@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.
Files changed (106) hide show
  1. package/benchmark/slicer.js +1 -1
  2. package/cli/repl/commands/repl-parse.js +1 -1
  3. package/cli/repl/commands/repl-query.js +4 -5
  4. package/cli/repl/server/connection.js +6 -1
  5. package/cli/repl/server/messages/message-query.js +2 -2
  6. package/cli/repl/server/net.js +1 -1
  7. package/cli/repl/server/send.js +3 -6
  8. package/cli/repl/server/server.d.ts +2 -2
  9. package/cli/repl/server/server.js +1 -1
  10. package/config.js +1 -1
  11. package/core/pipeline-executor.js +2 -1
  12. package/core/steps/all/core/00-parse.d.ts +11 -4
  13. package/core/steps/all/core/00-parse.js +5 -5
  14. package/core/steps/all/core/10-normalize.d.ts +2 -1
  15. package/core/steps/all/core/20-dataflow.d.ts +2 -2
  16. package/core/steps/all/core/20-dataflow.js +2 -2
  17. package/core/steps/pipeline/default-pipelines.d.ts +41 -23
  18. package/core/steps/pipeline/pipeline.d.ts +15 -3
  19. package/core/steps/pipeline/pipeline.js +2 -2
  20. package/dataflow/environments/built-in.d.ts +8 -6
  21. package/dataflow/environments/built-in.js +6 -1
  22. package/dataflow/environments/default-builtin-config.js +21 -5
  23. package/dataflow/environments/environment.d.ts +1 -0
  24. package/dataflow/environments/environment.js +5 -5
  25. package/dataflow/extractor.js +23 -0
  26. package/dataflow/graph/dataflowgraph-builder.d.ts +2 -0
  27. package/dataflow/graph/dataflowgraph-builder.js +9 -0
  28. package/dataflow/graph/diff.js +1 -1
  29. package/dataflow/graph/graph.d.ts +7 -2
  30. package/dataflow/graph/graph.js +10 -2
  31. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
  32. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +2 -2
  33. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +2 -2
  34. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +1 -1
  35. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +1 -1
  36. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +1 -1
  37. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
  38. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +13 -1
  39. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +1 -1
  40. package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
  41. package/dataflow/processor.d.ts +3 -3
  42. package/documentation/data/server/doc-data-server-messages.js +8 -14
  43. package/documentation/doc-util/doc-cli-option.js +4 -4
  44. package/documentation/doc-util/doc-query.d.ts +4 -6
  45. package/documentation/doc-util/doc-query.js +16 -156
  46. package/documentation/doc-util/doc-repl.js +2 -2
  47. package/documentation/print-dataflow-graph-wiki.js +2 -1
  48. package/documentation/print-interface-wiki.js +8 -3
  49. package/documentation/print-query-wiki.js +107 -16
  50. package/package.json +1 -1
  51. package/queries/base-query-format.d.ts +6 -0
  52. package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
  53. package/queries/catalog/call-context-query/call-context-query-executor.js +26 -80
  54. package/queries/catalog/call-context-query/call-context-query-format.d.ts +14 -13
  55. package/queries/catalog/call-context-query/call-context-query-format.js +32 -14
  56. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +17 -0
  57. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +99 -0
  58. package/queries/catalog/cluster-query/cluster-query-executor.d.ts +1 -1
  59. package/queries/catalog/cluster-query/cluster-query-format.d.ts +59 -0
  60. package/queries/catalog/cluster-query/cluster-query-format.js +29 -0
  61. package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +1 -1
  62. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +59 -0
  63. package/queries/catalog/dataflow-query/dataflow-query-format.js +21 -0
  64. package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +3 -0
  65. package/queries/catalog/dependencies-query/dependencies-query-executor.js +144 -0
  66. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +102 -0
  67. package/queries/catalog/dependencies-query/dependencies-query-format.js +187 -0
  68. package/queries/catalog/id-map-query/id-map-query-executor.d.ts +1 -1
  69. package/queries/catalog/id-map-query/id-map-query-format.d.ts +59 -0
  70. package/queries/catalog/id-map-query/id-map-query-format.js +21 -0
  71. package/queries/catalog/lineage-query/lineage-query-executor.d.ts +1 -1
  72. package/queries/catalog/lineage-query/lineage-query-format.d.ts +59 -0
  73. package/queries/catalog/lineage-query/lineage-query-format.js +24 -0
  74. package/queries/catalog/location-map-query/location-map-query-executor.d.ts +3 -0
  75. package/queries/catalog/location-map-query/location-map-query-executor.js +21 -0
  76. package/queries/catalog/location-map-query/location-map-query-format.d.ts +17 -0
  77. package/queries/catalog/location-map-query/location-map-query-format.js +24 -0
  78. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +1 -1
  79. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +59 -0
  80. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +21 -0
  81. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
  82. package/queries/catalog/static-slice-query/static-slice-query-executor.js +8 -3
  83. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +59 -0
  84. package/queries/catalog/static-slice-query/static-slice-query-format.js +40 -0
  85. package/queries/query-print.d.ts +8 -0
  86. package/queries/query-print.js +94 -0
  87. package/queries/query.d.ts +431 -26
  88. package/queries/query.js +36 -18
  89. package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +2 -1
  90. package/r-bridge/lang-4.x/ast/parser/json/parser.js +2 -2
  91. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -1
  92. package/r-bridge/retriever.js +1 -1
  93. package/r-bridge/shell-executor.js +1 -1
  94. package/r-bridge/shell.d.ts +1 -2
  95. package/r-bridge/shell.js +22 -18
  96. package/slicing/static/static-slicer.js +3 -1
  97. package/statistics/features/supported/used-functions/used-functions.js +1 -1
  98. package/{documentation/doc-util/doc-hover-over.js → util/html-hover-over.js} +1 -1
  99. package/util/json.d.ts +2 -1
  100. package/util/json.js +101 -3
  101. package/util/objects.d.ts +2 -1
  102. package/util/objects.js +3 -0
  103. package/util/version.js +1 -1
  104. package/queries/query-schema.d.ts +0 -13
  105. package/queries/query-schema.js +0 -54
  106. /package/{documentation/doc-util/doc-hover-over.d.ts → util/html-hover-over.d.ts} +0 -0
