@finos/legend-query-builder 0.4.4 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilder.d.ts +1 -0
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +11 -2
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +23 -0
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -0
- package/lib/components/QueryBuilderConstantExpressionPanel.js +104 -0
- package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -0
- package/lib/components/QueryBuilderDiffPanel.d.ts +1 -0
- package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderDiffPanel.js +1 -2
- package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.d.ts +1 -9
- package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +8 -26
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +1 -0
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.js +60 -12
- package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
- package/lib/components/QueryBuilderResultPanel.d.ts +1 -0
- package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.d.ts +3 -1
- package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.js +6 -14
- package/lib/components/QueryBuilderSideBar.js.map +1 -1
- package/lib/components/QueryBuilderTextEditor.d.ts +1 -0
- package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +1 -0
- package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +1 -0
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +1 -0
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js +12 -18
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +1 -0
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +1 -0
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +1 -0
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.d.ts → QueryBuilderOLAPGroupByPanel.d.ts} +3 -2
- package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.d.ts.map +1 -0
- package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.js → QueryBuilderOLAPGroupByPanel.js} +2 -2
- package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.js.map +1 -0
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +1 -0
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +9 -11
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +1 -0
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +1 -0
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +1 -0
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +4 -4
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts +1 -0
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +8 -9
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts +12 -1
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.js +11 -7
- package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
- package/lib/components/shared/LambdaEditor.d.ts +1 -0
- package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaEditor.js +1 -15
- package/lib/components/shared/LambdaEditor.js.map +1 -1
- package/lib/components/shared/LambdaParameterValuesEditor.d.ts +1 -0
- package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts +36 -0
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -0
- package/lib/components/shared/QueryBuilderVariableSelector.js +50 -0
- package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -0
- package/lib/components/watermark/QueryBuilderWatermark.d.ts +1 -0
- package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
- package/lib/components/watermark/QueryBuilderWatermark.js +9 -11
- package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -1
- package/lib/graphManager/QueryBuilderHashUtils.d.ts +2 -0
- package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
- package/lib/graphManager/QueryBuilderHashUtils.js +2 -0
- package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +6 -6
- package/lib/stores/QueryBuilderConfig.d.ts +1 -0
- package/lib/stores/QueryBuilderConfig.d.ts.map +1 -1
- package/lib/stores/QueryBuilderConfig.js +1 -0
- package/lib/stores/QueryBuilderConfig.js.map +1 -1
- package/lib/stores/QueryBuilderConstantsState.d.ts +43 -0
- package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -0
- package/lib/stores/QueryBuilderConstantsState.js +116 -0
- package/lib/stores/QueryBuilderConstantsState.js.map +1 -0
- package/lib/stores/QueryBuilderParametersState.d.ts +0 -4
- package/lib/stores/QueryBuilderParametersState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderParametersState.js +0 -1
- package/lib/stores/QueryBuilderParametersState.js.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.d.ts +3 -10
- package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.js +6 -140
- package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
- package/lib/stores/QueryBuilderState.d.ts +9 -3
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +19 -4
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts +4 -3
- package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.js +50 -42
- package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js +23 -25
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +14 -78
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.js +4 -20
- package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +3 -3
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +4 -4
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +2 -2
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts +3 -3
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js +6 -6
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.d.ts → QueryBuilderOLAPGroupByOperatorLoader.d.ts} +1 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.js → QueryBuilderOLAPGroupByOperatorLoader.js} +1 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.d.ts → QueryBuilderOLAPGroupByState.d.ts} +1 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.js → QueryBuilderOLAPGroupByState.js} +1 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.d.ts → QueryBuilderOLAPGroupByStateBuilder.d.ts} +3 -3
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.js → QueryBuilderOLAPGroupByStateBuilder.js} +4 -4
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts} +2 -2
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.js → QueryBuilderOLAPGroupByValueSpecificationBuilder.js} +2 -2
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +5 -5
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +10 -10
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts +2 -2
- package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js +6 -4
- package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts +27 -0
- package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts.map +1 -0
- package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js +93 -0
- package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js.map +1 -0
- package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts +26 -0
- package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts.map +1 -0
- package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js +60 -0
- package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js.map +1 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +70 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +199 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts +49 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts.map +1 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js +24 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js.map +1 -0
- package/lib/stores/{QueryBuilderMilestoningState.d.ts → milestoning/QueryBuilderMilestoningState.d.ts} +6 -2
- package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -0
- package/lib/stores/{QueryBuilderMilestoningState.js → milestoning/QueryBuilderMilestoningState.js} +20 -20
- package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -0
- package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts +26 -0
- package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts.map +1 -0
- package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js +55 -0
- package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js.map +1 -0
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +3 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.js +58 -2
- package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts +2 -2
- package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js +2 -2
- package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts +2 -2
- package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js +7 -4
- package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.js +1 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
- package/package.json +13 -13
- package/src/components/QueryBuilder.tsx +38 -0
- package/src/components/QueryBuilderConstantExpressionPanel.tsx +284 -0
- package/src/components/QueryBuilderDiffPanel.tsx +0 -2
- package/src/components/QueryBuilderParametersPanel.tsx +22 -103
- package/src/components/QueryBuilderPropertyExpressionEditor.tsx +119 -36
- package/src/components/QueryBuilderSideBar.tsx +5 -22
- package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +29 -39
- package/src/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.tsx → QueryBuilderOLAPGroupByPanel.tsx} +1 -1
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +18 -19
- package/src/components/fetch-structure/QueryBuilderPostTDSPanel.tsx +1 -1
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +9 -9
- package/src/components/filter/QueryBuilderFilterPanel.tsx +16 -17
- package/src/components/shared/BasicValueSpecificationEditor.tsx +47 -22
- package/src/components/shared/LambdaEditor.tsx +0 -15
- package/src/components/shared/QueryBuilderVariableSelector.tsx +186 -0
- package/src/components/watermark/QueryBuilderWatermark.tsx +19 -31
- package/src/graphManager/QueryBuilderHashUtils.ts +2 -0
- package/src/stores/QueryBuilderConfig.ts +1 -0
- package/src/stores/QueryBuilderConstantsState.ts +173 -0
- package/src/stores/QueryBuilderParametersState.ts +0 -6
- package/src/stores/QueryBuilderPropertyEditorState.ts +6 -235
- package/src/stores/QueryBuilderState.ts +25 -4
- package/src/stores/QueryBuilderStateBuilder.ts +111 -52
- package/src/stores/QueryBuilderValueSpecificationBuilder.ts +34 -51
- package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +16 -105
- package/src/stores/QueryBuilderValueSpecificationHelper.ts +10 -29
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +5 -0
- package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +2 -2
- package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.ts +7 -0
- package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.ts → QueryBuilderOLAPGroupByOperatorLoader.ts} +0 -0
- package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.ts → QueryBuilderOLAPGroupByState.ts} +0 -0
- package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.ts → QueryBuilderOLAPGroupByStateBuilder.ts} +3 -1
- package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.ts} +1 -1
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts +1 -1
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +11 -0
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +1 -1
- package/src/stores/filter/QueryBuilderFilterValueSpecificationBuilder.ts +10 -5
- package/src/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.ts +165 -0
- package/src/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.ts +96 -0
- package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +311 -0
- package/src/stores/milestoning/QueryBuilderMilestoningImplementation.ts +77 -0
- package/src/stores/{QueryBuilderMilestoningState.ts → milestoning/QueryBuilderMilestoningState.ts} +55 -39
- package/src/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.ts +88 -0
- package/src/stores/shared/ValueSpecificationEditorHelper.ts +84 -2
- package/src/stores/watermark/QueryBuilderWatermarkStateBuilder.ts +3 -0
- package/src/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.ts +11 -5
- package/src/stores/workflows/ServiceQueryBuilderState.ts +1 -1
- package/tsconfig.json +14 -6
- package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.d.ts.map +0 -1
- package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.js.map +0 -1
- package/lib/stores/QueryBuilderMilestoningState.d.ts.map +0 -1
- package/lib/stores/QueryBuilderMilestoningState.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.js.map +0 -1
@@ -18,6 +18,8 @@ import {
|
|
18
18
|
assertNonNullable,
|
19
19
|
assertTrue,
|
20
20
|
assertType,
|
21
|
+
guaranteeIsString,
|
22
|
+
guaranteeNonNullable,
|
21
23
|
guaranteeType,
|
22
24
|
UnsupportedOperationError,
|
23
25
|
} from '@finos/legend-shared';
|
@@ -30,18 +32,18 @@ import {
|
|
30
32
|
type InstanceValue,
|
31
33
|
type INTERNAL__UnknownValueSpecification,
|
32
34
|
type LambdaFunction,
|
33
|
-
MILESTONING_STEREOTYPE,
|
34
35
|
matchFunctionName,
|
35
36
|
Class,
|
36
37
|
type CollectionInstanceValue,
|
37
38
|
type LambdaFunctionInstanceValue,
|
38
|
-
|
39
|
+
PrimitiveInstanceValue,
|
39
40
|
SimpleFunctionExpression,
|
40
41
|
type VariableExpression,
|
41
42
|
type AbstractPropertyExpression,
|
42
43
|
getMilestoneTemporalStereotype,
|
43
44
|
type INTERNAL__PropagatedValue,
|
44
45
|
type ValueSpecification,
|
46
|
+
SUPPORTED_FUNCTIONS,
|
45
47
|
} from '@finos/legend-graph';
|
46
48
|
import { processTDSPostFilterExpression } from './fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js';
|
47
49
|
import { processFilterExpression } from './filter/QueryBuilderFilterStateBuilder.js';
|
@@ -64,8 +66,9 @@ import {
|
|
64
66
|
} from './fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js';
|
65
67
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
|
66
68
|
import { LambdaParameterState } from './shared/LambdaParameterState.js';
|
67
|
-
import { processTDS_OLAPGroupByExpression } from './fetch-structure/tds/olapGroupBy/
|
69
|
+
import { processTDS_OLAPGroupByExpression } from './fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js';
|
68
70
|
import { processWatermarkExpression } from './watermark/QueryBuilderWatermarkStateBuilder.js';
|
71
|
+
import { QueryBuilderConstantExpressionState } from './QueryBuilderConstantsState.js';
|
69
72
|
|
70
73
|
const processGetAllExpression = (
|
71
74
|
expression: SimpleFunctionExpression,
|
@@ -78,57 +81,62 @@ const processGetAllExpression = (
|
|
78
81
|
`Can't process getAll() expression: getAll() return type is missing`,
|
79
82
|
);
|
80
83
|
queryBuilderState.setClass(_class);
|
81
|
-
queryBuilderState.milestoningState.
|
84
|
+
queryBuilderState.milestoningState.clearMilestoningDates();
|
82
85
|
queryBuilderState.explorerState.refreshTreeData();
|
83
86
|
|
84
87
|
// check parameters (milestoning) and build state
|
85
|
-
|
88
|
+
const acceptedNoOfParameters = 1;
|
86
89
|
const stereotype = getMilestoneTemporalStereotype(
|
87
90
|
_class,
|
88
91
|
queryBuilderState.graphManagerState.graph,
|
89
92
|
);
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
);
|
100
|
-
queryBuilderState.milestoningState.setBusinessDate(
|
101
|
-
expression.parametersValues[2],
|
102
|
-
);
|
103
|
-
break;
|
104
|
-
case MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL:
|
105
|
-
acceptedNoOfParameters = 2;
|
106
|
-
assertTrue(
|
107
|
-
expression.parametersValues.length === acceptedNoOfParameters,
|
108
|
-
`Can't process getAll() expression: when used with a milestoned class getAll() expects a parameter`,
|
109
|
-
);
|
110
|
-
queryBuilderState.milestoningState.setBusinessDate(
|
111
|
-
expression.parametersValues[1],
|
112
|
-
);
|
113
|
-
break;
|
114
|
-
case MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL:
|
115
|
-
acceptedNoOfParameters = 2;
|
116
|
-
assertTrue(
|
117
|
-
expression.parametersValues.length === acceptedNoOfParameters,
|
118
|
-
`Can't process getAll() expression: when used with a milestoned class getAll() expects a parameter`,
|
119
|
-
);
|
120
|
-
queryBuilderState.milestoningState.setProcessingDate(
|
121
|
-
expression.parametersValues[1],
|
122
|
-
);
|
123
|
-
break;
|
124
|
-
default:
|
125
|
-
assertTrue(
|
126
|
-
expression.parametersValues.length === acceptedNoOfParameters,
|
127
|
-
`Can't process getAll() expression: getAll() expects no arguments`,
|
128
|
-
);
|
93
|
+
if (stereotype) {
|
94
|
+
queryBuilderState.milestoningState
|
95
|
+
.getMilestoningImplementation(stereotype)
|
96
|
+
.processGetAllParamaters(expression.parametersValues);
|
97
|
+
} else {
|
98
|
+
assertTrue(
|
99
|
+
expression.parametersValues.length === acceptedNoOfParameters,
|
100
|
+
`Can't process getAll() expression: getAll() expects no arguments`,
|
101
|
+
);
|
129
102
|
}
|
130
103
|
};
|
131
104
|
|
105
|
+
const processLetExpression = (
|
106
|
+
expression: SimpleFunctionExpression,
|
107
|
+
queryBuilderState: QueryBuilderState,
|
108
|
+
parentLambda: LambdaFunction,
|
109
|
+
): void => {
|
110
|
+
const parameters = expression.parametersValues;
|
111
|
+
assertTrue(
|
112
|
+
expression.parametersValues.length === 2,
|
113
|
+
'Let function expected to have two parameters (left and right side value)',
|
114
|
+
);
|
115
|
+
// process left side (var)
|
116
|
+
const letVariable = guaranteeIsString(
|
117
|
+
guaranteeType(
|
118
|
+
parameters[0],
|
119
|
+
PrimitiveInstanceValue,
|
120
|
+
'Can`t process let function: left side should be a primitive instance value',
|
121
|
+
).values[0],
|
122
|
+
'Can`t process let function: left side should be a string primitive instance value',
|
123
|
+
);
|
124
|
+
const varExp = guaranteeNonNullable(
|
125
|
+
parentLambda.openVariables.get(letVariable),
|
126
|
+
`Unable to find variable ${letVariable} in lambda function`,
|
127
|
+
);
|
128
|
+
// process right side (value)
|
129
|
+
const rightSide = guaranteeNonNullable(parameters[1]);
|
130
|
+
// final
|
131
|
+
const constantExpression = new QueryBuilderConstantExpressionState(
|
132
|
+
queryBuilderState,
|
133
|
+
varExp,
|
134
|
+
rightSide,
|
135
|
+
);
|
136
|
+
queryBuilderState.constantState.setShowConstantPanel(true);
|
137
|
+
queryBuilderState.constantState.addConstant(constantExpression);
|
138
|
+
};
|
139
|
+
|
132
140
|
/**
|
133
141
|
* This is the value specification processor (a.k.a state builder) for query builder.
|
134
142
|
*
|
@@ -209,21 +217,29 @@ export class QueryBuilderValueSpecificationProcessor
|
|
209
217
|
* value specification.
|
210
218
|
*/
|
211
219
|
readonly parentExpression?: SimpleFunctionExpression | undefined;
|
220
|
+
readonly parentLambda: LambdaFunction;
|
212
221
|
|
213
222
|
private constructor(
|
214
223
|
queryBuilderState: QueryBuilderState,
|
224
|
+
parentLambda: LambdaFunction,
|
215
225
|
parentExpression: SimpleFunctionExpression | undefined,
|
216
226
|
) {
|
217
227
|
this.queryBuilderState = queryBuilderState;
|
218
228
|
this.parentExpression = parentExpression;
|
229
|
+
this.parentLambda = parentLambda;
|
219
230
|
}
|
220
231
|
|
221
232
|
static process(
|
222
233
|
valueSpecification: ValueSpecification,
|
234
|
+
parentLambda: LambdaFunction,
|
223
235
|
queryBuilderState: QueryBuilderState,
|
224
236
|
): void {
|
225
237
|
valueSpecification.accept_ValueSpecificationVisitor(
|
226
|
-
new QueryBuilderValueSpecificationProcessor(
|
238
|
+
new QueryBuilderValueSpecificationProcessor(
|
239
|
+
queryBuilderState,
|
240
|
+
parentLambda,
|
241
|
+
undefined,
|
242
|
+
),
|
227
243
|
);
|
228
244
|
}
|
229
245
|
|
@@ -234,11 +250,13 @@ export class QueryBuilderValueSpecificationProcessor
|
|
234
250
|
static processChild(
|
235
251
|
valueSpecification: ValueSpecification,
|
236
252
|
parentExpression: SimpleFunctionExpression,
|
253
|
+
parentLambda: LambdaFunction,
|
237
254
|
queryBuilderState: QueryBuilderState,
|
238
255
|
): void {
|
239
256
|
valueSpecification.accept_ValueSpecificationVisitor(
|
240
257
|
new QueryBuilderValueSpecificationProcessor(
|
241
258
|
queryBuilderState,
|
259
|
+
parentLambda,
|
242
260
|
parentExpression,
|
243
261
|
),
|
244
262
|
);
|
@@ -316,6 +334,7 @@ export class QueryBuilderValueSpecificationProcessor
|
|
316
334
|
);
|
317
335
|
QueryBuilderValueSpecificationProcessor.process(
|
318
336
|
precedingExpression,
|
337
|
+
this.parentLambda,
|
319
338
|
this.queryBuilderState,
|
320
339
|
);
|
321
340
|
|
@@ -371,7 +390,11 @@ export class QueryBuilderValueSpecificationProcessor
|
|
371
390
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.WATERMARK,
|
372
391
|
)
|
373
392
|
) {
|
374
|
-
processWatermarkExpression(
|
393
|
+
processWatermarkExpression(
|
394
|
+
valueSpecification,
|
395
|
+
this.queryBuilderState,
|
396
|
+
this.parentLambda,
|
397
|
+
);
|
375
398
|
return;
|
376
399
|
} else if (
|
377
400
|
matchFunctionName(
|
@@ -379,7 +402,11 @@ export class QueryBuilderValueSpecificationProcessor
|
|
379
402
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_PROJECT,
|
380
403
|
)
|
381
404
|
) {
|
382
|
-
processTDSProjectExpression(
|
405
|
+
processTDSProjectExpression(
|
406
|
+
valueSpecification,
|
407
|
+
this.queryBuilderState,
|
408
|
+
this.parentLambda,
|
409
|
+
);
|
383
410
|
return;
|
384
411
|
} else if (
|
385
412
|
matchFunctionName(
|
@@ -387,7 +414,11 @@ export class QueryBuilderValueSpecificationProcessor
|
|
387
414
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_TAKE,
|
388
415
|
)
|
389
416
|
) {
|
390
|
-
processTDSTakeExpression(
|
417
|
+
processTDSTakeExpression(
|
418
|
+
valueSpecification,
|
419
|
+
this.queryBuilderState,
|
420
|
+
this.parentLambda,
|
421
|
+
);
|
391
422
|
return;
|
392
423
|
} else if (
|
393
424
|
matchFunctionName(
|
@@ -395,7 +426,11 @@ export class QueryBuilderValueSpecificationProcessor
|
|
395
426
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_DISTINCT,
|
396
427
|
)
|
397
428
|
) {
|
398
|
-
processTDSDistinctExpression(
|
429
|
+
processTDSDistinctExpression(
|
430
|
+
valueSpecification,
|
431
|
+
this.queryBuilderState,
|
432
|
+
this.parentLambda,
|
433
|
+
);
|
399
434
|
return;
|
400
435
|
} else if (
|
401
436
|
matchFunctionName(
|
@@ -403,7 +438,11 @@ export class QueryBuilderValueSpecificationProcessor
|
|
403
438
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_SORT,
|
404
439
|
)
|
405
440
|
) {
|
406
|
-
processTDSSortExpression(
|
441
|
+
processTDSSortExpression(
|
442
|
+
valueSpecification,
|
443
|
+
this.queryBuilderState,
|
444
|
+
this.parentLambda,
|
445
|
+
);
|
407
446
|
return;
|
408
447
|
} else if (
|
409
448
|
matchFunctionName(functionName, [
|
@@ -423,7 +462,11 @@ export class QueryBuilderValueSpecificationProcessor
|
|
423
462
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_GROUP_BY,
|
424
463
|
)
|
425
464
|
) {
|
426
|
-
processTDSGroupByExpression(
|
465
|
+
processTDSGroupByExpression(
|
466
|
+
valueSpecification,
|
467
|
+
this.queryBuilderState,
|
468
|
+
this.parentLambda,
|
469
|
+
);
|
427
470
|
return;
|
428
471
|
} else if (
|
429
472
|
matchFunctionName(functionName, QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_AGG)
|
@@ -432,6 +475,7 @@ export class QueryBuilderValueSpecificationProcessor
|
|
432
475
|
valueSpecification,
|
433
476
|
this.parentExpression,
|
434
477
|
this.queryBuilderState,
|
478
|
+
this.parentLambda,
|
435
479
|
);
|
436
480
|
return;
|
437
481
|
} else if (
|
@@ -443,6 +487,7 @@ export class QueryBuilderValueSpecificationProcessor
|
|
443
487
|
processTDS_OLAPGroupByExpression(
|
444
488
|
valueSpecification,
|
445
489
|
this.queryBuilderState,
|
490
|
+
this.parentLambda,
|
446
491
|
);
|
447
492
|
return;
|
448
493
|
} else if (
|
@@ -454,6 +499,7 @@ export class QueryBuilderValueSpecificationProcessor
|
|
454
499
|
processGraphFetchSerializeExpression(
|
455
500
|
valueSpecification,
|
456
501
|
this.queryBuilderState,
|
502
|
+
this.parentLambda,
|
457
503
|
);
|
458
504
|
return;
|
459
505
|
} else if (
|
@@ -462,7 +508,18 @@ export class QueryBuilderValueSpecificationProcessor
|
|
462
508
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH,
|
463
509
|
])
|
464
510
|
) {
|
465
|
-
processGraphFetchExpression(
|
511
|
+
processGraphFetchExpression(
|
512
|
+
valueSpecification,
|
513
|
+
this.queryBuilderState,
|
514
|
+
this.parentLambda,
|
515
|
+
);
|
516
|
+
return;
|
517
|
+
} else if (matchFunctionName(functionName, [SUPPORTED_FUNCTIONS.LET])) {
|
518
|
+
processLetExpression(
|
519
|
+
valueSpecification,
|
520
|
+
this.queryBuilderState,
|
521
|
+
this.parentLambda,
|
522
|
+
);
|
466
523
|
return;
|
467
524
|
}
|
468
525
|
throw new UnsupportedOperationError(
|
@@ -531,6 +588,7 @@ export class QueryBuilderValueSpecificationProcessor
|
|
531
588
|
expression.accept_ValueSpecificationVisitor(
|
532
589
|
new QueryBuilderValueSpecificationProcessor(
|
533
590
|
this.queryBuilderState,
|
591
|
+
this.parentLambda,
|
534
592
|
this.parentExpression,
|
535
593
|
),
|
536
594
|
),
|
@@ -574,6 +632,7 @@ export const processQueryLambdaFunction = (
|
|
574
632
|
lambdaFunction.expressionSequence.map((expression) =>
|
575
633
|
QueryBuilderValueSpecificationProcessor.process(
|
576
634
|
expression,
|
635
|
+
lambdaFunction,
|
577
636
|
queryBuilderState,
|
578
637
|
),
|
579
638
|
);
|
@@ -28,7 +28,9 @@ import {
|
|
28
28
|
GenericTypeExplicitReference,
|
29
29
|
LambdaFunction,
|
30
30
|
SimpleFunctionExpression,
|
31
|
-
|
31
|
+
PrimitiveInstanceValue,
|
32
|
+
PrimitiveType,
|
33
|
+
SUPPORTED_FUNCTIONS,
|
32
34
|
} from '@finos/legend-graph';
|
33
35
|
import type { QueryBuilderState } from './QueryBuilderState.js';
|
34
36
|
import { buildFilterExpression } from './filter/QueryBuilderFilterValueSpecificationBuilder.js';
|
@@ -37,6 +39,7 @@ import type { QueryBuilderFetchStructureState } from './fetch-structure/QueryBui
|
|
37
39
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
|
38
40
|
import { buildWatermarkExpression } from './watermark/QueryBuilderWatermarkValueSpecificationBuilder.js';
|
39
41
|
import { buildExecutionQueryFromLambdaFunction } from './shared/LambdaParameterState.js';
|
42
|
+
import type { QueryBuilderConstantExpressionState } from './QueryBuilderConstantsState.js';
|
40
43
|
|
41
44
|
const buildGetAllFunction = (
|
42
45
|
_class: Class,
|
@@ -54,6 +57,22 @@ const buildGetAllFunction = (
|
|
54
57
|
return _func;
|
55
58
|
};
|
56
59
|
|
60
|
+
const buildLetExpression = (
|
61
|
+
constantExpressionState: QueryBuilderConstantExpressionState,
|
62
|
+
): SimpleFunctionExpression => {
|
63
|
+
const varName = constantExpressionState.variable.name;
|
64
|
+
const value = constantExpressionState.value;
|
65
|
+
const leftSide = new PrimitiveInstanceValue(
|
66
|
+
GenericTypeExplicitReference.create(new GenericType(PrimitiveType.STRING)),
|
67
|
+
);
|
68
|
+
leftSide.values = [varName];
|
69
|
+
const letFunc = new SimpleFunctionExpression(
|
70
|
+
extractElementNameFromPath(SUPPORTED_FUNCTIONS.LET),
|
71
|
+
);
|
72
|
+
letFunc.parametersValues = [leftSide, value];
|
73
|
+
return letFunc;
|
74
|
+
};
|
75
|
+
|
57
76
|
const buildFetchStructure = (
|
58
77
|
fetchStructureState: QueryBuilderFetchStructureState,
|
59
78
|
lambdaFunction: LambdaFunction,
|
@@ -91,62 +110,17 @@ export const buildLambdaFunction = (
|
|
91
110
|
queryBuilderState.graphManagerState.graph,
|
92
111
|
);
|
93
112
|
if (milestoningStereotype) {
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
guaranteeNonNullable(
|
98
|
-
queryBuilderState.milestoningState.businessDate,
|
99
|
-
`Milestoning class should have a parameter of type 'Date'`,
|
100
|
-
),
|
101
|
-
);
|
102
|
-
break;
|
103
|
-
}
|
104
|
-
case MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL: {
|
105
|
-
getAllFunction.parametersValues.push(
|
106
|
-
guaranteeNonNullable(
|
107
|
-
queryBuilderState.milestoningState.processingDate,
|
108
|
-
`Milestoning class should have a parameter of type 'Date'`,
|
109
|
-
),
|
110
|
-
);
|
111
|
-
break;
|
112
|
-
}
|
113
|
-
case MILESTONING_STEREOTYPE.BITEMPORAL: {
|
114
|
-
getAllFunction.parametersValues.push(
|
115
|
-
guaranteeNonNullable(
|
116
|
-
queryBuilderState.milestoningState.processingDate,
|
117
|
-
`Milestoning class should have a parameter of type 'Date'`,
|
118
|
-
),
|
119
|
-
);
|
120
|
-
getAllFunction.parametersValues.push(
|
121
|
-
guaranteeNonNullable(
|
122
|
-
queryBuilderState.milestoningState.businessDate,
|
123
|
-
`Milestoning class should have a parameter of type 'Date'`,
|
124
|
-
),
|
125
|
-
);
|
126
|
-
break;
|
127
|
-
}
|
128
|
-
default:
|
129
|
-
}
|
113
|
+
queryBuilderState.milestoningState
|
114
|
+
.getMilestoningImplementation(milestoningStereotype)
|
115
|
+
.buildGetAllParameters(getAllFunction);
|
130
116
|
}
|
131
117
|
lambdaFunction.expressionSequence[0] = getAllFunction;
|
132
118
|
|
133
119
|
// build watermark
|
134
|
-
|
135
|
-
queryBuilderState.watermarkState,
|
136
|
-
getAllFunction,
|
137
|
-
);
|
138
|
-
if (watermarkFunction) {
|
139
|
-
lambdaFunction.expressionSequence[0] = watermarkFunction;
|
140
|
-
}
|
120
|
+
buildWatermarkExpression(queryBuilderState.watermarkState, lambdaFunction);
|
141
121
|
|
142
122
|
// build filter
|
143
|
-
|
144
|
-
queryBuilderState.filterState,
|
145
|
-
watermarkFunction ?? getAllFunction,
|
146
|
-
);
|
147
|
-
if (filterFunction) {
|
148
|
-
lambdaFunction.expressionSequence[0] = filterFunction;
|
149
|
-
}
|
123
|
+
buildFilterExpression(queryBuilderState.filterState, lambdaFunction);
|
150
124
|
|
151
125
|
// build fetch-structure
|
152
126
|
buildFetchStructure(
|
@@ -155,6 +129,15 @@ export const buildLambdaFunction = (
|
|
155
129
|
options,
|
156
130
|
);
|
157
131
|
|
132
|
+
// build variable expressions
|
133
|
+
if (queryBuilderState.constantState.constants.length) {
|
134
|
+
const letExpressions =
|
135
|
+
queryBuilderState.constantState.constants.map(buildLetExpression);
|
136
|
+
lambdaFunction.expressionSequence = [
|
137
|
+
...letExpressions,
|
138
|
+
...lambdaFunction.expressionSequence,
|
139
|
+
];
|
140
|
+
}
|
158
141
|
// build parameters
|
159
142
|
if (queryBuilderState.parametersState.parameterStates.length) {
|
160
143
|
if (options?.isBuildingExecutionQuery) {
|
@@ -16,12 +16,9 @@
|
|
16
16
|
|
17
17
|
import {
|
18
18
|
AbstractPropertyExpression,
|
19
|
-
Class,
|
20
19
|
DerivedProperty,
|
21
|
-
getMilestoneTemporalStereotype,
|
22
20
|
INTERNAL__PropagatedValue,
|
23
21
|
matchFunctionName,
|
24
|
-
MILESTONING_STEREOTYPE,
|
25
22
|
SimpleFunctionExpression,
|
26
23
|
VariableExpression,
|
27
24
|
type ValueSpecification,
|
@@ -32,103 +29,21 @@ import {
|
|
32
29
|
guaranteeType,
|
33
30
|
} from '@finos/legend-shared';
|
34
31
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
|
35
|
-
import { getDerivedPropertyMilestoningSteoreotype } from './QueryBuilderPropertyEditorState.js';
|
36
32
|
import type { QueryBuilderState } from './QueryBuilderState.js';
|
33
|
+
import { variableExpression_setName } from './shared/ValueSpecificationModifierHelper.js';
|
37
34
|
|
38
35
|
/**
|
39
|
-
*
|
40
|
-
* date propagation so we know whether we need to fill in values for the parameter
|
41
|
-
* or just propgate values from the parent's expression
|
42
|
-
*
|
43
|
-
* NOTE: this takes date propgation into account. See the table below for all
|
44
|
-
* the combination:
|
45
|
-
*
|
46
|
-
* | [source] | | | | |
|
47
|
-
* ----------------------------------------------------------------------
|
48
|
-
* [target] | | NONE | PR_TMP | BI_TMP | BU_TMP |
|
49
|
-
* ----------------------------------------------------------------------
|
50
|
-
* | NONE | N.A. | PRD | PRD,BUD | BUD |
|
51
|
-
* ----------------------------------------------------------------------
|
52
|
-
* | PR_TMP | N.A. | X | PRD,BUD | BUD |
|
53
|
-
* ----------------------------------------------------------------------
|
54
|
-
* | BI_TMP | N.A. | X | X | X |
|
55
|
-
* ----------------------------------------------------------------------
|
56
|
-
* | BU_TMP | N.A. | PRD | PRD,BUD | X |
|
57
|
-
* ----------------------------------------------------------------------
|
58
|
-
*
|
59
|
-
* Annotations:
|
60
|
-
*
|
61
|
-
* [source]: source temporal type
|
62
|
-
* [target]: target temporal type
|
63
|
-
*
|
64
|
-
* PR_TMP : processing temporal
|
65
|
-
* BI_TMP : bitemporal
|
66
|
-
* BU_TMP : business temporal
|
67
|
-
*
|
68
|
-
* X : no default date propagated
|
69
|
-
* PRD : default processing date is propagated
|
70
|
-
* BUD : default business date is propgated
|
36
|
+
* Gets the value of ValueSpecification given INTERNAL__PropagatedValue is pointing to.
|
71
37
|
*/
|
72
|
-
const
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
const graph = queryBuilderState.graphManagerState.graph;
|
79
|
-
// Default date propagation is not supported for current expression when the previous property expression is a derived property.
|
80
|
-
if (
|
81
|
-
prevPropertyExpression &&
|
82
|
-
prevPropertyExpression.func.value instanceof DerivedProperty &&
|
83
|
-
prevPropertyExpression.func.value._OWNER.derivedProperties.includes(
|
84
|
-
prevPropertyExpression.func.value,
|
85
|
-
)
|
86
|
-
) {
|
87
|
-
return false;
|
88
|
-
}
|
89
|
-
// Default date propagation is not supported for current expression when the milestonedParameterValues of
|
90
|
-
// the previous property expression doesn't match with the global milestonedParameterValues
|
91
|
-
if (
|
92
|
-
prevPropertyExpression &&
|
93
|
-
prevPropertyExpression.func.value.genericType.value.rawType instanceof Class
|
94
|
-
) {
|
95
|
-
const milestoningStereotype = getMilestoneTemporalStereotype(
|
96
|
-
prevPropertyExpression.func.value.genericType.value.rawType,
|
97
|
-
graph,
|
98
|
-
);
|
99
|
-
if (
|
100
|
-
milestoningStereotype &&
|
101
|
-
!prevPropertyExpression.parametersValues
|
102
|
-
.slice(1)
|
103
|
-
.every(
|
104
|
-
(parameterValue) =>
|
105
|
-
parameterValue instanceof INTERNAL__PropagatedValue,
|
106
|
-
)
|
107
|
-
) {
|
108
|
-
return false;
|
109
|
-
}
|
110
|
-
}
|
111
|
-
if (property.genericType.value.rawType instanceof Class) {
|
112
|
-
// the stereotype of source class of current property expression.
|
113
|
-
const sourceStereotype =
|
114
|
-
property instanceof DerivedProperty
|
115
|
-
? getDerivedPropertyMilestoningSteoreotype(property, graph)
|
116
|
-
: undefined;
|
117
|
-
// Default date propagation is always supported if the source is `bitemporal`
|
118
|
-
if (sourceStereotype === MILESTONING_STEREOTYPE.BITEMPORAL) {
|
119
|
-
return true;
|
120
|
-
}
|
121
|
-
// the stereotype (if exists) of the generic type of current property expression.
|
122
|
-
const targetStereotype = getMilestoneTemporalStereotype(
|
123
|
-
property.genericType.value.rawType,
|
124
|
-
graph,
|
38
|
+
const getValueOfInternalPropagatedValue = (
|
39
|
+
valueSpec: INTERNAL__PropagatedValue,
|
40
|
+
): ValueSpecification => {
|
41
|
+
if (valueSpec.getValue() instanceof INTERNAL__PropagatedValue) {
|
42
|
+
return getValueOfInternalPropagatedValue(
|
43
|
+
guaranteeType(valueSpec.getValue(), INTERNAL__PropagatedValue),
|
125
44
|
);
|
126
|
-
// Default date propagation is supported when stereotype of both source and target matches
|
127
|
-
if (sourceStereotype && targetStereotype) {
|
128
|
-
return sourceStereotype === targetStereotype;
|
129
|
-
}
|
130
45
|
}
|
131
|
-
return
|
46
|
+
return valueSpec.getValue();
|
132
47
|
};
|
133
48
|
|
134
49
|
export const buildPropertyExpressionChain = (
|
@@ -173,13 +88,7 @@ export const buildPropertyExpressionChain = (
|
|
173
88
|
// Replace with argumentless derived property expression only when default date propagation is supported
|
174
89
|
if (
|
175
90
|
!TEMPORARY__disableDatePropagation &&
|
176
|
-
|
177
|
-
currentPropertyExpression,
|
178
|
-
queryBuilderState,
|
179
|
-
nextExpression instanceof AbstractPropertyExpression
|
180
|
-
? nextExpression
|
181
|
-
: undefined,
|
182
|
-
)
|
91
|
+
parameterValue.isPropagatedValue
|
183
92
|
) {
|
184
93
|
// NOTE: For `bitemporal` property check if the property expression has parameters which are not instance of
|
185
94
|
// `INTERNAL_PropagatedValue` then pass the parameters as user explicitly changed values of either of the parameters.
|
@@ -190,11 +99,13 @@ export const buildPropertyExpressionChain = (
|
|
190
99
|
currentPropertyExpression.parametersValues.length === 3 &&
|
191
100
|
!(
|
192
101
|
currentPropertyExpression.parametersValues[2] instanceof
|
193
|
-
|
102
|
+
INTERNAL__PropagatedValue &&
|
103
|
+
currentPropertyExpression.parametersValues[2]
|
104
|
+
.isPropagatedValue === true
|
194
105
|
))
|
195
106
|
) {
|
196
107
|
currentPropertyExpression.parametersValues[index + 1] =
|
197
|
-
parameterValue
|
108
|
+
getValueOfInternalPropagatedValue(parameterValue);
|
198
109
|
} else {
|
199
110
|
currentPropertyExpression.parametersValues = [
|
200
111
|
guaranteeNonNullable(
|
@@ -205,7 +116,7 @@ export const buildPropertyExpressionChain = (
|
|
205
116
|
}
|
206
117
|
} else {
|
207
118
|
currentPropertyExpression.parametersValues[index + 1] =
|
208
|
-
parameterValue
|
119
|
+
getValueOfInternalPropagatedValue(parameterValue);
|
209
120
|
}
|
210
121
|
}
|
211
122
|
});
|
@@ -228,7 +139,7 @@ export const buildPropertyExpressionChain = (
|
|
228
139
|
|
229
140
|
// Update the root lambda name based on the parent's lambda parameter name.
|
230
141
|
if (currentExpression instanceof VariableExpression) {
|
231
|
-
currentExpression
|
142
|
+
variableExpression_setName(currentExpression, lambdaParameterName);
|
232
143
|
}
|
233
144
|
return newPropertyExpression;
|
234
145
|
};
|
@@ -38,7 +38,6 @@ import {
|
|
38
38
|
Class,
|
39
39
|
getMilestoneTemporalStereotype,
|
40
40
|
DerivedProperty,
|
41
|
-
MILESTONING_STEREOTYPE,
|
42
41
|
PackageableElementExplicitReference,
|
43
42
|
Multiplicity,
|
44
43
|
CollectionInstanceValue,
|
@@ -55,7 +54,10 @@ import {
|
|
55
54
|
UnsupportedOperationError,
|
56
55
|
} from '@finos/legend-shared';
|
57
56
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
|
58
|
-
import {
|
57
|
+
import {
|
58
|
+
getDerivedPropertyMilestoningSteoreotype,
|
59
|
+
validateMilestoningPropertyExpressionChain,
|
60
|
+
} from './milestoning/QueryBuilderMilestoningHelper.js';
|
59
61
|
|
60
62
|
export const getNonCollectionValueSpecificationType = (
|
61
63
|
valueSpecification: ValueSpecification,
|
@@ -209,6 +211,7 @@ export const generateDefaultValueForPrimitiveType = (
|
|
209
211
|
case PRIMITIVE_TYPE.DECIMAL:
|
210
212
|
case PRIMITIVE_TYPE.FLOAT:
|
211
213
|
case PRIMITIVE_TYPE.INTEGER:
|
214
|
+
case PRIMITIVE_TYPE.BINARY:
|
212
215
|
return 0;
|
213
216
|
case PRIMITIVE_TYPE.DATE:
|
214
217
|
case PRIMITIVE_TYPE.STRICTDATE:
|
@@ -301,33 +304,11 @@ export const validatePropertyExpressionChain = (
|
|
301
304
|
guaranteeType(func, DerivedProperty),
|
302
305
|
graph,
|
303
306
|
);
|
304
|
-
|
305
|
-
sourceStereotype
|
306
|
-
targetStereotype
|
307
|
-
|
308
|
-
|
309
|
-
if (
|
310
|
-
propertyExpression.parametersValues.length !== 3 &&
|
311
|
-
!sourceStereotype
|
312
|
-
) {
|
313
|
-
throw new UnsupportedOperationError(
|
314
|
-
`Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should have exactly two parameters`,
|
315
|
-
);
|
316
|
-
} else if (propertyExpression.parametersValues.length < 2) {
|
317
|
-
throw new UnsupportedOperationError(
|
318
|
-
`Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should have at least one parameter`,
|
319
|
-
);
|
320
|
-
} else if (propertyExpression.parametersValues.length > 3) {
|
321
|
-
throw new UnsupportedOperationError(
|
322
|
-
`Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should not have more than two parameters`,
|
323
|
-
);
|
324
|
-
}
|
325
|
-
} else if (propertyExpression.parametersValues.length !== 2) {
|
326
|
-
throw new UnsupportedOperationError(
|
327
|
-
`Property of milestoning sterotype '${targetStereotype}' should have exactly one parameter`,
|
328
|
-
);
|
329
|
-
}
|
330
|
-
}
|
307
|
+
validateMilestoningPropertyExpressionChain(
|
308
|
+
sourceStereotype,
|
309
|
+
targetStereotype,
|
310
|
+
propertyExpression,
|
311
|
+
);
|
331
312
|
}
|
332
313
|
}
|
333
314
|
}
|