@finos/legend-extension-dsl-persistence 2.0.8 → 2.0.11
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/components/studio/DSLPersistence_CodeSnippets.d.ts +1 -0
- package/lib/components/studio/DSLPersistence_CodeSnippets.d.ts.map +1 -1
- package/lib/components/studio/DSLPersistence_CodeSnippets.js +5 -1
- package/lib/components/studio/DSLPersistence_CodeSnippets.js.map +1 -1
- package/lib/components/studio/{DSLPersistence_LegendStudioPlugin.d.ts → DSLPersistence_LegendStudioApplicationPlugin.d.ts} +3 -3
- package/lib/components/studio/DSLPersistence_LegendStudioApplicationPlugin.d.ts.map +1 -0
- package/lib/components/studio/{DSLPersistence_LegendStudioPlugin.js → DSLPersistence_LegendStudioApplicationPlugin.js} +39 -8
- package/lib/components/studio/DSLPersistence_LegendStudioApplicationPlugin.js.map +1 -0
- package/lib/components/studio/DSLPersistence_LegendStudioDocumentation.d.ts +2 -1
- package/lib/components/studio/DSLPersistence_LegendStudioDocumentation.d.ts.map +1 -1
- package/lib/components/studio/DSLPersistence_LegendStudioDocumentation.js +1 -0
- package/lib/components/studio/DSLPersistence_LegendStudioDocumentation.js.map +1 -1
- package/lib/graph/DSLPersistence_PureGraphPlugin.d.ts.map +1 -1
- package/lib/graph/DSLPersistence_PureGraphPlugin.js +2 -1
- package/lib/graph/DSLPersistence_PureGraphPlugin.js.map +1 -1
- package/lib/graphManager/DSLPersistence_GraphManagerHelper.d.ts +3 -0
- package/lib/graphManager/DSLPersistence_GraphManagerHelper.d.ts.map +1 -1
- package/lib/graphManager/DSLPersistence_GraphManagerHelper.js +3 -0
- package/lib/graphManager/DSLPersistence_GraphManagerHelper.js.map +1 -1
- package/lib/graphManager/DSLPersistence_PureGraphManagerPlugin.d.ts +1 -0
- package/lib/graphManager/DSLPersistence_PureGraphManagerPlugin.d.ts.map +1 -1
- package/lib/graphManager/DSLPersistence_PureGraphManagerPlugin.js +13 -1
- package/lib/graphManager/DSLPersistence_PureGraphManagerPlugin.js.map +1 -1
- package/lib/graphManager/action/changeDetection/DSLPersistenceContext_ObserverHelper.d.ts +18 -0
- package/lib/graphManager/action/changeDetection/DSLPersistenceContext_ObserverHelper.d.ts.map +1 -0
- package/lib/graphManager/action/changeDetection/DSLPersistenceContext_ObserverHelper.js +29 -0
- package/lib/graphManager/action/changeDetection/DSLPersistenceContext_ObserverHelper.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +9 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +12 -2
- package/lib/index.js.map +1 -1
- package/lib/models/DSLPersistence_ModelUtils.d.ts +5 -0
- package/lib/models/DSLPersistence_ModelUtils.d.ts.map +1 -1
- package/lib/models/DSLPersistence_ModelUtils.js +9 -0
- package/lib/models/DSLPersistence_ModelUtils.js.map +1 -1
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistenceContext.d.ts +29 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistenceContext.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistenceContext.js +37 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistenceContext.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistencePlatform.d.ts +23 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistencePlatform.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistencePlatform.js +25 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistencePlatform.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_ServiceParameter.d.ts +34 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_ServiceParameter.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_ServiceParameter.js +49 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_ServiceParameter.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Sink.d.ts +3 -2
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Sink.d.ts.map +1 -1
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Sink.js +6 -1
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Sink.js.map +1 -1
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_TargetShape.d.ts +2 -2
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_TargetShape.d.ts.map +1 -1
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_TargetShape.js +1 -1
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_TargetShape.js.map +1 -1
- package/lib/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin.d.ts +1 -0
- package/lib/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin.js +33 -0
- package/lib/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin_Extension.d.ts +30 -0
- package/lib/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin_Extension.d.ts.map +1 -0
- package/lib/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin_Extension.js +17 -0
- package/lib/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin_Extension.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_PersistenceContext.d.ts +28 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_PersistenceContext.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_PersistenceContext.js +37 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_PersistenceContext.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_PersistencePlatform.d.ts +23 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_PersistencePlatform.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_PersistencePlatform.js +25 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_PersistencePlatform.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_ServiceParameter.d.ts +34 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_ServiceParameter.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_ServiceParameter.js +49 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_ServiceParameter.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Sink.d.ts +2 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Sink.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Sink.js +6 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Sink.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLPersistence_GraphBuilderHelper.d.ts +2 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLPersistence_GraphBuilderHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLPersistence_GraphBuilderHelper.js +2 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLPersistence_GraphBuilderHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceContextTransformer.d.ts +36 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceContextTransformer.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceContextTransformer.js +75 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceContextTransformer.js.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceTransformer.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceTransformer.js +7 -2
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceTransformer.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceBuilder.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceBuilder.js +11 -4
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceBuilder.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceContextBuilder.d.ts +35 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceContextBuilder.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceContextBuilder.js +74 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceContextBuilder.js.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistenceContext_ProtocolHelper.d.ts +31 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistenceContext_ProtocolHelper.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistenceContext_ProtocolHelper.js +118 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistenceContext_ProtocolHelper.js.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistence_ProtocolHelper.d.ts +3 -3
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistence_ProtocolHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistence_ProtocolHelper.js +3 -5
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistence_ProtocolHelper.js.map +1 -1
- package/lib/package.json +5 -5
- package/package.json +12 -12
- package/src/components/studio/DSLPersistence_CodeSnippets.ts +6 -1
- package/src/components/studio/{DSLPersistence_LegendStudioPlugin.tsx → DSLPersistence_LegendStudioApplicationPlugin.tsx} +51 -12
- package/src/components/studio/DSLPersistence_LegendStudioDocumentation.ts +1 -0
- package/src/graph/DSLPersistence_PureGraphPlugin.ts +2 -1
- package/src/graphManager/DSLPersistence_GraphManagerHelper.ts +20 -0
- package/src/graphManager/DSLPersistence_PureGraphManagerPlugin.ts +12 -1
- package/src/graphManager/action/changeDetection/DSLPersistenceContext_ObserverHelper.ts +38 -0
- package/src/index.ts +14 -2
- package/src/models/DSLPersistence_ModelUtils.ts +14 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistenceContext.ts +50 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistencePlatform.ts +30 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_ServiceParameter.ts +61 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Sink.ts +8 -2
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_TargetShape.ts +3 -7
- package/src/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin.ts +52 -0
- package/src/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin_Extension.ts +57 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_PersistenceContext.ts +51 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_PersistencePlatform.ts +31 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_ServiceParameter.ts +64 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Sink.ts +7 -2
- package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLPersistence_GraphBuilderHelper.ts +13 -1
- package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceContextTransformer.ts +141 -0
- package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceTransformer.ts +11 -6
- package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceBuilder.ts +15 -12
- package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceContextBuilder.ts +151 -0
- package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistenceContext_ProtocolHelper.ts +242 -0
- package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistence_ProtocolHelper.ts +20 -31
- package/tsconfig.json +12 -1
- package/lib/components/studio/DSLPersistence_LegendStudioPlugin.d.ts.map +0 -1
- package/lib/components/studio/DSLPersistence_LegendStudioPlugin.js.map +0 -1
|
@@ -16,13 +16,21 @@
|
|
|
16
16
|
|
|
17
17
|
import packageJson from '../../../../package.json';
|
|
18
18
|
import { Persistence } from '../../metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persistence.js';
|
|
19
|
+
import { PersistenceContext } from '../../metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistenceContext.js';
|
|
19
20
|
import { V1_Persistence } from './v1/model/packageableElements/persistence/V1_DSLPersistence_Persistence.js';
|
|
21
|
+
import { V1_PersistenceContext } from './v1/model/packageableElements/persistence/V1_DSLPersistence_PersistenceContext.js';
|
|
20
22
|
import {
|
|
21
23
|
V1_PERSISTENCE_ELEMENT_PROTOCOL_TYPE,
|
|
22
24
|
V1_persistenceModelSchema,
|
|
23
25
|
} from './v1/transformation/pureProtocol/V1_DSLPersistence_ProtocolHelper.js';
|
|
26
|
+
import {
|
|
27
|
+
V1_PERSISTENCE_CONTEXT_ELEMENT_PROTOCOL_TYPE,
|
|
28
|
+
V1_persistenceContextModelSchema,
|
|
29
|
+
} from './v1/transformation/pureProtocol/V1_DSLPersistenceContext_ProtocolHelper.js';
|
|
24
30
|
import { V1_buildPersistence } from './v1/transformation/pureGraph/to/V1_PersistenceBuilder.js';
|
|
31
|
+
import { V1_buildPersistenceContext } from './v1/transformation/pureGraph/to/V1_PersistenceContextBuilder.js';
|
|
25
32
|
import { V1_transformPersistence } from './v1/transformation/pureGraph/from/V1_PersistenceTransformer.js';
|
|
33
|
+
import { V1_transformPersistenceContext } from './v1/transformation/pureGraph/from/V1_PersistenceContextTransformer.js';
|
|
26
34
|
import {
|
|
27
35
|
type PackageableElement,
|
|
28
36
|
PureProtocolProcessorPlugin,
|
|
@@ -42,6 +50,9 @@ import { deserialize, serialize } from 'serializr';
|
|
|
42
50
|
export const PERSISTENCE_ELEMENT_CLASSIFIER_PATH =
|
|
43
51
|
'meta::pure::persistence::metamodel::Persistence';
|
|
44
52
|
|
|
53
|
+
export const PERSISTENCE_CONTEXT_ELEMENT_CLASSIFIER_PATH =
|
|
54
|
+
'meta::pure::persistence::metamodel::PersistenceContext';
|
|
55
|
+
|
|
45
56
|
export class DSLPersistence_PureProtocolProcessorPlugin extends PureProtocolProcessorPlugin {
|
|
46
57
|
constructor() {
|
|
47
58
|
super(
|
|
@@ -80,6 +91,34 @@ export class DSLPersistence_PureProtocolProcessorPlugin extends PureProtocolProc
|
|
|
80
91
|
V1_buildPersistence(elementProtocol, context);
|
|
81
92
|
},
|
|
82
93
|
}),
|
|
94
|
+
new V1_ElementBuilder<V1_PersistenceContext>({
|
|
95
|
+
elementClassName: 'PersistenceContext',
|
|
96
|
+
_class: V1_PersistenceContext,
|
|
97
|
+
firstPass: (
|
|
98
|
+
elementProtocol: V1_PackageableElement,
|
|
99
|
+
context: V1_GraphBuilderContext,
|
|
100
|
+
): PackageableElement => {
|
|
101
|
+
assertType(elementProtocol, V1_PersistenceContext);
|
|
102
|
+
const element = new PersistenceContext(elementProtocol.name);
|
|
103
|
+
const path = V1_buildFullPath(
|
|
104
|
+
elementProtocol.package,
|
|
105
|
+
elementProtocol.name,
|
|
106
|
+
);
|
|
107
|
+
context.currentSubGraph.setOwnElementInExtension(
|
|
108
|
+
path,
|
|
109
|
+
element,
|
|
110
|
+
PersistenceContext,
|
|
111
|
+
);
|
|
112
|
+
return element;
|
|
113
|
+
},
|
|
114
|
+
secondPass: (
|
|
115
|
+
elementProtocol: V1_PackageableElement,
|
|
116
|
+
context: V1_GraphBuilderContext,
|
|
117
|
+
): void => {
|
|
118
|
+
assertType(elementProtocol, V1_PersistenceContext);
|
|
119
|
+
V1_buildPersistenceContext(elementProtocol, context);
|
|
120
|
+
},
|
|
121
|
+
}),
|
|
83
122
|
];
|
|
84
123
|
}
|
|
85
124
|
|
|
@@ -88,6 +127,8 @@ export class DSLPersistence_PureProtocolProcessorPlugin extends PureProtocolProc
|
|
|
88
127
|
(elementProtocol: V1_PackageableElement): string | undefined => {
|
|
89
128
|
if (elementProtocol instanceof V1_Persistence) {
|
|
90
129
|
return PERSISTENCE_ELEMENT_CLASSIFIER_PATH;
|
|
130
|
+
} else if (elementProtocol instanceof V1_PersistenceContext) {
|
|
131
|
+
return PERSISTENCE_CONTEXT_ELEMENT_CLASSIFIER_PATH;
|
|
91
132
|
}
|
|
92
133
|
return undefined;
|
|
93
134
|
},
|
|
@@ -102,6 +143,11 @@ export class DSLPersistence_PureProtocolProcessorPlugin extends PureProtocolProc
|
|
|
102
143
|
): PlainObject<V1_PackageableElement> | undefined => {
|
|
103
144
|
if (elementProtocol instanceof V1_Persistence) {
|
|
104
145
|
return serialize(V1_persistenceModelSchema(plugins), elementProtocol);
|
|
146
|
+
} else if (elementProtocol instanceof V1_PersistenceContext) {
|
|
147
|
+
return serialize(
|
|
148
|
+
V1_persistenceContextModelSchema(plugins),
|
|
149
|
+
elementProtocol,
|
|
150
|
+
);
|
|
105
151
|
}
|
|
106
152
|
return undefined;
|
|
107
153
|
},
|
|
@@ -116,6 +162,10 @@ export class DSLPersistence_PureProtocolProcessorPlugin extends PureProtocolProc
|
|
|
116
162
|
): V1_PackageableElement | undefined => {
|
|
117
163
|
if (json._type === V1_PERSISTENCE_ELEMENT_PROTOCOL_TYPE) {
|
|
118
164
|
return deserialize(V1_persistenceModelSchema(plugins), json);
|
|
165
|
+
} else if (
|
|
166
|
+
json._type === V1_PERSISTENCE_CONTEXT_ELEMENT_PROTOCOL_TYPE
|
|
167
|
+
) {
|
|
168
|
+
return deserialize(V1_persistenceContextModelSchema(plugins), json);
|
|
119
169
|
}
|
|
120
170
|
return undefined;
|
|
121
171
|
},
|
|
@@ -130,6 +180,8 @@ export class DSLPersistence_PureProtocolProcessorPlugin extends PureProtocolProc
|
|
|
130
180
|
): V1_PackageableElement | undefined => {
|
|
131
181
|
if (metamodel instanceof Persistence) {
|
|
132
182
|
return V1_transformPersistence(metamodel, context);
|
|
183
|
+
} else if (metamodel instanceof PersistenceContext) {
|
|
184
|
+
return V1_transformPersistenceContext(metamodel, context);
|
|
133
185
|
}
|
|
134
186
|
return undefined;
|
|
135
187
|
},
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
import type { V1_PersistencePlatform } from './v1/model/packageableElements/persistence/V1_DSLPersistence_PersistencePlatform.js';
|
|
18
|
+
import type { PersistencePlatform } from '../../metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistencePlatform.js';
|
|
19
|
+
import type {
|
|
20
|
+
PureProtocolProcessorPlugin,
|
|
21
|
+
V1_GraphBuilderContext,
|
|
22
|
+
V1_GraphTransformerContext,
|
|
23
|
+
} from '@finos/legend-graph';
|
|
24
|
+
import type { PlainObject } from '@finos/legend-shared';
|
|
25
|
+
|
|
26
|
+
// types: persistence platform
|
|
27
|
+
|
|
28
|
+
export type V1_PersistencePlatformBuilder = (
|
|
29
|
+
protocol: V1_PersistencePlatform,
|
|
30
|
+
context: V1_GraphBuilderContext,
|
|
31
|
+
) => PersistencePlatform | undefined;
|
|
32
|
+
|
|
33
|
+
export type V1_PersistencePlatformTransformer = (
|
|
34
|
+
metamodel: PersistencePlatform,
|
|
35
|
+
context: V1_GraphTransformerContext,
|
|
36
|
+
) => V1_PersistencePlatform | undefined;
|
|
37
|
+
|
|
38
|
+
export type V1_PersistencePlatformProtocolSerializer = (
|
|
39
|
+
protocol: V1_PersistencePlatform,
|
|
40
|
+
) => PlainObject<V1_PersistencePlatform> | undefined;
|
|
41
|
+
|
|
42
|
+
export type V1_PersistencePlatformProtocolDeserializer = (
|
|
43
|
+
json: PlainObject<V1_PersistencePlatform>,
|
|
44
|
+
) => V1_PersistencePlatform | undefined;
|
|
45
|
+
|
|
46
|
+
export interface DSLPersistence_PureProtocolProcessorPlugin_Extension
|
|
47
|
+
extends PureProtocolProcessorPlugin {
|
|
48
|
+
// extension hooks: persistence platform
|
|
49
|
+
|
|
50
|
+
V1_getExtraPersistencePlatformBuilders?(): V1_PersistencePlatformBuilder[];
|
|
51
|
+
|
|
52
|
+
V1_getExtraPersistencePlatformTransformers?(): V1_PersistencePlatformTransformer[];
|
|
53
|
+
|
|
54
|
+
V1_getExtraPersistencePlatformProtocolSerializers?(): V1_PersistencePlatformProtocolSerializer[];
|
|
55
|
+
|
|
56
|
+
V1_getExtraPersistencePlatformProtocolDeserializers?(): V1_PersistencePlatformProtocolDeserializer[];
|
|
57
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
import { PERSISTENCE_HASH_STRUCTURE } from '../../../../../../DSLPersistence_ModelUtils.js';
|
|
18
|
+
import type { V1_PersistencePlatform } from './V1_DSLPersistence_PersistencePlatform.js';
|
|
19
|
+
import type { V1_ServiceParameter } from './V1_DSLPersistence_ServiceParameter.js';
|
|
20
|
+
import {
|
|
21
|
+
type V1_Connection,
|
|
22
|
+
V1_PackageableElement,
|
|
23
|
+
type V1_PackageableElementVisitor,
|
|
24
|
+
} from '@finos/legend-graph';
|
|
25
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
26
|
+
|
|
27
|
+
export class V1_PersistenceContext
|
|
28
|
+
extends V1_PackageableElement
|
|
29
|
+
implements Hashable
|
|
30
|
+
{
|
|
31
|
+
persistence!: string;
|
|
32
|
+
platform!: V1_PersistencePlatform;
|
|
33
|
+
serviceParameters: V1_ServiceParameter[] = [];
|
|
34
|
+
sinkConnection?: V1_Connection;
|
|
35
|
+
|
|
36
|
+
override get hashCode(): string {
|
|
37
|
+
return hashArray([
|
|
38
|
+
PERSISTENCE_HASH_STRUCTURE.PERSISTENCE_CONTEXT,
|
|
39
|
+
this.persistence,
|
|
40
|
+
this.platform,
|
|
41
|
+
hashArray(this.serviceParameters),
|
|
42
|
+
this.sinkConnection ?? '',
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
accept_PackageableElementVisitor<T>(
|
|
47
|
+
visitor: V1_PackageableElementVisitor<T>,
|
|
48
|
+
): T {
|
|
49
|
+
return visitor.visit_PackageableElement(this);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
import { PERSISTENCE_HASH_STRUCTURE } from '../../../../../../DSLPersistence_ModelUtils.js';
|
|
18
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
19
|
+
|
|
20
|
+
export abstract class V1_PersistencePlatform implements Hashable {
|
|
21
|
+
abstract get hashCode(): string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class V1_DefaultPersistencePlatform
|
|
25
|
+
extends V1_PersistencePlatform
|
|
26
|
+
implements Hashable
|
|
27
|
+
{
|
|
28
|
+
override get hashCode(): string {
|
|
29
|
+
return hashArray([PERSISTENCE_HASH_STRUCTURE.DEFAULT_PERSISTENCE_PLATFORM]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
import { PERSISTENCE_HASH_STRUCTURE } from '../../../../../../DSLPersistence_ModelUtils.js';
|
|
18
|
+
import type { V1_Connection, V1_ValueSpecification } from '@finos/legend-graph';
|
|
19
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
20
|
+
|
|
21
|
+
export class V1_ServiceParameter implements Hashable {
|
|
22
|
+
name!: string;
|
|
23
|
+
value!: V1_ServiceParameterValue;
|
|
24
|
+
|
|
25
|
+
get hashCode(): string {
|
|
26
|
+
return hashArray([
|
|
27
|
+
PERSISTENCE_HASH_STRUCTURE.SERVICE_PARAMETER,
|
|
28
|
+
this.name,
|
|
29
|
+
this.value,
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export abstract class V1_ServiceParameterValue implements Hashable {
|
|
35
|
+
abstract get hashCode(): string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class V1_PrimitiveTypeValue
|
|
39
|
+
extends V1_ServiceParameterValue
|
|
40
|
+
implements Hashable
|
|
41
|
+
{
|
|
42
|
+
primitiveType!: V1_ValueSpecification;
|
|
43
|
+
|
|
44
|
+
override get hashCode(): string {
|
|
45
|
+
return hashArray([
|
|
46
|
+
PERSISTENCE_HASH_STRUCTURE.PRIMITIVE_TYPE_VALUE_SERVICE_PARAMETER,
|
|
47
|
+
//TODO: ledav -- hash value specification
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export class V1_ConnectionValue
|
|
53
|
+
extends V1_ServiceParameterValue
|
|
54
|
+
implements Hashable
|
|
55
|
+
{
|
|
56
|
+
connection!: V1_Connection;
|
|
57
|
+
|
|
58
|
+
override get hashCode(): string {
|
|
59
|
+
return hashArray([
|
|
60
|
+
PERSISTENCE_HASH_STRUCTURE.CONNECTION_VALUE_SERVICE_PARAMETER,
|
|
61
|
+
this.connection,
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
}
|
package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Sink.ts
CHANGED
|
@@ -23,11 +23,15 @@ export abstract class V1_Sink implements Hashable {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export class V1_RelationalSink extends V1_Sink implements Hashable {
|
|
26
|
+
//TODO: ledav -- make required once persistence changes are rolled out in engine
|
|
27
|
+
database?: string;
|
|
28
|
+
//TODO: ledav -- remove once persistence changes are rolled out in engine
|
|
26
29
|
connection?: V1_Connection;
|
|
27
30
|
|
|
28
31
|
override get hashCode(): string {
|
|
29
32
|
return hashArray([
|
|
30
33
|
PERSISTENCE_HASH_STRUCTURE.RELATIONAL_SINK,
|
|
34
|
+
this.database ?? '',
|
|
31
35
|
this.connection ?? '',
|
|
32
36
|
]);
|
|
33
37
|
}
|
|
@@ -35,13 +39,14 @@ export class V1_RelationalSink extends V1_Sink implements Hashable {
|
|
|
35
39
|
|
|
36
40
|
export class V1_ObjectStorageSink extends V1_Sink implements Hashable {
|
|
37
41
|
binding!: string;
|
|
38
|
-
|
|
42
|
+
//TODO: ledav -- remove once persistence changes are rolled out in engine
|
|
43
|
+
connection?: V1_Connection;
|
|
39
44
|
|
|
40
45
|
override get hashCode(): string {
|
|
41
46
|
return hashArray([
|
|
42
47
|
PERSISTENCE_HASH_STRUCTURE.OBJECT_STORAGE_SINK,
|
|
43
48
|
this.binding,
|
|
44
|
-
this.connection,
|
|
49
|
+
this.connection ?? '',
|
|
45
50
|
]);
|
|
46
51
|
}
|
|
47
52
|
}
|
|
@@ -15,7 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import type { Persistence } from '../../../../../metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persistence.js';
|
|
18
|
-
import {
|
|
18
|
+
import type { PersistenceContext } from '../../../../../metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistenceContext.js';
|
|
19
|
+
import {
|
|
20
|
+
getPersistence,
|
|
21
|
+
getPersistenceContext,
|
|
22
|
+
} from '../../../../../../graphManager/DSLPersistence_GraphManagerHelper.js';
|
|
19
23
|
import type {
|
|
20
24
|
PackageableElementImplicitReference,
|
|
21
25
|
V1_GraphBuilderContext,
|
|
@@ -28,3 +32,11 @@ export const V1_resolvePersistence = (
|
|
|
28
32
|
context.createImplicitPackageableElementReference(path, (_path: string) =>
|
|
29
33
|
getPersistence(_path, context.graph),
|
|
30
34
|
);
|
|
35
|
+
|
|
36
|
+
export const V1_resolvePersistenceContext = (
|
|
37
|
+
path: string,
|
|
38
|
+
context: V1_GraphBuilderContext,
|
|
39
|
+
): PackageableElementImplicitReference<PersistenceContext> =>
|
|
40
|
+
context.createImplicitPackageableElementReference(path, (_path: string) =>
|
|
41
|
+
getPersistenceContext(_path, context.graph),
|
|
42
|
+
);
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
import type { PersistenceContext } from '../../../../../../metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistenceContext.js';
|
|
18
|
+
import {
|
|
19
|
+
type PersistencePlatform,
|
|
20
|
+
DefaultPersistencePlatform,
|
|
21
|
+
} from '../../../../../../metamodels/pure/model/packageableElements/persistence/DSLPersistence_PersistencePlatform.js';
|
|
22
|
+
import {
|
|
23
|
+
ConnectionValue,
|
|
24
|
+
PrimitiveTypeValue,
|
|
25
|
+
type ServiceParameter,
|
|
26
|
+
type ServiceParameterValue,
|
|
27
|
+
} from '../../../../../../metamodels/pure/model/packageableElements/persistence/DSLPersistence_ServiceParameter.js';
|
|
28
|
+
import { V1_PersistenceContext } from '../../../model/packageableElements/persistence/V1_DSLPersistence_PersistenceContext.js';
|
|
29
|
+
import {
|
|
30
|
+
V1_DefaultPersistencePlatform,
|
|
31
|
+
type V1_PersistencePlatform,
|
|
32
|
+
} from '../../../model/packageableElements/persistence/V1_DSLPersistence_PersistencePlatform.js';
|
|
33
|
+
import {
|
|
34
|
+
V1_ConnectionValue,
|
|
35
|
+
V1_PrimitiveTypeValue,
|
|
36
|
+
V1_ServiceParameter,
|
|
37
|
+
type V1_ServiceParameterValue,
|
|
38
|
+
} from '../../../model/packageableElements/persistence/V1_DSLPersistence_ServiceParameter.js';
|
|
39
|
+
import type { DSLPersistence_PureProtocolProcessorPlugin_Extension } from '../../../../DSLPersistence_PureProtocolProcessorPlugin_Extension.js';
|
|
40
|
+
import {
|
|
41
|
+
type V1_GraphTransformerContext,
|
|
42
|
+
V1_initPackageableElement,
|
|
43
|
+
V1_transformConnection,
|
|
44
|
+
V1_transformRootValueSpecification,
|
|
45
|
+
} from '@finos/legend-graph';
|
|
46
|
+
import { UnsupportedOperationError } from '@finos/legend-shared';
|
|
47
|
+
|
|
48
|
+
/**********
|
|
49
|
+
* persistence platform
|
|
50
|
+
**********/
|
|
51
|
+
|
|
52
|
+
export const V1_transformPersistencePlatform = (
|
|
53
|
+
element: PersistencePlatform,
|
|
54
|
+
context: V1_GraphTransformerContext,
|
|
55
|
+
): V1_PersistencePlatform => {
|
|
56
|
+
if (element instanceof DefaultPersistencePlatform) {
|
|
57
|
+
return new V1_DefaultPersistencePlatform();
|
|
58
|
+
}
|
|
59
|
+
const extraPersistencePlatformTransformers = context.plugins.flatMap(
|
|
60
|
+
(plugin) =>
|
|
61
|
+
(
|
|
62
|
+
plugin as DSLPersistence_PureProtocolProcessorPlugin_Extension
|
|
63
|
+
).V1_getExtraPersistencePlatformTransformers?.() ?? [],
|
|
64
|
+
);
|
|
65
|
+
for (const transformer of extraPersistencePlatformTransformers) {
|
|
66
|
+
const protocol = transformer(element, context);
|
|
67
|
+
if (protocol) {
|
|
68
|
+
return protocol;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
throw new UnsupportedOperationError(
|
|
72
|
+
`Can't transform persistence platform: no compatible transformer available from plugins`,
|
|
73
|
+
element,
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**********
|
|
78
|
+
* service parameter
|
|
79
|
+
**********/
|
|
80
|
+
|
|
81
|
+
export const V1_transformServiceParameterValue = (
|
|
82
|
+
element: ServiceParameterValue,
|
|
83
|
+
context: V1_GraphTransformerContext,
|
|
84
|
+
): V1_ServiceParameterValue => {
|
|
85
|
+
if (element instanceof PrimitiveTypeValue) {
|
|
86
|
+
const protocol = new V1_PrimitiveTypeValue();
|
|
87
|
+
protocol.primitiveType = V1_transformRootValueSpecification(
|
|
88
|
+
element.primitiveType,
|
|
89
|
+
);
|
|
90
|
+
return protocol;
|
|
91
|
+
} else if (element instanceof ConnectionValue) {
|
|
92
|
+
const protocol = new V1_ConnectionValue();
|
|
93
|
+
protocol.connection = V1_transformConnection(
|
|
94
|
+
element.connection,
|
|
95
|
+
true,
|
|
96
|
+
context,
|
|
97
|
+
);
|
|
98
|
+
return protocol;
|
|
99
|
+
}
|
|
100
|
+
throw new UnsupportedOperationError(
|
|
101
|
+
`Can't transform service parameter value '${element}'`,
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const V1_transformServiceParameter = (
|
|
106
|
+
element: ServiceParameter,
|
|
107
|
+
context: V1_GraphTransformerContext,
|
|
108
|
+
): V1_ServiceParameter => {
|
|
109
|
+
const protocol = new V1_ServiceParameter();
|
|
110
|
+
protocol.name = element.name;
|
|
111
|
+
protocol.value = V1_transformServiceParameterValue(element.value, context);
|
|
112
|
+
return protocol;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**********
|
|
116
|
+
* persistence context
|
|
117
|
+
**********/
|
|
118
|
+
|
|
119
|
+
export const V1_transformPersistenceContext = (
|
|
120
|
+
element: PersistenceContext,
|
|
121
|
+
context: V1_GraphTransformerContext,
|
|
122
|
+
): V1_PersistenceContext => {
|
|
123
|
+
const protocol = new V1_PersistenceContext();
|
|
124
|
+
V1_initPackageableElement(protocol, element);
|
|
125
|
+
protocol.persistence = element.persistence.valueForSerialization ?? '';
|
|
126
|
+
protocol.platform = V1_transformPersistencePlatform(
|
|
127
|
+
element.platform,
|
|
128
|
+
context,
|
|
129
|
+
);
|
|
130
|
+
protocol.serviceParameters = element.serviceParameters.map((sp) =>
|
|
131
|
+
V1_transformServiceParameter(sp, context),
|
|
132
|
+
);
|
|
133
|
+
if (element.sinkConnection) {
|
|
134
|
+
protocol.sinkConnection = V1_transformConnection(
|
|
135
|
+
element.sinkConnection,
|
|
136
|
+
true,
|
|
137
|
+
context,
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
return protocol;
|
|
141
|
+
};
|
package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceTransformer.ts
CHANGED
|
@@ -192,6 +192,9 @@ export const V1_transformRelationalSink = (
|
|
|
192
192
|
context: V1_GraphTransformerContext,
|
|
193
193
|
): V1_RelationalSink => {
|
|
194
194
|
const protocol = new V1_RelationalSink();
|
|
195
|
+
if (element.database) {
|
|
196
|
+
protocol.database = element.database.value.path;
|
|
197
|
+
}
|
|
195
198
|
if (element.connection) {
|
|
196
199
|
protocol.connection = V1_transformConnection(
|
|
197
200
|
element.connection,
|
|
@@ -207,12 +210,14 @@ export const V1_transformObjectStorageSink = (
|
|
|
207
210
|
context: V1_GraphTransformerContext,
|
|
208
211
|
): V1_ObjectStorageSink => {
|
|
209
212
|
const protocol = new V1_ObjectStorageSink();
|
|
210
|
-
protocol.connection = V1_transformConnection(
|
|
211
|
-
element.connection,
|
|
212
|
-
true,
|
|
213
|
-
context,
|
|
214
|
-
);
|
|
215
213
|
protocol.binding = element.binding.value.path;
|
|
214
|
+
if (element.connection) {
|
|
215
|
+
protocol.connection = V1_transformConnection(
|
|
216
|
+
element.connection,
|
|
217
|
+
true,
|
|
218
|
+
context,
|
|
219
|
+
);
|
|
220
|
+
}
|
|
216
221
|
return protocol;
|
|
217
222
|
};
|
|
218
223
|
|
|
@@ -489,7 +494,7 @@ export const V1_transformFlatTarget = (
|
|
|
489
494
|
context: V1_GraphTransformerContext,
|
|
490
495
|
): V1_FlatTarget => {
|
|
491
496
|
const protocol = new V1_FlatTarget();
|
|
492
|
-
protocol.modelClass = element.modelClass
|
|
497
|
+
protocol.modelClass = element.modelClass?.valueForSerialization;
|
|
493
498
|
protocol.targetName = element.targetName;
|
|
494
499
|
protocol.partitionFields = element.partitionFields;
|
|
495
500
|
protocol.deduplicationStrategy = V1_transformDeduplicationStrategy(
|
|
@@ -156,11 +156,11 @@ import {
|
|
|
156
156
|
import { getOwnPersistence } from '../../../../../../../graphManager/DSLPersistence_GraphManagerHelper.js';
|
|
157
157
|
import {
|
|
158
158
|
type Binding,
|
|
159
|
+
type Database,
|
|
159
160
|
type PackageableElementImplicitReference,
|
|
160
161
|
type V1_GraphBuilderContext,
|
|
161
|
-
V1_ProtocolToMetaModelConnectionBuilder,
|
|
162
162
|
V1_buildFullPath,
|
|
163
|
-
|
|
163
|
+
V1_buildConnection,
|
|
164
164
|
} from '@finos/legend-graph';
|
|
165
165
|
import {
|
|
166
166
|
guaranteeNonEmptyString,
|
|
@@ -198,10 +198,14 @@ export const V1_buildRelationalSink = (
|
|
|
198
198
|
context: V1_GraphBuilderContext,
|
|
199
199
|
): RelationalSink => {
|
|
200
200
|
const sink = new RelationalSink();
|
|
201
|
+
if (protocol.database) {
|
|
202
|
+
sink.database = context.resolveElement(
|
|
203
|
+
protocol.database,
|
|
204
|
+
false,
|
|
205
|
+
) as PackageableElementImplicitReference<Database>;
|
|
206
|
+
}
|
|
201
207
|
if (protocol.connection) {
|
|
202
|
-
sink.connection = protocol.connection
|
|
203
|
-
new V1_ProtocolToMetaModelConnectionBuilder(context),
|
|
204
|
-
);
|
|
208
|
+
sink.connection = V1_buildConnection(protocol.connection, context);
|
|
205
209
|
}
|
|
206
210
|
return sink;
|
|
207
211
|
};
|
|
@@ -211,13 +215,13 @@ export const V1_buildObjectStorageSink = (
|
|
|
211
215
|
context: V1_GraphBuilderContext,
|
|
212
216
|
): ObjectStorageSink => {
|
|
213
217
|
const sink = new ObjectStorageSink();
|
|
214
|
-
sink.connection = protocol.connection.accept_ConnectionVisitor(
|
|
215
|
-
new V1_ProtocolToMetaModelConnectionBuilder(context),
|
|
216
|
-
);
|
|
217
218
|
sink.binding = context.resolveElement(
|
|
218
219
|
protocol.binding,
|
|
219
220
|
false,
|
|
220
221
|
) as PackageableElementImplicitReference<Binding>;
|
|
222
|
+
if (protocol.connection) {
|
|
223
|
+
sink.connection = V1_buildConnection(protocol.connection, context);
|
|
224
|
+
}
|
|
221
225
|
return sink;
|
|
222
226
|
};
|
|
223
227
|
|
|
@@ -496,10 +500,9 @@ export const V1_buildFlatTarget = (
|
|
|
496
500
|
context: V1_GraphBuilderContext,
|
|
497
501
|
): FlatTarget => {
|
|
498
502
|
const targetShape = new FlatTarget();
|
|
499
|
-
targetShape.modelClass =
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
+
targetShape.modelClass = modelClass
|
|
504
|
+
? context.resolveClass(modelClass)
|
|
505
|
+
: undefined;
|
|
503
506
|
targetShape.targetName = guaranteeNonEmptyString(protocol.targetName);
|
|
504
507
|
targetShape.partitionFields = protocol.partitionFields;
|
|
505
508
|
targetShape.deduplicationStrategy = V1_buildDeduplicationStrategy(
|