@uipath/rules-tool 1.206.0-preview.303 → 1.207.0-preview.305

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 (50) hide show
  1. package/dist/DmnFactory-2Z66XPBB-dcse77vg.js +10 -0
  2. package/dist/DmnModelTypes-QISEK3CY-vth5tgqd.js +8 -0
  3. package/dist/KieDmnMarshaller-KLYKOHUQ-jae862c0.js +8 -0
  4. package/dist/THIRD-PARTY-NOTICES.md +6 -6
  5. package/dist/{business-rules-zfzwr08c.js → business-rules-4b4d9pw6.js} +4 -4
  6. package/dist/{constants-1sdwfz26.js → constants-yt6m7vkn.js} +12 -12
  7. package/dist/{first-party-service-ej32b6j2.js → first-party-service-r63v6skt.js} +1 -1
  8. package/dist/hitPolicyResult-2NPUZW2E-rddfkhb2.js +14 -0
  9. package/dist/{index-y5yffb2s.js → index-189nh3zq.js} +642 -513
  10. package/dist/{index-88sps467.js → index-g955264n.js} +7 -5
  11. package/dist/index-jm0j1yn2.js +212 -0
  12. package/dist/{index-s9wmt93c.js → index-thn9n1n9.js} +1 -1
  13. package/dist/index-xvy3d6qz.js +8 -0
  14. package/dist/index.js +2 -2
  15. package/dist/{rule-catalog-780050xk.js → rule-catalog-0zntgf3s.js} +34 -10
  16. package/dist/rules-command-error-5jq3z0ny.js +15 -0
  17. package/dist/{rules-debug-service-gjmn59w4.js → rules-debug-service-cfaqvnep.js} +16 -9
  18. package/dist/{rules-init-service-najk4r7p.js → rules-init-service-vhd0gzmd.js} +7 -7
  19. package/dist/{rules-refresh-service-x3gfnfqt.js → rules-refresh-service-r7fpbbfv.js} +3 -3
  20. package/dist/{rules-validate-service-e47hgykv.js → rules-validate-service-jrw7c1q9.js} +8 -10
  21. package/dist/{solution-definition-helper-trxp0zbj.js → solution-definition-helper-s5v427j0.js} +1 -1
  22. package/dist/{tool-zs98h1p2.js → tool-0r1ykkjf.js} +12 -5
  23. package/dist/{tool-yfaf9b8c.js → tool-19fj7ema.js} +36 -9
  24. package/dist/{tool-sjp6fvze.js → tool-2cxm18e8.js} +2 -2
  25. package/dist/tool-2grmcreg.js +117 -0
  26. package/dist/{tool-b475et36.js → tool-46g75ed0.js} +3 -3
  27. package/dist/{tool-syavphgt.js → tool-5sgkktdb.js} +287 -139
  28. package/dist/{tool-7ekab7v3.js → tool-a1wk2tqc.js} +28 -26
  29. package/dist/{tool-jzdt6z77.js → tool-c0peefw8.js} +7 -6
  30. package/dist/tool-e83bfqmj.js +192 -0
  31. package/dist/{tool-3755q59j.js → tool-fsmgxvqa.js} +189 -15
  32. package/dist/tool-fv5xtqv5.js +736 -0
  33. package/dist/{tool-vqm4apm6.js → tool-jykscmfk.js} +206 -203
  34. package/dist/{tool-0tbve332.js → tool-kmzhfjw8.js} +64 -10
  35. package/dist/tool-q02dmnzm.js +74 -0
  36. package/dist/{tool-93hqhaj3.js → tool-q3jw2emw.js} +100 -96
  37. package/dist/tool.js +2 -2
  38. package/package.json +2 -2
  39. package/dist/DmnFactory-L7MABUC6-q2sr3grz.js +0 -10
  40. package/dist/DmnModelTypes-ATR7FVKZ-h8srwcxk.js +0 -8
  41. package/dist/KieDmnMarshaller-LGE63WDG-nfkpv8f4.js +0 -8
  42. package/dist/hitPolicyResult-CGCR73CW-jz89f1aa.js +0 -12
  43. package/dist/index-egzwtc07.js +0 -19
  44. package/dist/index-z4kt2kt6.js +0 -8
  45. package/dist/index-zeszs1ra.js +0 -184
  46. package/dist/rules-command-error-2x1vm0wt.js +0 -13
  47. package/dist/tool-2nmqvfmt.js +0 -26
  48. package/dist/tool-89e90qrm.js +0 -777
  49. package/dist/tool-m59a481n.js +0 -49
  50. package/dist/tool-sbtf80ft.js +0 -218
