@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,274 @@
|
|
|
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 { observer } from 'mobx-react-lite';
|
|
18
|
+
import {
|
|
19
|
+
PlusIcon,
|
|
20
|
+
SearchIcon,
|
|
21
|
+
TimesIcon,
|
|
22
|
+
clsx,
|
|
23
|
+
ChevronLeftIcon,
|
|
24
|
+
ChevronRightIcon,
|
|
25
|
+
CustomSelectorInput,
|
|
26
|
+
} from '@finos/legend-art';
|
|
27
|
+
import type { REPLStore } from '../../../stores/dataCube/DataCubeStore.js';
|
|
28
|
+
import { DATA_CUBE_COLUMN_SORT_DIRECTION } from '../../../stores/dataCube/DataCubeMetaModelConst.js';
|
|
29
|
+
|
|
30
|
+
export const DataCubeEditorSortPanel = observer(
|
|
31
|
+
(props: { editorStore: REPLStore }) => {
|
|
32
|
+
const { editorStore } = props;
|
|
33
|
+
const sortState = editorStore.dataCubeState.editor.sort;
|
|
34
|
+
const onAvailabeColumnsSearchTextChange: React.ChangeEventHandler<
|
|
35
|
+
HTMLInputElement
|
|
36
|
+
> = (event) => {
|
|
37
|
+
sortState.setAvailableColumnsSearchText(event.target.value);
|
|
38
|
+
};
|
|
39
|
+
const onSelectedColumnsSearchTextChange: React.ChangeEventHandler<
|
|
40
|
+
HTMLInputElement
|
|
41
|
+
> = (event) => {
|
|
42
|
+
sortState.setSelectedColumnsSearchText(event.target.value);
|
|
43
|
+
};
|
|
44
|
+
const clearAvailableColumnsSearchText = (): void => {
|
|
45
|
+
sortState.setAvailableColumnsSearchText('');
|
|
46
|
+
};
|
|
47
|
+
const clearSelectedColumnsSearchText = (): void => {
|
|
48
|
+
sortState.setSelectedColumnsSearchText('');
|
|
49
|
+
};
|
|
50
|
+
const sortOptions = Array.from(
|
|
51
|
+
Object.values(DATA_CUBE_COLUMN_SORT_DIRECTION),
|
|
52
|
+
).map((val) => ({
|
|
53
|
+
label: val,
|
|
54
|
+
value: val,
|
|
55
|
+
}));
|
|
56
|
+
const onAvailableColumnsSortOptionsChanged =
|
|
57
|
+
(columnName: string) =>
|
|
58
|
+
(option: {
|
|
59
|
+
label: string;
|
|
60
|
+
value: DATA_CUBE_COLUMN_SORT_DIRECTION;
|
|
61
|
+
}): void => {
|
|
62
|
+
const column = sortState.availableColumns.find(
|
|
63
|
+
(col) => col.column.name === columnName,
|
|
64
|
+
);
|
|
65
|
+
if (column) {
|
|
66
|
+
column.setDirection(option.value);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const onSelectedColumnsSortOptionsChanged =
|
|
71
|
+
(columnName: string) =>
|
|
72
|
+
(option: {
|
|
73
|
+
label: string;
|
|
74
|
+
value: DATA_CUBE_COLUMN_SORT_DIRECTION;
|
|
75
|
+
}): void => {
|
|
76
|
+
const column = sortState.selectedColumns.find(
|
|
77
|
+
(col) => col.column.name === columnName,
|
|
78
|
+
);
|
|
79
|
+
if (column) {
|
|
80
|
+
column.setDirection(option.value);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<div className="repl__hpivot__sort__editor">
|
|
86
|
+
<div className="repl__hpivot__sort__column__editor">
|
|
87
|
+
<div className="repl__hpivot__sort__column__editor__header">
|
|
88
|
+
Sorts
|
|
89
|
+
</div>
|
|
90
|
+
<div className="repl__hpivot__sort__column__editor__content">
|
|
91
|
+
<div className="repl__hpivot__sort__column__editor__available__columns">
|
|
92
|
+
<div className="repl__hpivot__sort__column__editor__description">
|
|
93
|
+
Available sort columns:
|
|
94
|
+
</div>
|
|
95
|
+
<div className="repl__hpivot__sort__column__editor__container">
|
|
96
|
+
<div className="query-builder-property-search-panel__header">
|
|
97
|
+
<div className="query-builder-property-search-panel__input__container">
|
|
98
|
+
<input
|
|
99
|
+
className={clsx(
|
|
100
|
+
'query-builder-property-search-panel__input',
|
|
101
|
+
{
|
|
102
|
+
'query-builder-property-search-panel__input--searching':
|
|
103
|
+
sortState.availableColumnsSearchText,
|
|
104
|
+
},
|
|
105
|
+
)}
|
|
106
|
+
spellCheck={false}
|
|
107
|
+
onChange={onAvailabeColumnsSearchTextChange}
|
|
108
|
+
value={sortState.availableColumnsSearchText}
|
|
109
|
+
placeholder="Search"
|
|
110
|
+
/>
|
|
111
|
+
{!sortState.availableColumnsSearchText ? (
|
|
112
|
+
<>
|
|
113
|
+
<div className="query-builder-property-search-panel__input__search__icon">
|
|
114
|
+
<SearchIcon />
|
|
115
|
+
</div>
|
|
116
|
+
</>
|
|
117
|
+
) : (
|
|
118
|
+
<button
|
|
119
|
+
className="query-builder-property-search-panel__input__clear-btn"
|
|
120
|
+
tabIndex={-1}
|
|
121
|
+
onClick={clearAvailableColumnsSearchText}
|
|
122
|
+
title="Clear"
|
|
123
|
+
>
|
|
124
|
+
<TimesIcon />
|
|
125
|
+
</button>
|
|
126
|
+
)}
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
<div className="repl__hpivot__sort__column__editor__available__columns__content">
|
|
130
|
+
<div
|
|
131
|
+
className="repl__hpivot__sort__column__editor__available__columns__root"
|
|
132
|
+
onDoubleClick={(): void =>
|
|
133
|
+
sortState.addAllAvailableColumns()
|
|
134
|
+
}
|
|
135
|
+
>
|
|
136
|
+
<PlusIcon />
|
|
137
|
+
<div className="repl__hpivot__sort__column__editor__available__columns__root__label">
|
|
138
|
+
All
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
{sortState.availableColumnsSearchResults.map((col) => (
|
|
142
|
+
<div
|
|
143
|
+
className="repl__hpivot__sort__column__editor__available__columns__children"
|
|
144
|
+
key={col.column.name}
|
|
145
|
+
>
|
|
146
|
+
<div
|
|
147
|
+
className="repl__hpivot__sort__column__editor__available__columns__children__name"
|
|
148
|
+
onDoubleClick={(): void =>
|
|
149
|
+
sortState.addAvailableColumn(col.column.name)
|
|
150
|
+
}
|
|
151
|
+
>
|
|
152
|
+
{col.column.name}
|
|
153
|
+
</div>
|
|
154
|
+
<CustomSelectorInput
|
|
155
|
+
className="repl__hpivot__sort__column__editor__available__columns__children__order"
|
|
156
|
+
options={sortOptions}
|
|
157
|
+
onChange={onAvailableColumnsSortOptionsChanged(
|
|
158
|
+
col.column.name,
|
|
159
|
+
)}
|
|
160
|
+
value={{ label: col.direction, value: col.direction }}
|
|
161
|
+
isClearable={false}
|
|
162
|
+
darkMode={false}
|
|
163
|
+
/>
|
|
164
|
+
</div>
|
|
165
|
+
))}
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
<div className="repl__hpivot__sort__column__editor__actions">
|
|
170
|
+
<div className="repl__hpivot__sort__column__editor__action">
|
|
171
|
+
<button
|
|
172
|
+
tabIndex={-1}
|
|
173
|
+
// onClick={clearSearch}
|
|
174
|
+
title="Add"
|
|
175
|
+
>
|
|
176
|
+
Add
|
|
177
|
+
<ChevronRightIcon />
|
|
178
|
+
</button>
|
|
179
|
+
</div>
|
|
180
|
+
<div className="repl__hpivot__sort__column__editor__action">
|
|
181
|
+
<button
|
|
182
|
+
tabIndex={-1}
|
|
183
|
+
// onClick={clearSearch}
|
|
184
|
+
title="Remove"
|
|
185
|
+
>
|
|
186
|
+
<ChevronLeftIcon />
|
|
187
|
+
Remove
|
|
188
|
+
</button>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
<div className="repl__hpivot__sort__column__editor__selected__columns">
|
|
192
|
+
<div className="repl__hpivot__sort__column__editor__description">
|
|
193
|
+
Selected sort columns:
|
|
194
|
+
</div>
|
|
195
|
+
<div className="repl__hpivot__sort__column__editor__container">
|
|
196
|
+
<div className="query-builder-property-search-panel__header">
|
|
197
|
+
<div className="query-builder-property-search-panel__input__container">
|
|
198
|
+
<input
|
|
199
|
+
className={clsx(
|
|
200
|
+
'query-builder-property-search-panel__input',
|
|
201
|
+
{
|
|
202
|
+
'query-builder-property-search-panel__input--searching':
|
|
203
|
+
sortState.selectedColumnsSearchText,
|
|
204
|
+
},
|
|
205
|
+
)}
|
|
206
|
+
spellCheck={false}
|
|
207
|
+
onChange={onSelectedColumnsSearchTextChange}
|
|
208
|
+
value={sortState.selectedColumnsSearchText}
|
|
209
|
+
placeholder="Search"
|
|
210
|
+
/>
|
|
211
|
+
{!sortState.selectedColumnsSearchText ? (
|
|
212
|
+
<>
|
|
213
|
+
<div className="query-builder-property-search-panel__input__search__icon">
|
|
214
|
+
<SearchIcon />
|
|
215
|
+
</div>
|
|
216
|
+
</>
|
|
217
|
+
) : (
|
|
218
|
+
<button
|
|
219
|
+
className="query-builder-property-search-panel__input__clear-btn"
|
|
220
|
+
tabIndex={-1}
|
|
221
|
+
onClick={clearSelectedColumnsSearchText}
|
|
222
|
+
title="Clear"
|
|
223
|
+
>
|
|
224
|
+
<TimesIcon />
|
|
225
|
+
</button>
|
|
226
|
+
)}
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
<div className="repl__hpivot__sort__column__editor__available__columns__content">
|
|
230
|
+
<div
|
|
231
|
+
className="repl__hpivot__sort__column__editor__available__columns__root"
|
|
232
|
+
onDoubleClick={(): void =>
|
|
233
|
+
sortState.addAllSelectedColumns()
|
|
234
|
+
}
|
|
235
|
+
>
|
|
236
|
+
<PlusIcon />
|
|
237
|
+
<div className="repl__hpivot__sort__column__editor__available__columns__root__label">
|
|
238
|
+
All
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
{sortState.selectedColumnsSearchResults.map((col) => (
|
|
242
|
+
<div
|
|
243
|
+
className="repl__hpivot__sort__column__editor__available__columns__children"
|
|
244
|
+
key={col.column.name}
|
|
245
|
+
>
|
|
246
|
+
<div
|
|
247
|
+
className="repl__hpivot__sort__column__editor__available__columns__children__name"
|
|
248
|
+
onDoubleClick={(): void =>
|
|
249
|
+
sortState.addSelectedColumn(col.column.name)
|
|
250
|
+
}
|
|
251
|
+
>
|
|
252
|
+
{col.column.name}
|
|
253
|
+
</div>
|
|
254
|
+
<CustomSelectorInput
|
|
255
|
+
className="repl__hpivot__sort__column__editor__available__columns__children__order"
|
|
256
|
+
options={sortOptions}
|
|
257
|
+
onChange={onSelectedColumnsSortOptionsChanged(
|
|
258
|
+
col.column.name,
|
|
259
|
+
)}
|
|
260
|
+
value={{ label: col.direction, value: col.direction }}
|
|
261
|
+
isClearable={false}
|
|
262
|
+
darkMode={false}
|
|
263
|
+
/>
|
|
264
|
+
</div>
|
|
265
|
+
))}
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
);
|
|
273
|
+
},
|
|
274
|
+
);
|
|
@@ -0,0 +1,77 @@
|
|
|
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 { observer } from 'mobx-react-lite';
|
|
18
|
+
import type { REPLStore } from '../../../stores/dataCube/DataCubeStore.js';
|
|
19
|
+
import { LicenseManager } from '@ag-grid-enterprise/core';
|
|
20
|
+
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
|
|
21
|
+
import { ServerSideRowModelModule } from '@ag-grid-enterprise/server-side-row-model';
|
|
22
|
+
import { RowGroupingModule } from '@ag-grid-enterprise/row-grouping';
|
|
23
|
+
import { MenuModule } from '@ag-grid-enterprise/menu';
|
|
24
|
+
import { AgGridReact } from '@ag-grid-community/react';
|
|
25
|
+
import { useEffect } from 'react';
|
|
26
|
+
|
|
27
|
+
// NOTE: This is a workaround to prevent ag-grid license key check from flooding the console screen
|
|
28
|
+
// with its stack trace in Chrome.
|
|
29
|
+
// We MUST NEVER completely surpress this warning, else it's a violation of the ag-grid license
|
|
30
|
+
const __INTERNAL__original_console_error = console.error; // eslint-disable-line no-console
|
|
31
|
+
// eslint-disable-next-line no-process-env
|
|
32
|
+
if (process.env.NODE_ENV === 'development') {
|
|
33
|
+
// eslint-disable-next-line no-console
|
|
34
|
+
console.error = (message?: unknown, ...optionalParams: unknown[]): void => {
|
|
35
|
+
console.log(message); // eslint-disable-line no-console
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const DataCubeGrid = observer((props: { editorStore: REPLStore }) => {
|
|
40
|
+
const { editorStore } = props;
|
|
41
|
+
const dataCubeState = editorStore.dataCubeState;
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (dataCubeState.grid.clientLicenseKey) {
|
|
45
|
+
LicenseManager.setLicenseKey(dataCubeState.grid.clientLicenseKey);
|
|
46
|
+
}
|
|
47
|
+
}, [dataCubeState.grid.clientLicenseKey]);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<AgGridReact
|
|
52
|
+
rowGroupPanelShow="always"
|
|
53
|
+
suppressBrowserResizeObserver={true}
|
|
54
|
+
suppressScrollOnNewData={true}
|
|
55
|
+
alwaysMultiSort={true}
|
|
56
|
+
rowModelType="serverSide"
|
|
57
|
+
serverSideDatasource={dataCubeState.grid.clientDataSource}
|
|
58
|
+
modules={[
|
|
59
|
+
// community
|
|
60
|
+
ClientSideRowModelModule,
|
|
61
|
+
// enterprise
|
|
62
|
+
ServerSideRowModelModule,
|
|
63
|
+
RowGroupingModule,
|
|
64
|
+
MenuModule,
|
|
65
|
+
]}
|
|
66
|
+
onGridReady={(params): void => {
|
|
67
|
+
dataCubeState.grid.configureClient(params.api);
|
|
68
|
+
// eslint-disable-next-line no-process-env
|
|
69
|
+
if (process.env.NODE_ENV === 'development') {
|
|
70
|
+
console.error = __INTERNAL__original_console_error; // eslint-disable-line no-console
|
|
71
|
+
}
|
|
72
|
+
}}
|
|
73
|
+
className="ag-theme-balham"
|
|
74
|
+
/>
|
|
75
|
+
</>
|
|
76
|
+
);
|
|
77
|
+
});
|
package/src/index.tsx
CHANGED
|
@@ -14,24 +14,28 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
import {
|
|
18
|
+
WebConsole,
|
|
19
|
+
type AbstractPlugin,
|
|
20
|
+
type AbstractPreset,
|
|
21
|
+
} from '@finos/legend-shared';
|
|
22
|
+
import { LegendREPL } from './application/LegendREPL.js';
|
|
23
|
+
import { Core_LegendREPLApplicationPlugin } from './components/Core_LegendREPLApplicationPlugin.js';
|
|
20
24
|
|
|
21
|
-
export class
|
|
25
|
+
export class LegendREPLWebApplication {
|
|
22
26
|
static getPresetCollection(): AbstractPreset[] {
|
|
23
27
|
return [];
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
static getPluginCollection(): AbstractPlugin[] {
|
|
27
|
-
return [new
|
|
31
|
+
return [new Core_LegendREPLApplicationPlugin(), new WebConsole()];
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
static run(baseUrl: string): void {
|
|
31
|
-
|
|
35
|
+
LegendREPL.create()
|
|
32
36
|
.setup({ baseAddress: baseUrl })
|
|
33
|
-
.withPresets(
|
|
34
|
-
.withPlugins(
|
|
37
|
+
.withPresets(LegendREPLWebApplication.getPresetCollection())
|
|
38
|
+
.withPlugins(LegendREPLWebApplication.getPluginCollection())
|
|
35
39
|
.start()
|
|
36
40
|
.catch((e: unknown) => {
|
|
37
41
|
throw e;
|
|
@@ -19,10 +19,18 @@ import {
|
|
|
19
19
|
type NetworkClient,
|
|
20
20
|
type PlainObject,
|
|
21
21
|
} from '@finos/legend-shared';
|
|
22
|
-
import type {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
import type {
|
|
23
|
+
CompletionItem,
|
|
24
|
+
DataCubeGetQueryCodeInput,
|
|
25
|
+
DataCubeGetQueryRelationReturnTypeInput,
|
|
26
|
+
DataCubeParseQueryInput,
|
|
27
|
+
DataCubeQueryTypeaheadInput,
|
|
28
|
+
RelationType,
|
|
29
|
+
DataCubeExecutionInput,
|
|
30
|
+
DataCubeExecutionResult,
|
|
31
|
+
} from './models/DataCubeEngineModels.js';
|
|
32
|
+
import type { V1_ValueSpecification } from '@finos/legend-graph';
|
|
33
|
+
import type { DataCubeQuery } from './models/DataCubeQuery.js';
|
|
26
34
|
|
|
27
35
|
export class REPLServerClient {
|
|
28
36
|
private readonly networkClient: NetworkClient;
|
|
@@ -34,88 +42,52 @@ export class REPLServerClient {
|
|
|
34
42
|
get baseUrl(): string {
|
|
35
43
|
return guaranteeNonNullable(
|
|
36
44
|
this.networkClient.baseUrl,
|
|
37
|
-
`REPL client has not been configured properly`,
|
|
45
|
+
`REPL server client has not been configured properly`,
|
|
38
46
|
);
|
|
39
47
|
}
|
|
40
48
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.networkClient.post(
|
|
45
|
-
`${this.baseUrl}/gridResult`,
|
|
46
|
-
request,
|
|
47
|
-
undefined,
|
|
48
|
-
undefined,
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
getIntialQueryLambda = (): Promise<PlainObject<V1_Lambda>> =>
|
|
52
|
-
this.networkClient.get(
|
|
53
|
-
`${this.baseUrl}/initialLambda`,
|
|
54
|
-
undefined,
|
|
55
|
-
undefined,
|
|
56
|
-
undefined,
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
executeLambda = (
|
|
60
|
-
lambda: string,
|
|
61
|
-
isPaginationEnabled: boolean,
|
|
62
|
-
): Promise<PlainObject<REPLGridServerResult>> =>
|
|
63
|
-
this.networkClient.post(
|
|
64
|
-
`${this.baseUrl}/executeLambda`,
|
|
65
|
-
lambda,
|
|
66
|
-
undefined,
|
|
67
|
-
undefined,
|
|
68
|
-
{
|
|
69
|
-
isPaginationEnabled,
|
|
70
|
-
},
|
|
71
|
-
);
|
|
49
|
+
private get dataCube(): string {
|
|
50
|
+
return `${this.baseUrl}/api/dataCube`;
|
|
51
|
+
}
|
|
72
52
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
this.networkClient.post(
|
|
77
|
-
`${this.baseUrl}/typeahead`,
|
|
78
|
-
lambda,
|
|
79
|
-
undefined,
|
|
80
|
-
undefined,
|
|
81
|
-
);
|
|
53
|
+
async getGridClientLicenseKey(): Promise<string> {
|
|
54
|
+
return this.networkClient.get(`${this.dataCube}/gridLicenseKey`);
|
|
55
|
+
}
|
|
82
56
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
undefined,
|
|
89
|
-
);
|
|
57
|
+
async getQueryTypeahead(
|
|
58
|
+
input: DataCubeQueryTypeaheadInput,
|
|
59
|
+
): Promise<PlainObject<CompletionItem>[]> {
|
|
60
|
+
return this.networkClient.post(`${this.dataCube}/typeahead`, input);
|
|
61
|
+
}
|
|
90
62
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
63
|
+
// TODO: @akphi - we might need to support batch, source information offset, etc.
|
|
64
|
+
async parseQuery(
|
|
65
|
+
input: DataCubeParseQueryInput,
|
|
66
|
+
): Promise<PlainObject<V1_ValueSpecification>> {
|
|
67
|
+
return this.networkClient.post(`${this.dataCube}/parseQuery`, input);
|
|
68
|
+
}
|
|
69
|
+
async getQueryCode(
|
|
70
|
+
input: DataCubeGetQueryCodeInput,
|
|
71
|
+
): Promise<PlainObject<string>> {
|
|
72
|
+
return this.networkClient.post(`${this.dataCube}/getQueryCode`, input);
|
|
73
|
+
}
|
|
97
74
|
|
|
98
|
-
|
|
99
|
-
this.networkClient.get(
|
|
100
|
-
|
|
101
|
-
undefined,
|
|
102
|
-
undefined,
|
|
103
|
-
undefined,
|
|
104
|
-
);
|
|
75
|
+
async getBaseQuery(): Promise<PlainObject<DataCubeQuery>> {
|
|
76
|
+
return this.networkClient.get(`${this.dataCube}/getBaseQuery`);
|
|
77
|
+
}
|
|
105
78
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
79
|
+
async getRelationReturnType(
|
|
80
|
+
input: DataCubeGetQueryRelationReturnTypeInput,
|
|
81
|
+
): Promise<RelationType> {
|
|
82
|
+
return this.networkClient.post(
|
|
83
|
+
`${this.dataCube}/getRelationReturnType`,
|
|
84
|
+
input,
|
|
112
85
|
);
|
|
86
|
+
}
|
|
113
87
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
undefined,
|
|
120
|
-
);
|
|
88
|
+
async executeQuery(
|
|
89
|
+
input: PlainObject<DataCubeExecutionInput>,
|
|
90
|
+
): Promise<DataCubeExecutionResult> {
|
|
91
|
+
return this.networkClient.post(`${this.dataCube}/executeQuery`, input);
|
|
92
|
+
}
|
|
121
93
|
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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 { createModelSchema, custom, optional, primitive } from 'serializr';
|
|
18
|
+
import { SerializationFactory, usingModelSchema } from '@finos/legend-shared';
|
|
19
|
+
import {
|
|
20
|
+
type V1_ValueSpecification,
|
|
21
|
+
type V1_Lambda,
|
|
22
|
+
V1_deserializeValueSpecification,
|
|
23
|
+
V1_serializeValueSpecification,
|
|
24
|
+
V1_lambdaModelSchema,
|
|
25
|
+
} from '@finos/legend-graph';
|
|
26
|
+
import type { DataCubeQueryColumn } from './DataCubeQuery.js';
|
|
27
|
+
|
|
28
|
+
export class DataCubeGetQueryCodeInput {
|
|
29
|
+
query!: V1_ValueSpecification; // TODO: @akphi - consider if we should update this to use Lambda instead
|
|
30
|
+
pretty?: boolean;
|
|
31
|
+
|
|
32
|
+
static readonly serialization = new SerializationFactory(
|
|
33
|
+
createModelSchema(DataCubeGetQueryCodeInput, {
|
|
34
|
+
pretty: optional(primitive()),
|
|
35
|
+
query: custom(
|
|
36
|
+
(val) => V1_serializeValueSpecification(val, []),
|
|
37
|
+
(val) => V1_deserializeValueSpecification(val, []),
|
|
38
|
+
),
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type DataCubeParseQueryInput = {
|
|
44
|
+
code: string;
|
|
45
|
+
returnSourceInformation?: boolean | undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type CompletionItem = {
|
|
49
|
+
completion: string;
|
|
50
|
+
display: string;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type DataCubeQueryTypeaheadInput = {
|
|
54
|
+
code: string;
|
|
55
|
+
isPartial?: boolean | undefined;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export class DataCubeGetQueryRelationReturnTypeInput {
|
|
59
|
+
query!: V1_Lambda;
|
|
60
|
+
|
|
61
|
+
static readonly serialization = new SerializationFactory(
|
|
62
|
+
createModelSchema(DataCubeGetQueryRelationReturnTypeInput, {
|
|
63
|
+
query: usingModelSchema(V1_lambdaModelSchema([])),
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export class DataCubeExecutionInput {
|
|
69
|
+
query!: V1_Lambda;
|
|
70
|
+
|
|
71
|
+
static readonly serialization = new SerializationFactory(
|
|
72
|
+
createModelSchema(DataCubeExecutionInput, {
|
|
73
|
+
query: usingModelSchema(V1_lambdaModelSchema([])),
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type DataCubeExecutionResult = {
|
|
79
|
+
result: string;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type RelationType = {
|
|
83
|
+
columns: DataCubeQueryColumn[];
|
|
84
|
+
};
|