@finos/legend-graph 13.0.2 → 14.0.2
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.
- package/lib/graph/Core_HashUtils.d.ts +1 -0
- package/lib/graph/Core_HashUtils.d.ts.map +1 -1
- package/lib/graph/Core_HashUtils.js +3 -2
- package/lib/graph/Core_HashUtils.js.map +1 -1
- package/lib/graph/helpers/DomainHelper.d.ts +8 -0
- package/lib/graph/helpers/DomainHelper.d.ts.map +1 -1
- package/lib/graph/helpers/DomainHelper.js +22 -2
- package/lib/graph/helpers/DomainHelper.js.map +1 -1
- package/lib/graph/helpers/ValueSpecificationHelper.d.ts +1 -1
- package/lib/graph/helpers/ValueSpecificationHelper.d.ts.map +1 -1
- package/lib/graph/helpers/ValueSpecificationHelper.js +4 -2
- package/lib/graph/helpers/ValueSpecificationHelper.js.map +1 -1
- package/lib/graph/metamodel/pure/Reference.d.ts +1 -0
- package/lib/graph/metamodel/pure/Reference.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/Reference.js +2 -0
- package/lib/graph/metamodel/pure/Reference.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/domain/PropertyReference.js +2 -2
- package/lib/graph/metamodel/pure/packageableElements/domain/PropertyReference.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/domain/StereotypeReference.js +2 -2
- package/lib/graph/metamodel/pure/packageableElements/domain/StereotypeReference.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/domain/TagReference.js +2 -2
- package/lib/graph/metamodel/pure/packageableElements/domain/TagReference.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.js +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataDataType.d.ts +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataDataType.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataDataType.js +3 -3
- package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataDataType.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataProperty.d.ts +2 -2
- package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataProperty.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataProperty.js +2 -2
- package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataProperty.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataSectionReference.js +2 -2
- package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataSectionReference.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.d.ts +5 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.js +13 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/model/TableReference.js +3 -3
- package/lib/graph/metamodel/pure/packageableElements/store/relational/model/TableReference.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/model/ViewReference.js +3 -3
- package/lib/graph/metamodel/pure/packageableElements/store/relational/model/ViewReference.js.map +1 -1
- package/lib/graphManager/AbstractPureGraphManager.d.ts +5 -5
- package/lib/graphManager/AbstractPureGraphManager.d.ts.map +1 -1
- package/lib/graphManager/AbstractPureGraphManager.js.map +1 -1
- package/lib/graphManager/GraphManagerState.d.ts +8 -17
- package/lib/graphManager/GraphManagerState.d.ts.map +1 -1
- package/lib/graphManager/GraphManagerState.js +8 -73
- package/lib/graphManager/GraphManagerState.js.map +1 -1
- package/lib/graphManager/action/changeDetection/StoreRelational_ObserverHelper.d.ts +2 -1
- package/lib/graphManager/action/changeDetection/StoreRelational_ObserverHelper.d.ts.map +1 -1
- package/lib/graphManager/action/changeDetection/StoreRelational_ObserverHelper.js +8 -1
- package/lib/graphManager/action/changeDetection/StoreRelational_ObserverHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts +4 -4
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js +26 -91
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.d.ts +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.js +2 -2
- package/lib/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataDataType.d.ts +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataDataType.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataDataType.js +3 -3
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataDataType.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.d.ts +3 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.js +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.d.ts +4 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.js +9 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js +7 -2
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_FlatDataStoreBuilderHelper.js +1 -3
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_FlatDataStoreBuilderHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js +6 -2
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js +11 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.js +17 -8
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.js.map +1 -1
- package/lib/package.json +2 -2
- package/package.json +5 -5
- package/src/graph/Core_HashUtils.ts +3 -2
- package/src/graph/helpers/DomainHelper.ts +48 -0
- package/src/graph/helpers/ValueSpecificationHelper.ts +6 -1
- package/src/graph/metamodel/pure/Reference.ts +4 -0
- package/src/graph/metamodel/pure/packageableElements/domain/PropertyReference.ts +2 -2
- package/src/graph/metamodel/pure/packageableElements/domain/StereotypeReference.ts +2 -2
- package/src/graph/metamodel/pure/packageableElements/domain/TagReference.ts +2 -2
- package/src/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.ts +1 -1
- package/src/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataDataType.ts +4 -4
- package/src/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataProperty.ts +3 -3
- package/src/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataSectionReference.ts +2 -2
- package/src/graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.ts +19 -0
- package/src/graph/metamodel/pure/packageableElements/store/relational/model/TableReference.ts +3 -3
- package/src/graph/metamodel/pure/packageableElements/store/relational/model/ViewReference.ts +3 -3
- package/src/graphManager/AbstractPureGraphManager.ts +14 -20
- package/src/graphManager/GraphManagerState.ts +10 -113
- package/src/graphManager/action/changeDetection/StoreRelational_ObserverHelper.ts +16 -0
- package/src/graphManager/protocol/pure/v1/V1_PureGraphManager.ts +36 -113
- package/src/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.ts +2 -2
- package/src/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataDataType.ts +4 -4
- package/src/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.ts +4 -2
- package/src/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.ts +14 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.ts +8 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_FlatDataStoreBuilderHelper.ts +3 -3
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.ts +14 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.ts +22 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.ts +30 -12
|
@@ -24,6 +24,8 @@ import {
|
|
|
24
24
|
PRIMITIVE_TYPE,
|
|
25
25
|
MULTIPLICITY_INFINITE,
|
|
26
26
|
PURE_DEPRECATED_STEREOTYPE,
|
|
27
|
+
ROOT_PACKAGE_NAME,
|
|
28
|
+
MILESTONING_VERSION_PROPERTY_SUFFIX,
|
|
27
29
|
} from '../MetaModelConst.js';
|
|
28
30
|
import { Package } from '../metamodel/pure/packageableElements/domain/Package.js';
|
|
29
31
|
import type { PackageableElement } from '../metamodel/pure/packageableElements/PackageableElement.js';
|
|
@@ -36,6 +38,7 @@ import {
|
|
|
36
38
|
guaranteeType,
|
|
37
39
|
uniqBy,
|
|
38
40
|
UnsupportedOperationError,
|
|
41
|
+
returnUndefOnError,
|
|
39
42
|
} from '@finos/legend-shared';
|
|
40
43
|
import { createPath } from '../MetaModelUtils.js';
|
|
41
44
|
import type { BasicModel } from '../BasicModel.js';
|
|
@@ -215,6 +218,35 @@ export const getRawGenericType = <T extends Type>(
|
|
|
215
218
|
clazz: Clazz<T>,
|
|
216
219
|
): T => guaranteeType<T>(genericType.rawType, clazz);
|
|
217
220
|
|
|
221
|
+
export const isElementReadOnly = (element: PackageableElement): boolean =>
|
|
222
|
+
returnUndefOnError(() => getElementRootPackage(element))?.name !==
|
|
223
|
+
ROOT_PACKAGE_NAME.MAIN;
|
|
224
|
+
|
|
225
|
+
export const isDependencyElement = (
|
|
226
|
+
element: PackageableElement,
|
|
227
|
+
): element is PackageableElement =>
|
|
228
|
+
returnUndefOnError(() => getElementRootPackage(element))?.name ===
|
|
229
|
+
ROOT_PACKAGE_NAME.PROJECT_DEPENDENCY_ROOT;
|
|
230
|
+
|
|
231
|
+
export const isGeneratedElement = (
|
|
232
|
+
element: PackageableElement,
|
|
233
|
+
): element is PackageableElement =>
|
|
234
|
+
returnUndefOnError(() => getElementRootPackage(element))?.name ===
|
|
235
|
+
ROOT_PACKAGE_NAME.MODEL_GENERATION;
|
|
236
|
+
|
|
237
|
+
export const isSystemElement = (
|
|
238
|
+
element: PackageableElement,
|
|
239
|
+
): element is PackageableElement => {
|
|
240
|
+
const elementRootPackageName = returnUndefOnError(() =>
|
|
241
|
+
getElementRootPackage(element),
|
|
242
|
+
)?.name;
|
|
243
|
+
return (
|
|
244
|
+
element instanceof PrimitiveType ||
|
|
245
|
+
elementRootPackageName === ROOT_PACKAGE_NAME.SYSTEM ||
|
|
246
|
+
elementRootPackageName === ROOT_PACKAGE_NAME.CORE
|
|
247
|
+
);
|
|
248
|
+
};
|
|
249
|
+
|
|
218
250
|
/**
|
|
219
251
|
* Extract the type of temporal milestone the class is associated with (using stereotype).
|
|
220
252
|
*
|
|
@@ -532,3 +564,19 @@ export const isElementDeprecated = (
|
|
|
532
564
|
.getProfile(CORE_PURE_PATH.PROFILE_DOC)
|
|
533
565
|
.p_stereotypes.find((s) => s.value === PURE_DEPRECATED_STEREOTYPE),
|
|
534
566
|
);
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Gets the generated milestoned properties of a property owner
|
|
570
|
+
*/
|
|
571
|
+
export const getGeneratedMilestonedPropertiesForAssociation = (
|
|
572
|
+
propertyOwner: PropertyOwner,
|
|
573
|
+
property: DerivedProperty,
|
|
574
|
+
): AbstractProperty[] =>
|
|
575
|
+
propertyOwner._generatedMilestonedProperties.filter(
|
|
576
|
+
(prop) =>
|
|
577
|
+
prop.name !== property.name &&
|
|
578
|
+
prop.name !==
|
|
579
|
+
`${property.name}${MILESTONING_VERSION_PROPERTY_SUFFIX.ALL_VERSIONS}` &&
|
|
580
|
+
prop.name !==
|
|
581
|
+
`${property.name}${MILESTONING_VERSION_PROPERTY_SUFFIX.ALL_VERSIONS_IN_RANGE}`,
|
|
582
|
+
);
|
|
@@ -101,6 +101,7 @@ export const createMockEnumerationProperty = (
|
|
|
101
101
|
|
|
102
102
|
export const generateVariableExpressionMockValue = (
|
|
103
103
|
parameter: VariableExpression,
|
|
104
|
+
graph: PureModel,
|
|
104
105
|
): InstanceValue | undefined => {
|
|
105
106
|
const varType = parameter.genericType?.value.rawType;
|
|
106
107
|
const multiplicity = parameter.multiplicity;
|
|
@@ -112,7 +113,11 @@ export const generateVariableExpressionMockValue = (
|
|
|
112
113
|
}
|
|
113
114
|
if (varType instanceof PrimitiveType) {
|
|
114
115
|
const primitiveInst = new PrimitiveInstanceValue(
|
|
115
|
-
GenericTypeExplicitReference.create(
|
|
116
|
+
GenericTypeExplicitReference.create(
|
|
117
|
+
varType.name === PRIMITIVE_TYPE.DATE
|
|
118
|
+
? new GenericType(graph.getPrimitiveType(PRIMITIVE_TYPE.STRICTDATE))
|
|
119
|
+
: new GenericType(varType),
|
|
120
|
+
),
|
|
116
121
|
multiplicity,
|
|
117
122
|
);
|
|
118
123
|
primitiveInst.values = [
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { uuid } from '@finos/legend-shared';
|
|
18
|
+
|
|
17
19
|
/**
|
|
18
20
|
* Reference implies pointer-based relationship in the protocol. This means that during graph-building,
|
|
19
21
|
* we figure out/infer the reference using pointer of some form. Take the following example:
|
|
@@ -53,6 +55,8 @@
|
|
|
53
55
|
* but for simplicity sake, we will just swap out to use new a new reference
|
|
54
56
|
*/
|
|
55
57
|
export abstract class Reference {
|
|
58
|
+
readonly _UUID = uuid();
|
|
59
|
+
|
|
56
60
|
abstract value: unknown;
|
|
57
61
|
}
|
|
58
62
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { CORE_HASH_STRUCTURE } from '../../../../../graph/Core_HashUtils.js';
|
|
18
|
-
import {
|
|
18
|
+
import { hashValue } from '@finos/legend-shared';
|
|
19
19
|
import {
|
|
20
20
|
PackageableElementExplicitReference,
|
|
21
21
|
type PackageableElementReference,
|
|
@@ -48,7 +48,7 @@ export abstract class PropertyReference extends ReferenceWithOwner {
|
|
|
48
48
|
this.value.name,
|
|
49
49
|
this.ownerReference.valueForSerialization ?? '',
|
|
50
50
|
]
|
|
51
|
-
.map(
|
|
51
|
+
.map(hashValue)
|
|
52
52
|
.join(',');
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { CORE_HASH_STRUCTURE } from '../../../../../graph/Core_HashUtils.js';
|
|
18
|
-
import {
|
|
18
|
+
import { hashValue } from '@finos/legend-shared';
|
|
19
19
|
import {
|
|
20
20
|
PackageableElementExplicitReference,
|
|
21
21
|
type PackageableElementReference,
|
|
@@ -44,7 +44,7 @@ export abstract class StereotypeReference extends ReferenceWithOwner {
|
|
|
44
44
|
this.value.value,
|
|
45
45
|
this.ownerReference.valueForSerialization ?? '',
|
|
46
46
|
]
|
|
47
|
-
.map(
|
|
47
|
+
.map(hashValue)
|
|
48
48
|
.join(',');
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { CORE_HASH_STRUCTURE } from '../../../../../graph/Core_HashUtils.js';
|
|
18
|
-
import {
|
|
18
|
+
import { hashValue } from '@finos/legend-shared';
|
|
19
19
|
import {
|
|
20
20
|
PackageableElementExplicitReference,
|
|
21
21
|
type PackageableElementReference,
|
|
@@ -44,7 +44,7 @@ export abstract class TagReference extends ReferenceWithOwner {
|
|
|
44
44
|
this.value.value,
|
|
45
45
|
this.ownerReference.valueForSerialization ?? '',
|
|
46
46
|
]
|
|
47
|
-
.map(
|
|
47
|
+
.map(hashValue)
|
|
48
48
|
.join(',');
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -102,7 +102,7 @@ export abstract class PropertyMapping implements Hashable {
|
|
|
102
102
|
return hashArray([
|
|
103
103
|
CORE_HASH_STRUCTURE.PROPERTY_MAPPING,
|
|
104
104
|
this.property.pointerHashCode,
|
|
105
|
-
this.targetSetImplementation?.
|
|
105
|
+
this.targetSetImplementation?.valueForSerialization ?? '',
|
|
106
106
|
this.localMappingProperty ?? '',
|
|
107
107
|
]);
|
|
108
108
|
}
|
package/src/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataDataType.ts
CHANGED
|
@@ -73,13 +73,13 @@ export class FlatDataDecimal extends FlatDataNumber implements Hashable {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
export class FlatDataDate extends FlatDataDataType implements Hashable {
|
|
76
|
-
dateFormat?: string | undefined;
|
|
76
|
+
dateFormat?: string[] | undefined;
|
|
77
77
|
timeZone?: string | undefined;
|
|
78
78
|
|
|
79
79
|
get hashCode(): string {
|
|
80
80
|
return hashArray([
|
|
81
81
|
CORE_HASH_STRUCTURE.FLAT_DATA_DATE,
|
|
82
|
-
this.dateFormat
|
|
82
|
+
this.dateFormat ? hashArray(this.dateFormat) : '',
|
|
83
83
|
this.timeZone ?? '',
|
|
84
84
|
]);
|
|
85
85
|
}
|
|
@@ -89,7 +89,7 @@ export class FlatDataDateTime extends FlatDataDate implements Hashable {
|
|
|
89
89
|
override get hashCode(): string {
|
|
90
90
|
return hashArray([
|
|
91
91
|
CORE_HASH_STRUCTURE.FLAT_DATA_DATE_TIME,
|
|
92
|
-
this.dateFormat
|
|
92
|
+
this.dateFormat ? hashArray(this.dateFormat) : '',
|
|
93
93
|
this.timeZone ?? '',
|
|
94
94
|
]);
|
|
95
95
|
}
|
|
@@ -99,7 +99,7 @@ export class FlatDataStrictDate extends FlatDataDate implements Hashable {
|
|
|
99
99
|
override get hashCode(): string {
|
|
100
100
|
return hashArray([
|
|
101
101
|
CORE_HASH_STRUCTURE.FLAT_DATA_STRICT_DATE,
|
|
102
|
-
this.dateFormat
|
|
102
|
+
this.dateFormat ? hashArray(this.dateFormat) : '',
|
|
103
103
|
this.timeZone ?? '',
|
|
104
104
|
]);
|
|
105
105
|
}
|
package/src/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataProperty.ts
CHANGED
|
@@ -21,9 +21,9 @@ export type FlatDataPropertyValue = boolean | string | number;
|
|
|
21
21
|
|
|
22
22
|
export class FlatDataProperty implements Hashable {
|
|
23
23
|
name: string;
|
|
24
|
-
value: FlatDataPropertyValue;
|
|
24
|
+
value: FlatDataPropertyValue[] = [];
|
|
25
25
|
|
|
26
|
-
constructor(name: string, value: FlatDataPropertyValue) {
|
|
26
|
+
constructor(name: string, value: FlatDataPropertyValue[]) {
|
|
27
27
|
this.name = name;
|
|
28
28
|
this.value = value;
|
|
29
29
|
}
|
|
@@ -32,7 +32,7 @@ export class FlatDataProperty implements Hashable {
|
|
|
32
32
|
return hashArray([
|
|
33
33
|
CORE_HASH_STRUCTURE.FLAT_DATA_PROPERTY,
|
|
34
34
|
this.name,
|
|
35
|
-
this.value
|
|
35
|
+
hashArray(this.value),
|
|
36
36
|
]);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
|
|
18
|
-
import {
|
|
18
|
+
import { hashValue } from '@finos/legend-shared';
|
|
19
19
|
import {
|
|
20
20
|
PackageableElementExplicitReference,
|
|
21
21
|
type PackageableElementReference,
|
|
@@ -44,7 +44,7 @@ export abstract class FlatDataSectionReference extends ReferenceWithOwner {
|
|
|
44
44
|
this.ownerReference.valueForSerialization ?? '',
|
|
45
45
|
this.value.name,
|
|
46
46
|
]
|
|
47
|
-
.map(
|
|
47
|
+
.map(hashValue)
|
|
48
48
|
.join(',');
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -170,3 +170,22 @@ export class UsernamePasswordAuthenticationStrategy
|
|
|
170
170
|
]);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
+
|
|
174
|
+
export class MiddleTierUsernamePasswordAuthenticationStrategy
|
|
175
|
+
extends AuthenticationStrategy
|
|
176
|
+
implements Hashable
|
|
177
|
+
{
|
|
178
|
+
vaultReference: string;
|
|
179
|
+
|
|
180
|
+
constructor(vaultReference: string) {
|
|
181
|
+
super();
|
|
182
|
+
this.vaultReference = vaultReference;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
get hashCode(): string {
|
|
186
|
+
return hashArray([
|
|
187
|
+
CORE_HASH_STRUCTURE.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,
|
|
188
|
+
this.vaultReference,
|
|
189
|
+
]);
|
|
190
|
+
}
|
|
191
|
+
}
|
package/src/graph/metamodel/pure/packageableElements/store/relational/model/TableReference.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
|
|
18
|
-
import {
|
|
18
|
+
import { hashValue } from '@finos/legend-shared';
|
|
19
19
|
import {
|
|
20
20
|
PackageableElementExplicitReference,
|
|
21
21
|
type PackageableElementReference,
|
|
@@ -53,7 +53,7 @@ export abstract class TableReference extends NamedRelationalReference {
|
|
|
53
53
|
this.value.schema.name,
|
|
54
54
|
this.value.name,
|
|
55
55
|
]
|
|
56
|
-
.map(
|
|
56
|
+
.map(hashValue)
|
|
57
57
|
.join(',');
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -64,7 +64,7 @@ export abstract class TableReference extends NamedRelationalReference {
|
|
|
64
64
|
SELF_JOIN_SCHEMA_NAME,
|
|
65
65
|
SELF_JOIN_TABLE_NAME,
|
|
66
66
|
]
|
|
67
|
-
.map(
|
|
67
|
+
.map(hashValue)
|
|
68
68
|
.join(',');
|
|
69
69
|
}
|
|
70
70
|
}
|
package/src/graph/metamodel/pure/packageableElements/store/relational/model/ViewReference.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
|
|
18
|
-
import {
|
|
18
|
+
import { hashValue } from '@finos/legend-shared';
|
|
19
19
|
import {
|
|
20
20
|
PackageableElementExplicitReference,
|
|
21
21
|
type PackageableElementReference,
|
|
@@ -44,7 +44,7 @@ export abstract class ViewReference extends NamedRelationalReference {
|
|
|
44
44
|
this.value.schema.name,
|
|
45
45
|
this.value.name,
|
|
46
46
|
]
|
|
47
|
-
.map(
|
|
47
|
+
.map(hashValue)
|
|
48
48
|
.join(',');
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -55,7 +55,7 @@ export abstract class ViewReference extends NamedRelationalReference {
|
|
|
55
55
|
SELF_JOIN_SCHEMA_NAME,
|
|
56
56
|
SELF_JOIN_TABLE_NAME,
|
|
57
57
|
]
|
|
58
|
-
.map(
|
|
58
|
+
.map(hashValue)
|
|
59
59
|
.join(',');
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -279,6 +279,16 @@ export abstract class AbstractPureGraphManager {
|
|
|
279
279
|
rawValueSpecification: RawValueSpecification,
|
|
280
280
|
): Record<PropertyKey, unknown>;
|
|
281
281
|
|
|
282
|
+
// These methods are utilities that we could use to quickly construct compilable
|
|
283
|
+
// raw lambdas.
|
|
284
|
+
// NOTE: As of now, to simplify the code, these methods are implemented in quite a hacky way, as we create
|
|
285
|
+
// the lambdas from a templated JSON object. Formally, we could remove these method by building them
|
|
286
|
+
// in metamodel form and convert to raw form as these are relatively simple lambda to construct
|
|
287
|
+
abstract createGetAllRawLambda(_class: Class): RawLambda;
|
|
288
|
+
abstract createDefaultBasicRawLambda(options?: {
|
|
289
|
+
addDummyParameter?: boolean;
|
|
290
|
+
}): RawLambda;
|
|
291
|
+
|
|
282
292
|
// ------------------------------------------- Generation -------------------------------------------
|
|
283
293
|
|
|
284
294
|
abstract getAvailableGenerationConfigurationDescriptions(): Promise<
|
|
@@ -420,6 +430,10 @@ export abstract class AbstractPureGraphManager {
|
|
|
420
430
|
input: RawMappingModelCoverageAnalysisResult,
|
|
421
431
|
): MappingModelCoverageAnalysisResult;
|
|
422
432
|
|
|
433
|
+
// ------------------------------------------- Change detection -------------------------------------------
|
|
434
|
+
|
|
435
|
+
abstract buildHashesIndex(entities: Entity[]): Promise<Map<string, string>>;
|
|
436
|
+
|
|
423
437
|
// ------------------------------------------- Utilities -------------------------------------------
|
|
424
438
|
|
|
425
439
|
abstract elementToEntity(
|
|
@@ -448,24 +462,4 @@ export abstract class AbstractPureGraphManager {
|
|
|
448
462
|
);
|
|
449
463
|
return graph;
|
|
450
464
|
}
|
|
451
|
-
|
|
452
|
-
// ------------------------------------------- Change detection -------------------------------------------
|
|
453
|
-
|
|
454
|
-
abstract buildHashesIndex(entities: Entity[]): Promise<Map<string, string>>;
|
|
455
|
-
|
|
456
|
-
// --------------------------------------------- HACKY ---------------------------------------------
|
|
457
|
-
// As the name suggested, these methods are temporary hacks since we don't handle value-specification
|
|
458
|
-
// structurally in Studio
|
|
459
|
-
|
|
460
|
-
// Eventually, we could remove these method by building them in metamodel form and convert to raw form
|
|
461
|
-
// as these are relatively simple lambda to construct
|
|
462
|
-
abstract HACKY__createGetAllLambda(_class: Class): RawLambda;
|
|
463
|
-
abstract HACKY__createDefaultBlankLambda(): RawLambda;
|
|
464
|
-
|
|
465
|
-
// NOTE: after we refactor service, we probably can remove these methods
|
|
466
|
-
// See https://github.com/finos/legend-studio/issues/1077
|
|
467
|
-
abstract HACKY__createServiceTestAssertLambda(assertData: string): RawLambda;
|
|
468
|
-
abstract HACKY__extractServiceTestAssertionData(
|
|
469
|
-
query: RawLambda,
|
|
470
|
-
): string | undefined;
|
|
471
465
|
}
|
|
@@ -14,12 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
type Log,
|
|
19
|
-
uniq,
|
|
20
|
-
ActionState,
|
|
21
|
-
assertErrorThrown,
|
|
22
|
-
} from '@finos/legend-shared';
|
|
17
|
+
import { type Log, ActionState, assertErrorThrown } from '@finos/legend-shared';
|
|
23
18
|
import { action, makeObservable, observable } from 'mobx';
|
|
24
19
|
import { DependencyManager } from '../graph/DependencyManager.js';
|
|
25
20
|
import {
|
|
@@ -33,22 +28,14 @@ import type {
|
|
|
33
28
|
GraphBuilderOptions,
|
|
34
29
|
} from '../graphManager/AbstractPureGraphManager.js';
|
|
35
30
|
import type { GraphManagerPluginManager } from './GraphManagerPluginManager.js';
|
|
36
|
-
import { getElementRootPackage } from '../graph/helpers/DomainHelper.js';
|
|
37
|
-
import { getLeafSetImplementations } from '../graph/helpers/DSLMapping_Helper.js';
|
|
38
|
-
import { ROOT_PACKAGE_NAME } from '../graph/MetaModelConst.js';
|
|
39
|
-
import { AssociationImplementation } from '../graph/metamodel/pure/packageableElements/mapping/AssociationImplementation.js';
|
|
40
31
|
import type { EnumerationMapping } from '../graph/metamodel/pure/packageableElements/mapping/EnumerationMapping.js';
|
|
41
32
|
import { InstanceSetImplementation } from '../graph/metamodel/pure/packageableElements/mapping/InstanceSetImplementation.js';
|
|
42
|
-
import { OperationSetImplementation } from '../graph/metamodel/pure/packageableElements/mapping/OperationSetImplementation.js';
|
|
43
|
-
import type { PropertyMapping } from '../graph/metamodel/pure/packageableElements/mapping/PropertyMapping.js';
|
|
44
33
|
import type { SetImplementation } from '../graph/metamodel/pure/packageableElements/mapping/SetImplementation.js';
|
|
45
34
|
import type { PackageableElement } from '../graph/metamodel/pure/packageableElements/PackageableElement.js';
|
|
46
35
|
import { EmbeddedFlatDataPropertyMapping } from '../graph/metamodel/pure/packageableElements/store/flatData/mapping/EmbeddedFlatDataPropertyMapping.js';
|
|
47
36
|
import { EmbeddedRelationalInstanceSetImplementation } from '../graph/metamodel/pure/packageableElements/store/relational/mapping/EmbeddedRelationalInstanceSetImplementation.js';
|
|
48
|
-
import { InlineEmbeddedRelationalInstanceSetImplementation } from '../graph/metamodel/pure/packageableElements/store/relational/mapping/InlineEmbeddedRelationalInstanceSetImplementation.js';
|
|
49
|
-
import { OtherwiseEmbeddedRelationalInstanceSetImplementation } from '../graph/metamodel/pure/packageableElements/store/relational/mapping/OtherwiseEmbeddedRelationalInstanceSetImplementation.js';
|
|
50
37
|
import { buildPureGraphManager } from '../graphManager/protocol/pure/PureGraphManagerBuilder.js';
|
|
51
|
-
import {
|
|
38
|
+
import type { AssociationImplementation } from '../graph/metamodel/pure/packageableElements/mapping/AssociationImplementation.js';
|
|
52
39
|
|
|
53
40
|
export class BasicGraphManagerState {
|
|
54
41
|
pluginManager: GraphManagerPluginManager;
|
|
@@ -63,49 +50,17 @@ export class BasicGraphManagerState {
|
|
|
63
50
|
}
|
|
64
51
|
|
|
65
52
|
// -------------------------------------------------- UTILITIES -----------------------------------------------------
|
|
53
|
+
|
|
66
54
|
/**
|
|
67
|
-
*
|
|
68
|
-
* As such, methods in this utility cannot be placed in place they should belong to.
|
|
55
|
+
* Check if a mapping element is an instance set implementation
|
|
69
56
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
57
|
+
* NOTE: This would account for embedded property mappings as well
|
|
58
|
+
* these are technically instance of `InstanceSetImplementation`
|
|
59
|
+
* but since unlike Pure, Typescript cannot do multiple inheritance
|
|
60
|
+
* we only can make embedded property mapping extends `PropertyMapping`
|
|
73
61
|
*
|
|
74
|
-
*
|
|
75
|
-
* methods here so that we can load plugins.
|
|
62
|
+
* Potentially, we might need to apply an extension mechanism on this
|
|
76
63
|
*/
|
|
77
|
-
|
|
78
|
-
isDependencyElement(
|
|
79
|
-
element: PackageableElement,
|
|
80
|
-
): element is PackageableElement {
|
|
81
|
-
return (
|
|
82
|
-
getElementRootPackage(element).name ===
|
|
83
|
-
ROOT_PACKAGE_NAME.PROJECT_DEPENDENCY_ROOT
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
isGeneratedElement(
|
|
88
|
-
element: PackageableElement,
|
|
89
|
-
): element is PackageableElement {
|
|
90
|
-
return (
|
|
91
|
-
getElementRootPackage(element).name === ROOT_PACKAGE_NAME.MODEL_GENERATION
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
isSystemElement(element: PackageableElement): element is PackageableElement {
|
|
96
|
-
return (
|
|
97
|
-
element instanceof PrimitiveType ||
|
|
98
|
-
getElementRootPackage(element).name === ROOT_PACKAGE_NAME.SYSTEM ||
|
|
99
|
-
getElementRootPackage(element).name === ROOT_PACKAGE_NAME.CORE
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
isMainGraphElement(
|
|
104
|
-
element: PackageableElement,
|
|
105
|
-
): element is PackageableElement {
|
|
106
|
-
return getElementRootPackage(element).name === ROOT_PACKAGE_NAME.MAIN;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
64
|
isInstanceSetImplementation(
|
|
110
65
|
setImplementation:
|
|
111
66
|
| EnumerationMapping
|
|
@@ -119,67 +74,13 @@ export class BasicGraphManagerState {
|
|
|
119
74
|
);
|
|
120
75
|
}
|
|
121
76
|
|
|
122
|
-
getInstanceSetImplementationPropertyMappings(
|
|
123
|
-
instanceSetImpl: InstanceSetImplementation,
|
|
124
|
-
): PropertyMapping[] {
|
|
125
|
-
if (
|
|
126
|
-
instanceSetImpl instanceof
|
|
127
|
-
InlineEmbeddedRelationalInstanceSetImplementation
|
|
128
|
-
) {
|
|
129
|
-
return this.getMappingElementPropertyMappings(
|
|
130
|
-
instanceSetImpl.inlineSetImplementation,
|
|
131
|
-
);
|
|
132
|
-
} else if (
|
|
133
|
-
instanceSetImpl instanceof
|
|
134
|
-
OtherwiseEmbeddedRelationalInstanceSetImplementation
|
|
135
|
-
) {
|
|
136
|
-
// NOTE: for now we will grab all property mappings from the main otherwise embedded mapping and the otherwise property mapping.
|
|
137
|
-
// In the future we may want to incorporate some smartness as to when the otherwise set implementation isinvoked.
|
|
138
|
-
const otherwisePropertyMappings = instanceSetImpl.otherwisePropertyMapping
|
|
139
|
-
.targetSetImplementation?.value
|
|
140
|
-
? this.getMappingElementPropertyMappings(
|
|
141
|
-
instanceSetImpl.otherwisePropertyMapping.targetSetImplementation
|
|
142
|
-
.value,
|
|
143
|
-
)
|
|
144
|
-
: [];
|
|
145
|
-
return [
|
|
146
|
-
...instanceSetImpl.propertyMappings,
|
|
147
|
-
...otherwisePropertyMappings,
|
|
148
|
-
];
|
|
149
|
-
}
|
|
150
|
-
return instanceSetImpl.propertyMappings;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
getMappingElementPropertyMappings(
|
|
154
|
-
mappingElement:
|
|
155
|
-
| EnumerationMapping
|
|
156
|
-
| SetImplementation
|
|
157
|
-
| AssociationImplementation,
|
|
158
|
-
): PropertyMapping[] {
|
|
159
|
-
let mappedProperties: PropertyMapping[] = [];
|
|
160
|
-
if (this.isInstanceSetImplementation(mappingElement)) {
|
|
161
|
-
mappedProperties =
|
|
162
|
-
this.getInstanceSetImplementationPropertyMappings(mappingElement);
|
|
163
|
-
} else if (mappingElement instanceof AssociationImplementation) {
|
|
164
|
-
mappedProperties = mappingElement.propertyMappings;
|
|
165
|
-
} else if (mappingElement instanceof OperationSetImplementation) {
|
|
166
|
-
mappedProperties = getLeafSetImplementations(mappingElement)
|
|
167
|
-
.filter((me): me is InstanceSetImplementation =>
|
|
168
|
-
this.isInstanceSetImplementation(me),
|
|
169
|
-
)
|
|
170
|
-
.map((si) => si.propertyMappings)
|
|
171
|
-
.flat();
|
|
172
|
-
}
|
|
173
|
-
return uniq(mappedProperties);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
77
|
/**
|
|
177
78
|
* Filter the list of system elements that will be shown in selection options
|
|
178
79
|
* to users. This is helpful to avoid overwhelming and confusing users in form
|
|
179
80
|
* mode since many system elements are needed to build the graph, but should
|
|
180
81
|
* not present at all as selection options in form mode.
|
|
181
82
|
*/
|
|
182
|
-
|
|
83
|
+
collectExposedSystemElements<T extends PackageableElement>(
|
|
183
84
|
systemElements: T[],
|
|
184
85
|
): T[] {
|
|
185
86
|
const allowedSystemElements = this.pluginManager
|
|
@@ -189,10 +90,6 @@ export class BasicGraphManagerState {
|
|
|
189
90
|
allowedSystemElements.includes(element.path),
|
|
190
91
|
);
|
|
191
92
|
}
|
|
192
|
-
|
|
193
|
-
isElementReadOnly(element: PackageableElement): boolean {
|
|
194
|
-
return getElementRootPackage(element).name !== ROOT_PACKAGE_NAME.MAIN;
|
|
195
|
-
}
|
|
196
93
|
}
|
|
197
94
|
|
|
198
95
|
export class GraphManagerState extends BasicGraphManagerState {
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
SnowflakePublicAuthenticationStrategy,
|
|
26
26
|
UsernamePasswordAuthenticationStrategy,
|
|
27
27
|
GCPWorkloadIdentityFederationAuthenticationStrategy,
|
|
28
|
+
MiddleTierUsernamePasswordAuthenticationStrategy,
|
|
28
29
|
} from '../../../graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.js';
|
|
29
30
|
import {
|
|
30
31
|
type DatasourceSpecification,
|
|
@@ -938,6 +939,17 @@ export const observe_GCPWorkloadIdentityFederationAuthenticationStrategy =
|
|
|
938
939
|
}),
|
|
939
940
|
);
|
|
940
941
|
|
|
942
|
+
export const observe_MiddleTierUsernamePasswordAuthenticationStrategy =
|
|
943
|
+
skipObserved(
|
|
944
|
+
(
|
|
945
|
+
metamodel: MiddleTierUsernamePasswordAuthenticationStrategy,
|
|
946
|
+
): MiddleTierUsernamePasswordAuthenticationStrategy =>
|
|
947
|
+
makeObservable(metamodel, {
|
|
948
|
+
hashCode: computed,
|
|
949
|
+
vaultReference: observable,
|
|
950
|
+
}),
|
|
951
|
+
);
|
|
952
|
+
|
|
941
953
|
export const observe_AuthenticationStrategy = (
|
|
942
954
|
metamodel: AuthenticationStrategy,
|
|
943
955
|
context: ObserverContext,
|
|
@@ -966,6 +978,10 @@ export const observe_AuthenticationStrategy = (
|
|
|
966
978
|
return observe_GCPWorkloadIdentityFederationAuthenticationStrategy(
|
|
967
979
|
metamodel,
|
|
968
980
|
);
|
|
981
|
+
} else if (
|
|
982
|
+
metamodel instanceof MiddleTierUsernamePasswordAuthenticationStrategy
|
|
983
|
+
) {
|
|
984
|
+
return observe_MiddleTierUsernamePasswordAuthenticationStrategy(metamodel);
|
|
969
985
|
}
|
|
970
986
|
const extraObservers = context.plugins.flatMap(
|
|
971
987
|
(plugin) =>
|