@uipath/data-fabric-tool 1.204.0-preview.255 → 1.205.0-preview.256

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/index.js CHANGED
@@ -1,11 +1,15 @@
1
1
  #!/usr/bin/env bun
2
2
  import {
3
- Command,
4
3
  metadata,
5
4
  registerCommands
6
- } from "./packager-tool-awbse7ws.js";
5
+ } from "./packager-tool-r918t36v.js";
6
+ import"./packager-tool-w9r3qa12.js";
7
7
  import"./packager-tool-bndhpxxj.js";
8
- import"./packager-tool-wq4qexcc.js";
8
+ import"./packager-tool-2wp1xwz4.js";
9
+ import {
10
+ Command
11
+ } from "./packager-tool-xnrdmg37.js";
12
+ import"./packager-tool-m0btwdsf.js";
9
13
  import"./packager-tool-1de529jm.js";
10
14
 
11
15
  // src/index.ts
@@ -14,4 +18,4 @@ program.name(metadata.name).description(metadata.description).version(metadata.v
14
18
  await registerCommands(program);
15
19
  await program.parseAsync(process.argv);
16
20
 
17
- //# debugId=5E8796148C44571164756E2164756E21
21
+ //# debugId=6724BAAABF556E3B64756E2164756E21
@@ -0,0 +1,101 @@
1
+ import {
2
+ OutputFormatter,
3
+ RESULTS,
4
+ getFileSystem,
5
+ processContext,
6
+ readStdin,
7
+ requireConfirmation,
8
+ warnDeprecatedOptionAlias
9
+ } from "./packager-tool-xnrdmg37.js";
10
+
11
+ // src/utils/output.ts
12
+ function fail(message, instructions) {
13
+ OutputFormatter.error({
14
+ Result: RESULTS.Failure,
15
+ Message: message,
16
+ Instructions: instructions
17
+ });
18
+ processContext.exit(1);
19
+ }
20
+ function failInvalidArgument(message, instructions) {
21
+ OutputFormatter.error({
22
+ Result: RESULTS.Failure,
23
+ Message: message,
24
+ Instructions: instructions,
25
+ ErrorCode: "invalid_argument",
26
+ Retry: "RetryWillNotFix"
27
+ });
28
+ processContext.exit(1);
29
+ }
30
+ function failWithCode(message, instructions, errorCode) {
31
+ OutputFormatter.error({
32
+ Result: RESULTS.Failure,
33
+ Message: message,
34
+ Instructions: instructions,
35
+ ErrorCode: errorCode,
36
+ Retry: "RetryWillNotFix"
37
+ });
38
+ processContext.exit(1);
39
+ }
40
+ function requireDestructiveConfirmation(options, operation, reasonInstruction) {
41
+ if (options.confirm === true && options.yes !== true) {
42
+ warnDeprecatedOptionAlias("--confirm", "--yes");
43
+ }
44
+ if (!requireConfirmation({ yes: options.yes === true || options.confirm === true }, operation)) {
45
+ return null;
46
+ }
47
+ const reason = options.reason?.trim();
48
+ if (reason === undefined || reason === "") {
49
+ failInvalidArgument("Reason required for destructive operation", reasonInstruction);
50
+ return null;
51
+ }
52
+ return reason;
53
+ }
54
+
55
+ // src/utils/input.ts
56
+ var STDIN_SENTINEL = "-";
57
+ async function readFileBinary(filePath) {
58
+ const fs = getFileSystem();
59
+ const content = await fs.readFile(filePath);
60
+ if (content === null) {
61
+ throw new Error(`Could not read file: ${filePath}`);
62
+ }
63
+ return content;
64
+ }
65
+ async function readJsonInput(filePath, inline, missingMsg = "Provide either --file <path> or inline data.") {
66
+ if (!filePath && !inline) {
67
+ throw new Error(missingMsg);
68
+ }
69
+ if (inline === STDIN_SENTINEL || filePath === STDIN_SENTINEL) {
70
+ const stdinData = await readStdin();
71
+ if (stdinData === null) {
72
+ throw new Error("Expected JSON on stdin but got none. Pipe data in, e.g. `... --body - < payload.json`.");
73
+ }
74
+ return parseJson(stdinData);
75
+ }
76
+ let raw;
77
+ if (filePath) {
78
+ const fs = getFileSystem();
79
+ const content = await fs.readFile(filePath, "utf-8");
80
+ if (content === null) {
81
+ throw new Error(`Could not read file: ${filePath}`);
82
+ }
83
+ raw = content;
84
+ } else {
85
+ raw = inline;
86
+ }
87
+ return parseJson(raw);
88
+ }
89
+ function parseJson(raw) {
90
+ try {
91
+ return JSON.parse(raw);
92
+ } catch (err) {
93
+ const detail = err instanceof Error ? err.message : String(err);
94
+ const hint = process.platform === "win32" ? " On Windows cmd/PowerShell, characters like & | < > ^ split the command — use `--file <path>` or pipe JSON via `--body -`." : "";
95
+ throw new Error(`Invalid JSON input: ${detail}.${hint}`);
96
+ }
97
+ }
98
+
99
+ export { fail, failInvalidArgument, failWithCode, requireDestructiveConfirmation, readFileBinary, readJsonInput };
100
+
101
+ //# debugId=0FC79F5B9BB6159864756E2164756E21