@eagleoutice/flowr 2.1.3 → 2.1.5
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/benchmark/slicer.js +1 -1
- package/cli/repl/commands/repl-parse.js +1 -1
- package/cli/repl/commands/repl-query.js +4 -5
- package/cli/repl/server/connection.js +6 -1
- package/cli/repl/server/messages/message-query.js +2 -2
- package/cli/repl/server/net.js +1 -1
- package/cli/repl/server/send.js +3 -6
- package/cli/repl/server/server.d.ts +2 -2
- package/cli/repl/server/server.js +1 -1
- package/config.js +1 -1
- package/core/pipeline-executor.js +2 -1
- package/core/steps/all/core/00-parse.d.ts +11 -4
- package/core/steps/all/core/00-parse.js +5 -5
- package/core/steps/all/core/10-normalize.d.ts +2 -1
- package/core/steps/all/core/20-dataflow.d.ts +2 -2
- package/core/steps/all/core/20-dataflow.js +2 -2
- package/core/steps/pipeline/default-pipelines.d.ts +41 -23
- package/core/steps/pipeline/pipeline.d.ts +15 -3
- package/core/steps/pipeline/pipeline.js +2 -2
- package/dataflow/environments/built-in.d.ts +8 -6
- package/dataflow/environments/built-in.js +6 -1
- package/dataflow/environments/default-builtin-config.js +21 -5
- package/dataflow/environments/environment.d.ts +1 -0
- package/dataflow/environments/environment.js +5 -5
- package/dataflow/extractor.js +23 -0
- package/dataflow/graph/dataflowgraph-builder.d.ts +2 -0
- package/dataflow/graph/dataflowgraph-builder.js +9 -0
- package/dataflow/graph/diff.js +1 -1
- package/dataflow/graph/graph.d.ts +7 -2
- package/dataflow/graph/graph.js +10 -2
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +13 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
- package/dataflow/processor.d.ts +3 -3
- package/documentation/data/server/doc-data-server-messages.js +8 -14
- package/documentation/doc-util/doc-cli-option.js +4 -4
- package/documentation/doc-util/doc-query.d.ts +4 -6
- package/documentation/doc-util/doc-query.js +16 -156
- package/documentation/doc-util/doc-repl.js +2 -2
- package/documentation/print-dataflow-graph-wiki.js +2 -1
- package/documentation/print-interface-wiki.js +8 -3
- package/documentation/print-query-wiki.js +107 -16
- package/package.json +1 -1
- package/queries/base-query-format.d.ts +6 -0
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +26 -80
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +14 -13
- package/queries/catalog/call-context-query/call-context-query-format.js +32 -14
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +17 -0
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +99 -0
- package/queries/catalog/cluster-query/cluster-query-executor.d.ts +1 -1
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +59 -0
- package/queries/catalog/cluster-query/cluster-query-format.js +29 -0
- package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +59 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.js +21 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +3 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +144 -0
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +102 -0
- package/queries/catalog/dependencies-query/dependencies-query-format.js +187 -0
- package/queries/catalog/id-map-query/id-map-query-executor.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +59 -0
- package/queries/catalog/id-map-query/id-map-query-format.js +21 -0
- package/queries/catalog/lineage-query/lineage-query-executor.d.ts +1 -1
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +59 -0
- package/queries/catalog/lineage-query/lineage-query-format.js +24 -0
- package/queries/catalog/location-map-query/location-map-query-executor.d.ts +3 -0
- package/queries/catalog/location-map-query/location-map-query-executor.js +21 -0
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +17 -0
- package/queries/catalog/location-map-query/location-map-query-format.js +24 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +59 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +21 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +8 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +59 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.js +40 -0
- package/queries/query-print.d.ts +8 -0
- package/queries/query-print.js +94 -0
- package/queries/query.d.ts +431 -26
- package/queries/query.js +36 -18
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +2 -1
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -1
- package/r-bridge/retriever.js +1 -1
- package/r-bridge/shell-executor.js +1 -1
- package/r-bridge/shell.d.ts +1 -2
- package/r-bridge/shell.js +22 -18
- package/slicing/static/static-slicer.js +3 -1
- package/statistics/features/supported/used-functions/used-functions.js +1 -1
- package/{documentation/doc-util/doc-hover-over.js → util/html-hover-over.js} +1 -1
- package/util/json.d.ts +2 -1
- package/util/json.js +101 -3
- package/util/objects.d.ts +2 -1
- package/util/objects.js +3 -0
- package/util/version.js +1 -1
- package/queries/query-schema.d.ts +0 -13
- package/queries/query-schema.js +0 -54
- /package/{documentation/doc-util/doc-hover-over.d.ts → util/html-hover-over.d.ts} +0 -0
|
@@ -1,69 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeCallContextQueries = executeCallContextQueries;
|
|
4
|
-
const call_context_query_format_1 = require("./call-context-query-format");
|
|
5
4
|
const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
6
5
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
7
|
-
const assert_1 = require("../../../util/assert");
|
|
8
6
|
const edge_1 = require("../../../dataflow/graph/edge");
|
|
9
|
-
const resolve_by_name_1 = require("../../../dataflow/environments/resolve-by-name");
|
|
10
|
-
const built_in_1 = require("../../../dataflow/environments/built-in");
|
|
11
7
|
const cfg_1 = require("../../../util/cfg/cfg");
|
|
12
8
|
const two_layer_collector_1 = require("../../two-layer-collector");
|
|
13
9
|
const objects_1 = require("../../../util/objects");
|
|
14
|
-
const
|
|
15
|
-
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
16
|
-
function satisfiesCallTargets(id, graph, callTarget) {
|
|
17
|
-
const callVertex = graph.get(id);
|
|
18
|
-
if (callVertex === undefined || callVertex[0].tag !== vertex_1.VertexType.FunctionCall) {
|
|
19
|
-
return 'no';
|
|
20
|
-
}
|
|
21
|
-
const [info, outgoing] = callVertex;
|
|
22
|
-
const callTargets = [...outgoing]
|
|
23
|
-
.filter(([, e]) => (0, edge_1.edgeIncludesType)(e.types, edge_1.EdgeType.Calls))
|
|
24
|
-
.map(([t]) => t);
|
|
25
|
-
let builtIn = false;
|
|
26
|
-
if (info.environment === undefined) {
|
|
27
|
-
/* if we have a call with an unbound environment,
|
|
28
|
-
* this only happens if we are sure of built-in relations and want to save references
|
|
29
|
-
*/
|
|
30
|
-
builtIn = true;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
/*
|
|
34
|
-
* for performance and scoping reasons, flowR will not identify the global linkage,
|
|
35
|
-
* including any potential built-in mapping.
|
|
36
|
-
*/
|
|
37
|
-
const reResolved = (0, resolve_by_name_1.resolveByName)(info.name, info.environment, identifier_1.ReferenceType.Unknown);
|
|
38
|
-
if (reResolved?.some(t => t.definedAt === built_in_1.BuiltIn)) {
|
|
39
|
-
builtIn = true;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
switch (callTarget) {
|
|
43
|
-
case call_context_query_format_1.CallTargets.Any:
|
|
44
|
-
return callTargets;
|
|
45
|
-
case call_context_query_format_1.CallTargets.OnlyGlobal:
|
|
46
|
-
if (callTargets.length === 0) {
|
|
47
|
-
return builtIn ? [built_in_1.BuiltIn] : [];
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
return 'no';
|
|
51
|
-
}
|
|
52
|
-
case call_context_query_format_1.CallTargets.MustIncludeGlobal:
|
|
53
|
-
return builtIn || callTargets.length === 0 ? [...callTargets, built_in_1.BuiltIn] : 'no';
|
|
54
|
-
case call_context_query_format_1.CallTargets.OnlyLocal:
|
|
55
|
-
return !builtIn && callTargets.length > 0 ? callTargets : 'no';
|
|
56
|
-
case call_context_query_format_1.CallTargets.MustIncludeLocal:
|
|
57
|
-
if (callTargets.length > 0) {
|
|
58
|
-
return builtIn ? [...callTargets, built_in_1.BuiltIn] : callTargets;
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
return 'no';
|
|
62
|
-
}
|
|
63
|
-
default:
|
|
64
|
-
(0, assert_1.assertUnreachable)(callTarget);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
10
|
+
const identify_link_to_last_call_relation_1 = require("./identify-link-to-last-call-relation");
|
|
67
11
|
/* if the node is effected by nse, we have an ingoing nse edge */
|
|
68
12
|
function isQuoted(node, graph) {
|
|
69
13
|
const vertex = graph.ingoingEdges(node);
|
|
@@ -77,6 +21,9 @@ function makeReport(collector) {
|
|
|
77
21
|
for (const [kind, collected] of collector.store) {
|
|
78
22
|
const subkinds = {};
|
|
79
23
|
for (const [subkind, values] of collected) {
|
|
24
|
+
if (!Array.isArray(subkinds[subkind])) {
|
|
25
|
+
subkinds[subkind] = [];
|
|
26
|
+
}
|
|
80
27
|
subkinds[subkind] ??= [];
|
|
81
28
|
const collectIn = subkinds[subkind];
|
|
82
29
|
for (const value of values) {
|
|
@@ -90,7 +37,7 @@ function makeReport(collector) {
|
|
|
90
37
|
return result;
|
|
91
38
|
}
|
|
92
39
|
function isSubCallQuery(query) {
|
|
93
|
-
return 'linkTo' in query;
|
|
40
|
+
return 'linkTo' in query && query.linkTo !== undefined;
|
|
94
41
|
}
|
|
95
42
|
function exactCallNameRegex(name) {
|
|
96
43
|
return new RegExp(`^(${name})$`);
|
|
@@ -121,24 +68,6 @@ function promoteQueryCallNames(queries) {
|
|
|
121
68
|
});
|
|
122
69
|
return { promotedQueries, requiresCfg };
|
|
123
70
|
}
|
|
124
|
-
function identifyLinkToLastCallRelation(from, cfg, graph, linkTo) {
|
|
125
|
-
const found = [];
|
|
126
|
-
(0, visitor_1.visitInReverseOrder)(cfg, from, node => {
|
|
127
|
-
/* we ignore the start id as it cannot be the last call */
|
|
128
|
-
if (node === from) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
const vertex = graph.getVertex(node);
|
|
132
|
-
if (vertex === undefined || vertex.tag !== vertex_1.VertexType.FunctionCall) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
if (linkTo.test(vertex.name)) {
|
|
136
|
-
found.push(node);
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
return found;
|
|
141
|
-
}
|
|
142
71
|
/* maybe we want to add caches to this */
|
|
143
72
|
function retrieveAllCallAliases(nodeId, graph) {
|
|
144
73
|
/* we want the names of all functions called at the source id, including synonyms and returns */
|
|
@@ -187,6 +116,22 @@ function retrieveAllCallAliases(nodeId, graph) {
|
|
|
187
116
|
}
|
|
188
117
|
return aliases;
|
|
189
118
|
}
|
|
119
|
+
function removeIdenticalDuplicates(collector) {
|
|
120
|
+
for (const [, collected] of collector.store) {
|
|
121
|
+
for (const [subkind, values] of collected) {
|
|
122
|
+
const seen = new Set();
|
|
123
|
+
const newValues = values.filter(v => {
|
|
124
|
+
const str = JSON.stringify(v);
|
|
125
|
+
if (seen.has(str)) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
seen.add(str);
|
|
129
|
+
return true;
|
|
130
|
+
});
|
|
131
|
+
collected.set(subkind, newValues);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
190
135
|
/**
|
|
191
136
|
* Multi-stage call context query resolve.
|
|
192
137
|
*
|
|
@@ -223,7 +168,7 @@ function executeCallContextQueries({ graph, ast }, queries) {
|
|
|
223
168
|
for (const [l, ids] of targets.entries()) {
|
|
224
169
|
for (const query of queriesWhichWantAliases) {
|
|
225
170
|
if (query.callName.test(l)) {
|
|
226
|
-
initialIdCollector.add(query.kind ?? '.', query.subkind ?? '.', (0, objects_1.compactRecord)({ id: nodeId, aliasRoots: ids }));
|
|
171
|
+
initialIdCollector.add(query.kind ?? '.', query.subkind ?? '.', (0, objects_1.compactRecord)({ id: nodeId, name: info.name, aliasRoots: ids }));
|
|
227
172
|
}
|
|
228
173
|
}
|
|
229
174
|
}
|
|
@@ -231,7 +176,7 @@ function executeCallContextQueries({ graph, ast }, queries) {
|
|
|
231
176
|
for (const query of promotedQueries.filter(q => q.callName.test(info.name))) {
|
|
232
177
|
let targets = undefined;
|
|
233
178
|
if (query.callTargets) {
|
|
234
|
-
targets = satisfiesCallTargets(nodeId, graph, query.callTargets);
|
|
179
|
+
targets = (0, identify_link_to_last_call_relation_1.satisfiesCallTargets)(nodeId, graph, query.callTargets);
|
|
235
180
|
if (targets === 'no') {
|
|
236
181
|
continue;
|
|
237
182
|
}
|
|
@@ -243,14 +188,15 @@ function executeCallContextQueries({ graph, ast }, queries) {
|
|
|
243
188
|
let linkedIds = undefined;
|
|
244
189
|
if (cfg && isSubCallQuery(query)) {
|
|
245
190
|
/* if we have a linkTo query, we have to find the last call */
|
|
246
|
-
const lastCall = identifyLinkToLastCallRelation(nodeId, cfg.graph, graph, query.linkTo.callName);
|
|
191
|
+
const lastCall = (0, identify_link_to_last_call_relation_1.identifyLinkToLastCallRelation)(nodeId, cfg.graph, graph, query.linkTo.callName);
|
|
247
192
|
if (lastCall) {
|
|
248
193
|
linkedIds = lastCall;
|
|
249
194
|
}
|
|
250
195
|
}
|
|
251
|
-
initialIdCollector.add(query.kind ?? '.', query.subkind ?? '.', (0, objects_1.compactRecord)({ id: nodeId, calls: targets, linkedIds }));
|
|
196
|
+
initialIdCollector.add(query.kind ?? '.', query.subkind ?? '.', (0, objects_1.compactRecord)({ id: nodeId, name: info.name, calls: targets, linkedIds }));
|
|
252
197
|
}
|
|
253
198
|
}
|
|
199
|
+
removeIdenticalDuplicates(initialIdCollector);
|
|
254
200
|
return {
|
|
255
201
|
'.meta': {
|
|
256
202
|
timing: Date.now() - now,
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
OnlyLocal = "local",
|
|
10
|
-
/** call targets a function that is defined locally or globally, but must include a local function */
|
|
11
|
-
MustIncludeLocal = "must-include-local",
|
|
12
|
-
/** call targets a function that is defined locally or globally */
|
|
13
|
-
Any = "any"
|
|
14
|
-
}
|
|
3
|
+
import { executeCallContextQueries } from './call-context-query-executor';
|
|
4
|
+
import type { OutputFormatter } from '../../../util/ansi';
|
|
5
|
+
import Joi from 'joi';
|
|
6
|
+
import type { PipelineOutput } from '../../../core/steps/pipeline/pipeline';
|
|
7
|
+
import type { DEFAULT_DATAFLOW_PIPELINE } from '../../../core/steps/pipeline/default-pipelines';
|
|
8
|
+
import { CallTargets } from './identify-link-to-last-call-relation';
|
|
15
9
|
export interface DefaultCallContextQueryFormat<CallName extends RegExp | string> extends BaseQueryFormat {
|
|
16
10
|
readonly type: 'call-context';
|
|
17
11
|
/** Regex regarding the function name, please note that strings will be interpreted as regular expressions too! */
|
|
@@ -45,13 +39,15 @@ interface LinkToLastCall<CallName extends RegExp | string = RegExp | string> ext
|
|
|
45
39
|
/** Regex regarding the function name of the last call. Similar to {@link DefaultCallContextQueryFormat#callName}, strings are interpreted as a `RegExp`. */
|
|
46
40
|
readonly callName: CallName;
|
|
47
41
|
}
|
|
48
|
-
type LinkTo<CallName extends RegExp | string> = LinkToLastCall<CallName>;
|
|
42
|
+
export type LinkTo<CallName extends RegExp | string> = LinkToLastCall<CallName>;
|
|
49
43
|
export interface SubCallContextQueryFormat<CallName extends RegExp | string = RegExp | string> extends DefaultCallContextQueryFormat<CallName> {
|
|
50
44
|
readonly linkTo: LinkTo<CallName>;
|
|
51
45
|
}
|
|
52
46
|
export interface CallContextQuerySubKindResult {
|
|
53
47
|
/** The id of the call vertex identified within the supplied dataflow graph */
|
|
54
48
|
readonly id: NodeId;
|
|
49
|
+
/** The name of the function call */
|
|
50
|
+
readonly name: string;
|
|
55
51
|
/**
|
|
56
52
|
* Ids of functions which are called by the respective function call,
|
|
57
53
|
* this will only be populated whenever you explicitly state the {@link DefaultCallContextQueryFormat#callTargets}.
|
|
@@ -73,4 +69,9 @@ export interface CallContextQueryResult extends BaseQueryResult {
|
|
|
73
69
|
readonly kinds: CallContextQueryKindResult;
|
|
74
70
|
}
|
|
75
71
|
export type CallContextQuery<CallName extends RegExp | string = RegExp | string> = DefaultCallContextQueryFormat<CallName> | SubCallContextQueryFormat<CallName>;
|
|
72
|
+
export declare const CallContextQueryDefinition: {
|
|
73
|
+
readonly executor: typeof executeCallContextQueries;
|
|
74
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, processed: PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>, queryResults: BaseQueryResult, result: string[]) => boolean;
|
|
75
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
76
|
+
};
|
|
76
77
|
export {};
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
exports.CallContextQueryDefinition = void 0;
|
|
7
|
+
const call_context_query_executor_1 = require("./call-context-query-executor");
|
|
8
|
+
const ansi_1 = require("../../../util/ansi");
|
|
9
|
+
const time_1 = require("../../../util/time");
|
|
10
|
+
const joi_1 = __importDefault(require("joi"));
|
|
11
|
+
const query_print_1 = require("../../query-print");
|
|
12
|
+
const identify_link_to_last_call_relation_1 = require("./identify-link-to-last-call-relation");
|
|
13
|
+
exports.CallContextQueryDefinition = {
|
|
14
|
+
executor: call_context_query_executor_1.executeCallContextQueries,
|
|
15
|
+
asciiSummarizer: (formatter, processed, queryResults, result) => {
|
|
16
|
+
const out = queryResults;
|
|
17
|
+
result.push(`Query: ${(0, ansi_1.bold)('call-context', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
18
|
+
result.push((0, query_print_1.asciiCallContext)(formatter, out, processed));
|
|
19
|
+
return true;
|
|
20
|
+
},
|
|
21
|
+
schema: joi_1.default.object({
|
|
22
|
+
type: joi_1.default.string().valid('call-context').required().description('The type of the query.'),
|
|
23
|
+
callName: joi_1.default.string().required().description('Regex regarding the function name!'),
|
|
24
|
+
callNameExact: joi_1.default.boolean().optional().description('Should we automatically add the `^` and `$` anchors to the regex to make it an exact match?'),
|
|
25
|
+
kind: joi_1.default.string().optional().description('The kind of the call, this can be used to group calls together (e.g., linking `plot` to `visualize`). Defaults to `.`'),
|
|
26
|
+
subkind: joi_1.default.string().optional().description('The subkind of the call, this can be used to uniquely identify the respective call type when grouping the output (e.g., the normalized name, linking `ggplot` to `plot`). Defaults to `.`'),
|
|
27
|
+
callTargets: joi_1.default.string().valid(...Object.values(identify_link_to_last_call_relation_1.CallTargets)).optional().description('Call targets the function may have. This defaults to `any`. Request this specifically to gain all call targets we can resolve.'),
|
|
28
|
+
includeAliases: joi_1.default.boolean().optional().description('Consider a case like `f <- function_of_interest`, do you want uses of `f` to be included in the results?'),
|
|
29
|
+
linkTo: joi_1.default.object({
|
|
30
|
+
type: joi_1.default.string().valid('link-to-last-call').required().description('The type of the linkTo sub-query.'),
|
|
31
|
+
callName: joi_1.default.string().required().description('Regex regarding the function name of the last call. Similar to `callName`, strings are interpreted as a regular expression.')
|
|
32
|
+
}).optional().description('Links the current call to the last call of the given kind. This way, you can link a call like `points` to the latest graphics plot etc.')
|
|
33
|
+
}).description('Call context query used to find calls in the dataflow graph')
|
|
34
|
+
};
|
|
17
35
|
//# sourceMappingURL=call-context-query-format.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
2
|
+
import type { ControlFlowGraph } from '../../../util/cfg/cfg';
|
|
3
|
+
import type { DataflowGraph } from '../../../dataflow/graph/graph';
|
|
4
|
+
export declare enum CallTargets {
|
|
5
|
+
/** call targets a function that is not defined locally (e.g., the call targets a library function) */
|
|
6
|
+
OnlyGlobal = "global",
|
|
7
|
+
/** call targets a function that is defined locally or globally, but must include a global function */
|
|
8
|
+
MustIncludeGlobal = "must-include-global",
|
|
9
|
+
/** call targets a function that is defined locally */
|
|
10
|
+
OnlyLocal = "local",
|
|
11
|
+
/** call targets a function that is defined locally or globally, but must include a local function */
|
|
12
|
+
MustIncludeLocal = "must-include-local",
|
|
13
|
+
/** call targets a function that is defined locally or globally */
|
|
14
|
+
Any = "any"
|
|
15
|
+
}
|
|
16
|
+
export declare function satisfiesCallTargets(id: NodeId, graph: DataflowGraph, callTarget: CallTargets): NodeId[] | 'no';
|
|
17
|
+
export declare function identifyLinkToLastCallRelation(from: NodeId, cfg: ControlFlowGraph, graph: DataflowGraph, linkTo: RegExp): NodeId[];
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CallTargets = void 0;
|
|
4
|
+
exports.satisfiesCallTargets = satisfiesCallTargets;
|
|
5
|
+
exports.identifyLinkToLastCallRelation = identifyLinkToLastCallRelation;
|
|
6
|
+
const visitor_1 = require("../../../util/cfg/visitor");
|
|
7
|
+
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
8
|
+
const edge_1 = require("../../../dataflow/graph/edge");
|
|
9
|
+
const resolve_by_name_1 = require("../../../dataflow/environments/resolve-by-name");
|
|
10
|
+
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
11
|
+
const built_in_1 = require("../../../dataflow/environments/built-in");
|
|
12
|
+
const assert_1 = require("../../../util/assert");
|
|
13
|
+
var CallTargets;
|
|
14
|
+
(function (CallTargets) {
|
|
15
|
+
/** call targets a function that is not defined locally (e.g., the call targets a library function) */
|
|
16
|
+
CallTargets["OnlyGlobal"] = "global";
|
|
17
|
+
/** call targets a function that is defined locally or globally, but must include a global function */
|
|
18
|
+
CallTargets["MustIncludeGlobal"] = "must-include-global";
|
|
19
|
+
/** call targets a function that is defined locally */
|
|
20
|
+
CallTargets["OnlyLocal"] = "local";
|
|
21
|
+
/** call targets a function that is defined locally or globally, but must include a local function */
|
|
22
|
+
CallTargets["MustIncludeLocal"] = "must-include-local";
|
|
23
|
+
/** call targets a function that is defined locally or globally */
|
|
24
|
+
CallTargets["Any"] = "any";
|
|
25
|
+
})(CallTargets || (exports.CallTargets = CallTargets = {}));
|
|
26
|
+
function satisfiesCallTargets(id, graph, callTarget) {
|
|
27
|
+
const callVertex = graph.get(id);
|
|
28
|
+
if (callVertex === undefined || callVertex[0].tag !== vertex_1.VertexType.FunctionCall) {
|
|
29
|
+
return 'no';
|
|
30
|
+
}
|
|
31
|
+
const [info, outgoing] = callVertex;
|
|
32
|
+
const callTargets = [...outgoing]
|
|
33
|
+
.filter(([, e]) => (0, edge_1.edgeIncludesType)(e.types, edge_1.EdgeType.Calls))
|
|
34
|
+
.map(([t]) => t);
|
|
35
|
+
let builtIn = false;
|
|
36
|
+
if (info.environment === undefined) {
|
|
37
|
+
/* if we have a call with an unbound environment,
|
|
38
|
+
* this only happens if we are sure of built-in relations and want to save references
|
|
39
|
+
*/
|
|
40
|
+
builtIn = true;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
/*
|
|
44
|
+
* for performance and scoping reasons, flowR will not identify the global linkage,
|
|
45
|
+
* including any potential built-in mapping.
|
|
46
|
+
*/
|
|
47
|
+
const reResolved = (0, resolve_by_name_1.resolveByName)(info.name, info.environment, identifier_1.ReferenceType.Unknown);
|
|
48
|
+
if (reResolved?.some(t => t.definedAt === built_in_1.BuiltIn)) {
|
|
49
|
+
builtIn = true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
switch (callTarget) {
|
|
53
|
+
case CallTargets.Any:
|
|
54
|
+
return callTargets;
|
|
55
|
+
case CallTargets.OnlyGlobal:
|
|
56
|
+
if (callTargets.length === 0) {
|
|
57
|
+
return builtIn ? [built_in_1.BuiltIn] : [];
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return 'no';
|
|
61
|
+
}
|
|
62
|
+
case CallTargets.MustIncludeGlobal:
|
|
63
|
+
return builtIn || callTargets.length === 0 ? [...callTargets, built_in_1.BuiltIn] : 'no';
|
|
64
|
+
case CallTargets.OnlyLocal:
|
|
65
|
+
return !builtIn && callTargets.length > 0 ? callTargets : 'no';
|
|
66
|
+
case CallTargets.MustIncludeLocal:
|
|
67
|
+
if (callTargets.length > 0) {
|
|
68
|
+
return builtIn ? [...callTargets, built_in_1.BuiltIn] : callTargets;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return 'no';
|
|
72
|
+
}
|
|
73
|
+
default:
|
|
74
|
+
(0, assert_1.assertUnreachable)(callTarget);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function identifyLinkToLastCallRelation(from, cfg, graph, linkTo) {
|
|
78
|
+
const found = [];
|
|
79
|
+
(0, visitor_1.visitInReverseOrder)(cfg, from, node => {
|
|
80
|
+
/* we ignore the start id as it cannot be the last call */
|
|
81
|
+
if (node === from) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const vertex = graph.get(node);
|
|
85
|
+
if (vertex === undefined || vertex[0].tag !== vertex_1.VertexType.FunctionCall) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (linkTo.test(vertex[0].name)) {
|
|
89
|
+
const tar = satisfiesCallTargets(vertex[0].id, graph, CallTargets.MustIncludeGlobal);
|
|
90
|
+
if (tar === 'no') {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
found.push(node);
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return found;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=identify-link-to-last-call-relation.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { BasicQueryData } from '../../query';
|
|
2
1
|
import type { DataflowClusterQuery, DataflowClusterQueryResult } from './cluster-query-format';
|
|
2
|
+
import type { BasicQueryData } from '../../base-query-format';
|
|
3
3
|
export declare function executeDataflowClusterQuery({ graph }: BasicQueryData, queries: readonly DataflowClusterQuery[]): DataflowClusterQueryResult;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
|
+
import Joi from 'joi';
|
|
2
3
|
import type { DataflowGraphClusters } from '../../../dataflow/cluster';
|
|
4
|
+
import { executeDataflowClusterQuery } from './cluster-query-executor';
|
|
3
5
|
/**
|
|
4
6
|
* Calculates and returns all clusters encountered in the dataflow graph.
|
|
5
7
|
*/
|
|
@@ -10,3 +12,60 @@ export interface DataflowClusterQueryResult extends BaseQueryResult {
|
|
|
10
12
|
/** All clusters found in the respective dataflow */
|
|
11
13
|
readonly clusters: DataflowGraphClusters;
|
|
12
14
|
}
|
|
15
|
+
export declare const ClusterQueryDefinition: {
|
|
16
|
+
readonly executor: typeof executeDataflowClusterQuery;
|
|
17
|
+
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
18
|
+
readonly name: "parse";
|
|
19
|
+
readonly humanReadableName: "parse with R shell";
|
|
20
|
+
readonly description: "Parse the given R code into an AST";
|
|
21
|
+
readonly processor: (_results: unknown, input: Partial<import("../../../core/steps/all/core/00-parse").ParseRequiredInput>) => Promise<import("../../../core/steps/all/core/00-parse").ParseStepOutput>;
|
|
22
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
23
|
+
readonly printer: {
|
|
24
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
25
|
+
readonly 2: {
|
|
26
|
+
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
27
|
+
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
28
|
+
};
|
|
29
|
+
readonly 5: ({ parsed }: import("../../../core/steps/all/core/00-parse").ParseStepOutput, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
30
|
+
};
|
|
31
|
+
readonly dependencies: readonly [];
|
|
32
|
+
readonly requiredInput: import("../../../core/steps/all/core/00-parse").ParseRequiredInput;
|
|
33
|
+
} | {
|
|
34
|
+
readonly name: "normalize";
|
|
35
|
+
readonly humanReadableName: "normalize";
|
|
36
|
+
readonly description: "Normalize the AST to flowR's AST";
|
|
37
|
+
readonly processor: (results: {
|
|
38
|
+
parse?: import("../../../core/steps/all/core/00-parse").ParseStepOutput;
|
|
39
|
+
}, input: Partial<import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput>) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
|
|
40
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
41
|
+
readonly printer: {
|
|
42
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
43
|
+
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
44
|
+
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
45
|
+
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
46
|
+
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
47
|
+
};
|
|
48
|
+
readonly dependencies: readonly ["parse"];
|
|
49
|
+
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
50
|
+
} | {
|
|
51
|
+
readonly humanReadableName: "dataflow";
|
|
52
|
+
readonly processor: (results: {
|
|
53
|
+
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
54
|
+
}, input: {
|
|
55
|
+
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
56
|
+
}) => import("../../../dataflow/info").DataflowInformation;
|
|
57
|
+
readonly requiredInput: {};
|
|
58
|
+
readonly name: "dataflow";
|
|
59
|
+
readonly description: "Construct the dataflow graph";
|
|
60
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
61
|
+
readonly printer: {
|
|
62
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
63
|
+
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
64
|
+
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
65
|
+
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
66
|
+
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
67
|
+
};
|
|
68
|
+
readonly dependencies: readonly ["normalize"];
|
|
69
|
+
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
70
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
71
|
+
};
|
|
@@ -1,3 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ClusterQueryDefinition = void 0;
|
|
7
|
+
const ansi_1 = require("../../../util/ansi");
|
|
8
|
+
const joi_1 = __importDefault(require("joi"));
|
|
9
|
+
const cluster_query_executor_1 = require("./cluster-query-executor");
|
|
10
|
+
const dfg_1 = require("../../../util/mermaid/dfg");
|
|
11
|
+
const query_print_1 = require("../../query-print");
|
|
12
|
+
exports.ClusterQueryDefinition = {
|
|
13
|
+
executor: cluster_query_executor_1.executeDataflowClusterQuery,
|
|
14
|
+
asciiSummarizer: (formatter, processed, queryResults, result) => {
|
|
15
|
+
const out = queryResults;
|
|
16
|
+
result.push(`Query: ${(0, ansi_1.bold)('dataflow-cluster', formatter)} (${out['.meta'].timing.toFixed(0)}ms)`);
|
|
17
|
+
result.push(` ╰ Found ${out.clusters.length} cluster${out.clusters.length === 1 ? '' : 's'}`);
|
|
18
|
+
for (const cluster of out.clusters) {
|
|
19
|
+
const unknownSideEffects = cluster.hasUnknownSideEffects ? '(has unknown side effect)' : '';
|
|
20
|
+
let suffix = '';
|
|
21
|
+
if (formatter === ansi_1.markdownFormatter) {
|
|
22
|
+
suffix = `([marked](${(0, dfg_1.graphToMermaidUrl)(processed.dataflow.graph, false, new Set(cluster.members))}))`;
|
|
23
|
+
}
|
|
24
|
+
result.push(` ╰ ${unknownSideEffects} {${(0, query_print_1.summarizeIdsIfTooLong)(formatter, cluster.members)}} ${suffix}`);
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
},
|
|
28
|
+
schema: joi_1.default.object({
|
|
29
|
+
type: joi_1.default.string().valid('dataflow-cluster').required().description('The type of the query.'),
|
|
30
|
+
}).description('The cluster query calculates and returns all clusters in the dataflow graph.')
|
|
31
|
+
};
|
|
3
32
|
//# sourceMappingURL=cluster-query-format.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { BasicQueryData } from '../../query';
|
|
2
1
|
import type { DataflowQuery, DataflowQueryResult } from './dataflow-query-format';
|
|
2
|
+
import type { BasicQueryData } from '../../base-query-format';
|
|
3
3
|
export declare function executeDataflowQuery({ graph }: BasicQueryData, queries: readonly DataflowQuery[]): DataflowQueryResult;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import type { DataflowGraph } from '../../../dataflow/graph/graph';
|
|
3
|
+
import { executeDataflowQuery } from './dataflow-query-executor';
|
|
4
|
+
import Joi from 'joi';
|
|
3
5
|
/**
|
|
4
6
|
* Simple re-returns the dataflow graph of the analysis.
|
|
5
7
|
*/
|
|
@@ -10,3 +12,60 @@ export interface DataflowQueryResult extends BaseQueryResult {
|
|
|
10
12
|
/** Please be aware that this is the graph in its JSON representation, use {@link DataflowGraph#fromJson} if the result is serialized */
|
|
11
13
|
readonly graph: DataflowGraph;
|
|
12
14
|
}
|
|
15
|
+
export declare const DataflowQueryDefinition: {
|
|
16
|
+
readonly executor: typeof executeDataflowQuery;
|
|
17
|
+
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
18
|
+
readonly name: "parse";
|
|
19
|
+
readonly humanReadableName: "parse with R shell";
|
|
20
|
+
readonly description: "Parse the given R code into an AST";
|
|
21
|
+
readonly processor: (_results: unknown, input: Partial<import("../../../core/steps/all/core/00-parse").ParseRequiredInput>) => Promise<import("../../../core/steps/all/core/00-parse").ParseStepOutput>;
|
|
22
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
23
|
+
readonly printer: {
|
|
24
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
25
|
+
readonly 2: {
|
|
26
|
+
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
27
|
+
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
28
|
+
};
|
|
29
|
+
readonly 5: ({ parsed }: import("../../../core/steps/all/core/00-parse").ParseStepOutput, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
30
|
+
};
|
|
31
|
+
readonly dependencies: readonly [];
|
|
32
|
+
readonly requiredInput: import("../../../core/steps/all/core/00-parse").ParseRequiredInput;
|
|
33
|
+
} | {
|
|
34
|
+
readonly name: "normalize";
|
|
35
|
+
readonly humanReadableName: "normalize";
|
|
36
|
+
readonly description: "Normalize the AST to flowR's AST";
|
|
37
|
+
readonly processor: (results: {
|
|
38
|
+
parse?: import("../../../core/steps/all/core/00-parse").ParseStepOutput;
|
|
39
|
+
}, input: Partial<import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput>) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
|
|
40
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
41
|
+
readonly printer: {
|
|
42
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
43
|
+
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
44
|
+
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
45
|
+
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
46
|
+
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
47
|
+
};
|
|
48
|
+
readonly dependencies: readonly ["parse"];
|
|
49
|
+
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
50
|
+
} | {
|
|
51
|
+
readonly humanReadableName: "dataflow";
|
|
52
|
+
readonly processor: (results: {
|
|
53
|
+
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
54
|
+
}, input: {
|
|
55
|
+
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
56
|
+
}) => import("../../../dataflow/info").DataflowInformation;
|
|
57
|
+
readonly requiredInput: {};
|
|
58
|
+
readonly name: "dataflow";
|
|
59
|
+
readonly description: "Construct the dataflow graph";
|
|
60
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
61
|
+
readonly printer: {
|
|
62
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
63
|
+
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
64
|
+
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
65
|
+
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
66
|
+
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
67
|
+
};
|
|
68
|
+
readonly dependencies: readonly ["normalize"];
|
|
69
|
+
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
70
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
71
|
+
};
|
|
@@ -1,3 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DataflowQueryDefinition = void 0;
|
|
7
|
+
const dataflow_query_executor_1 = require("./dataflow-query-executor");
|
|
8
|
+
const ansi_1 = require("../../../util/ansi");
|
|
9
|
+
const time_1 = require("../../../util/time");
|
|
10
|
+
const dfg_1 = require("../../../util/mermaid/dfg");
|
|
11
|
+
const joi_1 = __importDefault(require("joi"));
|
|
12
|
+
exports.DataflowQueryDefinition = {
|
|
13
|
+
executor: dataflow_query_executor_1.executeDataflowQuery,
|
|
14
|
+
asciiSummarizer: (formatter, _processed, queryResults, result) => {
|
|
15
|
+
const out = queryResults;
|
|
16
|
+
result.push(`Query: ${(0, ansi_1.bold)('dataflow', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
17
|
+
result.push(` ╰ [Dataflow Graph](${(0, dfg_1.graphToMermaidUrl)(out.graph)})`);
|
|
18
|
+
return true;
|
|
19
|
+
},
|
|
20
|
+
schema: joi_1.default.object({
|
|
21
|
+
type: joi_1.default.string().valid('dataflow').required().description('The type of the query.'),
|
|
22
|
+
}).description('The dataflow query simply returns the dataflow graph, there is no need to pass it multiple times!')
|
|
23
|
+
};
|
|
3
24
|
//# sourceMappingURL=dataflow-query-format.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DependenciesQuery, DependenciesQueryResult } from './dependencies-query-format';
|
|
2
|
+
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
+
export declare function executeDependenciesQuery(data: BasicQueryData, queries: readonly DependenciesQuery[]): DependenciesQueryResult;
|