@uipath/packager-tool-datafabric 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/init.js +449 -15
- package/package.json +2 -2
package/dist/init.js
CHANGED
|
@@ -15133,7 +15133,165 @@ class FilterImplicitLimitError extends Error {
|
|
|
15133
15133
|
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).";
|
|
15134
15134
|
}
|
|
15135
15135
|
}
|
|
15136
|
-
function
|
|
15136
|
+
function countRecords(data) {
|
|
15137
|
+
if (Array.isArray(data))
|
|
15138
|
+
return data.length;
|
|
15139
|
+
return data == null ? 0 : 1;
|
|
15140
|
+
}
|
|
15141
|
+
function availableFields(data) {
|
|
15142
|
+
const records = Array.isArray(data) ? data : [data];
|
|
15143
|
+
const keys = new Set;
|
|
15144
|
+
for (const record of records) {
|
|
15145
|
+
if (record && typeof record === "object" && !Array.isArray(record)) {
|
|
15146
|
+
for (const key of Object.keys(record))
|
|
15147
|
+
keys.add(key);
|
|
15148
|
+
}
|
|
15149
|
+
}
|
|
15150
|
+
return [...keys];
|
|
15151
|
+
}
|
|
15152
|
+
function decodeQuotedIdentifier(whole, inner) {
|
|
15153
|
+
const [error, decoded] = catchError(() => JSON.parse(whole));
|
|
15154
|
+
if (!error && typeof decoded === "string")
|
|
15155
|
+
return decoded;
|
|
15156
|
+
return inner.replace(/\\(.)/g, "$1");
|
|
15157
|
+
}
|
|
15158
|
+
function referencedFields(filter) {
|
|
15159
|
+
const top = new Set;
|
|
15160
|
+
const nested = new Set;
|
|
15161
|
+
const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
|
|
15162
|
+
const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
|
|
15163
|
+
const quoted = [];
|
|
15164
|
+
const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
|
|
15165
|
+
const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
|
|
15166
|
+
if (!isAlias) {
|
|
15167
|
+
quoted.push({
|
|
15168
|
+
name: decodeQuotedIdentifier(whole, name),
|
|
15169
|
+
index,
|
|
15170
|
+
tail: isPathTail(withoutValueLiterals, index)
|
|
15171
|
+
});
|
|
15172
|
+
}
|
|
15173
|
+
return `"${" ".repeat(whole.length - 2)}"`;
|
|
15174
|
+
});
|
|
15175
|
+
const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
|
|
15176
|
+
const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
|
|
15177
|
+
const place = (name, index, tail) => {
|
|
15178
|
+
if (tail || index >= rootEnd)
|
|
15179
|
+
nested.add(name);
|
|
15180
|
+
else
|
|
15181
|
+
top.add(name);
|
|
15182
|
+
};
|
|
15183
|
+
for (const entry of quoted)
|
|
15184
|
+
place(entry.name, entry.index, entry.tail);
|
|
15185
|
+
const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
|
|
15186
|
+
const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
|
|
15187
|
+
for (const match of identifiers) {
|
|
15188
|
+
const [, name, trailing] = match;
|
|
15189
|
+
if (trailing || reserved.has(name))
|
|
15190
|
+
continue;
|
|
15191
|
+
place(name, match.index, isPathTail(withoutLiterals, match.index));
|
|
15192
|
+
}
|
|
15193
|
+
return {
|
|
15194
|
+
top: [...top],
|
|
15195
|
+
nested: [...nested].filter((name) => !top.has(name)),
|
|
15196
|
+
hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
|
|
15197
|
+
};
|
|
15198
|
+
}
|
|
15199
|
+
function appearsBelowTopLevel(data, name) {
|
|
15200
|
+
let budget = 2000;
|
|
15201
|
+
const visit = (value, depth) => {
|
|
15202
|
+
if (budget-- <= 0 || depth > 4)
|
|
15203
|
+
return false;
|
|
15204
|
+
if (value === null || typeof value !== "object")
|
|
15205
|
+
return false;
|
|
15206
|
+
if (Array.isArray(value))
|
|
15207
|
+
return value.some((entry) => visit(entry, depth));
|
|
15208
|
+
const record = value;
|
|
15209
|
+
if (depth > 0 && Object.hasOwn(record, name))
|
|
15210
|
+
return true;
|
|
15211
|
+
return Object.values(record).some((entry) => visit(entry, depth + 1));
|
|
15212
|
+
};
|
|
15213
|
+
return visit(data, 0);
|
|
15214
|
+
}
|
|
15215
|
+
function alwaysNullKeys(records) {
|
|
15216
|
+
const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
|
|
15217
|
+
if (objects.length === 0 || objects.length !== records.length)
|
|
15218
|
+
return [];
|
|
15219
|
+
const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
|
|
15220
|
+
if (keys.length === 0)
|
|
15221
|
+
return [];
|
|
15222
|
+
const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
|
|
15223
|
+
return nullKeys.length === keys.length ? nullKeys : [];
|
|
15224
|
+
}
|
|
15225
|
+
function carriesOnlyNulls(value) {
|
|
15226
|
+
if (value === null)
|
|
15227
|
+
return true;
|
|
15228
|
+
if (Array.isArray(value)) {
|
|
15229
|
+
return value.length > 0 && value.every(carriesOnlyNulls);
|
|
15230
|
+
}
|
|
15231
|
+
if (typeof value === "object" && value !== undefined) {
|
|
15232
|
+
const values = Object.values(value);
|
|
15233
|
+
return values.length > 0 && values.every(carriesOnlyNulls);
|
|
15234
|
+
}
|
|
15235
|
+
return false;
|
|
15236
|
+
}
|
|
15237
|
+
function nameList(names, cap2 = 12) {
|
|
15238
|
+
const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
|
|
15239
|
+
const rest = names.length - shown.length;
|
|
15240
|
+
return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
15241
|
+
}
|
|
15242
|
+
function buildFilterWarning(filter, data, outcome) {
|
|
15243
|
+
const present = availableFields(data);
|
|
15244
|
+
const refs = referencedFields(filter);
|
|
15245
|
+
const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
|
|
15246
|
+
const unchecked = refs.nested.filter((name) => !present.includes(name));
|
|
15247
|
+
const count = countRecords(data);
|
|
15248
|
+
const scope = `${count} record(s)`;
|
|
15249
|
+
const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
|
|
15250
|
+
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" : "";
|
|
15251
|
+
const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
|
|
15252
|
+
let detail;
|
|
15253
|
+
let lede;
|
|
15254
|
+
if (outcome.kind === "null-elements") {
|
|
15255
|
+
lede = "returned only null values";
|
|
15256
|
+
const projected = `all ${outcome.count} of the elements it projected are null`;
|
|
15257
|
+
if (unknown.length > 0) {
|
|
15258
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
15259
|
+
} else if (unchecked.length > 0) {
|
|
15260
|
+
detail = withSoundness(projected);
|
|
15261
|
+
} else {
|
|
15262
|
+
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`;
|
|
15263
|
+
}
|
|
15264
|
+
} else if (outcome.kind === "null-rows") {
|
|
15265
|
+
lede = "returned only null values";
|
|
15266
|
+
const projected = `every value it projected is null on all ${outcome.count} row(s)`;
|
|
15267
|
+
detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
|
|
15268
|
+
} else if (outcome.kind === "null-values") {
|
|
15269
|
+
lede = "returned only null values";
|
|
15270
|
+
const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
|
|
15271
|
+
const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
|
|
15272
|
+
if (sameSet) {
|
|
15273
|
+
detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
|
|
15274
|
+
} else if (unknown.length > 0) {
|
|
15275
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
15276
|
+
} else {
|
|
15277
|
+
detail = withSoundness(`${projected} on all ${scope}`);
|
|
15278
|
+
}
|
|
15279
|
+
} else {
|
|
15280
|
+
lede = "returned nothing";
|
|
15281
|
+
if (unknown.length > 0) {
|
|
15282
|
+
detail = isNotAField(unknown);
|
|
15283
|
+
} else {
|
|
15284
|
+
const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
|
|
15285
|
+
detail = withSoundness(`${selection} — it read ${scope}`);
|
|
15286
|
+
}
|
|
15287
|
+
}
|
|
15288
|
+
const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
|
|
15289
|
+
return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
|
|
15290
|
+
}
|
|
15291
|
+
function appendWarning(existing, note) {
|
|
15292
|
+
return existing ? `${existing} ${note}` : note;
|
|
15293
|
+
}
|
|
15294
|
+
function applyFilter(data, filter, onWarning) {
|
|
15137
15295
|
const codec = requireJmespath();
|
|
15138
15296
|
let result;
|
|
15139
15297
|
try {
|
|
@@ -15141,9 +15299,34 @@ function applyFilter(data, filter) {
|
|
|
15141
15299
|
} catch (err) {
|
|
15142
15300
|
throw new FilterEvaluationError(filter, err);
|
|
15143
15301
|
}
|
|
15144
|
-
|
|
15302
|
+
const inputCount = countRecords(data);
|
|
15303
|
+
const warn = (outcome) => {
|
|
15304
|
+
if (inputCount === 0)
|
|
15305
|
+
return;
|
|
15306
|
+
const note = buildFilterWarning(filter, data, outcome);
|
|
15307
|
+
getOutputSink().writeErr(`[WARN] ${note}
|
|
15308
|
+
`);
|
|
15309
|
+
onWarning?.(note);
|
|
15310
|
+
};
|
|
15311
|
+
const warnIfAllNull = (records) => {
|
|
15312
|
+
const keys = alwaysNullKeys(records);
|
|
15313
|
+
if (keys.length > 0)
|
|
15314
|
+
warn({ kind: "null-values", keys });
|
|
15315
|
+
};
|
|
15316
|
+
if (result == null) {
|
|
15317
|
+
warn({ kind: "empty" });
|
|
15145
15318
|
return [];
|
|
15319
|
+
}
|
|
15146
15320
|
if (Array.isArray(result)) {
|
|
15321
|
+
if (result.length === 0) {
|
|
15322
|
+
warn({ kind: "empty" });
|
|
15323
|
+
} else if (result.every((entry) => entry === null)) {
|
|
15324
|
+
warn({ kind: "null-elements", count: result.length });
|
|
15325
|
+
} else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
|
|
15326
|
+
warn({ kind: "null-rows", count: result.length });
|
|
15327
|
+
} else {
|
|
15328
|
+
warnIfAllNull(result);
|
|
15329
|
+
}
|
|
15147
15330
|
if (result.length > 0 && typeof result[0] !== "object") {
|
|
15148
15331
|
const fieldMatch = filter.match(/\.(\w+)$/);
|
|
15149
15332
|
const key = fieldMatch ? fieldMatch[1] : "Value";
|
|
@@ -15151,10 +15334,30 @@ function applyFilter(data, filter) {
|
|
|
15151
15334
|
}
|
|
15152
15335
|
return result;
|
|
15153
15336
|
}
|
|
15154
|
-
if (typeof result === "object")
|
|
15337
|
+
if (typeof result === "object") {
|
|
15338
|
+
warnIfAllNull([result]);
|
|
15155
15339
|
return result;
|
|
15340
|
+
}
|
|
15156
15341
|
return { Value: result };
|
|
15157
15342
|
}
|
|
15343
|
+
function filterFailureData(envelope) {
|
|
15344
|
+
const filter = getOutputFilter();
|
|
15345
|
+
const data = envelope.Data;
|
|
15346
|
+
if (!filter || data == null)
|
|
15347
|
+
return;
|
|
15348
|
+
let note;
|
|
15349
|
+
const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
|
|
15350
|
+
note = n;
|
|
15351
|
+
}));
|
|
15352
|
+
if (filterError) {
|
|
15353
|
+
envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
|
|
15354
|
+
return;
|
|
15355
|
+
}
|
|
15356
|
+
envelope.Data = filtered;
|
|
15357
|
+
if (note) {
|
|
15358
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
15359
|
+
}
|
|
15360
|
+
}
|
|
15158
15361
|
function defaultErrorCodeForResult(result) {
|
|
15159
15362
|
switch (result) {
|
|
15160
15363
|
case RESULTS.AuthenticationError:
|
|
@@ -15237,8 +15440,14 @@ var OutputFormatter;
|
|
|
15237
15440
|
}
|
|
15238
15441
|
const filter = getOutputFilter();
|
|
15239
15442
|
if (filter) {
|
|
15240
|
-
|
|
15443
|
+
let note;
|
|
15444
|
+
const filtered = applyFilter(data.Data, filter, (n) => {
|
|
15445
|
+
note = n;
|
|
15446
|
+
});
|
|
15241
15447
|
data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
|
|
15448
|
+
if (note) {
|
|
15449
|
+
data.Warning = appendWarning(data.Warning, note);
|
|
15450
|
+
}
|
|
15242
15451
|
}
|
|
15243
15452
|
logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
|
|
15244
15453
|
}
|
|
@@ -15266,6 +15475,7 @@ var OutputFormatter;
|
|
|
15266
15475
|
delete envelope.TelemetryErrorClass;
|
|
15267
15476
|
delete envelope.TelemetryTerminalOutcome;
|
|
15268
15477
|
delete envelope.TelemetryTerminalSignal;
|
|
15478
|
+
filterFailureData(envelope);
|
|
15269
15479
|
if (!suppressTelemetry) {
|
|
15270
15480
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
15271
15481
|
result: data.Result,
|
|
@@ -15314,13 +15524,20 @@ var OutputFormatter;
|
|
|
15314
15524
|
OutputFormatter2.log = log;
|
|
15315
15525
|
function formatToString(data) {
|
|
15316
15526
|
const filter = getOutputFilter();
|
|
15527
|
+
const envelope = data;
|
|
15317
15528
|
if ("Data" in data && data.Data != null) {
|
|
15318
15529
|
data.Data = normalizeDataKeys(data.Data);
|
|
15319
15530
|
if (filter) {
|
|
15320
|
-
|
|
15531
|
+
let note;
|
|
15532
|
+
data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
|
|
15533
|
+
note = n;
|
|
15534
|
+
}));
|
|
15535
|
+
if (note) {
|
|
15536
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
15537
|
+
}
|
|
15321
15538
|
}
|
|
15322
15539
|
}
|
|
15323
|
-
const output = normalizeOutputKeys(
|
|
15540
|
+
const output = normalizeOutputKeys(envelope);
|
|
15324
15541
|
const lines = [];
|
|
15325
15542
|
const sink = getOutputSink();
|
|
15326
15543
|
printOutput(output, getOutputFormat(), (msg) => {
|
|
@@ -17166,7 +17383,7 @@ class NodeFileSystem3 {
|
|
|
17166
17383
|
var fsInstance3 = new NodeFileSystem3;
|
|
17167
17384
|
var getFileSystem3 = () => fsInstance3;
|
|
17168
17385
|
|
|
17169
|
-
// ../../solution-sdk/dist/index-
|
|
17386
|
+
// ../../solution-sdk/dist/index-z20j4jst.js
|
|
17170
17387
|
init_index_1de529jm();
|
|
17171
17388
|
import { execFileSync as execFileSync6 } from "node:child_process";
|
|
17172
17389
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
@@ -21489,7 +21706,165 @@ class FilterImplicitLimitError2 extends Error {
|
|
|
21489
21706
|
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).";
|
|
21490
21707
|
}
|
|
21491
21708
|
}
|
|
21492
|
-
function
|
|
21709
|
+
function countRecords2(data) {
|
|
21710
|
+
if (Array.isArray(data))
|
|
21711
|
+
return data.length;
|
|
21712
|
+
return data == null ? 0 : 1;
|
|
21713
|
+
}
|
|
21714
|
+
function availableFields2(data) {
|
|
21715
|
+
const records = Array.isArray(data) ? data : [data];
|
|
21716
|
+
const keys = new Set;
|
|
21717
|
+
for (const record of records) {
|
|
21718
|
+
if (record && typeof record === "object" && !Array.isArray(record)) {
|
|
21719
|
+
for (const key of Object.keys(record))
|
|
21720
|
+
keys.add(key);
|
|
21721
|
+
}
|
|
21722
|
+
}
|
|
21723
|
+
return [...keys];
|
|
21724
|
+
}
|
|
21725
|
+
function decodeQuotedIdentifier2(whole, inner) {
|
|
21726
|
+
const [error, decoded] = catchError2(() => JSON.parse(whole));
|
|
21727
|
+
if (!error && typeof decoded === "string")
|
|
21728
|
+
return decoded;
|
|
21729
|
+
return inner.replace(/\\(.)/g, "$1");
|
|
21730
|
+
}
|
|
21731
|
+
function referencedFields2(filter) {
|
|
21732
|
+
const top = new Set;
|
|
21733
|
+
const nested = new Set;
|
|
21734
|
+
const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
|
|
21735
|
+
const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
|
|
21736
|
+
const quoted = [];
|
|
21737
|
+
const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
|
|
21738
|
+
const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
|
|
21739
|
+
if (!isAlias) {
|
|
21740
|
+
quoted.push({
|
|
21741
|
+
name: decodeQuotedIdentifier2(whole, name),
|
|
21742
|
+
index,
|
|
21743
|
+
tail: isPathTail(withoutValueLiterals, index)
|
|
21744
|
+
});
|
|
21745
|
+
}
|
|
21746
|
+
return `"${" ".repeat(whole.length - 2)}"`;
|
|
21747
|
+
});
|
|
21748
|
+
const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
|
|
21749
|
+
const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
|
|
21750
|
+
const place = (name, index, tail) => {
|
|
21751
|
+
if (tail || index >= rootEnd)
|
|
21752
|
+
nested.add(name);
|
|
21753
|
+
else
|
|
21754
|
+
top.add(name);
|
|
21755
|
+
};
|
|
21756
|
+
for (const entry of quoted)
|
|
21757
|
+
place(entry.name, entry.index, entry.tail);
|
|
21758
|
+
const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
|
|
21759
|
+
const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
|
|
21760
|
+
for (const match of identifiers) {
|
|
21761
|
+
const [, name, trailing] = match;
|
|
21762
|
+
if (trailing || reserved.has(name))
|
|
21763
|
+
continue;
|
|
21764
|
+
place(name, match.index, isPathTail(withoutLiterals, match.index));
|
|
21765
|
+
}
|
|
21766
|
+
return {
|
|
21767
|
+
top: [...top],
|
|
21768
|
+
nested: [...nested].filter((name) => !top.has(name)),
|
|
21769
|
+
hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
|
|
21770
|
+
};
|
|
21771
|
+
}
|
|
21772
|
+
function appearsBelowTopLevel2(data, name) {
|
|
21773
|
+
let budget = 2000;
|
|
21774
|
+
const visit = (value, depth) => {
|
|
21775
|
+
if (budget-- <= 0 || depth > 4)
|
|
21776
|
+
return false;
|
|
21777
|
+
if (value === null || typeof value !== "object")
|
|
21778
|
+
return false;
|
|
21779
|
+
if (Array.isArray(value))
|
|
21780
|
+
return value.some((entry) => visit(entry, depth));
|
|
21781
|
+
const record = value;
|
|
21782
|
+
if (depth > 0 && Object.hasOwn(record, name))
|
|
21783
|
+
return true;
|
|
21784
|
+
return Object.values(record).some((entry) => visit(entry, depth + 1));
|
|
21785
|
+
};
|
|
21786
|
+
return visit(data, 0);
|
|
21787
|
+
}
|
|
21788
|
+
function alwaysNullKeys2(records) {
|
|
21789
|
+
const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
|
|
21790
|
+
if (objects.length === 0 || objects.length !== records.length)
|
|
21791
|
+
return [];
|
|
21792
|
+
const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
|
|
21793
|
+
if (keys.length === 0)
|
|
21794
|
+
return [];
|
|
21795
|
+
const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
|
|
21796
|
+
return nullKeys.length === keys.length ? nullKeys : [];
|
|
21797
|
+
}
|
|
21798
|
+
function carriesOnlyNulls2(value) {
|
|
21799
|
+
if (value === null)
|
|
21800
|
+
return true;
|
|
21801
|
+
if (Array.isArray(value)) {
|
|
21802
|
+
return value.length > 0 && value.every(carriesOnlyNulls2);
|
|
21803
|
+
}
|
|
21804
|
+
if (typeof value === "object" && value !== undefined) {
|
|
21805
|
+
const values = Object.values(value);
|
|
21806
|
+
return values.length > 0 && values.every(carriesOnlyNulls2);
|
|
21807
|
+
}
|
|
21808
|
+
return false;
|
|
21809
|
+
}
|
|
21810
|
+
function nameList2(names, cap22 = 12) {
|
|
21811
|
+
const shown = names.slice(0, cap22).map((n) => `\`${n}\``);
|
|
21812
|
+
const rest = names.length - shown.length;
|
|
21813
|
+
return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
21814
|
+
}
|
|
21815
|
+
function buildFilterWarning2(filter, data, outcome) {
|
|
21816
|
+
const present = availableFields2(data);
|
|
21817
|
+
const refs = referencedFields2(filter);
|
|
21818
|
+
const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel2(data, name));
|
|
21819
|
+
const unchecked = refs.nested.filter((name) => !present.includes(name));
|
|
21820
|
+
const count = countRecords2(data);
|
|
21821
|
+
const scope = `${count} record(s)`;
|
|
21822
|
+
const isNotAField = (names) => `${nameList2(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
|
|
21823
|
+
const soundness = unchecked.length > 0 ? `${nameList2(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" : "";
|
|
21824
|
+
const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
|
|
21825
|
+
let detail;
|
|
21826
|
+
let lede;
|
|
21827
|
+
if (outcome.kind === "null-elements") {
|
|
21828
|
+
lede = "returned only null values";
|
|
21829
|
+
const projected = `all ${outcome.count} of the elements it projected are null`;
|
|
21830
|
+
if (unknown.length > 0) {
|
|
21831
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
21832
|
+
} else if (unchecked.length > 0) {
|
|
21833
|
+
detail = withSoundness(projected);
|
|
21834
|
+
} else {
|
|
21835
|
+
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`;
|
|
21836
|
+
}
|
|
21837
|
+
} else if (outcome.kind === "null-rows") {
|
|
21838
|
+
lede = "returned only null values";
|
|
21839
|
+
const projected = `every value it projected is null on all ${outcome.count} row(s)`;
|
|
21840
|
+
detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
|
|
21841
|
+
} else if (outcome.kind === "null-values") {
|
|
21842
|
+
lede = "returned only null values";
|
|
21843
|
+
const projected = `every key it projected (${nameList2(outcome.keys)}) is null`;
|
|
21844
|
+
const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
|
|
21845
|
+
if (sameSet) {
|
|
21846
|
+
detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
|
|
21847
|
+
} else if (unknown.length > 0) {
|
|
21848
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
21849
|
+
} else {
|
|
21850
|
+
detail = withSoundness(`${projected} on all ${scope}`);
|
|
21851
|
+
}
|
|
21852
|
+
} else {
|
|
21853
|
+
lede = "returned nothing";
|
|
21854
|
+
if (unknown.length > 0) {
|
|
21855
|
+
detail = isNotAField(unknown);
|
|
21856
|
+
} else {
|
|
21857
|
+
const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
|
|
21858
|
+
detail = withSoundness(`${selection} — it read ${scope}`);
|
|
21859
|
+
}
|
|
21860
|
+
}
|
|
21861
|
+
const fields = present.length > 0 ? ` Available fields: ${nameList2(present)}.` : "";
|
|
21862
|
+
return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
|
|
21863
|
+
}
|
|
21864
|
+
function appendWarning2(existing, note) {
|
|
21865
|
+
return existing ? `${existing} ${note}` : note;
|
|
21866
|
+
}
|
|
21867
|
+
function applyFilter2(data, filter, onWarning) {
|
|
21493
21868
|
const codec = requireJmespath2();
|
|
21494
21869
|
let result;
|
|
21495
21870
|
try {
|
|
@@ -21497,9 +21872,34 @@ function applyFilter2(data, filter) {
|
|
|
21497
21872
|
} catch (err) {
|
|
21498
21873
|
throw new FilterEvaluationError2(filter, err);
|
|
21499
21874
|
}
|
|
21500
|
-
|
|
21875
|
+
const inputCount = countRecords2(data);
|
|
21876
|
+
const warn = (outcome) => {
|
|
21877
|
+
if (inputCount === 0)
|
|
21878
|
+
return;
|
|
21879
|
+
const note = buildFilterWarning2(filter, data, outcome);
|
|
21880
|
+
getOutputSink2().writeErr(`[WARN] ${note}
|
|
21881
|
+
`);
|
|
21882
|
+
onWarning?.(note);
|
|
21883
|
+
};
|
|
21884
|
+
const warnIfAllNull = (records) => {
|
|
21885
|
+
const keys = alwaysNullKeys2(records);
|
|
21886
|
+
if (keys.length > 0)
|
|
21887
|
+
warn({ kind: "null-values", keys });
|
|
21888
|
+
};
|
|
21889
|
+
if (result == null) {
|
|
21890
|
+
warn({ kind: "empty" });
|
|
21501
21891
|
return [];
|
|
21892
|
+
}
|
|
21502
21893
|
if (Array.isArray(result)) {
|
|
21894
|
+
if (result.length === 0) {
|
|
21895
|
+
warn({ kind: "empty" });
|
|
21896
|
+
} else if (result.every((entry) => entry === null)) {
|
|
21897
|
+
warn({ kind: "null-elements", count: result.length });
|
|
21898
|
+
} else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls2(result)) {
|
|
21899
|
+
warn({ kind: "null-rows", count: result.length });
|
|
21900
|
+
} else {
|
|
21901
|
+
warnIfAllNull(result);
|
|
21902
|
+
}
|
|
21503
21903
|
if (result.length > 0 && typeof result[0] !== "object") {
|
|
21504
21904
|
const fieldMatch = filter.match(/\.(\w+)$/);
|
|
21505
21905
|
const key = fieldMatch ? fieldMatch[1] : "Value";
|
|
@@ -21507,10 +21907,30 @@ function applyFilter2(data, filter) {
|
|
|
21507
21907
|
}
|
|
21508
21908
|
return result;
|
|
21509
21909
|
}
|
|
21510
|
-
if (typeof result === "object")
|
|
21910
|
+
if (typeof result === "object") {
|
|
21911
|
+
warnIfAllNull([result]);
|
|
21511
21912
|
return result;
|
|
21913
|
+
}
|
|
21512
21914
|
return { Value: result };
|
|
21513
21915
|
}
|
|
21916
|
+
function filterFailureData2(envelope) {
|
|
21917
|
+
const filter = getOutputFilter2();
|
|
21918
|
+
const data = envelope.Data;
|
|
21919
|
+
if (!filter || data == null)
|
|
21920
|
+
return;
|
|
21921
|
+
let note;
|
|
21922
|
+
const [filterError, filtered] = catchError2(() => applyFilter2(data, filter, (n) => {
|
|
21923
|
+
note = n;
|
|
21924
|
+
}));
|
|
21925
|
+
if (filterError) {
|
|
21926
|
+
envelope.Warning = appendWarning2(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
|
|
21927
|
+
return;
|
|
21928
|
+
}
|
|
21929
|
+
envelope.Data = filtered;
|
|
21930
|
+
if (note) {
|
|
21931
|
+
envelope.Warning = appendWarning2(envelope.Warning, note);
|
|
21932
|
+
}
|
|
21933
|
+
}
|
|
21514
21934
|
function defaultErrorCodeForResult2(result) {
|
|
21515
21935
|
switch (result) {
|
|
21516
21936
|
case RESULTS2.AuthenticationError:
|
|
@@ -21593,8 +22013,14 @@ var OutputFormatter2;
|
|
|
21593
22013
|
}
|
|
21594
22014
|
const filter = getOutputFilter2();
|
|
21595
22015
|
if (filter) {
|
|
21596
|
-
|
|
22016
|
+
let note;
|
|
22017
|
+
const filtered = applyFilter2(data.Data, filter, (n) => {
|
|
22018
|
+
note = n;
|
|
22019
|
+
});
|
|
21597
22020
|
data.Data = normalize ? normalizeDataKeys2(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
|
|
22021
|
+
if (note) {
|
|
22022
|
+
data.Warning = appendWarning2(data.Warning, note);
|
|
22023
|
+
}
|
|
21598
22024
|
}
|
|
21599
22025
|
logOutput2(normalizeOutputKeys2(data), getOutputFormat2(), options?.tableRowStyle);
|
|
21600
22026
|
}
|
|
@@ -21622,6 +22048,7 @@ var OutputFormatter2;
|
|
|
21622
22048
|
delete envelope.TelemetryErrorClass;
|
|
21623
22049
|
delete envelope.TelemetryTerminalOutcome;
|
|
21624
22050
|
delete envelope.TelemetryTerminalSignal;
|
|
22051
|
+
filterFailureData2(envelope);
|
|
21625
22052
|
if (!suppressTelemetry) {
|
|
21626
22053
|
telemetry2.trackEvent(CommonTelemetryEvents2.Error, {
|
|
21627
22054
|
result: data.Result,
|
|
@@ -21670,13 +22097,20 @@ var OutputFormatter2;
|
|
|
21670
22097
|
OutputFormatter3.log = log;
|
|
21671
22098
|
function formatToString(data) {
|
|
21672
22099
|
const filter = getOutputFilter2();
|
|
22100
|
+
const envelope = data;
|
|
21673
22101
|
if ("Data" in data && data.Data != null) {
|
|
21674
22102
|
data.Data = normalizeDataKeys2(data.Data);
|
|
21675
22103
|
if (filter) {
|
|
21676
|
-
|
|
22104
|
+
let note;
|
|
22105
|
+
data.Data = normalizeDataKeys2(applyFilter2(data.Data, filter, (n) => {
|
|
22106
|
+
note = n;
|
|
22107
|
+
}));
|
|
22108
|
+
if (note) {
|
|
22109
|
+
envelope.Warning = appendWarning2(envelope.Warning, note);
|
|
22110
|
+
}
|
|
21677
22111
|
}
|
|
21678
22112
|
}
|
|
21679
|
-
const output = normalizeOutputKeys2(
|
|
22113
|
+
const output = normalizeOutputKeys2(envelope);
|
|
21680
22114
|
const lines = [];
|
|
21681
22115
|
const sink = getOutputSink2();
|
|
21682
22116
|
printOutput2(output, getOutputFormat2(), (msg) => {
|
|
@@ -23104,7 +23538,7 @@ var package_default = {
|
|
|
23104
23538
|
name: "@uipath/solution-sdk",
|
|
23105
23539
|
author: "UiPath",
|
|
23106
23540
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
23107
|
-
version: "1.203.0-preview.
|
|
23541
|
+
version: "1.203.0-preview.237",
|
|
23108
23542
|
repository: {
|
|
23109
23543
|
type: "git",
|
|
23110
23544
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -23643,4 +24077,4 @@ export {
|
|
|
23643
24077
|
entityInitAsync
|
|
23644
24078
|
};
|
|
23645
24079
|
|
|
23646
|
-
//# debugId=
|
|
24080
|
+
//# debugId=15B37359954C884664756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/packager-tool-datafabric",
|
|
3
|
-
"version": "1.203.0-preview.
|
|
3
|
+
"version": "1.203.0-preview.237",
|
|
4
4
|
"description": "UiPath Data Fabric entity schema, validation and packaging library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@uipath/solutionpackager-tool-core": "1.203.0"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "4ad3e17a66f2c7fb7fe1f0e3e04a5b6175a0a9a3"
|
|
28
28
|
}
|