@@ -5,12 +5,14 @@ import {
5
5
  findCatalogEntityAsync2,
6
6
  toResourceReference2,
7
7
  exportResourceDefinitionAsync2,
8
+ ResourceExportError2,
8
9
  readSpecEntryPoints2
9
- } from "./tool-yfaf9b8c.js";
10
- import"./tool-0tbve332.js";
11
- import"./tool-3755q59j.js";
12
- import"./tool-syavphgt.js";
10
+ } from "./tool-19fj7ema.js";
11
+ import"./tool-kmzhfjw8.js";
12
+ import"./tool-fsmgxvqa.js";
13
+ import"./tool-5sgkktdb.js";
13
14
  export {
15
+ ResourceExportError2 as ResourceExportError,
14
16
  addProjectArtifactsToSolutionAsync2 as addProjectArtifactsToSolutionAsync,
15
17
  createResourceBuilderServices2 as createResourceBuilderServices,
16
18
  exportResourceDefinitionAsync2 as exportResourceDefinitionAsync,
@@ -20,4 +22,4 @@ export {
20
22
  toResourceReference2 as toResourceReference
21
23
  };
22
24
 
23
- //# debugId=E74EC712ED5645CE64756E2164756E21
25
+ //# debugId=C4E74E7249593BDD64756E2164756E21
@@ -0,0 +1,212 @@
1
+ import {
2
+ v4_default,
3
+ E2,
4
+ y
5
+ } from "./tool-2grmcreg.js";
6
+ import {
7
+ u,
8
+ j2,
9
+ F,
10
+ N3,
11
+ se
12
+ } from "./tool-e83bfqmj.js";
13
+
14
+ // ../../node_modules/@uipath/dmn-editor-utils/dist/entry-points/index.js
15
+ function se2(e) {
16
+ switch (e.toLowerCase()) {
17
+ case "boolean":
18
+ return "boolean";
19
+ case "number":
20
+ case "integer":
21
+ case "long":
22
+ case "double":
23
+ case "decimal":
24
+ return "number";
25
+ case "date":
26
+ return "date";
27
+ case "time":
28
+ return "time";
29
+ case "date and time":
30
+ case "datetime":
31
+ return "datetime";
32
+ case "array":
33
+ return "array";
34
+ case "any":
35
+ case "object":
36
+ return "object";
37
+ default:
38
+ return "string";
39
+ }
40
+ }
41
+ var re = { date: { type: "string", format: "date" }, datetime: { type: "string", format: "date-time" }, time: { type: "string", format: "time" } };
42
+ var N = (e) => re[e] ?? (e === "array" ? { type: "array", items: {} } : { type: e });
43
+ var Y = (e) => e._jsonSchema ?? N(e.type);
44
+ var W = (e) => {
45
+ let n = e.type === "array" ? e.items?.type : undefined;
46
+ return { _jsonSchema: e, ...typeof n == "string" ? { subType: n } : {} };
47
+ };
48
+ var k = "x-uipath-decision-keyed";
49
+ var G = "x-uipath-rows";
50
+ var ue = { "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." };
51
+ var A = class extends Error {
52
+ constructor(t) {
53
+ super(ue[t] ?? "The rule could not be read.");
54
+ this.reason = t;
55
+ this.name = "UnreadableDmnError";
56
+ }
57
+ };
58
+ var J = (e) => e.__$$element === "decision";
59
+ var w = (e) => e.expression?.__$$element === "decisionTable" ? e.expression : undefined;
60
+ var I = (e) => e.expression?.__$$element === "literalExpression" ? e.expression : undefined;
61
+ var $ = (e) => !!w(e) || !!I(e);
62
+ var ce = (e, n, t, s) => ({ name: t, displayName: e["@_label"] || t, ...s.argumentType(...pe(e, n), true), source: `=result.${t}` });
63
+ var pe = (e, n) => n["@_typeRef"] === undefined ? [e.variable?.["@_typeRef"], [e.variable, e]] : [n["@_typeRef"], [n, e]];
64
+ var le = (e, n, t, s) => ({ name: n, displayName: e["@_name"] || e.variable?.["@_name"] || "", ...t.argumentType(...me(e, s), false), required: true });
65
+ var me = (e, n) => e.variable?.["@_typeRef"] === undefined && n ? n : [e.variable?.["@_typeRef"], [e.variable, e]];
66
+ var de = (e, n) => {
67
+ let t = new Map;
68
+ for (let s of e) {
69
+ let o = w(s);
70
+ for (let m of o?.input ?? []) {
71
+ let a = m.inputExpression, u = F(m), g = a?.["@_typeRef"];
72
+ if (!u || g === undefined)
73
+ continue;
74
+ let l = [g, [a, m, o, s]], d = JSON.stringify(n.argumentType(...l, false)), D = t.get(u);
75
+ D === undefined ? t.set(u, { hint: l, type: d }) : D?.type !== d && t.set(u, null);
76
+ }
77
+ }
78
+ return new Map([...t].flatMap(([s, o]) => o ? [[s, o.hint]] : []));
79
+ };
80
+ async function z(e) {
81
+ let [{ importDmnDocument: n }, { outputArgumentName: t, resolvedIdentifier: s }, { aggregateTypeRef: o, answersWithList: m, inheritedOutputTypeRef: a, isCollectAggregation: u }, { DmnHitPolicy: g }] = await Promise.all([import("./KieDmnMarshaller-KLYKOHUQ-jae862c0.js"), import("./DmnFactory-2Z66XPBB-dcse77vg.js"), import("./hitPolicyResult-2NPUZW2E-rddfkhb2.js"), import("./DmnModelTypes-QISEK3CY-vth5tgqd.js")]), l = await n(e);
82
+ if (l.status === "error")
83
+ throw new A(l.reason);
84
+ let d = l.document.definitions, D = y(d), O = E2(d), b = (r) => s(r.variable?.["@_name"], r["@_name"]), R = fe(d), P = (r, i, p) => {
85
+ let y = p["@_typeRef"] === undefined ? a(R.context, d, r, i.output?.length ?? 0, m(i)) : undefined, f = y?.typeRef ?? p["@_typeRef"], S = y?.enclosing ?? [p, i, r], x = i["@_aggregation"];
86
+ return i["@_hitPolicy"] === g.Collect && u(x) ? [o(x, { typeRef: f }) ?? "Any", S] : [f, S];
87
+ }, C = (r, i, p, y) => {
88
+ let f = t({ id: p["@_id"] ?? "", name: p["@_name"], label: p["@_label"] }, y);
89
+ return { name: f, displayName: p["@_label"] || f, ...R.argumentType(...P(r, i, p), true), source: `=result.${f}` };
90
+ }, E = (r) => r.map((i) => ({ ...i, type: "jsonSchema", ...W({ type: "array", items: Y(i) }) })), j = (r) => {
91
+ let i = I(r);
92
+ if (i)
93
+ return [ce(r, i, b(r), R)];
94
+ let p = w(r);
95
+ if (!p)
96
+ return [];
97
+ let y = (p.output ?? []).map((S, x) => C(r, p, S, x)), f = r["@_name"];
98
+ return y.length !== 1 || p.output?.[0]?.["@_name"]?.trim() || !f ? y : [{ ...y[0], name: f, displayName: p.output?.[0]?.["@_label"] || f, source: `=result.${f}` }];
99
+ }, c = (r) => {
100
+ let i = w(r);
101
+ return i && m(i) ? E(j(r)) : j(r);
102
+ }, h = (r = () => true, i = D) => {
103
+ let p = de(i, R);
104
+ return O.filter(r).map((y) => {
105
+ let f = b(y);
106
+ return le(y, f, R, p.get(f));
107
+ });
108
+ }, _ = (r) => {
109
+ let i = r["@_name"] ?? "", p = w(r), y = j(r), f = !!p && m(p), S = (te) => Object.fromEntries(te.map((v) => [v.name, Y(v)])), x = f && y.length > 1 ? { [i]: { type: "array", items: { type: "object", properties: S(y) }, [G]: true } } : S(f ? E(y) : y);
110
+ return { name: i, displayName: i, type: "jsonSchema", source: `=result.${i}`, _jsonSchema: { type: "object", properties: x } };
111
+ }, T = D.every((r) => !$(r) || !!r["@_name"]?.trim());
112
+ return { definitions: d, decisions: D, declared: O, identifierOf: b, inputsFor: h, outputsOf: c, toKeyedOutput: _, keyable: T };
113
+ }
114
+ var Q = (e) => se2(e.foreign ? "Any" : e.baseTypeRef ?? "");
115
+ var V = (e) => {
116
+ let n = e.recursive ? {} : e.components ? { type: "object", properties: Object.fromEntries(e.components.map((t) => [t.name, V(t.type)])) } : N(Q(e));
117
+ return e.chain.filter((t) => t.isCollection).reduce((t) => ({ type: "array", items: t }), n);
118
+ };
119
+ function fe(e) {
120
+ let n = { itemDefinitions: j2(e), namespace: e["@_namespace"], namespaces: u(e) }, t = (s, o) => se(n, s, N3(o));
121
+ return { context: n, argumentType: (s, o, m) => {
122
+ let a = t(s, o);
123
+ if (!a.components && !a.isCollection)
124
+ return { type: Q(a) };
125
+ let u = V(a);
126
+ return { type: m ? "jsonSchema" : u.type === "array" ? "array" : "object", ...W(u) };
127
+ } };
128
+ }
129
+ var Z = (e) => e?.startsWith("#") ? e.slice(1) : e || undefined;
130
+ var ge = (e, n) => new RegExp(`(^|[^\\w.$])${n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}([^\\w$]|$)`).test(e);
131
+ function De(e, n) {
132
+ let t = new Set([e]), s = [e];
133
+ for (;s.length > 0; ) {
134
+ let o = n.get(s.shift() ?? "");
135
+ if (!o)
136
+ continue;
137
+ let m = [...(o.informationRequirement ?? []).flatMap((a) => [a.requiredInput?.["@_href"], a.requiredDecision?.["@_href"]]), ...(o.knowledgeRequirement ?? []).map((a) => a.requiredKnowledge?.["@_href"])];
138
+ for (let a of m) {
139
+ let u = Z(a);
140
+ !u || t.has(u) || (t.add(u), s.push(u));
141
+ }
142
+ }
143
+ return t;
144
+ }
145
+ async function M(e, n = false) {
146
+ let { definitions: t, decisions: s, declared: o, identifierOf: m, inputsFor: a, outputsOf: u, toKeyedOutput: g, keyable: l } = await z(e), d = n && l, D = new Map([...s, ...o].flatMap((c) => c["@_id"] ? [[c["@_id"], c]] : [])), O = new Set(s.flatMap((c) => (c.informationRequirement ?? []).flatMap((h) => {
147
+ let _ = Z(h.requiredDecision?.["@_href"]);
148
+ return _ ? [_] : [];
149
+ }))), b = [...s.filter((c) => !O.has(c["@_id"] ?? "")), ...s.filter((c) => O.has(c["@_id"] ?? ""))], R = b.map((c) => De(c["@_id"] ?? "", D)), P = b.map((c, h) => {
150
+ let _ = R[h], T = [..._].flatMap((r) => {
151
+ let i = D.get(r);
152
+ if (!i || !J(i))
153
+ return [];
154
+ let p = I(i);
155
+ return p ? [p.text?.__$$text ?? ""] : (w(i)?.input ?? []).map((y) => y.inputExpression?.text?.__$$text ?? "");
156
+ });
157
+ return (r) => {
158
+ if (_.has(r["@_id"] ?? ""))
159
+ return true;
160
+ let i = m(r);
161
+ return !!i && T.some((p) => ge(p, i));
162
+ };
163
+ }), C = new Set(o.filter((c) => P.some((h) => h(c)))), E = b.flatMap((c, h) => {
164
+ if (!$(c))
165
+ return [];
166
+ let _ = (T) => P[h](T) || !C.has(T);
167
+ return [{ id: c["@_id"] ?? "", name: c["@_label"] ?? c["@_name"] ?? "", inputs: a(_, [...R[h]].flatMap((T) => {
168
+ let r = D.get(T);
169
+ return r && J(r) ? [r] : [];
170
+ })), outputs: d ? [g(c)] : u(c), ...d ? { decisionKeyed: true } : {} }];
171
+ });
172
+ return !d || E.length < 2 ? E : [{ name: t["@_label"] ?? t["@_name"] ?? "", inputs: a(), outputs: E.flatMap((c) => c.outputs), decisionKeyed: true }, ...E];
173
+ }
174
+ var be = JSON.stringify({ version: "2.0", resources: [] }, null, 2);
175
+ var _e = (e, n) => {
176
+ if (e._jsonSchema) {
177
+ let { $schema: t, ...s } = e._jsonSchema;
178
+ return n ? s : { ...s, title: e.name };
179
+ }
180
+ return e.type === "jsonSchema" ? {} : { ...N(e.type), title: e.name };
181
+ };
182
+ var ee = (e, n = false) => e.length === 0 ? { type: "object", properties: {} } : { type: "object", properties: Object.fromEntries(e.map((t) => [t.name, _e(t, n)])), required: [] };
183
+ var ne = (e) => typeof e == "string" && e !== "";
184
+ var Re = (e) => {
185
+ let n = Array.isArray(e?.entryPoints) ? e.entryPoints : [], t = new Map;
186
+ for (let s of n)
187
+ ne(s?.filePath) && ne(s.uniqueId) && t.set(s.filePath, s.uniqueId);
188
+ return t;
189
+ };
190
+ async function Te(e, n, t = false) {
191
+ let s = Re(n), o = [], m = [];
192
+ for (let { name: a, contents: u } of e) {
193
+ let g;
194
+ try {
195
+ g = await M(u, t);
196
+ } catch (l) {
197
+ m.push({ name: a, error: l });
198
+ continue;
199
+ }
200
+ for (let l of g) {
201
+ let d = l.id ? `/${a}#${l.id}` : `/${a}`;
202
+ o.push({ filePath: d, uniqueId: s.get(d) ?? v4_default(), type: "BusinessRules", ...l.name ? { displayName: l.name } : {}, input: ee(l.inputs), output: { ...ee(l.outputs, !!l.decisionKeyed), ...l.decisionKeyed ? { [k]: true } : {} } });
203
+ }
204
+ }
205
+ return { entryPoints: o, entryPointsContent: JSON.stringify({ $schema: "https://cloud.uipath.com/draft/2024-12/entry-point", $id: "entry-points.json", entryPoints: o }, null, 2), bindingContent: be, unreadable: m, entryPointsChanged: JSON.stringify(n?.entryPoints) !== JSON.stringify(o) };
206
+ }
207
+ export {
208
+ A as UnreadableDmnError,
209
+ Te as buildBusinessRulePackagingFiles
210
+ };
211
+
212
+ //# debugId=C1F8BB8C3A99315F64756E2164756E21
@@ -8,7 +8,7 @@ import {
8
8
  JsonSerializerFactory2,
9
9
  JsonSerializerProxy2,
10
10
  StreamSerializer2
11
- } from "./tool-yfaf9b8c.js";
11
+ } from "./tool-19fj7ema.js";
12
12
  export {
13
13
  CAMEL_CASE_ENUM_PROPERTIES2 as CAMEL_CASE_ENUM_PROPERTIES,
14
14
  JsonSerializer2 as JsonSerializer,
@@ -0,0 +1,8 @@
1
+ import {
2
+ Cs
3
+ } from "./tool-q3jw2emw.js";
4
+ export {
5
+ Cs as importDmnDocument
6
+ };
7
+
8
+ //# debugId=9C73C7E50801213E64756E2164756E21
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Command
4
- } from "./tool-syavphgt.js";
4
+ } from "./tool-5sgkktdb.js";
5
5
  import {
6
6
  metadata2,
7
7
  registerCommands2
8
- } from "./tool-7ekab7v3.js";
8
+ } from "./tool-a1wk2tqc.js";
9
9
 
