@uipath/data-fabric-tool 1.206.0-preview.306 → 1.207.0-preview.307
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/choice-sets-inline-1gv2mydg.js +173 -0
- package/dist/{entities-inline-6cz4y6gd.js → entities-inline-k0qggbgm.js} +429 -824
- package/dist/{federated-payload-1dcd1mck.js → federated-payload-d82r8jsd.js} +309 -7
- package/dist/index.js +9 -6
- package/dist/{packager-tool-8h3n7zh5.js → packager-tool-0whbpj17.js} +255 -248
- package/dist/packager-tool-34pcyhns.js +11 -0
- package/dist/packager-tool-3wzz1wn4.js +37 -0
- package/dist/{packager-tool-0j0r03b9.js → packager-tool-4amqsjff.js} +46 -1077
- package/dist/packager-tool-745zeysc.js +52 -0
- package/dist/{packager-tool-jy2jp2xx.js → packager-tool-7gac4cbd.js} +384 -97
- package/dist/packager-tool-kt0mxbv8.js +1455 -0
- package/dist/{packager-tool-gj7vsn2f.js → packager-tool-skeew4e3.js} +2741 -2566
- package/dist/{packager-tool-b1anyew3.js → packager-tool-spr308qr.js} +13043 -13001
- package/dist/packager-tool-yxv0qfms.js +64 -0
- package/dist/packager-tool-zwqkr7z9.js +2197 -0
- package/dist/packager-tool.js +5 -3
- package/dist/sdk-client-d91ez016.js +13 -0
- package/dist/tool.js +9 -6
- package/package.json +2 -2
- package/dist/packager-tool-cbbznax3.js +0 -101
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFileSystem,
|
|
3
|
+
readStdin
|
|
4
|
+
} from "./packager-tool-skeew4e3.js";
|
|
5
|
+
|
|
6
|
+
// src/utils/input.ts
|
|
7
|
+
var STDIN_SENTINEL = "-";
|
|
8
|
+
async function readFileBinary(filePath) {
|
|
9
|
+
const fs = getFileSystem();
|
|
10
|
+
const content = await fs.readFile(filePath);
|
|
11
|
+
if (content === null) {
|
|
12
|
+
throw new Error(`Could not read file: ${filePath}`);
|
|
13
|
+
}
|
|
14
|
+
return content;
|
|
15
|
+
}
|
|
16
|
+
async function readJsonInput(filePath, inline, missingMsg = "Provide either --file <path> or inline data.") {
|
|
17
|
+
if (!filePath && !inline) {
|
|
18
|
+
throw new Error(missingMsg);
|
|
19
|
+
}
|
|
20
|
+
if (inline === STDIN_SENTINEL || filePath === STDIN_SENTINEL) {
|
|
21
|
+
const stdinData = await readStdin();
|
|
22
|
+
if (stdinData === null) {
|
|
23
|
+
throw new Error("Expected JSON on stdin but got none. Pipe data in, e.g. `... --body - < payload.json`.");
|
|
24
|
+
}
|
|
25
|
+
return parseJson(stdinData);
|
|
26
|
+
}
|
|
27
|
+
let raw;
|
|
28
|
+
if (filePath) {
|
|
29
|
+
const fs = getFileSystem();
|
|
30
|
+
const content = await fs.readFile(filePath, "utf-8");
|
|
31
|
+
if (content === null) {
|
|
32
|
+
throw new Error(`Could not read file: ${filePath}`);
|
|
33
|
+
}
|
|
34
|
+
raw = content;
|
|
35
|
+
} else {
|
|
36
|
+
raw = inline;
|
|
37
|
+
}
|
|
38
|
+
return parseJson(raw);
|
|
39
|
+
}
|
|
40
|
+
function parseJson(raw) {
|
|
41
|
+
try {
|
|
42
|
+
return JSON.parse(raw);
|
|
43
|
+
} catch (err) {
|
|
44
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
45
|
+
const hint = process.platform === "win32" ? " On Windows cmd/PowerShell, characters like & | < > ^ split the command — use `--file <path>` or pipe JSON via `--body -`." : "";
|
|
46
|
+
throw new Error(`Invalid JSON input: ${detail}.${hint}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { readFileBinary, readJsonInput };
|
|
51
|
+
|
|
52
|
+
//# debugId=B0AC3CAC21C7D66264756E2164756E21
|