@finos/legend-query-builder 4.14.30 → 4.14.32
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilder.d.ts +1 -1
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +36 -3
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +3 -3
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.js +23 -15
- package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +1 -1
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js +5 -10
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +7 -7
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
- package/lib/graph/QueryBuilderMetaModelConst.d.ts +3 -0
- package/lib/graph/QueryBuilderMetaModelConst.d.ts.map +1 -1
- package/lib/graph/QueryBuilderMetaModelConst.js +5 -0
- package/lib/graph/QueryBuilderMetaModelConst.js.map +1 -1
- package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +4 -1
- package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +51 -3
- package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js.map +1 -1
- package/lib/index.css +17 -1
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderResultState.js +1 -0
- package/lib/stores/QueryBuilderResultState.js.map +1 -1
- package/lib/stores/QueryBuilderState.d.ts +4 -1
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +12 -1
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts +2 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.js +40 -5
- package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts +5 -0
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
- package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js +1 -1
- package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +1 -0
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts +2 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js +7 -0
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +1 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +4 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderAdvancedWorkflowState.d.ts +2 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderAdvancedWorkflowState.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderAdvancedWorkflowState.js +2 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderAdvancedWorkflowState.js.map +1 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +4 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +3 -3
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +9 -2
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts +2 -9
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +45 -36
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.d.ts +20 -0
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.js +55 -0
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.js.map +1 -0
- package/{src/stores/workflow/QueryBuilderWorkFlowState.ts → lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.d.ts} +5 -12
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.js +54 -0
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.js.map +1 -0
- package/lib/stores/{workflow → query-workflow}/QueryBuilderWorkFlowState.d.ts +12 -0
- package/lib/stores/query-workflow/QueryBuilderWorkFlowState.d.ts.map +1 -0
- package/lib/stores/{workflow → query-workflow}/QueryBuilderWorkFlowState.js +18 -0
- package/lib/stores/query-workflow/QueryBuilderWorkFlowState.js.map +1 -0
- package/lib/stores/workflows/FunctionQueryBuilderState.d.ts +1 -1
- package/lib/stores/workflows/FunctionQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/workflows/MappingQueryBuilderState.d.ts +1 -1
- package/lib/stores/workflows/MappingQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.d.ts +1 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/components/QueryBuilder.tsx +77 -2
- package/src/components/QueryBuilderPropertyExpressionEditor.tsx +34 -20
- package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +1 -1
- package/src/components/fetch-structure/QueryBuilderFetchStructurePanel.tsx +29 -29
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +9 -16
- package/src/graph/QueryBuilderMetaModelConst.ts +7 -0
- package/src/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +3 -3
- package/src/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +122 -1
- package/src/index.ts +1 -1
- package/src/stores/QueryBuilderResultState.ts +1 -0
- package/src/stores/QueryBuilderState.ts +17 -1
- package/src/stores/QueryBuilderStateBuilder.ts +83 -10
- package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +5 -0
- package/src/stores/__test-utils__/QueryBuilderStateTestUtils.ts +1 -1
- package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +1 -0
- package/src/stores/fetch-structure/QueryBuilderFetchStructureState.ts +15 -0
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +5 -0
- package/src/stores/fetch-structure/tds/QueryBuilderAdvancedWorkflowState.ts +0 -0
- package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +5 -0
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +9 -2
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +90 -81
- package/src/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.ts +108 -0
- package/src/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.ts +103 -0
- package/src/stores/query-workflow/QueryBuilderWorkFlowState.ts +64 -0
- package/src/stores/workflows/FunctionQueryBuilderState.ts +1 -1
- package/src/stores/workflows/MappingQueryBuilderState.ts +1 -1
- package/src/stores/workflows/ServiceQueryBuilderState.ts +1 -1
- package/tsconfig.json +4 -1
- package/lib/stores/workflow/QueryBuilderWorkFlowState.d.ts.map +0 -1
- package/lib/stores/workflow/QueryBuilderWorkFlowState.js.map +0 -1
package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js
CHANGED
@@ -19,10 +19,11 @@ import { QueryBuilderDerivationProjectionColumnState, QueryBuilderSimpleProjecti
|
|
19
19
|
import {} from '../QueryResultSetModifierState.js';
|
20
20
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../graph/QueryBuilderMetaModelConst.js';
|
21
21
|
import { buildGenericLambdaFunctionInstanceValue } from '../../../QueryBuilderValueSpecificationHelper.js';
|
22
|
-
import { buildPropertyExpressionChain } from '../../../QueryBuilderValueSpecificationBuilderHelper.js';
|
22
|
+
import { buildPropertyExpressionChain, } from '../../../QueryBuilderValueSpecificationBuilderHelper.js';
|
23
23
|
import { appendOLAPGroupByState } from '../window/QueryBuilderWindowValueSpecificationBuilder.js';
|
24
24
|
import { appendPostFilter } from '../post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js';
|
25
25
|
import { buildTDSSortTypeExpression } from '../QueryBuilderTDSHelper.js';
|
26
|
+
import { buildRelationProjection } from './QueryBuilderRelationProjectValueSpecBuidler.js';
|
26
27
|
const buildSortExpression = (sortColumnState) => buildTDSSortTypeExpression(sortColumnState.sortType, sortColumnState.columnState.columnName);
|
27
28
|
const appendResultSetModifier = (resultModifierState, lambdaFunction, options) => {
|
28
29
|
if (lambdaFunction.expressionSequence.length === 1) {
|
@@ -156,41 +157,49 @@ export const appendProjection = (tdsState, lambdaFunction, options) => {
|
|
156
157
|
lambdaFunction.expressionSequence[0] = groupByFunction;
|
157
158
|
}
|
158
159
|
else if (tdsState.projectionColumns.length) {
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
.
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
160
|
+
if (!tdsState.queryBuilderState.isFetchStructureTyped) {
|
161
|
+
// projection
|
162
|
+
const projectFunction = new SimpleFunctionExpression(extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_PROJECT));
|
163
|
+
const colLambdas = new CollectionInstanceValue(queryBuilderState.graphManagerState.graph.getMultiplicity(tdsState.projectionColumns.length, tdsState.projectionColumns.length));
|
164
|
+
const colAliases = new CollectionInstanceValue(queryBuilderState.graphManagerState.graph.getMultiplicity(tdsState.projectionColumns.length, tdsState.projectionColumns.length));
|
165
|
+
tdsState.projectionColumns.forEach((projectionColumnState) => {
|
166
|
+
// column alias
|
167
|
+
const colAlias = new PrimitiveInstanceValue(GenericTypeExplicitReference.create(new GenericType(PrimitiveType.STRING)));
|
168
|
+
colAlias.values.push(projectionColumnState.columnName);
|
169
|
+
colAliases.values.push(colAlias);
|
170
|
+
// column projection
|
171
|
+
let columnLambda;
|
172
|
+
if (projectionColumnState instanceof
|
173
|
+
QueryBuilderSimpleProjectionColumnState) {
|
174
|
+
columnLambda = buildGenericLambdaFunctionInstanceValue(projectionColumnState.lambdaParameterName, [
|
175
|
+
buildPropertyExpressionChain(projectionColumnState.propertyExpressionState
|
176
|
+
.propertyExpression, projectionColumnState.propertyExpressionState.queryBuilderState, projectionColumnState.lambdaParameterName, options),
|
177
|
+
], queryBuilderState.graphManagerState.graph);
|
178
|
+
}
|
179
|
+
else if (projectionColumnState instanceof
|
180
|
+
QueryBuilderDerivationProjectionColumnState) {
|
181
|
+
columnLambda = new INTERNAL__UnknownValueSpecification(V1_serializeRawValueSpecification(V1_transformRawLambda(projectionColumnState.lambda, new V1_GraphTransformerContextBuilder(
|
182
|
+
// TODO?: do we need to include the plugins here?
|
183
|
+
[])
|
184
|
+
.withKeepSourceInformationFlag(Boolean(options?.keepSourceInformation))
|
185
|
+
.build())));
|
186
|
+
}
|
187
|
+
else {
|
188
|
+
throw new UnsupportedOperationError(`Can't build project() column expression: unsupported projection column state`, projectionColumnState);
|
189
|
+
}
|
190
|
+
colLambdas.values.push(columnLambda);
|
191
|
+
});
|
192
|
+
projectFunction.parametersValues = [
|
193
|
+
precedingExpression,
|
194
|
+
colLambdas,
|
195
|
+
colAliases,
|
196
|
+
];
|
197
|
+
lambdaFunction.expressionSequence[0] = projectFunction;
|
198
|
+
}
|
199
|
+
else {
|
200
|
+
const projectFunction = buildRelationProjection(precedingExpression, tdsState, options);
|
201
|
+
lambdaFunction.expressionSequence[0] = projectFunction;
|
202
|
+
}
|
194
203
|
}
|
195
204
|
// build olapGroupBy
|
196
205
|
appendOLAPGroupByState(tdsState.windowState, lambdaFunction);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderProjectionValueSpecificationBuilder.js","sourceRoot":"","sources":["../../../../../src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,uBAAuB,EACvB,0BAA0B,EAC1B,WAAW,EACX,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EAExB,mCAAmC,EACnC,iCAAiC,EACjC,qBAAqB,EACrB,iCAAiC,EACjC,iBAAiB,EACjB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,2CAA2C,EAC3C,uCAAuC,GACxC,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAGN,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,iCAAiC,EAAE,MAAM,iDAAiD,CAAC;AACpG,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,
|
1
|
+
{"version":3,"file":"QueryBuilderProjectionValueSpecificationBuilder.js","sourceRoot":"","sources":["../../../../../src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,uBAAuB,EACvB,0BAA0B,EAC1B,WAAW,EACX,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EAExB,mCAAmC,EACnC,iCAAiC,EACjC,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YAC5C,CAAC,CAAC,SAAS;KAChB,CAAC,CAAC;AACL,CAAC,CAAC"}
|
package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.d.ts
ADDED
@@ -0,0 +1,20 @@
|
|
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
|
+
import { type ValueSpecification, SimpleFunctionExpression } from '@finos/legend-graph';
|
17
|
+
import type { QueryBuilderTDSState } from '../QueryBuilderTDSState.js';
|
18
|
+
import { type LambdaFunctionBuilderOption } from '../../../QueryBuilderValueSpecificationBuilderHelper.js';
|
19
|
+
export declare const buildRelationProjection: (precedingExpression: ValueSpecification, tdsState: QueryBuilderTDSState, options?: LambdaFunctionBuilderOption) => SimpleFunctionExpression;
|
20
|
+
//# sourceMappingURL=QueryBuilderRelationProjectValueSpecBuidler.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QueryBuilderRelationProjectValueSpecBuidler.d.ts","sourceRoot":"","sources":["../../../../../src/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,kBAAkB,EAEvB,wBAAwB,EAQzB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,yDAAyD,CAAC;AAGjE,eAAO,MAAM,uBAAuB,wBACb,kBAAkB,YAC7B,oBAAoB,YACpB,2BAA2B,KACpC,wBA6DF,CAAC"}
|
package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.js
ADDED
@@ -0,0 +1,55 @@
|
|
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
|
+
import { ColSpecArray, extractElementNameFromPath, SimpleFunctionExpression, ColSpecArrayInstance, Multiplicity, ColSpec, INTERNAL__UnknownValueSpecification, V1_serializeRawValueSpecification, V1_transformRawLambda, V1_GraphTransformerContextBuilder, } from '@finos/legend-graph';
|
17
|
+
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../graph/QueryBuilderMetaModelConst.js';
|
18
|
+
import { QueryBuilderDerivationProjectionColumnState, QueryBuilderSimpleProjectionColumnState, } from './QueryBuilderProjectionColumnState.js';
|
19
|
+
import { buildGenericLambdaFunctionInstanceValue } from '../../../QueryBuilderValueSpecificationHelper.js';
|
20
|
+
import { buildPropertyExpressionChain, } from '../../../QueryBuilderValueSpecificationBuilderHelper.js';
|
21
|
+
import { UnsupportedOperationError } from '@finos/legend-shared';
|
22
|
+
export const buildRelationProjection = (precedingExpression, tdsState, options) => {
|
23
|
+
const projectFunction = new SimpleFunctionExpression(extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_PROJECT));
|
24
|
+
const queryBuilderState = tdsState.queryBuilderState;
|
25
|
+
const instanceVal = new ColSpecArrayInstance(Multiplicity.ONE, undefined);
|
26
|
+
const colSepcArray = new ColSpecArray();
|
27
|
+
instanceVal.values = [colSepcArray];
|
28
|
+
tdsState.projectionColumns.forEach((projectionColumnState) => {
|
29
|
+
const colSpec = new ColSpec();
|
30
|
+
colSepcArray.colSpecs.push(colSpec);
|
31
|
+
colSpec.name = projectionColumnState.columnName;
|
32
|
+
// column projection
|
33
|
+
let columnLambda;
|
34
|
+
if (projectionColumnState instanceof QueryBuilderSimpleProjectionColumnState) {
|
35
|
+
columnLambda = buildGenericLambdaFunctionInstanceValue(projectionColumnState.lambdaParameterName, [
|
36
|
+
buildPropertyExpressionChain(projectionColumnState.propertyExpressionState.propertyExpression, projectionColumnState.propertyExpressionState.queryBuilderState, projectionColumnState.lambdaParameterName, options),
|
37
|
+
], queryBuilderState.graphManagerState.graph);
|
38
|
+
}
|
39
|
+
else if (projectionColumnState instanceof
|
40
|
+
QueryBuilderDerivationProjectionColumnState) {
|
41
|
+
columnLambda = new INTERNAL__UnknownValueSpecification(V1_serializeRawValueSpecification(V1_transformRawLambda(projectionColumnState.lambda, new V1_GraphTransformerContextBuilder(
|
42
|
+
// TODO?: do we need to include the plugins here?
|
43
|
+
[])
|
44
|
+
.withKeepSourceInformationFlag(Boolean(options?.keepSourceInformation))
|
45
|
+
.build())));
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
throw new UnsupportedOperationError(`Can't build relation project() column expression: unsupported projection column state`, projectionColumnState);
|
49
|
+
}
|
50
|
+
colSpec.function1 = columnLambda;
|
51
|
+
});
|
52
|
+
projectFunction.parametersValues = [precedingExpression, instanceVal];
|
53
|
+
return projectFunction;
|
54
|
+
};
|
55
|
+
//# sourceMappingURL=QueryBuilderRelationProjectValueSpecBuidler.js.map
|
package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QueryBuilderRelationProjectValueSpecBuidler.js","sourceRoot":"","sources":["../../../../../src/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,YAAY,EAEZ,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,EACZ,OAAO,EACP,mCAAmC,EACnC,iCAAiC,EACjC,qBAAqB,EACrB,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iCAAiC,EAAE,MAAM,iDAAiD,CAAC;AACpG,OAAO,EACL,2CAA2C,EAC3C,uCAAuC,GACxC,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EACL,4BAA4B,GAE7B,MAAM,yDAAyD,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,mBAAuC,EACvC,QAA8B,EAC9B,OAAqC,EACX,EAAE;IAC5B,MAAM,eAAe,GAAG,IAAI,wBAAwB,CAClD,0BAA0B,CAAC,iCAAiC,CAAC,WAAW,CAAC,CAC1E,CAAC;IACF,MAAM,iBAAiB,GAAG,QAAQ,CAAC,iBAAiB,CAAC;IAErD,MAAM,WAAW,GAAG,IAAI,oBAAoB,CAAC,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAE1E,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;IACxC,WAAW,CAAC,MAAM,GAAG,CAAC,YAAY,CAAC,CAAC;IAEpC,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,qBAAqB,EAAE,EAAE;QAC3D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;QAC9B,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,GAAG,qBAAqB,CAAC,UAAU,CAAC;QAChD,oBAAoB;QACpB,IAAI,YAAgC,CAAC;QACrC,IACE,qBAAqB,YAAY,uCAAuC,EACxE;YACA,YAAY,GAAG,uCAAuC,CACpD,qBAAqB,CAAC,mBAAmB,EACzC;gBACE,4BAA4B,CAC1B,qBAAqB,CAAC,uBAAuB,CAAC,kBAAkB,EAChE,qBAAqB,CAAC,uBAAuB,CAAC,iBAAiB,EAC/D,qBAAqB,CAAC,mBAAmB,EACzC,OAAO,CACR;aACF,EACD,iBAAiB,CAAC,iBAAiB,CAAC,KAAK,CAC1C,CAAC;SACH;aAAM,IACL,qBAAqB;YACrB,2CAA2C,EAC3C;YACA,YAAY,GAAG,IAAI,mCAAmC,CACpD,iCAAiC,CAC/B,qBAAqB,CACnB,qBAAqB,CAAC,MAAM,EAC5B,IAAI,iCAAiC;YACnC,iDAAiD;YACjD,EAAE,CACH;iBACE,6BAA6B,CAC5B,OAAO,CAAC,OAAO,EAAE,qBAAqB,CAAC,CACxC;iBACA,KAAK,EAAE,CACX,CACF,CACF,CAAC;SACH;aAAM;YACL,MAAM,IAAI,yBAAyB,CACjC,uFAAuF,EACvF,qBAAqB,CACtB,CAAC;SACH;QACD,OAAO,CAAC,SAAS,GAAG,YAAY,CAAC;IACnC,CAAC,CAAC,CAAC;IACH,eAAe,CAAC,gBAAgB,GAAG,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;IACtE,OAAO,eAAe,CAAC;AACzB,CAAC,CAAC"}
|
@@ -13,15 +13,8 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
export class QueryBuilderAdvancedWorkflowState extends QueryBuilderWorkflowState {
|
22
|
-
get showStatusBar(): boolean {
|
23
|
-
return true;
|
24
|
-
}
|
25
|
-
|
26
|
-
static INSTANCE = new QueryBuilderAdvancedWorkflowState();
|
27
|
-
}
|
16
|
+
import { type LambdaFunction, SimpleFunctionExpression } from '@finos/legend-graph';
|
17
|
+
import { type QueryBuilderState } from '../../../QueryBuilderState.js';
|
18
|
+
export declare const processTypedTDSProjectExpression: (expression: SimpleFunctionExpression, queryBuilderState: QueryBuilderState, parentLambda: LambdaFunction) => void;
|
19
|
+
export declare const isTypedProjectionExpression: (expression: SimpleFunctionExpression) => boolean;
|
20
|
+
//# sourceMappingURL=QueryBuilderTypedProjectionStateBuilder.d.ts.map
|
package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.d.ts.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QueryBuilderTypedProjectionStateBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,cAAc,EACnB,wBAAwB,EAGzB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AAOvC,eAAO,MAAM,gCAAgC,eAC/B,wBAAwB,qBACjB,iBAAiB,gBACtB,cAAc,KAC3B,IAgDF,CAAC;AAEF,eAAO,MAAM,2BAA2B,eAC1B,wBAAwB,KACnC,OAYF,CAAC"}
|
@@ -0,0 +1,54 @@
|
|
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
|
+
import { SimpleFunctionExpression, matchFunctionName, ColSpecArrayInstance, } from '@finos/legend-graph';
|
17
|
+
import { FETCH_STRUCTURE_IMPLEMENTATION } from '../../QueryBuilderFetchStructureImplementationState.js';
|
18
|
+
import { assertTrue, assertType, guaranteeType } from '@finos/legend-shared';
|
19
|
+
import { QUERY_BUILDER_LAMBDA_WRITER_MODE, } from '../../../QueryBuilderState.js';
|
20
|
+
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS, QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS, } from '../../../../graph/QueryBuilderMetaModelConst.js';
|
21
|
+
import { QueryBuilderValueSpecificationProcessor } from '../../../QueryBuilderStateBuilder.js';
|
22
|
+
export const processTypedTDSProjectExpression = (expression, queryBuilderState, parentLambda) => {
|
23
|
+
// check parameters
|
24
|
+
assertTrue(expression.parametersValues.length === 2, `Can't process typed project() expression: typed project() expects 2 arguments`);
|
25
|
+
// update fetch-structure
|
26
|
+
queryBuilderState.fetchStructureState.changeImplementation(FETCH_STRUCTURE_IMPLEMENTATION.TABULAR_DATA_STRUCTURE);
|
27
|
+
// check preceding expression
|
28
|
+
const precedingExpression = guaranteeType(expression.parametersValues[0], SimpleFunctionExpression, `Can't process typed project() expression: only support typed project() immediately following an expression`);
|
29
|
+
assertTrue(matchFunctionName(precedingExpression.functionName, [
|
30
|
+
QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL,
|
31
|
+
QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL_VERSIONS,
|
32
|
+
QUERY_BUILDER_SUPPORTED_GET_ALL_FUNCTIONS.GET_ALL_VERSIONS_IN_RANGE,
|
33
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.FILTER,
|
34
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.WATERMARK,
|
35
|
+
]), `Can't process typed project() expression: only support typed project() immediately following either getAll(), filter(), or forWatermark()`);
|
36
|
+
QueryBuilderValueSpecificationProcessor.process(precedingExpression, parentLambda, queryBuilderState);
|
37
|
+
// check columns
|
38
|
+
const classInstance = expression.parametersValues[1];
|
39
|
+
assertType(classInstance, ColSpecArrayInstance, `Can't process typed project() expression: typed project() expects argument #1 to be a ColSpec Array Instance`);
|
40
|
+
queryBuilderState.setLambdaWriteMode(QUERY_BUILDER_LAMBDA_WRITER_MODE.TYPED_FETCH_STRUCTURE);
|
41
|
+
QueryBuilderValueSpecificationProcessor.processChild(classInstance, expression, parentLambda, queryBuilderState);
|
42
|
+
};
|
43
|
+
export const isTypedProjectionExpression = (expression) => {
|
44
|
+
if (matchFunctionName(expression.functionName, [
|
45
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_PROJECT,
|
46
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_PROJECT,
|
47
|
+
])) {
|
48
|
+
if (expression.parametersValues.length === 2) {
|
49
|
+
return expression.parametersValues[1] instanceof ColSpecArrayInstance;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
return false;
|
53
|
+
};
|
54
|
+
//# sourceMappingURL=QueryBuilderTypedProjectionStateBuilder.js.map
|
package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QueryBuilderTypedProjectionStateBuilder.js","sourceRoot":"","sources":["../../../../../src/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,8BAA8B,EAAE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uCAAuC,CAAC,YAAY,CAClD,aAAa,EACb,UAAU,EACV,YAAY,EACZ,iBAAiB,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,UAAoC,EAC3B,EAAE;IACX,IACE,iBAAiB,CAAC,UAAU,CAAC,YAAY,EAAE;QACzC,iCAAiC,CAAC,WAAW;QAC7C,iCAAiC,CAAC,gBAAgB;KACnD,CAAC,EACF;QACA,IAAI,UAAU,CAAC,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5C,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,YAAY,oBAAoB,CAAC;SACvE;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
@@ -13,11 +13,23 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
+
import type { QueryBuilderState } from '../QueryBuilderState.js';
|
17
|
+
export interface FetchStructureLayoutConfig {
|
18
|
+
label: string;
|
19
|
+
showInFetchPanel: boolean;
|
20
|
+
}
|
16
21
|
export declare abstract class QueryBuilderWorkflowState {
|
17
22
|
abstract get showStatusBar(): boolean;
|
23
|
+
abstract getFetchStructureLayoutConfig(state: QueryBuilderState): FetchStructureLayoutConfig;
|
18
24
|
}
|
19
25
|
export declare class QueryBuilderAdvancedWorkflowState extends QueryBuilderWorkflowState {
|
20
26
|
get showStatusBar(): boolean;
|
27
|
+
getFetchStructureLayoutConfig(state: QueryBuilderState): FetchStructureLayoutConfig;
|
21
28
|
static INSTANCE: QueryBuilderAdvancedWorkflowState;
|
22
29
|
}
|
30
|
+
export declare class QueryBuilderDataBrowserWorkflow extends QueryBuilderWorkflowState {
|
31
|
+
get showStatusBar(): boolean;
|
32
|
+
getFetchStructureLayoutConfig(state: QueryBuilderState): FetchStructureLayoutConfig;
|
33
|
+
static readonly INSTANCE: QueryBuilderDataBrowserWorkflow;
|
34
|
+
}
|
23
35
|
//# sourceMappingURL=QueryBuilderWorkFlowState.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QueryBuilderWorkFlowState.d.ts","sourceRoot":"","sources":["../../../src/stores/query-workflow/QueryBuilderWorkFlowState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,8BAAsB,yBAAyB;IAC7C,QAAQ,KAAK,aAAa,IAAI,OAAO,CAAC;IAEtC,QAAQ,CAAC,6BAA6B,CACpC,KAAK,EAAE,iBAAiB,GACvB,0BAA0B;CAC9B;AAED,qBAAa,iCAAkC,SAAQ,yBAAyB;IAC9E,IAAI,aAAa,IAAI,OAAO,CAE3B;IAEQ,6BAA6B,CACpC,KAAK,EAAE,iBAAiB,GACvB,0BAA0B;IAO7B,MAAM,CAAC,QAAQ,oCAA2C;CAC3D;AAED,qBAAa,+BAAgC,SAAQ,yBAAyB;IAC5E,IAAa,aAAa,IAAI,OAAO,CAEpC;IAEQ,6BAA6B,CACpC,KAAK,EAAE,iBAAiB,GACvB,0BAA0B;IAO7B,MAAM,CAAC,QAAQ,CAAC,QAAQ,kCAAyC;CAClE"}
|
@@ -19,6 +19,24 @@ export class QueryBuilderAdvancedWorkflowState extends QueryBuilderWorkflowState
|
|
19
19
|
get showStatusBar() {
|
20
20
|
return true;
|
21
21
|
}
|
22
|
+
getFetchStructureLayoutConfig(state) {
|
23
|
+
return {
|
24
|
+
label: 'fetch structure',
|
25
|
+
showInFetchPanel: true,
|
26
|
+
};
|
27
|
+
}
|
22
28
|
static INSTANCE = new QueryBuilderAdvancedWorkflowState();
|
23
29
|
}
|
30
|
+
export class QueryBuilderDataBrowserWorkflow extends QueryBuilderWorkflowState {
|
31
|
+
get showStatusBar() {
|
32
|
+
return false;
|
33
|
+
}
|
34
|
+
getFetchStructureLayoutConfig(state) {
|
35
|
+
return {
|
36
|
+
label: state.fetchStructureState.implementation.fetchLabel,
|
37
|
+
showInFetchPanel: false,
|
38
|
+
};
|
39
|
+
}
|
40
|
+
static INSTANCE = new QueryBuilderDataBrowserWorkflow();
|
41
|
+
}
|
24
42
|
//# sourceMappingURL=QueryBuilderWorkFlowState.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QueryBuilderWorkFlowState.js","sourceRoot":"","sources":["../../../src/stores/query-workflow/QueryBuilderWorkFlowState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,MAAM,OAAgB,yBAAyB;CAM9C;AAED,MAAM,OAAO,iCAAkC,SAAQ,yBAAyB;IAC9E,IAAI,aAAa;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAEQ,6BAA6B,CACpC,KAAwB;QAExB,OAAO;YACL,KAAK,EAAE,iBAAiB;YACxB,gBAAgB,EAAE,IAAI;SACvB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,QAAQ,GAAG,IAAI,iCAAiC,EAAE,CAAC;;AAG5D,MAAM,OAAO,+BAAgC,SAAQ,yBAAyB;IAC5E,IAAa,aAAa;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IAEQ,6BAA6B,CACpC,KAAwB;QAExB,OAAO;YACL,KAAK,EAAE,KAAK,CAAC,mBAAmB,CAAC,cAAc,CAAC,UAAU;YAC1D,gBAAgB,EAAE,KAAK;SACxB,CAAC;IACJ,CAAC;IAED,MAAM,CAAU,QAAQ,GAAG,IAAI,+BAA+B,EAAE,CAAC"}
|
@@ -17,7 +17,7 @@ import type { GenericLegendApplicationStore } from '@finos/legend-application';
|
|
17
17
|
import type { ConcreteFunctionDefinition, GraphManagerState } from '@finos/legend-graph';
|
18
18
|
import { ClassQueryBuilderState } from './ClassQueryBuilderState.js';
|
19
19
|
import type { QueryBuilderConfig } from '../../graph-manager/QueryBuilderConfig.js';
|
20
|
-
import type { QueryBuilderWorkflowState } from '../workflow/QueryBuilderWorkFlowState.js';
|
20
|
+
import type { QueryBuilderWorkflowState } from '../query-workflow/QueryBuilderWorkFlowState.js';
|
21
21
|
export declare class FunctionQueryBuilderState extends ClassQueryBuilderState {
|
22
22
|
readonly functionElement: ConcreteFunctionDefinition;
|
23
23
|
constructor(applicationStore: GenericLegendApplicationStore, graphManagerState: GraphManagerState, workflowState: QueryBuilderWorkflowState, functionElemenet: ConcreteFunctionDefinition, config: QueryBuilderConfig | undefined);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FunctionQueryBuilderState.d.ts","sourceRoot":"","sources":["../../../src/stores/workflows/FunctionQueryBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,KAAK,EACV,0BAA0B,EAC1B,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"FunctionQueryBuilderState.d.ts","sourceRoot":"","sources":["../../../src/stores/workflows/FunctionQueryBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,KAAK,EACV,0BAA0B,EAC1B,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAIhG,qBAAa,yBAA0B,SAAQ,sBAAsB;IACnE,QAAQ,CAAC,eAAe,EAAE,0BAA0B,CAAC;gBAGnD,gBAAgB,EAAE,6BAA6B,EAC/C,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,yBAAyB,EACxC,gBAAgB,EAAE,0BAA0B,EAC5C,MAAM,EAAE,kBAAkB,GAAG,SAAS;CAMzC"}
|
@@ -17,7 +17,7 @@ import type { GenericLegendApplicationStore } from '@finos/legend-application';
|
|
17
17
|
import { type Mapping, type Runtime, type GraphManagerState } from '@finos/legend-graph';
|
18
18
|
import { QueryBuilderState } from '../QueryBuilderState.js';
|
19
19
|
import type { QueryBuilderConfig } from '../../graph-manager/QueryBuilderConfig.js';
|
20
|
-
import type { QueryBuilderWorkflowState } from '../workflow/QueryBuilderWorkFlowState.js';
|
20
|
+
import type { QueryBuilderWorkflowState } from '../query-workflow/QueryBuilderWorkFlowState.js';
|
21
21
|
export declare class MappingQueryBuilderState extends QueryBuilderState {
|
22
22
|
readonly onMappingChange?: ((val: Mapping) => void) | undefined;
|
23
23
|
readonly onRuntimeChange?: ((val: Runtime) => void) | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MappingQueryBuilderState.d.ts","sourceRoot":"","sources":["../../../src/stores/workflows/MappingQueryBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAKvB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"MappingQueryBuilderState.d.ts","sourceRoot":"","sources":["../../../src/stores/workflows/MappingQueryBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAKvB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAEhG,qBAAa,wBAAyB,SAAQ,iBAAiB;IAC7D,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAChE,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAEvD,oCAAoC,QAAO,MAAM,SAAS,CAChB;gBAGjD,gBAAgB,EAAE,6BAA6B,EAC/C,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,yBAAyB,EACxC,eAAe,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,EACtD,eAAe,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,EACtD,MAAM,CAAC,EAAE,kBAAkB,GAAG,SAAS,EACvC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS;IAcjC;;;;;;OAMG;IACH,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;CA6B/C"}
|
@@ -17,7 +17,7 @@ import type { GenericLegendApplicationStore } from '@finos/legend-application';
|
|
17
17
|
import { type Mapping, type Runtime, type GraphManagerState, type Service } from '@finos/legend-graph';
|
18
18
|
import { QueryBuilderState } from '../QueryBuilderState.js';
|
19
19
|
import type { QueryBuilderConfig } from '../../graph-manager/QueryBuilderConfig.js';
|
20
|
-
import type { QueryBuilderWorkflowState } from '../workflow/QueryBuilderWorkFlowState.js';
|
20
|
+
import type { QueryBuilderWorkflowState } from '../query-workflow/QueryBuilderWorkFlowState.js';
|
21
21
|
export type ServiceExecutionContext = {
|
22
22
|
key: string;
|
23
23
|
mapping: Mapping;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ServiceQueryBuilderState.d.ts","sourceRoot":"","sources":["../../../src/stores/workflows/ServiceQueryBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,OAAO,EAIb,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"ServiceQueryBuilderState.d.ts","sourceRoot":"","sources":["../../../src/stores/workflows/ServiceQueryBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,OAAO,EAIb,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,yBAAyB,EAAE,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,IAAa,iBAAiB,IAAI,OAAO,CAExC;IAED,IAAa,iBAAiB,IAAI,OAAO,CAExC;IAED;;;;;;OAMG;IACH,+BAA+B,CAC7B,gBAAgB,EAAE,uBAAuB,GACxC,IAAI;CAkBR"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-query-builder",
|
3
|
-
"version": "4.14.
|
3
|
+
"version": "4.14.32",
|
4
4
|
"description": "Legend query builder core",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -44,8 +44,8 @@
|
|
44
44
|
"dependencies": {
|
45
45
|
"@finos/legend-application": "15.0.75",
|
46
46
|
"@finos/legend-art": "7.1.27",
|
47
|
-
"@finos/legend-graph": "31.9.
|
48
|
-
"@finos/legend-lego": "1.2.
|
47
|
+
"@finos/legend-graph": "31.9.14",
|
48
|
+
"@finos/legend-lego": "1.2.28",
|
49
49
|
"@finos/legend-server-depot": "6.0.39",
|
50
50
|
"@finos/legend-shared": "10.0.34",
|
51
51
|
"@finos/legend-storage": "3.0.84",
|
@@ -65,7 +65,7 @@
|
|
65
65
|
"sql-formatter": "13.0.1"
|
66
66
|
},
|
67
67
|
"devDependencies": {
|
68
|
-
"@finos/legend-dev-utils": "2.1.
|
68
|
+
"@finos/legend-dev-utils": "2.1.4",
|
69
69
|
"@jest/globals": "29.7.0",
|
70
70
|
"cross-env": "7.0.3",
|
71
71
|
"eslint": "8.52.0",
|
@@ -51,7 +51,10 @@ import { QueryBuilderExplorerPanel } from './explorer/QueryBuilderExplorerPanel.
|
|
51
51
|
import { QueryBuilderSidebar } from './QueryBuilderSideBar.js';
|
52
52
|
import { QueryBuilderResultPanel } from './result/QueryBuilderResultPanel.js';
|
53
53
|
import { QueryBuilderTextEditor } from './QueryBuilderTextEditor.js';
|
54
|
-
import
|
54
|
+
import {
|
55
|
+
QUERY_BUILDER_LAMBDA_WRITER_MODE,
|
56
|
+
type QueryBuilderState,
|
57
|
+
} from '../stores/QueryBuilderState.js';
|
55
58
|
import { QueryBuilderTextEditorMode } from '../stores/QueryBuilderTextEditorState.js';
|
56
59
|
import { QueryBuilderFetchStructurePanel } from './fetch-structure/QueryBuilderFetchStructurePanel.js';
|
57
60
|
import { QUERY_BUILDER_TEST_ID } from '../__lib__/QueryBuilderTesting.js';
|
@@ -79,6 +82,8 @@ import { DataAccessOverview } from './data-access/DataAccessOverview.js';
|
|
79
82
|
import { QueryChat } from './QueryChat.js';
|
80
83
|
import { useEffect, useRef } from 'react';
|
81
84
|
import { RedoButton, UndoButton } from '@finos/legend-lego/application';
|
85
|
+
import { FETCH_STRUCTURE_IMPLEMENTATION } from '../stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js';
|
86
|
+
import { onChangeFetchStructureImplementation } from '../stores/fetch-structure/QueryBuilderFetchStructureState.js';
|
82
87
|
|
83
88
|
const QueryBuilderPostGraphFetchPanel = observer(
|
84
89
|
(props: { graphFetchState: QueryBuilderGraphFetchTreeState }) => {
|
@@ -325,6 +330,36 @@ export const QueryBuilder = observer(
|
|
325
330
|
}
|
326
331
|
};
|
327
332
|
|
333
|
+
const toggleTypedRelation = (): void => {
|
334
|
+
if (queryBuilderState.isFetchStructureTyped) {
|
335
|
+
queryBuilderState.setLambdaWriteMode(
|
336
|
+
QUERY_BUILDER_LAMBDA_WRITER_MODE.STANDARD,
|
337
|
+
);
|
338
|
+
} else {
|
339
|
+
queryBuilderState.applicationStore.alertService.setActionAlertInfo({
|
340
|
+
message:
|
341
|
+
'You are about to change to use typed TDS functions. Please proceed with caution as this is still an experimental feature.',
|
342
|
+
prompt: ' Do you want to proceed?',
|
343
|
+
type: ActionAlertType.CAUTION,
|
344
|
+
actions: [
|
345
|
+
{
|
346
|
+
label: 'Proceed',
|
347
|
+
type: ActionAlertActionType.PROCEED_WITH_CAUTION,
|
348
|
+
handler: (): void =>
|
349
|
+
queryBuilderState.setLambdaWriteMode(
|
350
|
+
QUERY_BUILDER_LAMBDA_WRITER_MODE.TYPED_FETCH_STRUCTURE,
|
351
|
+
),
|
352
|
+
},
|
353
|
+
{
|
354
|
+
label: 'Cancel',
|
355
|
+
type: ActionAlertActionType.PROCEED,
|
356
|
+
default: true,
|
357
|
+
},
|
358
|
+
],
|
359
|
+
});
|
360
|
+
}
|
361
|
+
};
|
362
|
+
|
328
363
|
const editQueryInPure = (): void => {
|
329
364
|
openLambdaEditor(QueryBuilderTextEditorMode.TEXT);
|
330
365
|
};
|
@@ -412,7 +447,12 @@ export const QueryBuilder = observer(
|
|
412
447
|
<BackdropContainer
|
413
448
|
elementId={QUERY_BUILDER_COMPONENT_ELEMENT_ID.BACKDROP_CONTAINER}
|
414
449
|
/>
|
415
|
-
<div
|
450
|
+
<div
|
451
|
+
className={clsx('query-builder__body', {
|
452
|
+
'query-builder__body__status-bar':
|
453
|
+
queryBuilderState.workflowState.showStatusBar,
|
454
|
+
})}
|
455
|
+
>
|
416
456
|
<PanelLoadingIndicator
|
417
457
|
isLoading={queryBuilderState.resultState.exportState.isInProgress}
|
418
458
|
/>
|
@@ -535,6 +575,22 @@ export const QueryBuilder = observer(
|
|
535
575
|
</MenuContentItemIcon>
|
536
576
|
<MenuContentItemLabel>Show Filter</MenuContentItemLabel>
|
537
577
|
</MenuContentItem>
|
578
|
+
<MenuContentItem
|
579
|
+
onClick={onChangeFetchStructureImplementation(
|
580
|
+
isTDSState
|
581
|
+
? FETCH_STRUCTURE_IMPLEMENTATION.GRAPH_FETCH
|
582
|
+
: FETCH_STRUCTURE_IMPLEMENTATION.TABULAR_DATA_STRUCTURE,
|
583
|
+
fetchStructureState,
|
584
|
+
)}
|
585
|
+
disabled={!queryBuilderState.isQuerySupported}
|
586
|
+
>
|
587
|
+
<MenuContentItemIcon>
|
588
|
+
{isTDSState ? <CheckIcon /> : null}
|
589
|
+
</MenuContentItemIcon>
|
590
|
+
<MenuContentItemLabel>
|
591
|
+
Tabular Data Structure
|
592
|
+
</MenuContentItemLabel>
|
593
|
+
</MenuContentItem>
|
538
594
|
<MenuContentDivider />
|
539
595
|
<MenuContentItem
|
540
596
|
onClick={toggleShowOLAPGroupByPanel}
|
@@ -616,6 +672,25 @@ export const QueryBuilder = observer(
|
|
616
672
|
Enable Calendar
|
617
673
|
</MenuContentItemLabel>
|
618
674
|
</MenuContentItem>
|
675
|
+
<MenuContentItem
|
676
|
+
onClick={toggleTypedRelation}
|
677
|
+
disabled={
|
678
|
+
!queryBuilderState.isQuerySupported ||
|
679
|
+
!(
|
680
|
+
queryBuilderState.fetchStructureState
|
681
|
+
.implementation instanceof QueryBuilderTDSState
|
682
|
+
)
|
683
|
+
}
|
684
|
+
>
|
685
|
+
<MenuContentItemIcon>
|
686
|
+
{queryBuilderState.isFetchStructureTyped ? (
|
687
|
+
<CheckIcon />
|
688
|
+
) : null}
|
689
|
+
</MenuContentItemIcon>
|
690
|
+
<MenuContentItemLabel>
|
691
|
+
Enable Typed TDS (BETA)
|
692
|
+
</MenuContentItemLabel>
|
693
|
+
</MenuContentItem>
|
619
694
|
<MenuContentDivider />
|
620
695
|
<MenuContentItem
|
621
696
|
onClick={openCheckEntitlmentsEditor}
|