10
10
  // src/index.ts
11
11
  var program = new Command;
@@ -1,5 +1,8 @@
1
- import"./tool-3755q59j.js";
2
- import"./tool-syavphgt.js";
1
+ import {
2
+ catchError,
3
+ extractErrorDetails
4
+ } from "./tool-5sgkktdb.js";
5
+ import"./tool-fsmgxvqa.js";
3
6
  import {
4
7
  getSolutionAuthContext,
5
8
  createResourceBuilderServices2,
@@ -7,16 +10,18 @@ import {
7
10
  findCatalogEntityAsync2,
8
11
  toResourceReference2,
9
12
  exportResourceDefinitionAsync2,
13
+ ResourceExportError2,
10
14
  readSpecEntryPoints2
11
- } from "./tool-yfaf9b8c.js";
15
+ } from "./tool-19fj7ema.js";
12
16
  import {
13
- RulesCommandError2
14
- } from "./tool-jzdt6z77.js";
17
+ RulesCommandError2,
18
+ DEPLOYED_RULES_FORBIDDEN_MESSAGE2
19
+ } from "./tool-c0peefw8.js";
15
20
  import {
16
21
  createRulesApi2,
17
22
  findRuleByName2
18
- } from "./tool-sjp6fvze.js";
19
- import"./tool-0tbve332.js";
23
+ } from "./tool-2cxm18e8.js";
24
+ import"./tool-kmzhfjw8.js";
20
25
 
