@finos/legend-graph 32.5.1 → 32.5.3

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 (60) 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-manager/AbstractPureGraphManager.d.ts +1 -0
  6. package/lib/graph-manager/AbstractPureGraphManager.d.ts.map +1 -1
  7. package/lib/graph-manager/AbstractPureGraphManager.js.map +1 -1
  8. package/lib/graph-manager/action/analytics/data-product/DataProductAnalysis.d.ts +4 -4
  9. package/lib/graph-manager/action/analytics/data-product/DataProductAnalysis.d.ts.map +1 -1
  10. package/lib/graph-manager/action/analytics/data-product/DataProductAnalysis.js.map +1 -1
  11. package/lib/graph-manager/action/query/Query.d.ts +2 -0
  12. package/lib/graph-manager/action/query/Query.d.ts.map +1 -1
  13. package/lib/graph-manager/action/query/Query.js +2 -0
  14. package/lib/graph-manager/action/query/Query.js.map +1 -1
  15. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts +22 -1
  16. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  17. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +289 -102
  18. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  19. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineHelper.d.ts.map +1 -1
  20. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineHelper.js +3 -0
  21. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineHelper.js.map +1 -1
  22. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts +1 -0
  23. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts.map +1 -1
  24. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.js +2 -0
  25. package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.js.map +1 -1
  26. package/lib/graph-manager/protocol/pure/v1/engine/V1_GraphManagerEngine.d.ts +1 -0
  27. package/lib/graph-manager/protocol/pure/v1/engine/V1_GraphManagerEngine.d.ts.map +1 -1
  28. package/lib/graph-manager/protocol/pure/v1/engine/V1_RemoteEngine.d.ts +1 -0
  29. package/lib/graph-manager/protocol/pure/v1/engine/V1_RemoteEngine.d.ts.map +1 -1
  30. package/lib/graph-manager/protocol/pure/v1/engine/V1_RemoteEngine.js +3 -0
  31. package/lib/graph-manager/protocol/pure/v1/engine/V1_RemoteEngine.js.map +1 -1
  32. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_MappingModelCoverageAnalysis.d.ts.map +1 -1
  33. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_MappingModelCoverageAnalysis.js +7 -0
  34. package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_MappingModelCoverageAnalysis.js.map +1 -1
  35. package/lib/graph-manager/protocol/pure/v1/engine/query/V1_Query.d.ts +2 -1
  36. package/lib/graph-manager/protocol/pure/v1/engine/query/V1_Query.d.ts.map +1 -1
  37. package/lib/graph-manager/protocol/pure/v1/engine/query/V1_Query.js +3 -1
  38. package/lib/graph-manager/protocol/pure/v1/engine/query/V1_Query.js.map +1 -1
  39. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts +1 -1
  40. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts.map +1 -1
  41. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js +6 -6
  42. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js.map +1 -1
  43. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.d.ts.map +1 -1
  44. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js +14 -10
  45. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js.map +1 -1
  46. package/lib/package.json +1 -1
  47. package/package.json +3 -3
  48. package/src/graph/metamodel/pure/dataProduct/DataProduct.ts +13 -5
  49. package/src/graph-manager/AbstractPureGraphManager.ts +4 -0
  50. package/src/graph-manager/action/analytics/data-product/DataProductAnalysis.ts +11 -4
  51. package/src/graph-manager/action/query/Query.ts +2 -0
  52. package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +690 -499
  53. package/src/graph-manager/protocol/pure/v1/engine/V1_EngineHelper.ts +3 -0
  54. package/src/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.ts +12 -0
  55. package/src/graph-manager/protocol/pure/v1/engine/V1_GraphManagerEngine.ts +5 -0
  56. package/src/graph-manager/protocol/pure/v1/engine/V1_RemoteEngine.ts +10 -0
  57. package/src/graph-manager/protocol/pure/v1/engine/analytics/V1_MappingModelCoverageAnalysis.ts +7 -0
  58. package/src/graph-manager/protocol/pure/v1/engine/query/V1_Query.ts +3 -1
  59. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.ts +6 -3
  60. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.ts +21 -23
