@finos/legend-graph 13.0.1 → 14.0.1

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.
Files changed (59) hide show
  1. package/lib/graph/Core_HashUtils.js +2 -2
  2. package/lib/graph/Core_HashUtils.js.map +1 -1
  3. package/lib/graph/helpers/DomainHelper.d.ts +4 -0
  4. package/lib/graph/helpers/DomainHelper.d.ts.map +1 -1
  5. package/lib/graph/helpers/DomainHelper.js +14 -2
  6. package/lib/graph/helpers/DomainHelper.js.map +1 -1
  7. package/lib/graph/metamodel/pure/Reference.d.ts +1 -0
  8. package/lib/graph/metamodel/pure/Reference.d.ts.map +1 -1
  9. package/lib/graph/metamodel/pure/Reference.js +2 -0
  10. package/lib/graph/metamodel/pure/Reference.js.map +1 -1
  11. package/lib/graph/metamodel/pure/packageableElements/domain/PropertyReference.js +2 -2
  12. package/lib/graph/metamodel/pure/packageableElements/domain/PropertyReference.js.map +1 -1
  13. package/lib/graph/metamodel/pure/packageableElements/domain/StereotypeReference.js +2 -2
  14. package/lib/graph/metamodel/pure/packageableElements/domain/StereotypeReference.js.map +1 -1
  15. package/lib/graph/metamodel/pure/packageableElements/domain/TagReference.js +2 -2
  16. package/lib/graph/metamodel/pure/packageableElements/domain/TagReference.js.map +1 -1
  17. package/lib/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.js +1 -1
  18. package/lib/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.js.map +1 -1
  19. package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataSectionReference.js +2 -2
  20. package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataSectionReference.js.map +1 -1
  21. package/lib/graph/metamodel/pure/packageableElements/store/relational/model/TableReference.js +3 -3
  22. package/lib/graph/metamodel/pure/packageableElements/store/relational/model/TableReference.js.map +1 -1
  23. package/lib/graph/metamodel/pure/packageableElements/store/relational/model/ViewReference.js +3 -3
  24. package/lib/graph/metamodel/pure/packageableElements/store/relational/model/ViewReference.js.map +1 -1
  25. package/lib/graphManager/AbstractPureGraphManager.d.ts +5 -5
  26. package/lib/graphManager/AbstractPureGraphManager.d.ts.map +1 -1
  27. package/lib/graphManager/AbstractPureGraphManager.js.map +1 -1
  28. package/lib/graphManager/GraphManagerState.d.ts +8 -13
  29. package/lib/graphManager/GraphManagerState.d.ts.map +1 -1
  30. package/lib/graphManager/GraphManagerState.js +8 -57
  31. package/lib/graphManager/GraphManagerState.js.map +1 -1
  32. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts +4 -4
  33. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  34. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js +26 -91
  35. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  36. package/lib/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.d.ts +1 -1
  37. package/lib/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.d.ts.map +1 -1
  38. package/lib/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.js +2 -2
  39. package/lib/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.js.map +1 -1
  40. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.d.ts +3 -1
  41. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.d.ts.map +1 -1
  42. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.js.map +1 -1
  43. package/lib/package.json +2 -2
  44. package/package.json +5 -5
  45. package/src/graph/Core_HashUtils.ts +2 -2
  46. package/src/graph/helpers/DomainHelper.ts +31 -0
  47. package/src/graph/metamodel/pure/Reference.ts +4 -0
  48. package/src/graph/metamodel/pure/packageableElements/domain/PropertyReference.ts +2 -2
  49. package/src/graph/metamodel/pure/packageableElements/domain/StereotypeReference.ts +2 -2
  50. package/src/graph/metamodel/pure/packageableElements/domain/TagReference.ts +2 -2
  51. package/src/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.ts +1 -1
  52. package/src/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataSectionReference.ts +2 -2
  53. package/src/graph/metamodel/pure/packageableElements/store/relational/model/TableReference.ts +3 -3
  54. package/src/graph/metamodel/pure/packageableElements/store/relational/model/ViewReference.ts +3 -3
  55. package/src/graphManager/AbstractPureGraphManager.ts +14 -20
  56. package/src/graphManager/GraphManagerState.ts +10 -81
  57. package/src/graphManager/protocol/pure/v1/V1_PureGraphManager.ts +36 -113
  58. package/src/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.ts +2 -2
  59. package/src/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.ts +3 -1
@@ -34,7 +34,7 @@ export declare class V1_ExecuteInput {
34
34
  }