21
26
  // src/services/rule-catalog.ts
22
27
  var BUSINESS_RULE_ENTITY_TYPE = "BusinessRule";
@@ -25,10 +30,19 @@ async function describeRuleAsync(name, folder) {
25
30
  const { catalog, importer } = getRemoteResourceClients2(await createResourceBuilderServices2());
26
31
  const entity = await findCatalogEntityAsync2(catalog, { name, entityTypes: [BUSINESS_RULE_ENTITY_TYPE] }, (e) => e.entityName?.toLowerCase() === name.toLowerCase() && e.folderKey?.toLowerCase() === folder.key.toLowerCase());
27
32
  if (!entity?.entityKey) {
28
- await findRuleByName2(await createRulesApi2(undefined, folder), name, folder);
33
+ const [lookupError] = await catchError(findRuleByName2(await createRulesApi2(undefined, folder), name, folder));
34
+ if (lookupError) {
35
+ throw await orchestratorReadFailure(lookupError, folder);
36
+ }
29
37
  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
38
  }
31
- const definition = await exportResourceDefinitionAsync2(importer, toResourceReference2(entity));
39
+ const [exportError, definition] = await catchError(exportResourceDefinitionAsync2(importer, toResourceReference2(entity)));
40
+ if (exportError) {
41
+ if (exportError instanceof ResourceExportError2 && exportError.status === 404) {
42
+ throw new RulesCommandError2(`Business rule '${name}' is in the resource catalog for folder '${folder.path}', but Orchestrator could not export it (404).`, "not_found", "This is normal for a few minutes right after a deploy. Run the command again shortly. If it keeps failing, the rule may have been deleted and the catalog not caught up yet.", "RetryAfter60Seconds", { httpStatus: 404 });
43
+ }
44
+ throw exportError;
45
+ }
32
46
  return readEntryPoints(definition?.spec, name);
33
47
  }
