@finos/legend-graph 32.1.17 → 32.1.19

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 (111) hide show
  1. package/lib/graph/BasicModel.d.ts +6 -0
  2. package/lib/graph/BasicModel.d.ts.map +1 -1
  3. package/lib/graph/BasicModel.js +18 -0
  4. package/lib/graph/BasicModel.js.map +1 -1
  5. package/lib/graph/Core_HashUtils.d.ts +5 -1
  6. package/lib/graph/Core_HashUtils.d.ts.map +1 -1
  7. package/lib/graph/Core_HashUtils.js +5 -0
  8. package/lib/graph/Core_HashUtils.js.map +1 -1
  9. package/lib/graph/MetaModelConst.d.ts +2 -1
  10. package/lib/graph/MetaModelConst.d.ts.map +1 -1
  11. package/lib/graph/MetaModelConst.js +1 -0
  12. package/lib/graph/MetaModelConst.js.map +1 -1
  13. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts +42 -0
  14. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts.map +1 -0
  15. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js +71 -0
  16. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js.map +1 -0
  17. package/lib/graph/metamodel/pure/packageableElements/PackageableElement.d.ts +2 -0
  18. package/lib/graph/metamodel/pure/packageableElements/PackageableElement.d.ts.map +1 -1
  19. package/lib/graph/metamodel/pure/packageableElements/PackageableElement.js.map +1 -1
  20. package/lib/graph-manager/AbstractPureGraphManager.d.ts +1 -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/DataProductObserveHelper.d.ts +19 -0
  24. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.d.ts.map +1 -0
  25. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js +39 -0
  26. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js.map +1 -0
  27. package/lib/graph-manager/action/changeDetection/PackageableElementObserver.d.ts.map +1 -1
  28. package/lib/graph-manager/action/changeDetection/PackageableElementObserver.js +4 -0
  29. package/lib/graph-manager/action/changeDetection/PackageableElementObserver.js.map +1 -1
  30. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts +2 -0
  31. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  32. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +8 -0
  33. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  34. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts +1 -0
  35. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts.map +1 -1
  36. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.js +1 -1
  37. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.js.map +1 -1
  38. package/lib/graph-manager/protocol/pure/v1/engine/V1_RemoteEngine.d.ts.map +1 -1
  39. package/lib/graph-manager/protocol/pure/v1/engine/V1_RemoteEngine.js +1 -0
  40. package/lib/graph-manager/protocol/pure/v1/engine/V1_RemoteEngine.js.map +1 -1
  41. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.d.ts +2 -0
  42. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.d.ts.map +1 -1
  43. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.js.map +1 -1
  44. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts +38 -0
  45. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts.map +1 -0
  46. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js +61 -0
  47. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js.map +1 -0
  48. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.d.ts +20 -0
  49. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.d.ts.map +1 -0
  50. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js +42 -0
  51. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js.map +1 -0
  52. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.d.ts.map +1 -1
  53. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.js +4 -0
  54. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.js.map +1 -1
  55. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.d.ts +2 -0
  56. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.d.ts.map +1 -1
  57. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.js +3 -0
  58. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.js.map +1 -1
  59. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.d.ts +2 -0
  60. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.d.ts.map +1 -1
  61. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.js +11 -0
  62. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.js.map +1 -1
  63. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.d.ts +2 -0
  64. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.d.ts.map +1 -1
  65. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.js +3 -0
  66. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.js.map +1 -1
  67. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts +2 -0
  68. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
  69. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +17 -0
  70. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
  71. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.d.ts +2 -0
  72. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.d.ts.map +1 -1
  73. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.js +3 -0
  74. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.js.map +1 -1
  75. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.d.ts.map +1 -1
  76. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.js +7 -0
  77. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.js.map +1 -1
  78. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts +24 -0
  79. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts.map +1 -0
  80. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js +59 -0
  81. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js.map +1 -0
  82. package/lib/index.d.ts +4 -0
  83. package/lib/index.d.ts.map +1 -1
  84. package/lib/index.js +5 -0
  85. package/lib/index.js.map +1 -1
  86. package/lib/package.json +1 -1
  87. package/package.json +3 -3
  88. package/src/graph/BasicModel.ts +22 -0
  89. package/src/graph/Core_HashUtils.ts +7 -0
  90. package/src/graph/MetaModelConst.ts +1 -0
  91. package/src/graph/metamodel/pure/dataProduct/DataProduct.ts +94 -0
  92. package/src/graph/metamodel/pure/packageableElements/PackageableElement.ts +2 -0
  93. package/src/graph-manager/AbstractPureGraphManager.ts +1 -0
  94. package/src/graph-manager/action/changeDetection/DataProductObserveHelper.ts +54 -0
  95. package/src/graph-manager/action/changeDetection/PackageableElementObserver.ts +6 -0
  96. package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +6 -0
  97. package/src/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.ts +5 -1
  98. package/src/graph-manager/protocol/pure/v1/engine/V1_RemoteEngine.ts +1 -0
  99. package/src/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.ts +3 -0
  100. package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.ts +86 -0
  101. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.ts +57 -0
  102. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.ts +6 -0
  103. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.ts +5 -0
  104. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.ts +26 -0
  105. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.ts +5 -0
  106. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +36 -0
  107. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.ts +5 -0
  108. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.ts +13 -0
  109. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.ts +89 -0
  110. package/src/index.ts +16 -0
  111. package/tsconfig.json +5 -0
