@uipath/rules-tool 1.204.0-preview.249 → 1.204.0-preview.250

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 (154) hide show
  1. package/dist/DmnFactory-VWZOSZHH-jkpbxz3n.js +42 -0
  2. package/dist/DmnModelTypes-ATR7FVKZ-jp35cecy.js +18 -0
  3. package/dist/KieDmnMarshaller-6TTUU5B4-47q50gk4.js +20 -0
  4. package/dist/THIRD-PARTY-NOTICES.md +1054 -0
  5. package/dist/business-rules-bnr581tz.js +26 -0
  6. package/dist/{constants-za5vbzp8.js → constants-9pa118cj.js} +17 -10
  7. package/dist/{embedded-file-reader-wmsg31a8.js → embedded-file-reader-rf2g1kfj.js} +4 -1
  8. package/dist/first-party-service-sd8yaf73.js +27 -0
  9. package/dist/hitPolicyResult-4WDHTX4A-gk103w84.js +33 -0
  10. package/dist/index-2hzp9b97.js +116 -0
  11. package/dist/index-34pj9f36.js +48 -0
  12. package/dist/{index-zdwhfpt1.js → index-4c4exdzw.js} +370 -406
  13. package/dist/index-dqa169gp.js +25 -0
  14. package/dist/{index-we6zjs66.js → index-fs1nd5ap.js} +40 -4
  15. package/dist/{index-nzr4mx5p.js → index-sby22td6.js} +22 -2
  16. package/dist/{index-7wc0g78k.js → index-t4mx1a5e.js} +5 -2
  17. package/dist/index.js +9 -8
  18. package/dist/{jmespath-ab6tdc42.js → jmespath-231m3hyn.js} +1 -1
  19. package/dist/{js-yaml-a2bk27p6.js → js-yaml-88tdqrtd.js} +3 -1
  20. package/dist/rule-catalog-5gzpe93c.js +46 -0
  21. package/dist/rules-command-error-20gp2dv9.js +14 -0
  22. package/dist/{rules-debug-service-h1ahd6p3.js → rules-debug-service-cmgmbhyh.js} +36 -35
  23. package/dist/{rules-init-service-y678kjje.js → rules-init-service-b74thek5.js} +16 -12
  24. package/dist/{rules-refresh-service-btn64j8j.js → rules-refresh-service-jgk2kq9d.js} +14 -13
  25. package/dist/{rules-validate-service-sppr4x13.js → rules-validate-service-mr2fk58k.js} +13 -10
  26. package/dist/{tool-97x3zjcm.js → tool-19b4ect0.js} +158 -113
  27. package/dist/{tool-epsr41wx.js → tool-1de529jm.js} +3 -12
  28. package/dist/{tool-7xmarr97.js → tool-2cky8jwp.js} +2578 -1777
  29. package/dist/{tool-0bthsb3x.js → tool-4dfpdepw.js} +15 -15
  30. package/dist/tool-53w8skv5.js +262 -0
  31. package/dist/tool-7haj67tr.js +19 -0
  32. package/dist/{tool-e1mmqsjr.js → tool-8h4er38s.js} +411 -396
  33. package/dist/{tool-2trg1fpx.js → tool-8qy8pkp4.js} +8 -8
  34. package/dist/tool-av4mmsef.js +73 -0
  35. package/dist/{tool-8j9f6ns5.js → tool-eymjx05p.js} +11 -11
  36. package/dist/{tool-mm1x18d6.js → tool-gdtpsdn7.js} +28 -223
  37. package/dist/{tool-6sqt4zrx.js → tool-jxvk6306.js} +32 -29
  38. package/dist/tool-m41px07w.js +49 -0
  39. package/dist/{tool-k2s349kn.js → tool-mkn83w88.js} +17 -14
  40. package/dist/tool-pm3ewdxc.js +1115 -0
  41. package/dist/{tool-6rp0gx98.js → tool-tkcx6png.js} +107 -127
  42. package/dist/{tool-1dycs173.js → tool-wmh645tm.js} +202 -194
  43. package/dist/{tool-24mr6g8c.js → tool-x0z7hxqr.js} +9 -649
  44. package/dist/tool.js +8 -7
  45. package/package.json +2 -15
  46. package/dist/DmnFactory-SG3RP3T3-cr8e7mxz.js +0 -8
  47. package/dist/DmnFactory-VWZOSZHH-azx0zqcn.js +0 -8
  48. package/dist/DmnModelTypes-ATR7FVKZ-vkv7n0jn.js +0 -8
  49. package/dist/KieDmnMarshaller-6TTUU5B4-rsxhvw7a.js +0 -8
  50. package/dist/business-rules-d51977r1.js +0 -25
  51. package/dist/business-rules-dekge24t.js +0 -23
  52. package/dist/business-rules-ew76mbwg.js +0 -25
  53. package/dist/business-rules-jmwx05k2.js +0 -25
  54. package/dist/business-rules-zpzqxyce.js +0 -26
  55. package/dist/constants-4r8pfr16.js +0 -22
  56. package/dist/embedded-file-reader-0228j82a.js +0 -111
  57. package/dist/first-party-service-1qa6cp4d.js +0 -8
  58. package/dist/first-party-service-28dkctkz.js +0 -8
  59. package/dist/first-party-service-4fsz3cnj.js +0 -8
  60. package/dist/first-party-service-ahcc6xc6.js +0 -8
  61. package/dist/first-party-service-y1ccmsvp.js +0 -8
  62. package/dist/first-party-service-zpr1q3nd.js +0 -8
  63. package/dist/hitPolicyResult-4WDHTX4A-dbtkgpqp.js +0 -12
  64. package/dist/index-2zxy6zgp.js +0 -23
  65. package/dist/index-3nx77wfh.js +0 -23
  66. package/dist/index-43zg1wqe.js +0 -19621
  67. package/dist/index-47jera73.js +0 -23
  68. package/dist/index-70jn7cz1.js +0 -19631
  69. package/dist/index-8kb5kc5y.js +0 -24
  70. package/dist/index-97yad7ms.js +0 -8
  71. package/dist/index-dfn83hxf.js +0 -14
  72. package/dist/index-e301h23h.js +0 -24
  73. package/dist/index-frd259yv.js +0 -24
  74. package/dist/index-gc7cw2jh.js +0 -23
  75. package/dist/index-gya2v502.js +0 -8
  76. package/dist/index-hb3gk1wf.js +0 -24
  77. package/dist/index-nsnfdqd5.js +0 -24
  78. package/dist/index-vffktc0w.js +0 -166
  79. package/dist/index-xymrydfw.js +0 -3095
  80. package/dist/index-z2qk2qn6.js +0 -24
  81. package/dist/index-zecwgvg7.js +0 -23
  82. package/dist/rule-catalog-a5w86qns.js +0 -43
  83. package/dist/rule-catalog-etpf962f.js +0 -69
  84. package/dist/rule-catalog-q5cr17hf.js +0 -58
  85. package/dist/rule-catalog-vc98yg4n.js +0 -43
  86. package/dist/rule-catalog-z3h66kh5.js +0 -56
  87. package/dist/rules-command-error-10qmb5w7.js +0 -13
  88. package/dist/rules-command-error-5bdv4bcx.js +0 -13
  89. package/dist/rules-command-error-cmssf0w4.js +0 -13
  90. package/dist/rules-command-error-fsm3b1mv.js +0 -13
  91. package/dist/rules-debug-service-5rcdh3pj.js +0 -192
  92. package/dist/rules-debug-service-8q7mkd0r.js +0 -199
  93. package/dist/rules-debug-service-b9j29ejz.js +0 -192
  94. package/dist/rules-debug-service-v3jr3r1n.js +0 -192
  95. package/dist/rules-init-service-3c2yfa7p.js +0 -687
  96. package/dist/rules-init-service-3wgd9cqp.js +0 -100
  97. package/dist/rules-init-service-8fqytxq0.js +0 -685
  98. package/dist/rules-init-service-pspt7sje.js +0 -100
  99. package/dist/rules-init-service-sbtzw93j.js +0 -102
  100. package/dist/rules-init-service-x7paqa63.js +0 -687
  101. package/dist/rules-init-service-y7qzmxx0.js +0 -102
  102. package/dist/rules-refresh-service-4xxj6ex6.js +0 -65
  103. package/dist/rules-refresh-service-ba5jk1y9.js +0 -65
  104. package/dist/rules-refresh-service-qkmphj53.js +0 -65
  105. package/dist/rules-validate-service-dmgnfne7.js +0 -60
  106. package/dist/rules-validate-service-hk2d006t.js +0 -60
  107. package/dist/rules-validate-service-xp05n2d9.js +0 -60
  108. package/dist/tool-1pkqxwwd.js +0 -17472
  109. package/dist/tool-39fmkx2d.js +0 -611
  110. package/dist/tool-3e2q1x2y.js +0 -6578
  111. package/dist/tool-3j0747gg.js +0 -17077
  112. package/dist/tool-4z7zcq4z.js +0 -6058
  113. package/dist/tool-56smnjrh.js +0 -73
  114. package/dist/tool-5qygptrc.js +0 -6171
  115. package/dist/tool-5xx6x8pe.js +0 -6596
  116. package/dist/tool-7fkrd618.js +0 -1556
  117. package/dist/tool-89xzeteg.js +0 -361
  118. package/dist/tool-911s9czz.js +0 -570
  119. package/dist/tool-9bz2x04j.js +0 -40
  120. package/dist/tool-akh7nnqs.js +0 -704
  121. package/dist/tool-axfzew45.js +0 -1555
  122. package/dist/tool-b71jq9pt.js +0 -389
  123. package/dist/tool-bfj846v8.js +0 -141
  124. package/dist/tool-bvmc017m.js +0 -96
  125. package/dist/tool-bykz5ryf.js +0 -454
  126. package/dist/tool-c76qb8ap.js +0 -17052
  127. package/dist/tool-ca15515v.js +0 -570
  128. package/dist/tool-f9qs255w.js +0 -70
  129. package/dist/tool-ga79rety.js +0 -389
  130. package/dist/tool-gb547mcn.js +0 -141
  131. package/dist/tool-gta9rr4h.js +0 -68
  132. package/dist/tool-h2dfnxdq.js +0 -6486
  133. package/dist/tool-hg6vr5y9.js +0 -3769
  134. package/dist/tool-hgvnm4vh.js +0 -1843
  135. package/dist/tool-hjbf9aay.js +0 -571
  136. package/dist/tool-k5jm64n3.js +0 -5650
  137. package/dist/tool-ketztpgf.js +0 -73
  138. package/dist/tool-n1d88ryb.js +0 -6396
  139. package/dist/tool-nmqpwh9m.js +0 -6166
  140. package/dist/tool-pb80pswx.js +0 -73
  141. package/dist/tool-pcsgwpfw.js +0 -40
  142. package/dist/tool-q3c1bjyb.js +0 -454
  143. package/dist/tool-rwp1skmf.js +0 -40
  144. package/dist/tool-s3fbt22r.js +0 -454
  145. package/dist/tool-tmbst1r8.js +0 -68
  146. package/dist/tool-v6w109p0.js +0 -455
  147. package/dist/tool-w2js05qv.js +0 -389
  148. package/dist/tool-x67kek1m.js +0 -1838
  149. package/dist/tool-x89947ah.js +0 -17052
  150. package/dist/tool-xhksjdka.js +0 -4005
  151. package/dist/tool-yv3t4gg5.js +0 -108
  152. package/dist/tool-zbyb1ttx.js +0 -5650
  153. /package/dist/{tool-fbqnqf9k.js → tool-jd313s2x.js} +0 -0
  154. /package/dist/{tool-vyx8fpft.js → tool-qgqscsjc.js} +0 -0