35
35
  export declare class V1_TestDataGenerationExecutionInput extends V1_ExecuteInput {
36
36
  parameters: (string | number | boolean)[];
37
- hashStrings: boolean;
37
+ hashValues: boolean;
38
38
  static readonly serialization: SerializationFactory<V1_TestDataGenerationExecutionInput>;
39
39
  }
40
40
  //# sourceMappingURL=V1_ExecuteInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"V1_ExecuteInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,OAAO,EAAE,oBAAoB,EAAoB,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AACzF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uDAAuD,CAAC;AACxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6DAA6D,CAAC;AAC1G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AAOtF,qBAAa,eAAe;IAC1B,aAAa,EAAG,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,EAAG,YAAY,CAAC;IACxB,OAAO,EAAG,MAAM,CAAC;IACjB,KAAK,EAAG,uBAAuB,CAAC;IAChC,OAAO,EAAG,UAAU,CAAC;IACrB,OAAO,EAAG,sBAAsB,CAAC;IAEjC,MAAM,CAAC,QAAQ,CAAC,aAAa,wCAY3B;CACH;AAED,qBAAa,mCAAoC,SAAQ,eAAe;IACtE,UAAU,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,CAAM;IAC/C,WAAW,UAAS;IAEpB,gBAAyB,aAAa,4DAcpC;CACH"}
