@finos/legend-application-repl 0.0.21 → 0.0.23
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/{stores/CompletionResult.d.ts → __lib__/LegendREPLEvent.d.ts} +4 -6
- package/lib/__lib__/LegendREPLEvent.d.ts.map +1 -0
- package/lib/__lib__/LegendREPLEvent.js +21 -0
- package/lib/__lib__/LegendREPLEvent.js.map +1 -0
- package/lib/{stores/dataCube/DataCubePanelState.js → __lib__/LegendREPLSetting.d.ts} +3 -6
- package/lib/__lib__/LegendREPLSetting.d.ts.map +1 -0
- package/lib/{components/grid/TDSLambdaBuilder.d.ts → __lib__/LegendREPLSetting.js} +5 -4
- package/lib/__lib__/LegendREPLSetting.js.map +1 -0
- package/lib/application/{LegendREPLGridClient.d.ts → LegendREPL.d.ts} +10 -10
- package/lib/application/LegendREPL.d.ts.map +1 -0
- package/lib/application/{LegendREPLGridClient.js → LegendREPL.js} +10 -15
- package/lib/application/LegendREPL.js.map +1 -0
- package/lib/application/{LegendREPLGridClientApplicationConfig.d.ts → LegendREPLApplicationConfig.d.ts} +4 -4
- package/lib/application/LegendREPLApplicationConfig.d.ts.map +1 -0
- package/lib/application/{LegendREPLGridClientApplicationConfig.js → LegendREPLApplicationConfig.js} +2 -2
- package/lib/application/LegendREPLApplicationConfig.js.map +1 -0
- package/lib/application/{LegendREPLGridClientPluginManager.d.ts → LegendREPLPluginManager.d.ts} +4 -4
- package/lib/application/LegendREPLPluginManager.d.ts.map +1 -0
- package/lib/application/{LegendREPLGridClientPluginManager.js → LegendREPLPluginManager.js} +3 -3
- package/lib/application/LegendREPLPluginManager.js.map +1 -0
- package/lib/components/{Core_LegendREPLGridClientApplicationPlugin.d.ts → Core_LegendREPLApplicationPlugin.d.ts} +3 -3
- package/lib/components/Core_LegendREPLApplicationPlugin.d.ts.map +1 -0
- package/lib/components/{Core_LegendREPLGridClientApplicationPlugin.js → Core_LegendREPLApplicationPlugin.js} +12 -7
- package/lib/components/Core_LegendREPLApplicationPlugin.js.map +1 -0
- package/lib/components/{AgGrid.d.ts → LegendREPLApplication.d.ts} +8 -6
- package/lib/components/LegendREPLApplication.d.ts.map +1 -0
- package/lib/components/LegendREPLApplication.js +32 -0
- package/lib/components/LegendREPLApplication.js.map +1 -0
- package/lib/components/{LegendREPLGridClientFrameworkProvider.d.ts → LegendREPLFrameworkProvider.d.ts} +4 -4
- package/lib/components/LegendREPLFrameworkProvider.d.ts.map +1 -0
- package/lib/components/{LegendREPLGridClientFrameworkProvider.js → LegendREPLFrameworkProvider.js} +9 -9
- package/lib/components/LegendREPLFrameworkProvider.js.map +1 -0
- package/lib/components/{REPLGridClientStoreProvider.d.ts → REPLStoreProvider.d.ts} +5 -5
- package/lib/components/REPLStoreProvider.d.ts.map +1 -0
- package/lib/components/{REPLGridClientStoreProvider.js → REPLStoreProvider.js} +9 -9
- package/lib/components/REPLStoreProvider.js.map +1 -0
- package/lib/components/dataCube/DataCube.d.ts +19 -0
- package/lib/components/dataCube/DataCube.d.ts.map +1 -0
- package/lib/components/dataCube/DataCube.js +33 -0
- package/lib/components/dataCube/DataCube.js.map +1 -0
- package/lib/components/{REPLGridClient.d.ts → dataCube/editor/DataCubeEditor.d.ts} +5 -9
- package/lib/components/dataCube/editor/DataCubeEditor.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditor.js +54 -0
- package/lib/components/dataCube/editor/DataCubeEditor.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.d.ts +19 -0
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.d.ts.map +1 -0
- package/lib/components/dataCube/{DataCubeQueryTextEditor.js → editor/DataCubeEditorCodePanel.js} +20 -20
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.js.map +1 -0
- package/lib/components/dataCube/{DataCubeGridEditor.d.ts → editor/DataCubeEditorSortPanel.d.ts} +4 -4
- package/lib/components/dataCube/editor/DataCubeEditorSortPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorSortPanel.js +61 -0
- package/lib/components/dataCube/editor/DataCubeEditorSortPanel.js.map +1 -0
- package/lib/components/dataCube/{DataCubeQueryTextEditor.d.ts → grid/DataCubeGrid.d.ts} +4 -4
- package/lib/components/dataCube/grid/DataCubeGrid.d.ts.map +1 -0
- package/lib/components/dataCube/grid/DataCubeGrid.js +59 -0
- package/lib/components/dataCube/grid/DataCubeGrid.js.map +1 -0
- package/lib/grid.css +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -8
- package/lib/index.js.map +1 -1
- package/lib/package.json +3 -3
- package/lib/repl.css +1 -1
- package/lib/server/REPLServerClient.d.ts +11 -13
- package/lib/server/REPLServerClient.d.ts.map +1 -1
- package/lib/server/REPLServerClient.js +27 -15
- package/lib/server/REPLServerClient.js.map +1 -1
- package/lib/server/models/DataCubeEngineModels.d.ts +50 -0
- package/lib/server/models/DataCubeEngineModels.d.ts.map +1 -0
- package/lib/server/models/DataCubeEngineModels.js +39 -0
- package/lib/server/models/DataCubeEngineModels.js.map +1 -0
- package/lib/server/models/DataCubeQuery.d.ts +41 -0
- package/lib/server/models/DataCubeQuery.d.ts.map +1 -0
- package/lib/server/models/DataCubeQuery.js +78 -0
- package/lib/server/models/DataCubeQuery.js.map +1 -0
- package/lib/stores/{LegendREPLGridClientApplicationPlugin.d.ts → LegendREPLApplicationPlugin.d.ts} +4 -4
- package/lib/stores/LegendREPLApplicationPlugin.d.ts.map +1 -0
- package/lib/stores/{LegendREPLGridClientApplicationPlugin.js → LegendREPLApplicationPlugin.js} +2 -2
- package/lib/stores/LegendREPLApplicationPlugin.js.map +1 -0
- package/lib/stores/LegendREPLBaseStore.d.ts +25 -0
- package/lib/stores/LegendREPLBaseStore.d.ts.map +1 -0
- package/lib/stores/{LegendREPLGridClientBaseStore.js → LegendREPLBaseStore.js} +2 -2
- package/lib/stores/LegendREPLBaseStore.js.map +1 -0
- package/lib/stores/dataCube/DataCubeMetaModelConst.d.ts +49 -0
- package/lib/stores/dataCube/DataCubeMetaModelConst.d.ts.map +1 -0
- package/lib/stores/dataCube/DataCubeMetaModelConst.js +57 -0
- package/lib/stores/dataCube/DataCubeMetaModelConst.js.map +1 -0
- package/lib/stores/dataCube/DataCubeState.d.ts +18 -23
- package/lib/stores/dataCube/DataCubeState.d.ts.map +1 -1
- package/lib/stores/dataCube/DataCubeState.js +31 -181
- package/lib/stores/dataCube/DataCubeState.js.map +1 -1
- package/lib/stores/{REPLGridClientStore.d.ts → dataCube/DataCubeStore.d.ts} +7 -7
- package/lib/stores/dataCube/DataCubeStore.d.ts.map +1 -0
- package/lib/stores/{REPLGridClientStore.js → dataCube/DataCubeStore.js} +5 -4
- package/lib/stores/dataCube/DataCubeStore.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeEngine.d.ts +29 -0
- package/lib/stores/dataCube/core/DataCubeEngine.d.ts.map +1 -0
- package/lib/stores/dataCube/core/DataCubeEngine.js +47 -0
- package/lib/stores/dataCube/core/DataCubeEngine.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeQueryAnalyzer.d.ts +37 -0
- package/lib/stores/dataCube/core/DataCubeQueryAnalyzer.d.ts.map +1 -0
- package/lib/stores/dataCube/core/DataCubeQueryAnalyzer.js +269 -0
- package/lib/stores/dataCube/core/DataCubeQueryAnalyzer.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.d.ts +19 -0
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.d.ts.map +1 -0
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.js +98 -0
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.d.ts +73 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.d.ts.map +1 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.js +56 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.js.map +1 -0
- package/lib/stores/dataCube/{DataCubePanelState.d.ts → core/DataCubeQuerySnapshotManager.d.ts} +11 -6
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.d.ts.map +1 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.js +46 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.d.ts +27 -0
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.d.ts.map +1 -0
- package/lib/{components/grid/REPLGridServerResult.js → stores/dataCube/core/DataCubeQuerySnapshotSubscriber.js} +18 -10
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.js.map +1 -0
- package/lib/stores/dataCube/{DataCubeQueryEditorState.d.ts → editor/DataCubeEditorCodeState.d.ts} +12 -2
- package/lib/stores/dataCube/editor/DataCubeEditorCodeState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorCodeState.js +87 -0
- package/lib/stores/dataCube/editor/DataCubeEditorCodeState.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorQuerySnapshotBuilder.d.ts +28 -0
- package/lib/stores/dataCube/editor/DataCubeEditorQuerySnapshotBuilder.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorQuerySnapshotBuilder.js +17 -0
- package/lib/stores/dataCube/editor/DataCubeEditorQuerySnapshotBuilder.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorSortState.d.ts +46 -0
- package/lib/stores/dataCube/editor/DataCubeEditorSortState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorSortState.js +133 -0
- package/lib/stores/dataCube/editor/DataCubeEditorSortState.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts +44 -0
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorState.js +77 -0
- package/lib/stores/dataCube/editor/DataCubeEditorState.js.map +1 -0
- package/lib/{components/grid/ServerSideDataSource.d.ts → stores/dataCube/grid/DataCubeGridClientEngine.d.ts} +17 -14
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js +96 -0
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.d.ts +19 -0
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.d.ts.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.js +224 -0
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.js.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridState.d.ts +33 -0
- package/lib/stores/dataCube/grid/DataCubeGridState.d.ts.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridState.js +50 -0
- package/lib/stores/dataCube/grid/DataCubeGridState.js.map +1 -0
- package/package.json +9 -9
- package/src/{Const.ts → __lib__/LegendREPLEvent.ts} +1 -16
- package/{lib/components/grid/REPLGridServerResult.d.ts → src/__lib__/LegendREPLSetting.ts} +3 -6
- package/src/application/LegendREPL.tsx +64 -0
- package/src/application/{LegendREPLGridClientApplicationConfig.ts → LegendREPLApplicationConfig.ts} +3 -3
- package/src/application/{LegendREPLGridClientPluginManager.ts → LegendREPLPluginManager.ts} +5 -5
- package/src/components/{Core_LegendREPLGridClientApplicationPlugin.tsx → Core_LegendREPLApplicationPlugin.tsx} +11 -6
- package/src/components/{LegendREPLGridClientApplication.tsx → LegendREPLApplication.tsx} +11 -28
- package/src/components/LegendREPLFrameworkProvider.tsx +57 -0
- package/src/components/{REPLGridClientStoreProvider.tsx → REPLStoreProvider.tsx} +17 -21
- package/src/components/dataCube/DataCube.tsx +63 -0
- package/src/components/dataCube/editor/DataCubeEditor.tsx +127 -0
- package/src/components/dataCube/{DataCubeQueryTextEditor.tsx → editor/DataCubeEditorCodePanel.tsx} +69 -76
- package/src/components/dataCube/editor/DataCubeEditorSortPanel.tsx +274 -0
- package/src/components/dataCube/grid/DataCubeGrid.tsx +77 -0
- package/src/index.tsx +12 -8
- package/src/server/REPLServerClient.ts +50 -78
- package/src/server/models/DataCubeEngineModels.ts +84 -0
- package/src/server/models/DataCubeQuery.ts +130 -0
- package/src/stores/{LegendREPLGridClientApplicationPlugin.ts → LegendREPLApplicationPlugin.ts} +4 -4
- package/src/stores/{LegendREPLGridClientBaseStore.ts → LegendREPLBaseStore.ts} +9 -9
- package/src/stores/dataCube/DataCubeMetaModelConst.ts +61 -0
- package/src/stores/dataCube/DataCubeState.ts +39 -303
- package/src/stores/{REPLGridClientStore.ts → dataCube/DataCubeStore.ts} +8 -6
- package/src/stores/dataCube/core/DataCubeEngine.ts +79 -0
- package/src/stores/dataCube/core/DataCubeQueryAnalyzer.ts +424 -0
- package/src/stores/dataCube/core/DataCubeQueryBuilder.ts +151 -0
- package/src/stores/dataCube/core/DataCubeQuerySnapshot.ts +201 -0
- package/src/stores/dataCube/core/DataCubeQuerySnapshotManager.ts +67 -0
- package/src/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.ts +43 -0
- package/src/stores/dataCube/editor/DataCubeEditorCodeState.ts +166 -0
- package/src/{components/grid/REPLGridServerResult.ts → stores/dataCube/editor/DataCubeEditorQuerySnapshotBuilder.ts} +14 -11
- package/src/stores/dataCube/editor/DataCubeEditorSortState.ts +198 -0
- package/src/stores/dataCube/editor/DataCubeEditorState.ts +94 -0
- package/src/stores/dataCube/grid/DataCubeGridClientEngine.ts +152 -0
- package/src/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.ts +245 -0
- package/src/stores/dataCube/grid/DataCubeGridState.ts +62 -0
- package/tsconfig.json +33 -29
- package/lib/Const.d.ts +0 -32
- package/lib/Const.d.ts.map +0 -1
- package/lib/Const.js +0 -35
- package/lib/Const.js.map +0 -1
- package/lib/application/LegendREPLGridClient.d.ts.map +0 -1
- package/lib/application/LegendREPLGridClient.js.map +0 -1
- package/lib/application/LegendREPLGridClientApplicationConfig.d.ts.map +0 -1
- package/lib/application/LegendREPLGridClientApplicationConfig.js.map +0 -1
- package/lib/application/LegendREPLGridClientPluginManager.d.ts.map +0 -1
- package/lib/application/LegendREPLGridClientPluginManager.js.map +0 -1
- package/lib/components/AgGrid.d.ts.map +0 -1
- package/lib/components/AgGrid.js +0 -41
- package/lib/components/AgGrid.js.map +0 -1
- package/lib/components/Core_LegendREPLGridClientApplicationPlugin.d.ts.map +0 -1
- package/lib/components/Core_LegendREPLGridClientApplicationPlugin.js.map +0 -1
- package/lib/components/LegendREPLGridClientApplication.d.ts +0 -31
- package/lib/components/LegendREPLGridClientApplication.d.ts.map +0 -1
- package/lib/components/LegendREPLGridClientApplication.js +0 -39
- package/lib/components/LegendREPLGridClientApplication.js.map +0 -1
- package/lib/components/LegendREPLGridClientFrameworkProvider.d.ts.map +0 -1
- package/lib/components/LegendREPLGridClientFrameworkProvider.js.map +0 -1
- package/lib/components/REPLGridClient.d.ts.map +0 -1
- package/lib/components/REPLGridClient.js +0 -143
- package/lib/components/REPLGridClient.js.map +0 -1
- package/lib/components/REPLGridClientStoreProvider.d.ts.map +0 -1
- package/lib/components/REPLGridClientStoreProvider.js.map +0 -1
- package/lib/components/dataCube/DataCubeGridEditor.d.ts.map +0 -1
- package/lib/components/dataCube/DataCubeGridEditor.js +0 -37
- package/lib/components/dataCube/DataCubeGridEditor.js.map +0 -1
- package/lib/components/dataCube/DataCubeQueryTextEditor.d.ts.map +0 -1
- package/lib/components/dataCube/DataCubeQueryTextEditor.js.map +0 -1
- package/lib/components/grid/GridUtils.d.ts +0 -31
- package/lib/components/grid/GridUtils.d.ts.map +0 -1
- package/lib/components/grid/GridUtils.js +0 -174
- package/lib/components/grid/GridUtils.js.map +0 -1
- package/lib/components/grid/REPLGridServerResult.d.ts.map +0 -1
- package/lib/components/grid/REPLGridServerResult.js.map +0 -1
- package/lib/components/grid/ServerSideDataSource.d.ts.map +0 -1
- package/lib/components/grid/ServerSideDataSource.js +0 -109
- package/lib/components/grid/ServerSideDataSource.js.map +0 -1
- package/lib/components/grid/TDSLambdaBuilder.d.ts.map +0 -1
- package/lib/components/grid/TDSLambdaBuilder.js +0 -314
- package/lib/components/grid/TDSLambdaBuilder.js.map +0 -1
- package/lib/components/grid/TDSQuery.d.ts +0 -25
- package/lib/components/grid/TDSQuery.d.ts.map +0 -1
- package/lib/components/grid/TDSQuery.js +0 -32
- package/lib/components/grid/TDSQuery.js.map +0 -1
- package/lib/components/grid/TDSRequest.d.ts +0 -103
- package/lib/components/grid/TDSRequest.d.ts.map +0 -1
- package/lib/components/grid/TDSRequest.js +0 -172
- package/lib/components/grid/TDSRequest.js.map +0 -1
- package/lib/stores/CompletionResult.d.ts.map +0 -1
- package/lib/stores/CompletionResult.js +0 -26
- package/lib/stores/CompletionResult.js.map +0 -1
- package/lib/stores/LegendREPLGridClientApplicationPlugin.d.ts.map +0 -1
- package/lib/stores/LegendREPLGridClientApplicationPlugin.js.map +0 -1
- package/lib/stores/LegendREPLGridClientBaseStore.d.ts +0 -25
- package/lib/stores/LegendREPLGridClientBaseStore.d.ts.map +0 -1
- package/lib/stores/LegendREPLGridClientBaseStore.js.map +0 -1
- package/lib/stores/REPLGridClientStore.d.ts.map +0 -1
- package/lib/stores/REPLGridClientStore.js.map +0 -1
- package/lib/stores/dataCube/DataCubeConfigState.d.ts +0 -32
- package/lib/stores/dataCube/DataCubeConfigState.d.ts.map +0 -1
- package/lib/stores/dataCube/DataCubeConfigState.js +0 -62
- package/lib/stores/dataCube/DataCubeConfigState.js.map +0 -1
- package/lib/stores/dataCube/DataCubeGridState.d.ts +0 -39
- package/lib/stores/dataCube/DataCubeGridState.d.ts.map +0 -1
- package/lib/stores/dataCube/DataCubeGridState.js +0 -108
- package/lib/stores/dataCube/DataCubeGridState.js.map +0 -1
- package/lib/stores/dataCube/DataCubePanelState.d.ts.map +0 -1
- package/lib/stores/dataCube/DataCubePanelState.js.map +0 -1
- package/lib/stores/dataCube/DataCubePropertiesPanelState.d.ts +0 -34
- package/lib/stores/dataCube/DataCubePropertiesPanelState.d.ts.map +0 -1
- package/lib/stores/dataCube/DataCubePropertiesPanelState.js +0 -57
- package/lib/stores/dataCube/DataCubePropertiesPanelState.js.map +0 -1
- package/lib/stores/dataCube/DataCubeQueryEditorState.d.ts.map +0 -1
- package/lib/stores/dataCube/DataCubeQueryEditorState.js +0 -49
- package/lib/stores/dataCube/DataCubeQueryEditorState.js.map +0 -1
- package/lib/stores/dataCube/DataCubeQueryTextEditorState.d.ts +0 -25
- package/lib/stores/dataCube/DataCubeQueryTextEditorState.d.ts.map +0 -1
- package/lib/stores/dataCube/DataCubeQueryTextEditorState.js +0 -35
- package/lib/stores/dataCube/DataCubeQueryTextEditorState.js.map +0 -1
- package/lib/stores/dataCube/HPivotAndSortPanelState.d.ts +0 -40
- package/lib/stores/dataCube/HPivotAndSortPanelState.d.ts.map +0 -1
- package/lib/stores/dataCube/HPivotAndSortPanelState.js +0 -130
- package/lib/stores/dataCube/HPivotAndSortPanelState.js.map +0 -1
- package/src/application/LegendREPLGridClient.tsx +0 -72
- package/src/components/AgGrid.tsx +0 -59
- package/src/components/LegendREPLGridClientFrameworkProvider.tsx +0 -63
- package/src/components/REPLGridClient.tsx +0 -560
- package/src/components/dataCube/DataCubeGridEditor.tsx +0 -69
- package/src/components/grid/GridUtils.ts +0 -220
- package/src/components/grid/ServerSideDataSource.ts +0 -197
- package/src/components/grid/TDSLambdaBuilder.ts +0 -456
- package/src/components/grid/TDSQuery.ts +0 -37
- package/src/components/grid/TDSRequest.ts +0 -231
- package/src/stores/CompletionResult.ts +0 -30
- package/src/stores/dataCube/DataCubeConfigState.ts +0 -79
- package/src/stores/dataCube/DataCubeGridState.ts +0 -143
- package/src/stores/dataCube/DataCubePanelState.ts +0 -28
- package/src/stores/dataCube/DataCubePropertiesPanelState.ts +0 -65
- package/src/stores/dataCube/DataCubeQueryEditorState.ts +0 -66
- package/src/stores/dataCube/DataCubeQueryTextEditorState.ts +0 -41
- package/src/stores/dataCube/HPivotAndSortPanelState.ts +0 -170
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { V1_Lambda, V1_ValueSpecification } from '@finos/legend-graph';
|
|
18
|
+
import type { DataCubeConfiguration } from '../../../server/models/DataCubeQuery.js';
|
|
19
|
+
import { uuid, type PlainObject, type Writable } from '@finos/legend-shared';
|
|
20
|
+
import type {
|
|
21
|
+
DATA_CUBE_AGGREGATE_FUNCTION,
|
|
22
|
+
DATA_CUBE_COLUMN_SORT_DIRECTION,
|
|
23
|
+
} from '../DataCubeMetaModelConst.js';
|
|
24
|
+
|
|
25
|
+
// export enum FILTER_OPERATION {
|
|
26
|
+
// EQUALS = 'equal',
|
|
27
|
+
// NOT_EQUAL = 'notEqual',
|
|
28
|
+
// GREATER_THAN = 'greaterThan',
|
|
29
|
+
// GREATER_THAN_OR_EQUAL = 'greaterThanOrEqual',
|
|
30
|
+
// LESS_THAN = 'lessThan',
|
|
31
|
+
// LESS_THAN_OR_EQUAL = 'lessThanOrEqual',
|
|
32
|
+
// BLANK = 'isEmpty',
|
|
33
|
+
// NOT_BLANK = 'isNotEmpty',
|
|
34
|
+
// CONTAINS = 'contains',
|
|
35
|
+
// NOT_CONTAINS = 'notContains',
|
|
36
|
+
// STARTS_WITH = 'startsWith',
|
|
37
|
+
// ENDS_WITH = 'endsWith',
|
|
38
|
+
// }
|
|
39
|
+
|
|
40
|
+
// export enum FILTER_GROUP {
|
|
41
|
+
// AND = 'and',
|
|
42
|
+
// OR = 'or',
|
|
43
|
+
// }
|
|
44
|
+
|
|
45
|
+
// export enum FILTER_TYPE {
|
|
46
|
+
// TEXT = 'text',
|
|
47
|
+
// NUMBER = 'number',
|
|
48
|
+
// }
|
|
49
|
+
|
|
50
|
+
// export class TDSFilterCondition {
|
|
51
|
+
// operation!: TDS_FILTER_OPERATION;
|
|
52
|
+
// value!: unknown;
|
|
53
|
+
|
|
54
|
+
// constructor(operation: TDS_FILTER_OPERATION, value: unknown) {
|
|
55
|
+
// this.operation = operation;
|
|
56
|
+
// this.value = value;
|
|
57
|
+
// }
|
|
58
|
+
|
|
59
|
+
// static readonly serialization = new SerializationFactory(
|
|
60
|
+
// createModelSchema(TDSFilterCondition, {
|
|
61
|
+
// operation: primitive(),
|
|
62
|
+
// value: primitive(),
|
|
63
|
+
// }),
|
|
64
|
+
// );
|
|
65
|
+
// }
|
|
66
|
+
|
|
67
|
+
// export class TDSFilter {
|
|
68
|
+
// column!: string;
|
|
69
|
+
// columnType!: PRIMITIVE_TYPE;
|
|
70
|
+
// conditions!: TDSFilterCondition[];
|
|
71
|
+
// groupOperation!: TDS_FILTER_GROUP;
|
|
72
|
+
|
|
73
|
+
// constructor(
|
|
74
|
+
// column: string,
|
|
75
|
+
// columnType: PRIMITIVE_TYPE,
|
|
76
|
+
// conditions: TDSFilterCondition[],
|
|
77
|
+
// groupOperation: TDS_FILTER_GROUP,
|
|
78
|
+
// ) {
|
|
79
|
+
// this.column = column;
|
|
80
|
+
// this.columnType = columnType;
|
|
81
|
+
// this.conditions = conditions;
|
|
82
|
+
// this.groupOperation = groupOperation;
|
|
83
|
+
// }
|
|
84
|
+
|
|
85
|
+
// static readonly serialization = new SerializationFactory(
|
|
86
|
+
// createModelSchema(TDSFilter, {
|
|
87
|
+
// column: primitive(),
|
|
88
|
+
// columnType: primitive(),
|
|
89
|
+
// conditions: list(
|
|
90
|
+
// usingModelSchema(TDSFilterCondition.serialization.schema),
|
|
91
|
+
// ),
|
|
92
|
+
// groupOperation: primitive(),
|
|
93
|
+
// }),
|
|
94
|
+
// );
|
|
95
|
+
// }
|
|
96
|
+
|
|
97
|
+
export type DataCubeQueryFilter = {
|
|
98
|
+
// TODO: @akphi
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export enum DataCubeQuerySnapshotColumnOrigin {
|
|
102
|
+
SOURCE,
|
|
103
|
+
LEAF_EXTENDED,
|
|
104
|
+
RENAME,
|
|
105
|
+
GROUP_BY,
|
|
106
|
+
SELECT,
|
|
107
|
+
PIVOT,
|
|
108
|
+
GROUP_EXTENDED,
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type DataCubeQuerySnapshotColumn = {
|
|
112
|
+
name: string;
|
|
113
|
+
type: string;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export type DataCubeQuerySnapshotColumnWithOrigin =
|
|
117
|
+
DataCubeQuerySnapshotColumn & {
|
|
118
|
+
origin: DataCubeQuerySnapshotColumnOrigin;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export type DataCubeQuerySnapshotExtendedColumn =
|
|
122
|
+
DataCubeQuerySnapshotColumn & {
|
|
123
|
+
lambda: PlainObject<V1_Lambda>;
|
|
124
|
+
code: string;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type DataCubeQuerySnapshotRenamedColumn = DataCubeQuerySnapshotColumn & {
|
|
128
|
+
oldName: string;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export type DataCubeQuerySnapshotSortColumn = DataCubeQuerySnapshotColumn & {
|
|
132
|
+
direction: DATA_CUBE_COLUMN_SORT_DIRECTION;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export type DataCubeQuerySnapshotAggregateColumn =
|
|
136
|
+
DataCubeQuerySnapshotColumn & {
|
|
137
|
+
function: DATA_CUBE_AGGREGATE_FUNCTION;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export type DataCubeQuerySnapshot = {
|
|
141
|
+
readonly uuid: string;
|
|
142
|
+
name: string;
|
|
143
|
+
runtime: string;
|
|
144
|
+
sourceQuery: PlainObject<V1_ValueSpecification>;
|
|
145
|
+
configuration: DataCubeConfiguration;
|
|
146
|
+
|
|
147
|
+
originalColumns: DataCubeQuerySnapshotColumn[];
|
|
148
|
+
leafExtendedColumns: DataCubeQuerySnapshotExtendedColumn[];
|
|
149
|
+
filter?: DataCubeQueryFilter | undefined;
|
|
150
|
+
renamedColumns: DataCubeQuerySnapshotRenamedColumn[];
|
|
151
|
+
groupByColumns: DataCubeQuerySnapshotColumn[];
|
|
152
|
+
groupByAggColumns: DataCubeQuerySnapshotAggregateColumn[];
|
|
153
|
+
selectedColumns: DataCubeQuerySnapshotColumn[];
|
|
154
|
+
pivotColumns: DataCubeQuerySnapshotColumn[];
|
|
155
|
+
pivotAggColumns: DataCubeQuerySnapshotAggregateColumn[];
|
|
156
|
+
castColumns: DataCubeQuerySnapshotColumn[];
|
|
157
|
+
groupExtendedColumns: DataCubeQuerySnapshotExtendedColumn[];
|
|
158
|
+
sortColumns: DataCubeQuerySnapshotSortColumn[];
|
|
159
|
+
limit: number | undefined;
|
|
160
|
+
columns: DataCubeQuerySnapshotColumnWithOrigin[];
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// ------------------------------------- UTILITIES -------------------------------------
|
|
164
|
+
|
|
165
|
+
export function createSnapshot(
|
|
166
|
+
name: string,
|
|
167
|
+
runtime: string,
|
|
168
|
+
sourceQuery: PlainObject<V1_ValueSpecification>,
|
|
169
|
+
configuration: DataCubeConfiguration,
|
|
170
|
+
): DataCubeQuerySnapshot {
|
|
171
|
+
return {
|
|
172
|
+
uuid: uuid(),
|
|
173
|
+
name,
|
|
174
|
+
runtime,
|
|
175
|
+
sourceQuery,
|
|
176
|
+
configuration,
|
|
177
|
+
|
|
178
|
+
originalColumns: [],
|
|
179
|
+
leafExtendedColumns: [],
|
|
180
|
+
filter: undefined,
|
|
181
|
+
renamedColumns: [],
|
|
182
|
+
groupByColumns: [],
|
|
183
|
+
groupByAggColumns: [],
|
|
184
|
+
selectedColumns: [],
|
|
185
|
+
pivotColumns: [],
|
|
186
|
+
pivotAggColumns: [],
|
|
187
|
+
castColumns: [],
|
|
188
|
+
groupExtendedColumns: [],
|
|
189
|
+
sortColumns: [],
|
|
190
|
+
limit: undefined,
|
|
191
|
+
columns: [],
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export function cloneSnapshot(
|
|
196
|
+
snapshot: DataCubeQuerySnapshot,
|
|
197
|
+
): DataCubeQuerySnapshot {
|
|
198
|
+
const clone = JSON.parse(JSON.stringify(snapshot)) as DataCubeQuerySnapshot;
|
|
199
|
+
(clone as Writable<DataCubeQuerySnapshot>).uuid = uuid();
|
|
200
|
+
return clone;
|
|
201
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { APPLICATION_EVENT } from '@finos/legend-application';
|
|
18
|
+
import type { DataCubeState } from '../DataCubeState.js';
|
|
19
|
+
import type { DataCubeQuerySnapshot } from './DataCubeQuerySnapshot.js';
|
|
20
|
+
import type { DataCubeQuerySnapshotSubscriber } from './DataCubeQuerySnapshotSubscriber.js';
|
|
21
|
+
import {
|
|
22
|
+
LogEvent,
|
|
23
|
+
assertErrorThrown,
|
|
24
|
+
guaranteeNonNullable,
|
|
25
|
+
} from '@finos/legend-shared';
|
|
26
|
+
|
|
27
|
+
// TODO: use this when we implement undo/redo
|
|
28
|
+
// const DATA_CUBE_MAX_SNAPSHOT_COUNT = 100;
|
|
29
|
+
|
|
30
|
+
export class DataCubeQuerySnapshotManager {
|
|
31
|
+
private readonly dataCubeState: DataCubeState;
|
|
32
|
+
private readonly subscribers: DataCubeQuerySnapshotSubscriber[] = [];
|
|
33
|
+
private readonly snapshots: DataCubeQuerySnapshot[] = [];
|
|
34
|
+
|
|
35
|
+
constructor(dataCubeState: DataCubeState) {
|
|
36
|
+
this.dataCubeState = dataCubeState;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get currentSnapshot(): DataCubeQuerySnapshot {
|
|
40
|
+
return guaranteeNonNullable(this.snapshots[this.snapshots.length - 1]);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
registerSubscriber(subscriber: DataCubeQuerySnapshotSubscriber): void {
|
|
44
|
+
this.subscribers.push(subscriber);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
broadcastSnapshot(snapshot: DataCubeQuerySnapshot): void {
|
|
48
|
+
this.snapshots.push(snapshot);
|
|
49
|
+
this.subscribers.forEach((subscriber) => {
|
|
50
|
+
const currentSnapshot = subscriber.getLatestSnapshot();
|
|
51
|
+
if (currentSnapshot?.uuid !== snapshot.uuid) {
|
|
52
|
+
subscriber.receiveSnapshot(snapshot).catch((error: unknown) => {
|
|
53
|
+
assertErrorThrown(error);
|
|
54
|
+
this.dataCubeState.applicationStore.logService.error(
|
|
55
|
+
LogEvent.create(
|
|
56
|
+
APPLICATION_EVENT.ILLEGAL_APPLICATION_STATE_OCCURRED,
|
|
57
|
+
),
|
|
58
|
+
`Error ocurred when subscribers receive and apply new snapshot should be handled gracefully`,
|
|
59
|
+
error,
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// TODO: replace snapshot (for minor modifications such as adjusting the cast columns)
|
|
67
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { DataCubeQuerySnapshot } from './DataCubeQuerySnapshot.js';
|
|
18
|
+
import type { DataCubeQuerySnapshotManager } from './DataCubeQuerySnapshotManager.js';
|
|
19
|
+
|
|
20
|
+
export abstract class DataCubeQuerySnapshotSubscriber {
|
|
21
|
+
readonly manager: DataCubeQuerySnapshotManager;
|
|
22
|
+
private latestSnapshot: DataCubeQuerySnapshot | undefined;
|
|
23
|
+
|
|
24
|
+
constructor(snapshotManager: DataCubeQuerySnapshotManager) {
|
|
25
|
+
this.manager = snapshotManager;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
abstract applySnapshot(snapshot: DataCubeQuerySnapshot): Promise<void>;
|
|
29
|
+
|
|
30
|
+
async receiveSnapshot(snapshot: DataCubeQuerySnapshot): Promise<void> {
|
|
31
|
+
this.latestSnapshot = snapshot;
|
|
32
|
+
await this.applySnapshot(snapshot);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
publishSnapshot(snapshot: DataCubeQuerySnapshot): void {
|
|
36
|
+
this.latestSnapshot = snapshot;
|
|
37
|
+
this.manager.broadcastSnapshot(snapshot);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
getLatestSnapshot(): DataCubeQuerySnapshot | undefined {
|
|
41
|
+
return this.latestSnapshot;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { action, flow, flowResult, makeObservable, observable } from 'mobx';
|
|
18
|
+
import type { DataCubeState } from '../DataCubeState.js';
|
|
19
|
+
import {
|
|
20
|
+
HttpStatus,
|
|
21
|
+
NetworkClientError,
|
|
22
|
+
assertErrorThrown,
|
|
23
|
+
uuid,
|
|
24
|
+
type GeneratorFn,
|
|
25
|
+
type PlainObject,
|
|
26
|
+
} from '@finos/legend-shared';
|
|
27
|
+
import {
|
|
28
|
+
ParserError,
|
|
29
|
+
SourceInformation,
|
|
30
|
+
V1_ParserError,
|
|
31
|
+
} from '@finos/legend-graph';
|
|
32
|
+
|
|
33
|
+
export class DataCubeQueryEditorState {
|
|
34
|
+
uuid = uuid();
|
|
35
|
+
query: string;
|
|
36
|
+
parserError?: ParserError | undefined;
|
|
37
|
+
|
|
38
|
+
constructor(query: string) {
|
|
39
|
+
makeObservable(this, {
|
|
40
|
+
query: observable,
|
|
41
|
+
parserError: observable,
|
|
42
|
+
setQuery: action,
|
|
43
|
+
setParserError: action,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
this.query = query;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
setQuery(val: string): void {
|
|
50
|
+
this.query = val;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
setParserError(parserError: ParserError | undefined): void {
|
|
54
|
+
// account for the lambda prefix offset in source information
|
|
55
|
+
if (parserError?.sourceInformation) {
|
|
56
|
+
parserError.sourceInformation = this.processSourceInformation(
|
|
57
|
+
parserError.sourceInformation,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
this.parserError = parserError;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
processSourceInformation(
|
|
64
|
+
sourceInformation: SourceInformation,
|
|
65
|
+
): SourceInformation {
|
|
66
|
+
const { sourceId, startLine, startColumn, endLine, endColumn } =
|
|
67
|
+
sourceInformation;
|
|
68
|
+
const lineOffset = 0;
|
|
69
|
+
const columnOffset = 0;
|
|
70
|
+
return new SourceInformation(
|
|
71
|
+
sourceId,
|
|
72
|
+
startLine + lineOffset,
|
|
73
|
+
startColumn - (startLine === 1 ? columnOffset : 0),
|
|
74
|
+
endLine + lineOffset,
|
|
75
|
+
endColumn - (endLine === 1 ? columnOffset : 0),
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export class DataCubeQueryCodeEditorState {
|
|
81
|
+
readonly dataCubeState!: DataCubeState;
|
|
82
|
+
|
|
83
|
+
queryEditorState!: DataCubeQueryEditorState;
|
|
84
|
+
currentSubQuery?: string | undefined;
|
|
85
|
+
|
|
86
|
+
constructor(dataCubeState: DataCubeState) {
|
|
87
|
+
makeObservable(this, {
|
|
88
|
+
currentSubQuery: observable,
|
|
89
|
+
queryEditorState: observable,
|
|
90
|
+
setCurrentSubQuery: action,
|
|
91
|
+
parseQuery: flow,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
this.dataCubeState = dataCubeState;
|
|
95
|
+
this.queryEditorState = new DataCubeQueryEditorState('');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
setCurrentSubQuery(val: string | undefined): void {
|
|
99
|
+
this.currentSubQuery = val;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
*parseQuery(): GeneratorFn<void> {
|
|
103
|
+
try {
|
|
104
|
+
this.queryEditorState.setParserError(undefined);
|
|
105
|
+
yield flowResult(
|
|
106
|
+
this.dataCubeState.editorStore.client.parseQuery({
|
|
107
|
+
code: `|${this.queryEditorState.query}`,
|
|
108
|
+
}),
|
|
109
|
+
);
|
|
110
|
+
} catch (error) {
|
|
111
|
+
assertErrorThrown(error);
|
|
112
|
+
if (
|
|
113
|
+
error instanceof NetworkClientError &&
|
|
114
|
+
error.response.status === HttpStatus.BAD_REQUEST
|
|
115
|
+
) {
|
|
116
|
+
const protocol = V1_ParserError.serialization.fromJson(
|
|
117
|
+
error.payload as PlainObject<V1_ParserError>,
|
|
118
|
+
);
|
|
119
|
+
const parserError = new ParserError(protocol.message);
|
|
120
|
+
if (protocol.sourceInformation) {
|
|
121
|
+
parserError.sourceInformation = new SourceInformation(
|
|
122
|
+
protocol.sourceInformation.sourceId,
|
|
123
|
+
protocol.sourceInformation.startLine,
|
|
124
|
+
protocol.sourceInformation.startColumn,
|
|
125
|
+
protocol.sourceInformation.endLine,
|
|
126
|
+
protocol.sourceInformation.endColumn,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
this.queryEditorState.setParserError(parserError);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// async getTypeaheadResults(
|
|
135
|
+
// position: IPosition,
|
|
136
|
+
// model: monacoEditorAPI.ITextModel,
|
|
137
|
+
// ): Promise<monacoLanguagesAPI.CompletionItem[]> {
|
|
138
|
+
// try {
|
|
139
|
+
// const textUntilPosition = model.getValueInRange({
|
|
140
|
+
// startLineNumber: 1,
|
|
141
|
+
// startColumn: 1,
|
|
142
|
+
// endLineNumber: position.lineNumber,
|
|
143
|
+
// endColumn: position.column,
|
|
144
|
+
// });
|
|
145
|
+
// const resultObj =
|
|
146
|
+
// await this.editorStore.client.getTypeaheadResults(textUntilPosition);
|
|
147
|
+
// const result = resultObj.map((res) =>
|
|
148
|
+
// CompletionItem.serialization.fromJson(res),
|
|
149
|
+
// );
|
|
150
|
+
// const currentWord = model.getWordUntilPosition(position);
|
|
151
|
+
// return result.map((res) => ({
|
|
152
|
+
// label: res.display,
|
|
153
|
+
// kind: monacoLanguagesAPI.CompletionItemKind.Text,
|
|
154
|
+
// range: {
|
|
155
|
+
// startLineNumber: position.lineNumber,
|
|
156
|
+
// startColumn: currentWord.startColumn + 1,
|
|
157
|
+
// endLineNumber: position.lineNumber,
|
|
158
|
+
// endColumn: currentWord.endColumn + 1,
|
|
159
|
+
// },
|
|
160
|
+
// insertText: res.completion,
|
|
161
|
+
// })) as monacoLanguagesAPI.CompletionItem[];
|
|
162
|
+
// } catch (e) {
|
|
163
|
+
// return [];
|
|
164
|
+
// }
|
|
165
|
+
// }
|
|
166
|
+
}
|
|
@@ -14,17 +14,20 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import { SerializationFactory } from '@finos/legend-shared';
|
|
17
|
+
import type { DataCubeQuerySnapshot } from '../core/DataCubeQuerySnapshot.js';
|
|
19
18
|
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
export interface DataCubeQueryEditorSubState {
|
|
20
|
+
/**
|
|
21
|
+
* Update the editor state based on the snapshot
|
|
22
|
+
*/
|
|
23
|
+
applySnaphot(snapshot: DataCubeQuerySnapshot): void;
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Build and enrich the snapshot with data from the editor state
|
|
27
|
+
* @returns whether the snapshot should be updated or not
|
|
28
|
+
*/
|
|
29
|
+
buildSnapshot(
|
|
30
|
+
newSnapshot: DataCubeQuerySnapshot,
|
|
31
|
+
baseSnapshot: DataCubeQuerySnapshot,
|
|
32
|
+
): boolean;
|
|
30
33
|
}
|