@finos/legend-cube-builder 0.0.0-stage → 0.0.3
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/LICENSE +201 -0
- package/README.md +64 -2
- package/docs/adding-an-operation.md +92 -0
- package/docs/hosting.md +79 -0
- package/docs/testing.md +83 -0
- package/lib/__lib__/LegendCubeCommand.d.ts +26 -0
- package/lib/__lib__/LegendCubeCommand.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeCommand.js +40 -0
- package/lib/__lib__/LegendCubeCommand.js.map +1 -0
- package/lib/__lib__/LegendCubeHelpText.d.ts +19 -0
- package/lib/__lib__/LegendCubeHelpText.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeHelpText.js +35 -0
- package/lib/__lib__/LegendCubeHelpText.js.map +1 -0
- package/lib/__lib__/LegendCubeLabels.d.ts +87 -0
- package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeLabels.js +128 -0
- package/lib/__lib__/LegendCubeLabels.js.map +1 -0
- package/lib/__lib__/LegendCubeTesting.d.ts +33 -0
- package/lib/__lib__/LegendCubeTesting.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeTesting.js +34 -0
- package/lib/__lib__/LegendCubeTesting.js.map +1 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.d.ts +24 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.js +37 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.js.map +1 -0
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts +47 -0
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -0
- package/lib/__test-utils__/CubeEngineTestSupport.js +106 -0
- package/lib/__test-utils__/CubeEngineTestSupport.js.map +1 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts +31 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts.map +1 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.js +102 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.js.map +1 -0
- package/lib/__test-utils__/CubeOperationsTestUtils.d.ts +42 -0
- package/lib/__test-utils__/CubeOperationsTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubeOperationsTestUtils.js +92 -0
- package/lib/__test-utils__/CubeOperationsTestUtils.js.map +1 -0
- package/lib/__test-utils__/CubePageTestUtils.d.ts +33 -0
- package/lib/__test-utils__/CubePageTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubePageTestUtils.js +68 -0
- package/lib/__test-utils__/CubePageTestUtils.js.map +1 -0
- package/lib/__test-utils__/CubeTestApplication.d.ts +30 -0
- package/lib/__test-utils__/CubeTestApplication.d.ts.map +1 -0
- package/lib/__test-utils__/CubeTestApplication.js +57 -0
- package/lib/__test-utils__/CubeTestApplication.js.map +1 -0
- package/lib/__test-utils__/FakeCubeEngine.d.ts +41 -0
- package/lib/__test-utils__/FakeCubeEngine.d.ts.map +1 -0
- package/lib/__test-utils__/FakeCubeEngine.js +91 -0
- package/lib/__test-utils__/FakeCubeEngine.js.map +1 -0
- package/lib/components/CubeButton.d.ts +20 -0
- package/lib/components/CubeButton.d.ts.map +1 -0
- package/lib/components/CubeButton.js +24 -0
- package/lib/components/CubeButton.js.map +1 -0
- package/lib/components/CubeEditor.d.ts +31 -0
- package/lib/components/CubeEditor.d.ts.map +1 -0
- package/lib/components/CubeEditor.js +90 -0
- package/lib/components/CubeEditor.js.map +1 -0
- package/lib/components/CubeNodeIcon.d.ts +23 -0
- package/lib/components/CubeNodeIcon.d.ts.map +1 -0
- package/lib/components/CubeNodeIcon.js +42 -0
- package/lib/components/CubeNodeIcon.js.map +1 -0
- package/lib/components/canvas/CubeCanvas.d.ts +37 -0
- package/lib/components/canvas/CubeCanvas.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvas.js +137 -0
- package/lib/components/canvas/CubeCanvas.js.map +1 -0
- package/lib/components/canvas/CubeCanvasContext.d.ts +19 -0
- package/lib/components/canvas/CubeCanvasContext.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasContext.js +22 -0
- package/lib/components/canvas/CubeCanvasContext.js.map +1 -0
- package/lib/components/canvas/CubeCanvasContextMenu.d.ts +28 -0
- package/lib/components/canvas/CubeCanvasContextMenu.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasContextMenu.js +35 -0
- package/lib/components/canvas/CubeCanvasContextMenu.js.map +1 -0
- package/lib/components/canvas/CubeCanvasDnd.d.ts +43 -0
- package/lib/components/canvas/CubeCanvasDnd.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasDnd.js +51 -0
- package/lib/components/canvas/CubeCanvasDnd.js.map +1 -0
- package/lib/components/canvas/CubeCanvasEdge.d.ts +24 -0
- package/lib/components/canvas/CubeCanvasEdge.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasEdge.js +33 -0
- package/lib/components/canvas/CubeCanvasEdge.js.map +1 -0
- package/lib/components/canvas/CubeCanvasElements.d.ts +66 -0
- package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasElements.js +97 -0
- package/lib/components/canvas/CubeCanvasElements.js.map +1 -0
- package/lib/components/canvas/CubeCanvasLayout.d.ts +32 -0
- package/lib/components/canvas/CubeCanvasLayout.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasLayout.js +63 -0
- package/lib/components/canvas/CubeCanvasLayout.js.map +1 -0
- package/lib/components/canvas/CubeCanvasNode.d.ts +29 -0
- package/lib/components/canvas/CubeCanvasNode.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasNode.js +75 -0
- package/lib/components/canvas/CubeCanvasNode.js.map +1 -0
- package/lib/components/editors/CubeColumnPicker.d.ts +47 -0
- package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -0
- package/lib/components/editors/CubeColumnPicker.js +56 -0
- package/lib/components/editors/CubeColumnPicker.js.map +1 -0
- package/lib/components/editors/CubeDistinctEditor.d.ts +23 -0
- package/lib/components/editors/CubeDistinctEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeDistinctEditor.js +24 -0
- package/lib/components/editors/CubeDistinctEditor.js.map +1 -0
- package/lib/components/editors/CubeFilterEditor.d.ts +26 -0
- package/lib/components/editors/CubeFilterEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeFilterEditor.js +90 -0
- package/lib/components/editors/CubeFilterEditor.js.map +1 -0
- package/lib/components/editors/CubeIntegerField.d.ts +29 -0
- package/lib/components/editors/CubeIntegerField.d.ts.map +1 -0
- package/lib/components/editors/CubeIntegerField.js +30 -0
- package/lib/components/editors/CubeIntegerField.js.map +1 -0
- package/lib/components/editors/CubeJoinEditor.d.ts +26 -0
- package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeJoinEditor.js +84 -0
- package/lib/components/editors/CubeJoinEditor.js.map +1 -0
- package/lib/components/editors/CubeNodeEditorPanel.d.ts +29 -0
- package/lib/components/editors/CubeNodeEditorPanel.d.ts.map +1 -0
- package/lib/components/editors/CubeNodeEditorPanel.js +72 -0
- package/lib/components/editors/CubeNodeEditorPanel.js.map +1 -0
- package/lib/components/editors/CubeNodeEditorRegistry.d.ts +44 -0
- package/lib/components/editors/CubeNodeEditorRegistry.d.ts.map +1 -0
- package/lib/components/editors/CubeNodeEditorRegistry.js +43 -0
- package/lib/components/editors/CubeNodeEditorRegistry.js.map +1 -0
- package/lib/components/editors/CubeRenameEditor.d.ts +26 -0
- package/lib/components/editors/CubeRenameEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeRenameEditor.js +58 -0
- package/lib/components/editors/CubeRenameEditor.js.map +1 -0
- package/lib/components/editors/CubeRestrictEditor.d.ts +26 -0
- package/lib/components/editors/CubeRestrictEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeRestrictEditor.js +23 -0
- package/lib/components/editors/CubeRestrictEditor.js.map +1 -0
- package/lib/components/editors/CubeRowCountEditor.d.ts +25 -0
- package/lib/components/editors/CubeRowCountEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeRowCountEditor.js +38 -0
- package/lib/components/editors/CubeRowCountEditor.js.map +1 -0
- package/lib/components/editors/CubeSliceEditor.d.ts +25 -0
- package/lib/components/editors/CubeSliceEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeSliceEditor.js +40 -0
- package/lib/components/editors/CubeSliceEditor.js.map +1 -0
- package/lib/components/editors/CubeSortEditor.d.ts +27 -0
- package/lib/components/editors/CubeSortEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeSortEditor.js +72 -0
- package/lib/components/editors/CubeSortEditor.js.map +1 -0
- package/lib/components/editors/CubeSourceEditor.d.ts +25 -0
- package/lib/components/editors/CubeSourceEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeSourceEditor.js +41 -0
- package/lib/components/editors/CubeSourceEditor.js.map +1 -0
- package/lib/components/editors/CubeValueEditor.d.ts +40 -0
- package/lib/components/editors/CubeValueEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeValueEditor.js +178 -0
- package/lib/components/editors/CubeValueEditor.js.map +1 -0
- package/lib/components/grid/CubeGridRegion.d.ts +23 -0
- package/lib/components/grid/CubeGridRegion.d.ts.map +1 -0
- package/lib/components/grid/CubeGridRegion.js +94 -0
- package/lib/components/grid/CubeGridRegion.js.map +1 -0
- package/lib/components/grid/CubeGridValues.d.ts +25 -0
- package/lib/components/grid/CubeGridValues.d.ts.map +1 -0
- package/lib/components/grid/CubeGridValues.js +95 -0
- package/lib/components/grid/CubeGridValues.js.map +1 -0
- package/lib/components/grid/CubeResultGrid.d.ts +39 -0
- package/lib/components/grid/CubeResultGrid.d.ts.map +1 -0
- package/lib/components/grid/CubeResultGrid.js +86 -0
- package/lib/components/grid/CubeResultGrid.js.map +1 -0
- package/lib/components/palette/CubePalette.d.ts +29 -0
- package/lib/components/palette/CubePalette.d.ts.map +1 -0
- package/lib/components/palette/CubePalette.js +73 -0
- package/lib/components/palette/CubePalette.js.map +1 -0
- package/lib/components/show-pure/CubeShowPureDialog.d.ts +23 -0
- package/lib/components/show-pure/CubeShowPureDialog.d.ts.map +1 -0
- package/lib/components/show-pure/CubeShowPureDialog.js +37 -0
- package/lib/components/show-pure/CubeShowPureDialog.js.map +1 -0
- package/lib/components/source-picker/CubeSourcePicker.d.ts +22 -0
- package/lib/components/source-picker/CubeSourcePicker.d.ts.map +1 -0
- package/lib/components/source-picker/CubeSourcePicker.js +89 -0
- package/lib/components/source-picker/CubeSourcePicker.js.map +1 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts +26 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts.map +1 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.js +45 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.js.map +1 -0
- package/lib/graph-manager/CubeEngine.d.ts +128 -0
- package/lib/graph-manager/CubeEngine.d.ts.map +1 -0
- package/lib/graph-manager/CubeEngine.js +61 -0
- package/lib/graph-manager/CubeEngine.js.map +1 -0
- package/lib/graph-manager/CubeModelOutlineHelper.d.ts +33 -0
- package/lib/graph-manager/CubeModelOutlineHelper.d.ts.map +1 -0
- package/lib/graph-manager/CubeModelOutlineHelper.js +45 -0
- package/lib/graph-manager/CubeModelOutlineHelper.js.map +1 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts +26 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js +22 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts +27 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js +76 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts +27 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js +82 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts +32 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js +195 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts +20 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js +174 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts +24 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js +43 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts +45 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js +171 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts +22 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js +79 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js.map +1 -0
- package/lib/index.css +17 -0
- package/lib/index.css.map +1 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/stores/CubeEditorState.d.ts +236 -0
- package/lib/stores/CubeEditorState.d.ts.map +1 -0
- package/lib/stores/CubeEditorState.js +632 -0
- package/lib/stores/CubeEditorState.js.map +1 -0
- package/lib/stores/CubeExecutionState.d.ts +67 -0
- package/lib/stores/CubeExecutionState.d.ts.map +1 -0
- package/lib/stores/CubeExecutionState.js +212 -0
- package/lib/stores/CubeExecutionState.js.map +1 -0
- package/lib/stores/CubeGridQuickActions.d.ts +40 -0
- package/lib/stores/CubeGridQuickActions.d.ts.map +1 -0
- package/lib/stores/CubeGridQuickActions.js +86 -0
- package/lib/stores/CubeGridQuickActions.js.map +1 -0
- package/lib/stores/CubeHost.d.ts +31 -0
- package/lib/stores/CubeHost.d.ts.map +1 -0
- package/lib/stores/CubeHost.js +17 -0
- package/lib/stores/CubeHost.js.map +1 -0
- package/lib/stores/CubeNodeEditorState.d.ts +103 -0
- package/lib/stores/CubeNodeEditorState.d.ts.map +1 -0
- package/lib/stores/CubeNodeEditorState.js +262 -0
- package/lib/stores/CubeNodeEditorState.js.map +1 -0
- package/lib/stores/CubeShowPureState.d.ts +41 -0
- package/lib/stores/CubeShowPureState.d.ts.map +1 -0
- package/lib/stores/CubeShowPureState.js +100 -0
- package/lib/stores/CubeShowPureState.js.map +1 -0
- package/lib/stores/CubeSourcePickerState.d.ts +98 -0
- package/lib/stores/CubeSourcePickerState.d.ts.map +1 -0
- package/lib/stores/CubeSourcePickerState.js +334 -0
- package/lib/stores/CubeSourcePickerState.js.map +1 -0
- package/lib/stores/CubeSpecTransferState.d.ts +60 -0
- package/lib/stores/CubeSpecTransferState.d.ts.map +1 -0
- package/lib/stores/CubeSpecTransferState.js +167 -0
- package/lib/stores/CubeSpecTransferState.js.map +1 -0
- package/lib/stores/LocalModelCatalog.d.ts +37 -0
- package/lib/stores/LocalModelCatalog.d.ts.map +1 -0
- package/lib/stores/LocalModelCatalog.js +49 -0
- package/lib/stores/LocalModelCatalog.js.map +1 -0
- package/lib/stores/editors/CubeFilterDraft.d.ts +61 -0
- package/lib/stores/editors/CubeFilterDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeFilterDraft.js +186 -0
- package/lib/stores/editors/CubeFilterDraft.js.map +1 -0
- package/lib/stores/editors/CubeIntegerText.d.ts +24 -0
- package/lib/stores/editors/CubeIntegerText.d.ts.map +1 -0
- package/lib/stores/editors/CubeIntegerText.js +33 -0
- package/lib/stores/editors/CubeIntegerText.js.map +1 -0
- package/lib/stores/editors/CubeJoinDraft.d.ts +71 -0
- package/lib/stores/editors/CubeJoinDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeJoinDraft.js +145 -0
- package/lib/stores/editors/CubeJoinDraft.js.map +1 -0
- package/lib/stores/editors/CubeNodeDraft.d.ts +38 -0
- package/lib/stores/editors/CubeNodeDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeNodeDraft.js +35 -0
- package/lib/stores/editors/CubeNodeDraft.js.map +1 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts +35 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.js +55 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.js.map +1 -0
- package/lib/stores/editors/CubeRenameDraft.d.ts +44 -0
- package/lib/stores/editors/CubeRenameDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeRenameDraft.js +79 -0
- package/lib/stores/editors/CubeRenameDraft.js.map +1 -0
- package/lib/stores/editors/CubeRestrictDraft.d.ts +37 -0
- package/lib/stores/editors/CubeRestrictDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeRestrictDraft.js +73 -0
- package/lib/stores/editors/CubeRestrictDraft.js.map +1 -0
- package/lib/stores/editors/CubeRowCountDraft.d.ts +42 -0
- package/lib/stores/editors/CubeRowCountDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeRowCountDraft.js +55 -0
- package/lib/stores/editors/CubeRowCountDraft.js.map +1 -0
- package/lib/stores/editors/CubeSliceDraft.d.ts +42 -0
- package/lib/stores/editors/CubeSliceDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeSliceDraft.js +72 -0
- package/lib/stores/editors/CubeSliceDraft.js.map +1 -0
- package/lib/stores/editors/CubeSortDraft.d.ts +49 -0
- package/lib/stores/editors/CubeSortDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeSortDraft.js +99 -0
- package/lib/stores/editors/CubeSortDraft.js.map +1 -0
- package/lib/stores/fixtures/CubeNorthwindModel.d.ts +23 -0
- package/lib/stores/fixtures/CubeNorthwindModel.d.ts.map +1 -0
- package/lib/stores/fixtures/CubeNorthwindModel.js +338 -0
- package/lib/stores/fixtures/CubeNorthwindModel.js.map +1 -0
- package/package.json +81 -3
- package/src/__lib__/LegendCubeCommand.ts +44 -0
- package/src/__lib__/LegendCubeHelpText.ts +58 -0
- package/src/__lib__/LegendCubeLabels.ts +171 -0
- package/src/__lib__/LegendCubeTesting.ts +33 -0
- package/src/__test-utils__/CubeCanvasTestUtils.ts +53 -0
- package/src/__test-utils__/CubeEngineTestSupport.ts +172 -0
- package/src/__test-utils__/CubeNorthwindTestQueries.ts +165 -0
- package/src/__test-utils__/CubeOperationsTestUtils.ts +177 -0
- package/src/__test-utils__/CubePageTestUtils.tsx +96 -0
- package/src/__test-utils__/CubeTestApplication.ts +82 -0
- package/src/__test-utils__/FakeCubeEngine.ts +145 -0
- package/src/components/CubeButton.tsx +35 -0
- package/src/components/CubeEditor.tsx +239 -0
- package/src/components/CubeNodeIcon.tsx +64 -0
- package/src/components/canvas/CubeCanvas.tsx +262 -0
- package/src/components/canvas/CubeCanvasContext.ts +31 -0
- package/src/components/canvas/CubeCanvasContextMenu.tsx +89 -0
- package/src/components/canvas/CubeCanvasDnd.ts +82 -0
- package/src/components/canvas/CubeCanvasEdge.tsx +57 -0
- package/src/components/canvas/CubeCanvasElements.ts +153 -0
- package/src/components/canvas/CubeCanvasLayout.ts +88 -0
- package/src/components/canvas/CubeCanvasNode.tsx +149 -0
- package/src/components/editors/CubeColumnPicker.tsx +138 -0
- package/src/components/editors/CubeDistinctEditor.tsx +28 -0
- package/src/components/editors/CubeFilterEditor.tsx +309 -0
- package/src/components/editors/CubeIntegerField.tsx +51 -0
- package/src/components/editors/CubeJoinEditor.tsx +247 -0
- package/src/components/editors/CubeNodeEditorPanel.tsx +215 -0
- package/src/components/editors/CubeNodeEditorRegistry.ts +81 -0
- package/src/components/editors/CubeRenameEditor.tsx +143 -0
- package/src/components/editors/CubeRestrictEditor.tsx +103 -0
- package/src/components/editors/CubeRowCountEditor.tsx +53 -0
- package/src/components/editors/CubeSliceEditor.tsx +69 -0
- package/src/components/editors/CubeSortEditor.tsx +206 -0
- package/src/components/editors/CubeSourceEditor.tsx +106 -0
- package/src/components/editors/CubeValueEditor.tsx +333 -0
- package/src/components/grid/CubeGridRegion.tsx +275 -0
- package/src/components/grid/CubeGridValues.ts +125 -0
- package/src/components/grid/CubeResultGrid.tsx +138 -0
- package/src/components/palette/CubePalette.tsx +177 -0
- package/src/components/show-pure/CubeShowPureDialog.tsx +101 -0
- package/src/components/source-picker/CubeSourcePicker.tsx +304 -0
- package/src/components/spec-transfer/CubeSpecTransferDialog.tsx +157 -0
- package/src/graph-manager/CubeEngine.ts +169 -0
- package/src/graph-manager/CubeModelOutlineHelper.ts +58 -0
- package/src/graph-manager/protocol/pure/CubeEngineBuilder.ts +34 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts +109 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts +115 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts +257 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts +243 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.ts +58 -0
- package/src/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.ts +278 -0
- package/src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts +127 -0
- package/src/index.ts +41 -0
- package/src/stores/CubeEditorState.ts +807 -0
- package/src/stores/CubeExecutionState.ts +288 -0
- package/src/stores/CubeGridQuickActions.ts +129 -0
- package/src/stores/CubeHost.ts +32 -0
- package/src/stores/CubeNodeEditorState.ts +324 -0
- package/src/stores/CubeShowPureState.ts +118 -0
- package/src/stores/CubeSourcePickerState.ts +426 -0
- package/src/stores/CubeSpecTransferState.ts +198 -0
- package/src/stores/LocalModelCatalog.ts +70 -0
- package/src/stores/editors/CubeFilterDraft.ts +241 -0
- package/src/stores/editors/CubeIntegerText.ts +34 -0
- package/src/stores/editors/CubeJoinDraft.ts +224 -0
- package/src/stores/editors/CubeNodeDraft.ts +46 -0
- package/src/stores/editors/CubeNodeDraftRegistry.ts +83 -0
- package/src/stores/editors/CubeRenameDraft.ts +110 -0
- package/src/stores/editors/CubeRestrictDraft.ts +83 -0
- package/src/stores/editors/CubeRowCountDraft.ts +69 -0
- package/src/stores/editors/CubeSliceDraft.ts +87 -0
- package/src/stores/editors/CubeSortDraft.ts +135 -0
- package/src/stores/fixtures/CubeNorthwindModel.ts +355 -0
- package/tsconfig.json +133 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-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 {
|
|
18
|
+
canFixJoinDuplicates,
|
|
19
|
+
fixJoinDuplicates,
|
|
20
|
+
type NodeRegistry,
|
|
21
|
+
type Query,
|
|
22
|
+
type QueryNode,
|
|
23
|
+
type Schema,
|
|
24
|
+
} from '@finos/legend-cube';
|
|
25
|
+
import {
|
|
26
|
+
action,
|
|
27
|
+
computed,
|
|
28
|
+
type IReactionDisposer,
|
|
29
|
+
makeObservable,
|
|
30
|
+
observable,
|
|
31
|
+
reaction,
|
|
32
|
+
} from 'mobx';
|
|
33
|
+
import {
|
|
34
|
+
CUBE_EDITOR_CLOSED_REASON,
|
|
35
|
+
getEditorClosedNotice,
|
|
36
|
+
} from '../__lib__/LegendCubeLabels.js';
|
|
37
|
+
import type { CubeEditorState } from './CubeEditorState.js';
|
|
38
|
+
import type { CubeNodeDraft } from './editors/CubeNodeDraft.js';
|
|
39
|
+
import { createCubeNodeDraft } from './editors/CubeNodeDraftRegistry.js';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Whether two nodes of the same id save the same: their own fields, as the
|
|
43
|
+
* spec stores them, and the keys this version doesn't know. A node of a type
|
|
44
|
+
* the registry doesn't know is the same only as itself.
|
|
45
|
+
*/
|
|
46
|
+
export const isSameNodeContent = (
|
|
47
|
+
registry: NodeRegistry,
|
|
48
|
+
a: QueryNode,
|
|
49
|
+
b: QueryNode,
|
|
50
|
+
): boolean => {
|
|
51
|
+
if (a === b) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
const definition = registry.get(a.type);
|
|
55
|
+
return (
|
|
56
|
+
definition !== undefined &&
|
|
57
|
+
a.type === b.type &&
|
|
58
|
+
JSON.stringify([definition.spec.encode(a), a.rest]) ===
|
|
59
|
+
JSON.stringify([definition.spec.encode(b), b.rest])
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The node editor in the side panel (PLAN §7.4, spec §17.5). Opening it
|
|
65
|
+
* never changes which node Execute runs. Edits go to a draft, and only Apply,
|
|
66
|
+
* or closing the panel, stores them, as one undo step; Cancel drops them.
|
|
67
|
+
*
|
|
68
|
+
* The panel follows the cube (user's choice, 2026-10-07): when the node it
|
|
69
|
+
* shows is replaced or removed underneath it, by Undo, a re-check or a
|
|
70
|
+
* Remove, a panel with edits closes without applying them and says so; one
|
|
71
|
+
* without edits shows the new node, or closes when the node is gone.
|
|
72
|
+
*/
|
|
73
|
+
export class CubeNodeEditorState {
|
|
74
|
+
readonly editorState: CubeEditorState;
|
|
75
|
+
|
|
76
|
+
/** The id of the node the panel shows, while it is open */
|
|
77
|
+
nodeId: string | undefined;
|
|
78
|
+
/** The key of the node the draft was made from */
|
|
79
|
+
private nodeKey: number | undefined;
|
|
80
|
+
draft: CubeNodeDraft | undefined;
|
|
81
|
+
/** Why the panel closed by itself, until it opens again or is dismissed */
|
|
82
|
+
notice: string | undefined;
|
|
83
|
+
|
|
84
|
+
private readonly disposeSync: IReactionDisposer;
|
|
85
|
+
|
|
86
|
+
constructor(editorState: CubeEditorState) {
|
|
87
|
+
makeObservable<CubeNodeEditorState, 'nodeKey' | 'sync'>(this, {
|
|
88
|
+
nodeId: observable,
|
|
89
|
+
nodeKey: observable,
|
|
90
|
+
draft: observable.ref,
|
|
91
|
+
notice: observable,
|
|
92
|
+
node: computed,
|
|
93
|
+
edited: computed,
|
|
94
|
+
hasChanges: computed,
|
|
95
|
+
open: action,
|
|
96
|
+
canSwapInputs: computed,
|
|
97
|
+
canRenameDuplicateColumns: computed,
|
|
98
|
+
apply: action,
|
|
99
|
+
swapInputs: action,
|
|
100
|
+
renameDuplicateColumns: action,
|
|
101
|
+
close: action,
|
|
102
|
+
cancel: action,
|
|
103
|
+
discard: action,
|
|
104
|
+
dismissNotice: action,
|
|
105
|
+
sync: action,
|
|
106
|
+
});
|
|
107
|
+
this.editorState = editorState;
|
|
108
|
+
this.disposeSync = reaction(
|
|
109
|
+
() => this.node,
|
|
110
|
+
() => this.sync(),
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** The node the panel shows, as the cube has it now */
|
|
115
|
+
get node(): QueryNode | undefined {
|
|
116
|
+
return this.nodeId === undefined
|
|
117
|
+
? undefined
|
|
118
|
+
: this.editorState.document.query.getNode(this.nodeId);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** The node Apply would store, built once per edit */
|
|
122
|
+
get edited(): QueryNode | undefined {
|
|
123
|
+
return this.draft?.build();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** The draft saves differently from the node it was made from */
|
|
127
|
+
get hasChanges(): boolean {
|
|
128
|
+
const { draft, edited } = this;
|
|
129
|
+
return (
|
|
130
|
+
draft !== undefined &&
|
|
131
|
+
edited !== undefined &&
|
|
132
|
+
!isSameNodeContent(this.editorState.registry, edited, draft.original)
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Opens the panel on a node, closing (and so applying) the one it showed */
|
|
137
|
+
open(nodeId: string): void {
|
|
138
|
+
if (nodeId === this.nodeId) {
|
|
139
|
+
this.notice = undefined;
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const node = this.editorState.document.query.getNode(nodeId);
|
|
143
|
+
if (!node) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
this.close();
|
|
147
|
+
this.notice = undefined;
|
|
148
|
+
this.bind(node);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Stores the draft in place of the node, as one undo step, and goes on
|
|
153
|
+
* editing the stored node. Does nothing without changes, or while the cube
|
|
154
|
+
* is read-only.
|
|
155
|
+
*/
|
|
156
|
+
apply(): void {
|
|
157
|
+
const { node, edited } = this;
|
|
158
|
+
if (
|
|
159
|
+
!node ||
|
|
160
|
+
!edited ||
|
|
161
|
+
node.key !== this.nodeKey ||
|
|
162
|
+
!this.hasChanges ||
|
|
163
|
+
this.editorState.readOnly
|
|
164
|
+
) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const { query } = this.editorState.document;
|
|
168
|
+
if (query.canReplace(edited)) {
|
|
169
|
+
this.editorState.applyQuery(query.replace(edited));
|
|
170
|
+
this.bind(edited);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
get canSwapInputs(): boolean {
|
|
175
|
+
const { node } = this;
|
|
176
|
+
return (
|
|
177
|
+
node !== undefined &&
|
|
178
|
+
!this.editorState.readOnly &&
|
|
179
|
+
this.editorState.document.query.canSwapInputs(node.id)
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Swaps the node's two inputs (a Join's Swap Inputs, spec §17.6), applying
|
|
185
|
+
* the draft first, as one undo step, then goes on editing the swapped
|
|
186
|
+
* node, whose settings followed its inputs
|
|
187
|
+
*/
|
|
188
|
+
swapInputs(): void {
|
|
189
|
+
const { node, edited } = this;
|
|
190
|
+
if (!node || !edited || node.key !== this.nodeKey || !this.canSwapInputs) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
let { query } = this.editorState.document;
|
|
194
|
+
if (this.hasChanges && query.canReplace(edited)) {
|
|
195
|
+
query = query.replace(edited);
|
|
196
|
+
}
|
|
197
|
+
query = query.swapInputs(node.id);
|
|
198
|
+
this.editorState.applyQuery(query);
|
|
199
|
+
this.bind(query.getNode(node.id) ?? node);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* The cube's query with the draft in place of its node, when it has
|
|
204
|
+
* changes, and the schemas of the node's inputs, which the draft doesn't
|
|
205
|
+
* change
|
|
206
|
+
*/
|
|
207
|
+
private get queryWithEdits(): {
|
|
208
|
+
query: Query;
|
|
209
|
+
inputSchemas: (Schema | undefined)[];
|
|
210
|
+
} {
|
|
211
|
+
const { node, edited } = this;
|
|
212
|
+
let { query } = this.editorState.document;
|
|
213
|
+
if (edited && this.hasChanges && query.canReplace(edited)) {
|
|
214
|
+
query = query.replace(edited);
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
query,
|
|
218
|
+
inputSchemas: node
|
|
219
|
+
? query
|
|
220
|
+
.getInputIds(node.id)
|
|
221
|
+
.map((inputId) =>
|
|
222
|
+
inputId === undefined
|
|
223
|
+
? undefined
|
|
224
|
+
: this.editorState.analysis.schemas.get(inputId),
|
|
225
|
+
)
|
|
226
|
+
: [],
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Whether the join being edited, edits included, can have the columns its
|
|
232
|
+
* inputs share renamed (spec §7.11's autofix, PLAN §11.4): its only problem
|
|
233
|
+
* is the duplicate rule, and the cube isn't read-only
|
|
234
|
+
*/
|
|
235
|
+
get canRenameDuplicateColumns(): boolean {
|
|
236
|
+
const { node } = this;
|
|
237
|
+
if (!node || node.key !== this.nodeKey || this.editorState.readOnly) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
const { query, inputSchemas } = this.queryWithEdits;
|
|
241
|
+
const [leftSchema, rightSchema] = inputSchemas;
|
|
242
|
+
return canFixJoinDuplicates(query, node.id, leftSchema, rightSchema);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Renames the columns the join's inputs share with a Rename before each
|
|
247
|
+
* input, applying the draft first, as one undo step, then goes on editing
|
|
248
|
+
* the join, whose keys follow the renames
|
|
249
|
+
*/
|
|
250
|
+
renameDuplicateColumns(): void {
|
|
251
|
+
const { node } = this;
|
|
252
|
+
if (!node || !this.canRenameDuplicateColumns) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const { query, inputSchemas } = this.queryWithEdits;
|
|
256
|
+
const [leftSchema, rightSchema] = inputSchemas;
|
|
257
|
+
const fixed = fixJoinDuplicates(query, node.id, leftSchema, rightSchema);
|
|
258
|
+
this.editorState.applyQuery(fixed);
|
|
259
|
+
this.bind(fixed.getNode(node.id) ?? node);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/** Applies the draft, then closes the panel (spec §17.5: edits commit on close) */
|
|
263
|
+
close(): void {
|
|
264
|
+
this.apply();
|
|
265
|
+
this.reset();
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/** Closes the panel, dropping the draft */
|
|
269
|
+
cancel(): void {
|
|
270
|
+
this.reset();
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Closes the panel without applying the draft, e.g. when another cube is
|
|
275
|
+
* opened, saying so when that drops edits
|
|
276
|
+
*/
|
|
277
|
+
discard(reason: CUBE_EDITOR_CLOSED_REASON): void {
|
|
278
|
+
const { nodeId } = this;
|
|
279
|
+
if (nodeId !== undefined && this.hasChanges) {
|
|
280
|
+
this.notice = getEditorClosedNotice(nodeId, reason);
|
|
281
|
+
}
|
|
282
|
+
this.reset();
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
dismissNotice(): void {
|
|
286
|
+
this.notice = undefined;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** Stops following the cube; call when the page closes */
|
|
290
|
+
dispose(): void {
|
|
291
|
+
this.disposeSync();
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
private bind(node: QueryNode): void {
|
|
295
|
+
this.nodeId = node.id;
|
|
296
|
+
this.nodeKey = node.key;
|
|
297
|
+
this.draft = createCubeNodeDraft(node, this.editorState);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
private reset(): void {
|
|
301
|
+
this.nodeId = undefined;
|
|
302
|
+
this.nodeKey = undefined;
|
|
303
|
+
this.draft = undefined;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/** Runs whenever the node with the panel's id is another object, or gone */
|
|
307
|
+
private sync(): void {
|
|
308
|
+
const { node } = this;
|
|
309
|
+
if (this.nodeId === undefined || node?.key === this.nodeKey) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
if (this.hasChanges) {
|
|
313
|
+
this.discard(
|
|
314
|
+
node
|
|
315
|
+
? CUBE_EDITOR_CLOSED_REASON.NODE_CHANGED
|
|
316
|
+
: CUBE_EDITOR_CLOSED_REASON.NODE_REMOVED,
|
|
317
|
+
);
|
|
318
|
+
} else if (node) {
|
|
319
|
+
this.bind(node);
|
|
320
|
+
} else {
|
|
321
|
+
this.reset();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-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 { needsDatabaseType } from '@finos/legend-cube';
|
|
18
|
+
import type { GeneratorFn } from '@finos/legend-shared';
|
|
19
|
+
import { action, flow, flowResult, makeObservable, observable } from 'mobx';
|
|
20
|
+
import {
|
|
21
|
+
CubeEngineError,
|
|
22
|
+
CubeEngineErrorKind,
|
|
23
|
+
} from '../graph-manager/CubeEngine.js';
|
|
24
|
+
import type { CubeEditorState } from './CubeEditorState.js';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Show Pure: the Pure text of what Execute would run, the capture node's
|
|
28
|
+
* execution lambda with the row limit, as the engine renders it. For display
|
|
29
|
+
* only: the text is never parsed back (PLAN §8.7).
|
|
30
|
+
*/
|
|
31
|
+
export class CubeShowPureState {
|
|
32
|
+
readonly editorState: CubeEditorState;
|
|
33
|
+
|
|
34
|
+
isOpen = false;
|
|
35
|
+
text: string | undefined;
|
|
36
|
+
/** Why the engine couldn't render the query; shown in the dialog */
|
|
37
|
+
error: CubeEngineError | undefined;
|
|
38
|
+
isRendering = false;
|
|
39
|
+
/** Counts renders, so one that finishes after the dialog closed is dropped */
|
|
40
|
+
private request = 0;
|
|
41
|
+
|
|
42
|
+
constructor(editorState: CubeEditorState) {
|
|
43
|
+
makeObservable(this, {
|
|
44
|
+
isOpen: observable,
|
|
45
|
+
text: observable,
|
|
46
|
+
error: observable.ref,
|
|
47
|
+
isRendering: observable,
|
|
48
|
+
open: flow,
|
|
49
|
+
close: action,
|
|
50
|
+
});
|
|
51
|
+
this.editorState = editorState;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Opens the dialog and renders the query, written for the database it runs
|
|
56
|
+
* on, as Execute writes it; does nothing when Execute can't run
|
|
57
|
+
*/
|
|
58
|
+
*open(): GeneratorFn<void> {
|
|
59
|
+
const { execution, document, emitter, rowLimit, host } = this.editorState;
|
|
60
|
+
const { query, context } = document;
|
|
61
|
+
const runtime = context?.runtime;
|
|
62
|
+
const model = context?.model;
|
|
63
|
+
// checked by canExecute
|
|
64
|
+
const captureId = query.selected as string;
|
|
65
|
+
if (!execution.canExecute || runtime === undefined || model === undefined) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const request = ++this.request;
|
|
69
|
+
this.isOpen = true;
|
|
70
|
+
this.text = undefined;
|
|
71
|
+
this.error = undefined;
|
|
72
|
+
this.isRendering = true;
|
|
73
|
+
try {
|
|
74
|
+
let databaseType: string | undefined;
|
|
75
|
+
if (needsDatabaseType(query, captureId)) {
|
|
76
|
+
yield flowResult(this.editorState.loadModelOutline(model));
|
|
77
|
+
// closed, or opened again, while the outline loaded
|
|
78
|
+
if (request !== this.request) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
databaseType = this.editorState.getRunDatabaseType(
|
|
82
|
+
query,
|
|
83
|
+
captureId,
|
|
84
|
+
model,
|
|
85
|
+
runtime,
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
const text = (yield host.engine.renderPure(
|
|
89
|
+
emitter.emitExecutionLambda({ rowLimit, runtime, databaseType }),
|
|
90
|
+
)) as string;
|
|
91
|
+
if (request === this.request) {
|
|
92
|
+
this.text = text;
|
|
93
|
+
}
|
|
94
|
+
} catch (error) {
|
|
95
|
+
if (request === this.request) {
|
|
96
|
+
this.error =
|
|
97
|
+
error instanceof CubeEngineError
|
|
98
|
+
? error
|
|
99
|
+
: new CubeEngineError(
|
|
100
|
+
CubeEngineErrorKind.COMPILE,
|
|
101
|
+
error instanceof Error ? error.message : String(error),
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
} finally {
|
|
105
|
+
if (request === this.request) {
|
|
106
|
+
this.isRendering = false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
close(): void {
|
|
112
|
+
this.request++;
|
|
113
|
+
this.isOpen = false;
|
|
114
|
+
this.isRendering = false;
|
|
115
|
+
this.text = undefined;
|
|
116
|
+
this.error = undefined;
|
|
117
|
+
}
|
|
118
|
+
}
|