@@ -229,6 +229,7 @@ export const V1_buildExecutionContext = (
229
229
  const exec = new QueryDataProductLakehouseExecutionContext();
230
230
  exec.dataProductPath = protocolExecContext.dataProductPath;
231
231
  exec.accessPointId = protocolExecContext.accessPointId;
232
+ exec.accessGroupId = protocolExecContext.accessGroupId;
232
233
  return exec;
233
234
  }
234
235
  throw new UnsupportedOperationError('Unsupported query execution context');
@@ -279,6 +280,7 @@ export const V1_buildExecutionContextInfo = (
279
280
  const exec = new QueryDataProductLakehouseExecutionContextInfo();
280
281
  exec.dataProductPath = v1_execContext.dataProductPath;
281
282
  exec.accessPointId = v1_execContext.accessPointId;
283
+ exec.accessGroupId = v1_execContext.accessGroupId;
282
284
  return exec;
283
285
  }
284
286
  throw new UnsupportedOperationError('Unsupported query execution context');
@@ -403,6 +405,7 @@ export const V1_transformQueryExecutionContext = (
403
405
  const protocol = new V1_DataProductLakehouseExecutionContext();
404
406
  protocol.dataProductPath = execContext.dataProductPath;
405
407
  protocol.accessPointId = execContext.accessPointId;
408
+ protocol.accessGroupId = execContext.accessGroupId;
406
409
  return protocol;
407
410
  }
408
411
  throw new UnsupportedOperationError('Unsupported query execution context');
