@uipath/api-workflow-tool 1.203.0-preview.235 → 1.203.0-preview.237
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/dist/executor-tool.js +1 -1
- package/dist/{index-mvexz6qn.js → index-6qw86bsb.js} +225 -8
- package/dist/index.js +2 -2
- package/dist/{node-j64mtx6e.js → node-z6yvq9d2.js} +225 -8
- package/dist/{packager-tool-myc90a0t.js → packager-tool-csg2tez0.js} +225 -7
- package/dist/{packager-tool-bkadz0w5.js → packager-tool-gf0z0zya.js} +7 -7
- package/dist/tool.js +2 -2
- package/package.json +2 -2
package/dist/executor-tool.js
CHANGED
|
@@ -12877,7 +12877,165 @@ class FilterImplicitLimitError extends Error {
|
|
|
12877
12877
|
this.instructions = "Pass --limit <n> to choose how many records the filter applies to. " + "To filter over all records, pass the command's maximum accepted --limit (see the option's description in --help).";
|
|
12878
12878
|
}
|
|
12879
12879
|
}
|
|
12880
|
-
function
|
|
12880
|
+
function countRecords(data) {
|
|
12881
|
+
if (Array.isArray(data))
|
|
12882
|
+
return data.length;
|
|
12883
|
+
return data == null ? 0 : 1;
|
|
12884
|
+
}
|
|
12885
|
+
function availableFields(data) {
|
|
12886
|
+
const records = Array.isArray(data) ? data : [data];
|
|
12887
|
+
const keys = new Set;
|
|
12888
|
+
for (const record of records) {
|
|
12889
|
+
if (record && typeof record === "object" && !Array.isArray(record)) {
|
|
12890
|
+
for (const key of Object.keys(record))
|
|
12891
|
+
keys.add(key);
|
|
12892
|
+
}
|
|
12893
|
+
}
|
|
12894
|
+
return [...keys];
|
|
12895
|
+
}
|
|
12896
|
+
function decodeQuotedIdentifier(whole, inner) {
|
|
12897
|
+
const [error, decoded] = catchError(() => JSON.parse(whole));
|
|
12898
|
+
if (!error && typeof decoded === "string")
|
|
12899
|
+
return decoded;
|
|
12900
|
+
return inner.replace(/\\(.)/g, "$1");
|
|
12901
|
+
}
|
|
12902
|
+
function referencedFields(filter) {
|
|
12903
|
+
const top = new Set;
|
|
12904
|
+
const nested = new Set;
|
|
12905
|
+
const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
|
|
12906
|
+
const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
|
|
12907
|
+
const quoted = [];
|
|
12908
|
+
const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
|
|
12909
|
+
const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
|
|
12910
|
+
if (!isAlias) {
|
|
12911
|
+
quoted.push({
|
|
12912
|
+
name: decodeQuotedIdentifier(whole, name),
|
|
12913
|
+
index,
|
|
12914
|
+
tail: isPathTail(withoutValueLiterals, index)
|
|
12915
|
+
});
|
|
12916
|
+
}
|
|
12917
|
+
return `"${" ".repeat(whole.length - 2)}"`;
|
|
12918
|
+
});
|
|
12919
|
+
const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
|
|
12920
|
+
const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
|
|
12921
|
+
const place = (name, index, tail) => {
|
|
12922
|
+
if (tail || index >= rootEnd)
|
|
12923
|
+
nested.add(name);
|
|
12924
|
+
else
|
|
12925
|
+
top.add(name);
|
|
12926
|
+
};
|
|
12927
|
+
for (const entry of quoted)
|
|
12928
|
+
place(entry.name, entry.index, entry.tail);
|
|
12929
|
+
const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
|
|
12930
|
+
const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
|
|
12931
|
+
for (const match of identifiers) {
|
|
12932
|
+
const [, name, trailing] = match;
|
|
12933
|
+
if (trailing || reserved.has(name))
|
|
12934
|
+
continue;
|
|
12935
|
+
place(name, match.index, isPathTail(withoutLiterals, match.index));
|
|
12936
|
+
}
|
|
12937
|
+
return {
|
|
12938
|
+
top: [...top],
|
|
12939
|
+
nested: [...nested].filter((name) => !top.has(name)),
|
|
12940
|
+
hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
|
|
12941
|
+
};
|
|
12942
|
+
}
|
|
12943
|
+
function appearsBelowTopLevel(data, name) {
|
|
12944
|
+
let budget = 2000;
|
|
12945
|
+
const visit = (value, depth) => {
|
|
12946
|
+
if (budget-- <= 0 || depth > 4)
|
|
12947
|
+
return false;
|
|
12948
|
+
if (value === null || typeof value !== "object")
|
|
12949
|
+
return false;
|
|
12950
|
+
if (Array.isArray(value))
|
|
12951
|
+
return value.some((entry) => visit(entry, depth));
|
|
12952
|
+
const record = value;
|
|
12953
|
+
if (depth > 0 && Object.hasOwn(record, name))
|
|
12954
|
+
return true;
|
|
12955
|
+
return Object.values(record).some((entry) => visit(entry, depth + 1));
|
|
12956
|
+
};
|
|
12957
|
+
return visit(data, 0);
|
|
12958
|
+
}
|
|
12959
|
+
function alwaysNullKeys(records) {
|
|
12960
|
+
const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
|
|
12961
|
+
if (objects.length === 0 || objects.length !== records.length)
|
|
12962
|
+
return [];
|
|
12963
|
+
const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
|
|
12964
|
+
if (keys.length === 0)
|
|
12965
|
+
return [];
|
|
12966
|
+
const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
|
|
12967
|
+
return nullKeys.length === keys.length ? nullKeys : [];
|
|
12968
|
+
}
|
|
12969
|
+
function carriesOnlyNulls(value) {
|
|
12970
|
+
if (value === null)
|
|
12971
|
+
return true;
|
|
12972
|
+
if (Array.isArray(value)) {
|
|
12973
|
+
return value.length > 0 && value.every(carriesOnlyNulls);
|
|
12974
|
+
}
|
|
12975
|
+
if (typeof value === "object" && value !== undefined) {
|
|
12976
|
+
const values = Object.values(value);
|
|
12977
|
+
return values.length > 0 && values.every(carriesOnlyNulls);
|
|
12978
|
+
}
|
|
12979
|
+
return false;
|
|
12980
|
+
}
|
|
12981
|
+
function nameList(names, cap2 = 12) {
|
|
12982
|
+
const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
|
|
12983
|
+
const rest = names.length - shown.length;
|
|
12984
|
+
return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
12985
|
+
}
|
|
12986
|
+
function buildFilterWarning(filter, data, outcome) {
|
|
12987
|
+
const present = availableFields(data);
|
|
12988
|
+
const refs = referencedFields(filter);
|
|
12989
|
+
const unknown2 = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
|
|
12990
|
+
const unchecked = refs.nested.filter((name) => !present.includes(name));
|
|
12991
|
+
const count = countRecords(data);
|
|
12992
|
+
const scope = `${count} record(s)`;
|
|
12993
|
+
const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
|
|
12994
|
+
const soundness = unchecked.length > 0 ? `${nameList(unchecked)} ${unchecked.length === 1 ? "reads" : "read"} below the top level, so ${unchecked.length === 1 ? "it was" : "they were"} not checked against the record keys` : refs.top.length > 0 ? "every field it names exists" : "";
|
|
12995
|
+
const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
|
|
12996
|
+
let detail;
|
|
12997
|
+
let lede;
|
|
12998
|
+
if (outcome.kind === "null-elements") {
|
|
12999
|
+
lede = "returned only null values";
|
|
13000
|
+
const projected = `all ${outcome.count} of the elements it projected are null`;
|
|
13001
|
+
if (unknown2.length > 0) {
|
|
13002
|
+
detail = `${projected}, because ${isNotAField(unknown2)}`;
|
|
13003
|
+
} else if (unchecked.length > 0) {
|
|
13004
|
+
detail = withSoundness(projected);
|
|
13005
|
+
} else {
|
|
13006
|
+
detail = `${projected}, and every field it names exists — a multi-select list ` + `(\`[A, B]\`) reads each entry against \`Data\` itself, so on a list ` + `result use \`[].[A, B]\` or \`[].{a: A, b: B}\` to read the records`;
|
|
13007
|
+
}
|
|
13008
|
+
} else if (outcome.kind === "null-rows") {
|
|
13009
|
+
lede = "returned only null values";
|
|
13010
|
+
const projected = `every value it projected is null on all ${outcome.count} row(s)`;
|
|
13011
|
+
detail = unknown2.length > 0 ? `${projected}, because ${isNotAField(unknown2)}` : withSoundness(projected);
|
|
13012
|
+
} else if (outcome.kind === "null-values") {
|
|
13013
|
+
lede = "returned only null values";
|
|
13014
|
+
const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
|
|
13015
|
+
const sameSet = unknown2.length === outcome.keys.length && outcome.keys.every((k) => unknown2.includes(k));
|
|
13016
|
+
if (sameSet) {
|
|
13017
|
+
detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
|
|
13018
|
+
} else if (unknown2.length > 0) {
|
|
13019
|
+
detail = `${projected}, because ${isNotAField(unknown2)}`;
|
|
13020
|
+
} else {
|
|
13021
|
+
detail = withSoundness(`${projected} on all ${scope}`);
|
|
13022
|
+
}
|
|
13023
|
+
} else {
|
|
13024
|
+
lede = "returned nothing";
|
|
13025
|
+
if (unknown2.length > 0) {
|
|
13026
|
+
detail = isNotAField(unknown2);
|
|
13027
|
+
} else {
|
|
13028
|
+
const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
|
|
13029
|
+
detail = withSoundness(`${selection} — it read ${scope}`);
|
|
13030
|
+
}
|
|
13031
|
+
}
|
|
13032
|
+
const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
|
|
13033
|
+
return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
|
|
13034
|
+
}
|
|
13035
|
+
function appendWarning(existing, note) {
|
|
13036
|
+
return existing ? `${existing} ${note}` : note;
|
|
13037
|
+
}
|
|
13038
|
+
function applyFilter(data, filter, onWarning) {
|
|
12881
13039
|
const codec = requireJmespath();
|
|
12882
13040
|
let result;
|
|
12883
13041
|
try {
|
|
@@ -12885,9 +13043,34 @@ function applyFilter(data, filter) {
|
|
|
12885
13043
|
} catch (err) {
|
|
12886
13044
|
throw new FilterEvaluationError(filter, err);
|
|
12887
13045
|
}
|
|
12888
|
-
|
|
13046
|
+
const inputCount = countRecords(data);
|
|
13047
|
+
const warn = (outcome) => {
|
|
13048
|
+
if (inputCount === 0)
|
|
13049
|
+
return;
|
|
13050
|
+
const note = buildFilterWarning(filter, data, outcome);
|
|
13051
|
+
getOutputSink().writeErr(`[WARN] ${note}
|
|
13052
|
+
`);
|
|
13053
|
+
onWarning?.(note);
|
|
13054
|
+
};
|
|
13055
|
+
const warnIfAllNull = (records) => {
|
|
13056
|
+
const keys = alwaysNullKeys(records);
|
|
13057
|
+
if (keys.length > 0)
|
|
13058
|
+
warn({ kind: "null-values", keys });
|
|
13059
|
+
};
|
|
13060
|
+
if (result == null) {
|
|
13061
|
+
warn({ kind: "empty" });
|
|
12889
13062
|
return [];
|
|
13063
|
+
}
|
|
12890
13064
|
if (Array.isArray(result)) {
|
|
13065
|
+
if (result.length === 0) {
|
|
13066
|
+
warn({ kind: "empty" });
|
|
13067
|
+
} else if (result.every((entry) => entry === null)) {
|
|
13068
|
+
warn({ kind: "null-elements", count: result.length });
|
|
13069
|
+
} else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
|
|
13070
|
+
warn({ kind: "null-rows", count: result.length });
|
|
13071
|
+
} else {
|
|
13072
|
+
warnIfAllNull(result);
|
|
13073
|
+
}
|
|
12891
13074
|
if (result.length > 0 && typeof result[0] !== "object") {
|
|
12892
13075
|
const fieldMatch = filter.match(/\.(\w+)$/);
|
|
12893
13076
|
const key = fieldMatch ? fieldMatch[1] : "Value";
|
|
@@ -12895,10 +13078,30 @@ function applyFilter(data, filter) {
|
|
|
12895
13078
|
}
|
|
12896
13079
|
return result;
|
|
12897
13080
|
}
|
|
12898
|
-
if (typeof result === "object")
|
|
13081
|
+
if (typeof result === "object") {
|
|
13082
|
+
warnIfAllNull([result]);
|
|
12899
13083
|
return result;
|
|
13084
|
+
}
|
|
12900
13085
|
return { Value: result };
|
|
12901
13086
|
}
|
|
13087
|
+
function filterFailureData(envelope) {
|
|
13088
|
+
const filter = getOutputFilter();
|
|
13089
|
+
const data = envelope.Data;
|
|
13090
|
+
if (!filter || data == null)
|
|
13091
|
+
return;
|
|
13092
|
+
let note;
|
|
13093
|
+
const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
|
|
13094
|
+
note = n;
|
|
13095
|
+
}));
|
|
13096
|
+
if (filterError) {
|
|
13097
|
+
envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
|
|
13098
|
+
return;
|
|
13099
|
+
}
|
|
13100
|
+
envelope.Data = filtered;
|
|
13101
|
+
if (note) {
|
|
13102
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
13103
|
+
}
|
|
13104
|
+
}
|
|
12902
13105
|
function defaultErrorCodeForResult(result) {
|
|
12903
13106
|
switch (result) {
|
|
12904
13107
|
case RESULTS.AuthenticationError:
|
|
@@ -12981,8 +13184,14 @@ var OutputFormatter;
|
|
|
12981
13184
|
}
|
|
12982
13185
|
const filter = getOutputFilter();
|
|
12983
13186
|
if (filter) {
|
|
12984
|
-
|
|
13187
|
+
let note;
|
|
13188
|
+
const filtered = applyFilter(data.Data, filter, (n) => {
|
|
13189
|
+
note = n;
|
|
13190
|
+
});
|
|
12985
13191
|
data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
|
|
13192
|
+
if (note) {
|
|
13193
|
+
data.Warning = appendWarning(data.Warning, note);
|
|
13194
|
+
}
|
|
12986
13195
|
}
|
|
12987
13196
|
logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
|
|
12988
13197
|
}
|
|
@@ -13010,6 +13219,7 @@ var OutputFormatter;
|
|
|
13010
13219
|
delete envelope.TelemetryErrorClass;
|
|
13011
13220
|
delete envelope.TelemetryTerminalOutcome;
|
|
13012
13221
|
delete envelope.TelemetryTerminalSignal;
|
|
13222
|
+
filterFailureData(envelope);
|
|
13013
13223
|
if (!suppressTelemetry) {
|
|
13014
13224
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
13015
13225
|
result: data.Result,
|
|
@@ -13058,13 +13268,20 @@ var OutputFormatter;
|
|
|
13058
13268
|
OutputFormatter2.log = log;
|
|
13059
13269
|
function formatToString(data) {
|
|
13060
13270
|
const filter = getOutputFilter();
|
|
13271
|
+
const envelope = data;
|
|
13061
13272
|
if ("Data" in data && data.Data != null) {
|
|
13062
13273
|
data.Data = normalizeDataKeys(data.Data);
|
|
13063
13274
|
if (filter) {
|
|
13064
|
-
|
|
13275
|
+
let note;
|
|
13276
|
+
data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
|
|
13277
|
+
note = n;
|
|
13278
|
+
}));
|
|
13279
|
+
if (note) {
|
|
13280
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
13281
|
+
}
|
|
13065
13282
|
}
|
|
13066
13283
|
}
|
|
13067
|
-
const output = normalizeOutputKeys(
|
|
13284
|
+
const output = normalizeOutputKeys(envelope);
|
|
13068
13285
|
const lines = [];
|
|
13069
13286
|
const sink = getOutputSink();
|
|
13070
13287
|
printOutput(output, getOutputFormat(), (msg) => {
|
|
@@ -14157,7 +14374,7 @@ var package_default = {
|
|
|
14157
14374
|
name: "@uipath/project-packager",
|
|
14158
14375
|
author: "UiPath",
|
|
14159
14376
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
14160
|
-
version: "1.203.0-preview.
|
|
14377
|
+
version: "1.203.0-preview.237",
|
|
14161
14378
|
description: "UiPath Project Packager - core library for packing individual UiPath projects",
|
|
14162
14379
|
type: "module",
|
|
14163
14380
|
main: "./dist/index.js",
|
|
@@ -15471,4 +15688,4 @@ export {
|
|
|
15471
15688
|
signNupkgsAsync
|
|
15472
15689
|
};
|
|
15473
15690
|
|
|
15474
|
-
//# debugId=
|
|
15691
|
+
//# debugId=81AE4BCC4A3632F664756E2164756E21
|
package/dist/index.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
metadata,
|
|
4
4
|
registerCommands
|
|
5
|
-
} from "./packager-tool-
|
|
5
|
+
} from "./packager-tool-gf0z0zya.js";
|
|
6
6
|
import"./packager-tool-k9wheprx.js";
|
|
7
7
|
import"./packager-tool-6se0wnbx.js";
|
|
8
8
|
import {
|
|
9
9
|
Command
|
|
10
|
-
} from "./packager-tool-
|
|
10
|
+
} from "./packager-tool-csg2tez0.js";
|
|
11
11
|
import"./packager-tool-d3w0wn6k.js";
|
|
12
12
|
import"./packager-tool-1de529jm.js";
|
|
13
13
|
|
|
@@ -12212,7 +12212,165 @@ class FilterImplicitLimitError extends Error {
|
|
|
12212
12212
|
this.instructions = "Pass --limit <n> to choose how many records the filter applies to. " + "To filter over all records, pass the command's maximum accepted --limit (see the option's description in --help).";
|
|
12213
12213
|
}
|
|
12214
12214
|
}
|
|
12215
|
-
function
|
|
12215
|
+
function countRecords(data) {
|
|
12216
|
+
if (Array.isArray(data))
|
|
12217
|
+
return data.length;
|
|
12218
|
+
return data == null ? 0 : 1;
|
|
12219
|
+
}
|
|
12220
|
+
function availableFields(data) {
|
|
12221
|
+
const records = Array.isArray(data) ? data : [data];
|
|
12222
|
+
const keys = new Set;
|
|
12223
|
+
for (const record of records) {
|
|
12224
|
+
if (record && typeof record === "object" && !Array.isArray(record)) {
|
|
12225
|
+
for (const key of Object.keys(record))
|
|
12226
|
+
keys.add(key);
|
|
12227
|
+
}
|
|
12228
|
+
}
|
|
12229
|
+
return [...keys];
|
|
12230
|
+
}
|
|
12231
|
+
function decodeQuotedIdentifier(whole, inner) {
|
|
12232
|
+
const [error, decoded] = catchError(() => JSON.parse(whole));
|
|
12233
|
+
if (!error && typeof decoded === "string")
|
|
12234
|
+
return decoded;
|
|
12235
|
+
return inner.replace(/\\(.)/g, "$1");
|
|
12236
|
+
}
|
|
12237
|
+
function referencedFields(filter) {
|
|
12238
|
+
const top = new Set;
|
|
12239
|
+
const nested = new Set;
|
|
12240
|
+
const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
|
|
12241
|
+
const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
|
|
12242
|
+
const quoted = [];
|
|
12243
|
+
const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
|
|
12244
|
+
const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
|
|
12245
|
+
if (!isAlias) {
|
|
12246
|
+
quoted.push({
|
|
12247
|
+
name: decodeQuotedIdentifier(whole, name),
|
|
12248
|
+
index,
|
|
12249
|
+
tail: isPathTail(withoutValueLiterals, index)
|
|
12250
|
+
});
|
|
12251
|
+
}
|
|
12252
|
+
return `"${" ".repeat(whole.length - 2)}"`;
|
|
12253
|
+
});
|
|
12254
|
+
const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
|
|
12255
|
+
const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
|
|
12256
|
+
const place = (name, index, tail) => {
|
|
12257
|
+
if (tail || index >= rootEnd)
|
|
12258
|
+
nested.add(name);
|
|
12259
|
+
else
|
|
12260
|
+
top.add(name);
|
|
12261
|
+
};
|
|
12262
|
+
for (const entry of quoted)
|
|
12263
|
+
place(entry.name, entry.index, entry.tail);
|
|
12264
|
+
const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
|
|
12265
|
+
const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
|
|
12266
|
+
for (const match of identifiers) {
|
|
12267
|
+
const [, name, trailing] = match;
|
|
12268
|
+
if (trailing || reserved.has(name))
|
|
12269
|
+
continue;
|
|
12270
|
+
place(name, match.index, isPathTail(withoutLiterals, match.index));
|
|
12271
|
+
}
|
|
12272
|
+
return {
|
|
12273
|
+
top: [...top],
|
|
12274
|
+
nested: [...nested].filter((name) => !top.has(name)),
|
|
12275
|
+
hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
|
|
12276
|
+
};
|
|
12277
|
+
}
|
|
12278
|
+
function appearsBelowTopLevel(data, name) {
|
|
12279
|
+
let budget = 2000;
|
|
12280
|
+
const visit = (value, depth) => {
|
|
12281
|
+
if (budget-- <= 0 || depth > 4)
|
|
12282
|
+
return false;
|
|
12283
|
+
if (value === null || typeof value !== "object")
|
|
12284
|
+
return false;
|
|
12285
|
+
if (Array.isArray(value))
|
|
12286
|
+
return value.some((entry) => visit(entry, depth));
|
|
12287
|
+
const record = value;
|
|
12288
|
+
if (depth > 0 && Object.hasOwn(record, name))
|
|
12289
|
+
return true;
|
|
12290
|
+
return Object.values(record).some((entry) => visit(entry, depth + 1));
|
|
12291
|
+
};
|
|
12292
|
+
return visit(data, 0);
|
|
12293
|
+
}
|
|
12294
|
+
function alwaysNullKeys(records) {
|
|
12295
|
+
const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
|
|
12296
|
+
if (objects.length === 0 || objects.length !== records.length)
|
|
12297
|
+
return [];
|
|
12298
|
+
const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
|
|
12299
|
+
if (keys.length === 0)
|
|
12300
|
+
return [];
|
|
12301
|
+
const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
|
|
12302
|
+
return nullKeys.length === keys.length ? nullKeys : [];
|
|
12303
|
+
}
|
|
12304
|
+
function carriesOnlyNulls(value) {
|
|
12305
|
+
if (value === null)
|
|
12306
|
+
return true;
|
|
12307
|
+
if (Array.isArray(value)) {
|
|
12308
|
+
return value.length > 0 && value.every(carriesOnlyNulls);
|
|
12309
|
+
}
|
|
12310
|
+
if (typeof value === "object" && value !== undefined) {
|
|
12311
|
+
const values = Object.values(value);
|
|
12312
|
+
return values.length > 0 && values.every(carriesOnlyNulls);
|
|
12313
|
+
}
|
|
12314
|
+
return false;
|
|
12315
|
+
}
|
|
12316
|
+
function nameList(names, cap2 = 12) {
|
|
12317
|
+
const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
|
|
12318
|
+
const rest = names.length - shown.length;
|
|
12319
|
+
return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
12320
|
+
}
|
|
12321
|
+
function buildFilterWarning(filter, data, outcome) {
|
|
12322
|
+
const present = availableFields(data);
|
|
12323
|
+
const refs = referencedFields(filter);
|
|
12324
|
+
const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
|
|
12325
|
+
const unchecked = refs.nested.filter((name) => !present.includes(name));
|
|
12326
|
+
const count = countRecords(data);
|
|
12327
|
+
const scope = `${count} record(s)`;
|
|
12328
|
+
const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
|
|
12329
|
+
const soundness = unchecked.length > 0 ? `${nameList(unchecked)} ${unchecked.length === 1 ? "reads" : "read"} below the top level, so ${unchecked.length === 1 ? "it was" : "they were"} not checked against the record keys` : refs.top.length > 0 ? "every field it names exists" : "";
|
|
12330
|
+
const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
|
|
12331
|
+
let detail;
|
|
12332
|
+
let lede;
|
|
12333
|
+
if (outcome.kind === "null-elements") {
|
|
12334
|
+
lede = "returned only null values";
|
|
12335
|
+
const projected = `all ${outcome.count} of the elements it projected are null`;
|
|
12336
|
+
if (unknown.length > 0) {
|
|
12337
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
12338
|
+
} else if (unchecked.length > 0) {
|
|
12339
|
+
detail = withSoundness(projected);
|
|
12340
|
+
} else {
|
|
12341
|
+
detail = `${projected}, and every field it names exists — a multi-select list ` + `(\`[A, B]\`) reads each entry against \`Data\` itself, so on a list ` + `result use \`[].[A, B]\` or \`[].{a: A, b: B}\` to read the records`;
|
|
12342
|
+
}
|
|
12343
|
+
} else if (outcome.kind === "null-rows") {
|
|
12344
|
+
lede = "returned only null values";
|
|
12345
|
+
const projected = `every value it projected is null on all ${outcome.count} row(s)`;
|
|
12346
|
+
detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
|
|
12347
|
+
} else if (outcome.kind === "null-values") {
|
|
12348
|
+
lede = "returned only null values";
|
|
12349
|
+
const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
|
|
12350
|
+
const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
|
|
12351
|
+
if (sameSet) {
|
|
12352
|
+
detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
|
|
12353
|
+
} else if (unknown.length > 0) {
|
|
12354
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
12355
|
+
} else {
|
|
12356
|
+
detail = withSoundness(`${projected} on all ${scope}`);
|
|
12357
|
+
}
|
|
12358
|
+
} else {
|
|
12359
|
+
lede = "returned nothing";
|
|
12360
|
+
if (unknown.length > 0) {
|
|
12361
|
+
detail = isNotAField(unknown);
|
|
12362
|
+
} else {
|
|
12363
|
+
const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
|
|
12364
|
+
detail = withSoundness(`${selection} — it read ${scope}`);
|
|
12365
|
+
}
|
|
12366
|
+
}
|
|
12367
|
+
const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
|
|
12368
|
+
return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
|
|
12369
|
+
}
|
|
12370
|
+
function appendWarning(existing, note) {
|
|
12371
|
+
return existing ? `${existing} ${note}` : note;
|
|
12372
|
+
}
|
|
12373
|
+
function applyFilter(data, filter, onWarning) {
|
|
12216
12374
|
const codec = requireJmespath();
|
|
12217
12375
|
let result;
|
|
12218
12376
|
try {
|
|
@@ -12220,9 +12378,34 @@ function applyFilter(data, filter) {
|
|
|
12220
12378
|
} catch (err) {
|
|
12221
12379
|
throw new FilterEvaluationError(filter, err);
|
|
12222
12380
|
}
|
|
12223
|
-
|
|
12381
|
+
const inputCount = countRecords(data);
|
|
12382
|
+
const warn = (outcome) => {
|
|
12383
|
+
if (inputCount === 0)
|
|
12384
|
+
return;
|
|
12385
|
+
const note = buildFilterWarning(filter, data, outcome);
|
|
12386
|
+
getOutputSink().writeErr(`[WARN] ${note}
|
|
12387
|
+
`);
|
|
12388
|
+
onWarning?.(note);
|
|
12389
|
+
};
|
|
12390
|
+
const warnIfAllNull = (records) => {
|
|
12391
|
+
const keys = alwaysNullKeys(records);
|
|
12392
|
+
if (keys.length > 0)
|
|
12393
|
+
warn({ kind: "null-values", keys });
|
|
12394
|
+
};
|
|
12395
|
+
if (result == null) {
|
|
12396
|
+
warn({ kind: "empty" });
|
|
12224
12397
|
return [];
|
|
12398
|
+
}
|
|
12225
12399
|
if (Array.isArray(result)) {
|
|
12400
|
+
if (result.length === 0) {
|
|
12401
|
+
warn({ kind: "empty" });
|
|
12402
|
+
} else if (result.every((entry) => entry === null)) {
|
|
12403
|
+
warn({ kind: "null-elements", count: result.length });
|
|
12404
|
+
} else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
|
|
12405
|
+
warn({ kind: "null-rows", count: result.length });
|
|
12406
|
+
} else {
|
|
12407
|
+
warnIfAllNull(result);
|
|
12408
|
+
}
|
|
12226
12409
|
if (result.length > 0 && typeof result[0] !== "object") {
|
|
12227
12410
|
const fieldMatch = filter.match(/\.(\w+)$/);
|
|
12228
12411
|
const key = fieldMatch ? fieldMatch[1] : "Value";
|
|
@@ -12230,10 +12413,30 @@ function applyFilter(data, filter) {
|
|
|
12230
12413
|
}
|
|
12231
12414
|
return result;
|
|
12232
12415
|
}
|
|
12233
|
-
if (typeof result === "object")
|
|
12416
|
+
if (typeof result === "object") {
|
|
12417
|
+
warnIfAllNull([result]);
|
|
12234
12418
|
return result;
|
|
12419
|
+
}
|
|
12235
12420
|
return { Value: result };
|
|
12236
12421
|
}
|
|
12422
|
+
function filterFailureData(envelope) {
|
|
12423
|
+
const filter = getOutputFilter();
|
|
12424
|
+
const data = envelope.Data;
|
|
12425
|
+
if (!filter || data == null)
|
|
12426
|
+
return;
|
|
12427
|
+
let note;
|
|
12428
|
+
const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
|
|
12429
|
+
note = n;
|
|
12430
|
+
}));
|
|
12431
|
+
if (filterError) {
|
|
12432
|
+
envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
|
|
12433
|
+
return;
|
|
12434
|
+
}
|
|
12435
|
+
envelope.Data = filtered;
|
|
12436
|
+
if (note) {
|
|
12437
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
12438
|
+
}
|
|
12439
|
+
}
|
|
12237
12440
|
function defaultErrorCodeForResult(result) {
|
|
12238
12441
|
switch (result) {
|
|
12239
12442
|
case RESULTS.AuthenticationError:
|
|
@@ -12316,8 +12519,14 @@ var OutputFormatter;
|
|
|
12316
12519
|
}
|
|
12317
12520
|
const filter = getOutputFilter();
|
|
12318
12521
|
if (filter) {
|
|
12319
|
-
|
|
12522
|
+
let note;
|
|
12523
|
+
const filtered = applyFilter(data.Data, filter, (n) => {
|
|
12524
|
+
note = n;
|
|
12525
|
+
});
|
|
12320
12526
|
data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
|
|
12527
|
+
if (note) {
|
|
12528
|
+
data.Warning = appendWarning(data.Warning, note);
|
|
12529
|
+
}
|
|
12321
12530
|
}
|
|
12322
12531
|
logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
|
|
12323
12532
|
}
|
|
@@ -12345,6 +12554,7 @@ var OutputFormatter;
|
|
|
12345
12554
|
delete envelope.TelemetryErrorClass;
|
|
12346
12555
|
delete envelope.TelemetryTerminalOutcome;
|
|
12347
12556
|
delete envelope.TelemetryTerminalSignal;
|
|
12557
|
+
filterFailureData(envelope);
|
|
12348
12558
|
if (!suppressTelemetry) {
|
|
12349
12559
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
12350
12560
|
result: data.Result,
|
|
@@ -12393,13 +12603,20 @@ var OutputFormatter;
|
|
|
12393
12603
|
OutputFormatter2.log = log;
|
|
12394
12604
|
function formatToString(data) {
|
|
12395
12605
|
const filter = getOutputFilter();
|
|
12606
|
+
const envelope = data;
|
|
12396
12607
|
if ("Data" in data && data.Data != null) {
|
|
12397
12608
|
data.Data = normalizeDataKeys(data.Data);
|
|
12398
12609
|
if (filter) {
|
|
12399
|
-
|
|
12610
|
+
let note;
|
|
12611
|
+
data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
|
|
12612
|
+
note = n;
|
|
12613
|
+
}));
|
|
12614
|
+
if (note) {
|
|
12615
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
12616
|
+
}
|
|
12400
12617
|
}
|
|
12401
12618
|
}
|
|
12402
|
-
const output = normalizeOutputKeys(
|
|
12619
|
+
const output = normalizeOutputKeys(envelope);
|
|
12403
12620
|
const lines = [];
|
|
12404
12621
|
const sink = getOutputSink();
|
|
12405
12622
|
printOutput(output, getOutputFormat(), (msg) => {
|
|
@@ -14940,7 +15157,7 @@ var package_default = {
|
|
|
14940
15157
|
name: "@uipath/project-packager",
|
|
14941
15158
|
author: "UiPath",
|
|
14942
15159
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
14943
|
-
version: "1.203.0-preview.
|
|
15160
|
+
version: "1.203.0-preview.237",
|
|
14944
15161
|
description: "UiPath Project Packager - core library for packing individual UiPath projects",
|
|
14945
15162
|
type: "module",
|
|
14946
15163
|
main: "./dist/index.js",
|
|
@@ -16489,4 +16706,4 @@ export {
|
|
|
16489
16706
|
signNupkgsAsync
|
|
16490
16707
|
};
|
|
16491
16708
|
|
|
16492
|
-
//# debugId=
|
|
16709
|
+
//# debugId=DD5EE320BF47E69064756E2164756E21
|
|
@@ -29560,6 +29560,7 @@ class SuccessOutput {
|
|
|
29560
29560
|
Data;
|
|
29561
29561
|
Pagination;
|
|
29562
29562
|
Instructions;
|
|
29563
|
+
Warning;
|
|
29563
29564
|
Log;
|
|
29564
29565
|
constructor(code, data) {
|
|
29565
29566
|
this.Code = code;
|
|
@@ -30178,7 +30179,165 @@ class FilterImplicitLimitError extends Error {
|
|
|
30178
30179
|
this.instructions = "Pass --limit <n> to choose how many records the filter applies to. " + "To filter over all records, pass the command's maximum accepted --limit (see the option's description in --help).";
|
|
30179
30180
|
}
|
|
30180
30181
|
}
|
|
30181
|
-
function
|
|
30182
|
+
function countRecords(data) {
|
|
30183
|
+
if (Array.isArray(data))
|
|
30184
|
+
return data.length;
|
|
30185
|
+
return data == null ? 0 : 1;
|
|
30186
|
+
}
|
|
30187
|
+
function availableFields(data) {
|
|
30188
|
+
const records = Array.isArray(data) ? data : [data];
|
|
30189
|
+
const keys = new Set;
|
|
30190
|
+
for (const record of records) {
|
|
30191
|
+
if (record && typeof record === "object" && !Array.isArray(record)) {
|
|
30192
|
+
for (const key of Object.keys(record))
|
|
30193
|
+
keys.add(key);
|
|
30194
|
+
}
|
|
30195
|
+
}
|
|
30196
|
+
return [...keys];
|
|
30197
|
+
}
|
|
30198
|
+
function decodeQuotedIdentifier(whole, inner) {
|
|
30199
|
+
const [error, decoded] = catchError(() => JSON.parse(whole));
|
|
30200
|
+
if (!error && typeof decoded === "string")
|
|
30201
|
+
return decoded;
|
|
30202
|
+
return inner.replace(/\\(.)/g, "$1");
|
|
30203
|
+
}
|
|
30204
|
+
function referencedFields(filter) {
|
|
30205
|
+
const top = new Set;
|
|
30206
|
+
const nested = new Set;
|
|
30207
|
+
const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
|
|
30208
|
+
const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
|
|
30209
|
+
const quoted = [];
|
|
30210
|
+
const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
|
|
30211
|
+
const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
|
|
30212
|
+
if (!isAlias) {
|
|
30213
|
+
quoted.push({
|
|
30214
|
+
name: decodeQuotedIdentifier(whole, name),
|
|
30215
|
+
index,
|
|
30216
|
+
tail: isPathTail(withoutValueLiterals, index)
|
|
30217
|
+
});
|
|
30218
|
+
}
|
|
30219
|
+
return `"${" ".repeat(whole.length - 2)}"`;
|
|
30220
|
+
});
|
|
30221
|
+
const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
|
|
30222
|
+
const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
|
|
30223
|
+
const place = (name, index, tail) => {
|
|
30224
|
+
if (tail || index >= rootEnd)
|
|
30225
|
+
nested.add(name);
|
|
30226
|
+
else
|
|
30227
|
+
top.add(name);
|
|
30228
|
+
};
|
|
30229
|
+
for (const entry of quoted)
|
|
30230
|
+
place(entry.name, entry.index, entry.tail);
|
|
30231
|
+
const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
|
|
30232
|
+
const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
|
|
30233
|
+
for (const match of identifiers) {
|
|
30234
|
+
const [, name, trailing] = match;
|
|
30235
|
+
if (trailing || reserved.has(name))
|
|
30236
|
+
continue;
|
|
30237
|
+
place(name, match.index, isPathTail(withoutLiterals, match.index));
|
|
30238
|
+
}
|
|
30239
|
+
return {
|
|
30240
|
+
top: [...top],
|
|
30241
|
+
nested: [...nested].filter((name) => !top.has(name)),
|
|
30242
|
+
hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
|
|
30243
|
+
};
|
|
30244
|
+
}
|
|
30245
|
+
function appearsBelowTopLevel(data, name) {
|
|
30246
|
+
let budget = 2000;
|
|
30247
|
+
const visit = (value, depth) => {
|
|
30248
|
+
if (budget-- <= 0 || depth > 4)
|
|
30249
|
+
return false;
|
|
30250
|
+
if (value === null || typeof value !== "object")
|
|
30251
|
+
return false;
|
|
30252
|
+
if (Array.isArray(value))
|
|
30253
|
+
return value.some((entry) => visit(entry, depth));
|
|
30254
|
+
const record = value;
|
|
30255
|
+
if (depth > 0 && Object.hasOwn(record, name))
|
|
30256
|
+
return true;
|
|
30257
|
+
return Object.values(record).some((entry) => visit(entry, depth + 1));
|
|
30258
|
+
};
|
|
30259
|
+
return visit(data, 0);
|
|
30260
|
+
}
|
|
30261
|
+
function alwaysNullKeys(records) {
|
|
30262
|
+
const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
|
|
30263
|
+
if (objects.length === 0 || objects.length !== records.length)
|
|
30264
|
+
return [];
|
|
30265
|
+
const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
|
|
30266
|
+
if (keys.length === 0)
|
|
30267
|
+
return [];
|
|
30268
|
+
const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
|
|
30269
|
+
return nullKeys.length === keys.length ? nullKeys : [];
|
|
30270
|
+
}
|
|
30271
|
+
function carriesOnlyNulls(value) {
|
|
30272
|
+
if (value === null)
|
|
30273
|
+
return true;
|
|
30274
|
+
if (Array.isArray(value)) {
|
|
30275
|
+
return value.length > 0 && value.every(carriesOnlyNulls);
|
|
30276
|
+
}
|
|
30277
|
+
if (typeof value === "object" && value !== undefined) {
|
|
30278
|
+
const values = Object.values(value);
|
|
30279
|
+
return values.length > 0 && values.every(carriesOnlyNulls);
|
|
30280
|
+
}
|
|
30281
|
+
return false;
|
|
30282
|
+
}
|
|
30283
|
+
function nameList(names, cap2 = 12) {
|
|
30284
|
+
const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
|
|
30285
|
+
const rest = names.length - shown.length;
|
|
30286
|
+
return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
30287
|
+
}
|
|
30288
|
+
function buildFilterWarning(filter, data, outcome) {
|
|
30289
|
+
const present = availableFields(data);
|
|
30290
|
+
const refs = referencedFields(filter);
|
|
30291
|
+
const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
|
|
30292
|
+
const unchecked = refs.nested.filter((name) => !present.includes(name));
|
|
30293
|
+
const count = countRecords(data);
|
|
30294
|
+
const scope = `${count} record(s)`;
|
|
30295
|
+
const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
|
|
30296
|
+
const soundness = unchecked.length > 0 ? `${nameList(unchecked)} ${unchecked.length === 1 ? "reads" : "read"} below the top level, so ${unchecked.length === 1 ? "it was" : "they were"} not checked against the record keys` : refs.top.length > 0 ? "every field it names exists" : "";
|
|
30297
|
+
const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
|
|
30298
|
+
let detail;
|
|
30299
|
+
let lede;
|
|
30300
|
+
if (outcome.kind === "null-elements") {
|
|
30301
|
+
lede = "returned only null values";
|
|
30302
|
+
const projected = `all ${outcome.count} of the elements it projected are null`;
|
|
30303
|
+
if (unknown.length > 0) {
|
|
30304
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
30305
|
+
} else if (unchecked.length > 0) {
|
|
30306
|
+
detail = withSoundness(projected);
|
|
30307
|
+
} else {
|
|
30308
|
+
detail = `${projected}, and every field it names exists — a multi-select list ` + `(\`[A, B]\`) reads each entry against \`Data\` itself, so on a list ` + `result use \`[].[A, B]\` or \`[].{a: A, b: B}\` to read the records`;
|
|
30309
|
+
}
|
|
30310
|
+
} else if (outcome.kind === "null-rows") {
|
|
30311
|
+
lede = "returned only null values";
|
|
30312
|
+
const projected = `every value it projected is null on all ${outcome.count} row(s)`;
|
|
30313
|
+
detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
|
|
30314
|
+
} else if (outcome.kind === "null-values") {
|
|
30315
|
+
lede = "returned only null values";
|
|
30316
|
+
const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
|
|
30317
|
+
const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
|
|
30318
|
+
if (sameSet) {
|
|
30319
|
+
detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
|
|
30320
|
+
} else if (unknown.length > 0) {
|
|
30321
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
30322
|
+
} else {
|
|
30323
|
+
detail = withSoundness(`${projected} on all ${scope}`);
|
|
30324
|
+
}
|
|
30325
|
+
} else {
|
|
30326
|
+
lede = "returned nothing";
|
|
30327
|
+
if (unknown.length > 0) {
|
|
30328
|
+
detail = isNotAField(unknown);
|
|
30329
|
+
} else {
|
|
30330
|
+
const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
|
|
30331
|
+
detail = withSoundness(`${selection} — it read ${scope}`);
|
|
30332
|
+
}
|
|
30333
|
+
}
|
|
30334
|
+
const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
|
|
30335
|
+
return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
|
|
30336
|
+
}
|
|
30337
|
+
function appendWarning(existing, note) {
|
|
30338
|
+
return existing ? `${existing} ${note}` : note;
|
|
30339
|
+
}
|
|
30340
|
+
function applyFilter(data, filter, onWarning) {
|
|
30182
30341
|
const codec = requireJmespath();
|
|
30183
30342
|
let result;
|
|
30184
30343
|
try {
|
|
@@ -30186,9 +30345,34 @@ function applyFilter(data, filter) {
|
|
|
30186
30345
|
} catch (err) {
|
|
30187
30346
|
throw new FilterEvaluationError(filter, err);
|
|
30188
30347
|
}
|
|
30189
|
-
|
|
30348
|
+
const inputCount = countRecords(data);
|
|
30349
|
+
const warn = (outcome) => {
|
|
30350
|
+
if (inputCount === 0)
|
|
30351
|
+
return;
|
|
30352
|
+
const note = buildFilterWarning(filter, data, outcome);
|
|
30353
|
+
getOutputSink().writeErr(`[WARN] ${note}
|
|
30354
|
+
`);
|
|
30355
|
+
onWarning?.(note);
|
|
30356
|
+
};
|
|
30357
|
+
const warnIfAllNull = (records) => {
|
|
30358
|
+
const keys = alwaysNullKeys(records);
|
|
30359
|
+
if (keys.length > 0)
|
|
30360
|
+
warn({ kind: "null-values", keys });
|
|
30361
|
+
};
|
|
30362
|
+
if (result == null) {
|
|
30363
|
+
warn({ kind: "empty" });
|
|
30190
30364
|
return [];
|
|
30365
|
+
}
|
|
30191
30366
|
if (Array.isArray(result)) {
|
|
30367
|
+
if (result.length === 0) {
|
|
30368
|
+
warn({ kind: "empty" });
|
|
30369
|
+
} else if (result.every((entry) => entry === null)) {
|
|
30370
|
+
warn({ kind: "null-elements", count: result.length });
|
|
30371
|
+
} else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
|
|
30372
|
+
warn({ kind: "null-rows", count: result.length });
|
|
30373
|
+
} else {
|
|
30374
|
+
warnIfAllNull(result);
|
|
30375
|
+
}
|
|
30192
30376
|
if (result.length > 0 && typeof result[0] !== "object") {
|
|
30193
30377
|
const fieldMatch = filter.match(/\.(\w+)$/);
|
|
30194
30378
|
const key = fieldMatch ? fieldMatch[1] : "Value";
|
|
@@ -30196,10 +30380,30 @@ function applyFilter(data, filter) {
|
|
|
30196
30380
|
}
|
|
30197
30381
|
return result;
|
|
30198
30382
|
}
|
|
30199
|
-
if (typeof result === "object")
|
|
30383
|
+
if (typeof result === "object") {
|
|
30384
|
+
warnIfAllNull([result]);
|
|
30200
30385
|
return result;
|
|
30386
|
+
}
|
|
30201
30387
|
return { Value: result };
|
|
30202
30388
|
}
|
|
30389
|
+
function filterFailureData(envelope) {
|
|
30390
|
+
const filter = getOutputFilter();
|
|
30391
|
+
const data = envelope.Data;
|
|
30392
|
+
if (!filter || data == null)
|
|
30393
|
+
return;
|
|
30394
|
+
let note;
|
|
30395
|
+
const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
|
|
30396
|
+
note = n;
|
|
30397
|
+
}));
|
|
30398
|
+
if (filterError) {
|
|
30399
|
+
envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
|
|
30400
|
+
return;
|
|
30401
|
+
}
|
|
30402
|
+
envelope.Data = filtered;
|
|
30403
|
+
if (note) {
|
|
30404
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
30405
|
+
}
|
|
30406
|
+
}
|
|
30203
30407
|
function defaultErrorCodeForResult(result) {
|
|
30204
30408
|
switch (result) {
|
|
30205
30409
|
case RESULTS.AuthenticationError:
|
|
@@ -30282,8 +30486,14 @@ var OutputFormatter;
|
|
|
30282
30486
|
}
|
|
30283
30487
|
const filter = getOutputFilter();
|
|
30284
30488
|
if (filter) {
|
|
30285
|
-
|
|
30489
|
+
let note;
|
|
30490
|
+
const filtered = applyFilter(data.Data, filter, (n) => {
|
|
30491
|
+
note = n;
|
|
30492
|
+
});
|
|
30286
30493
|
data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
|
|
30494
|
+
if (note) {
|
|
30495
|
+
data.Warning = appendWarning(data.Warning, note);
|
|
30496
|
+
}
|
|
30287
30497
|
}
|
|
30288
30498
|
logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
|
|
30289
30499
|
}
|
|
@@ -30311,6 +30521,7 @@ var OutputFormatter;
|
|
|
30311
30521
|
delete envelope.TelemetryErrorClass;
|
|
30312
30522
|
delete envelope.TelemetryTerminalOutcome;
|
|
30313
30523
|
delete envelope.TelemetryTerminalSignal;
|
|
30524
|
+
filterFailureData(envelope);
|
|
30314
30525
|
if (!suppressTelemetry) {
|
|
30315
30526
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
30316
30527
|
result: data.Result,
|
|
@@ -30359,13 +30570,20 @@ var OutputFormatter;
|
|
|
30359
30570
|
OutputFormatter.log = log;
|
|
30360
30571
|
function formatToString(data) {
|
|
30361
30572
|
const filter = getOutputFilter();
|
|
30573
|
+
const envelope = data;
|
|
30362
30574
|
if ("Data" in data && data.Data != null) {
|
|
30363
30575
|
data.Data = normalizeDataKeys(data.Data);
|
|
30364
30576
|
if (filter) {
|
|
30365
|
-
|
|
30577
|
+
let note;
|
|
30578
|
+
data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
|
|
30579
|
+
note = n;
|
|
30580
|
+
}));
|
|
30581
|
+
if (note) {
|
|
30582
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
30583
|
+
}
|
|
30366
30584
|
}
|
|
30367
30585
|
}
|
|
30368
|
-
const output = normalizeOutputKeys(
|
|
30586
|
+
const output = normalizeOutputKeys(envelope);
|
|
30369
30587
|
const lines = [];
|
|
30370
30588
|
const sink = getOutputSink();
|
|
30371
30589
|
printOutput(output, getOutputFormat(), (msg) => {
|
|
@@ -33155,4 +33373,4 @@ Running workflow: ${fs2.path.basename(resolvedPath)}`);
|
|
|
33155
33373
|
|
|
33156
33374
|
export { getFileSystem, catchError, logger, RESULTS, SuccessOutput, FailureOutput, OutputFormatter, Command, processContext, registerPackageMetadataOptions, mapPackageMetadataOptions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, unsupportedSolutionProjectType, getLoginStatusAsync, getAuthContext, WorkflowRunService };
|
|
33157
33375
|
|
|
33158
|
-
//# debugId=
|
|
33376
|
+
//# debugId=88E280B2C8315EBF64756E2164756E21
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
processContext,
|
|
20
20
|
registerPackageMetadataOptions,
|
|
21
21
|
unsupportedSolutionProjectType
|
|
22
|
-
} from "./packager-tool-
|
|
22
|
+
} from "./packager-tool-csg2tez0.js";
|
|
23
23
|
import {
|
|
24
24
|
yaml
|
|
25
25
|
} from "./packager-tool-d3w0wn6k.js";
|
|
@@ -7156,7 +7156,7 @@ var package_default = {
|
|
|
7156
7156
|
name: "@uipath/api-workflow-tool",
|
|
7157
7157
|
author: "UiPath",
|
|
7158
7158
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
7159
|
-
version: "1.203.0-preview.
|
|
7159
|
+
version: "1.203.0-preview.237",
|
|
7160
7160
|
description: "Run UiPath API Workflows locally.",
|
|
7161
7161
|
private: false,
|
|
7162
7162
|
repository: {
|
|
@@ -7740,7 +7740,7 @@ var package_default2 = {
|
|
|
7740
7740
|
name: "@uipath/integrationservice-sdk",
|
|
7741
7741
|
author: "UiPath",
|
|
7742
7742
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
7743
|
-
version: "1.203.0-preview.
|
|
7743
|
+
version: "1.203.0-preview.237",
|
|
7744
7744
|
repository: {
|
|
7745
7745
|
type: "git",
|
|
7746
7746
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -14372,7 +14372,7 @@ Subcommands:
|
|
|
14372
14372
|
// src/commands/packager-shared.ts
|
|
14373
14373
|
async function createPackager() {
|
|
14374
14374
|
registerPackagerFactories();
|
|
14375
|
-
const { createNodeProjectPackager } = await import("./node-
|
|
14375
|
+
const { createNodeProjectPackager } = await import("./node-z6yvq9d2.js");
|
|
14376
14376
|
return await createNodeProjectPackager({
|
|
14377
14377
|
logHandler: logger.handleLog
|
|
14378
14378
|
});
|
|
@@ -14395,7 +14395,7 @@ async function setupProject(packager, projectPath) {
|
|
|
14395
14395
|
return packager.setupAsync(absPath);
|
|
14396
14396
|
}
|
|
14397
14397
|
async function buildBaseOptions() {
|
|
14398
|
-
const { ProjectPackOptions } = await import("./index-
|
|
14398
|
+
const { ProjectPackOptions } = await import("./index-6qw86bsb.js");
|
|
14399
14399
|
const sdkLogLevelMap = {
|
|
14400
14400
|
[0 /* DEBUG */]: "Debug" /* Debug */,
|
|
14401
14401
|
[1 /* INFO */]: "Information" /* Info */,
|
|
@@ -14692,7 +14692,7 @@ var package_default3 = {
|
|
|
14692
14692
|
name: "@uipath/solution-sdk",
|
|
14693
14693
|
author: "UiPath",
|
|
14694
14694
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
14695
|
-
version: "1.203.0-preview.
|
|
14695
|
+
version: "1.203.0-preview.237",
|
|
14696
14696
|
repository: {
|
|
14697
14697
|
type: "git",
|
|
14698
14698
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -16907,4 +16907,4 @@ var registerCommands = async (program) => {
|
|
|
16907
16907
|
|
|
16908
16908
|
export { metadata, registerCommands };
|
|
16909
16909
|
|
|
16910
|
-
//# debugId=
|
|
16910
|
+
//# debugId=53D89D0915FD22C864756E2164756E21
|
package/dist/tool.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
metadata,
|
|
3
3
|
registerCommands
|
|
4
|
-
} from "./packager-tool-
|
|
4
|
+
} from "./packager-tool-gf0z0zya.js";
|
|
5
5
|
import"./packager-tool-k9wheprx.js";
|
|
6
6
|
import"./packager-tool-6se0wnbx.js";
|
|
7
|
-
import"./packager-tool-
|
|
7
|
+
import"./packager-tool-csg2tez0.js";
|
|
8
8
|
import"./packager-tool-d3w0wn6k.js";
|
|
9
9
|
import"./packager-tool-1de529jm.js";
|
|
10
10
|
export {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@uipath/api-workflow-tool",
|
|
3
3
|
"author": "UiPath",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
|
-
"version": "1.203.0-preview.
|
|
5
|
+
"version": "1.203.0-preview.237",
|
|
6
6
|
"description": "Run UiPath API Workflows locally.",
|
|
7
7
|
"private": false,
|
|
8
8
|
"repository": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"files": [
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "4ad3e17a66f2c7fb7fe1f0e3e04a5b6175a0a9a3"
|
|
30
30
|
}
|