@@ -77,6 +77,8 @@ import type { INTERNAL__UnknownStore } from '../../../graph/metamodel/pure/packa
77
77
  import type { SnowflakeApp } from '../../../graph/metamodel/pure/packageableElements/function/SnowflakeApp.js';
78
78
  import type { INTERNAL__UnknownElement } from '../../../graph/metamodel/pure/packageableElements/INTERNAL__UnknownElement.js';
79
79
  import type { HostedService } from '../../../graph/metamodel/pure/packageableElements/function/HostedService.js';
80
+ import type { DataProduct } from '../../../graph/metamodel/pure/dataProduct/DataProduct.js';
81
+ import { observe_DataProduct } from './DataProductObserveHelper.js';
80
82
 
81
83
  class PackageableElementObserver implements PackageableElementVisitor<void> {
82
84
  observerContext: ObserverContext;
@@ -169,6 +171,10 @@ class PackageableElementObserver implements PackageableElementVisitor<void> {
169
171
  observe_Database(element, this.observerContext);
170
172
  }
171
173
 
174
+ visit_DataProduct(element: DataProduct): void {
175
+ observe_DataProduct(element);
176
+ }
177
+
172
178
  visit_Mapping(element: Mapping): void {
173
179
  observe_Mapping(element, this.observerContext);
174
180
  }
@@ -360,6 +360,7 @@ import {
360
360
  V1_buildFunctionSignature,
361
361
  V1_createGenericTypeWithElementPath,
362
362
  } from './helpers/V1_DomainHelper.js';
363
+ import { V1_DataProduct } from './model/packageableElements/dataProduct/V1_DataProduct.js';
363
364
 
364
365
  class V1_PureModelContextDataIndex {
365
366
  elements: V1_PackageableElement[] = [];
@@ -387,6 +388,7 @@ class V1_PureModelContextDataIndex {
387
388
 
388
389
  services: V1_Service[] = [];
389
390
  executionEnvironments: V1_ExecutionEnvironmentInstance[] = [];
391
+ products: V1_DataProduct[] = [];
390
392
 
391
393
  INTERNAL__UnknownElement: V1_INTERNAL__UnknownElement[] = [];
392
394
  INTERNAL__unknownElements: V1_INTERNAL__UnknownPackageableElement[] = [];
@@ -469,6 +471,8 @@ export const V1_indexPureModelContextData = (
469
471
  index.dataElements.push(el);
470
472
  } else if (el instanceof V1_ExecutionEnvironmentInstance) {
471
473
  index.executionEnvironments.push(el);
474
+ } else if (el instanceof V1_DataProduct) {
475
+ index.products.push(el);
472
476
  } else {
473
477
  const clazz = getClass<V1_PackageableElement>(el);
474
478
  if (otherElementsByClass.has(clazz)) {
@@ -4445,6 +4449,8 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
4445
4449
  return CORE_PURE_PATH.SNOWFLAKE_APP;
4446
4450
  } else if (protocol instanceof V1_HostedService) {
4447
4451
  return CORE_PURE_PATH.HOSTED_SERVICE;
4452
+ } else if (protocol instanceof V1_DataProduct) {
4453
+ return CORE_PURE_PATH.DATA_PRODUCT;
4448
4454
  }
4449
4455
  const extraElementProtocolClassifierPathGetters = this.pluginManager
4450
4456
  .getPureProtocolProcessorPlugins()
@@ -721,10 +721,14 @@ export class V1_EngineServerClient extends AbstractServerClient {
721
721
  returnAsResponse?: boolean;
722
722
  serializationFormat?: EXECUTION_SERIALIZATION_FORMAT | undefined;
723
723
  abortController?: AbortController | undefined;
724
+ tracingTags?: PlainObject | undefined;
724
725
  },
725
726
  ): Promise<PlainObject<V1_ExecutionResult> | Response> =>
726
727
  this.postWithTracing(
727
- this.getTraceData(CORE_ENGINE_ACTIVITY_TRACE.EXECUTE),
728
+ this.getTraceData(
729
+ CORE_ENGINE_ACTIVITY_TRACE.EXECUTE,
730
+ options?.tracingTags,
731
+ ),
728
732
  `${this._execution()}/execute`,
729
733
  this.debugPayload(input, CORE_ENGINE_ACTIVITY_TRACE.EXECUTE),
730
734
  {
@@ -837,6 +837,7 @@ export class V1_RemoteEngine implements V1_GraphManagerEngine {
837
837
  returnAsResponse: true,
838
838
  serializationFormat: options?.serializationFormat,
839
839
  abortController: options?.abortController,
840
+ tracingTags: options?.tracingtags,
840
841
  },
841
842
  )) as Response;
842
843
  result.set(V1_EXECUTION_RESULT, await response.text());
@@ -40,6 +40,7 @@ import type { V1_INTERNAL__UnknownStore } from './store/V1_INTERNAL__UnknownStor
40
40
  import type { V1_SnowflakeApp } from './function/V1_SnowflakeApp.js';
41
41
  import type { V1_INTERNAL__UnknownElement } from './V1_INTERNAL__UnknownElement.js';
42
42
  import type { V1_HostedService } from './function/V1_HostedService.js';
43
+ import type { V1_DataProduct } from './dataProduct/V1_DataProduct.js';
43
44
 
44
45
  export interface V1_PackageableElementVisitor<T> {
45
46
  visit_PackageableElement(element: V1_PackageableElement): T;
@@ -74,6 +75,8 @@ export interface V1_PackageableElementVisitor<T> {
74
75
  ): T;
75
76
  visit_SnowflakeApp(element: V1_SnowflakeApp): T;
76
77
  visit_HostedService(element: V1_HostedService): T;
78
+
79
+ visit_DataProduct(element: V1_DataProduct): T;
77
80
  }
78
81
 
79
82
  export abstract class V1_PackageableElement implements Hashable {
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Copyright (c) 2020-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 {
18
+ hashArray,
19
+ type Hashable,
20
+ type PlainObject,
21
+ } from '@finos/legend-shared';
22
+ import type { V1_RawLambda } from '../../rawValueSpecification/V1_RawLambda.js';
23
+ import {
24
+ V1_PackageableElement,
25
+ type V1_PackageableElementVisitor,
26
+ } from '../V1_PackageableElement.js';
27
+ import {
28
+ CORE_HASH_STRUCTURE,
29
+ hashObjectWithoutSourceInformation,
30
+ } from '../../../../../../../graph/Core_HashUtils.js';
31
+
32
+ export const V1_DATA_PRODUCT_ELEMENT_PROTOCOL_TYPE = 'dataProduct';
33
+
34
+ export abstract class V1_AccessPoint implements Hashable {
35
+ id!: string;
36
+
37
+ get hashCode(): string {
38
+ return hashArray([CORE_HASH_STRUCTURE.DATA_PRODUCT_ACCESS_POINT, this.id]);
39
+ }
40
+ }
41
+
42
+ export class V1_LakehouseAccessPoint
43
+ extends V1_AccessPoint
44
+ implements Hashable
45
+ {
46
+ targetEnvironment!: string;
47
+ func!: V1_RawLambda;
48
+
49
+ override get hashCode(): string {
50
+ return hashArray([
51
+ super.hashCode,
52
+ CORE_HASH_STRUCTURE.LAKEHOUSE_ACCESS_POINT,
53
+ this.targetEnvironment,
54
+ this.func,
55
+ ]);
56
+ }
57
+ }
58
+
59
+ // handle incoming accesspoints not yet modeled
60
+ export class V1_UnknownAccessPoint extends V1_AccessPoint implements Hashable {
61
+ content!: PlainObject;
62
+ override get hashCode(): string {
63
+ return hashArray([
64
+ super.hashCode,
65
+ CORE_HASH_STRUCTURE.UNKNOWN_ACCESS_POINT,
66
+ hashObjectWithoutSourceInformation(this.content),
67
+ ]);
68
+ }
69
+ }
70
+
71
+ export class V1_DataProduct extends V1_PackageableElement implements Hashable {
72
+ accessPoints: V1_AccessPoint[] = [];
73
+
74
+ override get hashCode(): string {
75
+ return hashArray([
76
+ CORE_HASH_STRUCTURE.DATA_PRODUCT,
77
+ hashArray(this.accessPoints),
78
+ ]);
79
+ }
80
+
81
+ override accept_PackageableElementVisitor<T>(
82
+ visitor: V1_PackageableElementVisitor<T>,
83
+ ): T {
84
+ return visitor.visit_DataProduct(this);
85
+ }
86
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Copyright (c) 2020-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 { UnsupportedOperationError } from '@finos/legend-shared';
18
+ import {
19
+ LakehouseAccessPoint,
20
+ UnknownAccessPoint,
21
+ type DataProduct,
22
+ } from '../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
23
+ import {
24
+ V1_DataProduct,
25
+ V1_LakehouseAccessPoint,
26
+ V1_UnknownAccessPoint,
27
+ } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
28
+ import { V1_initPackageableElement } from './V1_CoreTransformerHelper.js';
29
+ import { V1_transformRawLambda } from './V1_RawValueSpecificationTransformer.js';
30
+ import type { V1_GraphTransformerContext } from './V1_GraphTransformerContext.js';
31
+
32
+ export const V1_transformDataProduct = (
33
+ element: DataProduct,
34
+ context: V1_GraphTransformerContext,
35
+ ): V1_DataProduct => {
36
+ const product = new V1_DataProduct();
37
+ V1_initPackageableElement(product, element);
38
+ product.accessPoints = element.accessPoints.map((ap) => {
39
+ if (ap instanceof LakehouseAccessPoint) {
40
+ const lake = new V1_LakehouseAccessPoint();
41
+ lake.id = ap.id;
42
+ lake.func = V1_transformRawLambda(ap.func, context);
43
+ lake.targetEnvironment = ap.targetEnvironment;
44
+ return lake;
45
+ } else if (ap instanceof UnknownAccessPoint) {
46
+ const un = new V1_UnknownAccessPoint();
47
+ un.content = ap.content;
48
+ un.id = ap.id;
49
+ return un;
50
+ }
51
+ throw new UnsupportedOperationError(
52
+ `Unable to transform data product access point`,
53
+ );
54
+ });
55
+
56
+ return product;
57
+ };
@@ -95,6 +95,8 @@ import { V1_INTERNAL__UnknownElement } from '../../../model/packageableElements/
95
95
  import type { HostedService } from '../../../../../../../graph/metamodel/pure/packageableElements/function/HostedService.js';
96
96
  import { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
97
97
  import { V1_transformFunctionActivatorActions } from '../to/helpers/V1_LegendLambdaTransformerHelper.js';
98
+ import type { DataProduct } from '../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
99
+ import { V1_transformDataProduct } from './V1_DataProductTransformer.js';
98
100
 
99
101
  class V1_PackageableElementTransformer
100
102
  implements PackageableElementVisitor<V1_PackageableElement>
@@ -275,6 +277,10 @@ class V1_PackageableElementTransformer
275
277
  return V1_transformDatabase(element, this.context);
276
278
  }
277
279
 
280
+ visit_DataProduct(element: DataProduct): V1_PackageableElement {
281
+ return V1_transformDataProduct(element, this.context);
282
+ }
283
+
278
284
  visit_Mapping(element: Mapping): V1_PackageableElement {
279
285
  return V1_transformMapping(element, this.context);
280
286
  }
@@ -51,6 +51,7 @@ import type { V1_INTERNAL__UnknownStore } from '../../../model/packageableElemen
51
51
  import type { V1_SnowflakeApp } from '../../../model/packageableElements/function/V1_SnowflakeApp.js';
52
52
  import type { V1_INTERNAL__UnknownElement } from '../../../model/packageableElements/V1_INTERNAL__UnknownElement.js';
53
53
  import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
54
+ import type { V1_DataProduct } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
54
55
 
55
56
  export class V1_ElementFifthPassBuilder
56
57
  implements V1_PackageableElementVisitor<void>
@@ -180,4 +181,8 @@ export class V1_ElementFifthPassBuilder
180
181
  visit_HostedService(element: V1_HostedService): void {
181
182
  throw new UnsupportedOperationError();
182
183
  }
184
+
185
+ visit_DataProduct(element: V1_DataProduct): void {
186
+ throw new UnsupportedOperationError();
187
+ }
183
188
  }
@@ -83,6 +83,8 @@ import { HostedService } from '../../../../../../../graph/metamodel/pure/package
83
83
  import { V1_buildFunctionActivatorActions } from './helpers/V1_LegendLambdaHelper.js';
84
84
  import { GenericTypeImplicitReference } from '../../../../../../../graph/metamodel/pure/packageableElements/domain/GenericTypeReference.js';
85
85
  import { GenericType } from '../../../../../../../graph/metamodel/pure/packageableElements/domain/GenericType.js';
86
+ import type { V1_DataProduct } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
87
+ import { DataProduct } from '../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
86
88
 
87
89
  export class V1_ElementFirstPassBuilder
88
90
  implements V1_PackageableElementVisitor<PackageableElement>
@@ -711,4 +713,28 @@ export class V1_ElementFirstPassBuilder
711
713
  this.context.currentSubGraph.setOwnExecutionEnvironment(path, exEnvir);
712
714
  return exEnvir;
713
715
  }
716
+
717
+ visit_DataProduct(element: V1_DataProduct): PackageableElement {
718
+ assertNonEmptyString(
719
+ element.package,
720
+ `Data Product 'package' field is missing or empty`,
721
+ );
722
+ assertNonEmptyString(
723
+ element.name,
724
+ `Data Product 'name' field is missing or empty`,
725
+ );
726
+ const product = new DataProduct(element.name);
727
+ const path = V1_buildFullPath(element.package, element.name);
728
+ V1_checkDuplicatedElement(path, this.context, this.elementPathCache);
729
+ addElementToPackage(
730
+ getOrCreateGraphPackage(
731
+ this.context.currentSubGraph,
732
+ element.package,
733
+ this.packageCache,
734
+ ),
735
+ product,
736
+ );
737
+ this.context.currentSubGraph.setOwnDataProduct(path, product);
738
+ return product;
739
+ }
714
740
  }
@@ -63,6 +63,7 @@ import type { V1_INTERNAL__UnknownStore } from '../../../model/packageableElemen
63
63
  import type { V1_SnowflakeApp } from '../../../model/packageableElements/function/V1_SnowflakeApp.js';
64
64
  import type { V1_INTERNAL__UnknownElement } from '../../../model/packageableElements/V1_INTERNAL__UnknownElement.js';
65
65
  import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
66
+ import type { V1_DataProduct } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
66
67
 
67
68
  export class V1_ElementFourthPassBuilder
68
69
  implements V1_PackageableElementVisitor<void>
@@ -119,6 +120,10 @@ export class V1_ElementFourthPassBuilder
119
120
  throw new UnsupportedOperationError();
120
121
  }
121
122
 
123
+ visit_DataProduct(element: V1_DataProduct): void {
124
+ throw new UnsupportedOperationError();
125
+ }
126
+
122
127
  visit_Class(element: V1_Class): void {
123
128
  const _class = this.context.currentSubGraph.getOwnClass(
124
129
  V1_buildFullPath(element.package, element.name),
@@ -112,6 +112,16 @@ import {
112
112
  } from './helpers/V1_FunctionActivatorBuilderHelper.js';
113
113
  import type { V1_INTERNAL__UnknownElement } from '../../../model/packageableElements/V1_INTERNAL__UnknownElement.js';
114
114
  import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
115
+ import {
116
+ V1_LakehouseAccessPoint,
117
+ V1_UnknownAccessPoint,
118
+ type V1_DataProduct,
119
+ } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
120
+ import {
121
+ LakehouseAccessPoint,
122
+ UnknownAccessPoint,
123
+ } from '../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
124
+ import { V1_buildRawLambdaWithResolvedPaths } from './helpers/V1_ValueSpecificationPathResolver.js';
115
125
 
116
126
  export class V1_ElementSecondPassBuilder
117
127
  implements V1_PackageableElementVisitor<void>
@@ -600,4 +610,30 @@ export class V1_ElementSecondPassBuilder
600
610
  V1_buildExecutionParameters(e, this.context),
601
611
  );
602
612
  }
613
+
614
+ visit_DataProduct(element: V1_DataProduct): void {
615
+ const execEnv = this.context.currentSubGraph.getOwnDataProduct(
616
+ V1_buildFullPath(element.package, element.name),
617
+ );
618
+ execEnv.accessPoints = element.accessPoints.map((ap) => {
619
+ if (ap instanceof V1_LakehouseAccessPoint) {
620
+ return new LakehouseAccessPoint(
621
+ ap.id,
622
+ ap.targetEnvironment,
623
+ V1_buildRawLambdaWithResolvedPaths(
624
+ ap.func.parameters,
625
+ ap.func.body,
626
+ this.context,
627
+ ),
628
+ );
629
+ } else if (ap instanceof V1_UnknownAccessPoint) {
630
+ const unkown = new UnknownAccessPoint(ap.id);
631
+ unkown.content = ap.content;
632
+ return unkown;
633
+ }
634
+ throw new UnsupportedOperationError(
635
+ `Unsupported data product access type ${ap}`,
636
+ );
637
+ });
638
+ }
603
639
  }
