@uipath/codedapp-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,3 +1,9 @@
1
+ import {
2
+ JsonSerializerFactory,
3
+ JsonSerializerNames,
4
+ JsonSerializerProxy,
5
+ StreamSerializer
6
+ } from "./packager-tool-gdtpsdn7.js";
1
7
  import {
2
8
  FirstPartyServiceApi
3
9
  } from "./packager-tool-53w8skv5.js";
@@ -12,23 +18,17 @@ import {
12
18
  logger,
13
19
  normalizeProjectType,
14
20
  toPortableRelativePath
15
- } from "./packager-tool-f1ptyxe1.js";
21
+ } from "./packager-tool-pwx9dvyr.js";
16
22
  import {
17
23
  getAuthContext,
18
24
  getLoginStatusAsync
19
- } from "./packager-tool-bvm4jqr1.js";
25
+ } from "./packager-tool-s4qh4pdq.js";
26
+ import"./packager-tool-aybzcdfg.js";
20
27
  import"./packager-tool-0gctz400.js";
21
28
  import {
22
29
  getFileSystem
23
30
  } from "./packager-tool-qyctya2j.js";
24
31
  import"./packager-tool-yc4kw997.js";
25
- import"./packager-tool-aybzcdfg.js";
26
- import {
27
- JsonSerializerFactory,
28
- JsonSerializerNames,
29
- JsonSerializerProxy,
30
- StreamSerializer
31
- } from "./packager-tool-gdtpsdn7.js";
32
32
  import {
33
33
  __commonJS,
34
34
  __require,
@@ -18540,4 +18540,4 @@ export {
18540
18540
  writeSolutionFile
18541
18541
  };
18542
18542
 
18543
- //# debugId=283F0F1B0D7C84F564756E2164756E21
18543
+ //# debugId=3D2CBDB923E4BF3C64756E2164756E21
@@ -50,6 +50,7 @@ import {
50
50
  parseAuthFlow,
51
51
  parseJWT,
52
52
  readAuthFromEnv,
53
+ readTokenScopes,
53
54
  refreshAccessToken,
54
55
  refreshTokenFingerprint,
55
56
  registerRobotClientLoader,
@@ -64,7 +65,7 @@ import {
64
65
  selectTenantWithDeps,
65
66
  setActiveAuthProfile,
66
67
  setAuthFileConfig
67
- } from "./packager-tool-bvm4jqr1.js";
68
+ } from "./packager-tool-s4qh4pdq.js";
68
69
  import {
69
70
  isBrowser,
70
71
  isNode
@@ -135,6 +136,7 @@ export {
135
136
  parseAuthFlow,
136
137
  parseJWT,
137
138
  readAuthFromEnv,
139
+ readTokenScopes,
138
140
  refreshAccessToken,
139
141
  refreshTokenFingerprint,
140
142
  registerRobotClientLoader,
@@ -151,4 +153,4 @@ export {
151
153
  setAuthFileConfig
152
154
  };
153
155
 
154
- //# debugId=06C873373E697BCA64756E2164756E21
156
+ //# debugId=8EB6A76369340FBD64756E2164756E21
package/dist/index.js CHANGED
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  metadata,
4
4
  registerCommands
5
- } from "./packager-tool-7cqx6z4h.js";
5
+ } from "./packager-tool-hke9s6yg.js";
6
6
  import {
7
7
  Command
8
- } from "./packager-tool-f1ptyxe1.js";
9
- import"./packager-tool-bvm4jqr1.js";
8
+ } from "./packager-tool-pwx9dvyr.js";
9
+ import"./packager-tool-s4qh4pdq.js";
10
+ import"./packager-tool-8cpdcx34.js";
11
+ import"./packager-tool-aybzcdfg.js";
10
12
  import"./packager-tool-0gctz400.js";
11
13
  import"./packager-tool-qyctya2j.js";
12
14
  import"./packager-tool-yc4kw997.js";
13
- import"./packager-tool-7ssjxrp3.js";
14
- import"./packager-tool-aybzcdfg.js";
15
15
  import"./packager-tool-1yh8g550.js";
16
16
 
17
17
  // src/index.ts
@@ -11739,7 +11739,165 @@ class FilterImplicitLimitError extends Error {
11739
11739
  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).";
11740
11740
  }
11741
11741
  }
