@uipath/common 1.202.0 → 1.203.0-preview.160

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.
@@ -5,13 +5,14 @@ compiled into its `dist/` output rather than installed alongside it.
5
5
  Their licences and copyright notices are reproduced here in full, as
6
6
  those licences require.
7
7
 
8
- 15 bundled dependencies:
8
+ 16 bundled dependencies:
9
9
 
10
10
  - bundle-name@4.1.0 — MIT
11
11
  - commander@14.0.3 — MIT
12
12
  - default-browser@5.5.0 — MIT
13
13
  - default-browser-id@5.0.1 — MIT
14
14
  - define-lazy-prop@3.0.0 — MIT
15
+ - fflate@0.8.3 — MIT
15
16
  - is-docker@3.0.0 — MIT
16
17
  - is-in-ssh@1.0.0 — MIT
17
18
  - is-inside-container@1.0.0 — MIT
@@ -128,6 +129,36 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
128
129
 
129
130
  ---
130
131
 
132
+ ## fflate@0.8.3
133
+
134
+ SPDX: MIT
135
+
136
+ ```
137
+ MIT License
138
+
139
+ Copyright (c) 2026 Arjun Barrett
140
+
141
+ Permission is hereby granted, free of charge, to any person obtaining a copy
142
+ of this software and associated documentation files (the "Software"), to deal
143
+ in the Software without restriction, including without limitation the rights
144
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
145
+ copies of the Software, and to permit persons to whom the Software is
146
+ furnished to do so, subject to the following conditions:
147
+
148
+ The above copyright notice and this permission notice shall be included in all
149
+ copies or substantial portions of the Software.
150
+
151
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
152
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
153
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
154
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
155
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
156
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
157
+ SOFTWARE.
158
+ ```
159
+
160
+ ---
161
+
131
162
  ## is-docker@3.0.0
132
163
 
133
164
  SPDX: MIT
@@ -1,3 +1,19 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __returnValue = (v) => v;
3
+ function __exportSetter(name, newValue) {
4
+ this[name] = __returnValue.bind(null, newValue);
5
+ }
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true,
11
+ configurable: true,
12
+ set: __exportSetter.bind(all, name)
13
+ });
14
+ };
15
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
16
+
1
17
  // src/telemetry/pseudonymize.ts
2
18
  var SHA256_K = new Uint32Array([
3
19
  1116352408,
@@ -278,4 +294,4 @@ export {
278
294
  describeThrownValue
279
295
  };
280
296
 
281
- //# debugId=523FB0079E2C37BE64756E2164756E21
297
+ //# debugId=DE1DC90C72EC55C764756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import type { Command, Help } from "commander";
2
2
  import { type CommandExample } from "./command-examples";
3
- import type { OutputFormat } from "./formatter";
3
+ import { type OutputFormat } from "./output-formats";
4
4
  export interface CommandHelpOption {
5
5
  Flags: string;
6
6
  Description: string;
@@ -1,3 +1,19 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __returnValue = (v) => v;
3
+ function __exportSetter(name, newValue) {
4
+ this[name] = __returnValue.bind(null, newValue);
5
+ }
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true,
11
+ configurable: true,
12
+ set: __exportSetter.bind(all, name)
13
+ });
14
+ };
15
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
16
+
1
17
  // src/entity-name-rules.ts
2
18
  var RESERVED_SQL_KEYWORDS_LOWER = new Set(["group", "order"]);
3
19
  var ENTITY_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]{2,99}$/;
@@ -238,4 +254,4 @@ export {
238
254
  validateName
239
255
  };
240
256
 
241
- //# debugId=DEFF72153B22EA2764756E2164756E21
257
+ //# debugId=BC3BF446F31CC06D64756E2164756E21
@@ -1,5 +1,6 @@
1
+ import { isOutputFormat, OUTPUT_FORMATS, type OutputFormat } from "./output-formats";
1
2
  import { type CommandErrorClass, type TerminalOutcome } from "./telemetry/command-terminal.js";
