@uipath/flow-tool 1.203.0-preview.205 → 1.204.0-preview.206
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/README.md +4 -0
- package/dist/THIRD-PARTY-NOTICES.md +237 -2
- package/dist/authoring-4kyzh1tf.js +23 -0
- package/dist/{binding-service-ft8mabkr.js → binding-service-815skxfx.js} +28 -30
- package/dist/{connector-service-qnpnwzpv.js → connector-service-xw4f8a7v.js} +34 -31
- package/dist/{conversion-FQTRFHRX-xh98wp2q.js → conversion-FQTRFHRX-1q7rk0te.js} +5 -5
- package/dist/{debug-conversation-trigger-fy19ygsm.js → debug-conversation-trigger-qdgvrekh.js} +14 -16
- package/dist/{debug-http-client-53qk6pc5.js → debug-http-client-s78gbtbn.js} +3 -3
- package/dist/{debug-service-nyk0s6mc.js → debug-service-0ppdzgzv.js} +4 -4
- package/dist/{edge-service-an71q4ry.js → edge-service-ttzfnxkf.js} +13 -14
- package/dist/{embedded-file-reader-0sjt4nkj.js → embedded-file-reader-v8c2yj2a.js} +2 -2
- package/dist/{flow-api-2phdajnk.js → flow-api-b7k5dtpm.js} +8 -8
- package/dist/{flow-debug-service-bnzgj53b.js → flow-debug-service-4we602jx.js} +38 -35
- package/dist/{flow-eval-node-target-2mjben3g.js → flow-eval-node-target-331vzbkw.js} +14 -15
- package/dist/{flow-eval-run-api-1bw5e0k4.js → flow-eval-run-api-yq18x5rb.js} +4 -4
- package/dist/{flow-eval-run-service-qv8j8fd1.js → flow-eval-run-service-36h1bnm8.js} +40 -37
- package/dist/{flow-eval-service-amd02ctw.js → flow-eval-service-ndtk9f9j.js} +19 -20
- package/dist/flow-init-sdk-source-9fy9p8ap.js +58 -0
- package/dist/{flow-init-service-rnygj5f8.js → flow-init-service-kwhbdtpc.js} +19 -18
- package/dist/{flow-io-hddhkve5.js → flow-io-pt392xct.js} +13 -14
- package/dist/{flow-migrate-service-e3hm99gp.js → flow-migrate-service-xvz8pbmp.js} +14 -15
- package/dist/{flow-pack-service-g8jebcts.js → flow-pack-service-wg1kt2bt.js} +72 -39
- package/dist/flow-validate-service-xbhrj47n.js +64 -0
- package/dist/{governance-fetcher-cswx2cw7.js → governance-fetcher-5yy89pfd.js} +6 -5
- package/dist/{headless-mmnrkzve.js → headless-1pdmae01.js} +2 -2
- package/dist/{hitl-service-a4fmjrzh.js → hitl-service-q2d39v5s.js} +13 -14
- package/dist/{index-3ts7y9d3.js → index-2s8rmmw6.js} +5 -3
- package/dist/index-3jpjaq1g.js +26 -0
- package/dist/{index-t5zedby6.js → index-41vyzws2.js} +59 -27
- package/dist/{index-b46bavh7.js → index-5yw15y73.js} +2 -2
- package/dist/{index-212q16sv.js → index-7qw3ttge.js} +416 -87
- package/dist/{index-t8e0ft8r.js → index-c1q6mnw1.js} +3 -3
- package/dist/{index-xa7gm52r.js → index-dqqg54v6.js} +601 -61
- package/dist/index.js +10 -10
- package/dist/init.d.ts +1 -1
- package/dist/init.js +19 -18
- package/dist/{input-reader-tw0j373f.js → input-reader-bv7kt19c.js} +2 -2
- package/dist/{known-types-b64as10y.js → known-types-jhyhnkt6.js} +4 -4
- package/dist/{maestro-automate-entry-pqy9xqm3.js → maestro-automate-entry-qak46eg0.js} +2 -2
- package/dist/node-2whm5wkf.js +4823 -0
- package/dist/{node-service-qnny15cm.js → node-service-js01ft95.js} +31 -30
- package/dist/{node-strategy-gc4sg6a2.js → node-strategy-fdnkvq4a.js} +1 -1
- package/dist/{node-sync-service-f1x1ak6q.js → node-sync-service-pb3m4dp2.js} +9 -9
- package/dist/{packager-tool-et7wj8kr.js → packager-tool-0w4es6rz.js} +2 -2
- package/dist/{packager-tool-dph5p2f5.js → packager-tool-1mnq1c97.js} +1 -1
- package/dist/packager-tool-225z77w9.js +52 -0
- package/dist/{packager-tool-de2txaxx.js → packager-tool-2hzsf1rc.js} +5 -5
- package/dist/{packager-tool-vbser1d9.js → packager-tool-2qr8z5ke.js} +4 -4
- package/dist/{packager-tool-0egkaa38.js → packager-tool-32czz9mq.js} +2 -2
- package/dist/{packager-tool-0v3s8r01.js → packager-tool-3h2ktz6q.js} +2 -2
- package/dist/{packager-tool-h9d8c9rf.js → packager-tool-4zdhy0c3.js} +2 -2
- package/dist/{packager-tool-afd1wwf2.js → packager-tool-53c81nnr.js} +440 -29
- package/dist/{packager-tool-2c688mdj.js → packager-tool-57fak54h.js} +4 -4
- package/dist/{packager-tool-qa2xzxez.js → packager-tool-59s95scr.js} +1 -1
- package/dist/{packager-tool-n8p9cay6.js → packager-tool-6azk3rex.js} +1 -1
- package/dist/{packager-tool-26ydwf12.js → packager-tool-6h69pd2a.js} +23 -8
- package/dist/{packager-tool-mnrbdn6a.js → packager-tool-6scjsgh6.js} +55 -17
- package/dist/{packager-tool-xzf4xc65.js → packager-tool-70cta0be.js} +4 -4
- package/dist/{packager-tool-tw3j5h3z.js → packager-tool-8hj7w7em.js} +5 -5
- package/dist/{packager-tool-795gzq9k.js → packager-tool-8pmgk4f6.js} +1 -1
- package/dist/{packager-tool-321a1806.js → packager-tool-8vmx4j2w.js} +1 -1
- package/dist/{packager-tool-cnftzx4c.js → packager-tool-a6ph7149.js} +40 -11
- package/dist/{packager-tool-s0mzv3sx.js → packager-tool-aw60v0et.js} +1 -1
- package/dist/{packager-tool-e89k4pjj.js → packager-tool-c0rtxezv.js} +1 -1
- package/dist/{packager-tool-1w4f09cq.js → packager-tool-d0ny3x3b.js} +141 -96
- package/dist/{packager-tool-gzpvdcnw.js → packager-tool-da1cmt0q.js} +2 -2
- package/dist/{packager-tool-p8j4zvrq.js → packager-tool-dp8vjby4.js} +4829 -1364
- package/dist/packager-tool-e5hj89zm.js +6 -0
- package/dist/{packager-tool-fwp34rqp.js → packager-tool-ev80vk13.js} +8 -8
- package/dist/{packager-tool-gctpkdzs.js → packager-tool-hhy1gr2k.js} +1 -1
- package/dist/{packager-tool-sf9f6jft.js → packager-tool-hygq2wy6.js} +1 -1
- package/dist/{packager-tool-0v3tzseq.js → packager-tool-jeb6xmgw.js} +2 -2
- package/dist/packager-tool-krzxg3ga.js +804 -0
- package/dist/{packager-tool-1r5dnt9q.js → packager-tool-mv4jav1h.js} +1 -1
- package/dist/{packager-tool-pppzgwfw.js → packager-tool-n4vdjmjx.js} +18079 -18079
- package/dist/{packager-tool-t9c77psy.js → packager-tool-p1tb6d4f.js} +955 -150
- package/dist/{packager-tool-gs28y1eq.js → packager-tool-qhhrq12s.js} +2 -2
- package/dist/{packager-tool-6k8s7pt9.js → packager-tool-r7xy9sew.js} +1090 -545
- package/dist/{packager-tool-b1xs6aty.js → packager-tool-stq8800d.js} +902 -897
- package/dist/{packager-tool-61r38k4d.js → packager-tool-t57d6pzz.js} +320 -200
- package/dist/{packager-tool-a7t9v5ss.js → packager-tool-v9v9ch04.js} +2 -2
- package/dist/{packager-tool-cdn59g60.js → packager-tool-ve5t7317.js} +2 -2
- package/dist/{packager-tool-yxv9mm8s.js → packager-tool-vtaqtf7f.js} +10 -10
- package/dist/{packager-tool-t39edv0g.js → packager-tool-w3dy6vnj.js} +184 -193
- package/dist/{packager-tool-9kx94sj5.js → packager-tool-x5qafkb7.js} +2 -2
- package/dist/{packager-tool-s841bbkr.js → packager-tool-yednpbbw.js} +2 -2
- package/dist/{packager-tool-yxnepq2j.js → packager-tool-ysbskrta.js} +1 -1
- package/dist/packager-tool-zgsvggdr.js +50 -0
- package/dist/packager-tool.js +12 -13
- package/dist/{serialization-BXU6AKAN-rhgmwp06.js → serialization-BXU6AKAN-c2ge8yvb.js} +5 -5
- package/dist/services/flow-init-sdk-source.d.ts +28 -0
- package/dist/services/flow-init-service.d.ts +25 -0
- package/dist/services/inline-activity-service.d.ts +135 -0
- package/dist/services/node-service.d.ts +14 -0
- package/dist/services/node-validators/index.d.ts +2 -0
- package/dist/services/node-validators/inline-activity-validator.d.ts +18 -0
- package/dist/services/node-validators/types.d.ts +6 -0
- package/dist/services/node-validators/unresolved-binding-placeholder-validator.d.ts +2 -0
- package/dist/services/preview-id-rule.d.ts +33 -0
- package/dist/services/ui-only-node-types.d.ts +1 -0
- package/dist/{shared-utils-wv356cvj.js → shared-utils-9vfmrxtx.js} +2 -2
- package/dist/{packager-tool-es0a755k.js → tidy-service-q2wwwans.js} +33 -7
- package/dist/tool.js +10 -10
- package/dist/utils/flow-io.d.ts +3 -16
- package/dist/validation.js +35 -36
- package/dist/{variable-service-bc7920kx.js → variable-service-nm9fdwsw.js} +13 -14
- package/dist/{wait-for-flow-job-v0njb0dk.js → wait-for-flow-job-yzyamptd.js} +8 -8
- package/package.json +2 -2
- package/dist/authoring-tv4dh80p.js +0 -360
- package/dist/flow-validate-service-x9dtdrc7.js +0 -65
- package/dist/node-xdgxafqs.js +0 -15600
- package/dist/packager-tool-2513jrxr.js +0 -898
- package/dist/packager-tool-5kt8tsq4.js +0 -85
- package/dist/packager-tool-w0kr4mbc.js +0 -996
- package/dist/services/tidy-service.d.ts +0 -26
- package/dist/tidy-service-8y2tjmb5.js +0 -39
- /package/dist/{localization-y790z9vm.js → localization-xecwjpe2.js} +0 -0
|
@@ -0,0 +1,804 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveMaestroRegistry
|
|
3
|
+
} from "./packager-tool-32czz9mq.js";
|
|
4
|
+
import {
|
|
5
|
+
Option,
|
|
6
|
+
OutputFormatter,
|
|
7
|
+
RESULTS,
|
|
8
|
+
getOutputSink,
|
|
9
|
+
pascalCaseDataKeys,
|
|
10
|
+
processContext
|
|
11
|
+
} from "./packager-tool-r7xy9sew.js";
|
|
12
|
+
import {
|
|
13
|
+
getFileSystem
|
|
14
|
+
} from "./packager-tool-3h2ktz6q.js";
|
|
15
|
+
|
|
16
|
+
// ../builder-sdk/src/argv.ts
|
|
17
|
+
function addValue(argv, flag, value) {
|
|
18
|
+
if (typeof value === "string") {
|
|
19
|
+
argv.push(flag, value);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// ../builder-sdk/src/delegate.ts
|
|
24
|
+
import { spawn as spawn2 } from "node:child_process";
|
|
25
|
+
import { createRequire } from "node:module";
|
|
26
|
+
import { StringDecoder } from "node:string_decoder";
|
|
27
|
+
|
|
28
|
+
// ../builder-sdk/src/npm-global-root.ts
|
|
29
|
+
import { spawn } from "node:child_process";
|
|
30
|
+
var NPM_ROOT_TIMEOUT_MS = 5000;
|
|
31
|
+
var npmRootLookup;
|
|
32
|
+
function npmGlobalRoot() {
|
|
33
|
+
const prefix = npmConfigPrefix(process.env);
|
|
34
|
+
if (prefix.trim() !== "") {
|
|
35
|
+
return Promise.resolve(process.platform === "win32" ? getFileSystem().path.join(prefix, "node_modules") : getFileSystem().path.join(prefix, "lib", "node_modules"));
|
|
36
|
+
}
|
|
37
|
+
npmRootLookup ??= runNpmRootGlobal();
|
|
38
|
+
return npmRootLookup;
|
|
39
|
+
}
|
|
40
|
+
function runNpmRootGlobal() {
|
|
41
|
+
return new Promise((resolve) => {
|
|
42
|
+
const stdio = ["ignore", "pipe", "ignore"];
|
|
43
|
+
const onWindows = { shell: true, stdio, windowsHide: true };
|
|
44
|
+
const proc = process.platform === "win32" ? spawn("npm root -g", [], onWindows) : spawn("npm", ["root", "-g"], { stdio });
|
|
45
|
+
let stdout = "";
|
|
46
|
+
proc.stdout?.on("data", (d) => {
|
|
47
|
+
stdout += d.toString();
|
|
48
|
+
});
|
|
49
|
+
const timer = setTimeout(() => {
|
|
50
|
+
proc.kill("SIGTERM");
|
|
51
|
+
resolve(null);
|
|
52
|
+
}, NPM_ROOT_TIMEOUT_MS);
|
|
53
|
+
proc.on("error", () => {
|
|
54
|
+
clearTimeout(timer);
|
|
55
|
+
resolve(null);
|
|
56
|
+
});
|
|
57
|
+
proc.on("close", (code) => {
|
|
58
|
+
clearTimeout(timer);
|
|
59
|
+
const root = stdout.trim();
|
|
60
|
+
resolve(code === 0 && root && !root.includes("***") ? root : null);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function npmConfigPrefix(env) {
|
|
65
|
+
let prefix = "";
|
|
66
|
+
for (const [key, value] of Object.entries(env)) {
|
|
67
|
+
if (key.toLowerCase() === "npm_config_prefix" && value !== undefined) {
|
|
68
|
+
prefix = value;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return prefix;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ../builder-sdk/src/delegate.ts
|
|
75
|
+
var FLOW_SDK_PACKAGE = {
|
|
76
|
+
name: "@uipath/maestro-builder-sdk",
|
|
77
|
+
minimumVersion: "6.11.1"
|
|
78
|
+
};
|
|
79
|
+
var BPMN_CONNECTOR_OPTIONS_VERSION = "6.15.0";
|
|
80
|
+
function commandLabel(family, verb) {
|
|
81
|
+
return `uip maestro ${family} ${verb}`;
|
|
82
|
+
}
|
|
83
|
+
function parseVersion(version) {
|
|
84
|
+
const match = /^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/.exec(version);
|
|
85
|
+
if (!match)
|
|
86
|
+
return null;
|
|
87
|
+
return [
|
|
88
|
+
Number(match[1]),
|
|
89
|
+
Number(match[2]),
|
|
90
|
+
Number(match[3]),
|
|
91
|
+
match[4] !== undefined
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
function versionMeetsFloor(version, floor) {
|
|
95
|
+
const installed = parseVersion(version);
|
|
96
|
+
const minimum = parseVersion(floor);
|
|
97
|
+
if (!installed || !minimum)
|
|
98
|
+
return false;
|
|
99
|
+
for (let index = 0;index < 3; index++) {
|
|
100
|
+
if (installed[index] !== minimum[index]) {
|
|
101
|
+
return installed[index] > minimum[index];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return !installed[3] || minimum[3];
|
|
105
|
+
}
|
|
106
|
+
var FLOW_SDK_INVOKED_AS = "uip maestro";
|
|
107
|
+
function resultCode(family, verb) {
|
|
108
|
+
return [family, verb].map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
109
|
+
}
|
|
110
|
+
function stdoutAsData(stdout) {
|
|
111
|
+
const text = stdout.trimEnd();
|
|
112
|
+
const trimmed = text.trimStart();
|
|
113
|
+
if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
|
|
114
|
+
try {
|
|
115
|
+
const parsed = JSON.parse(trimmed);
|
|
116
|
+
if (parsed !== null && typeof parsed === "object") {
|
|
117
|
+
if (!Array.isArray(parsed) && "ok" in parsed) {
|
|
118
|
+
const { ok: _ok, ...fields } = parsed;
|
|
119
|
+
return fields;
|
|
120
|
+
}
|
|
121
|
+
return parsed;
|
|
122
|
+
}
|
|
123
|
+
} catch {}
|
|
124
|
+
}
|
|
125
|
+
return { Output: text };
|
|
126
|
+
}
|
|
127
|
+
function failureReason(out, err) {
|
|
128
|
+
try {
|
|
129
|
+
const parsed = JSON.parse(out.trim());
|
|
130
|
+
if (parsed !== null && typeof parsed === "object" && typeof parsed.error === "string") {
|
|
131
|
+
return parsed.error;
|
|
132
|
+
}
|
|
133
|
+
} catch {}
|
|
134
|
+
const lines = err.split(`
|
|
135
|
+
`).filter((line) => line.trim() !== "");
|
|
136
|
+
return lines.at(-1)?.trim() ?? out.trim();
|
|
137
|
+
}
|
|
138
|
+
function spawnSdk(cliPath, args, cwd) {
|
|
139
|
+
return new Promise((settle) => {
|
|
140
|
+
let settled = false;
|
|
141
|
+
const resolve = (outcome) => {
|
|
142
|
+
if (settled)
|
|
143
|
+
return;
|
|
144
|
+
settled = true;
|
|
145
|
+
settle(outcome);
|
|
146
|
+
};
|
|
147
|
+
const child = spawn2("node", [cliPath, ...args], {
|
|
148
|
+
cwd,
|
|
149
|
+
env: {
|
|
150
|
+
...process.env,
|
|
151
|
+
FLOW_SDK_INVOKED_AS
|
|
152
|
+
},
|
|
153
|
+
stdio: ["inherit", "pipe", "pipe"]
|
|
154
|
+
});
|
|
155
|
+
const stdout = [];
|
|
156
|
+
const stderr = [];
|
|
157
|
+
const decoderErr = new StringDecoder("utf8");
|
|
158
|
+
const writeLive = (text) => {
|
|
159
|
+
if (text)
|
|
160
|
+
getOutputSink().writeErr(text);
|
|
161
|
+
};
|
|
162
|
+
child.stdout?.on("data", (chunk) => {
|
|
163
|
+
stdout.push(chunk);
|
|
164
|
+
});
|
|
165
|
+
child.stderr?.on("data", (chunk) => {
|
|
166
|
+
stderr.push(chunk);
|
|
167
|
+
writeLive(decoderErr.write(chunk));
|
|
168
|
+
});
|
|
169
|
+
child.once("error", (error) => {
|
|
170
|
+
resolve({ kind: "spawn-error", message: error.message });
|
|
171
|
+
});
|
|
172
|
+
child.once("close", (exitCode, signal) => {
|
|
173
|
+
if (settled)
|
|
174
|
+
return;
|
|
175
|
+
writeLive(decoderErr.end());
|
|
176
|
+
resolve({
|
|
177
|
+
kind: "closed",
|
|
178
|
+
exitCode,
|
|
179
|
+
signal,
|
|
180
|
+
out: Buffer.concat(stdout).toString("utf-8"),
|
|
181
|
+
err: Buffer.concat(stderr).toString("utf-8").trim()
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
async function runChild(cliPath, args, cwd, label) {
|
|
187
|
+
const outcome = await spawnSdk(cliPath, args, cwd);
|
|
188
|
+
if (outcome.kind === "spawn-error") {
|
|
189
|
+
return {
|
|
190
|
+
ok: false,
|
|
191
|
+
exitCode: 1,
|
|
192
|
+
result: RESULTS.Failure,
|
|
193
|
+
message: `${label}: ${outcome.message}`,
|
|
194
|
+
instructions: "Check that node is on PATH, then retry."
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const { exitCode, signal, out, err } = outcome;
|
|
198
|
+
if (exitCode === 0) {
|
|
199
|
+
return { ok: true, data: stdoutAsData(out) };
|
|
200
|
+
}
|
|
201
|
+
if (exitCode !== null) {
|
|
202
|
+
const detail = failureReason(out, err) || `SDK exited with code ${exitCode}`;
|
|
203
|
+
return {
|
|
204
|
+
ok: false,
|
|
205
|
+
exitCode,
|
|
206
|
+
result: RESULTS.Failure,
|
|
207
|
+
message: `${label}: ${detail}`,
|
|
208
|
+
instructions: err ? "Fix what the builder SDK reported (on stderr, and in Message), then retry." : "Fix what the builder SDK reported (see Message), then retry.",
|
|
209
|
+
...out.trim() ? { data: stdoutAsData(out) } : {}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
ok: false,
|
|
214
|
+
exitCode: 1,
|
|
215
|
+
result: RESULTS.Failure,
|
|
216
|
+
message: `${label}: SDK process ended with signal ${signal ?? "unknown"}.`,
|
|
217
|
+
instructions: "Retry the command."
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function upgradeInstructions(found) {
|
|
221
|
+
return found === "workspace" ? `npm install --save-dev ${FLOW_SDK_PACKAGE.name}@latest` : `npm install -g ${FLOW_SDK_PACKAGE.name}@latest`;
|
|
222
|
+
}
|
|
223
|
+
function resolveLocalPackageJson(workspace) {
|
|
224
|
+
const require2 = createRequire(import.meta.url);
|
|
225
|
+
try {
|
|
226
|
+
return require2.resolve(`${FLOW_SDK_PACKAGE.name}/package.json`, {
|
|
227
|
+
paths: [workspace]
|
|
228
|
+
});
|
|
229
|
+
} catch {
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
async function resolveGlobalPackageJson() {
|
|
234
|
+
const root = await npmGlobalRoot();
|
|
235
|
+
if (!root)
|
|
236
|
+
return null;
|
|
237
|
+
const fs = getFileSystem();
|
|
238
|
+
const candidate = fs.path.join(root, ...FLOW_SDK_PACKAGE.name.split("/"), "package.json");
|
|
239
|
+
return await fs.exists(candidate) ? candidate : null;
|
|
240
|
+
}
|
|
241
|
+
async function resolveFlowSdk(workspace, label) {
|
|
242
|
+
const fs = getFileSystem();
|
|
243
|
+
const { name, minimumVersion } = FLOW_SDK_PACKAGE;
|
|
244
|
+
const localPath = resolveLocalPackageJson(workspace);
|
|
245
|
+
const packagePath = localPath ?? await resolveGlobalPackageJson();
|
|
246
|
+
const found = localPath ? "workspace" : packagePath ? "global" : "none";
|
|
247
|
+
if (!packagePath) {
|
|
248
|
+
return {
|
|
249
|
+
ok: false,
|
|
250
|
+
message: `${label}: ${name} is not installed in this workspace or globally.`,
|
|
251
|
+
instructions: upgradeInstructions(found)
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
const packageText = await fs.readFile(packagePath, "utf-8");
|
|
255
|
+
if (packageText === null) {
|
|
256
|
+
return {
|
|
257
|
+
ok: false,
|
|
258
|
+
message: `${label}: could not read ${packagePath}.`,
|
|
259
|
+
instructions: `Reinstall ${name}, then retry.`
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
let version = "";
|
|
263
|
+
try {
|
|
264
|
+
const parsed = JSON.parse(packageText);
|
|
265
|
+
version = typeof parsed.version === "string" ? parsed.version : "";
|
|
266
|
+
} catch {
|
|
267
|
+
version = "";
|
|
268
|
+
}
|
|
269
|
+
if (!versionMeetsFloor(version, minimumVersion)) {
|
|
270
|
+
return {
|
|
271
|
+
ok: false,
|
|
272
|
+
message: `${label}: found ${name} ${version || "with no valid version"}; need >= ${minimumVersion}.`,
|
|
273
|
+
instructions: upgradeInstructions(found)
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
ok: true,
|
|
278
|
+
packageDir: fs.path.dirname(packagePath),
|
|
279
|
+
version,
|
|
280
|
+
found: found === "workspace" ? "workspace" : "global"
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
async function runFlowSdk({
|
|
284
|
+
family,
|
|
285
|
+
commandVerb,
|
|
286
|
+
sdkVerb = commandVerb,
|
|
287
|
+
argv,
|
|
288
|
+
cwd,
|
|
289
|
+
requiresSdkVersion
|
|
290
|
+
}) {
|
|
291
|
+
const fs = getFileSystem();
|
|
292
|
+
const workspace = cwd ?? fs.env.cwd();
|
|
293
|
+
const label = commandLabel(family, commandVerb);
|
|
294
|
+
const resolution = await resolveFlowSdk(workspace, label);
|
|
295
|
+
if (!resolution.ok) {
|
|
296
|
+
return {
|
|
297
|
+
ok: false,
|
|
298
|
+
exitCode: 1,
|
|
299
|
+
result: RESULTS.ConfigError,
|
|
300
|
+
message: resolution.message,
|
|
301
|
+
instructions: resolution.instructions
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
if (requiresSdkVersion && !versionMeetsFloor(resolution.version, requiresSdkVersion.version)) {
|
|
305
|
+
return {
|
|
306
|
+
ok: false,
|
|
307
|
+
exitCode: 1,
|
|
308
|
+
result: RESULTS.ConfigError,
|
|
309
|
+
message: `${label}: ${requiresSdkVersion.because} needs ${FLOW_SDK_PACKAGE.name} >= ${requiresSdkVersion.version}; found ${resolution.version}.`,
|
|
310
|
+
instructions: upgradeInstructions(resolution.found)
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
const cliPath = fs.path.join(resolution.packageDir, "dist", "cli", "index.js");
|
|
314
|
+
const sdkArgv = argv.includes("--json") ? [...argv] : [...argv, "--json"];
|
|
315
|
+
return await runChild(cliPath, [family, sdkVerb, ...sdkArgv], workspace, label);
|
|
316
|
+
}
|
|
317
|
+
async function delegateToFlowSdk(request) {
|
|
318
|
+
const result = await runFlowSdk(request);
|
|
319
|
+
if (result.ok) {
|
|
320
|
+
OutputFormatter.success({
|
|
321
|
+
Result: RESULTS.Success,
|
|
322
|
+
Code: resultCode(request.family, request.commandVerb),
|
|
323
|
+
Data: result.data
|
|
324
|
+
});
|
|
325
|
+
return 0;
|
|
326
|
+
}
|
|
327
|
+
OutputFormatter.error({
|
|
328
|
+
Result: result.result,
|
|
329
|
+
Message: result.message,
|
|
330
|
+
Instructions: result.instructions,
|
|
331
|
+
...result.data ? { Data: pascalCaseDataKeys(result.data) } : {}
|
|
332
|
+
});
|
|
333
|
+
return result.exitCode;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// ../builder-sdk/src/examples.ts
|
|
337
|
+
function sdkCliExample(family, verb, description, command, data) {
|
|
338
|
+
return [
|
|
339
|
+
{
|
|
340
|
+
Description: description,
|
|
341
|
+
Command: command,
|
|
342
|
+
Output: {
|
|
343
|
+
Code: resultCode(family, verb),
|
|
344
|
+
Data: data
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
];
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// ../builder-sdk/src/library-option.ts
|
|
351
|
+
async function resolveLibraryOption(explicit) {
|
|
352
|
+
if (explicit !== undefined)
|
|
353
|
+
return explicit;
|
|
354
|
+
if (getFileSystem().env.getenv("FLOW_SDK_LIBRARY_JSON"))
|
|
355
|
+
return;
|
|
356
|
+
const registry = await resolveMaestroRegistry();
|
|
357
|
+
return registry?.libraryJson;
|
|
358
|
+
}
|
|
359
|
+
async function connectorLibraryInPlay(explicit) {
|
|
360
|
+
if (explicit !== undefined)
|
|
361
|
+
return true;
|
|
362
|
+
if (getFileSystem().env.getenv("FLOW_SDK_LIBRARY_JSON"))
|
|
363
|
+
return true;
|
|
364
|
+
return (await resolveMaestroRegistry())?.libraryJson !== undefined;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// ../builder-sdk/src/commands/check.ts
|
|
368
|
+
var CHECK_EXAMPLES = {
|
|
369
|
+
flow: { input: "Order.flow.ts" },
|
|
370
|
+
case: { input: "Claims.case.ts" },
|
|
371
|
+
bpmn: { input: "Approval.bpmn.ts" }
|
|
372
|
+
};
|
|
373
|
+
var CHECK_RESULT = { Errors: 0, Warnings: 0, Diagnostics: [] };
|
|
374
|
+
var registerCheckCommand = (program, family) => {
|
|
375
|
+
const command = program.command("check <input>").description("Check a source file for authoring errors before compiling it.").option("--source", "Check authored TypeScript");
|
|
376
|
+
if (family === "flow" || family === "bpmn") {
|
|
377
|
+
command.option("--library <dir>", "Connector library directory (defaults to $FLOW_SDK_LIBRARY_JSON, else the pulled library)").option("--connectors-local <dir>", "Connection-resolved connector overlay (default: ./connectors-local)");
|
|
378
|
+
}
|
|
379
|
+
if (family === "bpmn") {
|
|
380
|
+
command.option("--graph", "Also print the resolved wiring: every element with the flows leaving it, implied edges marked ~>");
|
|
381
|
+
}
|
|
382
|
+
const example = CHECK_EXAMPLES[family];
|
|
383
|
+
command.examples(sdkCliExample(family, "check", `Check a ${family} source file before compiling it`, `uip maestro ${family} check ${example.input} --source`, CHECK_RESULT)).trackedAction(processContext, async (input, options) => {
|
|
384
|
+
const argv = [input];
|
|
385
|
+
if (options.source)
|
|
386
|
+
argv.push("--source");
|
|
387
|
+
const connectorOptions = family === "flow" || family === "bpmn";
|
|
388
|
+
const library = connectorOptions ? await resolveLibraryOption(options.library) : undefined;
|
|
389
|
+
addValue(argv, "--library", library);
|
|
390
|
+
addValue(argv, "--connectors-local", connectorOptions ? options.connectorsLocal : undefined);
|
|
391
|
+
if (options.graph)
|
|
392
|
+
argv.push("--graph");
|
|
393
|
+
const gateBpmnConnectors = family === "bpmn" && (options.connectorsLocal !== undefined || await connectorLibraryInPlay(options.library));
|
|
394
|
+
const code = await delegateToFlowSdk({
|
|
395
|
+
family,
|
|
396
|
+
commandVerb: "check",
|
|
397
|
+
argv,
|
|
398
|
+
...gateBpmnConnectors ? {
|
|
399
|
+
requiresSdkVersion: {
|
|
400
|
+
version: BPMN_CONNECTOR_OPTIONS_VERSION,
|
|
401
|
+
because: "the connector library on bpmn check"
|
|
402
|
+
}
|
|
403
|
+
} : {}
|
|
404
|
+
});
|
|
405
|
+
if (code !== 0)
|
|
406
|
+
processContext.exit(code);
|
|
407
|
+
});
|
|
408
|
+
};
|
|
409
|
+
// ../builder-sdk/src/commands/compile.ts
|
|
410
|
+
var COMPILE_EXAMPLES = {
|
|
411
|
+
flow: {
|
|
412
|
+
source: "Order.flow.ts",
|
|
413
|
+
output: "Order.flow",
|
|
414
|
+
result: {
|
|
415
|
+
Path: "/work/Order.flow",
|
|
416
|
+
Nodes: 3,
|
|
417
|
+
Edges: 2,
|
|
418
|
+
Sidecars: [],
|
|
419
|
+
Errors: 0,
|
|
420
|
+
Warnings: 0,
|
|
421
|
+
Diagnostics: []
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
case: {
|
|
425
|
+
source: "Claims.case.ts",
|
|
426
|
+
output: "caseplan.json",
|
|
427
|
+
result: { Path: "/work/caseplan.json", Stages: 3 }
|
|
428
|
+
},
|
|
429
|
+
bpmn: {
|
|
430
|
+
source: "Approval.bpmn.ts",
|
|
431
|
+
output: "Approval.bpmn",
|
|
432
|
+
result: { Path: "/work/Approval.bpmn", Elements: 4 }
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
var registerCompileCommand = (program, family) => {
|
|
436
|
+
const command = program.command("compile <source>").description(`Compile authored TypeScript to a ${family} artifact.`).option("-o, --output <file>", "Output artifact path").option("--library <dir>", "Connector library directory (defaults to the pulled registry)").option("--bindings <file>", "bindings.json path").option("--connectors-local <dir>", "Connection-resolved connector overlay (default: ./connectors-local)");
|
|
437
|
+
if (family === "flow") {
|
|
438
|
+
command.option("--no-check", "Skip the source-level check");
|
|
439
|
+
}
|
|
440
|
+
const example = COMPILE_EXAMPLES[family];
|
|
441
|
+
command.examples(sdkCliExample(family, "compile", `Compile a ${family} source file to an artifact`, `uip maestro ${family} compile ${example.source} --output ${example.output}`, example.result)).trackedAction(processContext, async (source, options) => {
|
|
442
|
+
const argv = [source];
|
|
443
|
+
addValue(argv, "-o", options.output);
|
|
444
|
+
addValue(argv, "--library", await resolveLibraryOption(options.library));
|
|
445
|
+
addValue(argv, "--bindings", options.bindings);
|
|
446
|
+
addValue(argv, "--connectors-local", options.connectorsLocal);
|
|
447
|
+
if (options.check === false)
|
|
448
|
+
argv.push("--no-check");
|
|
449
|
+
const code = await delegateToFlowSdk({
|
|
450
|
+
family,
|
|
451
|
+
commandVerb: "compile",
|
|
452
|
+
argv,
|
|
453
|
+
...family === "bpmn" && options.connectorsLocal !== undefined ? {
|
|
454
|
+
requiresSdkVersion: {
|
|
455
|
+
version: BPMN_CONNECTOR_OPTIONS_VERSION,
|
|
456
|
+
because: "--connectors-local on bpmn compile"
|
|
457
|
+
}
|
|
458
|
+
} : {}
|
|
459
|
+
});
|
|
460
|
+
if (code !== 0)
|
|
461
|
+
processContext.exit(code);
|
|
462
|
+
});
|
|
463
|
+
};
|
|
464
|
+
// ../builder-sdk/src/commands/decompile.ts
|
|
465
|
+
var DECOMPILE_EXAMPLES = {
|
|
466
|
+
flow: {
|
|
467
|
+
input: "Order.flow",
|
|
468
|
+
output: "Order.flow.ts",
|
|
469
|
+
result: {
|
|
470
|
+
Path: "/work/Order.flow.ts",
|
|
471
|
+
Pipeline: "/work/Order.pipeline.mjs"
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
case: {
|
|
475
|
+
input: "caseplan.json",
|
|
476
|
+
output: "Claims.case.ts",
|
|
477
|
+
result: {
|
|
478
|
+
Path: "/work/Claims.case.ts",
|
|
479
|
+
Pipeline: "/work/Claims.pipeline.mjs",
|
|
480
|
+
Diagnostics: []
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
bpmn: {
|
|
484
|
+
input: "Approval/Approval.bpmn",
|
|
485
|
+
output: "Approval.bpmn.ts",
|
|
486
|
+
result: { Path: "/work/Approval.bpmn.ts" },
|
|
487
|
+
extra: " --style nested"
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
var ARTIFACT = {
|
|
491
|
+
flow: { artifact: ".flow", source: ".flow.ts" },
|
|
492
|
+
case: { artifact: "caseplan.json", source: ".case.ts" },
|
|
493
|
+
bpmn: { artifact: ".bpmn", source: ".bpmn.ts" }
|
|
494
|
+
};
|
|
495
|
+
var registerDecompileCommand = (program, family) => {
|
|
496
|
+
const command = program.command("decompile <input>").description(`Convert a ${ARTIFACT[family].artifact} artifact to authored TypeScript.`).option("-o, --output <file>", `Output ${ARTIFACT[family].source} path`).option("--import <specifier>", "SDK import specifier in generated source");
|
|
497
|
+
if (family === "flow") {
|
|
498
|
+
command.option("--strict", "Fail on unsupported constructs");
|
|
499
|
+
} else if (family === "case") {
|
|
500
|
+
command.option("--library <dir>", "Connector library directory (defaults to the pulled registry)").option("--best-effort", "Emit a marked repair scaffold for unsupported constructs");
|
|
501
|
+
} else {
|
|
502
|
+
command.addOption(new Option("--style <style>", "explicit (default) or nested: lift boundary events, gateways and event sub-processes into the nesting constructs where the graph is provably the same").choices(["explicit", "nested"]));
|
|
503
|
+
}
|
|
504
|
+
if (family !== "bpmn") {
|
|
505
|
+
command.option("--no-pipeline", "Do not emit a brownfield pipeline helper");
|
|
506
|
+
}
|
|
507
|
+
const example = DECOMPILE_EXAMPLES[family];
|
|
508
|
+
command.examples(sdkCliExample(family, "decompile", `Convert a ${family} artifact back to authored TypeScript`, `uip maestro ${family} decompile ${example.input} --output ${example.output}${example.extra ?? ""}`, example.result)).trackedAction(processContext, async (input, options) => {
|
|
509
|
+
const argv = [input];
|
|
510
|
+
addValue(argv, "-o", options.output);
|
|
511
|
+
addValue(argv, "--import", options.import);
|
|
512
|
+
if (family === "case") {
|
|
513
|
+
addValue(argv, "--library", await resolveLibraryOption(options.library));
|
|
514
|
+
}
|
|
515
|
+
if (options.strict)
|
|
516
|
+
argv.push("--strict");
|
|
517
|
+
if (options.bestEffort)
|
|
518
|
+
argv.push("--best-effort");
|
|
519
|
+
if (options.pipeline === false)
|
|
520
|
+
argv.push("--no-pipeline");
|
|
521
|
+
addValue(argv, "--style", options.style);
|
|
522
|
+
const code = await delegateToFlowSdk({
|
|
523
|
+
family,
|
|
524
|
+
commandVerb: "decompile",
|
|
525
|
+
argv
|
|
526
|
+
});
|
|
527
|
+
if (code !== 0)
|
|
528
|
+
processContext.exit(code);
|
|
529
|
+
});
|
|
530
|
+
};
|
|
531
|
+
// ../builder-sdk/src/named-second.ts
|
|
532
|
+
function namedOrLegacy(spec) {
|
|
533
|
+
if (spec.named !== undefined && spec.legacy !== undefined) {
|
|
534
|
+
usageError(`pass ${spec.flag} or a second argument, not both`, spec.usage);
|
|
535
|
+
}
|
|
536
|
+
if (spec.named === "") {
|
|
537
|
+
usageError(`option '${spec.flag}' argument missing`, spec.usage);
|
|
538
|
+
}
|
|
539
|
+
if (spec.named !== undefined)
|
|
540
|
+
return spec.named;
|
|
541
|
+
if (spec.legacy === undefined) {
|
|
542
|
+
usageError(`required option '${spec.flag}' not specified`, spec.usage);
|
|
543
|
+
}
|
|
544
|
+
getOutputSink().writeErr(`[WARN] The two-argument form is deprecated. Use \`${spec.usage}\` instead.
|
|
545
|
+
`);
|
|
546
|
+
return spec.legacy;
|
|
547
|
+
}
|
|
548
|
+
function usageError(message, usage) {
|
|
549
|
+
throw Object.assign(new Error(message), {
|
|
550
|
+
result: RESULTS.ValidationError,
|
|
551
|
+
errorCode: "invalid_argument",
|
|
552
|
+
retry: "RetryWillNotFix",
|
|
553
|
+
instructions: `Usage: ${usage}`
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// ../builder-sdk/src/commands/merge.ts
|
|
558
|
+
var MERGE_EXAMPLES = {
|
|
559
|
+
flow: {
|
|
560
|
+
description: "Merge edited authored content into the original Flow artifact",
|
|
561
|
+
command: "uip maestro flow merge Edited.flow --original Original.flow --output Merged.flow --baseline Baseline.flow",
|
|
562
|
+
result: { Path: "/work/Merged.flow", Nodes: 3, Edges: 2 }
|
|
563
|
+
},
|
|
564
|
+
case: {
|
|
565
|
+
description: "Merge edited authored content into the original Case artifact",
|
|
566
|
+
command: "uip maestro case merge edited.caseplan.json --original original.caseplan.json --output merged.caseplan.json",
|
|
567
|
+
result: { Path: "/work/merged.caseplan.json", Stages: 3 }
|
|
568
|
+
},
|
|
569
|
+
bpmn: {
|
|
570
|
+
description: "Merge an edited process into the original BPMN artifact, keeping untouched elements byte for byte",
|
|
571
|
+
command: "uip maestro bpmn merge Edited.bpmn --original Original.bpmn --output Merged.bpmn --baseline Baseline.bpmn",
|
|
572
|
+
result: {
|
|
573
|
+
Path: "/work/Merged.bpmn",
|
|
574
|
+
Preserved: 5,
|
|
575
|
+
Authored: 1,
|
|
576
|
+
Removed: 0
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
var registerMergeCommand = (program, family) => {
|
|
581
|
+
const command = program.command("merge <edited>").description(`Merge an edited ${family} with its original artifact.`).option("--original <file>", "Original artifact to merge into (required)").option("-o, --output <file>", "Merged output path").allowExcessArguments(true);
|
|
582
|
+
if (family !== "case") {
|
|
583
|
+
command.option("--baseline <file>", "Compiled pristine decompile");
|
|
584
|
+
}
|
|
585
|
+
const example = MERGE_EXAMPLES[family];
|
|
586
|
+
command.examples(sdkCliExample(family, "merge", example.description, example.command, example.result)).trackedAction(processContext, async (first, options, cmd) => {
|
|
587
|
+
const usage = `uip maestro ${family} merge <edited> --original <file>`;
|
|
588
|
+
if (cmd.args.length > 2) {
|
|
589
|
+
usageError(`unexpected argument '${cmd.args[2]}'`, usage);
|
|
590
|
+
}
|
|
591
|
+
const legacyEdited = cmd.args[1];
|
|
592
|
+
const original = namedOrLegacy({
|
|
593
|
+
named: options.original,
|
|
594
|
+
legacy: legacyEdited === undefined ? undefined : first,
|
|
595
|
+
flag: "--original",
|
|
596
|
+
usage
|
|
597
|
+
});
|
|
598
|
+
const edited = legacyEdited ?? first;
|
|
599
|
+
const tail = [];
|
|
600
|
+
addValue(tail, "-o", options.output);
|
|
601
|
+
addValue(tail, "--baseline", options.baseline);
|
|
602
|
+
const code = await delegateToFlowSdk({
|
|
603
|
+
family,
|
|
604
|
+
commandVerb: "merge",
|
|
605
|
+
argv: [edited, "--original", original, ...tail]
|
|
606
|
+
});
|
|
607
|
+
if (code !== 0)
|
|
608
|
+
processContext.exit(code);
|
|
609
|
+
});
|
|
610
|
+
};
|
|
611
|
+
// ../builder-sdk/src/commands/registry.ts
|
|
612
|
+
function collect(value, previous) {
|
|
613
|
+
return [...previous, value];
|
|
614
|
+
}
|
|
615
|
+
async function delegate(commandVerb, argv) {
|
|
616
|
+
const code = await delegateToFlowSdk({
|
|
617
|
+
family: "registry",
|
|
618
|
+
commandVerb,
|
|
619
|
+
argv
|
|
620
|
+
});
|
|
621
|
+
if (code !== 0)
|
|
622
|
+
processContext.exit(code);
|
|
623
|
+
}
|
|
624
|
+
var registerPull = (registry) => {
|
|
625
|
+
registry.command("pull").description("Download the connector library into the shared cache and generate the descriptors this project imports.").option("--connectors <dir>", "TypeScript descriptor output (default: ./connectors)").option("--connector <key>", "only generate this connector (repeatable; default: whatever the project references)", collect, []).option("--library <dir>", "extract here instead of the shared cache").option("--library-md <dir>", "generate Markdown here instead").option("--url <url>", "archive URL to pull from").option("--archive <zip>", "use a zip already on disk").option("--force", "re-download and regenerate").option("--import <specifier>", "module specifier for descriptors").option("--triggers <path>", "registry-triggers.json for triggers").option("--python <executable>", "Python interpreter for the generators").option("--cache <dir>", "where downloaded archives are kept").option("--root <prefix>", "only extract archive entries under this prefix").option("--extractor <path>", "extract_library.py to run instead of the packaged copy").option("--generator <path>", "materialize_registry.py to run instead of the packaged copy").examples(sdkCliExample("registry", "pull", "Pull the library and generate the Slack descriptor", "uip maestro registry pull --connector uipath-salesforce-slack", {
|
|
626
|
+
Sha256: "f2ae49be22ec…",
|
|
627
|
+
Library: "~/.uipath/cache/flow-sdk/library/f2ae49be22ec…/library-json",
|
|
628
|
+
LibraryMarkdown: "~/.uipath/cache/flow-sdk/library/f2ae49be22ec…/library-md",
|
|
629
|
+
MadeCurrent: true,
|
|
630
|
+
Connectors: "/work/connectors",
|
|
631
|
+
Generated: ["uipath-salesforce-slack"]
|
|
632
|
+
})).trackedAction(processContext, async (options) => {
|
|
633
|
+
const argv = [];
|
|
634
|
+
addValue(argv, "--connectors", options.connectors);
|
|
635
|
+
for (const key of options.connector ?? []) {
|
|
636
|
+
argv.push("--connector", key);
|
|
637
|
+
}
|
|
638
|
+
addValue(argv, "--library", options.library);
|
|
639
|
+
addValue(argv, "--library-md", options.libraryMd);
|
|
640
|
+
addValue(argv, "--url", options.url);
|
|
641
|
+
addValue(argv, "--archive", options.archive);
|
|
642
|
+
if (options.force)
|
|
643
|
+
argv.push("--force");
|
|
644
|
+
addValue(argv, "--import", options.import);
|
|
645
|
+
addValue(argv, "--triggers", options.triggers);
|
|
646
|
+
addValue(argv, "--python", options.python);
|
|
647
|
+
addValue(argv, "--cache", options.cache);
|
|
648
|
+
addValue(argv, "--root", options.root);
|
|
649
|
+
addValue(argv, "--extractor", options.extractor);
|
|
650
|
+
addValue(argv, "--generator", options.generator);
|
|
651
|
+
await delegate("pull", argv);
|
|
652
|
+
});
|
|
653
|
+
};
|
|
654
|
+
var registerSearch = (registry) => {
|
|
655
|
+
registry.command("search [query...]").description("Find connector operations in the cached library.").passThroughOptions().allowExcessArguments(true).option("--library <dir>", "library-json directory (default: the cache)").option("--library-md <dir>", "markdown tree").option("--connector <key>", "restrict to one connector key").option("--limit <n>", "maximum results").examples(sdkCliExample("registry", "search", "Find the Slack channel-message operation", "uip maestro registry search slack send message --limit 5", { Total: 2, Operations: ["…"] })).trackedAction(processContext, async (_query, options, cmd) => {
|
|
656
|
+
const argv = [...cmd.args];
|
|
657
|
+
addValue(argv, "--library", options.library);
|
|
658
|
+
addValue(argv, "--library-md", options.libraryMd);
|
|
659
|
+
addValue(argv, "--connector", options.connector);
|
|
660
|
+
addValue(argv, "--limit", options.limit);
|
|
661
|
+
await delegate("search", argv);
|
|
662
|
+
});
|
|
663
|
+
};
|
|
664
|
+
var registerPath = (registry) => {
|
|
665
|
+
registry.command("path").description("Print where the cached connector library is.").option("--library-json", "print only the library-json directory").option("--library-md", "print only the markdown directory").option("--root", "print only the cache root").option("--sha", "print only the checksum current points at").examples(sdkCliExample("registry", "path", "Print the Markdown library directory, bare, for $(…) capture", "uip maestro registry path --library-md --output plain", {
|
|
666
|
+
LibraryMarkdown: "~/.uipath/cache/flow-sdk/library/current/library-md"
|
|
667
|
+
})).trackedAction(processContext, async (options) => {
|
|
668
|
+
const argv = [];
|
|
669
|
+
if (options.libraryJson)
|
|
670
|
+
argv.push("--library-json");
|
|
671
|
+
if (options.libraryMd)
|
|
672
|
+
argv.push("--library-md");
|
|
673
|
+
if (options.root)
|
|
674
|
+
argv.push("--root");
|
|
675
|
+
if (options.sha)
|
|
676
|
+
argv.push("--sha");
|
|
677
|
+
await delegate("path", argv);
|
|
678
|
+
});
|
|
679
|
+
};
|
|
680
|
+
function strayPositional(cmd, tail) {
|
|
681
|
+
for (let index = 0;index < tail.length; index++) {
|
|
682
|
+
const token = tail[index];
|
|
683
|
+
if (!token.startsWith("-"))
|
|
684
|
+
return token;
|
|
685
|
+
if (token.includes("="))
|
|
686
|
+
continue;
|
|
687
|
+
const option = cmd.options.find((candidate) => candidate.long === token || candidate.short === token);
|
|
688
|
+
if (option === undefined)
|
|
689
|
+
return;
|
|
690
|
+
if (option.required || option.optional)
|
|
691
|
+
index++;
|
|
692
|
+
}
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
var PREPARE_USAGE = "uip maestro registry prepare <connector-key> --action <name>";
|
|
696
|
+
var registerPrepare = (registry) => {
|
|
697
|
+
registry.command("prepare <connector-key>").description("Resolve one operation's schema against a live connection into ./connectors-local, and record the connection in bindings.json.").passThroughOptions().allowExcessArguments(true).option("--action <name>", "operation to resolve, e.g. insert-record (required)", (value, previous) => [
|
|
698
|
+
...previous ?? [],
|
|
699
|
+
value
|
|
700
|
+
]).option("--connection-id <id>", "connection to read the schema through (default: discovered)").option("--connection <name>", "pick the connection by name when several match").option("--connection-folder <folder>", "pick the connection in the folder the flow runs in (name or key) when several match").option("--bindings <file>", "bindings file to update (default: ./bindings.json)").option("--bind-connection <name>", "symbolic connection name (default: the connector suffix)").option("--bind-folder <name>", "symbolic folder name (default: shared)").option("--no-bindings", "discover the connection but leave bindings.json alone").option("--object <name>", "one connection-discovered object").option("--all-objects", "every connection-discovered object").option("-f, --field <name=value>", "parent field that selects the schema (repeatable)", collect, []).option("--out <dir>", "overlay directory (default: ./connectors-local)").option("--connector-version <version>", "connector version to resolve against").option("--import <specifier>", "module specifier for descriptors").option("--resolve <field:by=value>", "resolve a lookup field to the id the connector wants (repeatable)", collect, []).option("--refresh-lookups", "re-resolve lookups already recorded in resolutions.json").option("--json-only", "write the JSON overlay without TypeScript").option("--python <executable>", "Python interpreter for the generator").option("--generator <path>", "prepare_connector.py to run instead of the packaged copy").examples([
|
|
701
|
+
...sdkCliExample("registry", "prepare", "Resolve a Salesforce custom object the shipped library cannot know", "uip maestro registry prepare uipath-salesforce-sfdc --action insert-record --object Company__c", {
|
|
702
|
+
Connector: "uipath-salesforce-sfdc",
|
|
703
|
+
Action: "insert-record",
|
|
704
|
+
Overlay: "/work/connectors-local"
|
|
705
|
+
}),
|
|
706
|
+
...sdkCliExample("registry", "prepare", "Resolve Slack lookup fields to ids and pick one of several connections", "uip maestro registry prepare uipath-salesforce-slack --action send-message-to-channel --connection is-sandboxes --resolve channel:name=general --resolve send_as:name=user", {
|
|
707
|
+
Connector: "uipath-salesforce-slack",
|
|
708
|
+
Action: "send-message-to-channel",
|
|
709
|
+
Overlay: "/work/connectors-local"
|
|
710
|
+
})
|
|
711
|
+
]).trackedAction(processContext, async (connectorKey, options, cmd) => {
|
|
712
|
+
const tail = cmd.args.slice(1);
|
|
713
|
+
const before = options.action ?? [];
|
|
714
|
+
if (before.length > 1) {
|
|
715
|
+
usageError("pass --action once", PREPARE_USAGE);
|
|
716
|
+
}
|
|
717
|
+
let named = before[0];
|
|
718
|
+
const at = tail.findIndex((token) => token === "--action" || token.startsWith("--action="));
|
|
719
|
+
if (at >= 0) {
|
|
720
|
+
const token = tail[at];
|
|
721
|
+
const inline = token.startsWith("--action=");
|
|
722
|
+
const value = inline ? token.slice("--action=".length) : tail[at + 1];
|
|
723
|
+
if (!value || value.startsWith("-")) {
|
|
724
|
+
usageError("option '--action <name>' argument missing", PREPARE_USAGE);
|
|
725
|
+
}
|
|
726
|
+
if (named !== undefined) {
|
|
727
|
+
usageError("pass --action once", PREPARE_USAGE);
|
|
728
|
+
}
|
|
729
|
+
named = value;
|
|
730
|
+
tail.splice(at, inline ? 1 : 2);
|
|
731
|
+
if (tail.some((token2) => token2 === "--action" || token2.startsWith("--action="))) {
|
|
732
|
+
usageError("pass --action once", PREPARE_USAGE);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
const legacy = tail[0] !== undefined && !tail[0].startsWith("-") ? tail.shift() : undefined;
|
|
736
|
+
const extra = strayPositional(cmd, tail);
|
|
737
|
+
if (extra !== undefined) {
|
|
738
|
+
usageError(`unexpected argument '${extra}'`, PREPARE_USAGE);
|
|
739
|
+
}
|
|
740
|
+
const action = namedOrLegacy({
|
|
741
|
+
named,
|
|
742
|
+
legacy,
|
|
743
|
+
flag: "--action",
|
|
744
|
+
usage: PREPARE_USAGE
|
|
745
|
+
});
|
|
746
|
+
const argv = tail;
|
|
747
|
+
addValue(argv, "--connection-id", options.connectionId);
|
|
748
|
+
addValue(argv, "--connection", options.connection);
|
|
749
|
+
addValue(argv, "--connection-folder", options.connectionFolder);
|
|
750
|
+
addValue(argv, "--bindings", options.bindings);
|
|
751
|
+
addValue(argv, "--bind-connection", options.bindConnection);
|
|
752
|
+
addValue(argv, "--bind-folder", options.bindFolder);
|
|
753
|
+
if (options.bindings === false)
|
|
754
|
+
argv.push("--no-bindings");
|
|
755
|
+
addValue(argv, "--object", options.object);
|
|
756
|
+
if (options.allObjects)
|
|
757
|
+
argv.push("--all-objects");
|
|
758
|
+
for (const field of options.field ?? []) {
|
|
759
|
+
argv.push("-f", field);
|
|
760
|
+
}
|
|
761
|
+
addValue(argv, "--out", options.out);
|
|
762
|
+
addValue(argv, "--connector-version", options.connectorVersion);
|
|
763
|
+
addValue(argv, "--import", options.import);
|
|
764
|
+
for (const one of options.resolve ?? []) {
|
|
765
|
+
argv.push("--resolve", one);
|
|
766
|
+
}
|
|
767
|
+
if (options.refreshLookups)
|
|
768
|
+
argv.push("--refresh-lookups");
|
|
769
|
+
if (options.jsonOnly)
|
|
770
|
+
argv.push("--json-only");
|
|
771
|
+
addValue(argv, "--python", options.python);
|
|
772
|
+
addValue(argv, "--generator", options.generator);
|
|
773
|
+
await delegate("prepare", [
|
|
774
|
+
connectorKey,
|
|
775
|
+
"--action",
|
|
776
|
+
action,
|
|
777
|
+
...argv
|
|
778
|
+
]);
|
|
779
|
+
});
|
|
780
|
+
};
|
|
781
|
+
var registerRegistryCommands = (program) => {
|
|
782
|
+
const registry = program.command("registry").description("Acquire, locate, search and prepare the connector library shared by Flow, Case, and BPMN.").enablePositionalOptions();
|
|
783
|
+
registerPull(registry);
|
|
784
|
+
registerSearch(registry);
|
|
785
|
+
registerPath(registry);
|
|
786
|
+
registerPrepare(registry);
|
|
787
|
+
};
|
|
788
|
+
// ../builder-sdk/src/commands/tidy.ts
|
|
789
|
+
var registerTidyCommand = (program) => {
|
|
790
|
+
program.command("tidy <input>").description("Add diagram layout to a compiled .bpmn artifact.").option("-o, --output <file>", "Output .bpmn path").examples(sdkCliExample("bpmn", "tidy", "Add diagram layout and write the result to a separate BPMN artifact", "uip maestro bpmn tidy Approval.bpmn --output Approval.tidied.bpmn", { Path: "/work/Approval.tidied.bpmn", Shapes: 4 })).trackedAction(processContext, async (input, options) => {
|
|
791
|
+
const argv = [input];
|
|
792
|
+
addValue(argv, "-o", options.output);
|
|
793
|
+
const code = await delegateToFlowSdk({
|
|
794
|
+
family: "bpmn",
|
|
795
|
+
commandVerb: "tidy",
|
|
796
|
+
argv
|
|
797
|
+
});
|
|
798
|
+
if (code !== 0)
|
|
799
|
+
processContext.exit(code);
|
|
800
|
+
});
|
|
801
|
+
};
|
|
802
|
+
export { resolveFlowSdk, runFlowSdk, registerCheckCommand, registerCompileCommand, registerDecompileCommand, registerMergeCommand, registerRegistryCommands, registerTidyCommand };
|
|
803
|
+
|
|
804
|
+
//# debugId=1EE1D7D6FDBF346264756E2164756E21
|