@finos/legend-extension-dsl-data-space 10.1.89 → 10.1.91
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/DataSpaceQuickStart.d.ts.map +1 -1
- package/lib/components/DataSpaceQuickStart.js +3 -1
- package/lib/components/DataSpaceQuickStart.js.map +1 -1
- package/lib/graph/DSL_DataSpace_HashUtils.d.ts +2 -0
- package/lib/graph/DSL_DataSpace_HashUtils.d.ts.map +1 -1
- package/lib/graph/DSL_DataSpace_HashUtils.js +2 -0
- package/lib/graph/DSL_DataSpace_HashUtils.js.map +1 -1
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts +10 -2
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js +23 -1
- package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js.map +1 -1
- package/lib/graph-manager/action/analytics/DataSpaceAnalysis.d.ts +4 -1
- package/lib/graph-manager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
- package/lib/graph-manager/action/analytics/DataSpaceAnalysis.js +3 -0
- package/lib/graph-manager/action/analytics/DataSpaceAnalysis.js.map +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.d.ts +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js +47 -13
- package/lib/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +12 -4
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +4 -1
- package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +11 -1
- package/lib/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts +10 -2
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js +23 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts +2 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js +32 -6
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/package.json +1 -1
- package/package.json +12 -12
- package/src/components/DataSpaceQuickStart.tsx +5 -3
- package/src/graph/DSL_DataSpace_HashUtils.ts +2 -0
- package/src/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.ts +36 -3
- package/src/graph-manager/action/analytics/DataSpaceAnalysis.ts +5 -1
- package/src/graph-manager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.ts +84 -29
- package/src/graph-manager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +12 -1
- package/src/graph-manager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +22 -2
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.ts +36 -3
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.ts +61 -7
@@ -20,10 +20,11 @@ import {
|
|
20
20
|
V1_DataSpace,
|
21
21
|
V1_DataSpaceDiagram,
|
22
22
|
V1_DataSpaceElementPointer,
|
23
|
-
V1_DataSpaceExecutable,
|
24
23
|
V1_DataSpaceExecutionContext,
|
24
|
+
V1_DataSpacePackageableElementExecutable,
|
25
25
|
V1_DataSpaceSupportCombinedInfo,
|
26
26
|
V1_DataSpaceSupportEmail,
|
27
|
+
V1_DataSpaceTemplateExecutable,
|
27
28
|
} from './v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js';
|
28
29
|
import {
|
29
30
|
type PlainObject,
|
@@ -45,14 +46,15 @@ import {
|
|
45
46
|
import { V1_resolveDataSpace } from './v1/transformation/pureGraph/V1_DSL_DataSpace_GraphBuilderHelper.js';
|
46
47
|
import { getOwnDataSpace } from '../../DSL_DataSpace_GraphManagerHelper.js';
|
47
48
|
import {
|
49
|
+
type DataSpaceElement,
|
48
50
|
DataSpace,
|
49
|
-
DataSpaceExecutable,
|
50
51
|
DataSpaceExecutionContext,
|
51
52
|
DataSpaceSupportCombinedInfo,
|
52
53
|
DataSpaceSupportEmail,
|
53
|
-
type DataSpaceElement,
|
54
54
|
DataSpaceDiagram,
|
55
55
|
DataSpaceElementPointer,
|
56
|
+
DataSpaceExecutableTemplate,
|
57
|
+
DataSpacePackageableElementExecutable,
|
56
58
|
} from '../../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
57
59
|
import {
|
58
60
|
type PackageableElement,
|
@@ -65,6 +67,17 @@ import {
|
|
65
67
|
type V1_PackageableElement,
|
66
68
|
type V1_PureModelContextData,
|
67
69
|
type V1_TaggedValue,
|
70
|
+
type Mapping,
|
71
|
+
type MappingInclude,
|
72
|
+
type PackageableElementReference,
|
73
|
+
type V1_MappingInclude,
|
74
|
+
type DSL_Mapping_PureProtocolProcessorPlugin_Extension,
|
75
|
+
type V1_MappingIncludeBuilder,
|
76
|
+
type V1_MappingIncludeTransformer,
|
77
|
+
type V1_MappingIncludeProtocolSerializer,
|
78
|
+
type V1_MappingIncludeProtocolDeserializer,
|
79
|
+
type V1_MappingIncludeIdentifierBuilder,
|
80
|
+
type V1_RawLambda,
|
68
81
|
V1_taggedValueModelSchema,
|
69
82
|
PackageableElementExplicitReference,
|
70
83
|
V1_PackageableElementPointer,
|
@@ -79,17 +92,9 @@ import {
|
|
79
92
|
Class,
|
80
93
|
Enumeration,
|
81
94
|
Association,
|
82
|
-
type Mapping,
|
83
|
-
type MappingInclude,
|
84
|
-
type PackageableElementReference,
|
85
95
|
Package,
|
86
|
-
|
87
|
-
|
88
|
-
type V1_MappingIncludeBuilder,
|
89
|
-
type V1_MappingIncludeTransformer,
|
90
|
-
type V1_MappingIncludeProtocolSerializer,
|
91
|
-
type V1_MappingIncludeProtocolDeserializer,
|
92
|
-
type V1_MappingIncludeIdentifierBuilder,
|
96
|
+
V1_RawValueSpecificationTransformer,
|
97
|
+
V1_buildRawLambdaWithResolvedPaths,
|
93
98
|
} from '@finos/legend-graph';
|
94
99
|
import { V1_resolveDiagram } from '@finos/legend-extension-dsl-diagram/graph';
|
95
100
|
import { V1_MappingIncludeDataSpace } from './v1/model/packageableElements/mapping/V1_DSL_DataSpace_MappingIncludeDataSpace.js';
|
@@ -206,14 +211,41 @@ export class DSL_DataSpace_PureProtocolProcessorPlugin
|
|
206
211
|
if (elementProtocol.executables) {
|
207
212
|
element.executables = elementProtocol.executables.map(
|
208
213
|
(executableProtocol) => {
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
executableProtocol.
|
214
|
-
|
215
|
-
|
216
|
-
|
214
|
+
if (
|
215
|
+
executableProtocol instanceof V1_DataSpaceTemplateExecutable
|
216
|
+
) {
|
217
|
+
const executable = new DataSpaceExecutableTemplate();
|
218
|
+
executable.title = executableProtocol.title;
|
219
|
+
executable.description = executableProtocol.description;
|
220
|
+
executable.query = V1_buildRawLambdaWithResolvedPaths(
|
221
|
+
executableProtocol.query.parameters,
|
222
|
+
executableProtocol.query.body,
|
223
|
+
context,
|
224
|
+
);
|
225
|
+
if (executableProtocol.executionContextKey) {
|
226
|
+
executable.executionContextKey =
|
227
|
+
executableProtocol.executionContextKey;
|
228
|
+
}
|
229
|
+
return executable;
|
230
|
+
} else if (
|
231
|
+
executableProtocol instanceof
|
232
|
+
V1_DataSpacePackageableElementExecutable
|
233
|
+
) {
|
234
|
+
const executable =
|
235
|
+
new DataSpacePackageableElementExecutable();
|
236
|
+
executable.title = executableProtocol.title;
|
237
|
+
executable.description = executableProtocol.description;
|
238
|
+
executable.executable = context.resolveElement(
|
239
|
+
executableProtocol.executable.path,
|
240
|
+
false,
|
241
|
+
);
|
242
|
+
return executable;
|
243
|
+
} else {
|
244
|
+
throw new UnsupportedOperationError(
|
245
|
+
`Can't build data space executable`,
|
246
|
+
executableProtocol,
|
247
|
+
);
|
248
|
+
}
|
217
249
|
},
|
218
250
|
);
|
219
251
|
}
|
@@ -353,14 +385,37 @@ export class DSL_DataSpace_PureProtocolProcessorPlugin
|
|
353
385
|
return elementPointer;
|
354
386
|
});
|
355
387
|
protocol.executables = metamodel.executables?.map((executable) => {
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
388
|
+
if (executable instanceof DataSpaceExecutableTemplate) {
|
389
|
+
const executableProtocol = new V1_DataSpaceTemplateExecutable();
|
390
|
+
executableProtocol.title = executable.title;
|
391
|
+
executableProtocol.description = executable.description;
|
392
|
+
if (executable.executionContextKey) {
|
393
|
+
executableProtocol.executionContextKey =
|
394
|
+
executable.executionContextKey;
|
395
|
+
}
|
396
|
+
executableProtocol.query =
|
397
|
+
executable.query.accept_RawValueSpecificationVisitor(
|
398
|
+
new V1_RawValueSpecificationTransformer(context),
|
399
|
+
) as V1_RawLambda;
|
400
|
+
return executableProtocol;
|
401
|
+
} else if (
|
402
|
+
executable instanceof DataSpacePackageableElementExecutable
|
403
|
+
) {
|
404
|
+
const executableProtocol =
|
405
|
+
new V1_DataSpacePackageableElementExecutable();
|
406
|
+
executableProtocol.title = executable.title;
|
407
|
+
executableProtocol.description = executable.description;
|
408
|
+
executableProtocol.executable = new V1_PackageableElementPointer(
|
409
|
+
undefined,
|
410
|
+
executable.executable.valueForSerialization ?? '',
|
411
|
+
);
|
412
|
+
return executableProtocol;
|
413
|
+
} else {
|
414
|
+
throw new UnsupportedOperationError(
|
415
|
+
`Can't transform data space executable`,
|
416
|
+
executable,
|
417
|
+
);
|
418
|
+
}
|
364
419
|
});
|
365
420
|
protocol.diagrams = metamodel.diagrams?.map((diagram) => {
|
366
421
|
const diagramProtocol = new V1_DataSpaceDiagram();
|
@@ -70,6 +70,7 @@ import {
|
|
70
70
|
DataSpaceAssociationDocumentationEntry,
|
71
71
|
DataSpaceMultiExecutionServiceExecutableInfo,
|
72
72
|
DataSpaceMultiExecutionServiceKeyedExecutableInfo,
|
73
|
+
DataSpaceTemplateExecutableInfo,
|
73
74
|
} from '../../../action/analytics/DataSpaceAnalysis.js';
|
74
75
|
import { DSL_DataSpace_PureGraphManagerExtension } from '../DSL_DataSpace_PureGraphManagerExtension.js';
|
75
76
|
import {
|
@@ -81,6 +82,7 @@ import {
|
|
81
82
|
V1_DataSpaceServiceExecutableInfo,
|
82
83
|
V1_deserializeDataSpaceAnalysisResult,
|
83
84
|
V1_DataSpaceMultiExecutionServiceExecutableInfo,
|
85
|
+
V1_DataSpaceTemplateExecutableInfo,
|
84
86
|
} from './engine/analytics/V1_DataSpaceAnalysis.js';
|
85
87
|
import { getDiagram } from '@finos/legend-extension-dsl-diagram/graph';
|
86
88
|
|
@@ -487,8 +489,17 @@ export class V1_DSL_DataSpace_PureGraphManagerExtension extends DSL_DataSpace_Pu
|
|
487
489
|
const executable = new DataSpaceExecutableAnalysisResult();
|
488
490
|
executable.title = executableProtocol.title;
|
489
491
|
executable.description = executableProtocol.description;
|
490
|
-
|
492
|
+
if (executableProtocol.executable) {
|
493
|
+
executable.executable = executableProtocol.executable;
|
494
|
+
}
|
491
495
|
if (
|
496
|
+
executableProtocol.info instanceof V1_DataSpaceTemplateExecutableInfo
|
497
|
+
) {
|
498
|
+
const templateExecutableInfo = new DataSpaceTemplateExecutableInfo();
|
499
|
+
templateExecutableInfo.query = executableProtocol.info.query;
|
500
|
+
templateExecutableInfo.executionContextKey =
|
501
|
+
executableProtocol.info.executionContextKey;
|
502
|
+
} else if (
|
492
503
|
executableProtocol.info instanceof V1_DataSpaceServiceExecutableInfo
|
493
504
|
) {
|
494
505
|
const serviceExecutableInfo = new DataSpaceServiceExecutableInfo();
|
@@ -248,10 +248,25 @@ export abstract class V1_DataSpaceExecutableInfo {
|
|
248
248
|
query!: string;
|
249
249
|
}
|
250
250
|
|
251
|
+
const V1_DATA_SPACE_TEMPLATE_EXECUTABLE_INFO_TYPE = 'templateExecutableInfo';
|
251
252
|
const V1_DATA_SPACE_SERVICE_EXECUTABLE_INFO_TYPE = 'service';
|
252
253
|
const V1_DATA_SPACE_MULTI_EXECUTION_SERVICE_EXECUTABLE_INFO_TYPE =
|
253
254
|
'multiExecutionService';
|
254
255
|
|
256
|
+
export class V1_DataSpaceTemplateExecutableInfo extends V1_DataSpaceExecutableInfo {
|
257
|
+
executionContextKey!: string;
|
258
|
+
}
|
259
|
+
|
260
|
+
const V1_DataSpaceTemplateExecutableInfoModelSchema = (
|
261
|
+
plugins: PureProtocolProcessorPlugin[],
|
262
|
+
): ModelSchema<V1_DataSpaceTemplateExecutableInfo> =>
|
263
|
+
createModelSchema(V1_DataSpaceTemplateExecutableInfo, {
|
264
|
+
_type: usingConstantValueSchema(
|
265
|
+
V1_DATA_SPACE_TEMPLATE_EXECUTABLE_INFO_TYPE,
|
266
|
+
),
|
267
|
+
executionContextKey: primitive(),
|
268
|
+
});
|
269
|
+
|
255
270
|
export class V1_DataSpaceServiceExecutableInfo extends V1_DataSpaceExecutableInfo {
|
256
271
|
pattern!: string;
|
257
272
|
mapping?: string | undefined;
|
@@ -328,6 +343,11 @@ const V1_deserializeDataSpaceExecutableInfo = (
|
|
328
343
|
json: PlainObject<V1_DataSpaceExecutableInfo>,
|
329
344
|
): V1_DataSpaceExecutableInfo => {
|
330
345
|
switch (json._type) {
|
346
|
+
case V1_DATA_SPACE_TEMPLATE_EXECUTABLE_INFO_TYPE:
|
347
|
+
return deserialize(
|
348
|
+
V1_DataSpaceTemplateExecutableInfoModelSchema(plugins),
|
349
|
+
json,
|
350
|
+
);
|
331
351
|
case V1_DATA_SPACE_SERVICE_EXECUTABLE_INFO_TYPE:
|
332
352
|
return deserialize(
|
333
353
|
V1_dataSpaceServiceExecutableInfoModelSchema(plugins),
|
@@ -399,7 +419,7 @@ const V1_deserializeDataSpaceExecutableResult = (
|
|
399
419
|
export class V1_DataSpaceExecutableAnalysisResult {
|
400
420
|
title!: string;
|
401
421
|
description?: string | undefined;
|
402
|
-
executable
|
422
|
+
executable?: string;
|
403
423
|
info?: V1_DataSpaceExecutableInfo | undefined;
|
404
424
|
result!: V1_DataSpaceExecutableResult;
|
405
425
|
}
|
@@ -408,7 +428,7 @@ const V1_dataSpaceExecutableAnalysisResultModelSchema = (
|
|
408
428
|
plugins: PureProtocolProcessorPlugin[],
|
409
429
|
): ModelSchema<V1_DataSpaceExecutableAnalysisResult> =>
|
410
430
|
createModelSchema(V1_DataSpaceExecutableAnalysisResult, {
|
411
|
-
executable: primitive(),
|
431
|
+
executable: optional(primitive()),
|
412
432
|
description: optional(primitive()),
|
413
433
|
info: optionalCustom(
|
414
434
|
() => SKIP,
|
@@ -17,11 +17,12 @@
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
18
18
|
import { DATA_SPACE_HASH_STRUCTURE } from '../../../../../../../graph/DSL_DataSpace_HashUtils.js';
|
19
19
|
import {
|
20
|
-
|
20
|
+
type V1_RawLambda,
|
21
21
|
type V1_PackageableElementPointer,
|
22
22
|
type V1_PackageableElementVisitor,
|
23
23
|
type V1_StereotypePtr,
|
24
24
|
type V1_TaggedValue,
|
25
|
+
V1_PackageableElement,
|
25
26
|
} from '@finos/legend-graph';
|
26
27
|
|
27
28
|
export class V1_DataSpaceExecutionContext implements Hashable {
|
@@ -56,21 +57,53 @@ export class V1_DataSpaceElementPointer implements Hashable {
|
|
56
57
|
}
|
57
58
|
}
|
58
59
|
|
59
|
-
export class V1_DataSpaceExecutable implements Hashable {
|
60
|
+
export abstract class V1_DataSpaceExecutable implements Hashable {
|
60
61
|
title!: string;
|
61
62
|
description?: string | undefined;
|
62
|
-
executable!: V1_PackageableElementPointer;
|
63
63
|
|
64
64
|
get hashCode(): string {
|
65
65
|
return hashArray([
|
66
66
|
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_EXECUTABLE,
|
67
67
|
this.title,
|
68
68
|
this.description ?? '',
|
69
|
+
]);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
export class V1_DataSpacePackageableElementExecutable
|
74
|
+
extends V1_DataSpaceExecutable
|
75
|
+
implements Hashable
|
76
|
+
{
|
77
|
+
executable!: V1_PackageableElementPointer;
|
78
|
+
|
79
|
+
override get hashCode(): string {
|
80
|
+
return hashArray([
|
81
|
+
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_PACKAGEABLE_ELEMENT_EXECUTABLE,
|
82
|
+
this.title,
|
83
|
+
this.description ?? '',
|
69
84
|
this.executable.path,
|
70
85
|
]);
|
71
86
|
}
|
72
87
|
}
|
73
88
|
|
89
|
+
export class V1_DataSpaceTemplateExecutable
|
90
|
+
extends V1_DataSpaceExecutable
|
91
|
+
implements Hashable
|
92
|
+
{
|
93
|
+
query!: V1_RawLambda;
|
94
|
+
executionContextKey?: string;
|
95
|
+
|
96
|
+
override get hashCode(): string {
|
97
|
+
return hashArray([
|
98
|
+
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_TEMPLATE_EXECUTABLE,
|
99
|
+
this.title,
|
100
|
+
this.description ?? '',
|
101
|
+
this.query,
|
102
|
+
this.executionContextKey ?? '',
|
103
|
+
]);
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
74
107
|
export class V1_DataSpaceDiagram implements Hashable {
|
75
108
|
title!: string;
|
76
109
|
description?: string | undefined;
|
@@ -30,6 +30,7 @@ import {
|
|
30
30
|
V1_taggedValueModelSchema,
|
31
31
|
V1_packageableElementPointerModelSchema,
|
32
32
|
V1_PackageableElementPointer,
|
33
|
+
V1_rawLambdaModelSchema,
|
33
34
|
} from '@finos/legend-graph';
|
34
35
|
import {
|
35
36
|
type PlainObject,
|
@@ -43,19 +44,24 @@ import {
|
|
43
44
|
} from '@finos/legend-shared';
|
44
45
|
import {
|
45
46
|
type V1_DataSpaceSupportInfo,
|
47
|
+
type V1_DataSpaceExecutable,
|
46
48
|
V1_DataSpace,
|
47
49
|
V1_DataSpaceExecutionContext,
|
48
50
|
V1_DataSpaceSupportEmail,
|
49
51
|
V1_DataSpaceSupportCombinedInfo,
|
50
|
-
V1_DataSpaceExecutable,
|
51
52
|
V1_DataSpaceDiagram,
|
52
53
|
V1_DataSpaceElementPointer,
|
54
|
+
V1_DataSpaceTemplateExecutable,
|
55
|
+
V1_DataSpacePackageableElementExecutable,
|
53
56
|
} from '../../model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js';
|
54
57
|
import { V1_MappingIncludeDataSpace } from '../../model/packageableElements/mapping/V1_DSL_DataSpace_MappingIncludeDataSpace.js';
|
55
58
|
|
56
59
|
export const V1_DATA_SPACE_ELEMENT_PROTOCOL_TYPE = 'dataSpace';
|
57
60
|
const V1_DATA_SPACE_SUPPORT_EMAIL_TYPE = 'email';
|
58
61
|
const V1_DATA_SPACE_SUPPORT_COMBINED_INFO_TYPE = 'combined';
|
62
|
+
const V1_DATA_SPACE_PACKAGEABLE_ELEMENT_EXECUTABLE =
|
63
|
+
'dataSpacePackageableElementExecutable';
|
64
|
+
const V1_DATA_SPACE_TEMPLATE_EXECUTABLE = 'dataSpaceTemplateExecutable';
|
59
65
|
|
60
66
|
const V1_dataSpaceExecutionContextModelSchema = createModelSchema(
|
61
67
|
V1_DataSpaceExecutionContext,
|
@@ -130,18 +136,61 @@ const V1_dataSpaceElementPointerModelSchema = createModelSchema(
|
|
130
136
|
},
|
131
137
|
);
|
132
138
|
|
133
|
-
const
|
134
|
-
|
135
|
-
const V1_dataSpaceExecutableModelSchema = createModelSchema(
|
136
|
-
V1_DataSpaceExecutable,
|
139
|
+
const V1_dataSpacePackageableElementExecutableModelSchema = createModelSchema(
|
140
|
+
V1_DataSpacePackageableElementExecutable,
|
137
141
|
{
|
138
|
-
_type: usingConstantValueSchema(
|
142
|
+
_type: usingConstantValueSchema(
|
143
|
+
V1_DATA_SPACE_PACKAGEABLE_ELEMENT_EXECUTABLE,
|
144
|
+
),
|
139
145
|
description: optional(primitive()),
|
146
|
+
title: primitive(),
|
140
147
|
executable: usingModelSchema(V1_packageableElementPointerModelSchema),
|
148
|
+
},
|
149
|
+
);
|
150
|
+
|
151
|
+
const V1_dataSpaceTemplateExecutableModelSchema = createModelSchema(
|
152
|
+
V1_DataSpaceTemplateExecutable,
|
153
|
+
{
|
154
|
+
_type: usingConstantValueSchema(V1_DATA_SPACE_TEMPLATE_EXECUTABLE),
|
155
|
+
description: optional(primitive()),
|
141
156
|
title: primitive(),
|
157
|
+
query: usingModelSchema(V1_rawLambdaModelSchema),
|
158
|
+
executionContextKey: optional(primitive()),
|
142
159
|
},
|
143
160
|
);
|
144
161
|
|
162
|
+
const V1_serializeDataspaceExecutable = (
|
163
|
+
protocol: V1_DataSpaceExecutable,
|
164
|
+
): PlainObject<V1_DataSpaceExecutable> => {
|
165
|
+
if (protocol instanceof V1_DataSpaceTemplateExecutable) {
|
166
|
+
return serialize(V1_dataSpaceTemplateExecutableModelSchema, protocol);
|
167
|
+
} else if (protocol instanceof V1_DataSpacePackageableElementExecutable) {
|
168
|
+
return serialize(
|
169
|
+
V1_dataSpacePackageableElementExecutableModelSchema,
|
170
|
+
protocol,
|
171
|
+
);
|
172
|
+
}
|
173
|
+
throw new UnsupportedOperationError(
|
174
|
+
`Can't serialize data space executable`,
|
175
|
+
protocol,
|
176
|
+
);
|
177
|
+
};
|
178
|
+
|
179
|
+
export const V1_deserializeDataspaceExecutable = (
|
180
|
+
json: PlainObject<V1_DataSpaceExecutable>,
|
181
|
+
): V1_DataSpaceSupportInfo => {
|
182
|
+
switch (json._type) {
|
183
|
+
case V1_DATA_SPACE_TEMPLATE_EXECUTABLE:
|
184
|
+
return deserialize(V1_dataSpaceTemplateExecutableModelSchema, json);
|
185
|
+
case V1_DATA_SPACE_PACKAGEABLE_ELEMENT_EXECUTABLE:
|
186
|
+
default:
|
187
|
+
return deserialize(
|
188
|
+
V1_dataSpacePackageableElementExecutableModelSchema,
|
189
|
+
json,
|
190
|
+
);
|
191
|
+
}
|
192
|
+
};
|
193
|
+
|
145
194
|
const V1_dataSpaceDiagramModelSchema = createModelSchema(V1_DataSpaceDiagram, {
|
146
195
|
description: optional(primitive()),
|
147
196
|
diagram: usingModelSchema(V1_packageableElementPointerModelSchema),
|
@@ -154,7 +203,12 @@ const V1_dataSpaceModelSchema = createModelSchema(V1_DataSpace, {
|
|
154
203
|
description: optional(primitive()),
|
155
204
|
diagrams: list(object(V1_dataSpaceDiagramModelSchema)),
|
156
205
|
elements: optionalCustomListWithSchema(V1_dataSpaceElementPointerModelSchema),
|
157
|
-
executables: list(
|
206
|
+
executables: list(
|
207
|
+
custom(
|
208
|
+
(val) => V1_serializeDataspaceExecutable(val),
|
209
|
+
(val) => V1_deserializeDataspaceExecutable(val),
|
210
|
+
),
|
211
|
+
),
|
158
212
|
executionContexts: list(object(V1_dataSpaceExecutionContextModelSchema)),
|
159
213
|
featuredDiagrams: optionalCustomListWithSchema(
|
160
214
|
V1_packageableElementPointerModelSchema,
|