@finos/legend-graph 32.3.21 → 32.3.23

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 (77) hide show
  1. package/lib/graph/Core_HashUtils.d.ts +5 -0
  2. package/lib/graph/Core_HashUtils.d.ts.map +1 -1
  3. package/lib/graph/Core_HashUtils.js +5 -0
  4. package/lib/graph/Core_HashUtils.js.map +1 -1
  5. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts +30 -0
  6. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts.map +1 -1
  7. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js +76 -1
  8. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js.map +1 -1
  9. package/lib/graph/metamodel/pure/packageableElements/service/Service.d.ts +1 -0
  10. package/lib/graph/metamodel/pure/packageableElements/service/Service.d.ts.map +1 -1
  11. package/lib/graph/metamodel/pure/packageableElements/service/Service.js +2 -0
  12. package/lib/graph/metamodel/pure/packageableElements/service/Service.js.map +1 -1
  13. package/lib/graph-manager/action/changeDetection/DSL_Service_ObserverHelper.d.ts.map +1 -1
  14. package/lib/graph-manager/action/changeDetection/DSL_Service_ObserverHelper.js +1 -0
  15. package/lib/graph-manager/action/changeDetection/DSL_Service_ObserverHelper.js.map +1 -1
  16. package/lib/graph-manager/action/validation/DSL_Service_ValidationHelper.d.ts +1 -0
  17. package/lib/graph-manager/action/validation/DSL_Service_ValidationHelper.d.ts.map +1 -1
  18. package/lib/graph-manager/action/validation/DSL_Service_ValidationHelper.js +14 -0
  19. package/lib/graph-manager/action/validation/DSL_Service_ValidationHelper.js.map +1 -1
  20. package/lib/graph-manager/protocol/pure/v1/lakehouse/deploy/V1_DataProductArtifact.d.ts +89 -0
  21. package/lib/graph-manager/protocol/pure/v1/lakehouse/deploy/V1_DataProductArtifact.d.ts.map +1 -1
  22. package/lib/graph-manager/protocol/pure/v1/lakehouse/deploy/V1_DataProductArtifact.js +195 -2
  23. package/lib/graph-manager/protocol/pure/v1/lakehouse/deploy/V1_DataProductArtifact.js.map +1 -1
  24. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.d.ts +5 -0
  25. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.d.ts.map +1 -1
  26. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.js +5 -0
  27. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.js.map +1 -1
  28. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts +30 -0
  29. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts.map +1 -1
  30. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js +67 -0
  31. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js.map +1 -1
  32. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/service/V1_Service.d.ts +1 -0
  33. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/service/V1_Service.d.ts.map +1 -1
  34. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/service/V1_Service.js +2 -0
  35. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/service/V1_Service.js.map +1 -1
  36. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.d.ts.map +1 -1
  37. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js +74 -2
  38. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js.map +1 -1
  39. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.d.ts.map +1 -1
  40. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.js +1 -0
  41. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.js.map +1 -1
  42. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
  43. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +5 -1
  44. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
  45. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts +5 -2
  46. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts.map +1 -1
  47. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js +93 -3
  48. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js.map +1 -1
  49. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts +10 -1
  50. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts.map +1 -1
  51. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js +53 -1
  52. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js.map +1 -1
  53. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.d.ts.map +1 -1
  54. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.js +1 -0
  55. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.js.map +1 -1
  56. package/lib/index.d.ts +3 -3
  57. package/lib/index.d.ts.map +1 -1
  58. package/lib/index.js +3 -3
  59. package/lib/index.js.map +1 -1
  60. package/lib/package.json +1 -1
  61. package/package.json +1 -1
  62. package/src/graph/Core_HashUtils.ts +5 -0
  63. package/src/graph/metamodel/pure/dataProduct/DataProduct.ts +89 -1
  64. package/src/graph/metamodel/pure/packageableElements/service/Service.ts +2 -0
  65. package/src/graph-manager/action/changeDetection/DSL_Service_ObserverHelper.ts +1 -0
  66. package/src/graph-manager/action/validation/DSL_Service_ValidationHelper.ts +19 -0
  67. package/src/graph-manager/protocol/pure/v1/lakehouse/deploy/V1_DataProductArtifact.ts +294 -0
  68. package/src/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.ts +6 -0
  69. package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.ts +77 -0
  70. package/src/graph-manager/protocol/pure/v1/model/packageableElements/service/V1_Service.ts +2 -0
  71. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.ts +105 -0
  72. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.ts +1 -0
  73. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +8 -0
  74. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.ts +161 -1
  75. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.ts +92 -0
  76. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.ts +1 -0
  77. package/src/index.ts +11 -0
