@finos/legend-graph 23.0.3 → 23.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/graph/Core_HashUtils.d.ts +1 -0
- package/lib/graph/Core_HashUtils.d.ts.map +1 -1
- package/lib/graph/Core_HashUtils.js +1 -0
- package/lib/graph/Core_HashUtils.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/{MappingTestData.d.ts → MappingStoreTestData.d.ts} +2 -2
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingStoreTestData.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/{MappingTestData.js → MappingStoreTestData.js} +2 -2
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingStoreTestData.js.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.d.ts +2 -2
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js +2 -2
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/DatasourceSpecification.d.ts +9 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/DatasourceSpecification.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/DatasourceSpecification.js +25 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/DatasourceSpecification.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalDatabaseConnection.d.ts +2 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalDatabaseConnection.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalDatabaseConnection.js +1 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalDatabaseConnection.js.map +1 -1
- package/lib/graphManager/AbstractPureGraphManager.d.ts +7 -5
- package/lib/graphManager/AbstractPureGraphManager.d.ts.map +1 -1
- package/lib/graphManager/AbstractPureGraphManager.js +3 -3
- package/lib/graphManager/AbstractPureGraphManager.js.map +1 -1
- package/lib/graphManager/GraphManagerState.d.ts +11 -11
- package/lib/graphManager/GraphManagerState.d.ts.map +1 -1
- package/lib/graphManager/GraphManagerState.js +9 -11
- package/lib/graphManager/GraphManagerState.js.map +1 -1
- package/lib/graphManager/GraphManagerStateProvider.d.ts +2 -2
- package/lib/graphManager/GraphManagerStateProvider.d.ts.map +1 -1
- package/lib/graphManager/GraphManagerStateProvider.js +1 -1
- package/lib/graphManager/GraphManagerStateProvider.js.map +1 -1
- package/lib/graphManager/GraphManagerTestUtils.d.ts +2 -2
- package/lib/graphManager/GraphManagerTestUtils.d.ts.map +1 -1
- package/lib/graphManager/GraphManagerTestUtils.js +3 -3
- package/lib/graphManager/GraphManagerTestUtils.js.map +1 -1
- package/lib/graphManager/action/changeDetection/DSL_Mapping_ObserverHelper.d.ts +2 -2
- package/lib/graphManager/action/changeDetection/DSL_Mapping_ObserverHelper.d.ts.map +1 -1
- package/lib/graphManager/action/changeDetection/DSL_Mapping_ObserverHelper.js +3 -3
- package/lib/graphManager/action/changeDetection/DSL_Mapping_ObserverHelper.js.map +1 -1
- package/lib/graphManager/action/changeDetection/STO_Relational_ObserverHelper.d.ts +2 -1
- package/lib/graphManager/action/changeDetection/STO_Relational_ObserverHelper.d.ts.map +1 -1
- package/lib/graphManager/action/changeDetection/STO_Relational_ObserverHelper.js +12 -1
- package/lib/graphManager/action/changeDetection/STO_Relational_ObserverHelper.js.map +1 -1
- package/lib/graphManager/action/service/BulkServiceRegistrationResult.d.ts +29 -0
- package/lib/graphManager/action/service/BulkServiceRegistrationResult.d.ts.map +1 -0
- package/lib/graphManager/action/service/BulkServiceRegistrationResult.js +37 -0
- package/lib/graphManager/action/service/BulkServiceRegistrationResult.js.map +1 -0
- package/lib/graphManager/protocol/pure/PureGraphManagerBuilder.d.ts +2 -2
- package/lib/graphManager/protocol/pure/PureGraphManagerBuilder.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/PureGraphManagerBuilder.js +2 -2
- package/lib/graphManager/protocol/pure/PureGraphManagerBuilder.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts +6 -3
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js +119 -17
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.d.ts +5 -5
- package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.js +4 -4
- package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/{V1_MappingTestData.d.ts → V1_MappingStoreTestData.d.ts} +2 -2
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingStoreTestData.d.ts.map +1 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/{V1_MappingTestData.js → V1_MappingStoreTestData.js} +2 -2
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingStoreTestData.js.map +1 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.d.ts +2 -2
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.js +2 -2
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.d.ts +8 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.js +17 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalDatabaseConnection.d.ts +2 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalDatabaseConnection.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalDatabaseConnection.js +1 -0
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalDatabaseConnection.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 +14 -2
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js +4 -4
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingSecondPassBuilder.js +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingSecondPassBuilder.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +3 -3
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.js +2 -2
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.d.ts +7 -7
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js +5 -5
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.js +4 -4
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.js +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.js +8 -8
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.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 +9 -2
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_SectionBuilderHelper.js +3 -3
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_SectionBuilderHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.js +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationPathResolver.js +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationPathResolver.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 +15 -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_MappingSerializationHelper.d.ts +2 -2
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js +3 -3
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/package.json +3 -3
- package/package.json +6 -6
- package/src/graph/Core_HashUtils.ts +1 -0
- package/src/graph/metamodel/pure/packageableElements/mapping/{MappingTestData.ts → MappingStoreTestData.ts} +1 -1
- package/src/graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.ts +3 -3
- package/src/graph/metamodel/pure/packageableElements/store/relational/connection/DatasourceSpecification.ts +38 -0
- package/src/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalDatabaseConnection.ts +1 -0
- package/src/graphManager/AbstractPureGraphManager.ts +21 -7
- package/src/graphManager/GraphManagerState.ts +27 -19
- package/src/graphManager/GraphManagerStateProvider.tsx +3 -3
- package/src/graphManager/GraphManagerTestUtils.tsx +4 -4
- package/src/graphManager/action/changeDetection/DSL_Mapping_ObserverHelper.ts +9 -6
- package/src/graphManager/action/changeDetection/STO_Relational_ObserverHelper.ts +15 -0
- package/src/graphManager/action/service/BulkServiceRegistrationResult.ts +41 -0
- package/src/graphManager/protocol/pure/PureGraphManagerBuilder.ts +3 -3
- package/src/graphManager/protocol/pure/v1/V1_PureGraphManager.ts +184 -20
- package/src/graphManager/protocol/pure/v1/engine/V1_Engine.ts +11 -7
- package/src/graphManager/protocol/pure/v1/model/packageableElements/mapping/{V1_MappingTestData.ts → V1_MappingStoreTestData.ts} +1 -1
- package/src/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestSuite.ts +3 -3
- package/src/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.ts +22 -0
- package/src/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalDatabaseConnection.ts +1 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.ts +16 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts +8 -8
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingSecondPassBuilder.ts +1 -1
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +3 -3
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.ts +2 -2
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.ts +10 -9
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.ts +4 -4
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.ts +1 -1
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.ts +12 -12
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.ts +24 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_SectionBuilderHelper.ts +3 -3
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.ts +1 -1
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationPathResolver.ts +1 -1
- package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.ts +18 -0
- package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts +7 -5
- package/src/index.ts +5 -0
- package/tsconfig.json +3 -2
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestData.d.ts.map +0 -1
- package/lib/graph/metamodel/pure/packageableElements/mapping/MappingTestData.js.map +0 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestData.d.ts.map +0 -1
- package/lib/graphManager/protocol/pure/v1/model/packageableElements/mapping/V1_MappingTestData.js.map +0 -1
|
@@ -47,7 +47,7 @@ import type { ExecutionNode } from '../graph/metamodel/pure/executionPlan/nodes/
|
|
|
47
47
|
import {
|
|
48
48
|
ActionState,
|
|
49
49
|
type PlainObject,
|
|
50
|
-
type
|
|
50
|
+
type LogService,
|
|
51
51
|
type ServerClientConfig,
|
|
52
52
|
type TracerService,
|
|
53
53
|
} from '@finos/legend-shared';
|
|
@@ -79,6 +79,7 @@ import type {
|
|
|
79
79
|
} from './action/compilation/CompilationResult.js';
|
|
80
80
|
import type { ParameterValue } from '../DSL_Service_Exports.js';
|
|
81
81
|
import type { ModelUnit } from '../graph/metamodel/pure/packageableElements/externalFormat/store/DSL_ExternalFormat_ModelUnit.js';
|
|
82
|
+
import type { BulkServiceRegistrationResult } from './action/service/BulkServiceRegistrationResult.js';
|
|
82
83
|
|
|
83
84
|
export interface TEMPORARY__EngineSetupConfig {
|
|
84
85
|
env: string;
|
|
@@ -134,13 +135,16 @@ export abstract class AbstractPureGraphManagerExtension {
|
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
export abstract class AbstractPureGraphManager {
|
|
137
|
-
extensions: AbstractPureGraphManagerExtension[] = [];
|
|
138
|
-
pluginManager: GraphManagerPluginManager;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
constructor(
|
|
138
|
+
readonly extensions: AbstractPureGraphManagerExtension[] = [];
|
|
139
|
+
readonly pluginManager: GraphManagerPluginManager;
|
|
140
|
+
readonly logService: LogService;
|
|
141
|
+
|
|
142
|
+
constructor(
|
|
143
|
+
pluginManager: GraphManagerPluginManager,
|
|
144
|
+
logService: LogService,
|
|
145
|
+
) {
|
|
142
146
|
this.pluginManager = pluginManager;
|
|
143
|
-
this.
|
|
147
|
+
this.logService = logService;
|
|
144
148
|
this.extensions = pluginManager
|
|
145
149
|
.getPureGraphManagerPlugins()
|
|
146
150
|
.flatMap(
|
|
@@ -449,6 +453,16 @@ export abstract class AbstractPureGraphManager {
|
|
|
449
453
|
executionMode: ServiceExecutionMode,
|
|
450
454
|
options?: ServiceRegistrationOptions,
|
|
451
455
|
): Promise<ServiceRegistrationResult>;
|
|
456
|
+
abstract bulkServiceRegistration(
|
|
457
|
+
service: Service[],
|
|
458
|
+
graph: PureModel,
|
|
459
|
+
groupId: string,
|
|
460
|
+
artifactId: string,
|
|
461
|
+
version: string | undefined,
|
|
462
|
+
server: string,
|
|
463
|
+
executionMode: ServiceExecutionMode,
|
|
464
|
+
options?: ServiceRegistrationOptions,
|
|
465
|
+
): Promise<BulkServiceRegistrationResult[]>;
|
|
452
466
|
abstract activateService(
|
|
453
467
|
serviceUrl: string,
|
|
454
468
|
serviceId: string,
|
|
@@ -14,7 +14,11 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
type LogService,
|
|
19
|
+
ActionState,
|
|
20
|
+
assertErrorThrown,
|
|
21
|
+
} from '@finos/legend-shared';
|
|
18
22
|
import { action, computed, makeObservable, observable } from 'mobx';
|
|
19
23
|
import { DependencyManager } from '../graph/DependencyManager.js';
|
|
20
24
|
import {
|
|
@@ -55,15 +59,18 @@ import type { Type } from '../graph/metamodel/pure/packageableElements/domain/Ty
|
|
|
55
59
|
import { PrimitiveType } from '../graph/metamodel/pure/packageableElements/domain/PrimitiveType.js';
|
|
56
60
|
|
|
57
61
|
export class BasicGraphManagerState {
|
|
58
|
-
pluginManager: GraphManagerPluginManager;
|
|
59
|
-
|
|
62
|
+
readonly pluginManager: GraphManagerPluginManager;
|
|
63
|
+
readonly logService: LogService;
|
|
60
64
|
|
|
61
65
|
graphManager: AbstractPureGraphManager;
|
|
62
66
|
|
|
63
|
-
constructor(
|
|
67
|
+
constructor(
|
|
68
|
+
pluginManager: GraphManagerPluginManager,
|
|
69
|
+
logService: LogService,
|
|
70
|
+
) {
|
|
64
71
|
this.pluginManager = pluginManager;
|
|
65
|
-
this.
|
|
66
|
-
this.graphManager = buildPureGraphManager(this.pluginManager,
|
|
72
|
+
this.logService = logService;
|
|
73
|
+
this.graphManager = buildPureGraphManager(this.pluginManager, logService);
|
|
67
74
|
}
|
|
68
75
|
|
|
69
76
|
// -------------------------------------------------- UTILITIES -----------------------------------------------------
|
|
@@ -110,17 +117,21 @@ export class BasicGraphManagerState {
|
|
|
110
117
|
}
|
|
111
118
|
|
|
112
119
|
export class GraphManagerState extends BasicGraphManagerState {
|
|
113
|
-
coreModel: CoreModel;
|
|
114
|
-
systemModel: SystemModel;
|
|
115
|
-
|
|
120
|
+
readonly coreModel: CoreModel;
|
|
121
|
+
readonly systemModel: SystemModel;
|
|
122
|
+
|
|
123
|
+
readonly systemBuildState = ActionState.create();
|
|
124
|
+
readonly dependenciesBuildState = ActionState.create();
|
|
125
|
+
readonly graphBuildState = ActionState.create();
|
|
126
|
+
readonly generationsBuildState = ActionState.create();
|
|
116
127
|
|
|
117
|
-
|
|
118
|
-
dependenciesBuildState = ActionState.create();
|
|
119
|
-
graphBuildState = ActionState.create();
|
|
120
|
-
generationsBuildState = ActionState.create();
|
|
128
|
+
graph: PureModel;
|
|
121
129
|
|
|
122
|
-
constructor(
|
|
123
|
-
|
|
130
|
+
constructor(
|
|
131
|
+
pluginManager: GraphManagerPluginManager,
|
|
132
|
+
logService: LogService,
|
|
133
|
+
) {
|
|
134
|
+
super(pluginManager, logService);
|
|
124
135
|
|
|
125
136
|
makeObservable(this, {
|
|
126
137
|
graph: observable,
|
|
@@ -148,16 +159,13 @@ export class GraphManagerState extends BasicGraphManagerState {
|
|
|
148
159
|
resetGraph: action,
|
|
149
160
|
});
|
|
150
161
|
|
|
151
|
-
this.pluginManager = pluginManager;
|
|
152
|
-
this.log = log;
|
|
153
|
-
|
|
154
162
|
const extensionElementClasses = this.pluginManager
|
|
155
163
|
.getPureGraphPlugins()
|
|
156
164
|
.flatMap((plugin) => plugin.getExtraPureGraphExtensionClasses?.() ?? []);
|
|
157
165
|
this.systemModel = new SystemModel(extensionElementClasses);
|
|
158
166
|
this.coreModel = new CoreModel(extensionElementClasses);
|
|
159
167
|
this.graph = this.createEmptyGraph();
|
|
160
|
-
this.graphManager = buildPureGraphManager(this.pluginManager,
|
|
168
|
+
this.graphManager = buildPureGraphManager(this.pluginManager, logService);
|
|
161
169
|
|
|
162
170
|
this.systemBuildState.setMessageFormatter(
|
|
163
171
|
(message: string) => `[system] ${message}`,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { type
|
|
17
|
+
import { type LogService, guaranteeNonNullable } from '@finos/legend-shared';
|
|
18
18
|
import { useLocalObservable } from 'mobx-react-lite';
|
|
19
19
|
import { createContext, useContext } from 'react';
|
|
20
20
|
import { GraphManagerState } from './GraphManagerState.js';
|
|
@@ -27,8 +27,8 @@ const GraphManagerStateContext = createContext<GraphManagerState | undefined>(
|
|
|
27
27
|
export const GraphManagerStateProvider: React.FC<{
|
|
28
28
|
children: React.ReactNode;
|
|
29
29
|
pluginManager: GraphManagerPluginManager;
|
|
30
|
-
|
|
31
|
-
}> = ({ children, pluginManager, log }) => {
|
|
30
|
+
logService: LogService;
|
|
31
|
+
}> = ({ children, pluginManager, logService: log }) => {
|
|
32
32
|
const graphManagerState = useLocalObservable(
|
|
33
33
|
() => new GraphManagerState(pluginManager, log),
|
|
34
34
|
);
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
type LoggerPlugin,
|
|
20
20
|
type TEMPORARY__JestMatcher,
|
|
21
21
|
type PlainObject,
|
|
22
|
-
|
|
22
|
+
LogService,
|
|
23
23
|
AbstractPluginManager,
|
|
24
24
|
promisify,
|
|
25
25
|
createMock,
|
|
@@ -80,11 +80,11 @@ export class TEST__GraphManagerPluginManager
|
|
|
80
80
|
|
|
81
81
|
export const TEST__getTestGraphManagerState = (
|
|
82
82
|
pluginManager?: GraphManagerPluginManager,
|
|
83
|
-
|
|
83
|
+
logService?: LogService,
|
|
84
84
|
): GraphManagerState =>
|
|
85
85
|
new GraphManagerState(
|
|
86
86
|
pluginManager ?? new TEST__GraphManagerPluginManager(),
|
|
87
|
-
|
|
87
|
+
logService ?? new LogService(),
|
|
88
88
|
);
|
|
89
89
|
|
|
90
90
|
export const TEST__provideMockedGraphManagerState = (customization?: {
|
|
@@ -105,7 +105,7 @@ export const TEST__GraphManagerStateProvider: React.FC<{
|
|
|
105
105
|
}> = ({ children }) => (
|
|
106
106
|
<GraphManagerStateProvider
|
|
107
107
|
pluginManager={new TEST__GraphManagerPluginManager()}
|
|
108
|
-
|
|
108
|
+
logService={new LogService()}
|
|
109
109
|
>
|
|
110
110
|
{children}
|
|
111
111
|
</GraphManagerStateProvider>
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
observe_TestSuite,
|
|
124
124
|
} from './Testable_ObserverHelper.js';
|
|
125
125
|
import type { MappingTestSuite } from '../../../graph/metamodel/pure/packageableElements/mapping/MappingTestSuite.js';
|
|
126
|
-
import type {
|
|
126
|
+
import type { MappingStoreTestData } from '../../../graph/metamodel/pure/packageableElements/mapping/MappingStoreTestData.js';
|
|
127
127
|
import { observe_EmbeddedData } from './DSL_Data_ObserverHelper.js';
|
|
128
128
|
|
|
129
129
|
// ------------------------------------- Store -------------------------------------
|
|
@@ -140,8 +140,11 @@ export const observe_Abstract_Store = (metamodel: Store): void => {
|
|
|
140
140
|
|
|
141
141
|
// ------------------------------------- TestSuite -----------------------------------
|
|
142
142
|
|
|
143
|
-
export const
|
|
144
|
-
(
|
|
143
|
+
export const observe_MappingStoreTestData = skipObservedWithContext(
|
|
144
|
+
(
|
|
145
|
+
metamodel: MappingStoreTestData,
|
|
146
|
+
context: ObserverContext,
|
|
147
|
+
): MappingStoreTestData => {
|
|
145
148
|
makeObservable(metamodel, {
|
|
146
149
|
store: observable,
|
|
147
150
|
data: observable,
|
|
@@ -174,13 +177,13 @@ export const observe_MappingTestSuite = skipObservedWithContext(
|
|
|
174
177
|
makeObservable(metamodel, {
|
|
175
178
|
id: observable,
|
|
176
179
|
tests: observable,
|
|
177
|
-
|
|
180
|
+
mappingStoreTestDatas: observable,
|
|
178
181
|
hashCode: computed,
|
|
179
182
|
});
|
|
180
183
|
|
|
181
184
|
metamodel.tests.forEach((test) => observe_AtomicTest(test, context));
|
|
182
|
-
metamodel.
|
|
183
|
-
|
|
185
|
+
metamodel.mappingStoreTestDatas.forEach((testData) =>
|
|
186
|
+
observe_MappingStoreTestData(testData, context),
|
|
184
187
|
);
|
|
185
188
|
|
|
186
189
|
return metamodel;
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
RedshiftDatasourceSpecification,
|
|
37
37
|
SnowflakeDatasourceSpecification,
|
|
38
38
|
StaticDatasourceSpecification,
|
|
39
|
+
SpannerDatasourceSpecification,
|
|
39
40
|
} from '../../../graph/metamodel/pure/packageableElements/store/relational/connection/DatasourceSpecification.js';
|
|
40
41
|
import { MapperPostProcessor } from '../../../graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/MapperPostProcessor.js';
|
|
41
42
|
import type { PostProcessor } from '../../../graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/PostProcessor.js';
|
|
@@ -828,6 +829,18 @@ export const observe_BigQueryDatasourceSpecification = skipObserved(
|
|
|
828
829
|
}),
|
|
829
830
|
);
|
|
830
831
|
|
|
832
|
+
export const observe_SpannerDatasourceSpecification = skipObserved(
|
|
833
|
+
(metamodel: SpannerDatasourceSpecification): SpannerDatasourceSpecification =>
|
|
834
|
+
makeObservable(metamodel, {
|
|
835
|
+
projectId: observable,
|
|
836
|
+
instanceId: observable,
|
|
837
|
+
databaseId: observable,
|
|
838
|
+
proxyHost: observable,
|
|
839
|
+
proxyPort: observable,
|
|
840
|
+
hashCode: computed,
|
|
841
|
+
}),
|
|
842
|
+
);
|
|
843
|
+
|
|
831
844
|
export const observe_DatasourceSpecification = (
|
|
832
845
|
metamodel: DatasourceSpecification,
|
|
833
846
|
context: ObserverContext,
|
|
@@ -846,6 +859,8 @@ export const observe_DatasourceSpecification = (
|
|
|
846
859
|
return observe_RedshiftDatasourceSpecification(metamodel);
|
|
847
860
|
} else if (metamodel instanceof BigQueryDatasourceSpecification) {
|
|
848
861
|
return observe_BigQueryDatasourceSpecification(metamodel);
|
|
862
|
+
} else if (metamodel instanceof SpannerDatasourceSpecification) {
|
|
863
|
+
return observe_SpannerDatasourceSpecification(metamodel);
|
|
849
864
|
}
|
|
850
865
|
const extraObservers = context.plugins.flatMap(
|
|
851
866
|
(plugin) =>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-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
|
+
export class BulkServiceRegistrationResult {
|
|
18
|
+
servicePath: string | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class BulkRegistrationResultSuccess extends BulkServiceRegistrationResult {
|
|
22
|
+
serverURL: string;
|
|
23
|
+
pattern: string;
|
|
24
|
+
serviceInstanceId: string;
|
|
25
|
+
|
|
26
|
+
constructor(serverURL: string, pattern: string, serviceInstanceId: string) {
|
|
27
|
+
super();
|
|
28
|
+
this.serverURL = serverURL;
|
|
29
|
+
this.pattern = pattern;
|
|
30
|
+
this.serviceInstanceId = serviceInstanceId;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class BulkRegistrationResultFail extends BulkServiceRegistrationResult {
|
|
35
|
+
errorMessage: string;
|
|
36
|
+
|
|
37
|
+
constructor(errorMessage: string) {
|
|
38
|
+
super();
|
|
39
|
+
this.errorMessage = errorMessage;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
import type { AbstractPureGraphManager } from '../../../graphManager/AbstractPureGraphManager.js';
|
|
18
18
|
import { V1_PureGraphManager } from './v1/V1_PureGraphManager.js';
|
|
19
|
-
import type {
|
|
19
|
+
import type { LogService } from '@finos/legend-shared';
|
|
20
20
|
import type { GraphManagerPluginManager } from '../../GraphManagerPluginManager.js';
|
|
21
21
|
|
|
22
22
|
export const buildPureGraphManager = (
|
|
23
23
|
pluginManager: GraphManagerPluginManager,
|
|
24
|
-
|
|
24
|
+
logService: LogService,
|
|
25
25
|
): AbstractPureGraphManager =>
|
|
26
26
|
// NOTE: until we support more client versions, we always default to return V1
|
|
27
|
-
new V1_PureGraphManager(pluginManager,
|
|
27
|
+
new V1_PureGraphManager(pluginManager, logService);
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from '../../../../graph/MetaModelConst.js';
|
|
22
22
|
import {
|
|
23
23
|
type Clazz,
|
|
24
|
-
type
|
|
24
|
+
type LogService,
|
|
25
25
|
type PlainObject,
|
|
26
26
|
type ServerClientConfig,
|
|
27
27
|
ActionState,
|
|
@@ -275,6 +275,11 @@ import { V1_transformParameterValue } from './transformation/pureGraph/from/V1_S
|
|
|
275
275
|
import { V1_transformModelUnit } from './transformation/pureGraph/from/V1_DSL_ExternalFormat_Transformer.js';
|
|
276
276
|
import type { ModelUnit } from '../../../../graph/metamodel/pure/packageableElements/externalFormat/store/DSL_ExternalFormat_ModelUnit.js';
|
|
277
277
|
import { V1_LambdaReturnTypeInput } from './engine/compilation/V1_LambdaReturnType.js';
|
|
278
|
+
import {
|
|
279
|
+
type BulkServiceRegistrationResult,
|
|
280
|
+
BulkRegistrationResultSuccess,
|
|
281
|
+
BulkRegistrationResultFail,
|
|
282
|
+
} from '../../../action/service/BulkServiceRegistrationResult.js';
|
|
278
283
|
|
|
279
284
|
class V1_PureModelContextDataIndex {
|
|
280
285
|
elements: V1_PackageableElement[] = [];
|
|
@@ -450,11 +455,14 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
450
455
|
static readonly PROD_PROTOCOL_VERSION = undefined;
|
|
451
456
|
|
|
452
457
|
engine: V1_Engine;
|
|
453
|
-
graphBuilderExtensions: V1_GraphBuilderExtensions;
|
|
458
|
+
readonly graphBuilderExtensions: V1_GraphBuilderExtensions;
|
|
454
459
|
|
|
455
|
-
constructor(
|
|
456
|
-
|
|
457
|
-
|
|
460
|
+
constructor(
|
|
461
|
+
pluginManager: GraphManagerPluginManager,
|
|
462
|
+
logService: LogService,
|
|
463
|
+
) {
|
|
464
|
+
super(pluginManager, logService);
|
|
465
|
+
this.engine = new V1_Engine({}, logService);
|
|
458
466
|
|
|
459
467
|
// setup plugins
|
|
460
468
|
this.graphBuilderExtensions = new V1_GraphBuilderExtensions(
|
|
@@ -489,7 +497,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
489
497
|
tracerService?: TracerService | undefined;
|
|
490
498
|
},
|
|
491
499
|
): Promise<void> {
|
|
492
|
-
this.engine = new V1_Engine(config.clientConfig, this.
|
|
500
|
+
this.engine = new V1_Engine(config.clientConfig, this.logService);
|
|
493
501
|
this.engine
|
|
494
502
|
.getEngineServerClient()
|
|
495
503
|
.setTracerService(options?.tracerService ?? new TracerService());
|
|
@@ -575,7 +583,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
575
583
|
} catch (error) {
|
|
576
584
|
assertErrorThrown(error);
|
|
577
585
|
buildState.fail();
|
|
578
|
-
this.
|
|
586
|
+
this.logService.error(
|
|
579
587
|
LogEvent.create(GRAPH_MANAGER_EVENT.GRAPH_BUILDER_FAILURE),
|
|
580
588
|
error,
|
|
581
589
|
);
|
|
@@ -664,7 +672,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
664
672
|
};
|
|
665
673
|
} catch (error) {
|
|
666
674
|
assertErrorThrown(error);
|
|
667
|
-
this.
|
|
675
|
+
this.logService.error(
|
|
668
676
|
LogEvent.create(GRAPH_MANAGER_EVENT.GRAPH_BUILDER_FAILURE),
|
|
669
677
|
error,
|
|
670
678
|
);
|
|
@@ -747,7 +755,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
747
755
|
};
|
|
748
756
|
} catch (error) {
|
|
749
757
|
assertErrorThrown(error);
|
|
750
|
-
this.
|
|
758
|
+
this.logService.error(
|
|
751
759
|
LogEvent.create(GRAPH_MANAGER_EVENT.GRAPH_BUILDER_FAILURE),
|
|
752
760
|
error,
|
|
753
761
|
);
|
|
@@ -829,7 +837,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
829
837
|
};
|
|
830
838
|
} catch (error) {
|
|
831
839
|
assertErrorThrown(error);
|
|
832
|
-
this.
|
|
840
|
+
this.logService.error(
|
|
833
841
|
LogEvent.create(GRAPH_MANAGER_EVENT.GRAPH_BUILDER_FAILURE),
|
|
834
842
|
error,
|
|
835
843
|
);
|
|
@@ -914,7 +922,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
914
922
|
};
|
|
915
923
|
} catch (error) {
|
|
916
924
|
assertErrorThrown(error);
|
|
917
|
-
this.
|
|
925
|
+
this.logService.error(
|
|
918
926
|
LogEvent.create(GRAPH_MANAGER_EVENT.GRAPH_BUILDER_FAILURE),
|
|
919
927
|
error,
|
|
920
928
|
);
|
|
@@ -1025,7 +1033,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1025
1033
|
graph,
|
|
1026
1034
|
currentSubGraph,
|
|
1027
1035
|
this.graphBuilderExtensions,
|
|
1028
|
-
this.
|
|
1036
|
+
this.logService,
|
|
1029
1037
|
options,
|
|
1030
1038
|
)
|
|
1031
1039
|
.withElement(element)
|
|
@@ -1560,7 +1568,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1560
1568
|
const grammarToJson = await this.engine.pureModelContextDataToPureCode(
|
|
1561
1569
|
graphData,
|
|
1562
1570
|
);
|
|
1563
|
-
this.
|
|
1571
|
+
this.logService.info(
|
|
1564
1572
|
LogEvent.create(
|
|
1565
1573
|
GRAPH_MANAGER_EVENT.TRANSFORM_GRAPH_META_MODEL_TO_GRAMMAR__SUCCESS,
|
|
1566
1574
|
),
|
|
@@ -1579,7 +1587,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1579
1587
|
const grammarToJson = await this.engine.pureModelContextDataToPureCode(
|
|
1580
1588
|
await this.entitiesToPureModelContextData(entities),
|
|
1581
1589
|
);
|
|
1582
|
-
this.
|
|
1590
|
+
this.logService.info(
|
|
1583
1591
|
LogEvent.create(
|
|
1584
1592
|
GRAPH_MANAGER_EVENT.TRANSFORM_GRAPH_META_MODEL_TO_GRAMMAR__SUCCESS,
|
|
1585
1593
|
),
|
|
@@ -1985,7 +1993,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1985
1993
|
graph,
|
|
1986
1994
|
graph,
|
|
1987
1995
|
this.graphBuilderExtensions,
|
|
1988
|
-
this.
|
|
1996
|
+
this.logService,
|
|
1989
1997
|
).build(),
|
|
1990
1998
|
);
|
|
1991
1999
|
}
|
|
@@ -2013,7 +2021,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2013
2021
|
graph,
|
|
2014
2022
|
graph,
|
|
2015
2023
|
this.graphBuilderExtensions,
|
|
2016
|
-
this.
|
|
2024
|
+
this.logService,
|
|
2017
2025
|
).build(),
|
|
2018
2026
|
),
|
|
2019
2027
|
);
|
|
@@ -2462,7 +2470,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2462
2470
|
graph,
|
|
2463
2471
|
graph,
|
|
2464
2472
|
this.graphBuilderExtensions,
|
|
2465
|
-
this.
|
|
2473
|
+
this.logService,
|
|
2466
2474
|
).build(),
|
|
2467
2475
|
);
|
|
2468
2476
|
}
|
|
@@ -2596,6 +2604,145 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2596
2604
|
);
|
|
2597
2605
|
}
|
|
2598
2606
|
|
|
2607
|
+
async bulkServiceRegistration(
|
|
2608
|
+
services: Service[],
|
|
2609
|
+
graph: PureModel,
|
|
2610
|
+
groupId: string,
|
|
2611
|
+
artifactId: string,
|
|
2612
|
+
version: string | undefined,
|
|
2613
|
+
server: string,
|
|
2614
|
+
executionMode: ServiceExecutionMode,
|
|
2615
|
+
options?: ServiceRegistrationOptions,
|
|
2616
|
+
): Promise<BulkServiceRegistrationResult[]> {
|
|
2617
|
+
const serverServiceInfo = await this.engine.getServerServiceInfo();
|
|
2618
|
+
//input
|
|
2619
|
+
const input: V1_PureModelContext[] = [];
|
|
2620
|
+
const result: BulkServiceRegistrationResult[] = [];
|
|
2621
|
+
|
|
2622
|
+
const protocol = new V1_Protocol(
|
|
2623
|
+
'pure',
|
|
2624
|
+
serverServiceInfo.services.dependencies.pure,
|
|
2625
|
+
);
|
|
2626
|
+
switch (executionMode) {
|
|
2627
|
+
case ServiceExecutionMode.FULL_INTERACTIVE: {
|
|
2628
|
+
const pmcp = this.createBulkServiceRegistrationInput(graph, services);
|
|
2629
|
+
pmcp.forEach((data) => {
|
|
2630
|
+
data.origin = new V1_PureModelContextPointer(protocol);
|
|
2631
|
+
input.push(data);
|
|
2632
|
+
});
|
|
2633
|
+
break;
|
|
2634
|
+
}
|
|
2635
|
+
case ServiceExecutionMode.SEMI_INTERACTIVE: {
|
|
2636
|
+
services.forEach((service) => {
|
|
2637
|
+
const sdlcInfo = new V1_LegendSDLC(groupId, artifactId, version);
|
|
2638
|
+
const pointer = new V1_PureModelContextPointer(protocol, sdlcInfo);
|
|
2639
|
+
// data
|
|
2640
|
+
const data = new V1_PureModelContextData();
|
|
2641
|
+
data.origin = new V1_PureModelContextPointer(protocol);
|
|
2642
|
+
const serviceProtocol = this.elementToProtocol<V1_Service>(service);
|
|
2643
|
+
|
|
2644
|
+
// override the URL pattern if specified
|
|
2645
|
+
if (options?.TEMPORARY__semiInteractiveOverridePattern) {
|
|
2646
|
+
serviceProtocol.pattern =
|
|
2647
|
+
options.TEMPORARY__semiInteractiveOverridePattern;
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
data.elements = [serviceProtocol];
|
|
2651
|
+
|
|
2652
|
+
// SDLC info
|
|
2653
|
+
// TODO: We may need to add `runtime` pointers if the runtime defned in the service is a packageable runtime
|
|
2654
|
+
// and not embedded.
|
|
2655
|
+
const execution = service.execution;
|
|
2656
|
+
if (execution instanceof PureSingleExecution) {
|
|
2657
|
+
if (execution.mapping) {
|
|
2658
|
+
sdlcInfo.packageableElementPointers = [
|
|
2659
|
+
new V1_PackageableElementPointer(
|
|
2660
|
+
PackageableElementPointerType.MAPPING,
|
|
2661
|
+
execution.mapping.value.path,
|
|
2662
|
+
),
|
|
2663
|
+
];
|
|
2664
|
+
}
|
|
2665
|
+
} else if (execution instanceof PureMultiExecution) {
|
|
2666
|
+
sdlcInfo.packageableElementPointers =
|
|
2667
|
+
execution.executionParameters.map(
|
|
2668
|
+
(e) =>
|
|
2669
|
+
new V1_PackageableElementPointer(
|
|
2670
|
+
PackageableElementPointerType.MAPPING,
|
|
2671
|
+
e.mapping.value.path,
|
|
2672
|
+
),
|
|
2673
|
+
);
|
|
2674
|
+
} else {
|
|
2675
|
+
throw new UnsupportedOperationError(
|
|
2676
|
+
`Can't register service with the specified execution`,
|
|
2677
|
+
execution,
|
|
2678
|
+
);
|
|
2679
|
+
}
|
|
2680
|
+
// composite input
|
|
2681
|
+
input.push(new V1_PureModelContextComposite(protocol, data, pointer));
|
|
2682
|
+
});
|
|
2683
|
+
break;
|
|
2684
|
+
}
|
|
2685
|
+
case ServiceExecutionMode.PROD: {
|
|
2686
|
+
services.forEach((service) => {
|
|
2687
|
+
const sdlcInfo = new V1_LegendSDLC(groupId, artifactId, version);
|
|
2688
|
+
const pointer = new V1_PureModelContextPointer(protocol, sdlcInfo);
|
|
2689
|
+
const data = new V1_PackageableElementPointer(
|
|
2690
|
+
PackageableElementPointerType.SERVICE,
|
|
2691
|
+
service.path,
|
|
2692
|
+
);
|
|
2693
|
+
sdlcInfo.packageableElementPointers.push(data);
|
|
2694
|
+
input.push(pointer);
|
|
2695
|
+
});
|
|
2696
|
+
break;
|
|
2697
|
+
}
|
|
2698
|
+
default: {
|
|
2699
|
+
throw new UnsupportedOperationError(
|
|
2700
|
+
`Can't register service with execution mode '${executionMode}'`,
|
|
2701
|
+
);
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
|
|
2705
|
+
await Promise.all(
|
|
2706
|
+
input.map(async (res) => {
|
|
2707
|
+
await this.engine
|
|
2708
|
+
.registerService(
|
|
2709
|
+
res,
|
|
2710
|
+
server,
|
|
2711
|
+
executionMode,
|
|
2712
|
+
Boolean(options?.TEMPORARY__useStoreModel),
|
|
2713
|
+
)
|
|
2714
|
+
.then((serviceResult) => {
|
|
2715
|
+
if (serviceResult.status === 'success') {
|
|
2716
|
+
result.push(
|
|
2717
|
+
new BulkRegistrationResultSuccess(
|
|
2718
|
+
serviceResult.serverURL,
|
|
2719
|
+
serviceResult.pattern,
|
|
2720
|
+
serviceResult.serviceInstanceId,
|
|
2721
|
+
),
|
|
2722
|
+
);
|
|
2723
|
+
}
|
|
2724
|
+
})
|
|
2725
|
+
.catch((errorResult) => {
|
|
2726
|
+
assertErrorThrown(errorResult);
|
|
2727
|
+
const failedResult = new BulkRegistrationResultFail(
|
|
2728
|
+
errorResult.message,
|
|
2729
|
+
);
|
|
2730
|
+
|
|
2731
|
+
if (res instanceof V1_PureModelContextData) {
|
|
2732
|
+
const service = res.elements.filter(filterByType(V1_Service))[0];
|
|
2733
|
+
const metamodelService = service
|
|
2734
|
+
? graph.getNullableService(service.path)
|
|
2735
|
+
: undefined;
|
|
2736
|
+
failedResult.servicePath = metamodelService?.pattern;
|
|
2737
|
+
failedResult.servicePath = service?.path;
|
|
2738
|
+
}
|
|
2739
|
+
result.push(failedResult);
|
|
2740
|
+
});
|
|
2741
|
+
}),
|
|
2742
|
+
);
|
|
2743
|
+
return Promise.resolve(result);
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2599
2746
|
async activateService(serviceUrl: string, serviceId: string): Promise<void> {
|
|
2600
2747
|
const serviceStorage = await this.engine.getServiceVersionInfo(
|
|
2601
2748
|
serviceUrl,
|
|
@@ -2619,7 +2766,24 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2619
2766
|
prunedGraphData.elements.push(this.elementToProtocol<V1_Service>(service));
|
|
2620
2767
|
return prunedGraphData;
|
|
2621
2768
|
};
|
|
2622
|
-
|
|
2769
|
+
private createBulkServiceRegistrationInput = (
|
|
2770
|
+
graph: PureModel,
|
|
2771
|
+
services: Service[],
|
|
2772
|
+
): V1_PureModelContextData[] => {
|
|
2773
|
+
const graphData = this.getFullGraphModelData(graph);
|
|
2774
|
+
const results: V1_PureModelContextData[] = [];
|
|
2775
|
+
services.forEach((service) => {
|
|
2776
|
+
const prunedGraphData = new V1_PureModelContextData();
|
|
2777
|
+
prunedGraphData.elements = graphData.elements.filter(
|
|
2778
|
+
(element) => !(element instanceof V1_Service),
|
|
2779
|
+
);
|
|
2780
|
+
prunedGraphData.elements.push(
|
|
2781
|
+
this.elementToProtocol<V1_Service>(service),
|
|
2782
|
+
);
|
|
2783
|
+
results.push(prunedGraphData);
|
|
2784
|
+
});
|
|
2785
|
+
return results;
|
|
2786
|
+
};
|
|
2623
2787
|
// --------------------------------------------- Query ---------------------------------------------
|
|
2624
2788
|
|
|
2625
2789
|
async searchQueries(
|
|
@@ -3093,7 +3257,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
3093
3257
|
keepSourceInformation: options?.keepSourceInformation,
|
|
3094
3258
|
}),
|
|
3095
3259
|
);
|
|
3096
|
-
this.
|
|
3260
|
+
this.logService.info(
|
|
3097
3261
|
LogEvent.create(
|
|
3098
3262
|
GRAPH_MANAGER_EVENT.TRANSFORM_GRAPH_META_MODEL_TO_PROTOCOL__SUCCESS,
|
|
3099
3263
|
),
|
|
@@ -3114,7 +3278,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
3114
3278
|
...dependencyManager.allOwnElements,
|
|
3115
3279
|
...generatedModel.allOwnElements,
|
|
3116
3280
|
].map((element) => this.elementToProtocol(element));
|
|
3117
|
-
this.
|
|
3281
|
+
this.logService.info(
|
|
3118
3282
|
LogEvent.create(
|
|
3119
3283
|
GRAPH_MANAGER_EVENT.COLLECT_GRAPH_COMPILE_CONTEXT__SUCCESS,
|
|
3120
3284
|
),
|