@finos/legend-extension-dsl-data-space 9.1.7 → 9.2.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.
Files changed (54) hide show
  1. package/lib/components/DataSpaceQuickStart.d.ts.map +1 -1
  2. package/lib/components/DataSpaceQuickStart.js +3 -2
  3. package/lib/components/DataSpaceQuickStart.js.map +1 -1
  4. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  5. package/lib/components/DataSpaceViewer.js +1 -0
  6. package/lib/components/DataSpaceViewer.js.map +1 -1
  7. package/lib/components/DataSpaceViewerActivityBar.d.ts.map +1 -1
  8. package/lib/components/DataSpaceViewerActivityBar.js +6 -1
  9. package/lib/components/DataSpaceViewerActivityBar.js.map +1 -1
  10. package/lib/graph/DSL_DataSpace_HashUtils.d.ts +1 -0
  11. package/lib/graph/DSL_DataSpace_HashUtils.d.ts.map +1 -1
  12. package/lib/graph/DSL_DataSpace_HashUtils.js +1 -0
  13. package/lib/graph/DSL_DataSpace_HashUtils.js.map +1 -1
  14. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts +23 -19
  15. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts.map +1 -1
  16. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js +41 -32
  17. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js.map +1 -1
  18. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
  19. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js +23 -17
  20. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js.map +1 -1
  21. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
  22. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +4 -11
  23. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
  24. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +3 -3
  25. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -1
  26. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +25 -2
  27. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
  28. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts +21 -17
  29. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts.map +1 -1
  30. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js +41 -32
  31. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js.map +1 -1
  32. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts +2 -1
  33. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts.map +1 -1
  34. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js +44 -10
  35. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js.map +1 -1
  36. package/lib/index.css +2 -2
  37. package/lib/index.css.map +1 -1
  38. package/lib/package.json +5 -5
  39. package/lib/stores/DataSpaceViewerState.d.ts +1 -0
  40. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  41. package/lib/stores/DataSpaceViewerState.js +1 -0
  42. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  43. package/package.json +16 -16
  44. package/src/components/DataSpaceQuickStart.tsx +5 -1
  45. package/src/components/DataSpaceViewer.tsx +4 -0
  46. package/src/components/DataSpaceViewerActivityBar.tsx +8 -0
  47. package/src/graph/DSL_DataSpace_HashUtils.ts +1 -0
  48. package/src/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.ts +59 -55
  49. package/src/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.ts +23 -30
  50. package/src/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +9 -18
  51. package/src/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +34 -3
  52. package/src/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.ts +57 -46
  53. package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.ts +59 -14
  54. package/src/stores/DataSpaceViewerState.ts +1 -0
@@ -135,7 +135,7 @@ export class V1_DSL_DataSpace_PureGraphManagerExtension extends DSL_DataSpace_Pu
135
135
  );
136
136
  }
137
137
  return this.buildDataSpaceAnalytics(
138
- V1_DataSpaceAnalysisResult.serialization.fromJson(analysisResult),
138
+ V1_DataSpaceAnalysisResult.deserialize(analysisResult),
139
139
  );
140
140
  }
141
141
 
@@ -362,23 +362,14 @@ export class V1_DSL_DataSpace_PureGraphManagerExtension extends DSL_DataSpace_Pu
362
362
  return entries;
363
363
  });
364
364
 