@@ -66,6 +66,7 @@ import type { V1_INTERNAL__UnknownStore } from '../../../model/packageableElemen
66
66
  import type { V1_SnowflakeApp } from '../../../model/packageableElements/function/V1_SnowflakeApp.js';
67
67
  import type { V1_INTERNAL__UnknownElement } from '../../../model/packageableElements/V1_INTERNAL__UnknownElement.js';
68
68
  import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
69
+ import type { V1_DataProduct } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
69
70
 
70
71
  export class V1_ElementThirdPassBuilder
71
72
  implements V1_PackageableElementVisitor<void>
@@ -274,4 +275,8 @@ export class V1_ElementThirdPassBuilder
274
275
  visit_DataElement(element: V1_DataElement): void {
275
276
  throw new UnsupportedOperationError();
276
277
  }
278
+
279
+ visit_DataProduct(element: V1_DataProduct): void {
280
+ throw new UnsupportedOperationError();
281
+ }
277
282
  }
@@ -121,6 +121,11 @@ import { V1_INTERNAL__UnknownStore } from '../../model/packageableElements/store
121
121
  import type { V1_SnowflakeApp } from '../../model/packageableElements/function/V1_SnowflakeApp.js';
122
122
  import { V1_INTERNAL__UnknownElement } from '../../model/packageableElements/V1_INTERNAL__UnknownElement.js';
