@finos/legend-application-repl 1.0.8 → 1.0.10
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 +6 -5
- 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 +12 -11
- 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
|
@@ -18,52 +18,86 @@ import {
|
|
|
18
18
|
ContentType,
|
|
19
19
|
guaranteeNonNullable,
|
|
20
20
|
HttpHeader,
|
|
21
|
+
SerializationFactory,
|
|
22
|
+
usingModelSchema,
|
|
21
23
|
type NetworkClient,
|
|
22
24
|
type PlainObject,
|
|
23
25
|
} from '@finos/legend-shared';
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
DataCubeInfrastructureInfo,
|
|
26
|
+
import {
|
|
27
|
+
DataCubeQuery,
|
|
28
|
+
type CompletionItem,
|
|
29
|
+
type RelationType,
|
|
29
30
|
} from '@finos/legend-data-cube';
|
|
30
31
|
import type { V1_Lambda, V1_ValueSpecification } from '@finos/legend-graph';
|
|
32
|
+
import { createModelSchema, optional, primitive } from 'serializr';
|
|
31
33
|
|
|
32
|
-
type
|
|
33
|
-
|
|
34
|
+
type GetValueSpecificationCodeInput = {
|
|
35
|
+
value: PlainObject<V1_ValueSpecification>;
|
|
34
36
|
pretty?: boolean | undefined;
|
|
35
37
|
};
|
|
36
38
|
|
|
37
|
-
type
|
|
39
|
+
type ParseValueSpecificationInput = {
|
|
38
40
|
code: string;
|
|
39
41
|
returnSourceInformation?: boolean | undefined;
|
|
40
42
|
};
|
|
41
43
|
|
|
42
|
-
type
|
|
44
|
+
type QueryTypeaheadInput = {
|
|
43
45
|
code: string;
|
|
44
|
-
baseQuery?: PlainObject<
|
|
46
|
+
baseQuery?: PlainObject<V1_Lambda>;
|
|
45
47
|
};
|
|
46
48
|
|
|
47
|
-
type
|
|
49
|
+
type GetQueryRelationReturnTypeInput = {
|
|
48
50
|
query: PlainObject<V1_Lambda>;
|
|
49
51
|
};
|
|
50
52
|
|
|
51
|
-
type
|
|
53
|
+
type GetQueryCodeRelationReturnTypeInput = {
|
|
52
54
|
code: string;
|
|
53
55
|
baseQuery?: PlainObject<V1_ValueSpecification>;
|
|
54
56
|
};
|
|
55
57
|
|
|
56
|
-
type
|
|
58
|
+
type ExecutionInput = {
|
|
57
59
|
query: PlainObject<V1_Lambda>;
|
|
58
60
|
debug?: boolean | undefined;
|
|
59
61
|
};
|
|
60
62
|
|
|
61
|
-
type
|
|
63
|
+
type ExecutionResult = {
|
|
62
64
|
result: string;
|
|
63
65
|
executedQuery: string;
|
|
64
66
|
executedSQL: string;
|
|
65
67
|
};
|
|
66
68
|
|
|
69
|
+
type InfrastructureInfo = {
|
|
70
|
+
gridClientLicense?: string | undefined;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
class QuerySource {
|
|
74
|
+
runtime!: string;
|
|
75
|
+
mapping?: string | undefined;
|
|
76
|
+
query!: string;
|
|
77
|
+
timestamp!: number;
|
|
78
|
+
|
|
79
|
+
static readonly serialization = new SerializationFactory(
|
|
80
|
+
createModelSchema(QuerySource, {
|
|
81
|
+
mapping: optional(primitive()),
|
|
82
|
+
query: primitive(),
|
|
83
|
+
runtime: primitive(),
|
|
84
|
+
timestamp: primitive(),
|
|
85
|
+
}),
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export class GetBaseQueryResult {
|
|
90
|
+
query!: DataCubeQuery;
|
|
91
|
+
source!: QuerySource;
|
|
92
|
+
|
|
93
|
+
static readonly serialization = new SerializationFactory(
|
|
94
|
+
createModelSchema(GetBaseQueryResult, {
|
|
95
|
+
query: usingModelSchema(DataCubeQuery.serialization.schema),
|
|
96
|
+
source: usingModelSchema(QuerySource.serialization.schema),
|
|
97
|
+
}),
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
67
101
|
export class LegendREPLServerClient {
|
|
68
102
|
private readonly networkClient: NetworkClient;
|
|
69
103
|
|
|
@@ -82,37 +116,42 @@ export class LegendREPLServerClient {
|
|
|
82
116
|
return `${this.baseUrl}/api/dataCube`;
|
|
83
117
|
}
|
|
84
118
|
|
|
85
|
-
async getInfrastructureInfo(): Promise<
|
|
119
|
+
async getInfrastructureInfo(): Promise<InfrastructureInfo> {
|
|
86
120
|
return this.networkClient.get(`${this.dataCube}/infrastructureInfo`);
|
|
87
121
|
}
|
|
88
122
|
|
|
89
123
|
async getQueryTypeahead(
|
|
90
|
-
input:
|
|
124
|
+
input: QueryTypeaheadInput,
|
|
91
125
|
): Promise<CompletionItem[]> {
|
|
92
126
|
return this.networkClient.post(`${this.dataCube}/typeahead`, input);
|
|
93
127
|
}
|
|
94
128
|
|
|
95
|
-
async
|
|
96
|
-
input:
|
|
129
|
+
async parseValueSpecification(
|
|
130
|
+
input: ParseValueSpecificationInput,
|
|
97
131
|
): Promise<PlainObject<V1_ValueSpecification>> {
|
|
98
|
-
return this.networkClient.post(
|
|
132
|
+
return this.networkClient.post(
|
|
133
|
+
`${this.dataCube}/parseValueSpecification`,
|
|
134
|
+
input,
|
|
135
|
+
);
|
|
99
136
|
}
|
|
100
137
|
|
|
101
|
-
async
|
|
138
|
+
async getValueSpecificationCode(
|
|
139
|
+
input: GetValueSpecificationCodeInput,
|
|
140
|
+
): Promise<string> {
|
|
102
141
|
return this.networkClient.post(
|
|
103
|
-
`${this.dataCube}/
|
|
142
|
+
`${this.dataCube}/getValueSpecificationCode`,
|
|
104
143
|
input,
|
|
105
144
|
{},
|
|
106
145
|
{ [HttpHeader.ACCEPT]: ContentType.TEXT_PLAIN },
|
|
107
146
|
);
|
|
108
147
|
}
|
|
109
148
|
|
|
110
|
-
async getBaseQuery(): Promise<PlainObject<
|
|
149
|
+
async getBaseQuery(): Promise<PlainObject<GetBaseQueryResult>> {
|
|
111
150
|
return this.networkClient.get(`${this.dataCube}/getBaseQuery`);
|
|
112
151
|
}
|
|
113
152
|
|
|
114
153
|
async getQueryRelationReturnType(
|
|
115
|
-
input:
|
|
154
|
+
input: GetQueryRelationReturnTypeInput,
|
|
116
155
|
): Promise<RelationType> {
|
|
117
156
|
return this.networkClient.post(
|
|
118
157
|
`${this.dataCube}/getRelationReturnType`,
|
|
@@ -121,7 +160,7 @@ export class LegendREPLServerClient {
|
|
|
121
160
|
}
|
|
122
161
|
|
|
123
162
|
async getQueryCodeRelationReturnType(
|
|
124
|
-
input:
|
|
163
|
+
input: GetQueryCodeRelationReturnTypeInput,
|
|
125
164
|
): Promise<RelationType> {
|
|
126
165
|
return this.networkClient.post(
|
|
127
166
|
`${this.dataCube}/getRelationReturnType/code`,
|
|
@@ -130,8 +169,8 @@ export class LegendREPLServerClient {
|
|
|
130
169
|
}
|
|
131
170
|
|
|
132
171
|
async executeQuery(
|
|
133
|
-
input: PlainObject<
|
|
134
|
-
): Promise<
|
|
172
|
+
input: PlainObject<ExecutionInput>,
|
|
173
|
+
): Promise<ExecutionResult> {
|
|
135
174
|
return this.networkClient.post(`${this.dataCube}/executeQuery`, input);
|
|
136
175
|
}
|
|
137
176
|
}
|
package/tsconfig.json
CHANGED
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"./src/__lib__/LegendREPLSetting.ts",
|
|
53
53
|
"./src/application/LegendREPLApplicationConfig.ts",
|
|
54
54
|
"./src/application/LegendREPLApplicationStore.ts",
|
|
55
|
-
"./src/stores/LegendREPLDataCubeApplicationEngine.ts",
|
|
56
55
|
"./src/stores/LegendREPLDataCubeEngine.ts",
|
|
56
|
+
"./src/stores/LegendREPLDataCubeSource.ts",
|
|
57
57
|
"./src/stores/LegendREPLServerClient.ts",
|
|
58
58
|
"./src/index.tsx",
|
|
59
59
|
"./src/application/LegendREPL.tsx",
|
|
@@ -1,43 +0,0 @@
|
|
|
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 DocumentationEntry, LogEvent } from '@finos/legend-shared';
|
|
17
|
-
import { DataCubeApplicationEngine } from '@finos/legend-data-cube';
|
|
18
|
-
import type { LegendREPLApplicationStore } from '../application/LegendREPLApplicationStore.js';
|
|
19
|
-
export declare class LegendREPLDataCubeApplicationEngine extends DataCubeApplicationEngine {
|
|
20
|
-
private readonly application;
|
|
21
|
-
constructor(application: LegendREPLApplicationStore);
|
|
22
|
-
get documentationUrl(): string | undefined;
|
|
23
|
-
getDocumentationEntry(key: string): DocumentationEntry | undefined;
|
|
24
|
-
openDocumentationEntry(entry: DocumentationEntry): void;
|
|
25
|
-
shouldDisplayDocumentationEntry(entry: DocumentationEntry): boolean;
|
|
26
|
-
openLink(url: string): void;
|
|
27
|
-
setWindowTitle(title: string): void;
|
|
28
|
-
blockNavigation(blockCheckers: (() => boolean)[], onBlock?: ((onProceed: () => void) => void) | undefined, onNativePlatformNavigationBlock?: (() => void) | undefined): void;
|
|
29
|
-
unblockNavigation(): void;
|
|
30
|
-
logDebug(message: string, ...data: unknown[]): void;
|
|
31
|
-
debugProcess(processName: string, ...data: [string, unknown][]): void;
|
|
32
|
-
logInfo(event: LogEvent, ...data: unknown[]): void;
|
|
33
|
-
logWarning(event: LogEvent, ...data: unknown[]): void;
|
|
34
|
-
logError(event: LogEvent, ...data: unknown[]): void;
|
|
35
|
-
logUnhandledError(error: Error): void;
|
|
36
|
-
logIllegalStateError(message: string, error?: Error): void;
|
|
37
|
-
getPersistedNumericValue(key: string): number | undefined;
|
|
38
|
-
getPersistedStringValue(key: string): string | undefined;
|
|
39
|
-
getPersistedBooleanValue(key: string): boolean | undefined;
|
|
40
|
-
getPersistedObjectValue(key: string): object | undefined;
|
|
41
|
-
persistValue(key: string, value: string | number | boolean | object | undefined): void;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=LegendREPLDataCubeApplicationEngine.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LegendREPLDataCubeApplicationEngine.d.ts","source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GAAG,IAAI,EAAE,OAAO,EAAE;IAI5C,iBAAiB,CAAC,KAAK,EAAE,KAAK;IAI9B,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAQnD,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIzD,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIxD,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAI1D,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIxD,YAAY,CACV,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GACpD,IAAI;CAGR"}
|
|
@@ -1,86 +0,0 @@
|
|
|
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 { shouldDisplayVirtualAssistantDocumentationEntry, APPLICATION_EVENT, } from '@finos/legend-application';
|
|
17
|
-
import { LogEvent } from '@finos/legend-shared';
|
|
18
|
-
import { DataCubeApplicationEngine } from '@finos/legend-data-cube';
|
|
19
|
-
export class LegendREPLDataCubeApplicationEngine extends DataCubeApplicationEngine {
|
|
20
|
-
application;
|
|
21
|
-
constructor(application) {
|
|
22
|
-
super();
|
|
23
|
-
this.application = application;
|
|
24
|
-
}
|
|
25
|
-
get documentationUrl() {
|
|
26
|
-
return this.application.documentationService.url;
|
|
27
|
-
}
|
|
28
|
-
getDocumentationEntry(key) {
|
|
29
|
-
return this.application.documentationService.getDocEntry(key);
|
|
30
|
-
}
|
|
31
|
-
openDocumentationEntry(entry) {
|
|
32
|
-
this.currentDocumentationEntry = entry;
|
|
33
|
-
}
|
|
34
|
-
shouldDisplayDocumentationEntry(entry) {
|
|
35
|
-
return shouldDisplayVirtualAssistantDocumentationEntry(entry);
|
|
36
|
-
}
|
|
37
|
-
openLink(url) {
|
|
38
|
-
this.application.navigationService.navigator.visitAddress(url);
|
|
39
|
-
}
|
|
40
|
-
setWindowTitle(title) {
|
|
41
|
-
this.application.layoutService.setWindowTitle(title);
|
|
42
|
-
}
|
|
43
|
-
blockNavigation(blockCheckers, onBlock, onNativePlatformNavigationBlock) {
|
|
44
|
-
this.application.navigationService.navigator.blockNavigation(blockCheckers, onBlock, onNativePlatformNavigationBlock);
|
|
45
|
-
}
|
|
46
|
-
unblockNavigation() {
|
|
47
|
-
this.application.navigationService.navigator.unblockNavigation();
|
|
48
|
-
}
|
|
49
|
-
logDebug(message, ...data) {
|
|
50
|
-
this.application.logService.debug(LogEvent.create(APPLICATION_EVENT.DEBUG), message, ...data);
|
|
51
|
-
}
|
|
52
|
-
debugProcess(processName, ...data) {
|
|
53
|
-
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`);
|
|
54
|
-
}
|
|
55
|
-
logInfo(event, ...data) {
|
|
56
|
-
this.application.logService.info(event, ...data);
|
|
57
|
-
}
|
|
58
|
-
logWarning(event, ...data) {
|
|
59
|
-
this.application.logService.warn(event, ...data);
|
|
60
|
-
}
|
|
61
|
-
logError(event, ...data) {
|
|
62
|
-
this.application.logService.error(event, ...data);
|
|
63
|
-
}
|
|
64
|
-
logUnhandledError(error) {
|
|
65
|
-
this.application.logUnhandledError(error);
|
|
66
|
-
}
|
|
67
|
-
logIllegalStateError(message, error) {
|
|
68
|
-
this.logError(LogEvent.create(APPLICATION_EVENT.ILLEGAL_APPLICATION_STATE_OCCURRED), message, error);
|
|
69
|
-
}
|
|
70
|
-
getPersistedNumericValue(key) {
|
|
71
|
-
return this.application.settingService.getNumericValue(key);
|
|
72
|
-
}
|
|
73
|
-
getPersistedStringValue(key) {
|
|
74
|
-
return this.application.settingService.getStringValue(key);
|
|
75
|
-
}
|
|
76
|
-
getPersistedBooleanValue(key) {
|
|
77
|
-
return this.application.settingService.getBooleanValue(key);
|
|
78
|
-
}
|
|
79
|
-
getPersistedObjectValue(key) {
|
|
80
|
-
return this.application.settingService.getObjectValue(key);
|
|
81
|
-
}
|
|
82
|
-
persistValue(key, value) {
|
|
83
|
-
this.application.settingService.persistValue(key, value);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=LegendREPLDataCubeApplicationEngine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LegendREPLDataCubeApplicationEngine.js","sourceRoot":"","sources":["../../src/stores/LegendREPLDataCubeApplicationEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,+CAA+C,EAC/C,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAA2B,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAGpE,MAAM,OAAO,mCAAoC,SAAQ,yBAAyB;IAC/D,WAAW,CAA6B;IAEzD,YAAY,WAAuC;QACjD,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,IAAI,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AAc,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IAC9D,CAAC;IAED,uBAAuB,CAAC,GAAW;QACjC,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7D,CAAC;IAED,YAAY,CACV,GAAW,EACX,KAAqD;QAErD,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
|
@@ -1,137 +0,0 @@
|
|
|
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 {
|
|
18
|
-
shouldDisplayVirtualAssistantDocumentationEntry,
|
|
19
|
-
APPLICATION_EVENT,
|
|
20
|
-
} from '@finos/legend-application';
|
|
21
|
-
import { type DocumentationEntry, LogEvent } from '@finos/legend-shared';
|
|
22
|
-
import { DataCubeApplicationEngine } from '@finos/legend-data-cube';
|
|
23
|
-
import type { LegendREPLApplicationStore } from '../application/LegendREPLApplicationStore.js';
|
|
24
|
-
|
|
25
|
-
export class LegendREPLDataCubeApplicationEngine extends DataCubeApplicationEngine {
|
|
26
|
-
private readonly application: LegendREPLApplicationStore;
|
|
27
|
-
|
|
28
|
-
constructor(application: LegendREPLApplicationStore) {
|
|
29
|
-
super();
|
|
30
|
-
|
|
31
|
-
this.application = application;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
get documentationUrl(): string | undefined {
|
|
35
|
-
return this.application.documentationService.url;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
getDocumentationEntry(key: string) {
|
|
39
|
-
return this.application.documentationService.getDocEntry(key);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
openDocumentationEntry(entry: DocumentationEntry) {
|
|
43
|
-
this.currentDocumentationEntry = entry;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
shouldDisplayDocumentationEntry(entry: DocumentationEntry) {
|
|
47
|
-
return shouldDisplayVirtualAssistantDocumentationEntry(entry);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
openLink(url: string) {
|
|
51
|
-
this.application.navigationService.navigator.visitAddress(url);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
setWindowTitle(title: string) {
|
|
55
|
-
this.application.layoutService.setWindowTitle(title);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
blockNavigation(
|
|
59
|
-
blockCheckers: (() => boolean)[],
|
|
60
|
-
onBlock?: ((onProceed: () => void) => void) | undefined,
|
|
61
|
-
onNativePlatformNavigationBlock?: (() => void) | undefined,
|
|
62
|
-
) {
|
|
63
|
-
this.application.navigationService.navigator.blockNavigation(
|
|
64
|
-
blockCheckers,
|
|
65
|
-
onBlock,
|
|
66
|
-
onNativePlatformNavigationBlock,
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
unblockNavigation() {
|
|
71
|
-
this.application.navigationService.navigator.unblockNavigation();
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
logDebug(message: string, ...data: unknown[]) {
|
|
75
|
-
this.application.logService.debug(
|
|
76
|
-
LogEvent.create(APPLICATION_EVENT.DEBUG),
|
|
77
|
-
message,
|
|
78
|
-
...data,
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
debugProcess(processName: string, ...data: [string, unknown][]) {
|
|
83
|
-
this.application.logService.debug(
|
|
84
|
-
LogEvent.create(APPLICATION_EVENT.DEBUG),
|
|
85
|
-
`\n------ START DEBUG PROCESS: ${processName} ------`,
|
|
86
|
-
...data.flatMap(([key, value]) => [`\n[${key.toUpperCase()}]:`, value]),
|
|
87
|
-
`\n------- END DEBUG PROCESS: ${processName} -------\n\n`,
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
logInfo(event: LogEvent, ...data: unknown[]) {
|
|
92
|
-
this.application.logService.info(event, ...data);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
logWarning(event: LogEvent, ...data: unknown[]) {
|
|
96
|
-
this.application.logService.warn(event, ...data);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
logError(event: LogEvent, ...data: unknown[]) {
|
|
100
|
-
this.application.logService.error(event, ...data);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
logUnhandledError(error: Error) {
|
|
104
|
-
this.application.logUnhandledError(error);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
logIllegalStateError(message: string, error?: Error) {
|
|
108
|
-
this.logError(
|
|
109
|
-
LogEvent.create(APPLICATION_EVENT.ILLEGAL_APPLICATION_STATE_OCCURRED),
|
|
110
|
-
message,
|
|
111
|
-
error,
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
getPersistedNumericValue(key: string): number | undefined {
|
|
116
|
-
return this.application.settingService.getNumericValue(key);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
getPersistedStringValue(key: string): string | undefined {
|
|
120
|
-
return this.application.settingService.getStringValue(key);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
getPersistedBooleanValue(key: string): boolean | undefined {
|
|
124
|
-
return this.application.settingService.getBooleanValue(key);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
getPersistedObjectValue(key: string): object | undefined {
|
|
128
|
-
return this.application.settingService.getObjectValue(key);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
persistValue(
|
|
132
|
-
key: string,
|
|
133
|
-
value: string | number | boolean | object | undefined,
|
|
134
|
-
): void {
|
|
135
|
-
this.application.settingService.persistValue(key, value);
|
|
136
|
-
}
|
|
137
|
-
}
|