@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
@@ -0,0 +1,8 @@
1
+ import {
2
+ bs
3
+ } from "./tool-93hqhaj3.js";
4
+ export {
5
+ bs as importDmnDocument
6
+ };
7
+
8
+ //# debugId=869FEBEF2AA810FB64756E2164756E21
@@ -1,17 +1,10 @@
1
1
  import {
2
- v4_default
3
- } from "./tool-qgqscsjc.js";
4
- import {
5
- A,
2
+ m4,
3
+ A2,
6
4
  I,
7
- J,
8
- m
9
- } from "./tool-z1ay3csx.js";
10
- import"./tool-jd313s2x.js";
11
- import"./tool-7haj67tr.js";
12
- import {
13
- __require
14
- } from "./tool-1de529jm.js";
5
+ J2,
6
+ v4_default
7
+ } from "./tool-sbtf80ft.js";
15
8
 
16
9
  // ../../node_modules/@uipath/dmn-editor-utils/dist/entry-points/index.js
17
10
  function ne(e) {
@@ -49,33 +42,6 @@ var Y = (e) => {
49
42
  };
50
43
  var I2 = "x-uipath-decision-keyed";
51
44
  var H = "x-uipath-rows";
52
- var se = (e) => Object.entries(e.items?.properties ?? {}).map(([n, t]) => [n, { type: "array", items: t }]);
53
- var re = (e) => {
54
- try {
55
- return JSON.parse(e);
56
- } catch {
57
- return;
58
- }
59
- };
60
- var J2 = (e) => {
61
- let n = typeof e == "string" ? re(e) : e;
62
- if (!(!n || typeof n != "object" || n[I2] !== true))
63
- return Object.keys(n.properties ?? {}).length > 0 ? n : undefined;
64
- };
65
- var ie = (e) => {
66
- let n = J2(e);
67
- if (!n)
68
- return e;
69
- let t = {};
70
- for (let p of Object.values(n.properties ?? {}))
71
- for (let [o, c] of Object.entries(p.properties ?? {})) {
72
- let d = c[H] === true ? se(c) : [];
73
- for (let [l, g] of d.length ? d : [[o, c]])
74
- t[l] ??= g;
75
- }
76
- let { definitions: r, $defs: u } = n;
77
- return { type: "object", properties: t, ...r ? { definitions: r } : {}, ...u ? { $defs: u } : {} };
78
- };
79
45
  var oe = { "invalid-xml": "The rule is not valid XML.", "unsafe-xml": "The rule declares a document type, which is not allowed.", "lossy-xml": "The rule contains comments or processing instructions that cannot be preserved.", "unsupported-version": "The rule uses a DMN version that is not supported.", "migration-failed": "The rule could not be migrated to a supported DMN version.", "unsupported-profile": "The rule uses DMN constructs that are not supported." };
80
46
  var N = class extends Error {
81
47
  constructor(t) {
@@ -86,51 +52,47 @@ var N = class extends Error {
86
52
  };
87
53
  var W = (e) => e.__$$element === "decision";
88
54
  var ae = (e) => e.__$$element === "inputData";
89
- var A2 = (e) => e.expression?.__$$element === "decisionTable" ? e.expression : undefined;
55
+ var A = (e) => e.expression?.__$$element === "decisionTable" ? e.expression : undefined;
90
56
  var k = (e) => e.expression?.__$$element === "literalExpression" ? e.expression : undefined;
91
- var C = (e) => !!A2(e) || !!k(e);
57
+ var C = (e) => !!A(e) || !!k(e);
92
58
  var ue = (e, n, t, r) => ({ name: t, displayName: e["@_label"] || t, ...r.argumentType(...ce(e, n), true), source: `=result.${t}` });
93
59
  var ce = (e, n) => n["@_typeRef"] === undefined ? [e.variable?.["@_typeRef"], [e.variable, e]] : [n["@_typeRef"], [n, e]];
94
60
  var le = (e, n, t) => ({ name: n, displayName: e["@_name"] || e.variable?.["@_name"] || "", ...t.argumentType(e.variable?.["@_typeRef"], [e.variable, e], false), required: true });
95
61
  async function G(e) {
96
- let [{ importDmnDocument: n }, { outputArgumentName: t, resolvedIdentifier: r }, { aggregateTypeRef: u, isCollectAggregation: p, LIST_HIT_POLICIES: o }, { DmnHitPolicy: c }] = await Promise.all([import("./KieDmnMarshaller-LGE63WDG-3vemswef.js"), import("./DmnFactory-L7MABUC6-98k17dkr.js"), import("./hitPolicyResult-CGCR73CW-9bmc4nsr.js"), import("./DmnModelTypes-ATR7FVKZ-jp35cecy.js")]), d = await n(e);
62
+ let [{ importDmnDocument: n }, { outputArgumentName: t, resolvedIdentifier: r }, { aggregateTypeRef: u, isCollectAggregation: p, LIST_HIT_POLICIES: o }, { DmnHitPolicy: c }] = await Promise.all([import("./KieDmnMarshaller-LGE63WDG-nfkpv8f4.js"), import("./DmnFactory-L7MABUC6-q2sr3grz.js"), import("./hitPolicyResult-CGCR73CW-jz89f1aa.js"), import("./DmnModelTypes-ATR7FVKZ-h8srwcxk.js")]), d = await n(e);
97
63
  if (d.status === "error")
98
64
  throw new N(d.reason);
99
- let l = d.document.definitions, g = l.drgElement ?? [], R = g.filter(W), O = g.filter(ae), _ = (s) => r(s.variable?.["@_name"], s["@_name"]), T = pe(l), j = (s) => !s["@_aggregation"] && o.has(s["@_hitPolicy"] ?? c.Unique), P = (s, a, m2) => {
100
- let f = m2["@_typeRef"] === undefined && a.output?.length === 1 && !j(a) ? s.variable?.["@_typeRef"] : undefined, y = f ?? m2["@_typeRef"], S = f === undefined ? [m2, a, s] : [s.variable, s], w = a["@_aggregation"];
65
+ let l = d.document.definitions, g = l.drgElement ?? [], R = g.filter(W), O = g.filter(ae), _ = (s) => r(s.variable?.["@_name"], s["@_name"]), T = pe(l), j = (s) => !s["@_aggregation"] && o.has(s["@_hitPolicy"] ?? c.Unique), P = (s, a, m) => {
66
+ let f = m["@_typeRef"] === undefined && a.output?.length === 1 && !j(a) ? s.variable?.["@_typeRef"] : undefined, y = f ?? m["@_typeRef"], S = f === undefined ? [m, a, s] : [s.variable, s], w = a["@_aggregation"];
101
67
  return a["@_hitPolicy"] === c.Collect && p(w) ? [u(w, { typeRef: y }) ?? "Any", S] : [y, S];
102
- }, B = (s, a, m2, f) => {
103
- let y = t({ id: m2["@_id"] ?? "", name: m2["@_name"], label: m2["@_label"] }, f);
104
- return { name: y, displayName: m2["@_label"] || y, ...T.argumentType(...P(s, a, m2), true), source: `=result.${y}` };
68
+ }, B = (s, a, m, f) => {
69
+ let y = t({ id: m["@_id"] ?? "", name: m["@_name"], label: m["@_label"] }, f);
70
+ return { name: y, displayName: m["@_label"] || y, ...T.argumentType(...P(s, a, m), true), source: `=result.${y}` };
105
71
  }, i = (s) => s.map((a) => ({ ...a, type: "jsonSchema", ...Y({ type: "array", items: L(a) }) })), D = (s) => {
106
72
  let a = k(s);
107
73
  if (a)
108
74
  return [ue(s, a, _(s), T)];
109
- let m2 = A2(s);
110
- if (!m2)
75
+ let m = A(s);
76
+ if (!m)
111
77
  return [];
112
- let f = (m2.output ?? []).map((S, w) => B(s, m2, S, w)), y = s["@_name"];
113
- return f.length !== 1 || m2.output?.[0]?.["@_name"]?.trim() || !y ? f : [{ ...f[0], name: y, displayName: m2.output?.[0]?.["@_label"] || y, source: `=result.${y}` }];
78
+ let f = (m.output ?? []).map((S, w) => B(s, m, S, w)), y = s["@_name"];
79
+ return f.length !== 1 || m.output?.[0]?.["@_name"]?.trim() || !y ? f : [{ ...f[0], name: y, displayName: m.output?.[0]?.["@_label"] || y, source: `=result.${y}` }];
114
80
  }, E = (s) => {
115
- let a = A2(s);
81
+ let a = A(s);
116
82
  return a && j(a) ? i(D(s)) : D(s);
117
83
  }, h = (s = () => true) => O.filter(s).map((a) => le(a, _(a), T)), b = (s) => {
118
- let a = s["@_name"] ?? "", m2 = A2(s), f = D(s), y = !!m2 && j(m2), S = (ee) => Object.fromEntries(ee.map((M) => [M.name, L(M)])), w = y && f.length > 1 ? { [a]: { type: "array", items: { type: "object", properties: S(f) }, [H]: true } } : S(y ? i(f) : f);
84
+ let a = s["@_name"] ?? "", m = A(s), f = D(s), y = !!m && j(m), S = (ee) => Object.fromEntries(ee.map((M) => [M.name, L(M)])), w = y && f.length > 1 ? { [a]: { type: "array", items: { type: "object", properties: S(f) }, [H]: true } } : S(y ? i(f) : f);
119
85
  return { name: a, displayName: a, type: "jsonSchema", source: `=result.${a}`, _jsonSchema: { type: "object", properties: w } };
120
86
  }, x = R.every((s) => !C(s) || !!s["@_name"]?.trim());
121
87
  return { definitions: l, decisions: R, declared: O, identifierOf: _, inputsFor: h, outputsOf: E, toKeyedOutput: b, keyable: x };
122
88
  }
123
- async function me(e, n = false) {
124
- let { decisions: t, inputsFor: r, outputsOf: u, toKeyedOutput: p, keyable: o } = await G(e), c = t.filter(C), d = n && o && c.length > 0, l = d ? c.map(p) : c.flatMap(u).filter((g, R, O) => O.findIndex((_) => _.name === g.name) === R);
125
- return { inputs: r(), outputs: l, ...d ? { decisionKeyed: true } : {} };
126
- }
127
89
  var X = (e) => ne(e.foreign ? "Any" : e.baseTypeRef ?? "");
128
90
  var z = (e) => {
129
91
  let n = e.recursive ? {} : e.components ? { type: "object", properties: Object.fromEntries(e.components.map((t) => [t.name, z(t.type)])) } : $(X(e));
130
92
  return e.chain.filter((t) => t.isCollection).reduce((t) => ({ type: "array", items: t }), n);
131
93
  };
132
94
  function pe(e) {
133
- let n = { itemDefinitions: A(e), namespace: e["@_namespace"], namespaces: m(e) }, t = (r, u) => J(n, r, I(u));
95
+ let n = { itemDefinitions: A2(e), namespace: e["@_namespace"], namespaces: m4(e) }, t = (r, u) => J2(n, r, I(u));
134
96
  return { argumentType: (r, u, p) => {
135
97
  let o = t(r, u);
136
98
  if (!o.components && !o.isCollection)
@@ -165,7 +127,7 @@ async function v(e, n = false) {
165
127
  if (!b || !W(b))
166
128
  return [];
167
129
  let x = k(b);
168
- return x ? [x.text?.__$$text ?? ""] : (A2(b)?.input ?? []).map((s) => s.inputExpression?.text?.__$$text ?? "");
130
+ return x ? [x.text?.__$$text ?? ""] : (A(b)?.input ?? []).map((s) => s.inputExpression?.text?.__$$text ?? "");
169
131
  });
170
132
  return (h) => {
171
133
  if (D.has(h["@_id"] ?? ""))
@@ -215,13 +177,8 @@ async function be(e, n, t = false) {
215
177
  return { entryPoints: u, entryPointsContent: JSON.stringify({ $schema: "https://cloud.uipath.com/draft/2024-12/entry-point", $id: "entry-points.json", entryPoints: u }, null, 2), bindingContent: fe, unreadable: p, entryPointsChanged: JSON.stringify(n?.entryPoints) !== JSON.stringify(u) };
216
178
  }
217
179
  export {
218
- I2 as DECISION_KEYED_SCHEMA_KEY,
219
180
  N as UnreadableDmnError,
220
- J2 as asDecisionKeyedSchema,
221
- be as buildBusinessRulePackagingFiles,
222
- ie as flatOutputSchema,
223
- me as readDmnArguments,
224
- v as readDmnCallableUnits
181
+ be as buildBusinessRulePackagingFiles
225
182
  };
226
183
 
227
- //# debugId=482C4346B02DE8D264756E2164756E21
184
+ //# debugId=1A8F1A5A49EA7AEC64756E2164756E21
package/dist/index.js CHANGED
@@ -1,17 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- metadata,
4
- registerCommands
5
- } from "./tool-5hek0atf.js";
6
2
  import {
7
3
  Command
8
- } from "./tool-wf2qkrye.js";
9
- import"./tool-1de529jm.js";
4
+ } from "./tool-cs8nyk0r.js";
5
+ import {
6
+ metadata2,
7
+ registerCommands2
8
+ } from "./tool-k55fs9aj.js";
10
9
 
11
10
  // src/index.ts
12
11
  var program = new Command;
13
- program.name(metadata.commandPrefix).description(metadata.description).version(metadata.version);
14
- await registerCommands(program);
12
+ program.name(metadata2.commandPrefix).description(metadata2.description).version(metadata2.version);
13
+ await registerCommands2(program);
15
14
  program.parse(process.argv);
16
15
 
17
- //# debugId=5A4157118AD704D364756E2164756E21
16
+ //# debugId=6AA0DD0944CC2D3B64756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __commonJS
3
- } from "./tool-1de529jm.js";
3
+ } from "./tool-epsr41wx.js";
4
4
 
5
5
  // ../../node_modules/jmespath/jmespath.js
6
6
  var require_jmespath = __commonJS(function(exports) {
@@ -1,5 +1,3 @@
1
- import"./tool-1de529jm.js";
2
-
3
1
  // ../../node_modules/js-yaml/dist/js-yaml.mjs
4
2
  function getDefaultExportFromCjs(x) {
5
3
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -3150,4 +3148,4 @@ export {
3150
3148
  types
3151
3149
  };
3152
3150
 
3153
- //# debugId=9FA8E718B2F80BEA64756E2164756E21
3151
+ //# debugId=41DC6971B94BC54964756E2164756E21
@@ -0,0 +1,71 @@
1
+ import"./tool-e23cj2jx.js";
2
+ import"./tool-cs8nyk0r.js";
3
+ import {
4
+ getSolutionAuthContext,
5
+ createResourceBuilderServices2,
6
+ getRemoteResourceClients2,
7
+ findCatalogEntityAsync2,
8
+ toResourceReference2,
9
+ exportResourceDefinitionAsync2,
10
+ readSpecEntryPoints2
11
+ } from "./tool-8cnhz30a.js";
12
+ import {
13
+ RulesCommandError2
14
+ } from "./tool-njnhj05q.js";
15
+ import {
16
+ createRulesApi2,
17
+ findRuleByName2
18
+ } from "./tool-mst6a4dr.js";
19
+ import"./tool-p7hqn93n.js";
20
+
21
+ // src/services/rule-catalog.ts
22
+ var BUSINESS_RULE_ENTITY_TYPE = "BusinessRule";
23
+ async function describeRuleAsync(name, folder) {
24
+ await getSolutionAuthContext({});
25
+ const { catalog, importer } = getRemoteResourceClients2(await createResourceBuilderServices2());
26
+ const entity = await findCatalogEntityAsync2(catalog, { name, entityTypes: [BUSINESS_RULE_ENTITY_TYPE] }, (e) => e.entityName?.toLowerCase() === name.toLowerCase() && e.folderKey?.toLowerCase() === folder.key.toLowerCase());
27
+ if (!entity?.entityKey) {
28
+ await findRuleByName2(await createRulesApi2(undefined, folder), name, folder);
29
+ throw new RulesCommandError2(`Business rule '${name}' is not in the resource catalog for folder '${folder.path}' yet.`, "not_found", "The rule exists in Orchestrator but the resource catalog does not list it yet, which is normal right after a deploy. Run the command again shortly.", "RetryAfter60Seconds");
30
+ }
31
+ const definition = await exportResourceDefinitionAsync2(importer, toResourceReference2(entity));
32
+ return readEntryPoints(definition?.spec, name);
33
+ }
34
+ async function listRulesAcrossFoldersAsync(limit, offset) {
35
+ await getSolutionAuthContext({});
36
+ const { catalog } = getRemoteResourceClients2(await createResourceBuilderServices2());
37
+ const rows = [];
38
+ let pageCursor;
39
+ do {
40
+ const page = await catalog.searchFolderEntities({
41
+ entityTypes: [BUSINESS_RULE_ENTITY_TYPE],
42
+ pageSize: 100,
43
+ pageCursor
44
+ });
45
+ rows.push(...(page.items ?? []).filter((e) => e.entityKey && e.entityName));
46
+ pageCursor = page.nextPage ?? undefined;
47
+ } while (pageCursor && rows.length <= offset + limit);
48
+ return {
49
+ rows: rows.slice(offset, offset + limit).map((entity) => ({
50
+ Key: entity.entityKey ?? "",
51
+ Name: entity.entityName ?? "",
52
+ FolderPath: entity.fullyQualifiedName ?? "",
53
+ FolderKey: entity.folderKey ?? "",
54
+ Description: entity.entityDescription ?? ""
55
+ })),
56
+ hasMore: rows.length > offset + limit
57
+ };
58
+ }
59
+ function readEntryPoints(spec, name) {
60
+ const entryPoints = readSpecEntryPoints2(spec);
61
+ if (!entryPoints) {
62
+ throw new RulesCommandError2(`Business rule '${name}' has no argument contract on its resource.`, "configuration_error", "Redeploy the rule from its solution with 'uip solution publish' and 'uip solution deploy run' so its package carries entry-points.json. If it still has no contract, contact your tenant administrator.");
63
+ }
64
+ return entryPoints;
65
+ }
66
+ export {
67
+ describeRuleAsync,
68
+ listRulesAcrossFoldersAsync
69
+ };
70
+
71
+ //# debugId=20E2B7D41910710264756E2164756E21
@@ -0,0 +1,13 @@
1
+ import {
2
+ RulesCommandError2,
3
+ isJsonObject2,
4
+ reportRulesFailure2
5
+ } from "./tool-njnhj05q.js";
6
+ import"./tool-cs8nyk0r.js";
7
+ export {
8
+ RulesCommandError2 as RulesCommandError,
9
+ isJsonObject2 as isJsonObject,
10
+ reportRulesFailure2 as reportRulesFailure
11
+ };
12
+
13
+ //# debugId=1ABE9E632E07ECEB64756E2164756E21
@@ -1,34 +1,33 @@
1
+ import {
2
+ getAuthContext,
3
+ PersonalWorkspacesApi,
4
+ createApiClient
5
+ } from "./tool-e23cj2jx.js";
6
+ import {
7
+ getFileSystem,
8
+ catchError,
9
+ logger,
10
+ OutputFormatter
11
+ } from "./tool-cs8nyk0r.js";
1
12
  import {
2
13
  buildSolutionPackageFromDir,
3
14
  uploadOrOverwriteSolution
4
- } from "./tool-f04pwp3c.js";
15
+ } from "./tool-5exp6zh7.js";
16
+ import {
17
+ RulesCommandError2,
18
+ isJsonObject2
19
+ } from "./tool-njnhj05q.js";
20
+ import {
21
+ assertOneFolderOption2,
22
+ resolveRequiredFolder2
23
+ } from "./tool-mst6a4dr.js";
5
24
  import {
6
25
  findSolutionFile,
7
26
  updateSolutionFile
8
- } from "./tool-1pccj6q3.js";
27
+ } from "./tool-p7hqn93n.js";
9
28
  import {
10
29
  readRulesProjectNameAsync
11
- } from "./tool-gkbr01gc.js";
12
- import {
13
- assertOneFolderOption,
14
- resolveRequiredFolder
15
- } from "./tool-fbmxx07c.js";
16
- import {
17
- PersonalWorkspacesApi,
18
- createApiClient,
19
- getAuthContext
20
- } from "./tool-txp5th7j.js";
21
- import {
22
- RulesCommandError,
23
- isJsonObject
24
- } from "./tool-t4k013ex.js";
25
- import {
26
- OutputFormatter,
27
- catchError,
28
- getFileSystem,
29
- logger
30
- } from "./tool-wf2qkrye.js";
31
- import"./tool-1de529jm.js";
30
+ } from "./tool-fkppxa9f.js";
32
31
 
33
32
  // src/services/rules-engine-client.ts
34
33
  var DEBUG_EVALUATE_PATH = "/v1/business-rules/debug/evaluate";
@@ -65,7 +64,7 @@ async function postDebugEvaluate(config, request, timeoutSeconds) {
65
64
  signal: AbortSignal.timeout(timeoutSeconds * 1000)
66
65
  }));
67
66
  if (fetchError?.name === "TimeoutError") {
68
- throw new RulesCommandError(`The rules engine did not answer within ${timeoutSeconds} seconds.`, "timeout", "Run the command again, or pass a larger --timeout.", "RetryLater");
67
+ throw new RulesCommandError2(`The rules engine did not answer within ${timeoutSeconds} seconds.`, "timeout", "Run the command again, or pass a larger --timeout.", "RetryLater");
69
68
  }
70
69
  if (fetchError) {
71
70
  throw fetchError;
@@ -78,15 +77,15 @@ async function postDebugEvaluate(config, request, timeoutSeconds) {
78
77
  async function engineFailure(response, tenantName) {
79
78
  const text = await response.text().catch(() => "");
80
79
  if (response.status === 404 && /businessrules not found in organization/i.test(text)) {
81
- return new RulesCommandError(`Business Rules is not available on tenant '${tenantName}': it is not enabled there, or not offered in the tenant's region.`, "configuration_error", "Switch to a tenant that has Business Rules with 'uip login tenant set <tenant-name>', or ask your UiPath representative to enable it for this tenant.", "RetryWillNotFix", { httpStatus: 404 });
80
+ return new RulesCommandError2(`Business Rules is not available on tenant '${tenantName}': it is not enabled there, or not offered in the tenant's region.`, "configuration_error", "Switch to a tenant that has Business Rules with 'uip login tenant set <tenant-name>', or ask your UiPath representative to enable it for this tenant.", "RetryWillNotFix", { httpStatus: 404 });
82
81
  }
83
82
  const [, body] = catchError(() => JSON.parse(text));
84
- const error = isJsonObject(body) && isJsonObject(body.error) ? body.error : {};
83
+ const error = isJsonObject2(body) && isJsonObject2(body.error) ? body.error : {};
85
84
  if (error.code === "PREVIEW_NOT_ENABLED") {
86
- return new RulesCommandError("Business Rules is a preview feature and is not enabled for your organization.", "configuration_error", "Ask your UiPath representative to enroll your organization in the Business Rules preview.", "RetryWillNotFix", { httpStatus: response.status, errorCode: error.code });
85
+ return new RulesCommandError2("Business Rules is a preview feature and is not enabled for your organization.", "configuration_error", "Ask your UiPath representative to enroll your organization in the Business Rules preview.", "RetryWillNotFix", { httpStatus: response.status, errorCode: error.code });
87
86
  }
88
87
  if (error.code === "STUDIO_FORBIDDEN") {
89
- return new RulesCommandError("Studio Web did not let the rules engine read the uploaded project.", "permission_denied", "Check in Studio Web that your account can open the uploaded solution.");
88
+ return new RulesCommandError2("Studio Web did not let the rules engine read the uploaded project.", "permission_denied", "Check in Studio Web that your account can open the uploaded solution.");
90
89
  }
91
90
  const message = typeof error.message === "string" ? error.message : "The rules engine request failed.";
92
91
  return new RulesEngineHttpError(response.status, typeof error.code === "string" ? `${message} (${error.code})` : message);
@@ -94,7 +93,7 @@ async function engineFailure(response, tenantName) {
94
93
 
95
94
  // src/services/rules-debug-service.ts
96
95
  async function debugRuleProjectAsync(projectPath, options) {
97
- assertOneFolderOption(options);
96
+ assertOneFolderOption2(options);
98
97
  const input = await parseInput(options.inputs);
99
98
  const fs = getFileSystem();
100
99
  const projectDir = fs.path.resolve(projectPath);
@@ -121,7 +120,7 @@ async function debugRuleProjectAsync(projectPath, options) {
121
120
  }
122
121
  const project = upload.projects.find((p) => p.name === projectName);
123
122
  if (!project) {
124
- throw new RulesCommandError(`Studio Web returned no project named '${projectName}' for the uploaded solution.`, "not_found", "Check that the project is listed in the solution's .uipx, then run the command again.");
123
+ throw new RulesCommandError2(`Studio Web returned no project named '${projectName}' for the uploaded solution.`, "not_found", "Check that the project is listed in the solution's .uipx, then run the command again.");
125
124
  }
126
125
  logger.info(`Evaluating against Studio Web project ${project.id}...`);
127
126
  const response = await evaluateRuleDebugAsync({ ...config, folderKey }, { projectId: project.id, input }, options.timeout);
@@ -139,11 +138,11 @@ async function parseInput(raw) {
139
138
  const filePath = raw.startsWith("@") ? raw.slice(1) : undefined;
140
139
  const [readError, text] = filePath === undefined ? [undefined, raw] : await catchError(getFileSystem().readFile(filePath, "utf-8"));
141
140
  if (readError || text === null) {
142
- throw new RulesCommandError(`Input file '${filePath}' could not be read: ${readError?.message ?? "file not found"}.`, "invalid_argument", "Pass --inputs as a JSON object or @file.json pointing at an existing file.");
141
+ throw new RulesCommandError2(`Input file '${filePath}' could not be read: ${readError?.message ?? "file not found"}.`, "invalid_argument", "Pass --inputs as a JSON object or @file.json pointing at an existing file.");
143
142
  }
144
143
  const [parseError, parsed] = catchError(() => JSON.parse(text));
145
- if (parseError || !isJsonObject(parsed)) {
146
- throw new RulesCommandError(parseError ? `--inputs is not valid JSON: ${parseError.message}` : "--inputs must be a JSON object of input values.", "invalid_argument", `Pass --inputs '{"<input>": <value>}' or @file.json holding one such object.`);
144
+ if (parseError || !isJsonObject2(parsed)) {
145
+ throw new RulesCommandError2(parseError ? `--inputs is not valid JSON: ${parseError.message}` : "--inputs must be a JSON object of input values.", "invalid_argument", `Pass --inputs '{"<input>": <value>}' or @file.json holding one such object.`);
147
146
  }
148
147
  return parsed;
149
148
  }
@@ -153,14 +152,14 @@ function studioWebDesignerUrl(baseUrl, organizationName, projectId, solutionId)
153
152
  async function readRulesProjectName(projectDir) {
154
153
  const name = await readRulesProjectNameAsync(projectDir);
155
154
  if (!name) {
156
- throw new RulesCommandError(`${projectDir}/project.uiproj has no Name.`, "invalid_argument", "Set Name in project.uiproj to the rules project's name, as 'uip rules init' writes it.");
155
+ throw new RulesCommandError2(`${projectDir}/project.uiproj has no Name.`, "invalid_argument", "Set Name in project.uiproj to the rules project's name, as 'uip rules init' writes it.");
157
156
  }
158
157
  return name;
159
158
  }
160
159
  async function assertSolutionFolder(solutionDir) {
161
160
  const [, entries] = await catchError(getFileSystem().readdir(solutionDir));
162
161
  if (!entries?.some((entry) => entry.endsWith(".uipx"))) {
163
- throw new RulesCommandError(`${solutionDir} holds no .uipx, so the rules project is not inside a solution.`, "invalid_argument", "Pass a rules project that sits directly inside its solution folder, as 'uip rules init' creates it.");
162
+ throw new RulesCommandError2(`${solutionDir} holds no .uipx, so the rules project is not inside a solution.`, "invalid_argument", "Pass a rules project that sits directly inside its solution folder, as 'uip rules init' creates it.");
164
163
  }
165
164
  }
166
165
  async function loggedInContext(loginValidity) {
@@ -183,12 +182,12 @@ async function loggedInContext(loginValidity) {
183
182
  }
184
183
  async function evaluationFolderKey(options) {
185
184
  if (options.folderPath !== undefined || options.folderKey !== undefined) {
186
- return (await resolveRequiredFolder(options)).key;
185
+ return (await resolveRequiredFolder2(options)).key;
187
186
  }
188
187
  const api = await createApiClient(PersonalWorkspacesApi, {});
189
188
  const personal = await api.personalWorkspacesGetPersonalWorkspace();
190
189
  if (!personal?.key) {
191
- throw new RulesCommandError("Could not find your personal workspace to run the rules engine in.", "invalid_argument", "Pass --folder-path <path> or --folder-key <key> to run in a folder you can read.");
190
+ throw new RulesCommandError2("Could not find your personal workspace to run the rules engine in.", "invalid_argument", "Pass --folder-path <path> or --folder-key <key> to run in a folder you can read.");
192
191
  }
193
192
  return personal.key;
194
193
  }
@@ -196,4 +195,4 @@ export {
196
195
  debugRuleProjectAsync
197
196
  };
198
197
 
199
- //# debugId=4DAA15188929FF8E64756E2164756E21
198
+ //# debugId=2CD8911C068FFEEA64756E2164756E21
@@ -1,25 +1,22 @@
1
- import"./tool-f04pwp3c.js";
1
+ import {
2
+ getFileSystem,
3
+ catchError
4
+ } from "./tool-cs8nyk0r.js";
5
+ import"./tool-5exp6zh7.js";
6
+ import"./tool-njnhj05q.js";
2
7
  import {
3
8
  prepareProjectLocation,
4
9
  tryRegisterProjectInParentSolution
5
- } from "./tool-1pccj6q3.js";
10
+ } from "./tool-p7hqn93n.js";
6
11
  import {
7
- BINDINGS_FILE,
8
12
  ENTRY_POINTS_FILE,
13
+ BINDINGS_FILE,
9
14
  buildRuleEntryPointsAsync
10
- } from "./tool-gkbr01gc.js";
11
- import"./tool-t4k013ex.js";
12
- import {
13
- catchError,
14
- getFileSystem
15
- } from "./tool-wf2qkrye.js";
16
- import {
17
- __require
18
- } from "./tool-1de529jm.js";
15
+ } from "./tool-fkppxa9f.js";
19
16
 
20
17
  // src/services/project-artifacts.ts
21
18
  async function ensureProjectArtifacts(args) {
22
- const { addProjectArtifactsToSolutionAsync } = await import("./index-cpm94vee.js");
19
+ const { addProjectArtifactsToSolutionAsync } = await import("./index-xaxgkfez.js");
23
20
  return addProjectArtifactsToSolutionAsync(args);
24
21
  }
25
22
 
@@ -29,7 +26,7 @@ var SEEDED_DMN_FILE = "Business rule.dmn";
29
26
  var formatJson = (value) => `${JSON.stringify(value, null, 2)}
30
27
  `;
31
28
  async function createSeededRuleFilesAsync(ruleName) {
32
- const { createNewBusinessRuleDmn } = await import("./constants-cnn0jfw6.js");
29
+ const { createNewBusinessRuleDmn } = await import("./constants-1sdwfz26.js");
33
30
  const dmn = createNewBusinessRuleDmn();
34
31
  const packaging = await buildRuleEntryPointsAsync([{ name: SEEDED_DMN_FILE, contents: dmn }], undefined, ruleName);
35
32
  return {
@@ -97,8 +94,7 @@ async function maybeGenerateProjectArtifacts(registration, projectName) {
97
94
  });
98
95
  }
99
96
  export {
100
- createSeededRuleFilesAsync,
101
97
  rulesInitAsync
102
98
  };
103
99
 
104
- //# debugId=8300AFD86C3DD0AD64756E2164756E21
100
+ //# debugId=73D0149B38D31B8564756E2164756E21
@@ -1,18 +1,17 @@
1
1
  import {
2
- BINDINGS_FILE,
3
- ENTRY_POINTS_FILE,
4
- buildRuleEntryPointsAsync,
5
- readRuleProjectAsync
6
- } from "./tool-gkbr01gc.js";
2
+ getFileSystem,
3
+ catchError,
4
+ extractErrorMessageSync
5
+ } from "./tool-cs8nyk0r.js";
7
6
  import {
8
- RulesCommandError
9
- } from "./tool-t4k013ex.js";
7
+ RulesCommandError2
8
+ } from "./tool-njnhj05q.js";
10
9
  import {
11
- catchError,
12
- extractErrorMessageSync,
13
- getFileSystem
14
- } from "./tool-wf2qkrye.js";
15
- import"./tool-1de529jm.js";
10
+ ENTRY_POINTS_FILE,
11
+ BINDINGS_FILE,
12
+ readRuleProjectAsync,
13
+ buildRuleEntryPointsAsync
14
+ } from "./tool-fkppxa9f.js";
16
15
 
17
16
  // src/services/rules-refresh-service.ts
18
17
  async function refreshRuleProjectAsync(projectPath) {
@@ -22,7 +21,7 @@ async function refreshRuleProjectAsync(projectPath) {
22
21
  if (packaging.unreadable.length > 0) {
23
22
  const names = packaging.unreadable.map((rule) => rule.name).join(", ");
24
23
  const reasons = packaging.unreadable.map((rule) => `${rule.name}: ${extractErrorMessageSync(rule.error)}`).join(" ");
25
- throw new RulesCommandError(`Could not read ${names}, so no package file was written. ${reasons}`, "invalid_argument", "Fix the .dmn file, or open the project in Studio Web to see what it rejects, then run 'uip rules refresh' again.");
24
+ throw new RulesCommandError2(`Could not read ${names}, so no package file was written. ${reasons}`, "invalid_argument", "Fix the .dmn file, or open the project in Studio Web to see what it rejects, then run 'uip rules refresh' again.");
26
25
  }
27
26
  const bindingsPath = fs.path.join(project.projectDir, BINDINGS_FILE);
28
27
  const planned = [
@@ -63,4 +62,4 @@ export {
63
62
  refreshRuleProjectAsync
64
63
  };
65
64
 
66
- //# debugId=9DC9E1E1A7863AFA64756E2164756E21
65
+ //# debugId=8C02B24DF8C203E864756E2164756E21
@@ -1,13 +1,10 @@
1
+ import"./tool-cs8nyk0r.js";
2
+ import"./tool-njnhj05q.js";
1
3
  import {
2
4
  ENTRY_POINTS_FILE,
3
- buildRuleEntryPointsAsync,
4
- readRuleProjectAsync
5
- } from "./tool-gkbr01gc.js";
6
- import"./tool-t4k013ex.js";
7
- import"./tool-wf2qkrye.js";
8
- import {
9
- __require
10
- } from "./tool-1de529jm.js";
5
+ readRuleProjectAsync,
6
+ buildRuleEntryPointsAsync
7
+ } from "./tool-fkppxa9f.js";
11
8
 
12
9
  // src/services/rules-validate-service.ts
13
10
  async function validateRuleProjectAsync(projectPath) {
@@ -40,10 +37,10 @@ async function validateDmnFileAsync(file) {
40
37
  { importDmnDocument },
41
38
  { UnreadableDmnError }
42
39
  ] = await Promise.all([
43
- import("./index-ybrgtfsg.js"),
44
- import("./index-52h8rpew.js"),
45
- import("./index-x9msn1dj.js"),
46
- import("./index-bhjt1h5c.js")
40
+ import("./index-y5yffb2s.js"),
41
+ import("./index-egzwtc07.js"),
42
+ import("./index-z4kt2kt6.js"),
43
+ import("./index-zeszs1ra.js")
47
44
  ]);
48
45
  const diagnostics = await validateDmnDocument(file.contents);
49
46
  const imported = diagnostics.some((d) => d.code === "DMN_DOCUMENT_UNREADABLE") ? await importDmnDocument(file.contents) : undefined;
@@ -60,4 +57,4 @@ export {
60
57
  validateRuleProjectAsync
61
58
  };
62
59
 
63
- //# debugId=815CA3A34812F29264756E2164756E21
60
+ //# debugId=4E55FD726F10B69064756E2164756E21