@@ -16,7 +16,7 @@ class RShellExecutor {
16
16
  options;
17
17
  prerequisites;
18
18
  constructor(options) {
19
- this.options = (0, objects_1.deepMergeObject)(shell_1.DEFAULT_R_SHELL_OPTIONS, options);
19
+ this.options = (0, objects_1.deepMergeObject)((0, shell_1.getDefaultRShellOptions)(), options);
20
20
  this.prerequisites = [(0, init_1.initCommand)(this.options.eol)];
21
21
  }
22
22
  addPrerequisites(commands) {
@@ -66,8 +66,7 @@ export interface RShellOptions extends RShellSessionOptions {
66
66
  readonly sessionName: string;
67
67
  }
68
68
  export declare const DEFAULT_R_PATH: string;
69
- export declare const DEFAULT_R_SHELL_EXEC_OPTIONS: RShellExecutionOptions;
70
- export declare const DEFAULT_R_SHELL_OPTIONS: RShellOptions;
69
+ export declare function getDefaultRShellOptions(): RShellOptions;
71
70
  /**
72
71
  * The `RShell` represents an interactive session with the R interpreter.
73
72
  * You can configure it by {@link RShellOptions}.
package/r-bridge/shell.js CHANGED
@@ -26,7 +26,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.RShell = exports.DEFAULT_R_SHELL_OPTIONS = exports.DEFAULT_R_SHELL_EXEC_OPTIONS = exports.DEFAULT_R_PATH = exports.DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION = void 0;
29
+ exports.RShell = exports.DEFAULT_R_PATH = exports.DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION = void 0;
30
+ exports.getDefaultRShellOptions = getDefaultRShellOptions;
30
31
  const child_process_1 = require("child_process");
31
32
  const objects_1 = require("../util/objects");
32
33
  const readline = __importStar(require("readline"));
@@ -49,22 +50,25 @@ exports.DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION = {
49
50
  errorStopsWaiting: true
50
51
  };
51
52
  exports.DEFAULT_R_PATH = (0, os_1.getPlatform)() === 'windows' ? 'R.exe' : 'R';
52
- exports.DEFAULT_R_SHELL_EXEC_OPTIONS = {
53
- pathToRExecutable: (0, config_1.getConfig)().rPath ?? exports.DEFAULT_R_PATH,
54
- // -s is a short form of --no-echo (and the old version --slave), but this one works in R 3 and 4
55
- // (see https://github.com/wch/r-source/commit/f1ff49e74593341c74c20de9517f31a22c8bcb04)
56
- commandLineOptions: ['--vanilla', '--quiet', '--no-save', '-s'],
57
- cwd: process.cwd(),
58
- env: undefined,
59
- eol: '\n',
60
- homeLibPath: (0, os_1.getPlatform)() === 'windows' ? undefined : '~/.r-libs'
61
- };
62
- exports.DEFAULT_R_SHELL_OPTIONS = {
63
- ...exports.DEFAULT_R_SHELL_EXEC_OPTIONS,
64
- sessionName: 'default',
65
- revive: 0 /* RShellReviveOptions.Never */,
66
- onRevive: () => { }
67
- };
53
+ let DEFAULT_R_SHELL_OPTIONS = undefined;
54
+ function getDefaultRShellOptions() {
55
+ if (!DEFAULT_R_SHELL_OPTIONS) {
56
+ DEFAULT_R_SHELL_OPTIONS = {
57
+ pathToRExecutable: (0, config_1.getConfig)().rPath ?? exports.DEFAULT_R_PATH,
58
+ // -s is a short form of --no-echo (and the old version --slave), but this one works in R 3 and 4
59
+ // (see https://github.com/wch/r-source/commit/f1ff49e74593341c74c20de9517f31a22c8bcb04)
60
+ commandLineOptions: ['--vanilla', '--quiet', '--no-save', '-s'],
61
+ cwd: process.cwd(),
62
+ env: undefined,
63
+ eol: '\n',
64
+ homeLibPath: (0, os_1.getPlatform)() === 'windows' ? undefined : '~/.r-libs',
65
+ sessionName: 'default',
66
+ revive: 0 /* RShellReviveOptions.Never */,
67
+ onRevive: () => { }
68
+ };
69
+ }
70
+ return DEFAULT_R_SHELL_OPTIONS;
71
+ }
68
72
  /**
69
73
  * The `RShell` represents an interactive session with the R interpreter.
70
74
  * You can configure it by {@link RShellOptions}.
@@ -81,7 +85,7 @@ class RShell {
81
85
  // should never be more than one, but let's be sure
82
86
  tempDirs = new Set();
83
87
  constructor(options) {
84
- this.options = { ...exports.DEFAULT_R_SHELL_OPTIONS, ...options };
88
+ this.options = { ...getDefaultRShellOptions(), ...options };
85
89
  this.log = log_1.log.getSubLogger({ name: this.options.sessionName });
86
90
  this.session = new RShellSession(this.options, this.log);
87
91
  this.revive();
@@ -43,7 +43,9 @@ function staticSlicing(graph, { idMap }, criteria, threshold = 75) {
43
43
  * include all the implicit side effects that we have to consider as we are unable to narrow them down
44
44
  */
45
45
  for (const id of graph.unknownSideEffects) {
46
- queue.add(id, emptyEnv, basePrint, true);
46
+ if (typeof id !== 'object') { /* otherwise, their target is just missing */
47
+ queue.add(id, emptyEnv, basePrint, true);
48
+ }
47
49
  }
48
50
  }
