@uipath/rules-tool 1.204.0-preview.249 → 1.204.0-preview.250
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/dist/DmnFactory-VWZOSZHH-jkpbxz3n.js +42 -0
- package/dist/DmnModelTypes-ATR7FVKZ-jp35cecy.js +18 -0
- package/dist/KieDmnMarshaller-6TTUU5B4-47q50gk4.js +20 -0
- package/dist/THIRD-PARTY-NOTICES.md +1054 -0
- package/dist/business-rules-bnr581tz.js +26 -0
- package/dist/{constants-za5vbzp8.js → constants-9pa118cj.js} +17 -10
- package/dist/{embedded-file-reader-wmsg31a8.js → embedded-file-reader-rf2g1kfj.js} +4 -1
- package/dist/first-party-service-sd8yaf73.js +27 -0
- package/dist/hitPolicyResult-4WDHTX4A-gk103w84.js +33 -0
- package/dist/index-2hzp9b97.js +116 -0
- package/dist/index-34pj9f36.js +48 -0
- package/dist/{index-zdwhfpt1.js → index-4c4exdzw.js} +370 -406
- package/dist/index-dqa169gp.js +25 -0
- package/dist/{index-we6zjs66.js → index-fs1nd5ap.js} +40 -4
- package/dist/{index-nzr4mx5p.js → index-sby22td6.js} +22 -2
- package/dist/{index-7wc0g78k.js → index-t4mx1a5e.js} +5 -2
- package/dist/index.js +9 -8
- package/dist/{jmespath-ab6tdc42.js → jmespath-231m3hyn.js} +1 -1
- package/dist/{js-yaml-a2bk27p6.js → js-yaml-88tdqrtd.js} +3 -1
- package/dist/rule-catalog-5gzpe93c.js +46 -0
- package/dist/rules-command-error-20gp2dv9.js +14 -0
- package/dist/{rules-debug-service-h1ahd6p3.js → rules-debug-service-cmgmbhyh.js} +36 -35
- package/dist/{rules-init-service-y678kjje.js → rules-init-service-b74thek5.js} +16 -12
- package/dist/{rules-refresh-service-btn64j8j.js → rules-refresh-service-jgk2kq9d.js} +14 -13
- package/dist/{rules-validate-service-sppr4x13.js → rules-validate-service-mr2fk58k.js} +13 -10
- package/dist/{tool-97x3zjcm.js → tool-19b4ect0.js} +158 -113
- package/dist/{tool-epsr41wx.js → tool-1de529jm.js} +3 -12
- package/dist/{tool-7xmarr97.js → tool-2cky8jwp.js} +2578 -1777
- package/dist/{tool-0bthsb3x.js → tool-4dfpdepw.js} +15 -15
- package/dist/tool-53w8skv5.js +262 -0
- package/dist/tool-7haj67tr.js +19 -0
- package/dist/{tool-e1mmqsjr.js → tool-8h4er38s.js} +411 -396
- package/dist/{tool-2trg1fpx.js → tool-8qy8pkp4.js} +8 -8
- package/dist/tool-av4mmsef.js +73 -0
- package/dist/{tool-8j9f6ns5.js → tool-eymjx05p.js} +11 -11
- package/dist/{tool-mm1x18d6.js → tool-gdtpsdn7.js} +28 -223
- package/dist/{tool-6sqt4zrx.js → tool-jxvk6306.js} +32 -29
- package/dist/tool-m41px07w.js +49 -0
- package/dist/{tool-k2s349kn.js → tool-mkn83w88.js} +17 -14
- package/dist/tool-pm3ewdxc.js +1115 -0
- package/dist/{tool-6rp0gx98.js → tool-tkcx6png.js} +107 -127
- package/dist/{tool-1dycs173.js → tool-wmh645tm.js} +202 -194
- package/dist/{tool-24mr6g8c.js → tool-x0z7hxqr.js} +9 -649
- package/dist/tool.js +8 -7
- package/package.json +2 -15
- package/dist/DmnFactory-SG3RP3T3-cr8e7mxz.js +0 -8
- package/dist/DmnFactory-VWZOSZHH-azx0zqcn.js +0 -8
- package/dist/DmnModelTypes-ATR7FVKZ-vkv7n0jn.js +0 -8
- package/dist/KieDmnMarshaller-6TTUU5B4-rsxhvw7a.js +0 -8
- package/dist/business-rules-d51977r1.js +0 -25
- package/dist/business-rules-dekge24t.js +0 -23
- package/dist/business-rules-ew76mbwg.js +0 -25
- package/dist/business-rules-jmwx05k2.js +0 -25
- package/dist/business-rules-zpzqxyce.js +0 -26
- package/dist/constants-4r8pfr16.js +0 -22
- package/dist/embedded-file-reader-0228j82a.js +0 -111
- package/dist/first-party-service-1qa6cp4d.js +0 -8
- package/dist/first-party-service-28dkctkz.js +0 -8
- package/dist/first-party-service-4fsz3cnj.js +0 -8
- package/dist/first-party-service-ahcc6xc6.js +0 -8
- package/dist/first-party-service-y1ccmsvp.js +0 -8
- package/dist/first-party-service-zpr1q3nd.js +0 -8
- package/dist/hitPolicyResult-4WDHTX4A-dbtkgpqp.js +0 -12
- package/dist/index-2zxy6zgp.js +0 -23
- package/dist/index-3nx77wfh.js +0 -23
- package/dist/index-43zg1wqe.js +0 -19621
- package/dist/index-47jera73.js +0 -23
- package/dist/index-70jn7cz1.js +0 -19631
- package/dist/index-8kb5kc5y.js +0 -24
- package/dist/index-97yad7ms.js +0 -8
- package/dist/index-dfn83hxf.js +0 -14
- package/dist/index-e301h23h.js +0 -24
- package/dist/index-frd259yv.js +0 -24
- package/dist/index-gc7cw2jh.js +0 -23
- package/dist/index-gya2v502.js +0 -8
- package/dist/index-hb3gk1wf.js +0 -24
- package/dist/index-nsnfdqd5.js +0 -24
- package/dist/index-vffktc0w.js +0 -166
- package/dist/index-xymrydfw.js +0 -3095
- package/dist/index-z2qk2qn6.js +0 -24
- package/dist/index-zecwgvg7.js +0 -23
- package/dist/rule-catalog-a5w86qns.js +0 -43
- package/dist/rule-catalog-etpf962f.js +0 -69
- package/dist/rule-catalog-q5cr17hf.js +0 -58
- package/dist/rule-catalog-vc98yg4n.js +0 -43
- package/dist/rule-catalog-z3h66kh5.js +0 -56
- package/dist/rules-command-error-10qmb5w7.js +0 -13
- package/dist/rules-command-error-5bdv4bcx.js +0 -13
- package/dist/rules-command-error-cmssf0w4.js +0 -13
- package/dist/rules-command-error-fsm3b1mv.js +0 -13
- package/dist/rules-debug-service-5rcdh3pj.js +0 -192
- package/dist/rules-debug-service-8q7mkd0r.js +0 -199
- package/dist/rules-debug-service-b9j29ejz.js +0 -192
- package/dist/rules-debug-service-v3jr3r1n.js +0 -192
- package/dist/rules-init-service-3c2yfa7p.js +0 -687
- package/dist/rules-init-service-3wgd9cqp.js +0 -100
- package/dist/rules-init-service-8fqytxq0.js +0 -685
- package/dist/rules-init-service-pspt7sje.js +0 -100
- package/dist/rules-init-service-sbtzw93j.js +0 -102
- package/dist/rules-init-service-x7paqa63.js +0 -687
- package/dist/rules-init-service-y7qzmxx0.js +0 -102
- package/dist/rules-refresh-service-4xxj6ex6.js +0 -65
- package/dist/rules-refresh-service-ba5jk1y9.js +0 -65
- package/dist/rules-refresh-service-qkmphj53.js +0 -65
- package/dist/rules-validate-service-dmgnfne7.js +0 -60
- package/dist/rules-validate-service-hk2d006t.js +0 -60
- package/dist/rules-validate-service-xp05n2d9.js +0 -60
- package/dist/tool-1pkqxwwd.js +0 -17472
- package/dist/tool-39fmkx2d.js +0 -611
- package/dist/tool-3e2q1x2y.js +0 -6578
- package/dist/tool-3j0747gg.js +0 -17077
- package/dist/tool-4z7zcq4z.js +0 -6058
- package/dist/tool-56smnjrh.js +0 -73
- package/dist/tool-5qygptrc.js +0 -6171
- package/dist/tool-5xx6x8pe.js +0 -6596
- package/dist/tool-7fkrd618.js +0 -1556
- package/dist/tool-89xzeteg.js +0 -361
- package/dist/tool-911s9czz.js +0 -570
- package/dist/tool-9bz2x04j.js +0 -40
- package/dist/tool-akh7nnqs.js +0 -704
- package/dist/tool-axfzew45.js +0 -1555
- package/dist/tool-b71jq9pt.js +0 -389
- package/dist/tool-bfj846v8.js +0 -141
- package/dist/tool-bvmc017m.js +0 -96
- package/dist/tool-bykz5ryf.js +0 -454
- package/dist/tool-c76qb8ap.js +0 -17052
- package/dist/tool-ca15515v.js +0 -570
- package/dist/tool-f9qs255w.js +0 -70
- package/dist/tool-ga79rety.js +0 -389
- package/dist/tool-gb547mcn.js +0 -141
- package/dist/tool-gta9rr4h.js +0 -68
- package/dist/tool-h2dfnxdq.js +0 -6486
- package/dist/tool-hg6vr5y9.js +0 -3769
- package/dist/tool-hgvnm4vh.js +0 -1843
- package/dist/tool-hjbf9aay.js +0 -571
- package/dist/tool-k5jm64n3.js +0 -5650
- package/dist/tool-ketztpgf.js +0 -73
- package/dist/tool-n1d88ryb.js +0 -6396
- package/dist/tool-nmqpwh9m.js +0 -6166
- package/dist/tool-pb80pswx.js +0 -73
- package/dist/tool-pcsgwpfw.js +0 -40
- package/dist/tool-q3c1bjyb.js +0 -454
- package/dist/tool-rwp1skmf.js +0 -40
- package/dist/tool-s3fbt22r.js +0 -454
- package/dist/tool-tmbst1r8.js +0 -68
- package/dist/tool-v6w109p0.js +0 -455
- package/dist/tool-w2js05qv.js +0 -389
- package/dist/tool-x67kek1m.js +0 -1838
- package/dist/tool-x89947ah.js +0 -17052
- package/dist/tool-xhksjdka.js +0 -4005
- package/dist/tool-yv3t4gg5.js +0 -108
- package/dist/tool-zbyb1ttx.js +0 -5650
- /package/dist/{tool-fbqnqf9k.js → tool-jd313s2x.js} +0 -0
- /package/dist/{tool-vyx8fpft.js → tool-qgqscsjc.js} +0 -0
package/dist/tool-39fmkx2d.js
DELETED
|
@@ -1,611 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
catchError,
|
|
3
|
-
RESULTS,
|
|
4
|
-
Pagination,
|
|
5
|
-
OutputFormatter,
|
|
6
|
-
Option,
|
|
7
|
-
processContext,
|
|
8
|
-
DEFAULT_PAGE_SIZE,
|
|
9
|
-
createHiddenDeprecatedTenantOption,
|
|
10
|
-
parseLimit,
|
|
11
|
-
parseOffset,
|
|
12
|
-
parseBoundedInt
|
|
13
|
-
} from "./tool-5xx6x8pe.js";
|
|
14
|
-
// package.json
|
|
15
|
-
var package_default = {
|
|
16
|
-
name: "@uipath/rules-tool",
|
|
17
|
-
author: "UiPath",
|
|
18
|
-
license: "SEE LICENSE IN LICENSE.txt",
|
|
19
|
-
version: "1.205.0",
|
|
20
|
-
description: "Create and manage UiPath Business Rules (DMN) projects.",
|
|
21
|
-
private: false,
|
|
22
|
-
repository: {
|
|
23
|
-
type: "git",
|
|
24
|
-
url: "https://github.com/UiPath/cli.git",
|
|
25
|
-
directory: "packages/rules-tool"
|
|
26
|
-
},
|
|
27
|
-
publishConfig: {
|
|
28
|
-
registry: "https://npm.pkg.github.com/@uipath"
|
|
29
|
-
},
|
|
30
|
-
keywords: [
|
|
31
|
-
"cli-tool"
|
|
32
|
-
],
|
|
33
|
-
type: "module",
|
|
34
|
-
main: "./dist/tool.js",
|
|
35
|
-
exports: {
|
|
36
|
-
".": "./dist/tool.js"
|
|
37
|
-
},
|
|
38
|
-
bin: {
|
|
39
|
-
"rules-tool": "./dist/index.js"
|
|
40
|
-
},
|
|
41
|
-
files: [
|
|
42
|
-
"dist"
|
|
43
|
-
],
|
|
44
|
-
scripts: {
|
|
45
|
-
build: "bun ../../tools/build-tool.ts",
|
|
46
|
-
package: "bun run build && bun pm pack",
|
|
47
|
-
lint: "biome check .",
|
|
48
|
-
"lint:fix": "biome check --write .",
|
|
49
|
-
test: "vitest run",
|
|
50
|
-
"test:coverage": "vitest run --coverage"
|
|
51
|
-
},
|
|
52
|
-
devDependencies: {
|
|
53
|
-
"@types/node": "^25.5.2",
|
|
54
|
-
"@uipath/auth": "workspace:*",
|
|
55
|
-
"@uipath/common": "workspace:*",
|
|
56
|
-
"@uipath/dmn-editor-utils": "0.1164.0",
|
|
57
|
-
"@uipath/filesystem": "workspace:*",
|
|
58
|
-
"@uipath/orchestrator-sdk": "workspace:*",
|
|
59
|
-
"@uipath/packager-tool-businessrules": "workspace:*",
|
|
60
|
-
"@uipath/solution-sdk": "workspace:*",
|
|
61
|
-
commander: "^14.0.3",
|
|
62
|
-
fflate: "^0.8.2",
|
|
63
|
-
typescript: "^7.0.2"
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// src/commands/debug.ts
|
|
68
|
-
var RULES_DEBUG_EXAMPLES = [
|
|
69
|
-
{
|
|
70
|
-
Description: "Upload the rules project to Studio Web and evaluate it with one set of input values, returning the trace id of the run",
|
|
71
|
-
Command: `uip rules debug ./LoanSolution/LoanEligibility --inputs '{"creditScore": 720}'`,
|
|
72
|
-
Output: {
|
|
73
|
-
Code: "RulesDebug",
|
|
74
|
-
Data: {
|
|
75
|
-
solutionId: "30823424-33e3-405e-f21c-08df1c789a14",
|
|
76
|
-
projectId: "ee8a16e8-385c-42c1-81ee-1628ab7d7cb7",
|
|
77
|
-
studioWebUrl: "https://cloud.uipath.com/acme/studio_/designer/ee8a16e8-385c-42c1-81ee-1628ab7d7cb7?solutionId=30823424-33e3-405e-f21c-08df1c789a14",
|
|
78
|
-
fileName: "LoanEligibility.dmn",
|
|
79
|
-
result: {
|
|
80
|
-
decisions: [
|
|
81
|
-
{
|
|
82
|
-
decisionName: "Eligibility",
|
|
83
|
-
outputs: { eligible: true }
|
|
84
|
-
}
|
|
85
|
-
]
|
|
86
|
-
},
|
|
87
|
-
traceId: "499d9124f5da47462bd6535055483918"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
];
|
|
92
|
-
var registerDebugCommand = (program) => {
|
|
93
|
-
program.command("debug").description("Upload the rules project's solution to Studio Web and evaluate it once through the rules engine. Returns the decision outputs and errors, and the trace id that shows which rules fired.").argument("<project-path>", "Path to the business rules project directory (must contain project.uiproj)").option("-i, --inputs <json>", "Input values as a JSON object or @file.json").option("--folder-path <path>", "Folder to evaluate in and record the run's trace under (default: your personal workspace)").option("--folder-key <key>", "Key (GUID) of the folder to evaluate in and record the run's trace under").option("--timeout <seconds>", "Maximum seconds to wait for the rules engine to evaluate (default: 120)", (value) => parseBoundedInt(value, "--timeout", { min: 1, max: 3600 })).option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", (value) => Number.parseInt(value, 10), 10).examples(RULES_DEBUG_EXAMPLES).trackedAction(processContext, async (projectPath, options) => {
|
|
94
|
-
const { reportRulesFailure } = await import("./rules-command-error-10qmb5w7.js");
|
|
95
|
-
const { debugRuleProjectAsync } = await import("./rules-debug-service-v3jr3r1n.js");
|
|
96
|
-
const [error, result] = await catchError(debugRuleProjectAsync(projectPath, options));
|
|
97
|
-
if (error) {
|
|
98
|
-
await reportRulesFailure("Failed to debug business rules project", error);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const errors = evaluationErrors(result);
|
|
102
|
-
if (errors.length > 0) {
|
|
103
|
-
OutputFormatter.error({
|
|
104
|
-
Result: RESULTS.Failure,
|
|
105
|
-
Code: "RulesDebug",
|
|
106
|
-
ErrorCode: "invalid_argument",
|
|
107
|
-
Message: failedEvaluationMessage(errors),
|
|
108
|
-
Instructions: [
|
|
109
|
-
"Check the input values against the rule's inputs; Data.result holds the engine's errors.",
|
|
110
|
-
traceHint(result)
|
|
111
|
-
].filter(Boolean).join(" "),
|
|
112
|
-
Retry: "RetryWillNotFix",
|
|
113
|
-
Data: formatDebugResult(result)
|
|
114
|
-
});
|
|
115
|
-
processContext.exit(1);
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
OutputFormatter.success({
|
|
119
|
-
Result: RESULTS.Success,
|
|
120
|
-
Code: "RulesDebug",
|
|
121
|
-
Data: formatDebugResult(result),
|
|
122
|
-
...successInstructions(result)
|
|
123
|
-
}, { preserveDataKeys: true });
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
function formatDebugResult(result) {
|
|
127
|
-
const { response } = result;
|
|
128
|
-
return {
|
|
129
|
-
solutionId: result.solutionId,
|
|
130
|
-
projectId: result.projectId,
|
|
131
|
-
studioWebUrl: result.studioWebUrl,
|
|
132
|
-
fileName: response.fileName,
|
|
133
|
-
result: response.result,
|
|
134
|
-
...response.error ? { error: response.error } : {},
|
|
135
|
-
...response.traceId ? { traceId: response.traceId } : {}
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
function evaluationErrors(result) {
|
|
139
|
-
const outcome = result.response.result;
|
|
140
|
-
return [
|
|
141
|
-
...outcome?.errors ?? [],
|
|
142
|
-
...(outcome?.decisions ?? []).flatMap((decision) => decision.error ? [decision.error] : []),
|
|
143
|
-
...result.response.error ? [result.response.error] : []
|
|
144
|
-
];
|
|
145
|
-
}
|
|
146
|
-
function failedEvaluationMessage(errors) {
|
|
147
|
-
const firstError = errors.find((error) => error.message);
|
|
148
|
-
return firstError?.message ? `The rules engine failed to evaluate the input: ${firstError.message}` : "The rules engine failed to evaluate the input.";
|
|
149
|
-
}
|
|
150
|
-
function successInstructions(result) {
|
|
151
|
-
const hint = traceHint(result);
|
|
152
|
-
return hint ? { Instructions: hint } : {};
|
|
153
|
-
}
|
|
154
|
-
function traceHint(result) {
|
|
155
|
-
return result.response.traceId ? `Run 'uip traces spans get ${result.response.traceId}' to see which rules fired.` : undefined;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// src/commands/folder-options.ts
|
|
159
|
-
function addFolderOptions(command) {
|
|
160
|
-
return command.option("--folder-path <path>", "Folder path (e.g., 'Shared')").option("--folder-key <key>", "Folder key (GUID)");
|
|
161
|
-
}
|
|
162
|
-
function addTenantOption(command) {
|
|
163
|
-
return command.addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>"));
|
|
164
|
-
}
|
|
165
|
-
function addUnsupportedTenantOption(command) {
|
|
166
|
-
return command.addOption(new Option("-t, --tenant <tenant-name>", "Not supported").hideHelp());
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// src/commands/describe.ts
|
|
170
|
-
var RULES_DESCRIBE_EXAMPLES = [
|
|
171
|
-
{
|
|
172
|
-
Description: "Read a deployed rule's entry points before binding it from a BPMN process, RPA workflow or case",
|
|
173
|
-
Command: 'uip rules describe LoanEligibility --folder-path "Shared"',
|
|
174
|
-
Output: {
|
|
175
|
-
Code: "RulesEntryPoints",
|
|
176
|
-
Data: [
|
|
177
|
-
{
|
|
178
|
-
UniqueId: "8a0f5c3e-2d1b-4f6a-9e7c-1b2a3c4d5e6f",
|
|
179
|
-
Path: "/LoanEligibility.dmn#Decision_Eligibility",
|
|
180
|
-
DisplayName: "Eligibility",
|
|
181
|
-
InputArguments: '{"type":"object","properties":{"creditScore":{"type":"number"}}}',
|
|
182
|
-
OutputArguments: '{"type":"object","properties":{"eligible":{"type":"boolean"}}}'
|
|
183
|
-
}
|
|
184
|
-
]
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
];
|
|
188
|
-
var registerDescribeCommand = (program) => {
|
|
189
|
-
const command = program.command("describe").description("(Preview) Get the entry points of a deployed business rule's active version, with their input and output argument schemas. Use them to map arguments when binding the rule. Same row shape as 'uip or packages entry-points'.").argument("<rule-name>", "Business rule name");
|
|
190
|
-
addUnsupportedTenantOption(addFolderOptions(command)).examples(RULES_DESCRIBE_EXAMPLES).trackedAction(processContext, async (name, options) => {
|
|
191
|
-
const rules = await import("./business-rules-ew76mbwg.js");
|
|
192
|
-
const { reportRulesFailure, RulesCommandError } = await import("./rules-command-error-10qmb5w7.js");
|
|
193
|
-
if (options.tenant !== undefined) {
|
|
194
|
-
await reportRulesFailure("Failed to describe business rule", new RulesCommandError("'uip rules describe' does not support --tenant: it reads the rule from the resource catalog of the tenant you are logged in to.", "invalid_argument", "Run 'uip login tenant set <tenant-name>' to switch tenants, then run the command again."));
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
const [error, entryPoints] = await catchError((async () => {
|
|
198
|
-
const folder = await rules.resolveRequiredFolder(options);
|
|
199
|
-
const { describeRuleAsync } = await import("./rule-catalog-etpf962f.js");
|
|
200
|
-
return describeRuleAsync(name, folder);
|
|
201
|
-
})());
|
|
202
|
-
if (error) {
|
|
203
|
-
await reportRulesFailure("Failed to describe business rule", error);
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
OutputFormatter.success({
|
|
207
|
-
Result: RESULTS.Success,
|
|
208
|
-
Code: "RulesEntryPoints",
|
|
209
|
-
Data: entryPoints
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
// src/commands/get.ts
|
|
215
|
-
var RULES_GET_EXAMPLES = [
|
|
216
|
-
{
|
|
217
|
-
Description: "Get a business rule by name",
|
|
218
|
-
Command: 'uip rules get LoanEligibility --folder-path "Shared"',
|
|
219
|
-
Output: {
|
|
220
|
-
Code: "RulesGet",
|
|
221
|
-
Data: {
|
|
222
|
-
Key: "3f1c2a9e-8b4d-4e2a-9c1f-6d7e8f9a0b1c",
|
|
223
|
-
Name: "LoanEligibility",
|
|
224
|
-
FolderPath: "Shared",
|
|
225
|
-
FolderKey: "9b2d4f6a-1c3e-4a5b-8d7f-0e1a2b3c4d5e",
|
|
226
|
-
Description: "Decides loan eligibility",
|
|
227
|
-
CurrentVersion: "1.0.2",
|
|
228
|
-
Tags: [],
|
|
229
|
-
CreationTime: "2026-09-01T10:00:00.000Z",
|
|
230
|
-
LastModificationTime: "2026-09-20T08:30:00.000Z"
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
];
|
|
235
|
-
var registerGetCommand = (program) => {
|
|
236
|
-
const command = program.command("get").description("(Preview) Get a deployed business rule by name. Use 'rules versions' for its version history and 'rules describe' for its argument contract.").argument("<rule-name>", "Business rule name");
|
|
237
|
-
addTenantOption(addFolderOptions(command)).examples(RULES_GET_EXAMPLES).trackedAction(processContext, async (name, options) => {
|
|
238
|
-
const rules = await import("./business-rules-ew76mbwg.js");
|
|
239
|
-
const { reportRulesFailure } = await import("./rules-command-error-10qmb5w7.js");
|
|
240
|
-
const [error, found] = await catchError((async () => {
|
|
241
|
-
const folder = await rules.resolveRequiredFolder(options);
|
|
242
|
-
const api = await rules.createRulesApi(options.tenant, folder);
|
|
243
|
-
const rule = await rules.findRuleByName(api, name, folder);
|
|
244
|
-
return { rule, folder };
|
|
245
|
-
})());
|
|
246
|
-
if (error) {
|
|
247
|
-
await reportRulesFailure("Failed to get business rule", error);
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
OutputFormatter.success({
|
|
251
|
-
Result: RESULTS.Success,
|
|
252
|
-
Code: "RulesGet",
|
|
253
|
-
Data: rules.formatRuleDetail(found.rule, found.folder)
|
|
254
|
-
});
|
|
255
|
-
});
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
// src/commands/init.ts
|
|
259
|
-
var RULES_INIT_EXAMPLES = [
|
|
260
|
-
{
|
|
261
|
-
Description: "Create a new business rules project. If the current directory is not already inside a solution, a parent solution named '<project>Solution' is created automatically and the rules project is nested inside it.",
|
|
262
|
-
Command: "uip rules init my-rules-project",
|
|
263
|
-
Output: {
|
|
264
|
-
Code: "RulesInit",
|
|
265
|
-
Data: {
|
|
266
|
-
Status: "Created successfully",
|
|
267
|
-
Path: "/workspace/my-rules-projectSolution/my-rules-project",
|
|
268
|
-
RuleStatus: "Created",
|
|
269
|
-
SolutionRegistration: {
|
|
270
|
-
Status: "Registered",
|
|
271
|
-
Message: "Project registered in parent solution.",
|
|
272
|
-
Solution: "/workspace/my-rules-projectSolution/my-rules-projectSolution.uipx",
|
|
273
|
-
Project: "my-rules-project/project.uiproj",
|
|
274
|
-
ProjectId: "00000000-0000-0000-0000-000000000000",
|
|
275
|
-
Instructions: `The project is listed in the parent solution manifest.
|
|
276
|
-
Packing or uploading the solution will sync solution resources automatically.`
|
|
277
|
-
},
|
|
278
|
-
AutoCreatedSolution: {
|
|
279
|
-
Name: "my-rules-projectSolution",
|
|
280
|
-
Path: "/workspace/my-rules-projectSolution",
|
|
281
|
-
SolutionFile: "/workspace/my-rules-projectSolution/my-rules-projectSolution.uipx"
|
|
282
|
-
},
|
|
283
|
-
ProjectArtifacts: { Created: true },
|
|
284
|
-
NextSteps: `The project is listed in the parent solution manifest.
|
|
285
|
-
Packing or uploading the solution will sync solution resources automatically.`
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
];
|
|
290
|
-
var registerInitCommand = (program) => {
|
|
291
|
-
program.command("init").description("Create a new business rules project seeded with one decision table. If run outside an existing solution, a parent '<name>Solution' is scaffolded automatically and the rules project is created inside it. If run inside an existing solution, the project is added to that solution.").argument("<name>", "Business rules project name").option("--force", "Force initialization even if target directory exists and is not empty").option("--skip-solution-registration", "Do not auto-register this project in the surrounding solution").examples(RULES_INIT_EXAMPLES).trackedAction(processContext, async (name, options) => {
|
|
292
|
-
const { rulesInitAsync } = await import("./rules-init-service-3wgd9cqp.js");
|
|
293
|
-
const [error, result] = await catchError(rulesInitAsync(name, {
|
|
294
|
-
force: options.force,
|
|
295
|
-
skipRegistration: options.skipSolutionRegistration === true
|
|
296
|
-
}));
|
|
297
|
-
if (error) {
|
|
298
|
-
OutputFormatter.error({
|
|
299
|
-
Result: RESULTS.Failure,
|
|
300
|
-
Message: "Failed to create business rules project",
|
|
301
|
-
Instructions: error.message
|
|
302
|
-
});
|
|
303
|
-
processContext.exit(1);
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
const data = {
|
|
307
|
-
Status: "Created successfully",
|
|
308
|
-
Path: result.projectDir,
|
|
309
|
-
RuleStatus: result.ruleStatus,
|
|
310
|
-
SolutionRegistration: result.registration
|
|
311
|
-
};
|
|
312
|
-
if (result.autoCreatedSolution) {
|
|
313
|
-
data.AutoCreatedSolution = result.autoCreatedSolution;
|
|
314
|
-
}
|
|
315
|
-
if (result.projectArtifacts) {
|
|
316
|
-
data.ProjectArtifacts = result.projectArtifacts;
|
|
317
|
-
}
|
|
318
|
-
if (result.registration.Instructions) {
|
|
319
|
-
data.NextSteps = result.registration.Instructions;
|
|
320
|
-
}
|
|
321
|
-
OutputFormatter.success({
|
|
322
|
-
Result: RESULTS.Success,
|
|
323
|
-
Code: "RulesInit",
|
|
324
|
-
Data: data
|
|
325
|
-
});
|
|
326
|
-
});
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
// src/commands/list.ts
|
|
330
|
-
var RULES_LIST_EXAMPLES = [
|
|
331
|
-
{
|
|
332
|
-
Description: "List the business rules in one folder, with their current version",
|
|
333
|
-
Command: 'uip rules list --folder-path "Shared" --limit 1',
|
|
334
|
-
Output: {
|
|
335
|
-
Code: "RulesList",
|
|
336
|
-
Data: [
|
|
337
|
-
{
|
|
338
|
-
Key: "3f1c2a9e-8b4d-4e2a-9c1f-6d7e8f9a0b1c",
|
|
339
|
-
Name: "LoanEligibility",
|
|
340
|
-
FolderPath: "Shared",
|
|
341
|
-
FolderKey: "9b2d4f6a-1c3e-4a5b-8d7f-0e1a2b3c4d5e",
|
|
342
|
-
Description: "Decides loan eligibility",
|
|
343
|
-
CurrentVersion: "1.0.2"
|
|
344
|
-
}
|
|
345
|
-
]
|
|
346
|
-
}
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
Description: "List the business rules in every folder you can see, one row per folder a rule is shared to",
|
|
350
|
-
Command: "uip rules list --all-folders",
|
|
351
|
-
Output: {
|
|
352
|
-
Code: "RulesList",
|
|
353
|
-
Data: [
|
|
354
|
-
{
|
|
355
|
-
Key: "3f1c2a9e-8b4d-4e2a-9c1f-6d7e8f9a0b1c",
|
|
356
|
-
Name: "LoanEligibility",
|
|
357
|
-
FolderPath: "Shared",
|
|
358
|
-
FolderKey: "9b2d4f6a-1c3e-4a5b-8d7f-0e1a2b3c4d5e",
|
|
359
|
-
Description: "Decides loan eligibility"
|
|
360
|
-
}
|
|
361
|
-
]
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
];
|
|
365
|
-
var registerListCommand = (program) => {
|
|
366
|
-
const command = program.command("list").description("(Preview) List business rules deployed to Orchestrator in a folder, or across all accessible folders with --all-folders. Returns key, name, folder, description and, for one folder, current version. --all-folders returns one row per folder a rule is shared to.");
|
|
367
|
-
addTenantOption(addFolderOptions(command)).option("--all-folders", "List business rules across all accessible folders").option("-l, --limit <number>", "Number of items to return", parseLimit, DEFAULT_PAGE_SIZE).option("--offset <number>", "Number of items to skip", parseOffset, 0).examples(RULES_LIST_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
368
|
-
const { reportRulesFailure } = await import("./rules-command-error-10qmb5w7.js");
|
|
369
|
-
const [error, result] = await catchError(listRules(options));
|
|
370
|
-
if (error) {
|
|
371
|
-
await reportRulesFailure("Failed to list business rules", error);
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
OutputFormatter.success({
|
|
375
|
-
Result: RESULTS.Success,
|
|
376
|
-
Code: "RulesList",
|
|
377
|
-
Pagination: new Pagination({
|
|
378
|
-
returned: result.rows.length,
|
|
379
|
-
limit: options.limit,
|
|
380
|
-
offset: options.offset,
|
|
381
|
-
hasMore: result.hasMore
|
|
382
|
-
}),
|
|
383
|
-
Data: result.rows
|
|
384
|
-
});
|
|
385
|
-
});
|
|
386
|
-
};
|
|
387
|
-
async function listRules(options) {
|
|
388
|
-
const rules = await import("./business-rules-ew76mbwg.js");
|
|
389
|
-
const { RulesCommandError } = await import("./rules-command-error-10qmb5w7.js");
|
|
390
|
-
const hasFolderSelector = options.folderPath !== undefined || options.folderKey !== undefined;
|
|
391
|
-
if (options.allFolders && hasFolderSelector) {
|
|
392
|
-
throw new RulesCommandError("Option --all-folders cannot be used with --folder-path or --folder-key.", "invalid_argument", "Use --all-folders by itself, or provide a single folder selector with --folder-path or --folder-key.");
|
|
393
|
-
}
|
|
394
|
-
if (options.allFolders) {
|
|
395
|
-
return listRulesAcrossFolders(options);
|
|
396
|
-
}
|
|
397
|
-
if (!hasFolderSelector) {
|
|
398
|
-
throw new RulesCommandError("Missing required option --folder-path, --folder-key or --all-folders.", "invalid_argument", "Provide --folder-path <path> or --folder-key <key> to list one folder, or --all-folders to list every folder. Run 'uip or folders list' to find folder paths.");
|
|
399
|
-
}
|
|
400
|
-
const folder = await rules.resolveRequiredFolder(options);
|
|
401
|
-
const api = await rules.createRulesApi(options.tenant, folder);
|
|
402
|
-
const page = await api.businessRulesGet({
|
|
403
|
-
$top: options.limit,
|
|
404
|
-
$skip: options.offset
|
|
405
|
-
});
|
|
406
|
-
return {
|
|
407
|
-
rows: (page.value ?? []).map((rule) => rules.formatRule(rule, folder)),
|
|
408
|
-
hasMore: undefined
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
async function listRulesAcrossFolders(options) {
|
|
412
|
-
const { RulesCommandError } = await import("./rules-command-error-10qmb5w7.js");
|
|
413
|
-
if (options.tenant !== undefined) {
|
|
414
|
-
throw new RulesCommandError("'uip rules list --all-folders' does not support --tenant: it lists rules from the resource catalog of the tenant you are logged in to.", "invalid_argument", "Drop --all-folders and pass --folder-path <path> or --folder-key <key> to list one folder in that tenant, or run 'uip login tenant set <tenant-name>' to switch tenants.");
|
|
415
|
-
}
|
|
416
|
-
const { listRulesAcrossFoldersAsync } = await import("./rule-catalog-etpf962f.js");
|
|
417
|
-
const result = await listRulesAcrossFoldersAsync(options.limit, options.offset);
|
|
418
|
-
if (!result) {
|
|
419
|
-
throw new RulesCommandError("Listing business rules across folders needs the Node CLI: the browser build cannot read the resource catalog.", "configuration_error", "Drop --all-folders and pass --folder-path <path> or --folder-key <key> to list one folder.");
|
|
420
|
-
}
|
|
421
|
-
return result;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// src/commands/refresh.ts
|
|
425
|
-
var RULES_REFRESH_EXAMPLES = [
|
|
426
|
-
{
|
|
427
|
-
Description: "Regenerate a rules project's entry points after editing its .dmn outside Studio Web",
|
|
428
|
-
Command: "uip rules refresh ./LoanEligibilitySolution/LoanEligibility",
|
|
429
|
-
Output: {
|
|
430
|
-
Code: "RulesRefresh",
|
|
431
|
-
Data: {
|
|
432
|
-
Status: "Updated business rules package files",
|
|
433
|
-
ProjectPath: "/workspace/LoanEligibilitySolution/LoanEligibility",
|
|
434
|
-
DmnFiles: ["Business rule.dmn"],
|
|
435
|
-
WrittenFiles: ["entry-points.json"],
|
|
436
|
-
UnchangedFiles: ["bindings_v2.json"]
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
];
|
|
441
|
-
var registerRefreshCommand = (program) => {
|
|
442
|
-
program.command("refresh").description("Regenerate entry-points.json and bindings_v2.json from the rules project's .dmn, keeping each published entry point's uniqueId. Run it after editing a .dmn outside Studio Web, before 'uip solution pack'.").argument("<project-path>", "Path to the business rules project directory (must contain project.uiproj)").examples(RULES_REFRESH_EXAMPLES).trackedAction(processContext, async (projectPath) => {
|
|
443
|
-
const { reportRulesFailure } = await import("./rules-command-error-10qmb5w7.js");
|
|
444
|
-
const { refreshRuleProjectAsync } = await import("./rules-refresh-service-ba5jk1y9.js");
|
|
445
|
-
const [error, result] = await catchError(refreshRuleProjectAsync(projectPath));
|
|
446
|
-
if (error) {
|
|
447
|
-
await reportRulesFailure("Failed to refresh business rules package files", error);
|
|
448
|
-
return;
|
|
449
|
-
}
|
|
450
|
-
OutputFormatter.success({
|
|
451
|
-
Result: RESULTS.Success,
|
|
452
|
-
Code: "RulesRefresh",
|
|
453
|
-
Data: {
|
|
454
|
-
Status: result.writtenFiles.length > 0 ? "Updated business rules package files" : "Business rules package files are up to date",
|
|
455
|
-
ProjectPath: result.projectDir,
|
|
456
|
-
DmnFiles: result.dmnFiles,
|
|
457
|
-
WrittenFiles: result.writtenFiles,
|
|
458
|
-
UnchangedFiles: result.unchangedFiles
|
|
459
|
-
}
|
|
460
|
-
});
|
|
461
|
-
});
|
|
462
|
-
};
|
|
463
|
-
|
|
464
|
-
// src/commands/validate.ts
|
|
465
|
-
var RULES_VALIDATE_EXAMPLES = [
|
|
466
|
-
{
|
|
467
|
-
Description: "Check a rules project against what Studio Web accepts before 'uip solution pack'",
|
|
468
|
-
Command: "uip rules validate ./LoanEligibilitySolution/LoanEligibility",
|
|
469
|
-
Output: {
|
|
470
|
-
Code: "RulesValidate",
|
|
471
|
-
Data: {
|
|
472
|
-
Status: "Valid",
|
|
473
|
-
ProjectPath: "/workspace/LoanEligibilitySolution/LoanEligibility",
|
|
474
|
-
DmnFiles: ["Business rule.dmn"],
|
|
475
|
-
Diagnostics: []
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
];
|
|
480
|
-
var registerValidateCommand = (program) => {
|
|
481
|
-
program.command("validate").description("Check a rules project for what Studio Web blocks publish and debug on, the designer's diagnostics for each .dmn, and for an entry-points.json out of step with the .dmn. Errors exit 1; warnings are reported only.").argument("<project-path>", "Path to the business rules project directory (must contain project.uiproj)").examples(RULES_VALIDATE_EXAMPLES).trackedAction(processContext, async (projectPath) => {
|
|
482
|
-
const { reportRulesFailure } = await import("./rules-command-error-10qmb5w7.js");
|
|
483
|
-
const { validateRuleProjectAsync } = await import("./rules-validate-service-sppr4x13.js");
|
|
484
|
-
const [error, result] = await catchError(validateRuleProjectAsync(projectPath));
|
|
485
|
-
if (error) {
|
|
486
|
-
await reportRulesFailure("Failed to validate business rules project", error);
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
const errors = result.diagnostics.filter((d) => d.severity === "error").length;
|
|
490
|
-
if (errors > 0) {
|
|
491
|
-
const warnings = result.diagnostics.length - errors;
|
|
492
|
-
OutputFormatter.error({
|
|
493
|
-
Result: RESULTS.Failure,
|
|
494
|
-
Code: "RulesValidate",
|
|
495
|
-
ErrorCode: "invalid_argument",
|
|
496
|
-
Message: `Validation failed for ${result.projectDir}`,
|
|
497
|
-
Instructions: `Found ${errors} error(s) and ${warnings} warning(s):
|
|
498
|
-
${result.diagnostics.map(formatDiagnosticLine).join(`
|
|
499
|
-
`)}`,
|
|
500
|
-
Retry: "RetryWillNotFix",
|
|
501
|
-
Data: formatResult(result, "Invalid")
|
|
502
|
-
});
|
|
503
|
-
processContext.exit(1);
|
|
504
|
-
return;
|
|
505
|
-
}
|
|
506
|
-
OutputFormatter.success({
|
|
507
|
-
Result: RESULTS.Success,
|
|
508
|
-
Code: "RulesValidate",
|
|
509
|
-
Data: formatResult(result, "Valid")
|
|
510
|
-
}, { preserveDataKeys: ["Target"] });
|
|
511
|
-
});
|
|
512
|
-
};
|
|
513
|
-
function formatDiagnosticLine(d) {
|
|
514
|
-
const fix = d.instructions ? ` ${d.instructions}` : "";
|
|
515
|
-
return ` - [${d.severity}] [${d.file}] ${d.code}: ${d.message}${fix}`;
|
|
516
|
-
}
|
|
517
|
-
function formatResult(result, status) {
|
|
518
|
-
return {
|
|
519
|
-
Status: status,
|
|
520
|
-
ProjectPath: result.projectDir,
|
|
521
|
-
DmnFiles: result.dmnFiles,
|
|
522
|
-
Diagnostics: result.diagnostics.map((d) => ({
|
|
523
|
-
File: d.file,
|
|
524
|
-
Code: d.code,
|
|
525
|
-
Severity: d.severity,
|
|
526
|
-
Message: d.message,
|
|
527
|
-
Instructions: d.instructions,
|
|
528
|
-
Target: d.target
|
|
529
|
-
}))
|
|
530
|
-
};
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
// src/commands/versions.ts
|
|
534
|
-
var RULES_VERSIONS_EXAMPLES = [
|
|
535
|
-
{
|
|
536
|
-
Description: "List the versions of a business rule",
|
|
537
|
-
Command: 'uip rules versions LoanEligibility --folder-path "Shared"',
|
|
538
|
-
Output: {
|
|
539
|
-
Code: "RulesVersionList",
|
|
540
|
-
Data: [
|
|
541
|
-
{
|
|
542
|
-
Version: "1.0.2",
|
|
543
|
-
IsActive: true,
|
|
544
|
-
CreationTime: "2026-09-20T08:30:00.000Z"
|
|
545
|
-
},
|
|
546
|
-
{
|
|
547
|
-
Version: "1.0.1",
|
|
548
|
-
IsActive: false,
|
|
549
|
-
CreationTime: "2026-09-10T14:05:00.000Z"
|
|
550
|
-
}
|
|
551
|
-
]
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
];
|
|
555
|
-
var registerVersionsCommand = (program) => {
|
|
556
|
-
const command = program.command("versions").description("(Preview) List the versions of a deployed business rule. The active version is the one consumers evaluate.").argument("<rule-name>", "Business rule name");
|
|
557
|
-
addTenantOption(addFolderOptions(command)).option("-l, --limit <number>", "Number of versions to return", parseLimit, DEFAULT_PAGE_SIZE).option("--offset <number>", "Number of versions to skip", parseOffset, 0).examples(RULES_VERSIONS_EXAMPLES).trackedAction(processContext, async (name, options) => {
|
|
558
|
-
const rules = await import("./business-rules-ew76mbwg.js");
|
|
559
|
-
const { reportRulesFailure } = await import("./rules-command-error-10qmb5w7.js");
|
|
560
|
-
const [error, page] = await catchError((async () => {
|
|
561
|
-
const folder = await rules.resolveRequiredFolder(options);
|
|
562
|
-
const api = await rules.createRulesApi(options.tenant, folder);
|
|
563
|
-
const rule = await rules.findRuleByName(api, name, folder);
|
|
564
|
-
if (!rule.id) {
|
|
565
|
-
throw rules.ruleNotFound(name, folder);
|
|
566
|
-
}
|
|
567
|
-
return api.businessRulesGetVersionListById({
|
|
568
|
-
id: rule.id,
|
|
569
|
-
$top: options.limit,
|
|
570
|
-
$skip: options.offset
|
|
571
|
-
});
|
|
572
|
-
})());
|
|
573
|
-
if (error) {
|
|
574
|
-
await reportRulesFailure("Failed to list business rule versions", error);
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
const items = page.value ?? [];
|
|
578
|
-
OutputFormatter.success({
|
|
579
|
-
Result: RESULTS.Success,
|
|
580
|
-
Code: "RulesVersionList",
|
|
581
|
-
Pagination: new Pagination({
|
|
582
|
-
returned: items.length,
|
|
583
|
-
limit: options.limit,
|
|
584
|
-
offset: options.offset
|
|
585
|
-
}),
|
|
586
|
-
Data: items.map(rules.formatVersion)
|
|
587
|
-
});
|
|
588
|
-
});
|
|
589
|
-
};
|
|
590
|
-
|
|
591
|
-
// src/tool.ts
|
|
592
|
-
var metadata2 = {
|
|
593
|
-
name: "rules-tool",
|
|
594
|
-
version: package_default.version,
|
|
595
|
-
description: "Create and manage UiPath Business Rules (DMN) projects.",
|
|
596
|
-
commandPrefix: "rules"
|
|
597
|
-
};
|
|
598
|
-
var registerCommands2 = async (program) => {
|
|
599
|
-
registerInitCommand(program);
|
|
600
|
-
registerRefreshCommand(program);
|
|
601
|
-
registerValidateCommand(program);
|
|
602
|
-
registerListCommand(program);
|
|
603
|
-
registerGetCommand(program);
|
|
604
|
-
registerVersionsCommand(program);
|
|
605
|
-
registerDescribeCommand(program);
|
|
606
|
-
registerDebugCommand(program);
|
|
607
|
-
};
|
|
608
|
-
|
|
609
|
-
export { metadata2, registerCommands2 };
|
|
610
|
-
|
|
611
|
-
//# debugId=EB5C73029DDE747B64756E2164756E21
|