@finos/legend-graph 32.4.3 → 32.5.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.
Files changed (112) hide show
  1. package/lib/graph/Core_HashUtils.d.ts +1 -0
  2. package/lib/graph/Core_HashUtils.d.ts.map +1 -1
  3. package/lib/graph/Core_HashUtils.js +1 -0
  4. package/lib/graph/Core_HashUtils.js.map +1 -1
  5. package/lib/graph/helpers/STO_Relational_Helper.d.ts +2 -0
  6. package/lib/graph/helpers/STO_Relational_Helper.d.ts.map +1 -1
  7. package/lib/graph/helpers/STO_Relational_Helper.js +37 -0
  8. package/lib/graph/helpers/STO_Relational_Helper.js.map +1 -1
  9. package/lib/graph/metamodel/pure/packageableElements/relation/Accessor.d.ts +61 -0
  10. package/lib/graph/metamodel/pure/packageableElements/relation/Accessor.d.ts.map +1 -0
  11. package/lib/graph/metamodel/pure/packageableElements/relation/Accessor.js +91 -0
  12. package/lib/graph/metamodel/pure/packageableElements/relation/Accessor.js.map +1 -0
  13. package/lib/graph/metamodel/pure/packageableElements/service/Service.d.ts +1 -0
  14. package/lib/graph/metamodel/pure/packageableElements/service/Service.d.ts.map +1 -1
  15. package/lib/graph/metamodel/pure/packageableElements/service/Service.js +2 -0
  16. package/lib/graph/metamodel/pure/packageableElements/service/Service.js.map +1 -1
  17. package/lib/graph/metamodel/pure/valueSpecification/ValueSpecification.d.ts +2 -0
  18. package/lib/graph/metamodel/pure/valueSpecification/ValueSpecification.d.ts.map +1 -1
  19. package/lib/graph/metamodel/pure/valueSpecification/ValueSpecification.js.map +1 -1
  20. package/lib/graph-manager/AbstractPureGraphManager.d.ts +6 -0
  21. package/lib/graph-manager/AbstractPureGraphManager.d.ts.map +1 -1
  22. package/lib/graph-manager/AbstractPureGraphManager.js.map +1 -1
  23. package/lib/graph-manager/action/changeDetection/DSL_Service_ObserverHelper.d.ts.map +1 -1
  24. package/lib/graph-manager/action/changeDetection/DSL_Service_ObserverHelper.js +1 -0
  25. package/lib/graph-manager/action/changeDetection/DSL_Service_ObserverHelper.js.map +1 -1
  26. package/lib/graph-manager/action/changeDetection/ValueSpecificationObserver.d.ts.map +1 -1
  27. package/lib/graph-manager/action/changeDetection/ValueSpecificationObserver.js +3 -0
  28. package/lib/graph-manager/action/changeDetection/ValueSpecificationObserver.js.map +1 -1
  29. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts +6 -0
  30. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  31. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +13 -0
  32. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  33. package/lib/graph-manager/protocol/pure/v1/helpers/V1_AccessorHelper.d.ts +28 -0
  34. package/lib/graph-manager/protocol/pure/v1/helpers/V1_AccessorHelper.d.ts.map +1 -0
  35. package/lib/graph-manager/protocol/pure/v1/helpers/V1_AccessorHelper.js +104 -0
  36. package/lib/graph-manager/protocol/pure/v1/helpers/V1_AccessorHelper.js.map +1 -0
  37. package/lib/graph-manager/protocol/pure/v1/helpers/V1_ValueSpecificationObserver.d.ts +1 -1
  38. package/lib/graph-manager/protocol/pure/v1/helpers/V1_ValueSpecificationObserver.d.ts.map +1 -1
  39. package/lib/graph-manager/protocol/pure/v1/helpers/V1_ValueSpecificationObserver.js +3 -2
  40. package/lib/graph-manager/protocol/pure/v1/helpers/V1_ValueSpecificationObserver.js.map +1 -1
  41. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.d.ts +11 -9
  42. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.d.ts.map +1 -1
  43. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.js +16 -0
  44. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.js.map +1 -1
  45. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/service/V1_Service.d.ts +1 -0
  46. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/service/V1_Service.d.ts.map +1 -1
  47. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/service/V1_Service.js +2 -0
  48. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/service/V1_Service.js.map +1 -1
  49. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/classInstance/relation/V1_ColSpec.d.ts +3 -3
  50. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/classInstance/relation/V1_ColSpec.d.ts.map +1 -1
  51. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/classInstance/relation/V1_ColSpec.js.map +1 -1
  52. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/classInstance/relation/V1_RelationStoreAccessor.d.ts +14 -4
  53. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/classInstance/relation/V1_RelationStoreAccessor.d.ts.map +1 -1
  54. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/classInstance/relation/V1_RelationStoreAccessor.js +21 -4
  55. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/classInstance/relation/V1_RelationStoreAccessor.js.map +1 -1
  56. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.d.ts.map +1 -1
  57. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.js +6 -5
  58. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.js.map +1 -1
  59. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.d.ts.map +1 -1
  60. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js +30 -2
  61. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js.map +1 -1
  62. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
  63. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +1 -0
  64. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
  65. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.d.ts.map +1 -1
  66. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js +67 -1
  67. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js.map +1 -1
  68. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.d.ts +5 -1
  69. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.d.ts.map +1 -1
  70. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.js +22 -2
  71. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.js.map +1 -1
  72. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.d.ts.map +1 -1
  73. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.js +5 -4
  74. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.js.map +1 -1
  75. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TypeSerializationHelper.d.ts +2 -1
  76. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TypeSerializationHelper.d.ts.map +1 -1
  77. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TypeSerializationHelper.js +1 -1
  78. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TypeSerializationHelper.js.map +1 -1
  79. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.d.ts.map +1 -1
  80. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.js +16 -4
  81. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.js.map +1 -1
  82. package/lib/index.d.ts +5 -2
  83. package/lib/index.d.ts.map +1 -1
  84. package/lib/index.js +5 -2
  85. package/lib/index.js.map +1 -1
  86. package/lib/package.json +1 -1
  87. package/package.json +1 -1
  88. package/src/graph/Core_HashUtils.ts +1 -0
  89. package/src/graph/helpers/STO_Relational_Helper.ts +44 -0
  90. package/src/graph/metamodel/pure/packageableElements/relation/Accessor.ts +133 -0
  91. package/src/graph/metamodel/pure/packageableElements/service/Service.ts +2 -0
  92. package/src/graph/metamodel/pure/valueSpecification/ValueSpecification.ts +4 -0
  93. package/src/graph-manager/AbstractPureGraphManager.ts +13 -0
  94. package/src/graph-manager/action/changeDetection/DSL_Service_ObserverHelper.ts +1 -0
  95. package/src/graph-manager/action/changeDetection/ValueSpecificationObserver.ts +6 -0
  96. package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +31 -0
  97. package/src/graph-manager/protocol/pure/v1/helpers/V1_AccessorHelper.ts +156 -0
  98. package/src/graph-manager/protocol/pure/v1/helpers/V1_ValueSpecificationObserver.ts +3 -3
  99. package/src/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.ts +15 -11
  100. package/src/graph-manager/protocol/pure/v1/model/packageableElements/service/V1_Service.ts +2 -0
  101. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/classInstance/relation/V1_ColSpec.ts +3 -3
  102. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/classInstance/relation/V1_RelationStoreAccessor.ts +29 -4
  103. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.ts +8 -7
  104. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.ts +49 -2
  105. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +1 -0
  106. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.ts +129 -0
  107. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.ts +51 -1
  108. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.ts +5 -4
  109. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TypeSerializationHelper.ts +1 -1
  110. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.ts +29 -3
  111. package/src/index.ts +18 -2
  112. package/tsconfig.json +2 -0
