@finos/legend-graph 32.1.55 → 32.1.57

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 (88) hide show
  1. package/lib/graph/BasicModel.d.ts +1 -1
  2. package/lib/graph/BasicModel.d.ts.map +1 -1
  3. package/lib/graph/BasicModel.js +3 -1
  4. package/lib/graph/BasicModel.js.map +1 -1
  5. package/lib/graph/MetaModelConst.d.ts +3 -2
  6. package/lib/graph/MetaModelConst.d.ts.map +1 -1
  7. package/lib/graph/MetaModelConst.js +2 -1
  8. package/lib/graph/MetaModelConst.js.map +1 -1
  9. package/lib/graph/PureModel.d.ts +4 -0
  10. package/lib/graph/PureModel.d.ts.map +1 -1
  11. package/lib/graph/PureModel.js +35 -3
  12. package/lib/graph/PureModel.js.map +1 -1
  13. package/lib/graph/helpers/STO_RelationFunction_Helper.d.ts +18 -0
  14. package/lib/graph/helpers/STO_RelationFunction_Helper.d.ts.map +1 -0
  15. package/lib/graph/helpers/STO_RelationFunction_Helper.js +18 -0
  16. package/lib/graph/helpers/STO_RelationFunction_Helper.js.map +1 -0
  17. package/lib/graph/metamodel/pure/packageableElements/domain/GenericType.d.ts +2 -0
  18. package/lib/graph/metamodel/pure/packageableElements/domain/GenericType.d.ts.map +1 -1
  19. package/lib/graph/metamodel/pure/packageableElements/domain/GenericType.js +1 -0
  20. package/lib/graph/metamodel/pure/packageableElements/domain/GenericType.js.map +1 -1
  21. package/lib/graph/metamodel/pure/packageableElements/domain/PrimitiveType.d.ts +15 -0
  22. package/lib/graph/metamodel/pure/packageableElements/domain/PrimitiveType.d.ts.map +1 -1
  23. package/lib/graph/metamodel/pure/packageableElements/domain/PrimitiveType.js +19 -1
  24. package/lib/graph/metamodel/pure/packageableElements/domain/PrimitiveType.js.map +1 -1
  25. package/lib/graph/metamodel/pure/packageableElements/relation/RelationType.d.ts +5 -2
  26. package/lib/graph/metamodel/pure/packageableElements/relation/RelationType.d.ts.map +1 -1
  27. package/lib/graph/metamodel/pure/packageableElements/relation/RelationType.js +4 -2
  28. package/lib/graph/metamodel/pure/packageableElements/relation/RelationType.js.map +1 -1
  29. package/lib/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.js +4 -3
  30. package/lib/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.js.map +1 -1
  31. package/lib/graph-manager/protocol/pure/v1/helpers/V1_DomainHelper.d.ts +4 -2
  32. package/lib/graph-manager/protocol/pure/v1/helpers/V1_DomainHelper.d.ts.map +1 -1
  33. package/lib/graph-manager/protocol/pure/v1/helpers/V1_DomainHelper.js +23 -12
  34. package/lib/graph-manager/protocol/pure/v1/helpers/V1_DomainHelper.js.map +1 -1
  35. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.d.ts +4 -1
  36. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.d.ts.map +1 -1
  37. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.js +4 -1
  38. package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.js.map +1 -1
  39. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/type/V1_RelationType.d.ts +1 -0
  40. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/type/V1_RelationType.d.ts.map +1 -1
  41. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/type/V1_RelationType.js +1 -0
  42. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/type/V1_RelationType.js.map +1 -1
  43. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.d.ts +8 -1
  44. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.d.ts.map +1 -1
  45. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.js +29 -2
  46. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.js.map +1 -1
  47. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.d.ts.map +1 -1
  48. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js +5 -0
  49. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js.map +1 -1
  50. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
  51. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +2 -1
  52. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
  53. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.d.ts +1 -0
  54. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.d.ts.map +1 -1
  55. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js +23 -0
  56. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js.map +1 -1
  57. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.d.ts.map +1 -1
  58. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.js +1 -2
  59. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.js.map +1 -1
  60. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.d.ts +3 -2
  61. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.d.ts.map +1 -1
  62. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js +5 -2
  63. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js.map +1 -1
  64. package/lib/index.d.ts +3 -2
  65. package/lib/index.d.ts.map +1 -1
  66. package/lib/index.js +3 -2
  67. package/lib/index.js.map +1 -1
  68. package/lib/package.json +1 -1
  69. package/package.json +1 -1
  70. package/src/graph/BasicModel.ts +3 -2
  71. package/src/graph/MetaModelConst.ts +2 -1
  72. package/src/graph/PureModel.ts +47 -2
  73. package/src/graph/helpers/STO_RelationFunction_Helper.ts +21 -0
  74. package/src/graph/metamodel/pure/packageableElements/domain/GenericType.ts +2 -0
  75. package/src/graph/metamodel/pure/packageableElements/domain/PrimitiveType.ts +52 -1
  76. package/src/graph/metamodel/pure/packageableElements/relation/RelationType.ts +6 -3
  77. package/src/graph-manager/action/changeDetection/DSL_Mapping_ObserverHelper.ts +4 -4
  78. package/src/graph-manager/protocol/pure/v1/helpers/V1_DomainHelper.ts +32 -16
  79. package/src/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_ConsumerEntitlements.ts +5 -1
  80. package/src/graph-manager/protocol/pure/v1/model/packageableElements/type/V1_RelationType.ts +1 -0
  81. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.ts +47 -5
  82. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts +4 -1
  83. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +4 -3
  84. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.ts +41 -0
  85. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.ts +1 -2
  86. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.ts +11 -3
  87. package/src/index.ts +7 -4
  88. package/tsconfig.json +1 -0
