@finos/legend-graph 32.3.5 → 32.3.7

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 (108) hide show
  1. package/lib/graph/Core_HashUtils.d.ts +3 -1
  2. package/lib/graph/Core_HashUtils.d.ts.map +1 -1
  3. package/lib/graph/Core_HashUtils.js +2 -0
  4. package/lib/graph/Core_HashUtils.js.map +1 -1
  5. package/lib/graph/DependencyManager.js +1 -1
  6. package/lib/graph/DependencyManager.js.map +1 -1
  7. package/lib/graph/MetaModelConst.d.ts +1 -0
  8. package/lib/graph/MetaModelConst.d.ts.map +1 -1
  9. package/lib/graph/MetaModelConst.js +1 -0
  10. package/lib/graph/MetaModelConst.js.map +1 -1
  11. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts +9 -2
  12. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts.map +1 -1
  13. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js +23 -5
  14. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js.map +1 -1
  15. package/lib/graph/metamodel/pure/dataProduct/MappingIncludeDataProduct.d.ts +25 -0
  16. package/lib/graph/metamodel/pure/dataProduct/MappingIncludeDataProduct.d.ts.map +1 -0
  17. package/lib/graph/metamodel/pure/dataProduct/MappingIncludeDataProduct.js +34 -0
  18. package/lib/graph/metamodel/pure/dataProduct/MappingIncludeDataProduct.js.map +1 -0
  19. package/lib/graph-manager/action/changeDetection/DSL_Data_ObserverHelper.d.ts +4 -1
  20. package/lib/graph-manager/action/changeDetection/DSL_Data_ObserverHelper.d.ts.map +1 -1
  21. package/lib/graph-manager/action/changeDetection/DSL_Data_ObserverHelper.js +27 -1
  22. package/lib/graph-manager/action/changeDetection/DSL_Data_ObserverHelper.js.map +1 -1
  23. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.d.ts +2 -1
  24. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.d.ts.map +1 -1
  25. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js +9 -0
  26. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js.map +1 -1
  27. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +4 -4
  28. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  29. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts +3 -1
  30. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts.map +1 -1
  31. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.js +3 -1
  32. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.js.map +1 -1
  33. package/lib/graph-manager/protocol/pure/v1/lakehouse/deploy/V1_DataProductArtifact.d.ts +55 -26
  34. package/lib/graph-manager/protocol/pure/v1/lakehouse/deploy/V1_DataProductArtifact.d.ts.map +1 -1
  35. package/lib/graph-manager/protocol/pure/v1/lakehouse/deploy/V1_DataProductArtifact.js +105 -30
  36. package/lib/graph-manager/protocol/pure/v1/lakehouse/deploy/V1_DataProductArtifact.js.map +1 -1
  37. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts +6 -0
  38. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts.map +1 -1
  39. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js +13 -0
  40. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js.map +1 -1
  41. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_MappingIncludeDataProduct.d.ts +21 -0
  42. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_MappingIncludeDataProduct.d.ts.map +1 -0
  43. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_MappingIncludeDataProduct.js +28 -0
  44. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_MappingIncludeDataProduct.js.map +1 -0
  45. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.d.ts.map +1 -1
  46. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js +2 -1
  47. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js.map +1 -1
  48. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.d.ts.map +1 -1
  49. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js +8 -0
  50. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js.map +1 -1
  51. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
  52. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +12 -2
  53. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
  54. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.d.ts +2 -0
  55. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.d.ts.map +1 -1
  56. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js +1 -0
  57. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js.map +1 -1
  58. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts +3 -2
  59. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts.map +1 -1
  60. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js +13 -2
  61. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js.map +1 -1
  62. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.d.ts.map +1 -1
  63. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.js +9 -8
  64. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.js.map +1 -1
  65. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.d.ts.map +1 -1
  66. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.js +11 -0
  67. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.js.map +1 -1
  68. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts +7 -1
  69. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts.map +1 -1
  70. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js +26 -3
  71. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js.map +1 -1
  72. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.d.ts.map +1 -1
  73. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js +8 -0
  74. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js.map +1 -1
  75. package/lib/index.d.ts +4 -5
  76. package/lib/index.d.ts.map +1 -1
  77. package/lib/index.js +4 -5
  78. package/lib/index.js.map +1 -1
  79. package/lib/package.json +1 -1
  80. package/package.json +1 -1
  81. package/src/graph/Core_HashUtils.ts +2 -0
  82. package/src/graph/DependencyManager.ts +1 -1
  83. package/src/graph/MetaModelConst.ts +1 -0
  84. package/src/graph/metamodel/pure/dataProduct/DataProduct.ts +25 -4
  85. package/src/graph/metamodel/pure/dataProduct/MappingIncludeDataProduct.ts +42 -0
  86. package/src/graph-manager/action/changeDetection/DSL_Data_ObserverHelper.ts +37 -0
  87. package/src/graph-manager/action/changeDetection/DataProductObserveHelper.ts +13 -0
  88. package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +7 -7
  89. package/src/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.ts +6 -1
  90. package/src/graph-manager/protocol/pure/v1/lakehouse/deploy/V1_DataProductArtifact.ts +154 -53
  91. package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.ts +15 -0
  92. package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_MappingIncludeDataProduct.ts +30 -0
  93. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.ts +3 -1
  94. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts +7 -0
  95. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +19 -0
  96. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.ts +8 -0
  97. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.ts +24 -0
  98. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.ts +11 -4
  99. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.ts +19 -0
  100. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.ts +36 -0
  101. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts +10 -0
  102. package/src/index.ts +9 -10
  103. package/tsconfig.json +2 -1
  104. package/lib/graph-manager/action/generation/dataProduct/DataProductArtifactGeneration.d.ts +0 -28
  105. package/lib/graph-manager/action/generation/dataProduct/DataProductArtifactGeneration.d.ts.map +0 -1
  106. package/lib/graph-manager/action/generation/dataProduct/DataProductArtifactGeneration.js +0 -38
  107. package/lib/graph-manager/action/generation/dataProduct/DataProductArtifactGeneration.js.map +0 -1
  108. package/src/graph-manager/action/generation/dataProduct/DataProductArtifactGeneration.ts +0 -53
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Copyright (c) 2025-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { hashArray } from '@finos/legend-shared';
18
+ import { type Mapping } from '../packageableElements/mapping/Mapping.js';
19
+ import { MappingInclude } from '../packageableElements/mapping/MappingInclude.js';
20
+ import { type PackageableElementReference } from '../packageableElements/PackageableElementReference.js';
21
+ import type { DataProduct } from './DataProduct.js';
22
+ import { CORE_HASH_STRUCTURE } from '../../../Core_HashUtils.js';
23
+
24
+ export class MappingIncludeDataProduct extends MappingInclude {
25
+ includedDataProduct: PackageableElementReference<DataProduct>;
26
+
27
+ constructor(
28
+ _OWNER: Mapping,
29
+ included: PackageableElementReference<Mapping>,
30
+ includedDataProduct: PackageableElementReference<DataProduct>,
31
+ ) {
32
+ super(_OWNER, included);
33
+ this.includedDataProduct = includedDataProduct;
34
+ }
35
+
36
+ override get hashCode(): string {
37
+ return hashArray([
38
+ CORE_HASH_STRUCTURE.MAPPING_INCLUDE_DATAPRODUCT,
39
+ this.includedDataProduct.valueForSerialization ?? '',
40
+ ]);
41
+ }
42
+ }
@@ -18,11 +18,14 @@ import { computed, makeObservable, observable, override } from 'mobx';
18
18
  import {
19
19
  type EmbeddedData,
20
20
  type ModelData,
21
+ type RelationElement,
22
+ type RelationRowTestData,
21
23
  ModelEmbeddedData,
22
24
  ModelInstanceData,
23
25
  ExternalFormatData,
24
26
  DataElementReference,
25
27
  ModelStoreData,
28
+ RelationElementsData,
26
29
  } from '../../../graph/metamodel/pure/data/EmbeddedData.js';