365
- // featured diagrams
366
- result.diagrams = analysisResult.featuredDiagrams
367
- .map((path) => {
368
- const diagram = new DataSpaceDiagramAnalysisResult();
369
- diagram.title = path;
370
- diagram.diagram = getDiagram(path, graph);
371
- return diagram;
372
- })
373
- .concat(
374
- analysisResult.diagrams.map((diagramProtocol) => {
375
- const diagram = new DataSpaceDiagramAnalysisResult();
376
- diagram.title = diagramProtocol.title;
377
- diagram.description = diagramProtocol.description;
378
- diagram.diagram = getDiagram(diagramProtocol.diagram, graph);
379
- return diagram;
380
- }),
381
- );
365
+ // diagrams
366
+ result.diagrams = analysisResult.diagrams.map((diagramProtocol) => {
367
+ const diagram = new DataSpaceDiagramAnalysisResult();
368
+ diagram.title = diagramProtocol.title;
369
+ diagram.description = diagramProtocol.description;
370
+ diagram.diagram = getDiagram(diagramProtocol.diagram, graph);
371
+ return diagram;
372
+ });
382
373
 
383
374
  // executables
384
375
  result.executables = analysisResult.executables.map(
@@ -22,6 +22,8 @@ import {
22
22
  UnsupportedOperationError,
23
23
  customListWithSchema,
24
24
  usingConstantValueSchema,
25
+ isString,
26
+ isNonNullable,
25
27
  } from '@finos/legend-shared';
26
28
  import {
27
29
  createModelSchema,
@@ -317,15 +319,13 @@ export class V1_DataSpaceAnalysisResult {
317
319
  executionContexts: V1_DataSpaceExecutionContextAnalysisResult[] = [];
318
320
  defaultExecutionContext!: string;
319
321
 
320
- featuredDiagrams: string[] = [];
321
-
322
322
  elements: string[] = [];
323
323
  elementDocs: V1_DataSpaceModelDocumentationEntry[] = [];
324
324
 
325
325
  executables: V1_DataSpaceExecutableAnalysisResult[] = [];
326
326
  diagrams: V1_DataSpaceDiagramAnalysisResult[] = [];
327
327
 
328
- static readonly serialization = new SerializationFactory(
328
+ private static readonly serialization = new SerializationFactory(
329
329
  createModelSchema(V1_DataSpaceAnalysisResult, {
330
330
  name: primitive(),
331
331
  package: primitive(),
@@ -363,4 +363,35 @@ export class V1_DataSpaceAnalysisResult {
363
363
  ),
364
364
  }),
365
365
  );
366
+
367
+ static deserialize(
368
+ json: PlainObject<V1_DataSpaceAnalysisResult>,
369
+ ): V1_DataSpaceAnalysisResult {
370
+ const result = deserialize(
371
+ V1_DataSpaceAnalysisResult.serialization.schema,
372
+ json,
373
+ );
374
+ /**
375
+ * Featured diagrams will be transformed to diagrams, so here we nicely
376
+ * auto-transform it for backward compatibility
377
+ *
378
+ * @backwardCompatibility
379
+ */
380
+ if (json.featuredDiagrams && Array.isArray(json.featuredDiagrams)) {
381
+ const diagramResults = json.featuredDiagrams
382
+ .map((featuredDiagram) => {
383
+ if (isString(featuredDiagram)) {
384
+ const diagramAnalysisResult =
385
+ new V1_DataSpaceDiagramAnalysisResult();
386
+ diagramAnalysisResult.title = '';
387
+ diagramAnalysisResult.diagram = featuredDiagram;
388
+ return diagramAnalysisResult;
389
+ }
390
+ return undefined;
391
+ })
392
+ .filter(isNonNullable);
393
+ result.diagrams = result.diagrams.concat(diagramResults);
394
+ }
395
+ return result;
396
+ }
366
397
  }
@@ -24,48 +24,6 @@ import {
24
24
  type V1_TaggedValue,
25
25
  } from '@finos/legend-graph';
26
26
 
27
- export abstract class V1_DataSpaceSupportInfo implements Hashable {
28
- documentationUrl?: string | undefined;
29
-
30
- abstract get hashCode(): string;
31
- }
32
-
33
- export class V1_DataSpaceSupportEmail
34
- extends V1_DataSpaceSupportInfo
35
- implements Hashable
36
- {
37
- address!: string;
38
-
39
- get hashCode(): string {
40
- return hashArray([
41
- DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_SUPPORT_EMAIL,
42
- this.documentationUrl ?? '',
43
- this.address,
44
- ]);
45
- }
46
- }
47
-
48
- export class V1_DataSpaceSupportCombinedInfo
49
- extends V1_DataSpaceSupportInfo
50
- implements Hashable
51
- {
52
- emails?: string[] | undefined;
53
- website?: string | undefined;
54
- faqUrl?: string | undefined;
55
- supportUrl?: string | undefined;
56
-
57
- get hashCode(): string {
58
- return hashArray([
59
- DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_SUPPORT_COMBINED_INFO,
60
- this.documentationUrl ?? '',
61
- hashArray(this.emails ?? []),
62
- this.website ?? '',
63
- this.faqUrl ?? '',
64
- this.supportUrl ?? '',
65
- ]);
66
- }
67
- }
68
-
69
27
  export class V1_DataSpaceExecutionContext implements Hashable {
70
28
  name!: string;
71
29
  title?: string | undefined;
@@ -85,6 +43,19 @@ export class V1_DataSpaceExecutionContext implements Hashable {
85
43
  }
86
44
  }
87
45
 
46
+ export class V1_DataSpaceElementPointer implements Hashable {
47
+ path!: string;
48
+ exclude?: boolean | undefined;
49
+
50
+ get hashCode(): string {
51
+ return hashArray([
52
+ DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_ELEMENT_POINTER,
53
+ this.path,
54
+ this.exclude ?? '',
55
+ ]);
56
+ }
57
+ }
58
+
88
59
  export class V1_DataSpaceExecutable implements Hashable {
89
60
  title!: string;
90
61
  description?: string | undefined;
@@ -115,6 +86,48 @@ export class V1_DataSpaceDiagram implements Hashable {
115
86
  }
116
87
  }
117
88
 
89
+ export abstract class V1_DataSpaceSupportInfo implements Hashable {
90
+ documentationUrl?: string | undefined;
91
+
92
+ abstract get hashCode(): string;
93
+ }
94
+
95
+ export class V1_DataSpaceSupportEmail
96
+ extends V1_DataSpaceSupportInfo
97
+ implements Hashable
98
+ {
99
+ address!: string;
100
+
101
+ get hashCode(): string {
102
+ return hashArray([
103
+ DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_SUPPORT_EMAIL,
104
+ this.documentationUrl ?? '',
105
+ this.address,
106
+ ]);
107
+ }
108
+ }
109
+
110
+ export class V1_DataSpaceSupportCombinedInfo
111
+ extends V1_DataSpaceSupportInfo
112
+ implements Hashable
113
+ {
114
+ emails?: string[] | undefined;
115
+ website?: string | undefined;
116
+ faqUrl?: string | undefined;
117
+ supportUrl?: string | undefined;
118
+
119
+ get hashCode(): string {
120
+ return hashArray([
121
+ DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_SUPPORT_COMBINED_INFO,
122
+ this.documentationUrl ?? '',
123
+ hashArray(this.emails ?? []),
124
+ this.website ?? '',
125
+ this.faqUrl ?? '',
126
+ this.supportUrl ?? '',
127
+ ]);
128
+ }
129
+ }
130
+
118
131
  export class V1_DataSpace extends V1_PackageableElement implements Hashable {
119
132
  stereotypes: V1_StereotypePtr[] = [];
120
133
  taggedValues: V1_TaggedValue[] = [];
@@ -122,8 +135,7 @@ export class V1_DataSpace extends V1_PackageableElement implements Hashable {
122
135
  description?: string | undefined;
123
136
  executionContexts!: V1_DataSpaceExecutionContext[];
124
137
  defaultExecutionContext!: string;
125
- featuredDiagrams?: V1_PackageableElementPointer[] | undefined;
126
- elements?: V1_PackageableElementPointer[] | undefined;
138
+ elements?: V1_DataSpaceElementPointer[] | undefined;
127
139
  executables?: V1_DataSpaceExecutable[] | undefined;
128
140
  diagrams?: V1_DataSpaceDiagram[] | undefined;
129
141
  supportInfo?: V1_DataSpaceSupportInfo | undefined;
@@ -137,8 +149,7 @@ export class V1_DataSpace extends V1_PackageableElement implements Hashable {
137
149
  this.description ?? '',
138
150
  hashArray(this.executionContexts),
139
151
  this.defaultExecutionContext,
140
- hashArray((this.featuredDiagrams ?? []).map((pointer) => pointer.path)),
141
- hashArray((this.elements ?? []).map((pointer) => pointer.path)),
152
+ hashArray(this.elements ?? []),
142
153
  hashArray(this.executables ?? []),
143
154
  hashArray(this.diagrams ?? []),
144
155
  this.supportInfo ?? '',
@@ -28,7 +28,8 @@ import {
28
28
  import {
29
29
  V1_stereotypePtrSchema,
30
30
  V1_taggedValueSchema,
31
- V1_packageableElementPointerDeserializerSchema,
31
+ V1_packageableElementPointerModelSchema,
32
+ V1_PackageableElementPointer,
32
33
  } from '@finos/legend-graph';
33
34
  import {
34
35
  type PlainObject,
@@ -37,6 +38,8 @@ import {
37
38
  usingModelSchema,
38
39
  optionalCustomListWithSchema,
39
40
  customListWithSchema,
41
+ isString,
42
+ isNonNullable,
40
43
  } from '@finos/legend-shared';
41
44
  import {
42
45
  type V1_DataSpaceSupportInfo,
@@ -46,6 +49,7 @@ import {
46
49
  V1_DataSpaceSupportCombinedInfo,
47
50
  V1_DataSpaceExecutable,
48
51
  V1_DataSpaceDiagram,
52
+ V1_DataSpaceElementPointer,
49
53
  } from '../../model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js';
50
54
 
51
55
  export const V1_DATA_SPACE_ELEMENT_PROTOCOL_TYPE = 'dataSpace';
@@ -55,11 +59,9 @@ const V1_DATA_SPACE_SUPPORT_COMBINED_INFO_TYPE = 'combined';
55
59
  const V1_dataSpaceExecutionContextModelSchema = createModelSchema(
56
60
  V1_DataSpaceExecutionContext,
57
61
  {
58
- defaultRuntime: usingModelSchema(
59
- V1_packageableElementPointerDeserializerSchema,
60
- ),
62
+ defaultRuntime: usingModelSchema(V1_packageableElementPointerModelSchema),
61
63
  description: optional(primitive()),
62
- mapping: usingModelSchema(V1_packageableElementPointerDeserializerSchema),
64
+ mapping: usingModelSchema(V1_packageableElementPointerModelSchema),
63
65
  name: primitive(),
64
66
  title: optional(primitive()),
65
67
  },
@@ -119,35 +121,39 @@ export const V1_deserializeSupportInfo = (
119
121
  }
120
122
  };
121
123
 
124
+ const V1_dataSpaceElementPointerModelSchema = createModelSchema(
125
+ V1_DataSpaceElementPointer,
126
+ {
127
+ exclude: optional(primitive()),
128
+ path: primitive(),
129
+ },
130
+ );
131
+
122
132
  const V1_dataSpaceExecutableModelSchema = createModelSchema(
123
133
  V1_DataSpaceExecutable,
124
134
  {
125
135
  description: optional(primitive()),
126
- executable: usingModelSchema(
127
- V1_packageableElementPointerDeserializerSchema,
128
- ),
136
+ executable: usingModelSchema(V1_packageableElementPointerModelSchema),
129
137
  title: primitive(),
130
138
  },
131
139
  );
132
140
 
133
141
  const V1_dataSpaceDiagramModelSchema = createModelSchema(V1_DataSpaceDiagram, {
134
142
  description: optional(primitive()),
135
- diagram: usingModelSchema(V1_packageableElementPointerDeserializerSchema),
143
+ diagram: usingModelSchema(V1_packageableElementPointerModelSchema),
136
144
  title: primitive(),
137
145
  });
138
146
 
139
- export const V1_dataSpaceModelSchema = createModelSchema(V1_DataSpace, {
147
+ const V1_dataSpaceModelSchema = createModelSchema(V1_DataSpace, {
140
148
  _type: usingConstantValueSchema(V1_DATA_SPACE_ELEMENT_PROTOCOL_TYPE),
141
149
  defaultExecutionContext: primitive(),
142
150
  description: optional(primitive()),
143
151
  diagrams: list(object(V1_dataSpaceDiagramModelSchema)),
144
- elements: optionalCustomListWithSchema(
145
- V1_packageableElementPointerDeserializerSchema,
146
- ),
152
+ elements: optionalCustomListWithSchema(V1_dataSpaceElementPointerModelSchema),
147
153
  executables: list(object(V1_dataSpaceExecutableModelSchema)),
148
154
  executionContexts: list(object(V1_dataSpaceExecutionContextModelSchema)),
149
155
  featuredDiagrams: optionalCustomListWithSchema(
150
- V1_packageableElementPointerDeserializerSchema,
156
+ V1_packageableElementPointerModelSchema,
151
157
  ),
152
158
  name: primitive(),
153
159
  package: primitive(),
@@ -163,3 +169,42 @@ export const V1_dataSpaceModelSchema = createModelSchema(V1_DataSpace, {
163
169
  }),
164
170
  title: optional(primitive()),
165
171
  });
172
+
173
+ export const V1_serializeDataSpace = (
174
+ protocol: V1_DataSpace,
175
+ ): PlainObject<V1_DataSpace> => serialize(V1_dataSpaceModelSchema, protocol);
176
+
177
+ export const V1_deserializeDataSpace = (
178
+ json: PlainObject<V1_DataSpace>,
179
+ ): V1_DataSpace => {
180
+ const dataSpace = deserialize(V1_dataSpaceModelSchema, json);
181
+ /**
182
+ * Featured diagrams will be transformed to diagrams, so here we nicely
183
+ * auto-transform it for backward compatibility
184
+ *
185
+ * @backwardCompatibility
186
+ */
187
+ if (json.featuredDiagrams && Array.isArray(json.featuredDiagrams)) {
188
+ const diagrams = json.featuredDiagrams
189
+ .map((featuredDiagram) => {
190
+ if (isString(featuredDiagram.path)) {
191
+ const diagram = new V1_DataSpaceDiagram();
192
+ diagram.title = '';
193
+ diagram.diagram = new V1_PackageableElementPointer(
194
+ undefined,
195
+ featuredDiagram.path,
196
+ );
197
+ return diagram;
198
+ }
199
+ return undefined;
200
+ })
201
+ .filter(isNonNullable);
202
+ if (diagrams.length) {
203
+ dataSpace.diagrams =
204
+ dataSpace.diagrams !== undefined
205
+ ? dataSpace.diagrams.concat(diagrams)
206
+ : diagrams;
207
+ }
208
+ }
209
+ return dataSpace;
210
+ };
@@ -49,6 +49,7 @@ export enum DATA_SPACE_VIEWER_ACTIVITY_MODE {
49
49
 
50
50
  DATA_STORES = 'DATA_STORES', // TODO: with test-data, also let user call TDS query on top of these
51
51
  DATA_AVAILABILITY = 'DATA_AVAILABILITY',
52
+ DATA_READINESS = 'DATA_READINESS',
52
53
  DATA_COST = 'DATA_COST',
53
54
  DATA_GOVERNANCE = 'DATA_GOVERNANCE',
54
55
  INFO = 'INFO', // TODO: test coverage? (or maybe this should be done in elements/diagrams/data-quality section)