@finos/legend-query-builder 4.15.3 → 4.15.5
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/__lib__/QueryBuilderTesting.d.ts +3 -1
- package/lib/__lib__/QueryBuilderTesting.d.ts.map +1 -1
- package/lib/__lib__/QueryBuilderTesting.js +4 -0
- package/lib/__lib__/QueryBuilderTesting.js.map +1 -1
- package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.js +1 -1
- package/lib/components/QueryBuilderSideBar.js.map +1 -1
- package/lib/components/data-cube/QueryBuilderDataCube.d.ts.map +1 -1
- package/lib/components/data-cube/QueryBuilderDataCube.js +4 -6
- package/lib/components/data-cube/QueryBuilderDataCube.js.map +1 -1
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.js +38 -33
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +12 -5
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
- package/lib/index.css +16 -0
- package/lib/index.d.ts +1 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryBuilderState.d.ts +6 -1
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +3 -0
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/data-cube/QueryBuilderDataCubeEngine.d.ts +12 -21
- package/lib/stores/data-cube/QueryBuilderDataCubeEngine.d.ts.map +1 -1
- package/lib/stores/data-cube/QueryBuilderDataCubeEngine.js +39 -57
- package/lib/stores/data-cube/QueryBuilderDataCubeEngine.js.map +1 -1
- package/lib/stores/explorer/QueryFunctionsExplorerState.d.ts +17 -6
- package/lib/stores/explorer/QueryFunctionsExplorerState.d.ts.map +1 -1
- package/lib/stores/explorer/QueryFunctionsExplorerState.js +142 -59
- package/lib/stores/explorer/QueryFunctionsExplorerState.js.map +1 -1
- package/package.json +8 -8
- package/src/__lib__/QueryBuilderTesting.ts +5 -0
- package/src/components/QueryBuilderSideBar.tsx +4 -1
- package/src/components/data-cube/QueryBuilderDataCube.tsx +5 -17
- package/src/components/explorer/QueryBuilderFunctionsExplorerPanel.tsx +63 -70
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +23 -11
- package/src/index.ts +1 -1
- package/src/stores/QueryBuilderState.ts +12 -0
- package/src/stores/data-cube/QueryBuilderDataCubeEngine.ts +66 -86
- package/src/stores/explorer/QueryFunctionsExplorerState.ts +227 -94
- package/tsconfig.json +0 -1
- package/lib/stores/data-cube/QueryBuilderDataCubeApplicationEngine.d.ts +0 -36
- package/lib/stores/data-cube/QueryBuilderDataCubeApplicationEngine.d.ts.map +0 -1
- package/lib/stores/data-cube/QueryBuilderDataCubeApplicationEngine.js +0 -65
- package/lib/stores/data-cube/QueryBuilderDataCubeApplicationEngine.js.map +0 -1
- package/src/stores/data-cube/QueryBuilderDataCubeApplicationEngine.ts +0 -98
@@ -13,18 +13,9 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import { V1_Lambda, RawLambda, TDSExecutionResult, type GraphManagerState, type PureModel, type V1_ValueSpecification, type ParameterValue } from '@finos/legend-graph';
|
17
|
-
import {
|
16
|
+
import { V1_AppliedFunction, V1_Lambda, RawLambda, TDSExecutionResult, type GraphManagerState, type PureModel, type V1_ValueSpecification, type ParameterValue } from '@finos/legend-graph';
|
17
|
+
import { DataCubeEngine, DataCubeSource, type RelationType, type DataCubeInitialInput, type CompletionItem } from '@finos/legend-data-cube';
|
18
18
|
import { LogService } from '@finos/legend-shared';
|
19
|
-
export declare class _DataCubeQuery {
|
20
|
-
name: string;
|
21
|
-
query: string;
|
22
|
-
partialQuery: string;
|
23
|
-
source: DataCubeQuerySource;
|
24
|
-
constructor(name: string, query: string, partialQuery: string, source: DataCubeQuerySource);
|
25
|
-
}
|
26
|
-
export declare class QueryBuilderDataCubeQuerySource extends DataCubeQuerySource {
|
27
|
-
}
|
28
19
|
export declare class QueryBuilderDataCubeEngine extends DataCubeEngine {
|
29
20
|
readonly logService: LogService;
|
30
21
|
readonly graphState: GraphManagerState;
|
@@ -35,21 +26,21 @@ export declare class QueryBuilderDataCubeEngine extends DataCubeEngine {
|
|
35
26
|
_parameters: object | undefined;
|
36
27
|
constructor(selectQuery: RawLambda, parameterValues: ParameterValue[] | undefined, mappingPath: string | undefined, runtimePath: string, graphManagerState: GraphManagerState);
|
37
28
|
get sourceLabel(): string;
|
38
|
-
|
39
|
-
buildBaseQuery(): Promise<
|
29
|
+
getInitialInput(): Promise<DataCubeInitialInput>;
|
30
|
+
buildBaseQuery(): Promise<DataCubeInitialInput>;
|
40
31
|
get graph(): PureModel;
|
41
32
|
private buildRawLambdaFromValueSpec;
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
getQueryRelationType(query:
|
47
|
-
|
48
|
-
|
49
|
-
executeQuery(query: V1_Lambda): Promise<{
|
33
|
+
getQueryTypeahead(code: string, baseQuery: V1_Lambda, source: DataCubeSource): Promise<CompletionItem[]>;
|
34
|
+
parseValueSpecification(code: string, returnSourceInformation?: boolean): Promise<V1_ValueSpecification>;
|
35
|
+
getValueSpecificationCode(value: V1_ValueSpecification, pretty?: boolean | undefined): Promise<string>;
|
36
|
+
private getRelationalType;
|
37
|
+
getQueryRelationType(query: V1_Lambda, source: DataCubeSource): Promise<RelationType>;
|
38
|
+
getQueryCodeRelationReturnType(code: string, baseQuery: V1_ValueSpecification, source: DataCubeSource): Promise<RelationType>;
|
39
|
+
executeQuery(query: V1_Lambda, source: DataCubeSource): Promise<{
|
50
40
|
result: TDSExecutionResult;
|
51
41
|
executedQuery: string;
|
52
42
|
executedSQL: string;
|
53
43
|
}>;
|
44
|
+
buildExecutionContext(source: DataCubeSource): V1_AppliedFunction | undefined;
|
54
45
|
}
|
55
46
|
//# sourceMappingURL=QueryBuilderDataCubeEngine.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderDataCubeEngine.d.ts","sourceRoot":"","sources":["../../../src/stores/data-cube/QueryBuilderDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
1
|
+
{"version":3,"file":"QueryBuilderDataCubeEngine.d.ts","sourceRoot":"","sources":["../../../src/stores/data-cube/QueryBuilderDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,kBAAkB,EAClB,SAAS,EACT,SAAS,EAET,kBAAkB,EAKlB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,cAAc,EACd,cAAc,EACd,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EAGpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAgC,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOhF,qBAAa,0BAA2B,SAAQ,cAAc;IAC5D,QAAQ,CAAC,UAAU,aAAoB;IACvC,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC;IACvC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,eAAe,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;gBAG9B,WAAW,EAAE,SAAS,EACtB,eAAe,EAAE,cAAc,EAAE,GAAG,SAAS,EAC7C,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,WAAW,EAAE,MAAM,EACnB,iBAAiB,EAAE,iBAAiB;IAUtC,IAAI,WAAW,IAAI,MAAM,CAExB;IAEQ,eAAe,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAInD,cAAc,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAyCrD,IAAI,KAAK,IAAI,SAAS,CAErB;IAED,OAAO,CAAC,2BAA2B;IAa7B,iBAAiB,CACrB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,cAAc;IAeT,uBAAuB,CACpC,IAAI,EAAE,MAAM,EACZ,uBAAuB,CAAC,EAAE,OAAO;IAW1B,yBAAyB,CAChC,KAAK,EAAE,qBAAqB,EAC5B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS;YAQhB,iBAAiB;IAStB,oBAAoB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc;IAKvD,8BAA8B,CAC3C,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,qBAAqB,EAChC,MAAM,EAAE,cAAc;IAYT,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc;;;;;IAgC3D,qBAAqB,CAC5B,MAAM,EAAE,cAAc,GACrB,kBAAkB,GAAG,SAAS;CAYlC"}
|
@@ -14,21 +14,11 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
import { SUPPORTED_FUNCTIONS, V1_AppliedFunction, V1_Lambda, RawLambda, RelationalExecutionActivities, TDSExecutionResult, V1_deserializeRawValueSpecification, V1_deserializeValueSpecification, V1_RawLambda, V1_serializeValueSpecification, } from '@finos/legend-graph';
|
17
|
-
import { _elementPtr, _functionName,
|
18
|
-
import { guaranteeType, LogService } from '@finos/legend-shared';
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
partialQuery;
|
23
|
-
source;
|
24
|
-
constructor(name, query, partialQuery, source) {
|
25
|
-
this.name = name;
|
26
|
-
this.query = query;
|
27
|
-
this.partialQuery = partialQuery;
|
28
|
-
this.source = source;
|
29
|
-
}
|
30
|
-
}
|
31
|
-
export class QueryBuilderDataCubeQuerySource extends DataCubeQuerySource {
|
17
|
+
import { _elementPtr, _functionName, DataCubeEngine, DataCubeSource, DataCubeQuery, _function, DataCubeFunction, } from '@finos/legend-data-cube';
|
18
|
+
import { guaranteeType, isNonNullable, LogService } from '@finos/legend-shared';
|
19
|
+
class QueryBuilderDataCubeSource extends DataCubeSource {
|
20
|
+
mapping;
|
21
|
+
runtime;
|
32
22
|
}
|
33
23
|
export class QueryBuilderDataCubeEngine extends DataCubeEngine {
|
34
24
|
logService = new LogService();
|
@@ -49,11 +39,10 @@ export class QueryBuilderDataCubeEngine extends DataCubeEngine {
|
|
49
39
|
get sourceLabel() {
|
50
40
|
return `Query Builder Report`;
|
51
41
|
}
|
52
|
-
|
42
|
+
getInitialInput() {
|
53
43
|
return this.buildBaseQuery();
|
54
44
|
}
|
55
45
|
async buildBaseQuery() {
|
56
|
-
const timestamp = Date.now();
|
57
46
|
let srcFuncExp = V1_deserializeValueSpecification(this.graphState.graphManager.serializeRawValueSpecification(this.selectInitialQuery), []);
|
58
47
|
// We could do a further check here to ensure the experssion is an applied funciton
|
59
48
|
// this is because data cube expects an expression to be able to built further upon the queery
|
@@ -72,71 +61,55 @@ export class QueryBuilderDataCubeEngine extends DataCubeEngine {
|
|
72
61
|
if (this.runtimePath) {
|
73
62
|
fromFuncExp.parameters.push(_elementPtr(this.runtimePath));
|
74
63
|
}
|
75
|
-
const
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
const source = new QueryBuilderDataCubeQuerySource();
|
82
|
-
source.columns = columns;
|
64
|
+
const columns = (await this.getRelationalType(this.selectInitialQuery))
|
65
|
+
.columns;
|
66
|
+
const query = new DataCubeQuery();
|
67
|
+
query.query = `~[${columns.map((e) => `'${e.name}'`)}]->select()`;
|
68
|
+
const source = new QueryBuilderDataCubeSource();
|
69
|
+
source.sourceColumns = columns;
|
83
70
|
source.mapping = this.mappingPath;
|
84
71
|
source.runtime = this.runtimePath;
|
85
|
-
source.query =
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
const baseQueryResult = new DataCubeGetBaseQueryResult();
|
91
|
-
baseQueryResult.timestamp = timestamp;
|
92
|
-
baseQueryResult.query = result;
|
93
|
-
baseQueryResult.partialQuery = await this.parseQuery(partialQuery);
|
94
|
-
baseQueryResult.sourceQuery = srcFuncExp;
|
95
|
-
return baseQueryResult;
|
72
|
+
source.query = srcFuncExp;
|
73
|
+
return {
|
74
|
+
query,
|
75
|
+
source,
|
76
|
+
};
|
96
77
|
}
|
97
78
|
get graph() {
|
98
79
|
return this.graphState.graph;
|
99
80
|
}
|
100
81
|
buildRawLambdaFromValueSpec(query) {
|
101
|
-
const json = guaranteeType(V1_deserializeRawValueSpecification(V1_serializeValueSpecification(query, [])), V1_RawLambda);
|
82
|
+
const json = guaranteeType(V1_deserializeRawValueSpecification(V1_serializeValueSpecification(query.body[0], [])), V1_RawLambda);
|
102
83
|
return new RawLambda(json.parameters, json.body);
|
103
84
|
}
|
104
|
-
|
105
|
-
|
106
|
-
return Promise.resolve({
|
107
|
-
gridClientLicense: undefined,
|
108
|
-
simpleSampleDataTableName: '',
|
109
|
-
complexSampleDataTableName: '',
|
110
|
-
});
|
111
|
-
}
|
112
|
-
async getQueryTypeahead(code, query) {
|
113
|
-
const lambda = this.buildRawLambdaFromValueSpec(query);
|
85
|
+
async getQueryTypeahead(code, baseQuery, source) {
|
86
|
+
const lambda = this.buildRawLambdaFromValueSpec(baseQuery);
|
114
87
|
const queryString = await this.graphState.graphManager.lambdaToPureCode(lambda);
|
115
88
|
const offset = queryString.length;
|
116
89
|
const codeBlock = queryString + code;
|
117
90
|
const result = await this.graphState.graphManager.getCodeComplete(codeBlock, this.graph, offset);
|
118
91
|
return result.completions;
|
119
92
|
}
|
120
|
-
async
|
93
|
+
async parseValueSpecification(code, returnSourceInformation) {
|
121
94
|
return V1_deserializeValueSpecification(await this.graphState.graphManager.pureCodeToValueSpecification(code, returnSourceInformation), []);
|
122
95
|
}
|
123
|
-
|
124
|
-
return this.graphState.graphManager.valueSpecificationToPureCode(V1_serializeValueSpecification(
|
96
|
+
getValueSpecificationCode(value, pretty) {
|
97
|
+
return this.graphState.graphManager.valueSpecificationToPureCode(V1_serializeValueSpecification(value, []), pretty);
|
125
98
|
}
|
126
|
-
|
99
|
+
async getRelationalType(query) {
|
100
|
+
const relationType = await this.graphState.graphManager.getLambdaRelationType(query, this.graph);
|
101
|
+
return relationType;
|
102
|
+
}
|
103
|
+
getQueryRelationType(query, source) {
|
127
104
|
const lambda = this.buildRawLambdaFromValueSpec(query);
|
128
105
|
return this.getRelationalType(lambda);
|
129
106
|
}
|
130
|
-
async
|
131
|
-
const realtion_type = await this.graphState.graphManager.getLambdaRelationType(query, this.graph);
|
132
|
-
return realtion_type;
|
133
|
-
}
|
134
|
-
async getQueryCodeRelationReturnType(code, baseQuery) {
|
107
|
+
async getQueryCodeRelationReturnType(code, baseQuery, source) {
|
135
108
|
const queryString = await this.graphState.graphManager.valueSpecificationToPureCode(V1_serializeValueSpecification(baseQuery, []));
|
136
109
|
const fullQuery = code + queryString;
|
137
110
|
return this.getRelationalType(await this.graphState.graphManager.pureCodeToLambda(fullQuery));
|
138
111
|
}
|
139
|
-
async executeQuery(query) {
|
112
|
+
async executeQuery(query, source) {
|
140
113
|
const lambda = this.buildRawLambdaFromValueSpec(query);
|
141
114
|
lambda.parameters = this._parameters;
|
142
115
|
const [executionWithMetadata, queryString] = await Promise.all([
|
@@ -157,5 +130,14 @@ export class QueryBuilderDataCubeEngine extends DataCubeEngine {
|
|
157
130
|
executedSQL: sqlString,
|
158
131
|
};
|
159
132
|
}
|
133
|
+
buildExecutionContext(source) {
|
134
|
+
if (source instanceof QueryBuilderDataCubeSource) {
|
135
|
+
return _function(DataCubeFunction.FROM, [
|
136
|
+
source.mapping ? _elementPtr(source.mapping) : undefined,
|
137
|
+
_elementPtr(source.runtime),
|
138
|
+
].filter(isNonNullable));
|
139
|
+
}
|
140
|
+
return undefined;
|
141
|
+
}
|
160
142
|
}
|
161
143
|
//# sourceMappingURL=QueryBuilderDataCubeEngine.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderDataCubeEngine.js","sourceRoot":"","sources":["../../../src/stores/data-cube/QueryBuilderDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,6BAA6B,EAC7B,kBAAkB,EAClB,mCAAmC,EACnC,gCAAgC,EAChC,YAAY,EACZ,8BAA8B,GAK/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,aAAa,EACb,
|
1
|
+
{"version":3,"file":"QueryBuilderDataCubeEngine.js","sourceRoot":"","sources":["../../../src/stores/data-cube/QueryBuilderDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,6BAA6B,EAC7B,kBAAkB,EAClB,mCAAmC,EACnC,gCAAgC,EAChC,YAAY,EACZ,8BAA8B,GAK/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,cAAc,EAEd,aAAa,EAGb,SAAS,EACT,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,0BAA2B,SAAQ,cAAc;IACrD,OAAO,CAAsB;IAC7B,OAAO,CAAU;CAClB;AAED,MAAM,OAAO,0BAA2B,SAAQ,cAAc;IACnD,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAC9B,UAAU,C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EAAE,WAAW;YACnB,aAAa,EAAE,WAAW;YAC1B,WAAW,EAAE,SAAS;SACvB,CAAC;IACJ,CAAC;IAEQ,qBAAqB,CAC5B,MAAsB;QAEtB,IAAI,MAAM,YAAY,0BAA0B,EAAE,CAAC;YACjD,OAAO,SAAS,CACd,gBAAgB,CAAC,IAAI,EACrB;gBACE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;gBACxD,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC;aAC5B,CAAC,MAAM,CAAC,aAAa,CAAC,CACxB,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
@@ -13,7 +13,8 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import { type PackageableElement,
|
16
|
+
import { type PackageableElement, type FunctionAnalysisInfo, type PureModel, Package, ROOT_PACKAGE_NAME } from '@finos/legend-graph';
|
17
|
+
import { ActionState } from '@finos/legend-shared';
|
17
18
|
import type { QueryBuilderState } from '../QueryBuilderState.js';
|
18
19
|
import { type TreeNodeData, type TreeData } from '@finos/legend-art';
|
19
20
|
export declare const QUERY_BUILDER_FUNCTION_DND_TYPE = "QUERY_BUILDER_FUNCTION";
|
@@ -25,28 +26,37 @@ export declare class QueryBuilderFunctionsExplorerTreeNodeData implements TreeNo
|
|
25
26
|
label: string;
|
26
27
|
childrenIds: string[];
|
27
28
|
isOpen?: boolean | undefined;
|
28
|
-
|
29
|
-
|
29
|
+
package?: PackageableElement;
|
30
|
+
functionAnalysisInfo?: FunctionAnalysisInfo | undefined;
|
31
|
+
constructor(id: string, label: string);
|
30
32
|
}
|
31
|
-
export declare const
|
33
|
+
export declare const generateFunctionsExplorerTreeNodeDataFromFunctionAnalysisInfo: (functionAnalysisInfo: FunctionAnalysisInfo) => QueryBuilderFunctionsExplorerTreeNodeData;
|
32
34
|
export declare const getFunctionsExplorerTreeData: (roots: Package[], queryBuilderState: QueryBuilderState, rootPackageName?: ROOT_PACKAGE_NAME) => TreeData<QueryBuilderFunctionsExplorerTreeNodeData>;
|
33
35
|
export declare const getFunctionsExplorerTreeNodeChildren: (queryBuilderState: QueryBuilderState, node: QueryBuilderFunctionsExplorerTreeNodeData, data: TreeData<QueryBuilderFunctionsExplorerTreeNodeData>, rootPackageName?: ROOT_PACKAGE_NAME) => QueryBuilderFunctionsExplorerTreeNodeData[];
|
34
36
|
export declare class QueryFunctionExplorerState {
|
35
37
|
readonly uuid: string;
|
36
38
|
queryFunctionsState: QueryFunctionsExplorerState;
|
37
|
-
|
38
|
-
constructor(queryFunctionsState: QueryFunctionsExplorerState,
|
39
|
+
functionAnalysisInfo: FunctionAnalysisInfo;
|
40
|
+
constructor(queryFunctionsState: QueryFunctionsExplorerState, functionAnalysisInfo: FunctionAnalysisInfo);
|
39
41
|
}
|
40
42
|
export declare class QueryFunctionsExplorerState {
|
43
|
+
readonly initState: ActionState;
|
41
44
|
queryBuilderState: QueryBuilderState;
|
42
45
|
treeData?: TreeData<QueryBuilderFunctionsExplorerTreeNodeData> | undefined;
|
43
46
|
dependencyTreeData?: TreeData<QueryBuilderFunctionsExplorerTreeNodeData> | undefined;
|
47
|
+
_functionGraph: PureModel;
|
44
48
|
functionExplorerStates: QueryFunctionExplorerState[];
|
45
49
|
dependencyFunctionExplorerStates: QueryFunctionExplorerState[];
|
46
50
|
displayablePackagesSet: Set<Package>;
|
47
51
|
dependencyDisplayablePackagesSet: Set<Package>;
|
52
|
+
functionInfoMap?: Map<string, FunctionAnalysisInfo>;
|
53
|
+
dependencyFunctionInfoMap?: Map<string, FunctionAnalysisInfo>;
|
54
|
+
packagePathToFunctionInfoMap?: Map<string, FunctionAnalysisInfo[]>;
|
48
55
|
constructor(queryBuilderState: QueryBuilderState);
|
49
56
|
getTreeData(rootPackageName?: ROOT_PACKAGE_NAME): TreeData<QueryBuilderFunctionsExplorerTreeNodeData> | undefined;
|
57
|
+
setFunctionInfoMap(info: Map<string, FunctionAnalysisInfo>): void;
|
58
|
+
setDependencyFunctionInfoMap(info: Map<string, FunctionAnalysisInfo>): void;
|
59
|
+
setPackagePathToFunctionInfoMap(map: Map<string, FunctionAnalysisInfo[]>): void;
|
50
60
|
initializeDisplayablePackagesSet(): Promise<void>;
|
51
61
|
initializeDependencyDisplayablePackagesSet(): Promise<void>;
|
52
62
|
setTreeData(val: TreeData<QueryBuilderFunctionsExplorerTreeNodeData> | undefined): void;
|
@@ -54,6 +64,7 @@ export declare class QueryFunctionsExplorerState {
|
|
54
64
|
refreshTree(): void;
|
55
65
|
get nonNullableTreeData(): TreeData<QueryBuilderFunctionsExplorerTreeNodeData>;
|
56
66
|
onTreeNodeSelect: (queryBuilderState: QueryBuilderState, node: QueryBuilderFunctionsExplorerTreeNodeData, data: TreeData<QueryBuilderFunctionsExplorerTreeNodeData>, rootPackageName?: ROOT_PACKAGE_NAME) => void;
|
67
|
+
initializeFunctionInfoMap(): void;
|
57
68
|
initializeTreeData(): void;
|
58
69
|
}
|
59
70
|
//# sourceMappingURL=QueryFunctionsExplorerState.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryFunctionsExplorerState.d.ts","sourceRoot":"","sources":["../../../src/stores/explorer/QueryFunctionsExplorerState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,kBAAkB,EACvB,
|
1
|
+
{"version":3,"file":"QueryFunctionsExplorerState.d.ts","sourceRoot":"","sources":["../../../src/stores/explorer/QueryFunctionsExplorerState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,OAAO,EAEP,iBAAiB,EAGlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EAMZ,MAAM,sBAAsB,CA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