@finos/legend-application-data-cube 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__lib__/LegendDataCubeNavigation.d.ts +2 -0
- package/lib/__lib__/LegendDataCubeNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendDataCubeNavigation.js +2 -0
- package/lib/__lib__/LegendDataCubeNavigation.js.map +1 -1
- package/lib/application/LegendDataCubeApplicationConfig.d.ts +4 -0
- package/lib/application/LegendDataCubeApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendDataCubeApplicationConfig.js +5 -0
- package/lib/application/LegendDataCubeApplicationConfig.js.map +1 -1
- package/lib/application/__test-utils__/LegendDataCubeApplicationTestUtils.d.ts +18 -0
- package/lib/application/__test-utils__/LegendDataCubeApplicationTestUtils.d.ts.map +1 -0
- package/lib/application/__test-utils__/LegendDataCubeApplicationTestUtils.js +48 -0
- package/lib/application/__test-utils__/LegendDataCubeApplicationTestUtils.js.map +1 -0
- package/lib/components/LegendDataCubeBlockingWindow.d.ts +2 -1
- package/lib/components/LegendDataCubeBlockingWindow.d.ts.map +1 -1
- package/lib/components/LegendDataCubeBlockingWindow.js +8 -3
- package/lib/components/LegendDataCubeBlockingWindow.js.map +1 -1
- package/lib/components/__test-utils__/LegendDataCubeStoreTestUtils.d.ts +42 -0
- package/lib/components/__test-utils__/LegendDataCubeStoreTestUtils.d.ts.map +1 -0
- package/lib/components/__test-utils__/LegendDataCubeStoreTestUtils.js +104 -0
- package/lib/components/__test-utils__/LegendDataCubeStoreTestUtils.js.map +1 -0
- package/lib/components/builder/LegendDataCubeBuilder.d.ts +5 -0
- package/lib/components/builder/LegendDataCubeBuilder.d.ts.map +1 -1
- package/lib/components/builder/LegendDataCubeBuilder.js +26 -5
- package/lib/components/builder/LegendDataCubeBuilder.js.map +1 -1
- package/lib/components/builder/LegendDataCubeBuilderStoreProvider.d.ts.map +1 -1
- package/lib/components/builder/LegendDataCubeBuilderStoreProvider.js +1 -1
- package/lib/components/builder/LegendDataCubeBuilderStoreProvider.js.map +1 -1
- package/lib/components/builder/LegendDataCubePartialSourceLoader.d.ts +19 -0
- package/lib/components/builder/LegendDataCubePartialSourceLoader.d.ts.map +1 -0
- package/lib/components/builder/LegendDataCubePartialSourceLoader.js +50 -0
- package/lib/components/builder/LegendDataCubePartialSourceLoader.js.map +1 -0
- package/lib/components/builder/LegendDataCubeSourceViewer.d.ts.map +1 -1
- package/lib/components/builder/LegendDataCubeSourceViewer.js +61 -1
- package/lib/components/builder/LegendDataCubeSourceViewer.js.map +1 -1
- package/lib/components/builder/source/LocalFileDataCubeSourceBuilder.d.ts.map +1 -1
- package/lib/components/builder/source/LocalFileDataCubeSourceBuilder.js +1 -2
- package/lib/components/builder/source/LocalFileDataCubeSourceBuilder.js.map +1 -1
- package/lib/components/builder/source/loader/LocalFileDataCubePartialSourceLoader.d.ts +22 -0
- package/lib/components/builder/source/loader/LocalFileDataCubePartialSourceLoader.d.ts.map +1 -0
- package/lib/components/builder/source/loader/LocalFileDataCubePartialSourceLoader.js +28 -0
- package/lib/components/builder/source/loader/LocalFileDataCubePartialSourceLoader.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +3 -1
- package/lib/stores/LegendDataCubeBaseStore.d.ts +2 -1
- package/lib/stores/LegendDataCubeBaseStore.d.ts.map +1 -1
- package/lib/stores/LegendDataCubeBaseStore.js +6 -3
- package/lib/stores/LegendDataCubeBaseStore.js.map +1 -1
- package/lib/stores/LegendDataCubeDataCubeEngine.d.ts +6 -3
- package/lib/stores/LegendDataCubeDataCubeEngine.d.ts.map +1 -1
- package/lib/stores/LegendDataCubeDataCubeEngine.js +127 -106
- package/lib/stores/LegendDataCubeDataCubeEngine.js.map +1 -1
- package/lib/stores/LegendDataCubeDuckDBEngine.d.ts +11 -4
- package/lib/stores/LegendDataCubeDuckDBEngine.d.ts.map +1 -1
- package/lib/stores/LegendDataCubeDuckDBEngine.js +83 -16
- package/lib/stores/LegendDataCubeDuckDBEngine.js.map +1 -1
- package/lib/stores/builder/LegendDataCubeBuilderStore.d.ts +4 -0
- package/lib/stores/builder/LegendDataCubeBuilderStore.d.ts.map +1 -1
- package/lib/stores/builder/LegendDataCubeBuilderStore.js +58 -17
- package/lib/stores/builder/LegendDataCubeBuilderStore.js.map +1 -1
- package/lib/stores/builder/LegendDataCubeLoaderState.d.ts +11 -2
- package/lib/stores/builder/LegendDataCubeLoaderState.d.ts.map +1 -1
- package/lib/stores/builder/LegendDataCubeLoaderState.js +28 -1
- package/lib/stores/builder/LegendDataCubeLoaderState.js.map +1 -1
- package/lib/stores/builder/LegendDataCubeSourceLoaderState.d.ts +44 -0
- package/lib/stores/builder/LegendDataCubeSourceLoaderState.d.ts.map +1 -0
- package/lib/stores/builder/LegendDataCubeSourceLoaderState.js +101 -0
- package/lib/stores/builder/LegendDataCubeSourceLoaderState.js.map +1 -0
- package/lib/stores/builder/source/LocalFileDataCubeSourceBuilderState.d.ts +3 -2
- package/lib/stores/builder/source/LocalFileDataCubeSourceBuilderState.d.ts.map +1 -1
- package/lib/stores/builder/source/LocalFileDataCubeSourceBuilderState.js +7 -10
- package/lib/stores/builder/source/LocalFileDataCubeSourceBuilderState.js.map +1 -1
- package/lib/stores/builder/source/loader/LegendDataCubePartialSourceLoaderState.d.ts +29 -0
- package/lib/stores/builder/source/loader/LegendDataCubePartialSourceLoaderState.d.ts.map +1 -0
- package/lib/stores/builder/source/loader/LegendDataCubePartialSourceLoaderState.js +25 -0
- package/lib/stores/builder/source/loader/LegendDataCubePartialSourceLoaderState.js.map +1 -0
- package/lib/stores/builder/source/loader/LocalFileDataCubePartialSourceLoaderState.d.ts +43 -0
- package/lib/stores/builder/source/loader/LocalFileDataCubePartialSourceLoaderState.d.ts.map +1 -0
- package/lib/stores/builder/source/loader/LocalFileDataCubePartialSourceLoaderState.js +142 -0
- package/lib/stores/builder/source/loader/LocalFileDataCubePartialSourceLoaderState.js.map +1 -0
- package/lib/stores/model/LegendQueryDataCubeSource.d.ts +2 -1
- package/lib/stores/model/LegendQueryDataCubeSource.d.ts.map +1 -1
- package/lib/stores/model/LegendQueryDataCubeSource.js +1 -0
- package/lib/stores/model/LegendQueryDataCubeSource.js.map +1 -1
- package/lib/stores/model/LocalFileDataCubeSource.d.ts +3 -8
- package/lib/stores/model/LocalFileDataCubeSource.d.ts.map +1 -1
- package/lib/stores/model/LocalFileDataCubeSource.js +5 -15
- package/lib/stores/model/LocalFileDataCubeSource.js.map +1 -1
- package/package.json +13 -11
- package/src/__lib__/LegendDataCubeNavigation.ts +21 -0
- package/src/application/LegendDataCubeApplicationConfig.ts +10 -0
- package/src/application/__test-utils__/LegendDataCubeApplicationTestUtils.ts +52 -0
- package/src/components/LegendDataCubeBlockingWindow.tsx +8 -2
- package/src/components/__test-utils__/LegendDataCubeStoreTestUtils.tsx +231 -0
- package/src/components/builder/LegendDataCubeBuilder.tsx +51 -6
- package/src/components/builder/LegendDataCubeBuilderStoreProvider.tsx +3 -0
- package/src/components/builder/LegendDataCubePartialSourceLoader.tsx +108 -0
- package/src/components/builder/LegendDataCubeSourceViewer.tsx +171 -1
- package/src/components/builder/source/LocalFileDataCubeSourceBuilder.tsx +1 -2
- package/src/components/builder/source/loader/LocalFileDataCubePartialSourceLoader.tsx +60 -0
- package/src/stores/LegendDataCubeBaseStore.ts +13 -6
- package/src/stores/LegendDataCubeDataCubeEngine.ts +161 -120
- package/src/stores/LegendDataCubeDuckDBEngine.ts +101 -17
- package/src/stores/builder/LegendDataCubeBuilderStore.tsx +96 -24
- package/src/stores/builder/LegendDataCubeLoaderState.tsx +44 -1
- package/src/stores/builder/LegendDataCubeSourceLoaderState.tsx +145 -0
- package/src/stores/builder/source/LocalFileDataCubeSourceBuilderState.ts +9 -14
- package/src/stores/builder/source/loader/LegendDataCubePartialSourceLoaderState.ts +41 -0
- package/src/stores/builder/source/loader/LocalFileDataCubePartialSourceLoaderState.ts +217 -0
- package/src/stores/model/LegendQueryDataCubeSource.ts +2 -0
- package/src/stores/model/LocalFileDataCubeSource.ts +6 -15
- package/tsconfig.json +8 -1
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ActionState, csvStringify,
|
|
16
|
+
import { ActionState, csvStringify, guaranteeNonNullable, IllegalStateError, parseCSVFile, } from '@finos/legend-shared';
|
|
17
17
|
import { LegendDataCubeSourceBuilderState, LegendDataCubeSourceBuilderType, } from './LegendDataCubeSourceBuilderState.js';
|
|
18
18
|
import { action, makeObservable, observable } from 'mobx';
|
|
19
|
-
import {
|
|
19
|
+
import { LocalFileDataCubeSourceFormat, RawLocalFileQueryDataCubeSource, } from '../../model/LocalFileDataCubeSource.js';
|
|
20
20
|
export class LocalFileDataCubeSourceBuilderState extends LegendDataCubeSourceBuilderState {
|
|
21
21
|
processState = ActionState.create();
|
|
22
22
|
fileName;
|
|
@@ -74,7 +74,7 @@ export class LocalFileDataCubeSourceBuilderState extends LegendDataCubeSourceBui
|
|
|
74
74
|
complete: (result) => {
|
|
75
75
|
this.setFileData(csvStringify(result.data, { escapeChar: `'`, quoteChar: `'` }));
|
|
76
76
|
this.setFileName(fileName);
|
|
77
|
-
this.setFileFormat(
|
|
77
|
+
this.setFileFormat(LocalFileDataCubeSourceFormat.CSV);
|
|
78
78
|
this.setRowCount(result.data.length);
|
|
79
79
|
this.setPreviewText(csvStringify(result.data.slice(0, 100), {
|
|
80
80
|
escapeChar: `'`,
|
|
@@ -107,15 +107,12 @@ export class LocalFileDataCubeSourceBuilderState extends LegendDataCubeSourceBui
|
|
|
107
107
|
this.rowCount === undefined) {
|
|
108
108
|
throw new IllegalStateError(`Can't generate source data: file data and information is not set`);
|
|
109
109
|
}
|
|
110
|
-
const
|
|
110
|
+
const tableDetails = guaranteeNonNullable(await this._engine.ingestLocalFileData(this.fileData, this.fileFormat), `Can't generate source data: failed to ingest data from local file`);
|
|
111
111
|
const rawSource = new RawLocalFileQueryDataCubeSource();
|
|
112
|
-
rawSource.count = this.rowCount;
|
|
113
112
|
rawSource.fileName = this.fileName;
|
|
114
|
-
rawSource.
|
|
115
|
-
rawSource.
|
|
116
|
-
rawSource.
|
|
117
|
-
rawSource.table = source.table;
|
|
118
|
-
rawSource.runtime = source.runtime;
|
|
113
|
+
rawSource.fileFormat = this.fileFormat;
|
|
114
|
+
rawSource._ref = tableDetails.dbReference;
|
|
115
|
+
rawSource.columnNames = tableDetails.columnNames;
|
|
119
116
|
return RawLocalFileQueryDataCubeSource.serialization.toJson(rawSource);
|
|
120
117
|
}
|
|
121
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalFileDataCubeSourceBuilderState.js","sourceRoot":"","sources":["../../../../src/stores/builder/source/LocalFileDataCubeSourceBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"LocalFileDataCubeSourceBuilderState.js","sourceRoot":"","sources":["../../../../src/stores/builder/source/LocalFileDataCubeSourceBuilderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,GAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gCAAgC,EAChC,+BAA+B,GAChC,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,GAChC,MAAM,wCAAwC,CAAC;AAEhD,MAAM,OAAO,mCAAoC,SAAQ,gCAAgC;IAC9E,YAAY,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;IAE7C,QAAQ,CAAsB;IAC9B,UAAU,CAA6C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,IAAa,KAAK;QAChB,OAAO,+BAA+B,CAAC,UAAU,CAAC;IACpD,CAAC;IAED,IAAa,OAAO;QAClB,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAEQ,KAAK,CAAC,kBAAkB;QAC/B,IACE,CAAC,IAAI,CAAC,QAAQ;YACd,CAAC,IAAI,CAAC,QAAQ;YACd,CAAC,IAAI,CAAC,UAAU;YAChB,IAAI,CAAC,QAAQ,KAAK,SAAS,EAC3B,CAAC;YACD,MAAM,IAAI,iBAAiB,CACzB,kEAAkE,CACnE,CAAC;QACJ,CAAC;QAED,MAAM,YAAY,GAAG,oBAAoB,CACvC,MAAM,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,EACtE,mEAAmE,CACpE,CAAC;QACF,MAAM,SAAS,GAAG,IAAI,+BAA+B,EAAE,CAAC;QACxD,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QACnC,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACvC,SAAS,CAAC,IAAI,GAAG,YAAY,CAAC,WAAW,CAAC;QAC1C,SAAS,CAAC,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC;QAEjD,OAAO,+BAA+B,CAAC,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACzE,CAAC;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 PlainObject } from '@finos/legend-shared';
|
|
17
|
+
import type { LegendDataCubeApplicationStore } from '../../../LegendDataCubeBaseStore.js';
|
|
18
|
+
import type { LegendDataCubeDataCubeEngine } from '../../../LegendDataCubeDataCubeEngine.js';
|
|
19
|
+
import type { LegendDataCubeSourceLoaderType } from '../../LegendDataCubeSourceLoaderState.js';
|
|
20
|
+
export declare abstract class LegendDataCubePartialSourceLoaderState {
|
|
21
|
+
protected readonly _application: LegendDataCubeApplicationStore;
|
|
22
|
+
protected readonly _engine: LegendDataCubeDataCubeEngine;
|
|
23
|
+
constructor(application: LegendDataCubeApplicationStore, engine: LegendDataCubeDataCubeEngine);
|
|
24
|
+
abstract initialize(): void;
|
|
25
|
+
abstract get label(): LegendDataCubeSourceLoaderType;
|
|
26
|
+
abstract get isValid(): boolean;
|
|
27
|
+
abstract load(source: PlainObject | undefined): Promise<PlainObject>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=LegendDataCubePartialSourceLoaderState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendDataCubePartialSourceLoaderState.d.ts","sourceRoot":"","sources":["../../../../../src/stores/builder/source/loader/LegendDataCubePartialSourceLoaderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAC7F,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAE/F,8BAAsB,sCAAsC;IAC1D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,8BAA8B,CAAC;IAChE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,4BAA4B,CAAC;gBAGvD,WAAW,EAAE,8BAA8B,EAC3C,MAAM,EAAE,4BAA4B;IAMtC,QAAQ,CAAC,UAAU,IAAI,IAAI;IAE3B,QAAQ,KAAK,KAAK,IAAI,8BAA8B,CAAC;IAErD,QAAQ,KAAK,OAAO,IAAI,OAAO,CAAC;IAEhC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;CACrE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 {} from '@finos/legend-shared';
|
|
17
|
+
export class LegendDataCubePartialSourceLoaderState {
|
|
18
|
+
_application;
|
|
19
|
+
_engine;
|
|
20
|
+
constructor(application, engine) {
|
|
21
|
+
this._application = application;
|
|
22
|
+
this._engine = engine;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=LegendDataCubePartialSourceLoaderState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendDataCubePartialSourceLoaderState.js","sourceRoot":"","sources":["../../../../../src/stores/builder/source/loader/LegendDataCubePartialSourceLoaderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAoB,MAAM,sBAAsB,CAAC;AAKxD,MAAM,OAAgB,sCAAsC;IACvC,YAAY,CAAiC;IAC7C,OAAO,CAA+B;IAEzD,YACE,WAA2C,EAC3C,MAAoC;QAEpC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CASF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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, type PlainObject } from '@finos/legend-shared';
|
|
17
|
+
import type { LegendDataCubeApplicationStore } from '../../../LegendDataCubeBaseStore.js';
|
|
18
|
+
import type { LegendDataCubeDataCubeEngine } from '../../../LegendDataCubeDataCubeEngine.js';
|
|
19
|
+
import { LocalFileDataCubeSourceFormat } from '../../../model/LocalFileDataCubeSource.js';
|
|
20
|
+
import { LegendDataCubePartialSourceLoaderState } from './LegendDataCubePartialSourceLoaderState.js';
|
|
21
|
+
import { LegendDataCubeSourceLoaderType } from '../../LegendDataCubeSourceLoaderState.js';
|
|
22
|
+
export declare class LocalFileDataCubePartialSourceLoaderState extends LegendDataCubePartialSourceLoaderState {
|
|
23
|
+
readonly processState: ActionState;
|
|
24
|
+
fileName?: string | undefined;
|
|
25
|
+
fileFormat?: LocalFileDataCubeSourceFormat | undefined;
|
|
26
|
+
fileData?: string | undefined;
|
|
27
|
+
previewText?: string | undefined;
|
|
28
|
+
rowCount?: number | undefined;
|
|
29
|
+
columnNames?: string[] | undefined;
|
|
30
|
+
constructor(application: LegendDataCubeApplicationStore, engine: LegendDataCubeDataCubeEngine);
|
|
31
|
+
setFileName(fileName: string | undefined): void;
|
|
32
|
+
setColumnNames(columnNames: string[] | undefined): void;
|
|
33
|
+
setFileFormat(format: LocalFileDataCubeSourceFormat | undefined): void;
|
|
34
|
+
setFileData(data: string | undefined): void;
|
|
35
|
+
setRowCount(count: number | undefined): void;
|
|
36
|
+
setPreviewText(text: string | undefined): void;
|
|
37
|
+
initialize(): void;
|
|
38
|
+
processFile(file: File | undefined): void;
|
|
39
|
+
get isValid(): boolean;
|
|
40
|
+
get label(): LegendDataCubeSourceLoaderType;
|
|
41
|
+
load(source: PlainObject | undefined): Promise<PlainObject>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=LocalFileDataCubePartialSourceLoaderState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalFileDataCubePartialSourceLoaderState.d.ts","sourceRoot":"","sources":["../../../../../src/stores/builder/source/loader/LocalFileDataCubePartialSourceLoaderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,WAAW,EAKX,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAC7F,OAAO,EACL,6BAA6B,EAE9B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,sCAAsC,EAAE,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAE1F,qBAAa,yCAA0C,SAAQ,sCAAsC;IACnG,QAAQ,CAAC,YAAY,cAAwB;IAE7C,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,6BAA6B,GAAG,SAAS,CAAC;IAGvD,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;gBAGjC,WAAW,EAAE,8BAA8B,EAC3C,MAAM,EAAE,4BAA4B;IAyBtC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;IAIxC,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,SAAS;IAIhD,aAAa,CAAC,MAAM,EAAE,6BAA6B,GAAG,SAAS;IAI/D,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS;IAIpC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAIrC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS;IAI9B,UAAU,IAAI,IAAI;IAS3B,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS;IAwDlC,IAAa,OAAO,IAAI,OAAO,CAE9B;IAED,IAAa,KAAK,IAAI,8BAA8B,CAEnD;IAEc,IAAI,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;CA8C3E"}
|
|
@@ -0,0 +1,142 @@
|
|
|
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, csvStringify, guaranteeNonNullable, IllegalStateError, parseCSVFile, } from '@finos/legend-shared';
|
|
17
|
+
import { makeObservable, observable, action } from 'mobx';
|
|
18
|
+
import { LocalFileDataCubeSourceFormat, RawLocalFileQueryDataCubeSource, } from '../../../model/LocalFileDataCubeSource.js';
|
|
19
|
+
import { LegendDataCubePartialSourceLoaderState } from './LegendDataCubePartialSourceLoaderState.js';
|
|
20
|
+
import { LegendDataCubeSourceLoaderType } from '../../LegendDataCubeSourceLoaderState.js';
|
|
21
|
+
export class LocalFileDataCubePartialSourceLoaderState extends LegendDataCubePartialSourceLoaderState {
|
|
22
|
+
processState = ActionState.create();
|
|
23
|
+
fileName;
|
|
24
|
+
fileFormat;
|
|
25
|
+
// NOTE: type string is suitable for CSV/Excel, etc. but will not be appropriate
|
|
26
|
+
// for other format that we want to support, e.g. arrow/parquet
|
|
27
|
+
fileData;
|
|
28
|
+
previewText;
|
|
29
|
+
rowCount;
|
|
30
|
+
columnNames;
|
|
31
|
+
constructor(application, engine) {
|
|
32
|
+
super(application, engine);
|
|
33
|
+
makeObservable(this, {
|
|
34
|
+
fileName: observable,
|
|
35
|
+
setFileName: action,
|
|
36
|
+
columnNames: observable,
|
|
37
|
+
setColumnNames: action,
|
|
38
|
+
fileFormat: observable,
|
|
39
|
+
setFileFormat: action,
|
|
40
|
+
fileData: observable,
|
|
41
|
+
setFileData: action,
|
|
42
|
+
previewText: observable,
|
|
43
|
+
setPreviewText: action,
|
|
44
|
+
rowCount: observable,
|
|
45
|
+
setRowCount: action,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
setFileName(fileName) {
|
|
49
|
+
this.fileName = fileName;
|
|
50
|
+
}
|
|
51
|
+
setColumnNames(columnNames) {
|
|
52
|
+
this.columnNames = columnNames;
|
|
53
|
+
}
|
|
54
|
+
setFileFormat(format) {
|
|
55
|
+
this.fileFormat = format;
|
|
56
|
+
}
|
|
57
|
+
setFileData(data) {
|
|
58
|
+
this.fileData = data;
|
|
59
|
+
}
|
|
60
|
+
setRowCount(count) {
|
|
61
|
+
this.rowCount = count;
|
|
62
|
+
}
|
|
63
|
+
setPreviewText(text) {
|
|
64
|
+
this.previewText = text;
|
|
65
|
+
}
|
|
66
|
+
initialize() {
|
|
67
|
+
this.setFileName(undefined);
|
|
68
|
+
this.setColumnNames(undefined);
|
|
69
|
+
this.setFileFormat(undefined);
|
|
70
|
+
this.setFileData(undefined);
|
|
71
|
+
this.setRowCount(undefined);
|
|
72
|
+
this.setPreviewText(undefined);
|
|
73
|
+
}
|
|
74
|
+
processFile(file) {
|
|
75
|
+
this.setFileName(undefined);
|
|
76
|
+
this.setColumnNames(undefined);
|
|
77
|
+
this.setFileFormat(undefined);
|
|
78
|
+
this.setFileData(undefined);
|
|
79
|
+
this.setRowCount(undefined);
|
|
80
|
+
this.setPreviewText(undefined);
|
|
81
|
+
if (!file) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this.processState.inProgress();
|
|
85
|
+
const fileName = file.name;
|
|
86
|
+
const fileFormat = fileName.split('.').pop();
|
|
87
|
+
switch (fileFormat?.toLowerCase()) {
|
|
88
|
+
case LocalFileDataCubeSourceFormat.CSV.toLowerCase(): {
|
|
89
|
+
parseCSVFile(file, {
|
|
90
|
+
complete: (result) => {
|
|
91
|
+
this.setFileData(csvStringify(result.data, { escapeChar: `'`, quoteChar: `'` }));
|
|
92
|
+
this.setColumnNames(Object.keys(result.data.at(0)).filter((key) => key !== ''));
|
|
93
|
+
this.setFileName(fileName);
|
|
94
|
+
this.setFileFormat(LocalFileDataCubeSourceFormat.CSV);
|
|
95
|
+
this.setRowCount(result.data.length);
|
|
96
|
+
this.setPreviewText(csvStringify(result.data.slice(0, 100), {
|
|
97
|
+
escapeChar: `'`,
|
|
98
|
+
quoteChar: `'`,
|
|
99
|
+
}));
|
|
100
|
+
},
|
|
101
|
+
header: true,
|
|
102
|
+
dynamicTyping: false,
|
|
103
|
+
skipEmptyLines: true,
|
|
104
|
+
});
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
default: {
|
|
108
|
+
this.processState.complete();
|
|
109
|
+
throw new IllegalStateError(`Can't process file with format '${fileFormat}'`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
this.processState.complete();
|
|
113
|
+
}
|
|
114
|
+
get isValid() {
|
|
115
|
+
return Boolean(this.fileData);
|
|
116
|
+
}
|
|
117
|
+
get label() {
|
|
118
|
+
return LegendDataCubeSourceLoaderType.LOCAL_FILE;
|
|
119
|
+
}
|
|
120
|
+
async load(source) {
|
|
121
|
+
const deserializedSource = RawLocalFileQueryDataCubeSource.serialization.fromJson(guaranteeNonNullable(source));
|
|
122
|
+
if (!this.fileData ||
|
|
123
|
+
!this.fileName ||
|
|
124
|
+
!this.fileFormat ||
|
|
125
|
+
this.rowCount === undefined) {
|
|
126
|
+
throw new IllegalStateError(`Can't load source data: file data and information is not set`);
|
|
127
|
+
}
|
|
128
|
+
const intersectingColumns = guaranteeNonNullable(this.columnNames?.filter((col) => deserializedSource.columnNames.includes(col)));
|
|
129
|
+
if (intersectingColumns.length !== deserializedSource.columnNames.length) {
|
|
130
|
+
throw new Error(`Columns mismatch: Expected [${deserializedSource.columnNames.join(',')}], got [${this.columnNames?.join(',')}]`);
|
|
131
|
+
}
|
|
132
|
+
const tableDetails = guaranteeNonNullable(await this._engine.ingestLocalFileData(this.fileData, this.fileFormat, deserializedSource._ref), `Can't load source data: failed to ingest data from local file`);
|
|
133
|
+
// TODO: do a type check for columns
|
|
134
|
+
const rawSource = new RawLocalFileQueryDataCubeSource();
|
|
135
|
+
rawSource.fileName = this.fileName;
|
|
136
|
+
rawSource.fileFormat = this.fileFormat;
|
|
137
|
+
rawSource._ref = tableDetails.dbReference;
|
|
138
|
+
rawSource.columnNames = tableDetails.columnNames;
|
|
139
|
+
return RawLocalFileQueryDataCubeSource.serialization.toJson(rawSource);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=LocalFileDataCubePartialSourceLoaderState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalFileDataCubePartialSourceLoaderState.js","sourceRoot":"","sources":["../../../../../src/stores/builder/source/loader/LocalFileDataCubePartialSourceLoaderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,GAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAG1D,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,GAChC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,sCAAsC,EAAE,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAE1F,MAAM,OAAO,yCAA0C,SAAQ,sCAAsC;IAC1F,YAAY,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;IAE7C,QAAQ,CAAsB;IAC9B,UAAU,CAA6C;IACvD,gFAAgF;IAChF,+DAA+D;IAC/D,QAAQ,CAAsB;IAC9B,WAAW,CAAsB;IACjC,QAAQ,CAAsB;IAC9B,WAAW,CAAwB;IAEnC,YACE,WAA2C,EAC3C,MAAoC;QAEpC,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAE3B,cAAc,CAAC,IAAI,EAAE;YACnB,QAAQ,EAAE,UAAU;YACpB,WAAW,EA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CACb,+BAA+B,kBAAkB,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CACjH,CAAC;QACJ,CAAC;QAED,MAAM,YAAY,GAAG,oBAAoB,CACvC,MAAM,IAAI,CAAC,OAAO,CAAC,mBAAmB,CACpC,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,UAAU,EACf,kBAAkB,CAAC,IAAI,CACxB,EACD,+DAA+D,CAChE,CAAC;QAEF,oCAAoC;QACpC,MAAM,SAAS,GAAG,IAAI,+BAA+B,EAAE,CAAC;QACxD,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QACnC,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACvC,SAAS,CAAC,IAAI,GAAG,YAAY,CAAC,WAAW,CAAC;QAC1C,SAAS,CAAC,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC;QAEjD,OAAO,+BAA+B,CAAC,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACzE,CAAC;CACF"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { DataCubeSource } from '@finos/legend-data-cube';
|
|
17
|
-
import type { QueryInfo, V1_Lambda, V1_ParameterValue } from '@finos/legend-graph';
|
|
17
|
+
import type { QueryInfo, V1_Lambda, V1_ParameterValue, V1_ValueSpecification } from '@finos/legend-graph';
|
|
18
18
|
import { SerializationFactory, type PlainObject } from '@finos/legend-shared';
|
|
19
19
|
export declare const LEGEND_QUERY_DATA_CUBE_SOURCE_TYPE = "legendQuery";
|
|
20
20
|
export declare class LegendQueryDataCubeSource extends DataCubeSource {
|
|
@@ -24,6 +24,7 @@ export declare class LegendQueryDataCubeSource extends DataCubeSource {
|
|
|
24
24
|
runtime: string;
|
|
25
25
|
model: PlainObject;
|
|
26
26
|
parameterValues: V1_ParameterValue[];
|
|
27
|
+
letParameterValueSpec: V1_ValueSpecification[];
|
|
27
28
|
}
|
|
28
29
|
export declare class RawLegendQueryDataCubeSource {
|
|
29
30
|
queryId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendQueryDataCubeSource.d.ts","sourceRoot":"","sources":["../../../src/stores/model/LegendQueryDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,iBAAiB,
|
|
1
|
+
{"version":3,"file":"LegendQueryDataCubeSource.d.ts","sourceRoot":"","sources":["../../../src/stores/model/LegendQueryDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EAEpB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,kCAAkC,gBAAgB,CAAC;AAEhE,qBAAa,yBAA0B,SAAQ,cAAc;IAC3D,IAAI,EAAG,SAAS,CAAC;IACjB,MAAM,EAAG,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAG,MAAM,CAAC;IACjB,KAAK,EAAG,WAAW,CAAC;IACpB,eAAe,EAAE,iBAAiB,EAAE,CAAM;IAC1C,qBAAqB,EAAE,qBAAqB,EAAE,CAAM;CACrD;AAED,qBAAa,4BAA4B;IACvC,OAAO,EAAG,MAAM,CAAC;IAEjB,MAAM,CAAC,QAAQ,CAAC,aAAa,qDAK3B;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendQueryDataCubeSource.js","sourceRoot":"","sources":["../../../src/stores/model/LegendQueryDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"LegendQueryDataCubeSource.js","sourceRoot":"","sources":["../../../src/stores/model/LegendQueryDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAOzD,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEzD,MAAM,CAAC,MAAM,kCAAkC,GAAG,aAAa,CAAC;AAEhE,MAAM,OAAO,yBAA0B,SAAQ,cAAc;IAC3D,IAAI,CAAa;IACjB,MAAM,CAAa;IACnB,OAAO,CAAsB;IAC7B,OAAO,CAAU;IACjB,KAAK,CAAe;IACpB,eAAe,GAAwB,EAAE,CAAC;IAC1C,qBAAqB,GAA4B,EAAE,CAAC;CACrD;AAED,MAAM,OAAO,4BAA4B;IACvC,OAAO,CAAU;IAEjB,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,4BAA4B,EAAE;QAC9C,KAAK,EAAE,wBAAwB,CAAC,kCAAkC,CAAC;QACnE,OAAO,EAAE,SAAS,EAAE;KACrB,CAAC,CACH,CAAC"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { DataCubeSource } from '@finos/legend-data-cube';
|
|
17
|
-
import {
|
|
17
|
+
import type { V1_PureModelContextData } from '@finos/legend-graph';
|
|
18
18
|
import { SerializationFactory, type PlainObject } from '@finos/legend-shared';
|
|
19
19
|
export declare const LOCAL_FILE_QUERY_DATA_CUBE_SOURCE_TYPE = "localFile";
|
|
20
20
|
export declare enum LocalFileDataCubeSourceFormat {
|
|
@@ -26,19 +26,14 @@ export declare class LocalFileDataCubeSource extends DataCubeSource {
|
|
|
26
26
|
db: string;
|
|
27
27
|
schema: string;
|
|
28
28
|
table: string;
|
|
29
|
-
count: number;
|
|
30
29
|
fileName: string;
|
|
31
30
|
fileFormat: LocalFileDataCubeSourceFormat;
|
|
32
31
|
}
|
|
33
32
|
export declare class RawLocalFileQueryDataCubeSource {
|
|
34
|
-
model: PlainObject<V1_PureModelContextData>;
|
|
35
|
-
runtime: string;
|
|
36
|
-
db: string;
|
|
37
|
-
schema: string;
|
|
38
|
-
table: string;
|
|
39
|
-
count: number;
|
|
40
33
|
fileName: string;
|
|
41
34
|
fileFormat: LocalFileDataCubeSourceFormat;
|
|
35
|
+
_ref: string;
|
|
36
|
+
columnNames: string[];
|
|
42
37
|
static readonly serialization: SerializationFactory<RawLocalFileQueryDataCubeSource>;
|
|
43
38
|
}
|
|
44
39
|
//# sourceMappingURL=LocalFileDataCubeSource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalFileDataCubeSource.d.ts","sourceRoot":"","sources":["../../../src/stores/model/LocalFileDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"LocalFileDataCubeSource.d.ts","sourceRoot":"","sources":["../../../src/stores/model/LocalFileDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,oBAAoB,EAEpB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,sCAAsC,cAAc,CAAC;AAElE,oBAAY,6BAA6B;IACvC,GAAG,QAAQ;CAEZ;AAED,qBAAa,uBAAwB,SAAQ,cAAc;IACzD,KAAK,EAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAC7C,OAAO,EAAG,MAAM,CAAC;IACjB,EAAE,EAAG,MAAM,CAAC;IACZ,MAAM,EAAG,MAAM,CAAC;IAChB,KAAK,EAAG,MAAM,CAAC;IACf,QAAQ,EAAG,MAAM,CAAC;IAClB,UAAU,EAAG,6BAA6B,CAAC;CAC5C;AAED,qBAAa,+BAA+B;IAC1C,QAAQ,EAAG,MAAM,CAAC;IAClB,UAAU,EAAG,6BAA6B,CAAC;IAC3C,IAAI,EAAG,MAAM,CAAC;IACd,WAAW,EAAG,MAAM,EAAE,CAAC;IAEvB,MAAM,CAAC,QAAQ,CAAC,aAAa,wDAQ3B;CACH"}
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { DataCubeSource } from '@finos/legend-data-cube';
|
|
17
|
-
import {} from '@finos/legend-graph';
|
|
18
17
|
import { SerializationFactory, usingConstantValueSchema, } from '@finos/legend-shared';
|
|
19
|
-
import { createModelSchema,
|
|
18
|
+
import { createModelSchema, list, primitive } from 'serializr';
|
|
20
19
|
export const LOCAL_FILE_QUERY_DATA_CUBE_SOURCE_TYPE = 'localFile';
|
|
21
20
|
export var LocalFileDataCubeSourceFormat;
|
|
22
21
|
(function (LocalFileDataCubeSourceFormat) {
|
|
@@ -29,29 +28,20 @@ export class LocalFileDataCubeSource extends DataCubeSource {
|
|
|
29
28
|
db;
|
|
30
29
|
schema;
|
|
31
30
|
table;
|
|
32
|
-
count;
|
|
33
31
|
fileName;
|
|
34
32
|
fileFormat;
|
|
35
33
|
}
|
|
36
34
|
export class RawLocalFileQueryDataCubeSource {
|
|
37
|
-
model;
|
|
38
|
-
runtime;
|
|
39
|
-
db;
|
|
40
|
-
schema;
|
|
41
|
-
table;
|
|
42
|
-
count;
|
|
43
35
|
fileName;
|
|
44
36
|
fileFormat;
|
|
37
|
+
_ref;
|
|
38
|
+
columnNames;
|
|
45
39
|
static serialization = new SerializationFactory(createModelSchema(RawLocalFileQueryDataCubeSource, {
|
|
46
40
|
_type: usingConstantValueSchema(LOCAL_FILE_QUERY_DATA_CUBE_SOURCE_TYPE),
|
|
47
|
-
count: primitive(),
|
|
48
|
-
db: primitive(),
|
|
49
41
|
fileFormat: primitive(),
|
|
50
42
|
fileName: primitive(),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
schema: primitive(),
|
|
54
|
-
table: primitive(),
|
|
43
|
+
_ref: primitive(),
|
|
44
|
+
columnNames: list(primitive()),
|
|
55
45
|
}));
|
|
56
46
|
}
|
|
57
47
|
//# sourceMappingURL=LocalFileDataCubeSource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalFileDataCubeSource.js","sourceRoot":"","sources":["../../../src/stores/model/LocalFileDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"LocalFileDataCubeSource.js","sourceRoot":"","sources":["../../../src/stores/model/LocalFileDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE/D,MAAM,CAAC,MAAM,sCAAsC,GAAG,WAAW,CAAC;AAElE,MAAM,CAAN,IAAY,6BAGX;AAHD,WAAY,6BAA6B;IACvC,4CAAW,CAAA;IACX,kCAAkC;AACpC,CAAC,EAHW,6BAA6B,KAA7B,6BAA6B,QAGxC;AAED,MAAM,OAAO,uBAAwB,SAAQ,cAAc;IACzD,KAAK,CAAwC;IAC7C,OAAO,CAAU;IACjB,EAAE,CAAU;IACZ,MAAM,CAAU;IAChB,KAAK,CAAU;IACf,QAAQ,CAAU;IAClB,UAAU,CAAiC;CAC5C;AAED,MAAM,OAAO,+BAA+B;IAC1C,QAAQ,CAAU;IAClB,UAAU,CAAiC;IAC3C,IAAI,CAAU;IACd,WAAW,CAAY;IAEvB,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,+BAA+B,EAAE;QACjD,KAAK,EAAE,wBAAwB,CAAC,sCAAsC,CAAC;QACvE,UAAU,EAAE,SAAS,EAAE;QACvB,QAAQ,EAAE,SAAS,EAAE;QACrB,IAAI,EAAE,SAAS,EAAE;QACjB,WAAW,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;KAC/B,CAAC,CACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-application-data-cube",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Legend DataCube application core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@duckdb/duckdb-wasm": "1.29.0",
|
|
46
|
-
"@finos/legend-application": "16.0.
|
|
47
|
-
"@finos/legend-art": "7.1.
|
|
48
|
-
"@finos/legend-code-editor": "2.0.
|
|
49
|
-
"@finos/legend-data-cube": "0.1.
|
|
50
|
-
"@finos/legend-graph": "32.1.
|
|
51
|
-
"@finos/legend-query-builder": "4.16.
|
|
52
|
-
"@finos/legend-server-depot": "6.0.
|
|
53
|
-
"@finos/legend-shared": "11.0.
|
|
54
|
-
"@finos/legend-storage": "3.0.
|
|
46
|
+
"@finos/legend-application": "16.0.28",
|
|
47
|
+
"@finos/legend-art": "7.1.85",
|
|
48
|
+
"@finos/legend-code-editor": "2.0.50",
|
|
49
|
+
"@finos/legend-data-cube": "0.1.10",
|
|
50
|
+
"@finos/legend-graph": "32.1.8",
|
|
51
|
+
"@finos/legend-query-builder": "4.16.10",
|
|
52
|
+
"@finos/legend-server-depot": "6.0.84",
|
|
53
|
+
"@finos/legend-shared": "11.0.7",
|
|
54
|
+
"@finos/legend-storage": "3.0.126",
|
|
55
55
|
"@types/react": "19.0.10",
|
|
56
56
|
"@types/react-dom": "19.0.4",
|
|
57
57
|
"apache-arrow": "19.0.0",
|
|
@@ -62,8 +62,10 @@
|
|
|
62
62
|
"serializr": "3.0.3"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@finos/legend-dev-utils": "2.2.
|
|
65
|
+
"@finos/legend-dev-utils": "2.2.3",
|
|
66
66
|
"@jest/globals": "29.7.0",
|
|
67
|
+
"@testing-library/dom": "10.4.0",
|
|
68
|
+
"@testing-library/react": "16.2.0",
|
|
67
69
|
"cross-env": "7.0.3",
|
|
68
70
|
"eslint": "9.20.1",
|
|
69
71
|
"jest": "29.7.0",
|
|
@@ -42,3 +42,24 @@ export const EXTERNAL_APPLICATION_NAVIGATION__generateQueryViewUrl = (
|
|
|
42
42
|
queryApplicationUrl: string,
|
|
43
43
|
queryId: string,
|
|
44
44
|
) => `${queryApplicationUrl}/edit/${queryId}`;
|
|
45
|
+
|
|
46
|
+
export const EXTERNAL_APPLICATION_NAVIGATION__generateStudioSDLCViewUrl = (
|
|
47
|
+
studioApplicationUrl: string,
|
|
48
|
+
projectId: string,
|
|
49
|
+
versionId: string,
|
|
50
|
+
element: string | undefined,
|
|
51
|
+
) =>
|
|
52
|
+
`${studioApplicationUrl}/view/${projectId}/version/${versionId}${
|
|
53
|
+
element ? `/entity/${element}` : ''
|
|
54
|
+
}`;
|
|
55
|
+
|
|
56
|
+
export const EXTERNAL_APPLICATION_NAVIGATION__generateStudioViewUrl = (
|
|
57
|
+
studioApplicationUrl: string,
|
|
58
|
+
groupId: string,
|
|
59
|
+
artifactId: string,
|
|
60
|
+
versionId: string,
|
|
61
|
+
element: string | undefined,
|
|
62
|
+
) =>
|
|
63
|
+
`${studioApplicationUrl}/view/archive/${groupId}:${artifactId}:${versionId}${
|
|
64
|
+
element ? `/entity/${element}` : ''
|
|
65
|
+
}`;
|
|
@@ -33,6 +33,9 @@ export interface LegendDataCubeApplicationConfigurationData
|
|
|
33
33
|
query?: {
|
|
34
34
|
url: string;
|
|
35
35
|
};
|
|
36
|
+
studio?: {
|
|
37
|
+
url: string;
|
|
38
|
+
};
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
export class LegendDataCubeApplicationConfig extends LegendApplicationConfig {
|
|
@@ -40,6 +43,7 @@ export class LegendDataCubeApplicationConfig extends LegendApplicationConfig {
|
|
|
40
43
|
readonly depotServerUrl: string;
|
|
41
44
|
readonly engineQueryServerUrl?: string | undefined;
|
|
42
45
|
readonly queryApplicationUrl?: string | undefined;
|
|
46
|
+
readonly studioApplicationUrl?: string | undefined;
|
|
43
47
|
|
|
44
48
|
constructor(
|
|
45
49
|
input: LegendApplicationConfigurationInput<LegendDataCubeApplicationConfigurationData>,
|
|
@@ -81,6 +85,12 @@ export class LegendDataCubeApplicationConfig extends LegendApplicationConfig {
|
|
|
81
85
|
input.configData.query.url,
|
|
82
86
|
);
|
|
83
87
|
}
|
|
88
|
+
// stduio
|
|
89
|
+
if (input.configData.studio?.url) {
|
|
90
|
+
this.studioApplicationUrl = LegendApplicationConfig.resolveAbsoluteUrl(
|
|
91
|
+
input.configData.studio.url,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
84
94
|
}
|
|
85
95
|
getDefaultApplicationStorageKey(): string {
|
|
86
96
|
return 'legend-data-cube';
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
|
|
17
|
+
import { TEST__getApplicationVersionData } from '@finos/legend-application/test';
|
|
18
|
+
import { LegendDataCubeApplicationConfig } from '../LegendDataCubeApplicationConfig.js';
|
|
19
|
+
|
|
20
|
+
const TEST_DATA__appConfig = {
|
|
21
|
+
appName: 'datacube',
|
|
22
|
+
env: 'test-env',
|
|
23
|
+
engine: {
|
|
24
|
+
url: 'https://testEngineUrl',
|
|
25
|
+
queryUrl: 'https://testEngineQueryUrl',
|
|
26
|
+
},
|
|
27
|
+
depot: {
|
|
28
|
+
url: 'https://testMetadataUrl',
|
|
29
|
+
},
|
|
30
|
+
studio: {
|
|
31
|
+
url: 'https://testStudioUrl',
|
|
32
|
+
instances: [],
|
|
33
|
+
},
|
|
34
|
+
query: {
|
|
35
|
+
url: 'https://testStudioUrl',
|
|
36
|
+
instances: [],
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const TEST__getTestLegendDataCubeApplicationConfig = (
|
|
41
|
+
extraConfigData = {},
|
|
42
|
+
): LegendDataCubeApplicationConfig => {
|
|
43
|
+
const config = new LegendDataCubeApplicationConfig({
|
|
44
|
+
configData: {
|
|
45
|
+
...TEST_DATA__appConfig,
|
|
46
|
+
...extraConfigData,
|
|
47
|
+
},
|
|
48
|
+
versionData: TEST__getApplicationVersionData(),
|
|
49
|
+
baseAddress: '/datacube/',
|
|
50
|
+
});
|
|
51
|
+
return config;
|
|
52
|
+
};
|