@finos/legend-query-builder 3.2.11 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.js +5 -4
- package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
- package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderTextEditor.js +1 -1
- package/lib/components/QueryBuilderTextEditor.js.map +1 -1
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.js +5 -3
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +2 -2
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.js +1 -0
- package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
- package/lib/components/shared/LambdaEditor.d.ts +18 -19
- package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaEditor.js +30 -19
- package/lib/components/shared/LambdaEditor.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_QueryBuilder_PureGraphManagerExtension.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_QueryBuilder_PureGraphManagerExtension.js +20 -4
- package/lib/graph-manager/protocol/pure/v1/V1_QueryBuilder_PureGraphManagerExtension.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +54 -27
- package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +2 -2
- package/lib/stores/QueryBuilderStateBuilder.d.ts +1 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.js +6 -7
- package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.js +1 -0
- package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.d.ts +3 -3
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.js +18 -4
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.js +1 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.d.ts +2 -2
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +2 -2
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/shared/LambdaEditorState.d.ts.map +1 -1
- package/lib/stores/shared/LambdaEditorState.js.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.js +1 -0
- package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
- package/lib/stores/workflows/ClassQueryBuilderState.d.ts +5 -5
- package/lib/stores/workflows/ClassQueryBuilderState.js +6 -6
- package/lib/stores/workflows/MappingQueryBuilderState.d.ts +4 -4
- package/lib/stores/workflows/MappingQueryBuilderState.js +4 -4
- package/lib/stores/workflows/ServiceQueryBuilderState.d.ts +2 -2
- package/lib/stores/workflows/ServiceQueryBuilderState.js +2 -2
- package/package.json +10 -10
- package/src/components/QueryBuilderPropertyExpressionEditor.tsx +7 -8
- package/src/components/QueryBuilderTextEditor.tsx +1 -4
- package/src/components/explorer/QueryBuilderFunctionsExplorerPanel.tsx +5 -3
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +2 -2
- package/src/components/shared/BasicValueSpecificationEditor.tsx +1 -0
- package/src/components/shared/LambdaEditor.tsx +126 -79
- package/src/graph-manager/protocol/pure/v1/V1_QueryBuilder_PureGraphManagerExtension.ts +35 -23
- package/src/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +205 -83
- package/src/stores/QueryBuilderStateBuilder.ts +15 -19
- package/src/stores/QueryBuilderValueSpecificationHelper.ts +1 -0
- package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.ts +44 -12
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.ts +5 -12
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.ts +2 -1
- package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.ts +2 -1
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +2 -1
- package/src/stores/shared/LambdaEditorState.ts +1 -0
- package/src/stores/shared/ValueSpecificationEditorHelper.ts +1 -0
- package/src/stores/workflows/ClassQueryBuilderState.ts +6 -6
- package/src/stores/workflows/MappingQueryBuilderState.ts +4 -4
- package/src/stores/workflows/ServiceQueryBuilderState.ts +2 -2
|
@@ -52,6 +52,11 @@ import {
|
|
|
52
52
|
PrimitiveType,
|
|
53
53
|
V1_CStrictDate,
|
|
54
54
|
V1_CString,
|
|
55
|
+
CORE_PURE_PATH,
|
|
56
|
+
FunctionType,
|
|
57
|
+
LambdaFunction,
|
|
58
|
+
LambdaFunctionInstanceValue,
|
|
59
|
+
PackageableElementExplicitReference,
|
|
55
60
|
} from '@finos/legend-graph';
|
|
56
61
|
import {
|
|
57
62
|
QUERY_BUILDER_PURE_PATH,
|
|
@@ -91,81 +96,41 @@ const buildProjectionColumnLambda = (
|
|
|
91
96
|
let currentPropertyExpression: V1_ValueSpecification = valueSpecification
|
|
92
97
|
.body[0] as V1_ValueSpecification;
|
|
93
98
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
)
|
|
101
|
-
) {
|
|
102
|
-
assertTrue(
|
|
103
|
-
currentPropertyExpression.parameters.length === 4,
|
|
104
|
-
`Can't build projection column: only support calendar function with four parameters`,
|
|
105
|
-
);
|
|
106
|
-
assertType(
|
|
107
|
-
currentPropertyExpression.parameters[0],
|
|
108
|
-
V1_AppliedProperty,
|
|
109
|
-
`Can't build projection column: only support first parameter of calendar function as property expression`,
|
|
110
|
-
);
|
|
111
|
-
const calendarType = guaranteeType(
|
|
112
|
-
currentPropertyExpression.parameters[1],
|
|
113
|
-
V1_CString,
|
|
114
|
-
`Can't build projection column: only support second parameter of calendar function as String`,
|
|
115
|
-
);
|
|
99
|
+
assertType(
|
|
100
|
+
currentPropertyExpression,
|
|
101
|
+
V1_AppliedProperty,
|
|
102
|
+
`Can't build projection column: only support lambda body as property expression`,
|
|
103
|
+
);
|
|
104
|
+
while (currentPropertyExpression instanceof V1_AppliedProperty) {
|
|
116
105
|
assertTrue(
|
|
117
|
-
|
|
118
|
-
(val) => val === calendarType.value,
|
|
119
|
-
) !== undefined,
|
|
120
|
-
`Can't build projection column: ${calendarType.value} is not a supported calendar type`,
|
|
121
|
-
);
|
|
122
|
-
guaranteeType(
|
|
123
|
-
currentPropertyExpression.parameters[2],
|
|
124
|
-
V1_CStrictDate,
|
|
125
|
-
`Can't build projection column: only support third parameter of calendar function as StrictDate`,
|
|
126
|
-
);
|
|
127
|
-
assertType(
|
|
128
|
-
currentPropertyExpression.parameters[3],
|
|
129
|
-
V1_AppliedProperty,
|
|
130
|
-
`Can't build projection column: only support fourth parameter of calendar function as property expression`,
|
|
131
|
-
);
|
|
132
|
-
} else {
|
|
133
|
-
assertType(
|
|
134
|
-
currentPropertyExpression,
|
|
135
|
-
V1_AppliedProperty,
|
|
106
|
+
currentPropertyExpression.parameters.length >= 1,
|
|
136
107
|
`Can't build projection column: only support lambda body as property expression`,
|
|
137
108
|
);
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
109
|
+
currentPropertyExpression = currentPropertyExpression
|
|
110
|
+
.parameters[0] as V1_ValueSpecification;
|
|
111
|
+
// Take care of chains of subtype (a pattern that is not useful, but we want to support and rectify)
|
|
112
|
+
// $x.employees->subType(@Person)->subType(@Staff)
|
|
113
|
+
while (
|
|
114
|
+
currentPropertyExpression instanceof V1_AppliedFunction &&
|
|
115
|
+
matchFunctionName(
|
|
116
|
+
currentPropertyExpression.function,
|
|
117
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.SUBTYPE,
|
|
118
|
+
)
|
|
119
|
+
) {
|
|
143
120
|
currentPropertyExpression = currentPropertyExpression
|
|
144
121
|
.parameters[0] as V1_ValueSpecification;
|
|
145
|
-
// Take care of chains of subtype (a pattern that is not useful, but we want to support and rectify)
|
|
146
|
-
// $x.employees->subType(@Person)->subType(@Staff)
|
|
147
|
-
while (
|
|
148
|
-
currentPropertyExpression instanceof V1_AppliedFunction &&
|
|
149
|
-
matchFunctionName(
|
|
150
|
-
currentPropertyExpression.function,
|
|
151
|
-
QUERY_BUILDER_SUPPORTED_FUNCTIONS.SUBTYPE,
|
|
152
|
-
)
|
|
153
|
-
) {
|
|
154
|
-
currentPropertyExpression = currentPropertyExpression
|
|
155
|
-
.parameters[0] as V1_ValueSpecification;
|
|
156
|
-
}
|
|
157
122
|
}
|
|
158
|
-
// check lambda variable and parameter match
|
|
159
|
-
assertType(
|
|
160
|
-
currentPropertyExpression,
|
|
161
|
-
V1_Variable,
|
|
162
|
-
`Can't build projection column: only support lambda body as property expression`,
|
|
163
|
-
);
|
|
164
|
-
assertTrue(
|
|
165
|
-
columnLambdaParameter.name === currentPropertyExpression.name,
|
|
166
|
-
`Can't build column lambda: expects variable used in lambda body '${currentPropertyExpression.name}' to match lambda parameter '${columnLambdaParameter.name}'`,
|
|
167
|
-
);
|
|
168
123
|
}
|
|
124
|
+
// check lambda variable and parameter match
|
|
125
|
+
assertType(
|
|
126
|
+
currentPropertyExpression,
|
|
127
|
+
V1_Variable,
|
|
128
|
+
`Can't build projection column: only support lambda body as property expression`,
|
|
129
|
+
);
|
|
130
|
+
assertTrue(
|
|
131
|
+
columnLambdaParameter.name === currentPropertyExpression.name,
|
|
132
|
+
`Can't build column lambda: expects variable used in lambda body '${currentPropertyExpression.name}' to match lambda parameter '${columnLambdaParameter.name}'`,
|
|
133
|
+
);
|
|
169
134
|
return valueSpecification.accept_ValueSpecificationVisitor(
|
|
170
135
|
new V1_ValueSpecificationBuilder(
|
|
171
136
|
compileContext,
|
|
@@ -175,6 +140,138 @@ const buildProjectionColumnLambda = (
|
|
|
175
140
|
);
|
|
176
141
|
};
|
|
177
142
|
|
|
143
|
+
const buildCalendarFunctionExpression = (
|
|
144
|
+
valueSpecification: V1_ValueSpecification,
|
|
145
|
+
openVariables: string[],
|
|
146
|
+
compileContext: V1_GraphBuilderContext,
|
|
147
|
+
processingContext: V1_ProcessingContext,
|
|
148
|
+
): ValueSpecification => {
|
|
149
|
+
assertType(
|
|
150
|
+
valueSpecification,
|
|
151
|
+
V1_Lambda,
|
|
152
|
+
`Can't build calendar aggregation column: only support lambda`,
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
// lambda parameter
|
|
156
|
+
assertTrue(
|
|
157
|
+
valueSpecification.parameters.length === 1,
|
|
158
|
+
`Can't build calendar aggregation column: only support lambda with 1 parameter`,
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
// lambda body
|
|
162
|
+
assertTrue(
|
|
163
|
+
valueSpecification.body.length === 1,
|
|
164
|
+
`Can't build calendar aggregation column: only support lambda body with 1 expression`,
|
|
165
|
+
);
|
|
166
|
+
const columnLambdaParameter = guaranteeType(
|
|
167
|
+
valueSpecification.parameters[0],
|
|
168
|
+
V1_Variable,
|
|
169
|
+
`Can't build calendar aggregation column: only support lambda with 1 parameter`,
|
|
170
|
+
);
|
|
171
|
+
const currentPropertyExpression = guaranteeType(
|
|
172
|
+
valueSpecification.body[0],
|
|
173
|
+
V1_AppliedFunction,
|
|
174
|
+
`Can't build calendar aggregation column: only support applied function`,
|
|
175
|
+
);
|
|
176
|
+
assertTrue(
|
|
177
|
+
matchFunctionName(
|
|
178
|
+
currentPropertyExpression.function,
|
|
179
|
+
Object.values(QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS),
|
|
180
|
+
),
|
|
181
|
+
`Can't build calendar aggregation columnn: unsupported calenddar function`,
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
assertTrue(
|
|
185
|
+
currentPropertyExpression.parameters.length === 4,
|
|
186
|
+
`Can't build calendar aggregation column: only support calendar function with four parameters`,
|
|
187
|
+
);
|
|
188
|
+
assertType(
|
|
189
|
+
currentPropertyExpression.parameters[0],
|
|
190
|
+
V1_AppliedProperty,
|
|
191
|
+
`Can't build calendar aggregation column: only support first parameter of calendar function as property expression`,
|
|
192
|
+
);
|
|
193
|
+
const calendarType = guaranteeType(
|
|
194
|
+
currentPropertyExpression.parameters[1],
|
|
195
|
+
V1_CString,
|
|
196
|
+
`Can't build calendar aggregation column: only support second parameter of calendar function as String`,
|
|
197
|
+
);
|
|
198
|
+
assertTrue(
|
|
199
|
+
Object.values(QUERY_BUILDER_CALENDAR_TYPE).find(
|
|
200
|
+
(val) => val === calendarType.value,
|
|
201
|
+
) !== undefined,
|
|
202
|
+
`Can't build calendar aggregation column: ${calendarType.value} is not a supported calendar type`,
|
|
203
|
+
);
|
|
204
|
+
guaranteeType(
|
|
205
|
+
currentPropertyExpression.parameters[2],
|
|
206
|
+
V1_CStrictDate,
|
|
207
|
+
`Can't build calendar aggregation column: only support third parameter of calendar function as StrictDate`,
|
|
208
|
+
);
|
|
209
|
+
const dateColumn =
|
|
210
|
+
currentPropertyExpression.parameters[0].accept_ValueSpecificationVisitor(
|
|
211
|
+
new V1_ValueSpecificationBuilder(
|
|
212
|
+
compileContext,
|
|
213
|
+
processingContext,
|
|
214
|
+
openVariables,
|
|
215
|
+
),
|
|
216
|
+
);
|
|
217
|
+
const calendarTypeValueSpec = guaranteeNonNullable(
|
|
218
|
+
currentPropertyExpression.parameters[1],
|
|
219
|
+
).accept_ValueSpecificationVisitor(
|
|
220
|
+
new V1_ValueSpecificationBuilder(
|
|
221
|
+
compileContext,
|
|
222
|
+
processingContext,
|
|
223
|
+
openVariables,
|
|
224
|
+
),
|
|
225
|
+
);
|
|
226
|
+
const endDate = guaranteeNonNullable(
|
|
227
|
+
currentPropertyExpression.parameters[2],
|
|
228
|
+
).accept_ValueSpecificationVisitor(
|
|
229
|
+
new V1_ValueSpecificationBuilder(
|
|
230
|
+
compileContext,
|
|
231
|
+
processingContext,
|
|
232
|
+
openVariables,
|
|
233
|
+
),
|
|
234
|
+
);
|
|
235
|
+
const columnLambda = guaranteeNonNullable(
|
|
236
|
+
currentPropertyExpression.parameters[3],
|
|
237
|
+
);
|
|
238
|
+
const targetColumn =
|
|
239
|
+
returnUndefOnError(() =>
|
|
240
|
+
columnLambda.accept_ValueSpecificationVisitor(
|
|
241
|
+
new V1_ValueSpecificationBuilder(
|
|
242
|
+
compileContext,
|
|
243
|
+
processingContext,
|
|
244
|
+
openVariables,
|
|
245
|
+
),
|
|
246
|
+
),
|
|
247
|
+
) ??
|
|
248
|
+
new INTERNAL__UnknownValueSpecification(
|
|
249
|
+
V1_serializeValueSpecification(
|
|
250
|
+
columnLambda,
|
|
251
|
+
compileContext.extensions.plugins,
|
|
252
|
+
),
|
|
253
|
+
);
|
|
254
|
+
const calendarFunctionExpression = V1_buildBaseSimpleFunctionExpression(
|
|
255
|
+
[dateColumn, calendarTypeValueSpec, endDate, targetColumn],
|
|
256
|
+
currentPropertyExpression.function,
|
|
257
|
+
compileContext,
|
|
258
|
+
);
|
|
259
|
+
const functionInstanceValue = new LambdaFunctionInstanceValue();
|
|
260
|
+
const functionType = new FunctionType(
|
|
261
|
+
PackageableElementExplicitReference.create(
|
|
262
|
+
compileContext.graph.getType(CORE_PURE_PATH.ANY),
|
|
263
|
+
),
|
|
264
|
+
Multiplicity.ONE,
|
|
265
|
+
);
|
|
266
|
+
functionType.parameters.push(
|
|
267
|
+
new VariableExpression(columnLambdaParameter.name, Multiplicity.ONE),
|
|
268
|
+
);
|
|
269
|
+
const lambdaFunction = new LambdaFunction(functionType);
|
|
270
|
+
lambdaFunction.expressionSequence = [calendarFunctionExpression];
|
|
271
|
+
functionInstanceValue.values.push(lambdaFunction);
|
|
272
|
+
return functionInstanceValue;
|
|
273
|
+
};
|
|
274
|
+
|
|
178
275
|
const buildAggregationExpression = (
|
|
179
276
|
valueSpecification: V1_ValueSpecification,
|
|
180
277
|
openVariables: string[],
|
|
@@ -205,21 +302,46 @@ const buildAggregationExpression = (
|
|
|
205
302
|
V1_Lambda,
|
|
206
303
|
`Can't build agg() expression: agg() expects argument #1 as a lambda`,
|
|
207
304
|
);
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
305
|
+
let processedColumnLambda;
|
|
306
|
+
if (
|
|
307
|
+
columnLambda.body[0] instanceof V1_AppliedFunction &&
|
|
308
|
+
matchFunctionName(
|
|
309
|
+
columnLambda.body[0].function,
|
|
310
|
+
Object.values(QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS),
|
|
311
|
+
)
|
|
312
|
+
) {
|
|
313
|
+
processedColumnLambda =
|
|
314
|
+
returnUndefOnError(() =>
|
|
315
|
+
buildCalendarFunctionExpression(
|
|
316
|
+
columnLambda,
|
|
317
|
+
openVariables,
|
|
318
|
+
compileContext,
|
|
319
|
+
processingContext,
|
|
320
|
+
),
|
|
321
|
+
) ??
|
|
322
|
+
new INTERNAL__UnknownValueSpecification(
|
|
323
|
+
V1_serializeValueSpecification(
|
|
324
|
+
columnLambda,
|
|
325
|
+
compileContext.extensions.plugins,
|
|
326
|
+
),
|
|
327
|
+
);
|
|
328
|
+
} else {
|
|
329
|
+
processedColumnLambda =
|
|
330
|
+
returnUndefOnError(() =>
|
|
331
|
+
buildProjectionColumnLambda(
|
|
332
|
+
columnLambda,
|
|
333
|
+
openVariables,
|
|
334
|
+
compileContext,
|
|
335
|
+
processingContext,
|
|
336
|
+
),
|
|
337
|
+
) ??
|
|
338
|
+
new INTERNAL__UnknownValueSpecification(
|
|
339
|
+
V1_serializeValueSpecification(
|
|
340
|
+
columnLambda,
|
|
341
|
+
compileContext.extensions.plugins,
|
|
342
|
+
),
|
|
343
|
+
);
|
|
344
|
+
}
|
|
223
345
|
|
|
224
346
|
// aggregate lambda
|
|
225
347
|
const aggregateLambda = guaranteeType(
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
PrimitiveInstanceValue,
|
|
41
41
|
SimpleFunctionExpression,
|
|
42
42
|
type VariableExpression,
|
|
43
|
-
AbstractPropertyExpression,
|
|
43
|
+
type AbstractPropertyExpression,
|
|
44
44
|
getMilestoneTemporalStereotype,
|
|
45
45
|
type INTERNAL__PropagatedValue,
|
|
46
46
|
type ValueSpecification,
|
|
@@ -143,22 +143,6 @@ const processLetExpression = (
|
|
|
143
143
|
queryBuilderState.constantState.addConstant(constantExpression);
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
-
const processCalendarFunction = (
|
|
147
|
-
expression: SimpleFunctionExpression,
|
|
148
|
-
queryBuilderState: QueryBuilderState,
|
|
149
|
-
parentLambda: LambdaFunction,
|
|
150
|
-
): void => {
|
|
151
|
-
queryBuilderState.isCalendarEnabled = true;
|
|
152
|
-
assertTrue(
|
|
153
|
-
expression.parametersValues.length === 4,
|
|
154
|
-
'Calendar function expected to have four parameters',
|
|
155
|
-
);
|
|
156
|
-
processTDSProjectionColumnPropertyExpression(
|
|
157
|
-
guaranteeType(expression.parametersValues[3], AbstractPropertyExpression),
|
|
158
|
-
queryBuilderState,
|
|
159
|
-
);
|
|
160
|
-
};
|
|
161
|
-
|
|
162
146
|
/**
|
|
163
147
|
* This is the value specification processor (a.k.a state builder) for query builder.
|
|
164
148
|
*
|
|
@@ -297,6 +281,9 @@ export class QueryBuilderValueSpecificationProcessor
|
|
|
297
281
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_PROJECT,
|
|
298
282
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_GROUP_BY,
|
|
299
283
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_AGG,
|
|
284
|
+
...Object.values(
|
|
285
|
+
QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS,
|
|
286
|
+
),
|
|
300
287
|
])
|
|
301
288
|
) {
|
|
302
289
|
processTDSProjectionDerivationExpression(
|
|
@@ -561,10 +548,16 @@ export class QueryBuilderValueSpecificationProcessor
|
|
|
561
548
|
Object.values(QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS),
|
|
562
549
|
)
|
|
563
550
|
) {
|
|
564
|
-
|
|
551
|
+
this.queryBuilderState.isCalendarEnabled = true;
|
|
552
|
+
assertTrue(
|
|
553
|
+
valueSpecification.parametersValues.length === 4,
|
|
554
|
+
'Calendar function expected to have four parameters',
|
|
555
|
+
);
|
|
556
|
+
QueryBuilderValueSpecificationProcessor.processChild(
|
|
557
|
+
guaranteeNonNullable(valueSpecification.parametersValues[3]),
|
|
565
558
|
valueSpecification,
|
|
566
|
-
this.queryBuilderState,
|
|
567
559
|
this.parentLambda,
|
|
560
|
+
this.queryBuilderState,
|
|
568
561
|
);
|
|
569
562
|
return;
|
|
570
563
|
}
|
|
@@ -590,6 +583,9 @@ export class QueryBuilderValueSpecificationProcessor
|
|
|
590
583
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_PROJECT,
|
|
591
584
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_GROUP_BY,
|
|
592
585
|
QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_AGG,
|
|
586
|
+
...Object.values(
|
|
587
|
+
QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS,
|
|
588
|
+
),
|
|
593
589
|
])
|
|
594
590
|
) {
|
|
595
591
|
processTDSProjectionColumnPropertyExpression(
|
|
@@ -215,6 +215,7 @@ export const generateDefaultValueForPrimitiveType = (
|
|
|
215
215
|
case PRIMITIVE_TYPE.DECIMAL:
|
|
216
216
|
case PRIMITIVE_TYPE.FLOAT:
|
|
217
217
|
case PRIMITIVE_TYPE.INTEGER:
|
|
218
|
+
case PRIMITIVE_TYPE.BYTE:
|
|
218
219
|
case PRIMITIVE_TYPE.BINARY:
|
|
219
220
|
return 0;
|
|
220
221
|
case PRIMITIVE_TYPE.DATE:
|
|
@@ -14,16 +14,23 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
|
|
17
|
+
import {
|
|
18
|
+
type Hashable,
|
|
19
|
+
guaranteeType,
|
|
20
|
+
UnsupportedOperationError,
|
|
21
|
+
} from '@finos/legend-shared';
|
|
22
|
+
import {
|
|
19
23
|
AbstractPropertyExpression,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
INTERNAL__UnknownValueSpecification,
|
|
25
|
+
LambdaFunctionInstanceValue,
|
|
26
|
+
type PrimitiveInstanceValue,
|
|
27
|
+
type SimpleFunctionExpression,
|
|
28
|
+
type ValueSpecification,
|
|
23
29
|
} from '@finos/legend-graph';
|
|
24
30
|
import {
|
|
25
31
|
type QueryBuilderProjectionColumnState,
|
|
26
32
|
QueryBuilderSimpleProjectionColumnState,
|
|
33
|
+
QueryBuilderDerivationProjectionColumnState,
|
|
27
34
|
} from '../projection/QueryBuilderProjectionColumnState.js';
|
|
28
35
|
import type { QueryBuilderAggregateColumnState } from './QueryBuilderAggregationState.js';
|
|
29
36
|
import { computed, makeObservable, observable, action } from 'mobx';
|
|
@@ -59,18 +66,43 @@ export abstract class QueryBuilderAggregateCalendarFunction
|
|
|
59
66
|
): boolean;
|
|
60
67
|
|
|
61
68
|
abstract buildCalendarFunctionExpression(
|
|
62
|
-
propertyExpression:
|
|
69
|
+
propertyExpression:
|
|
70
|
+
| AbstractPropertyExpression
|
|
71
|
+
| INTERNAL__UnknownValueSpecification,
|
|
63
72
|
): ValueSpecification;
|
|
64
73
|
|
|
65
74
|
buildCalendarFunctionExpressionFromState(
|
|
66
75
|
aggregateColumnState: QueryBuilderAggregateColumnState,
|
|
76
|
+
columnLambda: ValueSpecification,
|
|
67
77
|
): ValueSpecification {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
let targetColumn:
|
|
79
|
+
| AbstractPropertyExpression
|
|
80
|
+
| INTERNAL__UnknownValueSpecification
|
|
81
|
+
| undefined;
|
|
82
|
+
if (
|
|
83
|
+
aggregateColumnState.projectionColumnState instanceof
|
|
84
|
+
QueryBuilderSimpleProjectionColumnState &&
|
|
85
|
+
columnLambda instanceof LambdaFunctionInstanceValue
|
|
86
|
+
) {
|
|
87
|
+
targetColumn = guaranteeType(
|
|
88
|
+
columnLambda.values[0]?.expressionSequence[0],
|
|
89
|
+
AbstractPropertyExpression,
|
|
90
|
+
);
|
|
91
|
+
} else if (
|
|
92
|
+
aggregateColumnState.projectionColumnState instanceof
|
|
93
|
+
QueryBuilderDerivationProjectionColumnState
|
|
94
|
+
) {
|
|
95
|
+
targetColumn = guaranteeType(
|
|
96
|
+
columnLambda,
|
|
97
|
+
INTERNAL__UnknownValueSpecification,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
if (!targetColumn) {
|
|
101
|
+
throw new UnsupportedOperationError(
|
|
102
|
+
"Can't build calendar aggregation column: target column should be defined",
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
return this.buildCalendarFunctionExpression(targetColumn);
|
|
74
106
|
}
|
|
75
107
|
|
|
76
108
|
abstract updateAggregateColumnState(
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
PrimitiveType,
|
|
27
27
|
PRIMITIVE_TYPE,
|
|
28
28
|
VariableExpression,
|
|
29
|
+
type INTERNAL__UnknownValueSpecification,
|
|
29
30
|
} from '@finos/legend-graph';
|
|
30
31
|
import {
|
|
31
32
|
guaranteeType,
|
|
@@ -41,7 +42,9 @@ export const buildCalendarFunctionExpression = (
|
|
|
41
42
|
dateColumn: AbstractPropertyExpression | undefined,
|
|
42
43
|
calendarType: QUERY_BUILDER_CALENDAR_TYPE,
|
|
43
44
|
endDate: PrimitiveInstanceValue,
|
|
44
|
-
targetColumn:
|
|
45
|
+
targetColumn:
|
|
46
|
+
| AbstractPropertyExpression
|
|
47
|
+
| INTERNAL__UnknownValueSpecification,
|
|
45
48
|
): ValueSpecification => {
|
|
46
49
|
const expression = new SimpleFunctionExpression(
|
|
47
50
|
extractElementNameFromPath(calendarFunctionFullPath),
|
|
@@ -50,7 +53,7 @@ export const buildCalendarFunctionExpression = (
|
|
|
50
53
|
expression.parametersValues.push(dateColumn);
|
|
51
54
|
} else {
|
|
52
55
|
throw new UnsupportedOperationError(
|
|
53
|
-
`Please specify date column for calendar
|
|
56
|
+
`Please specify date column for calendar function for column`,
|
|
54
57
|
);
|
|
55
58
|
}
|
|
56
59
|
const calendarTypeParameter = new PrimitiveInstanceValue(
|
|
@@ -147,16 +150,6 @@ export const updateAggregateColumnState = (
|
|
|
147
150
|
)}() with third parameter of type StrictDate`,
|
|
148
151
|
);
|
|
149
152
|
|
|
150
|
-
guaranteeType(
|
|
151
|
-
expression.parametersValues[3],
|
|
152
|
-
AbstractPropertyExpression,
|
|
153
|
-
`Can't process ${extractElementNameFromPath(
|
|
154
|
-
calendarFunctionFullPath,
|
|
155
|
-
)}() expression: only support ${extractElementNameFromPath(
|
|
156
|
-
calendarFunctionFullPath,
|
|
157
|
-
)}() fourth parameter as property expression`,
|
|
158
|
-
);
|
|
159
|
-
|
|
160
153
|
calendarFunction.calendarType = calendarTypeParameter
|
|
161
154
|
.values[0] as QUERY_BUILDER_CALENDAR_TYPE;
|
|
162
155
|
calendarFunction.endDate = endDate;
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type ValueSpecification,
|
|
20
20
|
type SimpleFunctionExpression,
|
|
21
21
|
type AbstractPropertyExpression,
|
|
22
|
+
type INTERNAL__UnknownValueSpecification,
|
|
22
23
|
} from '@finos/legend-graph';
|
|
23
24
|
import type { QueryBuilderAggregateColumnState } from '../QueryBuilderAggregationState.js';
|
|
24
25
|
import {
|
|
@@ -64,7 +65,7 @@ export class QueryBuilderAggregateCalendarFunction_Annualized
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
buildCalendarFunctionExpression(
|
|
67
|
-
p: AbstractPropertyExpression,
|
|
68
|
+
p: AbstractPropertyExpression | INTERNAL__UnknownValueSpecification,
|
|
68
69
|
): ValueSpecification {
|
|
69
70
|
return buildCalendarFunctionExpression(
|
|
70
71
|
QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS.CALENDAR_ANNUALIZED,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type ValueSpecification,
|
|
20
20
|
type SimpleFunctionExpression,
|
|
21
21
|
type AbstractPropertyExpression,
|
|
22
|
+
type INTERNAL__UnknownValueSpecification,
|
|
22
23
|
} from '@finos/legend-graph';
|
|
23
24
|
import type { QueryBuilderAggregateColumnState } from '../QueryBuilderAggregationState.js';
|
|
24
25
|
import {
|
|
@@ -64,7 +65,7 @@ export class QueryBuilderAggregateCalendarFunction_Cme
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
buildCalendarFunctionExpression(
|
|
67
|
-
p: AbstractPropertyExpression,
|
|
68
|
+
p: AbstractPropertyExpression | INTERNAL__UnknownValueSpecification,
|
|
68
69
|
): ValueSpecification {
|
|
69
70
|
return buildCalendarFunctionExpression(
|
|
70
71
|
QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS.CALENDAR_CME,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type ValueSpecification,
|
|
20
20
|
type SimpleFunctionExpression,
|
|
21
21
|
type AbstractPropertyExpression,
|
|
22
|
+
type INTERNAL__UnknownValueSpecification,
|
|
22
23
|
} from '@finos/legend-graph';
|
|
23
24
|
import type { QueryBuilderAggregateColumnState } from '../QueryBuilderAggregationState.js';
|
|
24
25
|
import {
|
|
@@ -64,7 +65,7 @@ export class QueryBuilderAggregateCalendarFunction_Cw
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
buildCalendarFunctionExpression(
|
|
67
|
-
p: AbstractPropertyExpression,
|
|
68
|
+
p: AbstractPropertyExpression | INTERNAL__UnknownValueSpecification,
|
|
68
69
|
): ValueSpecification {
|
|
69
70
|
return buildCalendarFunctionExpression(
|
|
70
71
|
QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS.CALENDAR_CW,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type ValueSpecification,
|
|
20
20
|
type SimpleFunctionExpression,
|
|
21
21
|
type AbstractPropertyExpression,
|
|
22
|
+
type INTERNAL__UnknownValueSpecification,
|
|
22
23
|
} from '@finos/legend-graph';
|
|
23
24
|
import type { QueryBuilderAggregateColumnState } from '../QueryBuilderAggregationState.js';
|
|
24
25
|
import {
|
|
@@ -65,7 +66,7 @@ export class QueryBuilderAggregateCalendarFunction_Cw_Fm
|
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
buildCalendarFunctionExpression(
|
|
68
|
-
p: AbstractPropertyExpression,
|
|
69
|
+
p: AbstractPropertyExpression | INTERNAL__UnknownValueSpecification,
|
|
69
70
|
): ValueSpecification {
|
|
70
71
|
return buildCalendarFunctionExpression(
|
|
71
72
|
QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS.CALENDAR_CW_FM,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type ValueSpecification,
|
|
20
20
|
type SimpleFunctionExpression,
|
|
21
21
|
type AbstractPropertyExpression,
|
|
22
|
+
type INTERNAL__UnknownValueSpecification,
|
|
22
23
|
} from '@finos/legend-graph';
|
|
23
24
|
import type { QueryBuilderAggregateColumnState } from '../QueryBuilderAggregationState.js';
|
|
24
25
|
import {
|
|
@@ -64,7 +65,7 @@ export class QueryBuilderAggregateCalendarFunction_Cy_Minus2
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
buildCalendarFunctionExpression(
|
|
67
|
-
p: AbstractPropertyExpression,
|
|
68
|
+
p: AbstractPropertyExpression | INTERNAL__UnknownValueSpecification,
|
|
68
69
|
): ValueSpecification {
|
|
69
70
|
return buildCalendarFunctionExpression(
|
|
70
71
|
QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS.CALENDAR_CY_MINUS2,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type ValueSpecification,
|
|
20
20
|
type SimpleFunctionExpression,
|
|
21
21
|
type AbstractPropertyExpression,
|
|
22
|
+
type INTERNAL__UnknownValueSpecification,
|
|
22
23
|
} from '@finos/legend-graph';
|
|
23
24
|
import type { QueryBuilderAggregateColumnState } from '../QueryBuilderAggregationState.js';
|
|
24
25
|
import {
|
|
@@ -64,7 +65,7 @@ export class QueryBuilderAggregateCalendarFunction_Cy_Minus3
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
buildCalendarFunctionExpression(
|
|
67
|
-
p: AbstractPropertyExpression,
|
|
68
|
+
p: AbstractPropertyExpression | INTERNAL__UnknownValueSpecification,
|
|
68
69
|
): ValueSpecification {
|
|
69
70
|
return buildCalendarFunctionExpression(
|
|
70
71
|
QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS.CALENDAR_CY_MINUS3,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type ValueSpecification,
|
|
20
20
|
type SimpleFunctionExpression,
|
|
21
21
|
type AbstractPropertyExpression,
|
|
22
|
+
type INTERNAL__UnknownValueSpecification,
|
|
22
23
|
} from '@finos/legend-graph';
|
|
23
24
|
import type { QueryBuilderAggregateColumnState } from '../QueryBuilderAggregationState.js';
|
|
24
25
|
import {
|
|
@@ -64,7 +65,7 @@ export class QueryBuilderAggregateCalendarFunction_Mtd
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
buildCalendarFunctionExpression(
|
|
67
|
-
p: AbstractPropertyExpression,
|
|
68
|
+
p: AbstractPropertyExpression | INTERNAL__UnknownValueSpecification,
|
|
68
69
|
): ValueSpecification {
|
|
69
70
|
return buildCalendarFunctionExpression(
|
|
70
71
|
QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS.CALENDAR_MTD,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type ValueSpecification,
|
|
20
20
|
type SimpleFunctionExpression,
|
|
21
21
|
type AbstractPropertyExpression,
|
|
22
|
+
type INTERNAL__UnknownValueSpecification,
|
|
22
23
|
} from '@finos/legend-graph';
|
|
23
24
|
import type { QueryBuilderAggregateColumnState } from '../QueryBuilderAggregationState.js';
|
|
24
25
|
import {
|
|
@@ -64,7 +65,7 @@ export class QueryBuilderAggregateCalendarFunction_P12Wa
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
buildCalendarFunctionExpression(
|
|
67
|
-
p: AbstractPropertyExpression,
|
|
68
|
+
p: AbstractPropertyExpression | INTERNAL__UnknownValueSpecification,
|
|
68
69
|
): ValueSpecification {
|
|
69
70
|
return buildCalendarFunctionExpression(
|
|
70
71
|
QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS.CALENDAR_P12WA,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type ValueSpecification,
|
|
20
20
|
type SimpleFunctionExpression,
|
|
21
21
|
type AbstractPropertyExpression,
|
|
22
|
+
type INTERNAL__UnknownValueSpecification,
|
|
22
23
|
} from '@finos/legend-graph';
|
|
23
24
|
import type { QueryBuilderAggregateColumnState } from '../QueryBuilderAggregationState.js';
|
|
24
25
|
import {
|
|
@@ -64,7 +65,7 @@ export class QueryBuilderAggregateCalendarFunction_P12Wtd
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
buildCalendarFunctionExpression(
|
|
67
|
-
p: AbstractPropertyExpression,
|
|
68
|
+
p: AbstractPropertyExpression | INTERNAL__UnknownValueSpecification,
|
|
68
69
|
): ValueSpecification {
|
|
69
70
|
return buildCalendarFunctionExpression(
|
|
70
71
|
QUERY_BUILDER_SUPPORTED_CALENDAR_AGGREGATION_FUNCTIONS.CALENDAR_P12WTD,
|