@@ -30,18 +30,22 @@ export class V1_IngestDefinition extends V1_INTERNAL__UnknownPackageableElement
30
30
  return visitor.visit_IngestDefinition(this);
31
31
  }
32
32
  }
33
- export interface V1_IngestDataset {
34
- name: string;
35
- primaryKey: string[];
36
- source: {
37
- _type: string;
38
- schema: {
39
- _type: string;
40
- columns: V1_RelationTypeColumn[];
41
- };
42
- };
33
+ export class V1_IngestDatasetSchema {
34
+ _type!: string;
35
+ columns: V1_RelationTypeColumn[] = [];
43
36
  }
44
37
 
45
- export interface V1_IngestDefinitionContent {
38
+ export class V1_IngestDatasetSource {
39
+ _type!: string;
40
+ schema!: V1_IngestDatasetSchema;
41
+ }
42
+
43
+ export class V1_IngestDataset {
44
+ name!: string;
45
+ primaryKey: string[] = [];
46
+ source!: V1_IngestDatasetSource;
47
+ }
48
+
49
+ export class V1_IngestDefinitionContent {
46
50
  datasets?: V1_IngestDataset[];
47
51
  }
@@ -35,6 +35,7 @@ export class V1_Service extends V1_PackageableElement implements Hashable {
35
35
  owners: string[] = [];
36
36
  ownership?: V1_ServiceOwnership | undefined;
37
37
  documentation!: string;
38
+ title?: string | undefined;
38
39
  mcpServer?: string | undefined;
39
40
  autoActivateUpdates = true;
40
41
  execution!: V1_ServiceExecution;
@@ -56,6 +57,7 @@ export class V1_Service extends V1_PackageableElement implements Hashable {
56
57
  this.execution,
57
58
  this.test ?? '',
58
59
  this.mcpServer ?? '',
60
+ this.title ?? '',
59
61
  hashArray(this.testSuites),
60
62
  hashArray(this.postValidations),
61
63
  hashArray(this.taggedValues),
@@ -14,11 +14,11 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import type { V1_Lambda } from '../../V1_Lambda.js';
17
+ import type { V1_ValueSpecification } from '../../../V1_ValueSpecification.js';
18
18
 
19
19
  export class V1_ColSpec {
20
20
  name!: string;
21
21
  type?: string | undefined;
22
- function1?: V1_Lambda | undefined;
23
- function2?: V1_Lambda | undefined;
22
+ function1?: V1_ValueSpecification | undefined;
23
+ function2?: V1_ValueSpecification | undefined;
24
24
  }
@@ -14,16 +14,41 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- export class V1_RelationStoreAccessor {
17
+ import { V1_ClassInstanceType } from '../../../../../transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.js';
18
+
19
+ export abstract class V1_Accessor {
18
20
  path: string[] = [];
21
+
22
+ abstract INSTANCE_TYPE: V1_ClassInstanceType;
23
+ }
24
+
25
+ export class V1_RelationStoreAccessor extends V1_Accessor {
19
26
  metadata?: boolean;
27
+
28
+ get INSTANCE_TYPE(): V1_ClassInstanceType {
29
+ return V1_ClassInstanceType.RELATION_STORE_ACCESSOR;
30
+ }
20
31
  }
21
32
 
22
- export class V1_DataProductAccessor {
23
- path: string[] = [];
33
+ export class V1_DataProductAccessor extends V1_Accessor {
24
34
  parameters: string[] = [];
35
+ get INSTANCE_TYPE(): V1_ClassInstanceType {
36
+ return V1_ClassInstanceType.DATA_PRODUCT_ACCESSOR;
37
+ }
25
38
  }
26
39
 
27
- export class V1_SQLAccessor {
40
+ export class V1_IngestDefinitionAccessor extends V1_Accessor {
41
+ metadata = false;
42
+
43
+ get INSTANCE_TYPE(): V1_ClassInstanceType {
44
+ return V1_ClassInstanceType.INGEST_ACCESSOR;
45
+ }
46
+ }
47
+
48
+ export class V1_SQLAccessor extends V1_Accessor {
28
49
  sql!: string;
50
+
51
+ get INSTANCE_TYPE(): V1_ClassInstanceType {
52
+ return V1_ClassInstanceType.SQL_ACCESSOR;
53
+ }
29
54
  }
@@ -329,25 +329,26 @@ export const V1_transformService = (
329
329
  ): V1_Service => {
330
330
  const service = new V1_Service();
331
331
  V1_initPackageableElement(service, element);
332
- service.stereotypes = element.stereotypes.map(V1_transformStereotype);
333
- service.taggedValues = element.taggedValues.map(V1_transformTaggedValue);
334
332
  service.autoActivateUpdates = element.autoActivateUpdates;
335
- service.mcpServer = element.mcpServer;
336
333
  service.documentation = element.documentation;
337
334
  service.execution = transformServiceExecution(element.execution, context);
335
+ service.mcpServer = element.mcpServer;
336
+ service.owners = element.owners;
338
337
  if (element.ownership) {
339
338
  service.ownership = transformServiceOwnership(element.ownership);
340
339
  }
341
- service.owners = element.owners;
342
340
  service.pattern = element.pattern;
341
+ service.postValidations = element.postValidations.map((postValidation) =>
342
+ V1_transformPostValidation(postValidation, context),
343
+ );
344
+ service.stereotypes = element.stereotypes.map(V1_transformStereotype);
345
+ service.taggedValues = element.taggedValues.map(V1_transformTaggedValue);
343
346
  if (element.test) {
344
347
  service.test = transformLegacyServiceTest(element.test, context);
345
348
  }
346
349
  service.testSuites = element.tests.map((testSuite) =>
347
350
  V1_transformTestSuite(testSuite, context),
348
351
  );
349
- service.postValidations = element.postValidations.map((postValidation) =>
350
- V1_transformPostValidation(postValidation, context),
351
- );
352
+ service.title = element.title;
352
353
  return service;
353
354
  };
@@ -94,6 +94,39 @@ import { V1_ColSpecArray } from '../../../model/valueSpecification/raw/classInst
94
94
  import { V1_ColSpec } from '../../../model/valueSpecification/raw/classInstance/relation/V1_ColSpec.js';
95
95
  import { RelationColumn } from '../../../../../../../graph/metamodel/pure/packageableElements/relation/RelationType.js';
96
96
  import { V1_createGenericTypeWithElementPath } from '../../../helpers/V1_DomainHelper.js';
97
+ import {
98
+ type Accessor,
99
+ type AccessorInstanceValue,
100
+ DataProductAccessor,
101
+ IngestionAccessor,
102
+ RelationalStoreAccessor,
103
+ } from '../../../../../../../graph/metamodel/pure/packageableElements/relation/Accessor.js';
104
+ import {
105
+ type V1_Accessor,
106
+ V1_DataProductAccessor,
107
+ V1_IngestDefinitionAccessor,
108
+ V1_RelationStoreAccessor,
109
+ } from '../../../model/valueSpecification/raw/classInstance/relation/V1_RelationStoreAccessor.js';
110
+
111
+ const transformAccessor = (accessor: Accessor): V1_Accessor => {
112
+ if (accessor instanceof DataProductAccessor) {
113
+ const v1Accessor = new V1_DataProductAccessor();
114
+ v1Accessor.path = accessor.path;
115
+ return v1Accessor;
116
+ } else if (accessor instanceof IngestionAccessor) {
117
+ const v1Accessor = new V1_IngestDefinitionAccessor();
118
+ v1Accessor.path = accessor.path;
119
+ return v1Accessor;
120
+ } else if (accessor instanceof RelationalStoreAccessor) {
121
+ const v1Accessor = new V1_RelationStoreAccessor();
122
+ v1Accessor.path = accessor.path;
123
+ return v1Accessor;
124
+ }
125
+ throw new UnsupportedOperationError(
126
+ `Can't transform accessor: unsupported accessor type`,
127
+ accessor,
128
+ );
129
+ };
97
130
 
98
131
  class V1_ValueSpecificationTransformer
99
132
  implements ValueSpecificationVisitor<V1_ValueSpecification>
@@ -254,6 +287,20 @@ class V1_ValueSpecificationTransformer
254
287
  );
255
288
  }
256
289
 
290
+ visit_AccessorInstanceValue(
291
+ valueAccessorInstanceValue: AccessorInstanceValue,
292
+ ): V1_ValueSpecification {
293
+ const accessor = guaranteeNonNullable(
294
+ valueAccessorInstanceValue.values[0],
295
+ 'Accessor required in AccessorInstanceValue',
296
+ );
297
+ const v1Accessor = transformAccessor(accessor);
298
+ const classInstance = new V1_ClassInstance();
299
+ classInstance.type = v1Accessor.INSTANCE_TYPE;
300
+ classInstance.value = v1Accessor;
301
+ return classInstance;
302
+ }
303
+
257
304
  visit_CollectionInstanceValue(
258
305
  valueSpecification: CollectionInstanceValue,
259
306
  ): V1_ValueSpecification {
@@ -428,10 +475,10 @@ class V1_ValueSpecificationTransformer
428
475
  ),
429
476
  );
430
477
  if (fun1) {
431
- colProtocol.function1 = guaranteeType(fun1, V1_Lambda);
478
+ colProtocol.function1 = fun1;
432
479
  }
433
480
  if (fun2) {
434
- colProtocol.function2 = guaranteeType(fun2, V1_Lambda);
481
+ colProtocol.function2 = fun2;
435
482
  }
436
483
  return colProtocol;
437
484
  });
@@ -619,6 +619,7 @@ export class V1_ElementSecondPassBuilder
619
619
  .map((taggedValue) => V1_buildTaggedValue(taggedValue, this.context))
620
620
  .filter(isNonNullable);
621
621
  service.pattern = element.pattern;
622
+ service.title = element.title;
622
623
  service.owners = element.owners.slice();
623
624
  service.documentation = element.documentation;
624
625
  service.autoActivateUpdates = element.autoActivateUpdates;
@@ -116,9 +116,21 @@ import {
116
116
  } from '../../../../helpers/V1_DomainHelper.js';
117
117
  import {
118
118
  ColSpec,
119
+ ColSpecArray,
120
+ ColSpecArrayInstance,
119
121
  ColSpecInstanceValue,
120
122
  } from '../../../../../../../../graph/metamodel/pure/valueSpecification/RelationValueSpecification.js';
121
123
  import { V1_ColSpec } from '../../../../model/valueSpecification/raw/classInstance/relation/V1_ColSpec.js';
124
+ import { V1_ColSpecArray } from '../../../../model/valueSpecification/raw/classInstance/relation/V1_ColSpecArray.js';
125
+ import {
126
+ V1_RelationStoreAccessor,
127
+ V1_IngestDefinitionAccessor,
128
+ V1_DataProductAccessor,
129
+ } from '../../../../model/valueSpecification/raw/classInstance/relation/V1_RelationStoreAccessor.js';
130
+ import { AccessorInstanceValue } from '../../../../../../../../graph/metamodel/pure/packageableElements/relation/Accessor.js';
131
+ import { V1_createAccessorFromPackageableElement } from '../../../../helpers/V1_AccessorHelper.js';
132
+ import { Database } from '../../../../../../../../graph/metamodel/pure/packageableElements/store/relational/model/Database.js';
133
+ import { IngestDefinition } from '../../../../../../../../graph/metamodel/pure/packageableElements/ingest/IngestDefinition.js';
122
134
 
123
135
  const buildPrimtiveInstanceValue = (
124
136
  type: PRIMITIVE_TYPE,
@@ -471,9 +483,125 @@ export class V1_ValueSpecificationBuilder
471
483
  const protocol = guaranteeType(valueSpecification.value, V1_ColSpec);
472
484
  const value = new ColSpec();
473
485
  value.name = protocol.name;
486
+ value.type = protocol.type;
487
+ value.function1 = protocol.function1
488
+ ? protocol.function1.accept_ValueSpecificationVisitor(
489
+ new V1_ValueSpecificationBuilder(
490
+ this.context,
491
+ this.processingContext,
492
+ this.openVariables,
493
+ ),
494
+ )
495
+ : undefined;
496
+ value.function2 = protocol.function2
497
+ ? protocol.function2.accept_ValueSpecificationVisitor(
498
+ new V1_ValueSpecificationBuilder(
499
+ this.context,
500
+ this.processingContext,
501
+ this.openVariables,
502
+ ),
503
+ )
504
+ : undefined;
474
505
  instanceValue.values = [value];
475
506
  return instanceValue;
476
507
  }
508
+ case V1_ClassInstanceType.COL_SPEC_ARRAY: {
509
+ const instanceValue = new ColSpecArrayInstance(
510
+ Multiplicity.ONE,
511
+ undefined,
512
+ );
513
+ const protocol = guaranteeType(
514
+ valueSpecification.value,
515
+ V1_ColSpecArray,
516
+ );
517
+ const value = new ColSpecArray();
518
+ value.colSpecs = protocol.colSpecs.map((colSpec) => {
519
+ const colSpecInstance = new ColSpec();
520
+ colSpecInstance.name = colSpec.name;
521
+ colSpecInstance.type = colSpec.type;
522
+ colSpecInstance.function1 = colSpec.function1
523
+ ? colSpec.function1.accept_ValueSpecificationVisitor(
524
+ new V1_ValueSpecificationBuilder(
525
+ this.context,
526
+ this.processingContext,
527
+ this.openVariables,
528
+ ),
529
+ )
530
+ : undefined;
531
+ colSpecInstance.function2 = colSpec.function2
532
+ ? colSpec.function2.accept_ValueSpecificationVisitor(
533
+ new V1_ValueSpecificationBuilder(
534
+ this.context,
535
+ this.processingContext,
536
+ this.openVariables,
537
+ ),
538
+ )
539
+ : undefined;
540
+ return colSpecInstance;
541
+ });
542
+ instanceValue.values = [value];
543
+ return instanceValue;
544
+ }
545
+ case V1_ClassInstanceType.RELATION_STORE_ACCESSOR: {
546
+ const protocol = guaranteeType(
547
+ valueSpecification.value,
548
+ V1_RelationStoreAccessor,
549
+ );
550
+ const dbPath = guaranteeNonNullable(protocol.path[0]);
551
+ const schemaName = protocol.path[1];
552
+ const tableName = protocol.path[2];
553
+ const db = guaranteeType(
554
+ this.context.resolveElement(dbPath, false).value,
555
+ Database,
556
+ );
557
+ const accessor = guaranteeNonNullable(
558
+ V1_createAccessorFromPackageableElement(db, this.context, {
559
+ schemaName,
560
+ tableName,
561
+ }),
562
+ `Can't build accessor for database '${dbPath}'`,
563
+ );
564
+ const accessorInstanceValue = new AccessorInstanceValue();
565
+ accessorInstanceValue.values = [accessor];
566
+ accessorInstanceValue.genericType = GenericTypeExplicitReference.create(
567
+ new GenericType(accessor.relationType),
568
+ );
569
+ return accessorInstanceValue;
570
+ }
571
+ case V1_ClassInstanceType.INGEST_ACCESSOR: {
572
+ const protocol = guaranteeType(
573
+ valueSpecification.value,
574
+ V1_IngestDefinitionAccessor,
575
+ );
576
+ const ingestPath = guaranteeNonNullable(protocol.path[0]);
577
+ const datasetName = protocol.path[1];
578
+ const ingestDef = guaranteeType(
579
+ this.context.resolveElement(ingestPath, false).value,
580
+ IngestDefinition,
581
+ );
582
+ const accessor = guaranteeNonNullable(
583
+ V1_createAccessorFromPackageableElement(ingestDef, this.context, {
584
+ tableName: datasetName,
585
+ }),
586
+ `Can't build accessor for ingest definition '${ingestPath}'`,
587
+ );
588
+ const accessorInstanceValue = new AccessorInstanceValue();
589
+ accessorInstanceValue.values = [accessor];
590
+ accessorInstanceValue.genericType = GenericTypeExplicitReference.create(
591
+ new GenericType(accessor.relationType),
592
+ );
593
+ return accessorInstanceValue;
594
+ }
595
+ case V1_ClassInstanceType.DATA_PRODUCT_ACCESSOR: {
596
+ const protocol = guaranteeType(
597
+ valueSpecification.value,
598
+ V1_DataProductAccessor,
599
+ );
600
+ const _path = protocol.path;
601
+ throw new UnsupportedOperationError(
602
+ `Can't build accessor for data product with path '${_path.join('.')}': data product accessor building is not yet supported`,
603
+ );
604
+ }
477
605
  default: {
478
606
  const builders = this.context.extensions.plugins.flatMap(
479
607
  (plugin) => plugin.V1_getExtraClassInstanceValueBuilders?.() ?? [],
@@ -609,6 +737,7 @@ export function V1_processProperty(
609
737
  const _funcExp = new FunctionExpression(col.name);
610
738
  _funcExp.func = col;
611
739
  _funcExp.parametersValues = processedParameters;
740
+ _funcExp.genericType = col.genericType;
612
741
  return _funcExp;
613
742
  }
614
743
  throw new UnsupportedOperationError(
@@ -20,7 +20,13 @@ import {
20
20
  usingModelSchema,
21
21
  type PlainObject,
22
22
  } from '@finos/legend-shared';
23
- import { V1_IngestDefinition } from '../../../model/packageableElements/ingest/V1_IngestDefinition.js';
23
+ import {
24
+ V1_IngestDataset,
25
+ V1_IngestDatasetSchema,
26
+ V1_IngestDatasetSource,
27
+ V1_IngestDefinition,
28
+ V1_IngestDefinitionContent,
29
+ } from '../../../model/packageableElements/ingest/V1_IngestDefinition.js';
24
30
  import type { V1_PackageableElement } from '../../../model/packageableElements/V1_PackageableElement.js';
25
31
  import type { V1_AppDirNode } from '../../../lakehouse/entitlements/V1_CoreEntitlements.js';
26
32
  import { V1_AppDirNodeModelSchema } from './lakehouse/V1_CoreEntitlementsSerializationHelper.js';
@@ -28,9 +34,12 @@ import {
28
34
  createModelSchema,
29
35
  custom,
30
36
  deserialize,
37
+ list,
38
+ optional,
31
39
  primitive,
32
40
  serialize,
33
41
  } from 'serializr';
42
+ import { V1_relationTypeColumnModelSchema } from './V1_TypeSerializationHelper.js';
34
43
  import {
35
44
  type V1_IngestEnvironment,
36
45
  V1_AWSSnowflakeIngestEnvironment,
@@ -167,3 +176,44 @@ export const V1_deserializeProducerEnvironment = (
167
176
  throw new Error(`Unknown V1_ProducerEnvironment type: ${json._type}`);
168
177
  }
169
178
  };
179
+
180
+ // --------------------------------------------- Ingest Dataset Content ---------------------------------------------
181
+
182
+ const V1_IngestDatasetSchemaModelSchema = createModelSchema(
183
+ V1_IngestDatasetSchema,
184
+ {
185
+ _type: primitive(),
186
+ columns: list(usingModelSchema(V1_relationTypeColumnModelSchema)),
187
+ },
188
+ );
189
+
190
+ const V1_IngestDatasetSourceModelSchema = createModelSchema(
191
+ V1_IngestDatasetSource,
192
+ {
193
+ _type: primitive(),
194
+ schema: usingModelSchema(V1_IngestDatasetSchemaModelSchema),
195
+ },
196
+ );
197
+
198
+ export const V1_IngestDatasetModelSchema = createModelSchema(V1_IngestDataset, {
199
+ name: primitive(),
200
+ primaryKey: list(primitive()),
201
+ source: usingModelSchema(V1_IngestDatasetSourceModelSchema),
202
+ });
203
+
204
+ export const V1_IngestDefinitionContentModelSchema = createModelSchema(
205
+ V1_IngestDefinitionContent,
206
+ {
207
+ datasets: optional(list(usingModelSchema(V1_IngestDatasetModelSchema))),
208
+ },
209
+ );
210
+
211
+ export const V1_deserializeIngestDefinitionContent = (
212
+ json: PlainObject<V1_IngestDefinitionContent>,
213
+ ): V1_IngestDefinitionContent =>
214
+ deserialize(V1_IngestDefinitionContentModelSchema, json);
215
+
216
+ export const V1_serializeIngestDefinitionContent = (
217
+ content: V1_IngestDefinitionContent,
218
+ ): PlainObject<V1_IngestDefinitionContent> =>
219
+ serialize(V1_IngestDefinitionContentModelSchema, content);
@@ -355,6 +355,7 @@ export const V1_serviceModelSchema = (
355
355
  (val) => V1_serializeServiceExecution(val),
356
356
  (val) => V1_deserializeServiceExecution(val),
357
357
  ),
358
+ mcpServer: optional(primitive()),
358
359
  name: primitive(),
359
360
  owners: list(primitive()),
360
361
  ownership: optionalCustom(
@@ -363,6 +364,9 @@ export const V1_serviceModelSchema = (
363
364
  ),
364
365
  package: primitive(),
365
366
  pattern: primitive(),
367
+ postValidations: customListWithSchema(V1_servicePostValidationModelSchema, {
368
+ INTERNAL__forceReturnEmptyInTest: true,
369
+ }),
366
370
  stereotypes: customListWithSchema(V1_stereotypePtrModelSchema, {
367
371
  INTERNAL__forceReturnEmptyInTest: true,
368
372
  }),
@@ -380,8 +384,5 @@ export const V1_serviceModelSchema = (
380
384
  INTERNAL__forceReturnEmptyInTest: true,
381
385
  },
382
386
  ),
383
- postValidations: customListWithSchema(V1_servicePostValidationModelSchema, {
384
- INTERNAL__forceReturnEmptyInTest: true,
385
- }),
386
- mcpServer: optional(primitive()),
387
+ title: optional(primitive()),
387
388
  });
@@ -91,7 +91,7 @@ const packageableTypeModelSchema = createModelSchema(V1_PackageableType, {
91
91
  fullPath: primitive(),
92
92
  });
93
93
 
94
- const V1_relationTypeColumnModelSchema = createModelSchema(
94
+ export const V1_relationTypeColumnModelSchema = createModelSchema(
95
95
  V1_RelationTypeColumn,
96
96
  {
97
97
  genericType: custom(
@@ -69,6 +69,7 @@ import { V1_ColSpecArray } from '../../../model/valueSpecification/raw/classInst
69
69
  import { V1_ColSpec } from '../../../model/valueSpecification/raw/classInstance/relation/V1_ColSpec.js';
70
70
  import {
71
71
  V1_DataProductAccessor,
72
+ V1_IngestDefinitionAccessor,
72
73
  V1_RelationStoreAccessor,
73
74
  V1_SQLAccessor,
74
75
  } from '../../../model/valueSpecification/raw/classInstance/relation/V1_RelationStoreAccessor.js';
@@ -773,6 +774,14 @@ const relationStoreAccessorModelSchema = createModelSchema(
773
774
  },
774
775
  );
775
776
 
777
+ const ingestAccessorModelSchema = createModelSchema(
778
+ V1_IngestDefinitionAccessor,
779
+ {
780
+ path: list(primitive()),
781
+ metadata: optional(primitive()),
782
+ },
783
+ );
784
+
776
785
  const dataProductAccessorModelSchema = createModelSchema(
777
786
  V1_DataProductAccessor,
778
787
  {
@@ -789,8 +798,22 @@ const colSpecModelSchema = (
789
798
  plugins: PureProtocolProcessorPlugin[],
790
799
  ): ModelSchema<V1_ColSpec> =>
791
800
  createModelSchema(V1_ColSpec, {
792
- function1: optional(usingModelSchema(V1_lambdaModelSchema(plugins))),
793
- function2: optional(usingModelSchema(V1_lambdaModelSchema(plugins))),
801
+ function1: optional(
802
+ custom(
803
+ (val) => {
804
+ return val ? V1_serializeValueSpecification(val, plugins) : SKIP;
805
+ },
806
+ (val) => V1_deserializeValueSpecification(val, plugins),
807
+ ),
808
+ ),
809
+ function2: optional(
810
+ custom(
811
+ (val) => {
812
+ return val ? V1_serializeValueSpecification(val, plugins) : SKIP;
813
+ },
814
+ (val) => V1_deserializeValueSpecification(val, plugins),
815
+ ),
816
+ ),
794
817
  name: primitive(),
795
818
  type: optional(primitive()),
796
819
  });
@@ -856,8 +879,9 @@ export function V1_deserializeClassInstanceValue(
856
879
  case V1_ClassInstanceType.COL_SPEC_ARRAY:
857
880
  return deserialize(colSpecArrayModelSchema(plugins), json);
858
881
  case V1_ClassInstanceType.RELATION_STORE_ACCESSOR:
859
- case V1_ClassInstanceType.INGEST_ACCESSOR:
860
882
  return deserialize(relationStoreAccessorModelSchema, json);
883
+ case V1_ClassInstanceType.INGEST_ACCESSOR:
884
+ return deserialize(ingestAccessorModelSchema, json);
861
885
  case V1_ClassInstanceType.DATA_PRODUCT_ACCESSOR:
862
886
  return deserialize(dataProductAccessorModelSchema, json);
863
887
  case V1_ClassInstanceType.SQL_ACCESSOR:
@@ -920,6 +944,8 @@ export function V1_serializeClassInstanceValue(
920
944
  return serialize(dataProductAccessorModelSchema, protocol);
921
945
  } else if (protocol instanceof V1_SQLAccessor) {
922
946
  return serialize(sqlAccessorModelSchema, protocol);
947
+ } else if (protocol instanceof V1_IngestDefinitionAccessor) {
948
+ return serialize(ingestAccessorModelSchema, protocol);
923
949
  }
924
950
  const serializers = plugins.flatMap(
925
951
  (plugin) =>
package/src/index.ts CHANGED
@@ -97,8 +97,10 @@ export { SnowflakeM2MUdfDeploymentConfiguration } from './graph/metamodel/pure/f
97
97
  export { INTERNAL__UnknownElement } from './graph/metamodel/pure/packageableElements/INTERNAL__UnknownElement.js';
98
98
  export {
99
99
  V1_IngestDefinition,
100
- type V1_IngestDataset,
101
- type V1_IngestDefinitionContent,
100
+ V1_IngestDatasetSchema,
101
+ V1_IngestDatasetSource,
102
+ V1_IngestDataset,
103
+ V1_IngestDefinitionContent,
102
104
  } from './graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.js';
103
105
  export {
104
106
  Ownership,
@@ -376,6 +378,10 @@ export { V1_transformDataContractToLiteDatacontract } from './graph-manager/prot
376
378
  export {
377
379
  V1_deserializeIngestEnvironment,
378
380
  V1_deserializeProducerEnvironment,
381
+ V1_IngestDatasetModelSchema,
382
+ V1_IngestDefinitionContentModelSchema,
383
+ V1_deserializeIngestDefinitionContent,
384
+ V1_serializeIngestDefinitionContent,
379
385
  } from './graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.js';
380
386
  export * from './graph-manager/protocol/pure/v1/model/lineage/V1_Lineage.js';
381
387
 
@@ -847,7 +853,17 @@ export {
847
853
  RelationType,
848
854
  RelationColumn,
849
855
  } from './graph/metamodel/pure/packageableElements/relation/RelationType.js';
856
+ export {
857
+ Accessor,
858
+ DataProductAccessor,
859
+ IngestionAccessor,
860
+ RelationalStoreAccessor,
861
+ AccessorInstanceValue,
862
+ type AccessorOwner,
863
+ } from './graph/metamodel/pure/packageableElements/relation/Accessor.js';
864
+ export { V1_createAccessorFromPackageableElement as createAccessorFromPackageableElement } from './graph-manager/protocol/pure/v1/helpers/V1_AccessorHelper.js';
850
865
  export { Store } from './graph/metamodel/pure/packageableElements/store/Store.js';
866
+ export { Database } from './graph/metamodel/pure/packageableElements/store/relational/model/Database.js';
851
867
  export { Mapping } from './graph/metamodel/pure/packageableElements/mapping/Mapping.js';
852
868
  export {
853
869
  Runtime,
package/tsconfig.json CHANGED
@@ -249,6 +249,7 @@
249
249
  "./src/graph/metamodel/pure/packageableElements/mapping/xStore/XStoreAssociationImplementation.ts",
250
250
  "./src/graph/metamodel/pure/packageableElements/mapping/xStore/XStorePropertyFetchDetails.ts",
251
251
  "./src/graph/metamodel/pure/packageableElements/mapping/xStore/XStorePropertyMapping.ts",
252
+ "./src/graph/metamodel/pure/packageableElements/relation/Accessor.ts",
252
253
  "./src/graph/metamodel/pure/packageableElements/relation/Relation.ts",
253
254
  "./src/graph/metamodel/pure/packageableElements/relation/RelationType.ts",
254
255
  "./src/graph/metamodel/pure/packageableElements/runtime/PackageableRuntime.ts",
@@ -511,6 +512,7 @@
511
512
  "./src/graph-manager/protocol/pure/v1/engine/test/V1_DebugTestsResult.ts",
512
513
  "./src/graph-manager/protocol/pure/v1/engine/test/V1_RunTestsInput.ts",
513
514
  "./src/graph-manager/protocol/pure/v1/engine/test/V1_RunTestsResult.ts",
515
+ "./src/graph-manager/protocol/pure/v1/helpers/V1_AccessorHelper.ts",
514
516
  "./src/graph-manager/protocol/pure/v1/helpers/V1_DataProductHelper.ts",
515
517
  "./src/graph-manager/protocol/pure/v1/helpers/V1_DomainHelper.ts",
516
518
  "./src/graph-manager/protocol/pure/v1/helpers/V1_DomainObserverHelper.ts",