@@ -28,6 +28,8 @@ import {
28
28
  UnknownAccessPoint,
29
29
  UnknownDataProductIcon,
30
30
  FunctionAccessPoint,
31
+ PackageableElementSampleQuery,
32
+ InLineSampleQuery,
31
33
  } from '../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
32
34
  import {
33
35
  type V1_AccessPoint,
@@ -51,6 +53,10 @@ import {
51
53
  V1_FunctionAccessPoint,
52
54
  type V1_Expertise,
53
55
  V1_DataProductOperationalMetadata,
56
+ V1_NativeModelAccess,
57
+ V1_PackageableElementSampleQuery,
58
+ V1_InLineSampleQuery,
59
+ V1_NativeModelExecutionContext,
54
60
  } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
55
61
  import { V1_initPackageableElement } from './V1_CoreTransformerHelper.js';
56
62
  import { V1_transformRawLambda } from './V1_RawValueSpecificationTransformer.js';
@@ -61,6 +67,8 @@ import {
61
67
  } from './V1_DomainTransformer.js';
62
68
  import { V1_PackageableElementPointer } from '../../../model/packageableElements/V1_PackageableElement.js';
63
69
  import { V1_transformEmbeddedData } from './V1_DataElementTransformer.js';
70
+ import { ConcreteFunctionDefinition } from '../../../../../../../graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.js';
71
+ import { generateFunctionPrettyName } from '../../../../../../../graph/helpers/PureLanguageHelper.js';
64
72
 
65
73
  const transformAccessPoint = (
66
74
  ap: AccessPoint,
@@ -137,6 +145,103 @@ export const V1_transformDataProduct = (
137
145
  product.type = dataProductType;
138
146
  }
139
147
 
148
+ if (element.nativeModelAccess) {
149
+ const nativeModelAccess = new V1_NativeModelAccess();
150
+ const metamodelNativeModelAccess = element.nativeModelAccess;
151
+ if (metamodelNativeModelAccess.diagrams.length === 0) {
152
+ nativeModelAccess.diagrams = undefined;
153
+ } else {
154
+ nativeModelAccess.diagrams = metamodelNativeModelAccess.diagrams.map(
155
+ (diagram) => {
156
+ const v1Diagram = new V1_DataProductDiagram();
157
+ v1Diagram.title = diagram.title;
158
+ v1Diagram.description = diagram.description;
159
+ v1Diagram.diagram = new V1_PackageableElementPointer(
160
+ undefined,
161
+ diagram.diagram.path,
162
+ );
163
+ return v1Diagram;
164
+ },
165
+ );
166
+ }
167
+ nativeModelAccess.defaultExecutionContext =
168
+ metamodelNativeModelAccess.defaultExecutionContext;
169
+ nativeModelAccess.nativeModelExecutionContexts =
170
+ metamodelNativeModelAccess.nativeModelExecutionContexts.map(
171
+ (executionContext) => {
172
+ const v1ExecutionContext = new V1_NativeModelExecutionContext();
173
+ v1ExecutionContext.key = executionContext.key;
174
+ v1ExecutionContext.mapping = new V1_PackageableElementPointer(
175
+ undefined,
176
+ executionContext.mapping.valueForSerialization ?? '',
177
+ );
178
+ if (executionContext.runtime) {
179
+ v1ExecutionContext.runtime = new V1_PackageableElementPointer(
180
+ undefined,
181
+ executionContext.runtime.valueForSerialization ?? '',
182
+ );
183
+ }
184
+ return v1ExecutionContext;
185
+ },
186
+ );
187
+ nativeModelAccess.featuredElements =
188
+ metamodelNativeModelAccess.featuredElements.map((metatamodelScope) => {
189
+ const scope = new V1_ElementScope();
190
+ scope.exclude = metatamodelScope.exclude;
191
+ scope.element = new V1_PackageableElementPointer(
192
+ undefined,
193
+ metatamodelScope.element.valueForSerialization ?? '',
194
+ );
195
+ return scope;
196
+ });
197
+ nativeModelAccess.sampleQueries =
198
+ metamodelNativeModelAccess.sampleQueries.map((metamodelSampleQuery) => {
199
+ if (metamodelSampleQuery instanceof PackageableElementSampleQuery) {
200
+ const sampleQuery = new V1_PackageableElementSampleQuery();
201
+ sampleQuery.id = metamodelSampleQuery.id;
202
+ sampleQuery.title = metamodelSampleQuery.title;
203
+ sampleQuery.description = metamodelSampleQuery.description;
204
+ sampleQuery.executionContextKey =
205
+ metamodelSampleQuery.executionContextKey;
206
+ if (
207
+ metamodelSampleQuery.query.value instanceof
208
+ ConcreteFunctionDefinition
209
+ ) {
210
+ sampleQuery.query = new V1_PackageableElementPointer(
211
+ undefined,
212
+ generateFunctionPrettyName(metamodelSampleQuery.query.value, {
213
+ fullPath: true,
214
+ spacing: false,
215
+ notIncludeParamName: true,
216
+ }),
217
+ );
218
+ } else {
219
+ sampleQuery.query = new V1_PackageableElementPointer(
220
+ undefined,
221
+ metamodelSampleQuery.query.valueForSerialization ?? '',
222
+ );
223
+ }
224
+ return sampleQuery;
225
+ } else if (metamodelSampleQuery instanceof InLineSampleQuery) {
226
+ const sampleQuery = new V1_InLineSampleQuery();
227
+ sampleQuery.id = metamodelSampleQuery.id;
228
+ sampleQuery.title = metamodelSampleQuery.title;
229
+ sampleQuery.description = metamodelSampleQuery.description;
230
+ sampleQuery.executionContextKey =
231
+ metamodelSampleQuery.executionContextKey;
232
+ sampleQuery.query = V1_transformRawLambda(
233
+ metamodelSampleQuery.query,
234
+ context,
235
+ );
236
+ return sampleQuery;
237
+ }
238
+ throw new UnsupportedOperationError(
239
+ `Unable to transform data product sample query`,
240
+ );
241
+ });
242
+ product.nativeModelAccess = nativeModelAccess;
243
+ }
244
+
140
245
  if (!element.icon) {
141
246
  product.icon = undefined;
142
247
  } else {
@@ -332,6 +332,7 @@ export const V1_transformService = (
332
332
  service.stereotypes = element.stereotypes.map(V1_transformStereotype);
333
333
  service.taggedValues = element.taggedValues.map(V1_transformTaggedValue);
334
334
  service.autoActivateUpdates = element.autoActivateUpdates;
335
+ service.mcpServer = element.mcpServer;
335
336
  service.documentation = element.documentation;
336
337
  service.execution = transformServiceExecution(element.execution, context);
337
338
  if (element.ownership) {
@@ -143,6 +143,7 @@ import {
143
143
  V1_buildDataProductIcon,
144
144
  V1_buildDataProductLink,
145
145
  V1_buildDataProductOperationalMetadata,
146
+ V1_buildNativeModelAccess,
146
147
  } from './helpers/V1_DataProductBuilder.js';
147
148
  import type { V1_IngestDefinition } from '../../../model/packageableElements/ingest/V1_IngestDefinition.js';
148
149
  import { IncludeStore } from '../../../../../../../graph/metamodel/pure/packageableElements/store/relational/model/IncludeStore.js';
@@ -619,6 +620,7 @@ export class V1_ElementSecondPassBuilder
619
620
  service.owners = element.owners.slice();
620
621
  service.documentation = element.documentation;
621
622
  service.autoActivateUpdates = element.autoActivateUpdates;
623
+ service.mcpServer = element.mcpServer;
622
624
  if (element.ownership) {
623
625
  service.ownership = V1_buildServiceOwnership(element.ownership, service);
624
626
  }
@@ -751,6 +753,12 @@ export class V1_ElementSecondPassBuilder
751
753
  dataProduct.accessPointGroups = element.accessPointGroups.map((gr) =>
752
754
  V1_buildAccessPointGroup(gr, this.context),
753
755
  );
756
+ if (element.nativeModelAccess) {
757
+ dataProduct.nativeModelAccess = V1_buildNativeModelAccess(
758
+ element.nativeModelAccess,
759
+ this.context,
760
+ );
761
+ }
754
762
  const protocolSupportInfo = element.supportInfo;
755
763
  if (protocolSupportInfo) {
756
764
  const supportInfo = new SupportInfo();
@@ -14,7 +14,11 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { isNonNullable, UnsupportedOperationError } from '@finos/legend-shared';
17
+ import {
18
+ guaranteeNonNullable,
19
+ isNonNullable,
20
+ UnsupportedOperationError,
21
+ } from '@finos/legend-shared';
18
22
  import {
19
23
  type AccessPoint,
20
24
  type DataProductElement,
@@ -33,6 +37,12 @@ import {
33
37
  ModelAccessPointGroup,
34
38
  UnknownAccessPoint,
35
39
  UnknownDataProductIcon,
40
+ NativeModelAccess,
41
+ type SampleQuery,
42
+ PackageableElementSampleQuery,
43
+ InLineSampleQuery,
44
+ DataProductDiagram,
45
+ NativeModelExecutionContext,
36
46
  } from '../../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
37
47
  import {
38
48
  type V1_AccessPoint,
@@ -45,9 +55,14 @@ import {
45
55
  V1_FunctionAccessPoint,
46
56
  V1_LakehouseAccessPoint,
47
57
  V1_ModelAccessPointGroup,
58
+ type V1_NativeModelAccess,
59
+ type V1_SampleQuery,
48
60
  V1_UnknownAccessPoint,
49
61
  V1_UnknownDataProductIcon,
50
62
  type V1_DataProductOperationalMetadata,
63
+ V1_PackageableElementSampleQuery,
64
+ V1_InLineSampleQuery,
65
+ type V1_NativeModelExecutionContext,
51
66
  } from '../../../../model/packageableElements/dataProduct/V1_DataProduct.js';
52
67
  import type { V1_GraphBuilderContext } from '../V1_GraphBuilderContext.js';
53
68
  import { V1_buildRawLambdaWithResolvedPaths } from './V1_ValueSpecificationPathResolver.js';
@@ -59,6 +74,7 @@ import { Package } from '../../../../../../../../graph/metamodel/pure/packageabl
59
74
  import { Class } from '../../../../../../../../graph/metamodel/pure/packageableElements/domain/Class.js';
60
75
  import { Enumeration } from '../../../../../../../../graph/metamodel/pure/packageableElements/domain/Enumeration.js';
61
76
  import { Association } from '../../../../../../../../graph/metamodel/pure/packageableElements/domain/Association.js';
77
+ import { generateFunctionPrettyName } from '../../../../../../../../graph/helpers/PureLanguageHelper.js';
62
78
 
63
79
  export const V1_buildDataProductLink = (
64
80
  link: V1_DataProductLink,
@@ -202,3 +218,147 @@ export const V1_buildAccessPointGroup = (
202
218
  return group;
203
219
  }
204
220
  };
221
+
222
+ export const V1_buildNativeModelExecutionContext = (
223
+ nativeModelExecutionContext: V1_NativeModelExecutionContext,
224
+ context: V1_GraphBuilderContext,
225
+ ): NativeModelExecutionContext => {
226
+ const metamodelNativeModelExecutionContext =
227
+ new NativeModelExecutionContext();
228
+ metamodelNativeModelExecutionContext.key = nativeModelExecutionContext.key;
229
+ metamodelNativeModelExecutionContext.mapping =
230
+ PackageableElementExplicitReference.create(
231
+ context.graph.getMapping(nativeModelExecutionContext.mapping.path),
232
+ );
233
+ if (nativeModelExecutionContext.runtime) {
234
+ metamodelNativeModelExecutionContext.runtime =
235
+ PackageableElementExplicitReference.create(
236
+ context.graph.getRuntime(nativeModelExecutionContext.runtime.path),
237
+ );
238
+ }
239
+ return metamodelNativeModelExecutionContext;
240
+ };
241
+
242
+ export const V1_buildSampleQuery = (
243
+ sampleQuery: V1_SampleQuery,
244
+ defaultExecutionContext: string,
245
+ context: V1_GraphBuilderContext,
246
+ ): SampleQuery => {
247
+ if (sampleQuery instanceof V1_PackageableElementSampleQuery) {
248
+ const metamodelSampleQuery = new PackageableElementSampleQuery();
249
+ metamodelSampleQuery.id = sampleQuery.id;
250
+ metamodelSampleQuery.title = sampleQuery.title;
251
+ metamodelSampleQuery.description = sampleQuery.description;
252
+ metamodelSampleQuery.executionContextKey =
253
+ sampleQuery.executionContextKey ?? defaultExecutionContext;
254
+ try {
255
+ metamodelSampleQuery.query = context.resolveElement(
256
+ sampleQuery.query.path,
257
+ false,
258
+ );
259
+ } catch {
260
+ try {
261
+ metamodelSampleQuery.query = PackageableElementExplicitReference.create(
262
+ guaranteeNonNullable(
263
+ context.graph.functions.find(
264
+ (fn) =>
265
+ generateFunctionPrettyName(fn, {
266
+ fullPath: true,
267
+ spacing: false,
268
+ notIncludeParamName: true,
269
+ }) === sampleQuery.query.path.replaceAll(/\s*/gu, ''),
270
+ ),
271
+ ),
272
+ );
273
+ } catch {
274
+ throw new UnsupportedOperationError(
275
+ `Can't analyze data product executable with element in path: ${sampleQuery.query.path}`,
276
+ sampleQuery,
277
+ );
278
+ }
279
+ }
280
+
281
+ return metamodelSampleQuery;
282
+ } else if (sampleQuery instanceof V1_InLineSampleQuery) {
283
+ const metamodelSampleQuery = new InLineSampleQuery();
284
+ metamodelSampleQuery.id = sampleQuery.id;
285
+ metamodelSampleQuery.title = sampleQuery.title;
286
+ metamodelSampleQuery.description = sampleQuery.description;
287
+ metamodelSampleQuery.executionContextKey =
288
+ sampleQuery.executionContextKey ?? defaultExecutionContext;
289
+ metamodelSampleQuery.query = V1_buildRawLambdaWithResolvedPaths(
290
+ sampleQuery.query.parameters,
291
+ sampleQuery.query.body,
292
+ context,
293
+ );
294
+ return metamodelSampleQuery;
295
+ }
296
+
297
+ throw new UnsupportedOperationError(
298
+ `Unsupported data product sample query type`,
299
+ );
300
+ };
301
+
302
+ export const V1_buildNativeModelAccess = (
303
+ nativeModelAccess: V1_NativeModelAccess,
304
+ context: V1_GraphBuilderContext,
305
+ ): NativeModelAccess => {
306
+ const metamodelNativeModelAccess = new NativeModelAccess();
307
+ metamodelNativeModelAccess.defaultExecutionContext =
308
+ nativeModelAccess.defaultExecutionContext;
309
+ metamodelNativeModelAccess.nativeModelExecutionContexts =
310
+ nativeModelAccess.nativeModelExecutionContexts.map((executionContext) =>
311
+ V1_buildNativeModelExecutionContext(executionContext, context),
312
+ );
313
+ if (nativeModelAccess.sampleQueries) {
314
+ metamodelNativeModelAccess.sampleQueries =
315
+ nativeModelAccess.sampleQueries.map((sampleQuery) =>
316
+ V1_buildSampleQuery(
317
+ sampleQuery,
318
+ nativeModelAccess.defaultExecutionContext,
319
+ context,
320
+ ),
321
+ );
322
+ }
323
+ if (!nativeModelAccess.diagrams) {
324
+ metamodelNativeModelAccess.diagrams = [];
325
+ } else {
326
+ metamodelNativeModelAccess.diagrams = nativeModelAccess.diagrams.map(
327
+ (diagram) => {
328
+ const metadatamodelDiagram = new DataProductDiagram();
329
+ metadatamodelDiagram.diagram = context.graph.getElement(
330
+ diagram.diagram.path,
331
+ );
332
+ metadatamodelDiagram.title = diagram.title;
333
+ metadatamodelDiagram.description = diagram.description;
334
+ return metadatamodelDiagram;
335
+ },
336
+ );
337
+ }
338
+ if (nativeModelAccess.featuredElements) {
339
+ metamodelNativeModelAccess.featuredElements =
340
+ nativeModelAccess.featuredElements.map((pointer) => {
341
+ const elementReference = context.resolveElement(
342
+ pointer.element.path,
343
+ true,
344
+ );
345
+ if (
346
+ elementReference.value instanceof Package ||
347
+ elementReference.value instanceof Class ||
348
+ elementReference.value instanceof Enumeration ||
349
+ elementReference.value instanceof Association
350
+ ) {
351
+ const elementPointer = new DataProductElementScope();
352
+ elementPointer.element =
353
+ elementReference as unknown as PackageableElementReference<DataProductElement>;
354
+ elementPointer.exclude = pointer.exclude;
355
+ return elementPointer;
356
+ }
357
+ throw new UnsupportedOperationError(
358
+ `Can't find data product element (only allow packages, classes, enumerations, and associations) '${pointer.element.path}'`,
359
+ );
360
+ });
361
+ }
362
+
363
+ return metamodelNativeModelAccess;
364
+ };
@@ -48,6 +48,11 @@ import {
48
48
  V1_Expertise,
49
49
  V1_FunctionAccessPoint,
50
50
  V1_DataProductOperationalMetadata,
51
+ V1_NativeModelAccess,
52
+ type V1_SampleQuery,
53
+ V1_PackageableElementSampleQuery,
54
+ V1_InLineSampleQuery,
55
+ V1_NativeModelExecutionContext,
51
56
  } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
52
57
  import {
53
58
  UnsupportedOperationError,
@@ -87,6 +92,11 @@ export enum V1_AccessPointGrouptype {
87
92
  MODEL_ACCESS_POINT_GROUP = 'modelAccessPointGroup',
88
93
  }
89
94
 
95
+ export enum V1_SampleQueryType {
96
+ IN_LINE_SAMPLE_QUERY = 'inLineSampleQuery',
97
+ PACKAGEABLE_ELEMENT_SAMPLE_QUERY = 'packageableElementSampleQuery',
98
+ }
99
+
90
100
  export enum V1_DataProductIconType {
91
101
  LIBRARY_ICON = 'libraryIcon',
92
102
  EMBEDDED_IMAGE_ICON = 'embeddedImageIcon',
@@ -199,6 +209,85 @@ export const V1_ModelAccessPointGroupModelSchema = createModelSchema(
199
209
  },
200
210
  );
201
211
 
212
+ export const V1_PackageableElementSampleQueryModelSchema = createModelSchema(
213
+ V1_PackageableElementSampleQuery,
214
+ {
215
+ _type: usingConstantValueSchema(
216
+ V1_SampleQueryType.PACKAGEABLE_ELEMENT_SAMPLE_QUERY,
217
+ ),
218
+ id: primitive(),
219
+ title: primitive(),
220
+ description: optional(primitive()),
221
+ query: usingModelSchema(V1_packageableElementPointerModelSchema),
222
+ executionContextKey: optional(primitive()),
223
+ },
224
+ );
225
+
226
+ export const V1_InLineSampleQueryModelSchema = createModelSchema(
227
+ V1_InLineSampleQuery,
228
+ {
229
+ _type: usingConstantValueSchema(V1_SampleQueryType.IN_LINE_SAMPLE_QUERY),
230
+ id: primitive(),
231
+ title: primitive(),
232
+ description: optional(primitive()),
233
+ executionContextKey: optional(primitive()),
234
+ query: usingModelSchema(V1_rawLambdaModelSchema),
235
+ },
236
+ );
237
+
238
+ const V1_serializeSampleQuery = (
239
+ protocol: V1_SampleQuery,
240
+ ): PlainObject<V1_SampleQuery> => {
241
+ if (protocol instanceof V1_InLineSampleQuery) {
242
+ return serialize(V1_InLineSampleQueryModelSchema, protocol);
243
+ } else if (protocol instanceof V1_PackageableElementSampleQuery) {
244
+ return serialize(V1_PackageableElementSampleQueryModelSchema, protocol);
245
+ }
246
+ throw new UnsupportedOperationError(
247
+ `Can't serialize data product sample query`,
248
+ protocol,
249
+ );
250
+ };
251
+
252
+ export const V1_deserializeSampleQuery = (
253
+ json: PlainObject<V1_SampleQuery>,
254
+ ): V1_SampleQuery => {
255
+ switch (json._type) {
256
+ case V1_SampleQueryType.IN_LINE_SAMPLE_QUERY:
257
+ return deserialize(V1_InLineSampleQueryModelSchema, json);
258
+ case V1_SampleQueryType.PACKAGEABLE_ELEMENT_SAMPLE_QUERY:
259
+ default:
260
+ return deserialize(V1_PackageableElementSampleQueryModelSchema, json);
261
+ }
262
+ };
263
+
264
+ export const V1_NativeModelExecutionContextSchema = createModelSchema(
265
+ V1_NativeModelExecutionContext,
266
+ {
267
+ key: primitive(),
268
+ mapping: usingModelSchema(V1_packageableElementPointerModelSchema),
269
+ runtime: optionalCustomUsingModelSchema(
270
+ V1_packageableElementPointerModelSchema,
271
+ ),
272
+ },
273
+ );
274
+
275
+ export const V1_NativeModelAccessModelSchema = createModelSchema(
276
+ V1_NativeModelAccess,
277
+ {
278
+ diagrams: optionalCustomListWithSchema(V1_dataProductDiagramModelSchema),
279
+ sampleQueries: optionalCustomList(
280
+ (val: V1_SampleQuery) => V1_serializeSampleQuery(val),
281
+ (val) => V1_deserializeSampleQuery(val),
282
+ ),
283
+ nativeModelExecutionContexts: customListWithSchema(
284
+ V1_NativeModelExecutionContextSchema,
285
+ ),
286
+ featuredElements: optionalCustomListWithSchema(V1_ElementScopeModelSchema),
287
+ defaultExecutionContext: primitive(),
288
+ },
289
+ );
290
+
202
291
  export const V1_DefaultAccessPointGroupModelSchema = createModelSchema(
203
292
  V1_AccessPointGroup,
204
293
  {
@@ -369,6 +458,9 @@ export const V1_dataProductModelSchema = (
369
458
  V1_serializeAccessPointGroup,
370
459
  V1_deserializeAccessPointGroup,
371
460
  ),
461
+ nativeModelAccess: optionalCustomUsingModelSchema(
462
+ V1_NativeModelAccessModelSchema,
463
+ ),
372
464
  description: optional(primitive()),
373
465
  sampleValues: optionalCustomList(
374
466
  (data: V1_EmbeddedData) => V1_serializeEmbeddedDataType(data, plugins),
@@ -383,4 +383,5 @@ export const V1_serviceModelSchema = (
383
383
  postValidations: customListWithSchema(V1_servicePostValidationModelSchema, {
384
384
  INTERNAL__forceReturnEmptyInTest: true,
385
385
  }),
386
+ mcpServer: optional(primitive()),
386
387
  });
package/src/index.ts CHANGED
@@ -300,6 +300,7 @@ export {
300
300
  V1_ContractUserEventPayload,
301
301
  V1_ContractUserEventPrivilegeManagerPayload,
302
302
  V1_ContractUserEventRecord,
303
+ V1_ContractUserMembership,
303
304
  V1_ContractUserStatusResponse,
304
305
  V1_CreateContractPayload,
305
306
  V1_DataContract,
@@ -307,6 +308,7 @@ export {
307
308
  V1_DataContractsResponse,
308
309
  V1_DataContractSubscriptions,
309
310
  V1_EnrichedUserApprovalStatus,
311
+ V1_InvalidateDataContractResponse,
310
312
  V1_LiteDataContract,
311
313
  V1_LiteDataContractsResponse,
312
314
  V1_LiteDataContractWithUserStatus,
@@ -363,6 +365,7 @@ export {
363
365
  V1_ContractUserStatusResponseModelSchema,
364
366
  V1_createContractPayloadModelSchema,
365
367
  V1_DataContractApprovedUsersResponseModelSchema,
368
+ V1_dataContractModelSchema,
366
369
  V1_dataContractsResponseModelSchema,
367
370
  V1_DataProductOriginType,
368
371
  V1_deserializeDataContractResponse,
@@ -396,6 +399,14 @@ export {
396
399
  V1_DataProductArtifact,
397
400
  V1_AccessPointImplementation,
398
401
  V1_AccessPointGroupInfo,
402
+ V1_SampleQueryInfo,
403
+ V1_InLineSampleQueryInfo,
404
+ V1_PackageableElementSampleQueryInfo,
405
+ V1_NativeModelAccessInfo,
406
+ V1_DiagramInfo,
407
+ V1_EnumerationDocumentationEntry,
408
+ V1_AssociationDocumentationEntry,
409
+ V1_ClassDocumentationEntry,
399
410
  } from './graph-manager/protocol/pure/v1/lakehouse/deploy/V1_DataProductArtifact.js';
400
411
  export {
401
412
  V1_IngestEnvironmentType,