34
48
  async function listRulesAcrossFoldersAsync(limit, offset) {
@@ -56,6 +70,16 @@ async function listRulesAcrossFoldersAsync(limit, offset) {
56
70
  hasMore: rows.length > offset + limit
57
71
  };
58
72
  }
73
+ async function orchestratorReadFailure(error, folder) {
74
+ const response = error.response;
75
+ if (response?.status !== 403) {
76
+ return error;
77
+ }
78
+ const { result, context } = await extractErrorDetails({
79
+ response: response.clone()
80
+ });
81
+ return result === "AuthenticationError" ? new RulesCommandError2(`Business rules in folder '${folder.path}' can't be read.`, "permission_denied", DEPLOYED_RULES_FORBIDDEN_MESSAGE2, "RetryWillNotFix", context) : error;
82
+ }
59
83
  function readEntryPoints(spec, name) {
60
84
  const entryPoints = readSpecEntryPoints2(spec);
61
85
  if (!entryPoints) {
@@ -68,4 +92,4 @@ export {
68
92
  listRulesAcrossFoldersAsync
69
93
  };
70
94
 
71
- //# debugId=20E2B7D41910710264756E2164756E21
95
+ //# debugId=E78CADD8891ECAD864756E2164756E21
@@ -0,0 +1,15 @@
1
+ import {
2
+ RulesCommandError2,
3
+ isJsonObject2,
4
+ DEPLOYED_RULES_FORBIDDEN_MESSAGE2,
5
+ reportRulesFailure2
6
+ } from "./tool-c0peefw8.js";
7
+ import"./tool-5sgkktdb.js";
8
+ export {
9
+ DEPLOYED_RULES_FORBIDDEN_MESSAGE2 as DEPLOYED_RULES_FORBIDDEN_MESSAGE,
10
+ RulesCommandError2 as RulesCommandError,
11
+ isJsonObject2 as isJsonObject,
12
+ reportRulesFailure2 as reportRulesFailure
13
+ };
14
+
15
+ //# debugId=7C0CE7F3062FA1FA64756E2164756E21
@@ -2,32 +2,34 @@ import {
2
2
  getAuthContext,
3
3
  PersonalWorkspacesApi,
4
4
  createApiClient
5
- } from "./tool-3755q59j.js";
5
+ } from "./tool-fsmgxvqa.js";
6
6
  import {
7
7
  getFileSystem,
8
8
  catchError,
9
+ isHtmlDocument,
10
+ notSupportedFailure,
9
11
  logger,
10
12
  OutputFormatter
11
- } from "./tool-syavphgt.js";
13
+ } from "./tool-5sgkktdb.js";
12
14
  import {
13
15
  buildSolutionPackageFromDir,
14
16
  uploadOrOverwriteSolution
15
- } from "./tool-zs98h1p2.js";
17
+ } from "./tool-0r1ykkjf.js";
16
18
  import {
17
19
  RulesCommandError2,
18
20
  isJsonObject2
19
- } from "./tool-jzdt6z77.js";
21
+ } from "./tool-c0peefw8.js";
20
22
  import {
21
23
  assertOneFolderOption2,
22
24
  resolveRequiredFolder2
23
- } from "./tool-sjp6fvze.js";
25
+ } from "./tool-2cxm18e8.js";
24
26
  import {
25
27
  findSolutionFile,
26
28
  updateSolutionFile
27
- } from "./tool-0tbve332.js";
29
+ } from "./tool-kmzhfjw8.js";
28
30
  import {
29
31
  readRulesProjectNameAsync
30
- } from "./tool-b475et36.js";
32
+ } from "./tool-46g75ed0.js";
31
33
 
