@finos/legend-application-repl 1.0.31 → 1.0.33
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/application/LegendREPLNavigation.d.ts +20 -0
- package/lib/application/LegendREPLNavigation.d.ts.map +1 -0
- package/lib/application/LegendREPLNavigation.js +20 -0
- package/lib/application/LegendREPLNavigation.js.map +1 -0
- package/lib/components/LegendREPLApplication.d.ts.map +1 -1
- package/lib/components/LegendREPLApplication.js +9 -12
- package/lib/components/LegendREPLApplication.js.map +1 -1
- package/lib/components/LegendREPLDataCubeHeader.d.ts +22 -0
- package/lib/components/LegendREPLDataCubeHeader.d.ts.map +1 -0
- package/lib/components/LegendREPLDataCubeHeader.js +21 -0
- package/lib/components/LegendREPLDataCubeHeader.js.map +1 -0
- package/lib/components/LegendREPLFramworkProvider.d.ts +21 -0
- package/lib/components/LegendREPLFramworkProvider.d.ts.map +1 -0
- package/lib/components/LegendREPLFramworkProvider.js +31 -0
- package/lib/components/LegendREPLFramworkProvider.js.map +1 -0
- package/lib/components/LegendREPLPublishDataCubeAlert.d.ts +20 -0
- package/lib/components/LegendREPLPublishDataCubeAlert.d.ts.map +1 -0
- package/lib/components/LegendREPLPublishDataCubeAlert.js +36 -0
- package/lib/components/LegendREPLPublishDataCubeAlert.js.map +1 -0
- package/lib/index.css +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/LegendREPLBaseStore.d.ts +31 -0
- package/lib/stores/LegendREPLBaseStore.d.ts.map +1 -0
- package/lib/stores/LegendREPLBaseStore.js +94 -0
- package/lib/stores/LegendREPLBaseStore.js.map +1 -0
- package/lib/stores/LegendREPLDataCubeEngine.d.ts +6 -6
- package/lib/stores/LegendREPLDataCubeEngine.d.ts.map +1 -1
- package/lib/stores/LegendREPLDataCubeEngine.js +43 -21
- package/lib/stores/LegendREPLDataCubeEngine.js.map +1 -1
- package/lib/stores/LegendREPLDataCubeSource.d.ts +4 -0
- package/lib/stores/LegendREPLDataCubeSource.d.ts.map +1 -1
- package/lib/stores/LegendREPLDataCubeSource.js +3 -0
- package/lib/stores/LegendREPLDataCubeSource.js.map +1 -1
- package/lib/stores/LegendREPLServerClient.d.ts +15 -11
- package/lib/stores/LegendREPLServerClient.d.ts.map +1 -1
- package/lib/stores/LegendREPLServerClient.js +22 -25
- package/lib/stores/LegendREPLServerClient.js.map +1 -1
- package/package.json +7 -7
- package/src/application/LegendREPLNavigation.ts +23 -0
- package/src/components/LegendREPLApplication.tsx +16 -35
- package/src/components/LegendREPLDataCubeHeader.tsx +53 -0
- package/src/components/LegendREPLFramworkProvider.tsx +62 -0
- package/src/components/LegendREPLPublishDataCubeAlert.tsx +103 -0
- package/src/stores/LegendREPLBaseStore.tsx +135 -0
- package/src/stores/LegendREPLDataCubeEngine.ts +60 -26
- package/src/stores/LegendREPLDataCubeSource.ts +5 -0
- package/src/stores/LegendREPLServerClient.ts +37 -41
- package/tsconfig.json +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendREPLDataCubeEngine.js","sourceRoot":"","sources":["../../src/stores/LegendREPLDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"LegendREPLDataCubeEngine.js","sourceRoot":"","sources":["../../src/stores/LegendREPLDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,GAE3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,cAAc,EACd,gBAAgB,EAGhB,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,kBAAkB,EAElB,uBAAuB,EACvB,gCAAgC,EAChC,2BAA2B,EAC3B,8BAA8B,EAG9B,mBAAmB,EACnB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iBAAiB,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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"}
|
|
@@ -14,9 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { DataCubeSource } from '@finos/legend-data-cube';
|
|
17
|
+
import type { PlainObject } from '@finos/legend-shared';
|
|
17
18
|
export declare class LegendREPLDataCubeSource extends DataCubeSource {
|
|
18
19
|
runtime: string;
|
|
19
20
|
mapping?: string | undefined;
|
|
20
21
|
timestamp: number;
|
|
22
|
+
model?: PlainObject | undefined;
|
|
23
|
+
isLocal: boolean;
|
|
24
|
+
isPersistenceSupported: boolean;
|
|
21
25
|
}
|
|
22
26
|
//# sourceMappingURL=LegendREPLDataCubeSource.d.ts.map
|
|
@@ -1 +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;
|
|
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;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,qBAAa,wBAAyB,SAAQ,cAAc;IAC1D,OAAO,EAAG,MAAM,CAAC;IAEjB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,EAAG,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAChC,OAAO,EAAG,OAAO,CAAC;IAClB,sBAAsB,EAAG,OAAO,CAAC;CAClC"}
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"LegendREPLDataCubeSource.js","sourceRoot":"","sources":["../../src/stores/LegendREPLDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IAC1D,OAAO,CAAU;IAEjB,OAAO,CAAsB;IAC7B,SAAS,CAAU;IACnB,KAAK,CAA2B;IAChC,OAAO,CAAW;IAClB,sBAAsB,CAAW;CAClC"}
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { SerializationFactory, type NetworkClient, type PlainObject } from '@finos/legend-shared';
|
|
17
|
-
import { DataCubeQuery, type CompletionItem, type RelationType } from '@finos/legend-data-cube';
|
|
18
|
-
import { type V1_Lambda, type V1_ValueSpecification } from '@finos/legend-graph';
|
|
17
|
+
import { type DataCubeQuery, type CompletionItem, type RelationType } from '@finos/legend-data-cube';
|
|
18
|
+
import { type PersistentDataCubeQuery, type V1_Lambda, type V1_ValueSpecification } from '@finos/legend-graph';
|
|
19
19
|
type GetValueSpecificationCodeInput = {
|
|
20
20
|
value: PlainObject<V1_ValueSpecification>;
|
|
21
21
|
pretty?: boolean | undefined;
|
|
@@ -45,20 +45,23 @@ type ExecutionResult = {
|
|
|
45
45
|
executedSQL: string;
|
|
46
46
|
};
|
|
47
47
|
type InfrastructureInfo = {
|
|
48
|
+
currentUser?: string | undefined;
|
|
48
49
|
gridClientLicense?: string | undefined;
|
|
50
|
+
queryServerBaseUrl?: string | undefined;
|
|
51
|
+
hostedApplicationBaseUrl?: string | undefined;
|
|
49
52
|
};
|
|
50
|
-
declare
|
|
53
|
+
export declare const REPL_DATA_CUBE_SOURCE_TYPE = "repl";
|
|
54
|
+
declare class REPLBaseDataCubeQuerySource {
|
|
55
|
+
query: string;
|
|
51
56
|
runtime: string;
|
|
57
|
+
model?: PlainObject | undefined;
|
|
52
58
|
mapping?: string | undefined;
|
|
53
|
-
query: string;
|
|
54
59
|
timestamp: number;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
query: DataCubeQuery;
|
|
59
|
-
source: QuerySource;
|
|
60
|
-
static readonly serialization: SerializationFactory<GetBaseQueryResult>;
|
|
60
|
+
isLocal: boolean;
|
|
61
|
+
isPersistenceSupported: boolean;
|
|
62
|
+
static readonly serialization: SerializationFactory<REPLBaseDataCubeQuerySource>;
|
|
61
63
|
}
|
|
64
|
+
export declare function deserializeREPLQuerySource(value: PlainObject<REPLBaseDataCubeQuerySource>): REPLBaseDataCubeQuerySource;
|
|
62
65
|
export declare class LegendREPLServerClient {
|
|
63
66
|
private readonly networkClient;
|
|
64
67
|
constructor(networkClient: NetworkClient);
|
|
@@ -68,10 +71,11 @@ export declare class LegendREPLServerClient {
|
|
|
68
71
|
getQueryTypeahead(input: QueryTypeaheadInput): Promise<CompletionItem[]>;
|
|
69
72
|
parseValueSpecification(input: ParseValueSpecificationInput): Promise<PlainObject<V1_ValueSpecification>>;
|
|
70
73
|
getValueSpecificationCode(input: GetValueSpecificationCodeInput): Promise<string>;
|
|
71
|
-
getBaseQuery(): Promise<PlainObject<
|
|
74
|
+
getBaseQuery(): Promise<PlainObject<DataCubeQuery>>;
|
|
72
75
|
getQueryRelationReturnType(input: GetQueryRelationReturnTypeInput): Promise<RelationType>;
|
|
73
76
|
getQueryCodeRelationReturnType(input: GetQueryCodeRelationReturnTypeInput): Promise<RelationType>;
|
|
74
77
|
executeQuery(input: PlainObject<ExecutionInput>): Promise<ExecutionResult>;
|
|
78
|
+
publishQuery(query: PlainObject<PersistentDataCubeQuery>, queryStoreBaseUrl: string): Promise<PlainObject<PersistentDataCubeQuery>>;
|
|
75
79
|
}
|
|
76
80
|
export {};
|
|
77
81
|
//# 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,
|
|
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,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAG7B,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,MAA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C,QAAQ,CAAC,aAAa,oDAW3B;CACH;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,WAAW,CAAC,2BAA2B,CAAC,+BAGhD;AAED,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;gBAElC,aAAa,EAAE,aAAa;IAIxC,IAAI,OAAO,IAAI,MAAM,CAKpB;IAED,OAAO,KAAK,QAAQ,GAEnB;IAEK,qBAAqB,IAAI,OAAO,CAAC,kBAAkB,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,aAAa,CAAC,CAAC;IAInD,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;IAIrB,YAAY,CAChB,KAAK,EAAE,WAAW,CAAC,uBAAuB,CAAC,EAC3C,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;CAGjD"}
|
|
@@ -13,29 +13,33 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { createModelSchema, optional, primitive } from 'serializr';
|
|
20
|
-
|
|
16
|
+
import { ContentType, guaranteeNonNullable, HttpHeader, SerializationFactory, usingConstantValueSchema, } from '@finos/legend-shared';
|
|
17
|
+
import {} from '@finos/legend-data-cube';
|
|
18
|
+
import {} from '@finos/legend-graph';
|
|
19
|
+
import { createModelSchema, optional, primitive, raw } from 'serializr';
|
|
20
|
+
export const REPL_DATA_CUBE_SOURCE_TYPE = 'repl';
|
|
21
|
+
class REPLBaseDataCubeQuerySource {
|
|
22
|
+
query;
|
|
21
23
|
runtime;
|
|
24
|
+
model;
|
|
22
25
|
mapping;
|
|
23
|
-
query;
|
|
24
26
|
timestamp;
|
|
25
|
-
|
|
27
|
+
isLocal;
|
|
28
|
+
isPersistenceSupported;
|
|
29
|
+
// columns // we don't need this analytics, we will get this from the query directly
|
|
30
|
+
static serialization = new SerializationFactory(createModelSchema(REPLBaseDataCubeQuerySource, {
|
|
31
|
+
_type: usingConstantValueSchema(REPL_DATA_CUBE_SOURCE_TYPE),
|
|
32
|
+
isLocal: primitive(),
|
|
33
|
+
isPersistenceSupported: primitive(),
|
|
26
34
|
mapping: optional(primitive()),
|
|
35
|
+
model: optional(raw()),
|
|
27
36
|
query: primitive(),
|
|
28
37
|
runtime: primitive(),
|
|
29
38
|
timestamp: primitive(),
|
|
30
39
|
}));
|
|
31
40
|
}
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
source;
|
|
35
|
-
static serialization = new SerializationFactory(createModelSchema(GetBaseQueryResult, {
|
|
36
|
-
query: usingModelSchema(DataCubeQuery.serialization.schema),
|
|
37
|
-
source: usingModelSchema(QuerySource.serialization.schema),
|
|
38
|
-
}));
|
|
41
|
+
export function deserializeREPLQuerySource(value) {
|
|
42
|
+
return REPLBaseDataCubeQuerySource.serialization.fromJson(value);
|
|
39
43
|
}
|
|
40
44
|
export class LegendREPLServerClient {
|
|
41
45
|
networkClient;
|
|
@@ -67,20 +71,13 @@ export class LegendREPLServerClient {
|
|
|
67
71
|
return this.networkClient.post(`${this.dataCube}/getRelationReturnType`, input);
|
|
68
72
|
}
|
|
69
73
|
async getQueryCodeRelationReturnType(input) {
|
|
70
|
-
|
|
71
|
-
return this.networkClient.post(`${this.dataCube}/getRelationReturnType/code`, input);
|
|
72
|
-
}
|
|
73
|
-
catch (error) {
|
|
74
|
-
assertErrorThrown(error);
|
|
75
|
-
if (error instanceof NetworkClientError &&
|
|
76
|
-
error.response.status === HttpStatus.BAD_REQUEST) {
|
|
77
|
-
throw V1_buildEngineError(V1_EngineError.serialization.fromJson(error.payload));
|
|
78
|
-
}
|
|
79
|
-
throw error;
|
|
80
|
-
}
|
|
74
|
+
return this.networkClient.post(`${this.dataCube}/getRelationReturnType/code`, input);
|
|
81
75
|
}
|
|
82
76
|
async executeQuery(input) {
|
|
83
77
|
return this.networkClient.post(`${this.dataCube}/executeQuery`, input);
|
|
84
78
|
}
|
|
79
|
+
async publishQuery(query, queryStoreBaseUrl) {
|
|
80
|
+
return this.networkClient.post(`${queryStoreBaseUrl}`, query);
|
|
81
|
+
}
|
|
85
82
|
}
|
|
86
83
|
//# sourceMappingURL=LegendREPLServerClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendREPLServerClient.js","sourceRoot":"","sources":["../../src/stores/LegendREPLServerClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,
|
|
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,wBAAwB,GAGzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAIN,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAIN,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AA4CxE,MAAM,CAAC,MAAM,0BAA0B,GAA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;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-application-repl",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.33",
|
|
4
4
|
"description": "Legend REPL Grid client application core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"test:watch": "jest --watch"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@finos/legend-application": "16.0.
|
|
47
|
-
"@finos/legend-art": "7.1.
|
|
48
|
-
"@finos/legend-data-cube": "0.0.
|
|
49
|
-
"@finos/legend-graph": "31.10.
|
|
50
|
-
"@finos/legend-shared": "10.0.
|
|
46
|
+
"@finos/legend-application": "16.0.15",
|
|
47
|
+
"@finos/legend-art": "7.1.72",
|
|
48
|
+
"@finos/legend-data-cube": "0.0.35",
|
|
49
|
+
"@finos/legend-graph": "31.10.64",
|
|
50
|
+
"@finos/legend-shared": "10.0.64",
|
|
51
51
|
"@types/react": "19.0.2",
|
|
52
52
|
"@types/react-dom": "19.0.2",
|
|
53
53
|
"mobx": "6.13.5",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"serializr": "3.0.3"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@finos/legend-dev-utils": "2.1.
|
|
60
|
+
"@finos/legend-dev-utils": "2.1.34",
|
|
61
61
|
"@jest/globals": "29.7.0",
|
|
62
62
|
"cross-env": "7.0.3",
|
|
63
63
|
"eslint": "9.17.0",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @external_application_navigation This depends on Legend Data Cube routing and is hardcoded so it's potentially brittle
|
|
19
|
+
*/
|
|
20
|
+
export const EXTERNAL_APPLICATION_NAVIGATION__generateDataCubeViewUrl = (
|
|
21
|
+
hostedApplicationBaseUrl: string,
|
|
22
|
+
id: string,
|
|
23
|
+
): string => `${hostedApplicationBaseUrl}/${id}`;
|
|
@@ -21,46 +21,24 @@ import {
|
|
|
21
21
|
} from '@finos/legend-application/browser';
|
|
22
22
|
import { observer } from 'mobx-react-lite';
|
|
23
23
|
import { useEffect, useMemo } from 'react';
|
|
24
|
-
import {
|
|
25
|
-
formatDate,
|
|
26
|
-
guaranteeNonNullable,
|
|
27
|
-
LogEvent,
|
|
28
|
-
NetworkClient,
|
|
29
|
-
} from '@finos/legend-shared';
|
|
30
|
-
import { LegendREPLServerClient } from '../stores/LegendREPLServerClient.js';
|
|
24
|
+
import { formatDate, LogEvent } from '@finos/legend-shared';
|
|
31
25
|
import { LegendREPLDataCubeEngine } from '../stores/LegendREPLDataCubeEngine.js';
|
|
32
26
|
import { DataCube, DataCubeSettingKey } from '@finos/legend-data-cube';
|
|
33
|
-
import {
|
|
34
|
-
APPLICATION_EVENT,
|
|
35
|
-
ApplicationFrameworkProvider,
|
|
36
|
-
useApplicationStore,
|
|
37
|
-
type LegendApplicationPlugin,
|
|
38
|
-
type LegendApplicationPluginManager,
|
|
39
|
-
} from '@finos/legend-application';
|
|
40
|
-
import type { LegendREPLApplicationConfig } from '../application/LegendREPLApplicationConfig.js';
|
|
27
|
+
import { APPLICATION_EVENT } from '@finos/legend-application';
|
|
41
28
|
import { LegendREPLDataCubeSource } from '../stores/LegendREPLDataCubeSource.js';
|
|
29
|
+
import { LegendREPLDataCubeHeader } from './LegendREPLDataCubeHeader.js';
|
|
30
|
+
import {
|
|
31
|
+
LegendREPLFrameworkProvider,
|
|
32
|
+
useLegendREPLBaseStore,
|
|
33
|
+
} from './LegendREPLFramworkProvider.js';
|
|
42
34
|
|
|
43
35
|
const LegendREPLDataCube = observer(() => {
|
|
44
|
-
const
|
|
45
|
-
LegendREPLApplicationConfig,
|
|
46
|
-
LegendApplicationPluginManager<LegendApplicationPlugin>
|
|
47
|
-
>();
|
|
48
|
-
const config = application.config;
|
|
36
|
+
const baseStore = useLegendREPLBaseStore();
|
|
49
37
|
const engine = useMemo(
|
|
50
|
-
() =>
|
|
51
|
-
|
|
52
|
-
application,
|
|
53
|
-
new LegendREPLServerClient(
|
|
54
|
-
new NetworkClient({
|
|
55
|
-
baseUrl: config.useDynamicREPLServer
|
|
56
|
-
? window.location.origin +
|
|
57
|
-
guaranteeNonNullable(config.baseAddress).replace('/repl/', '')
|
|
58
|
-
: config.replUrl,
|
|
59
|
-
}),
|
|
60
|
-
),
|
|
61
|
-
),
|
|
62
|
-
[application, config],
|
|
38
|
+
() => new LegendREPLDataCubeEngine(baseStore),
|
|
39
|
+
[baseStore],
|
|
63
40
|
);
|
|
41
|
+
const application = baseStore.application;
|
|
64
42
|
|
|
65
43
|
useEffect(() => {
|
|
66
44
|
engine.blockNavigation(
|
|
@@ -111,6 +89,9 @@ const LegendREPLDataCube = observer(() => {
|
|
|
111
89
|
application.settingService.getBooleanValue(
|
|
112
90
|
DataCubeSettingKey.GRID_CLIENT_SUPPRESS_LARGE_DATASET_WARNING,
|
|
113
91
|
),
|
|
92
|
+
innerHeaderComponent: (dataCube) => (
|
|
93
|
+
<LegendREPLDataCubeHeader dataCube={dataCube} />
|
|
94
|
+
),
|
|
114
95
|
}}
|
|
115
96
|
/>
|
|
116
97
|
);
|
|
@@ -136,9 +117,9 @@ export const LegendREPLWebApplication = (props: { baseUrl: string }) => {
|
|
|
136
117
|
|
|
137
118
|
return (
|
|
138
119
|
<BrowserEnvironmentProvider baseUrl={baseUrl}>
|
|
139
|
-
<
|
|
120
|
+
<LegendREPLFrameworkProvider>
|
|
140
121
|
<LegendREPLRouter />
|
|
141
|
-
</
|
|
122
|
+
</LegendREPLFrameworkProvider>
|
|
142
123
|
</BrowserEnvironmentProvider>
|
|
143
124
|
);
|
|
144
125
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
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 type { DataCubeState } from '@finos/legend-data-cube';
|
|
18
|
+
import { observer } from 'mobx-react-lite';
|
|
19
|
+
import { LegendREPLDataCubeSource } from '../stores/LegendREPLDataCubeSource.js';
|
|
20
|
+
import { useLegendREPLBaseStore } from './LegendREPLFramworkProvider.js';
|
|
21
|
+
|
|
22
|
+
export const LegendREPLDataCubeHeader = observer(
|
|
23
|
+
(props: { dataCube: DataCubeState }) => {
|
|
24
|
+
const { dataCube } = props;
|
|
25
|
+
const store = useLegendREPLBaseStore();
|
|
26
|
+
|
|
27
|
+
if (!dataCube.view.isSourceProcessed || !store.queryServerBaseUrl) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const isPublishAllowed =
|
|
32
|
+
dataCube.view.source instanceof LegendREPLDataCubeSource &&
|
|
33
|
+
dataCube.view.source.isPersistenceSupported &&
|
|
34
|
+
// eslint-disable-next-line no-process-env
|
|
35
|
+
(process.env.NODE_ENV === 'development' || !dataCube.view.source.isLocal);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className="flex h-full items-center">
|
|
39
|
+
<button
|
|
40
|
+
disabled={!isPublishAllowed || store.publishState.isInProgress}
|
|
41
|
+
onClick={() => {
|
|
42
|
+
store
|
|
43
|
+
.publishDataCube(dataCube)
|
|
44
|
+
.catch((error) => dataCube.engine.logUnhandledError(error));
|
|
45
|
+
}}
|
|
46
|
+
className="h- w-20 border border-neutral-400 bg-neutral-300 px-2 hover:brightness-95 disabled:cursor-not-allowed disabled:border-neutral-300 disabled:text-neutral-400 disabled:hover:brightness-100"
|
|
47
|
+
>
|
|
48
|
+
Publish
|
|
49
|
+
</button>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
);
|
|
@@ -0,0 +1,62 @@
|
|
|
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 { createContext, useContext } from 'react';
|
|
18
|
+
import { useLocalObservable } from 'mobx-react-lite';
|
|
19
|
+
import { LegendREPLBaseStore } from '../stores/LegendREPLBaseStore.js';
|
|
20
|
+
import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
21
|
+
import { type LegendREPLApplicationConfig } from '../application/LegendREPLApplicationConfig.js';
|
|
22
|
+
import {
|
|
23
|
+
useApplicationStore,
|
|
24
|
+
ApplicationFrameworkProvider,
|
|
25
|
+
type LegendApplicationPluginManager,
|
|
26
|
+
type LegendApplicationPlugin,
|
|
27
|
+
} from '@finos/legend-application';
|
|
28
|
+
|
|
29
|
+
const LegendREPLBaseStoreContext = createContext<
|
|
30
|
+
LegendREPLBaseStore | undefined
|
|
31
|
+
>(undefined);
|
|
32
|
+
|
|
33
|
+
const LegendREPLBaseStoreProvider: React.FC<{
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
}> = ({ children }) => {
|
|
36
|
+
const applicationStore = useApplicationStore<
|
|
37
|
+
LegendREPLApplicationConfig,
|
|
38
|
+
LegendApplicationPluginManager<LegendApplicationPlugin>
|
|
39
|
+
>();
|
|
40
|
+
const store = useLocalObservable(
|
|
41
|
+
() => new LegendREPLBaseStore(applicationStore),
|
|
42
|
+
);
|
|
43
|
+
return (
|
|
44
|
+
<LegendREPLBaseStoreContext.Provider value={store}>
|
|
45
|
+
{children}
|
|
46
|
+
</LegendREPLBaseStoreContext.Provider>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const useLegendREPLBaseStore = (): LegendREPLBaseStore =>
|
|
51
|
+
guaranteeNonNullable(
|
|
52
|
+
useContext(LegendREPLBaseStoreContext),
|
|
53
|
+
`Can't find Legend Query base store in context`,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
export const LegendREPLFrameworkProvider: React.FC<{
|
|
57
|
+
children: React.ReactNode;
|
|
58
|
+
}> = ({ children }) => (
|
|
59
|
+
<ApplicationFrameworkProvider simple={true}>
|
|
60
|
+
<LegendREPLBaseStoreProvider>{children}</LegendREPLBaseStoreProvider>
|
|
61
|
+
</ApplicationFrameworkProvider>
|
|
62
|
+
);
|
|
@@ -0,0 +1,103 @@
|
|
|
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 { useLegendREPLBaseStore } from './LegendREPLFramworkProvider.js';
|
|
18
|
+
import type { PersistentDataCubeQuery } from '@finos/legend-graph';
|
|
19
|
+
import { EXTERNAL_APPLICATION_NAVIGATION__generateDataCubeViewUrl } from '../application/LegendREPLNavigation.js';
|
|
20
|
+
import { DataCubeIcon } from '@finos/legend-art';
|
|
21
|
+
|
|
22
|
+
export const LegendREPLPublishDataCubeAlert = (props: {
|
|
23
|
+
query: PersistentDataCubeQuery;
|
|
24
|
+
}) => {
|
|
25
|
+
const { query } = props;
|
|
26
|
+
const store = useLegendREPLBaseStore();
|
|
27
|
+
const link = store.hostedApplicationBaseUrl
|
|
28
|
+
? EXTERNAL_APPLICATION_NAVIGATION__generateDataCubeViewUrl(
|
|
29
|
+
store.hostedApplicationBaseUrl,
|
|
30
|
+
query.id,
|
|
31
|
+
)
|
|
32
|
+
: undefined;
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className="h-full w-full p-6">
|
|
36
|
+
<div className="flex w-full overflow-auto">
|
|
37
|
+
<div className="mr-3">
|
|
38
|
+
<DataCubeIcon.AlertInfo className="flex-shrink-0 stroke-[0.5px] text-[40px] text-sky-500" />
|
|
39
|
+
</div>
|
|
40
|
+
<div>
|
|
41
|
+
<div className="whitespace-break-spaces text-lg">
|
|
42
|
+
Published query successfully!
|
|
43
|
+
</div>
|
|
44
|
+
{link && (
|
|
45
|
+
<div className="mt-1 whitespace-break-spaces text-neutral-500">
|
|
46
|
+
To view or share the published query, use the link below.
|
|
47
|
+
</div>
|
|
48
|
+
)}
|
|
49
|
+
{!link && (
|
|
50
|
+
<div className="mt-1 whitespace-break-spaces text-neutral-500">
|
|
51
|
+
See the published query ID below.
|
|
52
|
+
</div>
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
{link && (
|
|
57
|
+
<div className="mt-3 flex h-6 w-full">
|
|
58
|
+
<div className="flex h-full w-[calc(100%_-_20px)] items-center border border-r-0 border-neutral-400 bg-neutral-200 px-1.5">
|
|
59
|
+
<a
|
|
60
|
+
href={link}
|
|
61
|
+
target="_blank"
|
|
62
|
+
rel="noopener noreferrer"
|
|
63
|
+
className="overflow-hidden overflow-ellipsis whitespace-nowrap"
|
|
64
|
+
>
|
|
65
|
+
{link}
|
|
66
|
+
</a>
|
|
67
|
+
</div>
|
|
68
|
+
<button
|
|
69
|
+
className="flex aspect-square h-full w-6 items-center justify-center border border-neutral-400 bg-neutral-300 hover:brightness-95"
|
|
70
|
+
onClick={() => {
|
|
71
|
+
store.application.clipboardService
|
|
72
|
+
.copyTextToClipboard(link)
|
|
73
|
+
.catch(store.application.alertUnhandledError);
|
|
74
|
+
}}
|
|
75
|
+
title="Copy Link"
|
|
76
|
+
>
|
|
77
|
+
<DataCubeIcon.Clipboard />
|
|
78
|
+
</button>
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
{!link && (
|
|
82
|
+
<div className="mt-3 flex h-6 w-full">
|
|
83
|
+
<div className="flex h-full w-[calc(100%_-_20px)] items-center border border-r-0 border-neutral-400 bg-neutral-200 px-1.5">
|
|
84
|
+
<div className="overflow-hidden overflow-ellipsis whitespace-nowrap">
|
|
85
|
+
{query.id}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
<button
|
|
89
|
+
className="flex aspect-square h-full w-6 items-center justify-center border border-neutral-400 bg-neutral-300 hover:brightness-95"
|
|
90
|
+
onClick={() => {
|
|
91
|
+
store.application.clipboardService
|
|
92
|
+
.copyTextToClipboard(query.id)
|
|
93
|
+
.catch(store.application.alertUnhandledError);
|
|
94
|
+
}}
|
|
95
|
+
title="Copy ID"
|
|
96
|
+
>
|
|
97
|
+
<DataCubeIcon.Clipboard />
|
|
98
|
+
</button>
|
|
99
|
+
</div>
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
};
|