@finos/legend-graph 9.0.1 → 10.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/DSLData_Exports.d.ts +2 -1
- package/lib/DSLData_Exports.d.ts.map +1 -1
- package/lib/DSLData_Exports.js +2 -1
- package/lib/DSLData_Exports.js.map +1 -1
- package/lib/DSLMapping_Exports.d.ts +4 -0
- package/lib/DSLMapping_Exports.d.ts.map +1 -1
- package/lib/DSLMapping_Exports.js +4 -0
- package/lib/DSLMapping_Exports.js.map +1 -1
- package/lib/DSLService_Exports.d.ts +7 -0
- package/lib/DSLService_Exports.d.ts.map +1 -1
- package/lib/DSLService_Exports.js +7 -0
- package/lib/DSLService_Exports.js.map +1 -1
- package/lib/MetaModelConst.d.ts +5 -4
- package/lib/MetaModelConst.d.ts.map +1 -1
- package/lib/MetaModelConst.js +6 -4
- package/lib/MetaModelConst.js.map +1 -1
- package/lib/graph/PureGraphPlugin.d.ts +1 -1
- package/lib/graph/PureGraphPlugin.js +1 -1
- package/lib/graphManager/AbstractPureGraphManager.d.ts +20 -11
- package/lib/graphManager/AbstractPureGraphManager.d.ts.map +1 -1
- package/lib/graphManager/AbstractPureGraphManager.js +13 -0
- package/lib/graphManager/AbstractPureGraphManager.js.map +1 -1
- package/lib/graphManager/PureGraphManagerPlugin.d.ts +7 -4
- package/lib/graphManager/PureGraphManagerPlugin.d.ts.map +1 -1
- package/lib/graphManager/PureGraphManagerPlugin.js +1 -1
- package/lib/graphManager/PureGraphManagerPlugin.js.map +1 -1
- package/lib/graphManager/action/analytics/MappingAnalytics.d.ts +41 -0
- package/lib/graphManager/action/analytics/MappingAnalytics.d.ts.map +1 -0
- package/lib/graphManager/action/analytics/MappingAnalytics.js +58 -0
- package/lib/graphManager/action/analytics/MappingAnalytics.js.map +1 -0
- package/lib/graphManager/action/changeDetection/DSLData_ObserverHelper.d.ts +2 -3
- package/lib/graphManager/action/changeDetection/DSLData_ObserverHelper.d.ts.map +1 -1
- package/lib/graphManager/action/changeDetection/DSLData_ObserverHelper.js +8 -21
- package/lib/graphManager/action/changeDetection/DSLData_ObserverHelper.js.map +1 -1
- package/lib/graphManager/action/changeDetection/DSLService_ObserverHelper.d.ts.map +1 -1
- package/lib/graphManager/action/changeDetection/DSLService_ObserverHelper.js +2 -1
- package/lib/graphManager/action/changeDetection/DSLService_ObserverHelper.js.map +1 -1
- package/lib/graphManager/action/changeDetection/Testable_ObserverHelper.d.ts.map +1 -1
- package/lib/graphManager/action/changeDetection/Testable_ObserverHelper.js +3 -13
- package/lib/graphManager/action/changeDetection/Testable_ObserverHelper.js.map +1 -1
- package/lib/graphManager/action/creation/DSLExternalFormat_ModelCreatorHelper.d.ts +18 -0
- package/lib/graphManager/action/creation/DSLExternalFormat_ModelCreatorHelper.d.ts.map +1 -0
- package/lib/graphManager/action/creation/DSLExternalFormat_ModelCreatorHelper.js +17 -0
- package/lib/graphManager/action/creation/DSLExternalFormat_ModelCreatorHelper.js.map +1 -0
- package/lib/graphManager/action/validation/DSLService_ValidationHelper.d.ts +3 -2
- package/lib/graphManager/action/validation/DSLService_ValidationHelper.d.ts.map +1 -1
- package/lib/graphManager/action/validation/DSLService_ValidationHelper.js +1 -1
- package/lib/graphManager/action/validation/DSLService_ValidationHelper.js.map +1 -1
- package/lib/helpers/Testable_Helper.d.ts +3 -0
- package/lib/helpers/Testable_Helper.d.ts.map +1 -1
- package/lib/helpers/Testable_Helper.js +3 -0
- package/lib/helpers/Testable_Helper.js.map +1 -1
- package/lib/helpers/ValueSpecificationHelper.d.ts +10 -3
- package/lib/helpers/ValueSpecificationHelper.d.ts.map +1 -1
- package/lib/helpers/ValueSpecificationHelper.js +59 -4
- package/lib/helpers/ValueSpecificationHelper.js.map +1 -1
- package/lib/index.d.ts +7 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/models/metamodels/pure/data/EmbeddedData.d.ts +2 -2
- package/lib/models/metamodels/pure/data/EmbeddedData.d.ts.map +1 -1
- package/lib/models/metamodels/pure/data/{RelationalData.d.ts → RelationalCSVData.d.ts} +6 -15
- package/lib/models/metamodels/pure/data/RelationalCSVData.d.ts.map +1 -0
- package/lib/models/metamodels/pure/data/{RelationalData.js → RelationalCSVData.js} +10 -30
- package/lib/models/metamodels/pure/data/RelationalCSVData.js.map +1 -0
- package/lib/models/metamodels/pure/packageableElements/service/ServiceTest.d.ts +1 -0
- package/lib/models/metamodels/pure/packageableElements/service/ServiceTest.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/service/ServiceTest.js +2 -0
- package/lib/models/metamodels/pure/packageableElements/service/ServiceTest.js.map +1 -1
- package/lib/models/metamodels/pure/test/Test.d.ts +3 -1
- package/lib/models/metamodels/pure/test/Test.d.ts.map +1 -1
- package/lib/models/metamodels/pure/test/Test.js +2 -1
- package/lib/models/metamodels/pure/test/Test.js.map +1 -1
- package/lib/models/metamodels/pure/test/assertion/EqualToTDS.d.ts +2 -8
- package/lib/models/metamodels/pure/test/assertion/EqualToTDS.d.ts.map +1 -1
- package/lib/models/metamodels/pure/test/assertion/EqualToTDS.js +0 -11
- package/lib/models/metamodels/pure/test/assertion/EqualToTDS.js.map +1 -1
- package/lib/models/protocols/pure/DSLExternalFormat_PureProtocolProcessorPlugin.d.ts +3 -2
- package/lib/models/protocols/pure/DSLExternalFormat_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/models/protocols/pure/DSLExternalFormat_PureProtocolProcessorPlugin.js +6 -1
- package/lib/models/protocols/pure/DSLExternalFormat_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/models/protocols/pure/PureProtocolProcessorPlugin.d.ts +12 -3
- package/lib/models/protocols/pure/PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/models/protocols/pure/PureProtocolProcessorPlugin.js +1 -1
- package/lib/models/protocols/pure/PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/models/protocols/pure/v1/V1_PureGraphManager.d.ts +18 -9
- package/lib/models/protocols/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/V1_PureGraphManager.js +112 -139
- package/lib/models/protocols/pure/v1/V1_PureGraphManager.js.map +1 -1
- package/lib/models/protocols/pure/v1/engine/V1_Engine.d.ts +4 -1
- package/lib/models/protocols/pure/v1/engine/V1_Engine.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/engine/V1_Engine.js +11 -3
- package/lib/models/protocols/pure/v1/engine/V1_Engine.js.map +1 -1
- package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.d.ts +2 -0
- package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.js +3 -0
- package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.js.map +1 -1
- package/lib/models/protocols/pure/v1/engine/analytics/V1_MappingAnalytics.d.ts +40 -0
- package/lib/models/protocols/pure/v1/engine/analytics/V1_MappingAnalytics.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/engine/analytics/V1_MappingAnalytics.js +94 -0
- package/lib/models/protocols/pure/v1/engine/analytics/V1_MappingAnalytics.js.map +1 -0
- package/lib/models/protocols/pure/v1/engine/{V1_ExecutionHelper.d.ts → execution/V1_ExecutionHelper.d.ts} +2 -2
- package/lib/models/protocols/pure/v1/engine/execution/V1_ExecutionHelper.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/engine/{V1_ExecutionHelper.js → execution/V1_ExecutionHelper.js} +2 -2
- package/lib/models/protocols/pure/v1/engine/execution/V1_ExecutionHelper.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/data/V1_EmbeddedData.d.ts +2 -2
- package/lib/models/protocols/pure/v1/model/data/V1_EmbeddedData.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/data/{V1_RelationalData.d.ts → V1_RelationalCSVData.d.ts} +6 -15
- package/lib/models/protocols/pure/v1/model/data/V1_RelationalCSVData.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/data/{V1_RelationalData.js → V1_RelationalCSVData.js} +9 -29
- package/lib/models/protocols/pure/v1/model/data/V1_RelationalCSVData.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/service/V1_ServiceTest.d.ts +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/service/V1_ServiceTest.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/service/V1_ServiceTest.js +2 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/service/V1_ServiceTest.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/test/assertion/V1_EqualToTDS.d.ts +2 -8
- package/lib/models/protocols/pure/v1/model/test/assertion/V1_EqualToTDS.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/test/assertion/V1_EqualToTDS.js +0 -11
- package/lib/models/protocols/pure/v1/model/test/assertion/V1_EqualToTDS.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.js +12 -21
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.js +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_TestTransformer.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_TestTransformer.js +2 -4
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_TestTransformer.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.js +5 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.d.ts +2 -2
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.js +6 -15
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.d.ts +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.js +2 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.d.ts +5 -5
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.js +11 -9
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.d.ts +2 -3
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.js +10 -15
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.d.ts +1 -4
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.js +7 -14
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.js +2 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.js +3 -7
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.js.map +1 -1
- package/lib/package.json +6 -2
- package/package.json +9 -5
- package/src/DSLData_Exports.ts +3 -0
- package/src/DSLMapping_Exports.ts +4 -0
- package/src/DSLService_Exports.ts +10 -0
- package/src/MetaModelConst.ts +8 -4
- package/src/graph/PureGraphPlugin.ts +1 -1
- package/src/graphManager/AbstractPureGraphManager.ts +48 -20
- package/src/graphManager/PureGraphManagerPlugin.ts +18 -8
- package/src/graphManager/action/analytics/MappingAnalytics.ts +71 -0
- package/src/graphManager/action/changeDetection/DSLData_ObserverHelper.ts +12 -33
- package/src/graphManager/action/changeDetection/DSLService_ObserverHelper.ts +2 -1
- package/src/graphManager/action/changeDetection/Testable_ObserverHelper.ts +3 -23
- package/src/graphManager/action/creation/DSLExternalFormat_ModelCreatorHelper.ts +21 -0
- package/src/graphManager/action/validation/DSLService_ValidationHelper.ts +4 -7
- package/src/helpers/Testable_Helper.ts +4 -0
- package/src/helpers/ValueSpecificationHelper.ts +106 -10
- package/src/index.ts +13 -1
- package/src/models/metamodels/pure/data/EmbeddedData.ts +2 -2
- package/src/models/metamodels/pure/data/{RelationalData.ts → RelationalCSVData.ts} +10 -33
- package/src/models/metamodels/pure/packageableElements/service/ServiceTest.ts +2 -0
- package/src/models/metamodels/pure/test/Test.ts +3 -1
- package/src/models/metamodels/pure/test/assertion/EqualToTDS.ts +4 -19
- package/src/models/protocols/pure/DSLExternalFormat_PureProtocolProcessorPlugin.ts +15 -2
- package/src/models/protocols/pure/PureProtocolProcessorPlugin.ts +17 -3
- package/src/models/protocols/pure/v1/V1_PureGraphManager.ts +305 -292
- package/src/models/protocols/pure/v1/engine/V1_Engine.ts +24 -3
- package/src/models/protocols/pure/v1/engine/V1_EngineServerClient.ts +18 -0
- package/src/models/protocols/pure/v1/engine/analytics/V1_MappingAnalytics.ts +168 -0
- package/src/models/protocols/pure/v1/engine/{V1_ExecutionHelper.ts → execution/V1_ExecutionHelper.ts} +2 -2
- package/src/models/protocols/pure/v1/model/data/V1_EmbeddedData.ts +2 -2
- package/src/models/protocols/pure/v1/model/data/{V1_RelationalData.ts → V1_RelationalCSVData.ts} +9 -33
- package/src/models/protocols/pure/v1/model/packageableElements/service/V1_ServiceTest.ts +2 -0
- package/src/models/protocols/pure/v1/model/test/assertion/V1_EqualToTDS.ts +3 -19
- package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.ts +20 -31
- package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.ts +1 -0
- package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_TestTransformer.ts +2 -7
- package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.ts +7 -1
- package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.ts +10 -22
- package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.ts +7 -4
- package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.ts +27 -24
- package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.ts +16 -26
- package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.ts +10 -27
- package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.ts +2 -0
- package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.ts +3 -15
- package/tsconfig.json +6 -3
- package/lib/models/metamodels/pure/data/RelationalData.d.ts.map +0 -1
- package/lib/models/metamodels/pure/data/RelationalData.js.map +0 -1
- package/lib/models/protocols/pure/v1/engine/V1_ExecutionHelper.d.ts.map +0 -1
- package/lib/models/protocols/pure/v1/engine/V1_ExecutionHelper.js.map +0 -1
- package/lib/models/protocols/pure/v1/model/data/V1_RelationalData.d.ts.map +0 -1
- package/lib/models/protocols/pure/v1/model/data/V1_RelationalData.js.map +0 -1
|
@@ -37,7 +37,11 @@ import {
|
|
|
37
37
|
StopWatch,
|
|
38
38
|
filterByType,
|
|
39
39
|
isNonNullable,
|
|
40
|
-
|
|
40
|
+
addUniqueEntry,
|
|
41
|
+
uuid,
|
|
42
|
+
deleteEntry,
|
|
43
|
+
assertType,
|
|
44
|
+
uniq,
|
|
41
45
|
} from '@finos/legend-shared';
|
|
42
46
|
import type { TEMPORARY__AbstractEngineConfig } from '../../../../graphManager/action/TEMPORARY__AbstractEngineConfig.js';
|
|
43
47
|
import {
|
|
@@ -47,10 +51,7 @@ import {
|
|
|
47
51
|
type ExecutionOptions,
|
|
48
52
|
} from '../../../../graphManager/AbstractPureGraphManager.js';
|
|
49
53
|
import type { Mapping } from '../../../metamodels/pure/packageableElements/mapping/Mapping.js';
|
|
50
|
-
import {
|
|
51
|
-
type Runtime,
|
|
52
|
-
EngineRuntime,
|
|
53
|
-
} from '../../../metamodels/pure/packageableElements/runtime/Runtime.js';
|
|
54
|
+
import type { Runtime } from '../../../metamodels/pure/packageableElements/runtime/Runtime.js';
|
|
54
55
|
import type {
|
|
55
56
|
ImportConfigurationDescription,
|
|
56
57
|
ImportMode,
|
|
@@ -78,7 +79,6 @@ import type { GenerationOutput } from '../../../../graphManager/action/generatio
|
|
|
78
79
|
import type { ValueSpecification } from '../../../metamodels/pure/valueSpecification/ValueSpecification.js';
|
|
79
80
|
import { ServiceExecutionMode } from '../../../../graphManager/action/service/ServiceExecutionMode.js';
|
|
80
81
|
import {
|
|
81
|
-
KeyedExecutionParameter,
|
|
82
82
|
PureMultiExecution,
|
|
83
83
|
PureSingleExecution,
|
|
84
84
|
} from '../../../metamodels/pure/packageableElements/service/ServiceExecution.js';
|
|
@@ -169,7 +169,6 @@ import type { V1_Multiplicity } from './model/packageableElements/domain/V1_Mult
|
|
|
169
169
|
import type { V1_RawVariable } from './model/rawValueSpecification/V1_RawVariable.js';
|
|
170
170
|
import { V1_setupDatabaseSerialization } from './transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.js';
|
|
171
171
|
import {
|
|
172
|
-
V1_PACKAGEABLE_RUNTIME_ELEMENT_PROTOCOL_TYPE,
|
|
173
172
|
V1_setupEngineRuntimeSerialization,
|
|
174
173
|
V1_setupLegacyRuntimeSerialization,
|
|
175
174
|
} from './transformation/pureProtocol/serializationHelpers/V1_RuntimeSerializationHelper.js';
|
|
@@ -206,7 +205,7 @@ import {
|
|
|
206
205
|
V1_buildLightQuery,
|
|
207
206
|
V1_transformQuerySearchSpecification,
|
|
208
207
|
} from './engine/V1_EngineHelper.js';
|
|
209
|
-
import { V1_buildExecutionResult } from './engine/V1_ExecutionHelper.js';
|
|
208
|
+
import { V1_buildExecutionResult } from './engine/execution/V1_ExecutionHelper.js';
|
|
210
209
|
import {
|
|
211
210
|
type Entity,
|
|
212
211
|
ENTITY_PATH_DELIMITER,
|
|
@@ -214,25 +213,16 @@ import {
|
|
|
214
213
|
import {
|
|
215
214
|
DependencyGraphBuilderError,
|
|
216
215
|
GraphBuilderError,
|
|
216
|
+
PureClientVersion,
|
|
217
217
|
SystemGraphBuilderError,
|
|
218
218
|
} from '../../../../graphManager/GraphManagerUtils.js';
|
|
219
|
-
import {
|
|
220
|
-
PackageableElementExplicitReference,
|
|
221
|
-
PackageableElementReference,
|
|
222
|
-
} from '../../../metamodels/pure/packageableElements/PackageableElementReference.js';
|
|
219
|
+
import { PackageableElementReference } from '../../../metamodels/pure/packageableElements/PackageableElementReference.js';
|
|
223
220
|
import type { GraphPluginManager } from '../../../../GraphPluginManager.js';
|
|
224
221
|
import type { QuerySearchSpecification } from '../../../../graphManager/action/query/QuerySearchSpecification.js';
|
|
225
222
|
import type { ExternalFormatDescription } from '../../../../graphManager/action/externalFormat/ExternalFormatDescription.js';
|
|
226
223
|
import type { ConfigurationProperty } from '../../../metamodels/pure/packageableElements/fileGeneration/ConfigurationProperty.js';
|
|
227
224
|
import { V1_ExternalFormatModelGenerationInput } from './engine/externalFormat/V1_ExternalFormatModelGeneration.js';
|
|
228
225
|
import { GraphBuilderReport } from '../../../../graphManager/GraphBuilderReport.js';
|
|
229
|
-
import {
|
|
230
|
-
V1_PureMultiExecution,
|
|
231
|
-
V1_PureSingleExecution,
|
|
232
|
-
} from './model/packageableElements/service/V1_ServiceExecution.js';
|
|
233
|
-
import { V1_MAPPING_ELEMENT_PROTOCOL_TYPE } from './transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js';
|
|
234
|
-
import { V1_SERVICE_ELEMENT_PROTOCOL_TYPE } from './transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.js';
|
|
235
|
-
import { MappingInclude } from '../../../metamodels/pure/packageableElements/mapping/MappingInclude.js';
|
|
236
226
|
import type { ModelGenerationConfiguration } from '../../../ModelGenerationConfiguration.js';
|
|
237
227
|
import type { MappingGeneration_PureProtocolProcessorPlugin_Extension } from '../MappingGeneration_PureProtocolProcessorPlugin_Extension.js';
|
|
238
228
|
import type { Package } from '../../../metamodels/pure/packageableElements/domain/Package.js';
|
|
@@ -244,17 +234,33 @@ import {
|
|
|
244
234
|
import { V1_AtomicTestId } from './model/test/V1_AtomicTestId.js';
|
|
245
235
|
import type { RunTestsTestableInput } from '../../../metamodels/pure/test/result/RunTestsTestableInput.js';
|
|
246
236
|
import { V1_buildTestsResult } from './engine/test/V1_RunTestsResult.js';
|
|
247
|
-
import
|
|
237
|
+
import {
|
|
238
|
+
type TestResult,
|
|
239
|
+
TestFailed,
|
|
240
|
+
} from '../../../metamodels/pure/test/result/TestResult.js';
|
|
248
241
|
import type { Service } from '../../../../DSLService_Exports.js';
|
|
249
242
|
import type { Testable } from '../../../metamodels/pure/test/Testable.js';
|
|
250
|
-
import { stub_RawLambda } from '../../../../graphManager/action/creation/RawValueSpecificationCreatorHelper.js';
|
|
251
243
|
import {
|
|
252
244
|
getNullableIDFromTestable,
|
|
253
245
|
getNullableTestable,
|
|
254
246
|
} from '../../../../helpers/Testable_Helper.js';
|
|
255
|
-
import {
|
|
247
|
+
import type { TestAssertion } from '../../../metamodels/pure/test/assertion/TestAssertion.js';
|
|
248
|
+
import type { AssertFail } from '../../../metamodels/pure/test/assertion/status/AssertFail.js';
|
|
249
|
+
import {
|
|
250
|
+
type AtomicTest,
|
|
251
|
+
TestSuite,
|
|
252
|
+
} from '../../../metamodels/pure/test/Test.js';
|
|
256
253
|
import { pruneSourceInformation } from '../../../../MetaModelUtils.js';
|
|
257
|
-
import {
|
|
254
|
+
import {
|
|
255
|
+
V1_buildModelCoverageAnalysisResult,
|
|
256
|
+
V1_MappingModelCoverageAnalysisInput,
|
|
257
|
+
V1_MappingModelCoverageAnalysisResult,
|
|
258
|
+
} from './engine/analytics/V1_MappingAnalytics.js';
|
|
259
|
+
import type {
|
|
260
|
+
MappingModelCoverageAnalysisResult,
|
|
261
|
+
RawMappingModelCoverageAnalysisResult,
|
|
262
|
+
} from '../../../../graphManager/action/analytics/MappingAnalytics.js';
|
|
263
|
+
import { deserialize } from 'serializr';
|
|
258
264
|
|
|
259
265
|
const V1_FUNCTION_SUFFIX_MULTIPLICITY_INFINITE = 'MANY';
|
|
260
266
|
|
|
@@ -445,17 +451,23 @@ export interface V1_EngineSetupConfig {
|
|
|
445
451
|
}
|
|
446
452
|
|
|
447
453
|
export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
454
|
+
// Organizing these constants will help with configuring
|
|
455
|
+
// target protocol version in the future
|
|
456
|
+
// See https://github.com/finos/legend-studio/issues/475
|
|
457
|
+
private static readonly TARGET_PROTOCOL_VERSION = PureClientVersion.VX_X_X;
|
|
458
|
+
|
|
448
459
|
engine: V1_Engine;
|
|
449
|
-
|
|
460
|
+
graphBuilderExtensions: V1_GraphBuilderExtensions;
|
|
450
461
|
|
|
451
462
|
constructor(pluginManager: GraphPluginManager, log: Log) {
|
|
452
463
|
super(pluginManager, log);
|
|
453
464
|
this.engine = new V1_Engine({}, log);
|
|
454
465
|
|
|
455
466
|
// setup plugins
|
|
456
|
-
this.
|
|
467
|
+
this.graphBuilderExtensions = new V1_GraphBuilderExtensions(
|
|
457
468
|
this.pluginManager.getPureProtocolProcessorPlugins(),
|
|
458
469
|
);
|
|
470
|
+
|
|
459
471
|
// setup serialization plugins
|
|
460
472
|
V1_setupPureModelContextDataSerialization(
|
|
461
473
|
this.pluginManager.getPureProtocolProcessorPlugins(),
|
|
@@ -491,6 +503,10 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
491
503
|
await this.engine.setup(config);
|
|
492
504
|
}
|
|
493
505
|
|
|
506
|
+
getSupportedProtocolVersion(): string {
|
|
507
|
+
return PureClientVersion.V1_0_0;
|
|
508
|
+
}
|
|
509
|
+
|
|
494
510
|
// --------------------------------------------- Graph Builder ---------------------------------------------
|
|
495
511
|
|
|
496
512
|
async buildSystem(
|
|
@@ -528,7 +544,11 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
528
544
|
const buildInputs = [
|
|
529
545
|
{
|
|
530
546
|
model: systemModel,
|
|
531
|
-
data: indexPureModelContextData(
|
|
547
|
+
data: indexPureModelContextData(
|
|
548
|
+
report,
|
|
549
|
+
systemData,
|
|
550
|
+
this.graphBuilderExtensions,
|
|
551
|
+
),
|
|
532
552
|
},
|
|
533
553
|
];
|
|
534
554
|
|
|
@@ -610,7 +630,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
610
630
|
data: indexPureModelContextData(
|
|
611
631
|
report,
|
|
612
632
|
dependencyData,
|
|
613
|
-
this.
|
|
633
|
+
this.graphBuilderExtensions,
|
|
614
634
|
),
|
|
615
635
|
}));
|
|
616
636
|
|
|
@@ -669,7 +689,11 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
669
689
|
const buildInputs: V1_GraphBuilderInput[] = [
|
|
670
690
|
{
|
|
671
691
|
model: graph,
|
|
672
|
-
data: indexPureModelContextData(
|
|
692
|
+
data: indexPureModelContextData(
|
|
693
|
+
report,
|
|
694
|
+
data,
|
|
695
|
+
this.graphBuilderExtensions,
|
|
696
|
+
),
|
|
673
697
|
},
|
|
674
698
|
];
|
|
675
699
|
|
|
@@ -752,7 +776,11 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
752
776
|
generatedDataMap.entries(),
|
|
753
777
|
).map(([generationParentPath, generatedData]) => ({
|
|
754
778
|
model: generatedModel,
|
|
755
|
-
data: indexPureModelContextData(
|
|
779
|
+
data: indexPureModelContextData(
|
|
780
|
+
report,
|
|
781
|
+
generatedData,
|
|
782
|
+
this.graphBuilderExtensions,
|
|
783
|
+
),
|
|
756
784
|
}));
|
|
757
785
|
|
|
758
786
|
// build
|
|
@@ -860,7 +888,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
860
888
|
return new V1_GraphBuilderContextBuilder(
|
|
861
889
|
graph,
|
|
862
890
|
currentSubGraph,
|
|
863
|
-
this.
|
|
891
|
+
this.graphBuilderExtensions,
|
|
864
892
|
this.log,
|
|
865
893
|
options,
|
|
866
894
|
)
|
|
@@ -908,23 +936,24 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
908
936
|
),
|
|
909
937
|
);
|
|
910
938
|
await Promise.all(
|
|
911
|
-
this.
|
|
912
|
-
(
|
|
913
|
-
(
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
939
|
+
this.graphBuilderExtensions.sortedExtraElementBuilders.flatMap(
|
|
940
|
+
async (builder) =>
|
|
941
|
+
(input.data.otherElementsByBuilder.get(builder) ?? []).map(
|
|
942
|
+
(element) =>
|
|
943
|
+
this.visitWithGraphBuilderErrorHandling(
|
|
944
|
+
element,
|
|
945
|
+
new V1_ProtocolToMetaModelGraphFirstPassBuilder(
|
|
946
|
+
this.getBuilderContext(
|
|
947
|
+
graph,
|
|
948
|
+
input.model,
|
|
949
|
+
element,
|
|
950
|
+
options,
|
|
951
|
+
),
|
|
952
|
+
packageCache,
|
|
953
|
+
elementPathCache,
|
|
922
954
|
),
|
|
923
|
-
packageCache,
|
|
924
|
-
elementPathCache,
|
|
925
955
|
),
|
|
926
|
-
|
|
927
|
-
),
|
|
956
|
+
),
|
|
928
957
|
),
|
|
929
958
|
);
|
|
930
959
|
}),
|
|
@@ -1293,80 +1322,82 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1293
1322
|
options?: GraphBuilderOptions,
|
|
1294
1323
|
): Promise<void> {
|
|
1295
1324
|
await Promise.all(
|
|
1296
|
-
this.
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
(input
|
|
1300
|
-
(
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1325
|
+
this.graphBuilderExtensions.sortedExtraElementBuilders.map(
|
|
1326
|
+
async (builder) => {
|
|
1327
|
+
await Promise.all(
|
|
1328
|
+
inputs.flatMap((input) =>
|
|
1329
|
+
(input.data.otherElementsByBuilder.get(builder) ?? []).map(
|
|
1330
|
+
(element) =>
|
|
1331
|
+
this.visitWithGraphBuilderErrorHandling(
|
|
1332
|
+
element,
|
|
1333
|
+
new V1_ProtocolToMetaModelGraphSecondPassBuilder(
|
|
1334
|
+
this.getBuilderContext(
|
|
1335
|
+
graph,
|
|
1336
|
+
input.model,
|
|
1337
|
+
element,
|
|
1338
|
+
options,
|
|
1339
|
+
),
|
|
1309
1340
|
),
|
|
1310
1341
|
),
|
|
1311
|
-
|
|
1342
|
+
),
|
|
1312
1343
|
),
|
|
1313
|
-
)
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1344
|
+
);
|
|
1345
|
+
await Promise.all(
|
|
1346
|
+
inputs.flatMap((input) =>
|
|
1347
|
+
(input.data.otherElementsByBuilder.get(builder) ?? []).map(
|
|
1348
|
+
(element) =>
|
|
1349
|
+
this.visitWithGraphBuilderErrorHandling(
|
|
1350
|
+
element,
|
|
1351
|
+
new V1_ProtocolToMetaModelGraphThirdPassBuilder(
|
|
1352
|
+
this.getBuilderContext(
|
|
1353
|
+
graph,
|
|
1354
|
+
input.model,
|
|
1355
|
+
element,
|
|
1356
|
+
options,
|
|
1357
|
+
),
|
|
1327
1358
|
),
|
|
1328
1359
|
),
|
|
1329
|
-
|
|
1360
|
+
),
|
|
1330
1361
|
),
|
|
1331
|
-
)
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1362
|
+
);
|
|
1363
|
+
await Promise.all(
|
|
1364
|
+
inputs.flatMap((input) =>
|
|
1365
|
+
(input.data.otherElementsByBuilder.get(builder) ?? []).map(
|
|
1366
|
+
(element) =>
|
|
1367
|
+
this.visitWithGraphBuilderErrorHandling(
|
|
1368
|
+
element,
|
|
1369
|
+
new V1_ProtocolToMetaModelGraphFourthPassBuilder(
|
|
1370
|
+
this.getBuilderContext(
|
|
1371
|
+
graph,
|
|
1372
|
+
input.model,
|
|
1373
|
+
element,
|
|
1374
|
+
options,
|
|
1375
|
+
),
|
|
1345
1376
|
),
|
|
1346
1377
|
),
|
|
1347
|
-
|
|
1378
|
+
),
|
|
1348
1379
|
),
|
|
1349
|
-
)
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1380
|
+
);
|
|
1381
|
+
await Promise.all(
|
|
1382
|
+
inputs.flatMap((input) =>
|
|
1383
|
+
(input.data.otherElementsByBuilder.get(builder) ?? []).map(
|
|
1384
|
+
(element) =>
|
|
1385
|
+
this.visitWithGraphBuilderErrorHandling(
|
|
1386
|
+
element,
|
|
1387
|
+
new V1_ProtocolToMetaModelGraphFifthPassBuilder(
|
|
1388
|
+
this.getBuilderContext(
|
|
1389
|
+
graph,
|
|
1390
|
+
input.model,
|
|
1391
|
+
element,
|
|
1392
|
+
options,
|
|
1393
|
+
),
|
|
1363
1394
|
),
|
|
1364
1395
|
),
|
|
1365
|
-
|
|
1396
|
+
),
|
|
1366
1397
|
),
|
|
1367
|
-
)
|
|
1368
|
-
|
|
1369
|
-
|
|
1398
|
+
);
|
|
1399
|
+
},
|
|
1400
|
+
),
|
|
1370
1401
|
);
|
|
1371
1402
|
}
|
|
1372
1403
|
|
|
@@ -1666,6 +1697,56 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1666
1697
|
return result;
|
|
1667
1698
|
}
|
|
1668
1699
|
|
|
1700
|
+
async generateExpectedResult(
|
|
1701
|
+
testable: Testable,
|
|
1702
|
+
test: AtomicTest,
|
|
1703
|
+
baseAssertion: TestAssertion,
|
|
1704
|
+
graph: PureModel,
|
|
1705
|
+
): Promise<AssertFail> {
|
|
1706
|
+
const id = uuid();
|
|
1707
|
+
try {
|
|
1708
|
+
baseAssertion.id = id;
|
|
1709
|
+
addUniqueEntry(test.assertions, baseAssertion);
|
|
1710
|
+
const runTestsInput = new V1_RunTestsInput();
|
|
1711
|
+
runTestsInput.model = this.getFullGraphModelData(graph);
|
|
1712
|
+
const runTestableInput = new V1_RunTestsTestableInput();
|
|
1713
|
+
const unitAtomicTest = new V1_AtomicTestId();
|
|
1714
|
+
runTestableInput.testable = guaranteeNonNullable(
|
|
1715
|
+
getNullableIDFromTestable(
|
|
1716
|
+
testable,
|
|
1717
|
+
graph,
|
|
1718
|
+
this.pluginManager.getPureGraphManagerPlugins(),
|
|
1719
|
+
),
|
|
1720
|
+
);
|
|
1721
|
+
runTestsInput.testables = [runTestableInput];
|
|
1722
|
+
const parent = test.__parent;
|
|
1723
|
+
unitAtomicTest.testSuiteId =
|
|
1724
|
+
parent instanceof TestSuite ? parent.id : undefined;
|
|
1725
|
+
unitAtomicTest.atomicTestId = test.id;
|
|
1726
|
+
const runTestsResult = await this.engine.runTests(runTestsInput);
|
|
1727
|
+
const results = V1_buildTestsResult(
|
|
1728
|
+
runTestsResult,
|
|
1729
|
+
(_id: string): Testable | undefined =>
|
|
1730
|
+
getNullableTestable(
|
|
1731
|
+
_id,
|
|
1732
|
+
graph,
|
|
1733
|
+
this.pluginManager.getPureGraphManagerPlugins(),
|
|
1734
|
+
),
|
|
1735
|
+
);
|
|
1736
|
+
const result = results[0];
|
|
1737
|
+
assertType(result, TestFailed);
|
|
1738
|
+
const status = result.assertStatuses.find(
|
|
1739
|
+
(e) => e.assertion === baseAssertion,
|
|
1740
|
+
);
|
|
1741
|
+
return guaranteeNonNullable(status);
|
|
1742
|
+
} catch (error) {
|
|
1743
|
+
assertErrorThrown(error);
|
|
1744
|
+
throw error;
|
|
1745
|
+
} finally {
|
|
1746
|
+
deleteEntry(test.assertions, baseAssertion);
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1669
1750
|
// ------------------------------------------- ValueSpecification -------------------------------------------
|
|
1670
1751
|
|
|
1671
1752
|
buildValueSpecification(
|
|
@@ -1677,7 +1758,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1677
1758
|
new V1_GraphBuilderContextBuilder(
|
|
1678
1759
|
graph,
|
|
1679
1760
|
graph,
|
|
1680
|
-
this.
|
|
1761
|
+
this.graphBuilderExtensions,
|
|
1681
1762
|
this.log,
|
|
1682
1763
|
).build(),
|
|
1683
1764
|
);
|
|
@@ -1704,7 +1785,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1704
1785
|
new V1_GraphBuilderContextBuilder(
|
|
1705
1786
|
graph,
|
|
1706
1787
|
graph,
|
|
1707
|
-
this.
|
|
1788
|
+
this.graphBuilderExtensions,
|
|
1708
1789
|
this.log,
|
|
1709
1790
|
).build(),
|
|
1710
1791
|
),
|
|
@@ -1840,29 +1921,32 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1840
1921
|
* object to identify relevant classes yet. so the more economical way to to base on the classification above and the knowledge about hierarchy between
|
|
1841
1922
|
* models (e.g. service can use mapping, runtime, connection, store, etc.) we can roughly prune the graph model data by group. Following is an example
|
|
1842
1923
|
* for mapping used for execution, but this can generalized if we introduce hierarchy/ranking for model type
|
|
1843
|
-
*
|
|
1844
1924
|
*/
|
|
1845
1925
|
const graphData = this.getFullGraphModelData(graph);
|
|
1846
1926
|
const prunedGraphData = new V1_PureModelContextData();
|
|
1847
1927
|
const extraExecutionElements = this.pluginManager
|
|
1848
1928
|
.getPureProtocolProcessorPlugins()
|
|
1849
|
-
.flatMap(
|
|
1850
|
-
|
|
1851
|
-
prunedGraphData.elements = graphData.elements
|
|
1852
|
-
.filter(
|
|
1853
|
-
(element) =>
|
|
1854
|
-
element instanceof V1_Class ||
|
|
1855
|
-
element instanceof V1_Enumeration ||
|
|
1856
|
-
element instanceof V1_Profile ||
|
|
1857
|
-
element instanceof V1_Association ||
|
|
1858
|
-
element instanceof V1_ConcreteFunctionDefinition ||
|
|
1859
|
-
element instanceof V1_Measure ||
|
|
1860
|
-
element instanceof V1_Store ||
|
|
1861
|
-
element instanceof V1_PackageableConnection ||
|
|
1862
|
-
element instanceof V1_PackageableRuntime ||
|
|
1863
|
-
element instanceof V1_Mapping,
|
|
1929
|
+
.flatMap(
|
|
1930
|
+
(element) => element.V1_getExtraExecutionInputCollectors?.() ?? [],
|
|
1864
1931
|
)
|
|
1865
|
-
.
|
|
1932
|
+
.flatMap((getter) => getter(graph, mapping, runtime, graphData));
|
|
1933
|
+
prunedGraphData.elements = uniq(
|
|
1934
|
+
graphData.elements
|
|
1935
|
+
.filter(
|
|
1936
|
+
(element) =>
|
|
1937
|
+
element instanceof V1_Class ||
|
|
1938
|
+
element instanceof V1_Enumeration ||
|
|
1939
|
+
element instanceof V1_Profile ||
|
|
1940
|
+
element instanceof V1_Association ||
|
|
1941
|
+
element instanceof V1_ConcreteFunctionDefinition ||
|
|
1942
|
+
element instanceof V1_Measure ||
|
|
1943
|
+
element instanceof V1_Store ||
|
|
1944
|
+
element instanceof V1_PackageableConnection ||
|
|
1945
|
+
element instanceof V1_PackageableRuntime ||
|
|
1946
|
+
element instanceof V1_Mapping,
|
|
1947
|
+
)
|
|
1948
|
+
.concat(extraExecutionElements),
|
|
1949
|
+
);
|
|
1866
1950
|
// NOTE: for execution, we usually will just assume that we send the connections embedded in the runtime value, since we don't want the user to have to create
|
|
1867
1951
|
// packageable runtime and connection just to play with execution.
|
|
1868
1952
|
executeInput.clientVersion = clientVersion;
|
|
@@ -1889,7 +1973,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1889
1973
|
mapping: Mapping,
|
|
1890
1974
|
lambda: RawLambda,
|
|
1891
1975
|
runtime: Runtime,
|
|
1892
|
-
clientVersion: string,
|
|
1893
1976
|
options?: ExecutionOptions,
|
|
1894
1977
|
): Promise<ExecutionResult> {
|
|
1895
1978
|
return V1_buildExecutionResult(
|
|
@@ -1899,19 +1982,18 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1899
1982
|
mapping,
|
|
1900
1983
|
lambda,
|
|
1901
1984
|
runtime,
|
|
1902
|
-
|
|
1985
|
+
V1_PureGraphManager.TARGET_PROTOCOL_VERSION,
|
|
1903
1986
|
),
|
|
1904
1987
|
options,
|
|
1905
1988
|
),
|
|
1906
1989
|
);
|
|
1907
1990
|
}
|
|
1908
1991
|
|
|
1909
|
-
|
|
1992
|
+
generateExecuteTestData(
|
|
1910
1993
|
graph: PureModel,
|
|
1911
1994
|
mapping: Mapping,
|
|
1912
1995
|
lambda: RawLambda,
|
|
1913
1996
|
runtime: Runtime,
|
|
1914
|
-
clientVersion: string,
|
|
1915
1997
|
parameters: (string | number | boolean)[],
|
|
1916
1998
|
options?: {
|
|
1917
1999
|
anonymizeGeneratedData?: boolean;
|
|
@@ -1924,14 +2006,14 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1924
2006
|
mapping,
|
|
1925
2007
|
lambda,
|
|
1926
2008
|
runtime,
|
|
1927
|
-
|
|
2009
|
+
V1_PureGraphManager.TARGET_PROTOCOL_VERSION,
|
|
1928
2010
|
testDataGenerationExecuteInput,
|
|
1929
2011
|
);
|
|
1930
2012
|
testDataGenerationExecuteInput.parameters = parameters;
|
|
1931
2013
|
testDataGenerationExecuteInput.hashStrings = Boolean(
|
|
1932
2014
|
options?.anonymizeGeneratedData,
|
|
1933
2015
|
);
|
|
1934
|
-
return this.engine.
|
|
2016
|
+
return this.engine.generateExecuteTestData(testDataGenerationExecuteInput);
|
|
1935
2017
|
}
|
|
1936
2018
|
|
|
1937
2019
|
generateExecutionPlan(
|
|
@@ -1939,10 +2021,15 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1939
2021
|
mapping: Mapping,
|
|
1940
2022
|
lambda: RawLambda,
|
|
1941
2023
|
runtime: Runtime,
|
|
1942
|
-
clientVersion: string,
|
|
1943
2024
|
): Promise<RawExecutionPlan> {
|
|
1944
2025
|
return this.engine.generateExecutionPlan(
|
|
1945
|
-
this.createExecutionInput(
|
|
2026
|
+
this.createExecutionInput(
|
|
2027
|
+
graph,
|
|
2028
|
+
mapping,
|
|
2029
|
+
lambda,
|
|
2030
|
+
runtime,
|
|
2031
|
+
V1_PureGraphManager.TARGET_PROTOCOL_VERSION,
|
|
2032
|
+
),
|
|
1946
2033
|
);
|
|
1947
2034
|
}
|
|
1948
2035
|
|
|
@@ -1951,10 +2038,15 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1951
2038
|
mapping: Mapping,
|
|
1952
2039
|
lambda: RawLambda,
|
|
1953
2040
|
runtime: Runtime,
|
|
1954
|
-
clientVersion: string,
|
|
1955
2041
|
): Promise<{ plan: RawExecutionPlan; debug: string }> {
|
|
1956
2042
|
const result = await this.engine.debugExecutionPlanGeneration(
|
|
1957
|
-
this.createExecutionInput(
|
|
2043
|
+
this.createExecutionInput(
|
|
2044
|
+
graph,
|
|
2045
|
+
mapping,
|
|
2046
|
+
lambda,
|
|
2047
|
+
runtime,
|
|
2048
|
+
V1_PureGraphManager.TARGET_PROTOCOL_VERSION,
|
|
2049
|
+
),
|
|
1958
2050
|
);
|
|
1959
2051
|
return {
|
|
1960
2052
|
plan: result.plan,
|
|
@@ -1971,7 +2063,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1971
2063
|
new V1_GraphBuilderContextBuilder(
|
|
1972
2064
|
graph,
|
|
1973
2065
|
graph,
|
|
1974
|
-
this.
|
|
2066
|
+
this.graphBuilderExtensions,
|
|
1975
2067
|
this.log,
|
|
1976
2068
|
).build(),
|
|
1977
2069
|
);
|
|
@@ -2142,17 +2234,14 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2142
2234
|
V1_transformQuerySearchSpecification(searchSpecification),
|
|
2143
2235
|
)
|
|
2144
2236
|
).map((protocol) =>
|
|
2145
|
-
V1_buildLightQuery(
|
|
2146
|
-
protocol,
|
|
2147
|
-
this.engine.getEngineServerClient().currentUserId,
|
|
2148
|
-
),
|
|
2237
|
+
V1_buildLightQuery(protocol, this.engine.getCurrentUserId()),
|
|
2149
2238
|
);
|
|
2150
2239
|
}
|
|
2151
2240
|
|
|
2152
2241
|
async getLightQuery(queryId: string): Promise<LightQuery> {
|
|
2153
2242
|
return V1_buildLightQuery(
|
|
2154
2243
|
await this.engine.getQuery(queryId),
|
|
2155
|
-
this.engine.
|
|
2244
|
+
this.engine.getCurrentUserId(),
|
|
2156
2245
|
);
|
|
2157
2246
|
}
|
|
2158
2247
|
|
|
@@ -2196,7 +2285,11 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2196
2285
|
const dependencyGraphBuilderInput: V1_GraphBuilderInput[] = Array.from(
|
|
2197
2286
|
dependencyDataMap.entries(),
|
|
2198
2287
|
).map(([dependencyKey, dependencyData]) => ({
|
|
2199
|
-
data: indexPureModelContextData(
|
|
2288
|
+
data: indexPureModelContextData(
|
|
2289
|
+
report,
|
|
2290
|
+
dependencyData,
|
|
2291
|
+
this.graphBuilderExtensions,
|
|
2292
|
+
),
|
|
2200
2293
|
model: graph.dependencyManager.getModel(dependencyKey),
|
|
2201
2294
|
}));
|
|
2202
2295
|
// build main pmcd
|
|
@@ -2209,7 +2302,11 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2209
2302
|
const mainGraphBuilderInput: V1_GraphBuilderInput[] = [
|
|
2210
2303
|
{
|
|
2211
2304
|
model: graph,
|
|
2212
|
-
data: indexPureModelContextData(
|
|
2305
|
+
data: indexPureModelContextData(
|
|
2306
|
+
report,
|
|
2307
|
+
data,
|
|
2308
|
+
this.graphBuilderExtensions,
|
|
2309
|
+
),
|
|
2213
2310
|
},
|
|
2214
2311
|
];
|
|
2215
2312
|
const graphBuilderInput = [
|
|
@@ -2220,157 +2317,13 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2220
2317
|
return graphBuilderInput;
|
|
2221
2318
|
}
|
|
2222
2319
|
|
|
2223
|
-
//
|
|
2224
|
-
async buildGraphForCreateQuerySetup(
|
|
2225
|
-
graph: PureModel,
|
|
2226
|
-
entities: Entity[],
|
|
2227
|
-
dependencyEntities: Map<string, Entity[]>,
|
|
2228
|
-
): Promise<void> {
|
|
2229
|
-
try {
|
|
2230
|
-
const graphBuilderInput = await this.indexEntitiesWithDependencyIntoGraph(
|
|
2231
|
-
graph,
|
|
2232
|
-
entities,
|
|
2233
|
-
dependencyEntities,
|
|
2234
|
-
(entity: Entity): boolean =>
|
|
2235
|
-
((entity.content as PlainObject<V1_PackageableElement>)
|
|
2236
|
-
._type as string) === V1_MAPPING_ELEMENT_PROTOCOL_TYPE ||
|
|
2237
|
-
((entity.content as PlainObject<V1_PackageableElement>)
|
|
2238
|
-
._type as string) === V1_PACKAGEABLE_RUNTIME_ELEMENT_PROTOCOL_TYPE,
|
|
2239
|
-
);
|
|
2240
|
-
// handle mapping includes
|
|
2241
|
-
const mappings = [
|
|
2242
|
-
...graph.ownMappings,
|
|
2243
|
-
...graph.dependencyManager.mappings,
|
|
2244
|
-
];
|
|
2245
|
-
const v1Mappings = graphBuilderInput
|
|
2246
|
-
.map((e) => e.data.elements.filter(filterByType(V1_Mapping)))
|
|
2247
|
-
.flat();
|
|
2248
|
-
const context = new V1_GraphBuilderContextBuilder(
|
|
2249
|
-
graph,
|
|
2250
|
-
graph,
|
|
2251
|
-
this.extensions,
|
|
2252
|
-
this.log,
|
|
2253
|
-
).build();
|
|
2254
|
-
// build include index for compatible runtime analysis
|
|
2255
|
-
v1Mappings.forEach((element) => {
|
|
2256
|
-
const mapping = mappings.find((e) => e.path === element.path);
|
|
2257
|
-
if (mapping) {
|
|
2258
|
-
mapping.includes = element.includedMappings.map(
|
|
2259
|
-
(i) =>
|
|
2260
|
-
new MappingInclude(
|
|
2261
|
-
mapping,
|
|
2262
|
-
context.resolveMapping(
|
|
2263
|
-
guaranteeNonEmptyString(
|
|
2264
|
-
V1_getIncludedMappingPath(i),
|
|
2265
|
-
`Mapping include path is missing or empty`,
|
|
2266
|
-
),
|
|
2267
|
-
),
|
|
2268
|
-
),
|
|
2269
|
-
);
|
|
2270
|
-
}
|
|
2271
|
-
});
|
|
2272
|
-
// handle runtimes
|
|
2273
|
-
const runtimes = [
|
|
2274
|
-
...graph.ownRuntimes,
|
|
2275
|
-
...graph.dependencyManager.runtimes,
|
|
2276
|
-
];
|
|
2277
|
-
const v1Runtimes = graphBuilderInput
|
|
2278
|
-
.map((e) => e.data.elements.filter(filterByType(V1_PackageableRuntime)))
|
|
2279
|
-
.flat();
|
|
2280
|
-
v1Runtimes.forEach((element) => {
|
|
2281
|
-
const runtime = runtimes.find((e) => e.path === element.path);
|
|
2282
|
-
if (runtime) {
|
|
2283
|
-
const runtimeValue = new EngineRuntime();
|
|
2284
|
-
runtime.runtimeValue = runtimeValue;
|
|
2285
|
-
runtimeValue.mappings = element.runtimeValue.mappings.map((mapping) =>
|
|
2286
|
-
context.resolveMapping(mapping.path),
|
|
2287
|
-
);
|
|
2288
|
-
}
|
|
2289
|
-
});
|
|
2290
|
-
} catch (error) {
|
|
2291
|
-
assertErrorThrown(error);
|
|
2292
|
-
/**
|
|
2293
|
-
* Wrap all error with `GraphBuilderError`, as we throw a lot of assertion error in the graph builder
|
|
2294
|
-
* But we might want to rethink this decision in the future and throw appropriate type of error
|
|
2295
|
-
*/
|
|
2296
|
-
throw error instanceof GraphBuilderError
|
|
2297
|
-
? error
|
|
2298
|
-
: new GraphBuilderError(error);
|
|
2299
|
-
}
|
|
2300
|
-
}
|
|
2301
|
-
|
|
2302
|
-
// We could optimize this further by omitting parts of the entities we don't need
|
|
2303
|
-
// i.e service entity would only keep execution
|
|
2304
|
-
async buildGraphForServiceQuerySetup(
|
|
2305
|
-
graph: PureModel,
|
|
2306
|
-
entities: Entity[],
|
|
2307
|
-
dependencyEntities: Map<string, Entity[]>,
|
|
2308
|
-
): Promise<void> {
|
|
2309
|
-
try {
|
|
2310
|
-
const graphBuilderInput = await this.indexEntitiesWithDependencyIntoGraph(
|
|
2311
|
-
graph,
|
|
2312
|
-
entities,
|
|
2313
|
-
dependencyEntities,
|
|
2314
|
-
(entity: Entity): boolean =>
|
|
2315
|
-
((entity.content as PlainObject<V1_PackageableElement>)
|
|
2316
|
-
._type as string) === V1_SERVICE_ELEMENT_PROTOCOL_TYPE,
|
|
2317
|
-
);
|
|
2318
|
-
// handle servicess
|
|
2319
|
-
const services = [
|
|
2320
|
-
...graph.ownServices,
|
|
2321
|
-
...graph.dependencyManager.services,
|
|
2322
|
-
];
|
|
2323
|
-
const v1Services = graphBuilderInput
|
|
2324
|
-
.map((e) => e.data.elements.filter(filterByType(V1_Service)))
|
|
2325
|
-
.flat();
|
|
2326
|
-
// build service multi execution keys
|
|
2327
|
-
v1Services.forEach((element) => {
|
|
2328
|
-
const service = services.find((e) => e.path === element.path);
|
|
2329
|
-
if (service) {
|
|
2330
|
-
const serviceExecution = element.execution;
|
|
2331
|
-
if (serviceExecution instanceof V1_PureMultiExecution) {
|
|
2332
|
-
const execution = new PureMultiExecution(
|
|
2333
|
-
serviceExecution.executionKey,
|
|
2334
|
-
stub_RawLambda(),
|
|
2335
|
-
service,
|
|
2336
|
-
);
|
|
2337
|
-
execution.executionParameters =
|
|
2338
|
-
serviceExecution.executionParameters.map(
|
|
2339
|
-
(keyedExecutionParameter) =>
|
|
2340
|
-
new KeyedExecutionParameter(
|
|
2341
|
-
keyedExecutionParameter.key,
|
|
2342
|
-
PackageableElementExplicitReference.create(stub_Mapping()),
|
|
2343
|
-
new EngineRuntime(),
|
|
2344
|
-
),
|
|
2345
|
-
);
|
|
2346
|
-
service.execution = execution;
|
|
2347
|
-
} else if (serviceExecution instanceof V1_PureSingleExecution) {
|
|
2348
|
-
service.execution = new PureSingleExecution(
|
|
2349
|
-
stub_RawLambda(),
|
|
2350
|
-
service,
|
|
2351
|
-
PackageableElementExplicitReference.create(stub_Mapping()),
|
|
2352
|
-
new EngineRuntime(),
|
|
2353
|
-
);
|
|
2354
|
-
}
|
|
2355
|
-
}
|
|
2356
|
-
});
|
|
2357
|
-
} catch (error) {
|
|
2358
|
-
assertErrorThrown(error);
|
|
2359
|
-
/**
|
|
2360
|
-
* Wrap all error with `GraphBuilderError`, as we throw a lot of assertion error in the graph builder
|
|
2361
|
-
* But we might want to rethink this decision in the future and throw appropriate type of error
|
|
2362
|
-
*/
|
|
2363
|
-
throw error instanceof GraphBuilderError
|
|
2364
|
-
? error
|
|
2365
|
-
: new GraphBuilderError(error);
|
|
2366
|
-
}
|
|
2367
|
-
}
|
|
2320
|
+
// --------------------------------------------- Query ------------------------------------------------------
|
|
2368
2321
|
|
|
2369
2322
|
async getQuery(queryId: string, graph: PureModel): Promise<Query> {
|
|
2370
2323
|
return V1_buildQuery(
|
|
2371
2324
|
await this.engine.getQuery(queryId),
|
|
2372
2325
|
graph,
|
|
2373
|
-
this.engine.
|
|
2326
|
+
this.engine.getCurrentUserId(),
|
|
2374
2327
|
);
|
|
2375
2328
|
}
|
|
2376
2329
|
|
|
@@ -2382,7 +2335,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2382
2335
|
return V1_buildQuery(
|
|
2383
2336
|
await this.engine.createQuery(V1_transformQuery(query)),
|
|
2384
2337
|
graph,
|
|
2385
|
-
this.engine.
|
|
2338
|
+
this.engine.getCurrentUserId(),
|
|
2386
2339
|
);
|
|
2387
2340
|
}
|
|
2388
2341
|
|
|
@@ -2390,7 +2343,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2390
2343
|
return V1_buildQuery(
|
|
2391
2344
|
await this.engine.updateQuery(V1_transformQuery(query)),
|
|
2392
2345
|
graph,
|
|
2393
|
-
this.engine.
|
|
2346
|
+
this.engine.getCurrentUserId(),
|
|
2394
2347
|
);
|
|
2395
2348
|
}
|
|
2396
2349
|
|
|
@@ -2416,6 +2369,66 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2416
2369
|
return hashMap;
|
|
2417
2370
|
}
|
|
2418
2371
|
|
|
2372
|
+
// ---------------------------------------- Analysis ----------------------------------------
|
|
2373
|
+
|
|
2374
|
+
private buildMappingModelCoverageAnalysisInputContextData = (
|
|
2375
|
+
graph: PureModel,
|
|
2376
|
+
): V1_PureModelContextData => {
|
|
2377
|
+
const graphData = this.getFullGraphModelData(graph);
|
|
2378
|
+
const prunedGraphData = new V1_PureModelContextData();
|
|
2379
|
+
const extraElements = this.pluginManager
|
|
2380
|
+
.getPureProtocolProcessorPlugins()
|
|
2381
|
+
.flatMap(
|
|
2382
|
+
(element) =>
|
|
2383
|
+
element.V1_getExtraMappingModelCoverageAnalysisInputCollectors?.() ??
|
|
2384
|
+
[],
|
|
2385
|
+
)
|
|
2386
|
+
.flatMap((getter) => getter(graph, graphData));
|
|
2387
|
+
prunedGraphData.elements = uniq(
|
|
2388
|
+
this.getFullGraphModelData(graph)
|
|
2389
|
+
.elements.filter(
|
|
2390
|
+
(element) =>
|
|
2391
|
+
element instanceof V1_Class ||
|
|
2392
|
+
element instanceof V1_Enumeration ||
|
|
2393
|
+
element instanceof V1_Profile ||
|
|
2394
|
+
element instanceof V1_Association ||
|
|
2395
|
+
element instanceof V1_ConcreteFunctionDefinition ||
|
|
2396
|
+
element instanceof V1_Measure ||
|
|
2397
|
+
element instanceof V1_Store ||
|
|
2398
|
+
element instanceof V1_Mapping,
|
|
2399
|
+
)
|
|
2400
|
+
.concat(extraElements),
|
|
2401
|
+
);
|
|
2402
|
+
return prunedGraphData;
|
|
2403
|
+
};
|
|
2404
|
+
|
|
2405
|
+
async analyzeMappingModelCoverage(
|
|
2406
|
+
graph: PureModel,
|
|
2407
|
+
mapping: Mapping,
|
|
2408
|
+
): Promise<MappingModelCoverageAnalysisResult> {
|
|
2409
|
+
const modelCoverageAnalysisInput =
|
|
2410
|
+
new V1_MappingModelCoverageAnalysisInput();
|
|
2411
|
+
modelCoverageAnalysisInput.clientVersion =
|
|
2412
|
+
V1_PureGraphManager.TARGET_PROTOCOL_VERSION;
|
|
2413
|
+
modelCoverageAnalysisInput.mapping = mapping.path;
|
|
2414
|
+
modelCoverageAnalysisInput.model =
|
|
2415
|
+
this.buildMappingModelCoverageAnalysisInputContextData(graph);
|
|
2416
|
+
return V1_buildModelCoverageAnalysisResult(
|
|
2417
|
+
await this.engine.analyzeMappingModelCoverage(modelCoverageAnalysisInput),
|
|
2418
|
+
);
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
buildMappingModelCoverageAnalysisResult(
|
|
2422
|
+
input: RawMappingModelCoverageAnalysisResult,
|
|
2423
|
+
): MappingModelCoverageAnalysisResult {
|
|
2424
|
+
return V1_buildModelCoverageAnalysisResult(
|
|
2425
|
+
deserialize(
|
|
2426
|
+
V1_MappingModelCoverageAnalysisResult,
|
|
2427
|
+
input as PlainObject<V1_MappingModelCoverageAnalysisResult>,
|
|
2428
|
+
),
|
|
2429
|
+
);
|
|
2430
|
+
}
|
|
2431
|
+
|
|
2419
2432
|
// --------------------------------------------- Utilities ---------------------------------------------
|
|
2420
2433
|
|
|
2421
2434
|
elementToEntity = (
|