@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,128 @@
|
|
|
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
|
+
/** A relational connection of a runtime, for the operations some databases take another way (PLAN §11.4) */
|
|
56
|
+
export interface CubeOutlineConnection {
|
|
57
|
+
/** The store it is keyed by */
|
|
58
|
+
readonly storePath: string;
|
|
59
|
+
/** The engine's name for its database type, e.g. `H2` or `SqlServer` */
|
|
60
|
+
readonly databaseType: string;
|
|
61
|
+
}
|
|
62
|
+
export interface CubeOutlineRuntime {
|
|
63
|
+
readonly path: string;
|
|
64
|
+
/** The stores its connections are keyed by, exactly; includes are not followed (PLAN §6.2.5) */
|
|
65
|
+
readonly storePaths: readonly string[];
|
|
66
|
+
/**
|
|
67
|
+
* Its relational connections that name a database type, a list rather
|
|
68
|
+
* than a record keyed by a store path from the model; optional, as an
|
|
69
|
+
* outline from before M2 has none
|
|
70
|
+
*/
|
|
71
|
+
readonly connections?: readonly CubeOutlineConnection[];
|
|
72
|
+
}
|
|
73
|
+
/** What a model offers the source picker: its databases and runtimes, as plain data */
|
|
74
|
+
export interface CubeModelOutline {
|
|
75
|
+
readonly databases: readonly CubeOutlineDatabase[];
|
|
76
|
+
readonly runtimes: readonly CubeOutlineRuntime[];
|
|
77
|
+
}
|
|
78
|
+
export declare enum CubeEngineErrorKind {
|
|
79
|
+
/** the model or a lambda doesn't compile, or a table can't be typed */
|
|
80
|
+
COMPILE = "compile",
|
|
81
|
+
/** the query failed while running, or its result can't be read */
|
|
82
|
+
EXECUTION = "execution",
|
|
83
|
+
/** the cube's model is of a kind this version can't run */
|
|
84
|
+
UNSUPPORTED_MODEL = "unsupportedModel",
|
|
85
|
+
/** the engine couldn't be reached, or answered with no readable error */
|
|
86
|
+
NETWORK = "network"
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* An engine failure, placed on the node it concerns: the node a stamp in the
|
|
90
|
+
* error points to, else the source being typed or the node being run.
|
|
91
|
+
*/
|
|
92
|
+
export declare class CubeEngineError extends Error {
|
|
93
|
+
readonly kind: CubeEngineErrorKind;
|
|
94
|
+
readonly nodeId: NodeId | undefined;
|
|
95
|
+
/** The part of the node the error points to (an `EmitRole`), when it is located */
|
|
96
|
+
readonly role: string | undefined;
|
|
97
|
+
/** The first line of the engine's message, shown on the node */
|
|
98
|
+
readonly firstLine: string;
|
|
99
|
+
/** The engine's whole message, without its Java trace, shown in the panel */
|
|
100
|
+
readonly detail: string;
|
|
101
|
+
constructor(kind: CubeEngineErrorKind, detail: string, nodeId?: NodeId, role?: string);
|
|
102
|
+
}
|
|
103
|
+
/** A value of a result cell: Integer and Decimal values as their exact text, Float values as numbers (PLAN §8.7) */
|
|
104
|
+
export type CubeResultValue = string | number | boolean | null;
|
|
105
|
+
export interface CubeResult {
|
|
106
|
+
/** Column names, in order; rows match them by position */
|
|
107
|
+
readonly columns: readonly string[];
|
|
108
|
+
/** As many rows as the engine sent, up to the row limit + 1 */
|
|
109
|
+
readonly rows: readonly (readonly CubeResultValue[])[];
|
|
110
|
+
/** The SQL statements the engine ran */
|
|
111
|
+
readonly sql: readonly string[];
|
|
112
|
+
readonly durationMs: number;
|
|
113
|
+
}
|
|
114
|
+
export interface CubeEngine {
|
|
115
|
+
/** The databases and runtimes of a model, parsed once */
|
|
116
|
+
loadModel(model: ModelContext): Promise<CubeModelOutline>;
|
|
117
|
+
/** The schema of each table, in one engine call: one entry per key, failures included */
|
|
118
|
+
resolveSchemas(model: ModelContext, accessors: ReadonlyMap<NodeId, AccessorPath>): Promise<Map<NodeId, Schema | CubeEngineError>>;
|
|
119
|
+
/** The schema of each lambda, in one engine call: one entry per key, failures included */
|
|
120
|
+
typeLambdas(model: ModelContext, lambdas: ReadonlyMap<NodeId, IR>): Promise<Map<NodeId, Schema | CubeEngineError>>;
|
|
121
|
+
/** Runs an execution lambda; rejects with a `CubeEngineError` */
|
|
122
|
+
execute(model: ModelContext, lambda: IR, options?: {
|
|
123
|
+
abortController?: AbortController | undefined;
|
|
124
|
+
}): Promise<CubeResult>;
|
|
125
|
+
/** The Pure text of a lambda, for display only: never parsed back */
|
|
126
|
+
renderPure(lambda: IR): Promise<string>;
|
|
127
|
+
}
|
|
128
|
+
//# 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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AC;CACzC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
/** Why a table can't be picked as it is, read from its definition (PLAN §6.2.6) */
|
|
17
|
+
export var CubeTableFlag;
|
|
18
|
+
(function (CubeTableFlag) {
|
|
19
|
+
/** a binary column: the engine can't type the table */
|
|
20
|
+
CubeTableFlag["UNAVAILABLE"] = "unavailable";
|
|
21
|
+
/** a CHAR(n) column: typed with a length of 1 */
|
|
22
|
+
CubeTableFlag["LENGTH_UNKNOWN"] = "lengthUnknown";
|
|
23
|
+
/** an OTHER or ARRAY column: typed as a bare String */
|
|
24
|
+
CubeTableFlag["TYPE_UNKNOWN"] = "typeUnknown";
|
|
25
|
+
})(CubeTableFlag || (CubeTableFlag = {}));
|
|
26
|
+
export var CubeEngineErrorKind;
|
|
27
|
+
(function (CubeEngineErrorKind) {
|
|
28
|
+
/** the model or a lambda doesn't compile, or a table can't be typed */
|
|
29
|
+
CubeEngineErrorKind["COMPILE"] = "compile";
|
|
30
|
+
/** the query failed while running, or its result can't be read */
|
|
31
|
+
CubeEngineErrorKind["EXECUTION"] = "execution";
|
|
32
|
+
/** the cube's model is of a kind this version can't run */
|
|
33
|
+
CubeEngineErrorKind["UNSUPPORTED_MODEL"] = "unsupportedModel";
|
|
34
|
+
/** the engine couldn't be reached, or answered with no readable error */
|
|
35
|
+
CubeEngineErrorKind["NETWORK"] = "network";
|
|
36
|
+
})(CubeEngineErrorKind || (CubeEngineErrorKind = {}));
|
|
37
|
+
/**
|
|
38
|
+
* An engine failure, placed on the node it concerns: the node a stamp in the
|
|
39
|
+
* error points to, else the source being typed or the node being run.
|
|
40
|
+
*/
|
|
41
|
+
export class CubeEngineError extends Error {
|
|
42
|
+
kind;
|
|
43
|
+
nodeId;
|
|
44
|
+
/** The part of the node the error points to (an `EmitRole`), when it is located */
|
|
45
|
+
role;
|
|
46
|
+
/** The first line of the engine's message, shown on the node */
|
|
47
|
+
firstLine;
|
|
48
|
+
/** The engine's whole message, without its Java trace, shown in the panel */
|
|
49
|
+
detail;
|
|
50
|
+
constructor(kind, detail, nodeId, role) {
|
|
51
|
+
const firstLine = detail.split('\n', 1)[0]?.trim() ?? '';
|
|
52
|
+
super(firstLine);
|
|
53
|
+
this.name = 'CubeEngineError';
|
|
54
|
+
this.kind = kind;
|
|
55
|
+
this.detail = detail;
|
|
56
|
+
this.firstLine = firstLine;
|
|
57
|
+
this.nodeId = nodeId;
|
|
58
|
+
this.role = role;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=CubeEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeEngine.js","sourceRoot":"","sources":["../../src/graph-manager/CubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAkBH,mFAAmF;AACnF,MAAM,CAAN,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,uDAAuD;IACvD,4CAA2B,CAAA;IAC3B,iDAAiD;IACjD,iDAAgC,CAAA;IAChC,uDAAuD;IACvD,6CAA4B,CAAA;AAC9B,CAAC,EAPW,aAAa,KAAb,aAAa,QAOxB;AAoDD,MAAM,CAAN,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,uEAAuE;IACvE,0CAAmB,CAAA;IACnB,kEAAkE;IAClE,8CAAuB,CAAA;IACvB,2DAA2D;IAC3D,6DAAsC,CAAA;IACtC,yEAAyE;IACzE,0CAAmB,CAAA;AACrB,CAAC,EATW,mBAAmB,KAAnB,mBAAmB,QAS9B;AAED;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC/B,IAAI,CAAsB;IAC1B,MAAM,CAAqB;IACpC,mFAAmF;IAC1E,IAAI,CAAqB;IAClC,gEAAgE;IACvD,SAAS,CAAS;IAC3B,6EAA6E;IACpE,MAAM,CAAS;IAExB,YACE,IAAyB,EACzB,MAAc,EACd,MAAe,EACf,IAAa;QAEb,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACzD,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { CubeModelOutline, CubeOutlineRuntime } from './CubeEngine.js';
|
|
17
|
+
/**
|
|
18
|
+
* The runtimes a query on the database can run with: those with a connection
|
|
19
|
+
* keyed by exactly that database. The engine matches stores by exact element
|
|
20
|
+
* and silently falls back to the first connection otherwise, so a runtime
|
|
21
|
+
* that only reaches the database through an include is not offered (PLAN
|
|
22
|
+
* §6.2.5).
|
|
23
|
+
*/
|
|
24
|
+
export declare const getRuntimesForDatabase: (outline: CubeModelOutline, databasePath: string) => CubeOutlineRuntime[];
|
|
25
|
+
/**
|
|
26
|
+
* The database type a query on these databases runs on with the runtime, for
|
|
27
|
+
* the operations some databases take another way (PLAN §11.4): the type of
|
|
28
|
+
* the runtime's connections to them. None when the runtime isn't in the
|
|
29
|
+
* outline, a database has no typed connection, or the databases' types
|
|
30
|
+
* differ: the native forms are written then.
|
|
31
|
+
*/
|
|
32
|
+
export declare const getDatabaseType: (outline: CubeModelOutline, runtimePath: string, databasePaths: readonly string[]) => string | undefined;
|
|
33
|
+
//# sourceMappingURL=CubeModelOutlineHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeModelOutlineHelper.d.ts","sourceRoot":"","sources":["../../src/graph-manager/CubeModelOutlineHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE5E;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,gBAAgB,EACzB,cAAc,MAAM,KACnB,kBAAkB,EAGlB,CAAC;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAC1B,SAAS,gBAAgB,EACzB,aAAa,MAAM,EACnB,eAAe,SAAS,MAAM,EAAE,KAC/B,MAAM,GAAG,SAaX,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
* The runtimes a query on the database can run with: those with a connection
|
|
18
|
+
* keyed by exactly that database. The engine matches stores by exact element
|
|
19
|
+
* and silently falls back to the first connection otherwise, so a runtime
|
|
20
|
+
* that only reaches the database through an include is not offered (PLAN
|
|
21
|
+
* §6.2.5).
|
|
22
|
+
*/
|
|
23
|
+
export const getRuntimesForDatabase = (outline, databasePath) => outline.runtimes.filter((runtime) => runtime.storePaths.includes(databasePath));
|
|
24
|
+
/**
|
|
25
|
+
* The database type a query on these databases runs on with the runtime, for
|
|
26
|
+
* the operations some databases take another way (PLAN §11.4): the type of
|
|
27
|
+
* the runtime's connections to them. None when the runtime isn't in the
|
|
28
|
+
* outline, a database has no typed connection, or the databases' types
|
|
29
|
+
* differ: the native forms are written then.
|
|
30
|
+
*/
|
|
31
|
+
export const getDatabaseType = (outline, runtimePath, databasePaths) => {
|
|
32
|
+
const runtime = outline.runtimes.find(({ path }) => path === runtimePath);
|
|
33
|
+
const types = new Set();
|
|
34
|
+
for (const databasePath of new Set(databasePaths)) {
|
|
35
|
+
const databaseTypes = (runtime?.connections ?? [])
|
|
36
|
+
.filter(({ storePath }) => storePath === databasePath)
|
|
37
|
+
.map(({ databaseType }) => databaseType);
|
|
38
|
+
if (!databaseTypes.length) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
databaseTypes.forEach((databaseType) => types.add(databaseType));
|
|
42
|
+
}
|
|
43
|
+
return types.size === 1 ? [...types][0] : undefined;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=CubeModelOutlineHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeModelOutlineHelper.js","sourceRoot":"","sources":["../../src/graph-manager/CubeModelOutlineHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAyB,EACzB,YAAoB,EACE,EAAE,CACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAClC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAC1C,CAAC;AAEJ;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,OAAyB,EACzB,WAAmB,EACnB,aAAgC,EACZ,EAAE;IACtB,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;IAC1E,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,YAAY,IAAI,IAAI,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;QAClD,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,WAAW,IAAI,EAAE,CAAC;aAC/C,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,KAAK,YAAY,CAAC;aACrD,GAAG,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;YAC1B,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,aAAa,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { TracerService } from '@finos/legend-shared';
|
|
17
|
+
import type { CubeEngine } from '../../CubeEngine.js';
|
|
18
|
+
import { type V1_CubeEngineConfig } from './v1/V1_LegendCubeEngine.js';
|
|
19
|
+
/** The engine client's configuration, as the host gives it (e.g. Legend Query's engine server URL) */
|
|
20
|
+
export type CubeEngineConfig = V1_CubeEngineConfig;
|
|
21
|
+
/**
|
|
22
|
+
* The Cube engine of a host (PLAN §3.2): the only place that builds the
|
|
23
|
+
* Legend implementation, so hosts never name a V1_* symbol
|
|
24
|
+
*/
|
|
25
|
+
export declare const buildCubeEngine: (config: CubeEngineConfig, tracerService: TracerService) => CubeEngine;
|
|
26
|
+
//# sourceMappingURL=CubeEngineBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeEngineBuilder.d.ts","sourceRoot":"","sources":["../../../../src/graph-manager/protocol/pure/CubeEngineBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,6BAA6B,CAAC;AAErC,sGAAsG;AACtG,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,gBAAgB,EACxB,eAAe,aAAa,KAC3B,UAA4D,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 { V1_LegendCubeEngine, } from './v1/V1_LegendCubeEngine.js';
|
|
17
|
+
/**
|
|
18
|
+
* The Cube engine of a host (PLAN §3.2): the only place that builds the
|
|
19
|
+
* Legend implementation, so hosts never name a V1_* symbol
|
|
20
|
+
*/
|
|
21
|
+
export const buildCubeEngine = (config, tracerService) => new V1_LegendCubeEngine(config, tracerService);
|
|
22
|
+
//# sourceMappingURL=CubeEngineBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeEngineBuilder.js","sourceRoot":"","sources":["../../../../src/graph-manager/protocol/pure/CubeEngineBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAEL,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAKrC;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,MAAwB,EACxB,aAA4B,EAChB,EAAE,CAAC,IAAI,mBAAmB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { CubeEngineError, CubeEngineErrorKind, type NodeId } from '../../../CubeEngine.js';
|
|
17
|
+
/**
|
|
18
|
+
* The error of an engine payload (a failed call's, or a batch key's), placed
|
|
19
|
+
* on the stamped node, or else on the fallback node. Its Java trace is dropped.
|
|
20
|
+
*/
|
|
21
|
+
export declare const V1_buildCubeEngineError: (payload: unknown, fallbackNodeId: NodeId | undefined, kind: CubeEngineErrorKind) => CubeEngineError | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The error of a failed engine call: the engine's own message when it sent
|
|
24
|
+
* one, else a network error
|
|
25
|
+
*/
|
|
26
|
+
export declare const V1_toCubeEngineError: (error: unknown, fallbackNodeId: NodeId | undefined, kind: CubeEngineErrorKind) => CubeEngineError;
|
|
27
|
+
//# sourceMappingURL=V1_CubeEngineErrors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_CubeEngineErrors.d.ts","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,KAAK,MAAM,EACZ,MAAM,wBAAwB,CAAC;AAgChC;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,SAAS,OAAO,EAChB,gBAAgB,MAAM,GAAG,SAAS,EAClC,MAAM,mBAAmB,KACxB,eAAe,GAAG,SAcpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,OAAO,EACd,gBAAgB,MAAM,GAAG,SAAS,EAClC,MAAM,mBAAmB,KACxB,eAuBF,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 { NetworkClientError } from '@finos/legend-shared';
|
|
17
|
+
import { CubeEngineError, CubeEngineErrorKind, } from '../../../CubeEngine.js';
|
|
18
|
+
import { V1_parseCubeSourceId } from './V1_CubeLambdaSerializer.js';
|
|
19
|
+
// Engine errors → `CubeEngineError`s on canvas nodes (PLAN §8.7). A compile
|
|
20
|
+
// error echoes the stamp of the innermost failing protocol node, so it goes on
|
|
21
|
+
// that node; plan-time, database and network errors carry no stamp, so they
|
|
22
|
+
// go on the node being typed or run.
|
|
23
|
+
const COMPILATION_ERROR_TYPES = new Set(['COMPILATION', 'PARSER']);
|
|
24
|
+
/** The engine's error payload: `{message, errorType?, sourceInformation?, trace?}` */
|
|
25
|
+
const readPayload = (payload) => {
|
|
26
|
+
if (!payload || typeof payload !== 'object') {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
const { message, errorType, sourceInformation } = payload;
|
|
30
|
+
if (typeof message !== 'string' || !message.trim()) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
const sourceId = sourceInformation && typeof sourceInformation === 'object'
|
|
34
|
+
? sourceInformation.sourceId
|
|
35
|
+
: undefined;
|
|
36
|
+
return {
|
|
37
|
+
message,
|
|
38
|
+
...(typeof errorType === 'string' ? { errorType } : {}),
|
|
39
|
+
...(typeof sourceId === 'string' ? { sourceId } : {}),
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The error of an engine payload (a failed call's, or a batch key's), placed
|
|
44
|
+
* on the stamped node, or else on the fallback node. Its Java trace is dropped.
|
|
45
|
+
*/
|
|
46
|
+
export const V1_buildCubeEngineError = (payload, fallbackNodeId, kind) => {
|
|
47
|
+
const read = readPayload(payload);
|
|
48
|
+
if (!read) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
const origin = V1_parseCubeSourceId(read.sourceId);
|
|
52
|
+
return new CubeEngineError(read.errorType && COMPILATION_ERROR_TYPES.has(read.errorType)
|
|
53
|
+
? CubeEngineErrorKind.COMPILE
|
|
54
|
+
: kind, read.message, origin?.nodeId ?? fallbackNodeId, origin?.role);
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* The error of a failed engine call: the engine's own message when it sent
|
|
58
|
+
* one, else a network error
|
|
59
|
+
*/
|
|
60
|
+
export const V1_toCubeEngineError = (error, fallbackNodeId, kind) => {
|
|
61
|
+
if (error instanceof CubeEngineError) {
|
|
62
|
+
return error.nodeId !== undefined || fallbackNodeId === undefined
|
|
63
|
+
? error
|
|
64
|
+
: new CubeEngineError(error.kind, error.detail, fallbackNodeId);
|
|
65
|
+
}
|
|
66
|
+
if (error instanceof NetworkClientError) {
|
|
67
|
+
const fromPayload = V1_buildCubeEngineError(error.payload, fallbackNodeId, kind);
|
|
68
|
+
if (fromPayload) {
|
|
69
|
+
return fromPayload;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return new CubeEngineError(CubeEngineErrorKind.NETWORK, error instanceof Error && error.message
|
|
73
|
+
? error.message
|
|
74
|
+
: `The engine couldn't be reached`, fallbackNodeId);
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=V1_CubeEngineErrors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_CubeEngineErrors.js","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAoB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,GAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,4EAA4E;AAC5E,+EAA+E;AAC/E,4EAA4E;AAC5E,qCAAqC;AAErC,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;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CAAC,IAAI,EACR,IAAI,CAAC,OAAO,EACZ,MAAM,EAAE,MAAM,IAAI,cAAc,EAChC,MAAM,EAAE,IAAI,CACb,CAAC;AACJ,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,KAAc,EACd,cAAkC,EAClC,IAAyB,EACR,EAAE;IACnB,IAAI,KAAK,YAAY,eAAe,EAAE,CAAC;QACrC,OAAO,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,cAAc,KAAK,SAAS;YAC/D,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,KAAK,YAAY,kBAAkB,EAAE,CAAC;QACxC,MAAM,WAAW,GAAG,uBAAuB,CACzC,KAAK,CAAC,OAAO,EACb,cAAc,EACd,IAAI,CACL,CAAC;QACF,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,WAAW,CAAC;QACrB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,eAAe,CACxB,mBAAmB,CAAC,OAAO,EAC3B,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO;QACrC,CAAC,CAAC,KAAK,CAAC,OAAO;QACf,CAAC,CAAC,gCAAgC,EACpC,cAAc,CACf,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { CubeResultValue } from '../../../CubeEngine.js';
|
|
17
|
+
export interface V1_CubeExecutionResult {
|
|
18
|
+
readonly columns: readonly string[];
|
|
19
|
+
readonly rows: readonly (readonly CubeResultValue[])[];
|
|
20
|
+
readonly sql: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
/** Thrown when the body can't be read, e.g. a stack trace streamed into a 200 */
|
|
23
|
+
export declare class V1_CubeUnreadableResultError extends Error {
|
|
24
|
+
}
|
|
25
|
+
/** The columns, rows and SQL of an execution response's text */
|
|
26
|
+
export declare const V1_readCubeExecutionResult: (text: string) => V1_CubeExecutionResult;
|
|
27
|
+
//# sourceMappingURL=V1_CubeExecutionResultReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_CubeExecutionResultReader.d.ts","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAW9D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,eAAe,EAAE,CAAC,EAAE,CAAC;IACvD,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AAED,iFAAiF;AACjF,qBAAa,4BAA6B,SAAQ,KAAK;CAAG;AA8B1D,gEAAgE;AAChE,eAAO,MAAM,0BAA0B,GACrC,MAAM,MAAM,KACX,sBA6CF,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
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 { resolveCubeType, TypeFamily } from '@finos/legend-cube';
|
|
17
|
+
import { parseLosslessJSON } from '@finos/legend-shared';
|
|
18
|
+
// An execution response (DEFAULT format, relation result) read losslessly
|
|
19
|
+
// (PLAN §8.7). Each column's values keep one JS type, decided by the type the
|
|
20
|
+
// result builder gives it: Float values are numbers; any other number, an
|
|
21
|
+
// Integer or Decimal value above all, is its exact text ("9007199254740993",
|
|
22
|
+
// "12.30"). Nothing is inferred from the kind of JSON token, since a Float
|
|
23
|
+
// column may hold 5124 and a String column 32.38.
|
|
24
|
+
const RELATIONAL_ACTIVITY_TYPE = 'relational';
|
|
25
|
+
/** Thrown when the body can't be read, e.g. a stack trace streamed into a 200 */
|
|
26
|
+
export class V1_CubeUnreadableResultError extends Error {
|
|
27
|
+
}
|
|
28
|
+
const isLosslessNumber = (value) => typeof value === 'object' &&
|
|
29
|
+
value !== null &&
|
|
30
|
+
value.isLosslessNumber === true;
|
|
31
|
+
const asObject = (value) => value && typeof value === 'object' && !Array.isArray(value)
|
|
32
|
+
? value
|
|
33
|
+
: {};
|
|
34
|
+
const readCell = (value, asNumber) => {
|
|
35
|
+
if (isLosslessNumber(value)) {
|
|
36
|
+
return asNumber ? Number(value.value) : value.value;
|
|
37
|
+
}
|
|
38
|
+
if (value === null ||
|
|
39
|
+
typeof value === 'string' ||
|
|
40
|
+
typeof value === 'boolean') {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
throw new V1_CubeUnreadableResultError(`A result value is not a scalar: ${JSON.stringify(value)}`);
|
|
44
|
+
};
|
|
45
|
+
/** The columns, rows and SQL of an execution response's text */
|
|
46
|
+
export const V1_readCubeExecutionResult = (text) => {
|
|
47
|
+
let json;
|
|
48
|
+
try {
|
|
49
|
+
json = asObject(parseLosslessJSON(text));
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
throw new V1_CubeUnreadableResultError(`The engine's response can't be read: ${error.message}`);
|
|
53
|
+
}
|
|
54
|
+
const result = asObject(json.result);
|
|
55
|
+
if (!Array.isArray(result.columns) || !Array.isArray(result.rows)) {
|
|
56
|
+
throw new V1_CubeUnreadableResultError(`The engine's response has no relation result`);
|
|
57
|
+
}
|
|
58
|
+
const columns = result.columns.map((name) => String(name));
|
|
59
|
+
const builderTypes = new Map((Array.isArray(asObject(json.builder).columns)
|
|
60
|
+
? asObject(json.builder).columns
|
|
61
|
+
: []).map((column) => [
|
|
62
|
+
String(asObject(column).name),
|
|
63
|
+
String(asObject(column).type ?? ''),
|
|
64
|
+
]));
|
|
65
|
+
const asNumber = columns.map((name) => {
|
|
66
|
+
const type = builderTypes.get(name);
|
|
67
|
+
return type ? resolveCubeType(type).family === TypeFamily.FLOAT : false;
|
|
68
|
+
});
|
|
69
|
+
const rows = result.rows.map((row) => {
|
|
70
|
+
const values = asObject(row).values;
|
|
71
|
+
if (!Array.isArray(values) || values.length !== columns.length) {
|
|
72
|
+
throw new V1_CubeUnreadableResultError(`A result row doesn't have one value per column`);
|
|
73
|
+
}
|
|
74
|
+
return values.map((value, index) => readCell(value, asNumber[index] ?? false));
|
|
75
|
+
});
|
|
76
|
+
const sql = (Array.isArray(json.activities) ? json.activities : [])
|
|
77
|
+
.map(asObject)
|
|
78
|
+
.filter((activity) => activity._type === RELATIONAL_ACTIVITY_TYPE)
|
|
79
|
+
.map((activity) => String(activity.sql));
|
|
80
|
+
return { columns, rows, sql };
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=V1_CubeExecutionResultReader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_CubeExecutionResultReader.js","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAoB,MAAM,sBAAsB,CAAC;AAG3E,0EAA0E;AAC1E,8EAA8E;AAC9E,0EAA0E;AAC1E,6EAA6E;AAC7E,2EAA2E;AAC3E,kDAAkD;AAElD,MAAM,wBAAwB,GAAG,YAAY,CAAC;AAQ9C,iFAAiF;AACjF,MAAM,OAAO,4BAA6B,SAAQ,KAAK;CAAG;AAE1D,MAAM,gBAAgB,GAAG,CACvB,KAAc,EACsC,EAAE,CACtD,OAAO,KAAK,KAAK,QAAQ;IACzB,KAAK,KAAK,IAAI;IACb,KAAwC,CAAC,gBAAgB,KAAK,IAAI,CAAC;AAEtE,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAe,EAAE,CAC/C,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;IACzD,CAAC,CAAE,KAAqB;IACxB,CAAC,CAAC,EAAE,CAAC;AAET,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,QAAiB,EAAmB,EAAE;IACtE,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;IACtD,CAAC;IACD,IACE,KAAK,KAAK,IAAI;QACd,OAAO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E,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AAChC,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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, Origin } from '@finos/legend-cube';
|
|
17
|
+
import { type PlainObject } from '@finos/legend-shared';
|
|
18
|
+
/** The prefix of the source ids Cube stamps, `cube:<nodeId>:<role>` */
|
|
19
|
+
export declare const V1_CUBE_SOURCE_ID_PREFIX = "cube:";
|
|
20
|
+
/** The source id of an origin */
|
|
21
|
+
export declare const V1_buildCubeSourceId: (origin: Origin) => string;
|
|
22
|
+
/**
|
|
23
|
+
* The origin a source id names, or none when Cube didn't stamp it. A role
|
|
24
|
+
* never contains `:`, so a node id that does still reads back whole.
|
|
25
|
+
*/
|
|
26
|
+
export declare const V1_parseCubeSourceId: (sourceId: string | undefined) => Origin | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The protocol JSON of a lambda Cube emitted (a typing or an execution
|
|
29
|
+
* lambda), with lossless numbers: write it with `stringifyLosslessJSON`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const V1_serializeCubeLambda: (ir: IR) => PlainObject;
|
|
32
|
+
//# sourceMappingURL=V1_CubeLambdaSerializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_CubeLambdaSerializer.d.ts","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAgB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAO3E,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,UAAU,CAAC;AAKhD,iCAAiC;AACjC,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,KAAG,MACQ,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,MAAM,GAAG,SAAS,KAC3B,MAAM,GAAG,SAUX,CAAC;AAqMF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,IAAI,EAAE,KAAG,WAK/C,CAAC"}
|