@@ -1,570 +0,0 @@
1
- import {
2
- catchError,
3
- RESULTS,
4
- Pagination,
5
- OutputFormatter,
6
- Option,
7
- processContext,
8
- DEFAULT_PAGE_SIZE,
9
- createHiddenDeprecatedTenantOption,
10
- parseLimit,
11
- parseOffset,
12
- parseBoundedInt
13
- } from "./tool-3e2q1x2y.js";
14
- // package.json
15
- var package_default = {
16
- name: "@uipath/rules-tool",
17
- author: "UiPath",
18
- license: "SEE LICENSE IN LICENSE.txt",
19
- version: "1.205.0",
20
- description: "Create and manage UiPath Business Rules (DMN) projects.",
21
- private: false,
22
- repository: {
23
- type: "git",
24
- url: "https://github.com/UiPath/cli.git",
25
- directory: "packages/rules-tool"
26
- },
27
- publishConfig: {
28
- registry: "https://npm.pkg.github.com/@uipath"
29
- },
30
- keywords: [
31
- "cli-tool"
32
- ],
33
- type: "module",
34
- main: "./dist/tool.js",
35
- exports: {
36
- ".": "./dist/tool.js"
37
- },
38
- bin: {
39
- "rules-tool": "./dist/index.js"
40
- },
41
- files: [
42
- "dist"
43
- ],
44
- scripts: {
45
- build: "bun ../../tools/build-tool.ts",
46
- package: "bun run build && bun pm pack",
47
- lint: "biome check .",
48
- "lint:fix": "biome check --write .",
49
- test: "vitest run",
50
- "test:coverage": "vitest run --coverage"
51
- },
52
- devDependencies: {
53
- "@types/node": "^25.5.2",
54
- "@uipath/auth": "workspace:*",
55
- "@uipath/common": "workspace:*",
56
- "@uipath/dmn-editor-utils": "0.1164.0",
57
- "@uipath/filesystem": "workspace:*",
58
- "@uipath/orchestrator-sdk": "workspace:*",
59
- "@uipath/solution-sdk": "workspace:*",
60
- commander: "^14.0.3",
61
- fflate: "^0.8.2",
62
- typescript: "^7.0.2"
63
- }
64
- };
65
-
66
- // src/commands/debug.ts
67
- var RULES_DEBUG_EXAMPLES = [
68
- {
69
- Description: "Upload the rules project to Studio Web and evaluate it with one set of input values, returning the trace id of the run",
70
- Command: `uip rules debug ./LoanSolution/LoanEligibility --inputs '{"creditScore": 720}' --explain`,
71
- Output: {
72
- Code: "RulesDebug",
73
- Data: {
74
- solutionId: "30823424-33e3-405e-f21c-08df1c789a14",
75
- projectId: "ee8a16e8-385c-42c1-81ee-1628ab7d7cb7",
76
- studioWebUrl: "https://cloud.uipath.com/acme/studio_/designer/ee8a16e8-385c-42c1-81ee-1628ab7d7cb7?solutionId=30823424-33e3-405e-f21c-08df1c789a14",
77
- fileName: "LoanEligibility.dmn",
78
- stats: {
79
- submitted: 1,
80
- succeeded: 1,
81
- failed: 0,
82
- notEvaluated: 0
83
- },
84
- results: [
85
- {
86
- id: "1",
87
- decisions: [
88
- {
89
- decisionName: "Eligibility",
90
- outputs: { eligible: true }
91
- }
92
- ]
93
- }
94
- ],
95
- traceId: "499d9124f5da47462bd6535055483918"
96
- }
97
- }
98
- }
99
- ];
100
- var registerDebugCommand = (program) => {
101
- program.command("debug").description("Upload the rules project's solution to Studio Web and evaluate it once through the rules engine. Returns the decision outputs and errors, and with --explain the trace id that shows which rules fired.").argument("<project-path>", "Path to the business rules project directory (must contain project.uiproj)").option("-i, --inputs <json>", "Input values as a JSON object or @file.json").option("--explain", "Publish a trace of the run and return its id (read it with 'uip traces spans get')").option("--folder-path <path>", "Folder to evaluate in and publish the --explain trace into (default: your personal workspace)").option("--folder-key <key>", "Key (GUID) of the folder to evaluate in and publish the --explain trace into").option("--timeout <seconds>", "Maximum seconds to wait for the rules engine to evaluate (default: 120)", (value) => parseBoundedInt(value, "--timeout", { min: 1, max: 3600 })).option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", (value) => Number.parseInt(value, 10), 10).examples(RULES_DEBUG_EXAMPLES).trackedAction(processContext, async (projectPath, options) => {
102
- const { reportRulesFailure } = await import("./rules-command-error-5bdv4bcx.js");
103
- const { debugRuleProjectAsync } = await import("./rules-debug-service-5rcdh3pj.js");
104
- const [error, result] = await catchError(debugRuleProjectAsync(projectPath, options));
105
- if (error) {
106
- await reportRulesFailure("Failed to debug business rules project", error);
107
- return;
108
- }
109
- if (result.response.stats.failed > 0) {
110
- OutputFormatter.error({
111
- Result: RESULTS.Failure,
112
- Code: "RulesDebug",
113
- ErrorCode: "invalid_argument",
114
- Message: failedEvaluationMessage(result),
115
- Instructions: `Check the input values against the rule's inputs; Data.results holds the engine's errors. ${traceHint(result, options.explain === true) ?? "Run with --explain to see which rules fired."}`,
116
- Retry: "RetryWillNotFix",
117
- Data: formatDebugResult(result)
118
- });
119
- processContext.exit(1);
120
- return;
121
- }
122
- OutputFormatter.success({
123
- Result: RESULTS.Success,
124
- Code: "RulesDebug",
125
- Data: formatDebugResult(result),
126
- ...successInstructions(result, options.explain === true)
127
- }, { preserveDataKeys: true });
128
- });
129
- };
130
- function formatDebugResult(result) {
131
- const { response } = result;
132
- return {
133
- solutionId: result.solutionId,
134
- projectId: result.projectId,
135
- studioWebUrl: result.studioWebUrl,
136
- fileName: response.fileName,
137
- stats: response.stats,
138
- results: response.results,
139
- ...response.traceId ? { traceId: response.traceId } : {}
140
- };
141
- }
142
- function failedEvaluationMessage(result) {
143
- const [firstError] = result.response.results.flatMap((input) => [
144
- ...input.errors ?? [],
145
- ...(input.decisions ?? []).flatMap((decision) => decision.error ? [decision.error] : [])
146
- ]);
147
- return firstError?.message ? `The rules engine failed to evaluate the input: ${firstError.message}` : "The rules engine failed to evaluate the input.";
148
- }
149
- function successInstructions(result, explain) {
150
- const hint = traceHint(result, explain);
151
- return hint ? { Instructions: hint } : {};
152
- }
153
- function traceHint(result, explain) {
154
- if (!explain) {
155
- return;
156
- }
157
- return result.response.traceId ? `Run 'uip traces spans get ${result.response.traceId}' to see which rules fired.` : "The rules engine recorded no trace for this run.";
158
- }
159
-
160
- // src/commands/folder-options.ts
161
- function addFolderOptions(command) {
162
- return command.option("--folder-path <path>", "Folder path (e.g., 'Shared')").option("--folder-key <key>", "Folder key (GUID)");
163
- }
164
- function addTenantOption(command) {
165
- return command.addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>"));
166
- }
167
- function addUnsupportedTenantOption(command) {
168
- return command.addOption(new Option("-t, --tenant <tenant-name>", "Not supported").hideHelp());
169
- }
170
-
171
- // src/commands/describe.ts
172
- var RULES_DESCRIBE_EXAMPLES = [
173
- {
174
- Description: "Read a deployed rule's entry points before binding it from a BPMN process, RPA workflow or case",
175
- Command: 'uip rules describe LoanEligibility --folder-path "Shared"',
176
- Output: {
177
- Code: "RulesEntryPoints",
178
- Data: [
179
- {
180
- UniqueId: "8a0f5c3e-2d1b-4f6a-9e7c-1b2a3c4d5e6f",
181
- Path: "/LoanEligibility.dmn#Decision_Eligibility",
182
- DisplayName: "Eligibility",
183
- InputArguments: '{"type":"object","properties":{"creditScore":{"type":"number"}}}',
184
- OutputArguments: '{"type":"object","properties":{"eligible":{"type":"boolean"}}}'
185
- }
186
- ]
187
- }
188
- }
189
- ];
190
- var registerDescribeCommand = (program) => {
191
- const command = program.command("describe").description("(Preview) Get the entry points of a deployed business rule's active version, with their input and output argument schemas. Use them to map arguments when binding the rule. Same row shape as 'uip or packages entry-points'.").argument("<rule-name>", "Business rule name");
192
- addUnsupportedTenantOption(addFolderOptions(command)).examples(RULES_DESCRIBE_EXAMPLES).trackedAction(processContext, async (name, options) => {
193
- const rules = await import("./business-rules-jmwx05k2.js");
194
- const { reportRulesFailure, RulesCommandError } = await import("./rules-command-error-5bdv4bcx.js");
195
- if (options.tenant !== undefined) {
196
- await reportRulesFailure("Failed to describe business rule", new RulesCommandError("'uip rules describe' does not support --tenant: it reads the rule from the resource catalog of the tenant you are logged in to.", "invalid_argument", "Run 'uip login tenant set <tenant-name>' to switch tenants, then run the command again."));
197
- return;
198
- }
199
- const [error, entryPoints] = await catchError((async () => {
200
- const folder = await rules.resolveRequiredFolder(options);
201
- const { describeRuleAsync } = await import("./rule-catalog-vc98yg4n.js");
202
- return describeRuleAsync(name, folder);
203
- })());
204
- if (error) {
205
- await reportRulesFailure("Failed to describe business rule", error);
206
- return;
207
- }
208
- OutputFormatter.success({
209
- Result: RESULTS.Success,
210
- Code: "RulesEntryPoints",
211
- Data: entryPoints
212
- });
213
- });
214
- };
215
-
216
- // src/commands/get.ts
217
- var RULES_GET_EXAMPLES = [
218
- {
219
- Description: "Get a business rule by name",
220
- Command: 'uip rules get LoanEligibility --folder-path "Shared"',
221
- Output: {
222
- Code: "RulesGet",
223
- Data: {
224
- Key: "3f1c2a9e-8b4d-4e2a-9c1f-6d7e8f9a0b1c",
225
- Name: "LoanEligibility",
226
- FolderPath: "Shared",
227
- FolderKey: "9b2d4f6a-1c3e-4a5b-8d7f-0e1a2b3c4d5e",
228
- Description: "Decides loan eligibility",
229
- CurrentVersion: "1.0.2",
230
- Tags: [],
231
- CreationTime: "2026-09-01T10:00:00.000Z",
232
- LastModificationTime: "2026-09-20T08:30:00.000Z"
233
- }
234
- }
235
- }
236
- ];
237
- var registerGetCommand = (program) => {
238
- const command = program.command("get").description("(Preview) Get a deployed business rule by name. Use 'rules versions' for its version history and 'rules describe' for its argument contract.").argument("<rule-name>", "Business rule name");
239
- addTenantOption(addFolderOptions(command)).examples(RULES_GET_EXAMPLES).trackedAction(processContext, async (name, options) => {
240
- const rules = await import("./business-rules-jmwx05k2.js");
241
- const { reportRulesFailure } = await import("./rules-command-error-5bdv4bcx.js");
242
- const [error, found] = await catchError((async () => {
243
- const folder = await rules.resolveRequiredFolder(options);
244
- const api = await rules.createRulesApi(options.tenant, folder);
245
- const rule = await rules.findRuleByName(api, name, folder);
246
- return { rule, folder };
247
- })());
248
- if (error) {
249
- await reportRulesFailure("Failed to get business rule", error);
250
- return;
251
- }
252
- OutputFormatter.success({
253
- Result: RESULTS.Success,
254
- Code: "RulesGet",
255
- Data: rules.formatRuleDetail(found.rule, found.folder)
256
- });
257
- });
258
- };
259
-
260
- // src/commands/init.ts
261
- var RULES_INIT_EXAMPLES = [
262
- {
263
- Description: "Create a new business rules project. If the current directory is not already inside a solution, a parent solution named '<project>Solution' is created automatically and the rules project is nested inside it.",
264
- Command: "uip rules init my-rules-project",
265
- Output: {
266
- Code: "RulesInit",
267
- Data: {
268
- Status: "Created successfully",
269
- Path: "/workspace/my-rules-projectSolution/my-rules-project",
270
- RuleStatus: "Created",
271
- SolutionRegistration: {
272
- Status: "Registered",
273
- Message: "Project registered in parent solution.",
274
- Solution: "/workspace/my-rules-projectSolution/my-rules-projectSolution.uipx",
275
- Project: "my-rules-project/project.uiproj",
276
- ProjectId: "00000000-0000-0000-0000-000000000000",
277
- Instructions: `The project is listed in the parent solution manifest.
278
- Packing or uploading the solution will sync solution resources automatically.`
279
- },
280
- AutoCreatedSolution: {
281
- Name: "my-rules-projectSolution",
282
- Path: "/workspace/my-rules-projectSolution",
283
- SolutionFile: "/workspace/my-rules-projectSolution/my-rules-projectSolution.uipx"
284
- },
285
- ProjectArtifacts: { Created: true },
286
- NextSteps: `The project is listed in the parent solution manifest.
287
- Packing or uploading the solution will sync solution resources automatically.`
288
- }
289
- }
290
- }
291
- ];
292
- var registerInitCommand = (program) => {
293
- program.command("init").description("Create a new business rules project seeded with one decision table. If run outside an existing solution, a parent '<name>Solution' is scaffolded automatically and the rules project is created inside it. If run inside an existing solution, the project is added to that solution.").argument("<name>", "Business rules project name").option("--force", "Force initialization even if target directory exists and is not empty").option("--skip-solution-registration", "Do not auto-register this project in the surrounding solution").examples(RULES_INIT_EXAMPLES).trackedAction(processContext, async (name, options) => {
294
- const { rulesInitAsync } = await import("./rules-init-service-y7qzmxx0.js");
295
- const [error, result] = await catchError(rulesInitAsync(name, {
296
- force: options.force,
297
- skipRegistration: options.skipSolutionRegistration === true
298
- }));
299
- if (error) {
300
- OutputFormatter.error({
301
- Result: RESULTS.Failure,
302
- Message: "Failed to create business rules project",
303
- Instructions: error.message
304
- });
305
- processContext.exit(1);
306
- return;
307
- }
308
- const data = {
309
- Status: "Created successfully",
310
- Path: result.projectDir,
311
- RuleStatus: result.ruleStatus,
312
- SolutionRegistration: result.registration
313
- };
314
- if (result.autoCreatedSolution) {
315
- data.AutoCreatedSolution = result.autoCreatedSolution;
316
- }
317
- if (result.projectArtifacts) {
318
- data.ProjectArtifacts = result.projectArtifacts;
319
- }
320
- if (result.registration.Instructions) {
321
- data.NextSteps = result.registration.Instructions;
322
- }
323
- OutputFormatter.success({
324
- Result: RESULTS.Success,
325
- Code: "RulesInit",
326
- Data: data
327
- });
328
- });
329
- };
330
-
331
- // src/commands/list.ts
332
- var RULES_LIST_EXAMPLES = [
333
- {
334
- Description: "List the business rules in one folder, with their current version",
335
- Command: 'uip rules list --folder-path "Shared" --limit 1',
336
- Output: {
337
- Code: "RulesList",
338
- Data: [
339
- {
340
- Key: "3f1c2a9e-8b4d-4e2a-9c1f-6d7e8f9a0b1c",
341
- Name: "LoanEligibility",
342
- FolderPath: "Shared",
343
- FolderKey: "9b2d4f6a-1c3e-4a5b-8d7f-0e1a2b3c4d5e",
344
- Description: "Decides loan eligibility",
345
- CurrentVersion: "1.0.2"
346
- }
347
- ]
348
- }
349
- }
350
- ];
351
- var registerListCommand = (program) => {
352
- const command = program.command("list").description("(Preview) List business rules deployed to Orchestrator in a folder. Returns key, name, folder, description and current version.");
353
- addTenantOption(addFolderOptions(command)).option("-l, --limit <number>", "Number of items to return", parseLimit, DEFAULT_PAGE_SIZE).option("--offset <number>", "Number of items to skip", parseOffset, 0).examples(RULES_LIST_EXAMPLES).trackedAction(processContext, async (options) => {
354
- const { reportRulesFailure } = await import("./rules-command-error-5bdv4bcx.js");
355
- const [error, rows] = await catchError(listRules(options));
356
- if (error) {
357
- await reportRulesFailure("Failed to list business rules", error);
358
- return;
359
- }
360
- OutputFormatter.success({
361
- Result: RESULTS.Success,
362
- Code: "RulesList",
363
- Pagination: new Pagination({
364
- returned: rows.length,
365
- limit: options.limit,
366
- offset: options.offset
367
- }),
368
- Data: rows
369
- });
370
- });
371
- };
372
- async function listRules(options) {
373
- const rules = await import("./business-rules-jmwx05k2.js");
374
- const folder = await rules.resolveRequiredFolder(options);
375
- const api = await rules.createRulesApi(options.tenant, folder);
376
- const page = await api.businessRulesGet({
377
- $top: options.limit,
378
- $skip: options.offset
379
- });
380
- return (page.value ?? []).map((rule) => rules.formatRule(rule, folder));
381
- }
382
-
383
- // src/commands/refresh.ts
384
- var RULES_REFRESH_EXAMPLES = [
385
- {
386
- Description: "Regenerate a rules project's entry points after editing its .dmn outside Studio Web",
387
- Command: "uip rules refresh ./LoanEligibilitySolution/LoanEligibility",
388
- Output: {
389
- Code: "RulesRefresh",
390
- Data: {
391
- Status: "Updated business rules package files",
392
- ProjectPath: "/workspace/LoanEligibilitySolution/LoanEligibility",
393
- DmnFiles: ["Business rule.dmn"],
394
- WrittenFiles: ["entry-points.json"],
395
- UnchangedFiles: ["bindings_v2.json"]
396
- }
397
- }
398
- }
399
- ];
400
- var registerRefreshCommand = (program) => {
401
- program.command("refresh").description("Regenerate entry-points.json and bindings_v2.json from the rules project's .dmn, keeping each published entry point's uniqueId. Run it after editing a .dmn outside Studio Web, before 'uip solution pack'.").argument("<project-path>", "Path to the business rules project directory (must contain project.uiproj)").examples(RULES_REFRESH_EXAMPLES).trackedAction(processContext, async (projectPath) => {
402
- const { reportRulesFailure } = await import("./rules-command-error-5bdv4bcx.js");
403
- const { refreshRuleProjectAsync } = await import("./rules-refresh-service-qkmphj53.js");
404
- const [error, result] = await catchError(refreshRuleProjectAsync(projectPath));
405
- if (error) {
406
- await reportRulesFailure("Failed to refresh business rules package files", error);
407
- return;
408
- }
409
- OutputFormatter.success({
410
- Result: RESULTS.Success,
411
- Code: "RulesRefresh",
412
- Data: {
413
- Status: result.writtenFiles.length > 0 ? "Updated business rules package files" : "Business rules package files are up to date",
414
- ProjectPath: result.projectDir,
415
- DmnFiles: result.dmnFiles,
416
- WrittenFiles: result.writtenFiles,
417
- UnchangedFiles: result.unchangedFiles
418
- }
419
- });
420
- });
421
- };
422
-
423
- // src/commands/validate.ts
424
- var RULES_VALIDATE_EXAMPLES = [
425
- {
426
- Description: "Check a rules project against what Studio Web accepts before 'uip solution pack'",
427
- Command: "uip rules validate ./LoanEligibilitySolution/LoanEligibility",
428
- Output: {
429
- Code: "RulesValidate",
430
- Data: {
431
- Status: "Valid",
432
- ProjectPath: "/workspace/LoanEligibilitySolution/LoanEligibility",
433
- DmnFiles: ["Business rule.dmn"],
434
- Diagnostics: []
435
- }
436
- }
437
- }
438
- ];
439
- var registerValidateCommand = (program) => {
440
- program.command("validate").description("Check a rules project for what Studio Web blocks publish and debug on, the designer's diagnostics for each .dmn, and for an entry-points.json out of step with the .dmn. Errors exit 1; warnings are reported only.").argument("<project-path>", "Path to the business rules project directory (must contain project.uiproj)").examples(RULES_VALIDATE_EXAMPLES).trackedAction(processContext, async (projectPath) => {
441
- const { reportRulesFailure } = await import("./rules-command-error-5bdv4bcx.js");
442
- const { validateRuleProjectAsync } = await import("./rules-validate-service-hk2d006t.js");
443
- const [error, result] = await catchError(validateRuleProjectAsync(projectPath));
444
- if (error) {
445
- await reportRulesFailure("Failed to validate business rules project", error);
446
- return;
447
- }
448
- const errors = result.diagnostics.filter((d) => d.severity === "error").length;
449
- if (errors > 0) {
450
- const warnings = result.diagnostics.length - errors;
451
- OutputFormatter.error({
452
- Result: RESULTS.Failure,
453
- Code: "RulesValidate",
454
- ErrorCode: "invalid_argument",
455
- Message: `Validation failed for ${result.projectDir}`,
456
- Instructions: `Found ${errors} error(s) and ${warnings} warning(s):
457
- ${result.diagnostics.map(formatDiagnosticLine).join(`
458
- `)}`,
459
- Retry: "RetryWillNotFix",
460
- Data: formatResult(result, "Invalid")
461
- });
462
- processContext.exit(1);
463
- return;
464
- }
465
- OutputFormatter.success({
466
- Result: RESULTS.Success,
467
- Code: "RulesValidate",
468
- Data: formatResult(result, "Valid")
469
- }, { preserveDataKeys: ["Target"] });
470
- });
471
- };
472
- function formatDiagnosticLine(d) {
473
- const fix = d.instructions ? ` ${d.instructions}` : "";
474
- return ` - [${d.severity}] [${d.file}] ${d.code}: ${d.message}${fix}`;
475
- }
476
- function formatResult(result, status) {
477
- return {
478
- Status: status,
479
- ProjectPath: result.projectDir,
480
- DmnFiles: result.dmnFiles,
481
- Diagnostics: result.diagnostics.map((d) => ({
482
- File: d.file,
483
- Code: d.code,
484
- Severity: d.severity,
485
- Message: d.message,
486
- Instructions: d.instructions,
487
- Target: d.target
488
- }))
489
- };
490
- }
491
-
492
- // src/commands/versions.ts
493
- var RULES_VERSIONS_EXAMPLES = [
494
- {
495
- Description: "List the versions of a business rule",
496
- Command: 'uip rules versions LoanEligibility --folder-path "Shared"',
497
- Output: {
498
- Code: "RulesVersionList",
499
- Data: [
500
- {
501
- Version: "1.0.2",
502
- IsActive: true,
503
- CreationTime: "2026-09-20T08:30:00.000Z"
504
- },
505
- {
506
- Version: "1.0.1",
507
- IsActive: false,
508
- CreationTime: "2026-09-10T14:05:00.000Z"
509
- }
510
- ]
511
- }
512
- }
513
- ];
514
- var registerVersionsCommand = (program) => {
515
- const command = program.command("versions").description("(Preview) List the versions of a deployed business rule. The active version is the one consumers evaluate.").argument("<rule-name>", "Business rule name");
516
- addTenantOption(addFolderOptions(command)).option("-l, --limit <number>", "Number of versions to return", parseLimit, DEFAULT_PAGE_SIZE).option("--offset <number>", "Number of versions to skip", parseOffset, 0).examples(RULES_VERSIONS_EXAMPLES).trackedAction(processContext, async (name, options) => {
517
- const rules = await import("./business-rules-jmwx05k2.js");
518
- const { reportRulesFailure } = await import("./rules-command-error-5bdv4bcx.js");
519
- const [error, page] = await catchError((async () => {
520
- const folder = await rules.resolveRequiredFolder(options);
521
- const api = await rules.createRulesApi(options.tenant, folder);
522
- const rule = await rules.findRuleByName(api, name, folder);
523
- if (!rule.id) {
524
- throw rules.ruleNotFound(name, folder);
525
- }
526
- return api.businessRulesGetVersionListById({
527
- id: rule.id,
528
- $top: options.limit,
529
- $skip: options.offset
530
- });
531
- })());
532
- if (error) {
533
- await reportRulesFailure("Failed to list business rule versions", error);
534
- return;
535
- }
536
- const items = page.value ?? [];
537
- OutputFormatter.success({
538
- Result: RESULTS.Success,
539
- Code: "RulesVersionList",
540
- Pagination: new Pagination({
541
- returned: items.length,
542
- limit: options.limit,
543
- offset: options.offset
544
- }),
545
- Data: items.map(rules.formatVersion)
546
- });
547
- });
548
- };
549
-
550
- // src/tool.ts
551
- var metadata2 = {
552
- name: "rules-tool",
553
- version: package_default.version,
554
- description: "Create and manage UiPath Business Rules (DMN) projects.",
555
- commandPrefix: "rules"
556
- };
557
- var registerCommands2 = async (program) => {
558
- registerInitCommand(program);
559
- registerRefreshCommand(program);
560
- registerValidateCommand(program);
561
- registerListCommand(program);
562
- registerGetCommand(program);
563
- registerVersionsCommand(program);
564
- registerDescribeCommand(program);
565
- registerDebugCommand(program);
566
- };
567
-
568
- export { metadata2, registerCommands2 };
569
-
570
- //# debugId=44295B01C9816E2364756E2164756E21
@@ -1,70 +0,0 @@
1
- import {
2
- BusinessRulesApi,
3
- createApiClient,
4
- resolveFolder,
5
- quoteODataStringLiteral
6
- } from "./tool-8j9f6ns5.js";
7
- import {
8
- RulesCommandError2
9
- } from "./tool-9bz2x04j.js";
10
-
11
- // src/services/business-rules.ts
12
- async function resolveRequiredFolder2(options) {
13
- if (options.folderPath !== undefined && options.folderKey !== undefined) {
14
- throw new RulesCommandError2("Options --folder-path and --folder-key cannot be used together.", "invalid_argument", "Provide either --folder-path <path> or --folder-key <key>, not both.");
15
- }
16
- const folder = await resolveFolder({ folderPath: options.folderPath, folderKey: options.folderKey }, { tenant: options.tenant });
17
- if (!folder) {
18
- throw new RulesCommandError2("Missing required option --folder-path or --folder-key.", "invalid_argument", "Provide --folder-path <path> or --folder-key <key>. Run 'uip or folders list' to find folder paths.");
19
- }
20
- return folder;
21
- }
22
- function createRulesApi2(tenant, folder) {
23
- return createApiClient(BusinessRulesApi, {
24
- tenant,
25
- folderId: folder.id.toString()
26
- });
27
- }
28
- function ruleNotFound2(name, folder) {
29
- return new RulesCommandError2(`Business rule '${name}' was not found in folder '${folder.path}'.`, "not_found", `Run 'uip rules list --folder-path "${folder.path}"' to see the rules in this folder.`);
30
- }
31
- async function findRuleByName2(api, name, folder) {
32
- const result = await api.businessRulesGet({
33
- $filter: `Name eq ${quoteODataStringLiteral(name)}`,
34
- $top: 1
35
- });
36
- const rule = result.value?.[0];
37
- if (!rule) {
38
- throw ruleNotFound2(name, folder);
39
- }
40
- return rule;
41
- }
42
- function formatRule2(rule, folder) {
43
- return {
44
- Key: rule.id ?? "",
45
- Name: rule.name,
46
- FolderPath: folder.path,
47
- FolderKey: folder.key,
48
- Description: rule.description ?? "",
49
- CurrentVersion: rule.currentVersion?.versionNumber ?? ""
50
- };
51
- }
52
- function formatRuleDetail2(rule, folder) {
53
- return {
54
- ...formatRule2(rule, folder),
55
- Tags: (rule.tags ?? []).map((tag) => tag.name),
56
- CreationTime: rule.creationTime,
57
- LastModificationTime: rule.lastModificationTime
58
- };
59
- }
60
- function formatVersion2(version) {
61
- return {
62
- Version: version.versionNumber ?? "",
63
- IsActive: version.isActive === true,
64
- CreationTime: version.creationTime
65
- };
66
- }
67
-
68
- export { resolveRequiredFolder2, createRulesApi2, ruleNotFound2, findRuleByName2, formatRule2, formatRuleDetail2, formatVersion2 };
69
-
70
- //# debugId=C024EAC7A058890364756E2164756E21