@uipath/common 1.195.0 → 1.196.0
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.
- package/dist/confirmation.d.ts +28 -0
- package/dist/content-hash.d.ts +8 -0
- package/dist/error-handler.d.ts +5 -1
- package/dist/formatter.d.ts +9 -1
- package/dist/index.browser.d.ts +2 -0
- package/dist/index.browser.js +17894 -48
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3274 -2903
- package/dist/interactivity-context.d.ts +33 -0
- package/dist/package-metadata-options.d.ts +36 -0
- package/dist/package-metadata-options.js +27 -0
- package/dist/stdin.d.ts +1 -0
- package/dist/telemetry/global-telemetry-properties.d.ts +8 -0
- package/dist/telemetry/index.js +38 -1
- package/dist/telemetry/node-appinsights-telemetry-provider.d.ts +1 -2
- package/dist/telemetry/telemetry-service.d.ts +9 -1
- package/package.json +6 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flags that affirm a destructive operation. `--yes` is the canonical flag for
|
|
3
|
+
* delete/remove commands; `--force` is the established alias used by overwrite
|
|
4
|
+
* commands (`init`, `pull`). Either one satisfies the guard.
|
|
5
|
+
*
|
|
6
|
+
* Add the flag to a command with
|
|
7
|
+
* `.option("-y, --yes", "Confirm this irreversible operation (required; the CLI never prompts)")`
|
|
8
|
+
* and gate the handler with {@link requireConfirmation}.
|
|
9
|
+
*/
|
|
10
|
+
export interface ConfirmationFlags {
|
|
11
|
+
yes?: boolean;
|
|
12
|
+
force?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Guard a destructive operation. Returns `true` when the caller passed `--yes`
|
|
16
|
+
* (or `--force`). Otherwise emits a structured failure naming the flag to pass,
|
|
17
|
+
* sets a non-zero exit code via {@link processContext}, and returns `false` so
|
|
18
|
+
* the handler can bail in one line:
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* if (!requireConfirmation(options, `delete folder '${id}'`)) return;
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param flags - the parsed command options (must carry `yes`/`force`).
|
|
25
|
+
* @param operation - a short description of what will happen, e.g.
|
|
26
|
+
* `"delete folder 'Finance'"`. Surfaced in the error message.
|
|
27
|
+
*/
|
|
28
|
+
export declare function requireConfirmation(flags: ConfirmationFlags, operation: string): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate a SHA-256 hex hash of content for change detection.
|
|
3
|
+
* Prefers the Web Crypto API; falls back to node:crypto outside the browser.
|
|
4
|
+
*
|
|
5
|
+
* @param content - String content to hash
|
|
6
|
+
* @returns Hex string of the hash
|
|
7
|
+
*/
|
|
8
|
+
export declare function hashContent(content: string): Promise<string>;
|
package/dist/error-handler.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import type { ErrorContext, FailureResultType } from "./formatter";
|
|
1
|
+
import type { CliErrorCode, ErrorContext, FailureResultType, RetryHint } from "./formatter";
|
|
2
2
|
/**
|
|
3
3
|
* Structured error details returned by {@link extractErrorDetails}.
|
|
4
4
|
*/
|
|
5
5
|
export interface ErrorDetails {
|
|
6
6
|
/** Categorised failure type suitable for OutputFormatter.error() Result field */
|
|
7
7
|
result: FailureResultType;
|
|
8
|
+
/** Stable CLI-owned error code suitable for agent control flow */
|
|
9
|
+
errorCode: CliErrorCode;
|
|
8
10
|
/** Human-readable error message suitable for OutputFormatter.error() */
|
|
9
11
|
message: string;
|
|
12
|
+
/** Stable retry guidance suitable for agent control flow */
|
|
13
|
+
retry: RetryHint;
|
|
10
14
|
/** Raw details from the response body or error object for debugging */
|
|
11
15
|
details: string;
|
|
12
16
|
/** Machine-readable context for agents (HTTP status, request ID, retry-after, etc.) */
|
package/dist/formatter.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export type OutputFormat = "table" | "json" | "yaml" | "plain";
|
|
2
2
|
export type ResultType = "Success" | "Failure" | "ConfigError" | "AuthenticationError" | "ValidationError" | "TimeoutError";
|
|
3
3
|
export type FailureResultType = Exclude<ResultType, "Success">;
|
|
4
|
+
export declare const CLI_ERROR_CODES: readonly ["invalid_argument", "authentication_required", "permission_denied", "not_found", "rate_limited", "network_error", "timeout", "server_error", "method_not_allowed", "configuration_error", "unknown_error"];
|
|
5
|
+
export type CliErrorCode = (typeof CLI_ERROR_CODES)[number];
|
|
6
|
+
export declare const RETRY_HINTS: readonly ["RetryWillNotFix", "RetryLater", "RetryAfter1Second", "RetryAfter10Seconds", "RetryAfter30Seconds", "RetryAfter60Seconds"];
|
|
7
|
+
export type RetryHint = (typeof RETRY_HINTS)[number];
|
|
4
8
|
/** Canonical string constants for {@link ResultType} values. */
|
|
5
9
|
export declare const RESULTS: {
|
|
6
10
|
readonly Success: "Success";
|
|
@@ -76,8 +80,10 @@ export interface ErrorContext {
|
|
|
76
80
|
export declare class FailureOutput {
|
|
77
81
|
Result: FailureResultType;
|
|
78
82
|
Code?: string;
|
|
83
|
+
ErrorCode?: CliErrorCode;
|
|
79
84
|
Message: string;
|
|
80
85
|
Instructions: string;
|
|
86
|
+
Retry?: RetryHint;
|
|
81
87
|
Context?: ErrorContext;
|
|
82
88
|
Log?: string;
|
|
83
89
|
/**
|
|
@@ -88,7 +94,7 @@ export declare class FailureOutput {
|
|
|
88
94
|
* across success / failure paths.
|
|
89
95
|
*/
|
|
90
96
|
Data?: DataRecord | DataRecord[];
|
|
91
|
-
constructor(result: FailureResultType, message: string, instructions: string, context?: ErrorContext);
|
|
97
|
+
constructor(result: FailureResultType, message: string, instructions: string, context?: ErrorContext, errorCode?: CliErrorCode, retry?: RetryHint);
|
|
92
98
|
}
|
|
93
99
|
export type StructuredOutput = SuccessOutput | FailureOutput;
|
|
94
100
|
/**
|
|
@@ -119,7 +125,9 @@ export declare function validateOutputFilter(filter: string): Error | null;
|
|
|
119
125
|
export declare class FilterEvaluationError extends Error {
|
|
120
126
|
readonly __brand: "FilterEvaluationError";
|
|
121
127
|
readonly filter: string;
|
|
128
|
+
readonly errorCode: CliErrorCode;
|
|
122
129
|
readonly instructions: string;
|
|
130
|
+
readonly retry: RetryHint;
|
|
123
131
|
readonly result: FailureResultType;
|
|
124
132
|
constructor(filter: string, cause: unknown);
|
|
125
133
|
}
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./command-walker";
|
|
|
5
5
|
export * from "./completer";
|
|
6
6
|
export { installConsoleGuard, restoreConsole } from "./console-guard";
|
|
7
7
|
export * from "./constants";
|
|
8
|
+
export * from "./content-hash";
|
|
8
9
|
export * from "./env-reference";
|
|
9
10
|
export * from "./error-handler";
|
|
10
11
|
export * from "./error-instructions";
|
|
@@ -16,6 +17,7 @@ export * from "./orchestrator-urls";
|
|
|
16
17
|
export * from "./output-context";
|
|
17
18
|
export * from "./output-format-context";
|
|
18
19
|
export * from "./output-sink";
|
|
20
|
+
export * from "./package-metadata-options";
|
|
19
21
|
export * from "./polling";
|
|
20
22
|
export * from "./screen-logger";
|
|
21
23
|
export * from "./singleton";
|