11742
- function applyFilter(data, filter) {
11742
+ function countRecords(data) {
11743
+ if (Array.isArray(data))
11744
+ return data.length;
11745
+ return data == null ? 0 : 1;
11746
+ }
11747
+ function availableFields(data) {
11748
+ const records = Array.isArray(data) ? data : [data];
11749
+ const keys = new Set;
11750
+ for (const record of records) {
11751
+ if (record && typeof record === "object" && !Array.isArray(record)) {
11752
+ for (const key of Object.keys(record))
11753
+ keys.add(key);
11754
+ }
11755
+ }
11756
+ return [...keys];
11757
+ }
11758
+ function decodeQuotedIdentifier(whole, inner) {
11759
+ const [error, decoded] = catchError(() => JSON.parse(whole));
11760
+ if (!error && typeof decoded === "string")
11761
+ return decoded;
11762
+ return inner.replace(/\\(.)/g, "$1");
11763
+ }
11764
+ function referencedFields(filter) {
11765
+ const top = new Set;
11766
+ const nested = new Set;
11767
+ const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
11768
+ const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
11769
+ const quoted = [];
11770
+ const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
11771
+ const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
11772
+ if (!isAlias) {
11773
+ quoted.push({
11774
+ name: decodeQuotedIdentifier(whole, name),
11775
+ index,
11776
+ tail: isPathTail(withoutValueLiterals, index)
11777
+ });
11778
+ }
11779
+ return `"${" ".repeat(whole.length - 2)}"`;
11780
+ });
11781
+ const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
11782
+ const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
11783
+ const place = (name, index, tail) => {
11784
+ if (tail || index >= rootEnd)
11785
+ nested.add(name);
11786
+ else
11787
+ top.add(name);
11788
+ };
11789
+ for (const entry of quoted)
11790
+ place(entry.name, entry.index, entry.tail);
11791
+ const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
11792
+ const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
11793
+ for (const match of identifiers) {
11794
+ const [, name, trailing] = match;
11795
+ if (trailing || reserved.has(name))
11796
+ continue;
11797
+ place(name, match.index, isPathTail(withoutLiterals, match.index));
11798
+ }
11799
+ return {
11800
+ top: [...top],
11801
+ nested: [...nested].filter((name) => !top.has(name)),
11802
+ hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
11803
+ };
11804
+ }
11805
+ function appearsBelowTopLevel(data, name) {
11806
+ let budget = 2000;
11807
+ const visit = (value, depth) => {
11808
+ if (budget-- <= 0 || depth > 4)
11809
+ return false;
11810
+ if (value === null || typeof value !== "object")
11811
+ return false;
11812
+ if (Array.isArray(value))
11813
+ return value.some((entry) => visit(entry, depth));
11814
+ const record = value;
11815
+ if (depth > 0 && Object.hasOwn(record, name))
11816
+ return true;
11817
+ return Object.values(record).some((entry) => visit(entry, depth + 1));
11818
+ };
11819
+ return visit(data, 0);
11820
+ }
11821
+ function alwaysNullKeys(records) {
11822
+ const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
11823
+ if (objects.length === 0 || objects.length !== records.length)
11824
+ return [];
11825
+ const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
11826
+ if (keys.length === 0)
11827
+ return [];
11828
+ const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
11829
+ return nullKeys.length === keys.length ? nullKeys : [];
11830
+ }
11831
+ function carriesOnlyNulls(value) {
11832
+ if (value === null)
11833
+ return true;
11834
+ if (Array.isArray(value)) {
11835
+ return value.length > 0 && value.every(carriesOnlyNulls);
11836
+ }
11837
+ if (typeof value === "object" && value !== undefined) {
11838
+ const values = Object.values(value);
11839
+ return values.length > 0 && values.every(carriesOnlyNulls);
11840
+ }
11841
+ return false;
11842
+ }
11843
+ function nameList(names, cap2 = 12) {
11844
+ const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
11845
+ const rest = names.length - shown.length;
11846
+ return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
11847
+ }
11848
+ function buildFilterWarning(filter, data, outcome) {
11849
+ const present = availableFields(data);
11850
+ const refs = referencedFields(filter);
11851
+ const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
11852
+ const unchecked = refs.nested.filter((name) => !present.includes(name));
11853
+ const count = countRecords(data);
11854
+ const scope = `${count} record(s)`;
11855
+ const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
11856
+ 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" : "";
11857
+ const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
11858
+ let detail;
11859
+ let lede;
11860
+ if (outcome.kind === "null-elements") {
11861
+ lede = "returned only null values";
11862
+ const projected = `all ${outcome.count} of the elements it projected are null`;
11863
+ if (unknown.length > 0) {
11864
+ detail = `${projected}, because ${isNotAField(unknown)}`;
11865
+ } else if (unchecked.length > 0) {
11866
+ detail = withSoundness(projected);
11867
+ } else {
11868
+ 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`;
11869
+ }
11870
+ } else if (outcome.kind === "null-rows") {
11871
+ lede = "returned only null values";
11872
+ const projected = `every value it projected is null on all ${outcome.count} row(s)`;
11873
+ detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
11874
+ } else if (outcome.kind === "null-values") {
11875
+ lede = "returned only null values";
11876
+ const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
11877
+ const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
11878
+ if (sameSet) {
11879
+ detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
11880
+ } else if (unknown.length > 0) {
11881
+ detail = `${projected}, because ${isNotAField(unknown)}`;
11882
+ } else {
11883
+ detail = withSoundness(`${projected} on all ${scope}`);
11884
+ }
11885
+ } else {
11886
+ lede = "returned nothing";
11887
+ if (unknown.length > 0) {
11888
+ detail = isNotAField(unknown);
11889
+ } else {
11890
+ const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
11891
+ detail = withSoundness(`${selection} — it read ${scope}`);
11892
+ }
11893
+ }
11894
+ const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
11895
+ return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
11896
+ }
11897
+ function appendWarning(existing, note) {
11898
+ return existing ? `${existing} ${note}` : note;
11899
+ }
11900
+ function applyFilter(data, filter, onWarning) {
11743
11901
  const codec = requireJmespath();
11744
11902
  let result;
11745
11903
  try {
@@ -11747,9 +11905,34 @@ function applyFilter(data, filter) {
11747
11905
  } catch (err) {
11748
11906
  throw new FilterEvaluationError(filter, err);
11749
11907
  }
11750
- if (result == null)
11908
+ const inputCount = countRecords(data);
11909
+ const warn = (outcome) => {
11910
+ if (inputCount === 0)
11911
+ return;
11912
+ const note = buildFilterWarning(filter, data, outcome);
11913
+ getOutputSink().writeErr(`[WARN] ${note}
11914
+ `);
11915
+ onWarning?.(note);
11916
+ };
11917
+ const warnIfAllNull = (records) => {
11918
+ const keys = alwaysNullKeys(records);
11919
+ if (keys.length > 0)
11920
+ warn({ kind: "null-values", keys });
11921
+ };
11922
+ if (result == null) {
11923
+ warn({ kind: "empty" });
11751
11924
  return [];
11925
+ }
11752
11926
  if (Array.isArray(result)) {
11927
+ if (result.length === 0) {
11928
+ warn({ kind: "empty" });
11929
+ } else if (result.every((entry) => entry === null)) {
11930
+ warn({ kind: "null-elements", count: result.length });
11931
+ } else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
11932
+ warn({ kind: "null-rows", count: result.length });
11933
+ } else {
11934
+ warnIfAllNull(result);
11935
+ }
11753
11936
  if (result.length > 0 && typeof result[0] !== "object") {
11754
11937
  const fieldMatch = filter.match(/\.(\w+)$/);
11755
11938
  const key = fieldMatch ? fieldMatch[1] : "Value";
@@ -11757,10 +11940,30 @@ function applyFilter(data, filter) {
11757
11940
  }
11758
11941
  return result;
11759
11942
  }
11760
- if (typeof result === "object")
11943
+ if (typeof result === "object") {
11944
+ warnIfAllNull([result]);
11761
11945
  return result;
11946
+ }
11762
11947
  return { Value: result };
11763
11948
  }
11949
+ function filterFailureData(envelope) {
11950
+ const filter = getOutputFilter();
11951
+ const data = envelope.Data;
11952
+ if (!filter || data == null)
11953
+ return;
11954
+ let note;
11955
+ const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
11956
+ note = n;
11957
+ }));
11958
+ if (filterError) {
11959
+ envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
11960
+ return;
11961
+ }
11962
+ envelope.Data = filtered;
11963
+ if (note) {
11964
+ envelope.Warning = appendWarning(envelope.Warning, note);
11965
+ }
11966
+ }
11764
11967
  function defaultErrorCodeForResult(result) {
11765
11968
  switch (result) {
11766
11969
  case RESULTS.AuthenticationError:
@@ -11843,8 +12046,14 @@ var OutputFormatter;
11843
12046
  }
11844
12047
  const filter = getOutputFilter();
11845
12048
  if (filter) {
11846
- const filtered = applyFilter(data.Data, filter);
12049
+ let note;
12050
+ const filtered = applyFilter(data.Data, filter, (n) => {
12051
+ note = n;
12052
+ });
11847
12053
  data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
12054
+ if (note) {
12055
+ data.Warning = appendWarning(data.Warning, note);
12056
+ }
11848
12057
  }
11849
12058
  logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
11850
12059
  }
@@ -11872,6 +12081,7 @@ var OutputFormatter;
11872
12081
  delete envelope.TelemetryErrorClass;
11873
12082
  delete envelope.TelemetryTerminalOutcome;
11874
12083
  delete envelope.TelemetryTerminalSignal;
12084
+ filterFailureData(envelope);
11875
12085
  if (!suppressTelemetry) {
11876
12086
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
11877
12087
  result: data.Result,
@@ -11920,13 +12130,20 @@ var OutputFormatter;
11920
12130
  OutputFormatter2.log = log;
11921
12131
  function formatToString(data) {
11922
12132
  const filter = getOutputFilter();
12133
+ const envelope = data;
11923
12134
  if ("Data" in data && data.Data != null) {
11924
12135
  data.Data = normalizeDataKeys(data.Data);
11925
12136
  if (filter) {
11926
- data.Data = normalizeDataKeys(applyFilter(data.Data, filter));
12137
+ let note;
12138
+ data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
12139
+ note = n;
12140
+ }));
12141
+ if (note) {
12142
+ envelope.Warning = appendWarning(envelope.Warning, note);
12143
+ }
11927
12144
  }
11928
12145
  }
11929
- const output = normalizeOutputKeys(data);
12146
+ const output = normalizeOutputKeys(envelope);
11930
12147
  const lines = [];
11931
12148
  const sink = getOutputSink();
11932
12149
  printOutput(output, getOutputFormat(), (msg) => {
@@ -27215,4 +27432,4 @@ class WebAppContributingToolFactory extends WebAppToolFactory {
27215
27432
  }
27216
27433
  export { WEBAPP_MANIFEST_FILE_NAME, ACTION_SCHEMA_FILE_NAME, readProjectName, parseActionSchema, validateActionSchema, WebAppToolFactory, WebAppContributingToolFactory };
27217
27434
 
27218
- //# debugId=B1004F3D57AD230164756E2164756E21
27435
+ //# debugId=E0325ACE32335A5A64756E2164756E21
@@ -6,6 +6,7 @@ import {
6
6
  OutputFormatter,
7
7
  RESULTS,
8
8
  canPrompt,
9
+ carriedErrorCode,
9
10
  catchError,
10
11
  describeConnectivityError,
11
12
  extractErrorDetails,
@@ -22,13 +23,12 @@ import {
22
23
  requireConfirmation,
23
24
  trackShipSucceeded,
24
25
  tryRegisterProjectInParentSolution
25
- } from "./packager-tool-f1ptyxe1.js";
26
+ } from "./packager-tool-pwx9dvyr.js";
26
27
  import {
27
- getLoginStatusAsync
28
- } from "./packager-tool-bvm4jqr1.js";
29
- import {
30
- getFileSystem
31
- } from "./packager-tool-qyctya2j.js";
28
+ getLoginStatusAsync,
29
+ readTokenScopes,
30
+ resolveSessionIdentity
31
+ } from "./packager-tool-s4qh4pdq.js";
32
32
  import {
33
33
  ACTION_SCHEMA_FILE_NAME,
34
34
  WEBAPP_MANIFEST_FILE_NAME,
@@ -36,7 +36,10 @@ import {
36
36
  parseActionSchema,
37
37
  readProjectName,
38
38
  validateActionSchema
39
- } from "./packager-tool-7ssjxrp3.js";
39
+ } from "./packager-tool-8cpdcx34.js";
40
+ import {
41
+ getFileSystem
42
+ } from "./packager-tool-qyctya2j.js";
40
43
  import {
41
44
  __commonJS,
42
45
  __export,
@@ -20620,7 +20623,7 @@ var package_default = {
20620
20623
  name: "@uipath/codedapp-tool",
20621
20624
  author: "UiPath",
20622
20625
  license: "SEE LICENSE IN LICENSE.txt",
20623
- version: "1.203.0-preview.233",
20626
+ version: "1.203.0-preview.237",
20624
20627
  description: "Build, pack, publish, deploy, and manage UiPath Coded Web Applications.",
20625
20628
  keywords: [
20626
20629
  "cli-tool",
@@ -21414,6 +21417,7 @@ var MESSAGES = {
21414
21417
  AUTHENTICATION_FAILED: 'Authentication failed. Please check your UIPATH_ACCESS_TOKEN, run "uip login" to authenticate, or pass credentials via CLI flags',
21415
21418
  ACCESS_DENIED: "Access denied. You may not have permission to access this tenant/organization",
21416
21419
  API_ENDPOINT_NOT_FOUND: "API endpoint not found. Please check your UIPATH_BASE_URL configuration",
21420
+ APPS_SERVICE_APP_TOKEN_HINT: "The UiPath Apps service rejected this external application's token: it is missing the Apps.Read and Apps.Write scopes. Grant them to the external application (Admin > External Applications), then add them to 'uip login --scope'.",
21417
21421
  SERVER_ERROR: "Server error occurred. Please try again later or contact UiPath support",
21418
21422
  SERVICES_UNAVAILABLE: "UiPath services are temporarily unavailable. Please try again later",
21419
21423
  RATE_LIMIT_EXCEEDED: "Rate limit exceeded. Please wait and try again",
@@ -21630,7 +21634,7 @@ var MESSAGE_BUILDERS = {
21630
21634
  var getHttpErrorMessage = (status, context) => {
21631
21635
  switch (status) {
21632
21636
  case 401:
21633
- return MESSAGES.ERRORS.AUTHENTICATION_FAILED;
21637
+ return context ? `Authentication failed during ${context.toLowerCase()}. Please check your UIPATH_ACCESS_TOKEN, run "uip login" to authenticate, or pass credentials via CLI flags` : MESSAGES.ERRORS.AUTHENTICATION_FAILED;
21634
21638
  case 403:
21635
21639
  return context ? `Access denied. You may not have permission to ${context.toLowerCase()} in this tenant/organization` : MESSAGES.ERRORS.ACCESS_DENIED;
21636
21640
  case 404:
@@ -21785,10 +21789,23 @@ function buildAppUrl(params) {
21785
21789
  }
21786
21790
 
21787
21791
  // src/utils/error-handler.ts
21788
- async function createHttpErrorMessage(response, context) {
21792
+ var APPS_SCOPE_PREFIX = "Apps.";
21793
+ function appsServiceHint(status, appsServiceToken) {
21794
+ if (status !== 401 || !appsServiceToken)
21795
+ return;
21796
+ if (resolveSessionIdentity(appsServiceToken)?.type !== "Application") {
21797
+ return;
21798
+ }
21799
+ const scopes = readTokenScopes(appsServiceToken) ?? [];
21800
+ if (scopes.some((scope) => scope.startsWith(APPS_SCOPE_PREFIX))) {
21801
+ return;
21802
+ }
21803
+ return MESSAGES.ERRORS.APPS_SERVICE_APP_TOKEN_HINT;
21804
+ }
21805
+ async function createHttpErrorMessage(response, context, appsServiceToken) {
21789
21806
  const errorText = await response.text();
21790
- const userFriendlyMessage = getHttpErrorMessage(response.status, context);
21791
- let fullMessage = userFriendlyMessage;
21807
+ const hint = appsServiceHint(response.status, appsServiceToken);
21808
+ let fullMessage = hint ? `Authentication failed${context ? ` during ${context.toLowerCase()}` : ""}. ${hint}` : getHttpErrorMessage(response.status, context);
21792
21809
  if (errorText && errorText !== "{}" && errorText.trim() !== "") {
21793
21810
  fullMessage += `
21794
21811
  API Response: ${errorText}`;
@@ -21798,9 +21815,14 @@ HTTP ${response.status}: ${MESSAGES.ERRORS.NO_ERROR_DETAILS}`;
21798
21815
  }
21799
21816
  return fullMessage;
21800
21817
  }
21801
- async function handleHttpError(response, context) {
21802
- const errorMessage = await createHttpErrorMessage(response, context);
21803
- throw new Error(errorMessage);
21818
+ async function handleHttpError(response, context, appsServiceToken) {
21819
+ const errorMessage = await createHttpErrorMessage(response, context, appsServiceToken);
21820
+ const error = new Error(errorMessage);
21821
+ if (appsServiceHint(response.status, appsServiceToken)) {
21822
+ const errorCode = "permission_denied";
21823
+ Object.assign(error, { errorCode });
21824
+ }
21825
+ throw error;
21804
21826
  }
21805
21827
 
21806
21828
  // src/services/deployed-apps.ts
@@ -28557,8 +28579,13 @@ function isPersonalFolder(folder) {
28557
28579
  function matchesWorkspace(folder, personalWorkspace) {
28558
28580
  return personalWorkspace ? isPersonalFolder(folder) : !isPersonalFolder(folder);
28559
28581
  }
28560
- async function fetchFolders(baseUrl, accessToken, orgId, tenantName) {
28561
- const url = `${baseUrl}/${orgId}/${tenantName}/orchestrator_/api/Folders/GetAllForCurrentUser`;
28582
+ function sameFolderKey(a, b) {
28583
+ return a.toLowerCase() === b.toLowerCase();
28584
+ }
28585
+ var FOLDER_PAGE_SIZE = 100;
28586
+ var FOLDER_PAGE_LIMIT = 100;
28587
+ async function fetchFolderPage(baseUrl, accessToken, orgId, tenantName, skip) {
28588
+ const url = `${baseUrl}/${orgId}/${tenantName}/orchestrator_/api/Folders/GetAllForCurrentUser?take=${FOLDER_PAGE_SIZE}&skip=${skip}`;
28562
28589
  const response = await fetch(url, {
28563
28590
  headers: createHeaders({ bearerToken: accessToken })
28564
28591
  });
@@ -28567,12 +28594,34 @@ async function fetchFolders(baseUrl, accessToken, orgId, tenantName) {
28567
28594
  }
28568
28595
  const data = await response.json();
28569
28596
  const items = data.PageItems ?? data.value ?? [];
28570
- return items.map((item) => ({
28571
- key: String(item.Key ?? item.key ?? ""),
28572
- displayName: String(item.DisplayName ?? item.displayName ?? ""),
28573
- fullyQualifiedName: String(item.FullyQualifiedName ?? item.fullyQualifiedName ?? ""),
28574
- folderType: String(item.FolderType ?? item.folderType ?? "")
28575
- }));
28597
+ const count = data.Count ?? data.count;
28598
+ return {
28599
+ folders: items.map((item) => ({
28600
+ key: String(item.Key ?? item.key ?? ""),
28601
+ displayName: String(item.DisplayName ?? item.displayName ?? ""),
28602
+ fullyQualifiedName: String(item.FullyQualifiedName ?? item.fullyQualifiedName ?? ""),
28603
+ folderType: String(item.FolderType ?? item.folderType ?? "")
28604
+ })),
28605
+ total: typeof count === "number" ? count : null
28606
+ };
28607
+ }
28608
+ async function fetchFolders(baseUrl, accessToken, orgId, tenantName, stopEarly) {
28609
+ const all = [];
28610
+ for (let page = 0;page < FOLDER_PAGE_LIMIT; page++) {
28611
+ const { folders, total } = await fetchFolderPage(baseUrl, accessToken, orgId, tenantName, all.length);
28612
+ all.push(...folders);
28613
+ if (stopEarly?.(all))
28614
+ break;
28615
+ if (folders.length === 0)
28616
+ break;
28617
+ if (total !== null) {
28618
+ if (all.length >= total)
28619
+ break;
28620
+ } else if (folders.length < FOLDER_PAGE_SIZE) {
28621
+ break;
28622
+ }
28623
+ }
28624
+ return all;
28576
28625
  }
28577
28626
  async function promptFolderSelection(folders, logger2, personalWorkspace) {
28578
28627
  const filtered = personalWorkspace === undefined ? folders : folders.filter((f) => matchesWorkspace(f, personalWorkspace));
@@ -28619,13 +28668,12 @@ async function promptFolderSelection(folders, logger2, personalWorkspace) {
28619
28668
  return selection;
28620
28669
  }
28621
28670
  async function validateExplicitFolderKey(folderKey, personalWorkspace, baseUrl, accessToken, orgId, tenantName) {
28622
- const [fetchErr, folders] = await catchError(fetchFolders(baseUrl, accessToken, orgId, tenantName));
28671
+ const [fetchErr, folders] = await catchError(fetchFolders(baseUrl, accessToken, orgId, tenantName, (gathered) => gathered.some((f) => sameFolderKey(f.key, folderKey))));
28623
28672
  if (fetchErr)
28624
28673
  return;
28625
- const match = folders.find((f) => f.key === folderKey);
28626
- if (!match) {
28627
- throw new Error(`Folder key '${folderKey}' was not found among folders accessible to your account. Re-check the key with 'uip or folders list --output json'.`);
28628
- }
28674
+ const match = folders.find((f) => sameFolderKey(f.key, folderKey));
28675
+ if (!match)
28676
+ return;
28629
28677
  if (!matchesWorkspace(match, personalWorkspace)) {
28630
28678
  const folderKind = isPersonalFolder(match) ? "a Personal Workspace" : "a shared tenant";
28631
28679
  const publishedAs = personalWorkspace ? "into your Personal Workspace" : "into the tenant feed";
@@ -28681,7 +28729,7 @@ async function getDeployedApp(appName, envConfig, legacyAppName) {
28681
28729
  if (response.status === HTTP_NOT_FOUND)
28682
28730
  continue;
28683
28731
  if (!response.ok)
28684
- await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT);
28732
+ await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT, envConfig.accessToken);
28685
28733
  return await response.json();
28686
28734
  }
28687
28735
  return null;
@@ -28706,7 +28754,7 @@ async function getPublishedAppByName(appName, envConfig, version) {
28706
28754
  })
28707
28755
  });
28708
28756
  if (!response.ok)
28709
- await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT);
28757
+ await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT, envConfig.accessToken);
28710
28758
  const data = await response.json();