32
34
  // src/services/rules-engine-client.ts
33
35
  var DEBUG_EVALUATE_PATH = "/v1/business-rules/debug/evaluate";
@@ -72,7 +74,12 @@ async function postDebugEvaluate(config, request, timeoutSeconds) {
72
74
  if (!response.ok) {
73
75
  throw await engineFailure(response, config.tenantName);
74
76
  }
75
- return await response.json();
77
+ const text = await response.text();
78
+ if (isHtmlDocument(text)) {
79
+ const failure = notSupportedFailure("Business Rules", "The connected environment does not serve the Business Rules engine. Run the command against an environment where Business Rules is turned on.", { httpStatus: response.status });
80
+ throw new RulesCommandError2(failure.Message, "not_supported", failure.Instructions, failure.Retry, failure.Context);
81
+ }
82
+ return JSON.parse(text);
76
83
  }
77
84
  async function engineFailure(response, tenantName) {
78
85
  const text = await response.text().catch(() => "");
@@ -195,4 +202,4 @@ export {
195
202
  debugRuleProjectAsync
196
203
  };
197
204
 
198
- //# debugId=2CD8911C068FFEEA64756E2164756E21
205
+ //# debugId=C3B4C0EBEBB5E2BC64756E2164756E21
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  getFileSystem,
3
3
  catchError
4
- } from "./tool-syavphgt.js";
5
- import"./tool-zs98h1p2.js";
6
- import"./tool-jzdt6z77.js";
4
+ } from "./tool-5sgkktdb.js";
5
+ import"./tool-0r1ykkjf.js";
6
+ import"./tool-c0peefw8.js";
7
7
  import {
8
8
  prepareProjectLocation,
9
9
  tryRegisterProjectInParentSolution
10
- } from "./tool-0tbve332.js";
10
+ } from "./tool-kmzhfjw8.js";
11
11
  import {
12
12
  ENTRY_POINTS_FILE,
13
13
  BINDINGS_FILE,
14
14
  buildRuleEntryPointsAsync
15
- } from "./tool-b475et36.js";
15
+ } from "./tool-46g75ed0.js";
16
16
 
