@finos/legend-graph 32.3.15 → 32.3.16

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 (40) hide show
  1. package/lib/graph/Core_HashUtils.d.ts +2 -1
  2. package/lib/graph/Core_HashUtils.d.ts.map +1 -1
  3. package/lib/graph/Core_HashUtils.js +1 -0
  4. package/lib/graph/Core_HashUtils.js.map +1 -1
  5. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts +7 -3
  6. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts.map +1 -1
  7. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js +15 -6
  8. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js.map +1 -1
  9. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.d.ts +1 -1
  10. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.d.ts.map +1 -1
  11. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js +9 -9
  12. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js.map +1 -1
  13. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts +8 -3
  14. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts.map +1 -1
  15. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js +17 -7
  16. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js.map +1 -1
  17. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.d.ts.map +1 -1
  18. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js +11 -4
  19. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js.map +1 -1
  20. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
  21. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +5 -5
  22. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
  23. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts +3 -2
  24. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts.map +1 -1
  25. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js +9 -1
  26. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js.map +1 -1
  27. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts +3 -2
  28. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts.map +1 -1
  29. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js +11 -8
  30. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js.map +1 -1
  31. package/lib/package.json +1 -1
  32. package/package.json +3 -3
  33. package/src/graph/Core_HashUtils.ts +1 -0
  34. package/src/graph/metamodel/pure/dataProduct/DataProduct.ts +17 -6
  35. package/src/graph-manager/action/changeDetection/DataProductObserveHelper.ts +13 -12
  36. package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.ts +19 -6
  37. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.ts +17 -7
  38. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +8 -11
  39. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.ts +17 -0
  40. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.ts +24 -15
@@ -16,6 +16,7 @@
16
16
 
17
17
  import {
18
18
  hashArray,
19
+ uuid,
19
20
  type Hashable,
20
21
  type PlainObject,
21
22
  } from '@finos/legend-shared';
