@finos/legend-extension-dsl-data-space 6.1.11 → 6.1.13

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 (74) hide show
  1. package/lib/DSLDataSpace_Const.d.ts +2 -0
  2. package/lib/DSLDataSpace_Const.d.ts.map +1 -1
  3. package/lib/DSLDataSpace_Const.js +2 -0
  4. package/lib/DSLDataSpace_Const.js.map +1 -1
  5. package/lib/components/{query/DataSpaceQueryEditor.d.ts → DSLDataSpace_Icon.d.ts} +2 -4
  6. package/lib/components/DSLDataSpace_Icon.d.ts.map +1 -0
  7. package/lib/components/DSLDataSpace_Icon.js +19 -0
  8. package/lib/components/DSLDataSpace_Icon.js.map +1 -0
  9. package/lib/components/DataSpaceViewer.d.ts +0 -1
  10. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  11. package/lib/components/query/DSLDataSpace_LegendQueryApplicationPlugin.d.ts +3 -2
  12. package/lib/components/query/DSLDataSpace_LegendQueryApplicationPlugin.d.ts.map +1 -1
  13. package/lib/components/query/DSLDataSpace_LegendQueryApplicationPlugin.js +99 -8
  14. package/lib/components/query/DSLDataSpace_LegendQueryApplicationPlugin.js.map +1 -1
  15. package/lib/components/query/DataSpaceQueryBuilder.d.ts +18 -0
  16. package/lib/components/query/DataSpaceQueryBuilder.d.ts.map +1 -0
  17. package/lib/components/query/DataSpaceQueryBuilder.js +126 -0
  18. package/lib/components/query/DataSpaceQueryBuilder.js.map +1 -0
  19. package/lib/components/query/DataSpaceQueryCreator.d.ts +19 -0
  20. package/lib/components/query/DataSpaceQueryCreator.d.ts.map +1 -0
  21. package/lib/components/query/{DataSpaceQueryEditor.js → DataSpaceQueryCreator.js} +11 -11
  22. package/lib/components/query/DataSpaceQueryCreator.js.map +1 -0
  23. package/lib/components/query/DataSpaceQuerySetup.d.ts +0 -1
  24. package/lib/components/query/DataSpaceQuerySetup.d.ts.map +1 -1
  25. package/lib/components/query/DataSpaceQuerySetup.js +6 -8
  26. package/lib/components/query/DataSpaceQuerySetup.js.map +1 -1
  27. package/lib/components/studio/DSLDataSpace_LegendStudioApplicationPlugin.d.ts +4 -4
  28. package/lib/components/studio/DSLDataSpace_LegendStudioApplicationPlugin.d.ts.map +1 -1
  29. package/lib/components/studio/DSLDataSpace_LegendStudioApplicationPlugin.js +5 -5
  30. package/lib/components/studio/DSLDataSpace_LegendStudioApplicationPlugin.js.map +1 -1
  31. package/lib/index.css +2 -2
  32. package/lib/index.css.map +1 -1
  33. package/lib/package.json +8 -7
  34. package/lib/stores/query/DSLDataSpace_LegendQueryRouter.d.ts +11 -8
  35. package/lib/stores/query/DSLDataSpace_LegendQueryRouter.d.ts.map +1 -1
  36. package/lib/stores/query/DSLDataSpace_LegendQueryRouter.js +15 -11
  37. package/lib/stores/query/DSLDataSpace_LegendQueryRouter.js.map +1 -1
  38. package/lib/stores/query/DataSpaceInfo.d.ts +31 -0
  39. package/lib/stores/query/DataSpaceInfo.d.ts.map +1 -0
  40. package/lib/stores/query/DataSpaceInfo.js +34 -0
  41. package/lib/stores/query/DataSpaceInfo.js.map +1 -0
  42. package/lib/stores/query/DataSpaceQueryBuilderState.d.ts +52 -0
  43. package/lib/stores/query/DataSpaceQueryBuilderState.d.ts.map +1 -0
  44. package/lib/stores/query/DataSpaceQueryBuilderState.js +112 -0
  45. package/lib/stores/query/DataSpaceQueryBuilderState.js.map +1 -0
  46. package/lib/stores/query/{DataSpaceQueryEditorStore.d.ts → DataSpaceQueryCreatorStore.d.ts} +6 -3
  47. package/lib/stores/query/DataSpaceQueryCreatorStore.d.ts.map +1 -0
  48. package/lib/stores/query/DataSpaceQueryCreatorStore.js +113 -0
  49. package/lib/stores/query/DataSpaceQueryCreatorStore.js.map +1 -0
  50. package/lib/stores/query/DataSpaceQuerySetupState.d.ts +5 -12
  51. package/lib/stores/query/DataSpaceQuerySetupState.d.ts.map +1 -1
  52. package/lib/stores/query/DataSpaceQuerySetupState.js +9 -19
  53. package/lib/stores/query/DataSpaceQuerySetupState.js.map +1 -1
  54. package/package.json +18 -17
  55. package/src/DSLDataSpace_Const.ts +3 -0
  56. package/src/components/DSLDataSpace_Icon.tsx +23 -0
  57. package/src/components/query/DSLDataSpace_LegendQueryApplicationPlugin.tsx +170 -8
  58. package/src/components/query/DataSpaceQueryBuilder.tsx +344 -0
  59. package/src/components/query/{DataSpaceQueryEditor.tsx → DataSpaceQueryCreator.tsx} +13 -13
  60. package/src/components/query/DataSpaceQuerySetup.tsx +10 -14
  61. package/src/components/studio/DSLDataSpace_LegendStudioApplicationPlugin.tsx +7 -11
  62. package/src/stores/query/DSLDataSpace_LegendQueryRouter.ts +17 -15
  63. package/src/stores/query/DataSpaceInfo.ts +57 -0
  64. package/src/stores/query/DataSpaceQueryBuilderState.ts +178 -0
  65. package/src/stores/query/DataSpaceQueryCreatorStore.ts +241 -0
  66. package/src/stores/query/DataSpaceQuerySetupState.ts +18 -32
  67. package/tsconfig.json +7 -3
  68. package/tsconfig.package.json +1 -1
  69. package/lib/components/query/DataSpaceQueryEditor.d.ts.map +0 -1
  70. package/lib/components/query/DataSpaceQueryEditor.js.map +0 -1
  71. package/lib/stores/query/DataSpaceQueryEditorStore.d.ts.map +0 -1
  72. package/lib/stores/query/DataSpaceQueryEditorStore.js +0 -98
  73. package/lib/stores/query/DataSpaceQueryEditorStore.js.map +0 -1
  74. package/src/stores/query/DataSpaceQueryEditorStore.ts +0 -173
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataSpaceQueryEditorStore.js","sourceRoot":"","sources":["../../../src/stores/query/DataSpaceQueryEditorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,0BAA0B,EAC1B,gBAAgB,EAChB,cAAc,EACd,mCAAmC,EACnC,mBAAmB,EACnB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,GAIjB,MAAM,iCAAiC,CAAC;AAKzC,OAAO,EACL,uBAAuB,EACvB,oB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D,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
@@ -1,173 +0,0 @@
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 {
18
- type Query,
19
- extractElementNameFromPath,
20
- QueryTaggedValue,
21
- RuntimePointer,
22
- PackageableElementExplicitReference,
23
- getAllClassMappings,
24
- isSystemElement,
25
- } from '@finos/legend-graph';
26
- import {
27
- QueryEditorStore,
28
- type QueryExportConfiguration,
29
- type LegendQueryPluginManager,
30
- type LegendQueryApplicationStore,
31
- } from '@finos/legend-application-query';
32
- import type {
33
- DepotServerClient,
34
- ProjectGAVCoordinates,
35
- } from '@finos/legend-server-depot';
36
- import {
37
- getNullableFirstElement,
38
- guaranteeNonNullable,
39
- uuid,
40
- } from '@finos/legend-shared';
41
- import {
42
- QUERY_PROFILE_PATH,
43
- QUERY_PROFILE_TAG_DATA_SPACE,
44
- } from '../../DSLDataSpace_Const.js';
45
- import { getDataSpace } from '../../graphManager/DSLDataSpace_GraphManagerHelper.js';
46
-
47
- const createQueryDataSpaceTaggedValue = (
48
- dataSpacePath: string,
49
- ): QueryTaggedValue => {
50
- const taggedValue = new QueryTaggedValue();
51
- taggedValue.profile = QUERY_PROFILE_PATH;
52
- taggedValue.tag = QUERY_PROFILE_TAG_DATA_SPACE;
53
- taggedValue.value = dataSpacePath;
54
- return taggedValue;
55
- };
56
-
57
- export class DataSpaceQueryEditorStore extends QueryEditorStore {
58
- groupId: string;
59
- artifactId: string;
60
- versionId: string;
61
- dataSpacePath: string;
62
- executionContext: string;
63
- runtimePath: string | undefined;
64
- classPath: string | undefined;
65
-
66
- constructor(
67
- applicationStore: LegendQueryApplicationStore,
68
- depotServerClient: DepotServerClient,
69
- pluginManager: LegendQueryPluginManager,
70
- groupId: string,
71
- artifactId: string,
72
- versionId: string,
73
- dataSpacePath: string,
74
- executionContext: string,
75
- runtimePath: string | undefined,
76
- executionKey: string | undefined,
77
- ) {
78
- super(applicationStore, depotServerClient, pluginManager);
79
-
80
- this.groupId = groupId;
81
- this.artifactId = artifactId;
82
- this.versionId = versionId;
83
- this.dataSpacePath = dataSpacePath;
84
- this.executionContext = executionContext;
85
- this.runtimePath = runtimePath;
86
- this.classPath = executionKey;
87
- }
88
-
89
- getProjectInfo(): ProjectGAVCoordinates {
90
- return {
91
- groupId: this.groupId,
92
- artifactId: this.artifactId,
93
- versionId: this.versionId,
94
- };
95
- }
96
-
97
- async setUpBuilderState(): Promise<void> {
98
- this.queryBuilderState.querySetupState.setMappingIsReadOnly(true);
99
- this.queryBuilderState.querySetupState.setRuntimeIsReadOnly(true);
100
-
101
- const dataSpace = getDataSpace(
102
- this.dataSpacePath,
103
- this.graphManagerState.graph,
104
- );
105
- const executionContext = guaranteeNonNullable(
106
- dataSpace.executionContexts.find(
107
- (context) => context.name === this.executionContext,
108
- ),
109
- `Can't find execution context '${this.executionContext}'`,
110
- );
111
- this.queryBuilderState.querySetupState.setMapping(
112
- executionContext.mapping.value,
113
- );
114
- this.queryBuilderState.querySetupState.setRuntimeValue(
115
- new RuntimePointer(
116
- PackageableElementExplicitReference.create(
117
- this.runtimePath
118
- ? this.graphManagerState.graph.getRuntime(this.runtimePath)
119
- : executionContext.defaultRuntime.value,
120
- ),
121
- ),
122
- );
123
-
124
- if (this.classPath) {
125
- this.queryBuilderState.changeClass(
126
- this.queryBuilderState.graphManagerState.graph.getClass(this.classPath),
127
- );
128
- this.queryBuilderState.querySetupState.setClassIsReadOnly(true);
129
- } else {
130
- // try to find a class to set
131
- // first, find classes which is mapped by the mapping
132
- // then, find any classes except for class coming from system
133
- // if none found, default to a dummy blank query
134
- const defaultClass =
135
- getNullableFirstElement(
136
- this.queryBuilderState.querySetupState.mapping
137
- ? getAllClassMappings(
138
- this.queryBuilderState.querySetupState.mapping,
139
- ).map((classMapping) => classMapping.class.value)
140
- : [],
141
- ) ??
142
- getNullableFirstElement(
143
- this.queryBuilderState.graphManagerState.graph.classes.filter(
144
- (el) => !isSystemElement(el),
145
- ),
146
- );
147
- if (defaultClass) {
148
- this.queryBuilderState.changeClass(defaultClass);
149
- } else {
150
- this.queryBuilderState.initialize(
151
- this.queryBuilderState.graphManagerState.graphManager.createDefaultBasicRawLambda(),
152
- );
153
- }
154
- }
155
- }
156
-
157
- async getExportConfiguration(): Promise<QueryExportConfiguration> {
158
- return {
159
- defaultName: `New Query for ${extractElementNameFromPath(
160
- this.dataSpacePath,
161
- )}[${this.executionContext}]`,
162
- decorator: (query: Query): void => {
163
- query.id = uuid();
164
- query.groupId = this.groupId;
165
- query.artifactId = this.artifactId;
166
- query.versionId = this.versionId;
167
- query.taggedValues = [
168
- createQueryDataSpaceTaggedValue(this.dataSpacePath),
169
- ];
170
- },
171
- };
172
- }
173
- }