@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.
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The accepted `--output` values and the type derived from them.
3
+ *
4
+ * This lives in its own dependency-free module, not in `formatter.ts`, because
5
+ * `command-help.ts` needs the list at runtime and is re-exported from
6
+ * `index.browser.ts`. `formatter.ts` transitively imports `telemetry-init`
7
+ * (and through it applicationinsights → cls-hooked → `node:async_hooks`), so
8
+ * a value import of it from any browser-reachable module breaks the browser
9
+ * bundle — see the exclusion list at the top of `index.browser.ts`.
10
+ *
11
+ * `formatter.ts` re-exports both names, so `@uipath/common` consumers see one
12
+ * import site regardless of which file defines them.
13
+ */
14
+ /**
15
+ * Accepted `--output` values, in the order `uip --help` lists them.
16
+ *
17
+ * {@link OutputFormat} is derived from this list, so the type and the
18
+ * accepted-value set cannot drift. Every caller that validates a raw
19
+ * `--output` value or prints the flag's help text reads it from here instead
20
+ * of repeating the literals.
21
+ */
22
+ export declare const OUTPUT_FORMATS: readonly ["table", "json", "yaml", "plain", "markdown"];
23
+ export type OutputFormat = (typeof OUTPUT_FORMATS)[number];
24
+ /**
25
+ * Narrow a raw `--output` / `UIP_DEFAULT_OUTPUT` string to an accepted format.
26
+ *
27
+ * Every entry point receives the value as an arbitrary string; this is the one
28
+ * place that turns it into an {@link OutputFormat}, so no caller has to assert
29
+ * the cast the check was supposed to justify.
30
+ *
31
+ * @param value Raw value as typed on the command line or read from the env.
32
+ * @returns `true` when `value` is a member of {@link OUTPUT_FORMATS}.
33
+ */
34
+ export declare function isOutputFormat(value: string): value is OutputFormat;
@@ -2,5 +2,10 @@
2
2
  * Read a value from the Windows registry.
3
3
  * reg utility always exist.
4
4
  * Returns an empty string on non-Windows platforms or when the key/value is missing.
5
+ *
6
+ * `windowsHide` is required: a caller may have no console of its own — the
7
+ * telemetry sidecar is spawned `detached` with `stdio: "ignore"` — and
8
+ * Windows then allocates a new, visible console for `reg`, which flashes a
9
+ * terminal window on the user's desktop.
5
10
  */
6
11
  export declare function readRegistryValue(keyPath: string, valueName: string): string;
@@ -18812,7 +18812,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
18812
18812
  var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
18813
18813
  var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
18814
18814
  var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
18815
- var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
18815
+ var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
18816
18816
  var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
18817
18817
  var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
18818
18818
  var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
