@uipath/common 0.9.1 → 1.0.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/command-help.d.ts +2 -22
- package/dist/constants.d.ts +0 -2
- package/dist/error-handler.d.ts +1 -0
- package/dist/formatter.d.ts +26 -0
- package/dist/guid.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1131 -1000
- package/dist/option-validators.d.ts +2 -0
- package/dist/orchestrator-urls.d.ts +65 -0
- package/dist/output-format-context.d.ts +11 -0
- package/package.json +5 -5
package/dist/command-help.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Command, Help } from "commander";
|
|
2
2
|
import { type CommandExample } from "./command-examples";
|
|
3
|
-
import {
|
|
3
|
+
import type { OutputFormat } from "./formatter";
|
|
4
4
|
export interface CommandHelpOption {
|
|
5
5
|
Flags: string;
|
|
6
6
|
Description: string;
|
|
@@ -26,28 +26,8 @@ export interface CommandHelpData {
|
|
|
26
26
|
* to ensure consistency with the default help text.
|
|
27
27
|
*/
|
|
28
28
|
export declare function extractCommandHelp(cmd: Command, helper: Help): CommandHelpData;
|
|
29
|
-
/**
|
|
30
|
-
* Build a string representation of a command tree rooted at `command`.
|
|
31
|
-
*
|
|
32
|
-
* Table/plain format: delegates to Commander's built-in Help.formatHelp per command.
|
|
33
|
-
* Structured formats: aggregates extractCommandHelp data into a single envelope
|
|
34
|
-
* with full command paths.
|
|
35
|
-
*/
|
|
36
|
-
export declare function formatHelpAll(command: Command, baseName?: string): string;
|
|
37
29
|
/**
|
|
38
30
|
* Pre-scan raw argv for --output <value> before Commander parses.
|
|
39
31
|
* Falls back to the environment-aware default ("table" for TTY, "json" otherwise).
|
|
40
32
|
*/
|
|
41
33
|
export declare function extractFormatFromArgs(args: string[]): OutputFormat;
|
|
42
|
-
/**
|
|
43
|
-
* Register --help-all on a command. When triggered, prints the full
|
|
44
|
-
* recursive help for that command's subtree and exits.
|
|
45
|
-
*
|
|
46
|
-
* Uses Commander's `on('option:help-all')` event which fires during
|
|
47
|
-
* parseOptions — before subcommand routing — so it works on container
|
|
48
|
-
* commands that have no action handler.
|
|
49
|
-
*
|
|
50
|
-
* Output and exit use Commander's own infrastructure (configureOutput,
|
|
51
|
-
* CommanderError) — the same pattern Commander uses for --version.
|
|
52
|
-
*/
|
|
53
|
-
export declare function registerHelpAll(command: Command): void;
|
package/dist/constants.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ export declare const UIPATH_HOME_DIR = ".uipath";
|
|
|
4
4
|
export declare const AUTH_FILENAME = ".auth";
|
|
5
5
|
/** CLI config filename */
|
|
6
6
|
export declare const CONFIG_FILENAME = "config.json";
|
|
7
|
-
/** Local project config filename (looked up in CWD) */
|
|
8
|
-
export declare const LOCAL_CONFIG_FILENAME = "uipath.config.json";
|
|
9
7
|
/** Default UiPath cloud base URL */
|
|
10
8
|
export declare const DEFAULT_BASE_URL = "https://cloud.uipath.com";
|
|
11
9
|
/** Default page size for paginated API list commands */
|
package/dist/error-handler.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface ExtractErrorOptions {
|
|
|
19
19
|
/** Custom message for HTTP 403 Forbidden errors. Uses a generic default if omitted. */
|
|
20
20
|
forbiddenMessage?: string;
|
|
21
21
|
}
|
|
22
|
+
export declare function isHtmlDocument(body: string): boolean;
|
|
22
23
|
/**
|
|
23
24
|
* Extract a structured error message and details from an unknown thrown value.
|
|
24
25
|
*
|
package/dist/formatter.d.ts
CHANGED
|
@@ -33,10 +33,24 @@ export declare const EXIT_CODES: {
|
|
|
33
33
|
/** Widened record type that accepts interface types (which lack an implicit
|
|
34
34
|
* index signature in TypeScript) while still representing keyed objects. */
|
|
35
35
|
export type DataRecord = Record<string, unknown> | (object & Record<never, never>);
|
|
36
|
+
export declare class Pagination {
|
|
37
|
+
Returned: number;
|
|
38
|
+
Limit: number;
|
|
39
|
+
Offset: number;
|
|
40
|
+
Total?: number;
|
|
41
|
+
HasMore: boolean;
|
|
42
|
+
constructor({ returned, limit, offset, total, }: {
|
|
43
|
+
returned: number;
|
|
44
|
+
limit: number;
|
|
45
|
+
offset: number;
|
|
46
|
+
total?: number;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
36
49
|
export declare class SuccessOutput {
|
|
37
50
|
Result: "Success";
|
|
38
51
|
Code: string;
|
|
39
52
|
Data: DataRecord | DataRecord[];
|
|
53
|
+
Pagination?: Pagination;
|
|
40
54
|
Instructions?: string;
|
|
41
55
|
Log?: string;
|
|
42
56
|
constructor(code: string, data: DataRecord | DataRecord[]);
|
|
@@ -46,6 +60,18 @@ export interface ErrorContext {
|
|
|
46
60
|
errorCode?: string;
|
|
47
61
|
requestId?: string;
|
|
48
62
|
retryAfter?: number;
|
|
63
|
+
/** Pipeline stage label (e.g. "begin-debug-session", "create-debug-instance")
|
|
64
|
+
* identifying *which step* of a multi-stage command failed. Lets agents
|
|
65
|
+
* decide retry vs. report without parsing free-text messages. */
|
|
66
|
+
stage?: string;
|
|
67
|
+
/** Backend endpoint path (e.g. "/api/v1/debug-instances") relative to the
|
|
68
|
+
* service root. Combined with {@link method}, uniquely identifies the
|
|
69
|
+
* failing API call. */
|
|
70
|
+
endpoint?: string;
|
|
71
|
+
/** HTTP method of the failing request (e.g. "POST", "GET"). */
|
|
72
|
+
method?: string;
|
|
73
|
+
/** Distributed-tracing id parsed from the backend error body when present. */
|
|
74
|
+
traceId?: string;
|
|
49
75
|
}
|
|
50
76
|
export declare class FailureOutput {
|
|
51
77
|
Result: FailureResultType;
|
package/dist/guid.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isGuid(value: string): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,15 +9,18 @@ export * from "./env-reference";
|
|
|
9
9
|
export * from "./error-handler";
|
|
10
10
|
export * from "./error-instructions";
|
|
11
11
|
export * from "./formatter";
|
|
12
|
+
export * from "./guid";
|
|
12
13
|
export * from "./jsonpath";
|
|
13
14
|
export * from "./logger";
|
|
14
15
|
export * from "./option-validators";
|
|
16
|
+
export * from "./orchestrator-urls";
|
|
15
17
|
export * from "./output-context";
|
|
16
18
|
export * from "./output-format-context";
|
|
17
19
|
export * from "./output-sink";
|
|
18
20
|
export * from "./polling";
|
|
19
21
|
export * from "./registry";
|
|
20
22
|
export * from "./screen-logger";
|
|
23
|
+
export * from "./singleton";
|
|
21
24
|
export * from "./telemetry/node.js";
|
|
22
25
|
export { setGlobalTelemetryProperties } from "./telemetry/node-appinsights-telemetry-provider.js";
|
|
23
26
|
export * from "./telemetry/telemetry-events.js";
|