@finos/legend-graph 32.3.7 → 32.3.9

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 (54) hide show
  1. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts +2 -0
  2. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts.map +1 -1
  3. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js +2 -0
  4. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js.map +1 -1
  5. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.d.ts.map +1 -1
  6. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js +3 -0
  7. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js.map +1 -1
  8. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.d.ts +14 -0
  9. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.d.ts.map +1 -1
  10. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.js +14 -0
  11. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.js.map +1 -1
  12. package/lib/graph-manager/protocol/pure/v1/lakehouse/helpers/V1_CoreLakehouseHelper.d.ts +20 -0
  13. package/lib/graph-manager/protocol/pure/v1/lakehouse/helpers/V1_CoreLakehouseHelper.d.ts.map +1 -0
  14. package/lib/graph-manager/protocol/pure/v1/lakehouse/helpers/V1_CoreLakehouseHelper.js +33 -0
  15. package/lib/graph-manager/protocol/pure/v1/lakehouse/helpers/V1_CoreLakehouseHelper.js.map +1 -0
  16. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts +2 -0
  17. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts.map +1 -1
  18. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js +2 -0
  19. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js.map +1 -1
  20. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_Terminal.d.ts +5 -5
  21. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_Terminal.d.ts.map +1 -1
  22. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_Terminal.js +5 -5
  23. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_Terminal.js.map +1 -1
  24. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.d.ts.map +1 -1
  25. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js +6 -0
  26. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js.map +1 -1
  27. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts.map +1 -1
  28. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js +9 -3
  29. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js.map +1 -1
  30. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts.map +1 -1
  31. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js +6 -0
  32. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js.map +1 -1
  33. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.d.ts +7 -1
  34. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.d.ts.map +1 -1
  35. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js +35 -1
  36. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js.map +1 -1
  37. package/lib/index.d.ts +4 -3
  38. package/lib/index.d.ts.map +1 -1
  39. package/lib/index.js +4 -3
  40. package/lib/index.js.map +1 -1
  41. package/lib/package.json +1 -1
  42. package/package.json +1 -1
  43. package/src/graph/metamodel/pure/dataProduct/DataProduct.ts +2 -0
  44. package/src/graph-manager/action/changeDetection/DataProductObserveHelper.ts +3 -0
  45. package/src/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.ts +16 -0
  46. package/src/graph-manager/protocol/pure/v1/lakehouse/helpers/V1_CoreLakehouseHelper.ts +40 -0
  47. package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.ts +2 -0
  48. package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_Terminal.ts +10 -10
  49. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.ts +6 -0
  50. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.ts +9 -3
  51. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.ts +6 -0
  52. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.ts +62 -0
  53. package/src/index.ts +9 -0
  54. package/tsconfig.json +1 -0
@@ -161,6 +161,22 @@ export abstract class V1_ContractUserEventPayload {
161
161
  eventTimestamp!: string;
162
162
  }
163
163
 