1
+ {"version":3,"file":"V1_ExecuteInput.d.ts","sourceRoot":"","sources":["../../../../../../../src/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,OAAO,EAAE,oBAAoB,EAAoB,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AACzF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uDAAuD,CAAC;AACxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6DAA6D,CAAC;AAC1G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AAOtF,qBAAa,eAAe;IAC1B,aAAa,EAAG,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,EAAG,YAAY,CAAC;IACxB,OAAO,EAAG,MAAM,CAAC;IACjB,KAAK,EAAG,uBAAuB,CAAC;IAChC,OAAO,EAAG,UAAU,CAAC;IACrB,OAAO,EAAG,sBAAsB,CAAC;IAEjC,MAAM,CAAC,QAAQ,CAAC,aAAa,wCAY3B;CACH;AAED,qBAAa,mCAAoC,SAAQ,eAAe;IACtE,UAAU,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,CAAM;IAC/C,UAAU,UAAS;IAEnB,gBAAyB,aAAa,4DAcpC;CACH"}
@@ -41,7 +41,7 @@ export class V1_ExecuteInput {
41
41
  }
42
42
  export class V1_TestDataGenerationExecutionInput extends V1_ExecuteInput {
43
43
  parameters = [];
44
- hashStrings = false;
44
+ hashValues = false;
45
45
  static serialization = new SerializationFactory(createModelSchema(V1_TestDataGenerationExecutionInput, {
46
46
  clientVersion: optional(primitive()),
47
47
  function: usingModelSchema(V1_rawLambdaModelSchema),
@@ -49,7 +49,7 @@ export class V1_TestDataGenerationExecutionInput extends V1_ExecuteInput {
49
49
  model: object(V1_PureModelContextData),
50
50
  runtime: custom((val) => V1_serializeRuntime(val), () => SKIP),
51
51
  context: usingModelSchema(V1_rawBaseExecutionContextModelSchema),
52
- hashStrings: primitive(),
52
+ hashValues: primitive(),
53
53
  parameters: list(primitive()),
54
54
  }));
55
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"V1_ExecuteInput.js","sourceRoot":"","sources":["../../../../../../../src/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,iBAAiB,EACjB,MAAM,EACN,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,IAAI,GACL,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAIzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yFAAyF,CAAC;AAC9H,OAAO,EACL,qCAAqC,EACrC,uBAAuB,GACxB,MAAM,uGAAuG,CAAC;AAE/G,MAAM,OAAO,eAAe;IAC1B,aAAa,CAAU;IACvB;;;;OAIG;IACH,QAAQ,CAAgB;IACxB,OAAO,CAAU;IACjB,KAAK,CAA2B;IAChC,OAAO,CAAc;IACrB,OAAO,CAA0B;IAEjC,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,eAAe,EAAE;QACjC,aAAa,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QACpC,QAAQ,EAAE,gBAAgB,CAAC,uBAAuB,CAAC;QACnD,OAAO,EAAE,SAAS,EAAE;QACpB,KAAK,EAAE,MAAM,CAAC,uBAAuB,CAAC;QACtC,OAAO,EAAE,MAAM,CACb,CAAC,GAAG,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,EACjC,GAAG,EAAE,CAAC,IAAI,CACX;QACD,OAAO,EAAE,gBAAgB,CAAC,qCAAqC,CAAC;KACjE,CAAC,CACH,CAAC;;AAGJ,MAAM,OAAO,mCAAoC,SAAQ,eAAe;IACtE,UAAU,GAAkC,EAAE,CAAC;IAC/C,WAAW,GAAG,KAAK,CAAC;IAEpB,MAAM,CAAmB,aAAa,GAAG,IAAI,oBAAoB,CAC/D,iBAAiB,CAAC,mCAAmC,EAAE;QACrD,aAAa,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QACpC,QAAQ,EAAE,gBAAgB,CAAC,uBAAuB,CAAC;QACnD,OAAO,EAAE,SAAS,EAAE;QACpB,KAAK,EAAE,MAAM,CAAC,uBAAuB,CAAC;QACtC,OAAO,EAAE,MAAM,CACb,CAAC,GAAG,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,EACjC,GAAG,EAAE,CAAC,IAAI,CACX;QACD,OAAO,EAAE,gBAAgB,CAAC,qCAAqC,CAAC;QAChE,WAAW,EAAE,SAAS,EAAE;QACxB,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;KAC9B,CAAC,CACH,CAAC"}
1
+ {"version":3,"file":"V1_ExecuteInput.js","sourceRoot":"","sources":["../../../../../../../src/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,iBAAiB,EACjB,MAAM,EACN,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,IAAI,GACL,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAIzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yFAAyF,CAAC;AAC9H,OAAO,EACL,qCAAqC,EACrC,uBAAuB,GACxB,MAAM,uGAAuG,CAAC;AAE/G,MAAM,OAAO,eAAe;IAC1B,aAAa,CAAU;IACvB;;;;OAIG;IACH,QAAQ,CAAgB;IACxB,OAAO,CAAU;IACjB,KAAK,CAA2B;IAChC,OAAO,CAAc;IACrB,OAAO,CAA0B;IAEjC,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,eAAe,EAAE;QACjC,aAAa,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QACpC,QAAQ,EAAE,gBAAgB,CAAC,uBAAuB,CAAC;QACnD,OAAO,EAAE,SAAS,EAAE;QACpB,KAAK,EAAE,MAAM,CAAC,uBAAuB,CAAC;QACtC,OAAO,EAAE,MAAM,CACb,CAAC,GAAG,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,EACjC,GAAG,EAAE,CAAC,IAAI,CACX;QACD,OAAO,EAAE,gBAAgB,CAAC,qCAAqC,CAAC;KACjE,CAAC,CACH,CAAC;;AAGJ,MAAM,OAAO,mCAAoC,SAAQ,eAAe;IACtE,UAAU,GAAkC,EAAE,CAAC;IAC/C,UAAU,GAAG,KAAK,CAAC;IAEnB,MAAM,CAAmB,aAAa,GAAG,IAAI,oBAAoB,CAC/D,iBAAiB,CAAC,mCAAmC,EAAE;QACrD,aAAa,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QACpC,QAAQ,EAAE,gBAAgB,CAAC,uBAAuB,CAAC;QACnD,OAAO,EAAE,SAAS,EAAE;QACpB,KAAK,EAAE,MAAM,CAAC,uBAAuB,CAAC;QACtC,OAAO,EAAE,MAAM,CACb,CAAC,GAAG,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,EACjC,GAAG,EAAE,CAAC,IAAI,CACX;QACD,OAAO,EAAE,gBAAgB,CAAC,qCAAqC,CAAC;QAChE,UAAU,EAAE,SAAS,EAAE;QACvB,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;KAC9B,CAAC,CACH,CAAC"}
@@ -14,9 +14,11 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { type Hashable } from '@finos/legend-shared';
17
+ declare type V1_FlatDataPropertyValue = boolean | string | number;
17
18
  export declare class V1_FlatDataProperty implements Hashable {
18
19
  name: string;
19
- value: (boolean | string | number)[];
20
+ value: V1_FlatDataPropertyValue[];
20
21
  get hashCode(): string;
21
22
  }
23
+ export {};
22
24
  //# sourceMappingURL=V1_FlatDataProperty.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"V1_FlatDataProperty.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,KAAK,QAAQ,EAAa,MAAM,sBAAsB,CAAC;AAEhE,qBAAa,mBAAoB,YAAW,QAAQ;IAClD,IAAI,EAAG,MAAM,CAAC;IACd,KAAK,EAAG,CAAC,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAEtC,IAAI,QAAQ,IAAI,MAAM,CAMrB;CACF"}
1
+ {"version":3,"file":"V1_FlatDataProperty.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,KAAK,QAAQ,EAAa,MAAM,sBAAsB,CAAC;AAEhE,aAAK,wBAAwB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1D,qBAAa,mBAAoB,YAAW,QAAQ;IAClD,IAAI,EAAG,MAAM,CAAC;IACd,KAAK,EAAG,wBAAwB,EAAE,CAAC;IAEnC,IAAI,QAAQ,IAAI,MAAM,CAMrB;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"V1_FlatDataProperty.js","sourceRoot":"","sources":["../../../../../../../../../../src/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AACzF,OAAO,EAAiB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,OAAO,mBAAmB;IAC9B,IAAI,CAAU;IACd,KAAK,CAAiC;IAEtC,IAAI,QAAQ;QACV,OAAO,SAAS,CAAC;YACf,mBAAmB,CAAC,kBAAkB;YACtC,IAAI,CAAC,IAAI;YACT,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;SACtB,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"V1_FlatDataProperty.js","sourceRoot":"","sources":["../../../../../../../../../../src/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AACzF,OAAO,EAAiB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAIhE,MAAM,OAAO,mBAAmB;IAC9B,IAAI,CAAU;IACd,KAAK,CAA8B;IAEnC,IAAI,QAAQ;QACV,OAAO,SAAS,CAAC;YACf,mBAAmB,CAAC,kBAAkB;YACtC,IAAI,CAAC,IAAI;YACT,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;SACtB,CAAC,CAAC;IACL,CAAC;CACF"}
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-graph",
3
- "version": "13.0.1",
3
+ "version": "14.0.1",
4
4
  "description": "Legend graph and graph manager",
5
5
  "keywords": [
6
6
  "legend",
@@ -51,7 +51,7 @@
51
51
  "@finos/legend-dev-utils": "workspace:*",
52
52
  "@jest/globals": "28.1.3",
53
53
  "cross-env": "7.0.3",
54
- "eslint": "8.21.0",
54
+ "eslint": "8.22.0",
55
55
  "jest": "28.1.3",
56
56
  "npm-run-all": "4.1.5",
57
57
  "rimraf": "3.0.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-graph",
3
- "version": "13.0.1",
3
+ "version": "14.0.1",
4
4
  "description": "Legend graph and graph manager",
5
5
  "keywords": [
6
6
  "legend",
@@ -39,8 +39,8 @@
39
39
  "test:watch": "jest --watch"
40
40
  },
41
41
  "dependencies": {
42
- "@finos/legend-shared": "5.0.2",
43
- "@finos/legend-storage": "3.0.2",
42
+ "@finos/legend-shared": "6.0.1",
43
+ "@finos/legend-storage": "3.0.5",
44
44
  "date-fns": "2.29.1",
45
45
  "mobx": "6.6.1",
46
46
  "mobx-react-lite": "3.4.0",
@@ -48,10 +48,10 @@
48
48
  "serializr": "2.0.5"
49
49
  },
50
50
  "devDependencies": {
51
- "@finos/legend-dev-utils": "2.0.8",
51
+ "@finos/legend-dev-utils": "2.0.11",
52
52
  "@jest/globals": "28.1.3",
53
53
  "cross-env": "7.0.3",
54
- "eslint": "8.21.0",
54
+ "eslint": "8.22.0",
55
55
  "jest": "28.1.3",
56
56
  "npm-run-all": "4.1.5",
57
57
  "rimraf": "3.0.2",
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { hashArray, hashObject, hashString } from '@finos/legend-shared';
17
+ import { hashArray, hashObject, hashValue } from '@finos/legend-shared';
18
18
  import { SOURCE_INFORMATION_PROPERTY_KEY_SUFFIX } from './MetaModelConst.js';
19
19
 
20
20
  /**
@@ -261,5 +261,5 @@ export const hashRawLambda = (
261
261
 
262
262
  export const hashElementPointer = (pointerType: string, path: string): string =>
263
263
  [CORE_HASH_STRUCTURE.PACKAGEABLE_ELEMENT_POINTER, pointerType, path]
264
- .map(hashString)
264
+ .map(hashValue)
265
265
  .join(',');
@@ -24,6 +24,7 @@ import {
24
24
  PRIMITIVE_TYPE,
25
25
  MULTIPLICITY_INFINITE,
26
26
  PURE_DEPRECATED_STEREOTYPE,
27
+ ROOT_PACKAGE_NAME,
27
28
  } from '../MetaModelConst.js';
28
29
  import { Package } from '../metamodel/pure/packageableElements/domain/Package.js';
29
30
  import type { PackageableElement } from '../metamodel/pure/packageableElements/PackageableElement.js';
@@ -36,6 +37,7 @@ import {
36
37
  guaranteeType,
37
38
  uniqBy,
38
39
  UnsupportedOperationError,
40
+ returnUndefOnError,
39
41
  } from '@finos/legend-shared';
40
42
  import { createPath } from '../MetaModelUtils.js';
41
43
  import type { BasicModel } from '../BasicModel.js';
@@ -215,6 +217,35 @@ export const getRawGenericType = <T extends Type>(
215
217
  clazz: Clazz<T>,
216
218
  ): T => guaranteeType<T>(genericType.rawType, clazz);
217
219
 
220
+ export const isElementReadOnly = (element: PackageableElement): boolean =>
221
+ returnUndefOnError(() => getElementRootPackage(element))?.name !==
222
+ ROOT_PACKAGE_NAME.MAIN;
223
+
224
+ export const isDependencyElement = (
225
+ element: PackageableElement,
226
+ ): element is PackageableElement =>
227
+ returnUndefOnError(() => getElementRootPackage(element))?.name ===
228
+ ROOT_PACKAGE_NAME.PROJECT_DEPENDENCY_ROOT;
229
+
230
+ export const isGeneratedElement = (
231
+ element: PackageableElement,
232
+ ): element is PackageableElement =>
233
+ returnUndefOnError(() => getElementRootPackage(element))?.name ===
234
+ ROOT_PACKAGE_NAME.MODEL_GENERATION;
235
+
236
+ export const isSystemElement = (
237
+ element: PackageableElement,
238
+ ): element is PackageableElement => {
239
+ const elementRootPackageName = returnUndefOnError(() =>
240
+ getElementRootPackage(element),
241
+ )?.name;
242
+ return (
243
+ element instanceof PrimitiveType ||
244
+ elementRootPackageName === ROOT_PACKAGE_NAME.SYSTEM ||
245
+ elementRootPackageName === ROOT_PACKAGE_NAME.CORE
246
+ );
247
+ };
248
+
218
249
  /**
219
250
  * Extract the type of temporal milestone the class is associated with (using stereotype).
220
251
  *
@@ -14,6 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import { uuid } from '@finos/legend-shared';
18
+
17
19
  /**
18
20
  * Reference implies pointer-based relationship in the protocol. This means that during graph-building,
19
21
  * we figure out/infer the reference using pointer of some form. Take the following example:
@@ -53,6 +55,8 @@
53
55
  * but for simplicity sake, we will just swap out to use new a new reference
54
56
  */
55
57
  export abstract class Reference {
58
+ readonly _UUID = uuid();
59
+
56
60
  abstract value: unknown;
57
61
  }
58
62
 
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { CORE_HASH_STRUCTURE } from '../../../../../graph/Core_HashUtils.js';
18
- import { hashString } from '@finos/legend-shared';
18
+ import { hashValue } from '@finos/legend-shared';
19
19
  import {
20
20
  PackageableElementExplicitReference,
21
21
  type PackageableElementReference,
@@ -48,7 +48,7 @@ export abstract class PropertyReference extends ReferenceWithOwner {
48
48
  this.value.name,
49
49
  this.ownerReference.valueForSerialization ?? '',
50
50
  ]
51
- .map(hashString)
51
+ .map(hashValue)
52
52
  .join(',');
53
53
  }
54
54
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { CORE_HASH_STRUCTURE } from '../../../../../graph/Core_HashUtils.js';
18
- import { hashString } from '@finos/legend-shared';
18
+ import { hashValue } from '@finos/legend-shared';
19
19
  import {
20
20
  PackageableElementExplicitReference,
21
21
  type PackageableElementReference,
@@ -44,7 +44,7 @@ export abstract class StereotypeReference extends ReferenceWithOwner {
44
44
  this.value.value,
45
45
  this.ownerReference.valueForSerialization ?? '',
46
46
  ]
47
- .map(hashString)
47
+ .map(hashValue)
48
48
  .join(',');
49
49
  }
50
50
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { CORE_HASH_STRUCTURE } from '../../../../../graph/Core_HashUtils.js';
18
- import { hashString } from '@finos/legend-shared';
18
+ import { hashValue } from '@finos/legend-shared';
19
19
  import {
20
20
  PackageableElementExplicitReference,
21
21
  type PackageableElementReference,
@@ -44,7 +44,7 @@ export abstract class TagReference extends ReferenceWithOwner {
44
44
  this.value.value,
45
45
  this.ownerReference.valueForSerialization ?? '',
46
46
  ]
47
- .map(hashString)
47
+ .map(hashValue)
48
48
  .join(',');
49
49
  }
50
50
  }
@@ -102,7 +102,7 @@ export abstract class PropertyMapping implements Hashable {
102
102
  return hashArray([
103
103
  CORE_HASH_STRUCTURE.PROPERTY_MAPPING,
104
104
  this.property.pointerHashCode,
105
- this.targetSetImplementation?.value.id.value ?? '',
105
+ this.targetSetImplementation?.valueForSerialization ?? '',
106
106
  this.localMappingProperty ?? '',
107
107
  ]);
108
108
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
18
- import { hashString } from '@finos/legend-shared';
18
+ import { hashValue } from '@finos/legend-shared';
19
19
  import {
20
20
  PackageableElementExplicitReference,
21
21
  type PackageableElementReference,
@@ -44,7 +44,7 @@ export abstract class FlatDataSectionReference extends ReferenceWithOwner {
44
44
  this.ownerReference.valueForSerialization ?? '',
45
45
  this.value.name,
46
46
  ]
47
- .map(hashString)
47
+ .map(hashValue)
48
48
  .join(',');
49
49
  }
50
50
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
18
- import { hashString } from '@finos/legend-shared';
18
+ import { hashValue } from '@finos/legend-shared';
19
19
  import {
20
20
  PackageableElementExplicitReference,
21
21
  type PackageableElementReference,
@@ -53,7 +53,7 @@ export abstract class TableReference extends NamedRelationalReference {
53
53
  this.value.schema.name,
54
54
  this.value.name,
55
55
  ]
56
- .map(hashString)
56
+ .map(hashValue)
57
57
  .join(',');
58
58
  }
59
59
 
@@ -64,7 +64,7 @@ export abstract class TableReference extends NamedRelationalReference {
64
64
  SELF_JOIN_SCHEMA_NAME,
65
65
  SELF_JOIN_TABLE_NAME,
66
66
  ]
67
- .map(hashString)
67
+ .map(hashValue)
68
68
  .join(',');
69
69
  }
70
70
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
18
- import { hashString } from '@finos/legend-shared';
18
+ import { hashValue } from '@finos/legend-shared';
19
19
  import {
20
20
  PackageableElementExplicitReference,
21
21
  type PackageableElementReference,
@@ -44,7 +44,7 @@ export abstract class ViewReference extends NamedRelationalReference {
44
44
  this.value.schema.name,
45
45
  this.value.name,
46
46
  ]
47
- .map(hashString)
47
+ .map(hashValue)
48
48
  .join(',');
49
49
  }
50
50
 
@@ -55,7 +55,7 @@ export abstract class ViewReference extends NamedRelationalReference {
55
55
  SELF_JOIN_SCHEMA_NAME,
56
56
  SELF_JOIN_TABLE_NAME,
57
57
  ]
58
- .map(hashString)
58
+ .map(hashValue)
59
59
  .join(',');
60
60
  }
61
61
  }
@@ -279,6 +279,16 @@ export abstract class AbstractPureGraphManager {
279
279
  rawValueSpecification: RawValueSpecification,
280
280
  ): Record<PropertyKey, unknown>;
281
281
 
282
+ // These methods are utilities that we could use to quickly construct compilable
283
+ // raw lambdas.
284
+ // NOTE: As of now, to simplify the code, these methods are implemented in quite a hacky way, as we create
285
+ // the lambdas from a templated JSON object. Formally, we could remove these method by building them
286
+ // in metamodel form and convert to raw form as these are relatively simple lambda to construct
287
+ abstract createGetAllRawLambda(_class: Class): RawLambda;
288
+ abstract createDefaultBasicRawLambda(options?: {
289
+ addDummyParameter?: boolean;
290
+ }): RawLambda;
291
+
282
292
  // ------------------------------------------- Generation -------------------------------------------
283
293
 
284
294
  abstract getAvailableGenerationConfigurationDescriptions(): Promise<
@@ -420,6 +430,10 @@ export abstract class AbstractPureGraphManager {
420
430
  input: RawMappingModelCoverageAnalysisResult,
421
431
  ): MappingModelCoverageAnalysisResult;
422
432
 
433
+ // ------------------------------------------- Change detection -------------------------------------------
434
+
435
+ abstract buildHashesIndex(entities: Entity[]): Promise<Map<string, string>>;
436
+
423
437
  // ------------------------------------------- Utilities -------------------------------------------
424
438
 
425
439
  abstract elementToEntity(
@@ -448,24 +462,4 @@ export abstract class AbstractPureGraphManager {
448
462
  );
449
463
  return graph;
450
464
  }
451
-
452
- // ------------------------------------------- Change detection -------------------------------------------
453
-
454
- abstract buildHashesIndex(entities: Entity[]): Promise<Map<string, string>>;
455
-
456
- // --------------------------------------------- HACKY ---------------------------------------------
457
- // As the name suggested, these methods are temporary hacks since we don't handle value-specification
458
- // structurally in Studio
459
-
460
- // Eventually, we could remove these method by building them in metamodel form and convert to raw form
461
- // as these are relatively simple lambda to construct
462
- abstract HACKY__createGetAllLambda(_class: Class): RawLambda;
463
- abstract HACKY__createDefaultBlankLambda(): RawLambda;
464
-
465
- // NOTE: after we refactor service, we probably can remove these methods
466
- // See https://github.com/finos/legend-studio/issues/1077
467
- abstract HACKY__createServiceTestAssertLambda(assertData: string): RawLambda;
468
- abstract HACKY__extractServiceTestAssertionData(
469
- query: RawLambda,
470
- ): string | undefined;
471
465
  }
@@ -14,12 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import {
18
- type Log,
19
- uniq,
20
- ActionState,
21
- assertErrorThrown,
22
- } from '@finos/legend-shared';
17
+ import { type Log, ActionState, assertErrorThrown } from '@finos/legend-shared';
23
18
  import { action, makeObservable, observable } from 'mobx';
24
19
  import { DependencyManager } from '../graph/DependencyManager.js';
25
20
  import {
@@ -33,21 +28,14 @@ import type {
33
28
  GraphBuilderOptions,
34
29
  } from '../graphManager/AbstractPureGraphManager.js';
35
30
  import type { GraphManagerPluginManager } from './GraphManagerPluginManager.js';
36
- import { getElementRootPackage } from '../graph/helpers/DomainHelper.js';
37
- import { getLeafSetImplementations } from '../graph/helpers/DSLMapping_Helper.js';
38
- import { ROOT_PACKAGE_NAME } from '../graph/MetaModelConst.js';
39
- import { AssociationImplementation } from '../graph/metamodel/pure/packageableElements/mapping/AssociationImplementation.js';
40
31
  import type { EnumerationMapping } from '../graph/metamodel/pure/packageableElements/mapping/EnumerationMapping.js';
41
32
  import { InstanceSetImplementation } from '../graph/metamodel/pure/packageableElements/mapping/InstanceSetImplementation.js';
42
- import { OperationSetImplementation } from '../graph/metamodel/pure/packageableElements/mapping/OperationSetImplementation.js';
43
- import type { PropertyMapping } from '../graph/metamodel/pure/packageableElements/mapping/PropertyMapping.js';
44
33
  import type { SetImplementation } from '../graph/metamodel/pure/packageableElements/mapping/SetImplementation.js';
45
34
  import type { PackageableElement } from '../graph/metamodel/pure/packageableElements/PackageableElement.js';
46
35
  import { EmbeddedFlatDataPropertyMapping } from '../graph/metamodel/pure/packageableElements/store/flatData/mapping/EmbeddedFlatDataPropertyMapping.js';
47
36
  import { EmbeddedRelationalInstanceSetImplementation } from '../graph/metamodel/pure/packageableElements/store/relational/mapping/EmbeddedRelationalInstanceSetImplementation.js';
48
- import { InlineEmbeddedRelationalInstanceSetImplementation } from '../graph/metamodel/pure/packageableElements/store/relational/mapping/InlineEmbeddedRelationalInstanceSetImplementation.js';
49
- import { OtherwiseEmbeddedRelationalInstanceSetImplementation } from '../graph/metamodel/pure/packageableElements/store/relational/mapping/OtherwiseEmbeddedRelationalInstanceSetImplementation.js';
50
37
  import { buildPureGraphManager } from '../graphManager/protocol/pure/PureGraphManagerBuilder.js';
38
+ import type { AssociationImplementation } from '../graph/metamodel/pure/packageableElements/mapping/AssociationImplementation.js';
51
39
 
52
40
  export class BasicGraphManagerState {
53
41
  pluginManager: GraphManagerPluginManager;
@@ -62,18 +50,17 @@ export class BasicGraphManagerState {
62
50
  }
63
51
 
64
52
  // -------------------------------------------------- UTILITIES -----------------------------------------------------
53
+
65
54
  /**
66
- * NOTE: Notice how this utility draws resources from all of metamodels and uses `instanceof` to classify behavior/response.
67
- * As such, methods in this utility cannot be placed in place they should belong to.
55
+ * Check if a mapping element is an instance set implementation
68
56
  *
69
- * For example: `getSetImplemetnationType` cannot be placed in `SetImplementation` because of circular module dependency
70
- * So this utility is born for such purpose, to avoid circular module dependency, and it should just be used for only that
71
- * Other utilities that really should reside in the domain-specific meta model should be placed in the meta model module.
57
+ * NOTE: This would account for embedded property mappings as well
58
+ * these are technically instance of `InstanceSetImplementation`
59
+ * but since unlike Pure, Typescript cannot do multiple inheritance
60
+ * we only can make embedded property mapping extends `PropertyMapping`
72
61
  *
73
- * NOTE: We expect the need for these methods will eventually go away as we complete modularization. But we need these
74
- * methods here so that we can load plugins.
62
+ * Potentially, we might need to apply an extension mechanism on this
75
63
  */
76
-
77
64
  isInstanceSetImplementation(
78
65
  setImplementation:
79
66
  | EnumerationMapping
@@ -87,67 +74,13 @@ export class BasicGraphManagerState {
87
74
  );
88
75
  }
89
76
 
90
- getInstanceSetImplementationPropertyMappings(
91
- instanceSetImpl: InstanceSetImplementation,
92
- ): PropertyMapping[] {
93
- if (
94
- instanceSetImpl instanceof
95
- InlineEmbeddedRelationalInstanceSetImplementation
96
- ) {
97
- return this.getMappingElementPropertyMappings(
98
- instanceSetImpl.inlineSetImplementation,
99
- );
100
- } else if (
101
- instanceSetImpl instanceof
102
- OtherwiseEmbeddedRelationalInstanceSetImplementation
103
- ) {
104
- // NOTE: for now we will grab all property mappings from the main otherwise embedded mapping and the otherwise property mapping.
105
- // In the future we may want to incorporate some smartness as to when the otherwise set implementation isinvoked.
106
- const otherwisePropertyMappings = instanceSetImpl.otherwisePropertyMapping
107
- .targetSetImplementation?.value
108
- ? this.getMappingElementPropertyMappings(
109
- instanceSetImpl.otherwisePropertyMapping.targetSetImplementation
110
- .value,
111
- )
112
- : [];
113
- return [
114
- ...instanceSetImpl.propertyMappings,
115
- ...otherwisePropertyMappings,
116
- ];
117
- }
118
- return instanceSetImpl.propertyMappings;
119
- }
120
-
121
- getMappingElementPropertyMappings(
122
- mappingElement:
123
- | EnumerationMapping
124
- | SetImplementation
125
- | AssociationImplementation,
126
- ): PropertyMapping[] {
127
- let mappedProperties: PropertyMapping[] = [];
128
- if (this.isInstanceSetImplementation(mappingElement)) {
129
- mappedProperties =
130
- this.getInstanceSetImplementationPropertyMappings(mappingElement);
131
- } else if (mappingElement instanceof AssociationImplementation) {
132
- mappedProperties = mappingElement.propertyMappings;
133
- } else if (mappingElement instanceof OperationSetImplementation) {
134
- mappedProperties = getLeafSetImplementations(mappingElement)
135
- .filter((me): me is InstanceSetImplementation =>
136
- this.isInstanceSetImplementation(me),
137
- )
138
- .map((si) => si.propertyMappings)
139
- .flat();
140
- }
141
- return uniq(mappedProperties);
142
- }
143
-
144
77
  /**
145
78
  * Filter the list of system elements that will be shown in selection options
146
79
  * to users. This is helpful to avoid overwhelming and confusing users in form
147
80
  * mode since many system elements are needed to build the graph, but should
148
81
  * not present at all as selection options in form mode.
149
82
  */
150
- filterSystemElementOptions<T extends PackageableElement>(
83
+ collectExposedSystemElements<T extends PackageableElement>(
151
84
  systemElements: T[],
152
85
  ): T[] {
153
86
  const allowedSystemElements = this.pluginManager
@@ -157,10 +90,6 @@ export class BasicGraphManagerState {
157
90
  allowedSystemElements.includes(element.path),
158
91
  );
159
92
  }
160
-
161
- isElementReadOnly(element: PackageableElement): boolean {
162
- return getElementRootPackage(element).name !== ROOT_PACKAGE_NAME.MAIN;
163
- }
164
93
  }
165
94
 
166
95
  export class GraphManagerState extends BasicGraphManagerState {