@finos/legend-graph 32.1.65 → 32.1.67

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 (122) hide show
  1. package/lib/graph/metamodel/pure/lineage/LineageModel.d.ts +59 -0
  2. package/lib/graph/metamodel/pure/lineage/LineageModel.d.ts.map +1 -1
  3. package/lib/graph/metamodel/pure/lineage/LineageModel.js +187 -1
  4. package/lib/graph/metamodel/pure/lineage/LineageModel.js.map +1 -1
  5. package/lib/graph/metamodel/pure/packageableElements/domain/GenericType.d.ts +3 -1
  6. package/lib/graph/metamodel/pure/packageableElements/domain/GenericType.d.ts.map +1 -1
  7. package/lib/graph/metamodel/pure/packageableElements/domain/GenericType.js +11 -1
  8. package/lib/graph/metamodel/pure/packageableElements/domain/GenericType.js.map +1 -1
  9. package/lib/graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.d.ts.map +1 -1
  10. package/lib/graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.js +4 -0
  11. package/lib/graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.js.map +1 -1
  12. package/lib/graph/metamodel/pure/packageableElements/relation/RelationType.d.ts +5 -2
  13. package/lib/graph/metamodel/pure/packageableElements/relation/RelationType.d.ts.map +1 -1
  14. package/lib/graph/metamodel/pure/packageableElements/relation/RelationType.js +15 -0
  15. package/lib/graph/metamodel/pure/packageableElements/relation/RelationType.js.map +1 -1
  16. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.d.ts +4 -2
  17. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.d.ts.map +1 -1
  18. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.js +4 -2
  19. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.js.map +1 -1
  20. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/V1_ConcreteFunctionDefinition.d.ts.map +1 -1
  21. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/V1_ConcreteFunctionDefinition.js +4 -0
  22. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/V1_ConcreteFunctionDefinition.js.map +1 -1
  23. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/type/V1_GenericType.d.ts.map +1 -1
  24. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/type/V1_GenericType.js +6 -1
  25. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/type/V1_GenericType.js.map +1 -1
  26. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/type/V1_PackageableType.d.ts.map +1 -1
  27. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/type/V1_PackageableType.js.map +1 -1
  28. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.d.ts +3 -1
  29. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.d.ts.map +1 -1
  30. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.js +5 -0
  31. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.js.map +1 -1
  32. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/V1_Variable.d.ts +3 -1
  33. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/V1_Variable.d.ts.map +1 -1
  34. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/V1_Variable.js +10 -0
  35. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/V1_Variable.js.map +1 -1
  36. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CBoolean.d.ts +1 -0
  37. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CBoolean.d.ts.map +1 -1
  38. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CBoolean.js +11 -0
  39. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CBoolean.js.map +1 -1
  40. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CByteArray.d.ts +1 -0
  41. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CByteArray.d.ts.map +1 -1
  42. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CByteArray.js +11 -0
  43. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CByteArray.js.map +1 -1
  44. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDateTime.d.ts +1 -0
  45. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDateTime.d.ts.map +1 -1
  46. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDateTime.js +11 -0
  47. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDateTime.js.map +1 -1
  48. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDecimal.d.ts +3 -1
  49. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDecimal.d.ts.map +1 -1
  50. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDecimal.js +11 -0
  51. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDecimal.js.map +1 -1
  52. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CFloat.d.ts +1 -0
  53. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CFloat.d.ts.map +1 -1
  54. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CFloat.js +11 -0
  55. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CFloat.js.map +1 -1
  56. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CInteger.d.ts +1 -0
  57. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CInteger.d.ts.map +1 -1
  58. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CInteger.js +11 -0
  59. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CInteger.js.map +1 -1
  60. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CLatestDate.d.ts +1 -0
  61. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CLatestDate.d.ts.map +1 -1
  62. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CLatestDate.js +10 -0
  63. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CLatestDate.js.map +1 -1
  64. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CStrictDate.d.ts +1 -0
  65. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CStrictDate.d.ts.map +1 -1
  66. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CStrictDate.js +11 -0
  67. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CStrictDate.js.map +1 -1
  68. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CStrictTime.d.ts +1 -0
  69. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CStrictTime.d.ts.map +1 -1
  70. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CStrictTime.js +11 -0
  71. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CStrictTime.js.map +1 -1
  72. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CString.d.ts +3 -1
  73. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CString.d.ts.map +1 -1
  74. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CString.js +11 -0
  75. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CString.js.map +1 -1
  76. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_ClassInstance.d.ts +1 -0
  77. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_ClassInstance.d.ts.map +1 -1
  78. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_ClassInstance.js +10 -0
  79. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_ClassInstance.js.map +1 -1
  80. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_Collection.d.ts +1 -0
  81. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_Collection.d.ts.map +1 -1
  82. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_Collection.js +9 -0
  83. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_Collection.js.map +1 -1
  84. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_EnumValue.d.ts +1 -0
  85. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_EnumValue.d.ts.map +1 -1
  86. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_EnumValue.js +10 -0
  87. package/lib/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_EnumValue.js.map +1 -1
  88. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.d.ts +7 -1
  89. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.d.ts.map +1 -1
  90. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js +2 -2
  91. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js.map +1 -1
  92. package/lib/index.d.ts +2 -2
  93. package/lib/index.d.ts.map +1 -1
  94. package/lib/index.js +2 -2
  95. package/lib/index.js.map +1 -1
  96. package/lib/package.json +1 -1
  97. package/package.json +1 -1
  98. package/src/graph/metamodel/pure/lineage/LineageModel.ts +242 -1
  99. package/src/graph/metamodel/pure/packageableElements/domain/GenericType.ts +13 -2
  100. package/src/graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.ts +4 -0
  101. package/src/graph/metamodel/pure/packageableElements/relation/RelationType.ts +19 -2
  102. package/src/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.ts +4 -2
  103. package/src/graph-manager/protocol/pure/v1/model/packageableElements/function/V1_ConcreteFunctionDefinition.ts +4 -0
  104. package/src/graph-manager/protocol/pure/v1/model/packageableElements/type/V1_GenericType.ts +6 -1
  105. package/src/graph-manager/protocol/pure/v1/model/packageableElements/type/V1_PackageableType.ts +1 -1
  106. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.ts +7 -1
  107. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/V1_Variable.ts +12 -1
  108. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CBoolean.ts +15 -0
  109. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CByteArray.ts +15 -0
  110. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDateTime.ts +15 -0
  111. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDecimal.ts +19 -1
  112. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CFloat.ts +15 -0
  113. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CInteger.ts +15 -0
  114. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CLatestDate.ts +11 -0
  115. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CStrictDate.ts +15 -0
  116. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CStrictTime.ts +15 -0
  117. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CString.ts +19 -1
  118. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_ClassInstance.ts +14 -0
  119. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_Collection.ts +10 -0
  120. package/src/graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_EnumValue.ts +11 -0
  121. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.ts +3 -3
  122. package/src/index.ts +3 -0
