@uipath/tasks-tool 1.203.0-preview.233 → 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.
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  FoldersApi,
3
3
  createApiClient
4
- } from "./tool-6ykqbeks.js";
4
+ } from "./tool-yr6089g5.js";
5
5
  import {
6
6
  OutputFormatter,
7
7
  RESULTS,
8
8
  catchError,
9
9
  extractErrorMessage,
10
10
  processContext
11
- } from "./tool-pbamehqj.js";
11
+ } from "./tool-nxve7m74.js";
12
12
  import {
13
13
  __commonJS,
14
14
  __require,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveFolder
3
- } from "./tool-6ykqbeks.js";
3
+ } from "./tool-yr6089g5.js";
4
4
  import {
5
5
  OutputFormatter,
6
6
  RESULTS,
@@ -8,7 +8,7 @@ import {
8
8
  extractErrorMessage,
9
9
  isGuid,
10
10
  processContext
11
- } from "./tool-pbamehqj.js";
11
+ } from "./tool-nxve7m74.js";
12
12
  import"./tool-1de529jm.js";
13
13
 
14
14
  // src/commands/_shared/folder-resolver.ts
package/dist/index.js CHANGED
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  metadata,
4
4
  registerCommands
5
- } from "./tool-7t97dx0m.js";
5
+ } from "./tool-8fsjknks.js";
6
6
  import {
7
7
  Command
8
- } from "./tool-pbamehqj.js";
8
+ } from "./tool-nxve7m74.js";
9
9
  import"./tool-bndhpxxj.js";
10
10
  import"./tool-1de529jm.js";
11
11
 
@@ -9,7 +9,7 @@ import {
9
9
  extractErrorMessageSync,
10
10
  getLoginStatusAsync,
11
11
  processContext
12
- } from "./tool-pbamehqj.js";
12
+ } from "./tool-nxve7m74.js";
13
13
  import {
14
14
  require_src
15
15
  } from "./tool-bndhpxxj.js";
@@ -4503,7 +4503,7 @@ var package_default = {
4503
4503
  name: "@uipath/tasks-tool",
4504
4504
  author: "UiPath",
4505
4505
  license: "SEE LICENSE IN LICENSE.txt",
4506
- version: "1.203.0-preview.233",
4506
+ version: "1.203.0-preview.237",
4507
4507
  description: "Manage Action Center tasks.",
4508
4508
  publishConfig: {
4509
4509
  registry: "https://npm.pkg.github.com/"
@@ -18597,11 +18597,11 @@ async function resolveFolderScope(options) {
18597
18597
  return parseIntArg(options.folderId, "--folder-id");
18598
18598
  }
18599
18599
  if (options.folderKey !== undefined) {
18600
- const { resolveFolderIdByKey } = await import("./folder-resolver-v3hx6eqb.js");
18600
+ const { resolveFolderIdByKey } = await import("./folder-resolver-f074n56v.js");
18601
18601
  return resolveFolderIdByKey(options.folderKey, options.tenant);
18602
18602
  }
18603
18603
  if (options.folderPath !== undefined) {
18604
- const { resolveFolderIdByPath } = await import("./folder-resolver-v3hx6eqb.js");
18604
+ const { resolveFolderIdByPath } = await import("./folder-resolver-f074n56v.js");
18605
18605
  return resolveFolderIdByPath(options.folderPath, options.tenant);
18606
18606
  }
18607
18607
  return;
@@ -18621,7 +18621,7 @@ async function resolveFolderId(options, missingFolderInstructions = DEFAULT_FOLD
18621
18621
  processContext.exit(1);
18622
18622
  return null;
18623
18623
  }
18624
- const { pickFolderInteractively } = await import("./folder-picker-interactive-g7r2c8ct.js");
18624
+ const { pickFolderInteractively } = await import("./folder-picker-interactive-78n39ktd.js");
18625
18625
  return pickFolderInteractively(options.tenant);
18626
18626
  }
18627
18627
 
@@ -19443,4 +19443,4 @@ var registerCommands = async (program) => {
19443
19443
 
19444
19444
  export { metadata, registerCommands };
19445
19445
 
19446
- //# debugId=F836798917E4201E64756E2164756E21
19446
+ //# debugId=980C59D54120A30064756E2164756E21
@@ -5006,7 +5006,165 @@ class FilterImplicitLimitError extends Error {
5006
5006
  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).";
5007
5007
  }
5008
5008
  }
