@uipath/rules-tool 1.205.0-preview.281 → 1.206.0-preview.282

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 (62) hide show
  1. package/dist/DmnFactory-L7MABUC6-q2sr3grz.js +10 -0
  2. package/dist/DmnModelTypes-ATR7FVKZ-h8srwcxk.js +8 -0
  3. package/dist/KieDmnMarshaller-LGE63WDG-nfkpv8f4.js +8 -0
  4. package/dist/THIRD-PARTY-NOTICES.md +4 -4
  5. package/dist/business-rules-z2zw35qd.js +25 -0
  6. package/dist/{constants-cnn0jfw6.js → constants-1sdwfz26.js} +7 -15
  7. package/dist/{embedded-file-reader-z4becc02.js → embedded-file-reader-0228j82a.js} +1 -4
  8. package/dist/first-party-service-hegqxm82.js +8 -0
  9. package/dist/hitPolicyResult-CGCR73CW-jz89f1aa.js +12 -0
  10. package/dist/index-4a4x1ygg.js +24 -0
  11. package/dist/{index-52h8rpew.js → index-egzwtc07.js} +2 -4
  12. package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
  13. package/dist/index-xaxgkfez.js +23 -0
  14. package/dist/{tool-tjcg2xje.js → index-y5yffb2s.js} +3525 -236
  15. package/dist/index-z4kt2kt6.js +8 -0
  16. package/dist/{index-bhjt1h5c.js → index-zeszs1ra.js} +23 -66
  17. package/dist/index.js +8 -9
  18. package/dist/{jmespath-231m3hyn.js → jmespath-ab6tdc42.js} +1 -1
  19. package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
  20. package/dist/rule-catalog-5qnmp0xp.js +71 -0
  21. package/dist/rules-command-error-30c8a3n9.js +13 -0
  22. package/dist/{rules-debug-service-02zf7t4e.js → rules-debug-service-jf46j5g6.js} +37 -38
  23. package/dist/{rules-init-service-f990fgeb.js → rules-init-service-skes439c.js} +12 -16
  24. package/dist/{rules-refresh-service-jn6my893.js → rules-refresh-service-18hrs394.js} +13 -14
  25. package/dist/{rules-validate-service-hfw8m3dm.js → rules-validate-service-s787ehrr.js} +10 -13
  26. package/dist/{tool-f04pwp3c.js → tool-5exp6zh7.js} +659 -14
  27. package/dist/{tool-fk8rznma.js → tool-89e90qrm.js} +173 -223
  28. package/dist/{tool-fbxe48wd.js → tool-8cnhz30a.js} +13991 -15184
  29. package/dist/{tool-h7gn1rar.js → tool-93hqhaj3.js} +402 -417
  30. package/dist/{tool-wf2qkrye.js → tool-cs8nyk0r.js} +990 -514
  31. package/dist/{tool-txp5th7j.js → tool-e23cj2jx.js} +127 -42
  32. package/dist/{tool-1de529jm.js → tool-epsr41wx.js} +12 -3
  33. package/dist/{tool-gkbr01gc.js → tool-fkppxa9f.js} +14 -17
  34. package/dist/{tool-5hek0atf.js → tool-k55fs9aj.js} +32 -34
  35. package/dist/{tool-86f1xpxn.js → tool-m59a481n.js} +18 -20
  36. package/dist/tool-mst6a4dr.js +73 -0
  37. package/dist/{tool-t4k013ex.js → tool-njnhj05q.js} +8 -8
  38. package/dist/tool-p7hqn93n.js +455 -0
  39. package/dist/{tool-z1ay3csx.js → tool-sbtf80ft.js} +66 -24
  40. package/dist/{tool-yq5jph4h.js → tool-vqm4apm6.js} +207 -216
  41. package/dist/tool.js +7 -8
  42. package/package.json +2 -2
  43. package/dist/DmnFactory-L7MABUC6-98k17dkr.js +0 -46
  44. package/dist/DmnModelTypes-ATR7FVKZ-jp35cecy.js +0 -18
  45. package/dist/KieDmnMarshaller-LGE63WDG-3vemswef.js +0 -20
  46. package/dist/business-rules-pm96sefm.js +0 -26
  47. package/dist/first-party-service-sd8yaf73.js +0 -27
  48. package/dist/hitPolicyResult-CGCR73CW-9bmc4nsr.js +0 -36
  49. package/dist/index-cpm94vee.js +0 -132
  50. package/dist/index-dqa169gp.js +0 -25
  51. package/dist/index-x9msn1dj.js +0 -85
  52. package/dist/index-ybrgtfsg.js +0 -3326
  53. package/dist/rule-catalog-10fhgevc.js +0 -74
  54. package/dist/rules-command-error-k6kxwfn7.js +0 -14
  55. package/dist/tool-1pccj6q3.js +0 -1116
  56. package/dist/tool-53w8skv5.js +0 -262
  57. package/dist/tool-7haj67tr.js +0 -19
  58. package/dist/tool-fbmxx07c.js +0 -73
  59. package/dist/tool-gdtpsdn7.js +0 -342
  60. package/dist/tool-jd313s2x.js +0 -10
  61. package/dist/tool-qgqscsjc.js +0 -46
  62. /package/dist/{tool-cfrcyxgm.js → tool-2nmqvfmt.js} +0 -0
