@eagleoutice/flowr 2.1.10 → 2.1.11
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/cli/flowr.js +8 -0
- package/cli/repl/commands/repl-query.js +13 -2
- package/dataflow/environments/resolve-by-name.d.ts +2 -1
- package/dataflow/environments/resolve-by-name.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +29 -26
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +28 -24
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -1
- package/documentation/print-interface-wiki.js +7 -2
- package/documentation/print-query-wiki.js +13 -0
- package/package.json +1 -1
- package/queries/catalog/config-query/config-query-executor.d.ts +3 -0
- package/queries/catalog/config-query/config-query-executor.js +18 -0
- package/queries/catalog/config-query/config-query-format.d.ts +16 -0
- package/queries/catalog/config-query/config-query-format.js +24 -0
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
- package/queries/query.d.ts +7 -1
- package/queries/query.js +2 -0
- package/util/version.js +1 -1
package/cli/flowr.js
CHANGED
|
@@ -21,6 +21,7 @@ const core_1 = require("./repl/core");
|
|
|
21
21
|
const repl_version_1 = require("./repl/commands/repl-version");
|
|
22
22
|
const print_version_1 = require("./repl/print-version");
|
|
23
23
|
const flowr_main_options_1 = require("./flowr-main-options");
|
|
24
|
+
const fs_1 = __importDefault(require("fs"));
|
|
24
25
|
exports.toolName = 'flowr';
|
|
25
26
|
exports.optionHelp = [
|
|
26
27
|
{
|
|
@@ -59,6 +60,13 @@ if (options['config-json']) {
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
if (!usedConfig) {
|
|
63
|
+
if (options['config-file']) {
|
|
64
|
+
// validate it exists
|
|
65
|
+
if (!fs_1.default.existsSync(options['config-file'])) {
|
|
66
|
+
log_1.log.error(`Config file '${options['config-file']}' does not exist`);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
62
70
|
(0, config_1.setConfigFile)(options['config-file'] ?? flowr_main_options_1.defaultConfigFile, undefined, true);
|
|
63
71
|
}
|
|
64
72
|
function retrieveShell() {
|
|
@@ -21,8 +21,10 @@ function printHelp(output) {
|
|
|
21
21
|
output.stdout('The query is an array of query objects to represent multiple queries. Each query object may have the following properties:');
|
|
22
22
|
output.stdout((0, schema_1.describeSchema)((0, query_1.AnyQuerySchema)(), output.formatter));
|
|
23
23
|
output.stdout(`\n\nThe example ${(0, ansi_1.italic)(':query "[{\\"type\\": \\"call-context\\", \\"callName\\": \\"mean\\" }]" mean(1:10)', output.formatter)} would return the call context of the mean function.`);
|
|
24
|
-
output.stdout('As a convenience, we interpret any (non-help) string not starting with \'[\' as a regex for the simple call-context query.');
|
|
24
|
+
output.stdout('As a convenience, we interpret any (non-help, non-@) string not starting with \'[\' as a regex for the simple call-context query.');
|
|
25
25
|
output.stdout(`Hence, ${(0, ansi_1.italic)(':query "mean" mean(1:10)', output.formatter)} is equivalent to the above example.`);
|
|
26
|
+
output.stdout(`Similarly, '@<type>' is interpreted as a query of the given type.`);
|
|
27
|
+
output.stdout(`With this, ${(0, ansi_1.italic)(':query @config', output.formatter)} prints the result of the config query.`);
|
|
26
28
|
}
|
|
27
29
|
async function processQueryArgs(line, shell, output) {
|
|
28
30
|
const args = (0, args_1.splitAtEscapeSensitive)(line);
|
|
@@ -36,7 +38,16 @@ async function processQueryArgs(line, shell, output) {
|
|
|
36
38
|
return;
|
|
37
39
|
}
|
|
38
40
|
let parsedQuery = [];
|
|
39
|
-
if (query.startsWith('
|
|
41
|
+
if (query.startsWith('@')) {
|
|
42
|
+
parsedQuery = [{ type: query.slice(1) }];
|
|
43
|
+
const validationResult = (0, query_1.QueriesSchema)().validate(parsedQuery);
|
|
44
|
+
if (validationResult.error) {
|
|
45
|
+
output.stderr(`Invalid query: ${validationResult.error.message}`);
|
|
46
|
+
printHelp(output);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else if (query.startsWith('[')) {
|
|
40
51
|
parsedQuery = JSON.parse(query);
|
|
41
52
|
const validationResult = (0, query_1.QueriesSchema)().validate(parsedQuery);
|
|
42
53
|
if (validationResult.error) {
|
|
@@ -11,7 +11,8 @@ import type { DataflowGraph } from '../graph/graph';
|
|
|
11
11
|
* @param environment - The current environment used for name resolution
|
|
12
12
|
* @param target - The target (meta) type of the identifier to resolve
|
|
13
13
|
*
|
|
14
|
-
* @returns A list of possible definitions
|
|
14
|
+
* @returns A list of possible identifier definitions (one if the definition location is exactly and always known), or `undefined`
|
|
15
|
+
* if the identifier is undefined in the current scope/with the current environment information.
|
|
15
16
|
*/
|
|
16
17
|
export declare function resolveByName(name: Identifier, environment: REnvironmentInformation, target?: ReferenceType): IdentifierDefinition[] | undefined;
|
|
17
18
|
export declare function resolvesToBuiltInConstant(name: Identifier | undefined, environment: REnvironmentInformation, wantedValue: unknown): Ternary;
|
|
@@ -35,7 +35,8 @@ const TargetTypePredicate = {
|
|
|
35
35
|
* @param environment - The current environment used for name resolution
|
|
36
36
|
* @param target - The target (meta) type of the identifier to resolve
|
|
37
37
|
*
|
|
38
|
-
* @returns A list of possible definitions
|
|
38
|
+
* @returns A list of possible identifier definitions (one if the definition location is exactly and always known), or `undefined`
|
|
39
|
+
* if the identifier is undefined in the current scope/with the current environment information.
|
|
39
40
|
*/
|
|
40
41
|
function resolveByName(name, environment, target = identifier_1.ReferenceType.Unknown) {
|
|
41
42
|
let current = environment.current;
|
|
@@ -13,6 +13,7 @@ const built_in_assignment_1 = require("./built-in-assignment");
|
|
|
13
13
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
14
14
|
const vertex_1 = require("../../../../../graph/vertex");
|
|
15
15
|
const list_access_1 = require("../../../../../../util/list-access");
|
|
16
|
+
const config_1 = require("../../../../../../config");
|
|
16
17
|
function tableAssignmentProcessor(name, args, rootId, data, outInfo) {
|
|
17
18
|
outInfo.definitionRootNodes.push(rootId);
|
|
18
19
|
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data }).information;
|
|
@@ -147,34 +148,36 @@ function processStringBasedAccess(args, data, name, rootId, config) {
|
|
|
147
148
|
if (accessedArg === undefined || accessArg === undefined) {
|
|
148
149
|
return fnCall;
|
|
149
150
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
else {
|
|
156
|
-
// Higher access call
|
|
157
|
-
const underlyingAccessId = accessedArg.value?.info.id ?? -1;
|
|
158
|
-
const vertex = fnCall.information.graph.getVertex(underlyingAccessId);
|
|
159
|
-
const subIndices = vertex?.indicesCollection
|
|
160
|
-
?.flatMap(indices => indices.indices)
|
|
161
|
-
?.flatMap(index => index?.subIndices ?? []);
|
|
162
|
-
if (subIndices) {
|
|
163
|
-
accessedIndicesCollection = (0, list_access_1.filterIndices)(subIndices, accessArg);
|
|
151
|
+
if ((0, config_1.getConfig)().solver.pointerTracking) {
|
|
152
|
+
let accessedIndicesCollection;
|
|
153
|
+
// If the accessedArg is a symbol, it's either a simple access or the base case of a nested access
|
|
154
|
+
if (accessedArg.value?.type === type_1.RType.Symbol) {
|
|
155
|
+
accessedIndicesCollection = (0, list_access_1.resolveSingleIndex)(accessedArg, accessArg, data.environment);
|
|
164
156
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
157
|
+
else {
|
|
158
|
+
// Higher access call
|
|
159
|
+
const underlyingAccessId = accessedArg.value?.info.id ?? -1;
|
|
160
|
+
const vertex = fnCall.information.graph.getVertex(underlyingAccessId);
|
|
161
|
+
const subIndices = vertex?.indicesCollection
|
|
162
|
+
?.flatMap(indices => indices.indices)
|
|
163
|
+
?.flatMap(index => index?.subIndices ?? []);
|
|
164
|
+
if (subIndices) {
|
|
165
|
+
accessedIndicesCollection = (0, list_access_1.filterIndices)(subIndices, accessArg);
|
|
166
|
+
}
|
|
171
167
|
}
|
|
172
|
-
//
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
168
|
+
// Add indices to vertex afterward
|
|
169
|
+
if (accessedIndicesCollection) {
|
|
170
|
+
const vertex = fnCall.information.graph.getVertex(rootId);
|
|
171
|
+
if (vertex) {
|
|
172
|
+
vertex.indicesCollection = accessedIndicesCollection;
|
|
173
|
+
}
|
|
174
|
+
// When access has no access as parent, it's the top most
|
|
175
|
+
const rootNode = data.completeAst.idMap.get(rootId);
|
|
176
|
+
const parentNode = data.completeAst.idMap.get(rootNode?.info.parent ?? -1);
|
|
177
|
+
if (parentNode?.type !== type_1.RType.Access) {
|
|
178
|
+
// Only reference indices in top most access
|
|
179
|
+
referenceIndices(accessedIndicesCollection, fnCall, name.info.id);
|
|
180
|
+
}
|
|
178
181
|
}
|
|
179
182
|
}
|
|
180
183
|
return fnCall;
|
|
@@ -42,8 +42,7 @@ export interface AssignmentToSymbolParameters<OtherInfo> extends AssignmentConfi
|
|
|
42
42
|
* @param nodeToDefine - `x`
|
|
43
43
|
* @param sourceIds - `v`
|
|
44
44
|
* @param rootIdOfAssignment - `<-`
|
|
45
|
-
* @param
|
|
46
|
-
* @param superAssignment - whether this is a super assignment (i.e., `<<-`)
|
|
45
|
+
* @param config - configuration for the assignment processing
|
|
47
46
|
*/
|
|
48
47
|
export declare function markAsAssignment(information: {
|
|
49
48
|
environment: REnvironmentInformation;
|
|
@@ -18,6 +18,7 @@ const define_1 = require("../../../../../environments/define");
|
|
|
18
18
|
const edge_1 = require("../../../../../graph/edge");
|
|
19
19
|
const resolve_by_name_1 = require("../../../../../environments/resolve-by-name");
|
|
20
20
|
const list_access_1 = require("../../../../../../util/list-access");
|
|
21
|
+
const config_1 = require("../../../../../../config");
|
|
21
22
|
function toReplacementSymbol(target, prefix, superAssignment) {
|
|
22
23
|
return {
|
|
23
24
|
type: type_1.RType.Symbol,
|
|
@@ -184,29 +185,30 @@ function checkTargetReferenceType(source, sourceInfo) {
|
|
|
184
185
|
* @param nodeToDefine - `x`
|
|
185
186
|
* @param sourceIds - `v`
|
|
186
187
|
* @param rootIdOfAssignment - `<-`
|
|
187
|
-
* @param
|
|
188
|
-
* @param superAssignment - whether this is a super assignment (i.e., `<<-`)
|
|
188
|
+
* @param config - configuration for the assignment processing
|
|
189
189
|
*/
|
|
190
190
|
function markAsAssignment(information, nodeToDefine, sourceIds, rootIdOfAssignment, config) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
// Indices defined by replacement operation e.g. $<-
|
|
198
|
-
if (config?.indicesCollection !== undefined) {
|
|
199
|
-
// If there were indices stored in the vertex, then a container was defined
|
|
200
|
-
// and assigned to the index of another container e.g. a$b <- list(c = 1)
|
|
201
|
-
if (indicesCollection) {
|
|
202
|
-
indicesCollection = (0, list_access_1.addSubIndicesToLeafIndices)(config.indicesCollection, indicesCollection);
|
|
191
|
+
if ((0, config_1.getConfig)().solver.pointerTracking) {
|
|
192
|
+
let indicesCollection = undefined;
|
|
193
|
+
if (sourceIds.length === 1) {
|
|
194
|
+
// support for tracking indices
|
|
195
|
+
// Indices were defined for the vertex e.g. a <- list(c = 1) or a$b <- list(c = 1)
|
|
196
|
+
indicesCollection = information.graph.getVertex(sourceIds[0])?.indicesCollection;
|
|
203
197
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
198
|
+
// Indices defined by replacement operation e.g. $<-
|
|
199
|
+
if (config?.indicesCollection !== undefined) {
|
|
200
|
+
// If there were indices stored in the vertex, then a container was defined
|
|
201
|
+
// and assigned to the index of another container e.g. a$b <- list(c = 1)
|
|
202
|
+
if (indicesCollection) {
|
|
203
|
+
indicesCollection = (0, list_access_1.addSubIndicesToLeafIndices)(config.indicesCollection, indicesCollection);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
// No indices were defined for the vertex e.g. a$b <- 2
|
|
207
|
+
indicesCollection = config.indicesCollection;
|
|
208
|
+
}
|
|
207
209
|
}
|
|
210
|
+
nodeToDefine.indicesCollection ??= indicesCollection;
|
|
208
211
|
}
|
|
209
|
-
nodeToDefine.indicesCollection ??= indicesCollection;
|
|
210
212
|
information.environment = (0, define_1.define)(nodeToDefine, config?.superAssignment, information.environment);
|
|
211
213
|
information.graph.setDefinitionOfVertex(nodeToDefine);
|
|
212
214
|
if (!config?.quoteSource) {
|
|
@@ -215,12 +217,14 @@ function markAsAssignment(information, nodeToDefine, sourceIds, rootIdOfAssignme
|
|
|
215
217
|
}
|
|
216
218
|
}
|
|
217
219
|
information.graph.addEdge(nodeToDefine, rootIdOfAssignment, edge_1.EdgeType.DefinedBy);
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
edge
|
|
222
|
-
|
|
223
|
-
|
|
220
|
+
if ((0, config_1.getConfig)().solver.pointerTracking) {
|
|
221
|
+
// kinda dirty, but we have to remove existing read edges for the symbol, added by the child
|
|
222
|
+
const out = information.graph.outgoingEdges(nodeToDefine.nodeId);
|
|
223
|
+
for (const [id, edge] of (out ?? [])) {
|
|
224
|
+
edge.types &= ~edge_1.EdgeType.Reads;
|
|
225
|
+
if (edge.types == 0) {
|
|
226
|
+
out?.delete(id);
|
|
227
|
+
}
|
|
224
228
|
}
|
|
225
229
|
}
|
|
226
230
|
}
|
|
@@ -15,6 +15,7 @@ const edge_1 = require("../../../../../graph/edge");
|
|
|
15
15
|
const dfg_1 = require("../../../../../../util/mermaid/dfg");
|
|
16
16
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
17
17
|
const list_access_1 = require("../../../../../../util/list-access");
|
|
18
|
+
const config_1 = require("../../../../../../config");
|
|
18
19
|
function processReplacementFunction(name,
|
|
19
20
|
/** The last one has to be the value */
|
|
20
21
|
args, rootId, data, config) {
|
|
@@ -25,7 +26,7 @@ args, rootId, data, config) {
|
|
|
25
26
|
/* we only get here if <-, <<-, ... or whatever is part of the replacement is not overwritten */
|
|
26
27
|
(0, log_1.expensiveTrace)(logger_1.dataflowLogger, () => `Replacement ${name.content} with ${JSON.stringify(args)}, processing`);
|
|
27
28
|
let indices = undefined;
|
|
28
|
-
if (name.content === '$<-') {
|
|
29
|
+
if (name.content === '$<-' && (0, config_1.getConfig)().solver.pointerTracking) {
|
|
29
30
|
const nonEmptyArgs = args.filter(arg => arg !== r_function_call_1.EmptyArgument);
|
|
30
31
|
const accessedArg = nonEmptyArgs.find(arg => arg.info.role === "accessed" /* RoleInParent.Accessed */);
|
|
31
32
|
const accessArg = nonEmptyArgs.find(arg => arg.info.role === "index-access" /* RoleInParent.IndexAccess */);
|
|
@@ -162,6 +162,11 @@ function explainConfigFile() {
|
|
|
162
162
|
When running _flowR_, you may want to specify some behaviors with a dedicated configuration file.
|
|
163
163
|
By default, flowR looks for a file named \`${flowr_main_options_1.defaultConfigFile}\` in the current working directory (or any higher directory).
|
|
164
164
|
You can also specify a different file with ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'config-file')} or pass the configuration inline using ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'config-json')}.
|
|
165
|
+
To inspect the current configuration, you can run flowr with the ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'verbose')} flag, or use the \`config\` [Query](${doc_files_1.FlowrWikiBaseRef}/Query%20API).
|
|
166
|
+
Within the REPL this works by running the following:
|
|
167
|
+
|
|
168
|
+
${(0, doc_code_1.codeBlock)('shell', ':query @config')}
|
|
169
|
+
|
|
165
170
|
|
|
166
171
|
The following summarizes the configuration options:
|
|
167
172
|
|
|
@@ -209,8 +214,8 @@ ${(0, doc_code_1.codeBlock)('json', JSON.stringify({
|
|
|
209
214
|
- \`loadDefaults\` (boolean, initially \`true\`): If set to \`true\`, the default built-in definitions are loaded before applying the custom definitions. Setting this flag to \`false\` explicitly disables the loading of the default definitions.
|
|
210
215
|
- \`definitions\` (array, initially empty): Allows to overwrite or define new built-in elements. Each object within must have a \`type\` which is one of the below. Furthermore, they may define a string array of \`names\` which specifies the identifiers to bind the definitions to. You may use \`assumePrimitive\` to specify whether _flowR_ should assume that this is a primitive non-library definition (so you probably just do not want to specify the key).
|
|
211
216
|
|
|
212
|
-
| Type
|
|
213
|
-
|
|
|
217
|
+
| Type | Description | Example |
|
|
218
|
+
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
214
219
|
| \`constant\` | Additionally allows for a \`value\` this should resolve to. | \`{ type: 'constant', names: ['NULL', 'NA'], value: null }\` |
|
|
215
220
|
| \`function\` | Is a rather flexible way to define and bind built-in functions. For the time, we do not have extensive documentation to cover all the cases, so please either consult the sources with the \`default-builtin-config.ts\` or open a [new issue](${doc_issue_1.NewIssueUrl}). | \`{ type: 'function', names: ['next'], processor: 'builtin:default', config: { cfg: ExitPointType.Next } }\` |
|
|
216
221
|
| \`replacement\` | A comfortable way to specify replacement functions like \`$<-\` or \`names<-\`. \`suffixes\` describes the... suffixes to attach automatically. | \`{ type: 'replacement', suffixes: ['<-', '<<-'], names: ['[', '[['] }\` |
|
|
@@ -25,6 +25,7 @@ const doc_cli_option_1 = require("./doc-util/doc-cli-option");
|
|
|
25
25
|
const doc_issue_1 = require("./doc-util/doc-issue");
|
|
26
26
|
const location_map_query_executor_1 = require("../queries/catalog/location-map-query/location-map-query-executor");
|
|
27
27
|
const identify_link_to_last_call_relation_1 = require("../queries/catalog/call-context-query/identify-link-to-last-call-relation");
|
|
28
|
+
const config_query_executor_1 = require("../queries/catalog/config-query/config-query-executor");
|
|
28
29
|
(0, doc_query_1.registerQueryDocumentation)('call-context', {
|
|
29
30
|
name: 'Call-Context Query',
|
|
30
31
|
type: 'active',
|
|
@@ -208,6 +209,18 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
|
|
|
208
209
|
`;
|
|
209
210
|
}
|
|
210
211
|
});
|
|
212
|
+
(0, doc_query_1.registerQueryDocumentation)('config', {
|
|
213
|
+
name: 'Config Query',
|
|
214
|
+
type: 'active',
|
|
215
|
+
shortDescription: 'Returns the current configuration of flowR.',
|
|
216
|
+
functionName: config_query_executor_1.executeConfigQuery.name,
|
|
217
|
+
functionFile: '../queries/catalog/config-query/config-query-format.ts',
|
|
218
|
+
// eslint-disable-next-line @typescript-eslint/require-await -- no need for async here
|
|
219
|
+
buildExplanation: async () => {
|
|
220
|
+
return `
|
|
221
|
+
This query provides access to the current configuration of the flowR instance. See the [Interface](${doc_files_1.FlowrWikiBaseRef}/Interface) wiki page for more information on what the configuration represents.`;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
211
224
|
(0, doc_query_1.registerQueryDocumentation)('compound', {
|
|
212
225
|
name: 'Compound Query',
|
|
213
226
|
type: 'virtual',
|
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeConfigQuery = executeConfigQuery;
|
|
4
|
+
const log_1 = require("../../../util/log");
|
|
5
|
+
const config_1 = require("../../../config");
|
|
6
|
+
function executeConfigQuery(_, queries) {
|
|
7
|
+
if (queries.length !== 1) {
|
|
8
|
+
log_1.log.warn('Config query expects only up to one query, but got', queries.length);
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
'.meta': {
|
|
12
|
+
/* there is no sense in measuring a get */
|
|
13
|
+
timing: 0
|
|
14
|
+
},
|
|
15
|
+
config: (0, config_1.getConfig)()
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=config-query-executor.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
|
+
import { executeConfigQuery } from './config-query-executor';
|
|
3
|
+
import { type OutputFormatter } from '../../../util/ansi';
|
|
4
|
+
import Joi from 'joi';
|
|
5
|
+
import type { FlowrConfigOptions } from '../../../config';
|
|
6
|
+
export interface ConfigQuery extends BaseQueryFormat {
|
|
7
|
+
readonly type: 'config';
|
|
8
|
+
}
|
|
9
|
+
export interface ConfigQueryResult extends BaseQueryResult {
|
|
10
|
+
readonly config: FlowrConfigOptions;
|
|
11
|
+
}
|
|
12
|
+
export declare const ConfigQueryDefinition: {
|
|
13
|
+
readonly executor: typeof executeConfigQuery;
|
|
14
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, _processed: unknown, queryResults: BaseQueryResult, result: string[]) => boolean;
|
|
15
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
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.ConfigQueryDefinition = void 0;
|
|
7
|
+
const config_query_executor_1 = require("./config-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 json_1 = require("../../../util/json");
|
|
12
|
+
exports.ConfigQueryDefinition = {
|
|
13
|
+
executor: config_query_executor_1.executeConfigQuery,
|
|
14
|
+
asciiSummarizer: (formatter, _processed, queryResults, result) => {
|
|
15
|
+
const out = queryResults;
|
|
16
|
+
result.push(`Query: ${(0, ansi_1.bold)('config', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
17
|
+
result.push(` ╰ Config:\n${JSON.stringify(out.config, json_1.jsonReplacer, 4)}`);
|
|
18
|
+
return true;
|
|
19
|
+
},
|
|
20
|
+
schema: joi_1.default.object({
|
|
21
|
+
type: joi_1.default.string().valid('config').required().description('The type of the query.'),
|
|
22
|
+
}).description('The config query retrieves the current configuration of the flowR instance.')
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=config-query-format.js.map
|
|
@@ -19,6 +19,6 @@ exports.LocationMapQueryDefinition = {
|
|
|
19
19
|
},
|
|
20
20
|
schema: joi_1.default.object({
|
|
21
21
|
type: joi_1.default.string().valid('location-map').required().description('The type of the query.'),
|
|
22
|
-
}).description('The
|
|
22
|
+
}).description('The location map query retrieves the location of every id in the ast.')
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=location-map-query-format.js.map
|
package/queries/query.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ import type { PipelineOutput } from '../core/steps/pipeline/pipeline';
|
|
|
14
14
|
import type { DEFAULT_DATAFLOW_PIPELINE } from '../core/steps/pipeline/default-pipelines';
|
|
15
15
|
import Joi from 'joi';
|
|
16
16
|
import type { LocationMapQuery } from './catalog/location-map-query/location-map-query-format';
|
|
17
|
-
|
|
17
|
+
import type { ConfigQuery } from './catalog/config-query/config-query-format';
|
|
18
|
+
export type Query = CallContextQuery | ConfigQuery | DataflowQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | LineageQuery | DependenciesQuery | LocationMapQuery;
|
|
18
19
|
export type QueryArgumentsWithType<QueryType extends BaseQueryFormat['type']> = Query & {
|
|
19
20
|
type: QueryType;
|
|
20
21
|
};
|
|
@@ -33,6 +34,11 @@ export declare const SupportedQueries: {
|
|
|
33
34
|
readonly asciiSummarizer: (formatter: OutputFormatter, processed: PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>, queryResults: BaseQueryResult, result: string[]) => boolean;
|
|
34
35
|
readonly schema: Joi.ObjectSchema<any>;
|
|
35
36
|
};
|
|
37
|
+
readonly config: {
|
|
38
|
+
readonly executor: typeof import("./catalog/config-query/config-query-executor").executeConfigQuery;
|
|
39
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, _processed: unknown, queryResults: BaseQueryResult, result: string[]) => boolean;
|
|
40
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
41
|
+
};
|
|
36
42
|
readonly dataflow: {
|
|
37
43
|
readonly executor: typeof import("./catalog/dataflow-query/dataflow-query-executor").executeDataflowQuery;
|
|
38
44
|
readonly asciiSummarizer: (formatter: OutputFormatter, _processed: PipelineOutput<import("../core/steps/pipeline/pipeline").Pipeline<{
|
package/queries/query.js
CHANGED
|
@@ -22,8 +22,10 @@ const cluster_query_format_1 = require("./catalog/cluster-query/cluster-query-fo
|
|
|
22
22
|
const dependencies_query_format_1 = require("./catalog/dependencies-query/dependencies-query-format");
|
|
23
23
|
const joi_1 = __importDefault(require("joi"));
|
|
24
24
|
const location_map_query_format_1 = require("./catalog/location-map-query/location-map-query-format");
|
|
25
|
+
const config_query_format_1 = require("./catalog/config-query/config-query-format");
|
|
25
26
|
exports.SupportedQueries = {
|
|
26
27
|
'call-context': call_context_query_format_1.CallContextQueryDefinition,
|
|
28
|
+
'config': config_query_format_1.ConfigQueryDefinition,
|
|
27
29
|
'dataflow': dataflow_query_format_1.DataflowQueryDefinition,
|
|
28
30
|
'id-map': id_map_query_format_1.IdMapQueryDefinition,
|
|
29
31
|
'normalized-ast': normalized_ast_query_format_1.NormalizedAstQueryDefinition,
|
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.
|
|
6
|
+
const version = '2.1.11';
|
|
7
7
|
function flowrVersion() {
|
|
8
8
|
return new semver_1.SemVer(version);
|
|
9
9
|
}
|