@@ -121,6 +121,7 @@ enum CORE_ENGINE_ACTIVITY_TRACE {
121
121
  REGISTER_SERVICE = 'register service',
122
122
  GET_SERVICE_VERSION = 'get service version',
123
123
  ACTIVATE_SERVICE_GENERATION_ID = 'activate service generation id',
124
+ GET_SERVICE_METADATA = 'get service metadata',
124
125
  VALIDATE_SERVICE_ASSERTION_ID = 'validate service assertion id',
125
126
  RUN_SERVICE_TESTS = 'run service tests',
126
127
  GENERATE_TEST_DATA_WITH_DEFAULT_SEED = 'generate test data with default seed',
@@ -1240,6 +1241,17 @@ export class V1_EngineServerClient extends AbstractServerClient {
1240
1241
  request,
1241
1242
  );
1242
1243
 
1244
+ getServiceMetadataByPattern = (
1245
+ serviceServerUrl: string,
1246
+ servicePattern: string,
1247
+ ): Promise<PlainObject> =>
1248
+ this.getWithTracing(
1249
+ this.getTraceData(CORE_ENGINE_ACTIVITY_TRACE.GET_SERVICE_METADATA),
1250
+ `${this._service(
1251
+ this.baseUrlForServiceRegistration ?? serviceServerUrl,
1252
+ )}/serviceMetadata/${encodeURIComponent(servicePattern)}`,
1253
+ );
1254
+
1243
1255
  // ------------------------------------------- Legend Services List -------------------------------------------
1244
1256
 
1245
1257
  private readonly getServicesDetailsFromCache = (): Promise<PlainObject[]> =>
@@ -328,6 +328,11 @@ export interface V1_GraphManagerEngine {
328
328
  generationId: string,
329
329
  ) => Promise<void>;
330
330
 
331
+ getServiceMetadataByPattern: (
332
+ serviceServerUrl: string,
333
+ servicePattern: string,
334
+ ) => Promise<PlainObject>;
335
+
331
336
  runServicePostVal: (
332
337
  servicePath: string,
333
338
  input: V1_PureModelContext,
@@ -1142,6 +1142,16 @@ export class V1_RemoteEngine implements V1_GraphManagerEngine {
1142
1142
  );
1143
1143
  }
1144
1144
 
1145
+ async getServiceMetadataByPattern(
1146
+ serviceServerUrl: string,
1147
+ servicePattern: string,
1148
+ ): Promise<PlainObject> {
1149
+ return this.engineServerClient.getServiceMetadataByPattern(
1150
+ serviceServerUrl,
1151
+ servicePattern,
1152
+ );
1153
+ }
1154
+
1145
1155
  async runServicePostVal(
1146
1156
  servicePath: string,
1147
1157
  input: V1_PureModelContext,
@@ -103,6 +103,13 @@ const V1_deserializeMappedProperty = (
103
103
  case V1_MappedPropertyType.ENUM:
104
104
  return deserialize(V1_EnumMappedProperty.serialization.schema, json);
105
105
  default: {
106
+ // fix: data product artifacts omit type
107
+ if (json.entityPath !== undefined) {
108
+ return deserialize(V1_EntityMappedProperty.serialization.schema, json);
109
+ }
110
+ if (json.enumPath !== undefined) {
111
+ return deserialize(V1_EnumMappedProperty.serialization.schema, json);
112
+ }
106
113
  return deserialize(V1_MappedProperty.serialization.schema, json);
107
114
  }
108
115
  }
@@ -67,7 +67,7 @@ export enum V1_QueryExecutionContextType {
67
67
  QUERY_DATASAPCE_EXECUTION_CONTEXT = 'dataSpaceExecutionContext',
68
68
  QUERY_DATAPRODUCT_NATIVE_EXECUTION_CONTEXT = 'dataProductNativeExecutionContext',
69
69
  QUERY_DATAPRODUCT_MODEL_ACCESS_EXECUTION_CONTEXT = 'dataProductModelAccessExecutionContext',
70
- QUERY_DATAPRODUCT_LAKEHOUSE_EXECUTION_CONTEXT = 'dataProductLakehouseExecutionContext',
70
+ QUERY_DATAPRODUCT_LAKEHOUSE_EXECUTION_CONTEXT = 'dataProductLakehouseAccessExecutionContext',
71
71
  }
72
72
 
73
73
  export class V1_QueryExplicitExecutionContext extends V1_QueryExecutionContext {
@@ -146,6 +146,7 @@ export class V1_DataProductModelAccessExecutionContext extends V1_QueryDataProdu
146
146
 
147
147
  export class V1_DataProductLakehouseExecutionContext extends V1_QueryDataProductExecutionContext {
148
148
  accessPointId!: string;
149
+ accessGroupId!: string;
149
150
 
150
151
  static readonly serialization = new SerializationFactory(
151
152
  createModelSchema(V1_DataProductLakehouseExecutionContext, {
@@ -154,6 +155,7 @@ export class V1_DataProductLakehouseExecutionContext extends V1_QueryDataProduct
154
155
  ),
155
156
  dataProductPath: primitive(),
156
157
  accessPointId: primitive(),
158
+ accessGroupId: primitive(),
157
159
  }),
158
160
  {
159
161
  deserializeNullAsUndefined: true,
@@ -85,6 +85,7 @@ export const V1_buildDataProductLink = (
85
85
  export const V1_buildAccessPoint = (
86
86
  ap: V1_AccessPoint,
87
87
  context: V1_GraphBuilderContext,
88
+ owner: AccessPointGroup,
88
89
  ): AccessPoint => {
89
90
  if (ap instanceof V1_LakehouseAccessPoint) {
90
91
  const lakeAccessPoint = new LakehouseAccessPoint(
@@ -95,6 +96,7 @@ export const V1_buildAccessPoint = (
95
96
  ap.func.body,
96
97
  context,
97
98
  ),
99
+ owner,
98
100
  );
99
101
  lakeAccessPoint.reproducible = ap.reproducible;
100
102
  lakeAccessPoint.classification = ap.classification;
@@ -112,6 +114,7 @@ export const V1_buildAccessPoint = (
112
114
  ap.query.body,
113
115
  context,
114
116
  ),
117
+ owner,
115
118
  );
116
119
  functionAccessPoint.description = ap.description;
117
120
  functionAccessPoint.title = ap.title;
@@ -120,7 +123,7 @@ export const V1_buildAccessPoint = (
120
123
  .filter(isNonNullable);
121
124
  return functionAccessPoint;
122
125
  } else if (ap instanceof V1_UnknownAccessPoint) {
123
- const unknown = new UnknownAccessPoint(ap.id);
126
+ const unknown = new UnknownAccessPoint(ap.id, owner);
124
127
  unknown.description = ap.description;
125
128
  unknown.title = ap.title;
126
129
  unknown.content = ap.content;
@@ -178,7 +181,7 @@ export const V1_buildAccessPointGroup = (
178
181
  group.title = elementGroup.title;
179
182
  group.description = elementGroup.description;
180
183
  group.accessPoints = elementGroup.accessPoints.map((ep) =>
181
- V1_buildAccessPoint(ep, context),
184
+ V1_buildAccessPoint(ep, context, group),
182
185
  );
183
186
  group.stereotypes = elementGroup.stereotypes
184
187
  .map((stereotype) => context.resolveStereotype(stereotype))
@@ -225,7 +228,7 @@ export const V1_buildAccessPointGroup = (
225
228
  group.title = elementGroup.title;
226
229
  group.description = elementGroup.description;
227
230
  group.accessPoints = elementGroup.accessPoints.map((ep) =>
228
- V1_buildAccessPoint(ep, context),
231
+ V1_buildAccessPoint(ep, context, group),
229
232
  );
230
233
  group.stereotypes = elementGroup.stereotypes
231
234
  .map((stereotype) => context.resolveStereotype(stereotype))
@@ -30,6 +30,7 @@ import {
30
30
  UnsupportedOperationError,
31
31
  assertErrorThrown,
32
32
  usingModelSchema,
33
+ guaranteeNonNullable,
33
34
  } from '@finos/legend-shared';
34
35
  import { V1_PureModelContextData } from '../../model/context/V1_PureModelContextData.js';
35
36
  import { V1_PureModelContextPointer } from '../../model/context/V1_PureModelContextPointer.js';
@@ -101,29 +102,26 @@ export const V1_entitiesToPureModelContextData = async (
101
102
  TEMPORARY__entityPathIndex?.set(element.path, entity.path);
102
103
  return element;
103
104
  };
104
- graph.elements = await Promise.all<V1_PackageableElement>(
105
- entities.map(
106
- (e) =>
107
- new Promise((resolve, reject) =>
108
- setTimeout(() => {
109
- try {
110
- resolve(
111
- // NOTE: here we skip the check for classifier path, so there could be cases
112
- // where the classifier path is different from the actua element protocol path
113
- // we might need to do validation here. This can happen when the classifier
114
- // path is changed in the backend. If we are to check for this, we might consider
115
- // not throwing error but quitely print out warnings about elements that would not
116
- // be built.
117
- entityToElement(e),
118
- );
119
- } catch (error) {
120
- assertErrorThrown(error);
121
- reject(error);
122
- }
123
- }, 0),
124
- ),
125
- ),
126
- );
105
+ // Process entities in batches to avoid per-element setTimeout overhead.
106
+ // Each batch yields to the event loop to keep the UI responsive.
107
+ const DESERIALIZATION_BATCH_SIZE = 100;
108
+ const results: V1_PackageableElement[] = [];
109
+ for (let i = 0; i < entities.length; i += DESERIALIZATION_BATCH_SIZE) {
110
+ if (i > 0) {
111
+ await new Promise<void>((resolve) => setTimeout(resolve, 0));
112
+ }
113
+ const end = Math.min(i + DESERIALIZATION_BATCH_SIZE, entities.length);
114
+ for (let j = i; j < end; j++) {
115
+ // NOTE: here we skip the check for classifier path, so there could be cases
116
+ // where the classifier path is different from the actua element protocol path
117
+ // we might need to do validation here. This can happen when the classifier
118
+ // path is changed in the backend. If we are to check for this, we might consider
119
+ // not throwing error but quitely print out warnings about elements that would not
120
+ // be built.
121
+ results.push(entityToElement(guaranteeNonNullable(entities[j])));
122
+ }
123
+ }
124
+ graph.elements = results;
127
125
  }
128
126
  } catch (error) {
129
127
  assertErrorThrown(error);