@uipath/tasks-tool 1.202.1-preview.220 → 1.202.1-preview.239

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-9hhrssfa.js";
4
+ } from "./tool-gk51mzkn.js";
5
5
  import {
6
6
  OutputFormatter,
7
7
  RESULTS,
8
8
  catchError,
9
9
  extractErrorMessage,
10
10
  processContext
11
- } from "./tool-05ww08mw.js";
11
+ } from "./tool-eqtgrgf2.js";
12
12
  import {
13
13
  __commonJS,
14
14
  __require,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveFolder
3
- } from "./tool-9hhrssfa.js";
3
+ } from "./tool-gk51mzkn.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-05ww08mw.js";
11
+ } from "./tool-eqtgrgf2.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-k16zs3mn.js";
5
+ } from "./tool-gbz4ryjc.js";
6
6
  import {
7
7
  Command
8
- } from "./tool-05ww08mw.js";
8
+ } from "./tool-eqtgrgf2.js";
9
9
  import"./tool-bndhpxxj.js";
10
10
  import"./tool-1de529jm.js";
11
11
 
@@ -4760,7 +4760,165 @@ class FilterImplicitLimitError extends Error {
4760
4760
  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).";
4761
4761
  }
4762
4762
  }
4763
- function applyFilter(data, filter) {
4763
+ function countRecords(data) {
4764
+ if (Array.isArray(data))
4765
+ return data.length;
4766
+ return data == null ? 0 : 1;
4767
+ }
4768
+ function availableFields(data) {
4769
+ const records = Array.isArray(data) ? data : [data];
4770
+ const keys = new Set;
4771
+ for (const record of records) {
4772
+ if (record && typeof record === "object" && !Array.isArray(record)) {
4773
+ for (const key of Object.keys(record))
4774
+ keys.add(key);
4775
+ }
4776
+ }
4777
+ return [...keys];
4778
+ }
4779
+ function decodeQuotedIdentifier(whole, inner) {
4780
+ const [error, decoded] = catchError(() => JSON.parse(whole));
4781
+ if (!error && typeof decoded === "string")
4782
+ return decoded;
4783
+ return inner.replace(/\\(.)/g, "$1");
4784
+ }
4785
+ function referencedFields(filter) {
4786
+ const top = new Set;
4787
+ const nested = new Set;
4788
+ const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
4789
+ const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
4790
+ const quoted = [];
4791
+ const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
4792
+ const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
4793
+ if (!isAlias) {
4794
+ quoted.push({
4795
+ name: decodeQuotedIdentifier(whole, name),
4796
+ index,
4797
+ tail: isPathTail(withoutValueLiterals, index)
4798
+ });
4799
+ }
4800
+ return `"${" ".repeat(whole.length - 2)}"`;
4801
+ });
4802
+ const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
4803
+ const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
4804
+ const place = (name, index, tail) => {
4805
+ if (tail || index >= rootEnd)
4806
+ nested.add(name);
4807
+ else
4808
+ top.add(name);
4809
+ };
4810
+ for (const entry of quoted)
4811
+ place(entry.name, entry.index, entry.tail);
4812
+ const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
4813
+ const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
4814
+ for (const match of identifiers) {
4815
+ const [, name, trailing] = match;
4816
+ if (trailing || reserved.has(name))
4817
+ continue;
4818
+ place(name, match.index, isPathTail(withoutLiterals, match.index));
4819
+ }
4820
+ return {
4821
+ top: [...top],
4822
+ nested: [...nested].filter((name) => !top.has(name)),
4823
+ hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
4824
+ };
4825
+ }
4826
+ function appearsBelowTopLevel(data, name) {
4827
+ let budget = 2000;
4828
+ const visit = (value, depth) => {
4829
+ if (budget-- <= 0 || depth > 4)
4830
+ return false;
4831
+ if (value === null || typeof value !== "object")
4832
+ return false;
4833
+ if (Array.isArray(value))
4834
+ return value.some((entry) => visit(entry, depth));
4835
+ const record = value;
4836
+ if (depth > 0 && Object.hasOwn(record, name))
4837
+ return true;
4838
+ return Object.values(record).some((entry) => visit(entry, depth + 1));
4839
+ };
4840
+ return visit(data, 0);
4841
+ }
4842
+ function alwaysNullKeys(records) {
4843
+ const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
4844
+ if (objects.length === 0 || objects.length !== records.length)
4845
+ return [];
4846
+ const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
4847
+ if (keys.length === 0)
4848
+ return [];
4849
+ const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
4850
+ return nullKeys.length === keys.length ? nullKeys : [];
4851
+ }
4852
+ function carriesOnlyNulls(value) {
4853
+ if (value === null)
4854
+ return true;
4855
+ if (Array.isArray(value)) {
4856
+ return value.length > 0 && value.every(carriesOnlyNulls);
4857
+ }
4858
+ if (typeof value === "object" && value !== undefined) {
4859
+ const values = Object.values(value);
4860
+ return values.length > 0 && values.every(carriesOnlyNulls);
4861
+ }
4862
+ return false;
4863
+ }
4864
+ function nameList(names, cap2 = 12) {
4865
+ const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
4866
+ const rest = names.length - shown.length;
4867
+ return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
4868
+ }
4869
+ function buildFilterWarning(filter, data, outcome) {
4870
+ const present = availableFields(data);
4871
+ const refs = referencedFields(filter);
4872
+ const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
4873
+ const unchecked = refs.nested.filter((name) => !present.includes(name));
4874
+ const count = countRecords(data);
4875
+ const scope = `${count} record(s)`;
4876
+ const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
4877
+ 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" : "";
4878
+ const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
4879
+ let detail;
4880
+ let lede;
4881
+ if (outcome.kind === "null-elements") {
4882
+ lede = "returned only null values";
4883
+ const projected = `all ${outcome.count} of the elements it projected are null`;
4884
+ if (unknown.length > 0) {
4885
+ detail = `${projected}, because ${isNotAField(unknown)}`;
4886
+ } else if (unchecked.length > 0) {
4887
+ detail = withSoundness(projected);
4888
+ } else {
4889
+ 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`;
4890
+ }
4891
+ } else if (outcome.kind === "null-rows") {
4892
+ lede = "returned only null values";
4893
+ const projected = `every value it projected is null on all ${outcome.count} row(s)`;
4894
+ detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
4895
+ } else if (outcome.kind === "null-values") {
4896
+ lede = "returned only null values";
4897
+ const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
4898
+ const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
4899
+ if (sameSet) {
4900
+ detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
4901
+ } else if (unknown.length > 0) {
4902
+ detail = `${projected}, because ${isNotAField(unknown)}`;
4903
+ } else {
4904
+ detail = withSoundness(`${projected} on all ${scope}`);
4905
+ }
4906
+ } else {
4907
+ lede = "returned nothing";
4908
+ if (unknown.length > 0) {
4909
+ detail = isNotAField(unknown);
4910
+ } else {
4911
+ const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
4912
+ detail = withSoundness(`${selection} — it read ${scope}`);
4913
+ }
4914
+ }
4915
+ const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
4916
+ return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
4917
+ }
4918
+ function appendWarning(existing, note) {
4919
+ return existing ? `${existing} ${note}` : note;
4920
+ }
4921
+ function applyFilter(data, filter, onWarning) {
4764
4922
  const codec = requireJmespath();
4765
4923
  let result;
4766
4924
  try {
@@ -4768,9 +4926,34 @@ function applyFilter(data, filter) {
4768
4926
  } catch (err) {
4769
4927
  throw new FilterEvaluationError(filter, err);
4770
4928
  }
4771
- if (result == null)
4929
+ const inputCount = countRecords(data);
4930
+ const warn = (outcome) => {
4931
+ if (inputCount === 0)
4932
+ return;
4933
+ const note = buildFilterWarning(filter, data, outcome);
4934
+ getOutputSink().writeErr(`[WARN] ${note}
4935
+ `);
4936
+ onWarning?.(note);
4937
+ };
4938
+ const warnIfAllNull = (records) => {
4939
+ const keys = alwaysNullKeys(records);
4940
+ if (keys.length > 0)
4941
+ warn({ kind: "null-values", keys });
4942
+ };
4943
+ if (result == null) {
4944
+ warn({ kind: "empty" });
4772
4945
  return [];
4946
+ }
4773
4947
  if (Array.isArray(result)) {
4948
+ if (result.length === 0) {
4949
+ warn({ kind: "empty" });
4950
+ } else if (result.every((entry) => entry === null)) {
4951
+ warn({ kind: "null-elements", count: result.length });
4952
+ } else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
4953
+ warn({ kind: "null-rows", count: result.length });
4954
+ } else {
4955
+ warnIfAllNull(result);
4956
+ }
4774
4957
  if (result.length > 0 && typeof result[0] !== "object") {
4775
4958
  const fieldMatch = filter.match(/\.(\w+)$/);
4776
4959
  const key = fieldMatch ? fieldMatch[1] : "Value";
@@ -4778,10 +4961,30 @@ function applyFilter(data, filter) {
4778
4961
  }
4779
4962
  return result;
4780
4963
  }
4781
- if (typeof result === "object")
4964
+ if (typeof result === "object") {
4965
+ warnIfAllNull([result]);
4782
4966
  return result;
4967
+ }
4783
4968
  return { Value: result };
4784
4969
  }
4970
+ function filterFailureData(envelope) {
4971
+ const filter = getOutputFilter();
4972
+ const data = envelope.Data;
4973
+ if (!filter || data == null)
4974
+ return;
4975
+ let note;
4976
+ const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
4977
+ note = n;
4978
+ }));
4979
+ if (filterError) {
4980
+ envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
4981
+ return;
4982
+ }
4983
+ envelope.Data = filtered;
4984
+ if (note) {
4985
+ envelope.Warning = appendWarning(envelope.Warning, note);
4986
+ }
4987
+ }
4785
4988
  function defaultErrorCodeForResult(result) {
4786
4989
  switch (result) {
4787
4990
  case RESULTS.AuthenticationError:
@@ -4864,8 +5067,14 @@ var OutputFormatter;
4864
5067
  }
4865
5068
  const filter = getOutputFilter();
4866
5069
  if (filter) {
4867
- const filtered = applyFilter(data.Data, filter);
5070
+ let note;
5071
+ const filtered = applyFilter(data.Data, filter, (n) => {
5072
+ note = n;
5073
+ });
4868
5074
  data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
5075
+ if (note) {
5076
+ data.Warning = appendWarning(data.Warning, note);
5077
+ }
4869
5078
  }
4870
5079
  logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
4871
5080
  }
@@ -4893,6 +5102,7 @@ var OutputFormatter;
4893
5102
  delete envelope.TelemetryErrorClass;
4894
5103
  delete envelope.TelemetryTerminalOutcome;
4895
5104
  delete envelope.TelemetryTerminalSignal;
5105
+ filterFailureData(envelope);
4896
5106
  if (!suppressTelemetry) {
4897
5107
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
4898
5108
  result: data.Result,
@@ -4941,13 +5151,20 @@ var OutputFormatter;
4941
5151
  OutputFormatter.log = log;
4942
5152
  function formatToString(data) {
4943
5153
  const filter = getOutputFilter();
5154
+ const envelope = data;
4944
5155
  if ("Data" in data && data.Data != null) {
4945
5156
  data.Data = normalizeDataKeys(data.Data);
4946
5157
  if (filter) {
4947
- data.Data = normalizeDataKeys(applyFilter(data.Data, filter));
5158
+ let note;
5159
+ data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
5160
+ note = n;
5161
+ }));
5162
+ if (note) {
5163
+ envelope.Warning = appendWarning(envelope.Warning, note);
5164
+ }
4948
5165
  }
4949
5166
  }
4950
- const output = normalizeOutputKeys(data);
5167
+ const output = normalizeOutputKeys(envelope);
4951
5168
  const lines = [];
4952
5169
  const sink = getOutputSink();
4953
5170
  printOutput(output, getOutputFormat(), (msg) => {
@@ -7119,4 +7336,4 @@ var TENANT_SELECTION_CODES = new Set([
7119
7336
  ]);
7120
7337
  export { catchError, extractErrorMessage, extractErrorMessageSync, RESULTS, OutputFormatter, classifiedFailure, Command, Option, processContext, isGuid, createHiddenDeprecatedTenantOption, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, getLoginStatusAsync, getAuthContext };
7121
7338
 
7122
- //# debugId=7999BA8FAB3AE47864756E2164756E21
7339
+ //# debugId=81D03E1ABAB6009064756E2164756E21
@@ -9,7 +9,7 @@ import {
9
9
  extractErrorMessageSync,
10
10
  getLoginStatusAsync,
11
11
  processContext
12
- } from "./tool-05ww08mw.js";
12
+ } from "./tool-eqtgrgf2.js";
13
13
  import {
14
14
  require_src
15
15
  } from "./tool-bndhpxxj.js";
@@ -4502,7 +4502,7 @@ var require_src6 = __commonJS(function(exports) {
4502
4502
  var package_default = {
4503
4503
  name: "@uipath/tasks-tool",
4504
4504
  license: "SEE LICENSE IN LICENSE.txt",
4505
- version: "1.202.1-preview.220",
4505
+ version: "1.202.1-preview.239",
4506
4506
  description: "Manage Action Center tasks.",
4507
4507
  publishConfig: {
4508
4508
  registry: "https://npm.pkg.github.com/"
@@ -18596,11 +18596,11 @@ async function resolveFolderScope(options) {
18596
18596
  return parseIntArg(options.folderId, "--folder-id");
18597
18597
  }
18598
18598
  if (options.folderKey !== undefined) {
18599
- const { resolveFolderIdByKey } = await import("./folder-resolver-5jr9tqww.js");
18599
+ const { resolveFolderIdByKey } = await import("./folder-resolver-nbkkjqtv.js");
18600
18600
  return resolveFolderIdByKey(options.folderKey, options.tenant);
18601
18601
  }
18602
18602
  if (options.folderPath !== undefined) {
18603
- const { resolveFolderIdByPath } = await import("./folder-resolver-5jr9tqww.js");
18603
+ const { resolveFolderIdByPath } = await import("./folder-resolver-nbkkjqtv.js");
18604
18604
  return resolveFolderIdByPath(options.folderPath, options.tenant);
18605
18605
  }
18606
18606
  return;
@@ -18620,7 +18620,7 @@ async function resolveFolderId(options, missingFolderInstructions = DEFAULT_FOLD
18620
18620
  processContext.exit(1);
18621
18621
  return null;
18622
18622
  }
18623
- const { pickFolderInteractively } = await import("./folder-picker-interactive-brx8jtbq.js");
18623
+ const { pickFolderInteractively } = await import("./folder-picker-interactive-q8pfrpdp.js");
18624
18624
  return pickFolderInteractively(options.tenant);
18625
18625
  }
18626
18626
 
@@ -19442,4 +19442,4 @@ var registerCommands = async (program) => {
19442
19442
 
19443
19443
  export { metadata, registerCommands };
19444
19444
 
19445
- //# debugId=1BEB30B4FC6890E464756E2164756E21
19445
+ //# debugId=A8CD6053F83A95D264756E2164756E21
@@ -3,7 +3,7 @@ import {
3
3
  getAuthContext,
4
4
  getSdkUserAgentToken,
5
5
  installSdkUserAgentHeader
6
- } from "./tool-05ww08mw.js";
6
+ } from "./tool-eqtgrgf2.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-k16zs3mn.js";
5
- import"./tool-05ww08mw.js";
4
+ } from "./tool-gbz4ryjc.js";
5
+ import"./tool-eqtgrgf2.js";
6
6
  import"./tool-bndhpxxj.js";
7
7
  import"./tool-1de529jm.js";
8
8
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/tasks-tool",
3
3
  "license": "SEE LICENSE IN LICENSE.txt",
4
- "version": "1.202.1-preview.220",
4
+ "version": "1.202.1-preview.239",
5
5
  "description": "Manage Action Center tasks.",
6
6
  "publishConfig": {
7
7
  "registry": "https://registry.npmjs.org/"
@@ -17,5 +17,5 @@
17
17
  "files": [
18
18
  "dist"
19
19
  ],
20
- "gitHead": "a09041733b628c3f6b658a1f58349ea0f40bb492"
20
+ "gitHead": "97545a7857bdff7e6db62bbe13c6097607cf38f1"
21
21
  }