@uipath/maestro-builder-sdk 6.9.4 → 6.10.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.
Files changed (46) hide show
  1. package/README.md +18 -10
  2. package/dist/api-index.md +15 -15
  3. package/dist/api-members.md +14 -14
  4. package/dist/bpmn/check-cli.js +2 -0
  5. package/dist/bpmn/compile-cli.js +3 -1
  6. package/dist/bpmn/decompile-cli.js +3 -1
  7. package/dist/bpmn/merge-cli.js +3 -1
  8. package/dist/bpmn/tidy-cli.js +3 -0
  9. package/dist/case/check-cli.js +2 -0
  10. package/dist/case/compile-cli.js +3 -1
  11. package/dist/case/decompile-cli.js +3 -0
  12. package/dist/case/merge-cli.js +3 -1
  13. package/dist/check-cli.js +2 -0
  14. package/dist/check.js +2 -2
  15. package/dist/cli/commands/bpmn.js +16 -10
  16. package/dist/cli/commands/case.js +16 -10
  17. package/dist/cli/commands/flow.d.ts +1 -1
  18. package/dist/cli/commands/flow.js +45 -21
  19. package/dist/cli/commands/registry.js +11 -3
  20. package/dist/cli/common.d.ts +41 -0
  21. package/dist/cli/common.js +97 -0
  22. package/dist/cli/index.js +40 -2
  23. package/dist/cli-result.d.ts +22 -0
  24. package/dist/cli-result.js +31 -0
  25. package/dist/compile-cli.js +12 -0
  26. package/dist/core/actions.d.ts +1 -2
  27. package/dist/core/actions.js +1 -2
  28. package/dist/core/cli-spelling.d.ts +5 -3
  29. package/dist/core/cli-spelling.js +8 -4
  30. package/dist/core/lookups.js +1 -1
  31. package/dist/decompile-cli.js +3 -0
  32. package/dist/merge-cli.js +3 -1
  33. package/dist/registry/generators/markdown/sections/choosing-object.js +1 -1
  34. package/dist/registry/generators/markdown/sections/example.js +2 -2
  35. package/dist/registry/generators/markdown/sections/lookups.js +1 -1
  36. package/dist/registry/generators/markdown/sections/schema-dynamic.js +3 -3
  37. package/dist/registry/library-build/cli.js +3 -0
  38. package/dist/registry/materialize-cli.js +7 -0
  39. package/dist/registry/path-cli.js +14 -7
  40. package/dist/registry/prepare/messages.js +4 -4
  41. package/dist/registry/prepare/pipeline.d.ts +2 -0
  42. package/dist/registry/prepare/pipeline.js +4 -2
  43. package/dist/registry/prepare-cli.js +6 -3
  44. package/dist/registry/pull-cli.js +10 -1
  45. package/dist/registry/search-cli.js +2 -0
  46. package/package.json +7 -2
@@ -54,14 +54,14 @@ export function schemaDynamicLines(j, nodeType) {
54
54
  out.push("> ```bash");
55
55
  // ONE spelling on every page, the one `check` prints; no `--connection-id`.
56
56
  if (discovery) {
57
- out.push(`> npx flow-sdk registry prepare ${key} ${action} ${supply}`);
57
+ out.push(`> npx flow-sdk registry prepare ${key} --action ${action} ${supply}`);
58
58
  }
59
59
  else if (supply) {
60
- out.push(`> npx flow-sdk registry prepare ${key} ${action} \\`);
60
+ out.push(`> npx flow-sdk registry prepare ${key} --action ${action} \\`);
61
61
  out.push(`> ${supply}`);
62
62
  }
63
63
  else {
64
- out.push(`> npx flow-sdk registry prepare ${key} ${action}`);
64
+ out.push(`> npx flow-sdk registry prepare ${key} --action ${action}`);
65
65
  }
66
66
  out.push("> ```");
67
67
  out.push(">");
@@ -13,6 +13,8 @@
13
13
  * tenant, which is the only way its exit codes can be pinned.
14
14
  */
15
15
  import { rmSync } from "node:fs";
16
+ import { resolve } from "node:path";
17
+ import { reportResult } from "../../cli-result.js";
16
18
  import { UsageError, exitCodeOf, messageOf } from "../errors.js";
17
19
  import { consoleReporter } from "../reporter.js";
18
20
  import { OfflineUipClient, defaultUipClient } from "../uip/client.js";
@@ -173,6 +175,7 @@ export async function run(argv, deps = {}) {
173
175
  }
174
176
  }
175
177
  reporter.info("Done!");