@@ -18,6 +18,7 @@ import {
18
18
  type PRIMITIVE_TYPE,
19
19
  ROOT_PACKAGE_NAME,
20
20
  AUTO_IMPORTS,
21
+ PRECISE_PRIMITIVE_TYPE,
21
22
  } from '../graph/MetaModelConst.js';
22
23
  import {
23
24
  type Clazz,
@@ -27,7 +28,10 @@ import {
27
28
  IllegalStateError,
28
29
  isNonNullable,
29
30
  } from '@finos/legend-shared';
30
- import { PrimitiveType } from '../graph/metamodel/pure/packageableElements/domain/PrimitiveType.js';
31
+ import {
32
+ PrecisePrimitiveType,
33
+ PrimitiveType,
34
+ } from '../graph/metamodel/pure/packageableElements/domain/PrimitiveType.js';
31
35
  import { Enumeration } from '../graph/metamodel/pure/packageableElements/domain/Enumeration.js';
32
36
  import { Multiplicity } from '../graph/metamodel/pure/packageableElements/domain/Multiplicity.js';
33
37
  import type { Association } from '../graph/metamodel/pure/packageableElements/domain/Association.js';
@@ -53,7 +57,10 @@ import {
53
57
  Unit,
54
58
  } from '../graph/metamodel/pure/packageableElements/domain/Measure.js';
55
59
  import type { PureGraphPlugin } from './PureGraphPlugin.js';
56
- import { createPath } from '../graph/MetaModelUtils.js';
60
+ import {
61
+ createPath,
62
+ extractElementNameFromPath,
63
+ } from '../graph/MetaModelUtils.js';
57
64
  import type { DataElement } from '../graph/metamodel/pure/packageableElements/data/DataElement.js';
58
65
  import type { Testable } from '../graph/metamodel/pure/test/Testable.js';
59
66
  import type { PackageableElement } from '../graph/metamodel/pure/packageableElements/PackageableElement.js';
@@ -78,14 +85,20 @@ export interface GraphTextInputOption {
78
85
  */
79
86
  export class CoreModel extends BasicModel {
80
87
  primitiveTypesIndex = new Map<string, PrimitiveType>();
88
+ precisePrimitiveTypesIndex = new Map<string, PrimitiveType>();
81
89
 
82
90
  get primitiveTypes(): PrimitiveType[] {
83
91
  return Array.from(this.primitiveTypesIndex.values());
84
92
  }
85
93
 
94
+ get precisePrimitiveTypes(): PrimitiveType[] {
95
+ return Array.from(this.precisePrimitiveTypesIndex.values());
96
+ }
97
+
86
98
  constructor(graphPlugins: PureGraphPlugin[]) {
87
99
  super(ROOT_PACKAGE_NAME.CORE, graphPlugins);
88
100
  this.initializePrimitiveTypes();
101
+ this.initializePrecisePrimitiveTypes();
89
102
  // index model store singleton
90
103
  this.setOwnStore(ModelStore.NAME, ModelStore.INSTANCE);
91
104
  }
@@ -94,6 +107,15 @@ export class CoreModel extends BasicModel {
94
107
  return [...super.allOwnElements, ...this.primitiveTypes];
95
108
  }
96
109
 
110
+ override getOwnNullableType(path: string): Type | undefined {
111
+ let resolvedPath = path;
112
+ if ((Object.values(PRECISE_PRIMITIVE_TYPE) as string[]).includes(path)) {
113
+ // for precise primitive types, we use the name as the path
114
+ resolvedPath = extractElementNameFromPath(path);
115
+ }
116
+ return super.getOwnNullableType(resolvedPath);
117
+ }
118
+
97
119
  /**
98
120
  * NOTE: primitive types are special, they are not put in any package (i.e. they are not linked to `Root` package at all)
99
121
  */
@@ -117,6 +139,29 @@ export class CoreModel extends BasicModel {
117
139
  this.setOwnType(primitiveType.path, primitiveType);
118
140
  });
119
141
  }
142
+
143
+ initializePrecisePrimitiveTypes(): void {
144
+ [
145
+ PrecisePrimitiveType.VARCHAR,
146
+ PrecisePrimitiveType.INT,
147
+ PrecisePrimitiveType.TINY_INT,
148
+ PrecisePrimitiveType.U_TINY_INT,
149
+ PrecisePrimitiveType.SMALL_INT,
150
+ PrecisePrimitiveType.U_SMALL_INT,
151
+ PrecisePrimitiveType.U_INT,
152
+ PrecisePrimitiveType.BIG_INT,
153
+ PrecisePrimitiveType.U_BIG_INT,
154
+ PrecisePrimitiveType._FLOAT,
155
+ PrecisePrimitiveType.DOUBLE,
156
+ PrecisePrimitiveType.Numeric,
157
+ ].forEach((precisePrimitiveType) => {
158
+ this.precisePrimitiveTypesIndex.set(
159
+ precisePrimitiveType.path,
160
+ precisePrimitiveType,
161
+ );
162
+ this.setOwnType(precisePrimitiveType.path, precisePrimitiveType);
163
+ });
164
+ }
120
165
  }