@@ -146,6 +147,7 @@ export class V1_SupportInfo implements Hashable {
146
147
  faqUrl: V1_DataProductLink | undefined;
147
148
  supportUrl: V1_DataProductLink | undefined;
148
149
  emails: V1_Email[] = [];
150
+ expertise: V1_Expertise[] | undefined;
149
151
 
150
152
  get hashCode(): string {
151
153
  return hashArray([
@@ -155,6 +157,7 @@ export class V1_SupportInfo implements Hashable {
155
157
  this.faqUrl ?? '',
156
158
  this.supportUrl ?? '',
157
159
  hashArray(this.emails),
160
+ hashArray(this.expertise ?? []),
158
161
  ]);
159
162
  }
160
163
  }
@@ -308,6 +311,7 @@ export class V1_ExternalDataProductType extends V1_DataProductType {
308
311
  }
309
312
 
310
313
  export class V1_Expertise implements Hashable {
314
+ readonly uuid = uuid();
311
315
  description: string | undefined;
312
316
  expertIds: string[] | undefined;
313
317
 
@@ -320,11 +324,22 @@ export class V1_Expertise implements Hashable {
320
324
  }
321
325
  }
322
326
 
327
+ export class V1_DataProductOperationalMetadata implements Hashable {
328
+ coverageRegions: V1_DataProductRegion[] | undefined;
329
+ updateFrequency: V1_DeliveryFrequency | undefined;
330
+
331
+ get hashCode(): string {
332
+ return hashArray([
333
+ CORE_HASH_STRUCTURE.DATA_PRODUCT_OPERATIONAL_METADATA,
334
+ hashArray(this.coverageRegions ?? []),
335
+ this.updateFrequency ?? '',
336
+ ]);
337
+ }
338
+ }
339
+
323
340
  export class V1_DataProduct extends V1_PackageableElement implements Hashable {
324
341
  title: string | undefined;
325
342
  description: string | undefined;
326
- coverageRegions: V1_DataProductRegion[] | undefined;
327
- deliveryFrequency: V1_DeliveryFrequency | undefined;
328
343
  icon: V1_DataProductIcon | undefined;
329
344
  accessPointGroups: V1_AccessPointGroup[] = [];
330
345
  supportInfo: V1_SupportInfo | undefined;
@@ -332,15 +347,13 @@ export class V1_DataProduct extends V1_PackageableElement implements Hashable {
332
347
  stereotypes: V1_StereotypePtr[] = [];
333
348
  taggedValues: V1_TaggedValue[] = [];
334
349
  sampleValues: V1_EmbeddedData[] | undefined;
335
- expertise: V1_Expertise[] | undefined;
350
+ operational: V1_DataProductOperationalMetadata | undefined;
336
351
 
337
352
  override get hashCode(): string {
338
353
  return hashArray([
339
354
  CORE_HASH_STRUCTURE.DATA_PRODUCT,
340
355
  this.title ?? '',
341
356
  this.description ?? '',
342
- hashArray(this.coverageRegions ?? []),
343
- this.deliveryFrequency ?? '',
344
357
  this.icon ?? '',
345
358
  hashArray(this.accessPointGroups),
346
359
  this.supportInfo ?? '',
@@ -348,7 +361,7 @@ export class V1_DataProduct extends V1_PackageableElement implements Hashable {
348
361
  hashArray(this.stereotypes),
349
362
  hashArray(this.taggedValues),
350
363
  hashArray(this.sampleValues ?? []),
351
- hashArray(this.expertise ?? []),
364
+ this.operational ?? '',
352
365
  ]);
353
366
  }
354
367
 
@@ -51,6 +51,7 @@ import {
51
51
  V1_ExternalDataProductType,
52
52
  V1_FunctionAccessPoint,
53
53
  type V1_Expertise,
54
+ V1_DataProductOperationalMetadata,
54
55
  } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
55
56
  import { V1_initPackageableElement } from './V1_CoreTransformerHelper.js';
56
57
  import { V1_transformRawLambda } from './V1_RawValueSpecificationTransformer.js';
@@ -126,16 +127,9 @@ export const V1_transformDataProduct = (
126
127
  V1_initPackageableElement(product, element);
127
128
  product.description = element.description;
128
129
  product.title = element.title;
129
- product.deliveryFrequency = element.deliveryFrequency as
130
- | V1_DeliveryFrequency
131
- | undefined;
132
- product.coverageRegions = element.coverageRegions as
133
- | V1_DataProductRegion[]
134
- | undefined;
135
130
  product.sampleValues = element.sampleValues?.map((data) =>
136
131
  V1_transformEmbeddedData(data, context),
137
132
  );
138
- product.expertise = element.expertise as V1_Expertise[] | undefined;
139
133
  if (element.type instanceof InternalDataProductType) {
140
134
  product.type = new V1_InternalDataProductType();
141
135
  } else if (element.type instanceof ExternalDataProductType) {
@@ -150,10 +144,26 @@ export const V1_transformDataProduct = (
150
144
  product.icon = transformDataProductIcon(element.icon);
151
145
  }
152
146
 
147
+ if (!element.operational) {
148
+ product.operational = undefined;
149
+ } else {
150
+ const operational = new V1_DataProductOperationalMetadata();
151
+ operational.updateFrequency = element.operational.updateFrequency as
152
+ | V1_DeliveryFrequency
153
+ | undefined;
154
+ operational.coverageRegions = element.operational.coverageRegions as
155
+ | V1_DataProductRegion[]
156
+ | undefined;
157
+ product.operational = operational;
158
+ }
159
+
153
160
  if (!element.supportInfo) {
154
161
  product.supportInfo = undefined;
155
162
  } else {
156
163
  const supportInfo = new V1_SupportInfo();
164
+ supportInfo.expertise = element.supportInfo.expertise as
165
+ | V1_Expertise[]
166
+ | undefined;
157
167
  supportInfo.documentation = element.supportInfo.documentation;
158
168
  supportInfo.website = element.supportInfo.website;
159
169
  supportInfo.faqUrl = element.supportInfo.faqUrl;
@@ -131,8 +131,6 @@ import {
131
131
  type V1_DataProduct,
132
132
  } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
133
133
  import {
134
- type DataProduct_DeliveryFrequency,
135
- type DataProduct_Region,
136
134
  Email,
137
135
  ExternalDataProductType,
138
136
  InternalDataProductType,
@@ -144,6 +142,7 @@ import {
144
142
  V1_buildDataProductExpertise,
145
143
  V1_buildDataProductIcon,
146
144
  V1_buildDataProductLink,
145
+ V1_buildDataProductOperationalMetadata,
147
146
  } from './helpers/V1_DataProductBuilder.js';
148
147
  import type { V1_IngestDefinition } from '../../../model/packageableElements/ingest/V1_IngestDefinition.js';
149
148
  import { IncludeStore } from '../../../../../../../graph/metamodel/pure/packageableElements/store/relational/model/IncludeStore.js';
@@ -767,6 +766,10 @@ export class V1_ElementSecondPassBuilder
767
766
  supportInfo.supportUrl = protocolSupportInfo.supportUrl
768
767
  ? V1_buildDataProductLink(protocolSupportInfo.supportUrl)
769
768
  : undefined;
769
+ supportInfo.expertise =
770
+ protocolSupportInfo.expertise?.map((expertise) =>
771
+ V1_buildDataProductExpertise(expertise),
772
+ ) ?? [];
770
773
  supportInfo.emails = protocolSupportInfo.emails.map((elementEmail) => {
771
774
  const email = new Email(elementEmail.address, elementEmail.title);
772
775
  return email;
@@ -783,17 +786,11 @@ export class V1_ElementSecondPassBuilder
783
786
  dataProduct.sampleValues = element.sampleValues?.map((data) =>
784
787
  V1_buildEmbeddedData(data, this.context),
785
788
  );
786
- if (element.expertise) {
787
- dataProduct.expertise = element.expertise.map((expertise) =>
788
- V1_buildDataProductExpertise(expertise),
789
+ if (element.operational) {
790
+ dataProduct.operational = V1_buildDataProductOperationalMetadata(
791
+ element.operational,
789
792
  );
790
793
  }
791
- dataProduct.deliveryFrequency = element.deliveryFrequency as
792
- | DataProduct_DeliveryFrequency
793
- | undefined;
794
- dataProduct.coverageRegions = element.coverageRegions as
795
- | DataProduct_Region[]
796
- | undefined;
797
794
  dataProduct.stereotypes = element.stereotypes
798
795
  .map((stereotype) => this.context.resolveStereotype(stereotype))
799
796
  .filter(isNonNullable);
@@ -24,10 +24,13 @@ import {
24
24
  type DataProductElement,
25
25
  type DataProductIcon,
26
26
  AccessPointGroup,
27
+ type DataProduct_DeliveryFrequency,
28
+ type DataProduct_Region,
27
29
  DataProductElementScope,
28
30
  DataProductEmbeddedImageIcon,
29
31
  DataProductLibraryIcon,
30
32
  DataProductLink,
33
+ DataProductOperationalMetadata,
31
34
  DataProductRuntimeInfo,
32
35
  Expertise,
33
36
  FunctionAccessPoint,
@@ -49,6 +52,7 @@ import {
49
52
  V1_ModelAccessPointGroup,
50
53
  V1_UnknownAccessPoint,
51
54
  V1_UnknownDataProductIcon,
55
+ type V1_DataProductOperationalMetadata,
52
56
  } from '../../../../model/packageableElements/dataProduct/V1_DataProduct.js';
53
57
  import type { V1_GraphBuilderContext } from '../V1_GraphBuilderContext.js';
54
58
  import { V1_buildRawLambdaWithResolvedPaths } from './V1_ValueSpecificationPathResolver.js';
@@ -134,6 +138,19 @@ export const V1_buildDataProductExpertise = (
134
138
  return expertise;
135
139
  };
136
140
 
141
+ export const V1_buildDataProductOperationalMetadata = (
142
+ operationalMetadata: V1_DataProductOperationalMetadata,
143
+ ): DataProductOperationalMetadata => {
144
+ const metamodelOperationalMetadata = new DataProductOperationalMetadata();
145
+ metamodelOperationalMetadata.updateFrequency =
146
+ operationalMetadata.updateFrequency as
147
+ | DataProduct_DeliveryFrequency
148
+ | undefined;
149
+ metamodelOperationalMetadata.coverageRegions =
150
+ operationalMetadata.coverageRegions as DataProduct_Region[] | undefined;
151
+ return metamodelOperationalMetadata;
152
+ };
153
+
137
154
  export const V1_buildAccessPointGroup = (
138
155
  elementGroup: V1_AccessPointGroup,
139
156
  context: V1_GraphBuilderContext,
@@ -47,6 +47,7 @@ import {
47
47
  V1_DataProductTypeValue,
48
48
  V1_Expertise,
49
49
  V1_FunctionAccessPoint,
50
+ V1_DataProductOperationalMetadata,
50
51
  } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
51
52
  import {
52
53
  UnsupportedOperationError,
@@ -296,14 +297,34 @@ const V1_DataProductLinkModelSchema = createModelSchema(V1_DataProductLink, {
296
297
  url: primitive(),
297
298
  });
298
299
 
300
+ export const V1_ExpertiseModelSchema = createModelSchema(V1_Expertise, {
301
+ description: optional(primitive()),
302
+ expertIds: list(primitive()),
303
+ });
304
+
299
305
  export const V1_SupportInfoModelSchema = createModelSchema(V1_SupportInfo, {
300
306
  documentation: optional(usingModelSchema(V1_DataProductLinkModelSchema)),
301
307
  emails: customListWithSchema(V1_EmailModelSchema),
302
308
  faqUrl: optional(usingModelSchema(V1_DataProductLinkModelSchema)),
303
309
  supportUrl: optional(usingModelSchema(V1_DataProductLinkModelSchema)),
310
+ expertise: optionalCustomListWithSchema(V1_ExpertiseModelSchema),
304
311
  website: optional(usingModelSchema(V1_DataProductLinkModelSchema)),
305
312
  });
306
313
 
314
+ export const V1_DataProductOperationalMetadataModelSchema = createModelSchema(
315
+ V1_DataProductOperationalMetadata,
316
+ {
317
+ coverageRegions: optionalCustomList(
318
+ (json) => (json as string).toLowerCase(),
319
+ (json) => (json as unknown as string).toUpperCase(),
320
+ ),
321
+ updateFrequency: optionalCustom(
322
+ (json) => (json as string).toLowerCase(),
323
+ (json) => (json as string).toUpperCase(),
324
+ ),
325
+ },
326
+ );
327
+
307
328
  export const V1_InternalDataProductTypeModelSchema = createModelSchema(
308
329
  V1_InternalDataProductType,
309
330
  {
@@ -319,11 +340,6 @@ export const V1_ExternalDataProductTypeModelSchema = createModelSchema(
319
340
  },
320
341
  );
321
342
 
322
- export const V1_ExpertiseModelSchema = createModelSchema(V1_Expertise, {
323
- description: optional(primitive()),
324
- expertIds: list(primitive()),
325
- });
326
-
327
343
  export const V1_deserializeDataProductType = (
328
344
  json: Record<string, unknown>,
329
345
  ): V1_DataProductType => {
@@ -357,26 +373,19 @@ export const V1_dataProductModelSchema = (
357
373
  V1_serializeAccessPointGroup,
358
374
  V1_deserializeAccessPointGroup,
359
375
  ),
360
- coverageRegions: optionalCustomList(
361
- (json) => (json as string).toLowerCase(),
362
- (json) => (json as unknown as string).toUpperCase(),
363
- ),
364
-
365
- deliveryFrequency: optionalCustom(
366
- (json) => (json as string).toLowerCase(),
367
- (json) => (json as string).toUpperCase(),
368
- ),
369
376
  description: optional(primitive()),
370
377
  sampleValues: optionalCustomList(
371
378
  (data: V1_EmbeddedData) => V1_serializeEmbeddedDataType(data, plugins),
372
379
  (data) => V1_deserializeEmbeddedDataType(data, plugins),
373
380
  ),
374
- expertise: optionalCustomListWithSchema(V1_ExpertiseModelSchema),
375
381
  icon: optionalCustom(
376
382
  V1_serializeDataProductIcon,
377
383
  V1_deserializeDataProductIcon,
378
384
  ),
379
385
  name: primitive(),
386
+ operational: optionalCustomUsingModelSchema(
387
+ V1_DataProductOperationalMetadataModelSchema,
388
+ ),
380
389
  package: primitive(),
381
390
  type: optionalCustom(
382
391
  V1_serializeDataProductType,