@@ -14,7 +14,14 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { createModelSchema, primitive, list, object, custom } from 'serializr';
17
+ import {
18
+ createModelSchema,
19
+ primitive,
20
+ list,
21
+ object,
22
+ custom,
23
+ optional,
24
+ } from 'serializr';
18
25
 
19
26
  export type RawLineageModel = object;
20
27
 
@@ -98,8 +105,139 @@ export class LineageModel {
98
105
  classLineage!: Graph;
99
106
  functionTrees: PropertyPathTree[] = [];
100
107
  reportLineage!: ReportLineage;
108
+ propertyLineage?: PropertyLineageReport;
101
109
  }
102
110
 
111
+ // --- Property Lineage Model Classes ---
112
+
113
+ export class PropertyLineageReport {
114
+ propertyOwner: PropertyLineageNode[] = [];
115
+ ownerLink: OwnerLink[] = [];
116
+ }
117
+
118
+ export class PropertyLineageNode {
119
+ id!: string;
120
+ name!: string;
121
+ }
122
+
123
+ export class StorePropertyLineageNode extends PropertyLineageNode {}
124
+
125
+ export class PropertyOwnerNode extends PropertyLineageNode {
126
+ properties: LineageProperty[] = [];
127
+ }
128
+
129
+ export class RootQuery extends PropertyOwnerNode {}
130
+
131
+ export class LineageQuery extends PropertyOwnerNode {}
132
+
133
+ export class RelationalPropertyOwner extends PropertyOwnerNode {
134
+ namedRelation!: string; // NamedRelation[1] as string
135
+ relationType!: string;
136
+ relationName!: string;
137
+ schemaName!: string;
138
+ relationOwnerPath!: string;
139
+ }
140
+
141
+ export class MappedSetOwner extends PropertyOwnerNode {
142
+ setImplementationID!: string;
143
+ }
144
+
145
+ export class MappedClassOwner extends PropertyOwnerNode {
146
+ mapping?: string;
147
+ setImplementationID?: string;
148
+ _class!: string;
149
+ }
150
+
151
+ export class OwnerLink {
152
+ source!: string; // reference by id
153
+ target!: string; // reference by id
154
+ }
155
+
156
+ export class LineageProperty {
157
+ name!: string;
158
+ dataType?: string;
159
+ sourceInfo?: SourceInformation;
160
+ scope?: string;
161
+ propertyType!: string;
162
+ ownerID!: string;
163
+ sourceProperties: LineageProperty[] = [];
164
+ annotations: Annotation[] = [];
165
+ }
166
+
167
+ export class LineageModelProperty extends LineageProperty {
168
+ propertyTree!: PropertyPathTree;
169
+ }
170
+
171
+ export class SourceInformation {
172
+ sourceId!: string;
173
+ startLine!: number;
174
+ startColumn!: number;
175
+ endLine!: number;
176
+ endColumn!: number;
177
+ }
178
+ export class Annotation {}
179
+
180
+ // Helper for __TYPE-based subtyping
181
+ function subtypeFactory<T>(
182
+ typeMap: Record<string, new () => T>,
183
+ fallbackType?: new () => T,
184
+ ) {
185
+ return custom(
186
+ (value) => value, // serialization: just return as is
187
+ (value): unknown => {
188
+ if (
189
+ value &&
190
+ typeof value === 'object' &&
191
+ typeof value.__TYPE === 'string'
192
+ ) {
193
+ const ctor = typeMap[value.__TYPE];
194
+ if (ctor) {
195
+ const instance = Object.create(ctor.prototype as object) as object;
196
+ Object.assign(instance, value);
197
+ return instance;
198
+ }
199
+ const fallback = Object.create(
200
+ PropertyOwnerNode.prototype,
201
+ ) as PropertyOwnerNode;
202
+ Object.assign(fallback, value);
203
+ return fallback;
204
+ }
205
+ if (fallbackType) {
206
+ const instance = Object.create(
207
+ fallbackType.prototype as object,
208
+ ) as object;
209
+ Object.assign(instance, value);
210
+ return instance;
211
+ }
212
+ return value;
213
+ },
214
+ );
215
+ }
216
+
217
+ // Subtype maps for deserialization
218
+ const propertyLineageNodeTypeMap = {
219
+ 'meta::analytics::lineage::property::PropertyLineageNode':
220
+ PropertyLineageNode,
221
+ 'meta::analytics::lineage::property::StorePropertyLineageNode':
222
+ StorePropertyLineageNode,
223
+ 'meta::analytics::lineage::property::PropertyOwnerNode': PropertyOwnerNode,
224
+ 'meta::analytics::lineage::property::RootQuery': RootQuery,
225
+ 'meta::analytics::lineage::property::Query': LineageQuery,
226
+ 'meta::analytics::lineage::property::RelationalPropertyOwner':
227
+ RelationalPropertyOwner,
228
+ 'meta::analytics::lineage::property::MappedSetOwner': MappedSetOwner,
229
+ 'meta::analytics::lineage::property::MappedClassOwner': MappedClassOwner,
230
+ // Add other subtypes as needed
231
+ // Add other subtypes as needed
232
+ };
233
+
234
+ const lineagePropertyTypeMap = {
235
+ 'meta::analytics::lineage::property::LineageProperty': LineageProperty,
236
+ 'meta::analytics::lineage::property::LineageModelProperty':
237
+ LineageModelProperty,
238
+ // Add other subtypes as needed
239
+ };
240
+
103
241
  // Serialization schemas
