@uipath/maestro-builder-sdk 5.2.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 (238) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +322 -0
  3. package/dist/bindings-v2.d.ts +37 -0
  4. package/dist/bindings-v2.js +155 -0
  5. package/dist/bindings.d.ts +6 -0
  6. package/dist/bindings.js +6 -0
  7. package/dist/bpmn/bpmn-expr-check.d.ts +41 -0
  8. package/dist/bpmn/bpmn-expr-check.js +218 -0
  9. package/dist/bpmn/bpmn-sdk.d.ts +2257 -0
  10. package/dist/bpmn/bpmn-sdk.js +1476 -0
  11. package/dist/bpmn/check-cli.d.ts +3 -0
  12. package/dist/bpmn/check-cli.js +32 -0
  13. package/dist/bpmn/check.d.ts +25 -0
  14. package/dist/bpmn/check.js +430 -0
  15. package/dist/bpmn/compile-cli.d.ts +3 -0
  16. package/dist/bpmn/compile-cli.js +60 -0
  17. package/dist/bpmn/connector.d.ts +56 -0
  18. package/dist/bpmn/connector.js +199 -0
  19. package/dist/bpmn/decompile-cli.d.ts +8 -0
  20. package/dist/bpmn/decompile-cli.js +54 -0
  21. package/dist/bpmn/decompile.d.ts +6 -0
  22. package/dist/bpmn/decompile.js +1108 -0
  23. package/dist/bpmn/format-profile.d.ts +27 -0
  24. package/dist/bpmn/format-profile.js +11 -0
  25. package/dist/bpmn/intsvc.d.ts +77 -0
  26. package/dist/bpmn/intsvc.js +155 -0
  27. package/dist/bpmn/load.d.ts +4 -0
  28. package/dist/bpmn/load.js +22 -0
  29. package/dist/bpmn/merge-cli.d.ts +3 -0
  30. package/dist/bpmn/merge-cli.js +45 -0
  31. package/dist/bpmn/merge.d.ts +19 -0
  32. package/dist/bpmn/merge.js +293 -0
  33. package/dist/bpmn/registry-types.json +1869 -0
  34. package/dist/bpmn/serialize.d.ts +28 -0
  35. package/dist/bpmn/serialize.js +757 -0
  36. package/dist/bpmn/tidy-cli.d.ts +2 -0
  37. package/dist/bpmn/tidy-cli.js +39 -0
  38. package/dist/bpmn/typed-node.d.ts +382 -0
  39. package/dist/bpmn/typed-node.js +551 -0
  40. package/dist/bpmn/uipath-moddle.v1.json +823 -0
  41. package/dist/bpmn/xml-ranges.d.ts +45 -0
  42. package/dist/bpmn/xml-ranges.js +151 -0
  43. package/dist/case/case-expr-check.d.ts +35 -0
  44. package/dist/case/case-expr-check.js +85 -0
  45. package/dist/case/case-sdk.d.ts +1282 -0
  46. package/dist/case/case-sdk.js +923 -0
  47. package/dist/case/check-cli.d.ts +3 -0
  48. package/dist/case/check-cli.js +31 -0
  49. package/dist/case/check.d.ts +18 -0
  50. package/dist/case/check.js +456 -0
  51. package/dist/case/compile-cli.d.ts +3 -0
  52. package/dist/case/compile-cli.js +291 -0
  53. package/dist/case/decompile-cli.d.ts +9 -0
  54. package/dist/case/decompile-cli.js +117 -0
  55. package/dist/case/decompile.d.ts +187 -0
  56. package/dist/case/decompile.js +1170 -0
  57. package/dist/case/entry-points.d.ts +79 -0
  58. package/dist/case/entry-points.js +118 -0
  59. package/dist/case/format-profile.d.ts +60 -0
  60. package/dist/case/format-profile.js +79 -0
  61. package/dist/case/ids.d.ts +24 -0
  62. package/dist/case/ids.js +76 -0
  63. package/dist/case/load.d.ts +12 -0
  64. package/dist/case/load.js +32 -0
  65. package/dist/case/preserve.d.ts +133 -0
  66. package/dist/case/preserve.js +105 -0
  67. package/dist/case/serialize.d.ts +10 -0
  68. package/dist/case/serialize.js +1414 -0
  69. package/dist/check-cli.d.ts +3 -0
  70. package/dist/check-cli.js +118 -0
  71. package/dist/check.d.ts +146 -0
  72. package/dist/check.js +4898 -0
  73. package/dist/cli/commands/bpmn.d.ts +2 -0
  74. package/dist/cli/commands/bpmn.js +73 -0
  75. package/dist/cli/commands/case.d.ts +2 -0
  76. package/dist/cli/commands/case.js +60 -0
  77. package/dist/cli/commands/flow.d.ts +2 -0
  78. package/dist/cli/commands/flow.js +99 -0
  79. package/dist/cli/commands/registry.d.ts +10 -0
  80. package/dist/cli/commands/registry.js +170 -0
  81. package/dist/cli/common.d.ts +30 -0
  82. package/dist/cli/common.js +92 -0
  83. package/dist/cli/index.d.ts +2 -0
  84. package/dist/cli/index.js +18 -0
  85. package/dist/cli-run.d.ts +2 -0
  86. package/dist/cli-run.js +42 -0
  87. package/dist/compile-cli.d.ts +3 -0
  88. package/dist/compile-cli.js +160 -0
  89. package/dist/config.d.ts +47 -0
  90. package/dist/config.js +201 -0
  91. package/dist/core/actions.d.ts +3244 -0
  92. package/dist/core/actions.js +1062 -0
  93. package/dist/core/binding-messages.d.ts +1 -0
  94. package/dist/core/binding-messages.js +16 -0
  95. package/dist/core/bindings.d.ts +12 -0
  96. package/dist/core/bindings.js +67 -0
  97. package/dist/core/ceql.d.ts +73 -0
  98. package/dist/core/ceql.js +272 -0
  99. package/dist/core/cli-spelling.d.ts +39 -0
  100. package/dist/core/cli-spelling.js +62 -0
  101. package/dist/core/connector-raw-node.d.ts +21 -0
  102. package/dist/core/connector-raw-node.js +47 -0
  103. package/dist/core/connectors.d.ts +184 -0
  104. package/dist/core/connectors.js +128 -0
  105. package/dist/core/expr-check.d.ts +93 -0
  106. package/dist/core/expr-check.js +186 -0
  107. package/dist/core/expr.d.ts +323 -0
  108. package/dist/core/expr.js +400 -0
  109. package/dist/core/index.d.ts +10 -0
  110. package/dist/core/index.js +10 -0
  111. package/dist/core/library.d.ts +440 -0
  112. package/dist/core/library.js +1183 -0
  113. package/dist/core/list-envelope.d.ts +45 -0
  114. package/dist/core/list-envelope.js +97 -0
  115. package/dist/core/lookup-store.d.ts +22 -0
  116. package/dist/core/lookup-store.js +85 -0
  117. package/dist/core/lookups.d.ts +227 -0
  118. package/dist/core/lookups.js +231 -0
  119. package/dist/core/node-classes.d.ts +234 -0
  120. package/dist/core/node-classes.js +158 -0
  121. package/dist/core/script-return.d.ts +68 -0
  122. package/dist/core/script-return.js +197 -0
  123. package/dist/core/stable-id.d.ts +28 -0
  124. package/dist/core/stable-id.js +37 -0
  125. package/dist/core-definitions.json +16249 -0
  126. package/dist/decompile-cli.d.ts +3 -0
  127. package/dist/decompile-cli.js +131 -0
  128. package/dist/decompile.d.ts +138 -0
  129. package/dist/decompile.js +2482 -0
  130. package/dist/emit.d.ts +10 -0
  131. package/dist/emit.js +60 -0
  132. package/dist/event-filters.d.ts +130 -0
  133. package/dist/event-filters.js +137 -0
  134. package/dist/flow-expr-check.d.ts +17 -0
  135. package/dist/flow-expr-check.js +193 -0
  136. package/dist/flow-sdk.d.ts +1341 -0
  137. package/dist/flow-sdk.js +1164 -0
  138. package/dist/flow-variables.d.ts +13 -0
  139. package/dist/flow-variables.js +42 -0
  140. package/dist/format-profile.d.ts +72 -0
  141. package/dist/format-profile.js +97 -0
  142. package/dist/generators/_connections.py +287 -0
  143. package/dist/generators/_events.py +355 -0
  144. package/dist/generators/_lookups.py +114 -0
  145. package/dist/generators/_naming.py +185 -0
  146. package/dist/generators/_objects.py +299 -0
  147. package/dist/generators/_resolve.py +273 -0
  148. package/dist/generators/convert_library_to_md.py +1441 -0
  149. package/dist/generators/extract_library.py +125 -0
  150. package/dist/generators/generate_connectors_ts.py +936 -0
  151. package/dist/generators/generate_library_json.py +2527 -0
  152. package/dist/generators/generate_triggers_ts.py +110 -0
  153. package/dist/generators/materialize_registry.py +155 -0
  154. package/dist/generators/prepare_connector.py +1688 -0
  155. package/dist/index.d.ts +35 -0
  156. package/dist/index.js +35 -0
  157. package/dist/ixp-definition.json +1982 -0
  158. package/dist/library.d.ts +6 -0
  159. package/dist/library.js +6 -0
  160. package/dist/load.d.ts +16 -0
  161. package/dist/load.js +95 -0
  162. package/dist/merge-cli.d.ts +3 -0
  163. package/dist/merge-cli.js +47 -0
  164. package/dist/merge.d.ts +125 -0
  165. package/dist/merge.js +0 -0
  166. package/dist/migrate.d.ts +15 -0
  167. package/dist/migrate.js +245 -0
  168. package/dist/node-runtime.d.ts +3 -0
  169. package/dist/node-runtime.js +22 -0
  170. package/dist/package-name.d.ts +17 -0
  171. package/dist/package-name.js +17 -0
  172. package/dist/ref-resolve.d.ts +77 -0
  173. package/dist/ref-resolve.js +170 -0
  174. package/dist/registry/cache.d.ts +55 -0
  175. package/dist/registry/cache.js +134 -0
  176. package/dist/registry/curated-overlay.d.ts +16 -0
  177. package/dist/registry/curated-overlay.js +62 -0
  178. package/dist/registry/extractor.d.ts +22 -0
  179. package/dist/registry/extractor.js +18 -0
  180. package/dist/registry/materialize-bin.d.ts +2 -0
  181. package/dist/registry/materialize-bin.js +7 -0
  182. package/dist/registry/materialize-cli.d.ts +1 -0
  183. package/dist/registry/materialize-cli.js +46 -0
  184. package/dist/registry/materializer.d.ts +23 -0
  185. package/dist/registry/materializer.js +34 -0
  186. package/dist/registry/path-cli.d.ts +1 -0
  187. package/dist/registry/path-cli.js +56 -0
  188. package/dist/registry/prepare-cli.d.ts +62 -0
  189. package/dist/registry/prepare-cli.js +185 -0
  190. package/dist/registry/pull-cli.d.ts +1 -0
  191. package/dist/registry/pull-cli.js +274 -0
  192. package/dist/registry/python.d.ts +26 -0
  193. package/dist/registry/python.js +46 -0
  194. package/dist/registry/search-cli.d.ts +52 -0
  195. package/dist/registry/search-cli.js +159 -0
  196. package/dist/schema-version.d.ts +165 -0
  197. package/dist/schema-version.js +148 -0
  198. package/dist/serialize.d.ts +64 -0
  199. package/dist/serialize.js +6398 -0
  200. package/lib/README.md +112 -0
  201. package/lib/library-json.samples/index.json +158 -0
  202. package/lib/library-json.samples/invariant-collections.json +83 -0
  203. package/lib/library-json.samples/list-envelopes.json +123 -0
  204. package/lib/library-json.samples/uipath-atlassian-jira/create-issue@1.0.0.json +131 -0
  205. package/lib/library-json.samples/uipath-atlassian-jira/create-issue@1.0.0.v1def.json +306 -0
  206. package/lib/library-json.samples/uipath-atlassian-jira/generic/create_issue/create@1.0.0.json +86 -0
  207. package/lib/library-json.samples/uipath-atlassian-jira/generic/create_issue/create@1.0.0.v1def.json +208 -0
  208. package/lib/library-json.samples/uipath-atlassian-jira/get-issue@1.0.0.json +2040 -0
  209. package/lib/library-json.samples/uipath-atlassian-jira/get-issue@1.0.0.v1def.json +195 -0
  210. package/lib/library-json.samples/uipath-google-vertex/execute-google-vertex-agent@1.0.0.json +169 -0
  211. package/lib/library-json.samples/uipath-google-vertex/execute-google-vertex-agent@1.0.0.v1def.json +209 -0
  212. package/lib/library-json.samples/uipath-http-webhook/event-http-webhook@1.0.0.json +63 -0
  213. package/lib/library-json.samples/uipath-http-webhook/event-http-webhook@1.0.0.v1def.json +262 -0
  214. package/lib/library-json.samples/uipath-http-webhook/trigger-http-webhook@1.0.0.json +63 -0
  215. package/lib/library-json.samples/uipath-http-webhook/trigger-http-webhook@1.0.0.v1def.json +213 -0
  216. package/lib/library-json.samples/uipath-microsoft-azureactivedirectory/list-groups@1.0.0.json +227 -0
  217. package/lib/library-json.samples/uipath-microsoft-azureactivedirectory/list-groups@1.0.0.v1def.json +373 -0
  218. package/lib/library-json.samples/uipath-microsoft-onedrive/event-file-created@1.0.0.json +116 -0
  219. package/lib/library-json.samples/uipath-microsoft-onedrive/event-file-created@1.0.0.v1def.json +369 -0
  220. package/lib/library-json.samples/uipath-microsoft-onedrive/event-list-item-added@1.0.0.json +56 -0
  221. package/lib/library-json.samples/uipath-microsoft-onedrive/event-list-item-added@1.0.0.v1def.json +256 -0
  222. package/lib/library-json.samples/uipath-microsoft-onedrive/trigger-file-created@1.0.0.json +116 -0
  223. package/lib/library-json.samples/uipath-microsoft-onedrive/trigger-file-created@1.0.0.v1def.json +320 -0
  224. package/lib/library-json.samples/uipath-microsoft-onedrive/trigger-list-item-added@1.0.0.json +56 -0
  225. package/lib/library-json.samples/uipath-microsoft-onedrive/trigger-list-item-added@1.0.0.v1def.json +207 -0
  226. package/lib/library-json.samples/uipath-microsoft-outlook365/event-email-received@1.0.0.json +107 -0
  227. package/lib/library-json.samples/uipath-microsoft-outlook365/event-email-received@1.0.0.v1def.json +264 -0
  228. package/lib/library-json.samples/uipath-microsoft-outlook365/send-email@1.0.0.json +142 -0
  229. package/lib/library-json.samples/uipath-microsoft-outlook365/send-email@1.0.0.v1def.json +306 -0
  230. package/lib/library-json.samples/uipath-microsoft-outlook365/trigger-email-received@1.0.0.json +107 -0
  231. package/lib/library-json.samples/uipath-microsoft-outlook365/trigger-email-received@1.0.0.v1def.json +217 -0
  232. package/lib/library-json.samples/uipath-microsoft-powerautomate/invoke-a-microsoft-power-automate-flow@1.0.0.json +85 -0
  233. package/lib/library-json.samples/uipath-microsoft-powerautomate/invoke-a-microsoft-power-automate-flow@1.0.0.v1def.json +209 -0
  234. package/lib/library-json.samples/uipath-salesforce-slack/send-message-to-user@1.0.0.json +755 -0
  235. package/lib/library-json.samples/uipath-salesforce-slack/send-message-to-user@1.0.0.v1def.json +513 -0
  236. package/lib/library-json.samples/uipath-uipath-dataservice/query-entity-records@1.0.0.json +122 -0
  237. package/lib/library-json.samples/uipath-uipath-dataservice/query-entity-records@1.0.0.v1def.json +227 -0
  238. package/package.json +85 -0