@@ -18859,7 +18859,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
18859
18859
  `(?<![A-Za-z0-9])"(?:[^\\
18860
18860
  ]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
18861
18861
  ].join("|"), "g");
18862
- var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
18862
+ var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
18863
18863
  var COLLAPSED_BODY = "{…}";
18864
18864
  var COLLAPSED_BODY_MARKER = "\x01body\x01";
18865
18865
  var MAX_BODY_NESTING = 8;
@@ -18874,10 +18874,13 @@ function collapseJsonBodies(text) {
18874
18874
  }
18875
18875
  return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
18876
18876
  }
18877
- var TRAILING_PROSE_PUNCT = /[.,;:!?)\]}>'"]+$/;
18877
+ var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
18878
18878
  function peelTrailingPunctuation(match) {
18879
- const trailing = match.match(TRAILING_PROSE_PUNCT)?.[0] ?? "";
18880
- return trailing ? [match.slice(0, -trailing.length), trailing] : [match, ""];
18879
+ let end = match.length;
18880
+ while (end > 0 && TRAILING_PROSE_PUNCT.includes(match[end - 1])) {
18881
+ end -= 1;
18882
+ }
18883
+ return [match.slice(0, end), match.slice(end)];
18881
18884
  }
18882
18885
  function redactUrl(raw) {
18883
18886
  try {
@@ -19318,4 +19321,4 @@ export {
19318
19321
  setExecutionContextAuthSignal
19319
19322
  };
19320
19323
 
19321
- //# debugId=8E7DD2E6226061B664756E2164756E21
19324
+ //# debugId=92AE46794174C94B64756E2164756E21
@@ -71,7 +71,7 @@ export declare function telemetryInit(options?: TelemetryInitOptions): Promise<v
71
71
  * Deliver all buffered telemetry before the process exits.
72
72
  * Must be awaited on every exit path.
73
73
  *
74
- * Normally hands the buffered envelopes to a detached sidecar process (see
74
+ * Normally hands the buffered envelopes to a background sidecar process (see
75
75
  * {@link trySidecarHandoff}) so the exit is instant. Falls back to the
76
76
  * in-process flush — one ingestion round-trip, capped at
77
77
  * FLUSH_SHUTDOWN_TIMEOUT_MS — when the sidecar handoff isn't available or
package/dist/timings.d.ts CHANGED
@@ -9,6 +9,9 @@
9
9
  * sum inside `command`, not a fourth slice, so parallel calls can push `http`
10
10
  * past `command`.
11
11
  *
12
+ * The report goes to stderr, or to the file named by `UIP_TIMINGS_FILE` when a
13
+ * caller cannot afford to write on the stream something else is reading.
14
+ *
12
15
  * State is reached through `Symbol.for()` slots (each tool bundles its own copy
13
16
  * of this package) and bound to the invocation's async context, so the MCP
14
17
  * bridge's concurrent in-process commands can't overwrite each other's numbers.
@@ -18,6 +21,8 @@
18
21
  */
19
22
  /** Environment variable that turns the report on (`1` or `true`). */
20
23
  export declare const TIMINGS_ENV_VAR = "UIP_TIMINGS";
24
+ /** Environment variable naming a file to append the report to. */
25
+ export declare const TIMINGS_FILE_ENV_VAR = "UIP_TIMINGS_FILE";
21
26
  /** Prefix every report line carries, so a pipeline can grep them out. */
22
27
  export declare const TIMINGS_LINE_PREFIX = "[timing]";
23
28
  /**
@@ -41,6 +46,20 @@ export declare function markLongLivedHost(): void;
41
46
  export declare function runWithTimings<T>(fallbackCommand: string, fn: () => Promise<T>): Promise<T>;
42
47
  /** Only `1` and `true` count, matching how the logger reads `DEBUG`. */
43
48
  export declare function timingsEnabled(): boolean;
49
+ /**
50
+ * File the report is appended to, when one is named. Read only once the report
51
+ * is already on.
52
+ *
53
+ * Its own variable rather than a path value on {@link TIMINGS_ENV_VAR}, whose
54
+ * contract is that only `1` and `true` count: overloading it would turn a stray
55
+ * `UIP_TIMINGS=yes` from "off" into a relative file named `yes`.
56
+ *
57
+ * For a caller whose stderr is not free to write on: a harness timing the CLI
58
+ * while the process under measurement reads that same stream, or a wrapper that
59
+ * reads any stderr as failure. `--log-file` does not serve them, since it moves
60
+ * every log line and the caller stops seeing the diagnostics it had before.
61
+ */
62
+ export declare function timingsFile(): string | undefined;
44
63
  /** Name the command being timed, once the parser has resolved it. */
45
64
  export declare function setTimingCommand(command: string): void;
46
65
  /**
package/dist/zip.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { type IFileSystem } from "@uipath/filesystem";
2
+ /**
3
+ * Extract an in-memory zip archive into `destinationDir`.
4
+ *
5
+ * Rejects entries that escape the destination, both lexically and through a
6
+ * symlink already present at the destination. One residual gap: a *dangling*
7
+ * symlink as the final path component is not detectable through
8
+ * `IFileSystem`, which exposes `realpath` but no `lstat`. Callers extracting
9
+ * into a directory other processes can write to should hand this a freshly
10
+ * created destination rather than a reused one.
11
+ */
12
+ export declare function extractZipDataToDir(fs: IFileSystem, zipData: Uint8Array, destinationDir: string): Promise<void>;
13
+ /** Extract the zip archive at `archivePath` into `destinationDir`. */
14
+ export declare function extractArchive(archivePath: string, destinationDir: string): Promise<void>;