104
242
  createModelSchema(NodeData, {
105
243
  id: primitive(),
@@ -183,4 +321,107 @@ createModelSchema(LineageModel, {
183
321
  classLineage: object(Graph),
184
322
  functionTrees: list(object(PropertyPathTree)),
185
323
  reportLineage: object(ReportLineage),
324
+ propertyLineage: object(PropertyLineageReport),
325
+ });
326
+
327
+ createModelSchema(PropertyLineageReport, {
328
+ propertyOwner: list(
329
+ subtypeFactory(propertyLineageNodeTypeMap, PropertyLineageNode),
330
+ ),
331
+ ownerLink: list(object(OwnerLink)),
332
+ });
333
+
334
+ createModelSchema(PropertyLineageNode, {
335
+ id: primitive(),
336
+ name: primitive(),
337
+ });
338
+
339
+ createModelSchema(StorePropertyLineageNode, {
340
+ id: primitive(),
341
+ name: primitive(),
342
+ });
343
+
344
+ createModelSchema(PropertyOwnerNode, {
345
+ id: primitive(),
346
+ name: primitive(),
347
+ properties: list(subtypeFactory(lineagePropertyTypeMap, LineageProperty)),
348
+ });
349
+
350
+ createModelSchema(RootQuery, {
351
+ id: primitive(),
352
+ name: primitive(),
353
+ properties: list(subtypeFactory(lineagePropertyTypeMap, LineageProperty)),
354
+ });
355
+
356
+ createModelSchema(LineageQuery, {
357
+ id: primitive(),
358
+ name: primitive(),
359
+ properties: list(subtypeFactory(lineagePropertyTypeMap, LineageProperty)),
360
+ });
361
+
362
+ createModelSchema(RelationalPropertyOwner, {
363
+ id: primitive(),
364
+ name: primitive(),
365
+ properties: list(subtypeFactory(lineagePropertyTypeMap, LineageProperty)),
366
+ namedRelation: primitive(),
367
+ relationType: primitive(),
368
+ relationName: primitive(),
369
+ schemaName: primitive(),
370
+ relationOwnerPath: primitive(),
371
+ });
372
+
373
+ createModelSchema(MappedSetOwner, {
374
+ id: primitive(),
375
+ name: primitive(),
376
+ properties: list(subtypeFactory(lineagePropertyTypeMap, LineageProperty)),
377
+ setImplementationID: primitive(),
378
+ });
379
+
380
+ createModelSchema(MappedClassOwner, {
381
+ id: primitive(),
382
+ name: primitive(),
383
+ properties: list(subtypeFactory(lineagePropertyTypeMap, LineageProperty)),
384
+ mapping: optional(primitive()),
385
+ setImplementationID: optional(primitive()),
386
+ _class: primitive(),
387
+ });
388
+
389
+ createModelSchema(OwnerLink, {
390
+ source: primitive(),
391
+ target: primitive(),
392
+ });
393
+
394
+ createModelSchema(LineageProperty, {
395
+ name: primitive(),
396
+ dataType: optional(primitive()),
397
+ sourceInfo: optional(object(SourceInformation)),
398
+ scope: optional(primitive()),
399
+ propertyType: primitive(), // as string
400
+ ownerID: primitive(),
401
+ sourceProperties: list(
402
+ subtypeFactory(lineagePropertyTypeMap, LineageProperty),
403
+ ),
404
+ annotations: list(object(Annotation)),
405
+ });
406
+
407
+ createModelSchema(LineageModelProperty, {
408
+ name: primitive(),
409
+ dataType: optional(primitive()),
410
+ sourceInfo: optional(object(SourceInformation)),
411
+ scope: optional(primitive()),
412
+ propertyType: primitive(),
413
+ ownerID: primitive(),
414
+ sourceProperties: list(
415
+ subtypeFactory(lineagePropertyTypeMap, LineageProperty),
416
+ ),
417
+ annotations: list(object(Annotation)),
418
+ propertyTree: object(PropertyPathTree),
419
+ });
420
+
421
+ createModelSchema(SourceInformation, {
422
+ // ...define as needed...
423
+ });
424
+
425
+ createModelSchema(Annotation, {
426
+ // ...define as needed...
186
427
  });
@@ -14,12 +14,13 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { uuid } from '@finos/legend-shared';
17
+ import { hashArray, uuid, type Hashable } from '@finos/legend-shared';
18
18
  import type { Type } from './Type.js';
19
19
  import type { GenericTypeReference } from './GenericTypeReference.js';
20
20
  import type { ValueSpecification } from '../../valueSpecification/ValueSpecification.js';
21
+ import { RelationType } from '../relation/RelationType.js';
21
22
 
22
- export class GenericType {
23
+ export class GenericType implements Hashable {
23
24
  readonly _UUID = uuid();
24
25
 
25
26
  rawType: Type;
@@ -29,4 +30,14 @@ export class GenericType {
29
30
  constructor(rawType: Type) {
30
31
  this.rawType = rawType;
31
32
  }
33
+
34
+ get hashCode(): string {
35
+ return hashArray([
36
+ this.rawType instanceof RelationType
37
+ ? this.rawType.hashCode
38
+ : this.rawType.path,
39
+ hashArray(this.typeArguments?.map((e) => e.value) ?? []),
40
+ hashArray(this.typeVariableValues ?? []),
41
+ ]);
42
+ }
32
43
  }
@@ -63,6 +63,10 @@ export class ConcreteFunctionDefinition
63
63
  this.path,
64
64
  hashArray(this.parameters),
65
65
  this.returnType.ownerReference.valueForSerialization ?? '',
66
+ this.returnType.value.typeArguments?.length &&
67
+ this.returnType.value.typeVariableValues?.length
68
+ ? this.returnType.value
69
+ : '',
66
70
  hashArray(this.taggedValues),
67
71
  hashArray(this.stereotypes.map((val) => val.pointerHashCode)),
68
72
  hashRawLambda(undefined, this.expressionSequence),
@@ -19,8 +19,10 @@ import type { PackageableElementVisitor } from '../PackageableElement.js';
19
19
  import { Function } from '../domain/Function.js';
20
20
  import { Multiplicity } from '../domain/Multiplicity.js';
21
21
  import type { GenericTypeReference } from '../domain/GenericTypeReference.js';
22
+ import { hashArray, type Hashable } from '@finos/legend-shared';
23
+ import { CORE_HASH_STRUCTURE } from '../../../../Core_HashUtils.js';
22
24
 
23
- export class RelationColumn extends Function {
25
+ export class RelationColumn extends Function implements Hashable {
24
26
  genericType: GenericTypeReference;
25
27
  multiplicity: Multiplicity = Multiplicity.ONE;
26
28
 
@@ -34,9 +36,17 @@ export class RelationColumn extends Function {
34
36
  ): T {
35
37
  throw new Error('Method not implemented.');
36
38
  }
39
+
40
+ override get hashCode(): string {
41
+ return hashArray([
42
+ CORE_HASH_STRUCTURE.RELATION_TYPE,
43
+ this.name,
44
+ this.genericType.value,
45
+ ]);
46
+ }
37
47
  }
38
48
 
39
- export class RelationType extends Type {
49
+ export class RelationType extends Type implements Hashable {
40
50
  static ID = 'RelationType';
41
51
  columns: RelationColumn[] = [];
42
52
 
@@ -45,4 +55,11 @@ export class RelationType extends Type {
45
55
  ): T {
46
56
  throw new Error('Method not implemented.');
47
57
  }
58
+
59
+ override get hashCode(): string {
60
+ return hashArray([
61
+ CORE_HASH_STRUCTURE.RELATION_TYPE,
62
+ hashArray(this.columns),
63
+ ]);
64
+ }
48
65
  }
@@ -158,17 +158,19 @@ export class V1_CreateContractPayload {
158
158
 
159
159
  export abstract class V1_ContractUserEventPayload {
160
160
  type!: V1_ContractEventPayloadType;
161
- candidateIdentity!: string;
162
- taskId!: string;
163
161
  eventTimestamp!: string;
164
162
  }
165
163
 
166
164
  export class V1_ContractUserEventPrivilegeManagerPayload extends V1_ContractUserEventPayload {
165
+ candidateIdentity!: string;
167
166
  managerIdentity!: string;
167
+ taskId!: string;
168
168
  }
169
169
 
170
170
  export class V1_ContractUserEventDataProducerPayload extends V1_ContractUserEventPayload {
171
+ candidateIdentity!: string;
171
172
  dataProducerIdentity!: string;
173
+ taskId!: string;
172
174
  }
173
175
 
174
176
  export class V1_ContractUserEventRecord {
@@ -70,6 +70,10 @@ export class V1_ConcreteFunctionDefinition extends V1_PackageableElement {
70
70
  this.returnGenericType.rawType instanceof V1_PackageableType
71
71
  ? this.returnGenericType.rawType.fullPath
72
72
  : '',
73
+ this.returnGenericType.typeArguments.length &&
74
+ this.returnGenericType.typeVariableValues.length
75
+ ? this.returnGenericType
76
+ : '',
73
77
  hashArray(this.taggedValues),
74
78
  hashArray(this.stereotypes),
75
79
  hashRawLambda(undefined, this.body),
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import { hashArray } from '@finos/legend-shared';
17
18
  import type { V1_ValueSpecification } from '../../valueSpecification/V1_ValueSpecification.js';
18
19
  import type { V1_Multiplicity } from '../domain/V1_Multiplicity.js';
19
20
  import type { V1_Type } from './V1_Type.js';
@@ -25,6 +26,10 @@ export class V1_GenericType {
25
26
  typeVariableValues: V1_ValueSpecification[] = [];
26
27
 
27
28
  get hashCode(): string {
28
- return this.rawType.hashCode;
29
+ return hashArray([
30
+ this.rawType.hashCode,
31
+ hashArray(this.typeArguments),
32
+ hashArray(this.typeVariableValues),
33
+ ]);
29
34
  }
30
35
  }
@@ -21,7 +21,7 @@ export class V1_PackageableType
21
21
  extends V1_PackageableElementPtr
22
22
  implements V1_Type
23
23
  {
24
- get hashCode(): string {
24
+ override get hashCode(): string {
25
25
  return this.fullPath;
26
26
  }
27
27
  }
@@ -35,6 +35,8 @@ import type { V1_INTERNAL__UnknownValueSpecification } from './V1_INTERNAL__Unkn
35
35
  import type { V1_GenericTypeInstance } from './raw/V1_GenericTypeInstance.js';
36
36
  import type { V1_ClassInstance } from './raw/V1_ClassInstance.js';
37
37
  import type { V1_CByteArray } from './raw/V1_CByteArray.js';
38
+ import { type Hashable } from '@finos/legend-shared';
39
+ import { CORE_HASH_STRUCTURE } from '../../../../../../graph/Core_HashUtils.js';
38
40
 
39
41
  export interface V1_ValueSpecificationVisitor<T> {
40
42
  visit_INTERNAL__UnknownValueSpecfication(
@@ -67,8 +69,12 @@ export interface V1_ValueSpecificationVisitor<T> {
67
69
  visit_ClassInstance(valueSpecification: V1_ClassInstance): T;
68
70
  }
69
71
 
70
- export abstract class V1_ValueSpecification {
72
+ export abstract class V1_ValueSpecification implements Hashable {
71
73
  abstract accept_ValueSpecificationVisitor<T>(
72
74
  visitor: V1_ValueSpecificationVisitor<T>,
73
75
  ): T;
76
+
77
+ get hashCode(): string {
78
+ return CORE_HASH_STRUCTURE.INTERNAL__UNKNOWN_VALUE_SPECIFICATION;
79
+ }
74
80
  }
@@ -20,8 +20,10 @@ import {
20
20
  } from '../../model/valueSpecification/V1_ValueSpecification.js';
21
21
  import type { V1_Multiplicity } from '../../model/packageableElements/domain/V1_Multiplicity.js';
22
22
  import type { V1_GenericType } from '../packageableElements/type/V1_GenericType.js';
23
+ import { hashArray, type Hashable } from '@finos/legend-shared';
24
+ import { CORE_HASH_STRUCTURE } from '../../../../../../graph/Core_HashUtils.js';
23
25
 
24
- export class V1_Variable extends V1_ValueSpecification {
26
+ export class V1_Variable extends V1_ValueSpecification implements Hashable {
25
27
  name!: string;
26
28
  multiplicity!: V1_Multiplicity;
27
29
  genericType: V1_GenericType | undefined;
@@ -31,4 +33,13 @@ export class V1_Variable extends V1_ValueSpecification {
31
33
  ): T {
32
34
  return visitor.visit_Variable(this);
33
35
  }
36
+
37
+ override get hashCode(): string {
38
+ return hashArray([
39
+ CORE_HASH_STRUCTURE.VARIABLE_EXPRESSION,
40
+ this.name,
41
+ this.multiplicity,
42
+ this.genericType?.rawType.hashCode,
43
+ ]);
44
+ }
34
45
  }
@@ -16,6 +16,12 @@
16
16
 
17
17
  import type { V1_ValueSpecificationVisitor } from '../V1_ValueSpecification.js';
18
18
  import { V1_PrimitiveValueSpecification } from './V1_PrimitiveValueSpecification.js';
19
+ import { hashArray } from '@finos/legend-shared';
20
+ import {
21
+ CORE_HASH_STRUCTURE,
22
+ hashObjectWithoutSourceInformation,
23
+ } from '../../../../../../../graph/Core_HashUtils.js';
24
+ import { PRIMITIVE_TYPE } from '../../../../../../../graph/MetaModelConst.js';
19
25
 
20
26
  export class V1_CBoolean extends V1_PrimitiveValueSpecification {
21
27
  value!: boolean;
@@ -25,4 +31,13 @@ export class V1_CBoolean extends V1_PrimitiveValueSpecification {
25
31
  ): T {
26
32
  return visitor.visit_CBoolean(this);
27
33
  }
34
+
35
+ override get hashCode(): string {
36
+ return hashArray([
37
+ CORE_HASH_STRUCTURE.PRIMITIVE_INSTANCE_VALUE,
38
+ PRIMITIVE_TYPE.BOOLEAN,
39
+ this.multiplicity,
40
+ hashObjectWithoutSourceInformation([this.value]),
41
+ ]);
42
+ }
28
43
  }
@@ -16,6 +16,12 @@
16
16
 
17
17
  import type { V1_ValueSpecificationVisitor } from '../V1_ValueSpecification.js';
18
18
  import { V1_PrimitiveValueSpecification } from './V1_PrimitiveValueSpecification.js';
19
+ import { hashArray } from '@finos/legend-shared';
20
+ import {
21
+ CORE_HASH_STRUCTURE,
22
+ hashObjectWithoutSourceInformation,
23
+ } from '../../../../../../../graph/Core_HashUtils.js';
24
+ import { PRIMITIVE_TYPE } from '../../../../../../../graph/MetaModelConst.js';
19
25
 
20
26
  export class V1_CByteArray extends V1_PrimitiveValueSpecification {
21
27
  value!: string; // the Base64String transformed from byte[] by Jackson
@@ -25,4 +31,13 @@ export class V1_CByteArray extends V1_PrimitiveValueSpecification {
25
31
  ): T {
26
32
  return visitor.visit_CByteArray(this);
27
33
  }
34
+
35
+ override get hashCode(): string {
36
+ return hashArray([
37
+ CORE_HASH_STRUCTURE.PRIMITIVE_INSTANCE_VALUE,
38
+ PRIMITIVE_TYPE.BYTE,
39
+ this.multiplicity,
40
+ hashObjectWithoutSourceInformation([this.value]),
41
+ ]);
42
+ }
28
43
  }
@@ -16,6 +16,12 @@
16
16
 
17
17
  import type { V1_ValueSpecificationVisitor } from '../../../model/valueSpecification/V1_ValueSpecification.js';
18
18
  import { V1_CDate } from './V1_CDate.js';
19
+ import { hashArray } from '@finos/legend-shared';
20
+ import {
21
+ CORE_HASH_STRUCTURE,
22
+ hashObjectWithoutSourceInformation,
23
+ } from '../../../../../../../graph/Core_HashUtils.js';
24
+ import { PRIMITIVE_TYPE } from '../../../../../../../graph/MetaModelConst.js';
19
25
 
20
26
  export class V1_CDateTime extends V1_CDate {
21
27
  value!: string;
@@ -25,4 +31,13 @@ export class V1_CDateTime extends V1_CDate {
25
31
  ): T {
26
32
  return visitor.visit_CDateTime(this);
27
33
  }
34
+
35
+ override get hashCode(): string {
36
+ return hashArray([
37
+ CORE_HASH_STRUCTURE.PRIMITIVE_INSTANCE_VALUE,
38
+ PRIMITIVE_TYPE.DATETIME,
39
+ this.multiplicity,
40
+ hashObjectWithoutSourceInformation([this.value]),
41
+ ]);
42
+ }
28
43
  }
@@ -14,10 +14,19 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import { hashArray, type Hashable } from '@finos/legend-shared';
17
18
  import type { V1_ValueSpecificationVisitor } from '../V1_ValueSpecification.js';
18
19
  import { V1_PrimitiveValueSpecification } from './V1_PrimitiveValueSpecification.js';
20
+ import {
21
+ CORE_HASH_STRUCTURE,
22
+ hashObjectWithoutSourceInformation,
23
+ } from '../../../../../../../graph/Core_HashUtils.js';
24
+ import { PRIMITIVE_TYPE } from '../../../../../../../graph/MetaModelConst.js';
19
25
 
20
- export class V1_CDecimal extends V1_PrimitiveValueSpecification {
26
+ export class V1_CDecimal
27
+ extends V1_PrimitiveValueSpecification
28
+ implements Hashable
29
+ {
21
30
  value!: number;
22
31
 
23
32
  accept_ValueSpecificationVisitor<T>(
@@ -25,4 +34,13 @@ export class V1_CDecimal extends V1_PrimitiveValueSpecification {
25
34
  ): T {
26
35
  return visitor.visit_CDecimal(this);
27
36
  }
37
+
38
+ override get hashCode(): string {
39
+ return hashArray([
40
+ CORE_HASH_STRUCTURE.PRIMITIVE_INSTANCE_VALUE,
41
+ PRIMITIVE_TYPE.DECIMAL,
42
+ this.multiplicity,
43
+ hashObjectWithoutSourceInformation([this.value]),
44
+ ]);
45
+ }
28
46
  }
@@ -16,6 +16,12 @@
16
16
 
17
17
  import type { V1_ValueSpecificationVisitor } from '../V1_ValueSpecification.js';
18
18
  import { V1_PrimitiveValueSpecification } from './V1_PrimitiveValueSpecification.js';
19
+ import { hashArray } from '@finos/legend-shared';
20
+ import {
21
+ CORE_HASH_STRUCTURE,
22
+ hashObjectWithoutSourceInformation,
23
+ } from '../../../../../../../graph/Core_HashUtils.js';
24
+ import { PRIMITIVE_TYPE } from '../../../../../../../graph/MetaModelConst.js';
19
25
 
20
26
  export class V1_CFloat extends V1_PrimitiveValueSpecification {
21
27
  value!: number;
@@ -25,4 +31,13 @@ export class V1_CFloat extends V1_PrimitiveValueSpecification {
25
31
  ): T {
26
32
  return visitor.visit_CFloat(this);
27
33
  }
34
+
35
+ override get hashCode(): string {
36
+ return hashArray([
37
+ CORE_HASH_STRUCTURE.PRIMITIVE_INSTANCE_VALUE,
38
+ PRIMITIVE_TYPE.FLOAT,
39
+ this.multiplicity,
40
+ hashObjectWithoutSourceInformation([this.value]),
41
+ ]);
42
+ }
28
43
  }
@@ -16,6 +16,12 @@
16
16
 
17
17
  import type { V1_ValueSpecificationVisitor } from '../V1_ValueSpecification.js';
18
18
  import { V1_PrimitiveValueSpecification } from './V1_PrimitiveValueSpecification.js';
19
+ import { hashArray } from '@finos/legend-shared';
20
+ import {
21
+ CORE_HASH_STRUCTURE,
22
+ hashObjectWithoutSourceInformation,
23
+ } from '../../../../../../../graph/Core_HashUtils.js';
24
+ import { PRIMITIVE_TYPE } from '../../../../../../../graph/MetaModelConst.js';
19
25
 
20
26
  export class V1_CInteger extends V1_PrimitiveValueSpecification {
21
27
  value!: number;
@@ -25,4 +31,13 @@ export class V1_CInteger extends V1_PrimitiveValueSpecification {
25
31
  ): T {
26
32
  return visitor.visit_CInteger(this);
27
33
  }
34
+
35
+ override get hashCode(): string {
36
+ return hashArray([
37
+ CORE_HASH_STRUCTURE.PRIMITIVE_INSTANCE_VALUE,
38
+ PRIMITIVE_TYPE.INTEGER,
39
+ this.multiplicity,
40
+ hashObjectWithoutSourceInformation([this.value]),
41
+ ]);
42
+ }
28
43
  }
@@ -16,6 +16,9 @@
16
16
 
17
17
  import type { V1_ValueSpecificationVisitor } from '../../../model/valueSpecification/V1_ValueSpecification.js';
18
18
  import { V1_CDate } from './V1_CDate.js';
19
+ import { hashArray } from '@finos/legend-shared';
20
+ import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
21
+ import { PRIMITIVE_TYPE } from '../../../../../../../graph/MetaModelConst.js';
19
22
 
20
23
  export class V1_CLatestDate extends V1_CDate {
21
24
  accept_ValueSpecificationVisitor<T>(
@@ -23,4 +26,12 @@ export class V1_CLatestDate extends V1_CDate {
23
26
  ): T {
24
27
  return visitor.visit_CLatestDate(this);
25
28
  }
29
+
30
+ override get hashCode(): string {
31
+ return hashArray([
32
+ CORE_HASH_STRUCTURE.PRIMITIVE_INSTANCE_VALUE,
33
+ PRIMITIVE_TYPE.LATESTDATE,
34
+ this.multiplicity,
35
+ ]);
36
+ }
26
37
  }
@@ -16,6 +16,12 @@
16
16
 
17
17
  import type { V1_ValueSpecificationVisitor } from '../../../model/valueSpecification/V1_ValueSpecification.js';
18
18
  import { V1_CDate } from './V1_CDate.js';
19
+ import { hashArray } from '@finos/legend-shared';
20
+ import {
21
+ CORE_HASH_STRUCTURE,
22
+ hashObjectWithoutSourceInformation,
23
+ } from '../../../../../../../graph/Core_HashUtils.js';
24
+ import { PRIMITIVE_TYPE } from '../../../../../../../graph/MetaModelConst.js';
19
25
 
20
26
  export class V1_CStrictDate extends V1_CDate {
21
27
  value!: string;
@@ -25,4 +31,13 @@ export class V1_CStrictDate extends V1_CDate {
25
31
  ): T {
26
32
  return visitor.visit_CStrictDate(this);
27
33
  }
34
+
35
+ override get hashCode(): string {
36
+ return hashArray([
37
+ CORE_HASH_STRUCTURE.PRIMITIVE_INSTANCE_VALUE,
38
+ PRIMITIVE_TYPE.STRICTDATE,
39
+ this.multiplicity,
40
+ hashObjectWithoutSourceInformation([this.value]),
41
+ ]);
42
+ }
28
43
  }