164
+ export class V1_TerminalOrderItem {
165
+ providerName!: string;
166
+ productName!: string;
167
+ category!: string;
168
+ price!: number;
169
+ id!: number;
170
+ perm_id?: number;
171
+ }
172
+
173
+ export class V1_TerminalProvisionPayload {
174
+ ordered_by!: string;
175
+ kerberos!: string;
176
+ order_items!: Record<number, V1_TerminalOrderItem[]>;
177
+ business_justification!: string;
178
+ }
179
+
164
180
  export class V1_ContractUserEventPrivilegeManagerPayload extends V1_ContractUserEventPayload {
165
181
  candidateIdentity!: string;
166
182
  managerIdentity!: string;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright (c) 2025-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 { V1_IngestEnvironmentClassification } from '../ingest/V1_LakehouseIngestEnvironment.js';
18
+ import { V1_EntitlementsLakehouseEnvironmentType } from '../entitlements/V1_EntitlementsDataProduct.js';
19
+
20
+ export const V1_getEntitlementsEnvFromIngestEnv = (
21
+ ingestEnv: V1_IngestEnvironmentClassification,
22
+ ): V1_EntitlementsLakehouseEnvironmentType => {
23
+ switch (ingestEnv) {
24
+ case V1_IngestEnvironmentClassification.DEV:
25
+ return V1_EntitlementsLakehouseEnvironmentType.DEVELOPMENT;
26
+ case V1_IngestEnvironmentClassification.PROD_PARALLEL:
27
+ return V1_EntitlementsLakehouseEnvironmentType.PRODUCTION_PARALLEL;
28
+ case V1_IngestEnvironmentClassification.PROD:
29
+ return V1_EntitlementsLakehouseEnvironmentType.PRODUCTION;
30
+ default:
31
+ return V1_EntitlementsLakehouseEnvironmentType.PRODUCTION;
32
+ }
33
+ };
34
+
35
+ export const V1_isIngestEnvsCompatibleWithEntitlements = (
36
+ ingestEnv: V1_IngestEnvironmentClassification,
37
+ entitlementEnv: V1_EntitlementsLakehouseEnvironmentType,
38
+ ): boolean => {
39
+ return V1_getEntitlementsEnvFromIngestEnv(ingestEnv) === entitlementEnv;
40
+ };
@@ -41,6 +41,7 @@ export enum V1_DataProductTypeValue {
41
41
 
42
42
  export abstract class V1_AccessPoint implements Hashable {
43
43
  id!: string;
44
+ title: string | undefined;
44
45
  description: string | undefined;
45
46
 
46
47
  get hashCode(): string {
@@ -98,6 +99,7 @@ export class V1_FunctionAccessPoint extends V1_AccessPoint implements Hashable {
98
99
 
99
100
  export class V1_AccessPointGroup implements Hashable {
100
101
  id!: string;
102
+ title: string | undefined;
101
103
  description: string | undefined;
102
104
  stereotypes: V1_StereotypePtr[] = [];
103
105
  accessPoints: V1_AccessPoint[] = [];
@@ -17,30 +17,30 @@
17
17
  import { hashArray, type Hashable } from '@finos/legend-shared';
18
18
 
19
19
  export class V1_Terminal implements Hashable {
20
- id: string | undefined;
21
- providerName: string | undefined;
22
- productName: string | undefined;
23
- category: string | undefined;
20
+ id!: string;
21
+ providerName!: string;
22
+ productName!: string;
23
+ category!: string;
24
24
  vendorProfileId: string | undefined;
25
25
  modelName: string | undefined;
26
26
  description: string | undefined;
27
27
  applicationName: string | undefined;
28
28
  tieredPrice: string | undefined;
29
- price: string | undefined;
29
+ price!: string;
30
30
  totalFirmPrice: string | undefined;
31
31
 
32
32
  get hashCode(): string {
33
33
  return hashArray([
34
- this.id ?? '',
35
- this.providerName ?? '',
36
- this.productName ?? '',
37
- this.category ?? '',
34
+ this.id,
35
+ this.providerName,
36
+ this.productName,
37
+ this.category,
38
38
  this.vendorProfileId ?? '',
39
39
  this.modelName ?? '',
40
40
  this.description ?? '',
41
41
  this.applicationName ?? '',
42
42
  this.tieredPrice ?? '',
43
- this.price ?? '',
43
+ this.price,
44
44
  this.totalFirmPrice ?? '',
45
45
  ]);
46
46
  }
@@ -73,17 +73,21 @@ const transformAccessPoint = (
73
73
  lake.classification = ap.classification;
74
74
  lake.reproducible = ap.reproducible;
75
75
  lake.description = ap.description;
76
+ lake.title = ap.title;
76
77
  return lake;
77
78
  } else if (ap instanceof FunctionAccessPoint) {
78
79
  const func = new V1_FunctionAccessPoint();
79
80
  func.id = ap.id;
80
81
  func.description = ap.description;
82
+ func.title = func.title;
81
83
  func.query = V1_transformRawLambda(ap.query, context);
82
84
  return func;
83
85
  } else if (ap instanceof UnknownAccessPoint) {
84
86
  const un = new V1_UnknownAccessPoint();
85
87
  un.content = ap.content;
86
88
  un.id = ap.id;
89
+ un.description = ap.title;
90
+ un.title = ap.title;
87
91
  return un;
88
92
  }
89
93
  throw new UnsupportedOperationError(
@@ -164,6 +168,7 @@ export const V1_transformDataProduct = (
164
168
  if (metamodelGroup instanceof ModelAccessPointGroup) {
165
169
  const modelGroup = new V1_ModelAccessPointGroup();
166
170
  modelGroup.id = metamodelGroup.id;
171
+ modelGroup.title = metamodelGroup.title;
167
172
  modelGroup.description = metamodelGroup.description;
168
173
  modelGroup.stereotypes = metamodelGroup.stereotypes.map(
169
174
  V1_transformStereotype,
@@ -216,6 +221,7 @@ export const V1_transformDataProduct = (
216
221
  }
217
222
  const group = new V1_AccessPointGroup();
218
223
  group.id = metamodelGroup.id;
224
+ group.title = metamodelGroup.title;
219
225
  group.description = metamodelGroup.description;
220
226
  group.stereotypes = metamodelGroup.stereotypes.map(
221
227
  V1_transformStereotype,
@@ -84,6 +84,7 @@ export const V1_buildAccessPoint = (
84
84
  lakeAccessPoint.reproducible = ap.reproducible;
85
85
  lakeAccessPoint.classification = ap.classification;
86
86
  lakeAccessPoint.description = ap.description;
87
+ lakeAccessPoint.title = ap.title;
87
88
  return lakeAccessPoint;
88
89
  } else if (ap instanceof V1_FunctionAccessPoint) {
89
90
  const functionAccessPoint = new FunctionAccessPoint(
@@ -95,11 +96,14 @@ export const V1_buildAccessPoint = (
95
96
  ),
96
97
  );
97
98
  functionAccessPoint.description = ap.description;
99
+ functionAccessPoint.title = ap.title;
98
100
  return functionAccessPoint;
99
101
  } else if (ap instanceof V1_UnknownAccessPoint) {
100
- const unkown = new UnknownAccessPoint(ap.id);
101
- unkown.content = ap.content;
102
- return unkown;
102
+ const unknown = new UnknownAccessPoint(ap.id);
103
+ unknown.description = ap.description;
104
+ unknown.title = ap.title;
105
+ unknown.content = ap.content;
106
+ return unknown;
103
107
  }
104
108
  throw new UnsupportedOperationError(
105
109
  `Unsupported data product access type ${ap}`,
@@ -137,6 +141,7 @@ export const V1_buildAccessPointGroup = (
137
141
  if (elementGroup instanceof V1_ModelAccessPointGroup) {
138
142
  const group = new ModelAccessPointGroup();
139
143
  group.id = elementGroup.id;
144
+ group.title = elementGroup.title;
140
145
  group.description = elementGroup.description;
141
146
  group.accessPoints = elementGroup.accessPoints.map((ep) =>
142
147
  V1_buildAccessPoint(ep, context),
@@ -189,6 +194,7 @@ export const V1_buildAccessPointGroup = (
189
194
  } else {
190
195
  const group = new AccessPointGroup();
191
196
  group.id = elementGroup.id;
197
+ group.title = elementGroup.title;
192
198
  group.description = elementGroup.description;
193
199
  group.accessPoints = elementGroup.accessPoints.map((ep) =>
194
200
  V1_buildAccessPoint(ep, context),
@@ -98,6 +98,7 @@ export const V1_lakehouseAccessPointModelSchema = createModelSchema(
98
98
  id: primitive(),
99
99
  reproducible: optional(primitive()),
100
100
  targetEnvironment: primitive(),
101
+ title: optional(primitive()),
101
102
  },
102
103
  );
103
104
 
@@ -108,6 +109,7 @@ export const V1_functionAccessPointModelSchema = createModelSchema(
108
109
  description: optional(primitive()),
109
110
  id: primitive(),
110
111
  query: usingModelSchema(V1_rawLambdaModelSchema),
112
+ title: optional(primitive()),
111
113
  },
112
114
  );
113
115
 
@@ -139,6 +141,8 @@ const V1_deserializeAccessPoint = (
139
141
  const unknown = new V1_UnknownAccessPoint();
140
142
  unknown.content = json;
141
143
  unknown.id = json.id as string;
144
+ unknown.description = json.description as string;
145
+ unknown.title = json.title as string;
142
146
  return unknown;
143
147
  }
144
148
  }
@@ -185,6 +189,7 @@ export const V1_ModelAccessPointGroupModelSchema = createModelSchema(
185
189
  diagrams: customListWithSchema(V1_dataProductDiagramModelSchema),
186
190
  featuredElements: customListWithSchema(V1_ElementScopeModelSchema),
187
191
  id: primitive(),
192
+ title: optional(primitive()),
188
193
  stereotypes: customListWithSchema(V1_stereotypePtrModelSchema),
189
194
  mapping: usingModelSchema(V1_packageableElementPointerModelSchema),
190
195
  },
@@ -199,6 +204,7 @@ export const V1_DefaultAccessPointGroupModelSchema = createModelSchema(
199
204
  ),
200
205
  description: optional(primitive()),
201
206
  id: primitive(),
207
+ title: optional(primitive()),
202
208
  stereotypes: customListWithSchema(V1_stereotypePtrModelSchema, {
203
209
  INTERNAL__forceReturnEmptyInTest: true,
204
210
  }),
@@ -44,6 +44,8 @@ import {
44
44
  V1_LiteDataContractsResponse,
45
45
  V1_LiteDataContract,
46
46
  V1_DataContractApprovedUsersResponse,
47
+ V1_TerminalOrderItem,
48
+ V1_TerminalProvisionPayload,
47
49
  } from '../../../lakehouse/entitlements/V1_ConsumerEntitlements.js';
48
50
  import {
49
51
  createModelSchema,
@@ -437,6 +439,66 @@ export const V1_createContractPayloadModelSchema = (
437
439
  ),
438
440
  });
439
441
 
442
+ export const V1_terminalOrderItemModelSchema = createModelSchema(
443
+ V1_TerminalOrderItem,
444
+ {
445
+ providerName: primitive(),
446
+ productName: primitive(),
447
+ category: primitive(),
448
+ price: primitive(),
449
+ id: primitive(),
450
+ perm_id: optional(primitive()),
451
+ },
452
+ );
453
+
454
+ export const V1_serializeOrderItems = (
455
+ val: Record<number, V1_TerminalOrderItem[]>,
456
+ ): Record<number, PlainObject<V1_TerminalOrderItem>[]> => {
457
+ const result: Record<number, PlainObject<V1_TerminalOrderItem>[]> = {};
458
+ for (const [key, items] of Object.entries(val)) {
459
+ result[Number(key)] = items.map(
460
+ (item: V1_TerminalOrderItem): PlainObject<V1_TerminalOrderItem> =>
461
+ serialize(V1_terminalOrderItemModelSchema, item),
462
+ );
463
+ }
464
+ return result;
465
+ };
466
+
467
+ export const V1_deserializeOrderItems = (
468
+ val: Record<string, PlainObject<V1_TerminalOrderItem>[]>,
469
+ ): Record<number, V1_TerminalOrderItem[]> => {
470
+ const result: Record<number, V1_TerminalOrderItem[]> = {};
471
+ for (const [key, items] of Object.entries(val)) {
472
+ result[Number(key)] = items.map(
473
+ (item: PlainObject<V1_TerminalOrderItem>): V1_TerminalOrderItem =>
474
+ deserialize(V1_terminalOrderItemModelSchema, item),
475
+ );
476
+ }
477
+ return result;
478
+ };
479
+
480
+ export const V1_terminalProvisionPayloadModelSchema = createModelSchema(
481
+ V1_TerminalProvisionPayload,
482
+ {
483
+ ordered_by: primitive(),
484
+ kerberos: primitive(),
485
+ order_items: custom(V1_serializeOrderItems, V1_deserializeOrderItems),
486
+ business_justification: primitive(),
487
+ },
488
+ );
489
+
490
+ export const V1_serializeTerminalProvisionPayload = (
491
+ payload: V1_TerminalProvisionPayload,
492
+ ): PlainObject<V1_TerminalProvisionPayload> => {
493
+ return serialize(V1_terminalProvisionPayloadModelSchema, payload);
494
+ };
495
+
496
+ export const V1_deserializeTerminalProvisionPayload = (
497
+ json: PlainObject<V1_TerminalProvisionPayload>,
498
+ ): V1_TerminalProvisionPayload => {
499
+ return deserialize(V1_terminalProvisionPayloadModelSchema, json);
500
+ };
501
+
440
502
  export const V1_ContractUserStatusResponseModelSchema = createModelSchema(
441
503
  V1_ContractUserStatusResponse,
442
504
  {
package/src/index.ts CHANGED
@@ -308,8 +308,14 @@ export {
308
308
  V1_TaskResponse,
309
309
  V1_TaskStatus,
310
310
  V1_TaskStatusChangeResponse,
311
+ V1_TerminalOrderItem,
312
+ V1_TerminalProvisionPayload,
311
313
  V1_UserApprovalStatus,
312
314
  } from './graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.js';
315
+ export {
316
+ V1_getEntitlementsEnvFromIngestEnv,
317
+ V1_isIngestEnvsCompatibleWithEntitlements,
318
+ } from './graph-manager/protocol/pure/v1/lakehouse/helpers/V1_CoreLakehouseHelper.js';
313
319
  export {
314
320
  V1_AdhocTeam,
315
321
  V1_AppDirLevel,
@@ -360,6 +366,7 @@ export {
360
366
  V1_pendingTasksResponseModelSchema,
361
367
  V1_SdlcDeploymentDataProductOriginModelSchema,
362
368
  V1_TaskStatusChangeResponseModelSchema,
369
+ V1_terminalProvisionPayloadModelSchema,
363
370
  } from './graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js';
364
371
  export {
365
372
  V1_CreateSubscriptionInput,
@@ -737,8 +744,10 @@ export {
737
744
  UnknownDataProductIcon,
738
745
  DataProductElementScope,
739
746
  DataProductDiagram,
747
+ DataProductType,
740
748
  InternalDataProductType,
741
749
  Expertise,
750
+ ExternalDataProductType,
742
751
  type DataProductElement,
743
752
  } from './graph/metamodel/pure/dataProduct/DataProduct.js';
744
753
  export * from './graph-manager/action/changeDetection/DataProductObserveHelper.js';
package/tsconfig.json CHANGED
@@ -514,6 +514,7 @@
514
514
  "./src/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_EntitlementsTasks.ts",
515
515
  "./src/graph-manager/protocol/pure/v1/lakehouse/helpers/V1_ConsumerEntitlementsObserver.ts",
516
516
  "./src/graph-manager/protocol/pure/v1/lakehouse/helpers/V1_ConsumerEntitlementsUtils.ts",
517
+ "./src/graph-manager/protocol/pure/v1/lakehouse/helpers/V1_CoreLakehouseHelper.ts",
517
518
  "./src/graph-manager/protocol/pure/v1/lakehouse/ingest/V1_LakehouseIngestEnvironment.ts",
518
519
  "./src/graph-manager/protocol/pure/v1/lakehouse/ingest/V1_LakehouseProducerEnvironment.ts",
519
520
  "./src/graph-manager/protocol/pure/v1/lakehouse/subscriptions/V1_ConsumerSubscriptions.ts",