@uipath/rules-tool 0.0.0-stage → 1.204.0-preview.249
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.
- package/LICENSE.txt +3 -0
- package/README.md +80 -2
- package/dist/DmnFactory-SG3RP3T3-cr8e7mxz.js +8 -0
- package/dist/DmnFactory-VWZOSZHH-azx0zqcn.js +8 -0
- package/dist/DmnModelTypes-ATR7FVKZ-vkv7n0jn.js +8 -0
- package/dist/KieDmnMarshaller-6TTUU5B4-rsxhvw7a.js +8 -0
- package/dist/business-rules-d51977r1.js +25 -0
- package/dist/business-rules-dekge24t.js +23 -0
- package/dist/business-rules-ew76mbwg.js +25 -0
- package/dist/business-rules-jmwx05k2.js +25 -0
- package/dist/business-rules-zpzqxyce.js +26 -0
- package/dist/constants-4r8pfr16.js +22 -0
- package/dist/constants-za5vbzp8.js +22 -0
- package/dist/embedded-file-reader-0228j82a.js +111 -0
- package/dist/embedded-file-reader-wmsg31a8.js +111 -0
- package/dist/first-party-service-1qa6cp4d.js +8 -0
- package/dist/first-party-service-28dkctkz.js +8 -0
- package/dist/first-party-service-4fsz3cnj.js +8 -0
- package/dist/first-party-service-ahcc6xc6.js +8 -0
- package/dist/first-party-service-y1ccmsvp.js +8 -0
- package/dist/first-party-service-zpr1q3nd.js +8 -0
- package/dist/hitPolicyResult-4WDHTX4A-dbtkgpqp.js +12 -0
- package/dist/index-2zxy6zgp.js +23 -0
- package/dist/index-3nx77wfh.js +23 -0
- package/dist/index-43zg1wqe.js +19621 -0
- package/dist/index-47jera73.js +23 -0
- package/dist/index-70jn7cz1.js +19631 -0
- package/dist/index-7wc0g78k.js +14 -0
- package/dist/index-8kb5kc5y.js +24 -0
- package/dist/index-97yad7ms.js +8 -0
- package/dist/index-dfn83hxf.js +14 -0
- package/dist/index-e301h23h.js +24 -0
- package/dist/index-frd259yv.js +24 -0
- package/dist/index-gc7cw2jh.js +23 -0
- package/dist/index-gya2v502.js +8 -0
- package/dist/index-hb3gk1wf.js +24 -0
- package/dist/index-nsnfdqd5.js +24 -0
- package/dist/index-nzr4mx5p.js +614 -0
- package/dist/index-vffktc0w.js +166 -0
- package/dist/index-we6zjs66.js +164 -0
- package/dist/index-xymrydfw.js +3095 -0
- package/dist/index-z2qk2qn6.js +24 -0
- package/dist/index-zdwhfpt1.js +3071 -0
- package/dist/index-zecwgvg7.js +23 -0
- package/dist/index.js +16 -0
- package/dist/jmespath-ab6tdc42.js +1485 -0
- package/dist/js-yaml-a2bk27p6.js +3151 -0
- package/dist/rule-catalog-a5w86qns.js +43 -0
- package/dist/rule-catalog-etpf962f.js +69 -0
- package/dist/rule-catalog-q5cr17hf.js +58 -0
- package/dist/rule-catalog-vc98yg4n.js +43 -0
- package/dist/rule-catalog-z3h66kh5.js +56 -0
- package/dist/rules-command-error-10qmb5w7.js +13 -0
- package/dist/rules-command-error-5bdv4bcx.js +13 -0
- package/dist/rules-command-error-cmssf0w4.js +13 -0
- package/dist/rules-command-error-fsm3b1mv.js +13 -0
- package/dist/rules-debug-service-5rcdh3pj.js +192 -0
- package/dist/rules-debug-service-8q7mkd0r.js +199 -0
- package/dist/rules-debug-service-b9j29ejz.js +192 -0
- package/dist/rules-debug-service-h1ahd6p3.js +192 -0
- package/dist/rules-debug-service-v3jr3r1n.js +192 -0
- package/dist/rules-init-service-3c2yfa7p.js +687 -0
- package/dist/rules-init-service-3wgd9cqp.js +100 -0
- package/dist/rules-init-service-8fqytxq0.js +685 -0
- package/dist/rules-init-service-pspt7sje.js +100 -0
- package/dist/rules-init-service-sbtzw93j.js +102 -0
- package/dist/rules-init-service-x7paqa63.js +687 -0
- package/dist/rules-init-service-y678kjje.js +100 -0
- package/dist/rules-init-service-y7qzmxx0.js +102 -0
- package/dist/rules-refresh-service-4xxj6ex6.js +65 -0
- package/dist/rules-refresh-service-ba5jk1y9.js +65 -0
- package/dist/rules-refresh-service-btn64j8j.js +65 -0
- package/dist/rules-refresh-service-qkmphj53.js +65 -0
- package/dist/rules-validate-service-dmgnfne7.js +60 -0
- package/dist/rules-validate-service-hk2d006t.js +60 -0
- package/dist/rules-validate-service-sppr4x13.js +60 -0
- package/dist/rules-validate-service-xp05n2d9.js +60 -0
- package/dist/tool-0bthsb3x.js +55 -0
- package/dist/tool-1dycs173.js +4014 -0
- package/dist/tool-1pkqxwwd.js +17472 -0
- package/dist/tool-24mr6g8c.js +1556 -0
- package/dist/tool-2trg1fpx.js +40 -0
- package/dist/tool-39fmkx2d.js +611 -0
- package/dist/tool-3e2q1x2y.js +6578 -0
- package/dist/tool-3j0747gg.js +17077 -0
- package/dist/tool-4z7zcq4z.js +6058 -0
- package/dist/tool-56smnjrh.js +73 -0
- package/dist/tool-5qygptrc.js +6171 -0
- package/dist/tool-5xx6x8pe.js +6596 -0
- package/dist/tool-6rp0gx98.js +6578 -0
- package/dist/tool-6sqt4zrx.js +571 -0
- package/dist/tool-7fkrd618.js +1556 -0
- package/dist/tool-7xmarr97.js +17077 -0
- package/dist/tool-89xzeteg.js +361 -0
- package/dist/tool-8j9f6ns5.js +6396 -0
- package/dist/tool-911s9czz.js +570 -0
- package/dist/tool-97x3zjcm.js +709 -0
- package/dist/tool-9bz2x04j.js +40 -0
- package/dist/tool-akh7nnqs.js +704 -0
- package/dist/tool-axfzew45.js +1555 -0
- package/dist/tool-b71jq9pt.js +389 -0
- package/dist/tool-bfj846v8.js +141 -0
- package/dist/tool-bvmc017m.js +96 -0
- package/dist/tool-bykz5ryf.js +454 -0
- package/dist/tool-c76qb8ap.js +17052 -0
- package/dist/tool-ca15515v.js +570 -0
- package/dist/tool-e1mmqsjr.js +11048 -0
- package/dist/tool-epsr41wx.js +48 -0
- package/dist/tool-f9qs255w.js +70 -0
- package/dist/tool-fbqnqf9k.js +10 -0
- package/dist/tool-ga79rety.js +389 -0
- package/dist/tool-gb547mcn.js +141 -0
- package/dist/tool-gta9rr4h.js +68 -0
- package/dist/tool-h2dfnxdq.js +6486 -0
- package/dist/tool-hg6vr5y9.js +3769 -0
- package/dist/tool-hgvnm4vh.js +1843 -0
- package/dist/tool-hjbf9aay.js +571 -0
- package/dist/tool-k2s349kn.js +108 -0
- package/dist/tool-k5jm64n3.js +5650 -0
- package/dist/tool-ketztpgf.js +73 -0
- package/dist/tool-mm1x18d6.js +537 -0
- package/dist/tool-n1d88ryb.js +6396 -0
- package/dist/tool-nmqpwh9m.js +6166 -0
- package/dist/tool-pb80pswx.js +73 -0
- package/dist/tool-pcsgwpfw.js +40 -0
- package/dist/tool-q3c1bjyb.js +454 -0
- package/dist/tool-rwp1skmf.js +40 -0
- package/dist/tool-s3fbt22r.js +454 -0
- package/dist/tool-tmbst1r8.js +68 -0
- package/dist/tool-v6w109p0.js +455 -0
- package/dist/tool-vyx8fpft.js +46 -0
- package/dist/tool-w2js05qv.js +389 -0
- package/dist/tool-x67kek1m.js +1838 -0
- package/dist/tool-x89947ah.js +17052 -0
- package/dist/tool-xhksjdka.js +4005 -0
- package/dist/tool-yv3t4gg5.js +108 -0
- package/dist/tool-zbyb1ttx.js +5650 -0
- package/dist/tool.js +11 -0
- package/package.json +43 -5
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import {
|
|
2
|
+
v4_default
|
|
3
|
+
} from "./tool-vyx8fpft.js";
|
|
4
|
+
|
|
5
|
+
// ../../node_modules/@uipath/dmn-editor-utils/dist/entry-points/index.js
|
|
6
|
+
function O(e) {
|
|
7
|
+
switch (e.toLowerCase()) {
|
|
8
|
+
case "boolean":
|
|
9
|
+
return "boolean";
|
|
10
|
+
case "number":
|
|
11
|
+
case "integer":
|
|
12
|
+
case "long":
|
|
13
|
+
case "double":
|
|
14
|
+
case "decimal":
|
|
15
|
+
return "number";
|
|
16
|
+
case "date":
|
|
17
|
+
return "date";
|
|
18
|
+
case "time":
|
|
19
|
+
return "time";
|
|
20
|
+
case "date and time":
|
|
21
|
+
case "datetime":
|
|
22
|
+
return "datetime";
|
|
23
|
+
case "array":
|
|
24
|
+
return "array";
|
|
25
|
+
case "any":
|
|
26
|
+
case "object":
|
|
27
|
+
return "object";
|
|
28
|
+
default:
|
|
29
|
+
return "string";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
var N = "x-uipath-decision-keyed";
|
|
33
|
+
var F = { "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." };
|
|
34
|
+
var S = class extends Error {
|
|
35
|
+
constructor(r) {
|
|
36
|
+
super(F[r] ?? "The rule could not be read.");
|
|
37
|
+
this.reason = r;
|
|
38
|
+
this.name = "UnreadableDmnError";
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var j = (e) => e.__$$element === "decision";
|
|
42
|
+
var L = (e) => e.__$$element === "inputData";
|
|
43
|
+
var E = (e) => e.expression?.__$$element === "decisionTable" ? e.expression : undefined;
|
|
44
|
+
var P = (e) => e.expression?.__$$element === "literalExpression" ? e.expression : undefined;
|
|
45
|
+
var I = (e) => !!E(e) || !!P(e);
|
|
46
|
+
var Y = (e, t) => {
|
|
47
|
+
let r = e.variable?.["@_name"] || e["@_name"] || "";
|
|
48
|
+
return { name: r, displayName: e["@_label"] || r, type: O(t["@_typeRef"] ?? e.variable?.["@_typeRef"] ?? ""), source: `=result.${r}` };
|
|
49
|
+
};
|
|
50
|
+
var J = (e) => ({ name: e.variable?.["@_name"] || e["@_name"] || "", displayName: e["@_name"] || e.variable?.["@_name"] || "", type: O(e.variable?.["@_typeRef"] ?? ""), required: true });
|
|
51
|
+
var A = (e) => e.inputExpression?.text?.__$$text || e["@_label"] || "";
|
|
52
|
+
var H = (e) => ({ name: A(e), displayName: e["@_label"] || A(e), type: O(e.inputExpression?.["@_typeRef"] ?? ""), required: true });
|
|
53
|
+
async function k(e) {
|
|
54
|
+
let [{ importDmnDocument: t }, { outputArgumentName: r }] = await Promise.all([import("./KieDmnMarshaller-6TTUU5B4-rsxhvw7a.js"), import("./DmnFactory-SG3RP3T3-cr8e7mxz.js")]), i = await t(e);
|
|
55
|
+
if (i.status === "error")
|
|
56
|
+
throw new S(i.reason);
|
|
57
|
+
let o = i.document.definitions, p = o.drgElement ?? [], a = p.filter(j), l = p.filter(L), b = (n, y) => {
|
|
58
|
+
let d = r({ id: n["@_id"] ?? "", name: n["@_name"], label: n["@_label"] }, y);
|
|
59
|
+
return { name: d, displayName: n["@_label"] || d, type: O(n["@_typeRef"] ?? ""), source: `=result.${d}` };
|
|
60
|
+
}, c = (n) => {
|
|
61
|
+
let y = P(n);
|
|
62
|
+
if (y)
|
|
63
|
+
return [Y(n, y)];
|
|
64
|
+
let d = E(n);
|
|
65
|
+
if (!d)
|
|
66
|
+
return [];
|
|
67
|
+
let s = (d.output ?? []).map(b), m = n["@_name"];
|
|
68
|
+
return s.length !== 1 || d.output?.[0]?.["@_name"]?.trim() || !m ? s : [{ ...s[0], name: m, displayName: d.output?.[0]?.["@_label"] || m, source: `=result.${m}` }];
|
|
69
|
+
}, _ = (n, y = () => true) => l.length ? l.filter(y).map(J) : n.flatMap((d) => (d.input ?? []).map(H)), h = new Map((o.itemDefinition ?? []).map((n) => [n["@_name"], n])), R = (n) => !n["@_aggregation"] && ["COLLECT", "RULE ORDER", "OUTPUT ORDER"].includes(n["@_hitPolicy"] ?? "UNIQUE"), x = (n) => {
|
|
70
|
+
let y = n["@_name"] ?? "", d = c(n).map((u) => u.name), s = P(n), m = E(n), f = (m?.output ?? []).map((u) => $(u["@_typeRef"], h)), g;
|
|
71
|
+
return s ? g = [[d[0], $(s["@_typeRef"] ?? n.variable?.["@_typeRef"], h)]] : m && R(m) ? g = f.length > 1 ? [[y, { type: "array", items: { type: "object", properties: Object.fromEntries(d.map((u, D) => [u, f[D]])) } }]] : f.map((u, D) => [d[D], { type: "array", items: u }]) : g = d.map((u, D) => [u, f[D]]), { name: y, displayName: y, type: "jsonSchema", source: `=result.${y}`, _jsonSchema: { type: "object", properties: Object.fromEntries(g) } };
|
|
72
|
+
}, w = a.every((n) => !I(n) || !!n["@_name"]?.trim());
|
|
73
|
+
return { definitions: o, decisions: a, declared: l, inputsFor: _, outputsOf: c, toKeyedOutput: x, keyable: w };
|
|
74
|
+
}
|
|
75
|
+
function $(e, t, r = new Set) {
|
|
76
|
+
let i = e && !r.has(e) ? t.get(e) : undefined;
|
|
77
|
+
if (!i)
|
|
78
|
+
return { type: O(e ?? "") };
|
|
79
|
+
let o = new Set(r).add(e ?? ""), p = i.itemComponent ?? [], a = p.length ? { type: "object", properties: Object.fromEntries(p.map((l) => [l["@_name"], $(l.typeRef?.__$$text, t, o)])) } : $(i.typeRef?.__$$text, t, o);
|
|
80
|
+
return i["@_isCollection"] ? { type: "array", items: a } : a;
|
|
81
|
+
}
|
|
82
|
+
var M = (e) => e?.startsWith("#") ? e.slice(1) : e || undefined;
|
|
83
|
+
var G = (e, t) => new RegExp(`(^|[^\\w.$])${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}([^\\w$]|$)`).test(e);
|
|
84
|
+
function Q(e, t) {
|
|
85
|
+
let r = new Set([e]), i = [e];
|
|
86
|
+
for (;i.length > 0; ) {
|
|
87
|
+
let o = t.get(i.shift() ?? "");
|
|
88
|
+
if (!o)
|
|
89
|
+
continue;
|
|
90
|
+
let p = [...(o.informationRequirement ?? []).flatMap((a) => [a.requiredInput?.["@_href"], a.requiredDecision?.["@_href"]]), ...(o.knowledgeRequirement ?? []).map((a) => a.requiredKnowledge?.["@_href"])];
|
|
91
|
+
for (let a of p) {
|
|
92
|
+
let l = M(a);
|
|
93
|
+
!l || r.has(l) || (r.add(l), i.push(l));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return r;
|
|
97
|
+
}
|
|
98
|
+
async function T(e, t = false) {
|
|
99
|
+
let { definitions: r, decisions: i, declared: o, inputsFor: p, outputsOf: a, toKeyedOutput: l, keyable: b } = await k(e), c = t && b, _ = new Map([...i, ...o].flatMap((s) => s["@_id"] ? [[s["@_id"], s]] : [])), h = new Set(i.flatMap((s) => (s.informationRequirement ?? []).flatMap((m) => {
|
|
100
|
+
let f = M(m.requiredDecision?.["@_href"]);
|
|
101
|
+
return f ? [f] : [];
|
|
102
|
+
}))), R = [...i.filter((s) => !h.has(s["@_id"] ?? "")), ...i.filter((s) => h.has(s["@_id"] ?? ""))], x = R.map((s) => {
|
|
103
|
+
let m = Q(s["@_id"] ?? "", _), f = [...m].flatMap((g) => {
|
|
104
|
+
let u = _.get(g);
|
|
105
|
+
if (!u || !j(u))
|
|
106
|
+
return [];
|
|
107
|
+
let D = P(u);
|
|
108
|
+
return D ? [D.text?.__$$text ?? ""] : (E(u)?.input ?? []).map((q) => q.inputExpression?.text?.__$$text ?? "");
|
|
109
|
+
});
|
|
110
|
+
return (g) => {
|
|
111
|
+
if (m.has(g["@_id"] ?? ""))
|
|
112
|
+
return true;
|
|
113
|
+
let u = g.variable?.["@_name"] || g["@_name"] || "";
|
|
114
|
+
return !!u && f.some((D) => G(D, u));
|
|
115
|
+
};
|
|
116
|
+
}), w = new Set(o.filter((s) => x.some((m) => m(s)))), n = R.flatMap((s, m) => {
|
|
117
|
+
if (!I(s))
|
|
118
|
+
return [];
|
|
119
|
+
let f = E(s), g = (u) => x[m](u) || !w.has(u);
|
|
120
|
+
return [{ id: s["@_id"] ?? "", name: s["@_label"] ?? s["@_name"] ?? "", inputs: p(f ? [f] : [], g), outputs: c ? [l(s)] : a(s), ...c ? { decisionKeyed: true } : {} }];
|
|
121
|
+
});
|
|
122
|
+
if (!c || n.length < 2)
|
|
123
|
+
return n;
|
|
124
|
+
let y = i.map(E).filter((s) => !!s);
|
|
125
|
+
return [{ name: r["@_label"] ?? r["@_name"] ?? "", inputs: p(y), outputs: n.flatMap((s) => s.outputs), decisionKeyed: true }, ...n];
|
|
126
|
+
}
|
|
127
|
+
var z = JSON.stringify({ version: "2.0", resources: [] }, null, 2);
|
|
128
|
+
var V = { date: { type: "string", format: "date" }, datetime: { type: "string", format: "date-time" }, time: { type: "string", format: "time" } };
|
|
129
|
+
var Z = (e) => {
|
|
130
|
+
if (e.type === "jsonSchema") {
|
|
131
|
+
let { $schema: t, ...r } = e._jsonSchema ?? {};
|
|
132
|
+
return e._jsonSchema ? r : {};
|
|
133
|
+
}
|
|
134
|
+
return e.type === "array" ? { type: "array", items: {}, title: e.name } : { ...V[e.type] ?? { type: e.type }, title: e.name };
|
|
135
|
+
};
|
|
136
|
+
var U = (e) => e.length === 0 ? { type: "object", properties: {} } : { type: "object", properties: Object.fromEntries(e.map((t) => [t.name, Z(t)])), required: [] };
|
|
137
|
+
var B = (e) => typeof e == "string" && e !== "";
|
|
138
|
+
var ee = (e) => {
|
|
139
|
+
let t = Array.isArray(e?.entryPoints) ? e.entryPoints : [], r = new Map;
|
|
140
|
+
for (let i of t)
|
|
141
|
+
B(i?.filePath) && B(i.uniqueId) && r.set(i.filePath, i.uniqueId);
|
|
142
|
+
return r;
|
|
143
|
+
};
|
|
144
|
+
async function te(e, t, r = false) {
|
|
145
|
+
let i = ee(t), o = [], p = [];
|
|
146
|
+
for (let { name: a, contents: l } of e) {
|
|
147
|
+
let b;
|
|
148
|
+
try {
|
|
149
|
+
b = await T(l, r);
|
|
150
|
+
} catch (c) {
|
|
151
|
+
p.push({ name: a, error: c });
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
for (let c of b) {
|
|
155
|
+
let _ = c.id ? `/${a}#${c.id}` : `/${a}`;
|
|
156
|
+
o.push({ filePath: _, uniqueId: i.get(_) ?? v4_default(), type: "BusinessRules", ...c.name ? { displayName: c.name } : {}, input: U(c.inputs), output: { ...U(c.outputs), ...c.decisionKeyed ? { [N]: true } : {} } });
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
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: z, unreadable: p, entryPointsChanged: JSON.stringify(t?.entryPoints) !== JSON.stringify(o) };
|
|
160
|
+
}
|
|
161
|
+
export {
|
|
162
|
+
S as UnreadableDmnError,
|
|
163
|
+
te as buildBusinessRulePackagingFiles
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
//# debugId=36F0E7BA0B1FB92964756E2164756E21
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import {
|
|
2
|
+
v4_default
|
|
3
|
+
} from "./tool-vyx8fpft.js";
|
|
4
|
+
|
|
5
|
+
// ../../node_modules/@uipath/dmn-editor-utils/dist/entry-points/index.js
|
|
6
|
+
function T(e) {
|
|
7
|
+
switch (e.toLowerCase()) {
|
|
8
|
+
case "boolean":
|
|
9
|
+
return "boolean";
|
|
10
|
+
case "number":
|
|
11
|
+
case "integer":
|
|
12
|
+
case "long":
|
|
13
|
+
case "double":
|
|
14
|
+
case "decimal":
|
|
15
|
+
return "number";
|
|
16
|
+
case "date":
|
|
17
|
+
return "date";
|
|
18
|
+
case "time":
|
|
19
|
+
return "time";
|
|
20
|
+
case "date and time":
|
|
21
|
+
case "datetime":
|
|
22
|
+
return "datetime";
|
|
23
|
+
case "array":
|
|
24
|
+
return "array";
|
|
25
|
+
case "any":
|
|
26
|
+
case "object":
|
|
27
|
+
return "object";
|
|
28
|
+
default:
|
|
29
|
+
return "string";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
var j = "x-uipath-decision-keyed";
|
|
33
|
+
var J = { "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." };
|
|
34
|
+
var $ = class extends Error {
|
|
35
|
+
constructor(s) {
|
|
36
|
+
super(J[s] ?? "The rule could not be read.");
|
|
37
|
+
this.reason = s;
|
|
38
|
+
this.name = "UnreadableDmnError";
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var q = (e) => e.__$$element === "decision";
|
|
42
|
+
var H = (e) => e.__$$element === "inputData";
|
|
43
|
+
var N = (e) => e.expression?.__$$element === "decisionTable" ? e.expression : undefined;
|
|
44
|
+
var A = (e) => e.expression?.__$$element === "literalExpression" ? e.expression : undefined;
|
|
45
|
+
var C = (e) => !!N(e) || !!A(e);
|
|
46
|
+
var W = (e, t) => {
|
|
47
|
+
let s = e.variable?.["@_name"] || e["@_name"] || "";
|
|
48
|
+
return { name: s, displayName: e["@_label"] || s, type: T(t["@_typeRef"] ?? e.variable?.["@_typeRef"] ?? ""), source: `=result.${s}` };
|
|
49
|
+
};
|
|
50
|
+
var G = (e) => ({ name: e.variable?.["@_name"] || e["@_name"] || "", displayName: e["@_name"] || e.variable?.["@_name"] || "", type: T(e.variable?.["@_typeRef"] ?? ""), required: true });
|
|
51
|
+
async function U(e) {
|
|
52
|
+
let [{ importDmnDocument: t }, { outputArgumentName: s }, { aggregateTypeRef: r, isCollectAggregation: u, LIST_HIT_POLICIES: m }, { DmnHitPolicy: a }] = await Promise.all([import("./KieDmnMarshaller-6TTUU5B4-rsxhvw7a.js"), import("./DmnFactory-VWZOSZHH-azx0zqcn.js"), import("./hitPolicyResult-4WDHTX4A-dbtkgpqp.js"), import("./DmnModelTypes-ATR7FVKZ-vkv7n0jn.js")]), c = await t(e);
|
|
53
|
+
if (c.status === "error")
|
|
54
|
+
throw new $(c.reason);
|
|
55
|
+
let y = c.document.definitions, p = y.drgElement ?? [], g = p.filter(q), _ = p.filter(H), E = (n, o) => {
|
|
56
|
+
let l = n["@_aggregation"];
|
|
57
|
+
return n["@_hitPolicy"] === a.Collect && u(l) ? r(l, { typeRef: o["@_typeRef"] }) ?? "Any" : o["@_typeRef"];
|
|
58
|
+
}, R = (n, o, l) => {
|
|
59
|
+
let d = s({ id: o["@_id"] ?? "", name: o["@_name"], label: o["@_label"] }, l);
|
|
60
|
+
return { name: d, displayName: o["@_label"] || d, type: T(E(n, o) ?? ""), source: `=result.${d}` };
|
|
61
|
+
}, O = (n) => {
|
|
62
|
+
let o = A(n);
|
|
63
|
+
if (o)
|
|
64
|
+
return [W(n, o)];
|
|
65
|
+
let l = N(n);
|
|
66
|
+
if (!l)
|
|
67
|
+
return [];
|
|
68
|
+
let d = (l.output ?? []).map((S, P) => R(l, S, P)), D = n["@_name"];
|
|
69
|
+
return d.length !== 1 || l.output?.[0]?.["@_name"]?.trim() || !D ? d : [{ ...d[0], name: D, displayName: l.output?.[0]?.["@_label"] || D, source: `=result.${D}` }];
|
|
70
|
+
}, x = (n = () => true) => _.filter(n).map(G), k = new Map((y.itemDefinition ?? []).map((n) => [n["@_name"], n])), i = (n) => !n["@_aggregation"] && m.has(n["@_hitPolicy"] ?? a.Unique), f = (n) => {
|
|
71
|
+
let o = n["@_name"] ?? "", l = O(n).map((b) => b.name), d = A(n), D = N(n), S = D ? (D.output ?? []).map((b) => I(E(D, b), k)) : [], P;
|
|
72
|
+
return d ? P = [[l[0], I(d["@_typeRef"] ?? n.variable?.["@_typeRef"], k)]] : D && i(D) ? P = S.length > 1 ? [[o, { type: "array", items: { type: "object", properties: Object.fromEntries(l.map((b, w) => [b, S[w]])) } }]] : S.map((b, w) => [l[w], { type: "array", items: b }]) : P = l.map((b, w) => [b, S[w]]), { name: o, displayName: o, type: "jsonSchema", source: `=result.${o}`, _jsonSchema: { type: "object", properties: Object.fromEntries(P) } };
|
|
73
|
+
}, h = g.every((n) => !C(n) || !!n["@_name"]?.trim());
|
|
74
|
+
return { definitions: y, decisions: g, declared: _, inputsFor: x, outputsOf: O, toKeyedOutput: f, keyable: h };
|
|
75
|
+
}
|
|
76
|
+
function I(e, t, s = new Set) {
|
|
77
|
+
let r = e && !s.has(e) ? t.get(e) : undefined;
|
|
78
|
+
if (!r)
|
|
79
|
+
return { type: T(e ?? "") };
|
|
80
|
+
let u = new Set(s).add(e ?? ""), m = r.itemComponent ?? [], a = m.length ? { type: "object", properties: Object.fromEntries(m.map((c) => [c["@_name"], I(c.typeRef?.__$$text, t, u)])) } : I(r.typeRef?.__$$text, t, u);
|
|
81
|
+
return r["@_isCollection"] ? { type: "array", items: a } : a;
|
|
82
|
+
}
|
|
83
|
+
var v = (e) => e?.startsWith("#") ? e.slice(1) : e || undefined;
|
|
84
|
+
var z = (e, t) => new RegExp(`(^|[^\\w.$])${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}([^\\w$]|$)`).test(e);
|
|
85
|
+
function Q(e, t) {
|
|
86
|
+
let s = new Set([e]), r = [e];
|
|
87
|
+
for (;r.length > 0; ) {
|
|
88
|
+
let u = t.get(r.shift() ?? "");
|
|
89
|
+
if (!u)
|
|
90
|
+
continue;
|
|
91
|
+
let m = [...(u.informationRequirement ?? []).flatMap((a) => [a.requiredInput?.["@_href"], a.requiredDecision?.["@_href"]]), ...(u.knowledgeRequirement ?? []).map((a) => a.requiredKnowledge?.["@_href"])];
|
|
92
|
+
for (let a of m) {
|
|
93
|
+
let c = v(a);
|
|
94
|
+
!c || s.has(c) || (s.add(c), r.push(c));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return s;
|
|
98
|
+
}
|
|
99
|
+
async function M(e, t = false) {
|
|
100
|
+
let { definitions: s, decisions: r, declared: u, inputsFor: m, outputsOf: a, toKeyedOutput: c, keyable: y } = await U(e), p = t && y, g = new Map([...r, ...u].flatMap((i) => i["@_id"] ? [[i["@_id"], i]] : [])), _ = new Set(r.flatMap((i) => (i.informationRequirement ?? []).flatMap((f) => {
|
|
101
|
+
let h = v(f.requiredDecision?.["@_href"]);
|
|
102
|
+
return h ? [h] : [];
|
|
103
|
+
}))), E = [...r.filter((i) => !_.has(i["@_id"] ?? "")), ...r.filter((i) => _.has(i["@_id"] ?? ""))], R = E.map((i) => {
|
|
104
|
+
let f = Q(i["@_id"] ?? "", g), h = [...f].flatMap((n) => {
|
|
105
|
+
let o = g.get(n);
|
|
106
|
+
if (!o || !q(o))
|
|
107
|
+
return [];
|
|
108
|
+
let l = A(o);
|
|
109
|
+
return l ? [l.text?.__$$text ?? ""] : (N(o)?.input ?? []).map((d) => d.inputExpression?.text?.__$$text ?? "");
|
|
110
|
+
});
|
|
111
|
+
return (n) => {
|
|
112
|
+
if (f.has(n["@_id"] ?? ""))
|
|
113
|
+
return true;
|
|
114
|
+
let o = n.variable?.["@_name"] || n["@_name"] || "";
|
|
115
|
+
return !!o && h.some((l) => z(l, o));
|
|
116
|
+
};
|
|
117
|
+
}), O = new Set(u.filter((i) => R.some((f) => f(i)))), x = E.flatMap((i, f) => {
|
|
118
|
+
if (!C(i))
|
|
119
|
+
return [];
|
|
120
|
+
let h = (n) => R[f](n) || !O.has(n);
|
|
121
|
+
return [{ id: i["@_id"] ?? "", name: i["@_label"] ?? i["@_name"] ?? "", inputs: m(h), outputs: p ? [c(i)] : a(i), ...p ? { decisionKeyed: true } : {} }];
|
|
122
|
+
});
|
|
123
|
+
return !p || x.length < 2 ? x : [{ name: s["@_label"] ?? s["@_name"] ?? "", inputs: m(), outputs: x.flatMap((i) => i.outputs), decisionKeyed: true }, ...x];
|
|
124
|
+
}
|
|
125
|
+
var Z = JSON.stringify({ version: "2.0", resources: [] }, null, 2);
|
|
126
|
+
var ee = { date: { type: "string", format: "date" }, datetime: { type: "string", format: "date-time" }, time: { type: "string", format: "time" } };
|
|
127
|
+
var te = (e) => {
|
|
128
|
+
if (e.type === "jsonSchema") {
|
|
129
|
+
let { $schema: t, ...s } = e._jsonSchema ?? {};
|
|
130
|
+
return e._jsonSchema ? s : {};
|
|
131
|
+
}
|
|
132
|
+
return e.type === "array" ? { type: "array", items: {}, title: e.name } : { ...ee[e.type] ?? { type: e.type }, title: e.name };
|
|
133
|
+
};
|
|
134
|
+
var K = (e) => e.length === 0 ? { type: "object", properties: {} } : { type: "object", properties: Object.fromEntries(e.map((t) => [t.name, te(t)])), required: [] };
|
|
135
|
+
var F = (e) => typeof e == "string" && e !== "";
|
|
136
|
+
var ne = (e) => {
|
|
137
|
+
let t = Array.isArray(e?.entryPoints) ? e.entryPoints : [], s = new Map;
|
|
138
|
+
for (let r of t)
|
|
139
|
+
F(r?.filePath) && F(r.uniqueId) && s.set(r.filePath, r.uniqueId);
|
|
140
|
+
return s;
|
|
141
|
+
};
|
|
142
|
+
async function se(e, t, s = false) {
|
|
143
|
+
let r = ne(t), u = [], m = [];
|
|
144
|
+
for (let { name: a, contents: c } of e) {
|
|
145
|
+
let y;
|
|
146
|
+
try {
|
|
147
|
+
y = await M(c, s);
|
|
148
|
+
} catch (p) {
|
|
149
|
+
m.push({ name: a, error: p });
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
for (let p of y) {
|
|
153
|
+
let g = p.id ? `/${a}#${p.id}` : `/${a}`;
|
|
154
|
+
u.push({ filePath: g, uniqueId: r.get(g) ?? v4_default(), type: "BusinessRules", ...p.name ? { displayName: p.name } : {}, input: K(p.inputs), output: { ...K(p.outputs), ...p.decisionKeyed ? { [j]: true } : {} } });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
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: Z, unreadable: m, entryPointsChanged: JSON.stringify(t?.entryPoints) !== JSON.stringify(u) };
|
|
158
|
+
}
|
|
159
|
+
export {
|
|
160
|
+
$ as UnreadableDmnError,
|
|
161
|
+
se as buildBusinessRulePackagingFiles
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
//# debugId=BF9314EE8C4EAE0564756E2164756E21
|