28711
28759
  const matches = data.value.filter((app) => app.title === appName);
28712
28760
  if (matches.length === 0)
@@ -28732,7 +28780,7 @@ async function getAllPublishedVersions(systemName, envConfig) {
28732
28780
  })
28733
28781
  });
28734
28782
  if (!response.ok)
28735
- await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT);
28783
+ await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT, envConfig.accessToken);
28736
28784
  const data = await response.json();
28737
28785
  return data.value;
28738
28786
  }
@@ -28793,7 +28841,7 @@ async function deployNewApp(appName, routingName, systemName, deployVersion, env
28793
28841
  body: JSON.stringify(body)
28794
28842
  });
28795
28843
  if (!response.ok)
28796
- await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT);
28844
+ await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_DEPLOYMENT, envConfig.accessToken);
28797
28845
  const data = await response.json();
28798
28846
  return data.id;
28799
28847
  }
@@ -28872,7 +28920,7 @@ async function upgradeApp(params) {
28872
28920
  if (await waitForUpgradeToLand(params))
28873
28921
  return;
28874
28922
  }
28875
- await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_UPGRADE);
28923
+ await handleHttpError(response, MESSAGES.ERROR_CONTEXT.APP_UPGRADE, params.envConfig.accessToken);
28876
28924
  }
