@finos/legend-graph 32.5.3 → 32.6.1

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 (59) hide show
  1. package/lib/STO_Relational_Exports.d.ts +10 -2
  2. package/lib/STO_Relational_Exports.d.ts.map +1 -1
  3. package/lib/STO_Relational_Exports.js +10 -2
  4. package/lib/STO_Relational_Exports.js.map +1 -1
  5. package/lib/graph/Core_HashUtils.d.ts +2 -0
  6. package/lib/graph/Core_HashUtils.d.ts.map +1 -1
  7. package/lib/graph/Core_HashUtils.js +2 -0
  8. package/lib/graph/Core_HashUtils.js.map +1 -1
  9. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts +10 -0
  10. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts.map +1 -1
  11. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js +16 -0
  12. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js.map +1 -1
  13. package/lib/graph/metamodel/pure/packageableElements/ingest/IngestDefinition.d.ts +11 -2
  14. package/lib/graph/metamodel/pure/packageableElements/ingest/IngestDefinition.d.ts.map +1 -1
  15. package/lib/graph/metamodel/pure/packageableElements/ingest/IngestDefinition.js +17 -0
  16. package/lib/graph/metamodel/pure/packageableElements/ingest/IngestDefinition.js.map +1 -1
  17. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.d.ts +4 -1
  18. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.d.ts.map +1 -1
  19. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js +25 -1
  20. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js.map +1 -1
  21. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_CoreEntitlements.d.ts +6 -10
  22. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_CoreEntitlements.d.ts.map +1 -1
  23. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_CoreEntitlements.js +11 -8
  24. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_CoreEntitlements.js.map +1 -1
  25. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts +13 -2
  26. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts.map +1 -1
  27. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js +19 -2
  28. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js.map +1 -1
  29. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.d.ts.map +1 -1
  30. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js +22 -2
  31. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js.map +1 -1
  32. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
  33. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +4 -1
  34. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
  35. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts +3 -2
  36. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts.map +1 -1
  37. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js +22 -2
  38. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js.map +1 -1
  39. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts.map +1 -1
  40. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js +21 -1
  41. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js.map +1 -1
  42. package/lib/index.d.ts +2 -2
  43. package/lib/index.d.ts.map +1 -1
  44. package/lib/index.js +2 -2
  45. package/lib/index.js.map +1 -1
  46. package/lib/package.json +1 -1
  47. package/package.json +1 -1
  48. package/src/STO_Relational_Exports.ts +16 -2
  49. package/src/graph/Core_HashUtils.ts +2 -0
  50. package/src/graph/metamodel/pure/dataProduct/DataProduct.ts +22 -0
  51. package/src/graph/metamodel/pure/packageableElements/ingest/IngestDefinition.ts +20 -2
  52. package/src/graph-manager/action/changeDetection/DataProductObserveHelper.ts +31 -0
  53. package/src/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_CoreEntitlements.ts +19 -11
  54. package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.ts +25 -4
  55. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.ts +24 -0
  56. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +4 -0
  57. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.ts +30 -0
  58. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.ts +34 -0
  59. package/src/index.ts +5 -0
@@ -14,8 +14,16 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import type { PlainObject } from '@finos/legend-shared';
17
+ import {
18
+ hashArray,
19
+ type Hashable,
20
+ type PlainObject,
21
+ } from '@finos/legend-shared';
18
22
  import type { V1_StereotypePtr } from '../../model/packageableElements/domain/V1_StereotypePtr.js';
23
+ import { AppDirLevel } from '../../../../../../graph/metamodel/pure/packageableElements/ingest/IngestDefinition.js';
24
+ import { CORE_HASH_STRUCTURE } from '../../../../../../graph/Core_HashUtils.js';
25
+
26
+ export { AppDirLevel as V1_AppDirLevel };
19
27
 
20
28
  // ---------------------------------------- Users & App Directory --------------------------------------
21
29
 
@@ -29,17 +37,17 @@ export enum V1_UserType {
29
37
  SYSTEM_ACCOUNT = 'SYSTEM_ACCOUNT',
30
38
  }
31
39
 