@@ -0,0 +1,2 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerBpmnCommands(program: Command): void;
@@ -0,0 +1,73 @@
1
+ import { addValue, inferCheckMode, invoke, loadTool } from '../common.js';
2
+ export function registerBpmnCommands(program) {
3
+ const family = program.command('bpmn').description('Build, inspect, and merge BPMN artifacts.');
4
+ family.command('compile')
5
+ .description('Compile authored TypeScript to a .bpmn artifact.')
6
+ .argument('<source>', 'a .bpmn.ts path or bare name')
7
+ .option('-o, --output <file>', 'output .bpmn path')
8
+ .option('--library <dir>', 'connector library directory')
9
+ .option('--bindings <file>', 'bindings.json path')
10
+ .action(async (source, options) => {
11
+ const argv = [source];
12
+ addValue(argv, '-o', options.output);
13
+ addValue(argv, '--library', options.library);
14
+ addValue(argv, '--bindings', options.bindings);
15
+ await invoke('bpmn compile', () => loadTool(import.meta.url, '../../bpmn/compile-cli.js'), argv);
16
+ });
17
+ family.command('check')
18
+ .description('Check authored TypeScript; use the product CLI for compiled BPMN.')
19
+ .argument('<input>', 'source or .bpmn artifact')
20
+ .option('--source', 'check authored TypeScript')
21
+ .option('--compiled', 'identify a compiled artifact')
22
+ .action(async (input, options) => {
23
+ let mode;
24
+ try {
25
+ mode = inferCheckMode('bpmn', input, options.source === true, options.compiled === true);
26
+ }
27
+ catch (error) {
28
+ console.error(`flow-sdk bpmn check: ${error instanceof Error ? error.message : String(error)}`);
29
+ process.exitCode = 2;
30
+ return;
31
+ }
32
+ if (mode === 'compiled') {
33
+ console.error('flow-sdk bpmn check --compiled: use `uip maestro bpmn validate <file.bpmn>`');
34
+ process.exitCode = 2;
35
+ return;
36
+ }
37
+ await invoke('bpmn check', () => loadTool(import.meta.url, '../../bpmn/check-cli.js'), [input]);
38
+ });
39
+ family.command('tidy')
40
+ .description('Add diagram layout to a compiled .bpmn artifact.')
41
+ .argument('<input>', 'input .bpmn path')
42
+ .option('-o, --output <file>', 'output .bpmn path')
43
+ .action(async (input, options) => {
44
+ const argv = [input];
45
+ addValue(argv, '-o', options.output);
46
+ await invoke('bpmn tidy', () => loadTool(import.meta.url, '../../bpmn/tidy-cli.js'), argv);
47
+ });
48
+ family
49
+ .command('decompile')
50
+ .description('Convert a .bpmn artifact to authored TypeScript.')
51
+ .argument('<input>', 'input .bpmn path')
52
+ .option('-o, --output <file>', 'output .bpmn.ts path')
53
+ .option('--import <specifier>', 'SDK import specifier in generated source')
54
+ .action(async (input, options) => {
55
+ const argv = [input];
56
+ addValue(argv, '-o', options.output);
57
+ addValue(argv, '--import', options.import);
58
+ await invoke('bpmn decompile', () => loadTool(import.meta.url, '../../bpmn/decompile-cli.js'), argv);
59
+ });
60
+ family
61
+ .command('merge')
62
+ .description('Merge an edited process with its original BPMN artifact.')
63
+ .argument('<original>', 'original .bpmn path')
64
+ .argument('<edited>', 'edited .bpmn path')
65
+ .option('-o, --output <file>', 'merged output path')
66
+ .option('--baseline <file>', 'compiled pristine decompile')
67
+ .action(async (original, edited, options) => {
68
+ const argv = [original, edited];
69
+ addValue(argv, '-o', options.output);
70
+ addValue(argv, '--baseline', options.baseline);
71
+ await invoke('bpmn merge', () => loadTool(import.meta.url, '../../bpmn/merge-cli.js'), argv);
72
+ });
73
+ }
@@ -0,0 +1,2 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerCaseCommands(program: Command): void;
@@ -0,0 +1,60 @@
1
+ import { addValue, inferCheckMode, invoke, loadTool } from '../common.js';
2
+ export function registerCaseCommands(program) {
3
+ const family = program.command('case').description('Build and check Case artifacts.');
4
+ family.command('compile')
5
+ .description('Compile authored TypeScript to caseplan.json.')
6
+ .argument('<source>', 'a .case.ts path or bare name')
7
+ .option('-o, --output <file>', 'output caseplan.json path')
8
+ .option('--library <dir>', 'connector library directory')
9
+ .option('--bindings <file>', 'bindings.json path')
10
+ .option('--connectors-local <dir>', 'connection-resolved connector overlay')
11
+ .action(async (source, options) => {
12
+ const argv = [source];
13
+ addValue(argv, '-o', options.output);
14
+ addValue(argv, '--library', options.library);
15
+ addValue(argv, '--bindings', options.bindings);
16
+ addValue(argv, '--connectors-local', options.connectorsLocal);
17
+ await invoke('case compile', () => loadTool(import.meta.url, '../../case/compile-cli.js'), argv);
18
+ });
19
+ family.command('check')
20
+ .description('Check authored TypeScript; use the product CLI for caseplan.json.')
21
+ .argument('<input>', 'source or caseplan.json')
22
+ .option('--source', 'check authored TypeScript')
23
+ .option('--compiled', 'identify a compiled artifact')
24
+ .action(async (input, options) => {
25
+ let mode;
26
+ try {
27
+ mode = inferCheckMode('case', input, options.source === true, options.compiled === true);
28
+ }
29
+ catch (error) {
30
+ console.error(`flow-sdk case check: ${error instanceof Error ? error.message : String(error)}`);
31
+ process.exitCode = 2;
32
+ return;
33
+ }
34
+ if (mode === 'compiled') {
35
+ console.error('flow-sdk case check --compiled: use `uip maestro case validate caseplan.json`');
36
+ process.exitCode = 2;
37
+ return;
38
+ }
39
+ await invoke('case check', () => loadTool(import.meta.url, '../../case/check-cli.js'), [input]);
40
+ });
41
+ family.command('decompile')
42
+ .description('Convert a caseplan.json to authored TypeScript.')
43
+ .argument('<input>', 'input caseplan.json path')
44
+ .option('-o, --output <file>', 'output .case.ts path')
45
+ .option('--import <specifier>', 'SDK import specifier in generated source')
46
+ .option('--library <dir>', 'connector library directory')
47
+ .option('--best-effort', 'emit a marked repair scaffold for unsupported constructs')
48
+ .option('--no-pipeline', 'do not emit a brownfield pipeline helper')
49
+ .action(async (input, options) => {
50
+ const argv = [input];
51
+ addValue(argv, '-o', options.output);
52
+ addValue(argv, '--import', options.import);
53
+ addValue(argv, '--library', options.library);
54
+ if (options.bestEffort === true)
55
+ argv.push('--best-effort');
56
+ if (options.pipeline === false)
57
+ argv.push('--no-pipeline');
58
+ await invoke('case decompile', () => loadTool(import.meta.url, '../../case/decompile-cli.js'), argv);
59
+ });
60
+ }
@@ -0,0 +1,2 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerFlowCommands(program: Command): void;
@@ -0,0 +1,99 @@
1
+ import { addValue, emitOnlyEnabled, inferCheckMode, invoke, loadTool } from '../common.js';
2
+ export function registerFlowCommands(program) {
3
+ const flow = program.command('flow').description('Build and check Flow artifacts.');
4
+ flow.command('compile')
5
+ .description('Compile authored TypeScript to a .flow artifact.')
6
+ .argument('<source>', 'a .flow.ts path or bare name')
7
+ .option('-o, --output <file>', 'output .flow path')
8
+ .option('--library <dir>', 'connector library directory')
9
+ .option('--bindings <file>', 'bindings.json path')
10
+ .option('--connectors-local <dir>', 'connection-resolved connector overlay')
11
+ .option('--no-check', 'skip the source-level check')
12
+ .action(async (source, options) => {
13
+ const argv = [source];
14
+ addValue(argv, '-o', options.output);
15
+ addValue(argv, '--library', options.library);
16
+ addValue(argv, '--bindings', options.bindings);
17
+ addValue(argv, '--connectors-local', options.connectorsLocal);
18
+ if (options.check === false || emitOnlyEnabled())
19
+ argv.push('--no-check');
20
+ await invoke('flow compile', () => loadTool(import.meta.url, '../../compile-cli.js'), argv);
21
+ });
22
+ flow.command('check')
23
+ .description('Check authored TypeScript or a compiled .flow artifact.')
24
+ .argument('<input>', 'source or compiled artifact')
25
+ .option('--source', 'check authored TypeScript')
26
+ .option('--compiled', 'check the emitted artifact')
27
+ .option('--library <dir>', 'connector library directory')
28
+ .option('--json', 'print compiled-check diagnostics as JSON')
29
+ .option('--uip', 'resolve missing schemas with the UiPath CLI')
30
+ .option('--max-errors <count>', 'stop after this many compiled-check errors')
31
+ .option('--script-determinism', 'check script blocks for non-deterministic calls')
32
+ .option('--quiet', 'suppress warnings and information')
33
+ .option('--debug-internal', 'include internal compile context')
34
+ .option('--dump-ir', 'print the generated intermediate representation')
35
+ .action(async (input, options) => {
36
+ if (emitOnlyEnabled()) {
37
+ console.error('flow-sdk flow check: disabled by emit-only mode; use `uip maestro flow validate` or `uip maestro flow debug`');
38
+ process.exitCode = 2;
39
+ return;
40
+ }
41
+ let mode;
42
+ try {
43
+ mode = inferCheckMode('flow', input, options.source === true, options.compiled === true);
44
+ }
45
+ catch (error) {
46
+ console.error(`flow-sdk flow check: ${error instanceof Error ? error.message : String(error)}`);
47
+ process.exitCode = 2;
48
+ return;
49
+ }
50
+ if (mode === 'source') {
51
+ const argv = [input];
52
+ addValue(argv, '--library', options.library);
53
+ await invoke('flow check', () => loadTool(import.meta.url, '../../check-cli.js'), argv);
54
+ return;
55
+ }
56
+ // The COMPILED-artifact analyser is gone: it was a standalone tool bundled into this
57
+ // package by a `prepack` step, and it was retired because the product answers this
58
+ // question itself now, and better — it answers it about what it will actually run.
59
+ //
60
+ // Nothing regressed by removing it. In emit-only mode — which is what every task workspace
61
+ // and every current authoring flow uses — this path already refused, with the same two
62
+ // suggestions repeated here. What is checked at author time is `check.ts`, reached above by
63
+ // the `source` arm, and that is untouched.
64
+ console.error('flow-sdk flow check: checking a COMPILED .flow is no longer supported here. ' +
65
+ 'Use `uip maestro flow validate <file.flow>` for the product static check, or ' +
66
+ '`uip maestro flow debug` / `flow-debug <file.flow>` to run it. ' +
67
+ 'Authoring-time checks still work on a .flow.ts source (--source).');
68
+ process.exitCode = 2;
69
+ });
70
+ flow.command('decompile')
71
+ .description('Convert a .flow artifact to authored TypeScript.')
72
+ .argument('<input>', 'input .flow path')
73
+ .option('-o, --output <file>', 'output .flow.ts path')
74
+ .option('--import <specifier>', 'SDK import specifier in generated source')
75
+ .option('--strict', 'fail on unsupported constructs')
76
+ .option('--no-pipeline', 'do not emit a brownfield pipeline helper')
77
+ .action(async (input, options) => {
78
+ const argv = [input];
79
+ addValue(argv, '-o', options.output);
80
+ addValue(argv, '--import', options.import);
81
+ if (options.strict)
82
+ argv.push('--strict');
83
+ if (options.pipeline === false)
84
+ argv.push('--no-pipeline');
85
+ await invoke('flow decompile', () => loadTool(import.meta.url, '../../decompile-cli.js'), argv);
86
+ });
87
+ flow.command('merge')
88
+ .description('Merge an edited flow with its original artifact.')
89
+ .argument('<original>', 'original .flow path')
90
+ .argument('<edited>', 'edited .flow path')
91
+ .option('-o, --output <file>', 'merged output path')
92
+ .option('--baseline <file>', 'compiled pristine decompile')
93
+ .action(async (original, edited, options) => {
94
+ const argv = [original, edited];
95
+ addValue(argv, '-o', options.output);
96
+ addValue(argv, '--baseline', options.baseline);
97
+ await invoke('flow merge', () => loadTool(import.meta.url, '../../merge-cli.js'), argv);
98
+ });
99
+ }
@@ -0,0 +1,10 @@
1
+ import type { Command } from 'commander';
2
+ /**
3
+ * The `registry` family: work with an extracted connector library.
4
+ *
5
+ * Registered beside flow/case/bpmn so these verbs are reachable the same way
6
+ * every other verb is — `flow-sdk registry <verb>` — rather than only through
7
+ * their own bins. Unlike the other families these take no positional artifact
8
+ * apart from the search query, so the actions are mostly `addValue` calls.
9
+ */
10
+ export declare function registerRegistryCommands(program: Command): void;
@@ -0,0 +1,170 @@
1
+ import { addValue, invoke, loadTool } from '../common.js';
2
+ /** Commander hands a repeatable option one value at a time. */
3
+ function collect(value, previous) {
4
+ return [...previous, value];
5
+ }
6
+ /**
7
+ * The `registry` family: work with an extracted connector library.
8
+ *
9
+ * Registered beside flow/case/bpmn so these verbs are reachable the same way
10
+ * every other verb is — `flow-sdk registry <verb>` — rather than only through
11
+ * their own bins. Unlike the other families these take no positional artifact
12
+ * apart from the search query, so the actions are mostly `addValue` calls.
13
+ */
14
+ export function registerRegistryCommands(program) {
15
+ const family = program
16
+ .command('registry')
17
+ .description('Acquire, locate, materialize, search and prepare the connector library.');
18
+ family.command('pull')
19
+ .description('Download the published connector library and generate its Markdown and TypeScript views.')
20
+ .option('--library <dir>', 'where library-json lands (default: ./library)')
21
+ .option('--library-md <dir>', 'markdown output (default: ./library-md)')
22
+ .option('--connectors <dir>', 'TypeScript descriptor output (default: ./connectors)')
23
+ .option('--connector <key>', 'only generate this connector (repeatable; default: whatever the project references)', collect, [])
24
+ .option('--url <url>', 'archive URL to pull from')
25
+ .option('--archive <zip>', 'use a zip already on disk instead of downloading')
26
+ .option('--cache <dir>', 'where downloaded archives are kept')
27
+ .option('--force', 're-download and regenerate even if the archive is cached')
28
+ .option('--import <specifier>', 'module specifier for generated descriptors')
29
+ .option('--triggers <path>', 'registry-triggers.json for trigger descriptors')
30
+ .option('--python <executable>', 'Python interpreter to run the generators with')
31
+ .option('--root <prefix>', 'only extract archive entries under this prefix')
32
+ .option('--extractor <path>', 'extract_library.py to run instead of the packaged copy')
33
+ .option('--generator <path>', 'materialize_registry.py to run instead of the packaged copy')
34
+ .action(async (options) => {
35
+ const argv = [];
36
+ addValue(argv, '--library', options.library);
37
+ addValue(argv, '--library-md', options.libraryMd);
38
+ addValue(argv, '--connectors', options.connectors);
39
+ for (const key of options.connector ?? [])
40
+ argv.push('--connector', key);
41
+ addValue(argv, '--url', options.url);
42
+ addValue(argv, '--archive', options.archive);
43
+ addValue(argv, '--cache', options.cache);
44
+ if (options.force)
45
+ argv.push('--force');
46
+ addValue(argv, '--import', options.import);
47
+ addValue(argv, '--triggers', options.triggers);
48
+ addValue(argv, '--python', options.python);
49
+ addValue(argv, '--root', options.root);
50
+ addValue(argv, '--extractor', options.extractor);
51
+ addValue(argv, '--generator', options.generator);
52
+ await invoke('registry pull', () => loadTool(import.meta.url, '../../registry/pull-cli.js'), argv);
53
+ });
54
+ family.command('materialize')
55
+ .description('Generate library-md and connectors/ from an extracted library-json.')
56
+ .requiredOption('--library-json <dir>', 'extracted library-json directory')
57
+ .requiredOption('--library-md <dir>', 'markdown output directory')
58
+ .requiredOption('--connectors <dir>', 'TypeScript descriptor output directory')
59
+ .option('--import <specifier>', 'module specifier for generated descriptors')
60
+ .option('--triggers <path>', 'registry-triggers.json for trigger descriptors')
61
+ .option('--python <executable>', 'Python interpreter to run the generators with')
62
+ .option('--generator <path>', 'materialize_registry.py to run instead of the packaged copy')
63
+ .action(async (options) => {
64
+ const argv = [];
65
+ addValue(argv, '--library-json', options.libraryJson);
66
+ addValue(argv, '--library-md', options.libraryMd);
67
+ addValue(argv, '--connectors', options.connectors);
68
+ addValue(argv, '--import', options.import);
69
+ addValue(argv, '--triggers', options.triggers);
70
+ addValue(argv, '--python', options.python);
71
+ addValue(argv, '--generator', options.generator);
72
+ await invoke('registry materialize', () => loadTool(import.meta.url, '../../registry/materialize-cli.js'), argv);
73
+ });
74
+ family.command('prepare')
75
+ .description("Resolve one operation's schema against a live connection into ./connectors-local.")
76
+ .argument('<connector-key>', 'connector key, e.g. uipath-salesforce')
77
+ .argument('<action>', 'operation to resolve, e.g. InsertRecord')
78
+ // Optional: without one the command discovers the connection itself from
79
+ // `uip is connections list` and writes both keys into bindings.json.
80
+ .option('--connection-id <id>', 'connection to read the schema through')
81
+ .option('--connection <name>', 'pick the connection by name when several match')
82
+ .option('--bindings <file>', 'bindings file to update (default: ./bindings.json)')
83
+ .option('--bind-connection <name>', 'symbolic connection name (default: the connector suffix)')
84
+ .option('--bind-folder <name>', 'symbolic folder name (default: shared)')
85
+ .option('--no-bindings', 'discover the connection but leave bindings.json alone')
86
+ .option('--object <name>', 'one connection-discovered object')
87
+ .option('--all-objects', 'every connection-discovered object')
88
+ .option('-f, --field <name=value>', 'parent field that selects the schema (repeatable)', collect, [])
89
+ .option('--out <dir>', 'overlay directory (default: ./connectors-local)')
90
+ // Not `--version`: the program's own version option shadows a subcommand's,
91
+ // so `prepare --version 2.0` printed the package version instead of parsing.
92
+ .option('--connector-version <version>', 'connector version to resolve against')
93
+ .option('--import <specifier>', 'module specifier for generated descriptors')
94
+ .option('--json-only', 'write the JSON overlay without generating TypeScript')
95
+ .option('--python <executable>', 'Python interpreter to run the generator with')
96
+ .option('--generator <path>', 'prepare_connector.py to run instead of the packaged copy')
97
+ // Commander declares the surface; the inner CLI only ever sees what is
98
+ // forwarded below. Adding `--resolve` to prepare-cli.ts without adding it
99
+ // HERE made the flag unreachable through the shipped command, while the
100
+ // usage string printed by that same command advertised it — a worse failure
101
+ // than omitting it, because the reader has documentation telling them to
102
+ // pass an option the parser rejects.
103
+ .option('--resolve <field:by=value>', 'resolve a lookup field to the id the connector wants (repeatable)', collect, [])
104
+ .option('--refresh-lookups', 're-resolve lookups already recorded in resolutions.json')
105
+ .option('--source <flow.ts>', 'the flow whose import to repoint at the prepared descriptor')
106
+ .option('--no-source-rewrite', 'print the import line instead of editing the source')
107
+ .action(async (connectorKey, action, options) => {
108
+ const argv = [connectorKey, action];
109
+ addValue(argv, '--connection-id', options.connectionId);
110
+ addValue(argv, '--connection', options.connection);
111
+ addValue(argv, '--bindings', options.bindings);
112
+ addValue(argv, '--bind-connection', options.bindConnection);
113
+ addValue(argv, '--bind-folder', options.bindFolder);
114
+ // commander sets `bindings` false for `--no-bindings`.
115
+ if (options.bindings === false)
116
+ argv.push('--no-bindings');
117
+ addValue(argv, '--object', options.object);
118
+ if (options.allObjects)
119
+ argv.push('--all-objects');
120
+ for (const field of options.field ?? [])
121
+ argv.push('-f', field);
122
+ addValue(argv, '--out', options.out);
123
+ addValue(argv, '--version', options.connectorVersion);
124
+ addValue(argv, '--import', options.import);
125
+ for (const one of options.resolve ?? [])
126
+ argv.push('--resolve', one);
127
+ if (options.refreshLookups)
128
+ argv.push('--refresh-lookups');
129
+ if (options.jsonOnly)
130
+ argv.push('--json-only');
131
+ addValue(argv, '--source', options.source);
132
+ // commander sets `sourceRewrite` false for `--no-source-rewrite`.
133
+ if (options.sourceRewrite === false)
134
+ argv.push('--no-source-rewrite');
135
+ addValue(argv, '--python', options.python);
136
+ addValue(argv, '--generator', options.generator);
137
+ await invoke('registry prepare', () => loadTool(import.meta.url, '../../registry/prepare-cli.js'), argv);
138
+ });
139
+ family.command('path')
140
+ .description('Print where the cached connector library is.')
141
+ .option('--library-json', 'print only the library-json directory')
142
+ .option('--library-md', 'print only the library-md directory')
143
+ .option('--root', 'print only the cache root')
144
+ .option('--sha', 'print only the checksum current points at')
145
+ .action(async (options) => {
146
+ const argv = [];
147
+ for (const flag of ['library-json', 'library-md', 'root', 'sha']) {
148
+ // commander camel-cases: --library-json -> libraryJson
149
+ const key = flag.replace(/-(.)/g, (_, c) => c.toUpperCase());
150
+ if (options[key])
151
+ argv.push(`--${flag}`);
152
+ }
153
+ await invoke('registry path', () => loadTool(import.meta.url, '../../registry/path-cli.js'), argv);
154
+ });
155
+ family.command('search')
156
+ .description('Find connector operations in an extracted library.')
157
+ .argument('[query...]', 'words that must all match somewhere on an entry')
158
+ .option('--library <dir>', 'extracted library-json directory (default: the cached one)')
159
+ .option('--library-md <dir>', 'markdown tree (defaults to a library-md sibling)')
160
+ .option('--connector <key>', 'restrict to one connector key')
161
+ .option('--limit <n>', 'maximum results to print')
162
+ .action(async (query, options) => {
163
+ const argv = [...query];
164
+ addValue(argv, '--library', options.library);
165
+ addValue(argv, '--library-md', options.libraryMd);
166
+ addValue(argv, '--connector', options.connector);
167
+ addValue(argv, '--limit', options.limit);
168
+ await invoke('registry search', () => loadTool(import.meta.url, '../../registry/search-cli.js'), argv);
169
+ });
170
+ }
@@ -0,0 +1,30 @@
1
+ export type ToolRun = (argv: string[]) => Promise<number> | number;
2
+ export declare function loadTool(baseUrl: string, relativePath: string): Promise<{
3
+ run: ToolRun;
4
+ }>;
5
+ export declare function invoke(label: string, load: () => Promise<{
6
+ run: ToolRun;
7
+ }>, argv: string[]): Promise<void>;
8
+ export declare function addValue(argv: string[], flag: string, value: unknown): void;
9
+ /**
10
+ * Is emit-only mode on for the PROJECT containing `cwd`?
11
+ *
12
+ * Emit-only is a property of the project, not of the directory you happen to be
13
+ * standing in, so this walks up for the nearest `package.json` that actually
14
+ * declares `flowSdk.emitOnly` — the way Node tooling resolves project config.
15
+ *
16
+ * Anchoring it to `process.cwd()` alone was #392. Compiling the same project from
17
+ * a subdirectory found no `package.json`, silently re-armed the checker, and —
18
+ * because check GATES EMISSION — turned a working build into
19
+ * `compile: 1 error(s); not emitting.` The same anchoring let `flow check` slip
20
+ * past its own emit-only refusal simply by being run one directory down.
21
+ *
22
+ * Nearest DECLARATION wins, not nearest package.json: a nested `package.json`
23
+ * that says nothing about `flowSdk` must not lift an ancestor's emit-only, since
24
+ * scaffolders (`uip solution init`) drop exactly such a file into a subdirectory
25
+ * of an emit-only project. A nested package that explicitly sets
26
+ * `emitOnly: false` still opts out — silence and denial are different answers.
27
+ */
28
+ export declare function emitOnlyEnabled(cwd?: string, env?: NodeJS.ProcessEnv): boolean;
29
+ export type CheckMode = 'source' | 'compiled';
30
+ export declare function inferCheckMode(family: 'flow' | 'case' | 'bpmn', input: string, source: boolean, compiled: boolean): CheckMode;
@@ -0,0 +1,92 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { dirname, join, resolve } from 'node:path';
3
+ export function loadTool(baseUrl, relativePath) {
4
+ return import(new URL(relativePath, baseUrl).href);
5
+ }
6
+ export async function invoke(label, load, argv) {
7
+ try {
8
+ const code = await (await load()).run(argv);
9
+ if (code !== 0)
10
+ process.exitCode = code;
11
+ }
12
+ catch (error) {
13
+ const message = error instanceof Error ? error.message : String(error);
14
+ console.error(`flow-sdk ${label}: ${message}`);
15
+ process.exitCode = 1;
16
+ }
17
+ }
18
+ export function addValue(argv, flag, value) {
19
+ if (typeof value === 'string')
20
+ argv.push(flag, value);
21
+ }
22
+ /**
23
+ * `flowSdk.emitOnly` as declared by ONE package.json, or `undefined` when that
24
+ * file says nothing about it — absent, unreadable, malformed, or non-boolean.
25
+ * "Says nothing" is deliberately distinct from "says false": only the former
26
+ * lets the search continue to the parent directory.
27
+ */
28
+ function declaredEmitOnly(packagePath) {
29
+ if (!existsSync(packagePath))
30
+ return undefined;
31
+ try {
32
+ const pkg = JSON.parse(readFileSync(packagePath, 'utf8'));
33
+ const declared = pkg.flowSdk?.emitOnly;
34
+ return typeof declared === 'boolean' ? declared : undefined;
35
+ }
36
+ catch {
37
+ return undefined;
38
+ }
39
+ }
40
+ /**
41
+ * Is emit-only mode on for the PROJECT containing `cwd`?
42
+ *
43
+ * Emit-only is a property of the project, not of the directory you happen to be
44
+ * standing in, so this walks up for the nearest `package.json` that actually
45
+ * declares `flowSdk.emitOnly` — the way Node tooling resolves project config.
46
+ *
47
+ * Anchoring it to `process.cwd()` alone was #392. Compiling the same project from
48
+ * a subdirectory found no `package.json`, silently re-armed the checker, and —
49
+ * because check GATES EMISSION — turned a working build into
50
+ * `compile: 1 error(s); not emitting.` The same anchoring let `flow check` slip
51
+ * past its own emit-only refusal simply by being run one directory down.
52
+ *
53
+ * Nearest DECLARATION wins, not nearest package.json: a nested `package.json`
54
+ * that says nothing about `flowSdk` must not lift an ancestor's emit-only, since
55
+ * scaffolders (`uip solution init`) drop exactly such a file into a subdirectory
56
+ * of an emit-only project. A nested package that explicitly sets
57
+ * `emitOnly: false` still opts out — silence and denial are different answers.
58
+ */
59
+ export function emitOnlyEnabled(cwd = process.cwd(), env = process.env) {
60
+ if (env.FLOW_SDK_EMIT_ONLY === '1')
61
+ return true;
62
+ for (let dir = resolve(cwd);;) {
63
+ const declared = declaredEmitOnly(join(dir, 'package.json'));
64
+ if (declared !== undefined)
65
+ return declared;
66
+ const parent = dirname(dir);
67
+ if (parent === dir)
68
+ return false; // filesystem root, nothing declared it
69
+ dir = parent;
70
+ }
71
+ }
72
+ export function inferCheckMode(family, input, source, compiled) {
73
+ if (source && compiled)
74
+ throw new Error('choose exactly one of --source or --compiled');
75
+ const lower = input.toLowerCase();
76
+ const inferred = lower.endsWith('.ts')
77
+ ? 'source'
78
+ : family === 'flow' && lower.endsWith('.flow')
79
+ ? 'compiled'
80
+ : family === 'case' && lower.endsWith('caseplan.json')
81
+ ? 'compiled'
82
+ : family === 'bpmn' && lower.endsWith('.bpmn')
83
+ ? 'compiled'
84
+ : 'source';
85
+ if (source && inferred === 'compiled') {
86
+ throw new Error(`--source does not accept compiled artifact '${input}'`);
87
+ }
88
+ if (compiled && inferred === 'source' && lower.endsWith('.ts')) {
89
+ throw new Error(`--compiled does not accept TypeScript source '${input}'`);
90
+ }
91
+ return source ? 'source' : compiled ? 'compiled' : inferred;
92
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import { readFileSync } from 'node:fs';
3
+ import { Command } from 'commander';
4
+ import { registerBpmnCommands } from './commands/bpmn.js';
5
+ import { registerCaseCommands } from './commands/case.js';
6
+ import { registerFlowCommands } from './commands/flow.js';
7
+ import { registerRegistryCommands } from './commands/registry.js';
8
+ const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8'));
9
+ const program = new Command();
10
+ program
11
+ .name('flow-sdk')
12
+ .description('Build and check UiPath Flow, Case, and BPMN artifacts, and manage the connector library.')
13
+ .version(pkg.version);
14
+ registerFlowCommands(program);
15
+ registerCaseCommands(program);
16
+ registerBpmnCommands(program);
17
+ registerRegistryCommands(program);
18
+ await program.parseAsync(process.argv);
@@ -0,0 +1,2 @@
1
+ export type CliExitCode = 0 | 1 | 2;
2
+ export declare function runWhenInvokedDirectly(moduleUrl: string, label: string, run: (argv: string[]) => Promise<CliExitCode> | CliExitCode): void;
@@ -0,0 +1,42 @@
1
+ import { realpathSync } from 'node:fs';
2
+ import { resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ /**
5
+ * Resolve a path to its real location, following symlinks. Falls back to the
6
+ * lexical form when the path cannot be stat'd, so a missing file still compares
7
+ * (and still fails) rather than throwing out of the guard.
8
+ */
9
+ function realOrAbsolute(path) {
10
+ try {
11
+ return realpathSync(path);
12
+ }
13
+ catch {
14
+ return resolve(path);
15
+ }
16
+ }
17
+ export function runWhenInvokedDirectly(moduleUrl, label, run) {
18
+ const entry = process.argv[1];
19
+ if (!entry)
20
+ return;
21
+ // Compare REAL paths, not lexical ones. `npm install` links every `bin` into
22
+ // `node_modules/.bin/<name>` as a symlink, so invoking the package's own CLI
23
+ // the documented way — `npx bpmn-decompile`, or the bare name on PATH — sets
24
+ // `process.argv[1]` to the LINK while `import.meta.url` is the link's TARGET
25
+ // inside `dist/`. A lexical comparison never matches, and because this guard
26
+ // returns quietly the process then exits 0 having done nothing at all: no
27
+ // output, no file written, no error. That silence made 10 of the package's 12
28
+ // bins inert, and hid it — the ladder scripts and tests all invoke
29
+ // `node dist/**/*-cli.js` directly, the one form that does match.
30
+ if (realOrAbsolute(fileURLToPath(moduleUrl)) !== realOrAbsolute(entry))
31
+ return;
32
+ Promise.resolve()
33
+ .then(() => run(process.argv.slice(2)))
34
+ .then((code) => {
35
+ process.exitCode = code;
36
+ })
37
+ .catch((error) => {
38
+ const message = error instanceof Error ? error.message : String(error);
39
+ console.error(`${label}: ${message}`);
40
+ process.exitCode = 1;
41
+ });
42
+ }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { type CliExitCode } from './cli-run.js';
3
+ export declare function run(argv: string[]): Promise<CliExitCode>;