49
51
  while (queue.nonEmpty()) {
@@ -84,7 +84,7 @@ function visitCalls(info, input) {
84
84
  hasCallsEdge ? 1 : 0
85
85
  ]);
86
86
  }
87
- classifyArguments(node.arguments.map(unpack_argument_1.unpackArgument), info.args);
87
+ classifyArguments(node.arguments.map(e => (0, unpack_argument_1.unpackArgument)(e)), info.args);
88
88
  calls.push(node);
89
89
  }, node => {
90
90
  // drop again :D
@@ -4,4 +4,4 @@ exports.textWithTooltip = textWithTooltip;
4
4
  function textWithTooltip(text, tooltip) {
5
5
  return tooltip ? `<span title=${JSON.stringify(tooltip)}>${text}</span>` : text;
6
6
  }
7
- //# sourceMappingURL=doc-hover-over.js.map
7
+ //# sourceMappingURL=html-hover-over.js.map
package/util/json.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export declare function jsonReplacer(key: any, value: any): any;
1
+ export declare function jsonReplacer(key: unknown, value: unknown): unknown;
2
2
  export declare function jsonBigIntRetriever(key: string, value: unknown): unknown;
3
+ export declare function superBigJsonStringify(obj: unknown, end: string, send: (s: string) => void): void;
package/util/json.js CHANGED
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
+ // to get the types within JSON.stringify
3
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.jsonReplacer = jsonReplacer;
4
6
  exports.jsonBigIntRetriever = jsonBigIntRetriever;
5
- // to get the types within JSON.stringify
6
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ exports.superBigJsonStringify = superBigJsonStringify;
8
+ const environment_1 = require("../dataflow/environments/environment");
7
9
  function jsonReplacer(key, value) {
8
- if (value instanceof Map || value instanceof Set) {
10
+ if (key === 'fullLexeme') {
11
+ return undefined;
12
+ }
13
+ else if (value instanceof Map || value instanceof Set) {
9
14
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
10
15
  return [...value];
11
16
  }
@@ -24,4 +29,97 @@ function jsonBigIntRetriever(key, value) {
24
29
  return value;
25
30
  }
26
31
  }
32
+ function superBigJsonStringify(obj, end, send) {
33
+ try {
34
+ const tryOut = JSON.stringify(obj, jsonReplacer) + end;
35
+ send(tryOut);
36
+ }
37
+ catch {
38
+ /* let's try the sad path! */
39
+ const remainder = bigStringify(obj, '', send);
40
+ send(remainder + end);
41
+ }
42
+ }
43
+ function bigStringify(obj, current, send) {
44
+ if (current.length > 20_000) {
45
+ send(current);
46
+ current = '';
47
+ }
48
+ if (obj === undefined || obj === null) {
49
+ return current + 'null';
50
+ }
51
+ else if (obj === environment_1.BuiltInEnvironment) {
52
+ return current + '<BuiltInEnvironment>';
53
+ }
54
+ else if (obj === environment_1.EmptyBuiltInEnvironment) {
55
+ return current + '<EmptyBuiltInEnvironment>';
56
+ }
57
+ else if (Array.isArray(obj)) {
58
+ let str = current + '[';
59
+ for (let i = 0; i < obj.length; i++) {
60
+ if (i > 0) {
61
+ str += ',';
62
+ }
63
+ str = bigStringify(obj[i], str, send);
64
+ if (str.length > 20_000) {
65
+ send(str);
66
+ str = '';
67
+ }
68
+ }
69
+ return str + ']';
70
+ }
71
+ else if (obj instanceof Map || obj instanceof Set) {
72
+ let str = current + '[';
73
+ let i = 0;
74
+ for (const value of obj) {
75
+ if (i++ > 0) {
76
+ str += ',';
77
+ }
78
+ str = bigStringify(value, str, send);
79
+ if (str.length > 20_000) {
80
+ send(str);
81
+ str = '';
82
+ }
83
+ }
84
+ return str + ']';
85
+ }
86
+ else if (typeof obj === 'bigint') {
87
+ return current + `${obj.toString()}n`;
88
+ }
89
+ else if (obj instanceof Date) {
90
+ return current + `"${obj.toISOString()}"`;
91
+ }
92
+ else if (obj instanceof RegExp) {
93
+ return current + `"${obj.toString()}"`;
94
+ }
95
+ else if (typeof obj === 'object') {
96
+ let str = current + '{';
97
+ let i = 0;
98
+ for (const key in obj) {
99
+ if (Object.hasOwn(obj, key)) {
100
+ // @ts-expect-error - We know that obj[key] is not undefined, it its own property
101
+ const value = obj[key];
102
+ if (value === undefined || typeof value === 'function' || typeof value === 'symbol' || key === 'info') {
103
+ continue;
104
+ }
105
+ if (i++ > 0) {
106
+ str += ',';
107
+ }
108
+ str += `"${key}":`;
109
+ str = bigStringify(value, str, send);
110
+ if (str.length > 20_000) {
111
+ send(str);
112
+ str = '';
113
+ }
114
+ }
115
+ }
116
+ return str + '}';
117
+ }
118
+ else if (typeof obj === 'function' || typeof obj === 'symbol') {
119
+ return current + 'null'; // Optionally skip functions and symbols
120
+ }
121
+ else {
122
+ return current + JSON.stringify(obj, environment_1.builtInEnvJsonReplacer);
123
+ }
124
+ }
27
125
  //# sourceMappingURL=json.js.map
package/util/objects.d.ts CHANGED
@@ -19,6 +19,7 @@ type Defined<T> = Exclude<T, undefined>;
19
19
  type DefinedRecord<T> = {
20
20
  [K in keyof T as T[K] extends undefined ? never : K]: Defined<T[K]>;
21
21
  };
22
- /** from a record take only the keys that are not undefined */
23
22
  export declare function compactRecord<T extends Record<string, unknown>>(record: T): DefinedRecord<T>;
23
+ export declare function compactRecord(record: undefined): undefined;
24
+ export declare function compactRecord<T extends Record<string, unknown>>(record: T | undefined): DefinedRecord<T> | undefined;
24
25
  export {};
package/util/objects.js CHANGED
@@ -63,6 +63,9 @@ function assertSameType(base, addon) {
63
63
  }
64
64
  /** from a record take only the keys that are not undefined */
65
65
  function compactRecord(record) {
66
+ if (record === undefined) {
67
+ return undefined;
68
+ }
66
69
  const result = {};
67
70
  for (const key of Object.keys(record)) {
68
71
  if (record[key] !== undefined) {
package/util/version.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.flowrVersion = flowrVersion;
4
4
  const semver_1 = require("semver");
5
5
  // this is automatically replaced with the current version by release-it
6
- const version = '2.1.3';
6
+ const version = '2.1.5';
7
7
  function flowrVersion() {
8
8
  return new semver_1.SemVer(version);
9
9
  }
@@ -1,13 +0,0 @@
1
- import Joi from 'joi';
2
- export declare const CallContextQuerySchema: Joi.ObjectSchema<any>;
3
- export declare const DataflowQuerySchema: Joi.ObjectSchema<any>;
4
- export declare const IdMapQuerySchema: Joi.ObjectSchema<any>;
5
- export declare const NormalizedAstQuerySchema: Joi.ObjectSchema<any>;
6
- export declare const DataflowClusterQuerySchema: Joi.ObjectSchema<any>;
7
- export declare const StaticSliceQuerySchema: Joi.ObjectSchema<any>;
8
- export declare const LineageQuerySchema: Joi.ObjectSchema<any>;
9
- export declare const SupportedQueriesSchema: Joi.AlternativesSchema<any>;
10
- export declare const CompoundQuerySchema: Joi.ObjectSchema<any>;
11
- export declare const VirtualQuerySchema: Joi.AlternativesSchema<any>;
12
- export declare const AnyQuerySchema: Joi.AlternativesSchema<any>;
13
- export declare const QueriesSchema: Joi.ArraySchema<any[]>;
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.QueriesSchema = exports.AnyQuerySchema = exports.VirtualQuerySchema = exports.CompoundQuerySchema = exports.SupportedQueriesSchema = exports.LineageQuerySchema = exports.StaticSliceQuerySchema = exports.DataflowClusterQuerySchema = exports.NormalizedAstQuerySchema = exports.IdMapQuerySchema = exports.DataflowQuerySchema = exports.CallContextQuerySchema = void 0;
7
- const joi_1 = __importDefault(require("joi"));
8
- const call_context_query_format_1 = require("./catalog/call-context-query/call-context-query-format");
9
- exports.CallContextQuerySchema = joi_1.default.object({
10
- type: joi_1.default.string().valid('call-context').required().description('The type of the query.'),
11
- callName: joi_1.default.string().required().description('Regex regarding the function name!'),
12
- callNameExact: joi_1.default.boolean().optional().description('Should we automatically add the `^` and `$` anchors to the regex to make it an exact match?'),
13
- 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 `.`'),
14
- 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 `.`'),
15
- callTargets: joi_1.default.string().valid(...Object.values(call_context_query_format_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.'),
16
- 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?'),
17
- linkTo: joi_1.default.object({
18
- type: joi_1.default.string().valid('link-to-last-call').required().description('The type of the linkTo sub-query.'),
19
- 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.')
20
- }).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.')
21
- }).description('Call context query used to find calls in the dataflow graph');
22
- exports.DataflowQuerySchema = joi_1.default.object({
23
- type: joi_1.default.string().valid('dataflow').required().description('The type of the query.'),
24
- }).description('The dataflow query simply returns the dataflow graph, there is no need to pass it multiple times!');
25
- exports.IdMapQuerySchema = joi_1.default.object({
26
- type: joi_1.default.string().valid('id-map').required().description('The type of the query.'),
27
- }).description('The id map query retrieves the id map from the normalized AST.');
28
- exports.NormalizedAstQuerySchema = joi_1.default.object({
29
- type: joi_1.default.string().valid('normalized-ast').required().description('The type of the query.'),
30
- }).description('The normalized AST query simply returns the normalized AST, there is no need to pass it multiple times!');
31
- exports.DataflowClusterQuerySchema = joi_1.default.object({
32
- type: joi_1.default.string().valid('dataflow-cluster').required().description('The type of the query.'),
33
- }).description('The cluster query calculates and returns all clusters in the dataflow graph.');
34
- exports.StaticSliceQuerySchema = joi_1.default.object({
35
- type: joi_1.default.string().valid('static-slice').required().description('The type of the query.'),
36
- criteria: joi_1.default.array().items(joi_1.default.string()).min(0).required().description('The slicing criteria to use.'),
37
- noReconstruction: joi_1.default.boolean().optional().description('Do not reconstruct the slice into readable code.'),
38
- noMagicComments: joi_1.default.boolean().optional().description('Should the magic comments (force-including lines within the slice) be ignored?')
39
- }).description('Slice query used to slice the dataflow graph');
40
- exports.LineageQuerySchema = joi_1.default.object({
41
- type: joi_1.default.string().valid('lineage').required().description('The type of the query.'),
42
- id: joi_1.default.string().required().description('The ID of the node to get the lineage of.')
43
- }).description('Lineage query used to find the lineage of a node in the dataflow graph');
44
- exports.SupportedQueriesSchema = joi_1.default.alternatives(exports.CallContextQuerySchema, exports.DataflowQuerySchema, exports.IdMapQuerySchema, exports.NormalizedAstQuerySchema, exports.DataflowClusterQuerySchema, exports.StaticSliceQuerySchema, exports.LineageQuerySchema).description('Supported queries');
45
- exports.CompoundQuerySchema = joi_1.default.object({
46
- type: joi_1.default.string().valid('compound').required().description('The type of the query.'),
47
- query: joi_1.default.string().required().description('The query to run on the file analysis information.'),
48
- commonArguments: joi_1.default.object().required().description('Common arguments for all queries.'),
49
- arguments: joi_1.default.array().items(joi_1.default.object()).required().description('Arguments for each query.')
50
- }).description('Compound query used to combine queries of the same type');
51
- exports.VirtualQuerySchema = joi_1.default.alternatives(exports.CompoundQuerySchema).description('Virtual queries (used for structure)');
52
- exports.AnyQuerySchema = joi_1.default.alternatives(exports.SupportedQueriesSchema, exports.VirtualQuerySchema).description('Any query');
53
- exports.QueriesSchema = joi_1.default.array().items(exports.AnyQuerySchema).description('Queries to run on the file analysis information (in the form of an array)');
54
- //# sourceMappingURL=query-schema.js.map