17
17
  // src/services/project-artifacts.ts
18
18
  async function ensureProjectArtifacts(args) {
19
- const { addProjectArtifactsToSolutionAsync } = await import("./index-88sps467.js");
19
+ const { addProjectArtifactsToSolutionAsync } = await import("./index-g955264n.js");
20
20
  return addProjectArtifactsToSolutionAsync(args);
21
21
  }
22
22
 
@@ -26,7 +26,7 @@ var SEEDED_DMN_FILE = "Business rule.dmn";
26
26
  var formatJson = (value) => `${JSON.stringify(value, null, 2)}
27
27
  `;
28
28
  async function createSeededRuleFilesAsync(ruleName) {
29
- const { createNewBusinessRuleDmn } = await import("./constants-1sdwfz26.js");
29
+ const { createNewBusinessRuleDmn } = await import("./constants-yt6m7vkn.js");
30
30
  const dmn = createNewBusinessRuleDmn();
31
31
  const packaging = await buildRuleEntryPointsAsync([{ name: SEEDED_DMN_FILE, contents: dmn }], undefined, ruleName);
32
32
  return {
@@ -2,16 +2,16 @@ import {
2
2
  getFileSystem,
3
3
  catchError,
4
4
  extractErrorMessageSync
5
- } from "./tool-syavphgt.js";
5
+ } from "./tool-5sgkktdb.js";
6
6
  import {
7
7
  RulesCommandError2
8
- } from "./tool-jzdt6z77.js";
8
+ } from "./tool-c0peefw8.js";
9
9
  import {
10
10
  ENTRY_POINTS_FILE,
11
11
  BINDINGS_FILE,
12
12
  readRuleProjectAsync,
13
13
  buildRuleEntryPointsAsync
14
- } from "./tool-b475et36.js";
14
+ } from "./tool-46g75ed0.js";
15
15
 
16
16
  // src/services/rules-refresh-service.ts
17
17
  async function refreshRuleProjectAsync(projectPath) {
@@ -1,10 +1,10 @@
1
- import"./tool-syavphgt.js";
2
- import"./tool-jzdt6z77.js";
1
+ import"./tool-5sgkktdb.js";
2
+ import"./tool-c0peefw8.js";
3
3
  import {
4
4
  ENTRY_POINTS_FILE,
5
5
  readRuleProjectAsync,
6
6
  buildRuleEntryPointsAsync
7
- } from "./tool-b475et36.js";
7
+ } from "./tool-46g75ed0.js";
8
8
 
9
9
  // src/services/rules-validate-service.ts
10
10
  async function validateRuleProjectAsync(projectPath) {
@@ -32,15 +32,13 @@ async function validateRuleProjectAsync(projectPath) {
32
32
  }
33
33
  async function validateDmnFileAsync(file) {
34
34
  const [
35
- { validateDmnDocument },
36
- { translateDmnDiagnostic },
35
+ { validateDmnDocument, translateDmnDiagnostic },
37
36
  { importDmnDocument },
38
37
  { UnreadableDmnError }
39
38
  ] = await Promise.all([
40
- import("./index-y5yffb2s.js"),
41
- import("./index-egzwtc07.js"),
42
- import("./index-z4kt2kt6.js"),
43
- import("./index-zeszs1ra.js")
39
+ import("./index-189nh3zq.js"),
40
+ import("./index-xvy3d6qz.js"),
41
+ import("./index-jm0j1yn2.js")
44
42
  ]);
45
43
  const diagnostics = await validateDmnDocument(file.contents);
46
44
  const imported = diagnostics.some((d) => d.code === "DMN_DOCUMENT_UNREADABLE") ? await importDmnDocument(file.contents) : undefined;
@@ -57,4 +55,4 @@ export {
57
55
  validateRuleProjectAsync
58
56
  };
59
57
 
60
- //# debugId=4E55FD726F10B69064756E2164756E21
58
+ //# debugId=A71D8727885D6AE964756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SolutionDefinitionHelper2
3
- } from "./tool-yfaf9b8c.js";
3
+ } from "./tool-19fj7ema.js";
4
4
  export {
5
5
  SolutionDefinitionHelper2 as SolutionDefinitionHelper
6
6
  };
