@finos/legend-cube-builder 0.0.0-stage → 0.0.2
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 +5 -2
- 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 +27 -0
- package/lib/__lib__/LegendCubeHelpText.js.map +1 -0
- package/lib/__lib__/LegendCubeLabels.d.ts +68 -0
- package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeLabels.js +109 -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 +41 -0
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -0
- package/lib/__test-utils__/CubeEngineTestSupport.js +76 -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__/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 +85 -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 +32 -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 +135 -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 +64 -0
- package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasElements.js +96 -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 +72 -0
- package/lib/components/canvas/CubeCanvasNode.js.map +1 -0
- package/lib/components/editors/CubeColumnPicker.d.ts +40 -0
- package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -0
- package/lib/components/editors/CubeColumnPicker.js +51 -0
- package/lib/components/editors/CubeColumnPicker.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/CubeJoinEditor.d.ts +26 -0
- package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeJoinEditor.js +76 -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 +71 -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 +30 -0
- package/lib/components/editors/CubeNodeEditorRegistry.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 +42 -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 +177 -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 +26 -0
- package/lib/components/grid/CubeResultGrid.d.ts.map +1 -0
- package/lib/components/grid/CubeResultGrid.js +50 -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 +115 -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 +25 -0
- package/lib/graph-manager/CubeModelOutlineHelper.d.ts.map +1 -0
- package/lib/graph-manager/CubeModelOutlineHelper.js +24 -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 +121 -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 +206 -0
- package/lib/stores/CubeEditorState.d.ts.map +1 -0
- package/lib/stores/CubeEditorState.js +551 -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 +196 -0
- package/lib/stores/CubeExecutionState.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 +85 -0
- package/lib/stores/CubeNodeEditorState.d.ts.map +1 -0
- package/lib/stores/CubeNodeEditorState.js +207 -0
- package/lib/stores/CubeNodeEditorState.js.map +1 -0
- package/lib/stores/CubeShowPureState.d.ts +38 -0
- package/lib/stores/CubeShowPureState.d.ts.map +1 -0
- package/lib/stores/CubeShowPureState.js +83 -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/CubeJoinDraft.d.ts +63 -0
- package/lib/stores/editors/CubeJoinDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeJoinDraft.js +136 -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 +29 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.js +33 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.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 +38 -0
- package/src/__lib__/LegendCubeLabels.ts +141 -0
- package/src/__lib__/LegendCubeTesting.ts +33 -0
- package/src/__test-utils__/CubeCanvasTestUtils.ts +53 -0
- package/src/__test-utils__/CubeEngineTestSupport.ts +137 -0
- package/src/__test-utils__/CubeNorthwindTestQueries.ts +165 -0
- package/src/__test-utils__/CubePageTestUtils.tsx +96 -0
- package/src/__test-utils__/CubeTestApplication.ts +82 -0
- package/src/__test-utils__/FakeCubeEngine.ts +139 -0
- package/src/components/CubeButton.tsx +35 -0
- package/src/components/CubeEditor.tsx +239 -0
- package/src/components/CubeNodeIcon.tsx +47 -0
- package/src/components/canvas/CubeCanvas.tsx +260 -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 +150 -0
- package/src/components/canvas/CubeCanvasLayout.ts +88 -0
- package/src/components/canvas/CubeCanvasNode.tsx +141 -0
- package/src/components/editors/CubeColumnPicker.tsx +114 -0
- package/src/components/editors/CubeFilterEditor.tsx +309 -0
- package/src/components/editors/CubeJoinEditor.tsx +224 -0
- package/src/components/editors/CubeNodeEditorPanel.tsx +204 -0
- package/src/components/editors/CubeNodeEditorRegistry.ts +61 -0
- package/src/components/editors/CubeSourceEditor.tsx +116 -0
- package/src/components/editors/CubeValueEditor.tsx +332 -0
- package/src/components/grid/CubeGridRegion.tsx +274 -0
- package/src/components/grid/CubeGridValues.ts +125 -0
- package/src/components/grid/CubeResultGrid.tsx +84 -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 +155 -0
- package/src/graph-manager/CubeModelOutlineHelper.ts +32 -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 +157 -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 +124 -0
- package/src/index.ts +41 -0
- package/src/stores/CubeEditorState.ts +702 -0
- package/src/stores/CubeExecutionState.ts +255 -0
- package/src/stores/CubeHost.ts +32 -0
- package/src/stores/CubeNodeEditorState.ts +255 -0
- package/src/stores/CubeShowPureState.ts +96 -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/CubeJoinDraft.ts +197 -0
- package/src/stores/editors/CubeNodeDraft.ts +46 -0
- package/src/stores/editors/CubeNodeDraftRegistry.ts +49 -0
- package/src/stores/fixtures/CubeNorthwindModel.ts +355 -0
- package/tsconfig.json +118 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { clsx } from '@finos/legend-art';
|
|
18
|
+
import { DataGrid, } from '@finos/legend-lego/data-grid';
|
|
19
|
+
import { memo, useMemo } from 'react';
|
|
20
|
+
import { NULL_CELL_TEXT } from '../../__lib__/LegendCubeLabels.js';
|
|
21
|
+
import { LEGEND_CUBE_TEST_ID } from '../../__lib__/LegendCubeTesting.js';
|
|
22
|
+
import { compareCellValues, isNumericFamily } from './CubeGridValues.js';
|
|
23
|
+
const CubeCell = (props) => props.value === null || props.value === undefined ? (_jsx("span", { className: "text-[var(--color-text-muted)]", children: NULL_CELL_TEXT })) : (_jsx(_Fragment, { children: String(props.value) }));
|
|
24
|
+
/**
|
|
25
|
+
* The rows of a run (PLAN §9): columns from Cube's own schema of the capture
|
|
26
|
+
* node, by position, so any column name works. Numbers are right-aligned and
|
|
27
|
+
* shown and sorted exactly as the engine wrote them.
|
|
28
|
+
*/
|
|
29
|
+
export const CubeResultGrid = memo((props) => {
|
|
30
|
+
const { result, darkMode } = props;
|
|
31
|
+
const columnDefs = useMemo(() => result.schema.columns.map((column, position) => {
|
|
32
|
+
const numeric = isNumericFamily(column.type.family);
|
|
33
|
+
return {
|
|
34
|
+
colId: `c${position}`,
|
|
35
|
+
headerName: column.name,
|
|
36
|
+
headerTooltip: `${column.type.displayName}${column.nullable ? '?' : ''} (${column.type.fullName})`,
|
|
37
|
+
valueGetter: (params) => params.data?.[position] ?? null,
|
|
38
|
+
cellRenderer: CubeCell,
|
|
39
|
+
...(numeric
|
|
40
|
+
? { type: 'rightAligned', comparator: compareCellValues }
|
|
41
|
+
: {}),
|
|
42
|
+
};
|
|
43
|
+
}), [result]);
|
|
44
|
+
return (_jsx("div", { className: clsx('h-full w-full', {
|
|
45
|
+
'ag-theme-balham': !darkMode,
|
|
46
|
+
'ag-theme-balham-dark': darkMode,
|
|
47
|
+
}), "data-testid": LEGEND_CUBE_TEST_ID.RESULT_GRID, children: _jsx(DataGrid, { rowData: result.rows, columnDefs: columnDefs, suppressFieldDotNotation: true, tooltipShowDelay: 500 }) }));
|
|
48
|
+
});
|
|
49
|
+
CubeResultGrid.displayName = 'CubeResultGrid';
|
|
50
|
+
//# sourceMappingURL=CubeResultGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeResultGrid.js","sourceRoot":"","sources":["../../../src/components/grid/CubeResultGrid.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,QAAQ,GAGT,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAGzE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAIzE,MAAM,QAAQ,GAEV,CAAC,KAAK,EAAE,EAAE,CACZ,KAAK,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAClD,eAAM,SAAS,EAAC,gCAAgC,YAAE,cAAc,GAAQ,CACzE,CAAC,CAAC,CAAC,CACF,4BAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAI,CAC3B,CAAC;AAEJ;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAChC,CAAC,KAAyD,EAAE,EAAE;IAC5D,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACnC,MAAM,UAAU,GAAG,OAAO,CACxB,GAAyD,EAAE,CACzD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;QAC7C,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpD,OAAO;YACL,KAAK,EAAE,IAAI,QAAQ,EAAE;YACrB,UAAU,EAAE,MAAM,CAAC,IAAI;YACvB,aAAa,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,IAAI,CAAC,QAAQ,GAAG;YAClG,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,IAAI;YACxD,YAAY,EAAE,QAAQ;YACtB,GAAG,CAAC,OAAO;gBACT,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE;gBACzD,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;IACJ,CAAC,CAAC,EACJ,CAAC,MAAM,CAAC,CACT,CAAC;IACF,OAAO,CACL,cACE,SAAS,EAAE,IAAI,CAAC,eAAe,EAAE;YAC/B,iBAAiB,EAAE,CAAC,QAAQ;YAC5B,sBAAsB,EAAE,QAAQ;SACjC,CAAC,iBACW,mBAAmB,CAAC,WAAW,YAE5C,KAAC,QAAQ,IACP,OAAO,EAAE,MAAM,CAAC,IAAiB,EACjC,UAAU,EAAE,UAAU,EACtB,wBAAwB,EAAE,IAAI,EAC9B,gBAAgB,EAAE,GAAG,GACrB,GACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AACF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
import type { CubeEditorState } from '../../stores/CubeEditorState.js';
|
|
17
|
+
/** Shown in the palette while the cube has no node yet (spec §17.2, worded for the canvas) */
|
|
18
|
+
export declare const PALETTE_EMPTY_HINT = "Drag items onto the canvas.";
|
|
19
|
+
/**
|
|
20
|
+
* The sidebar of node types to add (spec §17.2): the sources, then the
|
|
21
|
+
* transforms in menu order, read from the registry, as the context menu is.
|
|
22
|
+
* Collapsed, it shows icons only; that choice is kept per user.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CubePalette: ((props: {
|
|
25
|
+
editorState: CubeEditorState;
|
|
26
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=CubePalette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubePalette.d.ts","sourceRoot":"","sources":["../../../src/components/palette/CubePalette.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOvE,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB,gCAAgC,CAAC;AA+EhE;;;;GAIG;AACH,eAAO,MAAM,WAAW,WACd;IAAE,WAAW,EAAE,eAAe,CAAA;CAAE;;CA4DzC,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { ChevronLeftIcon, ChevronRightIcon, clsx } from '@finos/legend-art';
|
|
18
|
+
import { observer } from 'mobx-react-lite';
|
|
19
|
+
import { useRef } from 'react';
|
|
20
|
+
import { useDrag } from 'react-dnd';
|
|
21
|
+
import { READ_ONLY_CUBE_TITLE } from '../../__lib__/LegendCubeLabels.js';
|
|
22
|
+
import { LEGEND_CUBE_TEST_ID } from '../../__lib__/LegendCubeTesting.js';
|
|
23
|
+
import { CUBE_DND_TYPE, } from '../canvas/CubeCanvasDnd.js';
|
|
24
|
+
import { CubeNodeIcon } from '../CubeNodeIcon.js';
|
|
25
|
+
/** Shown in the palette while the cube has no node yet (spec §17.2, worded for the canvas) */
|
|
26
|
+
export const PALETTE_EMPTY_HINT = 'Drag items onto the canvas.';
|
|
27
|
+
/** What an item does, for its tooltip */
|
|
28
|
+
const describeItem = (definition) => definition.kind === 'source'
|
|
29
|
+
? 'Click, or drop it on the canvas, to pick a table'
|
|
30
|
+
: 'Drag it onto a node to add it after that node, or onto the canvas to add it on its own; click to add it on its own';
|
|
31
|
+
const CubePaletteItem = observer((props) => {
|
|
32
|
+
const { editorState, definition, collapsed } = props;
|
|
33
|
+
const { readOnly } = editorState;
|
|
34
|
+
const ref = useRef(null);
|
|
35
|
+
const [, dragConnector] = useDrag(() => ({
|
|
36
|
+
type: CUBE_DND_TYPE.PALETTE_ITEM,
|
|
37
|
+
item: { nodeType: definition.type },
|
|
38
|
+
canDrag: () => !editorState.readOnly,
|
|
39
|
+
}), [editorState, definition.type]);
|
|
40
|
+
dragConnector(ref);
|
|
41
|
+
const label = `${definition.label}${definition.beta ? ' (BETA)' : ''}`;
|
|
42
|
+
const add = () => {
|
|
43
|
+
if (!readOnly) {
|
|
44
|
+
editorState.addNode(definition.type);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return (
|
|
48
|
+
// a div, not a button: browsers won't drag a button
|
|
49
|
+
_jsxs("div", { ref: ref, role: "button", tabIndex: readOnly ? -1 : 0, "aria-disabled": readOnly, "aria-label": label, className: clsx('flex h-8 shrink-0 items-center gap-2 px-3 text-base', readOnly
|
|
50
|
+
? 'cursor-not-allowed text-[var(--color-text-disabled)]'
|
|
51
|
+
: 'cursor-grab hover:bg-[var(--color-bg-hover)]'), title: readOnly
|
|
52
|
+
? READ_ONLY_CUBE_TITLE
|
|
53
|
+
: collapsed
|
|
54
|
+
? `${label}: ${describeItem(definition)}`
|
|
55
|
+
: describeItem(definition), onClick: add, onKeyDown: (event) => {
|
|
56
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
add();
|
|
59
|
+
}
|
|
60
|
+
}, "data-testid": LEGEND_CUBE_TEST_ID.PALETTE_ITEM, children: [_jsx(CubeNodeIcon, { icon: definition.icon, className: "shrink-0 text-[var(--color-text-secondary)]" }), !collapsed && (_jsx("span", { className: "min-w-0 flex-1 truncate", children: definition.label })), !collapsed && definition.beta && (_jsx("span", { className: "shrink-0 rounded-sm bg-[var(--color-accent)] px-1 text-xs font-medium text-[var(--color-text-on-accent)]", children: "BETA" }))] }));
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* The sidebar of node types to add (spec §17.2): the sources, then the
|
|
64
|
+
* transforms in menu order, read from the registry, as the context menu is.
|
|
65
|
+
* Collapsed, it shows icons only; that choice is kept per user.
|
|
66
|
+
*/
|
|
67
|
+
export const CubePalette = observer((props) => {
|
|
68
|
+
const { editorState } = props;
|
|
69
|
+
const collapsed = editorState.isPaletteCollapsed;
|
|
70
|
+
const { registry } = editorState;
|
|
71
|
+
return (_jsxs("div", { className: clsx('flex h-full shrink-0 flex-col border-r border-[var(--color-border-default)] bg-[var(--color-bg-panel)]', collapsed ? 'w-10' : 'w-56'), "data-testid": LEGEND_CUBE_TEST_ID.PALETTE, children: [_jsxs("div", { className: "flex h-8 shrink-0 items-center border-b border-[var(--color-border-default)] bg-[var(--color-bg-panel-header)] px-2", children: [!collapsed && (_jsx("span", { className: "min-w-0 flex-1 truncate text-base font-medium", children: "Add to the query" })), _jsx("button", { className: "flex h-6 w-6 shrink-0 items-center justify-center text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]", title: collapsed ? 'Expand the palette' : 'Collapse the palette', onClick: () => editorState.setPaletteCollapsed(!collapsed), children: collapsed ? _jsx(ChevronRightIcon, {}) : _jsx(ChevronLeftIcon, {}) })] }), _jsxs("div", { className: "flex min-h-0 shrink flex-col overflow-auto py-1", role: "group", "aria-label": "Palette", children: [registry.sources.map((definition) => (_jsx(CubePaletteItem, { editorState: editorState, definition: definition, collapsed: collapsed }, definition.type))), _jsx("div", { className: "mx-2 my-1 shrink-0 border-t border-[var(--color-border-default)]", role: "separator" }), registry.transforms.map((definition) => (_jsx(CubePaletteItem, { editorState: editorState, definition: definition, collapsed: collapsed }, definition.type)))] }), !collapsed && editorState.document.query.isEmpty && (_jsx("div", { className: "shrink-0 px-3 py-2 text-sm text-[var(--color-text-muted)]", children: PALETTE_EMPTY_HINT }))] }));
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=CubePalette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubePalette.js","sourceRoot":"","sources":["../../../src/components/palette/CubePalette.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,i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,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,IAHf,UAAU,CAAC,IAAI,CAIpB,CACH,CAAC,IACE,EACL,CAAC,SAAS,IAAI,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,IAAI,CACnD,cAAK,SAAS,EAAC,2DAA2D,YACvE,kBAAkB,GACf,CACP,IACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
import type { CubeEditorState } from '../../stores/CubeEditorState.js';
|
|
17
|
+
/** The Pure text of what Execute would run, read-only, with Copy */
|
|
18
|
+
export declare const CubeShowPureDialog: ((props: {
|
|
19
|
+
editorState: CubeEditorState;
|
|
20
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=CubeShowPureDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeShowPureDialog.d.ts","sourceRoot":"","sources":["../../../src/components/show-pure/CubeShowPureDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAaH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE,oEAAoE;AACpE,eAAO,MAAM,kBAAkB,WACrB;IAAE,WAAW,EAAE,eAAe,CAAA;CAAE;;CAqEzC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { Dialog, Modal, ModalBody, ModalFooter, ModalFooterButton, ModalHeader, PanelLoadingIndicator, } from '@finos/legend-art';
|
|
18
|
+
import { observer } from 'mobx-react-lite';
|
|
19
|
+
import { CUBE_PENDING_LABEL } from '../../__lib__/LegendCubeLabels.js';
|
|
20
|
+
/** The Pure text of what Execute would run, read-only, with Copy */
|
|
21
|
+
export const CubeShowPureDialog = observer((props) => {
|
|
22
|
+
const { editorState } = props;
|
|
23
|
+
const showPure = editorState.showPure;
|
|
24
|
+
const { applicationStore } = editorState.host;
|
|
25
|
+
const darkMode = !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
|
|
26
|
+
const { text, error } = showPure;
|
|
27
|
+
return (_jsx(Dialog, { open: showPure.isOpen, onClose: () => showPure.close(), children: _jsxs(Modal, { darkMode: darkMode, className: "w-[800px] max-w-full", children: [_jsx(ModalHeader, { children: _jsx("div", { className: "modal__title", children: "Pure query" }) }), _jsx(PanelLoadingIndicator, { isLoading: showPure.isRendering }), _jsx(ModalBody, { children: _jsxs("div", { className: "flex flex-col gap-2", children: [showPure.isRendering && (_jsx("div", { className: "text-base text-[var(--color-text-secondary)]", children: CUBE_PENDING_LABEL.RENDERING_QUERY })), text !== undefined && (_jsx("pre", { className: "max-h-[60vh] overflow-auto whitespace-pre rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] p-2 font-mono text-sm text-[var(--color-text-primary)]", "aria-label": "Pure query", children: text })), error && (_jsx("div", { className: "whitespace-pre-wrap break-words text-base text-[var(--color-status-error)]", role: "alert", children: error.detail }))] }) }), _jsxs(ModalFooter, { children: [_jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, text: "Copy to Clipboard", disabled: text === undefined, onClick: () => {
|
|
28
|
+
if (text !== undefined) {
|
|
29
|
+
applicationStore.clipboardService
|
|
30
|
+
.copyTextToClipboard(text, {
|
|
31
|
+
notifySuccessMessage: 'Pure query copied to the clipboard',
|
|
32
|
+
})
|
|
33
|
+
.catch(applicationStore.alertUnhandledError);
|
|
34
|
+
}
|
|
35
|
+
} }), _jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, type: "secondary", text: "Close", onClick: () => showPure.close() })] })] }) }));
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=CubeShowPureDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeShowPureDialog.js","sourceRoot":"","sources":["../../../src/components/show-pure/CubeShowPureDialog.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,MAAM,EACN,KAAK,EACL,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGvE,oEAAoE;AAC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,GAAG,EAAE;gCACZ,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oCACvB,gBAAgB,CAAC,gBAAgB;yCAC9B,mBAAmB,CAAC,IAAI,EAAE;wCACzB,oBAAoB,EAClB,oCAAoC;qCACvC,CAAC;yCACD,KAAK,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;gCACjD,CAAC;4BACH,CAAC,GACD,EACF,KAAC,iBAAiB,IAChB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,KAAK,EACjB,IAAI,EAAC,WAAW,EAChB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,GAC/B,IACU,IACR,GACD,CACV,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
import type { CubeEditorState } from '../../stores/CubeEditorState.js';
|
|
17
|
+
export declare const CubeSourcePicker: ((props: {
|
|
18
|
+
editorState: CubeEditorState;
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=CubeSourcePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSourcePicker.d.ts","sourceRoot":"","sources":["../../../src/components/source-picker/CubeSourcePicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoBH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AA4CvE,eAAO,MAAM,gBAAgB,WACnB;IAAE,WAAW,EAAE,eAAe,CAAA;CAAE;;CAgOzC,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { clsx, Dialog, Modal, ModalBody, ModalFooter, ModalFooterButton, ModalHeader, PanelLoadingIndicator, } from '@finos/legend-art';
|
|
18
|
+
import { getRelationalDisplayName } from '@finos/legend-cube';
|
|
19
|
+
import { flowResult } from 'mobx';
|
|
20
|
+
import { observer } from 'mobx-react-lite';
|
|
21
|
+
import { useId } from 'react';
|
|
22
|
+
import { CUBE_PENDING_LABEL, CUBE_TABLE_FLAG_LABELS, } from '../../__lib__/LegendCubeLabels.js';
|
|
23
|
+
import { isTableSelectable } from '../../stores/CubeSourcePickerState.js';
|
|
24
|
+
import { CubeButton } from '../CubeButton.js';
|
|
25
|
+
/** One step of the picker: a labelled list of choices, read-only when the cube fixes it */
|
|
26
|
+
const CubePickerStep = ({ label, value, options, disabled, onChange }) => {
|
|
27
|
+
const id = useId();
|
|
28
|
+
return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("label", { className: "w-20 shrink-0 text-base", htmlFor: id, children: label }), _jsxs("select", { id: id, className: "h-7 min-w-0 flex-1 rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] px-1 text-base text-[var(--color-text-primary)] disabled:text-[var(--color-text-secondary)]", value: value ?? '', disabled: Boolean(disabled) || !options.length, onChange: (event) => onChange(event.target.value || undefined), children: [value === undefined && _jsx("option", { value: "", children: "Choose\u2026" }), options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value)))] })] }));
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Adds a table to the cube (PLAN §6.2.7): a minimal dialog, which M3
|
|
32
|
+
* redesigns. The table lands with its schema; the first one fixes the cube's
|
|
33
|
+
* model and runtime.
|
|
34
|
+
*/
|
|
35
|
+
/** The Model option that offers a text box for Pure text */
|
|
36
|
+
const PASTE_MODEL_OPTION = 'paste';
|
|
37
|
+
export const CubeSourcePicker = observer((props) => {
|
|
38
|
+
const { editorState } = props;
|
|
39
|
+
const picker = editorState.sourcePicker;
|
|
40
|
+
const { applicationStore } = editorState.host;
|
|
41
|
+
const darkMode = !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
|
|
42
|
+
const isFixed = picker.fixedContext !== undefined;
|
|
43
|
+
const fixedModelLabel = picker.models.find((model) => JSON.stringify(model.model) ===
|
|
44
|
+
JSON.stringify(picker.fixedContext?.model))?.label ?? "The cube's model";
|
|
45
|
+
const confirm = () => {
|
|
46
|
+
flowResult(picker.confirm()).catch(applicationStore.alertUnhandledError);
|
|
47
|
+
};
|
|
48
|
+
return (_jsx(Dialog, { open: picker.isOpen, onClose: () => picker.close(), children: _jsxs(Modal, { darkMode: darkMode, className: "w-[640px] max-w-full", children: [_jsx(ModalHeader, { children: _jsx("div", { className: "modal__title", children: "Add a table" }) }), _jsx(PanelLoadingIndicator, { isLoading: picker.isLoadingModel || picker.isResolving }), _jsx(ModalBody, { children: _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(CubePickerStep, { label: "Model", value: isFixed
|
|
49
|
+
? 'fixed'
|
|
50
|
+
: picker.isPastingModel
|
|
51
|
+
? PASTE_MODEL_OPTION
|
|
52
|
+
: picker.models.find((model) => model.model === picker.model)?.id, options: isFixed
|
|
53
|
+
? [{ value: 'fixed', label: fixedModelLabel }]
|
|
54
|
+
: [
|
|
55
|
+
...picker.models.map((model) => ({
|
|
56
|
+
value: model.id,
|
|
57
|
+
label: model.label,
|
|
58
|
+
})),
|
|
59
|
+
{
|
|
60
|
+
value: PASTE_MODEL_OPTION,
|
|
61
|
+
label: 'Paste Pure model…',
|
|
62
|
+
},
|
|
63
|
+
], disabled: isFixed, onChange: (id) => {
|
|
64
|
+
if (id === PASTE_MODEL_OPTION) {
|
|
65
|
+
picker.startPastingModel();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const model = picker.models.find((candidate) => candidate.id === id);
|
|
69
|
+
if (model) {
|
|
70
|
+
flowResult(picker.selectModel(model.model)).catch(applicationStore.alertUnhandledError);
|
|
71
|
+
}
|
|
72
|
+
} }), picker.isPastingModel && !isFixed && (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("textarea", { className: "h-40 w-full resize-y rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] p-1 font-mono text-sm text-[var(--color-text-primary)]", "aria-label": "Pure model", placeholder: '###Relational\nDatabase my::Database ( … )\n\n###Runtime\nRuntime my::Runtime { … }', spellCheck: false, value: picker.pastedModelText, onChange: (event) => picker.setPastedModelText(event.target.value) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CubeButton, { disabled: !picker.pastedModelText.trim() || picker.isLoadingModel, onClick: () => {
|
|
73
|
+
flowResult(picker.loadPastedModel()).catch(applicationStore.alertUnhandledError);
|
|
74
|
+
}, children: "Load model" }), _jsx("span", { className: "text-sm text-[var(--color-text-muted)]", children: "The cube keeps the model's text, which counts towards the 1 MiB a cube spec can hold." })] })] })), picker.isLoadingModel && (_jsx("div", { className: "text-base text-[var(--color-text-secondary)]", children: CUBE_PENDING_LABEL.LOADING_MODEL })), _jsx(CubePickerStep, { label: "Database", value: picker.databasePath, options: picker.databases.map((database) => ({
|
|
75
|
+
value: database.path,
|
|
76
|
+
label: database.path,
|
|
77
|
+
})), disabled: picker.fixedDatabasePath !== undefined, onChange: (path) => picker.selectDatabase(path) }), _jsx(CubePickerStep, { label: "Runtime", value: picker.runtimePath, options: picker.runtimes.map((runtime) => ({
|
|
78
|
+
value: runtime.path,
|
|
79
|
+
label: runtime.path,
|
|
80
|
+
})), disabled: picker.fixedContext?.runtime !== undefined, onChange: (path) => picker.selectRuntime(path) }), _jsx(CubePickerStep, { label: "Schema", value: picker.schemaName, options: picker.schemas.map((schema) => ({
|
|
81
|
+
value: schema.name,
|
|
82
|
+
label: getRelationalDisplayName(schema.name),
|
|
83
|
+
})), onChange: (name) => picker.selectSchema(name) }), picker.schemaName !== undefined && (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("input", { className: "h-7 rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] px-1 text-base text-[var(--color-text-primary)]", placeholder: "Search tables", "aria-label": "Search tables", value: picker.tableSearch, onChange: (event) => picker.setTableSearch(event.target.value) }), _jsx("ul", { className: "h-56 overflow-auto rounded-sm border border-[var(--color-border-subtle)]", "aria-label": "Tables", children: picker.tables.map((table) => {
|
|
84
|
+
const selectable = isTableSelectable(table);
|
|
85
|
+
const isPicked = picker.tableName === table.name;
|
|
86
|
+
return (_jsx("li", { children: _jsxs("button", { type: "button", className: clsx('flex w-full items-center gap-2 px-2 py-1 text-left text-base enabled:hover:bg-[var(--color-bg-hover)] disabled:cursor-not-allowed disabled:text-[var(--color-text-disabled)]', { 'bg-[var(--color-bg-selected)]': isPicked }), "aria-pressed": isPicked, disabled: !selectable, onClick: () => picker.selectTable(table.name), children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: getRelationalDisplayName(table.name) }), table.flags.map((flag) => (_jsx("span", { className: "rounded-sm bg-[var(--color-status-warn-bg)] px-1 text-sm text-[var(--color-status-warn)]", title: CUBE_TABLE_FLAG_LABELS[flag].description, children: CUBE_TABLE_FLAG_LABELS[flag].label }, flag))), _jsxs("span", { className: "shrink-0 text-sm text-[var(--color-text-muted)]", children: [table.columnCount, " columns"] })] }) }, table.name));
|
|
87
|
+
}) })] })), picker.isResolving && (_jsx("div", { className: "text-base text-[var(--color-text-secondary)]", children: CUBE_PENDING_LABEL.RESOLVING_SOURCE })), picker.error !== undefined && (_jsx("div", { className: "text-base text-[var(--color-status-error)]", role: "alert", children: picker.error }))] }) }), _jsxs(ModalFooter, { children: [_jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, text: "Add", disabled: !picker.canConfirm, onClick: confirm }), _jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, type: "secondary", text: "Cancel", onClick: () => picker.close() })] })] }) }));
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=CubeSourcePicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSourcePicker.js","sourceRoot":"","sources":["../../../src/components/source-picker/CubeSourcePicker.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,IAAI,EACJ,MAAM,EACN,KAAK,EACL,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,E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ldman 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
|
+
import type { CubeEditorState } from '../../stores/CubeEditorState.js';
|
|
17
|
+
/**
|
|
18
|
+
* Export and Import of the cube's saved spec, as text to copy, download,
|
|
19
|
+
* paste or read from a file (PLAN §10.3; developer tools until M8).
|
|
20
|
+
*/
|
|
21
|
+
export declare const CubeSpecTransferDialog: ((props: {
|
|
22
|
+
editorState: CubeEditorState;
|
|
23
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=CubeSpecTransferDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSpecTransferDialog.d.ts","sourceRoot":"","sources":["../../../src/components/spec-transfer/CubeSpecTransferDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAaH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMvE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,WACzB;IAAE,WAAW,EAAE,eAAe,CAAA;CAAE;;CAsHzC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { Dialog, Modal, ModalBody, ModalFooter, ModalFooterButton, ModalHeader, PanelLoadingIndicator, } from '@finos/legend-art';
|
|
18
|
+
import { flowResult } from 'mobx';
|
|
19
|
+
import { observer } from 'mobx-react-lite';
|
|
20
|
+
import { CUBE_SPEC_TRANSFER_MODE } from '../../stores/CubeSpecTransferState.js';
|
|
21
|
+
const TEXT_AREA_CLASS_NAME = 'h-80 w-full resize-none rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] p-1 font-mono text-sm text-[var(--color-text-primary)]';
|
|
22
|
+
/**
|
|
23
|
+
* Export and Import of the cube's saved spec, as text to copy, download,
|
|
24
|
+
* paste or read from a file (PLAN §10.3; developer tools until M8).
|
|
25
|
+
*/
|
|
26
|
+
export const CubeSpecTransferDialog = observer((props) => {
|
|
27
|
+
const { editorState } = props;
|
|
28
|
+
const transfer = editorState.specTransfer;
|
|
29
|
+
const { applicationStore } = editorState.host;
|
|
30
|
+
const darkMode = !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
|
|
31
|
+
const isExport = transfer.mode === CUBE_SPEC_TRANSFER_MODE.EXPORT;
|
|
32
|
+
return (_jsx(Dialog, { open: transfer.mode !== undefined, onClose: () => transfer.close(), children: _jsxs(Modal, { darkMode: darkMode, className: "w-[720px] max-w-full", children: [_jsx(ModalHeader, { children: _jsx("div", { className: "modal__title", children: isExport ? 'Export spec (dev)' : 'Import spec (dev)' }) }), _jsx(PanelLoadingIndicator, { isLoading: transfer.isReadingFile }), _jsx(ModalBody, { children: _jsxs("div", { className: "flex flex-col gap-2", children: [isExport ? (transfer.exportText !== undefined && (_jsx("textarea", { className: TEXT_AREA_CLASS_NAME, "aria-label": "Cube spec", readOnly: true, value: transfer.exportText }))) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "text-base text-[var(--color-text-secondary)]", children: "Paste a cube spec, or choose a .cube.json file. The spec replaces this cube; Undo brings it back." }), _jsx("input", { className: "text-base", type: "file", accept: ".json,application/json", "aria-label": "Spec file", onChange: (event) => {
|
|
33
|
+
const file = event.target.files?.[0];
|
|
34
|
+
// the same file can be chosen again
|
|
35
|
+
event.target.value = '';
|
|
36
|
+
if (file) {
|
|
37
|
+
flowResult(transfer.readImportFile(file)).catch(applicationStore.alertUnhandledError);
|
|
38
|
+
}
|
|
39
|
+
} }), _jsx("textarea", { className: TEXT_AREA_CLASS_NAME, "aria-label": "Cube spec", placeholder: "Cube spec", spellCheck: false, value: transfer.importText, onChange: (event) => transfer.setImportText(event.target.value) })] })), transfer.error !== undefined && (_jsx("div", { className: "break-words text-base text-[var(--color-status-error)]", role: "alert", children: transfer.error }))] }) }), _jsxs(ModalFooter, { children: [isExport ? (_jsxs(_Fragment, { children: [_jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, text: "Copy", disabled: transfer.exportText === undefined, onClick: () => {
|
|
40
|
+
transfer
|
|
41
|
+
.copyExport()
|
|
42
|
+
.catch(applicationStore.alertUnhandledError);
|
|
43
|
+
} }), _jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, text: "Download", disabled: transfer.exportText === undefined, onClick: () => transfer.downloadExport() })] })) : (_jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, text: "Import", disabled: !transfer.importText.trim() || transfer.isReadingFile, onClick: () => transfer.importSpec() })), _jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, type: "secondary", text: isExport ? 'Close' : 'Cancel', onClick: () => transfer.close() })] })] }) }));
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=CubeSpecTransferDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSpecTransferDialog.js","sourceRoot":"","sources":["../../../src/components/spec-transfer/CubeSpecTransferDialog.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,MAAM,EACN,KAAK,EACL,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,MAAM,oBAAoB,GACxB,kKAAkK,CAAC;AAErK;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAC5C,CAAC,KAAuC,EAAE,EAAE;IAC1C,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC9B,MAAM,QAAQ,GAAG,WAAW,CAAC,YAAY,CAAC;IAC1C,MAAM,EAAE,gBAAgB,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC;IAC9C,MAAM,QAAQ,GACZ,CAAC,gBAAgB,CAAC,aAAa,CAAC,mCAAmC,CAAC;IACtE,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,KAAK,uBAAuB,CAAC,MAAM,CAAC;IAElE,OAAO,CACL,KAAC,MAAM,IACL,IAAI,EAAE,QAAQ,CAAC,IAAI,KAAK,SAAS,EACjC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,YAE/B,MAAC,KAAK,IAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAC,sBAAsB,aACzD,KAAC,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F,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
import type { IR, ModelContext, Schema } from '@finos/legend-cube';
|
|
17
|
+
/** A query node's id */
|
|
18
|
+
export type NodeId = string;
|
|
19
|
+
/** A table's Database element path, schema name and table name, names as stored (quotes included) */
|
|
20
|
+
export type AccessorPath = readonly [
|
|
21
|
+
database: string,
|
|
22
|
+
schema: string,
|
|
23
|
+
table: string
|
|
24
|
+
];
|
|
25
|
+
/** Why a table can't be picked as it is, read from its definition (PLAN §6.2.6) */
|
|
26
|
+
export declare enum CubeTableFlag {
|
|
27
|
+
/** a binary column: the engine can't type the table */
|
|
28
|
+
UNAVAILABLE = "unavailable",
|
|
29
|
+
/** a CHAR(n) column: typed with a length of 1 */
|
|
30
|
+
LENGTH_UNKNOWN = "lengthUnknown",
|
|
31
|
+
/** an OTHER or ARRAY column: typed as a bare String */
|
|
32
|
+
TYPE_UNKNOWN = "typeUnknown"
|
|
33
|
+
}
|
|
34
|
+
export interface CubeOutlineTable {
|
|
35
|
+
/** As stored, quotes included */
|
|
36
|
+
readonly name: string;
|
|
37
|
+
/** Views are typed as text of length 0, so the picker hides them in v1 */
|
|
38
|
+
readonly isView: boolean;
|
|
39
|
+
readonly columnCount: number;
|
|
40
|
+
readonly flags: readonly CubeTableFlag[];
|
|
41
|
+
/**
|
|
42
|
+
* The columns typed as a bare String because Cube can't read their type
|
|
43
|
+
* (OTHER or ARRAY), unquoted as in the table's schema
|
|
44
|
+
*/
|
|
45
|
+
readonly untypedColumns: readonly string[];
|
|
46
|
+
}
|
|
47
|
+
export interface CubeOutlineSchema {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly tables: readonly CubeOutlineTable[];
|
|
50
|
+
}
|
|
51
|
+
export interface CubeOutlineDatabase {
|
|
52
|
+
readonly path: string;
|
|
53
|
+
readonly schemas: readonly CubeOutlineSchema[];
|
|
54
|
+
}
|
|
55
|
+
export interface CubeOutlineRuntime {
|
|
56
|
+
readonly path: string;
|
|
57
|
+
/** The stores its connections are keyed by, exactly; includes are not followed (PLAN §6.2.5) */
|
|
58
|
+
readonly storePaths: readonly string[];
|
|
59
|
+
}
|
|
60
|
+
/** What a model offers the source picker: its databases and runtimes, as plain data */
|
|
61
|
+
export interface CubeModelOutline {
|
|
62
|
+
readonly databases: readonly CubeOutlineDatabase[];
|
|
63
|
+
readonly runtimes: readonly CubeOutlineRuntime[];
|
|
64
|
+
}
|
|
65
|
+
export declare enum CubeEngineErrorKind {
|
|
66
|
+
/** the model or a lambda doesn't compile, or a table can't be typed */
|
|
67
|
+
COMPILE = "compile",
|
|
68
|
+
/** the query failed while running, or its result can't be read */
|
|
69
|
+
EXECUTION = "execution",
|
|
70
|
+
/** the cube's model is of a kind this version can't run */
|
|
71
|
+
UNSUPPORTED_MODEL = "unsupportedModel",
|
|
72
|
+
/** the engine couldn't be reached, or answered with no readable error */
|
|
73
|
+
NETWORK = "network"
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* An engine failure, placed on the node it concerns: the node a stamp in the
|
|
77
|
+
* error points to, else the source being typed or the node being run.
|
|
78
|
+
*/
|
|
79
|
+
export declare class CubeEngineError extends Error {
|
|
80
|
+
readonly kind: CubeEngineErrorKind;
|
|
81
|
+
readonly nodeId: NodeId | undefined;
|
|
82
|
+
/** The part of the node the error points to (an `EmitRole`), when it is located */
|
|
83
|
+
readonly role: string | undefined;
|
|
84
|
+
/** The first line of the engine's message, shown on the node */
|
|
85
|
+
readonly firstLine: string;
|
|
86
|
+
/** The engine's whole message, without its Java trace, shown in the panel */
|
|
87
|
+
readonly detail: string;
|
|
88
|
+
constructor(kind: CubeEngineErrorKind, detail: string, nodeId?: NodeId, role?: string);
|
|
89
|
+
}
|
|
90
|
+
/** A value of a result cell: Integer and Decimal values as their exact text, Float values as numbers (PLAN §8.7) */
|
|
91
|
+
export type CubeResultValue = string | number | boolean | null;
|
|
92
|
+
export interface CubeResult {
|
|
93
|
+
/** Column names, in order; rows match them by position */
|
|
94
|
+
readonly columns: readonly string[];
|
|
95
|
+
/** As many rows as the engine sent, up to the row limit + 1 */
|
|
96
|
+
readonly rows: readonly (readonly CubeResultValue[])[];
|
|
97
|
+
/** The SQL statements the engine ran */
|
|
98
|
+
readonly sql: readonly string[];
|
|
99
|
+
readonly durationMs: number;
|
|
100
|
+
}
|
|
101
|
+
export interface CubeEngine {
|
|
102
|
+
/** The databases and runtimes of a model, parsed once */
|
|
103
|
+
loadModel(model: ModelContext): Promise<CubeModelOutline>;
|
|
104
|
+
/** The schema of each table, in one engine call: one entry per key, failures included */
|
|
105
|
+
resolveSchemas(model: ModelContext, accessors: ReadonlyMap<NodeId, AccessorPath>): Promise<Map<NodeId, Schema | CubeEngineError>>;
|
|
106
|
+
/** The schema of each lambda, in one engine call: one entry per key, failures included */
|
|
107
|
+
typeLambdas(model: ModelContext, lambdas: ReadonlyMap<NodeId, IR>): Promise<Map<NodeId, Schema | CubeEngineError>>;
|
|
108
|
+
/** Runs an execution lambda; rejects with a `CubeEngineError` */
|
|
109
|
+
execute(model: ModelContext, lambda: IR, options?: {
|
|
110
|
+
abortController?: AbortController | undefined;
|
|
111
|
+
}): Promise<CubeResult>;
|
|
112
|
+
/** The Pure text of a lambda, for display only: never parsed back */
|
|
113
|
+
renderPure(lambda: IR): Promise<string>;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=CubeEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeEngine.d.ts","sourceRoot":"","sources":["../../src/graph-manager/CubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAMnE,wBAAwB;AACxB,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B,qGAAqG;AACrG,MAAM,MAAM,YAAY,GAAG,SAAS;IAClC,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,mFAAmF;AACnF,oBAAY,aAAa;IACvB,uDAAuD;IACvD,WAAW,gBAAgB;IAC3B,iDAAiD;IACjD,cAAc,kBAAkB;IAChC,uDAAuD;IACvD,YAAY,gBAAgB;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAChD;AAED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