@@ -1,25 +1,22 @@
1
1
  import {
2
- DEFAULT_PAGE_SIZE,
2
+ catchError,
3
+ RESULTS,
3
4
  Option,
4
- OutputFormatter,
5
5
  Pagination,
6
- RESULTS,
7
- catchError,
6
+ OutputFormatter,
7
+ processContext,
8
+ DEFAULT_PAGE_SIZE,
8
9
  createHiddenDeprecatedTenantOption,
9
- parseBoundedInt,
10
10
  parseLimit,
11
11
  parseOffset,
12
- processContext
13
- } from "./tool-wf2qkrye.js";
14
- import {
15
- __require
16
- } from "./tool-1de529jm.js";
12
+ parseBoundedInt
13
+ } from "./tool-cs8nyk0r.js";
17
14
  // package.json
18
15
  var package_default = {
19
16
  name: "@uipath/rules-tool",
20
17
  author: "UiPath",
21
18
  license: "SEE LICENSE IN LICENSE.txt",
22
- version: "1.205.0-preview.281",
19
+ version: "1.206.0-preview.282",
23
20
  description: "Create and manage UiPath Business Rules (DMN) projects.",
24
21
  private: false,
25
22
  repository: {
@@ -49,6 +46,7 @@ var package_default = {
49
46
  package: "bun run build && bun pm pack",
50
47
  lint: "biome check .",
51
48
  "lint:fix": "biome check --write .",
49
+ typecheck: "tsc --noEmit",
52
50
  test: "vitest run",
53
51
  "test:coverage": "vitest run --coverage"
54
52
  },
@@ -94,8 +92,8 @@ var RULES_DEBUG_EXAMPLES = [
94
92
  ];
95
93
  var registerDebugCommand = (program) => {
96
94
  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 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("--folder-path <path>", "Folder to evaluate in and record the run's trace under (default: your personal workspace)").option("--folder-key <key>", "Key (GUID) of the folder to evaluate in and record the run's trace under").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) => {
97
- const { reportRulesFailure } = await import("./rules-command-error-k6kxwfn7.js");
98
- const { debugRuleProjectAsync } = await import("./rules-debug-service-02zf7t4e.js");
95
+ const { reportRulesFailure } = await import("./rules-command-error-30c8a3n9.js");
96
+ const { debugRuleProjectAsync } = await import("./rules-debug-service-jf46j5g6.js");
99
97
  const [error, result] = await catchError(debugRuleProjectAsync(projectPath, options));
100
98
  if (error) {
101
99
  await reportRulesFailure("Failed to debug business rules project", error);
@@ -191,15 +189,15 @@ var RULES_DESCRIBE_EXAMPLES = [
191
189
  var registerDescribeCommand = (program) => {
192
190
  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");
193
191
  addUnsupportedTenantOption(addFolderOptions(command)).examples(RULES_DESCRIBE_EXAMPLES).trackedAction(processContext, async (name, options) => {
194
- const rules = await import("./business-rules-pm96sefm.js");
195
- const { reportRulesFailure, RulesCommandError } = await import("./rules-command-error-k6kxwfn7.js");
192
+ const rules = await import("./business-rules-z2zw35qd.js");
193
+ const { reportRulesFailure, RulesCommandError } = await import("./rules-command-error-30c8a3n9.js");
196
194
  if (options.tenant !== undefined) {
197
195
  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."));
198
196
  return;
199
197
  }
200
198
  const [error, entryPoints] = await catchError((async () => {
201
199
  const folder = await rules.resolveRequiredFolder(options);
202
- const { describeRuleAsync } = await import("./rule-catalog-10fhgevc.js");
200
+ const { describeRuleAsync } = await import("./rule-catalog-5qnmp0xp.js");
203
201
  return describeRuleAsync(name, folder);
204
202
  })());
205
203
  if (error) {
@@ -238,8 +236,8 @@ var RULES_GET_EXAMPLES = [
238
236
  var registerGetCommand = (program) => {
239
237
  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");
240
238
  addTenantOption(addFolderOptions(command)).examples(RULES_GET_EXAMPLES).trackedAction(processContext, async (name, options) => {
241
- const rules = await import("./business-rules-pm96sefm.js");
242
- const { reportRulesFailure } = await import("./rules-command-error-k6kxwfn7.js");
239
+ const rules = await import("./business-rules-z2zw35qd.js");
240
+ const { reportRulesFailure } = await import("./rules-command-error-30c8a3n9.js");
243
241
  const [error, found] = await catchError((async () => {
244
242
  const folder = await rules.resolveRequiredFolder(options);
245
243
  const api = await rules.createRulesApi(options.tenant, folder);
@@ -292,7 +290,7 @@ Packing or uploading the solution will sync solution resources automatically.`
292
290
  ];
293
291
  var registerInitCommand = (program) => {
294
292
  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) => {
295
- const { rulesInitAsync } = await import("./rules-init-service-f990fgeb.js");
293
+ const { rulesInitAsync } = await import("./rules-init-service-skes439c.js");
296
294
  const [error, result] = await catchError(rulesInitAsync(name, {
297
295
  force: options.force,
298
296
  skipRegistration: options.skipSolutionRegistration === true
@@ -368,7 +366,7 @@ var RULES_LIST_EXAMPLES = [
368
366
  var registerListCommand = (program) => {
369
367
  const command = program.command("list").description("(Preview) List business rules deployed to Orchestrator in a folder, or across all accessible folders with --all-folders. Returns key, name, folder, description and, for one folder, current version. --all-folders returns one row per folder a rule is shared to.");
370
368
  addTenantOption(addFolderOptions(command)).option("--all-folders", "List business rules across all accessible folders").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) => {
371
- const { reportRulesFailure } = await import("./rules-command-error-k6kxwfn7.js");
369
+ const { reportRulesFailure } = await import("./rules-command-error-30c8a3n9.js");
372
370
  const [error, result] = await catchError(listRules(options));
373
371
  if (error) {
374
372
  await reportRulesFailure("Failed to list business rules", error);
@@ -388,8 +386,8 @@ var registerListCommand = (program) => {
388
386
  });
389
387
  };
390
388
  async function listRules(options) {
391
- const rules = await import("./business-rules-pm96sefm.js");
392
- const { RulesCommandError } = await import("./rules-command-error-k6kxwfn7.js");
389
+ const rules = await import("./business-rules-z2zw35qd.js");
390
+ const { RulesCommandError } = await import("./rules-command-error-30c8a3n9.js");
393
391
  const hasFolderSelector = options.folderPath !== undefined || options.folderKey !== undefined;
394
392
  if (options.allFolders && hasFolderSelector) {
395
393
  throw new RulesCommandError("Option --all-folders cannot be used with --folder-path or --folder-key.", "invalid_argument", "Use --all-folders by itself, or provide a single folder selector with --folder-path or --folder-key.");
@@ -412,11 +410,11 @@ async function listRules(options) {
412
410
  };
413
411
  }
414
412
  async function listRulesAcrossFolders(options) {
415
- const { RulesCommandError } = await import("./rules-command-error-k6kxwfn7.js");
413
+ const { RulesCommandError } = await import("./rules-command-error-30c8a3n9.js");
416
414
  if (options.tenant !== undefined) {
417
415
  throw new RulesCommandError("'uip rules list --all-folders' does not support --tenant: it lists rules from the resource catalog of the tenant you are logged in to.", "invalid_argument", "Drop --all-folders and pass --folder-path <path> or --folder-key <key> to list one folder in that tenant, or run 'uip login tenant set <tenant-name>' to switch tenants.");
418
416
  }
419
- const { listRulesAcrossFoldersAsync } = await import("./rule-catalog-10fhgevc.js");
417
+ const { listRulesAcrossFoldersAsync } = await import("./rule-catalog-5qnmp0xp.js");
420
418
  const result = await listRulesAcrossFoldersAsync(options.limit, options.offset);
421
419
  if (!result) {
422
420
  throw new RulesCommandError("Listing business rules across folders needs the Node CLI: the browser build cannot read the resource catalog.", "configuration_error", "Drop --all-folders and pass --folder-path <path> or --folder-key <key> to list one folder.");
@@ -443,8 +441,8 @@ var RULES_REFRESH_EXAMPLES = [
443
441
  ];
444
442
  var registerRefreshCommand = (program) => {
445
443
  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) => {
446
- const { reportRulesFailure } = await import("./rules-command-error-k6kxwfn7.js");
447
- const { refreshRuleProjectAsync } = await import("./rules-refresh-service-jn6my893.js");
444
+ const { reportRulesFailure } = await import("./rules-command-error-30c8a3n9.js");
445
+ const { refreshRuleProjectAsync } = await import("./rules-refresh-service-18hrs394.js");
448
446
  const [error, result] = await catchError(refreshRuleProjectAsync(projectPath));
449
447
  if (error) {
450
448
  await reportRulesFailure("Failed to refresh business rules package files", error);
@@ -482,8 +480,8 @@ var RULES_VALIDATE_EXAMPLES = [
482
480
  ];
483
481
  var registerValidateCommand = (program) => {
484
482
  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) => {
485
- const { reportRulesFailure } = await import("./rules-command-error-k6kxwfn7.js");
486
- const { validateRuleProjectAsync } = await import("./rules-validate-service-hfw8m3dm.js");
483
+ const { reportRulesFailure } = await import("./rules-command-error-30c8a3n9.js");
484
+ const { validateRuleProjectAsync } = await import("./rules-validate-service-s787ehrr.js");
487
485
  const [error, result] = await catchError(validateRuleProjectAsync(projectPath));
488
486
  if (error) {
489
487
  await reportRulesFailure("Failed to validate business rules project", error);
@@ -558,8 +556,8 @@ var RULES_VERSIONS_EXAMPLES = [
558
556
  var registerVersionsCommand = (program) => {
559
557
  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");
560
558
  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) => {
561
- const rules = await import("./business-rules-pm96sefm.js");
562
- const { reportRulesFailure } = await import("./rules-command-error-k6kxwfn7.js");
559
+ const rules = await import("./business-rules-z2zw35qd.js");
560
+ const { reportRulesFailure } = await import("./rules-command-error-30c8a3n9.js");
563
561
  const [error, page] = await catchError((async () => {
564
562
  const folder = await rules.resolveRequiredFolder(options);
565
563
  const api = await rules.createRulesApi(options.tenant, folder);
@@ -592,13 +590,13 @@ var registerVersionsCommand = (program) => {
592
590
  };
593
591
 
594
592
  // src/tool.ts
595
- var metadata = {
593
+ var metadata2 = {
596
594
  name: "rules-tool",
597
595
  version: package_default.version,
598
596
  description: "Create and manage UiPath Business Rules (DMN) projects.",
599
597
  commandPrefix: "rules"
600
598
  };
601
- var registerCommands = async (program) => {
599
+ var registerCommands2 = async (program) => {
602
600
  registerInitCommand(program);
603
601
  registerRefreshCommand(program);
604
602
  registerValidateCommand(program);
@@ -609,6 +607,6 @@ var registerCommands = async (program) => {
609
607
  registerDebugCommand(program);
610
608
  };
611
609
 
612
- export { metadata, registerCommands };
610
+ export { metadata2, registerCommands2 };
613
611
 
614
- //# debugId=2BCD3AE3E6FA55CB64756E2164756E21
612
+ //# debugId=98E4E5626ACB307064756E2164756E21
@@ -1,51 +1,49 @@
1
- import {
2
- R,
3
- X
4
- } from "./tool-z1ay3csx.js";
5
1
  import {
6
2
  e,
7
- i,
8
3
  n,
9
- r
10
- } from "./tool-jd313s2x.js";
4
+ i,
5
+ r,
6
+ R2,
7
+ X2
8
+ } from "./tool-sbtf80ft.js";
11
9
 
12
10
  // ../../node_modules/@uipath/dmn-editor-utils/dist/chunks/chunk-JAGAV2EF.js
13
11
  var f = new Set([e.Collect, e.RuleOrder, e.OutputOrder]);
14
- var m = new Set([e.Priority, e.OutputOrder]);
12
+ var m3 = new Set([e.Priority, e.OutputOrder]);
15
13
  var O = (e2) => e2.hitPolicy === e.Collect && e2.aggregation ? e2.aggregation : f.has(e2.hitPolicy) ? "list" : "value";
16
- var R2 = (e2) => !!e2 && i.includes(e2);
14
+ var R = (e2) => !!e2 && i.includes(e2);
17
15
  var C = (e2, n2) => e2 === n.Sum || e2 === n.Count ? "number" : n2?.typeRef;
18
16
  var p = (e2, n2) => n2.typeRef ?? (e2.decision.decisionTable.outputs.length === 1 ? e2.decision.variableTypeRef : undefined);
19
- var T = (e2, n2) => X(e2, n2).isCollection;
20
- var g = (e2) => r.includes(R(e2));
17
+ var T = (e2, n2) => X2(e2, n2).isCollection;
18
+ var g2 = (e2) => r.includes(R2(e2));
21
19
  var x = (e2, n2) => {
22
- let t = X(e2, n2);
20
+ let t = X2(e2, n2);
23
21
  if (t.isCollection || t.foreign)
24
22
  return false;
25
23
  let i2 = t.baseTypeRef;
26
- return i2 === undefined || g(i2) && i2 !== "Any";
24
+ return i2 === undefined || g2(i2) && i2 !== "Any";
27
25
  };
28
26
  var u = (e2, n2) => {
29
- let t = X(e2, n2);
27
+ let t = X2(e2, n2);
30
28
  if (t.foreign)
31
29
  return "Any";
32
30
  if (t.baseTypeRef !== undefined)
33
31
  return t.baseTypeRef;
34
32
  let i2 = t.chain[t.chain.length - 1];
35
- return i2 ? R(i2.name) : undefined;
33
+ return i2 ? R2(i2.name) : undefined;
36
34
  };
37
- var E = (e2, n2) => n2 && g(n2) ? n2 : u(e2, n2);
35
+ var E2 = (e2, n2) => n2 && g2(n2) ? n2 : u(e2, n2);
38
36
  var A = (e2, n2) => {
39
- let t = p(e2, n2), i2 = n2.allowedValues?.text.trim() || X(e2, t).chain.find((r2) => r2.allowedValues?.trim())?.allowedValues;
37
+ let t = p(e2, n2), i2 = n2.allowedValues?.text.trim() || X2(e2, t).chain.find((r2) => r2.allowedValues?.trim())?.allowedValues;
40
38
  return i2 ? { text: i2, typeRef: u(e2, t) } : undefined;
41
39
  };
42
40
  var S = (e2, n2, t) => {
43
41
  if (n2 === n.Count)
44
42
  return true;
45
43
  let i2 = p(e2, t), r2 = u(e2, i2);
46
- return !T(e2, i2) && (!r2 || ["number", "Any"].includes(R(r2)));
44
+ return !T(e2, i2) && (!r2 || ["number", "Any"].includes(R2(r2)));
47
45
  };
48
46
 
49
- export { f, m, O, R2 as R, C, p, T, g, x, u, E, A, S };
47
+ export { f, m3, O, R, C, p, T, g2, x, u, E2, A, S };
50
48
 
51
- //# debugId=5BB7BDD21176C3C264756E2164756E21
49
+ //# debugId=31405D58E09C528664756E2164756E21
@@ -0,0 +1,73 @@
1
+ import {
2
+ BusinessRulesApi,
3
+ createApiClient,
4
+ resolveFolder,
5
+ quoteODataStringLiteral
6
+ } from "./tool-e23cj2jx.js";
7
+ import {
8
+ RulesCommandError2
9
+ } from "./tool-njnhj05q.js";
10
+
11
+ // src/services/business-rules.ts
12
+ function assertOneFolderOption2(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
+ }
17
+ async function resolveRequiredFolder2(options) {
18
+ assertOneFolderOption2(options);
19
+ const folder = await resolveFolder({ folderPath: options.folderPath, folderKey: options.folderKey }, { tenant: options.tenant });
20
+ if (!folder) {
21
+ 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.");
22
+ }
23
+ return folder;
24
+ }
25
+ function createRulesApi2(tenant, folder) {
26
+ return createApiClient(BusinessRulesApi, {
27
+ tenant,
28
+ folderId: folder.id.toString()
29
+ });
30
+ }
31
+ function ruleNotFound2(name, folder) {
32
+ 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.`);
33
+ }
34
+ async function findRuleByName2(api, name, folder) {
35
+ const result = await api.businessRulesGet({
36
+ $filter: `Name eq ${quoteODataStringLiteral(name)}`,
37
+ $top: 1
38
+ });
39
+ const rule = result.value?.[0];
40
+ if (!rule) {
41
+ throw ruleNotFound2(name, folder);
42
+ }
43
+ return rule;
44
+ }
45
+ function formatRule2(rule, folder) {
46
+ return {
47
+ Key: rule.id ?? "",
48
+ Name: rule.name,
49
+ FolderPath: folder.path,
50
+ FolderKey: folder.key,
51
+ Description: rule.description ?? "",
52
+ CurrentVersion: rule.currentVersion?.versionNumber ?? ""
53
+ };
54
+ }
55
+ function formatRuleDetail2(rule, folder) {
56
+ return {
57
+ ...formatRule2(rule, folder),
58
+ Tags: (rule.tags ?? []).map((tag) => tag.name),
59
+ CreationTime: rule.creationTime,
60
+ LastModificationTime: rule.lastModificationTime
61
+ };
62
+ }
63
+ function formatVersion2(version) {
64
+ return {
65
+ Version: version.versionNumber ?? "",
66
+ IsActive: version.isActive === true,
67
+ CreationTime: version.creationTime
68
+ };
69
+ }
70
+
71
+ export { assertOneFolderOption2, resolveRequiredFolder2, createRulesApi2, ruleNotFound2, findRuleByName2, formatRule2, formatRuleDetail2, formatVersion2 };
72
+
73
+ //# debugId=3821AC45F94CDB2E64756E2164756E21
@@ -1,12 +1,12 @@
1
1
  import {
2
- OutputFormatter,
3
2
  RESULTS,
4
3
  classifiedFailure,
4
+ OutputFormatter,
5
5
  processContext
6
- } from "./tool-wf2qkrye.js";
6
+ } from "./tool-cs8nyk0r.js";
7
7
 
8
8
  // src/services/rules-command-error.ts
9
- class RulesCommandError extends Error {
9
+ class RulesCommandError2 extends Error {
10
10
  errorCode;
11
11
  instructions;
12
12
  retry;
@@ -19,11 +19,11 @@ class RulesCommandError extends Error {
19
19
  this.context = context;
20
20
  }
21
21
  }
22
- function isJsonObject(value) {
22
+ function isJsonObject2(value) {
23
23
  return typeof value === "object" && value !== null && !Array.isArray(value);
24
24
  }
25
- async function reportRulesFailure(message, error) {
26
- if (error instanceof RulesCommandError) {
25
+ async function reportRulesFailure2(message, error) {
26
+ if (error instanceof RulesCommandError2) {
27
27
  OutputFormatter.error({
28
28
  Result: error.errorCode === "configuration_error" ? RESULTS.ConfigError : RESULTS.Failure,
29
29
  ErrorCode: error.errorCode,
@@ -38,6 +38,6 @@ async function reportRulesFailure(message, error) {
38
38
  processContext.exit(1);
39
39
  }
40
40
 
41
- export { RulesCommandError, isJsonObject, reportRulesFailure };
41
+ export { RulesCommandError2, isJsonObject2, reportRulesFailure2 };
42
42
 
43
- //# debugId=B2F6C5FC5162EEA564756E2164756E21
43
+ //# debugId=5F74FF1A10A8429C64756E2164756E21