178
+ reportResult({ outputDir: resolve(options.outputDir) });
176
179
  return 0;
177
180
  }
178
181
  catch (error) {
@@ -1,3 +1,5 @@
1
+ import { resolve } from "node:path";
2
+ import { reportResult } from "../cli-result.js";
1
3
  import { exitCodeOf, messageOf } from "./errors.js";
2
4
  import { materializeRegistry } from "./materializer.js";
3
5
  /**
@@ -51,6 +53,11 @@ export async function run(argv) {
51
53
  checkSymbols: argv.includes("--check-symbols"),
52
54
  checkOrphans: argv.includes("--check-orphans"),
53
55
  });
56
+ reportResult({
57
+ libraryJson: resolve(libraryJsonPath),
58
+ ...(libraryMarkdownPath ? { libraryMarkdown: resolve(libraryMarkdownPath) } : {}),
59
+ ...(connectorsPath ? { connectors: resolve(connectorsPath) } : {}),
60
+ });
54
61
  return 0;
55
62
  }
56
63
  catch (error) {
@@ -1,3 +1,4 @@
1
+ import { reportResult } from '../cli-result.js';
1
2
  import { join } from "node:path";
2
3
  import { CURRENT_LINK, currentEntrySha, libraryCacheRoot, resolveCachedLibrary, resolveCachedMarkdown, } from "./cache.js";
3
4
  /**
@@ -27,7 +28,11 @@ export async function run(argv) {
27
28
  const libraryJson = resolveCachedLibrary();
28
29
  const libraryMarkdown = resolveCachedMarkdown();
29
30
  const sha256 = currentEntrySha();
30
- const single = (value) => {
31
+ // With one flag, `--json` reports just that field, like the text output. A
32
+ // caller capturing one value (`uip maestro registry path --sha --output
33
+ // plain`, which prints each Data value) must still get exactly one.
34
+ const single = (field, value) => {
35
+ reportResult({ [field]: value ?? null });
31
36
  if (!value) {
32
37
  console.error("No connector library in the cache yet. Run `flow-sdk registry pull`.");
33
38
  return 1;
@@ -36,20 +41,22 @@ export async function run(argv) {
36
41
  return 0;
37
42
  };
38
43
  if (argv.includes("--library-json"))
39
- return single(libraryJson);
44
+ return single("libraryJson", libraryJson);
40
45
  if (argv.includes("--library-md"))
41
- return single(libraryMarkdown);
46
+ return single("libraryMarkdown", libraryMarkdown);
42
47
  if (argv.includes("--root"))
43
- return single(root);
48
+ return single("root", root);
44
49
  if (argv.includes("--sha"))
45
- return single(sha256);
46
- console.log(JSON.stringify({
50
+ return single("sha256", sha256);
51
+ const all = {
47
52
  root,
48
53
  current: join(root, CURRENT_LINK),
49
54
  sha256: sha256 ?? null,
50
55
  libraryJson: libraryJson ?? null,
51
56
  libraryMarkdown: libraryMarkdown ?? null,
52
- }, null, 2));
57
+ };
58
+ reportResult(all);
59
+ console.log(JSON.stringify(all, null, 2));
53
60
  // Not an error: a caller asking for the whole picture is entitled to be told
54
61
  // the cache is empty, rather than getting a non-zero exit for a plain report.
55
62
  return 0;
@@ -73,7 +73,7 @@ export function sourceLabelSuffix(files) {
73
73
  export function ambiguousLabelsMessage(attribute, connectorKey, action, labels, command) {
74
74
  const flag = attribute === "connection" ? "--bind-connection" : "--bind-folder";
75
75
  const files = [...new Set([...labels.values()].flat())];
76
- const lines = [...labels.keys()].map((label) => ` ${command} ${connectorKey} ${action} ${flag} ${label} --connection-id <id>`);
76
+ const lines = [...labels.keys()].map((label) => ` ${command} ${connectorKey} --action ${action} ${flag} ${label} --connection-id <id>`);
77
77
  return prefixed(`${files.join(", ")} ${files.length === 1 ? "uses" : "use"} ${labels.size} ${attribute} labels for ${connectorKey} `
78
78
  + `(${[...labels.keys()].join(", ")}), and one prepare binds one ${attribute === "connection" ? "connection" : "folder key"}. `
79
79
  + `Bind each label to the connection it means, one run per label:\n${lines.join("\n")}\n`
@@ -328,7 +328,7 @@ export function resolvedParentsNote(connectorKey, action, actionParents, resolve
328
328
  return (`${PREFIX}note: this operation resolves its fields ` +
329
329
  "from the VALUES of parent inputs, and the resolutions above " +
330
330
  "ARE those values. Re-run to materialize the full field set:\n" +
331
- ` ${command} ${connectorKey} ${action} ${fieldsArg}`);
331
+ ` ${command} ${connectorKey} --action ${action} ${fieldsArg}`);
332
332
  }
333
333
  /** The note when some schema parent did not arrive as `-f`, with the example re-run. */
334
334
  export function missingParentsNote(connectorKey, action, actionParents, missing, parentFields, command = PREPARE_COMMAND) {
@@ -347,7 +347,7 @@ export function missingParentsNote(connectorKey, action, actionParents, missing,
347
347
  "body field the object declares is not there yet and compile " +
348
348
  "will refuse it as an unknown input. Re-run passing ALL of them " +
349
349
  "as -f NAME=VALUE (a partial set is rejected):\n" +
350
- ` ${command} ${connectorKey} ${action} ${example}`);
350
+ ` ${command} ${connectorKey} --action ${action} ${example}`);
351
351
  }