32
- export class V1_AppDirNode {
40
+ export class V1_AppDirNode implements Hashable {
33
41
  appDirId!: number;
34
- level!: V1_AppDirLevel;
35
- }
36
-
37
- export enum V1_AppDirLevel {
38
- BUSINESS_UNIT = 'BUSINESS_UNIT',
39
- SUB_BUSINESS_UNIT = 'SUB_BUSINESS_UNIT',
40
- FAMILY = 'FAMILY',
41
- APPLICATION = 'APPLICATION',
42
- DEPLOYMENT = 'DEPLOYMENT',
42
+ level!: AppDirLevel;
43
+
44
+ get hashCode(): string {
45
+ return hashArray([
46
+ CORE_HASH_STRUCTURE.APP_DIR_NODE,
47
+ this.appDirId.toString(),
48
+ this.level,
49
+ ]);
50
+ }
43
51
  }
44
52
 
45
53
  // -------------------------------------------- Pagination ---------------------------------------------
@@ -33,6 +33,7 @@ import {
33
33
  import type { V1_StereotypePtr } from '../domain/V1_StereotypePtr.js';
34
34
  import type { V1_TaggedValue } from '../domain/V1_TaggedValue.js';
35
35
  import type { V1_EmbeddedData } from '../../data/V1_EmbeddedData.js';
36
+ import type { V1_AppDirNode } from '../../../lakehouse/entitlements/V1_CoreEntitlements.js';
36
37
 
37
38
  export const V1_DATA_PRODUCT_ELEMENT_PROTOCOL_TYPE = 'dataProduct';
38
39
 
@@ -369,12 +370,9 @@ export abstract class V1_DataProductType implements Hashable {
369
370
  }
370
371
  }
371
372
 
372
- export class V1_InternalDataProductType extends V1_DataProductType {
373
- _type = V1_DataProductTypeValue.INTERNAL;
374
- }
373
+ export class V1_InternalDataProductType extends V1_DataProductType {}
375
374
 
376
375
  export class V1_ExternalDataProductType extends V1_DataProductType {
377
- _type = V1_DataProductTypeValue.EXTERNAL;
378
376
  link!: V1_DataProductLink;
379
377
 
380
378
  override get hashCode(): string {
@@ -409,6 +407,27 @@ export class V1_DataProductOperationalMetadata implements Hashable {
409
407
  }
410
408
  }
411
409
 
410
+ export enum V1_DataProductOwnerType {
411
+ APP_DIR = 'appDir',
412
+ }
413
+
414
+ export abstract class V1_DataProductOwner implements Hashable {
415
+ abstract get hashCode(): string;
416
+ }
417
+
418
+ export class V1_AppDirOwner extends V1_DataProductOwner implements Hashable {
419
+ production: V1_AppDirNode | undefined;
420
+ prodParallel: V1_AppDirNode | undefined;
421
+
422
+ override get hashCode(): string {
423
+ return hashArray([
424
+ CORE_HASH_STRUCTURE.DATA_PRODUCT_OWNER,
425
+ this.production?.hashCode ?? '',
426
+ this.prodParallel?.hashCode ?? '',
427
+ ]);
428
+ }
429
+ }
430
+
412
431
  export class V1_DataProduct extends V1_PackageableElement implements Hashable {
413
432
  title: string | undefined;
414
433
  description: string | undefined;
@@ -421,6 +440,7 @@ export class V1_DataProduct extends V1_PackageableElement implements Hashable {
421
440
  taggedValues: V1_TaggedValue[] = [];
422
441
  sampleValues: V1_EmbeddedData[] | undefined;
423
442
  operationalMetadata: V1_DataProductOperationalMetadata | undefined;
443
+ owner: V1_DataProductOwner | undefined;
424
444
 
425
445
  override get hashCode(): string {
426
446
  return hashArray([
@@ -436,6 +456,7 @@ export class V1_DataProduct extends V1_PackageableElement implements Hashable {
436
456
  hashArray(this.taggedValues),
437
457
  hashArray(this.sampleValues ?? []),
438
458
  this.operationalMetadata ?? '',
459
+ this.owner ?? '',
439
460
  ]);
440
461
  }
441
462
 
@@ -30,6 +30,7 @@ import {
30
30
  FunctionAccessPoint,
31
31
  PackageableElementSampleQuery,
32
32
  InLineSampleQuery,
33
+ AppDirOwner,
33
34
  } from '../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
34
35
  import {
35
36
  type V1_AccessPoint,
@@ -57,6 +58,7 @@ import {
57
58
  V1_PackageableElementSampleQuery,
58
59
  V1_InLineSampleQuery,
59
60
  V1_NativeModelExecutionContext,
61
+ V1_AppDirOwner,
60
62
  } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
61
63
  import { V1_initPackageableElement } from './V1_CoreTransformerHelper.js';
62
64
  import { V1_transformRawLambda } from './V1_RawValueSpecificationTransformer.js';
@@ -69,6 +71,7 @@ import { V1_PackageableElementPointer } from '../../../model/packageableElements
69
71
  import { V1_transformEmbeddedData } from './V1_DataElementTransformer.js';
70
72
  import { ConcreteFunctionDefinition } from '../../../../../../../graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.js';
71
73
  import { generateFunctionPrettyName } from '../../../../../../../graph/helpers/PureLanguageHelper.js';
74
+ import { V1_AppDirNode } from '../../../lakehouse/entitlements/V1_CoreEntitlements.js';
72
75
 
73
76
  const transformAccessPoint = (
74
77
  ap: AccessPoint,
@@ -343,5 +346,26 @@ export const V1_transformDataProduct = (
343
346
  V1_transformTaggedValue(taggedValue),
344
347
  );
345
348
 
349
+ if (element.owner instanceof AppDirOwner) {
350
+ const v1Owner = new V1_AppDirOwner();
351
+ if (element.owner.production) {
352
+ const v1Node = new V1_AppDirNode();
353
+ v1Node.appDirId = element.owner.production.appDirId;
354
+ v1Node.level = element.owner.production.level;
355
+ v1Owner.production = v1Node;
356
+ }
357
+ if (element.owner.prodParallel) {
358
+ const v1Node = new V1_AppDirNode();
359
+ v1Node.appDirId = element.owner.prodParallel.appDirId;
360
+ v1Node.level = element.owner.prodParallel.level;
361
+ v1Owner.prodParallel = v1Node;
362
+ }
363
+ product.owner = v1Owner;
364
+ } else if (element.owner !== undefined) {
365
+ throw new UnsupportedOperationError(
366
+ `Unable to transform data product owner`,
367
+ );
368
+ }
369
+
346
370
  return product;
347
371
  };
@@ -144,6 +144,7 @@ import {
144
144
  V1_buildDataProductLink,
145
145
  V1_buildDataProductOperationalMetadata,
146
146
  V1_buildNativeModelAccess,
147
+ V1_buildDataProductOwner,
147
148
  } from './helpers/V1_DataProductBuilder.js';
148
149
  import type { V1_IngestDefinition } from '../../../model/packageableElements/ingest/V1_IngestDefinition.js';
149
150
  import { IncludeStore } from '../../../../../../../graph/metamodel/pure/packageableElements/store/relational/model/IncludeStore.js';
@@ -808,5 +809,8 @@ export class V1_ElementSecondPassBuilder
808
809
  dataProduct.taggedValues = element.taggedValues
809
810
  .map((taggedValue) => V1_buildTaggedValue(taggedValue, this.context))
810
811
  .filter(isNonNullable);
812
+ if (element.owner) {
813
+ dataProduct.owner = V1_buildDataProductOwner(element.owner);
814
+ }
811
815
  }
812
816
  }
@@ -43,7 +43,10 @@ import {
43
43
  InLineSampleQuery,
44
44
  DataProductDiagram,
45
45
  NativeModelExecutionContext,
46
+ type DataProductOwner,
47
+ AppDirOwner,
46
48
  } from '../../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
49
+ import { AppDirNode } from '../../../../../../../../graph/metamodel/pure/packageableElements/ingest/IngestDefinition.js';
47
50
  import {
48
51
  type V1_AccessPoint,
49
52
  type V1_AccessPointGroup,
@@ -63,6 +66,8 @@ import {
63
66
  V1_PackageableElementSampleQuery,
64
67
  V1_InLineSampleQuery,
65
68
  type V1_NativeModelExecutionContext,
69
+ V1_AppDirOwner,
70
+ type V1_DataProductOwner,
66
71
  } from '../../../../model/packageableElements/dataProduct/V1_DataProduct.js';
67
72
  import type { V1_GraphBuilderContext } from '../V1_GraphBuilderContext.js';
68
73
  import { V1_buildRawLambdaWithResolvedPaths } from './V1_ValueSpecificationPathResolver.js';
@@ -390,3 +395,28 @@ export const V1_buildNativeModelAccess = (
390
395
 
391
396
  return metamodelNativeModelAccess;
392
397
  };
398
+
399
+ export const V1_buildDataProductOwner = (
400
+ v1Owner: V1_DataProductOwner,
401
+ ): DataProductOwner => {
402
+ if (v1Owner instanceof V1_AppDirOwner) {
403
+ const owner = new AppDirOwner();
404
+ if (v1Owner.production) {
405
+ const production = new AppDirNode();
406
+ production.appDirId = v1Owner.production.appDirId;
407
+ production.level = v1Owner.production.level;
408
+ owner.production = production;
409
+ }
410
+ if (v1Owner.prodParallel) {
411
+ const prodParallel = new AppDirNode();
412
+ prodParallel.appDirId = v1Owner.prodParallel.appDirId;
413
+ prodParallel.level = v1Owner.prodParallel.level;
414
+ owner.prodParallel = prodParallel;
415
+ }
416
+ return owner;
417
+ }
418
+ throw new UnsupportedOperationError(
419
+ `Unsupported data product owner type`,
420
+ v1Owner,
421
+ );
422
+ };
@@ -53,6 +53,9 @@ import {
53
53
  V1_PackageableElementSampleQuery,
54
54
  V1_InLineSampleQuery,
55
55
  V1_NativeModelExecutionContext,
56
+ V1_AppDirOwner,
57
+ V1_DataProductOwnerType,
58
+ type V1_DataProductOwner,
56
59
  } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
57
60
  import {
58
61
  UnsupportedOperationError,
@@ -78,6 +81,7 @@ import {
78
81
  V1_serializeEmbeddedDataType,
79
82
  } from './V1_DataElementSerializationHelper.js';
80
83
  import type { PureProtocolProcessorPlugin } from '../../../../PureProtocolProcessorPlugin.js';
84
+ import { V1_AppDirNodeModelSchema } from './lakehouse/V1_CoreEntitlementsSerializationHelper.js';
81
85
  import type { V1_EmbeddedData } from '../../../model/data/V1_EmbeddedData.js';
82
86
 
83
87
  export enum V1_AccessPointType {
@@ -458,6 +462,32 @@ export const V1_serializeDataProductType = (
458
462
  throw new Error(`Unknown V1_DataProductType instance: ${value}`);
459
463
  };
460
464
 
465
+ // ---------------------------------------- Owner -----------------------------------------
466
+
467
+ const V1_AppDirOwnerModelSchema = createModelSchema(V1_AppDirOwner, {
468
+ _type: usingConstantValueSchema(V1_DataProductOwnerType.APP_DIR),
469
+ prodParallel: optionalCustomUsingModelSchema(V1_AppDirNodeModelSchema),
470
+ production: optionalCustomUsingModelSchema(V1_AppDirNodeModelSchema),
471
+ });
472
+
473
+ const V1_deserializeDataProductOwner = (
474
+ json: PlainObject<V1_DataProductOwner>,
475
+ ): V1_DataProductOwner => {
476
+ if (json._type === V1_DataProductOwnerType.APP_DIR) {
477
+ return deserialize(V1_AppDirOwnerModelSchema, json);
478
+ }
479
+ throw new Error(`Unknown V1_DataProductOwner type: ${json._type}`);
480
+ };
481
+
482
+ const V1_serializeDataProductOwner = (
483
+ value: V1_DataProductOwner,
484
+ ): PlainObject<V1_DataProductOwner> => {
485
+ if (value instanceof V1_AppDirOwner) {
486
+ return serialize(V1_AppDirOwnerModelSchema, value);
487
+ }
488
+ throw new Error(`Unknown V1_DataProductOwner instance`);
489
+ };
490
+
461
491
  export const V1_dataProductModelSchema = (
462
492
  plugins: PureProtocolProcessorPlugin[],
463
493
  ): ModelSchema<V1_DataProduct> =>
@@ -484,6 +514,10 @@ export const V1_dataProductModelSchema = (
484
514
  operationalMetadata: optionalCustomUsingModelSchema(
485
515
  V1_DataProductOperationalMetadataModelSchema,
486
516
  ),
517
+ owner: optionalCustom(
518
+ V1_serializeDataProductOwner,
519
+ V1_deserializeDataProductOwner,
520
+ ),
487
521
  package: primitive(),
488
522
  type: optionalCustom(
489
523
  V1_serializeDataProductType,
package/src/index.ts CHANGED
@@ -212,6 +212,9 @@ export {
212
212
  V1_ExternalDataProductType,
213
213
  V1_SupportInfo,
214
214
  V1_UnknownDataProductIcon,
215
+ V1_DataProductOwner,
216
+ V1_AppDirOwner,
217
+ V1_DataProductOwnerType,
215
218
  } from './graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js';
216
219
  export {
217
220
  V1_ExecuteInput,
@@ -747,6 +750,8 @@ export {
747
750
  NativeModelExecutionContext,
748
751
  DataProductAccessType,
749
752
  DataProductOperationalMetadata,
753
+ DataProductOwner,
754
+ AppDirOwner,
750
755
  } from './graph/metamodel/pure/dataProduct/DataProduct.js';
751
756
  export * from './graph-manager/action/changeDetection/DataProductObserveHelper.js';
752
757