@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,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFileSystem,
|
|
3
|
+
catchError
|
|
4
|
+
} from "./tool-5qygptrc.js";
|
|
5
|
+
import {
|
|
6
|
+
RulesCommandError2,
|
|
7
|
+
isJsonObject2
|
|
8
|
+
} from "./tool-9bz2x04j.js";
|
|
9
|
+
|
|
10
|
+
// src/services/rule-project.ts
|
|
11
|
+
var ENTRY_POINTS_FILE = "entry-points.json";
|
|
12
|
+
var BINDINGS_FILE = "bindings_v2.json";
|
|
13
|
+
async function readRuleProjectAsync(projectPath) {
|
|
14
|
+
const fs = getFileSystem();
|
|
15
|
+
const projectDir = fs.path.resolve(projectPath);
|
|
16
|
+
await readRulesProjectNameAsync(projectDir);
|
|
17
|
+
const names = (await fs.readdir(projectDir)).filter((name) => name.toLowerCase().endsWith(".dmn")).sort((a, b) => a.localeCompare(b, "en"));
|
|
18
|
+
const dmnFiles = await Promise.all(names.map(async (name) => ({
|
|
19
|
+
name,
|
|
20
|
+
contents: await fs.readFile(fs.path.join(projectDir, name), "utf-8") ?? ""
|
|
21
|
+
})));
|
|
22
|
+
if (dmnFiles.length === 0) {
|
|
23
|
+
throw new RulesCommandError2(`No .dmn file found in ${projectDir}.`, "not_found", "Add the rule's .dmn file at the top level of the project, or run 'uip rules init <name>' to scaffold one.");
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
projectDir,
|
|
27
|
+
dmnFiles,
|
|
28
|
+
publishedEntryPoints: await readPublishedEntryPoints(projectDir)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async function buildRuleEntryPointsAsync(dmnFiles, publishedEntryPoints) {
|
|
32
|
+
const { buildBusinessRulePackagingFiles } = await import("./index-vffktc0w.js");
|
|
33
|
+
return buildBusinessRulePackagingFiles(dmnFiles, publishedEntryPoints, true);
|
|
34
|
+
}
|
|
35
|
+
async function readRulesProjectNameAsync(projectDir) {
|
|
36
|
+
const fs = getFileSystem();
|
|
37
|
+
const filePath = fs.path.join(projectDir, "project.uiproj");
|
|
38
|
+
const raw = await fs.readFile(filePath, "utf-8");
|
|
39
|
+
const project = raw === null ? undefined : parseJson(raw);
|
|
40
|
+
if (raw !== null && project === undefined) {
|
|
41
|
+
throw new RulesCommandError2(`Could not read ${filePath}: it is not valid JSON.`, "invalid_argument", "Fix the project file, or run 'uip rules init <name> --force' to recreate it.");
|
|
42
|
+
}
|
|
43
|
+
if (!isJsonObject2(project) || project.ProjectType !== "BusinessRules") {
|
|
44
|
+
throw new RulesCommandError2(`${projectDir} is not a business rules project.`, "invalid_argument", "Pass the folder that holds the rules project's project.uiproj, created by 'uip rules init'.");
|
|
45
|
+
}
|
|
46
|
+
return typeof project.Name === "string" ? project.Name : "";
|
|
47
|
+
}
|
|
48
|
+
async function readPublishedEntryPoints(projectDir) {
|
|
49
|
+
const fs = getFileSystem();
|
|
50
|
+
const filePath = fs.path.join(projectDir, ENTRY_POINTS_FILE);
|
|
51
|
+
const raw = await fs.readFile(filePath, "utf-8");
|
|
52
|
+
if (raw === null) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const published = parseJson(raw);
|
|
56
|
+
if (!isJsonObject2(published) || !Array.isArray(published.entryPoints)) {
|
|
57
|
+
throw new RulesCommandError2(`${filePath} is not an entry-points document: it needs an "entryPoints" array.`, "invalid_argument", `Fix or delete ${ENTRY_POINTS_FILE}; deleting it gives every entry point a new uniqueId, which breaks the consumers bound to the old ones.`);
|
|
58
|
+
}
|
|
59
|
+
return published;
|
|
60
|
+
}
|
|
61
|
+
function parseJson(raw) {
|
|
62
|
+
const [, parsed] = catchError(() => JSON.parse(raw));
|
|
63
|
+
return parsed;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { ENTRY_POINTS_FILE, BINDINGS_FILE, readRuleProjectAsync, buildRuleEntryPointsAsync, readRulesProjectNameAsync };
|
|
67
|
+
|
|
68
|
+
//# debugId=DF70717AFFAF5D5E64756E2164756E21
|