@@ -4,7 +4,7 @@ import {
4
4
  getSdkUserAgentToken,
5
5
  addSdkUserAgentHeader,
6
6
  installSdkUserAgentHeader
7
- } from "./tool-syavphgt.js";
7
+ } from "./tool-5sgkktdb.js";
8
8
  import {
9
9
  __toESM,
10
10
  __commonJS
@@ -1088,14 +1088,16 @@ async function mirrorTree(fs, srcDir, relativeBase, destBaseDir, ignoreRules) {
1088
1088
  if (rootRel) {
1089
1089
  await fs.mkdir(fs.path.join(destBaseDir, rootRel));
1090
1090
  }
1091
- return;
1091
+ return [];
1092
1092
  }
1093
+ const copied = [];
1093
1094
  for (const f of files) {
1094
1095
  const relPath = fs.path.relative(relativeBase, f);
1095
1096
  const destPath = fs.path.join(destBaseDir, relPath);
1096
1097
  const data = await fs.readFile(f);
1097
1098
  if (data) {
1098
1099
  await fs.writeFile(destPath, data);
1100
+ copied.push(f);
1099
1101
  } else {
1100
1102
  logger.warn(`Skipping empty or unreadable file: ${f}`);
1101
1103
  }
@@ -1107,6 +1109,7 @@ async function mirrorTree(fs, srcDir, relativeBase, destBaseDir, ignoreRules) {
1107
1109
  }
1108
1110
  await fs.mkdir(fs.path.join(destBaseDir, relPath));
1109
1111
  }
1112
+ return copied;
1110
1113
  }
1111
1114
  async function buildSolutionPackageFromDir(fs, solutionDir) {
1112
1115
  const absoluteSolutionDir = fs.path.resolve(solutionDir);
@@ -1591,7 +1594,7 @@ var package_default = {
1591
1594
  name: "@uipath/solution-sdk",
1592
1595
  author: "UiPath",
1593
1596
  license: "SEE LICENSE IN LICENSE.txt",
1594
- version: "1.206.0-preview.303",
1597
+ version: "1.207.0-preview.305",
1595
1598
  repository: {
1596
1599
  type: "git",
1597
1600
  url: "https://github.com/UiPath/cli.git",
@@ -1632,6 +1635,10 @@ var package_default = {
1632
1635
  "./project-context": {
1633
1636
  types: "./dist/src/project-context.d.ts",
1634
1637
  default: "./dist/project-context.js"
1638
+ },
1639
+ "./invocation-graph": {
1640
+ types: "./dist/src/invocation-graph.d.ts",
1641
+ default: "./dist/invocation-graph.js"
1635
1642
  }
1636
1643
  },
1637
1644
  bin: {
@@ -1642,7 +1649,7 @@ var package_default = {
1642
1649
  ],
1643
1650
  private: false,
1644
1651
  scripts: {
1645
- build: "bun build ./src/index.ts ./src/resources/index.ts ./src/solution-auth.ts ./src/deployment-search.ts ./src/package-search.ts ./src/project-context.ts --outdir dist --format esm --target node --splitting --sourcemap=linked && bun build ./src/scripts/generate-sdk.ts --outdir dist/scripts --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
1652
+ build: "bun build ./src/index.ts ./src/resources/index.ts ./src/solution-auth.ts ./src/deployment-search.ts ./src/package-search.ts ./src/project-context.ts ./src/invocation-graph.ts --outdir dist --format esm --target node --splitting --sourcemap=linked && bun build ./src/scripts/generate-sdk.ts --outdir dist/scripts --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
1646
1653
  generate: "bun run src/scripts/generate-sdk.ts",
1647
1654
  lint: "biome check .",
1648
1655
  test: "vitest run",
@@ -1850,4 +1857,4 @@ var SUCCEEDED = "creationsucceeded";
1850
1857
  var TERMINAL = new Set([SUCCEEDED, "creationfailed", "validationfailed"]);
1851
1858
  export { buildSolutionPackageFromDir, uploadOrOverwriteSolution };
1852
1859
 
1853
- //# debugId=FA48D89645BD9C8C64756E2164756E21
1860
+ //# debugId=46663291ABFC5B5064756E2164756E21