@uipath/common 1.0.4 → 1.1.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/attachment-binding.d.ts +55 -0
- package/dist/formatter.d.ts +1 -0
- package/dist/index.browser.d.ts +23 -0
- package/dist/index.browser.js +5817 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5565 -5406
- package/dist/option-aliases.d.ts +19 -0
- package/dist/sdk-user-agent.d.ts +12 -0
- package/dist/sdk-user-agent.js +143 -0
- package/package.json +11 -12
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commander collector for repeatable string options. Use with `.option(...,
|
|
3
|
+
* appendOption, [] as string[])` to accumulate values across multiple flag
|
|
4
|
+
* occurrences (e.g. `--attachment a=b --attachment c=d`).
|
|
5
|
+
*/
|
|
6
|
+
export declare function appendOption(value: string, previous: string[] | undefined): string[];
|
|
7
|
+
/** A parsed `name=path` --attachment spec. */
|
|
8
|
+
export interface ParsedAttachmentSpec {
|
|
9
|
+
name: string;
|
|
10
|
+
path: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Standard `Instructions` text for an OutputFormatter error when the user's
|
|
14
|
+
* `--attachment` spec is malformed.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ATTACHMENT_INSTRUCTIONS = "Provide --attachment as 'name=path' where 'name' matches a file-typed workflow input variable and 'path' points at a readable local file. Repeat the flag to attach multiple files.";
|
|
17
|
+
/**
|
|
18
|
+
* Standard `Instructions` text when `--attachment` upload fails (auth, network,
|
|
19
|
+
* permissions). Pair with the underlying error message in `Message`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ATTACHMENT_UPLOAD_INSTRUCTIONS = "Check that the active tenant has Orchestrator access and the file is readable, then retry.";
|
|
22
|
+
/**
|
|
23
|
+
* Parse a `name=path` --attachment spec for Maestro-engine file-variable
|
|
24
|
+
* binding (used by `flow debug` and `flow process run`).
|
|
25
|
+
*
|
|
26
|
+
* `name=` is mandatory: the engine resolves `=js:($vars.<scope>.input.<name>)`
|
|
27
|
+
* expressions in connector multipart slots against the uploaded
|
|
28
|
+
* `JobAttachmentReference`, so it needs the explicit workflow-variable name
|
|
29
|
+
* as the binding key. A bare path has no binding target and is rejected.
|
|
30
|
+
*
|
|
31
|
+
* Distinct from `or jobs run --attachment` which auto-derives a name from
|
|
32
|
+
* the basename when '=' is absent (no binding key required there).
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseAttachmentSpec(spec: string): ParsedAttachmentSpec;
|
|
35
|
+
/**
|
|
36
|
+
* Read each spec's bytes (fail-fast on any error), then upload all via the
|
|
37
|
+
* caller-supplied `upload` function (e.g. `uploadJobAttachment` from
|
|
38
|
+
* `@uipath/orchestrator-sdk`) in parallel. Returns references in input order.
|
|
39
|
+
*
|
|
40
|
+
* Two-phase to avoid orphaned attachments when a local path is bad: phase 1
|
|
41
|
+
* reads + validates every file before any network write. A read failure
|
|
42
|
+
* short-circuits before any upload begins. A mid-upload failure on one spec
|
|
43
|
+
* can still leave a sibling's attachment orphaned — accepted trade-off;
|
|
44
|
+
* Orchestrator has no atomic-batch endpoint.
|
|
45
|
+
*
|
|
46
|
+
* The `fileName` passed to `upload` is the local basename (not the LHS of
|
|
47
|
+
* `name=path`) so users recognize their uploaded file in the Orchestrator
|
|
48
|
+
* UI. The spec's `name` is preserved on the returned record for callers to
|
|
49
|
+
* use as the binding key in their inputs payload.
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveAttachmentInputs<R>(specs: ParsedAttachmentSpec[], upload: (bytes: Uint8Array, fileName: string) => Promise<R>): Promise<{
|
|
52
|
+
name: string;
|
|
53
|
+
path: string;
|
|
54
|
+
reference: R;
|
|
55
|
+
}[]>;
|
package/dist/formatter.d.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export * from "./catch-error";
|
|
2
|
+
export * from "./command-examples";
|
|
3
|
+
export * from "./command-help";
|
|
4
|
+
export * from "./command-walker";
|
|
5
|
+
export * from "./completer";
|
|
6
|
+
export { installConsoleGuard, restoreConsole } from "./console-guard";
|
|
7
|
+
export * from "./constants";
|
|
8
|
+
export * from "./env-reference";
|
|
9
|
+
export * from "./error-handler";
|
|
10
|
+
export * from "./error-instructions";
|
|
11
|
+
export * from "./guid";
|
|
12
|
+
export * from "./jsonpath";
|
|
13
|
+
export * from "./logger";
|
|
14
|
+
export * from "./option-validators";
|
|
15
|
+
export * from "./orchestrator-urls";
|
|
16
|
+
export * from "./output-context";
|
|
17
|
+
export * from "./output-format-context";
|
|
18
|
+
export * from "./output-sink";
|
|
19
|
+
export * from "./polling";
|
|
20
|
+
export * from "./screen-logger";
|
|
21
|
+
export * from "./singleton";
|
|
22
|
+
export * from "./telemetry/telemetry-events.js";
|
|
23
|
+
export * from "./tool-provider";
|