@finos/legend-graph 32.5.0 → 32.5.2

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 (49) hide show
  1. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts +4 -3
  2. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts.map +1 -1
  3. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js +7 -5
  4. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js.map +1 -1
  5. package/lib/graph/metamodel/pure/packageableElements/relation/Accessor.d.ts +1 -0
  6. package/lib/graph/metamodel/pure/packageableElements/relation/Accessor.d.ts.map +1 -1
  7. package/lib/graph/metamodel/pure/packageableElements/relation/Accessor.js +5 -1
  8. package/lib/graph/metamodel/pure/packageableElements/relation/Accessor.js.map +1 -1
  9. package/lib/graph-manager/action/query/Query.d.ts +7 -0
  10. package/lib/graph-manager/action/query/Query.d.ts.map +1 -1
  11. package/lib/graph-manager/action/query/Query.js +7 -0
  12. package/lib/graph-manager/action/query/Query.js.map +1 -1
  13. package/lib/graph-manager/helpers/DataProductHelper.d.ts +7 -2
  14. package/lib/graph-manager/helpers/DataProductHelper.d.ts.map +1 -1
  15. package/lib/graph-manager/helpers/DataProductHelper.js +27 -2
  16. package/lib/graph-manager/helpers/DataProductHelper.js.map +1 -1
  17. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts +13 -1
  18. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  19. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +214 -92
  20. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  21. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineHelper.d.ts.map +1 -1
  22. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineHelper.js +20 -2
  23. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineHelper.js.map +1 -1
  24. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_MappingModelCoverageAnalysis.d.ts.map +1 -1
  25. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_MappingModelCoverageAnalysis.js +7 -0
  26. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_MappingModelCoverageAnalysis.js.map +1 -1
  27. package/lib/graph-manager/protocol/pure/v1/engine/query/V1_Query.d.ts +6 -1
  28. package/lib/graph-manager/protocol/pure/v1/engine/query/V1_Query.d.ts.map +1 -1
  29. package/lib/graph-manager/protocol/pure/v1/engine/query/V1_Query.js +16 -0
  30. package/lib/graph-manager/protocol/pure/v1/engine/query/V1_Query.js.map +1 -1
  31. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts +1 -1
  32. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts.map +1 -1
  33. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js +6 -6
  34. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js.map +1 -1
  35. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.d.ts.map +1 -1
  36. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js +14 -10
  37. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js.map +1 -1
  38. package/lib/package.json +1 -1
  39. package/package.json +3 -3
  40. package/src/graph/metamodel/pure/dataProduct/DataProduct.ts +13 -5
  41. package/src/graph/metamodel/pure/packageableElements/relation/Accessor.ts +6 -1
  42. package/src/graph-manager/action/query/Query.ts +9 -0
  43. package/src/graph-manager/helpers/DataProductHelper.ts +47 -4
  44. package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +488 -484
  45. package/src/graph-manager/protocol/pure/v1/engine/V1_EngineHelper.ts +22 -0
  46. package/src/graph-manager/protocol/pure/v1/engine/analytics/V1_MappingModelCoverageAnalysis.ts +7 -0
  47. package/src/graph-manager/protocol/pure/v1/engine/query/V1_Query.ts +28 -0
  48. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.ts +6 -3
  49. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.ts +21 -23
@@ -27,6 +27,8 @@ import {
27
27
  type DataProductElement,
28
28
  type ElementScope,
29
29
  type NativeModelExecutionContext,
30
+ LakehouseAccessPoint,
31
+ type AccessPointGroup,
30
32
  } from '../../graph/metamodel/pure/dataProduct/DataProduct.js';
31
33
  import type { Mapping } from '../../graph/metamodel/pure/packageableElements/mapping/Mapping.js';
32
34
  import type { GraphManagerState } from '../GraphManagerState.js';
@@ -119,9 +121,26 @@ export const resolveUsableDataProductClasses = (
119
121
  return compatibleClasses;
120
122
  };
121
123
 
124
+ export const resolveLakehouseAccessPoint = (
125
+ dataProduct: DataProduct,
126
+ ): LakehouseAccessPoint | undefined => {
127
+ for (const group of dataProduct.accessPointGroups) {
128
+ const lakehouseAp = group.accessPoints.find(
129
+ (ap): ap is LakehouseAccessPoint => ap instanceof LakehouseAccessPoint,
130
+ );
131
+ if (lakehouseAp) {
132
+ return lakehouseAp;
133
+ }
134
+ }
135
+ return undefined;
136
+ };
137
+
122
138
  export const resolveDataProductExecutionState = (
123
139
  dataProduct: DataProduct,
124
- ): NativeModelExecutionContext | ModelAccessPointGroup => {
140
+ ):
141
+ | NativeModelExecutionContext
142
+ | ModelAccessPointGroup
143
+ | LakehouseAccessPoint => {
125
144
  if (isDataProductNative(dataProduct)) {
126
145
  return getModelGroupFromNativeDataProduct(dataProduct)
127
146
  .defaultExecutionContext;
@@ -129,9 +148,33 @@ export const resolveDataProductExecutionState = (
129
148
  const modelAccessGroup = dataProduct.accessPointGroups.filter(
130
149
  filterByType(ModelAccessPointGroup),
131
150
  )[0];
132
- return guaranteeNonNullable(
133
- modelAccessGroup,
134
- 'No native model access group or model access group on data product',
151
+ if (modelAccessGroup) {
152
+ return modelAccessGroup;
153
+ }
154
+ const lakehouseAccessPoint = resolveLakehouseAccessPoint(dataProduct);
155
+ if (lakehouseAccessPoint) {
156
+ return lakehouseAccessPoint;
157
+ }
158
+ throw new Error(
159
+ 'No native model access, model access group, or lakehouse access point on data product',
135
160
  );
136
161
  }
137
162
  };
163
+
164
+ export const findLakehouseAccessPointGroup = (
165
+ dataProduct: DataProduct,
166
+ accessPointId: string,
167
+ ):
168
+ | { group: AccessPointGroup; accessPoint: LakehouseAccessPoint }
169
+ | undefined => {
170
+ for (const group of dataProduct.accessPointGroups) {
171
+ const ap = group.accessPoints.find(
172
+ (a): a is LakehouseAccessPoint =>
173
+ a instanceof LakehouseAccessPoint && a.id === accessPointId,
174
+ );
175
+ if (ap) {
176
+ return { group, accessPoint: ap };
177
+ }
178
+ }
179
+ return undefined;
180
+ };