@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,195 @@
|
|
|
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 { parseLosslessJSON } from '@finos/legend-shared';
|
|
17
|
+
// Cube IR → V1 protocol lambda JSON (PLAN §8.3, §8.5), built as plain JSON,
|
|
18
|
+
// never through legend-graph's value-specification classes, whose serializer
|
|
19
|
+
// drops `sourceInformation`. Numbers are lossless number values, so the
|
|
20
|
+
// request body must be written with `stringifyLosslessJSON`.
|
|
21
|
+
/** The prefix of the source ids Cube stamps, `cube:<nodeId>:<role>` */
|
|
22
|
+
export const V1_CUBE_SOURCE_ID_PREFIX = 'cube:';
|
|
23
|
+
/** A JSON number token: what an integer, float or decimal literal must be */
|
|
24
|
+
const NUMBER_TOKEN = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/u;
|
|
25
|
+
/** The source id of an origin */
|
|
26
|
+
export const V1_buildCubeSourceId = (origin) => `${V1_CUBE_SOURCE_ID_PREFIX}${origin.nodeId}:${origin.role}`;
|
|
27
|
+
/**
|
|
28
|
+
* The origin a source id names, or none when Cube didn't stamp it. A role
|
|
29
|
+
* never contains `:`, so a node id that does still reads back whole.
|
|
30
|
+
*/
|
|
31
|
+
export const V1_parseCubeSourceId = (sourceId) => {
|
|
32
|
+
if (!sourceId?.startsWith(V1_CUBE_SOURCE_ID_PREFIX)) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const rest = sourceId.slice(V1_CUBE_SOURCE_ID_PREFIX.length);
|
|
36
|
+
const at = rest.lastIndexOf(':');
|
|
37
|
+
if (at <= 0 || at === rest.length - 1) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
return { nodeId: rest.slice(0, at), role: rest.slice(at + 1) };
|
|
41
|
+
};
|
|
42
|
+
const stamped = (json, origin) => origin
|
|
43
|
+
? {
|
|
44
|
+
...json,
|
|
45
|
+
sourceInformation: { sourceId: V1_buildCubeSourceId(origin) },
|
|
46
|
+
}
|
|
47
|
+
: json;
|
|
48
|
+
/** A lossless JSON number for a numeric literal's text, written digit for digit */
|
|
49
|
+
const numberToken = (text) => {
|
|
50
|
+
if (!NUMBER_TOKEN.test(text)) {
|
|
51
|
+
throw new Error(`"${text}" is not a number Cube can send`);
|
|
52
|
+
}
|
|
53
|
+
return parseLosslessJSON(text);
|
|
54
|
+
};
|
|
55
|
+
const serializeLiteral = (value) => {
|
|
56
|
+
switch (value.kind) {
|
|
57
|
+
case 'string':
|
|
58
|
+
case 'boolean':
|
|
59
|
+
case 'strictDate':
|
|
60
|
+
case 'dateTime':
|
|
61
|
+
return { _type: value.kind, value: value.value };
|
|
62
|
+
case 'integer':
|
|
63
|
+
case 'float':
|
|
64
|
+
case 'decimal':
|
|
65
|
+
return { _type: value.kind, value: numberToken(value.value) };
|
|
66
|
+
case 'enum':
|
|
67
|
+
// enumeration values are emitted as `enumValue`, with their enumeration
|
|
68
|
+
throw new Error(`Can't send the enumeration value "${value.value}" as a literal`);
|
|
69
|
+
default: {
|
|
70
|
+
const unknown = value;
|
|
71
|
+
throw new Error(`Unknown literal ${JSON.stringify(unknown)}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* The protocol JSON of an IR node. Every protocol node is stamped with the
|
|
77
|
+
* origin of its IR node, or else of its nearest ancestor that has one.
|
|
78
|
+
*/
|
|
79
|
+
const serialize = (ir, inherited) => {
|
|
80
|
+
switch (ir.k) {
|
|
81
|
+
case 'func': {
|
|
82
|
+
const origin = ir.origin ?? inherited;
|
|
83
|
+
return stamped({
|
|
84
|
+
_type: 'func',
|
|
85
|
+
function: ir.name,
|
|
86
|
+
parameters: ir.params.map((param) => serialize(param, origin)),
|
|
87
|
+
}, origin);
|
|
88
|
+
}
|
|
89
|
+
case 'property': {
|
|
90
|
+
const origin = ir.origin ?? inherited;
|
|
91
|
+
return stamped({
|
|
92
|
+
_type: 'property',
|
|
93
|
+
property: ir.name,
|
|
94
|
+
parameters: [serialize(ir.receiver, origin)],
|
|
95
|
+
}, origin);
|
|
96
|
+
}
|
|
97
|
+
case 'var':
|
|
98
|
+
return stamped({ _type: 'var', name: ir.name }, inherited);
|
|
99
|
+
case 'lambda':
|
|
100
|
+
return stamped({
|
|
101
|
+
_type: 'lambda',
|
|
102
|
+
parameters: ir.params.map((name) => stamped({ _type: 'var', name }, inherited)),
|
|
103
|
+
body: ir.body.map((statement) => serialize(statement, inherited)),
|
|
104
|
+
}, inherited);
|
|
105
|
+
case 'literal':
|
|
106
|
+
return stamped(serializeLiteral(ir.value), ir.origin ?? inherited);
|
|
107
|
+
case 'collection':
|
|
108
|
+
return stamped({
|
|
109
|
+
_type: 'collection',
|
|
110
|
+
multiplicity: {
|
|
111
|
+
lowerBound: ir.values.length,
|
|
112
|
+
upperBound: ir.values.length,
|
|
113
|
+
},
|
|
114
|
+
values: ir.values.map((value) => serialize(value, inherited)),
|
|
115
|
+
}, inherited);
|
|
116
|
+
case 'colSpec':
|
|
117
|
+
// the engine reports a missing column on the spec's value, which is
|
|
118
|
+
// also what a column list holds, so the value is stamped too
|
|
119
|
+
return stamped({
|
|
120
|
+
_type: 'classInstance',
|
|
121
|
+
type: 'colSpec',
|
|
122
|
+
value: stamped({
|
|
123
|
+
name: ir.name,
|
|
124
|
+
...(ir.fn1 ? { function1: serialize(ir.fn1, inherited) } : {}),
|
|
125
|
+
...(ir.fn2 ? { function2: serialize(ir.fn2, inherited) } : {}),
|
|
126
|
+
}, inherited),
|
|
127
|
+
}, inherited);
|
|
128
|
+
case 'colSpecArray':
|
|
129
|
+
return stamped({
|
|
130
|
+
_type: 'classInstance',
|
|
131
|
+
type: 'colSpecArray',
|
|
132
|
+
value: {
|
|
133
|
+
colSpecs: ir.specs.map((spec) => {
|
|
134
|
+
if (spec.k !== 'colSpec') {
|
|
135
|
+
throw new Error(`A column list holds only column specs, not "${spec.k}"`);
|
|
136
|
+
}
|
|
137
|
+
return serialize(spec, inherited)
|
|
138
|
+
.value;
|
|
139
|
+
}),
|
|
140
|
+
},
|
|
141
|
+
}, inherited);
|
|
142
|
+
case 'storeAccessor': {
|
|
143
|
+
const origin = ir.origin ?? inherited;
|
|
144
|
+
// the engine reports a wrong database, schema or table on the value
|
|
145
|
+
return stamped({
|
|
146
|
+
_type: 'classInstance',
|
|
147
|
+
type: '>',
|
|
148
|
+
value: stamped({ path: [...ir.path] }, origin),
|
|
149
|
+
}, origin);
|
|
150
|
+
}
|
|
151
|
+
case 'elementPtr':
|
|
152
|
+
return stamped({ _type: 'packageableElementPtr', fullPath: ir.path }, inherited);
|
|
153
|
+
case 'genericType':
|
|
154
|
+
return stamped({
|
|
155
|
+
_type: 'genericTypeInstance',
|
|
156
|
+
genericType: {
|
|
157
|
+
rawType: { _type: 'packageableType', fullPath: ir.path },
|
|
158
|
+
typeArguments: [],
|
|
159
|
+
multiplicityArguments: [],
|
|
160
|
+
typeVariableValues: (ir.params ?? []).map((param) => stamped({ _type: 'integer', value: numberToken(String(param)) }, inherited)),
|
|
161
|
+
},
|
|
162
|
+
}, inherited);
|
|
163
|
+
case 'enumValue': {
|
|
164
|
+
const origin = ir.origin ?? inherited;
|
|
165
|
+
return stamped({
|
|
166
|
+
_type: 'property',
|
|
167
|
+
property: ir.value,
|
|
168
|
+
parameters: [
|
|
169
|
+
stamped({ _type: 'packageableElementPtr', fullPath: ir.enumPath }, origin),
|
|
170
|
+
],
|
|
171
|
+
}, origin);
|
|
172
|
+
}
|
|
173
|
+
case 'let':
|
|
174
|
+
case 'block':
|
|
175
|
+
// window isolation (PLAN §8.6) comes with Partition, in M5
|
|
176
|
+
throw new Error(`Can't send "${ir.k}" yet`);
|
|
177
|
+
case 'raw':
|
|
178
|
+
return ir.json;
|
|
179
|
+
default: {
|
|
180
|
+
const unknown = ir;
|
|
181
|
+
throw new Error(`Unknown IR ${JSON.stringify(unknown)}`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* The protocol JSON of a lambda Cube emitted (a typing or an execution
|
|
187
|
+
* lambda), with lossless numbers: write it with `stringifyLosslessJSON`.
|
|
188
|
+
*/
|
|
189
|
+
export const V1_serializeCubeLambda = (ir) => {
|
|
190
|
+
if (ir.k !== 'lambda') {
|
|
191
|
+
throw new Error(`Only a lambda can be sent, not "${ir.k}"`);
|
|
192
|
+
}
|
|
193
|
+
return serialize(ir, undefined);
|
|
194
|
+
};
|
|
195
|
+
//# sourceMappingURL=V1_CubeLambdaSerializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_CubeLambdaSerializer.js","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,iBAAiB,EAAoB,MAAM,sBAAsB,CAAC;AAE3E,4EAA4E;AAC5E,6EAA6E;AAC7E,wEAAwE;AACxE,6DAA6D;AAE7D,uEAAuE;AACvE,MAAM,CAAC,MAAM,wBAAwB,GAAG,OAAO,CAAC;AAEhD,6EAA6E;AAC7E,MAAM,YAAY,GAAG,gDAAgD,CAAC;AAEtE,iCAAiC;AACjC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAc,EAAU,EAAE,CAC7D,GAAG,wBAAwB,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,QAA4B,EACR,EAAE;IACtB,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,wBAAwB,CAAC,EAAE,CAAC;QACpD,OA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C;IACH,CAAC;AACH,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EAAM,EAAe,EAAE;IAC5D,IAAI,EAAE,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,mCAAmC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;AAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { PlainObject } from '@finos/legend-shared';
|
|
17
|
+
import { type CubeModelOutline } from '../../../CubeEngine.js';
|
|
18
|
+
/** The outline of a parsed model: its Database elements and its readable runtimes, in model order */
|
|
19
|
+
export declare const V1_buildCubeModelOutline: (modelData: PlainObject) => CubeModelOutline;
|
|
20
|
+
//# sourceMappingURL=V1_CubeModelOutlineBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_CubeModelOutlineBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAEL,KAAK,gBAAgB,EAMtB,MAAM,wBAAwB,CAAC;AA4LhC,qGAAqG;AACrG,eAAO,MAAM,wBAAwB,GACnC,WAAW,WAAW,KACrB,gBAyBF,CAAC"}
|
|
@@ -0,0 +1,174 @@
|
|
|
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 { getRelationalDisplayName } from '@finos/legend-cube';
|
|
17
|
+
import { CubeTableFlag, } from '../../../CubeEngine.js';
|
|
18
|
+
// The databases and runtimes of a parsed model (`{_type: 'data', elements}`),
|
|
19
|
+
// for the source picker (PLAN §6.2.3-§6.2.6). Read as plain JSON: only names,
|
|
20
|
+
// column types and store paths are needed, and an element's full protocol
|
|
21
|
+
// deserializer needs the graph manager's plugins.
|
|
22
|
+
const DATABASE_TYPE = 'relational';
|
|
23
|
+
const RUNTIME_TYPE = 'runtime';
|
|
24
|
+
const CONNECTION_TYPE = 'connection';
|
|
25
|
+
const CONNECTION_POINTER_TYPE = 'connectionPointer';
|
|
26
|
+
const RELATIONAL_CONNECTION_TYPE = 'RelationalDatabaseConnection';
|
|
27
|
+
/** The only runtime value whose store keys Cube can read; others are hidden */
|
|
28
|
+
const ENGINE_RUNTIME_TYPE = 'engineRuntime';
|
|
29
|
+
/** The flag a column type gives its table, if any (PLAN §6.2.6) */
|
|
30
|
+
const COLUMN_TYPE_FLAGS = {
|
|
31
|
+
// the engine fails to type the whole table
|
|
32
|
+
Binary: CubeTableFlag.UNAVAILABLE,
|
|
33
|
+
Varbinary: CubeTableFlag.UNAVAILABLE,
|
|
34
|
+
// typed with a length of 1
|
|
35
|
+
Char: CubeTableFlag.LENGTH_UNKNOWN,
|
|
36
|
+
// an ARRAY column is parsed as Other; both are typed as a bare String
|
|
37
|
+
Other: CubeTableFlag.TYPE_UNKNOWN,
|
|
38
|
+
};
|
|
39
|
+
const asObject = (value) => value && typeof value === 'object' && !Array.isArray(value)
|
|
40
|
+
? value
|
|
41
|
+
: {};
|
|
42
|
+
const asList = (value) => Array.isArray(value) ? value : [];
|
|
43
|
+
const asString = (value) => typeof value === 'string' ? value : undefined;
|
|
44
|
+
const elementPath = (element) => {
|
|
45
|
+
const name = asString(element.name) ?? '';
|
|
46
|
+
const pkg = asString(element.package);
|
|
47
|
+
return pkg ? `${pkg}::${name}` : name;
|
|
48
|
+
};
|
|
49
|
+
const buildTable = (json) => {
|
|
50
|
+
const table = asObject(json);
|
|
51
|
+
const columns = asList(table.columns).map(asObject);
|
|
52
|
+
const flags = new Set();
|
|
53
|
+
const untypedColumns = [];
|
|
54
|
+
columns.forEach((column) => {
|
|
55
|
+
const flag = COLUMN_TYPE_FLAGS[asString(asObject(column.type)._type) ?? ''];
|
|
56
|
+
if (flag) {
|
|
57
|
+
flags.add(flag);
|
|
58
|
+
}
|
|
59
|
+
if (flag === CubeTableFlag.TYPE_UNKNOWN) {
|
|
60
|
+
// unquoted, as the engine names the column in the table's schema
|
|
61
|
+
untypedColumns.push(getRelationalDisplayName(asString(column.name) ?? ''));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
name: asString(table.name) ?? '',
|
|
66
|
+
isView: false,
|
|
67
|
+
columnCount: columns.length,
|
|
68
|
+
flags: Object.values(CubeTableFlag).filter((flag) => flags.has(flag)),
|
|
69
|
+
untypedColumns,
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
const buildView = (json) => {
|
|
73
|
+
const view = asObject(json);
|
|
74
|
+
return {
|
|
75
|
+
name: asString(view.name) ?? '',
|
|
76
|
+
isView: true,
|
|
77
|
+
columnCount: asList(view.columnMappings).length,
|
|
78
|
+
flags: [],
|
|
79
|
+
untypedColumns: [],
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
const buildSchema = (json) => {
|
|
83
|
+
const schema = asObject(json);
|
|
84
|
+
return {
|
|
85
|
+
name: asString(schema.name) ?? '',
|
|
86
|
+
tables: [
|
|
87
|
+
...asList(schema.tables).map(buildTable),
|
|
88
|
+
...asList(schema.views).map(buildView),
|
|
89
|
+
],
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
const buildDatabase = (element) => ({
|
|
93
|
+
path: elementPath(element),
|
|
94
|
+
// included stores are not followed (v1)
|
|
95
|
+
schemas: asList(element.schemas).map(buildSchema),
|
|
96
|
+
});
|
|
97
|
+
/** The database type of a relational connection value: its `type`, else its `databaseType` */
|
|
98
|
+
const getRelationalDatabaseType = (value) => value._type === RELATIONAL_CONNECTION_TYPE
|
|
99
|
+
? (asString(value.type) ?? asString(value.databaseType))
|
|
100
|
+
: undefined;
|
|
101
|
+
/**
|
|
102
|
+
* The database type of a runtime's connection, embedded or a pointer to a
|
|
103
|
+
* connection element (`connectionTypes`, by path); none for one that isn't
|
|
104
|
+
* relational
|
|
105
|
+
*/
|
|
106
|
+
const getConnectionDatabaseType = (json, connectionTypes) => {
|
|
107
|
+
const connection = asObject(json);
|
|
108
|
+
if (connection._type === CONNECTION_POINTER_TYPE) {
|
|
109
|
+
const path = asString(connection.connection);
|
|
110
|
+
return path === undefined ? undefined : connectionTypes.get(path);
|
|
111
|
+
}
|
|
112
|
+
return getRelationalDatabaseType(connection);
|
|
113
|
+
};
|
|
114
|
+
/** The stores a runtime's connections are keyed by, in both syntaxes; none when it can't be read */
|
|
115
|
+
const buildRuntime = (element, connectionTypes) => {
|
|
116
|
+
const value = asObject(element.runtimeValue);
|
|
117
|
+
if (value._type !== ENGINE_RUNTIME_TYPE) {
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
const storePaths = [
|
|
121
|
+
// `connections: [<store>: [...]]`
|
|
122
|
+
...asList(value.connections).map((connection) => asString(asObject(asObject(connection).store).path)),
|
|
123
|
+
// `connectionStores: [<connection>: [<store>, ...]]`
|
|
124
|
+
...asList(value.connectionStores).flatMap((connectionStore) => asList(asObject(connectionStore).storePointers).map((pointer) => asString(asObject(pointer).path))),
|
|
125
|
+
].filter((path) => path !== undefined);
|
|
126
|
+
const connections = [];
|
|
127
|
+
const addConnection = (storePath, databaseType) => {
|
|
128
|
+
if (storePath !== undefined &&
|
|
129
|
+
databaseType !== undefined &&
|
|
130
|
+
!connections.some((connection) => connection.storePath === storePath &&
|
|
131
|
+
connection.databaseType === databaseType)) {
|
|
132
|
+
connections.push({ storePath, databaseType });
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
asList(value.connections).forEach((json) => {
|
|
136
|
+
const storeConnections = asObject(json);
|
|
137
|
+
const storePath = asString(asObject(storeConnections.store).path);
|
|
138
|
+
asList(storeConnections.storeConnections).forEach((identified) => addConnection(storePath, getConnectionDatabaseType(asObject(identified).connection, connectionTypes)));
|
|
139
|
+
});
|
|
140
|
+
asList(value.connectionStores).forEach((json) => {
|
|
141
|
+
const connectionStore = asObject(json);
|
|
142
|
+
const databaseType = getConnectionDatabaseType(connectionStore.connectionPointer, connectionTypes);
|
|
143
|
+
asList(connectionStore.storePointers).forEach((pointer) => addConnection(asString(asObject(pointer).path), databaseType));
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
path: elementPath(element),
|
|
147
|
+
storePaths: [...new Set(storePaths)],
|
|
148
|
+
connections,
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
/** The outline of a parsed model: its Database elements and its readable runtimes, in model order */
|
|
152
|
+
export const V1_buildCubeModelOutline = (modelData) => {
|
|
153
|
+
const elements = asList(modelData.elements).map(asObject);
|
|
154
|
+
// the database type of each relational connection element, by path
|
|
155
|
+
const connectionTypes = new Map();
|
|
156
|
+
elements
|
|
157
|
+
.filter((element) => element._type === CONNECTION_TYPE)
|
|
158
|
+
.forEach((element) => {
|
|
159
|
+
const databaseType = getRelationalDatabaseType(asObject(element.connectionValue));
|
|
160
|
+
if (databaseType !== undefined) {
|
|
161
|
+
connectionTypes.set(elementPath(element), databaseType);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
return {
|
|
165
|
+
databases: elements
|
|
166
|
+
.filter((element) => element._type === DATABASE_TYPE)
|
|
167
|
+
.map(buildDatabase),
|
|
168
|
+
runtimes: elements
|
|
169
|
+
.filter((element) => element._type === RUNTIME_TYPE)
|
|
170
|
+
.map((element) => buildRuntime(element, connectionTypes))
|
|
171
|
+
.filter((runtime) => runtime !== undefined),
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=V1_CubeModelOutlineBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_CubeModelOutlineBuilder.js","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EACL,aAAa,GAOd,MAAM,wBAAwB,CAAC;AAEhC,8EAA8E;AAC9E,8EAA8E;AAC9E,0EAA0E;AAC1E,kDAAkD;AAElD,MAAM,aAAa,GAAG,YAAY,CAAC;AACnC,MAAM,YAAY,GAAG,SAAS,CAAC;AAC/B,MAAM,eAAe,GAAG,YAAY,CAAC;AACrC,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AACpD,MAAM,0BAA0B,GAAG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.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 { Schema } from '@finos/legend-cube';
|
|
17
|
+
import type { PlainObject } from '@finos/legend-shared';
|
|
18
|
+
/**
|
|
19
|
+
* The schema of a relation type: one column per relation column, in order,
|
|
20
|
+
* typed by its path and parameters (an unknown type is opaque) and nullable
|
|
21
|
+
* when it may be empty
|
|
22
|
+
*/
|
|
23
|
+
export declare const V1_buildCubeSchema: (json: PlainObject) => Schema;
|
|
24
|
+
//# sourceMappingURL=V1_CubeRelationTypeAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_CubeRelationTypeAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAmB,MAAM,EAAgB,MAAM,oBAAoB,CAAC;AAM3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOxD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,WAAW,KAAG,MAuBtD,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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, Schema, SchemaColumn } from '@finos/legend-cube';
|
|
17
|
+
import { V1_CInteger, V1_PackageableType, V1_relationTypeModelSchema, } from '@finos/legend-graph';
|
|
18
|
+
import { deserialize } from 'serializr';
|
|
19
|
+
// The engine's relation type → a Cube schema (PLAN §6.2.6), read through
|
|
20
|
+
// legend-graph's protocol schema. Its graph-manager wrappers are bypassed:
|
|
21
|
+
// they drop type parameters (D8).
|
|
22
|
+
/**
|
|
23
|
+
* The schema of a relation type: one column per relation column, in order,
|
|
24
|
+
* typed by its path and parameters (an unknown type is opaque) and nullable
|
|
25
|
+
* when it may be empty
|
|
26
|
+
*/
|
|
27
|
+
export const V1_buildCubeSchema = (json) => {
|
|
28
|
+
const relationType = deserialize(V1_relationTypeModelSchema, json);
|
|
29
|
+
return new Schema(relationType.columns.map((column) => {
|
|
30
|
+
const { rawType, typeVariableValues } = column.genericType;
|
|
31
|
+
if (!(rawType instanceof V1_PackageableType)) {
|
|
32
|
+
throw new Error(`Column "${column.name}" has a type Cube can't read`);
|
|
33
|
+
}
|
|
34
|
+
const params = typeVariableValues.map((value) => {
|
|
35
|
+
if (!(value instanceof V1_CInteger)) {
|
|
36
|
+
throw new Error(`Column "${column.name}" has a type parameter Cube can't read`);
|
|
37
|
+
}
|
|
38
|
+
return value.value;
|
|
39
|
+
});
|
|
40
|
+
return new SchemaColumn(column.name, resolveCubeType(rawType.fullPath, params), column.multiplicity.lowerBound === 0);
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=V1_CubeRelationTypeAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_CubeRelationTypeAdapter.js","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,yEAAyE;AACzE,2EAA2E;AAC3E,kCAAkC;AAElC;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAiB,EAAU,EAAE;IAC9D,MAAM,YAAY,GAAG,WAAW,CAAC,0BAA0B,EAAE,IAAI,CAAC,CAAC;IACnE,OAAO,IAAI,MAAM,CACf,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAClC,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC;QAC3D,IAAI,CAAC,CAAC,OAAO,YAAY,kBAAkB,CAAC,EAAE,CAAC;YAC7C,MAAM,IAAI,KAAK,CAAC,WAAW,MAAM,CAAC,IAAI,8BAA8B,CAAC,CAAC;QACxE,CAAC;QACD,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAC9C,IAAI,CAAC,CAAC,KAAK,YAAY,WAAW,CAAC,EAAE,CAAC;gBACpC,MAAM,IAAI,KAAK,CACb,WAAW,MAAM,CAAC,IAAI,wCAAwC,CAC/D,CAAC;YACJ,CAAC;YACD,OAAO,KAAK,CAAC,KAAK,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,YAAY,CACrB,MAAM,CAAC,IAAI,EACX,eAAe,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,EACzC,MAAM,CAAC,YAAY,CAAC,UAAU,KAAK,CAAC,CACrC,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,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
|
+
import { type IR, type ModelContext, type Schema } from '@finos/legend-cube';
|
|
17
|
+
import { V1_EngineServerClient } from '@finos/legend-graph';
|
|
18
|
+
import { type TracerService } from '@finos/legend-shared';
|
|
19
|
+
import { type AccessorPath, type CubeEngine, CubeEngineError, type CubeModelOutline, type CubeResult, type NodeId } from '../../../CubeEngine.js';
|
|
20
|
+
/** The engine client's configuration, as the host gives it (legend-graph doesn't export its type) */
|
|
21
|
+
export type V1_CubeEngineConfig = ConstructorParameters<typeof V1_EngineServerClient>[0];
|
|
22
|
+
/** The message for a model of a kind this version can't run (PLAN §8.7) */
|
|
23
|
+
export declare const V1_unsupportedModelMessage: (type: string) => string;
|
|
24
|
+
/**
|
|
25
|
+
* The Legend engine behind the Cube engine port (PLAN §8.7). It sends the
|
|
26
|
+
* cube's saved model context as it is, lambdas as protocol JSON with lossless
|
|
27
|
+
* numbers, and reads every response itself: the graph manager's wrappers drop
|
|
28
|
+
* type parameters and read numbers lossily (D8).
|
|
29
|
+
*/
|
|
30
|
+
export declare class V1_LegendCubeEngine implements CubeEngine {
|
|
31
|
+
readonly client: V1_EngineServerClient;
|
|
32
|
+
constructor(config: V1_CubeEngineConfig, tracerService: TracerService);
|
|
33
|
+
/** The model's Pure text, or an unsupported-model error for any other kind */
|
|
34
|
+
private textOf;
|
|
35
|
+
loadModel(model: ModelContext): Promise<CubeModelOutline>;
|
|
36
|
+
resolveSchemas(model: ModelContext, accessors: ReadonlyMap<NodeId, AccessorPath>): Promise<Map<NodeId, Schema | CubeEngineError>>;
|
|
37
|
+
typeLambdas(model: ModelContext, lambdas: ReadonlyMap<NodeId, IR>): Promise<Map<NodeId, Schema | CubeEngineError>>;
|
|
38
|
+
/** Types every lambda in one batch call: one entry per key, whatever fails */
|
|
39
|
+
private typeAll;
|
|
40
|
+
execute(model: ModelContext, executionLambda: IR, options?: {
|
|
41
|
+
abortController?: AbortController | undefined;
|
|
42
|
+
}): Promise<CubeResult>;
|
|
43
|
+
renderPure(lambdaIR: IR): Promise<string>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=V1_LegendCubeEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_LegendCubeEngine.d.ts","sourceRoot":"","sources":["../../../../../src/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,EAAE,EAEP,KAAK,YAAY,EACjB,KAAK,MAAM,EAEZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAkB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,eAAe,EAEf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAC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