@finos/legend-application-studio 28.18.148 → 28.19.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/application/LegendIngestionConfiguration.d.ts +1 -5
- package/lib/application/LegendIngestionConfiguration.d.ts.map +1 -1
- package/lib/application/LegendIngestionConfiguration.js +1 -8
- package/lib/application/LegendIngestionConfiguration.js.map +1 -1
- package/lib/components/ElementIconUtils.d.ts.map +1 -1
- package/lib/components/ElementIconUtils.js +3 -1
- package/lib/components/ElementIconUtils.js.map +1 -1
- package/lib/components/editor/editor-group/EditorGroup.d.ts +2 -0
- package/lib/components/editor/editor-group/EditorGroup.d.ts.map +1 -1
- package/lib/components/editor/editor-group/EditorGroup.js +6 -0
- package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.js +140 -26
- package/lib/components/editor/editor-group/dataProduct/DataPoductEditor.js.map +1 -1
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts +1 -0
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.js +21 -3
- package/lib/components/editor/editor-group/function-activator/FunctionEditor.js.map +1 -1
- package/lib/{stores/ingestion/AdhocDataProductDeployResponse.js → components/editor/editor-group/function-activator/MemSQLFunctionActivatorEditor.d.ts} +3 -8
- package/lib/components/editor/editor-group/function-activator/MemSQLFunctionActivatorEditor.d.ts.map +1 -0
- package/lib/components/editor/editor-group/function-activator/MemSQLFunctionActivatorEditor.js +89 -0
- package/lib/components/editor/editor-group/function-activator/MemSQLFunctionActivatorEditor.js.map +1 -0
- package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js +1 -1
- package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js +1 -2
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/package.json +2 -1
- package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/editor/EditorGraphState.js +4 -1
- package/lib/stores/editor/EditorGraphState.js.map +1 -1
- package/lib/stores/editor/EditorStore.d.ts +2 -2
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +2 -2
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/EditorTabManagerState.d.ts.map +1 -1
- package/lib/stores/editor/EditorTabManagerState.js +5 -1
- package/lib/stores/editor/EditorTabManagerState.js.map +1 -1
- package/lib/stores/editor/data-cube/LegendStudioDataCubeHelper.d.ts +2 -2
- package/lib/stores/editor/data-cube/LegendStudioDataCubeHelper.d.ts.map +1 -1
- package/lib/stores/editor/data-cube/LegendStudioDataCubeHelper.js +4 -3
- package/lib/stores/editor/data-cube/LegendStudioDataCubeHelper.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.js +14 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +3 -0
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +24 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +9 -4
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +23 -4
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.js +3 -3
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/MemSQLFunctionActivatorEditorState.d.ts +33 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/MemSQLFunctionActivatorEditorState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/MemSQLFunctionActivatorEditorState.js +86 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/MemSQLFunctionActivatorEditorState.js.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js +28 -2
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts +2 -3
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +4 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js +24 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/lib/stores/editor/utils/ModelClassifierUtils.d.ts +1 -0
- package/lib/stores/editor/utils/ModelClassifierUtils.d.ts.map +1 -1
- package/lib/stores/editor/utils/ModelClassifierUtils.js +1 -0
- package/lib/stores/editor/utils/ModelClassifierUtils.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts +3 -2
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js +7 -4
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js.map +1 -1
- package/package.json +9 -8
- package/src/application/LegendIngestionConfiguration.ts +1 -12
- package/src/components/ElementIconUtils.tsx +3 -0
- package/src/components/editor/editor-group/EditorGroup.tsx +10 -0
- package/src/components/editor/editor-group/dataProduct/DataPoductEditor.tsx +375 -65
- package/src/components/editor/editor-group/function-activator/FunctionEditor.tsx +40 -2
- package/src/components/editor/editor-group/function-activator/MemSQLFunctionActivatorEditor.tsx +269 -0
- package/src/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.tsx +1 -1
- package/src/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.tsx +1 -2
- package/src/index.ts +2 -0
- package/src/stores/editor/EditorGraphState.ts +3 -0
- package/src/stores/editor/EditorStore.ts +7 -5
- package/src/stores/editor/EditorTabManagerState.ts +4 -0
- package/src/stores/editor/data-cube/LegendStudioDataCubeHelper.ts +14 -2
- package/src/stores/editor/editor-state/element-editor-state/FunctionActivatorState.ts +15 -0
- package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +50 -0
- package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +31 -5
- package/src/stores/editor/editor-state/element-editor-state/function-activator/HostedServiceFunctionActivatorEditorState.ts +3 -3
- package/src/stores/editor/editor-state/element-editor-state/function-activator/MemSQLFunctionActivatorEditorState.ts +130 -0
- package/src/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.ts +38 -7
- package/src/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.ts +3 -3
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +51 -0
- package/src/stores/editor/utils/ModelClassifierUtils.ts +1 -0
- package/src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts +10 -4
- package/tsconfig.json +2 -5
- package/lib/stores/ingestion/AdhocDataProductDeployResponse.d.ts +0 -21
- package/lib/stores/ingestion/AdhocDataProductDeployResponse.d.ts.map +0 -1
- package/lib/stores/ingestion/AdhocDataProductDeployResponse.js.map +0 -1
- package/lib/stores/ingestion/IngestDeploymentServerClient.d.ts +0 -35
- package/lib/stores/ingestion/IngestDeploymentServerClient.d.ts.map +0 -1
- package/lib/stores/ingestion/IngestDeploymentServerClient.js +0 -58
- package/lib/stores/ingestion/IngestDeploymentServerClient.js.map +0 -1
- package/lib/stores/ingestion/IngestDiscoveryServerClient.d.ts +0 -26
- package/lib/stores/ingestion/IngestDiscoveryServerClient.d.ts.map +0 -1
- package/lib/stores/ingestion/IngestDiscoveryServerClient.js +0 -35
- package/lib/stores/ingestion/IngestDiscoveryServerClient.js.map +0 -1
- package/lib/stores/ingestion/IngestionDeploymentResponse.d.ts +0 -41
- package/lib/stores/ingestion/IngestionDeploymentResponse.d.ts.map +0 -1
- package/lib/stores/ingestion/IngestionDeploymentResponse.js +0 -56
- package/lib/stores/ingestion/IngestionDeploymentResponse.js.map +0 -1
- package/lib/stores/ingestion/IngestionManager.d.ts +0 -38
- package/lib/stores/ingestion/IngestionManager.d.ts.map +0 -1
- package/lib/stores/ingestion/IngestionManager.js +0 -111
- package/lib/stores/ingestion/IngestionManager.js.map +0 -1
- package/src/stores/ingestion/AdhocDataProductDeployResponse.ts +0 -29
- package/src/stores/ingestion/IngestDeploymentServerClient.ts +0 -112
- package/src/stores/ingestion/IngestDiscoveryServerClient.ts +0 -52
- package/src/stores/ingestion/IngestionDeploymentResponse.ts +0 -74
- package/src/stores/ingestion/IngestionManager.ts +0 -219
@@ -1,219 +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 type { AppDirNode } from '@finos/legend-graph';
|
18
|
-
import { IngestDeploymentServerClient } from './IngestDeploymentServerClient.js';
|
19
|
-
import { IngestDiscoveryServerClient } from './IngestDiscoveryServerClient.js';
|
20
|
-
import type { GenericLegendApplicationStore } from '@finos/legend-application';
|
21
|
-
import {
|
22
|
-
NetworkClientError,
|
23
|
-
type PlainObject,
|
24
|
-
assertErrorThrown,
|
25
|
-
} from '@finos/legend-shared';
|
26
|
-
import {
|
27
|
-
type IngestDefinitionValidationResponse,
|
28
|
-
IngestDefinitionDeploymentResponse,
|
29
|
-
IngestDefinitionValidationResponseStatus,
|
30
|
-
ValidateAndDeploymentResponse,
|
31
|
-
createIngestDefinitionValidationResponse,
|
32
|
-
} from './IngestionDeploymentResponse.js';
|
33
|
-
import {
|
34
|
-
IngestDeploymentServerConfig,
|
35
|
-
type LegendIngestionConfiguration,
|
36
|
-
} from '../../application/LegendIngestionConfiguration.js';
|
37
|
-
import {
|
38
|
-
createAdhocDataProductDeployResponse,
|
39
|
-
type AdhocDataProductDeployResponse,
|
40
|
-
} from './AdhocDataProductDeployResponse.js';
|
41
|
-
|
42
|
-
export class IngestionManager {
|
43
|
-
private readonly applicationStore: GenericLegendApplicationStore;
|
44
|
-
private ingestDiscoveryServerClient: IngestDiscoveryServerClient;
|
45
|
-
private ingestDeploymentServerClient: IngestDeploymentServerClient;
|
46
|
-
private _currentAppID: number | undefined;
|
47
|
-
private _currentLevel: string | undefined;
|
48
|
-
private useDefaultServer = false;
|
49
|
-
|
50
|
-
constructor(
|
51
|
-
config: LegendIngestionConfiguration,
|
52
|
-
applicationStore: GenericLegendApplicationStore,
|
53
|
-
) {
|
54
|
-
this.ingestDiscoveryServerClient = new IngestDiscoveryServerClient(
|
55
|
-
config.discoveryUrl,
|
56
|
-
);
|
57
|
-
this.ingestDiscoveryServerClient.setTracerService(
|
58
|
-
applicationStore.tracerService,
|
59
|
-
);
|
60
|
-
this.ingestDeploymentServerClient = new IngestDeploymentServerClient(
|
61
|
-
config.deployment.defaultServer,
|
62
|
-
);
|
63
|
-
this.ingestDeploymentServerClient.setTracerService(
|
64
|
-
applicationStore.tracerService,
|
65
|
-
);
|
66
|
-
this.useDefaultServer = Boolean(config.deployment.useDefaultServer);
|
67
|
-
this.applicationStore = applicationStore;
|
68
|
-
}
|
69
|
-
|
70
|
-
isCurrentAppDirNode(appDirNode: AppDirNode): boolean {
|
71
|
-
return (
|
72
|
-
this._currentAppID === appDirNode.appDirId &&
|
73
|
-
this._currentLevel === appDirNode.level
|
74
|
-
);
|
75
|
-
}
|
76
|
-
|
77
|
-
setCurrentAppDirNode(appDirNode: AppDirNode): void {
|
78
|
-
this._currentAppID = appDirNode.appDirId;
|
79
|
-
this._currentLevel = appDirNode.level;
|
80
|
-
}
|
81
|
-
|
82
|
-
async deploy(
|
83
|
-
ingestDefinition: string,
|
84
|
-
appDirNode: AppDirNode,
|
85
|
-
messageCallBack: (message: string) => void,
|
86
|
-
token: string | undefined,
|
87
|
-
): Promise<ValidateAndDeploymentResponse> {
|
88
|
-
messageCallBack(
|
89
|
-
`Discovering associated ingest environment for DID ${appDirNode.appDirId}...`,
|
90
|
-
);
|
91
|
-
await this.identifyIngestDeploymentServer(appDirNode, token);
|
92
|
-
messageCallBack(
|
93
|
-
`Validating ingest with server ${this.ingestDeploymentServerClient.baseUrl ?? ''} for realm ${this.ingestDeploymentServerClient.environmentClassification}...`,
|
94
|
-
);
|
95
|
-
const validateResonse = await this._validate(
|
96
|
-
ingestDefinition,
|
97
|
-
undefined,
|
98
|
-
token,
|
99
|
-
);
|
100
|
-
const fullResponse = new ValidateAndDeploymentResponse(
|
101
|
-
validateResonse,
|
102
|
-
undefined,
|
103
|
-
);
|
104
|
-
if (
|
105
|
-
validateResonse.status !==
|
106
|
-
IngestDefinitionValidationResponseStatus.SUCCESS
|
107
|
-
) {
|
108
|
-
return fullResponse;
|
109
|
-
}
|
110
|
-
messageCallBack(
|
111
|
-
`Validation Success. Deploying ingest with server ${this.ingestDeploymentServerClient.baseUrl ?? ''} for realm ${this.ingestDeploymentServerClient.environmentClassification}...`,
|
112
|
-
);
|
113
|
-
const deployResponse = await this._deploy(
|
114
|
-
ingestDefinition,
|
115
|
-
undefined,
|
116
|
-
token,
|
117
|
-
);
|
118
|
-
try {
|
119
|
-
messageCallBack(`Deployment Success. Fetching write location...`);
|
120
|
-
await this._fetchDeployLocations(deployResponse, token);
|
121
|
-
} catch (error) {
|
122
|
-
assertErrorThrown(error);
|
123
|
-
}
|
124
|
-
|
125
|
-
return fullResponse;
|
126
|
-
}
|
127
|
-
|
128
|
-
async deployDataProduct(
|
129
|
-
grammarText: string,
|
130
|
-
appDirNode: AppDirNode,
|
131
|
-
messageCallBack: (message: string) => void,
|
132
|
-
token: string | undefined,
|
133
|
-
): Promise<AdhocDataProductDeployResponse> {
|
134
|
-
messageCallBack(
|
135
|
-
`Discovering associated data product environment for DID ${appDirNode.appDirId}...`,
|
136
|
-
);
|
137
|
-
await this.identifyIngestDeploymentServer(appDirNode, token);
|
138
|
-
messageCallBack(
|
139
|
-
`Deploying data product with server ${this.ingestDeploymentServerClient.baseUrl ?? ''} for realm ${this.ingestDeploymentServerClient.environmentClassification}...`,
|
140
|
-
);
|
141
|
-
const deployResponse =
|
142
|
-
await this.ingestDeploymentServerClient.deployDataProduct(
|
143
|
-
grammarText,
|
144
|
-
token,
|
145
|
-
);
|
146
|
-
return createAdhocDataProductDeployResponse(deployResponse);
|
147
|
-
}
|
148
|
-
|
149
|
-
private async _validate(
|
150
|
-
ingestDefinition: string,
|
151
|
-
appDirNode: AppDirNode | undefined,
|
152
|
-
token: string | undefined,
|
153
|
-
): Promise<IngestDefinitionValidationResponse> {
|
154
|
-
if (appDirNode) {
|
155
|
-
await this.identifyIngestDeploymentServer(appDirNode, token);
|
156
|
-
}
|
157
|
-
try {
|
158
|
-
const response = await this.ingestDeploymentServerClient.validate(
|
159
|
-
ingestDefinition,
|
160
|
-
token,
|
161
|
-
);
|
162
|
-
return createIngestDefinitionValidationResponse(response);
|
163
|
-
} catch (error) {
|
164
|
-
assertErrorThrown(error);
|
165
|
-
if (error instanceof NetworkClientError) {
|
166
|
-
return createIngestDefinitionValidationResponse(
|
167
|
-
error.payload as PlainObject<IngestDefinitionValidationResponse>,
|
168
|
-
);
|
169
|
-
}
|
170
|
-
throw error;
|
171
|
-
}
|
172
|
-
}
|
173
|
-
|
174
|
-
private async _deploy(
|
175
|
-
ingestDefinition: string,
|
176
|
-
appDirNode: AppDirNode | undefined,
|
177
|
-
token: string | undefined,
|
178
|
-
): Promise<IngestDefinitionDeploymentResponse> {
|
179
|
-
if (appDirNode) {
|
180
|
-
await this.identifyIngestDeploymentServer(appDirNode, token);
|
181
|
-
}
|
182
|
-
// validate
|
183
|
-
const response = (await this.ingestDeploymentServerClient.deploy(
|
184
|
-
ingestDefinition,
|
185
|
-
token,
|
186
|
-
)) as unknown as PlainObject<IngestDefinitionDeploymentResponse>;
|
187
|
-
return IngestDefinitionDeploymentResponse.serialization.fromJson(response);
|
188
|
-
}
|
189
|
-
|
190
|
-
private async _fetchDeployLocations(
|
191
|
-
depploymentResponse: IngestDefinitionDeploymentResponse,
|
192
|
-
token: string | undefined,
|
193
|
-
): Promise<void> {
|
194
|
-
const response = (await this.ingestDeploymentServerClient.write_location(
|
195
|
-
depploymentResponse.ingestDefinitionUrn,
|
196
|
-
token,
|
197
|
-
)) as unknown as PlainObject;
|
198
|
-
depploymentResponse.write_location = response;
|
199
|
-
}
|
200
|
-
|
201
|
-
private async identifyIngestDeploymentServer(
|
202
|
-
appDirNode: AppDirNode,
|
203
|
-
token: string | undefined,
|
204
|
-
): Promise<void> {
|
205
|
-
// we do not change if current appDirNode is the same as the one we are trying to set
|
206
|
-
if (this.useDefaultServer || this.isCurrentAppDirNode(appDirNode)) {
|
207
|
-
return;
|
208
|
-
}
|
209
|
-
const serverConfig = IngestDeploymentServerConfig.serialization.fromJson(
|
210
|
-
await this.ingestDiscoveryServerClient.findProducerServer(
|
211
|
-
appDirNode.appDirId,
|
212
|
-
appDirNode.level,
|
213
|
-
token,
|
214
|
-
),
|
215
|
-
);
|
216
|
-
this.ingestDeploymentServerClient.changeServer(serverConfig);
|
217
|
-
this.setCurrentAppDirNode(appDirNode);
|
218
|
-
}
|
219
|
-
}
|