28877
28925
  async function updateAppConfig(update, logger2) {
28878
28926
  const fsys = getFileSystem();
@@ -29162,7 +29210,8 @@ var registerDeployCommand = (program) => {
29162
29210
  OutputFormatter.error({
29163
29211
  Result: RESULTS.Failure,
29164
29212
  Message: "Deploy failed",
29165
- Instructions: error2.message
29213
+ Instructions: error2.message,
29214
+ ErrorCode: carriedErrorCode(error2)
29166
29215
  });
29167
29216
  processContext.exit(1);
29168
29217
  return;
@@ -29411,7 +29460,7 @@ var package_default2 = {
29411
29460
  name: "@uipath/solution-sdk",
29412
29461
  author: "UiPath",
29413
29462
  license: "SEE LICENSE IN LICENSE.txt",
29414
- version: "1.203.0-preview.233",
29463
+ version: "1.203.0-preview.237",
29415
29464
  repository: {
29416
29465
  type: "git",
29417
29466
  url: "https://github.com/UiPath/cli.git",
@@ -29710,7 +29759,7 @@ var SUCCEEDED = "creationsucceeded";
29710
29759
  var TERMINAL = new Set([SUCCEEDED, "creationfailed", "validationfailed"]);
29711
29760
  // src/services/project-artifacts.ts
29712
29761
  async function ensureProjectArtifacts(args) {
29713
- const { addProjectArtifactsToSolutionAsync } = await import("./index-6zef5vcv.js");
29762
+ const { addProjectArtifactsToSolutionAsync } = await import("./index-c813fcbc.js");
29714
29763
  return addProjectArtifactsToSolutionAsync(args);
29715
29764
  }
29716
29765
 
@@ -30571,7 +30620,7 @@ async function registerCodedApp(metadata, envConfig, isActionApp, feedId, logger
30571
30620
  body: JSON.stringify(payload)
30572
30621
  });
30573
30622
  if (!response.ok) {
30574
- await handleHttpError(response, MESSAGES.ERROR_CONTEXT.CODED_APP_REGISTRATION);
30623
+ await handleHttpError(response, MESSAGES.ERROR_CONTEXT.CODED_APP_REGISTRATION, envConfig.accessToken);
30575
30624
  }
30576
30625
  return await response.json();
30577
30626
  }
@@ -30863,7 +30912,7 @@ var registerPublishCommand = (program) => {
30863
30912
  const failure = await extractErrorDetails(error2);
30864
30913
  OutputFormatter.error({
30865
30914
  Result: RESULTS.Failure,
30866
- ErrorCode: failure.errorCode,
30915
+ ErrorCode: carriedErrorCode(error2) ?? failure.errorCode,
30867
30916
  Message: `Publish failed: ${failure.message}`,
30868
30917
  Instructions: describeConnectivityError(error2)?.instructions ?? failure.details,
30869
30918
  Retry: failure.retry,
@@ -33728,7 +33777,7 @@ async function promptCreateNewSolution(envConfig, logger2) {
33728
33777
  async function persistProjectId(projectId, logger2) {
33729
33778
  const fs = getFileSystem();
33730
33779
  const [saveErr] = await catchError((async () => {
33731
- const { saveEnvFileAsync } = await import("./index-8yrjtchg.js");
33780
+ const { saveEnvFileAsync } = await import("./index-qy734f8k.js");
33732
33781
  const localEnvPath = fs.path.join(fs.env.cwd(), ".env");
33733
33782
  await saveEnvFileAsync({
33734
33783
  envPath: localEnvPath,
@@ -33936,4 +33985,4 @@ var registerCommands = async (program) => {
33936
33985
 
33937
33986
  export { metadata, registerCommands };
33938
33987
 
33939
- //# debugId=AD2D83837F55475664756E2164756E21
33988
+ //# debugId=731A14C85D301F7664756E2164756E21
@@ -4191,6 +4191,12 @@ function isCliErrorCode(value) {
4191
4191
  function isRetryHint(value) {
4192
4192
  return typeof value === "string" && RETRY_HINT_VALUES.has(value);
4193
4193
  }
4194
+ function carriedErrorCode(error) {
4195
+ if (!error || typeof error !== "object")
4196
+ return;
4197
+ const code = error.errorCode;
4198
+ return isCliErrorCode(code) ? code : undefined;
4199
+ }
4194
4200
  var RESULTS = {
4195
4201
  Success: "Success",
4196
4202
  Failure: "Failure",
@@ -4795,7 +4801,165 @@ class ConfigurationError extends Error {
4795
4801
  function isConfigurationError(error) {
4796
4802
  return typeof error === "object" && error !== null && "__brand" in error && error.__brand === "ConfigurationError";
4797
4803
  }
4798
- function applyFilter(data, filter) {
4804
+ function countRecords(data) {
4805
+ if (Array.isArray(data))
4806
+ return data.length;
4807
+ return data == null ? 0 : 1;
4808
+ }
4809
+ function availableFields(data) {
4810
+ const records = Array.isArray(data) ? data : [data];
4811
+ const keys = new Set;
4812
+ for (const record of records) {
4813
+ if (record && typeof record === "object" && !Array.isArray(record)) {
4814
+ for (const key of Object.keys(record))
4815
+ keys.add(key);
4816
+ }
4817
+ }
4818
+ return [...keys];
4819
+ }
4820
+ function decodeQuotedIdentifier(whole, inner) {
4821
+ const [error, decoded] = catchError(() => JSON.parse(whole));
4822
+ if (!error && typeof decoded === "string")
4823
+ return decoded;
4824
+ return inner.replace(/\\(.)/g, "$1");
4825
+ }
4826
+ function referencedFields(filter) {
4827
+ const top = new Set;
4828
+ const nested = new Set;
4829
+ const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
4830
+ const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
4831
+ const quoted = [];
4832
+ const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
4833
+ const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
4834
+ if (!isAlias) {
4835
+ quoted.push({
4836
+ name: decodeQuotedIdentifier(whole, name),
4837
+ index,
4838
+ tail: isPathTail(withoutValueLiterals, index)
4839
+ });
4840
+ }
4841
+ return `"${" ".repeat(whole.length - 2)}"`;
4842
+ });
4843
+ const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
4844
+ const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
4845
+ const place = (name, index, tail) => {
4846
+ if (tail || index >= rootEnd)
4847
+ nested.add(name);
4848
+ else
4849
+ top.add(name);
4850
+ };
4851
+ for (const entry of quoted)
4852
+ place(entry.name, entry.index, entry.tail);
4853
+ const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
4854
+ const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
4855
+ for (const match of identifiers) {
4856
+ const [, name, trailing] = match;
4857
+ if (trailing || reserved.has(name))
4858
+ continue;
4859
+ place(name, match.index, isPathTail(withoutLiterals, match.index));
4860
+ }
4861
+ return {
4862
+ top: [...top],
4863
+ nested: [...nested].filter((name) => !top.has(name)),
4864
+ hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
4865
+ };
4866
+ }
4867
+ function appearsBelowTopLevel(data, name) {
4868
+ let budget = 2000;
4869
+ const visit = (value, depth) => {
4870
+ if (budget-- <= 0 || depth > 4)
4871
+ return false;
4872
+ if (value === null || typeof value !== "object")
4873
+ return false;
4874
+ if (Array.isArray(value))
4875
+ return value.some((entry) => visit(entry, depth));
4876
+ const record = value;
4877
+ if (depth > 0 && Object.hasOwn(record, name))
4878
+ return true;
4879
+ return Object.values(record).some((entry) => visit(entry, depth + 1));
4880
+ };
4881
+ return visit(data, 0);
4882
+ }
4883
+ function alwaysNullKeys(records) {
4884
+ const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
4885
+ if (objects.length === 0 || objects.length !== records.length)
4886
+ return [];
4887
+ const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
4888
+ if (keys.length === 0)
4889
+ return [];
4890
+ const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
4891
+ return nullKeys.length === keys.length ? nullKeys : [];
4892
+ }
4893
+ function carriesOnlyNulls(value) {
4894
+ if (value === null)
4895
+ return true;
4896
+ if (Array.isArray(value)) {
4897
+ return value.length > 0 && value.every(carriesOnlyNulls);
4898
+ }
4899
+ if (typeof value === "object" && value !== undefined) {
4900
+ const values = Object.values(value);
4901
+ return values.length > 0 && values.every(carriesOnlyNulls);
4902
+ }
4903
+ return false;
4904
+ }
4905
+ function nameList(names, cap2 = 12) {
4906
+ const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
4907
+ const rest = names.length - shown.length;
4908
+ return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
4909
+ }
4910
+ function buildFilterWarning(filter, data, outcome) {
4911
+ const present = availableFields(data);
4912
+ const refs = referencedFields(filter);
4913
+ const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
4914
+ const unchecked = refs.nested.filter((name) => !present.includes(name));
4915
+ const count = countRecords(data);
4916
+ const scope = `${count} record(s)`;
4917
+ const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
4918
+ 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" : "";
4919
+ const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
4920
+ let detail;
4921
+ let lede;
4922
+ if (outcome.kind === "null-elements") {
4923
+ lede = "returned only null values";
4924
+ const projected = `all ${outcome.count} of the elements it projected are null`;
4925
+ if (unknown.length > 0) {
4926
+ detail = `${projected}, because ${isNotAField(unknown)}`;
4927
+ } else if (unchecked.length > 0) {
4928
+ detail = withSoundness(projected);
4929
+ } else {
4930
+ 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`;
4931
+ }
4932
+ } else if (outcome.kind === "null-rows") {
4933
+ lede = "returned only null values";
4934
+ const projected = `every value it projected is null on all ${outcome.count} row(s)`;
4935
+ detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
4936
+ } else if (outcome.kind === "null-values") {
4937
+ lede = "returned only null values";
4938
+ const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
4939
+ const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
4940
+ if (sameSet) {
4941
+ detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
4942
+ } else if (unknown.length > 0) {
4943
+ detail = `${projected}, because ${isNotAField(unknown)}`;
4944
+ } else {
4945
+ detail = withSoundness(`${projected} on all ${scope}`);
4946
+ }
4947
+ } else {
4948
+ lede = "returned nothing";
4949
+ if (unknown.length > 0) {
4950
+ detail = isNotAField(unknown);
4951
+ } else {
4952
+ const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
4953
+ detail = withSoundness(`${selection} — it read ${scope}`);
4954
+ }
4955
+ }
4956
+ const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
4957
+ return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
4958
+ }
4959
+ function appendWarning(existing, note) {
4960
+ return existing ? `${existing} ${note}` : note;
4961
+ }
4962
+ function applyFilter(data, filter, onWarning) {
4799
4963
  const codec = requireJmespath();
4800
4964
  let result;
4801
4965
  try {
@@ -4803,9 +4967,34 @@ function applyFilter(data, filter) {
4803
4967
  } catch (err) {
4804
4968
  throw new FilterEvaluationError(filter, err);
4805
4969
  }
4806
- if (result == null)
4970
+ const inputCount = countRecords(data);
4971
+ const warn = (outcome) => {
4972
+ if (inputCount === 0)
4973
+ return;
4974
+ const note = buildFilterWarning(filter, data, outcome);
4975
+ getOutputSink().writeErr(`[WARN] ${note}
4976
+ `);
4977
+ onWarning?.(note);
4978
+ };
4979
+ const warnIfAllNull = (records) => {
4980
+ const keys = alwaysNullKeys(records);
4981
+ if (keys.length > 0)
4982
+ warn({ kind: "null-values", keys });
4983
+ };
4984
+ if (result == null) {
4985
+ warn({ kind: "empty" });
4807
4986
  return [];
4987
+ }
4808
4988
  if (Array.isArray(result)) {
4989
+ if (result.length === 0) {
4990
+ warn({ kind: "empty" });
4991
+ } else if (result.every((entry) => entry === null)) {
4992
+ warn({ kind: "null-elements", count: result.length });
4993
+ } else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
4994
+ warn({ kind: "null-rows", count: result.length });
4995
+ } else {
4996
+ warnIfAllNull(result);
4997
+ }
4809
4998
  if (result.length > 0 && typeof result[0] !== "object") {
4810
4999
  const fieldMatch = filter.match(/\.(\w+)$/);
4811
5000
  const key = fieldMatch ? fieldMatch[1] : "Value";
@@ -4813,10 +5002,30 @@ function applyFilter(data, filter) {
4813
5002
  }
4814
5003
  return result;
4815
5004
  }
4816
- if (typeof result === "object")
5005
+ if (typeof result === "object") {
5006
+ warnIfAllNull([result]);
4817
5007
  return result;
5008
+ }
4818
5009
  return { Value: result };
4819
5010
  }
5011
+ function filterFailureData(envelope) {
5012
+ const filter = getOutputFilter();
5013
+ const data = envelope.Data;
5014
+ if (!filter || data == null)
5015
+ return;
5016
+ let note;
5017
+ const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
5018
+ note = n;
5019
+ }));
5020
+ if (filterError) {
5021
+ envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
5022
+ return;
5023
+ }
5024
+ envelope.Data = filtered;
5025
+ if (note) {
5026
+ envelope.Warning = appendWarning(envelope.Warning, note);
5027
+ }
5028
+ }
4820
5029
  function defaultErrorCodeForResult(result) {
4821
5030
  switch (result) {
4822
5031
  case RESULTS.AuthenticationError:
@@ -4899,8 +5108,14 @@ var OutputFormatter;
4899
5108
  }
4900
5109
  const filter = getOutputFilter();
4901
5110
  if (filter) {
4902
- const filtered = applyFilter(data.Data, filter);
5111
+ let note;
5112
+ const filtered = applyFilter(data.Data, filter, (n) => {
5113
+ note = n;
5114
+ });
4903
5115
  data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
5116
+ if (note) {
5117
+ data.Warning = appendWarning(data.Warning, note);
5118
+ }
4904
5119
  }
4905
5120
  logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
4906
5121
  }
@@ -4928,6 +5143,7 @@ var OutputFormatter;
4928
5143
  delete envelope.TelemetryErrorClass;
4929
5144
  delete envelope.TelemetryTerminalOutcome;
4930
5145
  delete envelope.TelemetryTerminalSignal;
5146
+ filterFailureData(envelope);
4931
5147
  if (!suppressTelemetry) {
4932
5148
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
4933
5149
  result: data.Result,
@@ -4976,13 +5192,20 @@ var OutputFormatter;
4976
5192
  OutputFormatter.log = log;
4977
5193
  function formatToString(data) {
4978
5194
  const filter = getOutputFilter();
5195
+ const envelope = data;
4979
5196
  if ("Data" in data && data.Data != null) {
4980
5197
  data.Data = normalizeDataKeys(data.Data);
4981
5198
  if (filter) {
4982
- data.Data = normalizeDataKeys(applyFilter(data.Data, filter));
5199
+ let note;
5200
+ data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
5201
+ note = n;
5202
+ }));
5203
+ if (note) {
5204
+ envelope.Warning = appendWarning(envelope.Warning, note);
5205
+ }
4983
5206
  }
4984
5207
  }
4985
- const output = normalizeOutputKeys(data);
5208
+ const output = normalizeOutputKeys(envelope);
4986
5209
  const lines = [];
4987
5210
  const sink = getOutputSink();
4988
5211
  printOutput(output, getOutputFormat(), (msg) => {
@@ -6194,6 +6417,6 @@ async function findSolutionFileUpward(fs, startDir) {
6194
6417
  }
6195
6418
  }
6196
6419
 
6197
- export { catchError, describeConnectivityError, extractErrorDetails, extractErrorMessage, getOutputSink, logger, RESULTS, EXIT_CODES, ConfigurationError, isConfigurationError, OutputFormatter, InvalidArgumentError, Command, Option, processContext, requireConfirmation, isGuid, canPrompt, registerPackageMetadataOptions, mapPackageMetadataOptions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, trackShipSucceeded, normalizeProjectType, toPortableRelativePath, tryRegisterProjectInParentSolution, findNearestParentUipxFile, findSolutionFileUpward };
6420
+ export { catchError, describeConnectivityError, extractErrorDetails, extractErrorMessage, getOutputSink, logger, carriedErrorCode, RESULTS, EXIT_CODES, ConfigurationError, isConfigurationError, OutputFormatter, InvalidArgumentError, Command, Option, processContext, requireConfirmation, isGuid, canPrompt, registerPackageMetadataOptions, mapPackageMetadataOptions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, trackShipSucceeded, normalizeProjectType, toPortableRelativePath, tryRegisterProjectInParentSolution, findNearestParentUipxFile, findSolutionFileUpward };
6198
6421
 
6199
- //# debugId=401ACF1EEAAA614364756E2164756E21
6422
+ //# debugId=BCF2BC47014651D464756E2164756E21
@@ -755,6 +755,12 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
755
755
  identity.clientId = clientId;
756
756
  return identity;
757
757
  };
758
+ var pickScopes = (claims) => {
759
+ const raw = claims?.scope;
760
+ const scopes = Array.isArray(raw) ? raw.filter((entry) => asString(entry) !== undefined) : typeof raw === "string" ? raw.split(/\s+/).filter(Boolean) : [];
761
+ return scopes.length > 0 ? scopes : undefined;
762
+ };
763
+ var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
758
764
 
759
765
  // ../auth/src/envAuth.ts
760
766
  var ENV_AUTH_ENABLE_VAR = "UIPATH_CLI_ENABLE_ENV_AUTH";
@@ -2435,6 +2441,6 @@ var authenticate = async ({
2435
2441
  });
2436
2442
  };
2437
2443
 
2438
- export { setAuthFileConfig, InvalidBaseUrlError, DEFAULT_AUTH_PROFILE, AuthProfileValidationError, normalizeAuthProfileName, setActiveAuthProfile, clearActiveAuthProfile, getActiveAuthProfile, runWithAuthProfile, resolveAuthProfileFilePath, getActiveAuthProfileFilePath, getAuthProfilesRootPath, resolveAuthProfileDirPath, listAuthProfileNamesAsync, authProfileExistsAsync, deleteAuthProfileAsync, parseJWT, parseAuthFlow, resolveSessionIdentity, ENV_AUTH_ENABLE_VAR, ENFORCE_ROBOT_AUTH_VAR, ENV_AUTH_VARS, EnvAuthConfigError, isEnvAuthEnabled, isRobotAuthEnforced, readAuthFromEnv, refreshTokenFingerprint, loadRefreshBreaker, saveRefreshBreaker, clearRefreshBreaker, registerRobotClientLoader, TokenRefreshOAuthError, isTokenRefreshOAuthFailure, refreshAccessToken, AUTH_FLOW_ENV_VAR, DEFAULT_AUTH_FILENAME, DEFAULT_ENV_FILENAME, resolveEnvFileLocationAsync, resolveEnvFilePathAsync, loadEnvFileAsync, saveEnvFileAsync, CredentialSource, getLoginStatusAsync, getLoginStatusWithDeps, getAuthContext, getAuthEnv, describeAuthProfilesAsync, ClientCredentialsAuthenticationError, clientCredentialsLogin, JWT_BEARER_ASSERTION_TYPE, FederatedCredentialsAuthenticationError, federatedCredentialsLogin, fetchTenantsAndOrganizations, TENANT_SELECTION_REQUIRED_CODE, INVALID_TENANT_CODE, TenantSelectionError, TenantSelectionRequiredError, InvalidTenantError, isTenantSelectionError, selectTenantWithDeps, interactiveLoginWithDeps, interactiveLogin, logoutWithDeps, logout, authenticate };
2444
+ export { setAuthFileConfig, InvalidBaseUrlError, DEFAULT_AUTH_PROFILE, AuthProfileValidationError, normalizeAuthProfileName, setActiveAuthProfile, clearActiveAuthProfile, getActiveAuthProfile, runWithAuthProfile, resolveAuthProfileFilePath, getActiveAuthProfileFilePath, getAuthProfilesRootPath, resolveAuthProfileDirPath, listAuthProfileNamesAsync, authProfileExistsAsync, deleteAuthProfileAsync, parseJWT, parseAuthFlow, resolveSessionIdentity, readTokenScopes, ENV_AUTH_ENABLE_VAR, ENFORCE_ROBOT_AUTH_VAR, ENV_AUTH_VARS, EnvAuthConfigError, isEnvAuthEnabled, isRobotAuthEnforced, readAuthFromEnv, refreshTokenFingerprint, loadRefreshBreaker, saveRefreshBreaker, clearRefreshBreaker, registerRobotClientLoader, TokenRefreshOAuthError, isTokenRefreshOAuthFailure, refreshAccessToken, AUTH_FLOW_ENV_VAR, DEFAULT_AUTH_FILENAME, DEFAULT_ENV_FILENAME, resolveEnvFileLocationAsync, resolveEnvFilePathAsync, loadEnvFileAsync, saveEnvFileAsync, CredentialSource, getLoginStatusAsync, getLoginStatusWithDeps, getAuthContext, getAuthEnv, describeAuthProfilesAsync, ClientCredentialsAuthenticationError, clientCredentialsLogin, JWT_BEARER_ASSERTION_TYPE, FederatedCredentialsAuthenticationError, federatedCredentialsLogin, fetchTenantsAndOrganizations, TENANT_SELECTION_REQUIRED_CODE, INVALID_TENANT_CODE, TenantSelectionError, TenantSelectionRequiredError, InvalidTenantError, isTenantSelectionError, selectTenantWithDeps, interactiveLoginWithDeps, interactiveLogin, logoutWithDeps, logout, authenticate };
2439
2445
 
2440
- //# debugId=E7AC7F320178FAB464756E2164756E21
2446
+ //# debugId=0F4AD7F11CFB99A664756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  WebAppContributingToolFactory
3
- } from "./packager-tool-7ssjxrp3.js";
3
+ } from "./packager-tool-8cpdcx34.js";
4
4
  import {
5
5
  toolsFactoryRepository
6
6
  } from "./packager-tool-aybzcdfg.js";
package/dist/tool.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./packager-tool-7cqx6z4h.js";
5
- import"./packager-tool-f1ptyxe1.js";
6
- import"./packager-tool-bvm4jqr1.js";
4
+ } from "./packager-tool-hke9s6yg.js";
5
+ import"./packager-tool-pwx9dvyr.js";
6
+ import"./packager-tool-s4qh4pdq.js";
7
+ import"./packager-tool-8cpdcx34.js";
8
+ import"./packager-tool-aybzcdfg.js";
7
9
  import"./packager-tool-0gctz400.js";
8
10
  import"./packager-tool-qyctya2j.js";
9
11
  import"./packager-tool-yc4kw997.js";
10
- import"./packager-tool-7ssjxrp3.js";
11
- import"./packager-tool-aybzcdfg.js";
12
12
  import"./packager-tool-1yh8g550.js";
13
13
  export {
14
14
  metadata,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/codedapp-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": "Build, pack, publish, deploy, and manage UiPath Coded Web Applications.",
7
7
  "keywords": [
8
8
  "cli-tool",
@@ -29,5 +29,5 @@
29
29
  "publishConfig": {
30
30
  "registry": "https://registry.npmjs.org/"
31
31
  },
32
- "gitHead": "641614a6f9817662baaf51dabdebbfa2a9334b1b"
32
+ "gitHead": "4ad3e17a66f2c7fb7fe1f0e3e04a5b6175a0a9a3"
33
33
  }