5009
- function applyFilter(data, filter) {
5009
+ function countRecords(data) {
5010
+ if (Array.isArray(data))
5011
+ return data.length;
5012
+ return data == null ? 0 : 1;
5013
+ }
5014
+ function availableFields(data) {
5015
+ const records = Array.isArray(data) ? data : [data];
5016
+ const keys = new Set;
5017
+ for (const record of records) {
5018
+ if (record && typeof record === "object" && !Array.isArray(record)) {
5019
+ for (const key of Object.keys(record))
5020
+ keys.add(key);
5021
+ }
5022
+ }
5023
+ return [...keys];
5024
+ }
5025
+ function decodeQuotedIdentifier(whole, inner) {
5026
+ const [error, decoded] = catchError(() => JSON.parse(whole));
5027
+ if (!error && typeof decoded === "string")
5028
+ return decoded;
5029
+ return inner.replace(/\\(.)/g, "$1");
5030
+ }
5031
+ function referencedFields(filter) {
5032
+ const top = new Set;
5033
+ const nested = new Set;
5034
+ const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
5035
+ const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
5036
+ const quoted = [];
5037
+ const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
5038
+ const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
5039
+ if (!isAlias) {
5040
+ quoted.push({
5041
+ name: decodeQuotedIdentifier(whole, name),
5042
+ index,
5043
+ tail: isPathTail(withoutValueLiterals, index)
5044
+ });
5045
+ }
5046
+ return `"${" ".repeat(whole.length - 2)}"`;
5047
+ });
5048
+ const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
5049
+ const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
5050
+ const place = (name, index, tail) => {
5051
+ if (tail || index >= rootEnd)
5052
+ nested.add(name);
5053
+ else
5054
+ top.add(name);
5055
+ };
5056
+ for (const entry of quoted)
5057
+ place(entry.name, entry.index, entry.tail);
5058
+ const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
5059
+ const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
5060
+ for (const match of identifiers) {
5061
+ const [, name, trailing] = match;
5062
+ if (trailing || reserved.has(name))
5063
+ continue;
5064
+ place(name, match.index, isPathTail(withoutLiterals, match.index));
5065
+ }
5066
+ return {
5067
+ top: [...top],
5068
+ nested: [...nested].filter((name) => !top.has(name)),
5069
+ hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
5070
+ };
5071
+ }
5072
+ function appearsBelowTopLevel(data, name) {
5073
+ let budget = 2000;
5074
+ const visit = (value, depth) => {
5075
+ if (budget-- <= 0 || depth > 4)
5076
+ return false;
5077
+ if (value === null || typeof value !== "object")
5078
+ return false;
5079
+ if (Array.isArray(value))
5080
+ return value.some((entry) => visit(entry, depth));
5081
+ const record = value;
5082
+ if (depth > 0 && Object.hasOwn(record, name))
5083
+ return true;
5084
+ return Object.values(record).some((entry) => visit(entry, depth + 1));
5085
+ };
5086
+ return visit(data, 0);
5087
+ }
5088
+ function alwaysNullKeys(records) {
5089
+ const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
5090
+ if (objects.length === 0 || objects.length !== records.length)
5091
+ return [];
5092
+ const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
5093
+ if (keys.length === 0)
5094
+ return [];
5095
+ const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
5096
+ return nullKeys.length === keys.length ? nullKeys : [];
5097
+ }
5098
+ function carriesOnlyNulls(value) {
5099
+ if (value === null)
5100
+ return true;
5101
+ if (Array.isArray(value)) {
5102
+ return value.length > 0 && value.every(carriesOnlyNulls);
5103
+ }
5104
+ if (typeof value === "object" && value !== undefined) {
5105
+ const values = Object.values(value);
5106
+ return values.length > 0 && values.every(carriesOnlyNulls);
5107
+ }
5108
+ return false;
5109
+ }
5110
+ function nameList(names, cap2 = 12) {
5111
+ const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
5112
+ const rest = names.length - shown.length;
5113
+ return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
5114
+ }
5115
+ function buildFilterWarning(filter, data, outcome) {
5116
+ const present = availableFields(data);
5117
+ const refs = referencedFields(filter);
5118
+ const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
5119
+ const unchecked = refs.nested.filter((name) => !present.includes(name));
5120
+ const count = countRecords(data);
5121
+ const scope = `${count} record(s)`;
5122
+ const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
5123
+ 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" : "";
5124
+ const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
5125
+ let detail;
5126
+ let lede;
5127
+ if (outcome.kind === "null-elements") {
5128
+ lede = "returned only null values";
5129
+ const projected = `all ${outcome.count} of the elements it projected are null`;
5130
+ if (unknown.length > 0) {
5131
+ detail = `${projected}, because ${isNotAField(unknown)}`;
5132
+ } else if (unchecked.length > 0) {
5133
+ detail = withSoundness(projected);
5134
+ } else {
5135
+ 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`;
5136
+ }
5137
+ } else if (outcome.kind === "null-rows") {
5138
+ lede = "returned only null values";
5139
+ const projected = `every value it projected is null on all ${outcome.count} row(s)`;
5140
+ detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
5141
+ } else if (outcome.kind === "null-values") {
5142
+ lede = "returned only null values";
5143
+ const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
5144
+ const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
5145
+ if (sameSet) {
5146
+ detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
5147
+ } else if (unknown.length > 0) {
5148
+ detail = `${projected}, because ${isNotAField(unknown)}`;
5149
+ } else {
5150
+ detail = withSoundness(`${projected} on all ${scope}`);
5151
+ }
5152
+ } else {
5153
+ lede = "returned nothing";
5154
+ if (unknown.length > 0) {
5155
+ detail = isNotAField(unknown);
5156
+ } else {
5157
+ const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
5158
+ detail = withSoundness(`${selection} — it read ${scope}`);
5159
+ }
5160
+ }
5161
+ const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
5162
+ return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
5163
+ }
5164
+ function appendWarning(existing, note) {
5165
+ return existing ? `${existing} ${note}` : note;
5166
+ }
5167
+ function applyFilter(data, filter, onWarning) {
5010
5168
  const codec = requireJmespath();
5011
5169
  let result;
5012
5170
  try {
@@ -5014,9 +5172,34 @@ function applyFilter(data, filter) {
5014
5172
  } catch (err) {
5015
5173
  throw new FilterEvaluationError(filter, err);
5016
5174
  }
5017
- if (result == null)
5175
+ const inputCount = countRecords(data);
5176
+ const warn = (outcome) => {
5177
+ if (inputCount === 0)
5178
+ return;
5179
+ const note = buildFilterWarning(filter, data, outcome);
5180
+ getOutputSink().writeErr(`[WARN] ${note}
5181
+ `);
5182
+ onWarning?.(note);
5183
+ };
5184
+ const warnIfAllNull = (records) => {
5185
+ const keys = alwaysNullKeys(records);
5186
+ if (keys.length > 0)
5187
+ warn({ kind: "null-values", keys });
5188
+ };
5189
+ if (result == null) {
5190
+ warn({ kind: "empty" });
5018
5191
  return [];
5192
+ }
5019
5193
  if (Array.isArray(result)) {
5194
+ if (result.length === 0) {
5195
+ warn({ kind: "empty" });
5196
+ } else if (result.every((entry) => entry === null)) {
5197
+ warn({ kind: "null-elements", count: result.length });
5198
+ } else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
5199
+ warn({ kind: "null-rows", count: result.length });
5200
+ } else {
5201
+ warnIfAllNull(result);
5202
+ }
5020
5203
  if (result.length > 0 && typeof result[0] !== "object") {
5021
5204
  const fieldMatch = filter.match(/\.(\w+)$/);
5022
5205
  const key = fieldMatch ? fieldMatch[1] : "Value";
@@ -5024,10 +5207,30 @@ function applyFilter(data, filter) {
5024
5207
  }
5025
5208
  return result;
5026
5209
  }
5027
- if (typeof result === "object")
5210
+ if (typeof result === "object") {
5211
+ warnIfAllNull([result]);
5028
5212
  return result;
5213
+ }
5029
5214
  return { Value: result };
5030
5215
  }
5216
+ function filterFailureData(envelope) {
5217
+ const filter = getOutputFilter();
5218
+ const data = envelope.Data;
5219
+ if (!filter || data == null)
5220
+ return;
5221
+ let note;
5222
+ const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
5223
+ note = n;
5224
+ }));
5225
+ if (filterError) {
5226
+ envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
5227
+ return;
5228
+ }
5229
+ envelope.Data = filtered;
5230
+ if (note) {
5231
+ envelope.Warning = appendWarning(envelope.Warning, note);
5232
+ }
5233
+ }
5031
5234
  function defaultErrorCodeForResult(result) {
5032
5235
  switch (result) {
5033
5236
  case RESULTS.AuthenticationError:
@@ -5110,8 +5313,14 @@ var OutputFormatter;
5110
5313
  }
5111
5314
  const filter = getOutputFilter();
5112
5315
  if (filter) {
5113
- const filtered = applyFilter(data.Data, filter);
5316
+ let note;
5317
+ const filtered = applyFilter(data.Data, filter, (n) => {
5318
+ note = n;
5319
+ });
5114
5320
  data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
5321
+ if (note) {
5322
+ data.Warning = appendWarning(data.Warning, note);
5323
+ }
5115
5324
  }
5116
5325
  logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
5117
5326
  }
@@ -5139,6 +5348,7 @@ var OutputFormatter;
5139
5348
  delete envelope.TelemetryErrorClass;
5140
5349
  delete envelope.TelemetryTerminalOutcome;
5141
5350
  delete envelope.TelemetryTerminalSignal;
5351
+ filterFailureData(envelope);
5142
5352
  if (!suppressTelemetry) {
5143
5353
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
5144
5354
  result: data.Result,
@@ -5187,13 +5397,20 @@ var OutputFormatter;
5187
5397
  OutputFormatter.log = log;
5188
5398
  function formatToString(data) {
5189
5399
  const filter = getOutputFilter();
5400
+ const envelope = data;
5190
5401
  if ("Data" in data && data.Data != null) {
5191
5402
  data.Data = normalizeDataKeys(data.Data);
5192
5403
  if (filter) {
5193
- data.Data = normalizeDataKeys(applyFilter(data.Data, filter));
5404
+ let note;
5405
+ data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
5406
+ note = n;
5407
+ }));
5408
+ if (note) {
5409
+ envelope.Warning = appendWarning(envelope.Warning, note);
5410
+ }
5194
5411
  }
5195
5412
  }
5196
- const output = normalizeOutputKeys(data);
5413
+ const output = normalizeOutputKeys(envelope);
5197
5414
  const lines = [];
5198
5415
  const sink = getOutputSink();
5199
5416
  printOutput(output, getOutputFormat(), (msg) => {
@@ -7368,4 +7585,4 @@ var TENANT_SELECTION_CODES = new Set([
7368
7585
  ]);
7369
7586
  export { catchError, extractErrorMessage, extractErrorMessageSync, RESULTS, OutputFormatter, classifiedFailure, Command, Option, processContext, isGuid, createHiddenDeprecatedTenantOption, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, getLoginStatusAsync, getAuthContext };
7370
7587
 
7371
- //# debugId=2BD0227A2166399C64756E2164756E21
7588
+ //# debugId=951E917FD24FFD6464756E2164756E21
@@ -3,7 +3,7 @@ import {
3
3
  getAuthContext,
4
4
  getSdkUserAgentToken,
5
5
  installSdkUserAgentHeader
6
- } from "./tool-pbamehqj.js";
6
+ } from "./tool-nxve7m74.js";
7
7
 
8
8
  // ../orchestrator-sdk/generated/src/runtime.ts
9
9
  var BASE_PATH = "https://alpha.uipath.com/uipattycyrhx/abizon_1/orchestrator_".replace(/\/+$/, "");
package/dist/tool.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./tool-7t97dx0m.js";
5
- import"./tool-pbamehqj.js";
4
+ } from "./tool-8fsjknks.js";
5
+ import"./tool-nxve7m74.js";
6
6
  import"./tool-bndhpxxj.js";
7
7
  import"./tool-1de529jm.js";
8
8
  export {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/tasks-tool",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.203.0-preview.233",
5
+ "version": "1.203.0-preview.237",
6
6
  "description": "Manage Action Center tasks.",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/"
@@ -18,5 +18,5 @@
18
18
  "files": [
19
19
  "dist"
20
20
  ],
21
- "gitHead": "641614a6f9817662baaf51dabdebbfa2a9334b1b"
21
+ "gitHead": "4ad3e17a66f2c7fb7fe1f0e3e04a5b6175a0a9a3"
22
22
  }