2
- export type OutputFormat = "table" | "json" | "yaml" | "plain";
3
+ export { isOutputFormat, OUTPUT_FORMATS, type OutputFormat };
3
4
  /**
4
5
  * Per-row highlight for interactive TABLE output only. Applied line-level
5
6
  * AFTER column padding, so width math never sees escape bytes; json/yaml/plain
@@ -24,6 +25,23 @@ export type RetryHint = (typeof RETRY_HINTS)[number];
24
25
  export declare function isCliErrorCode(value: unknown): value is CliErrorCode;
25
26
  /** Narrow an arbitrary value to a {@link RetryHint}. See {@link isCliErrorCode}. */
26
27
  export declare function isRetryHint(value: unknown): value is RetryHint;
28
+ /**
29
+ * The `ErrorCode` an error carries, when it classified itself.
30
+ *
31
+ * Companion to `carriedInstructions` (error-handler): a thrower that knows its
32
+ * failure mode can say so, and the renderer uses it instead of defaulting to
33
+ * `unknown_error`. Duck-typed and validated for the same reason — the error may
34
+ * have crossed a bundle boundary, and an unrecognised string must not reach the
35
+ * envelope as a code no consumer can branch on.
36
+ *
37
+ * Lives here, beside {@link isCliErrorCode}, rather than next to
38
+ * `carriedInstructions`: error-handler reaches formatter type-only on purpose,
39
+ * and a runtime edge from there pulls this module's telemetry imports into the
40
+ * browser bundle, which cannot require node builtins.
41
+ */
42
+ export declare function carriedErrorCode(error: unknown): CliErrorCode | undefined;
43
+ /** The `Retry` hint an error carries. See {@link carriedErrorCode}. */
44
+ export declare function carriedRetry(error: unknown): RetryHint | undefined;
27
45
  /** Canonical string constants for {@link ResultType} values. */
28
46
  export declare const RESULTS: {
29
47
  readonly Success: "Success";
@@ -167,6 +185,19 @@ export type StructuredOutput = SuccessOutput | FailureOutput;
167
185
  * with the exact same escaping the CLI applies on the wire.
168
186
  */
169
187
  export declare function escapeNonAscii(jsonText: string): string;
188
+ /**
189
+ * The text of a `{ message: "…" }` payload — a tool that returned prose rather
190
+ * than a record — or `null` for any other shape.
191
+ *
192
+ * Key casing varies: most tools go through PascalCase normalization, while ones
193
+ * that opt out with `preserveDataKeys` keep their own, so either is matched.
194
+ * Exported because every renderer that passes prose through untouched needs the
195
+ * same test, in this package and in the tool packages built on it.
196
+ *
197
+ * @param payload Candidate `Data` payload, of any shape.
198
+ * @returns The message text, or `null` when the payload is not a lone message.
199
+ */
200
+ export declare function extractSingleMessage(payload: unknown): string | null;
170
201
  /**
171
202
  * Check whether `filter` is a syntactically valid JMESPath expression.
172
203
  * Returns `null` when valid, otherwise the parser error.
@@ -223,6 +254,24 @@ export declare class FilterImplicitLimitError extends Error {
223
254
  readonly result: FailureResultType;
224
255
  constructor(defaultLimit: string);
225
256
  }
257
+ /**
258
+ * Thrown when connection configuration is missing or invalid — no base URL,
259
+ * no access token, GUIDs that don't parse, etc. Command reporters classify
260
+ * via {@link isConfigurationError} so they can emit a `ConfigError` envelope
261
+ * without matching on `error.message`.
262
+ *
263
+ * Uses a duck-type `__brand` rather than relying on `instanceof`, because each
264
+ * tool bundles its own copy of `@uipath/common` and class identity differs
265
+ * across bundle boundaries.
266
+ */
267
+ export declare class ConfigurationError extends Error {
268
+ readonly __brand: "ConfigurationError";
269
+ readonly errorCode: CliErrorCode;
270
+ readonly retry: RetryHint;
271
+ readonly result: FailureResultType;
272
+ constructor(message: string);
273
+ }
274
+ export declare function isConfigurationError(error: unknown): error is ConfigurationError;
226
275
  /**
227
276
  * OutputFormatter namespace for formatting and displaying output.
228
277
  */
package/dist/guid.js CHANGED
@@ -1,3 +1,19 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __returnValue = (v) => v;
3
+ function __exportSetter(name, newValue) {
4
+ this[name] = __returnValue.bind(null, newValue);
5
+ }
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true,
11
+ configurable: true,
12
+ set: __exportSetter.bind(all, name)
13
+ });
14
+ };
15
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
16
+
1
17
  // src/guid.ts
