@finos/legend-cube-builder 0.0.0-stage → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +5 -2
- package/lib/__lib__/LegendCubeCommand.d.ts +26 -0
- package/lib/__lib__/LegendCubeCommand.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeCommand.js +40 -0
- package/lib/__lib__/LegendCubeCommand.js.map +1 -0
- package/lib/__lib__/LegendCubeHelpText.d.ts +19 -0
- package/lib/__lib__/LegendCubeHelpText.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeHelpText.js +27 -0
- package/lib/__lib__/LegendCubeHelpText.js.map +1 -0
- package/lib/__lib__/LegendCubeLabels.d.ts +68 -0
- package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeLabels.js +109 -0
- package/lib/__lib__/LegendCubeLabels.js.map +1 -0
- package/lib/__lib__/LegendCubeTesting.d.ts +33 -0
- package/lib/__lib__/LegendCubeTesting.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeTesting.js +34 -0
- package/lib/__lib__/LegendCubeTesting.js.map +1 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.d.ts +24 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.js +37 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.js.map +1 -0
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts +41 -0
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -0
- package/lib/__test-utils__/CubeEngineTestSupport.js +76 -0
- package/lib/__test-utils__/CubeEngineTestSupport.js.map +1 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts +31 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts.map +1 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.js +102 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.js.map +1 -0
- package/lib/__test-utils__/CubePageTestUtils.d.ts +33 -0
- package/lib/__test-utils__/CubePageTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubePageTestUtils.js +68 -0
- package/lib/__test-utils__/CubePageTestUtils.js.map +1 -0
- package/lib/__test-utils__/CubeTestApplication.d.ts +30 -0
- package/lib/__test-utils__/CubeTestApplication.d.ts.map +1 -0
- package/lib/__test-utils__/CubeTestApplication.js +57 -0
- package/lib/__test-utils__/CubeTestApplication.js.map +1 -0
- package/lib/__test-utils__/FakeCubeEngine.d.ts +41 -0
- package/lib/__test-utils__/FakeCubeEngine.d.ts.map +1 -0
- package/lib/__test-utils__/FakeCubeEngine.js +85 -0
- package/lib/__test-utils__/FakeCubeEngine.js.map +1 -0
- package/lib/components/CubeButton.d.ts +20 -0
- package/lib/components/CubeButton.d.ts.map +1 -0
- package/lib/components/CubeButton.js +24 -0
- package/lib/components/CubeButton.js.map +1 -0
- package/lib/components/CubeEditor.d.ts +31 -0
- package/lib/components/CubeEditor.d.ts.map +1 -0
- package/lib/components/CubeEditor.js +90 -0
- package/lib/components/CubeEditor.js.map +1 -0
- package/lib/components/CubeNodeIcon.d.ts +23 -0
- package/lib/components/CubeNodeIcon.d.ts.map +1 -0
- package/lib/components/CubeNodeIcon.js +32 -0
- package/lib/components/CubeNodeIcon.js.map +1 -0
- package/lib/components/canvas/CubeCanvas.d.ts +37 -0
- package/lib/components/canvas/CubeCanvas.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvas.js +135 -0
- package/lib/components/canvas/CubeCanvas.js.map +1 -0
- package/lib/components/canvas/CubeCanvasContext.d.ts +19 -0
- package/lib/components/canvas/CubeCanvasContext.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasContext.js +22 -0
- package/lib/components/canvas/CubeCanvasContext.js.map +1 -0
- package/lib/components/canvas/CubeCanvasContextMenu.d.ts +28 -0
- package/lib/components/canvas/CubeCanvasContextMenu.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasContextMenu.js +35 -0
- package/lib/components/canvas/CubeCanvasContextMenu.js.map +1 -0
- package/lib/components/canvas/CubeCanvasDnd.d.ts +43 -0
- package/lib/components/canvas/CubeCanvasDnd.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasDnd.js +51 -0
- package/lib/components/canvas/CubeCanvasDnd.js.map +1 -0
- package/lib/components/canvas/CubeCanvasEdge.d.ts +24 -0
- package/lib/components/canvas/CubeCanvasEdge.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasEdge.js +33 -0
- package/lib/components/canvas/CubeCanvasEdge.js.map +1 -0
- package/lib/components/canvas/CubeCanvasElements.d.ts +64 -0
- package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasElements.js +96 -0
- package/lib/components/canvas/CubeCanvasElements.js.map +1 -0
- package/lib/components/canvas/CubeCanvasLayout.d.ts +32 -0
- package/lib/components/canvas/CubeCanvasLayout.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasLayout.js +63 -0
- package/lib/components/canvas/CubeCanvasLayout.js.map +1 -0
- package/lib/components/canvas/CubeCanvasNode.d.ts +29 -0
- package/lib/components/canvas/CubeCanvasNode.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasNode.js +72 -0
- package/lib/components/canvas/CubeCanvasNode.js.map +1 -0
- package/lib/components/editors/CubeColumnPicker.d.ts +40 -0
- package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -0
- package/lib/components/editors/CubeColumnPicker.js +51 -0
- package/lib/components/editors/CubeColumnPicker.js.map +1 -0
- package/lib/components/editors/CubeFilterEditor.d.ts +26 -0
- package/lib/components/editors/CubeFilterEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeFilterEditor.js +90 -0
- package/lib/components/editors/CubeFilterEditor.js.map +1 -0
- package/lib/components/editors/CubeJoinEditor.d.ts +26 -0
- package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeJoinEditor.js +76 -0
- package/lib/components/editors/CubeJoinEditor.js.map +1 -0
- package/lib/components/editors/CubeNodeEditorPanel.d.ts +29 -0
- package/lib/components/editors/CubeNodeEditorPanel.d.ts.map +1 -0
- package/lib/components/editors/CubeNodeEditorPanel.js +71 -0
- package/lib/components/editors/CubeNodeEditorPanel.js.map +1 -0
- package/lib/components/editors/CubeNodeEditorRegistry.d.ts +44 -0
- package/lib/components/editors/CubeNodeEditorRegistry.d.ts.map +1 -0
- package/lib/components/editors/CubeNodeEditorRegistry.js +30 -0
- package/lib/components/editors/CubeNodeEditorRegistry.js.map +1 -0
- package/lib/components/editors/CubeSourceEditor.d.ts +25 -0
- package/lib/components/editors/CubeSourceEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeSourceEditor.js +42 -0
- package/lib/components/editors/CubeSourceEditor.js.map +1 -0
- package/lib/components/editors/CubeValueEditor.d.ts +40 -0
- package/lib/components/editors/CubeValueEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeValueEditor.js +177 -0
- package/lib/components/editors/CubeValueEditor.js.map +1 -0
- package/lib/components/grid/CubeGridRegion.d.ts +23 -0
- package/lib/components/grid/CubeGridRegion.d.ts.map +1 -0
- package/lib/components/grid/CubeGridRegion.js +94 -0
- package/lib/components/grid/CubeGridRegion.js.map +1 -0
- package/lib/components/grid/CubeGridValues.d.ts +25 -0
- package/lib/components/grid/CubeGridValues.d.ts.map +1 -0
- package/lib/components/grid/CubeGridValues.js +95 -0
- package/lib/components/grid/CubeGridValues.js.map +1 -0
- package/lib/components/grid/CubeResultGrid.d.ts +26 -0
- package/lib/components/grid/CubeResultGrid.d.ts.map +1 -0
- package/lib/components/grid/CubeResultGrid.js +50 -0
- package/lib/components/grid/CubeResultGrid.js.map +1 -0
- package/lib/components/palette/CubePalette.d.ts +29 -0
- package/lib/components/palette/CubePalette.d.ts.map +1 -0
- package/lib/components/palette/CubePalette.js +73 -0
- package/lib/components/palette/CubePalette.js.map +1 -0
- package/lib/components/show-pure/CubeShowPureDialog.d.ts +23 -0
- package/lib/components/show-pure/CubeShowPureDialog.d.ts.map +1 -0
- package/lib/components/show-pure/CubeShowPureDialog.js +37 -0
- package/lib/components/show-pure/CubeShowPureDialog.js.map +1 -0
- package/lib/components/source-picker/CubeSourcePicker.d.ts +22 -0
- package/lib/components/source-picker/CubeSourcePicker.d.ts.map +1 -0
- package/lib/components/source-picker/CubeSourcePicker.js +89 -0
- package/lib/components/source-picker/CubeSourcePicker.js.map +1 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts +26 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts.map +1 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.js +45 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.js.map +1 -0
- package/lib/graph-manager/CubeEngine.d.ts +115 -0
- package/lib/graph-manager/CubeEngine.d.ts.map +1 -0
- package/lib/graph-manager/CubeEngine.js +61 -0
- package/lib/graph-manager/CubeEngine.js.map +1 -0
- package/lib/graph-manager/CubeModelOutlineHelper.d.ts +25 -0
- package/lib/graph-manager/CubeModelOutlineHelper.d.ts.map +1 -0
- package/lib/graph-manager/CubeModelOutlineHelper.js +24 -0
- package/lib/graph-manager/CubeModelOutlineHelper.js.map +1 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts +26 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js +22 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts +27 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js +76 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts +27 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js +82 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts +32 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js +195 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts +20 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js +121 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts +24 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js +43 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts +45 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js +171 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts +22 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js +79 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js.map +1 -0
- package/lib/index.css +17 -0
- package/lib/index.css.map +1 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/stores/CubeEditorState.d.ts +206 -0
- package/lib/stores/CubeEditorState.d.ts.map +1 -0
- package/lib/stores/CubeEditorState.js +551 -0
- package/lib/stores/CubeEditorState.js.map +1 -0
- package/lib/stores/CubeExecutionState.d.ts +67 -0
- package/lib/stores/CubeExecutionState.d.ts.map +1 -0
- package/lib/stores/CubeExecutionState.js +196 -0
- package/lib/stores/CubeExecutionState.js.map +1 -0
- package/lib/stores/CubeHost.d.ts +31 -0
- package/lib/stores/CubeHost.d.ts.map +1 -0
- package/lib/stores/CubeHost.js +17 -0
- package/lib/stores/CubeHost.js.map +1 -0
- package/lib/stores/CubeNodeEditorState.d.ts +85 -0
- package/lib/stores/CubeNodeEditorState.d.ts.map +1 -0
- package/lib/stores/CubeNodeEditorState.js +207 -0
- package/lib/stores/CubeNodeEditorState.js.map +1 -0
- package/lib/stores/CubeShowPureState.d.ts +38 -0
- package/lib/stores/CubeShowPureState.d.ts.map +1 -0
- package/lib/stores/CubeShowPureState.js +83 -0
- package/lib/stores/CubeShowPureState.js.map +1 -0
- package/lib/stores/CubeSourcePickerState.d.ts +98 -0
- package/lib/stores/CubeSourcePickerState.d.ts.map +1 -0
- package/lib/stores/CubeSourcePickerState.js +334 -0
- package/lib/stores/CubeSourcePickerState.js.map +1 -0
- package/lib/stores/CubeSpecTransferState.d.ts +60 -0
- package/lib/stores/CubeSpecTransferState.d.ts.map +1 -0
- package/lib/stores/CubeSpecTransferState.js +167 -0
- package/lib/stores/CubeSpecTransferState.js.map +1 -0
- package/lib/stores/LocalModelCatalog.d.ts +37 -0
- package/lib/stores/LocalModelCatalog.d.ts.map +1 -0
- package/lib/stores/LocalModelCatalog.js +49 -0
- package/lib/stores/LocalModelCatalog.js.map +1 -0
- package/lib/stores/editors/CubeFilterDraft.d.ts +61 -0
- package/lib/stores/editors/CubeFilterDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeFilterDraft.js +186 -0
- package/lib/stores/editors/CubeFilterDraft.js.map +1 -0
- package/lib/stores/editors/CubeJoinDraft.d.ts +63 -0
- package/lib/stores/editors/CubeJoinDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeJoinDraft.js +136 -0
- package/lib/stores/editors/CubeJoinDraft.js.map +1 -0
- package/lib/stores/editors/CubeNodeDraft.d.ts +38 -0
- package/lib/stores/editors/CubeNodeDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeNodeDraft.js +35 -0
- package/lib/stores/editors/CubeNodeDraft.js.map +1 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts +29 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.js +33 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.js.map +1 -0
- package/lib/stores/fixtures/CubeNorthwindModel.d.ts +23 -0
- package/lib/stores/fixtures/CubeNorthwindModel.d.ts.map +1 -0
- package/lib/stores/fixtures/CubeNorthwindModel.js +338 -0
- package/lib/stores/fixtures/CubeNorthwindModel.js.map +1 -0
- package/package.json +81 -3
- package/src/__lib__/LegendCubeCommand.ts +44 -0
- package/src/__lib__/LegendCubeHelpText.ts +38 -0
- package/src/__lib__/LegendCubeLabels.ts +141 -0
- package/src/__lib__/LegendCubeTesting.ts +33 -0
- package/src/__test-utils__/CubeCanvasTestUtils.ts +53 -0
- package/src/__test-utils__/CubeEngineTestSupport.ts +137 -0
- package/src/__test-utils__/CubeNorthwindTestQueries.ts +165 -0
- package/src/__test-utils__/CubePageTestUtils.tsx +96 -0
- package/src/__test-utils__/CubeTestApplication.ts +82 -0
- package/src/__test-utils__/FakeCubeEngine.ts +139 -0
- package/src/components/CubeButton.tsx +35 -0
- package/src/components/CubeEditor.tsx +239 -0
- package/src/components/CubeNodeIcon.tsx +47 -0
- package/src/components/canvas/CubeCanvas.tsx +260 -0
- package/src/components/canvas/CubeCanvasContext.ts +31 -0
- package/src/components/canvas/CubeCanvasContextMenu.tsx +89 -0
- package/src/components/canvas/CubeCanvasDnd.ts +82 -0
- package/src/components/canvas/CubeCanvasEdge.tsx +57 -0
- package/src/components/canvas/CubeCanvasElements.ts +150 -0
- package/src/components/canvas/CubeCanvasLayout.ts +88 -0
- package/src/components/canvas/CubeCanvasNode.tsx +141 -0
- package/src/components/editors/CubeColumnPicker.tsx +114 -0
- package/src/components/editors/CubeFilterEditor.tsx +309 -0
- package/src/components/editors/CubeJoinEditor.tsx +224 -0
- package/src/components/editors/CubeNodeEditorPanel.tsx +204 -0
- package/src/components/editors/CubeNodeEditorRegistry.ts +61 -0
- package/src/components/editors/CubeSourceEditor.tsx +116 -0
- package/src/components/editors/CubeValueEditor.tsx +332 -0
- package/src/components/grid/CubeGridRegion.tsx +274 -0
- package/src/components/grid/CubeGridValues.ts +125 -0
- package/src/components/grid/CubeResultGrid.tsx +84 -0
- package/src/components/palette/CubePalette.tsx +177 -0
- package/src/components/show-pure/CubeShowPureDialog.tsx +101 -0
- package/src/components/source-picker/CubeSourcePicker.tsx +304 -0
- package/src/components/spec-transfer/CubeSpecTransferDialog.tsx +157 -0
- package/src/graph-manager/CubeEngine.ts +155 -0
- package/src/graph-manager/CubeModelOutlineHelper.ts +32 -0
- package/src/graph-manager/protocol/pure/CubeEngineBuilder.ts +34 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts +109 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts +115 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts +257 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts +157 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.ts +58 -0
- package/src/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.ts +278 -0
- package/src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts +124 -0
- package/src/index.ts +41 -0
- package/src/stores/CubeEditorState.ts +702 -0
- package/src/stores/CubeExecutionState.ts +255 -0
- package/src/stores/CubeHost.ts +32 -0
- package/src/stores/CubeNodeEditorState.ts +255 -0
- package/src/stores/CubeShowPureState.ts +96 -0
- package/src/stores/CubeSourcePickerState.ts +426 -0
- package/src/stores/CubeSpecTransferState.ts +198 -0
- package/src/stores/LocalModelCatalog.ts +70 -0
- package/src/stores/editors/CubeFilterDraft.ts +241 -0
- package/src/stores/editors/CubeJoinDraft.ts +197 -0
- package/src/stores/editors/CubeNodeDraft.ts +46 -0
- package/src/stores/editors/CubeNodeDraftRegistry.ts +49 -0
- package/src/stores/fixtures/CubeNorthwindModel.ts +355 -0
- package/tsconfig.json +118 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeCanvasTestUtils.d.ts","sourceRoot":"","sources":["../../src/__test-utils__/CubeCanvasTestUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,GAChC,QAAQ,MAAM,EACd,YAAW,UAAqB,KAC/B,WAAW,GAAG,IAGd,CAAC;AAEJ,oEAAoE;AACpE,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,MAAM,EACd,YAAW,UAAqB,KAC/B,OAAO,CAAC,WAAW,CASrB,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,oBAAoB,QAAO,WAAW,EACO,CAAC;AAE3D,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B,GAAI,MAAM,WAAW,KAAG,MAAM,EACrB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { screen, waitFor } from '@testing-library/react';
|
|
17
|
+
import { LEGEND_CUBE_TEST_ID } from '../__lib__/LegendCubeTesting.js';
|
|
18
|
+
// The canvas's nodes, as the tests find them: React Flow keys its own wrapper
|
|
19
|
+
// of each node by the node's id
|
|
20
|
+
/** The canvas node of a query node, or `null` when it isn't drawn */
|
|
21
|
+
export const TEST__queryCanvasNode = (nodeId, container = document) => container.querySelector(`.react-flow__node[data-id="${nodeId}"] [data-testid="${LEGEND_CUBE_TEST_ID.CANVAS_NODE}"]`);
|
|
22
|
+
/** The canvas node of a query node, once React Flow has drawn it */
|
|
23
|
+
export const TEST__findCanvasNode = async (nodeId, container = document) => {
|
|
24
|
+
let node = null;
|
|
25
|
+
await waitFor(() => {
|
|
26
|
+
node = TEST__queryCanvasNode(nodeId, container);
|
|
27
|
+
if (!node) {
|
|
28
|
+
throw new Error(`Node "${nodeId}" is not on the canvas`);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return node;
|
|
32
|
+
};
|
|
33
|
+
/** Every node drawn on the canvas */
|
|
34
|
+
export const TEST__getCanvasNodes = () => screen.queryAllByTestId(LEGEND_CUBE_TEST_ID.CANVAS_NODE);
|
|
35
|
+
/** The node's tooltip, one line an item: errors, warnings, description, id */
|
|
36
|
+
export const TEST__getCanvasNodeTooltip = (node) => (node.getAttribute('title') ?? '').split('\n');
|
|
37
|
+
//# sourceMappingURL=CubeCanvasTestUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeCanvasTestUtils.js","sourceRoot":"","sources":["../../src/__test-utils__/CubeCanvasTestUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,8EAA8E;AAC9E,gCAAgC;AAEhC,qEAAqE;AACrE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,MAAc,EACd,YAAwB,QAAQ,EACZ,EAAE,CACtB,SAAS,CAAC,aAAa,CACrB,8BAA8B,MAAM,oBAAoB,mBAAmB,CAAC,WAAW,IAAI,CAC5F,CAAC;AAEJ,oEAAoE;AACpE,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EACvC,MAAc,EACd,YAAwB,QAAQ,EACV,EAAE;IACxB,IAAI,IAAI,GAAuB,IAAI,CAAC;IACpC,MAAM,OAAO,CAAC,GAAG,EAAE;QACjB,IAAI,GAAG,qBAAqB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,SAAS,MAAM,wBAAwB,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,IAA8B,CAAC;AACxC,CAAC,CAAC;AAEF,qCAAqC;AACrC,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAkB,EAAE,CACtD,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;AAE3D,8EAA8E;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,IAAiB,EAAY,EAAE,CACxE,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
/** The commit of the engine the tests run against */
|
|
18
|
+
export declare const CUBE_ENGINE_TEST__getCommit: () => Promise<string>;
|
|
19
|
+
/**
|
|
20
|
+
* The protocol JSON the engine parses Pure lambda text into, read losslessly
|
|
21
|
+
* (a JSON parse would round large numbers) and without source information
|
|
22
|
+
*/
|
|
23
|
+
export declare const CUBE_ENGINE_TEST__grammarToJson_lambda: (code: string) => Promise<unknown>;
|
|
24
|
+
/** The relation types of a batch of lambdas: `{result, errors}`, keyed as the input */
|
|
25
|
+
export declare const CUBE_ENGINE_TEST__lambdaRelationTypeBatch: (input: object) => Promise<PlainObject>;
|
|
26
|
+
/** Compiles a model context; a model that doesn't compile is an HTTP 400 */
|
|
27
|
+
export declare const CUBE_ENGINE_TEST__compile: (model: object) => Promise<PlainObject>;
|
|
28
|
+
/** The Pure text of a lambda, as the engine renders it */
|
|
29
|
+
export declare const CUBE_ENGINE_TEST__jsonToGrammar_lambda: (lambda: PlainObject, renderStyle?: string | undefined) => Promise<string>;
|
|
30
|
+
/**
|
|
31
|
+
* Executes a query and gives the response as the client's `returnAsResponse`
|
|
32
|
+
* does, its body unread, so the lossless reader parses the raw text as it
|
|
33
|
+
* does in the browser. A body given as text (with lossless numbers) is sent
|
|
34
|
+
* as it is.
|
|
35
|
+
*/
|
|
36
|
+
export declare const CUBE_ENGINE_TEST__execute: (input: object | string) => Promise<{
|
|
37
|
+
ok: boolean;
|
|
38
|
+
status: number;
|
|
39
|
+
text: () => Promise<string>;
|
|
40
|
+
}>;
|
|
41
|
+
//# sourceMappingURL=CubeEngineTestSupport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeEngineTestSupport.d.ts","sourceRoot":"","sources":["../../src/__test-utils__/CubeEngineTestSupport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAa9B,qDAAqD;AACrD,eAAO,MAAM,2BAA2B,QAAa,OAAO,CAAC,MAAM,CAMlE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sCAAsC,GACjD,MAAM,MAAM,KACX,OAAO,CAAC,OAAO,CAcf,CAAC;AAEJ,uFAAuF;AACvF,eAAO,MAAM,yCAAyC,GACpD,OAAO,MAAM,KACZ,OAAO,CAAC,WAAW,CAOd,CAAC;AAET,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,GACpC,OAAO,MAAM,KACZ,OAAO,CAAC,WAAW,CAOd,CAAC;AAET,0DAA0D;AAC1D,eAAO,MAAM,sCAAsC,GACjD,QAAQ,WAAW,EACnB,cAAc,MAAM,GAAG,SAAS,KAC/B,OAAO,CAAC,MAAM,CAeT,CAAC;AAET;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,GACpC,OAAO,MAAM,GAAG,MAAM,KACrB,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,CAiBtE,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 axios, {} from 'axios';
|
|
17
|
+
import { ContentType, HttpHeader, parseLosslessJSON, } from '@finos/legend-shared';
|
|
18
|
+
import { ENGINE_TEST_SUPPORT_API_URL } from '@finos/legend-graph/test';
|
|
19
|
+
// Engine calls for Cube's engine tests (PLAN §3.4), as plain JSON. legend-graph's
|
|
20
|
+
// engine test support has no batch relation-type helper, and its `execute`
|
|
21
|
+
// parses the response, which would bypass Cube's lossless result reader
|
|
22
|
+
const PURE_API = `${ENGINE_TEST_SUPPORT_API_URL}/pure/v1`;
|
|
23
|
+
const JSON_HEADERS = {
|
|
24
|
+
[HttpHeader.CONTENT_TYPE]: ContentType.APPLICATION_JSON,
|
|
25
|
+
};
|
|
26
|
+
/** The commit of the engine the tests run against */
|
|
27
|
+
export const CUBE_ENGINE_TEST__getCommit = async () => {
|
|
28
|
+
const { data } = await axios.get(`${ENGINE_TEST_SUPPORT_API_URL}/server/v1/info`);
|
|
29
|
+
const info = data.info;
|
|
30
|
+
return info?.legendSDLC?.['git.commit.id'] ?? 'unknown';
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The protocol JSON the engine parses Pure lambda text into, read losslessly
|
|
34
|
+
* (a JSON parse would round large numbers) and without source information
|
|
35
|
+
*/
|
|
36
|
+
export const CUBE_ENGINE_TEST__grammarToJson_lambda = async (code) => parseLosslessJSON((await axios.post(`${PURE_API}/grammar/grammarToJson/lambda`, code, {
|
|
37
|
+
headers: { [HttpHeader.CONTENT_TYPE]: ContentType.TEXT_PLAIN },
|
|
38
|
+
params: { returnSourceInformation: false },
|
|
39
|
+
responseType: 'text',
|
|
40
|
+
transformResponse: (data) => data,
|
|
41
|
+
})).data);
|
|
42
|
+
/** The relation types of a batch of lambdas: `{result, errors}`, keyed as the input */
|
|
43
|
+
export const CUBE_ENGINE_TEST__lambdaRelationTypeBatch = async (input) => (await axios.post(`${PURE_API}/compilation/lambdaRelationType/batch`, input, { headers: JSON_HEADERS })).data;
|
|
44
|
+
/** Compiles a model context; a model that doesn't compile is an HTTP 400 */
|
|
45
|
+
export const CUBE_ENGINE_TEST__compile = async (model) => (await axios.post(`${PURE_API}/compilation/compile`, model, { headers: JSON_HEADERS })).data;
|
|
46
|
+
/** The Pure text of a lambda, as the engine renders it */
|
|
47
|
+
export const CUBE_ENGINE_TEST__jsonToGrammar_lambda = async (lambda, renderStyle) => (await axios.post(`${PURE_API}/grammar/jsonToGrammar/lambda`, lambda, {
|
|
48
|
+
headers: {
|
|
49
|
+
...JSON_HEADERS,
|
|
50
|
+
[HttpHeader.ACCEPT]: ContentType.TEXT_PLAIN,
|
|
51
|
+
},
|
|
52
|
+
params: { renderStyle },
|
|
53
|
+
responseType: 'text',
|
|
54
|
+
transformResponse: (data) => data,
|
|
55
|
+
})).data;
|
|
56
|
+
/**
|
|
57
|
+
* Executes a query and gives the response as the client's `returnAsResponse`
|
|
58
|
+
* does, its body unread, so the lossless reader parses the raw text as it
|
|
59
|
+
* does in the browser. A body given as text (with lossless numbers) is sent
|
|
60
|
+
* as it is.
|
|
61
|
+
*/
|
|
62
|
+
export const CUBE_ENGINE_TEST__execute = async (input) => {
|
|
63
|
+
const response = await axios.post(`${PURE_API}/execution/execute`, input, {
|
|
64
|
+
headers: JSON_HEADERS,
|
|
65
|
+
params: { serializationFormat: 'DEFAULT' },
|
|
66
|
+
responseType: 'text',
|
|
67
|
+
transformResponse: (data) => data,
|
|
68
|
+
validateStatus: () => true,
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
ok: response.status >= 200 && response.status < 300,
|
|
72
|
+
status: response.status,
|
|
73
|
+
text: async () => response.data,
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=CubeEngineTestSupport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeEngineTestSupport.js","sourceRoot":"","sources":["../../src/__test-utils__/CubeEngineTestSupport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AAClD,OAAO,EACL,WAAW,EACX,UAAU,EACV,iBAAiB,GAElB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEvE,kFAAkF;AAClF,2EAA2E;AAC3E,wEAAwE;AAExE,MAAM,QAAQ,GAAG,GAAG,2BAA2B,UAAU,CAAC;AAE1D,MAAM,YAAY,GAAG;IACnB,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,gBAAgB;CACxD,CAAC;AAEF,qDAAqD;AACrD,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,IAAqB,EAAE;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,KAAK,CAAC,GAAG,CAC9B,GAAG,2BAA2B,iBAAiB,CAChD,CAAC;IACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAA2D,CAAC;IAC9E,OAAO,IAAI,EAAE,UAAU,EAAE,CAAC,eAAe,CAAC,IAAI,SAAS,CAAC;AAC1D,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MA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CAC1C,CACF,CACF,CAAC,IAAI,CAAC;AAET;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,EAC5C,KAAsB,EACiD,EAAE;IACzE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAC/B,GAAG,QAAQ,oBAAoB,EAC/B,KAAK,EACL;QACE,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,EAAE,mBAAmB,EAAE,SAAS,EAAE;QAC1C,YAAY,EAAE,MAAM;QACpB,iBAAiB,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI;QACzC,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI;KAC3B,CACF,CAAC;IACF,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG;QACnD,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI;KAChC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 FilterRule, JoinType, Query, RelationalTableSource, SchemaColumn } from '@finos/legend-cube';
|
|
17
|
+
export declare const NORTHWIND_DATABASE = "showcase::northwind::store::NorthwindDatabase";
|
|
18
|
+
export declare const NORTHWIND_RUNTIME = "showcase::northwind::mapping::StoreRuntime";
|
|
19
|
+
export declare const ORDERS_COLUMNS: SchemaColumn[];
|
|
20
|
+
export declare const CUSTOMERS_COLUMNS: SchemaColumn[];
|
|
21
|
+
export declare const northwindTable: (id: string, name: string, columns: SchemaColumn[]) => RelationalTableSource;
|
|
22
|
+
/** France since 1997, by employees 1 and 4 (PLAN §8.5) */
|
|
23
|
+
export declare const SLICE_FILTER: FilterRule;
|
|
24
|
+
/** The slice (PLAN §8.5): ORDERS ⋈ CUSTOMERS on CUSTOMER_ID, then the filter, captured at the filter */
|
|
25
|
+
export declare const sliceQuery: (filter?: FilterRule, joinType?: JoinType) => Query;
|
|
26
|
+
/**
|
|
27
|
+
* ORDERS ⟗ a CUSTOMERS-like table on CUSTOMER_ID, nullable on both sides with
|
|
28
|
+
* different lengths (so `toOne()`, a merge and a cast), captured at the join
|
|
29
|
+
*/
|
|
30
|
+
export declare const fullJoinQuery: () => Query;
|
|
31
|
+
//# sourceMappingURL=CubeNorthwindTestQueries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNorthwindTestQueries.d.ts","sourceRoot":"","sources":["../../src/__test-utils__/CubeNorthwindTestQueries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAOL,KAAK,UAAU,EAEf,QAAQ,EAER,KAAK,EACL,qBAAqB,EAErB,YAAY,EACb,MAAM,oBAAoB,CAAC;AAK5B,eAAO,MAAM,kBAAkB,kDACkB,CAAC;AAClD,eAAO,MAAM,iBAAiB,+CAA+C,CAAC;AAiB9E,eAAO,MAAM,cAAc,gBAe1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBAY7B,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,SAAS,YAAY,EAAE,KACtB,qBAKA,CAAC;AAEJ,0DAA0D;AAC1D,eAAO,MAAM,YAAY,EAAE,UAiB1B,CAAC;AAEF,wGAAwG;AACxG,eAAO,MAAM,UAAU,GACrB,SAAQ,UAAyB,EACjC,mBAAyB,KACxB,KAkBA,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,KAmB9B,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
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 { ColumnComparisonFilter, CompositeFilter, CompositeFilterOperator, Connection, Filter, FilterOperator, Join, JoinType, PrimitiveType, Query, RelationalTableSource, Schema, SchemaColumn, } from '@finos/legend-cube';
|
|
17
|
+
// Cube queries over Northwind, typed as the engine types the Cube fixture
|
|
18
|
+
// (PLAN §8.5), for the serializer's and the engine's tests
|
|
19
|
+
export const NORTHWIND_DATABASE = 'showcase::northwind::store::NorthwindDatabase';
|
|
20
|
+
export const NORTHWIND_RUNTIME = 'showcase::northwind::mapping::StoreRuntime';
|
|
21
|
+
const P = 'meta::pure::precisePrimitives::';
|
|
22
|
+
const column = (name, path, nullable = true, params = []) => new SchemaColumn(name, PrimitiveType.get(path, params), nullable);
|
|
23
|
+
const varchar = (name, length, nullable = true) => column(name, `${P}Varchar`, nullable, [length]);
|
|
24
|
+
const smallInt = (name, nullable = true) => column(name, `${P}SmallInt`, nullable);
|
|
25
|
+
const date = (name) => column(name, 'StrictDate');
|
|
26
|
+
export const ORDERS_COLUMNS = [
|
|
27
|
+
smallInt('ORDER_ID', false),
|
|
28
|
+
varchar('CUSTOMER_ID', 5),
|
|
29
|
+
smallInt('EMPLOYEE_ID'),
|
|
30
|
+
date('ORDER_DATE'),
|
|
31
|
+
date('REQUIRED_DATE'),
|
|
32
|
+
date('SHIPPED_DATE'),
|
|
33
|
+
smallInt('SHIP_VIA'),
|
|
34
|
+
column('FREIGHT', `${P}Double`),
|
|
35
|
+
varchar('SHIP_NAME', 40),
|
|
36
|
+
varchar('SHIP_ADDRESS', 60),
|
|
37
|
+
varchar('SHIP_CITY', 15),
|
|
38
|
+
varchar('SHIP_REGION', 15),
|
|
39
|
+
varchar('SHIP_POSTAL_CODE', 10),
|
|
40
|
+
varchar('SHIP_COUNTRY', 15),
|
|
41
|
+
];
|
|
42
|
+
export const CUSTOMERS_COLUMNS = [
|
|
43
|
+
varchar('CUSTOMER_ID', 5, false),
|
|
44
|
+
varchar('COMPANY_NAME', 40, false),
|
|
45
|
+
varchar('CONTACT_NAME', 30),
|
|
46
|
+
varchar('CONTACT_TITLE', 30),
|
|
47
|
+
varchar('ADDRESS', 60),
|
|
48
|
+
varchar('CITY', 15),
|
|
49
|
+
varchar('REGION', 15),
|
|
50
|
+
varchar('POSTAL_CODE', 10),
|
|
51
|
+
varchar('COUNTRY', 15),
|
|
52
|
+
varchar('PHONE', 24),
|
|
53
|
+
varchar('FAX', 24),
|
|
54
|
+
];
|
|
55
|
+
export const northwindTable = (id, name, columns) => new RelationalTableSource(id, { database: NORTHWIND_DATABASE, schema: 'NORTHWIND', table: name }, { kind: 'resolved', schema: new Schema(columns) });
|
|
56
|
+
/** France since 1997, by employees 1 and 4 (PLAN §8.5) */
|
|
57
|
+
export const SLICE_FILTER = new CompositeFilter(CompositeFilterOperator.AND, [
|
|
58
|
+
new ColumnComparisonFilter('SHIP_COUNTRY', FilterOperator.EQUAL, {
|
|
59
|
+
kind: 'string',
|
|
60
|
+
value: 'France',
|
|
61
|
+
}),
|
|
62
|
+
new ColumnComparisonFilter('ORDER_DATE', FilterOperator.GREATER_THAN_OR_EQUAL, { kind: 'strictDate', value: '1997-01-01' }),
|
|
63
|
+
new ColumnComparisonFilter('EMPLOYEE_ID', FilterOperator.IN, [
|
|
64
|
+
{ kind: 'integer', value: '1' },
|
|
65
|
+
{ kind: 'integer', value: '4' },
|
|
66
|
+
]),
|
|
67
|
+
]);
|
|
68
|
+
/** The slice (PLAN §8.5): ORDERS ⋈ CUSTOMERS on CUSTOMER_ID, then the filter, captured at the filter */
|
|
69
|
+
export const sliceQuery = (filter = SLICE_FILTER, joinType = JoinType.INNER) => new Query([
|
|
70
|
+
northwindTable('relational101', 'ORDERS', ORDERS_COLUMNS),
|
|
71
|
+
northwindTable('relational102', 'CUSTOMERS', CUSTOMERS_COLUMNS),
|
|
72
|
+
new Join('join101', {
|
|
73
|
+
leftColumns: ['CUSTOMER_ID'],
|
|
74
|
+
rightColumns: ['CUSTOMER_ID'],
|
|
75
|
+
joinType,
|
|
76
|
+
}),
|
|
77
|
+
new Filter('filter101', filter),
|
|
78
|
+
], [
|
|
79
|
+
new Connection('relational101', 'join101', 'leftTds'),
|
|
80
|
+
new Connection('relational102', 'join101', 'rightTds'),
|
|
81
|
+
new Connection('join101', 'filter101', 'tds'),
|
|
82
|
+
], 'filter101');
|
|
83
|
+
/**
|
|
84
|
+
* ORDERS ⟗ a CUSTOMERS-like table on CUSTOMER_ID, nullable on both sides with
|
|
85
|
+
* different lengths (so `toOne()`, a merge and a cast), captured at the join
|
|
86
|
+
*/
|
|
87
|
+
export const fullJoinQuery = () => new Query([
|
|
88
|
+
northwindTable('relational101', 'ORDERS', ORDERS_COLUMNS),
|
|
89
|
+
northwindTable('relational102', 'CUSTOMERS', [
|
|
90
|
+
varchar('CUSTOMER_ID', 40),
|
|
91
|
+
varchar('COMPANY_NAME', 40),
|
|
92
|
+
]),
|
|
93
|
+
new Join('join101', {
|
|
94
|
+
leftColumns: ['CUSTOMER_ID'],
|
|
95
|
+
rightColumns: ['CUSTOMER_ID'],
|
|
96
|
+
joinType: JoinType.FULL_OUTER,
|
|
97
|
+
}),
|
|
98
|
+
], [
|
|
99
|
+
new Connection('relational101', 'join101', 'leftTds'),
|
|
100
|
+
new Connection('relational102', 'join101', 'rightTds'),
|
|
101
|
+
], 'join101');
|
|
102
|
+
//# sourceMappingURL=CubeNorthwindTestQueries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNorthwindTestQueries.js","sourceRoot":"","sources":["../../src/__test-utils__/CubeNorthwindTestQueries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,UAAU,EACV,MAAM,EACN,cAAc,EAEd,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,KAAK,EACL,qBAAqB,EACrB,MAAM,EACN,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B,0EAA0E;AAC1E,2DAA2D;AAE3D,MAAM,CAAC,MAAM,kBAAkB,GAC7B,+CAA+C,CAAC;AAClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,4CAA4C,CAAC;AAE9E,MAAM,CAAC,GAAG,iCAAiC,CAAC;AAE5C,MAAM,MAAM,GAAG,CACb,IAAY,EACZ,IAAY,EACZ,QAAQ,GAAG,IAAI,EACf,SAAmB,EAAE,EACP,EAAE,CAChB,IAAI,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;AACpE,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,MAAc,EAAE,QAAQ,GAAG,IAAI,EAAgB,EAAE,CAC9E,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC,MAAM,CA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AC;IACzD,cAAc,CAAC,eAAe,EAAE,WAAW,EAAE,iBAAiB,CAAC;IAC/D,IAAI,IAAI,CAAC,SAAS,EAAE;QAClB,WAAW,EAAE,CAAC,aAAa,CAAC;QAC5B,YAAY,EAAE,CAAC,aAAa,CAAC;QAC7B,QAAQ;KACT,CAAC;IACF,IAAI,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC;CAChC,EACD;IACE,IAAI,UAAU,CAAC,eAAe,EAAE,SAAS,EAAE,SAAS,CAAC;IACrD,IAAI,UAAU,CAAC,eAAe,EAAE,SAAS,EAAE,UAAU,CAAC;IACtD,IAAI,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC;CAC9C,EACD,WAAW,CACZ,CAAC;AAEJ;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAU,EAAE,CACvC,IAAI,KAAK,CACP;IACE,cAAc,CAAC,eAAe,EAAE,QAAQ,EAAE,cAAc,CAAC;IACzD,cAAc,CAAC,eAAe,EAAE,WAAW,EAAE;QAC3C,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;QAC1B,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;KAC5B,CAAC;IACF,IAAI,IAAI,CAAC,SAAS,EAAE;QAClB,WAAW,EAAE,CAAC,aAAa,CAAC;QAC5B,YAAY,EAAE,CAAC,aAAa,CAAC;QAC7B,QAAQ,EAAE,QAAQ,CAAC,UAAU;KAC9B,CAAC;CACH,EACD;IACE,IAAI,UAAU,CAAC,eAAe,EAAE,SAAS,EAAE,SAAS,CAAC;IACrD,IAAI,UAAU,CAAC,eAAe,EAAE,SAAS,EAAE,UAAU,CAAC;CACvD,EACD,SAAS,CACV,CAAC"}
|
|
@@ -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 GenericLegendApplicationStore } from '@finos/legend-application';
|
|
17
|
+
import type { CubeDocument } from '@finos/legend-cube';
|
|
18
|
+
import { type RenderResult } from '@testing-library/react';
|
|
19
|
+
import type { CubeEditorState } from '../stores/CubeEditorState.js';
|
|
20
|
+
/** Lets the canvas mount under jsdom; call before rendering it */
|
|
21
|
+
export declare const TEST__installCanvasDomStubs: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Renders an element inside a Legend application, as a host would, and waits
|
|
24
|
+
* for the element with the given test id: the framework renders nothing until
|
|
25
|
+
* the application store has initialized
|
|
26
|
+
*/
|
|
27
|
+
export declare const TEST__renderInCubeApplication: (element: React.ReactNode, applicationStore: GenericLegendApplicationStore, readyTestId: string) => Promise<RenderResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Imports a cube into a rendered page, as Import does, and waits for its
|
|
30
|
+
* tables to be typed again, so nothing changes after the test has ended
|
|
31
|
+
*/
|
|
32
|
+
export declare const TEST__importDocument: (editorState: CubeEditorState, document: CubeDocument, readOnly?: boolean) => Promise<void>;
|
|
33
|
+
//# sourceMappingURL=CubePageTestUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubePageTestUtils.d.ts","sourceRoot":"","sources":["../../src/__test-utils__/CubePageTestUtils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAEL,KAAK,YAAY,EAGlB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAkBpE,kEAAkE;AAClE,eAAO,MAAM,2BAA2B,QAAO,IAQ9C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GACxC,SAAS,KAAK,CAAC,SAAS,EACxB,kBAAkB,6BAA6B,EAC/C,aAAa,MAAM,KAClB,OAAO,CAAC,YAAY,CAWtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,aAAa,eAAe,EAC5B,UAAU,YAAY,EACtB,kBAAgB,KACf,OAAO,CAAC,IAAI,CAOd,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { ApplicationFrameworkProvider, ApplicationStoreProvider, } from '@finos/legend-application';
|
|
18
|
+
import { TEST__BrowserEnvironmentProvider } from '@finos/legend-application/test';
|
|
19
|
+
import { act, render, waitFor, } from '@testing-library/react';
|
|
20
|
+
/** React Flow watches the canvas with an IntersectionObserver, which jsdom lacks */
|
|
21
|
+
class TEST__IntersectionObserver {
|
|
22
|
+
observe() {
|
|
23
|
+
// nothing is ever in view under jsdom
|
|
24
|
+
}
|
|
25
|
+
unobserve() {
|
|
26
|
+
// nothing to stop watching
|
|
27
|
+
}
|
|
28
|
+
disconnect() {
|
|
29
|
+
// nothing to stop watching
|
|
30
|
+
}
|
|
31
|
+
takeRecords() {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Lets the canvas mount under jsdom; call before rendering it */
|
|
36
|
+
export const TEST__installCanvasDomStubs = () => {
|
|
37
|
+
if (!('IntersectionObserver' in window)) {
|
|
38
|
+
Object.defineProperty(window, 'IntersectionObserver', {
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: TEST__IntersectionObserver,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Renders an element inside a Legend application, as a host would, and waits
|
|
47
|
+
* for the element with the given test id: the framework renders nothing until
|
|
48
|
+
* the application store has initialized
|
|
49
|
+
*/
|
|
50
|
+
export const TEST__renderInCubeApplication = async (element, applicationStore, readyTestId) => {
|
|
51
|
+
TEST__installCanvasDomStubs();
|
|
52
|
+
const renderResult = render(_jsx(ApplicationStoreProvider, { store: applicationStore, children: _jsx(TEST__BrowserEnvironmentProvider, { initialEntries: ['/'], children: _jsx(ApplicationFrameworkProvider, { children: element }) }) }));
|
|
53
|
+
await waitFor(() => renderResult.getByTestId(readyTestId));
|
|
54
|
+
return renderResult;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Imports a cube into a rendered page, as Import does, and waits for its
|
|
58
|
+
* tables to be typed again, so nothing changes after the test has ended
|
|
59
|
+
*/
|
|
60
|
+
export const TEST__importDocument = async (editorState, document, readOnly = false) => {
|
|
61
|
+
act(() => editorState.importDocument(document, readOnly));
|
|
62
|
+
await waitFor(() => {
|
|
63
|
+
if (editorState.isResolvingSources) {
|
|
64
|
+
throw new Error('The imported tables are still being typed');
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=CubePageTestUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubePageTestUtils.js","sourceRoot":"","sources":["../../src/__test-utils__/CubePageTestUtils.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,GAEzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAElF,OAAO,EACL,GAAG,EAEH,MAAM,EACN,OAAO,GACR,MAAM,wBAAwB,CAAC;AAGhC,oFAAoF;AACpF,MAAM,0BAA0B;IAC9B,OAAO;QACL,sCAAsC;IACxC,CAAC;IACD,SAAS;QACP,2BAA2B;IAC7B,CAAC;IACD,UAAU;QACR,2BAA2B;IAC7B,CAAC;IACD,WAAW;QACT,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAED,kEAAkE;AAClE,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAS,EAAE;IACpD,IAAI,CAAC,CAAC,sBAAsB,IAAI,MAAM,CAAC,EAAE,CAAC;QACxC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,sBAAsB,EAAE;YACpD,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,0BAA0B;SAClC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,EAChD,OAAwB,EACxB,gBAA+C,EAC/C,WAAmB,EACI,EAAE;IACzB,2BAA2B,EAAE,CAAC;IAC9B,MAAM,YAAY,GAAG,MAAM,CACzB,KAAC,wBAAwB,IAAC,KAAK,EAAE,gBAAgB,YAC/C,KAAC,gCAAgC,IAAC,cAAc,EAAE,CAAC,GAAG,CAAC,YACrD,KAAC,4BAA4B,cAAE,OAAO,GAAgC,GACrC,GACV,CAC5B,CAAC;IACF,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;IAC3D,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EACvC,WAA4B,EAC5B,QAAsB,EACtB,QAAQ,GAAG,KAAK,EACD,EAAE;IACjB,GAAG,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC1D,MAAM,OAAO,CAAC,GAAG,EAAE;QACjB,IAAI,WAAW,CAAC,kBAAkB,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 GenericLegendApplicationStore, type LegendApplicationPlugin, LegendApplicationPluginManager } from '@finos/legend-application';
|
|
17
|
+
import type { CubeHost } from '../stores/CubeHost.js';
|
|
18
|
+
import { type FakeCubeEngine, type FakeCubeEngineAnswers } from './FakeCubeEngine.js';
|
|
19
|
+
export declare class TEST__LegendCubePluginManager extends LegendApplicationPluginManager<LegendApplicationPlugin> {
|
|
20
|
+
private constructor();
|
|
21
|
+
static create(): TEST__LegendCubePluginManager;
|
|
22
|
+
}
|
|
23
|
+
/** A fresh application store: build one per test, since it initializes once */
|
|
24
|
+
export declare const TEST__createCubeApplicationStore: (plugins?: LegendApplicationPlugin[]) => GenericLegendApplicationStore;
|
|
25
|
+
/** A host over a fake engine, with the bundled models */
|
|
26
|
+
export declare const TEST__createCubeHost: (answers?: FakeCubeEngineAnswers, applicationStore?: GenericLegendApplicationStore) => {
|
|
27
|
+
host: CubeHost;
|
|
28
|
+
fake: FakeCubeEngine;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=CubeTestApplication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeTestApplication.d.ts","sourceRoot":"","sources":["../../src/__test-utils__/CubeTestApplication.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,6BAA6B,EAElC,KAAK,uBAAuB,EAC5B,8BAA8B,EAC/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAK7B,qBAAa,6BAA8B,SAAQ,8BAA8B,CAAC,uBAAuB,CAAC;IACxG,OAAO;IAIP,MAAM,CAAC,MAAM,IAAI,6BAA6B;CAG/C;AAQD,+EAA+E;AAC/E,eAAO,MAAM,gCAAgC,GAC3C,UAAS,uBAAuB,EAAO,KACtC,6BAWF,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,oBAAoB,GAC/B,UAAU,qBAAqB,EAC/B,gDAAqD,KACpD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAUxC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { ApplicationStore, LegendApplicationConfig, LegendApplicationPluginManager, } from '@finos/legend-application';
|
|
17
|
+
import { TEST__getApplicationVersionData } from '@finos/legend-application/test';
|
|
18
|
+
import { LocalModelCatalog } from '../stores/LocalModelCatalog.js';
|
|
19
|
+
import { createFakeCubeEngine, } from './FakeCubeEngine.js';
|
|
20
|
+
// A bare Legend application for Cube's jsdom tests, as the data-space viewer's
|
|
21
|
+
// tests build theirs: the builder may not use the query builder's test helpers
|
|
22
|
+
export class TEST__LegendCubePluginManager extends LegendApplicationPluginManager {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
}
|
|
26
|
+
static create() {
|
|
27
|
+
return new TEST__LegendCubePluginManager();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
class TEST__LegendCubeApplicationConfig extends LegendApplicationConfig {
|
|
31
|
+
getDefaultApplicationStorageKey() {
|
|
32
|
+
return 'test';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** A fresh application store: build one per test, since it initializes once */
|
|
36
|
+
export const TEST__createCubeApplicationStore = (plugins = []) => {
|
|
37
|
+
const pluginManager = TEST__LegendCubePluginManager.create();
|
|
38
|
+
pluginManager.usePlugins(plugins).install();
|
|
39
|
+
return new ApplicationStore(new TEST__LegendCubeApplicationConfig({
|
|
40
|
+
configData: { env: 'TEST', appName: 'TEST' },
|
|
41
|
+
versionData: TEST__getApplicationVersionData(),
|
|
42
|
+
baseAddress: '/',
|
|
43
|
+
}), pluginManager);
|
|
44
|
+
};
|
|
45
|
+
/** A host over a fake engine, with the bundled models */
|
|
46
|
+
export const TEST__createCubeHost = (answers, applicationStore = TEST__createCubeApplicationStore()) => {
|
|
47
|
+
const fake = createFakeCubeEngine(answers);
|
|
48
|
+
return {
|
|
49
|
+
host: {
|
|
50
|
+
applicationStore,
|
|
51
|
+
engine: fake.engine,
|
|
52
|
+
modelCatalog: new LocalModelCatalog(fake.engine),
|
|
53
|
+
},
|
|
54
|
+
fake,
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=CubeTestApplication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeTestApplication.js","sourceRoot":"","sources":["../../src/__test-utils__/CubeTestApplication.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,gBAAgB,EAEhB,uBAAuB,EAEvB,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EACL,oBAAoB,GAGrB,MAAM,qBAAqB,CAAC;AAE7B,+EAA+E;AAC/E,+EAA+E;AAE/E,MAAM,OAAO,6BAA8B,SAAQ,8BAAuD;IACxG;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,6BAA6B,EAAE,CAAC;IAC7C,CAAC;CACF;AAED,MAAM,iCAAkC,SAAQ,uBAAuB;IAC5D,+BAA+B;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,UAAqC,EAAE,EACR,EAAE;IACjC,MAAM,aAAa,GAAG,6BAA6B,CAAC,MAAM,EAAE,CAAC;IAC7D,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IAC5C,OAAO,IAAI,gBAAgB,CACzB,IAAI,iCAAiC,CAAC;QACpC,UAAU,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;QAC5C,WAAW,EAAE,+BAA+B,EAAE;QAC9C,WAAW,EAAE,GAAG;KACjB,CAAC,EACF,aAAa,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,yDAAyD;AACzD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,OAA+B,EAC/B,gBAAgB,GAAG,gCAAgC,EAAE,EACX,EAAE;IAC5C,MAAM,IAAI,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO;QACL,IAAI,EAAE;YACJ,gBAAgB;YAChB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,YAAY,EAAE,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC;SACjD;QACD,IAAI;KACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 { jest } from '@jest/globals';
|
|
17
|
+
import { Schema } from '@finos/legend-cube';
|
|
18
|
+
import { type CubeEngine, type CubeModelOutline, type CubeResult } from '../graph-manager/CubeEngine.js';
|
|
19
|
+
/** Northwind as the fake knows it: two tables, one runtime keyed by the database */
|
|
20
|
+
export declare const FAKE_NORTHWIND_OUTLINE: CubeModelOutline;
|
|
21
|
+
/** The schemas the fake gives, keyed by `<schema>.<table>` as the outline names them */
|
|
22
|
+
export declare const FAKE_NORTHWIND_SCHEMAS: ReadonlyMap<string, Schema>;
|
|
23
|
+
export declare const EMPTY_CUBE_RESULT: CubeResult;
|
|
24
|
+
export interface FakeCubeEngineAnswers {
|
|
25
|
+
readonly outline?: CubeModelOutline;
|
|
26
|
+
/** keyed by `<schema>.<table>`; a table not in it gets a compile error */
|
|
27
|
+
readonly schemas?: ReadonlyMap<string, Schema>;
|
|
28
|
+
readonly result?: CubeResult;
|
|
29
|
+
readonly pure?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface FakeCubeEngine {
|
|
32
|
+
readonly engine: CubeEngine;
|
|
33
|
+
readonly loadModel: jest.Mock<CubeEngine['loadModel']>;
|
|
34
|
+
readonly resolveSchemas: jest.Mock<CubeEngine['resolveSchemas']>;
|
|
35
|
+
readonly typeLambdas: jest.Mock<CubeEngine['typeLambdas']>;
|
|
36
|
+
readonly execute: jest.Mock<CubeEngine['execute']>;
|
|
37
|
+
readonly renderPure: jest.Mock<CubeEngine['renderPure']>;
|
|
38
|
+
}
|
|
39
|
+
/** A fresh fake: build one per test, since jest.fn keeps its calls across tests */
|
|
40
|
+
export declare const createFakeCubeEngine: (answers?: FakeCubeEngineAnswers) => FakeCubeEngine;
|
|
41
|
+
//# sourceMappingURL=FakeCubeEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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