27
30
  import {
28
31
  type RelationalCSVDataTable,
@@ -141,6 +144,38 @@ const observe_RelationalCSVData = skipObserved(
141
144
  },
142
145
  );
143
146
 
147
+ export const observe_RelationRowTestData = skipObserved(
148
+ (metamodel: RelationRowTestData): RelationRowTestData => {
149
+ makeObservable(metamodel, {
150
+ values: observable,
151
+ });
152
+ return metamodel;
153
+ },
154
+ );
155
+
156
+ export const observe_RelationElement = skipObserved(
157
+ (metamodel: RelationElement): RelationElement => {
158
+ makeObservable(metamodel, {
159
+ paths: observable,
160
+ columns: observable,
161
+ rows: observable,
162
+ hashCode: computed,
163
+ });
164
+ metamodel.rows.forEach(observe_RelationRowTestData);
165
+ return metamodel;
166
+ },
167
+ );
168
+
169
+ export const observe_RelationElementsData = skipObserved(
170
+ (metamodel: RelationElementsData): RelationElementsData => {
171
+ makeObservable(metamodel, {
172
+ hashCode: computed,
173
+ });
174
+ metamodel.relationElements.forEach(observe_RelationElement);
175
+ return metamodel;
176
+ },
177
+ );
178
+
144
179
  export const observe_INTERNAL__UnknownEmbeddedData = skipObserved(
145
180
  (metamodel: INTERNAL__UnknownEmbeddedData): INTERNAL__UnknownEmbeddedData => {
146
181
  makeObservable(metamodel, {
@@ -165,6 +200,8 @@ export function observe_EmbeddedData(
165
200
  return observe_ModelStoreData(metamodel, context);
166
201
  } else if (metamodel instanceof RelationalCSVData) {
167
202
  return observe_RelationalCSVData(metamodel);
203
+ } else if (metamodel instanceof RelationElementsData) {
204
+ return observe_RelationElementsData(metamodel);
168
205
  }
169
206
  const extraEmbeddedDataObservers = context.plugins.flatMap(
170
207
  (plugin) =>
@@ -31,6 +31,7 @@ import {
31
31
  type DataProductRuntimeInfo,
32
32
  LakehouseAccessPoint,
33
33
  UnknownDataProductIcon,
34
+ type Expertise,
34
35
  } from '../../../graph/metamodel/pure/dataProduct/DataProduct.js';
35
36
  import {
36
37
  observe_Abstract_PackageableElement,
@@ -200,6 +201,16 @@ export const observe_DataProductIcon = skipObserved(
200
201
  },
201
202
  );
202
203
 
204
+ export const observe_Expertise = skipObserved(
205
+ (metamodel: Expertise): Expertise => {
206
+ makeObservable(metamodel, {
207
+ description: observable,
208
+ expertIds: observable,
209
+ });
210
+ return metamodel;
211
+ },
212
+ );
213
+
203
214
  export const observe_DataProduct = skipObserved(
204
215
  (metamodel: DataProduct): DataProduct => {
205
216
  observe_Abstract_PackageableElement(metamodel);
@@ -211,6 +222,7 @@ export const observe_DataProduct = skipObserved(
211
222
  description: observable,
212
223
  supportInfo: observable,
213
224
  icon: observable,
225
+ expertise: observable,
214
226
  });
215
227
 
216
228
  if (metamodel.supportInfo) {
@@ -219,6 +231,7 @@ export const observe_DataProduct = skipObserved(
219
231
  if (metamodel.icon) {
220
232
  observe_DataProductIcon(metamodel.icon);
221
233
  }
234
+ metamodel.expertise?.forEach(observe_Expertise);
222
235
  metamodel.accessPointGroups.forEach(observe_APG);
223
236
  return metamodel;
224
237
  },
@@ -1160,6 +1160,13 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
1160
1160
  await this.buildStores(graph, inputs, options);
1161
1161
  stopWatch.record(GRAPH_MANAGER_EVENT.GRAPH_BUILDER_BUILD_STORES__SUCCESS);
1162
1162
 
1163
+ // build data products
1164
+ graphBuilderState.setMessage(`Building data products...`);
1165
+ await this.buildDataProducts(graph, inputs, options);
1166
+ stopWatch.record(
1167
+ GRAPH_MANAGER_EVENT.GRAPH_BUILDER_BUILD_DATA_PRODUCTS__SUCCESS,
1168
+ );
1169
+
1163
1170
  // build mappings
1164
1171
  graphBuilderState.setMessage(`Building mappings...`);
1165
1172
  await this.buildMappings(graph, inputs, options);
@@ -1193,13 +1200,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
1193
1200
  GRAPH_MANAGER_EVENT.GRAPH_BUILDER_BUILD_DATA_ELEMENTS__SUCCESS,
1194
1201
  );
1195
1202
 
1196
- // build data products
1197
- graphBuilderState.setMessage(`Building data products...`);
1198
- await this.buildDataProducts(graph, inputs, options);
1199
- stopWatch.record(
1200
- GRAPH_MANAGER_EVENT.GRAPH_BUILDER_BUILD_DATA_PRODUCTS__SUCCESS,
1201
- );
1202
-
1203
1203
  // build other elements
1204
1204
  graphBuilderState.setMessage(`Building other elements...`);
1205
1205
  await this.buildFileGenerations(graph, inputs, options);
@@ -703,12 +703,17 @@ export class V1_EngineServerClient extends AbstractServerClient {
703
703
 
704
704
  lambdaRelationType = (
705
705
  input: PlainObject<V1_LambdaReturnTypeInput>,
706
+ options?: {
707
+ abortController?: AbortController | undefined;
708
+ },
706
709
  ): Promise<PlainObject<V1_RelationType>> =>
707
710
  this.postWithTracing(
708
711
  this.getTraceData(CORE_ENGINE_ACTIVITY_TRACE.GET_LAMBDA_RETURN_TYPE),
709
712
  `${this._pure()}/compilation/lambdaRelationType`,
710
713
  input,
711
- {},
714
+ {
715
+ signal: options?.abortController?.signal ?? null,
716
+ },
712
717
  undefined,
713
718
  undefined,
714
719
  { enableCompression: true },
@@ -14,113 +14,214 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { SerializationFactory, usingModelSchema } from '@finos/legend-shared';
18
- import { createModelSchema, list, optional, primitive } from 'serializr';
17
+ import {
18
+ SerializationFactory,
19
+ UnsupportedOperationError,
20
+ usingConstantValueSchema,
21
+ usingModelSchema,
22
+ type PlainObject,
23
+ } from '@finos/legend-shared';
24
+ import {
25
+ createModelSchema,
26
+ custom,
27
+ list,
28
+ optional,
29
+ primitive,
30
+ serialize,
31
+ } from 'serializr';
32
+ import type { V1_GenericType } from '../../model/packageableElements/type/V1_GenericType.js';
33
+ import {
34
+ V1_deserializeGenericType,
35
+ V1_genericTypeModelSchema,
36
+ } from '../../transformation/pureProtocol/serializationHelpers/V1_TypeSerializationHelper.js';
19
37
 
20
- export class V1_DataProductArtifactDataProduct {
38
+ export enum V1_DataProductTypeEnum {
39
+ INTERNAL = 'internalDataProductType',
40
+ EXTERNAL = 'externalDataProductType',
41
+ }
42
+
43
+ export enum V1_ResourceBuilderType {
44
+ DATABASE_DDL = 'databaseDDL',
45
+ FUNCTION_ACCESS_POINT = 'functionAccessPoint',
46
+ }
47
+
48
+ export enum V1_DatabaseDDLImplementationType {
49
+ VIEW = 'VIEW',
50
+ TABLE = 'TABLE',
51
+ PROCEDURE = 'PROCEDURE',
52
+ }
53
+
54
+ export abstract class V1_DataProductType {}
55
+
56
+ export class V1_ExternalDataProductType extends V1_DataProductType {
57
+ link: string | undefined;
58
+
59
+ static readonly serialization = new SerializationFactory(
60
+ createModelSchema(V1_ExternalDataProductType, {
61
+ _type: usingConstantValueSchema(V1_DataProductTypeEnum.EXTERNAL),
62
+ link: optional(primitive()),
63
+ }),
64
+ );
65
+ }
66
+
67
+ export class V1_InternalDataProductType extends V1_DataProductType {
68
+ static readonly serialization = new SerializationFactory(
69
+ createModelSchema(V1_InternalDataProductType, {
70
+ _type: usingConstantValueSchema(V1_DataProductTypeEnum.INTERNAL),
71
+ }),
72
+ );
73
+ }
74
+
75
+ export const V1_serializeDataProductType = (
76
+ DataProductType: V1_DataProductType,
77
+ ): PlainObject<V1_DataProductType> => {
78
+ if (DataProductType instanceof V1_ExternalDataProductType) {
79
+ return V1_ExternalDataProductType.serialization.toJson(DataProductType);
80
+ } else if (DataProductType instanceof V1_InternalDataProductType) {
81
+ return V1_InternalDataProductType.serialization.toJson(DataProductType);
82
+ }
83
+ throw new UnsupportedOperationError();
84
+ };
85
+
86
+ export const V1_deserializeDataProductType = (
87
+ json: PlainObject<V1_DataProductType>,
88
+ ): V1_DataProductType => {
89
+ switch (json._type) {
90
+ case V1_DataProductTypeEnum.EXTERNAL:
91
+ return V1_ExternalDataProductType.serialization.fromJson(json);
92
+ case V1_DataProductTypeEnum.INTERNAL:
93
+ return V1_InternalDataProductType.serialization.fromJson(json);
94
+ default:
95
+ throw new Error(`Unknown V1_DataProductType type: ${json._type}`);
96
+ }
97
+ };
98
+
99
+ export class V1_DataProductInfo {
21
100
  path!: string;
22
- deploymentId!: string;
101
+ deploymentId: string | undefined;
23
102
  description: string | undefined;
24
103
  title: string | undefined;
104
+ dataProductType: V1_DataProductType | undefined;
25
105
 
26
106
  static readonly serialization = new SerializationFactory(
27
- createModelSchema(V1_DataProductArtifactDataProduct, {
107
+ createModelSchema(V1_DataProductInfo, {
28
108
  path: primitive(),
29
109
  deploymentId: primitive(),
30
110
  description: optional(primitive()),
31
111
  title: optional(primitive()),
112
+ dataProductType: custom(
113
+ (val) => (val ? V1_serializeDataProductType(val) : undefined),
114
+ (val) => (val ? V1_deserializeDataProductType(val) : undefined),
115
+ ),
32
116
  }),
33
117
  );
34
118
  }
35
119
 
36
- export class V1_DataProductArtifactResourceBuilder {
120
+ export abstract class V1_ResourceBuilder {}
121
+
122
+ export class V1_DatabaseDDL extends V1_ResourceBuilder {
37
123
  reproducible!: boolean;
38
124
  targetEnvironment!: string;
39
125
  script!: string;
126
+ classification: string | undefined;
127
+ resourceType!: V1_DatabaseDDLImplementationType;
40
128
 
41
129
  static readonly serialization = new SerializationFactory(
42
- createModelSchema(V1_DataProductArtifactResourceBuilder, {
130
+ createModelSchema(V1_DatabaseDDL, {
131
+ _type: usingConstantValueSchema(V1_ResourceBuilderType.DATABASE_DDL),
43
132
  reproducible: primitive(),
44
133
  targetEnvironment: primitive(),
45
134
  script: primitive(),
135
+ classification: optional(primitive()),
136
+ resourceType: primitive(),
46
137
  }),
47
138
  );
48
139
  }
49
140
 
50
- export class V1_DataProductArtifactAccessPointImplementation {
51
- id!: string;
52
- resourceBuilder!: V1_DataProductArtifactResourceBuilder;
141
+ export class V1_FunctionAccessPoint extends V1_ResourceBuilder {
142
+ functionGrammar!: string;
53
143
 
54
144
  static readonly serialization = new SerializationFactory(
55
- createModelSchema(V1_DataProductArtifactAccessPointImplementation, {
56
- id: primitive(),
57
- resourceBuilder: usingModelSchema(
58
- V1_DataProductArtifactResourceBuilder.serialization.schema,
145
+ createModelSchema(V1_FunctionAccessPoint, {
146
+ _type: usingConstantValueSchema(
147
+ V1_ResourceBuilderType.FUNCTION_ACCESS_POINT,
59
148
  ),
149
+ functionGrammar: primitive(),
60
150
  }),
61
151
  );
62
152
  }
63
153
 
64
- export class V1_DataProductArtifactAccessPointGroup {
154
+ export const V1_serializeResourceBuilder = (
155
+ resourceBuilder: V1_ResourceBuilder,
156
+ ): PlainObject<V1_ResourceBuilder> => {
157
+ if (resourceBuilder instanceof V1_DatabaseDDL) {
158
+ return V1_DatabaseDDL.serialization.toJson(resourceBuilder);
159
+ } else if (resourceBuilder instanceof V1_FunctionAccessPoint) {
160
+ return V1_FunctionAccessPoint.serialization.toJson(resourceBuilder);
161
+ }
162
+ throw new UnsupportedOperationError();
163
+ };
164
+
165
+ export const V1_deserializeResourceBuilder = (
166
+ json: PlainObject<V1_ResourceBuilder>,
167
+ ): V1_ResourceBuilder => {
168
+ switch (json._type) {
169
+ case V1_ResourceBuilderType.DATABASE_DDL:
170
+ return V1_DatabaseDDL.serialization.fromJson(json);
171
+ case V1_ResourceBuilderType.FUNCTION_ACCESS_POINT:
172
+ return V1_FunctionAccessPoint.serialization.fromJson(json);
173
+ default:
174
+ throw new Error(`Unknown V1_ResourceBuilder type: ${json._type}`);
175
+ }
176
+ };
177
+
178
+ export class V1_AccessPointImplementation {
65
179
  id!: string;
66
180
  description: string | undefined;
67
- accessPointImplementations: V1_DataProductArtifactAccessPointImplementation[] =
68
- [];
181
+ resourceBuilder!: V1_ResourceBuilder;
182
+ lambdaGenericType: V1_GenericType | undefined;
69
183
 
70
184
  static readonly serialization = new SerializationFactory(
71
- createModelSchema(V1_DataProductArtifactAccessPointGroup, {
185
+ createModelSchema(V1_AccessPointImplementation, {
72
186
  id: primitive(),
73
187
  description: optional(primitive()),
74
- accessPointImplementations: list(
75
- usingModelSchema(
76
- V1_DataProductArtifactAccessPointImplementation.serialization.schema,
77
- ),
78
- ),
79
- }),
80
- );
81
- }
82
-
83
- export class V1_DataProductArtifactGeneration {
84
- dataProduct!: V1_DataProductArtifactDataProduct;
85
- accessPointGroups: V1_DataProductArtifactAccessPointGroup[] = [];
86
-
87
- static readonly serialization = new SerializationFactory(
88
- createModelSchema(V1_DataProductArtifactGeneration, {
89
- dataProduct: usingModelSchema(
90
- V1_DataProductArtifactDataProduct.serialization.schema,
188
+ resourceBuilder: custom(
189
+ V1_serializeResourceBuilder,
190
+ V1_deserializeResourceBuilder,
91
191
  ),
92
- accessPointGroups: list(
93
- usingModelSchema(
94
- V1_DataProductArtifactAccessPointGroup.serialization.schema,
95
- ),
192
+ lambdaGenericType: custom(
193
+ (val) => serialize(V1_genericTypeModelSchema, val),
194
+ (val) => V1_deserializeGenericType(val),
96
195
  ),
97
196
  }),
98
197
  );
99
198
  }
100
199
 
101
- export class V1_DataProductDefinitionAndArtifact {
102
- definition!: string;
103
- artifact!: V1_DataProductArtifactGeneration;
200
+ export class V1_AccessPointGroupInfo {
201
+ id!: string;
202
+ description: string | undefined;
203
+ accessPointImplementations: V1_AccessPointImplementation[] = [];
104
204
 
105
205
  static readonly serialization = new SerializationFactory(
106
- createModelSchema(V1_DataProductDefinitionAndArtifact, {
107
- definition: primitive(),
108
- artifact: usingModelSchema(
109
- V1_DataProductArtifactGeneration.serialization.schema,
206
+ createModelSchema(V1_AccessPointGroupInfo, {
207
+ id: primitive(),
208
+ description: optional(primitive()),
209
+ accessPointImplementations: list(
210
+ usingModelSchema(V1_AccessPointImplementation.serialization.schema),
110
211
  ),
111
212
  }),
112
213
  );
113
214
  }
114
215
 
115
- export class V1_SandboxDataProductDeploymentResponse {
116
- deployedDataProducts: V1_DataProductDefinitionAndArtifact[] = [];
216
+ export class V1_DataProductArtifact {
217
+ dataProduct!: V1_DataProductInfo;
218
+ accessPointGroups: V1_AccessPointGroupInfo[] = [];
117
219
 
118
220
  static readonly serialization = new SerializationFactory(
119
- createModelSchema(V1_SandboxDataProductDeploymentResponse, {
120
- deployedDataProducts: list(
121
- usingModelSchema(
122
- V1_DataProductDefinitionAndArtifact.serialization.schema,
123
- ),
221
+ createModelSchema(V1_DataProductArtifact, {
222
+ dataProduct: usingModelSchema(V1_DataProductInfo.serialization.schema),
223
+ accessPointGroups: list(
224
+ usingModelSchema(V1_AccessPointGroupInfo.serialization.schema),
124
225
  ),
125
226
  }),
126
227
  );
@@ -302,6 +302,19 @@ export class V1_ExternalDataProductType extends V1_DataProductType {
302
302
  }
303
303
  }
304
304
 
305
+ export class V1_Expertise implements Hashable {
306
+ description: string | undefined;
307
+ expertIds: string[] | undefined;
308
+
309
+ get hashCode(): string {
310
+ return hashArray([
311
+ CORE_HASH_STRUCTURE.DATA_PRODUCT_EXPERTISE,
312
+ this.description ?? '',
313
+ hashArray(this.expertIds ?? []),
314
+ ]);
315
+ }
316
+ }
317
+
305
318
  export class V1_DataProduct extends V1_PackageableElement implements Hashable {
306
319
  title: string | undefined;
307
320
  description: string | undefined;
@@ -313,6 +326,7 @@ export class V1_DataProduct extends V1_PackageableElement implements Hashable {
313
326
  type: V1_DataProductType | undefined;
314
327
  stereotypes: V1_StereotypePtr[] = [];
315
328
  taggedValues: V1_TaggedValue[] = [];
329
+ expertise: V1_Expertise[] | undefined;
316
330
 
317
331
  override get hashCode(): string {
318
332
  return hashArray([
@@ -327,6 +341,7 @@ export class V1_DataProduct extends V1_PackageableElement implements Hashable {
327
341
  this.type ?? '',
328
342
  hashArray(this.stereotypes),
329
343
  hashArray(this.taggedValues),
344
+ hashArray(this.expertise ?? []),
330
345
  ]);
331
346
  }
332
347
 
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (c) 2025-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { hashArray } from '@finos/legend-shared';
18
+ import { V1_MappingInclude } from '../mapping/V1_MappingInclude.js';
19
+ import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
20
+
21
+ export class V1_MappingIncludeDataProduct extends V1_MappingInclude {
22
+ includedDataProduct!: string;
23
+
24
+ override get hashCode(): string {
25
+ return hashArray([
26
+ CORE_HASH_STRUCTURE.MAPPING_INCLUDE_DATAPRODUCT,
27
+ this.includedDataProduct,
28
+ ]);
29
+ }
30
+ }
@@ -50,6 +50,7 @@ import {
50
50
  V1_InternalDataProductType,
51
51
  V1_ExternalDataProductType,
52
52
  V1_FunctionAccessPoint,
53
+ type V1_Expertise,
53
54
  } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
54
55
  import { V1_initPackageableElement } from './V1_CoreTransformerHelper.js';
55
56
  import { V1_transformRawLambda } from './V1_RawValueSpecificationTransformer.js';
@@ -77,7 +78,7 @@ const transformAccessPoint = (
77
78
  const func = new V1_FunctionAccessPoint();
78
79
  func.id = ap.id;
79
80
  func.description = ap.description;
80
- func.query = V1_transformRawLambda(ap.func, context);
81
+ func.query = V1_transformRawLambda(ap.query, context);
81
82
  return func;
82
83
  } else if (ap instanceof UnknownAccessPoint) {
83
84
  const un = new V1_UnknownAccessPoint();
@@ -126,6 +127,7 @@ export const V1_transformDataProduct = (
126
127
  product.coverageRegions = element.coverageRegions as
127
128
  | V1_DataProductRegion[]
128
129
  | undefined;
130
+ product.expertise = element.expertise as V1_Expertise[] | undefined;
129
131
  if (element.type instanceof InternalDataProductType) {
130
132
  product.type = new V1_InternalDataProductType();
131
133
  } else if (element.type instanceof ExternalDataProductType) {
@@ -51,6 +51,7 @@ import type { InlineEmbeddedRelationalInstanceSetImplementation } from '../../..
51
51
  import type { OtherwiseEmbeddedRelationalInstanceSetImplementation } from '../../../../../../../graph/metamodel/pure/packageableElements/store/relational/mapping/OtherwiseEmbeddedRelationalInstanceSetImplementation.js';
52
52
  import type { InferableMappingElementIdValue } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/InferableMappingElementId.js';
53
53
  import { MappingIncludeMapping } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingIncludeMapping.js';
54
+ import { MappingIncludeDataProduct } from '../../../../../../../graph/metamodel/pure/dataProduct/MappingIncludeDataProduct.js';
54
55
  import { INTERNAL__UnknownMappingInclude } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/INTERNAL__UnknownMappingInclude.js';
55
56
  import type { MappingInclude } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/MappingInclude.js';
56
57
  import {
@@ -104,6 +105,7 @@ import {
104
105
  type V1_MappingInclude,
105
106
  V1_MappingIncludeMapping,
106
107
  } from '../../../model/packageableElements/mapping/V1_MappingInclude.js';
108
+ import { V1_MappingIncludeDataProduct } from '../../../model/packageableElements/dataProduct/V1_MappingIncludeDataProduct.js';
107
109
  import { V1_INTERNAL__UnknownMappingInclude } from '../../../model/packageableElements/mapping/V1_INTERNAL__UnknownMappingInclude.js';
108
110
  import { V1_EnumerationMapping } from '../../../model/packageableElements/mapping/V1_EnumerationMapping.js';
109
111
  import { V1_FlatDataPropertyMapping } from '../../../model/packageableElements/store/flatData/mapping/V1_FlatDataPropertyMapping.js';
@@ -416,6 +418,11 @@ const transformMappingInclude = (
416
418
  const protocol = new V1_INTERNAL__UnknownMappingInclude();
417
419
  protocol.content = element.content;
418
420
  return protocol;
421
+ } else if (element instanceof MappingIncludeDataProduct) {
422
+ const mappingInclude = new V1_MappingIncludeDataProduct();
423
+ mappingInclude.includedDataProduct =
424
+ element.includedDataProduct.valueForSerialization ?? '';
425
+ return mappingInclude;
419
426
  } else if (element instanceof MappingIncludeMapping) {
420
427
  const mappingInclude = new V1_MappingIncludeMapping();
421
428
  mappingInclude.includedMapping =
@@ -108,6 +108,7 @@ import {
108
108
  type V1_MappingInclude,
109
109
  V1_MappingIncludeMapping,
110
110
  } from '../../../model/packageableElements/mapping/V1_MappingInclude.js';
111
+ import { V1_MappingIncludeDataProduct } from '../../../model/packageableElements/dataProduct/V1_MappingIncludeDataProduct.js';
111
112
  import { V1_INTERNAL__UnknownMappingInclude } from '../../../model/packageableElements/mapping/V1_INTERNAL__UnknownMappingInclude.js';
112
113
  import type { V1_INTERNAL__UnknownStore } from '../../../model/packageableElements/store/V1_INTERNAL__UnknownStore.js';
113
114
  import type { V1_SnowflakeApp } from '../../../model/packageableElements/function/V1_SnowflakeApp.js';
@@ -135,10 +136,12 @@ import {
135
136
  Email,
136
137
  ExternalDataProductType,
137
138
  InternalDataProductType,
139
+ ModelAccessPointGroup,
138
140
  SupportInfo,
139
141
  } from '../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
140
142
  import {
141
143
  V1_buildAccessPointGroup,
144
+ V1_buildDataProductExpertise,
142
145
  V1_buildDataProductIcon,
143
146
  V1_buildDataProductLink,
144
147
  } from './helpers/V1_DataProductBuilder.js';
@@ -543,6 +546,17 @@ export class V1_ElementSecondPassBuilder
543
546
  if (protocol instanceof V1_INTERNAL__UnknownMappingInclude) {
544
547
  return undefined;
545
548
  }
549
+ if (protocol instanceof V1_MappingIncludeDataProduct) {
550
+ const dataProduct = this.context.graph.getDataProduct(
551
+ protocol.includedDataProduct,
552
+ );
553
+ return guaranteeNonNullable(
554
+ dataProduct.accessPointGroups
555
+ .filter((apg) => apg instanceof ModelAccessPointGroup)
556
+ .at(0),
557
+ `include dataproduct requires Model AccessPoint Group. Can't find a Model AccessPoint Group for the dataproduct ${protocol.includedDataProduct}`,
558
+ ).mapping.value.path;
559
+ }
546
560
  if (protocol instanceof V1_MappingIncludeMapping) {
547
561
  return protocol.includedMapping;
548
562
  }
@@ -766,6 +780,11 @@ export class V1_ElementSecondPassBuilder
766
780
  dataProductType.link = element.type.link;
767
781
  dataProduct.type = dataProductType;
768
782
  }
783
+ if (element.expertise) {
784
+ dataProduct.expertise = element.expertise.map((expertise) =>
785
+ V1_buildDataProductExpertise(expertise),
786
+ );
787
+ }
769
788
  dataProduct.deliveryFrequency = element.deliveryFrequency as
770
789
  | DataProduct_DeliveryFrequency
771
790
  | undefined;
@@ -112,6 +112,7 @@ import {
112
112
  RelationColumn,
113
113
  RelationType,
114
114
  } from '../../../../../../../graph/metamodel/pure/packageableElements/relation/RelationType.js';
115
+ import type { DataProduct } from '../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
115
116
  import { V1_buildValueSpecification } from './helpers/V1_ValueSpecificationBuilderHelper.js';
116
117
 
117
118
  export const V1_buildFullPath = (
@@ -664,6 +665,13 @@ export class V1_GraphBuilderContext {
664
665
  path,
665
666
  this.graph.getDataElement,
666
667
  );
668
+ resolveDataProduct = (
669
+ path: string,
670
+ ): PackageableElementImplicitReference<DataProduct> =>
671
+ this.createImplicitPackageableElementReference(
672
+ path,
673
+ this.graph.getDataProduct,
674
+ );
667
675
  }
668
676
 
669
677
  export class V1_GraphBuilderContextBuilder {