@finos/legend-application-data-cube 0.1.0

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.
Files changed (108) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +3 -0
  3. package/lib/application/Core_LegendDataCubeApplicationPlugin.d.ts +23 -0
  4. package/lib/application/Core_LegendDataCubeApplicationPlugin.d.ts.map +1 -0
  5. package/lib/application/Core_LegendDataCubeApplicationPlugin.js +35 -0
  6. package/lib/application/Core_LegendDataCubeApplicationPlugin.js.map +1 -0
  7. package/lib/application/Core_LegendDataCube_LegendApplicationPlugin.d.ts +19 -0
  8. package/lib/application/Core_LegendDataCube_LegendApplicationPlugin.d.ts.map +1 -0
  9. package/lib/application/Core_LegendDataCube_LegendApplicationPlugin.js +19 -0
  10. package/lib/application/Core_LegendDataCube_LegendApplicationPlugin.js.map +1 -0
  11. package/lib/application/LegendDataCube.d.ts +26 -0
  12. package/lib/application/LegendDataCube.d.ts.map +1 -0
  13. package/lib/application/LegendDataCube.js +41 -0
  14. package/lib/application/LegendDataCube.js.map +1 -0
  15. package/lib/application/LegendDataCubeApplicationConfig.d.ts +33 -0
  16. package/lib/application/LegendDataCubeApplicationConfig.d.ts.map +1 -0
  17. package/lib/application/LegendDataCubeApplicationConfig.js +36 -0
  18. package/lib/application/LegendDataCubeApplicationConfig.js.map +1 -0
  19. package/lib/application/LegendDataCubeApplicationPlugin.d.ts +26 -0
  20. package/lib/application/LegendDataCubeApplicationPlugin.d.ts.map +1 -0
  21. package/lib/application/LegendDataCubeApplicationPlugin.js +28 -0
  22. package/lib/application/LegendDataCubeApplicationPlugin.js.map +1 -0
  23. package/lib/application/LegendDataCubePluginManager.d.ts +32 -0
  24. package/lib/application/LegendDataCubePluginManager.d.ts.map +1 -0
  25. package/lib/application/LegendDataCubePluginManager.js +47 -0
  26. package/lib/application/LegendDataCubePluginManager.js.map +1 -0
  27. package/lib/components/DataCubeEditor.d.ts +19 -0
  28. package/lib/components/DataCubeEditor.d.ts.map +1 -0
  29. package/lib/components/DataCubeEditor.js +31 -0
  30. package/lib/components/DataCubeEditor.js.map +1 -0
  31. package/lib/components/LegendDataCubeFrameworkProvider.d.ts +25 -0
  32. package/lib/components/LegendDataCubeFrameworkProvider.d.ts.map +1 -0
  33. package/lib/components/LegendDataCubeFrameworkProvider.js +31 -0
  34. package/lib/components/LegendDataCubeFrameworkProvider.js.map +1 -0
  35. package/lib/components/LegendDataCubeWebApplication.d.ts +21 -0
  36. package/lib/components/LegendDataCubeWebApplication.d.ts.map +1 -0
  37. package/lib/components/LegendDataCubeWebApplication.js +29 -0
  38. package/lib/components/LegendDataCubeWebApplication.js.map +1 -0
  39. package/lib/components/source/DataCubeSourceEditor.d.ts +22 -0
  40. package/lib/components/source/DataCubeSourceEditor.d.ts.map +1 -0
  41. package/lib/components/source/DataCubeSourceEditor.js +43 -0
  42. package/lib/components/source/DataCubeSourceEditor.js.map +1 -0
  43. package/lib/components/source/SavedQuerySourceEditor.d.ts +22 -0
  44. package/lib/components/source/SavedQuerySourceEditor.d.ts.map +1 -0
  45. package/lib/components/source/SavedQuerySourceEditor.js +25 -0
  46. package/lib/components/source/SavedQuerySourceEditor.js.map +1 -0
  47. package/lib/index.css +17 -0
  48. package/lib/index.css.map +1 -0
  49. package/lib/index.d.ts +19 -0
  50. package/lib/index.d.ts.map +1 -0
  51. package/lib/index.js +19 -0
  52. package/lib/index.js.map +1 -0
  53. package/lib/package.json +81 -0
  54. package/lib/stores/LegendDataCubeEditorStore.d.ts +44 -0
  55. package/lib/stores/LegendDataCubeEditorStore.d.ts.map +1 -0
  56. package/lib/stores/LegendDataCubeEditorStore.js +91 -0
  57. package/lib/stores/LegendDataCubeEditorStore.js.map +1 -0
  58. package/lib/stores/engine/LegendExecutionDataCubeEngine.d.ts +46 -0
  59. package/lib/stores/engine/LegendExecutionDataCubeEngine.d.ts.map +1 -0
  60. package/lib/stores/engine/LegendExecutionDataCubeEngine.js +145 -0
  61. package/lib/stores/engine/LegendExecutionDataCubeEngine.js.map +1 -0
  62. package/lib/stores/source/CubeInputSource.d.ts +38 -0
  63. package/lib/stores/source/CubeInputSource.d.ts.map +1 -0
  64. package/lib/stores/source/CubeInputSource.js +40 -0
  65. package/lib/stores/source/CubeInputSource.js.map +1 -0
  66. package/lib/stores/source/CubeInputSourceLoader.d.ts +37 -0
  67. package/lib/stores/source/CubeInputSourceLoader.d.ts.map +1 -0
  68. package/lib/stores/source/CubeInputSourceLoader.js +40 -0
  69. package/lib/stores/source/CubeInputSourceLoader.js.map +1 -0
  70. package/lib/stores/source/LegendCubeViewer.d.ts +23 -0
  71. package/lib/stores/source/LegendCubeViewer.d.ts.map +1 -0
  72. package/lib/stores/source/LegendCubeViewer.js +24 -0
  73. package/lib/stores/source/LegendCubeViewer.js.map +1 -0
  74. package/lib/stores/source/LegendDataCubeSourceBuilder.d.ts +34 -0
  75. package/lib/stores/source/LegendDataCubeSourceBuilder.d.ts.map +1 -0
  76. package/lib/stores/source/LegendDataCubeSourceBuilder.js +70 -0
  77. package/lib/stores/source/LegendDataCubeSourceBuilder.js.map +1 -0
  78. package/lib/stores/source/SavedDepotInputSourceState.d.ts +47 -0
  79. package/lib/stores/source/SavedDepotInputSourceState.d.ts.map +1 -0
  80. package/lib/stores/source/SavedDepotInputSourceState.js +77 -0
  81. package/lib/stores/source/SavedDepotInputSourceState.js.map +1 -0
  82. package/lib/stores/source/SavedQueryInputSourceState.d.ts +35 -0
  83. package/lib/stores/source/SavedQueryInputSourceState.d.ts.map +1 -0
  84. package/lib/stores/source/SavedQueryInputSourceState.js +81 -0
  85. package/lib/stores/source/SavedQueryInputSourceState.js.map +1 -0
  86. package/package.json +81 -0
  87. package/src/application/Core_LegendDataCubeApplicationPlugin.ts +38 -0
  88. package/src/application/Core_LegendDataCube_LegendApplicationPlugin.ts +19 -0
  89. package/src/application/LegendDataCube.tsx +70 -0
  90. package/src/application/LegendDataCubeApplicationConfig.ts +74 -0
  91. package/src/application/LegendDataCubeApplicationPlugin.ts +30 -0
  92. package/src/application/LegendDataCubePluginManager.ts +66 -0
  93. package/src/components/DataCubeEditor.tsx +93 -0
  94. package/src/components/LegendDataCubeFrameworkProvider.tsx +70 -0
  95. package/src/components/LegendDataCubeWebApplication.tsx +45 -0
  96. package/src/components/source/DataCubeSourceEditor.tsx +133 -0
  97. package/src/components/source/SavedQuerySourceEditor.tsx +62 -0
  98. package/src/index.ts +19 -0
  99. package/src/stores/LegendDataCubeEditorStore.ts +120 -0
  100. package/src/stores/engine/LegendExecutionDataCubeEngine.ts +257 -0
  101. package/src/stores/source/CubeInputSource.ts +47 -0
  102. package/src/stores/source/CubeInputSourceLoader.ts +56 -0
  103. package/src/stores/source/LegendCubeViewer.ts +28 -0
  104. package/src/stores/source/LegendDataCubeSourceBuilder.ts +98 -0
  105. package/src/stores/source/SavedDepotInputSourceState.ts +103 -0
  106. package/src/stores/source/SavedQueryInputSourceState.ts +144 -0
  107. package/tsconfig.json +82 -0
  108. package/tsconfig.package.json +54 -0
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "@finos/legend-application-data-cube",
3
+ "version": "0.1.0",
4
+ "description": "Legend Data Cube application core",
5
+ "keywords": [
6
+ "legend",
7
+ "legend-application",
8
+ "legend-data-cube"
9
+ ],
10
+ "homepage": "https://github.com/finos/legend-studio/tree/master/packages/legend-application-data-cube",
11
+ "bugs": {
12
+ "url": "https://github.com/finos/legend-studio/issues"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/finos/legend-studio.git",
17
+ "directory": "packages/legend-application-data-cube"
18
+ },
19
+ "license": "Apache-2.0",
20
+ "sideEffects": false,
21
+ "type": "module",
22
+ "exports": {
23
+ ".": "./lib/index.js",
24
+ "./lib/index.css": "./lib/index.css"
25
+ },
26
+ "module": "lib/index.js",
27
+ "types": "lib/index.d.ts",
28
+ "scripts": {
29
+ "build": "yarn clean && yarn build:sass && yarn build:ts",
30
+ "build:sass": "cross-env INIT_CWD=$INIT_CWD node ../../scripts/workflow/buildSass.js",
31
+ "build:ts": "tsc --project ./tsconfig.build.json",
32
+ "clean": "npm-run-all clean:cache clean:lib",
33
+ "clean:cache": "rimraf \"build\"",
34
+ "clean:lib": "rimraf \"lib\"",
35
+ "dev": "npm-run-all --parallel dev:sass dev:ts",
36
+ "dev:sass": "sass style:lib --watch --load-path=../../node_modules/@finos/legend-art/scss",
37
+ "dev:ts": "tsc --watch --preserveWatchOutput",
38
+ "lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location ./build/.eslintcache --report-unused-disable-directives --parser-options=project:\"./tsconfig.json\" \"./src/**/*.{js,ts,tsx}\"",
39
+ "publish:prepare": "node ../../scripts/release/preparePublishContent.js",
40
+ "publish:snapshot": "node ../../scripts/release/publishDevSnapshot.js",
41
+ "test": "jest",
42
+ "test:watch": "jest --watch"
43
+ },
44
+ "dependencies": {
45
+ "@finos/legend-application": "workspace:*",
46
+ "@finos/legend-art": "workspace:*",
47
+ "@finos/legend-code-editor": "workspace:*",
48
+ "@finos/legend-data-cube": "workspace:*",
49
+ "@finos/legend-graph": "workspace:*",
50
+ "@finos/legend-query-builder": "workspace:*",
51
+ "@finos/legend-server-depot": "workspace:*",
52
+ "@finos/legend-shared": "workspace:*",
53
+ "@finos/legend-storage": "workspace:*",
54
+ "@types/react": "18.3.12",
55
+ "@types/react-dom": "18.3.1",
56
+ "mobx": "6.13.5",
57
+ "mobx-react-lite": "4.0.7",
58
+ "react": "18.3.1",
59
+ "react-dom": "18.3.1"
60
+ },
61
+ "devDependencies": {
62
+ "@finos/legend-dev-utils": "workspace:*",
63
+ "@jest/globals": "29.7.0",
64
+ "cross-env": "7.0.3",
65
+ "eslint": "9.15.0",
66
+ "jest": "29.7.0",
67
+ "npm-run-all": "4.1.5",
68
+ "rimraf": "6.0.1",
69
+ "sass": "1.81.0",
70
+ "typescript": "5.6.3"
71
+ },
72
+ "peerDependencies": {
73
+ "react": "^18.0.0"
74
+ },
75
+ "publishConfig": {
76
+ "directory": "build/publishContent"
77
+ },
78
+ "extensions": {
79
+ "applicationDataCubePlugin": "@finos/legend-application-data-cube-plugin-core"
80
+ }
81
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Copyright (c) 2020-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 ApplicationStore } from '@finos/legend-application';
17
+ import type { LegendDataCubePluginManager } from '../application/LegendDataCubePluginManager.js';
18
+ import { DepotServerClient } from '@finos/legend-server-depot';
19
+ import type { LegendDataCubeApplicationConfig } from '../application/LegendDataCubeApplicationConfig.js';
20
+ import { GraphManagerState } from '@finos/legend-graph';
21
+ import { LegendDataCubeSourceBuilder } from './source/LegendDataCubeSourceBuilder.js';
22
+ import { ActionState, type GeneratorFn } from '@finos/legend-shared';
23
+ import { LegendCubeViewer } from './source/LegendCubeViewer.js';
24
+ import type { CubeInputSource } from './source/CubeInputSource.js';
25
+ import type { DataCubeEngine } from '@finos/legend-data-cube';
26
+ export type LegendDataCubeApplicationStore = ApplicationStore<LegendDataCubeApplicationConfig, LegendDataCubePluginManager>;
27
+ export declare class LegendDataCubeStoreContext {
28
+ readonly applicationStore: LegendDataCubeApplicationStore;
29
+ readonly depotServerClient: DepotServerClient;
30
+ readonly graphManagerState: GraphManagerState;
31
+ initState: ActionState;
32
+ constructor(applicationStore: LegendDataCubeApplicationStore);
33
+ initialize(): GeneratorFn<void>;
34
+ }
35
+ export declare class LegendDataCubeStore {
36
+ readonly applicationStore: LegendDataCubeApplicationStore;
37
+ readonly context: LegendDataCubeStoreContext;
38
+ readonly pluginManager: LegendDataCubePluginManager;
39
+ sourceSelector: LegendDataCubeSourceBuilder;
40
+ cubeViewer: LegendCubeViewer | undefined;
41
+ constructor(applicationStore: LegendDataCubeApplicationStore);
42
+ initializeView(source: CubeInputSource, engine: DataCubeEngine): void;
43
+ }
44
+ //# sourceMappingURL=LegendDataCubeEditorStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendDataCubeEditorStore.d.ts","sourceRoot":"","sources":["../../src/stores/LegendDataCubeEditorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AACzG,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EACL,WAAW,EAEX,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,MAAM,8BAA8B,GAAG,gBAAgB,CAC3D,+BAA+B,EAC/B,2BAA2B,CAC5B,CAAC;AAEF,qBAAa,0BAA0B;IACrC,QAAQ,CAAC,gBAAgB,EAAE,8BAA8B,CAAC;IAC1D,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,SAAS,cAAwB;gBAErB,gBAAgB,EAAE,8BAA8B;IAiB3D,UAAU,IAAI,WAAW,CAAC,IAAI,CAAC;CAgCjC;AAED,qBAAa,mBAAmB;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,8BAA8B,CAAC;IAC1D,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC;IAC7C,QAAQ,CAAC,aAAa,EAAE,2BAA2B,CAAC;IACpD,cAAc,EAAE,2BAA2B,CAAC;IAC5C,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAC;gBAE7B,gBAAgB,EAAE,8BAA8B;IAY5D,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI;CAGtE"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Copyright (c) 2020-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 { DEFAULT_TAB_SIZE, } from '@finos/legend-application';
17
+ import { DepotServerClient } from '@finos/legend-server-depot';
18
+ import { GraphManagerState } from '@finos/legend-graph';
19
+ import { LegendDataCubeSourceBuilder } from './source/LegendDataCubeSourceBuilder.js';
20
+ import { ActionState, assertErrorThrown, } from '@finos/legend-shared';
21
+ import { action, flow, makeObservable, observable } from 'mobx';
22
+ import { LegendCubeViewer } from './source/LegendCubeViewer.js';
23
+ export class LegendDataCubeStoreContext {
24
+ applicationStore;
25
+ depotServerClient;
26
+ graphManagerState;
27
+ initState = ActionState.create();
28
+ constructor(applicationStore) {
29
+ makeObservable(this, {
30
+ initialize: flow,
31
+ initState: observable,
32
+ });
33
+ // server
34
+ this.depotServerClient = new DepotServerClient({
35
+ serverUrl: applicationStore.config.depotServerUrl,
36
+ });
37
+ this.depotServerClient.setTracerService(applicationStore.tracerService);
38
+ this.graphManagerState = new GraphManagerState(applicationStore.pluginManager, applicationStore.logService);
39
+ this.applicationStore = applicationStore;
40
+ }
41
+ *initialize() {
42
+ if (!this.initState.isInInitialState) {
43
+ return;
44
+ }
45
+ try {
46
+ this.initState.inProgress();
47
+ // TODO: when we genericize the way to initialize an application page
48
+ this.applicationStore.assistantService.setIsHidden(true);
49
+ // initialize the graph manager
50
+ yield this.graphManagerState.graphManager.initialize({
51
+ env: this.applicationStore.config.env,
52
+ tabSize: DEFAULT_TAB_SIZE,
53
+ clientConfig: {
54
+ baseUrl: this.applicationStore.config.engineServerUrl,
55
+ queryBaseUrl: this.applicationStore.config.engineQueryServerUrl,
56
+ enableCompression: true,
57
+ },
58
+ }, {
59
+ tracerService: this.applicationStore.tracerService,
60
+ });
61
+ this.initState.pass();
62
+ }
63
+ catch (error) {
64
+ assertErrorThrown(error);
65
+ this.applicationStore.notificationService.notifyError(error);
66
+ this.initState.fail();
67
+ }
68
+ }
69
+ }
70
+ export class LegendDataCubeStore {
71
+ applicationStore;
72
+ context;
73
+ pluginManager;
74
+ sourceSelector;
75
+ cubeViewer;
76
+ constructor(applicationStore) {
77
+ makeObservable(this, {
78
+ cubeViewer: observable,
79
+ sourceSelector: observable,
80
+ initializeView: action,
81
+ });
82
+ this.applicationStore = applicationStore;
83
+ this.pluginManager = applicationStore.pluginManager;
84
+ this.context = new LegendDataCubeStoreContext(applicationStore);
85
+ this.sourceSelector = new LegendDataCubeSourceBuilder(this.context);
86
+ }
87
+ initializeView(source, engine) {
88
+ this.cubeViewer = new LegendCubeViewer(source, engine);
89
+ }
90
+ }
91
+ //# sourceMappingURL=LegendDataCubeEditorStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendDataCubeEditorStore.js","sourceRoot":"","sources":["../../src/stores/LegendDataCubeEditorStore.ts"],"names":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GAAG,IAAI,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;QAChE,IAAI,CAAC,cAAc,GAAG,IAAI,2BAA2B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtE,CAAC;IAED,cAAc,CAAC,MAAuB,EAAE,MAAsB;QAC5D,IAAI,CAAC,UAAU,GAAG,IAAI,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;CACF"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { V1_AppliedFunction, V1_Lambda, RawLambda, TDSExecutionResult, type GraphManagerState, type PureModel, type V1_ValueSpecification, type ParameterValue } from '@finos/legend-graph';
17
+ import { DataCubeEngine, DataCubeSource, type RelationType, type DataCubeInitialInput, type CompletionItem } from '@finos/legend-data-cube';
18
+ import { LogService } from '@finos/legend-shared';
19
+ export declare class LegendExecutionDataCubeEngine extends DataCubeEngine {
20
+ readonly logService: LogService;
21
+ readonly graphState: GraphManagerState;
22
+ readonly selectInitialQuery: RawLambda;
23
+ readonly mappingPath: string | undefined;
24
+ readonly parameterValues: ParameterValue[] | undefined;
25
+ readonly runtimePath: string;
26
+ _parameters: object | undefined;
27
+ constructor(selectQuery: RawLambda, parameterValues: ParameterValue[] | undefined, mappingPath: string | undefined, runtimePath: string, graphManagerState: GraphManagerState);
28
+ get sourceLabel(): string;
29
+ getInitialInput(): Promise<DataCubeInitialInput>;
30
+ buildBaseQuery(): Promise<DataCubeInitialInput>;
31
+ get graph(): PureModel;
32
+ private buildRawLambdaFromValueSpec;
33
+ getQueryTypeahead(code: string, baseQuery: V1_Lambda, source: DataCubeSource): Promise<CompletionItem[]>;
34
+ parseValueSpecification(code: string, returnSourceInformation?: boolean): Promise<V1_ValueSpecification>;
35
+ getValueSpecificationCode(value: V1_ValueSpecification, pretty?: boolean | undefined): Promise<string>;
36
+ private getRelationalType;
37
+ getQueryRelationType(query: V1_Lambda, source: DataCubeSource): Promise<RelationType>;
38
+ getQueryCodeRelationReturnType(code: string, baseQuery: V1_ValueSpecification, source: DataCubeSource): Promise<RelationType>;
39
+ executeQuery(query: V1_Lambda, source: DataCubeSource): Promise<{
40
+ result: TDSExecutionResult;
41
+ executedQuery: string;
42
+ executedSQL: string;
43
+ }>;
44
+ buildExecutionContext(source: DataCubeSource): V1_AppliedFunction | undefined;
45
+ }
46
+ //# sourceMappingURL=LegendExecutionDataCubeEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendExecutionDataCubeEngine.d.ts","sourceRoot":"","sources":["../../../src/stores/engine/LegendExecutionDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,kBAAkB,EAClB,SAAS,EACT,SAAS,EAET,kBAAkB,EAKlB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,cAAc,EACd,cAAc,EACd,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EAGpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAgC,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOhF,qBAAa,6BAA8B,SAAQ,cAAc;IAC/D,QAAQ,CAAC,UAAU,aAAoB;IACvC,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC;IACvC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,C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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 { SUPPORTED_FUNCTIONS, V1_AppliedFunction, V1_Lambda, RawLambda, RelationalExecutionActivities, TDSExecutionResult, V1_deserializeRawValueSpecification, V1_deserializeValueSpecification, V1_RawLambda, V1_serializeValueSpecification, } from '@finos/legend-graph';
17
+ import { _elementPtr, _functionName, DataCubeEngine, DataCubeSource, DataCubeQuery, _function, DataCubeFunction, } from '@finos/legend-data-cube';
18
+ import { guaranteeType, isNonNullable, LogService } from '@finos/legend-shared';
19
+ class QueryBuilderDataCubeSource extends DataCubeSource {
20
+ mapping;
21
+ runtime;
22
+ }
23
+ export class LegendExecutionDataCubeEngine extends DataCubeEngine {
24
+ logService = new LogService();
25
+ graphState;
26
+ selectInitialQuery;
27
+ mappingPath;
28
+ parameterValues;
29
+ runtimePath;
30
+ _parameters;
31
+ constructor(selectQuery, parameterValues, mappingPath, runtimePath, graphManagerState) {
32
+ super();
33
+ this.graphState = graphManagerState;
34
+ this.selectInitialQuery = selectQuery;
35
+ this.mappingPath = mappingPath;
36
+ this.runtimePath = runtimePath;
37
+ this.parameterValues = parameterValues;
38
+ }
39
+ get sourceLabel() {
40
+ return `Query Builder Report`;
41
+ }
42
+ getInitialInput() {
43
+ return this.buildBaseQuery();
44
+ }
45
+ async buildBaseQuery() {
46
+ let srcFuncExp = V1_deserializeValueSpecification(this.graphState.graphManager.serializeRawValueSpecification(this.selectInitialQuery), []);
47
+ // We could do a further check here to ensure the experssion is an applied funciton
48
+ // this is because data cube expects an expression to be able to built further upon the queery
49
+ if (srcFuncExp instanceof V1_Lambda &&
50
+ srcFuncExp.body.length === 1 &&
51
+ srcFuncExp.body[0]) {
52
+ srcFuncExp = srcFuncExp.body[0];
53
+ }
54
+ this._parameters = this.selectInitialQuery.parameters;
55
+ const fromFuncExp = new V1_AppliedFunction();
56
+ fromFuncExp.function = _functionName(SUPPORTED_FUNCTIONS.FROM);
57
+ fromFuncExp.parameters = [srcFuncExp];
58
+ if (this.mappingPath) {
59
+ fromFuncExp.parameters.push(_elementPtr(this.mappingPath));
60
+ }
61
+ if (this.runtimePath) {
62
+ fromFuncExp.parameters.push(_elementPtr(this.runtimePath));
63
+ }
64
+ const columns = (await this.getRelationalType(this.selectInitialQuery))
65
+ .columns;
66
+ const query = new DataCubeQuery();
67
+ query.query = `~[${columns.map((e) => `'${e.name}'`)}]->select()`;
68
+ const source = new QueryBuilderDataCubeSource();
69
+ source.sourceColumns = columns;
70
+ source.mapping = this.mappingPath;
71
+ source.runtime = this.runtimePath;
72
+ source.query = srcFuncExp;
73
+ return {
74
+ query,
75
+ source,
76
+ };
77
+ }
78
+ get graph() {
79
+ return this.graphState.graph;
80
+ }
81
+ buildRawLambdaFromValueSpec(query) {
82
+ const json = guaranteeType(V1_deserializeRawValueSpecification(V1_serializeValueSpecification(query, [])), V1_RawLambda);
83
+ return new RawLambda(json.parameters, json.body);
84
+ }
85
+ async getQueryTypeahead(code, baseQuery, source) {
86
+ const lambda = this.buildRawLambdaFromValueSpec(baseQuery);
87
+ const queryString = await this.graphState.graphManager.lambdaToPureCode(lambda);
88
+ let codeBlock = queryString + code;
89
+ if (codeBlock[0] === '|') {
90
+ codeBlock = codeBlock.substring(1);
91
+ }
92
+ const result = await this.graphState.graphManager.getCodeComplete(codeBlock, this.graph, undefined);
93
+ return result.completions;
94
+ }
95
+ async parseValueSpecification(code, returnSourceInformation) {
96
+ return V1_deserializeValueSpecification(await this.graphState.graphManager.pureCodeToValueSpecification(code, returnSourceInformation), []);
97
+ }
98
+ getValueSpecificationCode(value, pretty) {
99
+ return this.graphState.graphManager.valueSpecificationToPureCode(V1_serializeValueSpecification(value, []), pretty);
100
+ }
101
+ async getRelationalType(query) {
102
+ const relationType = await this.graphState.graphManager.getLambdaRelationType(query, this.graph);
103
+ return relationType;
104
+ }
105
+ getQueryRelationType(query, source) {
106
+ const lambda = this.buildRawLambdaFromValueSpec(query);
107
+ return this.getRelationalType(lambda);
108
+ }
109
+ async getQueryCodeRelationReturnType(code, baseQuery, source) {
110
+ const queryString = await this.graphState.graphManager.valueSpecificationToPureCode(V1_serializeValueSpecification(baseQuery, []));
111
+ const fullQuery = queryString + code;
112
+ return this.getRelationalType(await this.graphState.graphManager.pureCodeToLambda(fullQuery));
113
+ }
114
+ async executeQuery(query, source) {
115
+ const lambda = this.buildRawLambdaFromValueSpec(query);
116
+ lambda.parameters = this._parameters;
117
+ const [executionWithMetadata, queryString] = await Promise.all([
118
+ this.graphState.graphManager.runQuery(lambda, undefined, undefined, this.graph, {
119
+ parameterValues: this.parameterValues ?? [],
120
+ }),
121
+ this.graphState.graphManager.lambdaToPureCode(lambda),
122
+ ]);
123
+ const expectedTDS = guaranteeType(executionWithMetadata.executionResult, TDSExecutionResult, 'Query returned expected to be of tabular data set');
124
+ const sql = expectedTDS.activities?.[0];
125
+ let sqlString = '### NO SQL FOUND';
126
+ if (sql instanceof RelationalExecutionActivities) {
127
+ sqlString = sql.sql;
128
+ }
129
+ return {
130
+ result: expectedTDS,
131
+ executedQuery: queryString,
132
+ executedSQL: sqlString,
133
+ };
134
+ }
135
+ buildExecutionContext(source) {
136
+ if (source instanceof QueryBuilderDataCubeSource) {
137
+ return _function(DataCubeFunction.FROM, [
138
+ source.mapping ? _elementPtr(source.mapping) : undefined,
139
+ _elementPtr(source.runtime),
140
+ ].filter(isNonNullable));
141
+ }
142
+ return undefined;
143
+ }
144
+ }
145
+ //# sourceMappingURL=LegendExecutionDataCubeEngine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendExecutionDataCubeEngine.js","sourceRoot":"","sources":["../../../src/stores/engine/LegendExecutionDataCubeEngine.ts"],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EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC7D,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CACnC,MAAM,EACN,SAAS,EACT,SAAS,EACT,IAAI,CAAC,KAAK,EACV;gBACE,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,EAAE;aAC5C,CACF;YACD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,gBAAgB,CAAC,MAAM,CAAC;SACtD,CAAC,CAAC;QACH,MAAM,WAAW,GAAG,aAAa,CAC/B,qBAAqB,CAAC,eAAe,EACrC,kBAAkB,EAClB,mDAAmD,CACpD,CAAC;QACF,MAAM,GAAG,GAAG,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,IAAI,SAAS,GAAG,kBAAkB,CAAC;QACnC,IAAI,GAAG,YAAY,6BAA6B,EAAE,CAAC;YACjD,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC;QACtB,CAAC;QACD,OAAO;YACL,MAAM,EAAE,WAAW;YACnB,aAAa,EAAE,WAAW;YAC1B,WAAW,EAAE,SAAS;SACvB,CAAC;IACJ,CAAC;IAEQ,qBAAqB,CAC5B,MAAsB;QAEtB,IAAI,MAAM,YAAY,0BAA0B,EAAE,CAAC;YACjD,OAAO,SAAS,CACd,gBAAgB,CAAC,IAAI,EACrB;gBACE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;gBACxD,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC;aAC5B,CAAC,MAAM,CAAC,aAAa,CAAC,CACxB,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Copyright (c) 2020-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 { VersionedProjectData } from '@finos/legend-server-depot';
17
+ export declare abstract class CubeInputSource {
18
+ }
19
+ export declare abstract class LegendDepotSavedSource {
20
+ project: VersionedProjectData;
21
+ }
22
+ export declare class LegendSavedQuerySource extends CubeInputSource {
23
+ id: string;
24
+ constructor(id: string);
25
+ }
26
+ export declare class LegendDepotService extends LegendDepotSavedSource {
27
+ service: string;
28
+ }
29
+ export declare class LegendDepotFunction extends LegendDepotSavedSource {
30
+ _function: string;
31
+ }
32
+ export declare class LegendDepotTable extends LegendDepotSavedSource {
33
+ database: string;
34
+ schema: string;
35
+ table: string;
36
+ runtime: string;
37
+ }
38
+ //# sourceMappingURL=CubeInputSource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeInputSource.d.ts","sourceRoot":"","sources":["../../../src/stores/source/CubeInputSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,8BAAsB,eAAe;CAAG;AAExC,8BAAsB,sBAAsB;IAC1C,OAAO,EAAG,oBAAoB,CAAC;CAChC;AAED,qBAAa,sBAAuB,SAAQ,eAAe;IACzD,EAAE,EAAE,MAAM,CAAC;gBAEC,EAAE,EAAE,MAAM;CAIvB;AAED,qBAAa,kBAAmB,SAAQ,sBAAsB;IAC5D,OAAO,EAAG,MAAM,CAAC;CAClB;AAED,qBAAa,mBAAoB,SAAQ,sBAAsB;IAC7D,SAAS,EAAG,MAAM,CAAC;CACpB;AAED,qBAAa,gBAAiB,SAAQ,sBAAsB;IAC1D,QAAQ,EAAG,MAAM,CAAC;IAClB,MAAM,EAAG,MAAM,CAAC;IAChB,KAAK,EAAG,MAAM,CAAC;IACf,OAAO,EAAG,MAAM,CAAC;CAClB"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright (c) 2020-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
+ export class CubeInputSource {
17
+ }
18
+ export class LegendDepotSavedSource {
19
+ project;
20
+ }
21
+ export class LegendSavedQuerySource extends CubeInputSource {
22
+ id;
23
+ constructor(id) {
24
+ super();
25
+ this.id = id;
26
+ }
27
+ }
28
+ export class LegendDepotService extends LegendDepotSavedSource {
29
+ service;
30
+ }
31
+ export class LegendDepotFunction extends LegendDepotSavedSource {
32
+ _function;
33
+ }
34
+ export class LegendDepotTable extends LegendDepotSavedSource {
35
+ database;
36
+ schema;
37
+ table;
38
+ runtime;
39
+ }
40
+ //# sourceMappingURL=CubeInputSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeInputSource.js","sourceRoot":"","sources":["../../../src/stores/source/CubeInputSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,OAAgB,eAAe;CAAG;AAExC,MAAM,OAAgB,sBAAsB;IAC1C,OAAO,CAAwB;CAChC;AAED,MAAM,OAAO,sBAAuB,SAAQ,eAAe;IACzD,EAAE,CAAS;IAEX,YAAY,EAAU;QACpB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAC5D,OAAO,CAAU;CAClB;AAED,MAAM,OAAO,mBAAoB,SAAQ,sBAAsB;IAC7D,SAAS,CAAU;CACpB;AAED,MAAM,OAAO,gBAAiB,SAAQ,sBAAsB;IAC1D,QAAQ,CAAU;IAClB,MAAM,CAAU;IAChB,KAAK,CAAU;IACf,OAAO,CAAU;CAClB"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Copyright (c) 2020-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 { ActionState } from '@finos/legend-shared';
17
+ import { type CubeInputSource } from './CubeInputSource.js';
18
+ import type { DataCubeEngine } from '@finos/legend-data-cube';
19
+ import type { LegendDataCubeStoreContext } from '../LegendDataCubeEditorStore.js';
20
+ export declare enum DataCubeSourceType {
21
+ LEGEND_QUERY = "Legend Query",
22
+ DEPOT_QUERY = "Depot Query"
23
+ }
24
+ export declare abstract class CubeInputSourceState {
25
+ buildCubeEngineState: ActionState;
26
+ setupActionState: ActionState;
27
+ readonly context: LegendDataCubeStoreContext;
28
+ constructor(context: LegendDataCubeStoreContext);
29
+ abstract get label(): DataCubeSourceType;
30
+ setup(): Promise<void>;
31
+ abstract buildCubeEngine(): Promise<DataCubeEngine | undefined>;
32
+ abstract process(): CubeInputSource;
33
+ abstract get isValid(): boolean;
34
+ get openActionable(): boolean;
35
+ static builder(context: LegendDataCubeStoreContext): CubeInputSourceState;
36
+ }
37
+ //# sourceMappingURL=CubeInputSourceLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeInputSourceLoader.d.ts","sourceRoot":"","sources":["../../../src/stores/source/CubeInputSourceLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAA6B,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAElF,oBAAY,kBAAkB;IAC5B,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;CAC5B;AAED,8BAAsB,oBAAoB;IACxC,oBAAoB,cAAwB;IAE5C,gBAAgB,cAAwB;IAExC,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC;gBAEjC,OAAO,EAAE,0BAA0B;IAG/C,QAAQ,KAAK,KAAK,IAAI,kBAAkB,CAAC;IAEnC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,QAAQ,CAAC,eAAe,IAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAE/D,QAAQ,CAAC,OAAO,IAAI,eAAe;IAEnC,QAAQ,KAAK,OAAO,IAAI,OAAO,CAAC;IAEhC,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,0BAA0B,GAAG,oBAAoB;CAG1E"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright (c) 2020-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 { ActionState, UnsupportedOperationError } from '@finos/legend-shared';
17
+ import {} from './CubeInputSource.js';
18
+ export var DataCubeSourceType;
19
+ (function (DataCubeSourceType) {
20
+ DataCubeSourceType["LEGEND_QUERY"] = "Legend Query";
21
+ DataCubeSourceType["DEPOT_QUERY"] = "Depot Query";
22
+ })(DataCubeSourceType || (DataCubeSourceType = {}));
23
+ export class CubeInputSourceState {
24
+ buildCubeEngineState = ActionState.create();
25
+ setupActionState = ActionState.create();
26
+ context;
27
+ constructor(context) {
28
+ this.context = context;
29
+ }
30
+ async setup() {
31
+ this.setupActionState.complete();
32
+ }
33
+ get openActionable() {
34
+ return true;
35
+ }
36
+ static builder(context) {
37
+ throw new UnsupportedOperationError('No builder');
38
+ }
39
+ }
40
+ //# sourceMappingURL=CubeInputSourceLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeInputSourceLoader.js","sourceRoot":"","sources":["../../../src/stores/source/CubeInputSourceLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAwB,MAAM,sBAAsB,CAAC;AAI5D,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,mDAA6B,CAAA;IAC7B,iDAA2B,CAAA;AAC7B,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,OAAgB,oBAAoB;IACxC,oBAAoB,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;IAE5C,gBAAgB,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;IAE/B,OAAO,CAA6B;IAE7C,YAAY,OAAmC;QAC7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAGD,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;IAQD,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,OAAmC;QAChD,MAAM,IAAI,yBAAyB,CAAC,YAAY,CAAC,CAAC;IACpD,CAAC;CACF"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2020-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 { DataCubeEngine } from '@finos/legend-data-cube';
17
+ import type { CubeInputSource } from './CubeInputSource.js';
18
+ export declare class LegendCubeViewer {
19
+ source: CubeInputSource;
20
+ engine: DataCubeEngine;
21
+ constructor(source: CubeInputSource, engine: DataCubeEngine);
22
+ }
23
+ //# sourceMappingURL=LegendCubeViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendCubeViewer.d.ts","sourceRoot":"","sources":["../../../src/stores/source/LegendCubeViewer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,qBAAa,gBAAgB;IAC3B,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,cAAc,CAAC;gBAEX,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc;CAI5D"}