@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,136 @@
|
|
|
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 { getSameNamedJoinKeys, Join, JoinType, RelationalTableSource, } from '@finos/legend-cube';
|
|
17
|
+
import { action, makeObservable, observable } from 'mobx';
|
|
18
|
+
import { CubeNodeDraft } from './CubeNodeDraft.js';
|
|
19
|
+
let nextPairKey = 1;
|
|
20
|
+
const isSameList = (a, b) => a.length === b.length && a.every((name, index) => name === b[index]);
|
|
21
|
+
/** The key lists pairs build: a pair with no column picked is left out */
|
|
22
|
+
const toKeyLists = (pairs) => {
|
|
23
|
+
const kept = pairs.filter((pair) => pair.left || pair.right);
|
|
24
|
+
return [kept.map((pair) => pair.left), kept.map((pair) => pair.right)];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The Join editor's draft (spec §17.6): the join type and the key column
|
|
28
|
+
* pairs. A pair with no column picked on either side is left out when built,
|
|
29
|
+
* as a Filter's blank rows are (user's choice, 2026-10-07).
|
|
30
|
+
*/
|
|
31
|
+
export class CubeJoinDraft extends CubeNodeDraft {
|
|
32
|
+
joinType;
|
|
33
|
+
pairs;
|
|
34
|
+
/** Anything was changed; until then, `build()` gives the original back */
|
|
35
|
+
touched = false;
|
|
36
|
+
/**
|
|
37
|
+
* The key lists the pairs built before any edit, so edits undone by hand
|
|
38
|
+
* give the original back, even for saved lists of unequal length
|
|
39
|
+
*/
|
|
40
|
+
initialKeyLists;
|
|
41
|
+
constructor(original) {
|
|
42
|
+
super(original);
|
|
43
|
+
makeObservable(this, {
|
|
44
|
+
joinType: observable,
|
|
45
|
+
pairs: observable.ref,
|
|
46
|
+
touched: observable,
|
|
47
|
+
setJoinType: action,
|
|
48
|
+
addPair: action,
|
|
49
|
+
removePair: action,
|
|
50
|
+
setLeftColumn: action,
|
|
51
|
+
setRightColumn: action,
|
|
52
|
+
});
|
|
53
|
+
this.joinType = original.joinType;
|
|
54
|
+
this.pairs = Array.from({
|
|
55
|
+
length: Math.max(original.leftColumns.length, original.rightColumns.length),
|
|
56
|
+
}, (_, index) => ({
|
|
57
|
+
key: nextPairKey++,
|
|
58
|
+
left: original.leftColumns[index] ?? '',
|
|
59
|
+
right: original.rightColumns[index] ?? '',
|
|
60
|
+
}));
|
|
61
|
+
this.initialKeyLists = toKeyLists(this.pairs);
|
|
62
|
+
}
|
|
63
|
+
setJoinType(joinType) {
|
|
64
|
+
this.joinType = joinType;
|
|
65
|
+
this.touched = true;
|
|
66
|
+
}
|
|
67
|
+
addPair() {
|
|
68
|
+
this.pairs = [...this.pairs, { key: nextPairKey++, left: '', right: '' }];
|
|
69
|
+
this.touched = true;
|
|
70
|
+
}
|
|
71
|
+
removePair(key) {
|
|
72
|
+
this.pairs = this.pairs.filter((pair) => pair.key !== key);
|
|
73
|
+
this.touched = true;
|
|
74
|
+
}
|
|
75
|
+
setLeftColumn(key, left) {
|
|
76
|
+
this.pairs = this.pairs.map((pair) => pair.key === key ? { ...pair, left } : pair);
|
|
77
|
+
this.touched = true;
|
|
78
|
+
}
|
|
79
|
+
setRightColumn(key, right) {
|
|
80
|
+
this.pairs = this.pairs.map((pair) => pair.key === key ? { ...pair, right } : pair);
|
|
81
|
+
this.touched = true;
|
|
82
|
+
}
|
|
83
|
+
build() {
|
|
84
|
+
const [leftColumns, rightColumns] = toKeyLists(this.pairs);
|
|
85
|
+
const [initialLeft, initialRight] = this.initialKeyLists;
|
|
86
|
+
const { original } = this;
|
|
87
|
+
return !this.touched ||
|
|
88
|
+
(this.joinType === original.joinType &&
|
|
89
|
+
isSameList(leftColumns, initialLeft) &&
|
|
90
|
+
isSameList(rightColumns, initialRight))
|
|
91
|
+
? original
|
|
92
|
+
: original.withSettings({
|
|
93
|
+
joinType: this.joinType,
|
|
94
|
+
leftColumns,
|
|
95
|
+
rightColumns,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The table sources a column of a node's output comes from: followed back
|
|
101
|
+
* through the inputs whose output has the column. A join key of the same name
|
|
102
|
+
* on both sides comes from the side the join keeps (the left for INNER and
|
|
103
|
+
* LEFT OUTER, the right for RIGHT OUTER), and from both for FULL OUTER, which
|
|
104
|
+
* merges them.
|
|
105
|
+
*/
|
|
106
|
+
export const findColumnSources = (query, analysis, nodeId, columnName) => {
|
|
107
|
+
const node = query.getNode(nodeId);
|
|
108
|
+
if (node instanceof RelationalTableSource) {
|
|
109
|
+
return node.resolution.kind === 'resolved' &&
|
|
110
|
+
node.resolution.schema.lookup(columnName)
|
|
111
|
+
? [node]
|
|
112
|
+
: [];
|
|
113
|
+
}
|
|
114
|
+
const inputIds = query.getInputIds(nodeId);
|
|
115
|
+
const [leftId, rightId] = inputIds;
|
|
116
|
+
const followed = node instanceof Join &&
|
|
117
|
+
node.joinType !== JoinType.FULL_OUTER &&
|
|
118
|
+
getSameNamedJoinKeys(node.leftColumns, node.rightColumns).includes(columnName)
|
|
119
|
+
? [node.joinType === JoinType.RIGHT_OUTER ? rightId : leftId]
|
|
120
|
+
: inputIds;
|
|
121
|
+
return followed.flatMap((inputId) => inputId !== undefined && analysis.schemas.get(inputId)?.lookup(columnName)
|
|
122
|
+
? findColumnSources(query, analysis, inputId, columnName)
|
|
123
|
+
: []);
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Whether the column of the node's output comes from a table column whose
|
|
127
|
+
* type Cube can't read (OTHER or ARRAY), so it was typed as a bare String
|
|
128
|
+
* (PLAN §8.7). Unknown until the model's outline has loaded.
|
|
129
|
+
*/
|
|
130
|
+
export const isUntypedColumn = (outline, query, analysis, nodeId, columnName) => outline !== undefined &&
|
|
131
|
+
findColumnSources(query, analysis, nodeId, columnName).some((source) => outline.databases
|
|
132
|
+
.find((database) => database.path === source.database)
|
|
133
|
+
?.schemas.find((schema) => schema.name === source.schema)
|
|
134
|
+
?.tables.find((table) => table.name === source.table)
|
|
135
|
+
?.untypedColumns.includes(columnName));
|
|
136
|
+
//# sourceMappingURL=CubeJoinDraft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeJoinDraft.js","sourceRoot":"","sources":["../../../src/stores/editors/CubeJoinDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,oBAAoB,EACpB,IAAI,EACJ,QAAQ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A+B,EAC/B,MAAc,EACd,UAAkB,EACT,EAAE,CACX,OAAO,KAAK,SAAS;IACrB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CACrE,OAAO,CAAC,SAAS;SACd,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM,CAAC,QAAQ,CAAC;QACtD,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC;QACzD,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC;QACrD,EAAE,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,CACxC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { QueryNode } from '@finos/legend-cube';
|
|
17
|
+
/**
|
|
18
|
+
* The edits of one node in the side panel, kept until Apply (PLAN §7.4,
|
|
19
|
+
* spec §17.5). A node type's editor edits its draft, never the document:
|
|
20
|
+
* only the panel's Apply stores `build()`, as one undo step. A draft is
|
|
21
|
+
* made once each time the panel opens on a node, and again after an Apply.
|
|
22
|
+
*/
|
|
23
|
+
export declare abstract class CubeNodeDraft<N extends QueryNode = QueryNode> {
|
|
24
|
+
/** The node the draft was made from */
|
|
25
|
+
readonly original: N;
|
|
26
|
+
constructor(original: N);
|
|
27
|
+
/**
|
|
28
|
+
* The node Apply would store. Return `original` itself while nothing was
|
|
29
|
+
* edited; the panel also treats a node that saves the same as `original`
|
|
30
|
+
* as no change.
|
|
31
|
+
*/
|
|
32
|
+
abstract build(): N;
|
|
33
|
+
}
|
|
34
|
+
/** A node with nothing to edit in the panel, such as a source or an Unknown node */
|
|
35
|
+
export declare class CubeReadOnlyNodeDraft extends CubeNodeDraft {
|
|
36
|
+
build(): QueryNode;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=CubeNodeDraft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNodeDraft.d.ts","sourceRoot":"","sources":["../../../src/stores/editors/CubeNodeDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;;GAKG;AACH,8BAAsB,aAAa,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IACjE,uCAAuC;IACvC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAET,QAAQ,EAAE,CAAC;IAIvB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,IAAI,CAAC;CACpB;AAED,oFAAoF;AACpF,qBAAa,qBAAsB,SAAQ,aAAa;IACtD,KAAK,IAAI,SAAS;CAGnB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* The edits of one node in the side panel, kept until Apply (PLAN §7.4,
|
|
18
|
+
* spec §17.5). A node type's editor edits its draft, never the document:
|
|
19
|
+
* only the panel's Apply stores `build()`, as one undo step. A draft is
|
|
20
|
+
* made once each time the panel opens on a node, and again after an Apply.
|
|
21
|
+
*/
|
|
22
|
+
export class CubeNodeDraft {
|
|
23
|
+
/** The node the draft was made from */
|
|
24
|
+
original;
|
|
25
|
+
constructor(original) {
|
|
26
|
+
this.original = original;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** A node with nothing to edit in the panel, such as a source or an Unknown node */
|
|
30
|
+
export class CubeReadOnlyNodeDraft extends CubeNodeDraft {
|
|
31
|
+
build() {
|
|
32
|
+
return this.original;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=CubeNodeDraft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNodeDraft.js","sourceRoot":"","sources":["../../../src/stores/editors/CubeNodeDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;;;;;GAKG;AACH,MAAM,OAAgB,aAAa;IACjC,uCAAuC;IAC9B,QAAQ,CAAI;IAErB,YAAY,QAAW;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CAQF;AAED,oFAAoF;AACpF,MAAM,OAAO,qBAAsB,SAAQ,aAAa;IACtD,KAAK;QACH,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { type QueryNode } from '@finos/legend-cube';
|
|
17
|
+
import type { CubeEditorState } from '../CubeEditorState.js';
|
|
18
|
+
import { type CubeNodeDraft } from './CubeNodeDraft.js';
|
|
19
|
+
/** Makes the draft of a node of one type */
|
|
20
|
+
export type CubeNodeDraftFactory = (node: QueryNode, editorState: CubeEditorState) => CubeNodeDraft;
|
|
21
|
+
/**
|
|
22
|
+
* The draft of each node type the panel edits, by type (PLAN §7.4). A
|
|
23
|
+
* transform with an editor in `CUBE_NODE_EDITORS` has its factory here; a
|
|
24
|
+
* source, which has nothing to edit, has none, and so no Apply or Cancel.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CUBE_NODE_DRAFT_FACTORIES: ReadonlyMap<string, CubeNodeDraftFactory>;
|
|
27
|
+
/** The node's draft; a node with nothing to edit gets a read-only one */
|
|
28
|
+
export declare const createCubeNodeDraft: (node: QueryNode, editorState: CubeEditorState) => CubeNodeDraft;
|
|
29
|
+
//# sourceMappingURL=CubeNodeDraftRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNodeDraftRegistry.d.ts","sourceRoot":"","sources":["../../../src/stores/editors/CubeNodeDraftRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EAAE,KAAK,aAAa,EAAyB,MAAM,oBAAoB,CAAC;AAE/E,4CAA4C;AAC5C,MAAM,MAAM,oBAAoB,GAAG,CACjC,IAAI,EAAE,SAAS,EACf,WAAW,EAAE,eAAe,KACzB,aAAa,CAAC;AAEnB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,WAAW,CACjD,MAAM,EACN,oBAAoB,CAIpB,CAAC;AAEH,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,GAC9B,MAAM,SAAS,EACf,aAAa,eAAe,KAC3B,aAE8B,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 { Filter, Join } from '@finos/legend-cube';
|
|
17
|
+
import { guaranteeType } from '@finos/legend-shared';
|
|
18
|
+
import { CubeFilterDraft } from './CubeFilterDraft.js';
|
|
19
|
+
import { CubeJoinDraft } from './CubeJoinDraft.js';
|
|
20
|
+
import { CubeReadOnlyNodeDraft } from './CubeNodeDraft.js';
|
|
21
|
+
/**
|
|
22
|
+
* The draft of each node type the panel edits, by type (PLAN §7.4). A
|
|
23
|
+
* transform with an editor in `CUBE_NODE_EDITORS` has its factory here; a
|
|
24
|
+
* source, which has nothing to edit, has none, and so no Apply or Cancel.
|
|
25
|
+
*/
|
|
26
|
+
export const CUBE_NODE_DRAFT_FACTORIES = new Map([
|
|
27
|
+
[Filter.TYPE, (node) => new CubeFilterDraft(guaranteeType(node, Filter))],
|
|
28
|
+
[Join.TYPE, (node) => new CubeJoinDraft(guaranteeType(node, Join))],
|
|
29
|
+
]);
|
|
30
|
+
/** The node's draft; a node with nothing to edit gets a read-only one */
|
|
31
|
+
export const createCubeNodeDraft = (node, editorState) => CUBE_NODE_DRAFT_FACTORIES.get(node.type)?.(node, editorState) ??
|
|
32
|
+
new CubeReadOnlyNodeDraft(node);
|
|
33
|
+
//# sourceMappingURL=CubeNodeDraftRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNodeDraftRegistry.js","sourceRoot":"","sources":["../../../src/stores/editors/CubeNodeDraftRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAkB,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAsB,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAQ/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAGlC,IAAI,GAAG,CAA+B;IACxC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACzE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;CACpE,CAAC,CAAC;AAEH,yEAAyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,IAAe,EACf,WAA4B,EACb,EAAE,CACjB,yBAAyB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC;IAC7D,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { ModelContext } from '@finos/legend-cube';
|
|
17
|
+
export declare const CUBE_NORTHWIND_DATABASE = "showcase::northwind::store::NorthwindDatabase";
|
|
18
|
+
export declare const CUBE_NORTHWIND_CONNECTION = "showcase::northwind::connection::NorthwindConnection";
|
|
19
|
+
export declare const CUBE_NORTHWIND_RUNTIME = "showcase::northwind::mapping::StoreRuntime";
|
|
20
|
+
export declare const CUBE_NORTHWIND_MODEL_CODE: string;
|
|
21
|
+
/** The Cube Northwind fixture as a cube saves it (PLAN §6.2.2) */
|
|
22
|
+
export declare const CUBE_NORTHWIND_MODEL: ModelContext;
|
|
23
|
+
//# sourceMappingURL=CubeNorthwindModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNorthwindModel.d.ts","sourceRoot":"","sources":["../../../src/stores/fixtures/CubeNorthwindModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAUvD,eAAO,MAAM,uBAAuB,kDACa,CAAC;AAClD,eAAO,MAAM,yBAAyB,yDACkB,CAAC;AACzD,eAAO,MAAM,sBAAsB,+CACW,CAAC;AAwD/C,eAAO,MAAM,yBAAyB,QAqQrC,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,oBAAoB,EAAE,YAGjC,CAAC"}
|
|
@@ -0,0 +1,338 @@
|
|
|
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
|
+
// The Cube Northwind fixture (PLAN §6.2.4): a corrected copy of the Northwind
|
|
17
|
+
// Database of the query builder's tests, which is left as it is. Corrections:
|
|
18
|
+
// the money columns are REAL (they were OTHER, typed String); the binary
|
|
19
|
+
// columns are dropped; SHIPPERS.PHONE is nullable; the four *_REGION joins
|
|
20
|
+
// (text against SMALLINT) are removed. Schema CUBETEST adds the precise types
|
|
21
|
+
// Northwind lacks (ALLTYPES) and the tables Part A needs (§11.2), since the
|
|
22
|
+
// slice has only Source, Join and Filter nodes.
|
|
23
|
+
export const CUBE_NORTHWIND_DATABASE = 'showcase::northwind::store::NorthwindDatabase';
|
|
24
|
+
export const CUBE_NORTHWIND_CONNECTION = 'showcase::northwind::connection::NorthwindConnection';
|
|
25
|
+
export const CUBE_NORTHWIND_RUNTIME = 'showcase::northwind::mapping::StoreRuntime';
|
|
26
|
+
/**
|
|
27
|
+
* The H2 statements that set up the CUBETEST tables, run after Northwind's own
|
|
28
|
+
* data is loaded, on every connection checkout (so they start by dropping)
|
|
29
|
+
*/
|
|
30
|
+
const CUBETEST_SETUP_SQLS = [
|
|
31
|
+
'drop schema if exists CUBETEST cascade',
|
|
32
|
+
'create schema CUBETEST',
|
|
33
|
+
// every precise type; ID 3 has every nullable column NULL
|
|
34
|
+
'create table CUBETEST.ALLTYPES (ID INTEGER PRIMARY KEY, TI TINYINT, SI SMALLINT, BI BIGINT, F FLOAT, D DOUBLE, DEC DECIMAL(10,2), NUM NUMERIC(12,4), DT DATE, TS TIMESTAMP, B BIT, VC VARCHAR(20))',
|
|
35
|
+
"insert into CUBETEST.ALLTYPES values (1, 1, 100, 4, 1.5, 2.5, 12.34, 1.2345, '2024-01-02', '2024-01-02 03:04:05.678', true, 'abc')",
|
|
36
|
+
"insert into CUBETEST.ALLTYPES values (2, 2, 200, 9007199254740993, 2.5, 0.1, 1.25, 2.5, '2024-01-03', '2024-01-02 13:00:00', false, 'xyz')",
|
|
37
|
+
'insert into CUBETEST.ALLTYPES (ID) values (3)',
|
|
38
|
+
// a quoted, dotted table; read from Pure text, its path would split and
|
|
39
|
+
// reach the decoy (a table named CUBETEST in the default schema)
|
|
40
|
+
'create table CUBETEST."ORDER.LINES" (LINE_ID INTEGER PRIMARY KEY, RIGHT_COL VARCHAR(10))',
|
|
41
|
+
'insert into CUBETEST."ORDER.LINES" values (1, \'right\')',
|
|
42
|
+
'drop table if exists PUBLIC.CUBETEST',
|
|
43
|
+
'create table PUBLIC.CUBETEST (WRONG_TABLE VARCHAR(10))',
|
|
44
|
+
"insert into PUBLIC.CUBETEST values ('wrong')",
|
|
45
|
+
// tables the picker flags (§6.2.6); the model declares the problem types
|
|
46
|
+
'create table CUBETEST.PROBLEM_BINARY (ID INTEGER PRIMARY KEY, PAYLOAD BINARY(8))',
|
|
47
|
+
'insert into CUBETEST.PROBLEM_BINARY (ID) values (1)',
|
|
48
|
+
'create table CUBETEST.PROBLEM_CHAR (CODE CHAR(3) PRIMARY KEY, LABEL VARCHAR(10))',
|
|
49
|
+
"insert into CUBETEST.PROBLEM_CHAR values ('ABC', 'first')",
|
|
50
|
+
'create table CUBETEST.PROBLEM_OTHER (ID INTEGER PRIMARY KEY, O VARCHAR(10))',
|
|
51
|
+
"insert into CUBETEST.PROBLEM_OTHER values (1, '32.38')",
|
|
52
|
+
// narrow copies of Northwind columns, for joins the slice's nodes can build
|
|
53
|
+
'create table CUBETEST.EMP_REGION as select EMPLOYEE_ID, REGION from NORTHWIND.EMPLOYEES',
|
|
54
|
+
'create table CUBETEST.CUST_REGION as select CUSTOMER_ID, REGION from NORTHWIND.CUSTOMERS',
|
|
55
|
+
'create table CUBETEST.CATEGORY_REGION as select CATEGORY_ID, CATEGORY_NAME as SHIP_REGION from NORTHWIND.CATEGORIES',
|
|
56
|
+
// same-named keys differing only in their parameters, for the FULL casts
|
|
57
|
+
'create table CUBETEST.KEY_VC15 (K VARCHAR(15))',
|
|
58
|
+
"insert into CUBETEST.KEY_VC15 values ('AB'), ('ABCDEFGHIJ'), (null)",
|
|
59
|
+
'create table CUBETEST.KEY_VC2 (K VARCHAR(2))',
|
|
60
|
+
"insert into CUBETEST.KEY_VC2 values ('AB'), ('CD'), (null)",
|
|
61
|
+
'create table CUBETEST.KEY_DEC (K DECIMAL(10,2))',
|
|
62
|
+
'insert into CUBETEST.KEY_DEC values (1.25), (2.50)',
|
|
63
|
+
'create table CUBETEST.KEY_NUM (K NUMERIC(12,4))',
|
|
64
|
+
'insert into CUBETEST.KEY_NUM values (1.2500), (3.0000)',
|
|
65
|
+
];
|
|
66
|
+
/** A Pure string literal */
|
|
67
|
+
const pureString = (text) => `'${text.replaceAll('\\', '\\\\').replaceAll("'", "\\'")}'`;
|
|
68
|
+
const SETUP_SQLS = ['call loadNorthwindData()', ...CUBETEST_SETUP_SQLS]
|
|
69
|
+
.map((sql) => ` ${pureString(sql)}`)
|
|
70
|
+
.join(',\n');
|
|
71
|
+
export const CUBE_NORTHWIND_MODEL_CODE = `###Relational
|
|
72
|
+
Database ${CUBE_NORTHWIND_DATABASE}
|
|
73
|
+
(
|
|
74
|
+
Schema NORTHWIND
|
|
75
|
+
(
|
|
76
|
+
Table CATEGORIES
|
|
77
|
+
(
|
|
78
|
+
CATEGORY_ID SMALLINT PRIMARY KEY,
|
|
79
|
+
CATEGORY_NAME VARCHAR(15) NOT NULL,
|
|
80
|
+
DESCRIPTION VARCHAR(256)
|
|
81
|
+
)
|
|
82
|
+
Table CUSTOMERS
|
|
83
|
+
(
|
|
84
|
+
CUSTOMER_ID VARCHAR(5) PRIMARY KEY,
|
|
85
|
+
COMPANY_NAME VARCHAR(40) NOT NULL,
|
|
86
|
+
CONTACT_NAME VARCHAR(30),
|
|
87
|
+
CONTACT_TITLE VARCHAR(30),
|
|
88
|
+
ADDRESS VARCHAR(60),
|
|
89
|
+
CITY VARCHAR(15),
|
|
90
|
+
REGION VARCHAR(15),
|
|
91
|
+
POSTAL_CODE VARCHAR(10),
|
|
92
|
+
COUNTRY VARCHAR(15),
|
|
93
|
+
PHONE VARCHAR(24),
|
|
94
|
+
FAX VARCHAR(24)
|
|
95
|
+
)
|
|
96
|
+
Table CUSTOMER_CUSTOMER_DEMO
|
|
97
|
+
(
|
|
98
|
+
CUSTOMER_ID VARCHAR(5) PRIMARY KEY,
|
|
99
|
+
CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY
|
|
100
|
+
)
|
|
101
|
+
Table CUSTOMER_DEMOGRAPHICS
|
|
102
|
+
(
|
|
103
|
+
CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY,
|
|
104
|
+
CUSTOMER_DESC VARCHAR(256)
|
|
105
|
+
)
|
|
106
|
+
Table EMPLOYEES
|
|
107
|
+
(
|
|
108
|
+
EMPLOYEE_ID SMALLINT PRIMARY KEY,
|
|
109
|
+
LAST_NAME VARCHAR(20) NOT NULL,
|
|
110
|
+
FIRST_NAME VARCHAR(10) NOT NULL,
|
|
111
|
+
TITLE VARCHAR(30),
|
|
112
|
+
TITLE_OF_COURTESY VARCHAR(25),
|
|
113
|
+
BIRTH_DATE DATE,
|
|
114
|
+
HIRE_DATE DATE,
|
|
115
|
+
ADDRESS VARCHAR(60),
|
|
116
|
+
CITY VARCHAR(15),
|
|
117
|
+
REGION VARCHAR(15),
|
|
118
|
+
POSTAL_CODE VARCHAR(10),
|
|
119
|
+
COUNTRY VARCHAR(15),
|
|
120
|
+
HOME_PHONE VARCHAR(24),
|
|
121
|
+
EXTENSION VARCHAR(4),
|
|
122
|
+
REPORTS_TO SMALLINT,
|
|
123
|
+
PHOTO_PATH VARCHAR(255)
|
|
124
|
+
)
|
|
125
|
+
Table EMPLOYEE_TERRITORIES
|
|
126
|
+
(
|
|
127
|
+
EMPLOYEE_ID SMALLINT PRIMARY KEY,
|
|
128
|
+
TERRITORY_ID VARCHAR(20) PRIMARY KEY
|
|
129
|
+
)
|
|
130
|
+
Table ORDERS
|
|
131
|
+
(
|
|
132
|
+
ORDER_ID SMALLINT PRIMARY KEY,
|
|
133
|
+
CUSTOMER_ID VARCHAR(5),
|
|
134
|
+
EMPLOYEE_ID SMALLINT,
|
|
135
|
+
ORDER_DATE DATE,
|
|
136
|
+
REQUIRED_DATE DATE,
|
|
137
|
+
SHIPPED_DATE DATE,
|
|
138
|
+
SHIP_VIA SMALLINT,
|
|
139
|
+
FREIGHT REAL,
|
|
140
|
+
SHIP_NAME VARCHAR(40),
|
|
141
|
+
SHIP_ADDRESS VARCHAR(60),
|
|
142
|
+
SHIP_CITY VARCHAR(15),
|
|
143
|
+
SHIP_REGION VARCHAR(15),
|
|
144
|
+
SHIP_POSTAL_CODE VARCHAR(10),
|
|
145
|
+
SHIP_COUNTRY VARCHAR(15)
|
|
146
|
+
)
|
|
147
|
+
Table ORDER_DETAILS
|
|
148
|
+
(
|
|
149
|
+
ORDER_ID SMALLINT PRIMARY KEY,
|
|
150
|
+
PRODUCT_ID SMALLINT PRIMARY KEY,
|
|
151
|
+
UNIT_PRICE REAL NOT NULL,
|
|
152
|
+
QUANTITY SMALLINT NOT NULL,
|
|
153
|
+
DISCOUNT REAL NOT NULL
|
|
154
|
+
)
|
|
155
|
+
Table PRODUCTS
|
|
156
|
+
(
|
|
157
|
+
PRODUCT_ID SMALLINT PRIMARY KEY,
|
|
158
|
+
PRODUCT_NAME VARCHAR(40) NOT NULL,
|
|
159
|
+
SUPPLIER_ID SMALLINT,
|
|
160
|
+
CATEGORY_ID SMALLINT,
|
|
161
|
+
QUANTITY_PER_UNIT VARCHAR(20),
|
|
162
|
+
UNIT_PRICE REAL,
|
|
163
|
+
UNITS_IN_STOCK SMALLINT,
|
|
164
|
+
UNITS_ON_ORDER SMALLINT,
|
|
165
|
+
REORDER_LEVEL SMALLINT,
|
|
166
|
+
DISCONTINUED INTEGER NOT NULL
|
|
167
|
+
)
|
|
168
|
+
Table REGION
|
|
169
|
+
(
|
|
170
|
+
REGION_ID SMALLINT PRIMARY KEY,
|
|
171
|
+
REGION_DESCRIPTION VARCHAR(60) NOT NULL
|
|
172
|
+
)
|
|
173
|
+
Table SHIPPERS
|
|
174
|
+
(
|
|
175
|
+
SHIPPER_ID SMALLINT PRIMARY KEY,
|
|
176
|
+
COMPANY_NAME VARCHAR(40) NOT NULL,
|
|
177
|
+
PHONE VARCHAR(24)
|
|
178
|
+
)
|
|
179
|
+
Table SUPPLIERS
|
|
180
|
+
(
|
|
181
|
+
SUPPLIER_ID SMALLINT PRIMARY KEY,
|
|
182
|
+
COMPANY_NAME VARCHAR(40) NOT NULL,
|
|
183
|
+
CONTACT_NAME VARCHAR(30),
|
|
184
|
+
CONTACT_TITLE VARCHAR(30),
|
|
185
|
+
ADDRESS VARCHAR(60),
|
|
186
|
+
CITY VARCHAR(15),
|
|
187
|
+
REGION VARCHAR(15),
|
|
188
|
+
POSTAL_CODE VARCHAR(10),
|
|
189
|
+
COUNTRY VARCHAR(15),
|
|
190
|
+
PHONE VARCHAR(24),
|
|
191
|
+
FAX VARCHAR(24),
|
|
192
|
+
HOMEPAGE VARCHAR(256)
|
|
193
|
+
)
|
|
194
|
+
Table TERRITORIES
|
|
195
|
+
(
|
|
196
|
+
TERRITORY_ID VARCHAR(20) PRIMARY KEY,
|
|
197
|
+
TERRITORY_DESCRIPTION VARCHAR(60) NOT NULL,
|
|
198
|
+
REGION_ID SMALLINT NOT NULL
|
|
199
|
+
)
|
|
200
|
+
Table US_STATES
|
|
201
|
+
(
|
|
202
|
+
STATE_ID SMALLINT PRIMARY KEY,
|
|
203
|
+
STATE_NAME VARCHAR(100),
|
|
204
|
+
STATE_ABBR VARCHAR(2),
|
|
205
|
+
STATE_REGION VARCHAR(50)
|
|
206
|
+
)
|
|
207
|
+
)
|
|
208
|
+
Schema CUBETEST
|
|
209
|
+
(
|
|
210
|
+
Table ALLTYPES
|
|
211
|
+
(
|
|
212
|
+
ID INTEGER PRIMARY KEY,
|
|
213
|
+
TI TINYINT,
|
|
214
|
+
SI SMALLINT,
|
|
215
|
+
BI BIGINT,
|
|
216
|
+
F FLOAT,
|
|
217
|
+
D DOUBLE,
|
|
218
|
+
DEC DECIMAL(10, 2),
|
|
219
|
+
NUM NUMERIC(12, 4),
|
|
220
|
+
DT DATE,
|
|
221
|
+
TS TIMESTAMP,
|
|
222
|
+
B BIT,
|
|
223
|
+
VC VARCHAR(20)
|
|
224
|
+
)
|
|
225
|
+
Table "ORDER.LINES"
|
|
226
|
+
(
|
|
227
|
+
LINE_ID INTEGER PRIMARY KEY,
|
|
228
|
+
RIGHT_COL VARCHAR(10)
|
|
229
|
+
)
|
|
230
|
+
Table PROBLEM_BINARY
|
|
231
|
+
(
|
|
232
|
+
ID INTEGER PRIMARY KEY,
|
|
233
|
+
PAYLOAD BINARY(8)
|
|
234
|
+
)
|
|
235
|
+
Table PROBLEM_CHAR
|
|
236
|
+
(
|
|
237
|
+
CODE CHAR(3) PRIMARY KEY,
|
|
238
|
+
LABEL VARCHAR(10)
|
|
239
|
+
)
|
|
240
|
+
Table PROBLEM_OTHER
|
|
241
|
+
(
|
|
242
|
+
ID INTEGER PRIMARY KEY,
|
|
243
|
+
O OTHER
|
|
244
|
+
)
|
|
245
|
+
View PROBLEM_VIEW
|
|
246
|
+
(
|
|
247
|
+
ID: CUBETEST.ALLTYPES.ID PRIMARY KEY,
|
|
248
|
+
VC: CUBETEST.ALLTYPES.VC
|
|
249
|
+
)
|
|
250
|
+
Table EMP_REGION
|
|
251
|
+
(
|
|
252
|
+
EMPLOYEE_ID SMALLINT PRIMARY KEY,
|
|
253
|
+
REGION VARCHAR(15)
|
|
254
|
+
)
|
|
255
|
+
Table CUST_REGION
|
|
256
|
+
(
|
|
257
|
+
CUSTOMER_ID VARCHAR(5) PRIMARY KEY,
|
|
258
|
+
REGION VARCHAR(15)
|
|
259
|
+
)
|
|
260
|
+
Table CATEGORY_REGION
|
|
261
|
+
(
|
|
262
|
+
CATEGORY_ID SMALLINT PRIMARY KEY,
|
|
263
|
+
SHIP_REGION VARCHAR(15) NOT NULL
|
|
264
|
+
)
|
|
265
|
+
Table KEY_VC15
|
|
266
|
+
(
|
|
267
|
+
K VARCHAR(15)
|
|
268
|
+
)
|
|
269
|
+
Table KEY_VC2
|
|
270
|
+
(
|
|
271
|
+
K VARCHAR(2)
|
|
272
|
+
)
|
|
273
|
+
Table KEY_DEC
|
|
274
|
+
(
|
|
275
|
+
K DECIMAL(10, 2)
|
|
276
|
+
)
|
|
277
|
+
Table KEY_NUM
|
|
278
|
+
(
|
|
279
|
+
K NUMERIC(12, 4)
|
|
280
|
+
)
|
|
281
|
+
)
|
|
282
|
+
Table CUBETEST
|
|
283
|
+
(
|
|
284
|
+
WRONG_TABLE VARCHAR(10)
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
Join ORDERS_CUSTMERS(NORTHWIND.ORDERS.CUSTOMER_ID = NORTHWIND.CUSTOMERS.CUSTOMER_ID)
|
|
288
|
+
Join ORDERS_EMPLOYEES(NORTHWIND.ORDERS.EMPLOYEE_ID = NORTHWIND.EMPLOYEES.EMPLOYEE_ID)
|
|
289
|
+
Join ORDERS_SHIPPERS(NORTHWIND.ORDERS.SHIP_VIA = NORTHWIND.SHIPPERS.SHIPPER_ID)
|
|
290
|
+
Join ORDERS_ORDER_DETAILS(NORTHWIND.ORDERS.ORDER_ID = NORTHWIND.ORDER_DETAILS.ORDER_ID)
|
|
291
|
+
Join ORDERS_DETAILS_PRODUCTS(NORTHWIND.ORDER_DETAILS.PRODUCT_ID = NORTHWIND.PRODUCTS.PRODUCT_ID)
|
|
292
|
+
Join PRODUCTS_CATEGORIES(NORTHWIND.PRODUCTS.CATEGORY_ID = NORTHWIND.CATEGORIES.CATEGORY_ID)
|
|
293
|
+
Join PRODUCTS_SUPPLIERS(NORTHWIND.PRODUCTS.SUPPLIER_ID = NORTHWIND.SUPPLIERS.SUPPLIER_ID)
|
|
294
|
+
Join TERRITORIES_REGION(NORTHWIND.TERRITORIES.REGION_ID = NORTHWIND.REGION.REGION_ID)
|
|
295
|
+
Join EMPLOYEES_EMPLOYEE_TERRITORIES(NORTHWIND.EMPLOYEES.EMPLOYEE_ID = NORTHWIND.EMPLOYEE_TERRITORIES.EMPLOYEE_ID)
|
|
296
|
+
Join EMPLOYEE_TERRITORIES_TERRITORIES(NORTHWIND.EMPLOYEE_TERRITORIES.TERRITORY_ID = NORTHWIND.TERRITORIES.TERRITORY_ID)
|
|
297
|
+
Join CUSTOMER_CURSTOMER_DEMO(NORTHWIND.CUSTOMERS.CUSTOMER_ID = NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_ID)
|
|
298
|
+
Join CURSTOMER_DEMO_DEMOGRAPHICS(NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_TYPE_ID = NORTHWIND.CUSTOMER_DEMOGRAPHICS.CUSTOMER_TYPE_ID)
|
|
299
|
+
Join EMPLOYEE_REPORTS(NORTHWIND.EMPLOYEES.REPORTS_TO = {target}.EMPLOYEE_ID)
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
###Connection
|
|
304
|
+
RelationalDatabaseConnection ${CUBE_NORTHWIND_CONNECTION}
|
|
305
|
+
{
|
|
306
|
+
store: ${CUBE_NORTHWIND_DATABASE};
|
|
307
|
+
type: H2;
|
|
308
|
+
specification: LocalH2
|
|
309
|
+
{
|
|
310
|
+
testDataSetupSqls: [
|
|
311
|
+
${SETUP_SQLS}
|
|
312
|
+
];
|
|
313
|
+
};
|
|
314
|
+
auth: DefaultH2;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
###Runtime
|
|
319
|
+
Runtime ${CUBE_NORTHWIND_RUNTIME}
|
|
320
|
+
{
|
|
321
|
+
mappings:
|
|
322
|
+
[
|
|
323
|
+
];
|
|
324
|
+
connections:
|
|
325
|
+
[
|
|
326
|
+
${CUBE_NORTHWIND_DATABASE}:
|
|
327
|
+
[
|
|
328
|
+
connection_1: ${CUBE_NORTHWIND_CONNECTION}
|
|
329
|
+
]
|
|
330
|
+
];
|
|
331
|
+
}
|
|
332
|
+
`;
|
|
333
|
+
/** The Cube Northwind fixture as a cube saves it (PLAN §6.2.2) */
|
|
334
|
+
export const CUBE_NORTHWIND_MODEL = Object.freeze({
|
|
335
|
+
_type: 'text',
|
|
336
|
+
code: CUBE_NORTHWIND_MODEL_CODE,
|
|
337
|
+
});
|
|
338
|
+
//# sourceMappingURL=CubeNorthwindModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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