121
166
 
122
167
  export class SystemModel extends BasicModel {
@@ -0,0 +1,21 @@
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 { isEmpty } from '@finos/legend-shared';
18
+ import type { RelationColumn } from '../metamodel/pure/packageableElements/relation/RelationType.js';
19
+
20
+ export const isStubbed_RelationColumn = (column: RelationColumn): boolean =>
21
+ isEmpty(column);
@@ -17,12 +17,14 @@
17
17
  import { uuid } from '@finos/legend-shared';
18
18
  import type { Type } from './Type.js';
19
19
  import type { GenericTypeReference } from './GenericTypeReference.js';
20
+ import type { ValueSpecification } from '../../valueSpecification/ValueSpecification.js';
20
21
 
21
22
  export class GenericType {
22
23
  readonly _UUID = uuid();
23
24
 
24
25
  rawType: Type;
25
26
  typeArguments: GenericTypeReference[] | undefined;
27
+ typeVariableValues: ValueSpecification[] | undefined;
26
28
 
27
29
  constructor(rawType: Type) {
28
30
  this.rawType = rawType;
@@ -16,7 +16,11 @@
16
16
 
17
17
  import { DataType } from './DataType.js';
18
18
  import type { PackageableElementVisitor } from '../PackageableElement.js';
19
- import { PRIMITIVE_TYPE } from '../../../../MetaModelConst.js';
19
+ import {
20
+ PRECISE_PRIMITIVE_TYPE,
21
+ PRIMITIVE_TYPE,
22
+ } from '../../../../MetaModelConst.js';
23
+ import { extractElementNameFromPath } from '../../../../MetaModelUtils.js';
20
24
 
21
25
  export class PrimitiveType extends DataType {
22
26
  accept_PackageableElementVisitor<T>(
@@ -38,6 +42,53 @@ export class PrimitiveType extends DataType {
38
42
  static readonly STRICTTIME = new PrimitiveType(PRIMITIVE_TYPE.STRICTTIME);
39
43
  static readonly LATESTDATE = new PrimitiveType(PRIMITIVE_TYPE.LATESTDATE);
40
44
  static readonly BYTE = new PrimitiveType(PRIMITIVE_TYPE.BYTE);
45
+ // precise primitive
46
+ }
47
+
48
+ export class PrecisePrimitiveType extends DataType {
49
+ static readonly VARCHAR = new PrecisePrimitiveType(
50
+ extractElementNameFromPath(PRECISE_PRIMITIVE_TYPE.VARCHAR),
51
+ );
52
+ static readonly INT = new PrecisePrimitiveType(
53
+ extractElementNameFromPath(PRECISE_PRIMITIVE_TYPE.INT),
54
+ );
55
+ static readonly TINY_INT = new PrecisePrimitiveType(
56
+ extractElementNameFromPath(PRECISE_PRIMITIVE_TYPE.TINY_INT),
57
+ );
58
+ static readonly U_TINY_INT = new PrecisePrimitiveType(
59
+ extractElementNameFromPath(PRECISE_PRIMITIVE_TYPE.U_TINY_INT),
60
+ );
61
+ static readonly SMALL_INT = new PrecisePrimitiveType(
62
+ extractElementNameFromPath(PRECISE_PRIMITIVE_TYPE.SMALL_INT),
63
+ );
64
+ static readonly U_SMALL_INT = new PrecisePrimitiveType(
65
+ extractElementNameFromPath(PRECISE_PRIMITIVE_TYPE.U_SMALL_INT),
66
+ );
67
+ static readonly U_INT = new PrecisePrimitiveType(
68
+ extractElementNameFromPath(PRECISE_PRIMITIVE_TYPE.U_INT),
69
+ );
70
+ static readonly BIG_INT = new PrecisePrimitiveType(
71
+ extractElementNameFromPath(PRECISE_PRIMITIVE_TYPE.BIG_INT),
72
+ );
73
+ static readonly U_BIG_INT = new PrecisePrimitiveType(
74
+ extractElementNameFromPath(PRECISE_PRIMITIVE_TYPE.U_BIG_INT),
75
+ );
76
+ static readonly _FLOAT = new PrecisePrimitiveType(
77
+ extractElementNameFromPath(PRECISE_PRIMITIVE_TYPE.FLOAT),
78
+ );
79
+ static readonly DOUBLE = new PrecisePrimitiveType(
80
+ extractElementNameFromPath(PRECISE_PRIMITIVE_TYPE.DOUBLE),
81
+ );
82
+
83
+ static readonly Numeric = new PrecisePrimitiveType(
84
+ extractElementNameFromPath(PRECISE_PRIMITIVE_TYPE.NUMERIC),
85
+ );
86
+
87
+ override accept_PackageableElementVisitor<T>(
88
+ visitor: PackageableElementVisitor<T>,
89
+ ): T {
90
+ throw new Error('Method not implemented.');
91
+ }
41
92
  }
42
93
 
43
94
  export const getPrimitiveTypeInstanceFromEnum = (
@@ -17,13 +17,16 @@
17
17
  import { Type } from '../domain/Type.js';
18
18
  import type { PackageableElementVisitor } from '../PackageableElement.js';
19
19
  import { Function } from '../domain/Function.js';
20
+ import { Multiplicity } from '../domain/Multiplicity.js';
21
+ import type { GenericTypeReference } from '../domain/GenericTypeReference.js';
20
22
 
21
23
  export class RelationColumn extends Function {
22
- type: Type;
24
+ genericType: GenericTypeReference;
25
+ multiplicity: Multiplicity = Multiplicity.ONE;
23
26
 
24
- constructor(name: string, type: Type) {
27
+ constructor(name: string, type: GenericTypeReference) {
25
28
  super(name);
26
- this.type = type;
29
+ this.genericType = type;
27
30
  }
28
31
 
29
32
  override accept_PackageableElementVisitor<T>(
@@ -99,8 +99,8 @@ import {
99
99
  import {
100
100
  observe_ConcreteFunctionDefinition,
101
101
  observe_EnumValueReference,
102
+ observe_GenericTypeReference,
102
103
  observe_PropertyReference,
103
- observe_Type,
104
104
  } from './DomainObserverHelper.js';
105
105
  import { observe_RawLambda } from './RawValueSpecificationObserver.js';
106
106
  import {
@@ -230,11 +230,11 @@ export const observe_RelationColumn = skipObserved(
230
230
  (metamodel: RelationColumn): RelationColumn => {
231
231
  makeObservable(metamodel, {
232
232
  name: observable,
233
- type: observable,
233
+ genericType: observable,
234
234
  hashCode: computed,
235
235
  });
236
-
237
- observe_Type(metamodel.type);
236
+ // FIXME
237
+ observe_GenericTypeReference(metamodel.genericType);
238
238
 
239
239
  return metamodel;
240
240
  },
@@ -30,10 +30,14 @@ import {
30
30
  V1_RelationTypeColumn,
31
31
  } from '../model/packageableElements/type/V1_RelationType.js';
32
32
  import type { V1_Type } from '../model/packageableElements/type/V1_Type.js';
33
+ import { V1_transformMultiplicity } from '../transformation/pureGraph/from/V1_CoreTransformerHelper.js';
34
+ import type { Multiplicity } from '../../../../../graph/metamodel/pure/packageableElements/domain/Multiplicity.js';
33
35
 
34
36
  export const V1_getGenericTypeFullPath = (val: V1_GenericType): string => {
35
37
  if (val.rawType instanceof V1_PackageableType) {
36
38
  return val.rawType.fullPath;
39
+ } else if (val.rawType instanceof V1_RelationType) {
40
+ return V1_RelationType.NAME;
37
41
  }
38
42
  throw new UnsupportedOperationError(
39
43
  `Can't extract type path from generic type`,
@@ -122,22 +126,6 @@ export const V1_buildFunctionPrettyName = (
122
126
  return '';
123
127
  });
124
128
 
125
- export function V1_createGenericTypeWithElementPath(
126
- path: string,
127
- ): V1_GenericType {
128
- const genType = new V1_GenericType();
129
- const pType = new V1_PackageableType();
130
- pType.fullPath = path;
131
- genType.rawType = pType;
132
- return genType;
133
- }
134
-
135
- export function V1_createGenericTypeWithRawType(type: V1_Type): V1_GenericType {
136
- const genType = new V1_GenericType();
137
- genType.rawType = type;
138
- return genType;
139
- }
140
-
141
129
  export function V1_createRelationType(
142
130
  columns: V1_RelationTypeColumn[],
143
131
  ): V1_RelationType {
@@ -156,3 +144,31 @@ export function V1_createRelationTypeColumn(
156
144
  column.multiplicity = V1_Multiplicity.ZERO_ONE;
157
145
  return column;
158
146
  }
147
+
148
+ export function V1_createRelationTypeColumnWithGenericType(
149
+ name: string,
150
+ type: V1_GenericType,
151
+ multiplicity: Multiplicity,
152
+ ): V1_RelationTypeColumn {
153
+ const column = new V1_RelationTypeColumn();
154
+ column.name = name;
155
+ column.genericType = type;
156
+ column.multiplicity = V1_transformMultiplicity(multiplicity);
157
+ return column;
158
+ }
159
+
160
+ export function V1_createGenericTypeWithElementPath(
161
+ path: string,
162
+ ): V1_GenericType {
163
+ const genType = new V1_GenericType();
164
+ const pType = new V1_PackageableType();
165
+ pType.fullPath = path;
166
+ genType.rawType = pType;
167
+ return genType;
168
+ }
169
+
170
+ export function V1_createGenericTypeWithRawType(type: V1_Type): V1_GenericType {
171
+ const genType = new V1_GenericType();
172
+ genType.rawType = type;
173
+ return genType;
174
+ }
@@ -163,7 +163,7 @@ export class V1_ContractUserEventRecord {
163
163
  type!: V1_ApprovalType;
164
164
  }
165
165
 
166
- export class V1_PendingTasksRespond {
166
+ export class V1_PendingTasksResponse {
167
167
  privilegeManager: V1_ContractUserEventRecord[] = [];
168
168
  dataOwner: V1_ContractUserEventRecord[] = [];
169
169
  }
@@ -208,3 +208,7 @@ export class V1_TaskMetadata {
208
208
  export class V1_TaskResponse {
209
209
  tasks: V1_TaskMetadata[] | undefined;
210
210
  }
211
+
212
+ export class V1_ContractUserStatusResponse {
213
+ status!: V1_EnrichedUserApprovalStatus;
214
+ }
@@ -35,6 +35,7 @@ export class V1_RelationTypeColumn implements Hashable {
35
35
  }
36
36
 
37
37
  export class V1_RelationType implements V1_Type {
38
+ static readonly NAME = 'RelationType';
38
39
  columns: V1_RelationTypeColumn[] = [];
39
40
 
40
41
  get hashCode(): string {
@@ -76,24 +76,66 @@ import { V1_transformEmbeddedData } from './V1_DataElementTransformer.js';
76
76
  import { V1_transformTestAssertion } from './V1_TestTransformer.js';
77
77
  import { V1_DefaultValue } from '../../../model/packageableElements/domain/V1_DefaultValue.js';
78
78
  import { PackageableElementPointerType } from '../../../../../../../graph/MetaModelConst.js';
79
- import { V1_createGenericTypeWithElementPath } from '../../../helpers/V1_DomainHelper.js';
79
+ import {
80
+ V1_createGenericTypeWithElementPath,
81
+ V1_createRelationTypeColumnWithGenericType,
82
+ } from '../../../helpers/V1_DomainHelper.js';
80
83
  import { V1_PackageableElementPointer } from '../../../model/packageableElements/V1_PackageableElement.js';
81
84
  import type { GenericType } from '../../../../../../../graph/metamodel/pure/packageableElements/domain/GenericType.js';
82
- import type { V1_GenericType } from '../../../model/packageableElements/type/V1_GenericType.js';
85
+ import { V1_GenericType } from '../../../model/packageableElements/type/V1_GenericType.js';
86
+ import type { V1_Type } from '../../../model/packageableElements/type/V1_Type.js';
87
+ import { RelationType } from '../../../../../../../graph/metamodel/pure/packageableElements/relation/RelationType.js';
88
+ import { V1_PackageableType } from '../../../model/packageableElements/type/V1_PackageableType.js';
89
+ import type { Type } from '../../../../../../../graph/metamodel/pure/packageableElements/domain/Type.js';
90
+ import { V1_RelationType } from '../../../model/packageableElements/type/V1_RelationType.js';
91
+ import { V1_transformRootValueSpecification } from './V1_ValueSpecificationTransformer.js';
83
92
 
84
93
  export const V1_createGenericType = (
85
94
  genericType: GenericType,
86
95
  ): V1_GenericType => {
87
- const protocolGenType = V1_createGenericTypeWithElementPath(
88
- genericType.rawType.path,
89
- );
96
+ const v1Type = V1_transformGenericType_Type(genericType.rawType);
97
+ const protocolGenType = new V1_GenericType();
98
+ protocolGenType.rawType = v1Type;
90
99
  const typeArguments = genericType.typeArguments ?? [];
91
100
  protocolGenType.typeArguments = typeArguments.map((t) =>
92
101
  V1_createGenericType(t.value),
93
102
  );
103
+ protocolGenType.typeVariableValues =
104
+ genericType.typeVariableValues?.map((v) =>
105
+ V1_transformRootValueSpecification(v),
106
+ ) ?? [];
94
107
  return protocolGenType;
95
108
  };
96
109
 
110
+ export function V1_transformGenericType_Type(type: Type): V1_Type {
111
+ if (type instanceof RelationType) {
112
+ return V1_transformGenericType_RelationType(type);
113
+ }
114
+ const pType = new V1_PackageableType();
115
+ pType.fullPath = type.path;
116
+ return pType;
117
+ }
118
+
119
+ export function V1_transformGenericType_RelationType(
120
+ path: RelationType,
121
+ ): V1_RelationType {
122
+ const genType = new V1_RelationType();
123
+ genType.columns = path.columns.map((col) =>
124
+ V1_createRelationTypeColumnWithGenericType(
125
+ col.name,
126
+ V1_createGenericType(col.genericType.value),
127
+ col.multiplicity,
128
+ ),
129
+ );
130
+ return genType;
131
+ }
132
+
133
+ export function V1_createGenericTypeWithRawType(type: V1_Type): V1_GenericType {
134
+ const genType = new V1_GenericType();
135
+ genType.rawType = type;
136
+ return genType;
137
+ }
138
+
97
139
  export const V1_createRawGenericTypeWithElementPath = (
98
140
  path: string,
99
141
  ): V1_RawGenericType => {
@@ -177,10 +177,11 @@ import type { INTERNAL__UnknownSetImplementation } from '../../../../../../../gr
177
177
  import { V1_INTERNAL__UnknownClassMapping } from '../../../model/packageableElements/mapping/V1_INTERNAL__UnknownClassMapping.js';
178
178
  import { V1_PackageableElementPointer } from '../../../model/packageableElements/V1_PackageableElement.js';
179
179
  import type { RelationFunctionInstanceSetImplementation } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionInstanceSetImplementation.js';
180
- import type { RelationFunctionPropertyMapping } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionPropertyMapping.js';
180
+ import { RelationFunctionPropertyMapping } from '../../../../../../../graph/metamodel/pure/packageableElements/mapping/relationFunction/RelationFunctionPropertyMapping.js';
181
181
  import { V1_RelationFunctionPropertyMapping } from '../../../model/packageableElements/mapping/V1_RelationFunctionPropertyMapping.js';
182
182
  import { V1_RelationFunctionClassMapping } from '../../../model/packageableElements/mapping/V1_RelationFunctionClassMapping.js';
183
183
  import { generateFunctionPrettyName } from '../../../../../../../graph/helpers/PureLanguageHelper.js';
184
+ import { isStubbed_RelationColumn } from '../../../../../../../graph/helpers/STO_RelationFunction_Helper.js';
184
185
 
185
186
  export const V1_transformPropertyReference = (
186
187
  element: PropertyReference,
@@ -466,6 +467,8 @@ const transformClassMappingPropertyMappings = (
466
467
  return !isStubbed_RawRelationalOperationElement(
467
468
  value.relationalOperation,
468
469
  );
470
+ } else if (value instanceof RelationFunctionPropertyMapping) {
471
+ return !isStubbed_RelationColumn(value.column);
469
472
  }
470
473
  const checkerResult = context.plugins
471
474
  .flatMap(
@@ -454,9 +454,10 @@ export class V1_ElementSecondPassBuilder
454
454
  const func = this.context.currentSubGraph.getOwnFunction(
455
455
  V1_buildFullPath(protocol.package, V1_buildFunctionSignature(protocol)),
456
456
  );
457
- func.returnType = this.context.resolveGenericTypeFromProtocol(
458
- protocol.returnGenericType,
459
- );
457
+ func.returnType =
458
+ this.context.resolveGenericTypeFromProtocolWithRelationType(
459
+ protocol.returnGenericType,
460
+ );
460
461
  func.returnMultiplicity = this.context.graph.getMultiplicity(
461
462
  protocol.returnMultiplicity.lowerBound,
462
463
  protocol.returnMultiplicity.upperBound,
@@ -102,6 +102,12 @@ import type { PropertyOwner } from '../../../../../../../graph/metamodel/pure/pa
102
102
  import type { DataElement } from '../../../../../../../graph/metamodel/pure/packageableElements/data/DataElement.js';
103
103
  import type { V1_GenericType } from '../../../model/packageableElements/type/V1_GenericType.js';
104
104
  import { V1_getGenericTypeFullPath } from '../../../helpers/V1_DomainHelper.js';
105
+ import { V1_RelationType } from '../../../model/packageableElements/type/V1_RelationType.js';
106
+ import {
107
+ RelationColumn,
108
+ RelationType,
109
+ } from '../../../../../../../graph/metamodel/pure/packageableElements/relation/RelationType.js';
110
+ import { V1_buildValueSpecification } from './helpers/V1_ValueSpecificationBuilderHelper.js';
105
111
 
106
112
  export const V1_buildFullPath = (
107
113
  packagePath: string | undefined,
@@ -334,6 +340,41 @@ export class V1_GraphBuilderContext {
334
340
  return GenericTypeImplicitReference.create(ownerReference, value);
335
341
  };
336
342
 
343
+ resolveGenericTypeFromProtocolWithRelationType = (
344
+ genericType: V1_GenericType,
345
+ ): GenericTypeReference => {
346
+ let ownerReference: PackageableElementImplicitReference<PackageableElement>;
347
+ const rawType = genericType.rawType;
348
+ if (rawType instanceof V1_RelationType) {
349
+ const _relType = new RelationType(RelationType.ID);
350
+ _relType.columns = rawType.columns.map((_col) => {
351
+ const relCol = new RelationColumn(
352
+ _col.name,
353
+ this.resolveGenericTypeFromProtocolWithRelationType(_col.genericType),
354
+ );
355
+ relCol.multiplicity = this.graph.getMultiplicity(
356
+ _col.multiplicity.lowerBound,
357
+ _col.multiplicity.upperBound,
358
+ );
359
+ return relCol;
360
+ });
361
+ ownerReference = PackageableElementImplicitReference.create(
362
+ _relType,
363
+ V1_RelationType.NAME,
364
+ );
365
+ } else {
366
+ ownerReference = this.resolveType(V1_getGenericTypeFullPath(genericType));
367
+ }
368
+ const typeArguments = genericType.typeArguments.map((g) =>
369
+ this.resolveGenericTypeFromProtocolWithRelationType(g),
370
+ );
371
+ const value = newGenericType(ownerReference.value, typeArguments);
372
+ value.typeVariableValues = genericType.typeVariableValues.map((v) =>
373
+ V1_buildValueSpecification(v, this),
374
+ );
375
+ return GenericTypeImplicitReference.create(ownerReference, value);
376
+ };
377
+
337
378
  resolveOwnProperty = (
338
379
  pointer: V1_PropertyPointer,
339
380
  ): PropertyImplicitReference => {
@@ -1252,7 +1252,6 @@ export class V1_PropertyMappingBuilder
1252
1252
  this.context,
1253
1253
  ),
1254
1254
  );
1255
- const propertyType = property.genericType.value.rawType;
1256
1255
  const propertyMapping = new RelationFunctionPropertyMapping(
1257
1256
  this.topParent ?? this.immediateParent,
1258
1257
  PropertyImplicitReference.create(
@@ -1267,7 +1266,7 @@ export class V1_PropertyMappingBuilder
1267
1266
  protocol.source,
1268
1267
  ),
1269
1268
  undefined,
1270
- new RelationColumn(protocol.column, propertyType),
1269
+ new RelationColumn(protocol.column, property.genericType),
1271
1270
  );
1272
1271
  propertyMapping.localMappingProperty = localMapping;
1273
1272
  return propertyMapping;
@@ -36,11 +36,12 @@ import {
36
36
  V1_DataContractSubscriptions,
37
37
  V1_DataContractsResponse,
38
38
  V1_DataProduct_Entitlements,
39
- V1_PendingTasksRespond,
39
+ V1_PendingTasksResponse,
40
40
  V1_TaskMetadata,
41
41
  V1_TaskResponse,
42
42
  V1_TaskStatusChangeResponse,
43
43
  V1_ContractUserMembership,
44
+ V1_ContractUserStatusResponse,
44
45
  } from '../../../lakehouse/entitlements/V1_ConsumerEntitlements.js';
45
46
  import {
46
47
  createModelSchema,
@@ -302,8 +303,8 @@ export const V1_taskResponseModelSchema = createModelSchema(V1_TaskResponse, {
302
303
  tasks: customListWithSchema(V1_taskMetadataModelSchema),
303
304
  });
304
305
 
305
- export const V1_pendingTasksRespondModelSchema = createModelSchema(
306
- V1_PendingTasksRespond,
306
+ export const V1_pendingTasksResponseModelSchema = createModelSchema(
307
+ V1_PendingTasksResponse,
307
308
  {
308
309
  privilegeManager: customListWithSchema(
309
310
  V1_contractUserEventRecordModelSchema,
@@ -352,3 +353,10 @@ export const V1_createContractPayloadModelSchema = (
352
353
  (val) => V1_deserializeOrganizationalScope(val, plugins),
353
354
  ),
354
355
  });
356
+
357
+ export const V1_ContractUserStatusResponseModelSchema = createModelSchema(
358
+ V1_ContractUserStatusResponse,
359
+ {
360
+ status: primitive(),
361
+ },
362
+ );
package/src/index.ts CHANGED
@@ -276,12 +276,13 @@ export {
276
276
  V1_ContractUserEventPayload,
277
277
  V1_ContractUserEventPrivilegeManagerPayload,
278
278
  V1_ContractUserEventRecord,
279
+ V1_ContractUserStatusResponse,
279
280
  V1_CreateContractPayload,
280
281
  V1_DataContract,
281
282
  V1_DataContractApprovedUsersResponse,
282
283
  V1_DataContractsResponse,
283
284
  V1_EnrichedUserApprovalStatus,
284
- V1_PendingTasksRespond,
285
+ V1_PendingTasksResponse,
285
286
  V1_ResourceType,
286
287
  V1_TaskMetadata,
287
288
  V1_TaskResponse,
@@ -300,14 +301,15 @@ export {
300
301
  V1_UserType,
301
302
  } from './graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_CoreEntitlements.js';
302
303
  export {
304
+ V1_AdhocTeamModelSchema,
303
305
  V1_AppDirNodeModelSchema,
306
+ V1_ContractUserStatusResponseModelSchema,
304
307
  V1_createContractPayloadModelSchema,
305
308
  V1_dataContractsResponseModelSchema,
306
- V1_pendingTasksRespondModelSchema,
307
- V1_TaskStatusChangeResponseModelSchema,
308
- V1_AdhocTeamModelSchema,
309
309
  V1_dataContractsResponseModelSchemaToContracts,
310
310
  V1_deserializeTaskResponse,
311
+ V1_pendingTasksResponseModelSchema,
312
+ V1_TaskStatusChangeResponseModelSchema,
311
313
  } from './graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js';
312
314
  export {
313
315
  V1_CreateSubscriptionInput,
@@ -778,6 +780,7 @@ export {
778
780
  IdentifiedConnection,
779
781
  StoreConnections,
780
782
  } from './graph/metamodel/pure/packageableElements/runtime/Runtime.js';
783
+ export * from './graph/helpers/STO_RelationFunction_Helper.js';
781
784
  export { PackageableRuntime } from './graph/metamodel/pure/packageableElements/runtime/PackageableRuntime.js';
782
785
  export { PureInstanceSetImplementation } from './graph/metamodel/pure/packageableElements/store/modelToModel/mapping/PureInstanceSetImplementation.js';
783
786
  export {
package/tsconfig.json CHANGED
@@ -77,6 +77,7 @@
77
77
  "./src/graph/helpers/FunctionAnalysis.ts",
78
78
  "./src/graph/helpers/PureLanguageHelper.ts",
79
79
  "./src/graph/helpers/STO_FlatData_Helper.ts",
80
+ "./src/graph/helpers/STO_RelationFunction_Helper.ts",
80
81
  "./src/graph/helpers/STO_Relational_Helper.ts",
81
82
  "./src/graph/helpers/ValueSpecificationHelper.ts",
82
83
  "./src/graph/helpers/creator/DSL_ExternalFormat_ModelCreatorHelper.ts",