352
352
  /**
353
353
  * `_print_lookup_vocabulary`: the lookup table for the operation just
@@ -374,7 +374,7 @@ export function lookupVocabularyLines(connectorKey, action, objectName, specs, c
374
374
  const [field, spec] = shown[0];
375
375
  const by = (pyTruthy(spec.by) ? spec.by : ["id"])[0];
376
376
  const obj = objectName ? ` --object ${objectName}` : "";
377
- lines.push(`${PREFIX}resolve with: ${command} ${connectorKey} ${action}${obj} --resolve ${field}:${by}=<value>`);
377
+ lines.push(`${PREFIX}resolve with: ${command} ${connectorKey} --action ${action}${obj} --resolve ${field}:${by}=<value>`);
378
378
  return lines;
379
379
  }
380
380
  // ---------------------------------------------------------------------------
@@ -50,6 +50,8 @@ export interface PreparePorts {
50
50
  /** How the pasteable `registry prepare` is spelled in the notes. */
51
51
  prepareCommand?: string;
52
52
  }
53
+ /** Where prepare writes its overlay when `--out` is not given. */
54
+ export declare const DEFAULT_OVERLAY_DIR = "./connectors-local";
53
55
  export interface PrepareReport {
54
56
  kind: "action" | "event";
55
57
  /** The node type the overlay entry is stored under (the WAIT form for an event). */
@@ -49,6 +49,8 @@ import { retryOtherConnections } from "./retry.js";
49
49
  import { repointSource } from "./source-import.js";
50
50
  import { sourceBindingLabels } from "./source-labels.js";
51
51
  import { isPlainObject, pyGet, pyOr, pyPathJoin, pyPathlibStr, pyStrAny, pyTruthy } from "./support.js";
52
+ /** Where prepare writes its overlay when `--out` is not given. */
53
+ export const DEFAULT_OVERLAY_DIR = "./connectors-local";
52
54
  function memoryCaches() {
53
55
  return { registry: new MemoryResponseCache(), is: new MemoryResponseCache(), connectors: new MemoryResponseCache() };
54
56
  }
@@ -105,7 +107,7 @@ function chooseLabels(options, ports) {
105
107
  const command = ports.prepareCommand ?? PREPARE_COMMAND;
106
108
  const labels = sourceBindingLabels({
107
109
  cwd: ports.cwd ?? process.cwd(),
108
- out: options.out ?? "./connectors-local",
110
+ out: options.out ?? DEFAULT_OVERLAY_DIR,
109
111
  connectorKey: options.connectorKey,
110
112
  source: options.source,
111
113
  });
@@ -308,7 +310,7 @@ async function prepareOnConnection(options, ports, connected) {
308
310
  const { connectorKey, action } = options;
309
311
  const fieldPairs = options.fields ?? [];
310
312
  const parentFields = parseFields(fieldPairs);
311
- const outShown = options.out ?? "./connectors-local";
313
+ const outShown = options.out ?? DEFAULT_OVERLAY_DIR;
312
314
  const out = resolve(cwd, outShown);
313
315
  const importSpecifier = options.importSpecifier ?? PACKAGE_NAME;
314
316
  const jsonOnly = options.jsonOnly ?? false;
@@ -1,7 +1,9 @@
1
+ import { resolve } from 'node:path';
2
+ import { reportResult } from '../cli-result.js';
1
3
  import { PACKAGE_NAME } from "../package-name.js";
2
4
  import { exitCodeOf } from "./errors.js";
3
5
  import { exitText } from "./prepare/messages.js";
4
- import { prepareConnector as runPipeline } from "./prepare/pipeline.js";
6
+ import { DEFAULT_OVERLAY_DIR, prepareConnector as runPipeline } from "./prepare/pipeline.js";
5
7
  import { consoleReporter } from "./reporter.js";
6
8
  import { defaultUipClient } from "./uip/client.js";
7
9
  // This mirrors the generator's own flags one for one, so a `--version` here is
@@ -12,7 +14,7 @@ import { defaultUipClient } from "./uip/client.js";
12
14
  * relative path that only resolves inside a source checkout. */
13
15
  const DEFAULT_CONNECTOR_IMPORT = PACKAGE_NAME;
14
16
  const USAGE = [
15
- "Usage: flow-sdk registry prepare <connector-key> <action> [--connection-id <id>]",
17
+ "Usage: flow-sdk registry prepare <connector-key> --action <name> [--connection-id <id>]",
16
18
  " [--connection <name>] [--bindings <file>] [--no-bindings]",
17
19
  " [--object <name> | --all-objects] [-f NAME=VALUE ...]",
18
20
  " [--resolve FIELD:BY=VALUE ...] [--refresh-lookups]",
@@ -180,7 +182,8 @@ export async function run(argv) {
180
182
  }
181
183
  }
182
184
  try {
183
- await prepareConnector(options);
185
+ const report = await prepareConnector(options);
186
+ reportResult({ connector: options.connectorKey, action: options.action, overlay: resolve(options.outPath ?? DEFAULT_OVERLAY_DIR), ...report });
184
187
  return 0;
185
188
  }
186
189
  catch (error) {
@@ -1,6 +1,7 @@
1
+ import { reportResult } from '../cli-result.js';
1
2
  import { createHash } from "node:crypto";
2
3
  import { mkdir, readFile, rename, rm, stat, symlink, writeFile, } from "node:fs/promises";
3
- import { join } from "node:path";
4
+ import { join, resolve } from "node:path";
4
5
  import { CURRENT_LINK, LIBRARY_JSON_DIR, LIBRARY_MARKDOWN_DIR, cacheEntry, libraryCacheRoot, referencedConnectorKeys, } from "./cache.js";
5
6
  import { extractLibrary } from "./extractor.js";
6
7
  import { materializeRegistry } from "./materializer.js";
@@ -302,6 +303,14 @@ export async function run(argv) {
302
303
  if (!value(argv, "--library")) {
303
304
  await pointCurrentAt(cacheDir, sha256);
304
305
  }
306
+ reportResult({
307
+ sha256,
308
+ library: resolve(libraryPath),
309
+ libraryMarkdown: resolve(markdownPath),
310
+ madeCurrent: !value(argv, "--library"),
311
+ connectors: resolve(connectorsPath),
312
+ generated: referenced,
313
+ });
305
314
  console.error(`registry pull: ${sha256.slice(0, 12)}… ready in ${cacheDir}` +
306
315
  (value(argv, "--library") ? "" : ` (current -> ${sha256.slice(0, 12)}…)`));
307
316
  if (referenced.length > 0) {
@@ -1,3 +1,4 @@
1
+ import { reportResult } from '../cli-result.js';
1
2
  import { readFile, stat } from "node:fs/promises";
2
3
  import { resolveLibraryDir } from "./cache.js";
3
4
  import { dirname, join } from "node:path";
@@ -149,6 +150,7 @@ export async function run(argv) {
149
150
  connector: value(argv, "--connector"),
150
151
  limit,
151
152
  });
153
+ reportResult(result);
152
154
  console.log(JSON.stringify(result, null, 2));
153
155
  return 0;
154
156
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.9.4",
3
+ "version": "6.10.0",
4
4
  "description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://docs.uipath.com/maestro",
@@ -55,6 +55,11 @@
55
55
  "bpmn-merge": "./dist/bpmn/merge-cli.js",
56
56
  "flow-registry-materialize": "./dist/registry/materialize-bin.js"
57
57
  },
58
+ "cliCapabilities": [
59
+ "merge-original-option",
60
+ "prepare-action-option",
61
+ "json-result"
62
+ ],
58
63
  "files": [
59
64
  "dist",
60
65
  "lib/library-json.samples",
@@ -87,5 +92,5 @@
87
92
  "@types/node": "^22.7.0",
88
93
  "esbuild": "^0.28.1"
89
94
  },
90
- "gitref": "ca9f8350a07eaf7ec145b315ad37e75e00a23049"
95
+ "gitref": "d50db2eeec64253d691dc9512ee9e7027062665b"
91
96
  }