@finos/legend-graph 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/StoreRelational_Exports.d.ts +1 -0
- package/lib/StoreRelational_Exports.d.ts.map +1 -1
- package/lib/StoreRelational_Exports.js +1 -0
- package/lib/StoreRelational_Exports.js.map +1 -1
- package/lib/graph/BasicModel.d.ts +12 -4
- package/lib/graph/BasicModel.d.ts.map +1 -1
- package/lib/graph/BasicModel.js +13 -5
- package/lib/graph/BasicModel.js.map +1 -1
- package/lib/graph/PureModel.d.ts +1 -1
- package/lib/graph/PureModel.d.ts.map +1 -1
- package/lib/graph/PureModel.js +7 -3
- package/lib/graph/PureModel.js.map +1 -1
- package/lib/graphManager/action/changeDetection/GraphObserverHelper.d.ts.map +1 -1
- package/lib/graphManager/action/changeDetection/GraphObserverHelper.js +1 -22
- package/lib/graphManager/action/changeDetection/GraphObserverHelper.js.map +1 -1
- package/lib/graphManager/action/changeDetection/ValueSpecificationObserver.d.ts.map +1 -1
- package/lib/graphManager/action/changeDetection/ValueSpecificationObserver.js +1 -11
- package/lib/graphManager/action/changeDetection/ValueSpecificationObserver.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/PackageableElement.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/PackageableElement.js.map +1 -1
- package/lib/models/metamodels/pure/valueSpecification/GraphFetchTree.d.ts +0 -3
- package/lib/models/metamodels/pure/valueSpecification/GraphFetchTree.d.ts.map +1 -1
- package/lib/models/metamodels/pure/valueSpecification/GraphFetchTree.js +0 -11
- package/lib/models/metamodels/pure/valueSpecification/GraphFetchTree.js.map +1 -1
- package/lib/models/metamodels/pure/valueSpecification/InstanceValue.d.ts +1 -5
- package/lib/models/metamodels/pure/valueSpecification/InstanceValue.d.ts.map +1 -1
- package/lib/models/metamodels/pure/valueSpecification/InstanceValue.js +0 -13
- package/lib/models/metamodels/pure/valueSpecification/InstanceValue.js.map +1 -1
- package/lib/models/protocols/pure/v1/V1_PureGraphManager.js +1 -1
- package/lib/models/protocols/pure/v1/V1_PureGraphManager.js.map +1 -1
- package/lib/package.json +2 -2
- package/package.json +5 -5
- package/src/StoreRelational_Exports.ts +1 -0
- package/src/graph/BasicModel.ts +17 -7
- package/src/graph/PureModel.ts +11 -4
- package/src/graphManager/action/changeDetection/GraphObserverHelper.ts +1 -31
- package/src/graphManager/action/changeDetection/ValueSpecificationObserver.ts +1 -11
- package/src/models/metamodels/pure/packageableElements/PackageableElement.ts +1 -3
- package/src/models/metamodels/pure/valueSpecification/GraphFetchTree.ts +6 -20
- package/src/models/metamodels/pure/valueSpecification/InstanceValue.ts +9 -25
- package/src/models/protocols/pure/v1/V1_PureGraphManager.ts +1 -1
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { computed, makeObservable, observable } from 'mobx';
|
|
18
18
|
import type { AlloySerializationConfigInstanceValue } from '../../../models/metamodels/pure/valueSpecification/AlloySerializationConfig';
|
|
19
19
|
import {
|
|
20
20
|
type RootGraphFetchTreeInstanceValue,
|
|
@@ -95,9 +95,6 @@ export const observe_PrimitiveInstanceValue = skipObserved(
|
|
|
95
95
|
makeObservable<PrimitiveInstanceValue>(metamodel, {
|
|
96
96
|
genericType: observable,
|
|
97
97
|
values: observable,
|
|
98
|
-
deleteValue: action,
|
|
99
|
-
addValue: action,
|
|
100
|
-
changeValue: action,
|
|
101
98
|
});
|
|
102
99
|
|
|
103
100
|
observe_GenericTypeReference(metamodel.genericType);
|
|
@@ -113,9 +110,6 @@ export const observe_EnumValueInstanceValue = skipObserved(
|
|
|
113
110
|
makeObservable<EnumValueInstanceValue>(metamodel, {
|
|
114
111
|
genericType: observable,
|
|
115
112
|
values: observable,
|
|
116
|
-
deleteValue: action,
|
|
117
|
-
addValue: action,
|
|
118
|
-
changeValue: action,
|
|
119
113
|
});
|
|
120
114
|
|
|
121
115
|
metamodel.values.forEach(observe_EnumValueReference);
|
|
@@ -296,7 +290,6 @@ function _observe_CollectionInstanceValue(
|
|
|
296
290
|
makeObservable<CollectionInstanceValue>(metamodel, {
|
|
297
291
|
genericType: observable,
|
|
298
292
|
values: observable,
|
|
299
|
-
changeValues: action,
|
|
300
293
|
});
|
|
301
294
|
|
|
302
295
|
metamodel.values.forEach((value) =>
|
|
@@ -331,8 +324,6 @@ function observe_Abstract_GraphFetchTree(
|
|
|
331
324
|
): GraphFetchTree {
|
|
332
325
|
makeObservable(metamodel, {
|
|
333
326
|
subTrees: observable,
|
|
334
|
-
addSubTree: action,
|
|
335
|
-
removeSubTree: action,
|
|
336
327
|
isEmpty: computed,
|
|
337
328
|
});
|
|
338
329
|
|
|
@@ -359,7 +350,6 @@ function _observe_PropertyGraphFetchTree(
|
|
|
359
350
|
alias: observable,
|
|
360
351
|
parameters: observable,
|
|
361
352
|
subType: observable,
|
|
362
|
-
withSubType: action,
|
|
363
353
|
});
|
|
364
354
|
|
|
365
355
|
observe_PropertyReference(metamodel.property);
|
|
@@ -66,9 +66,7 @@ export interface PackageableElementVisitor<T> {
|
|
|
66
66
|
visit_GenerationSpecification(element: GenerationSpecification): T;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
export abstract class
|
|
70
|
-
implements Hashable, Stubable
|
|
71
|
-
{
|
|
69
|
+
export abstract class PackageableElement implements Hashable, Stubable {
|
|
72
70
|
readonly uuid = uuid();
|
|
73
71
|
|
|
74
72
|
protected _isDeleted = false;
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { addUniqueEntry, deleteEntry } from '@finos/legend-shared';
|
|
18
17
|
import type { Class } from '../packageableElements/domain/Class';
|
|
19
18
|
import type { PropertyReference } from '../packageableElements/domain/PropertyReference';
|
|
20
19
|
import {
|
|
@@ -28,21 +27,15 @@ import type {
|
|
|
28
27
|
} from './ValueSpecification';
|
|
29
28
|
import { InstanceValue } from './InstanceValue';
|
|
30
29
|
|
|
31
|
-
export abstract class
|
|
30
|
+
export abstract class GraphFetchTree {
|
|
32
31
|
subTrees: GraphFetchTree[] = [];
|
|
33
32
|
|
|
34
33
|
get isEmpty(): boolean {
|
|
35
34
|
return !this.subTrees.length;
|
|
36
35
|
}
|
|
37
|
-
addSubTree(val: GraphFetchTree): void {
|
|
38
|
-
addUniqueEntry(this.subTrees, val);
|
|
39
|
-
}
|
|
40
|
-
removeSubTree(val: GraphFetchTree): void {
|
|
41
|
-
deleteEntry(this.subTrees, val);
|
|
42
|
-
}
|
|
43
36
|
}
|
|
44
37
|
|
|
45
|
-
export class
|
|
38
|
+
export class RootGraphFetchTree extends GraphFetchTree {
|
|
46
39
|
class: PackageableElementReference<Class>;
|
|
47
40
|
|
|
48
41
|
constructor(_class: PackageableElementReference<Class>) {
|
|
@@ -51,7 +44,7 @@ export class /*toCHECK*/ RootGraphFetchTree extends GraphFetchTree {
|
|
|
51
44
|
}
|
|
52
45
|
}
|
|
53
46
|
|
|
54
|
-
export class
|
|
47
|
+
export class PropertyGraphFetchTree extends GraphFetchTree {
|
|
55
48
|
property: PropertyReference;
|
|
56
49
|
alias?: string | undefined;
|
|
57
50
|
parameters: ValueSpecification[] = []; //TODO
|
|
@@ -67,20 +60,13 @@ export class /*toCHECK*/ PropertyGraphFetchTree extends GraphFetchTree {
|
|
|
67
60
|
val ??
|
|
68
61
|
OptionalPackageableElementExplicitReference.create<Class>(undefined);
|
|
69
62
|
}
|
|
70
|
-
|
|
71
|
-
withSubType(
|
|
72
|
-
val: OptionalPackageableElementReference<Class>,
|
|
73
|
-
): PropertyGraphFetchTree {
|
|
74
|
-
this.subType = val;
|
|
75
|
-
return this;
|
|
76
|
-
}
|
|
77
63
|
}
|
|
78
64
|
|
|
79
|
-
export abstract class
|
|
65
|
+
export abstract class GraphFetchTreeInstanceValue extends InstanceValue {
|
|
80
66
|
override values: GraphFetchTree[] = [];
|
|
81
67
|
}
|
|
82
68
|
|
|
83
|
-
export class
|
|
69
|
+
export class PropertyGraphFetchTreeInstanceValue extends GraphFetchTreeInstanceValue {
|
|
84
70
|
override values: PropertyGraphFetchTree[] = [];
|
|
85
71
|
|
|
86
72
|
override accept_ValueSpecificationVisitor<T>(
|
|
@@ -90,7 +76,7 @@ export class /*toCHECK*/ PropertyGraphFetchTreeInstanceValue extends GraphFetchT
|
|
|
90
76
|
}
|
|
91
77
|
}
|
|
92
78
|
|
|
93
|
-
export class
|
|
79
|
+
export class RootGraphFetchTreeInstanceValue extends GraphFetchTreeInstanceValue {
|
|
94
80
|
override values: RootGraphFetchTree[] = [];
|
|
95
81
|
|
|
96
82
|
override accept_ValueSpecificationVisitor<T>(
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import type { Pair } from '@finos/legend-shared';
|
|
18
18
|
import {
|
|
19
19
|
type ValueSpecificationVisitor,
|
|
20
20
|
ValueSpecification,
|
|
@@ -32,25 +32,9 @@ import type { Mapping } from '../packageableElements/mapping/Mapping';
|
|
|
32
32
|
* Also, right now, we haven't done the full build/transform flow for value specification
|
|
33
33
|
* we use the subtypes to make it easier to transform metamodel back into protocol.
|
|
34
34
|
*/
|
|
35
|
-
export class
|
|
35
|
+
export class InstanceValue extends ValueSpecification {
|
|
36
36
|
values: unknown[] = [];
|
|
37
37
|
|
|
38
|
-
deleteValue(val: unknown): void {
|
|
39
|
-
deleteEntry(this.values, val);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
addValue(val: unknown): void {
|
|
43
|
-
addUniqueEntry(this.values, val);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
changeValue(val: unknown, idx: number): void {
|
|
47
|
-
this.values[idx] = val;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
changeValues(val: unknown[]): void {
|
|
51
|
-
this.values = val;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
38
|
accept_ValueSpecificationVisitor<T>(
|
|
55
39
|
visitor: ValueSpecificationVisitor<T>,
|
|
56
40
|
): T {
|
|
@@ -58,7 +42,7 @@ export class /*toCHECK*/ InstanceValue extends ValueSpecification {
|
|
|
58
42
|
}
|
|
59
43
|
}
|
|
60
44
|
|
|
61
|
-
export class
|
|
45
|
+
export class PrimitiveInstanceValue extends InstanceValue {
|
|
62
46
|
override genericType: GenericTypeReference;
|
|
63
47
|
|
|
64
48
|
constructor(genericType: GenericTypeReference, multiplicity: Multiplicity) {
|
|
@@ -73,7 +57,7 @@ export class /*toCHECK*/ PrimitiveInstanceValue extends InstanceValue {
|
|
|
73
57
|
}
|
|
74
58
|
}
|
|
75
59
|
|
|
76
|
-
export class
|
|
60
|
+
export class EnumValueInstanceValue extends InstanceValue {
|
|
77
61
|
override values: EnumValueReference[] = [];
|
|
78
62
|
|
|
79
63
|
constructor(genericType: GenericTypeReference, multiplicity: Multiplicity) {
|
|
@@ -87,7 +71,7 @@ export class /*toCHECK*/ EnumValueInstanceValue extends InstanceValue {
|
|
|
87
71
|
}
|
|
88
72
|
}
|
|
89
73
|
|
|
90
|
-
export class
|
|
74
|
+
export class RuntimeInstanceValue extends InstanceValue {
|
|
91
75
|
override values: EngineRuntime[] = [];
|
|
92
76
|
|
|
93
77
|
override accept_ValueSpecificationVisitor<T>(
|
|
@@ -97,7 +81,7 @@ export class /*toCHECK*/ RuntimeInstanceValue extends InstanceValue {
|
|
|
97
81
|
}
|
|
98
82
|
}
|
|
99
83
|
|
|
100
|
-
export class
|
|
84
|
+
export class PairInstanceValue extends InstanceValue {
|
|
101
85
|
override values: Pair<unknown, unknown>[] = [];
|
|
102
86
|
|
|
103
87
|
override accept_ValueSpecificationVisitor<T>(
|
|
@@ -107,7 +91,7 @@ export class /*toCHECK*/ PairInstanceValue extends InstanceValue {
|
|
|
107
91
|
}
|
|
108
92
|
}
|
|
109
93
|
|
|
110
|
-
export class
|
|
94
|
+
export class MappingInstanceValue extends InstanceValue {
|
|
111
95
|
override values: PackageableElementReference<Mapping>[] = [];
|
|
112
96
|
|
|
113
97
|
override accept_ValueSpecificationVisitor<T>(
|
|
@@ -117,7 +101,7 @@ export class /*toCHECK*/ MappingInstanceValue extends InstanceValue {
|
|
|
117
101
|
}
|
|
118
102
|
}
|
|
119
103
|
|
|
120
|
-
export class
|
|
104
|
+
export class PureListInstanceValue extends InstanceValue {
|
|
121
105
|
override values: ValueSpecification[] = [];
|
|
122
106
|
|
|
123
107
|
override accept_ValueSpecificationVisitor<T>(
|
|
@@ -127,7 +111,7 @@ export class /*toCHECK*/ PureListInstanceValue extends InstanceValue {
|
|
|
127
111
|
}
|
|
128
112
|
}
|
|
129
113
|
|
|
130
|
-
export class
|
|
114
|
+
export class CollectionInstanceValue extends InstanceValue {
|
|
131
115
|
override values: ValueSpecification[] = [];
|
|
132
116
|
|
|
133
117
|
override accept_ValueSpecificationVisitor<T>(
|
|
@@ -552,7 +552,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
552
552
|
systemModel,
|
|
553
553
|
this.pluginManager.getPureGraphPlugins(),
|
|
554
554
|
);
|
|
555
|
-
graph.
|
|
555
|
+
graph.dependencyManager = dependencyManager;
|
|
556
556
|
|
|
557
557
|
try {
|
|
558
558
|
dependencyManager.initialize(dependencyEntitiesMap);
|