@finos/legend-extension-dsl-data-space 3.0.3 → 4.0.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/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_LegendStudioDocumentation.d.ts +0 -2
- package/lib/components/studio/DSLDataSpace_LegendStudioDocumentation.d.ts.map +1 -1
- package/lib/components/studio/DSLDataSpace_LegendStudioDocumentation.js +0 -14
- package/lib/components/studio/DSLDataSpace_LegendStudioDocumentation.js.map +1 -1
- package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.d.ts +1 -2
- package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.d.ts.map +1 -1
- package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.js +11 -13
- 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 +6 -6
- 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 +16 -16
- 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_LegendStudioDocumentation.ts +0 -20
- package/src/components/studio/DSLDataSpace_LegendStudioPlugin.tsx +19 -23
- 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
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
} from './v1/model/packageableElements/dataSpace/V1_DSLDataSpace_DataSpace.js';
|
|
24
24
|
import {
|
|
25
25
|
type PlainObject,
|
|
26
|
-
uuid,
|
|
27
26
|
guaranteeNonEmptyString,
|
|
28
27
|
guaranteeNonNullable,
|
|
29
28
|
UnsupportedOperationError,
|
|
@@ -37,17 +36,12 @@ import {
|
|
|
37
36
|
} from './v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js';
|
|
38
37
|
import { getOwnDataSpace } from '../../../graphManager/DSLDataSpace_GraphManagerHelper.js';
|
|
39
38
|
import {
|
|
40
|
-
type DataSpaceSupportInfo,
|
|
41
39
|
DataSpace,
|
|
42
40
|
DataSpaceExecutionContext,
|
|
43
41
|
DataSpaceSupportEmail,
|
|
44
42
|
} from '../../metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
|
|
45
43
|
import {
|
|
46
|
-
type Mapping,
|
|
47
44
|
type PackageableElement,
|
|
48
|
-
type PackageableElementReference,
|
|
49
|
-
type PackageableRuntime,
|
|
50
|
-
type PureModel,
|
|
51
45
|
type V1_ElementProtocolClassifierPathGetter,
|
|
52
46
|
type V1_ElementProtocolDeserializer,
|
|
53
47
|
type V1_ElementProtocolSerializer,
|
|
@@ -67,11 +61,9 @@ import {
|
|
|
67
61
|
PureProtocolProcessorPlugin,
|
|
68
62
|
V1_ElementBuilder,
|
|
69
63
|
V1_initPackageableElement,
|
|
70
|
-
V1_StereotypePtr,
|
|
71
64
|
V1_buildFullPath,
|
|
72
65
|
} from '@finos/legend-graph';
|
|
73
66
|
import {
|
|
74
|
-
type Diagram,
|
|
75
67
|
V1_DSLDiagram_PackageableElementPointerType,
|
|
76
68
|
getDiagram,
|
|
77
69
|
} from '@finos/legend-extension-dsl-diagram';
|
|
@@ -125,18 +117,6 @@ export class DSLDataSpace_PureProtocolProcessorPlugin extends PureProtocolProces
|
|
|
125
117
|
element.taggedValues = elementProtocol.taggedValues
|
|
126
118
|
.map((taggedValue) => V1_buildTaggedValue(taggedValue, context))
|
|
127
119
|
.filter(isNonNullable);
|
|
128
|
-
element.groupId = guaranteeNonEmptyString(
|
|
129
|
-
elementProtocol.groupId,
|
|
130
|
-
`Data space 'groupId' field is missing or empty`,
|
|
131
|
-
);
|
|
132
|
-
element.artifactId = guaranteeNonEmptyString(
|
|
133
|
-
elementProtocol.artifactId,
|
|
134
|
-
`Data space 'artifactId' field is missing or empty`,
|
|
135
|
-
);
|
|
136
|
-
element.versionId = guaranteeNonEmptyString(
|
|
137
|
-
elementProtocol.versionId,
|
|
138
|
-
`Data space 'versionId' field is missing or empty`,
|
|
139
|
-
);
|
|
140
120
|
element.executionContexts = guaranteeNonNullable(
|
|
141
121
|
elementProtocol.executionContexts,
|
|
142
122
|
`Data space 'executionContexts' field is missing`,
|
|
@@ -147,14 +127,13 @@ export class DSLDataSpace_PureProtocolProcessorPlugin extends PureProtocolProces
|
|
|
147
127
|
`Data space execution context 'name' field is missing or empty`,
|
|
148
128
|
);
|
|
149
129
|
execContext.description = contextProtocol.description;
|
|
150
|
-
execContext.mapping =
|
|
151
|
-
contextProtocol.mapping,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
).path;
|
|
130
|
+
execContext.mapping = PackageableElementExplicitReference.create(
|
|
131
|
+
context.graph.getMapping(contextProtocol.mapping.path),
|
|
132
|
+
);
|
|
133
|
+
execContext.defaultRuntime =
|
|
134
|
+
PackageableElementExplicitReference.create(
|
|
135
|
+
context.graph.getRuntime(contextProtocol.defaultRuntime.path),
|
|
136
|
+
);
|
|
158
137
|
return execContext;
|
|
159
138
|
});
|
|
160
139
|
element.defaultExecutionContext = guaranteeNonNullable(
|
|
@@ -171,7 +150,10 @@ export class DSLDataSpace_PureProtocolProcessorPlugin extends PureProtocolProces
|
|
|
171
150
|
element.description = elementProtocol.description;
|
|
172
151
|
if (elementProtocol.featuredDiagrams) {
|
|
173
152
|
element.featuredDiagrams = elementProtocol.featuredDiagrams.map(
|
|
174
|
-
(pointer) =>
|
|
153
|
+
(pointer) =>
|
|
154
|
+
PackageableElementExplicitReference.create(
|
|
155
|
+
getDiagram(pointer.path, context.graph),
|
|
156
|
+
),
|
|
175
157
|
);
|
|
176
158
|
}
|
|
177
159
|
if (elementProtocol.supportInfo) {
|
|
@@ -254,9 +236,6 @@ export class DSLDataSpace_PureProtocolProcessorPlugin extends PureProtocolProces
|
|
|
254
236
|
protocol.taggedValues = metamodel.taggedValues.map(
|
|
255
237
|
V1_transformTaggedValue,
|
|
256
238
|
);
|
|
257
|
-
protocol.groupId = metamodel.groupId;
|
|
258
|
-
protocol.artifactId = metamodel.artifactId;
|
|
259
|
-
protocol.versionId = metamodel.versionId;
|
|
260
239
|
protocol.executionContexts = metamodel.executionContexts.map(
|
|
261
240
|
(execContext) => {
|
|
262
241
|
const contextProtocol = new V1_DataSpaceExecutionContext();
|
|
@@ -264,11 +243,11 @@ export class DSLDataSpace_PureProtocolProcessorPlugin extends PureProtocolProces
|
|
|
264
243
|
contextProtocol.description = execContext.description;
|
|
265
244
|
contextProtocol.mapping = new V1_PackageableElementPointer(
|
|
266
245
|
PackageableElementPointerType.MAPPING,
|
|
267
|
-
execContext.mapping,
|
|
246
|
+
execContext.mapping.valueForSerialization ?? '',
|
|
268
247
|
);
|
|
269
248
|
contextProtocol.defaultRuntime = new V1_PackageableElementPointer(
|
|
270
249
|
PackageableElementPointerType.RUNTIME,
|
|
271
|
-
execContext.defaultRuntime,
|
|
250
|
+
execContext.defaultRuntime.valueForSerialization ?? '',
|
|
272
251
|
);
|
|
273
252
|
return contextProtocol;
|
|
274
253
|
},
|
|
@@ -276,11 +255,11 @@ export class DSLDataSpace_PureProtocolProcessorPlugin extends PureProtocolProces
|
|
|
276
255
|
protocol.defaultExecutionContext =
|
|
277
256
|
metamodel.defaultExecutionContext.name;
|
|
278
257
|
protocol.description = metamodel.description;
|
|
279
|
-
protocol.featuredDiagrams = metamodel.featuredDiagrams
|
|
258
|
+
protocol.featuredDiagrams = metamodel.featuredDiagrams?.map(
|
|
280
259
|
(diagramPath) =>
|
|
281
260
|
new V1_PackageableElementPointer(
|
|
282
261
|
V1_DSLDiagram_PackageableElementPointerType,
|
|
283
|
-
diagramPath,
|
|
262
|
+
diagramPath.valueForSerialization ?? '',
|
|
284
263
|
),
|
|
285
264
|
);
|
|
286
265
|
if (metamodel.supportInfo) {
|
|
@@ -295,7 +274,6 @@ export class DSLDataSpace_PureProtocolProcessorPlugin extends PureProtocolProces
|
|
|
295
274
|
);
|
|
296
275
|
}
|
|
297
276
|
}
|
|
298
|
-
// protocol.supportInfo = metamodel.supportInfo;
|
|
299
277
|
return protocol;
|
|
300
278
|
}
|
|
301
279
|
return undefined;
|
|
@@ -304,139 +282,6 @@ export class DSLDataSpace_PureProtocolProcessorPlugin extends PureProtocolProces
|
|
|
304
282
|
}
|
|
305
283
|
}
|
|
306
284
|
|
|
307
|
-
export class ResolvedDataSpaceExecutionContext {
|
|
308
|
-
name!: string;
|
|
309
|
-
description?: string | undefined;
|
|
310
|
-
mapping!: PackageableElementReference<Mapping>;
|
|
311
|
-
defaultRuntime!: PackageableElementReference<PackageableRuntime>;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* When we actually need to use the data space, we want to resolve all of its
|
|
316
|
-
* element pointers to actual reference, hence this model.
|
|
317
|
-
*/
|
|
318
|
-
export class ResolvedDataSpace {
|
|
319
|
-
taggedValues: {
|
|
320
|
-
uuid: string;
|
|
321
|
-
profile: string;
|
|
322
|
-
tag: string;
|
|
323
|
-
value: string;
|
|
324
|
-
}[] = [];
|
|
325
|
-
stereotypes: { uuid: string; profile: string; stereotype: string }[] = [];
|
|
326
|
-
path!: string;
|
|
327
|
-
groupId!: string;
|
|
328
|
-
artifactId!: string;
|
|
329
|
-
versionId!: string;
|
|
330
|
-
executionContexts: ResolvedDataSpaceExecutionContext[] = [];
|
|
331
|
-
defaultExecutionContext!: ResolvedDataSpaceExecutionContext;
|
|
332
|
-
featuredDiagrams: PackageableElementReference<Diagram>[] = [];
|
|
333
|
-
description?: string | undefined;
|
|
334
|
-
supportInfo?: DataSpaceSupportInfo | undefined;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
export const getResolvedDataSpace = (
|
|
338
|
-
json: PlainObject<V1_DataSpace>,
|
|
339
|
-
graph: PureModel,
|
|
340
|
-
): ResolvedDataSpace => {
|
|
341
|
-
const dataSpace = new ResolvedDataSpace();
|
|
342
|
-
if (json._type === V1_DATA_SPACE_ELEMENT_PROTOCOL_TYPE) {
|
|
343
|
-
const protocol = deserialize(V1_dataSpaceModelSchema, json);
|
|
344
|
-
dataSpace.path = protocol.path;
|
|
345
|
-
if (Array.isArray(json.taggedValues)) {
|
|
346
|
-
dataSpace.taggedValues = (
|
|
347
|
-
json.taggedValues as PlainObject<V1_TaggedValue>[]
|
|
348
|
-
)
|
|
349
|
-
.map((taggedValueJson) =>
|
|
350
|
-
deserialize(V1_taggedValueSchema, taggedValueJson),
|
|
351
|
-
)
|
|
352
|
-
.map((taggedValue) => ({
|
|
353
|
-
uuid: uuid(),
|
|
354
|
-
profile: taggedValue.tag.profile,
|
|
355
|
-
tag: taggedValue.tag.value,
|
|
356
|
-
value: taggedValue.value,
|
|
357
|
-
}));
|
|
358
|
-
}
|
|
359
|
-
if (Array.isArray(json.stereotypes)) {
|
|
360
|
-
dataSpace.stereotypes = (
|
|
361
|
-
json.stereotypes as PlainObject<V1_StereotypePtr>[]
|
|
362
|
-
)
|
|
363
|
-
.map((stereotypePtrJson) =>
|
|
364
|
-
deserialize(V1_StereotypePtr, stereotypePtrJson),
|
|
365
|
-
)
|
|
366
|
-
.map((stereotypePtr) => ({
|
|
367
|
-
uuid: uuid(),
|
|
368
|
-
profile: stereotypePtr.profile,
|
|
369
|
-
stereotype: stereotypePtr.value,
|
|
370
|
-
}));
|
|
371
|
-
}
|
|
372
|
-
dataSpace.groupId = guaranteeNonEmptyString(
|
|
373
|
-
protocol.groupId,
|
|
374
|
-
`Data space 'groupId' field is missing or empty`,
|
|
375
|
-
);
|
|
376
|
-
dataSpace.artifactId = guaranteeNonEmptyString(
|
|
377
|
-
protocol.artifactId,
|
|
378
|
-
`Data space 'artifactId' field is missing or empty`,
|
|
379
|
-
);
|
|
380
|
-
dataSpace.versionId = guaranteeNonEmptyString(
|
|
381
|
-
protocol.versionId,
|
|
382
|
-
`Data space 'versionId' field is missing or empty`,
|
|
383
|
-
);
|
|
384
|
-
dataSpace.executionContexts = protocol.executionContexts.map(
|
|
385
|
-
(contextProtocol) => {
|
|
386
|
-
const context = new ResolvedDataSpaceExecutionContext();
|
|
387
|
-
context.name = guaranteeNonEmptyString(
|
|
388
|
-
contextProtocol.name,
|
|
389
|
-
`Data space execution context 'name' field is missing or empty`,
|
|
390
|
-
);
|
|
391
|
-
context.description = contextProtocol.description;
|
|
392
|
-
context.mapping = PackageableElementExplicitReference.create(
|
|
393
|
-
graph.getMapping(contextProtocol.mapping.path),
|
|
394
|
-
);
|
|
395
|
-
context.defaultRuntime = PackageableElementExplicitReference.create(
|
|
396
|
-
graph.getRuntime(contextProtocol.defaultRuntime.path),
|
|
397
|
-
);
|
|
398
|
-
return context;
|
|
399
|
-
},
|
|
400
|
-
);
|
|
401
|
-
dataSpace.defaultExecutionContext = guaranteeNonNullable(
|
|
402
|
-
dataSpace.executionContexts.find(
|
|
403
|
-
(context) =>
|
|
404
|
-
context.name ===
|
|
405
|
-
guaranteeNonEmptyString(
|
|
406
|
-
protocol.defaultExecutionContext,
|
|
407
|
-
`Data space 'defaultExecutionContext' field is missing or empty`,
|
|
408
|
-
),
|
|
409
|
-
),
|
|
410
|
-
`Can't find default execution context '${protocol.defaultExecutionContext}'`,
|
|
411
|
-
);
|
|
412
|
-
dataSpace.description = protocol.description;
|
|
413
|
-
if (protocol.featuredDiagrams) {
|
|
414
|
-
dataSpace.featuredDiagrams = protocol.featuredDiagrams.map((pointer) =>
|
|
415
|
-
PackageableElementExplicitReference.create(
|
|
416
|
-
getDiagram(pointer.path, graph),
|
|
417
|
-
),
|
|
418
|
-
);
|
|
419
|
-
}
|
|
420
|
-
if (protocol.supportInfo) {
|
|
421
|
-
if (protocol.supportInfo instanceof V1_DataSpaceSupportEmail) {
|
|
422
|
-
const supportEmail = new DataSpaceSupportEmail();
|
|
423
|
-
supportEmail.address = guaranteeNonEmptyString(
|
|
424
|
-
protocol.supportInfo.address,
|
|
425
|
-
`Data space support email 'address' field is missing or empty`,
|
|
426
|
-
);
|
|
427
|
-
dataSpace.supportInfo = supportEmail;
|
|
428
|
-
} else {
|
|
429
|
-
throw new UnsupportedOperationError(
|
|
430
|
-
`Can't build data space support info`,
|
|
431
|
-
protocol.supportInfo,
|
|
432
|
-
);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
return dataSpace;
|
|
436
|
-
}
|
|
437
|
-
throw new UnsupportedOperationError(`Can't resolve data space`, json);
|
|
438
|
-
};
|
|
439
|
-
|
|
440
285
|
export const extractDataSpaceTaxonomyNodes = (
|
|
441
286
|
json: PlainObject<V1_DataSpace>,
|
|
442
287
|
): string[] => {
|
|
@@ -62,9 +62,6 @@ export class V1_DataSpaceExecutionContext implements Hashable {
|
|
|
62
62
|
export class V1_DataSpace extends V1_PackageableElement implements Hashable {
|
|
63
63
|
stereotypes: V1_StereotypePtr[] = [];
|
|
64
64
|
taggedValues: V1_TaggedValue[] = [];
|
|
65
|
-
groupId!: string;
|
|
66
|
-
artifactId!: string;
|
|
67
|
-
versionId!: string;
|
|
68
65
|
executionContexts!: V1_DataSpaceExecutionContext[];
|
|
69
66
|
defaultExecutionContext!: string;
|
|
70
67
|
featuredDiagrams?: V1_PackageableElementPointer[] | undefined;
|
|
@@ -76,9 +73,6 @@ export class V1_DataSpace extends V1_PackageableElement implements Hashable {
|
|
|
76
73
|
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE,
|
|
77
74
|
hashArray(this.stereotypes),
|
|
78
75
|
hashArray(this.taggedValues),
|
|
79
|
-
this.groupId,
|
|
80
|
-
this.artifactId,
|
|
81
|
-
this.versionId,
|
|
82
76
|
hashArray(this.executionContexts),
|
|
83
77
|
this.defaultExecutionContext,
|
|
84
78
|
hashArray((this.featuredDiagrams ?? []).map((pointer) => pointer.path)),
|
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,
|