123
123
  import type { V1_HostedService } from '../../model/packageableElements/function/V1_HostedService.js';
124
+ import {
125
+ V1_DATA_PRODUCT_ELEMENT_PROTOCOL_TYPE,
126
+ type V1_DataProduct,
127
+ } from '../../model/packageableElements/dataProduct/V1_DataProduct.js';
128
+ import { V1_dataProductModelSchema } from './serializationHelpers/V1_DataProductSerializationHelper.js';
124
129
 
125
130
  class V1_PackageableElementSerializer
126
131
  implements V1_PackageableElementVisitor<PlainObject<V1_PackageableElement>>
@@ -223,6 +228,12 @@ class V1_PackageableElementSerializer
223
228
  return serialize(V1_databaseModelSchema, element);
224
229
  }
225
230
 
231
+ visit_DataProduct(
232
+ element: V1_DataProduct,
233
+ ): PlainObject<V1_PackageableElement> {
234
+ return serialize(V1_dataProductModelSchema, element);
235
+ }
236
+
226
237
  visit_Mapping(element: V1_Mapping): PlainObject<V1_PackageableElement> {
227
238
  return serialize(V1_mappingModelSchema(this.plugins), element);
228
239
  }
@@ -352,6 +363,8 @@ export const V1_deserializePackageableElement = (
352
363
  return deserialize(V1_snowflakeAppModelSchema, json);
353
364
  case V1_HOSTED_SERVICE_TYPE:
354
365
  return deserialize(V1_HostedServiceModelSchema, json);
366
+ case V1_DATA_PRODUCT_ELEMENT_PROTOCOL_TYPE:
367
+ return deserialize(V1_dataProductModelSchema, json);
355
368
  default: {
356
369
  for (const deserializer of extraElementProtocolDeserializers) {
357
370
  const protocol = deserializer(json, plugins);
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Copyright (c) 2020-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 {
18
+ createModelSchema,
19
+ deserialize,
20
+ primitive,
21
+ serialize,
22
+ } from 'serializr';
23
+ import {
24
+ type V1_AccessPoint,
25
+ V1_DATA_PRODUCT_ELEMENT_PROTOCOL_TYPE,
26
+ V1_DataProduct,
27
+ V1_LakehouseAccessPoint,
28
+ V1_UnknownAccessPoint,
29
+ } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
30
+ import {
31
+ UnsupportedOperationError,
32
+ usingConstantValueSchema,
33
+ usingModelSchema,
34
+ customList,
35
+ type PlainObject,
36
+ } from '@finos/legend-shared';
37
+ import { V1_rawLambdaModelSchema } from './V1_RawValueSpecificationSerializationHelper.js';
38
+
39
+ export enum V1_AccessPointType {
40
+ LAKEHOUSE = 'lakehouseAccessPoint',
41
+ EQUAL_TO_JSON = 'equalToJson',
42
+ EQUAL_TO_TDS = 'equalToTDS',
43
+ }
44
+
45
+ export const V1_lakehouseAccessPointModelSchema = createModelSchema(
46
+ V1_LakehouseAccessPoint,
47
+ {
48
+ _type: usingConstantValueSchema(V1_AccessPointType.LAKEHOUSE),
49
+ id: primitive(),
50
+ targetEnvironment: primitive(),
51
+ func: usingModelSchema(V1_rawLambdaModelSchema),
52
+ },
53
+ );
54
+
55
+ const V1_serializeAccessPoint = (
56
+ protocol: V1_AccessPoint,
57
+ ): PlainObject<V1_AccessPoint> => {
58
+ if (protocol instanceof V1_LakehouseAccessPoint) {
59
+ return serialize(V1_lakehouseAccessPointModelSchema, protocol);
60
+ } else if (protocol instanceof V1_UnknownAccessPoint) {
61
+ return protocol.content;
62
+ }
63
+ throw new UnsupportedOperationError(
64
+ `Can't serialize access point type`,
65
+ protocol,
66
+ );
67
+ };
68
+
69
+ const V1_deserializeAccessPoint = (
70
+ json: PlainObject<V1_AccessPoint>,
71
+ ): V1_AccessPoint => {
72
+ switch (json._type) {
73
+ case V1_AccessPointType.LAKEHOUSE:
74
+ return deserialize(V1_lakehouseAccessPointModelSchema, json);
75
+ default: {
76
+ const unknown = new V1_UnknownAccessPoint();
77
+ unknown.content = json;
78
+ unknown.id = json.id as string;
79
+ return unknown;
80
+ }
81
+ }
82
+ };
83
+
84
+ export const V1_dataProductModelSchema = createModelSchema(V1_DataProduct, {
85
+ _type: usingConstantValueSchema(V1_DATA_PRODUCT_ELEMENT_PROTOCOL_TYPE),
86
+ name: primitive(),
87
+ package: primitive(),
88
+ accessPoints: customList(V1_serializeAccessPoint, V1_deserializeAccessPoint),
89
+ });
package/src/index.ts CHANGED
@@ -158,6 +158,11 @@ export { V1_Multiplicity } from './graph-manager/protocol/pure/v1/model/packagea
158
158
  export { V1_ExternalFormatDescription } from './graph-manager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatDescription.js';
159
159
  export { V1_ExternalFormatModelGenerationInput } from './graph-manager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatModelGeneration.js';
160
160
  export { V1_GenerateSchemaInput } from './graph-manager/protocol/pure/v1/engine/externalFormat/V1_GenerateSchemaInput.js';
161
+ export {
162
+ V1_DataProduct,
163
+ V1_LakehouseAccessPoint,
164
+ V1_AccessPoint,
165
+ } from './graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js';
161
166
  export {
162
167
  V1_ExecuteInput,
163
168
  V1_TestDataGenerationExecutionInput,
@@ -448,6 +453,7 @@ export {
448
453
  V1_RawValueSpecificationType,
449
454
  V1_deserializeRawValueSpecificationType,
450
455
  } from './graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_RawValueSpecificationSerializationHelper.js';
456
+ export { V1_dataProductModelSchema } from './graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js';
451
457
  export { V1_transformPropertyReference } from './graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js';
452
458
  export * from './graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.js';
453
459
  export {
@@ -553,6 +559,16 @@ export * from './graph-manager/action/changeDetection/DSL_Generation_ObserverHel
553
559
  export * from './graph-manager/action/changeDetection/Testable_ObserverHelper.js';
554
560
  export * from './graph-manager/action/changeDetection/DSL_FunctionActivatorObserverHelper.js';
555
561
 
562
+ // ------------------------------------- Data Product --------------------------------------------
563
+
564
+ export {
565
+ DataProduct,
566
+ LakehouseAccessPoint,
567
+ LakehouseTargetEnv,
568
+ AccessPoint,
569
+ } from './graph/metamodel/pure/dataProduct/DataProduct.js';
570
+ export * from './graph-manager/action/changeDetection/DataProductObserveHelper.js';
571
+
556
572
  // ------------------------------------- DSL Data --------------------------------------------
557
573
 
558
574
  export { INTERNAL__UnknownEmbeddedData } from './graph/metamodel/pure/data/INTERNAL__UnknownEmbeddedData.js';
package/tsconfig.json CHANGED
@@ -89,6 +89,7 @@
89
89
  "./src/graph/metamodel/pure/data/EmbeddedData.ts",
90
90
  "./src/graph/metamodel/pure/data/INTERNAL__UnknownEmbeddedData.ts",
91
91
  "./src/graph/metamodel/pure/data/RelationalCSVData.ts",
92
+ "./src/graph/metamodel/pure/dataProduct/DataProduct.ts",
92
93
  "./src/graph/metamodel/pure/executionPlan/ExecutionPlan.ts",
93
94
  "./src/graph/metamodel/pure/executionPlan/nodes/AllocationExecutionNode.ts",
94
95
  "./src/graph/metamodel/pure/executionPlan/nodes/ConstantExecutionNode.ts",
@@ -376,6 +377,7 @@
376
377
  "./src/graph-manager/action/changeDetection/DSL_Generation_ObserverHelper.ts",
377
378
  "./src/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.ts",
378
379
  "./src/graph-manager/action/changeDetection/DSL_Service_ObserverHelper.ts",
380
+ "./src/graph-manager/action/changeDetection/DataProductObserveHelper.ts",
379
381
  "./src/graph-manager/action/changeDetection/DomainObserverHelper.ts",
380
382
  "./src/graph-manager/action/changeDetection/GraphObserverHelper.ts",
381
383
  "./src/graph-manager/action/changeDetection/PackageableElementObserver.ts",
@@ -553,6 +555,7 @@
553
555
  "./src/graph-manager/protocol/pure/v1/model/packageableElements/connection/V1_INTERNAL__UnknownConnection.ts",
554
556
  "./src/graph-manager/protocol/pure/v1/model/packageableElements/connection/V1_PackageableConnection.ts",
555
557
  "./src/graph-manager/protocol/pure/v1/model/packageableElements/data/V1_DataElement.ts",
558
+ "./src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.ts",
556
559
  "./src/graph-manager/protocol/pure/v1/model/packageableElements/domain/V1_Association.ts",
557
560
  "./src/graph-manager/protocol/pure/v1/model/packageableElements/domain/V1_Class.ts",
558
561
  "./src/graph-manager/protocol/pure/v1/model/packageableElements/domain/V1_Constraint.ts",
@@ -768,6 +771,7 @@
768
771
  "./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_CoreTransformerHelper.ts",
769
772
  "./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DSL_ExternalFormat_Transformer.ts",
770
773
  "./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.ts",
774
+ "./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.ts",
771
775
  "./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DatabaseTransformer.ts",
772
776
  "./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.ts",
773
777
  "./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ExecutionEnvironmentTransformer.ts",
@@ -836,6 +840,7 @@
836
840
  "./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_CoreSerializationHelper.ts",
837
841
  "./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DSL_ExternalFormat_ProtocolHelper.ts",
838
842
  "./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.ts",
843
+ "./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.ts",
839
844
  "./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.ts",
840
845
  "./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.ts",
841
846
  "./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ExecutionEnvironmentSerializationHelper.ts",