2
18
  var GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
3
19
  function isGuid(value) {
@@ -7,4 +23,4 @@ export {
7
23
  isGuid
8
24
  };
9
25
 
10
- //# debugId=F25023E1915C1B3664756E2164756E21
26
+ //# debugId=13FF8B3F125159DD64756E2164756E21
@@ -17,6 +17,7 @@ export * from "./option-validators";
17
17
  export * from "./orchestrator-urls";
18
18
  export * from "./output-context";
19
19
  export * from "./output-format-context";
20
+ export * from "./output-formats";
20
21
  export * from "./output-sink";
21
22
  export * from "./package-metadata-options";
22
23
  export * from "./polling";
@@ -20948,7 +20948,7 @@ var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{1
20948
20948
  var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
20949
20949
  var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
20950
20950
  var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
20951
- var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
20951
+ var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
20952
20952
  var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
20953
20953
  var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
20954
20954
  var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
@@ -20995,7 +20995,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
20995
20995
  `(?<![A-Za-z0-9])"(?:[^\\
20996
20996
  ]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
20997
20997
  ].join("|"), "g");
20998
- var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
20998
+ var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
20999
20999
  var COLLAPSED_BODY = "{…}";
21000
21000
  var COLLAPSED_BODY_MARKER = "\x01body\x01";
21001
21001
  var MAX_BODY_NESTING = 8;
@@ -21010,10 +21010,13 @@ function collapseJsonBodies(text) {
21010
21010
  }
21011
21011
  return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
21012
21012
  }
21013
- var TRAILING_PROSE_PUNCT = /[.,;:!?)\]}>'"]+$/;
21013
+ var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
21014
21014
  function peelTrailingPunctuation(match) {
21015
- const trailing = match.match(TRAILING_PROSE_PUNCT)?.[0] ?? "";
21016
- return trailing ? [match.slice(0, -trailing.length), trailing] : [match, ""];
21015
+ let end = match.length;
21016
+ while (end > 0 && TRAILING_PROSE_PUNCT.includes(match[end - 1])) {
21017
+ end -= 1;
21018
+ }
21019
+ return [match.slice(0, end), match.slice(end)];
21017
21020
  }
21018
21021
  function redactUrl(raw) {
21019
21022
  try {
@@ -21261,6 +21264,18 @@ function setGlobalSink(sink) {
21261
21264
  sinkSlot.set(sink);
21262
21265
  }
21263
21266
 
21267
+ // src/output-formats.ts
21268
+ var OUTPUT_FORMATS = [
21269
+ "table",
21270
+ "json",
21271
+ "yaml",
21272
+ "plain",
21273
+ "markdown"
21274
+ ];
21275
+ function isOutputFormat(value) {
21276
+ return OUTPUT_FORMATS.includes(value);
21277
+ }
21278
+
21264
21279
  // src/command-help.ts
21265
21280
  function extractCommandHelp(cmd, helper) {
21266
21281
  const usage = helper.commandUsage(cmd);
@@ -21300,18 +21315,17 @@ function extractCommandHelp(cmd, helper) {
21300
21315
  }
21301
21316
  return result;
21302
21317
  }
21303
- var VALID_FORMATS = ["table", "json", "yaml", "plain"];
21304
21318
  function extractFormatFromArgs(args) {
21305
21319
  for (let i2 = 0;i2 < args.length; i2++) {
21306
21320
  if (args[i2] === "--output" && i2 + 1 < args.length) {
21307
21321
  const value = args[i2 + 1];
21308
- if (VALID_FORMATS.includes(value)) {
21322
+ if (isOutputFormat(value)) {
21309
21323
  return value;
21310
21324
  }
21311
21325
  }
21312
21326
  if (args[i2]?.startsWith("--output=")) {
21313
21327
  const value = args[i2].substring("--output=".length);
21314
- if (VALID_FORMATS.includes(value)) {
21328
+ if (isOutputFormat(value)) {
21315
21329
  return value;
21316
21330
  }
21317
21331
  }
@@ -21867,6 +21881,22 @@ function parseHttpStatusFromMessage(message) {
21867
21881
  const status = Number(match[1]);
21868
21882
  return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
21869
21883
  }
21884
+ function findHttpStatusInGraph(error) {
21885
+ for (const node of walkErrorGraph(error)) {
21886
+ const response = node.response;
21887
+ const explicit = typeof node.status === "number" ? node.status : response?.status;
21888
+ if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
21889
+ return explicit;
21890
+ }
21891
+ if (typeof node.message === "string") {
21892
+ const parsed = parseHttpStatusFromMessage(node.message);
21893
+ if (parsed !== undefined && parsed >= 400) {
21894
+ return parsed;
21895
+ }
21896
+ }
21897
+ }
21898
+ return;
21899
+ }
21870
21900
  function isHtmlDocument(body) {
21871
21901
  return /^\s*(<!doctype html|<html\b)/i.test(body);
21872
21902
  }
@@ -21980,7 +22010,8 @@ async function extractErrorDetails(error, options) {
21980
22010
  }
21981
22011
  let message;
21982
22012
  let result = "Failure";
21983
- const classification = classifyError(status, error);
22013
+ const classificationStatus = status ?? findHttpStatusInGraph(error);
22014
+ const classification = classifyError(classificationStatus, error);
21984
22015
  let retry = classification.retry;
21985
22016
  if (status === 401) {
21986
22017
  message = DEFAULT_401;
@@ -22056,8 +22087,8 @@ async function extractErrorDetails(error, options) {
22056
22087
  details = describeThrownValue(error);
22057
22088
  }
22058
22089
  const context = {};
22059
- if (status) {
22060
- context.httpStatus = status;
22090
+ if (classificationStatus) {
22091
+ context.httpStatus = classificationStatus;
22061
22092
  }
22062
22093
  if (parsedBody?.errorCode && typeof parsedBody.errorCode === "string") {
22063
22094
  context.errorCode = parsedBody.errorCode;
@@ -24048,7 +24079,9 @@ class TelemetryService {
24048
24079
  }
24049
24080
  }
24050
24081
  // src/timings.ts
24082
+ import { getFileSystem as getFileSystem2 } from "@uipath/filesystem";
24051
24083
  var TIMINGS_ENV_VAR = "UIP_TIMINGS";
24084
+ var TIMINGS_FILE_ENV_VAR = "UIP_TIMINGS_FILE";
24052
24085
  var TIMINGS_LINE_PREFIX = "[timing]";
24053
24086
  function createStorage2() {
24054
24087
  const [error, mod] = catchError(() => (() => ({})));
@@ -24115,7 +24148,7 @@ async function runWithTimings(fallbackCommand, fn) {
24115
24148
  }
24116
24149
  }
24117
24150
  if (timingsEnabled()) {
24118
- emitTimingReport(state, fallbackCommand);
24151
+ await emitTimingReport(state, fallbackCommand);
24119
24152
  }
24120
24153
  }
24121
24154
  });
@@ -24131,6 +24164,13 @@ function timingsEnabled() {
24131
24164
  const normalized = value.trim().toLowerCase();
24132
24165
  return normalized === "1" || normalized === "true";
24133
24166
  }
24167
+ function timingsFile() {
24168
+ if (typeof process === "undefined") {
24169
+ return;
24170
+ }
24171
+ const value = process.env?.[TIMINGS_FILE_ENV_VAR]?.trim();
24172
+ return value === undefined || value === "" ? undefined : value;
24173
+ }
24134
24174
  function setTimingCommand(command) {
24135
24175
  if (!timingsEnabled()) {
24136
24176
  return;
@@ -24217,12 +24257,12 @@ function formatTimingReport(args) {
24217
24257
  parts.push(`flush=${total - startup - command}ms`);
24218
24258
  return parts.join(" ");
24219
24259
  }
24220
- function emitTimingReport(state, fallbackCommand) {
24260
+ async function emitTimingReport(state, fallbackCommand) {
24221
24261
  if (state.suppressed) {
24222
24262
  return;
24223
24263
  }
24224
24264
  const now = performance.now();
24225
- logger.report(formatTimingReport({
24265
+ const line = formatTimingReport({
24226
24266
  command: state.command ?? fallbackCommand,
24227
24267
  exitCode: state.exitCode ?? 0,
24228
24268
  totalMs: now - state.baseline,
@@ -24234,7 +24274,17 @@ function emitTimingReport(state, fallbackCommand) {
24234
24274
  },
24235
24275
  httpMs: state.httpMs,
24236
24276
  httpCalls: state.httpCalls
24237
- }));
24277
+ });
24278
+ const file = timingsFile();
24279
+ if (file === undefined) {
24280
+ logger.report(line);
24281
+ return;
24282
+ }
24283
+ const [error] = await catchError(() => getFileSystem2().appendFile(file, `${line}
24284
+ `));
24285
+ if (error) {
24286
+ logger.report(line);
24287
+ }
24238
24288
  }
24239
24289
  // src/packager-tool-import.ts
24240
24290
  var REGISTER_EXPORT = "registerPackagerFactories";
@@ -24294,12 +24344,14 @@ export {
24294
24344
  ErrorDecision,
24295
24345
  LogLevel,
24296
24346
  MIN_INTERVAL_MS,
24347
+ OUTPUT_FORMATS,
24297
24348
  POLL_DEFAULTS,
24298
24349
  PollOutcome,
24299
24350
  ScreenLogger,
24300
24351
  TELEMETRY_SESSION_ID_ENV,
24301
24352
  TELEMETRY_SESSION_SOURCE_PROPERTY,
24302
24353
  TIMINGS_ENV_VAR,
24354
+ TIMINGS_FILE_ENV_VAR,
24303
24355
  TIMINGS_LINE_PREFIX,
24304
24356
  TelemetryService,
24305
24357
  UIPATH_HOME_DIR,
@@ -24354,6 +24406,7 @@ export {
24354
24406
  isFailureStatus,
24355
24407
  isGuid,
24356
24408
  isHtmlDocument,
24409
+ isOutputFormat,
24357
24410
  isSuccessStatus,
24358
24411
  isTerminalStatus,
24359
24412
  logger,
@@ -24397,8 +24450,9 @@ export {
24397
24450
  suppressTimingReport,
24398
24451
  takeRecordedCommandFailureTelemetry,
24399
24452
  timingsEnabled,
24453
+ timingsFile,
24400
24454
  validateName,
24401
24455
  withCompleter
24402
24456
  };
24403
24457
 
24404
- //# debugId=0481BE8702F1F3FB64756E2164756E21
24458
+ //# debugId=37F07319EF673DA664756E2164756E21