@finos/legend-extension-dsl-data-space 3.0.4 → 4.0.0
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/DataSpaceViewer.d.ts.map +1 -1
- package/lib/components/DataSpaceViewer.js +5 -6
- package/lib/components/DataSpaceViewer.js.map +1 -1
- package/lib/components/query/DataSpaceQuerySetup.js +3 -3
- package/lib/components/query/DataSpaceQuerySetup.js.map +1 -1
- package/lib/components/studio/DSLDataSpace_CodeSnippets.d.ts +1 -1
- package/lib/components/studio/DSLDataSpace_CodeSnippets.d.ts.map +1 -1
- package/lib/components/studio/DSLDataSpace_CodeSnippets.js +0 -3
- package/lib/components/studio/DSLDataSpace_CodeSnippets.js.map +1 -1
- package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.d.ts.map +1 -1
- package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.js +5 -8
- package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.d.ts +5 -7
- package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.d.ts.map +1 -1
- package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js +4 -10
- package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js.map +1 -1
- package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts +1 -36
- package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js +9 -93
- package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.d.ts +0 -3
- package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.js +0 -6
- package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js +2 -5
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js.map +1 -1
- package/lib/package.json +3 -3
- package/lib/stores/DataSpaceViewerState.d.ts +8 -8
- package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
- package/lib/stores/DataSpaceViewerState.js +9 -9
- package/lib/stores/DataSpaceViewerState.js.map +1 -1
- package/lib/stores/query/DataSpaceQuerySetupState.d.ts +6 -12
- package/lib/stores/query/DataSpaceQuerySetupState.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQuerySetupState.js +10 -17
- package/lib/stores/query/DataSpaceQuerySetupState.js.map +1 -1
- package/package.json +13 -13
- package/src/components/DataSpaceViewer.tsx +18 -47
- package/src/components/query/DataSpaceQuerySetup.tsx +5 -5
- package/src/components/studio/DSLDataSpace_CodeSnippets.ts +0 -3
- package/src/components/studio/DSLDataSpace_LegendStudioPlugin.tsx +12 -9
- package/src/index.ts +2 -1
- package/src/models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.ts +14 -12
- package/src/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.ts +15 -170
- package/src/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.ts +0 -6
- package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.ts +2 -4
- package/src/stores/DataSpaceViewerState.ts +18 -18
- package/src/stores/query/DataSpaceQuerySetupState.ts +30 -61
package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.ts
CHANGED
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
UnsupportedOperationError,
|
|
38
38
|
usingConstantValueSchema,
|
|
39
39
|
usingModelSchema,
|
|
40
|
+
optionalCustom,
|
|
40
41
|
} from '@finos/legend-shared';
|
|
41
42
|
import {
|
|
42
43
|
type V1_DataSpaceSupportInfo,
|
|
@@ -96,11 +97,10 @@ const V1_deserializeSupportInfo = (
|
|
|
96
97
|
|
|
97
98
|
export const V1_dataSpaceModelSchema = createModelSchema(V1_DataSpace, {
|
|
98
99
|
_type: usingConstantValueSchema(V1_DATA_SPACE_ELEMENT_PROTOCOL_TYPE),
|
|
99
|
-
artifactId: primitive(),
|
|
100
100
|
defaultExecutionContext: primitive(),
|
|
101
101
|
description: optional(primitive()),
|
|
102
102
|
executionContexts: list(object(V1_dataSpaceExecutionContextModelSchema)),
|
|
103
|
-
featuredDiagrams:
|
|
103
|
+
featuredDiagrams: optionalCustom(
|
|
104
104
|
(values) =>
|
|
105
105
|
serializeArray(
|
|
106
106
|
values,
|
|
@@ -121,7 +121,6 @@ export const V1_dataSpaceModelSchema = createModelSchema(V1_DataSpace, {
|
|
|
121
121
|
},
|
|
122
122
|
),
|
|
123
123
|
),
|
|
124
|
-
groupId: primitive(),
|
|
125
124
|
name: primitive(),
|
|
126
125
|
package: primitive(),
|
|
127
126
|
stereotypes: custom(
|
|
@@ -158,5 +157,4 @@ export const V1_dataSpaceModelSchema = createModelSchema(V1_DataSpace, {
|
|
|
158
157
|
skipIfEmpty: false,
|
|
159
158
|
}),
|
|
160
159
|
),
|
|
161
|
-
versionId: primitive(),
|
|
162
160
|
});
|
|
@@ -28,9 +28,9 @@ import type {
|
|
|
28
28
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
29
29
|
import { action, computed, makeObservable, observable } from 'mobx';
|
|
30
30
|
import type {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} from '../models/
|
|
31
|
+
DataSpace,
|
|
32
|
+
DataSpaceExecutionContext,
|
|
33
|
+
} from '../models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
|
|
34
34
|
|
|
35
35
|
export enum DATA_SPACE_VIEWER_ACTIVITY_MODE {
|
|
36
36
|
MODELS_OVERVIEW = 'MODELS_OVERVIEW',
|
|
@@ -44,14 +44,14 @@ export enum DATA_SPACE_VIEWER_ACTIVITY_MODE {
|
|
|
44
44
|
|
|
45
45
|
export class DataSpaceViewerState {
|
|
46
46
|
graphManagerState: GraphManagerState;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
dataSpace:
|
|
47
|
+
groupId: string;
|
|
48
|
+
artifactId: string;
|
|
49
|
+
versionId: string;
|
|
50
|
+
dataSpace: DataSpace;
|
|
51
51
|
_renderer?: DiagramRenderer | undefined;
|
|
52
52
|
currentDiagram?: Diagram | undefined;
|
|
53
53
|
currentActivity = DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS_OVERVIEW;
|
|
54
|
-
currentExecutionContext:
|
|
54
|
+
currentExecutionContext: DataSpaceExecutionContext;
|
|
55
55
|
currentRuntime: PackageableRuntime;
|
|
56
56
|
viewProject?:
|
|
57
57
|
| ((
|
|
@@ -65,10 +65,10 @@ export class DataSpaceViewerState {
|
|
|
65
65
|
|
|
66
66
|
constructor(
|
|
67
67
|
graphManagerState: GraphManagerState,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
dataSpace:
|
|
68
|
+
groupId: string,
|
|
69
|
+
artifactId: string,
|
|
70
|
+
versionId: string,
|
|
71
|
+
dataSpace: DataSpace,
|
|
72
72
|
options?: {
|
|
73
73
|
viewProject?: (
|
|
74
74
|
groupId: string,
|
|
@@ -95,13 +95,13 @@ export class DataSpaceViewerState {
|
|
|
95
95
|
|
|
96
96
|
this.graphManagerState = graphManagerState;
|
|
97
97
|
this.dataSpace = dataSpace;
|
|
98
|
-
this.
|
|
99
|
-
this.
|
|
100
|
-
this.
|
|
98
|
+
this.groupId = groupId;
|
|
99
|
+
this.artifactId = artifactId;
|
|
100
|
+
this.versionId = versionId;
|
|
101
101
|
this.currentExecutionContext = this.dataSpace.defaultExecutionContext;
|
|
102
102
|
this.currentRuntime =
|
|
103
103
|
this.dataSpace.defaultExecutionContext.defaultRuntime.value;
|
|
104
|
-
this.currentDiagram = this.dataSpace.featuredDiagrams
|
|
104
|
+
this.currentDiagram = this.dataSpace.featuredDiagrams?.length
|
|
105
105
|
? (
|
|
106
106
|
this.dataSpace
|
|
107
107
|
.featuredDiagrams[0] as PackageableElementReference<Diagram>
|
|
@@ -125,7 +125,7 @@ export class DataSpaceViewerState {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
get featuredDiagrams(): Diagram[] {
|
|
128
|
-
return this.dataSpace.featuredDiagrams
|
|
128
|
+
return this.dataSpace.featuredDiagrams?.map((ref) => ref.value) ?? [];
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
get diagrams(): Diagram[] {
|
|
@@ -183,7 +183,7 @@ export class DataSpaceViewerState {
|
|
|
183
183
|
this.currentActivity = val;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
setCurrentExecutionContext(val:
|
|
186
|
+
setCurrentExecutionContext(val: DataSpaceExecutionContext): void {
|
|
187
187
|
this.currentExecutionContext = val;
|
|
188
188
|
this.currentRuntime = val.defaultRuntime.value;
|
|
189
189
|
}
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
import type { ClassView } from '@finos/legend-extension-dsl-diagram';
|
|
18
18
|
import { type Class, QueryTaggedValue } from '@finos/legend-graph';
|
|
19
|
-
import type { Entity } from '@finos/legend-model-storage';
|
|
20
19
|
import {
|
|
21
20
|
type QuerySetupStore,
|
|
22
21
|
CreateQueryInfoState,
|
|
@@ -35,26 +34,18 @@ import {
|
|
|
35
34
|
type PlainObject,
|
|
36
35
|
ActionState,
|
|
37
36
|
assertErrorThrown,
|
|
38
|
-
guaranteeNonNullable,
|
|
39
37
|
} from '@finos/legend-shared';
|
|
40
38
|
import { action, flow, flowResult, makeObservable, observable } from 'mobx';
|
|
41
|
-
import {
|
|
42
|
-
|
|
43
|
-
getResolvedDataSpace,
|
|
44
|
-
} from '../../models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js';
|
|
39
|
+
import { getDataSpace } from '../../graphManager/DSLDataSpace_GraphManagerHelper.js';
|
|
40
|
+
import { DATA_SPACE_ELEMENT_CLASSIFIER_PATH } from '../../models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js';
|
|
45
41
|
import { DataSpaceViewerState } from '../DataSpaceViewerState.js';
|
|
46
42
|
|
|
47
|
-
export
|
|
43
|
+
export interface DataSpaceContext {
|
|
48
44
|
groupId: string;
|
|
49
45
|
artifactId: string;
|
|
50
46
|
versionId: string;
|
|
51
47
|
path: string;
|
|
52
|
-
|
|
53
|
-
groupId: string;
|
|
54
|
-
artifactId: string;
|
|
55
|
-
versionId: string;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
48
|
+
}
|
|
58
49
|
|
|
59
50
|
const QUERY_PROFILE_PATH = 'meta::pure::profiles::query';
|
|
60
51
|
const QUERY_PROFILE_TAG_DATA_SPACE = 'dataSpace';
|
|
@@ -78,10 +69,10 @@ export const createQueryDataSpaceTaggedValue = (
|
|
|
78
69
|
};
|
|
79
70
|
|
|
80
71
|
export class DataSpaceQuerySetupState extends QuerySetupState {
|
|
81
|
-
dataSpaces:
|
|
72
|
+
dataSpaces: DataSpaceContext[] = [];
|
|
82
73
|
loadDataSpacesState = ActionState.create();
|
|
83
74
|
setUpDataSpaceState = ActionState.create();
|
|
84
|
-
currentDataSpace?:
|
|
75
|
+
currentDataSpace?: DataSpaceContext | undefined;
|
|
85
76
|
dataSpaceViewerState?: DataSpaceViewerState | undefined;
|
|
86
77
|
toGetSnapShot = false;
|
|
87
78
|
|
|
@@ -102,7 +93,7 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
|
|
|
102
93
|
});
|
|
103
94
|
}
|
|
104
95
|
|
|
105
|
-
setCurrentDataSpace(val:
|
|
96
|
+
setCurrentDataSpace(val: DataSpaceContext | undefined): void {
|
|
106
97
|
this.currentDataSpace = val;
|
|
107
98
|
}
|
|
108
99
|
|
|
@@ -134,33 +125,14 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
|
|
|
134
125
|
limit: 10,
|
|
135
126
|
},
|
|
136
127
|
)) as StoredEntity[]
|
|
137
|
-
).map(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
: storedEntity.versionId,
|
|
146
|
-
path: storedEntity.entity.path,
|
|
147
|
-
content: {
|
|
148
|
-
...storedEntity.entity.content,
|
|
149
|
-
groupId: guaranteeNonNullable(
|
|
150
|
-
storedEntity.entity.content.groupId,
|
|
151
|
-
`Data space 'groupId' field is missing`,
|
|
152
|
-
),
|
|
153
|
-
artifactId: guaranteeNonNullable(
|
|
154
|
-
storedEntity.entity.content.artifactId,
|
|
155
|
-
`Data space 'artifactId' field is missing`,
|
|
156
|
-
),
|
|
157
|
-
versionId: guaranteeNonNullable(
|
|
158
|
-
storedEntity.entity.content.versionId,
|
|
159
|
-
`Data space 'versionId' field is missing`,
|
|
160
|
-
),
|
|
161
|
-
},
|
|
162
|
-
} as LightDataSpace),
|
|
163
|
-
);
|
|
128
|
+
).map((storedEntity) => ({
|
|
129
|
+
groupId: storedEntity.groupId,
|
|
130
|
+
artifactId: storedEntity.artifactId,
|
|
131
|
+
versionId: this.toGetSnapShot
|
|
132
|
+
? SNAPSHOT_VERSION_ALIAS
|
|
133
|
+
: storedEntity.versionId,
|
|
134
|
+
path: storedEntity.entity.path,
|
|
135
|
+
}));
|
|
164
136
|
this.loadDataSpacesState.pass();
|
|
165
137
|
} catch (error) {
|
|
166
138
|
assertErrorThrown(error);
|
|
@@ -169,7 +141,7 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
|
|
|
169
141
|
}
|
|
170
142
|
}
|
|
171
143
|
|
|
172
|
-
*setUpDataSpace(dataSpace:
|
|
144
|
+
*setUpDataSpace(dataSpace: DataSpaceContext): GeneratorFn<void> {
|
|
173
145
|
if (this.queryStore.initState.isInInitialState) {
|
|
174
146
|
yield flowResult(this.queryStore.initialize());
|
|
175
147
|
} else if (this.queryStore.initState.isInProgress) {
|
|
@@ -180,25 +152,22 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
|
|
|
180
152
|
const projectData = ProjectData.serialization.fromJson(
|
|
181
153
|
(yield flowResult(
|
|
182
154
|
this.queryStore.depotServerClient.getProject(
|
|
183
|
-
dataSpace.
|
|
184
|
-
dataSpace.
|
|
155
|
+
dataSpace.groupId,
|
|
156
|
+
dataSpace.artifactId,
|
|
185
157
|
),
|
|
186
158
|
)) as PlainObject<ProjectData>,
|
|
187
159
|
);
|
|
188
160
|
|
|
189
161
|
yield flowResult(
|
|
190
|
-
this.queryStore.buildGraph(projectData, dataSpace.
|
|
191
|
-
);
|
|
192
|
-
const resolvedDataSpace = getResolvedDataSpace(
|
|
193
|
-
dataSpace.content,
|
|
194
|
-
this.queryStore.graphManagerState.graph,
|
|
162
|
+
this.queryStore.buildGraph(projectData, dataSpace.versionId),
|
|
195
163
|
);
|
|
164
|
+
|
|
196
165
|
this.dataSpaceViewerState = new DataSpaceViewerState(
|
|
197
166
|
this.queryStore.graphManagerState,
|
|
198
167
|
dataSpace.groupId,
|
|
199
168
|
dataSpace.artifactId,
|
|
200
169
|
dataSpace.versionId,
|
|
201
|
-
|
|
170
|
+
getDataSpace(dataSpace.path, this.queryStore.graphManagerState.graph),
|
|
202
171
|
{
|
|
203
172
|
viewProject: (
|
|
204
173
|
groupId: string,
|
|
@@ -230,32 +199,32 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
|
|
|
230
199
|
const projectData = ProjectData.serialization.fromJson(
|
|
231
200
|
(yield flowResult(
|
|
232
201
|
this.queryStore.depotServerClient.getProject(
|
|
233
|
-
this.dataSpaceViewerState.
|
|
234
|
-
this.dataSpaceViewerState.
|
|
202
|
+
this.dataSpaceViewerState.groupId,
|
|
203
|
+
this.dataSpaceViewerState.artifactId,
|
|
235
204
|
),
|
|
236
205
|
)) as PlainObject<ProjectData>,
|
|
237
206
|
);
|
|
238
207
|
const queryInfoState = new CreateQueryInfoState(
|
|
239
208
|
this.queryStore,
|
|
240
209
|
projectData,
|
|
241
|
-
this.dataSpaceViewerState.
|
|
210
|
+
this.dataSpaceViewerState.versionId,
|
|
242
211
|
this.dataSpaceViewerState.currentExecutionContext.mapping.value,
|
|
243
212
|
this.dataSpaceViewerState.currentRuntime,
|
|
244
213
|
);
|
|
245
214
|
queryInfoState.taggedValues = [
|
|
246
215
|
createQueryDataSpaceTaggedValue(
|
|
247
216
|
this.dataSpaceViewerState.dataSpace.path,
|
|
248
|
-
this.dataSpaceViewerState.
|
|
249
|
-
this.dataSpaceViewerState.
|
|
250
|
-
this.dataSpaceViewerState.
|
|
217
|
+
this.dataSpaceViewerState.groupId,
|
|
218
|
+
this.dataSpaceViewerState.artifactId,
|
|
219
|
+
this.dataSpaceViewerState.versionId,
|
|
251
220
|
),
|
|
252
221
|
];
|
|
253
222
|
this.queryStore.setQueryInfoState(queryInfoState);
|
|
254
223
|
this.queryStore.applicationStore.navigator.goTo(
|
|
255
224
|
generateCreateQueryRoute(
|
|
256
|
-
this.dataSpaceViewerState.
|
|
257
|
-
this.dataSpaceViewerState.
|
|
258
|
-
this.dataSpaceViewerState.
|
|
225
|
+
this.dataSpaceViewerState.groupId,
|
|
226
|
+
this.dataSpaceViewerState.artifactId,
|
|
227
|
+
this.dataSpaceViewerState.versionId,
|
|
259
228
|
this.dataSpaceViewerState.currentExecutionContext.mapping.value.path,
|
|
260
229
|
this.dataSpaceViewerState.currentRuntime.path,
|
|
261
230
|
_class?.path,
|