@finos/legend-application-repl 1.0.7 → 1.0.9
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/components/LegendREPLApplication.d.ts.map +1 -1
- package/lib/components/LegendREPLApplication.js +29 -15
- package/lib/components/LegendREPLApplication.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/package.json +3 -2
- package/lib/stores/LegendREPLDataCubeEngine.d.ts +37 -18
- package/lib/stores/LegendREPLDataCubeEngine.d.ts.map +1 -1
- package/lib/stores/LegendREPLDataCubeEngine.js +96 -47
- package/lib/stores/LegendREPLDataCubeEngine.js.map +1 -1
- package/lib/stores/LegendREPLDataCubeSource.d.ts +22 -0
- package/lib/stores/LegendREPLDataCubeSource.d.ts.map +1 -0
- package/lib/stores/LegendREPLDataCubeSource.js +22 -0
- package/lib/stores/LegendREPLDataCubeSource.js.map +1 -0
- package/lib/stores/LegendREPLServerClient.d.ts +34 -19
- package/lib/stores/LegendREPLServerClient.d.ts.map +1 -1
- package/lib/stores/LegendREPLServerClient.js +27 -5
- package/lib/stores/LegendREPLServerClient.js.map +1 -1
- package/package.json +7 -6
- package/src/components/LegendREPLApplication.tsx +55 -27
- package/src/stores/LegendREPLDataCubeEngine.ts +173 -87
- package/src/stores/LegendREPLDataCubeSource.ts +23 -0
- package/src/stores/LegendREPLServerClient.ts +65 -26
- package/tsconfig.json +1 -1
- package/lib/stores/LegendREPLDataCubeApplicationEngine.d.ts +0 -43
- package/lib/stores/LegendREPLDataCubeApplicationEngine.d.ts.map +0 -1
- package/lib/stores/LegendREPLDataCubeApplicationEngine.js +0 -86
- package/lib/stores/LegendREPLDataCubeApplicationEngine.js.map +0 -1
- package/src/stores/LegendREPLDataCubeApplicationEngine.ts +0 -137
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendREPLApplication.d.ts","sourceRoot":"","sources":["../../src/components/LegendREPLApplication.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"LegendREPLApplication.d.ts","sourceRoot":"","sources":["../../src/components/LegendREPLApplication.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAwGH,eAAO,MAAM,qCAAqC;;EAEhD,CAAC;AAEH,eAAO,MAAM,gBAAgB;;CAS3B,CAAC;AAEH,eAAO,MAAM,wBAAwB,UAAW;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,4CAUlE,CAAC"}
|
|
@@ -17,33 +17,47 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
17
17
|
import { BrowserEnvironmentProvider, Route, Routes, } from '@finos/legend-application/browser';
|
|
18
18
|
import { observer } from 'mobx-react-lite';
|
|
19
19
|
import { useEffect, useMemo } from 'react';
|
|
20
|
-
import { guaranteeNonNullable, LogEvent, NetworkClient, } from '@finos/legend-shared';
|
|
20
|
+
import { formatDate, guaranteeNonNullable, LogEvent, NetworkClient, } from '@finos/legend-shared';
|
|
21
21
|
import { LegendREPLServerClient } from '../stores/LegendREPLServerClient.js';
|
|
22
|
-
import { LegendREPLDataCubeApplicationEngine } from '../stores/LegendREPLDataCubeApplicationEngine.js';
|
|
23
22
|
import { LegendREPLDataCubeEngine } from '../stores/LegendREPLDataCubeEngine.js';
|
|
24
|
-
import { DataCube,
|
|
23
|
+
import { DataCube, DataCubeSettingKey } from '@finos/legend-data-cube';
|
|
25
24
|
import { APPLICATION_EVENT, ApplicationFrameworkProvider, useApplicationStore, } from '@finos/legend-application';
|
|
25
|
+
import { LegendREPLDataCubeSource } from '../stores/LegendREPLDataCubeSource.js';
|
|
26
26
|
const LegendREPLDataCube = observer(() => {
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const engine = new LegendREPLDataCubeEngine(application, new LegendREPLServerClient(new NetworkClient({
|
|
30
|
-
baseUrl:
|
|
27
|
+
const application = useApplicationStore();
|
|
28
|
+
const config = application.config;
|
|
29
|
+
const engine = useMemo(() => new LegendREPLDataCubeEngine(application, new LegendREPLServerClient(new NetworkClient({
|
|
30
|
+
baseUrl: config.useDynamicREPLServer
|
|
31
31
|
? window.location.origin +
|
|
32
|
-
guaranteeNonNullable(
|
|
33
|
-
:
|
|
34
|
-
})));
|
|
32
|
+
guaranteeNonNullable(config.baseAddress).replace('/repl/', '')
|
|
33
|
+
: config.replUrl,
|
|
34
|
+
}))), [application, config]);
|
|
35
35
|
useEffect(() => {
|
|
36
|
-
|
|
36
|
+
engine.blockNavigation(
|
|
37
37
|
// Only block navigation in production
|
|
38
38
|
// eslint-disable-next-line no-process-env
|
|
39
39
|
[() => process.env.NODE_ENV === 'production'], undefined, () => {
|
|
40
|
-
|
|
40
|
+
engine.logWarning(LogEvent.create(APPLICATION_EVENT.NAVIGATION_BLOCKED), `Navigation from the application is blocked`);
|
|
41
41
|
});
|
|
42
42
|
return () => {
|
|
43
|
-
|
|
43
|
+
engine.unblockNavigation();
|
|
44
44
|
};
|
|
45
|
-
}, [
|
|
46
|
-
return (_jsx(
|
|
45
|
+
}, [engine]);
|
|
46
|
+
return (_jsx(DataCube, { engine: engine, options: {
|
|
47
|
+
onNameChanged(name, source) {
|
|
48
|
+
const timestamp = source instanceof LegendREPLDataCubeSource
|
|
49
|
+
? source.timestamp
|
|
50
|
+
: undefined;
|
|
51
|
+
application.layoutService.setWindowTitle(`\u229E ${name}${timestamp ? ` - ${formatDate(new Date(timestamp), 'HH:mm:ss EEE MMM dd yyyy')}` : ''}`);
|
|
52
|
+
},
|
|
53
|
+
onSettingChanged(key, value) {
|
|
54
|
+
engine.persistSettingValue(key, value);
|
|
55
|
+
},
|
|
56
|
+
enableDebugMode: application.settingService.getBooleanValue(DataCubeSettingKey.ENABLE_DEBUG_MODE),
|
|
57
|
+
gridClientRowBuffer: application.settingService.getNumericValue(DataCubeSettingKey.GRID_CLIENT_ROW_BUFFER),
|
|
58
|
+
gridClientPurgeClosedRowNodes: application.settingService.getBooleanValue(DataCubeSettingKey.GRID_CLIENT_PURGE_CLOSED_ROW_NODES),
|
|
59
|
+
gridClientSuppressLargeDatasetWarning: application.settingService.getBooleanValue(DataCubeSettingKey.GRID_CLIENT_SUPPRESS_LARGE_DATASET_WARNING),
|
|
60
|
+
} }));
|
|
47
61
|
});
|
|
48
62
|
export const LEGEND_REPL_GRID_CLIENT_ROUTE_PATTERN = Object.freeze({
|
|
49
63
|
DATA_CUBE: `/dataCube`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendREPLApplication.js","sourceRoot":"","sources":["../../src/components/LegendREPLApplication.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,0BAA0B,EAC1B,KAAK,EACL,MAAM,GACP,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EACL,oBAAoB,EACpB,QAAQ,EACR,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"LegendREPLApplication.js","sourceRoot":"","sources":["../../src/components/LegendREPLApplication.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,0BAA0B,EAC1B,KAAK,EACL,MAAM,GACP,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACR,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,C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AC/B,GACK,GACL,CACP,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAA0B,EAAE,EAAE;IACrE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAE1B,OAAO,CACL,KAAC,0BAA0B,IAAC,OAAO,EAAE,OAAO,YAC1C,KAAC,4BAA4B,IAAC,MAAM,EAAE,IAAI,YACxC,KAAC,gBAAgB,KAAG,GACS,GACJ,CAC9B,CAAC;AACJ,CAAC,CAAC"}
|
package/lib/index.css
CHANGED
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-application-repl",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Legend REPL Grid client application core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"mobx": "6.13.3",
|
|
54
54
|
"mobx-react-lite": "4.0.7",
|
|
55
55
|
"react": "18.3.1",
|
|
56
|
-
"react-dom": "18.3.1"
|
|
56
|
+
"react-dom": "18.3.1",
|
|
57
|
+
"serializr": "3.0.2"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"@finos/legend-dev-utils": "workspace:*",
|
|
@@ -13,29 +13,48 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type
|
|
17
|
-
import { DataCubeEngine,
|
|
18
|
-
import { TDSExecutionResult, type V1_Lambda, type V1_ValueSpecification } from '@finos/legend-graph';
|
|
19
|
-
import type
|
|
16
|
+
import { type LegendREPLServerClient } from './LegendREPLServerClient.js';
|
|
17
|
+
import { DataCubeEngine, type DataCubeAPI, type DataCubeSource } from '@finos/legend-data-cube';
|
|
18
|
+
import { TDSExecutionResult, type V1_AppliedFunction, type V1_Lambda, type V1_ValueSpecification } from '@finos/legend-graph';
|
|
19
|
+
import { type DocumentationEntry, LogEvent, type PlainObject } from '@finos/legend-shared';
|
|
20
|
+
import { LegendREPLDataCubeSource } from './LegendREPLDataCubeSource.js';
|
|
21
|
+
import type { LegendREPLApplicationStore } from '../application/LegendREPLApplicationStore.js';
|
|
20
22
|
export declare class LegendREPLDataCubeEngine extends DataCubeEngine {
|
|
21
|
-
readonly application:
|
|
23
|
+
readonly application: LegendREPLApplicationStore;
|
|
22
24
|
readonly client: LegendREPLServerClient;
|
|
23
|
-
constructor(application:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
constructor(application: LegendREPLApplicationStore, client: LegendREPLServerClient);
|
|
26
|
+
blockNavigation(blockCheckers: (() => boolean)[], onBlock?: ((onProceed: () => void) => void) | undefined, onNativePlatformNavigationBlock?: (() => void) | undefined): void;
|
|
27
|
+
unblockNavigation(): void;
|
|
28
|
+
persistSettingValue(key: string, value: string | number | boolean | object | undefined): void;
|
|
29
|
+
fetchConfiguration(): Promise<{
|
|
30
|
+
gridClientLicense: string | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
getInitialInput(): Promise<{
|
|
33
|
+
query: import("@finos/legend-data-cube").DataCubeQuery;
|
|
34
|
+
source: LegendREPLDataCubeSource;
|
|
35
|
+
}>;
|
|
36
|
+
parseValueSpecification(code: string, returnSourceInformation?: boolean): Promise<V1_ValueSpecification>;
|
|
37
|
+
getValueSpecificationCode(value: V1_ValueSpecification, pretty?: boolean): Promise<string>;
|
|
38
|
+
getQueryTypeahead(code: string, baseQuery: V1_Lambda, source: DataCubeSource): Promise<import("@finos/legend-data-cube").CompletionItem[]>;
|
|
39
|
+
getQueryRelationType(query: V1_Lambda, source: DataCubeSource): Promise<import("@finos/legend-data-cube").RelationType>;
|
|
40
|
+
getQueryCodeRelationReturnType(code: string, baseQuery: V1_ValueSpecification, source: DataCubeSource): Promise<import("@finos/legend-data-cube").RelationType>;
|
|
41
|
+
executeQuery(query: V1_Lambda, source: DataCubeSource, api: DataCubeAPI): Promise<{
|
|
36
42
|
result: TDSExecutionResult;
|
|
37
43
|
executedQuery: string;
|
|
38
44
|
executedSQL: string;
|
|
39
45
|
}>;
|
|
46
|
+
buildExecutionContext(source: DataCubeSource): V1_AppliedFunction | undefined;
|
|
47
|
+
getDocumentationURL(): string | undefined;
|
|
48
|
+
getDocumentationEntry(key: string): DocumentationEntry | undefined;
|
|
49
|
+
shouldDisplayDocumentationEntry(entry: DocumentationEntry): boolean;
|
|
50
|
+
openLink(url: string): void;
|
|
51
|
+
sendTelemetry(event: string, data: PlainObject): void;
|
|
52
|
+
logDebug(message: string, ...data: unknown[]): void;
|
|
53
|
+
debugProcess(processName: string, ...data: [string, unknown][]): void;
|
|
54
|
+
logInfo(event: LogEvent, ...data: unknown[]): void;
|
|
55
|
+
logWarning(event: LogEvent, ...data: unknown[]): void;
|
|
56
|
+
logError(event: LogEvent, ...data: unknown[]): void;
|
|
57
|
+
logUnhandledError(error: Error): void;
|
|
58
|
+
logIllegalStateError(message: string, error?: Error): void;
|
|
40
59
|
}
|
|
41
60
|
//# sourceMappingURL=LegendREPLDataCubeEngine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendREPLDataCubeEngine.d.ts","sourceRoot":"","sources":["../../src/stores/LegendREPLDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"LegendREPLDataCubeEngine.d.ts","sourceRoot":"","sources":["../../src/stores/LegendREPLDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAIL,cAAc,EAEd,KAAK,WAAW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,SAAS,EAAE,MAAM,EAAE,cAAc;IAM7D,8BAA8B,CAClC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,qBAAqB,EAChC,MAAM,EAAE,cAAc;IAQlB,YAAY,CAChB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,WAAW;;;;;IAkBT,qBAAqB,CAC5B,MAAM,EAAE,cAAc,GACrB,kBAAkB,GAAG,SAAS;IAaxB,mBAAmB,IAAI,MAAM,GAAG,SAAS;IAIzC,qBAAqB,CAAC,GAAG,EAAE,MAAM;IAIjC,+BAA+B,CAAC,KAAK,EAAE,kBAAkB;IAIzD,QAAQ,CAAC,GAAG,EAAE,MAAM;IAIpB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW;IAI9C,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAQ5C,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IAS9D,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAI3C,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAI9C,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAI5C,iBAAiB,CAAC,KAAK,EAAE,KAAK;IAI9B,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAO7D"}
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import { GetBaseQueryResult, } from './LegendREPLServerClient.js';
|
|
17
|
+
import { _elementPtr, _function, _lambda, DataCubeEngine, DataCubeFunction, } from '@finos/legend-data-cube';
|
|
17
18
|
import { TDSExecutionResult, V1_buildExecutionResult, V1_deserializeValueSpecification, V1_serializeExecutionResult, V1_serializeValueSpecification, } from '@finos/legend-graph';
|
|
18
|
-
import { guaranteeType } from '@finos/legend-shared';
|
|
19
|
-
import {
|
|
19
|
+
import { guaranteeType, isNonNullable, LogEvent, } from '@finos/legend-shared';
|
|
20
|
+
import { LegendREPLDataCubeSource } from './LegendREPLDataCubeSource.js';
|
|
21
|
+
import { APPLICATION_EVENT, shouldDisplayVirtualAssistantDocumentationEntry, } from '@finos/legend-application';
|
|
20
22
|
export class LegendREPLDataCubeEngine extends DataCubeEngine {
|
|
21
23
|
application;
|
|
22
24
|
client;
|
|
@@ -24,67 +26,69 @@ export class LegendREPLDataCubeEngine extends DataCubeEngine {
|
|
|
24
26
|
super();
|
|
25
27
|
this.application = application;
|
|
26
28
|
this.client = client;
|
|
27
|
-
this.enableDebugMode =
|
|
28
|
-
this.application.getPersistedBooleanValue(LEGEND_REPL_SETTING_KEY.ENABLE_DEBUG_MODE) ?? DEFAULT_ENABLE_DEBUG_MODE;
|
|
29
|
-
this.gridClientRowBuffer =
|
|
30
|
-
this.application.getPersistedNumericValue(LEGEND_REPL_SETTING_KEY.GRID_CLIENT_ROW_BUFFER) ?? DEFAULT_GRID_CLIENT_ROW_BUFFER;
|
|
31
|
-
this.gridClientPurgeClosedRowNodes =
|
|
32
|
-
this.application.getPersistedBooleanValue(LEGEND_REPL_SETTING_KEY.GRID_CLIENT_PURGE_CLOSED_ROW_NODES) ?? DEFAULT_GRID_CLIENT_PURGE_CLOSED_ROW_NODES;
|
|
33
|
-
this.gridClientSuppressLargeDatasetWarning =
|
|
34
|
-
this.application.getPersistedBooleanValue(LEGEND_REPL_SETTING_KEY.GRID_CLIENT_SUPPRESS_LARGE_DATASET_WARNING) ?? DEFAULT_GRID_CLIENT_SUPPRESS_LARGE_DATASET_WARNING;
|
|
35
|
-
}
|
|
36
|
-
setEnableDebugMode(value) {
|
|
37
|
-
super.setEnableDebugMode(value);
|
|
38
|
-
this.application.persistValue(LEGEND_REPL_SETTING_KEY.ENABLE_DEBUG_MODE, value);
|
|
39
|
-
}
|
|
40
|
-
setGridClientRowBuffer(value) {
|
|
41
|
-
super.setGridClientRowBuffer(value);
|
|
42
|
-
this.application.persistValue(LEGEND_REPL_SETTING_KEY.GRID_CLIENT_ROW_BUFFER, value);
|
|
43
|
-
}
|
|
44
|
-
setGridClientPurgeClosedRowNodes(value) {
|
|
45
|
-
super.setGridClientPurgeClosedRowNodes(value);
|
|
46
|
-
this.application.persistValue(LEGEND_REPL_SETTING_KEY.GRID_CLIENT_PURGE_CLOSED_ROW_NODES, value);
|
|
47
|
-
}
|
|
48
|
-
setGridClientSuppressLargeDatasetWarning(value) {
|
|
49
|
-
super.setGridClientSuppressLargeDatasetWarning(value);
|
|
50
|
-
this.application.persistValue(LEGEND_REPL_SETTING_KEY.GRID_CLIENT_SUPPRESS_LARGE_DATASET_WARNING, value);
|
|
51
|
-
}
|
|
52
|
-
async getInfrastructureInfo() {
|
|
53
|
-
return this.client.getInfrastructureInfo();
|
|
54
|
-
}
|
|
55
|
-
async getQueryTypeahead(code, query) {
|
|
56
|
-
return this.client.getQueryTypeahead({
|
|
57
|
-
code,
|
|
58
|
-
baseQuery: V1_serializeValueSpecification(query, []),
|
|
59
|
-
});
|
|
60
29
|
}
|
|
61
|
-
|
|
62
|
-
|
|
30
|
+
blockNavigation(blockCheckers, onBlock, onNativePlatformNavigationBlock) {
|
|
31
|
+
this.application.navigationService.navigator.blockNavigation(blockCheckers, onBlock, onNativePlatformNavigationBlock);
|
|
63
32
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
33
|
+
unblockNavigation() {
|
|
34
|
+
this.application.navigationService.navigator.unblockNavigation();
|
|
35
|
+
}
|
|
36
|
+
persistSettingValue(key, value) {
|
|
37
|
+
this.application.settingService.persistValue(key, value);
|
|
38
|
+
}
|
|
39
|
+
// ---------------------------------- IMPLEMENTATION ----------------------------------
|
|
40
|
+
async fetchConfiguration() {
|
|
41
|
+
const info = await this.client.getInfrastructureInfo();
|
|
42
|
+
return {
|
|
43
|
+
gridClientLicense: info.gridClientLicense,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async getInitialInput() {
|
|
47
|
+
const baseQuery = GetBaseQueryResult.serialization.fromJson(await this.client.getBaseQuery());
|
|
48
|
+
const source = new LegendREPLDataCubeSource();
|
|
49
|
+
source.mapping = baseQuery.source.mapping;
|
|
50
|
+
source.query = await this.parseValueSpecification(baseQuery.source.query, false);
|
|
51
|
+
source.runtime = baseQuery.source.runtime;
|
|
52
|
+
source.timestamp = baseQuery.source.timestamp;
|
|
53
|
+
source.sourceColumns = (await this.getQueryRelationType(_lambda([], [source.query]), source)).columns;
|
|
54
|
+
return {
|
|
55
|
+
query: baseQuery.query,
|
|
56
|
+
source,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
async parseValueSpecification(code, returnSourceInformation) {
|
|
60
|
+
return V1_deserializeValueSpecification(await this.client.parseValueSpecification({
|
|
61
|
+
code,
|
|
62
|
+
returnSourceInformation,
|
|
63
|
+
}), []);
|
|
64
|
+
}
|
|
65
|
+
getValueSpecificationCode(value, pretty) {
|
|
66
|
+
return this.client.getValueSpecificationCode({
|
|
67
|
+
value: V1_serializeValueSpecification(value, []),
|
|
67
68
|
pretty,
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
|
-
async
|
|
71
|
-
return
|
|
71
|
+
async getQueryTypeahead(code, baseQuery, source) {
|
|
72
|
+
return this.client.getQueryTypeahead({
|
|
73
|
+
code,
|
|
74
|
+
baseQuery: V1_serializeValueSpecification(baseQuery, []),
|
|
75
|
+
});
|
|
72
76
|
}
|
|
73
|
-
async getQueryRelationType(query) {
|
|
77
|
+
async getQueryRelationType(query, source) {
|
|
74
78
|
return this.client.getQueryRelationReturnType({
|
|
75
79
|
query: V1_serializeValueSpecification(query, []),
|
|
76
80
|
});
|
|
77
81
|
}
|
|
78
|
-
async getQueryCodeRelationReturnType(code, baseQuery) {
|
|
82
|
+
async getQueryCodeRelationReturnType(code, baseQuery, source) {
|
|
79
83
|
return this.client.getQueryCodeRelationReturnType({
|
|
80
84
|
code,
|
|
81
85
|
baseQuery: V1_serializeValueSpecification(baseQuery, []),
|
|
82
86
|
});
|
|
83
87
|
}
|
|
84
|
-
async executeQuery(query) {
|
|
88
|
+
async executeQuery(query, source, api) {
|
|
85
89
|
const result = await this.client.executeQuery({
|
|
86
90
|
query: V1_serializeValueSpecification(query, []),
|
|
87
|
-
debug:
|
|
91
|
+
debug: api.getSettings().enableDebugMode,
|
|
88
92
|
});
|
|
89
93
|
return {
|
|
90
94
|
result: guaranteeType(V1_buildExecutionResult(V1_serializeExecutionResult(JSON.parse(result.result))), TDSExecutionResult),
|
|
@@ -92,5 +96,50 @@ export class LegendREPLDataCubeEngine extends DataCubeEngine {
|
|
|
92
96
|
executedSQL: result.executedSQL,
|
|
93
97
|
};
|
|
94
98
|
}
|
|
99
|
+
buildExecutionContext(source) {
|
|
100
|
+
if (source instanceof LegendREPLDataCubeSource) {
|
|
101
|
+
return _function(DataCubeFunction.FROM, [
|
|
102
|
+
source.mapping ? _elementPtr(source.mapping) : undefined,
|
|
103
|
+
_elementPtr(source.runtime),
|
|
104
|
+
].filter(isNonNullable));
|
|
105
|
+
}
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
getDocumentationURL() {
|
|
109
|
+
return this.application.documentationService.url;
|
|
110
|
+
}
|
|
111
|
+
getDocumentationEntry(key) {
|
|
112
|
+
return this.application.documentationService.getDocEntry(key);
|
|
113
|
+
}
|
|
114
|
+
shouldDisplayDocumentationEntry(entry) {
|
|
115
|
+
return shouldDisplayVirtualAssistantDocumentationEntry(entry);
|
|
116
|
+
}
|
|
117
|
+
openLink(url) {
|
|
118
|
+
this.application.navigationService.navigator.visitAddress(url);
|
|
119
|
+
}
|
|
120
|
+
sendTelemetry(event, data) {
|
|
121
|
+
this.application.telemetryService.logEvent(event, data);
|
|
122
|
+
}
|
|
123
|
+
logDebug(message, ...data) {
|
|
124
|
+
this.application.logService.debug(LogEvent.create(APPLICATION_EVENT.DEBUG), message, ...data);
|
|
125
|
+
}
|
|
126
|
+
debugProcess(processName, ...data) {
|
|
127
|
+
this.application.logService.debug(LogEvent.create(APPLICATION_EVENT.DEBUG), `\n------ START DEBUG PROCESS: ${processName} ------`, ...data.flatMap(([key, value]) => [`\n[${key.toUpperCase()}]:`, value]), `\n------- END DEBUG PROCESS: ${processName} -------\n\n`);
|
|
128
|
+
}
|
|
129
|
+
logInfo(event, ...data) {
|
|
130
|
+
this.application.logService.info(event, ...data);
|
|
131
|
+
}
|
|
132
|
+
logWarning(event, ...data) {
|
|
133
|
+
this.application.logService.warn(event, ...data);
|
|
134
|
+
}
|
|
135
|
+
logError(event, ...data) {
|
|
136
|
+
this.application.logService.error(event, ...data);
|
|
137
|
+
}
|
|
138
|
+
logUnhandledError(error) {
|
|
139
|
+
this.application.logUnhandledError(error);
|
|
140
|
+
}
|
|
141
|
+
logIllegalStateError(message, error) {
|
|
142
|
+
this.logError(LogEvent.create(APPLICATION_EVENT.ILLEGAL_APPLICATION_STATE_OCCURRED), message, error);
|
|
143
|
+
}
|
|
95
144
|
}
|
|
96
145
|
//# sourceMappingURL=LegendREPLDataCubeEngine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendREPLDataCubeEngine.js","sourceRoot":"","sources":["../../src/stores/LegendREPLDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"LegendREPLDataCubeEngine.js","sourceRoot":"","sources":["../../src/stores/LegendREPLDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,kBAAkB,GAEnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP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,CAAC,EACvE,gCAAgC,WAAW,cAAc,CAC1D,CAAC;IACJ,CAAC;IAEQ,OAAO,CAAC,KAAe,EAAE,GAAG,IAAe;QAClD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;IACnD,CAAC;IAEQ,UAAU,CAAC,KAAe,EAAE,GAAG,IAAe;QACrD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;IACnD,CAAC;IAEQ,QAAQ,CAAC,KAAe,EAAE,GAAG,IAAe;QACnD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;IACpD,CAAC;IAEQ,iBAAiB,CAAC,KAAY;QACrC,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAEQ,oBAAoB,CAAC,OAAe,EAAE,KAAa;QAC1D,IAAI,CAAC,QAAQ,CACX,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,kCAAkC,CAAC,EACrE,OAAO,EACP,KAAK,CACN,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { DataCubeSource } from '@finos/legend-data-cube';
|
|
17
|
+
export declare class LegendREPLDataCubeSource extends DataCubeSource {
|
|
18
|
+
runtime: string;
|
|
19
|
+
mapping?: string | undefined;
|
|
20
|
+
timestamp: number;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=LegendREPLDataCubeSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendREPLDataCubeSource.d.ts","sourceRoot":"","sources":["../../src/stores/LegendREPLDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,qBAAa,wBAAyB,SAAQ,cAAc;IAC1D,OAAO,EAAG,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,EAAG,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { DataCubeSource } from '@finos/legend-data-cube';
|
|
17
|
+
export class LegendREPLDataCubeSource extends DataCubeSource {
|
|
18
|
+
runtime;
|
|
19
|
+
mapping;
|
|
20
|
+
timestamp;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=LegendREPLDataCubeSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendREPLDataCubeSource.js","sourceRoot":"","sources":["../../src/stores/LegendREPLDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IAC1D,OAAO,CAAU;IACjB,OAAO,CAAsB;IAC7B,SAAS,CAAU;CACpB"}
|
|
@@ -13,50 +13,65 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { type NetworkClient, type PlainObject } from '@finos/legend-shared';
|
|
17
|
-
import
|
|
16
|
+
import { SerializationFactory, type NetworkClient, type PlainObject } from '@finos/legend-shared';
|
|
17
|
+
import { DataCubeQuery, type CompletionItem, type RelationType } from '@finos/legend-data-cube';
|
|
18
18
|
import type { V1_Lambda, V1_ValueSpecification } from '@finos/legend-graph';
|
|
19
|
-
type
|
|
20
|
-
|
|
19
|
+
type GetValueSpecificationCodeInput = {
|
|
20
|
+
value: PlainObject<V1_ValueSpecification>;
|
|
21
21
|
pretty?: boolean | undefined;
|
|
22
22
|
};
|
|
23
|
-
type
|
|
23
|
+
type ParseValueSpecificationInput = {
|
|
24
24
|
code: string;
|
|
25
25
|
returnSourceInformation?: boolean | undefined;
|
|
26
26
|
};
|
|
27
|
-
type
|
|
27
|
+
type QueryTypeaheadInput = {
|
|
28
28
|
code: string;
|
|
29
|
-
baseQuery?: PlainObject<
|
|
29
|
+
baseQuery?: PlainObject<V1_Lambda>;
|
|
30
30
|
};
|
|
31
|
-
type
|
|
31
|
+
type GetQueryRelationReturnTypeInput = {
|
|
32
32
|
query: PlainObject<V1_Lambda>;
|
|
33
33
|
};
|
|
34
|
-
type
|
|
34
|
+
type GetQueryCodeRelationReturnTypeInput = {
|
|
35
35
|
code: string;
|
|
36
36
|
baseQuery?: PlainObject<V1_ValueSpecification>;
|
|
37
37
|
};
|
|
38
|
-
type
|
|
38
|
+
type ExecutionInput = {
|
|
39
39
|
query: PlainObject<V1_Lambda>;
|
|
40
40
|
debug?: boolean | undefined;
|
|
41
41
|
};
|
|
42
|
-
type
|
|
42
|
+
type ExecutionResult = {
|
|
43
43
|
result: string;
|
|
44
44
|
executedQuery: string;
|
|
45
45
|
executedSQL: string;
|
|
46
46
|
};
|
|
47
|
+
type InfrastructureInfo = {
|
|
48
|
+
gridClientLicense?: string | undefined;
|
|
49
|
+
};
|
|
50
|
+
declare class QuerySource {
|
|
51
|
+
runtime: string;
|
|
52
|
+
mapping?: string | undefined;
|
|
53
|
+
query: string;
|
|
54
|
+
timestamp: number;
|
|
55
|
+
static readonly serialization: SerializationFactory<QuerySource>;
|
|
56
|
+
}
|
|
57
|
+
export declare class GetBaseQueryResult {
|
|
58
|
+
query: DataCubeQuery;
|
|
59
|
+
source: QuerySource;
|
|
60
|
+
static readonly serialization: SerializationFactory<GetBaseQueryResult>;
|
|
61
|
+
}
|
|
47
62
|
export declare class LegendREPLServerClient {
|
|
48
63
|
private readonly networkClient;
|
|
49
64
|
constructor(networkClient: NetworkClient);
|
|
50
65
|
get baseUrl(): string;
|
|
51
66
|
private get dataCube();
|
|
52
|
-
getInfrastructureInfo(): Promise<
|
|
53
|
-
getQueryTypeahead(input:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
getBaseQuery(): Promise<PlainObject<
|
|
57
|
-
getQueryRelationReturnType(input:
|
|
58
|
-
getQueryCodeRelationReturnType(input:
|
|
59
|
-
executeQuery(input: PlainObject<
|
|
67
|
+
getInfrastructureInfo(): Promise<InfrastructureInfo>;
|
|
68
|
+
getQueryTypeahead(input: QueryTypeaheadInput): Promise<CompletionItem[]>;
|
|
69
|
+
parseValueSpecification(input: ParseValueSpecificationInput): Promise<PlainObject<V1_ValueSpecification>>;
|
|
70
|
+
getValueSpecificationCode(input: GetValueSpecificationCodeInput): Promise<string>;
|
|
71
|
+
getBaseQuery(): Promise<PlainObject<GetBaseQueryResult>>;
|
|
72
|
+
getQueryRelationReturnType(input: GetQueryRelationReturnTypeInput): Promise<RelationType>;
|
|
73
|
+
getQueryCodeRelationReturnType(input: GetQueryCodeRelationReturnTypeInput): Promise<RelationType>;
|
|
74
|
+
executeQuery(input: PlainObject<ExecutionInput>): Promise<ExecutionResult>;
|
|
60
75
|
}
|
|
61
76
|
export {};
|
|
62
77
|
//# sourceMappingURL=LegendREPLServerClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendREPLServerClient.d.ts","sourceRoot":"","sources":["../../src/stores/LegendREPLServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"LegendREPLServerClient.d.ts","sourceRoot":"","sources":["../../src/stores/LegendREPLServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAIL,oBAAoB,EAEpB,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAG5E,KAAK,8BAA8B,GAAG;IACpC,KAAK,EAAE,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,KAAK,4BAA4B,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;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kB,CAAC;IAIpD,iBAAiB,CACrB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,cAAc,EAAE,CAAC;IAItB,uBAAuB,CAC3B,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAOxC,yBAAyB,CAC7B,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,MAAM,CAAC;IASZ,YAAY,IAAI,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAIxD,0BAA0B,CAC9B,KAAK,EAAE,+BAA+B,GACrC,OAAO,CAAC,YAAY,CAAC;IAOlB,8BAA8B,CAClC,KAAK,EAAE,mCAAmC,GACzC,OAAO,CAAC,YAAY,CAAC;IAOlB,YAAY,CAChB,KAAK,EAAE,WAAW,CAAC,cAAc,CAAC,GACjC,OAAO,CAAC,eAAe,CAAC;CAG5B"}
|
|
@@ -13,7 +13,29 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ContentType, guaranteeNonNullable, HttpHeader, } from '@finos/legend-shared';
|
|
16
|
+
import { ContentType, guaranteeNonNullable, HttpHeader, SerializationFactory, usingModelSchema, } from '@finos/legend-shared';
|
|
17
|
+
import { DataCubeQuery, } from '@finos/legend-data-cube';
|
|
18
|
+
import { createModelSchema, optional, primitive } from 'serializr';
|
|
19
|
+
class QuerySource {
|
|
20
|
+
runtime;
|
|
21
|
+
mapping;
|
|
22
|
+
query;
|
|
23
|
+
timestamp;
|
|
24
|
+
static serialization = new SerializationFactory(createModelSchema(QuerySource, {
|
|
25
|
+
mapping: optional(primitive()),
|
|
26
|
+
query: primitive(),
|
|
27
|
+
runtime: primitive(),
|
|
28
|
+
timestamp: primitive(),
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
export class GetBaseQueryResult {
|
|
32
|
+
query;
|
|
33
|
+
source;
|
|
34
|
+
static serialization = new SerializationFactory(createModelSchema(GetBaseQueryResult, {
|
|
35
|
+
query: usingModelSchema(DataCubeQuery.serialization.schema),
|
|
36
|
+
source: usingModelSchema(QuerySource.serialization.schema),
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
17
39
|
export class LegendREPLServerClient {
|
|
18
40
|
networkClient;
|
|
19
41
|
constructor(networkClient) {
|
|
@@ -31,11 +53,11 @@ export class LegendREPLServerClient {
|
|
|
31
53
|
async getQueryTypeahead(input) {
|
|
32
54
|
return this.networkClient.post(`${this.dataCube}/typeahead`, input);
|
|
33
55
|
}
|
|
34
|
-
async
|
|
35
|
-
return this.networkClient.post(`${this.dataCube}/
|
|
56
|
+
async parseValueSpecification(input) {
|
|
57
|
+
return this.networkClient.post(`${this.dataCube}/parseValueSpecification`, input);
|
|
36
58
|
}
|
|
37
|
-
async
|
|
38
|
-
return this.networkClient.post(`${this.dataCube}/
|
|
59
|
+
async getValueSpecificationCode(input) {
|
|
60
|
+
return this.networkClient.post(`${this.dataCube}/getValueSpecificationCode`, input, {}, { [HttpHeader.ACCEPT]: ContentType.TEXT_PLAIN });
|
|
39
61
|
}
|
|
40
62
|
async getBaseQuery() {
|
|
41
63
|
return this.networkClient.get(`${this.dataCube}/getBaseQuery`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendREPLServerClient.js","sourceRoot":"","sources":["../../src/stores/LegendREPLServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,UAAU,
|
|
1
|
+
{"version":3,"file":"LegendREPLServerClient.js","sourceRoot":"","sources":["../../src/stores/LegendREPLServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,oBAAoB,EACpB,gBAAgB,GAGjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,aAAa,GAGd,MAAM,yBAAyB,CAA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