@uipath/rules-tool 1.204.0-preview.249 → 1.204.0-preview.254
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 +1085 -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-yvh448xp.js} +36 -35
- package/dist/{rules-init-service-y678kjje.js → rules-init-service-ewahc0vh.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-x67kek1m.js → tool-2qj74g14.js} +12 -652
- 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-6sqt4zrx.js → tool-cgmy94zt.js} +32 -29
- package/dist/{tool-8j9f6ns5.js → tool-eymjx05p.js} +11 -11
- package/dist/{tool-mm1x18d6.js → tool-gdtpsdn7.js} +28 -223
- 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.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-24mr6g8c.js +0 -1556
- 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-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/index-z2qk2qn6.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
JsonSerializerNames2,
|
|
3
|
-
JsonSerializer2,
|
|
4
|
-
CAMEL_CASE_ENUM_PROPERTIES2,
|
|
5
|
-
SHARED_CORE_ABSTRACTIONS_PASCAL_CASE_PROPERTIES2,
|
|
6
|
-
RESOURCE_BUILDER_PASCAL_CASE_PROPERTIES2,
|
|
7
|
-
PASCAL_CASE_ENUM_PROPERTIES2,
|
|
8
|
-
JsonSerializerFactory2,
|
|
9
|
-
JsonSerializerProxy2,
|
|
10
|
-
StreamSerializer2
|
|
11
|
-
} from "./tool-mm1x18d6.js";
|
|
12
|
-
export {
|
|
13
|
-
CAMEL_CASE_ENUM_PROPERTIES2 as CAMEL_CASE_ENUM_PROPERTIES,
|
|
14
|
-
JsonSerializer2 as JsonSerializer,
|
|
15
|
-
JsonSerializerFactory2 as JsonSerializerFactory,
|
|
16
|
-
JsonSerializerNames2 as JsonSerializerNames,
|
|
17
|
-
JsonSerializerProxy2 as JsonSerializerProxy,
|
|
18
|
-
PASCAL_CASE_ENUM_PROPERTIES2 as PASCAL_CASE_ENUM_PROPERTIES,
|
|
19
|
-
RESOURCE_BUILDER_PASCAL_CASE_PROPERTIES2 as RESOURCE_BUILDER_PASCAL_CASE_PROPERTIES,
|
|
20
|
-
SHARED_CORE_ABSTRACTIONS_PASCAL_CASE_PROPERTIES2 as SHARED_CORE_ABSTRACTIONS_PASCAL_CASE_PROPERTIES,
|
|
21
|
-
StreamSerializer2 as StreamSerializer
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
//# debugId=1649BE3E5BA7790D64756E2164756E21
|
package/dist/index-zecwgvg7.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createResourceBuilderServices2,
|
|
3
|
-
addProjectArtifactsToSolutionAsync2,
|
|
4
|
-
getRemoteResourceClients2,
|
|
5
|
-
findCatalogEntityAsync2,
|
|
6
|
-
toResourceReference2,
|
|
7
|
-
exportResourceDefinitionAsync2,
|
|
8
|
-
readSpecEntryPoints2
|
|
9
|
-
} from "./tool-3j0747gg.js";
|
|
10
|
-
import"./tool-q3c1bjyb.js";
|
|
11
|
-
import"./tool-n1d88ryb.js";
|
|
12
|
-
import"./tool-6rp0gx98.js";
|
|
13
|
-
export {
|
|
14
|
-
addProjectArtifactsToSolutionAsync2 as addProjectArtifactsToSolutionAsync,
|
|
15
|
-
createResourceBuilderServices2 as createResourceBuilderServices,
|
|
16
|
-
exportResourceDefinitionAsync2 as exportResourceDefinitionAsync,
|
|
17
|
-
findCatalogEntityAsync2 as findCatalogEntityAsync,
|
|
18
|
-
getRemoteResourceClients2 as getRemoteResourceClients,
|
|
19
|
-
readSpecEntryPoints2 as readSpecEntryPoints,
|
|
20
|
-
toResourceReference2 as toResourceReference
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
//# debugId=E74EC712ED5645CE64756E2164756E21
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import"./tool-n1d88ryb.js";
|
|
2
|
-
import"./tool-6rp0gx98.js";
|
|
3
|
-
import {
|
|
4
|
-
getSolutionAuthContext,
|
|
5
|
-
createResourceBuilderServices2,
|
|
6
|
-
getRemoteResourceClients2,
|
|
7
|
-
findCatalogEntityAsync2,
|
|
8
|
-
toResourceReference2,
|
|
9
|
-
exportResourceDefinitionAsync2,
|
|
10
|
-
readSpecEntryPoints2
|
|
11
|
-
} from "./tool-3j0747gg.js";
|
|
12
|
-
import {
|
|
13
|
-
RulesCommandError2
|
|
14
|
-
} from "./tool-rwp1skmf.js";
|
|
15
|
-
import {
|
|
16
|
-
ruleNotFound2
|
|
17
|
-
} from "./tool-ketztpgf.js";
|
|
18
|
-
import"./tool-q3c1bjyb.js";
|
|
19
|
-
|
|
20
|
-
// src/services/rule-catalog.ts
|
|
21
|
-
var BUSINESS_RULE_ENTITY_TYPE = "BusinessRule";
|
|
22
|
-
async function describeRuleAsync(name, folder) {
|
|
23
|
-
await getSolutionAuthContext({});
|
|
24
|
-
const { catalog, importer } = getRemoteResourceClients2(await createResourceBuilderServices2());
|
|
25
|
-
const entity = await findCatalogEntityAsync2(catalog, { name, entityTypes: [BUSINESS_RULE_ENTITY_TYPE] }, (e) => e.entityName?.toLowerCase() === name.toLowerCase() && e.folderKey?.toLowerCase() === folder.key.toLowerCase());
|
|
26
|
-
if (!entity?.entityKey) {
|
|
27
|
-
throw ruleNotFound2(name, folder);
|
|
28
|
-
}
|
|
29
|
-
const definition = await exportResourceDefinitionAsync2(importer, toResourceReference2(entity));
|
|
30
|
-
return readEntryPoints(definition?.spec, name);
|
|
31
|
-
}
|
|
32
|
-
function readEntryPoints(spec, name) {
|
|
33
|
-
const entryPoints = readSpecEntryPoints2(spec);
|
|
34
|
-
if (!entryPoints) {
|
|
35
|
-
throw new RulesCommandError2(`Business rule '${name}' has no argument contract on its resource.`, "configuration_error", "Redeploy the rule from its solution with 'uip solution publish' and 'uip solution deploy run' so its package carries entry-points.json. If it still has no contract, contact your tenant administrator.");
|
|
36
|
-
}
|
|
37
|
-
return entryPoints;
|
|
38
|
-
}
|
|
39
|
-
export {
|
|
40
|
-
describeRuleAsync
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
//# debugId=7827CA15CAD3233064756E2164756E21
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import"./tool-hg6vr5y9.js";
|
|
2
|
-
import"./tool-5xx6x8pe.js";
|
|
3
|
-
import {
|
|
4
|
-
getSolutionAuthContext,
|
|
5
|
-
createResourceBuilderServices2,
|
|
6
|
-
getRemoteResourceClients2,
|
|
7
|
-
findCatalogEntityAsync2,
|
|
8
|
-
toResourceReference2,
|
|
9
|
-
exportResourceDefinitionAsync2,
|
|
10
|
-
readSpecEntryPoints2
|
|
11
|
-
} from "./tool-1pkqxwwd.js";
|
|
12
|
-
import {
|
|
13
|
-
RulesCommandError2
|
|
14
|
-
} from "./tool-2trg1fpx.js";
|
|
15
|
-
import {
|
|
16
|
-
ruleNotFound2
|
|
17
|
-
} from "./tool-pb80pswx.js";
|
|
18
|
-
import"./tool-v6w109p0.js";
|
|
19
|
-
|
|
20
|
-
// src/services/rule-catalog.ts
|
|
21
|
-
var BUSINESS_RULE_ENTITY_TYPE = "BusinessRule";
|
|
22
|
-
async function describeRuleAsync(name, folder) {
|
|
23
|
-
await getSolutionAuthContext({});
|
|
24
|
-
const { catalog, importer } = getRemoteResourceClients2(await createResourceBuilderServices2());
|
|
25
|
-
const entity = await findCatalogEntityAsync2(catalog, { name, entityTypes: [BUSINESS_RULE_ENTITY_TYPE] }, (e) => e.entityName?.toLowerCase() === name.toLowerCase() && e.folderKey?.toLowerCase() === folder.key.toLowerCase());
|
|
26
|
-
if (!entity?.entityKey) {
|
|
27
|
-
throw ruleNotFound2(name, folder);
|
|
28
|
-
}
|
|
29
|
-
const definition = await exportResourceDefinitionAsync2(importer, toResourceReference2(entity));
|
|
30
|
-
return readEntryPoints(definition?.spec, name);
|
|
31
|
-
}
|
|
32
|
-
async function listRulesAcrossFoldersAsync(limit, offset) {
|
|
33
|
-
await getSolutionAuthContext({});
|
|
34
|
-
const { catalog } = getRemoteResourceClients2(await createResourceBuilderServices2());
|
|
35
|
-
const rows = [];
|
|
36
|
-
let pageCursor;
|
|
37
|
-
do {
|
|
38
|
-
const page = await catalog.searchFolderEntities({
|
|
39
|
-
entityTypes: [BUSINESS_RULE_ENTITY_TYPE],
|
|
40
|
-
pageSize: 100,
|
|
41
|
-
pageCursor
|
|
42
|
-
});
|
|
43
|
-
rows.push(...(page.items ?? []).filter((e) => e.entityKey && e.entityName));
|
|
44
|
-
pageCursor = page.nextPage ?? undefined;
|
|
45
|
-
} while (pageCursor && rows.length <= offset + limit);
|
|
46
|
-
return {
|
|
47
|
-
rows: rows.slice(offset, offset + limit).map((entity) => ({
|
|
48
|
-
Key: entity.entityKey ?? "",
|
|
49
|
-
Name: entity.entityName ?? "",
|
|
50
|
-
FolderPath: entity.fullyQualifiedName ?? "",
|
|
51
|
-
FolderKey: entity.folderKey ?? "",
|
|
52
|
-
Description: entity.entityDescription ?? ""
|
|
53
|
-
})),
|
|
54
|
-
hasMore: rows.length > offset + limit
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function readEntryPoints(spec, name) {
|
|
58
|
-
const entryPoints = readSpecEntryPoints2(spec);
|
|
59
|
-
if (!entryPoints) {
|
|
60
|
-
throw new RulesCommandError2(`Business rule '${name}' has no argument contract on its resource.`, "configuration_error", "Redeploy the rule from its solution with 'uip solution publish' and 'uip solution deploy run' so its package carries entry-points.json. If it still has no contract, contact your tenant administrator.");
|
|
61
|
-
}
|
|
62
|
-
return entryPoints;
|
|
63
|
-
}
|
|
64
|
-
export {
|
|
65
|
-
describeRuleAsync,
|
|
66
|
-
listRulesAcrossFoldersAsync
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
//# debugId=28CEDB119BA33EDC64756E2164756E21
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
catchError
|
|
3
|
-
} from "./tool-5qygptrc.js";
|
|
4
|
-
import"./tool-8j9f6ns5.js";
|
|
5
|
-
import {
|
|
6
|
-
getSolutionAuthContext,
|
|
7
|
-
createResourceBuilderServices2,
|
|
8
|
-
getRemoteResourceClients2,
|
|
9
|
-
findCatalogEntityAsync2,
|
|
10
|
-
toResourceReference2,
|
|
11
|
-
exportResourceDefinitionAsync2,
|
|
12
|
-
readSpecProperty2
|
|
13
|
-
} from "./tool-c76qb8ap.js";
|
|
14
|
-
import {
|
|
15
|
-
RulesCommandError2
|
|
16
|
-
} from "./tool-9bz2x04j.js";
|
|
17
|
-
import {
|
|
18
|
-
ruleNotFound2
|
|
19
|
-
} from "./tool-f9qs255w.js";
|
|
20
|
-
import"./tool-s3fbt22r.js";
|
|
21
|
-
|
|
22
|
-
// src/services/rule-catalog.ts
|
|
23
|
-
var BUSINESS_RULE_ENTITY_TYPE = "BusinessRule";
|
|
24
|
-
async function describeRuleAsync(name, folder) {
|
|
25
|
-
await getSolutionAuthContext({});
|
|
26
|
-
const { catalog, importer } = getRemoteResourceClients2(await createResourceBuilderServices2());
|
|
27
|
-
const entity = await findCatalogEntityAsync2(catalog, { name, entityTypes: [BUSINESS_RULE_ENTITY_TYPE] }, (e) => e.entityName?.toLowerCase() === name.toLowerCase() && e.folderKey?.toLowerCase() === folder.key.toLowerCase());
|
|
28
|
-
if (!entity?.entityKey) {
|
|
29
|
-
throw ruleNotFound2(name, folder);
|
|
30
|
-
}
|
|
31
|
-
const definition = await exportResourceDefinitionAsync2(importer, toResourceReference2(entity));
|
|
32
|
-
return readEntryPoints(definition?.spec, name);
|
|
33
|
-
}
|
|
34
|
-
function readEntryPoints(spec, name) {
|
|
35
|
-
const entryPoints = parseEntryPoints(readSpecProperty2(spec, "entryPoints"));
|
|
36
|
-
if (!Array.isArray(entryPoints) || !entryPoints.every((entry) => entry !== null && typeof entry === "object")) {
|
|
37
|
-
throw new RulesCommandError2(`Business rule '${name}' has no argument contract on its resource.`, "configuration_error", "Redeploy the rule from its solution with 'uip solution publish' and 'uip solution deploy run' so its package carries entry-points.json. If it still has no contract, contact your tenant administrator.");
|
|
38
|
-
}
|
|
39
|
-
return entryPoints.map((entry) => ({
|
|
40
|
-
UniqueId: String(readSpecProperty2(entry, "uniqueId") ?? ""),
|
|
41
|
-
Path: String(readSpecProperty2(entry, "path") ?? ""),
|
|
42
|
-
DisplayName: String(readSpecProperty2(entry, "displayName") ?? ""),
|
|
43
|
-
InputArguments: readSpecProperty2(entry, "inputArguments"),
|
|
44
|
-
OutputArguments: readSpecProperty2(entry, "outputArguments")
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
function parseEntryPoints(raw) {
|
|
48
|
-
if (typeof raw !== "string") {
|
|
49
|
-
return raw;
|
|
50
|
-
}
|
|
51
|
-
const [error, parsed] = catchError(() => JSON.parse(raw));
|
|
52
|
-
return error ? undefined : parsed;
|
|
53
|
-
}
|
|
54
|
-
export {
|
|
55
|
-
describeRuleAsync
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
//# debugId=06CBCD525A2E23DA64756E2164756E21
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import"./tool-h2dfnxdq.js";
|
|
2
|
-
import"./tool-3e2q1x2y.js";
|
|
3
|
-
import {
|
|
4
|
-
getSolutionAuthContext,
|
|
5
|
-
createResourceBuilderServices2,
|
|
6
|
-
getRemoteResourceClients2,
|
|
7
|
-
findCatalogEntityAsync2,
|
|
8
|
-
toResourceReference2,
|
|
9
|
-
exportResourceDefinitionAsync2,
|
|
10
|
-
readSpecEntryPoints2
|
|
11
|
-
} from "./tool-7xmarr97.js";
|
|
12
|
-
import {
|
|
13
|
-
RulesCommandError2
|
|
14
|
-
} from "./tool-pcsgwpfw.js";
|
|
15
|
-
import {
|
|
16
|
-
ruleNotFound2
|
|
17
|
-
} from "./tool-56smnjrh.js";
|
|
18
|
-
import"./tool-bykz5ryf.js";
|
|
19
|
-
|
|
20
|
-
// src/services/rule-catalog.ts
|
|
21
|
-
var BUSINESS_RULE_ENTITY_TYPE = "BusinessRule";
|
|
22
|
-
async function describeRuleAsync(name, folder) {
|
|
23
|
-
await getSolutionAuthContext({});
|
|
24
|
-
const { catalog, importer } = getRemoteResourceClients2(await createResourceBuilderServices2());
|
|
25
|
-
const entity = await findCatalogEntityAsync2(catalog, { name, entityTypes: [BUSINESS_RULE_ENTITY_TYPE] }, (e) => e.entityName?.toLowerCase() === name.toLowerCase() && e.folderKey?.toLowerCase() === folder.key.toLowerCase());
|
|
26
|
-
if (!entity?.entityKey) {
|
|
27
|
-
throw ruleNotFound2(name, folder);
|
|
28
|
-
}
|
|
29
|
-
const definition = await exportResourceDefinitionAsync2(importer, toResourceReference2(entity));
|
|
30
|
-
return readEntryPoints(definition?.spec, name);
|
|
31
|
-
}
|
|
32
|
-
function readEntryPoints(spec, name) {
|
|
33
|
-
const entryPoints = readSpecEntryPoints2(spec);
|
|
34
|
-
if (!entryPoints) {
|
|
35
|
-
throw new RulesCommandError2(`Business rule '${name}' has no argument contract on its resource.`, "configuration_error", "Redeploy the rule from its solution with 'uip solution publish' and 'uip solution deploy run' so its package carries entry-points.json. If it still has no contract, contact your tenant administrator.");
|
|
36
|
-
}
|
|
37
|
-
return entryPoints;
|
|
38
|
-
}
|
|
39
|
-
export {
|
|
40
|
-
describeRuleAsync
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
//# debugId=7827CA15CAD3233064756E2164756E21
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
catchError
|
|
3
|
-
} from "./tool-nmqpwh9m.js";
|
|
4
|
-
import"./tool-4z7zcq4z.js";
|
|
5
|
-
import {
|
|
6
|
-
getSolutionAuthContext,
|
|
7
|
-
createResourceBuilderServices2,
|
|
8
|
-
getRemoteResourceClients2,
|
|
9
|
-
findCatalogEntityAsync2,
|
|
10
|
-
toResourceReference2,
|
|
11
|
-
exportResourceDefinitionAsync2,
|
|
12
|
-
readSpecProperty2
|
|
13
|
-
} from "./tool-x89947ah.js";
|
|
14
|
-
import {
|
|
15
|
-
RulesCommandError2,
|
|
16
|
-
ruleNotFound2
|
|
17
|
-
} from "./tool-bvmc017m.js";
|
|
18
|
-
import"./tool-b71jq9pt.js";
|
|
19
|
-
|
|
20
|
-
// src/services/rule-catalog.ts
|
|
21
|
-
var BUSINESS_RULE_ENTITY_TYPE = "BusinessRule";
|
|
22
|
-
async function describeRuleAsync(name, folder) {
|
|
23
|
-
await getSolutionAuthContext({});
|
|
24
|
-
const { catalog, importer } = getRemoteResourceClients2(await createResourceBuilderServices2());
|
|
25
|
-
const entity = await findCatalogEntityAsync2(catalog, { name, entityTypes: [BUSINESS_RULE_ENTITY_TYPE] }, (e) => e.entityName?.toLowerCase() === name.toLowerCase() && e.folderKey?.toLowerCase() === folder.key.toLowerCase());
|
|
26
|
-
if (!entity?.entityKey) {
|
|
27
|
-
throw ruleNotFound2(name, folder);
|
|
28
|
-
}
|
|
29
|
-
const definition = await exportResourceDefinitionAsync2(importer, toResourceReference2(entity));
|
|
30
|
-
return readEntryPoints(definition?.spec, name);
|
|
31
|
-
}
|
|
32
|
-
function readEntryPoints(spec, name) {
|
|
33
|
-
const entryPoints = parseEntryPoints(readSpecProperty2(spec, "entryPoints"));
|
|
34
|
-
if (!Array.isArray(entryPoints) || !entryPoints.every((entry) => entry !== null && typeof entry === "object")) {
|
|
35
|
-
throw new RulesCommandError2(`Business rule '${name}' has no argument contract on its resource.`, "configuration_error", "Redeploy the rule from its solution with 'uip solution publish' and 'uip solution deploy run' so its package carries entry-points.json. If it still has no contract, contact your tenant administrator.");
|
|
36
|
-
}
|
|
37
|
-
return entryPoints.map((entry) => ({
|
|
38
|
-
UniqueId: String(readSpecProperty2(entry, "uniqueId") ?? ""),
|
|
39
|
-
Path: String(readSpecProperty2(entry, "path") ?? ""),
|
|
40
|
-
DisplayName: String(readSpecProperty2(entry, "displayName") ?? ""),
|
|
41
|
-
InputArguments: readSpecProperty2(entry, "inputArguments"),
|
|
42
|
-
OutputArguments: readSpecProperty2(entry, "outputArguments")
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
|
-
function parseEntryPoints(raw) {
|
|
46
|
-
if (typeof raw !== "string") {
|
|
47
|
-
return raw;
|
|
48
|
-
}
|
|
49
|
-
const [error, parsed] = catchError(() => JSON.parse(raw));
|
|
50
|
-
return error ? undefined : parsed;
|
|
51
|
-
}
|
|
52
|
-
export {
|
|
53
|
-
describeRuleAsync
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
//# debugId=AD4FEA4A6D86C02464756E2164756E21
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RulesCommandError2,
|
|
3
|
-
isJsonObject2,
|
|
4
|
-
reportRulesFailure2
|
|
5
|
-
} from "./tool-2trg1fpx.js";
|
|
6
|
-
import"./tool-5xx6x8pe.js";
|
|
7
|
-
export {
|
|
8
|
-
RulesCommandError2 as RulesCommandError,
|
|
9
|
-
isJsonObject2 as isJsonObject,
|
|
10
|
-
reportRulesFailure2 as reportRulesFailure
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
//# debugId=1ABE9E632E07ECEB64756E2164756E21
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RulesCommandError2,
|
|
3
|
-
isJsonObject2,
|
|
4
|
-
reportRulesFailure2
|
|
5
|
-
} from "./tool-pcsgwpfw.js";
|
|
6
|
-
import"./tool-3e2q1x2y.js";
|
|
7
|
-
export {
|
|
8
|
-
RulesCommandError2 as RulesCommandError,
|
|
9
|
-
isJsonObject2 as isJsonObject,
|
|
10
|
-
reportRulesFailure2 as reportRulesFailure
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
//# debugId=1ABE9E632E07ECEB64756E2164756E21
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RulesCommandError2,
|
|
3
|
-
isJsonObject2,
|
|
4
|
-
reportRulesFailure2
|
|
5
|
-
} from "./tool-9bz2x04j.js";
|
|
6
|
-
import"./tool-5qygptrc.js";
|
|
7
|
-
export {
|
|
8
|
-
RulesCommandError2 as RulesCommandError,
|
|
9
|
-
isJsonObject2 as isJsonObject,
|
|
10
|
-
reportRulesFailure2 as reportRulesFailure
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
//# debugId=1ABE9E632E07ECEB64756E2164756E21
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RulesCommandError2,
|
|
3
|
-
isJsonObject2,
|
|
4
|
-
reportRulesFailure2
|
|
5
|
-
} from "./tool-rwp1skmf.js";
|
|
6
|
-
import"./tool-6rp0gx98.js";
|
|
7
|
-
export {
|
|
8
|
-
RulesCommandError2 as RulesCommandError,
|
|
9
|
-
isJsonObject2 as isJsonObject,
|
|
10
|
-
reportRulesFailure2 as reportRulesFailure
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
//# debugId=1ABE9E632E07ECEB64756E2164756E21
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getAuthContext,
|
|
3
|
-
PersonalWorkspacesApi,
|
|
4
|
-
createApiClient
|
|
5
|
-
} from "./tool-h2dfnxdq.js";
|
|
6
|
-
import {
|
|
7
|
-
getFileSystem,
|
|
8
|
-
catchError,
|
|
9
|
-
logger
|
|
10
|
-
} from "./tool-3e2q1x2y.js";
|
|
11
|
-
import {
|
|
12
|
-
buildSolutionPackageFromDir,
|
|
13
|
-
uploadOrOverwriteSolution
|
|
14
|
-
} from "./tool-x67kek1m.js";
|
|
15
|
-
import {
|
|
16
|
-
RulesCommandError2,
|
|
17
|
-
isJsonObject2
|
|
18
|
-
} from "./tool-pcsgwpfw.js";
|
|
19
|
-
import {
|
|
20
|
-
assertOneFolderOption2,
|
|
21
|
-
resolveRequiredFolder2
|
|
22
|
-
} from "./tool-56smnjrh.js";
|
|
23
|
-
import {
|
|
24
|
-
findSolutionFile,
|
|
25
|
-
updateSolutionFile
|
|
26
|
-
} from "./tool-bykz5ryf.js";
|
|
27
|
-
import {
|
|
28
|
-
readRulesProjectNameAsync
|
|
29
|
-
} from "./tool-tmbst1r8.js";
|
|
30
|
-
|
|
31
|
-
// src/services/rules-engine-client.ts
|
|
32
|
-
var DEBUG_EVALUATE_PATH = "/v1/business-rules/debug/evaluate";
|
|
33
|
-
var DEFAULT_TIMEOUT_SECONDS = 120;
|
|
34
|
-
|
|
35
|
-
class RulesEngineHttpError extends Error {
|
|
36
|
-
status;
|
|
37
|
-
constructor(status, message) {
|
|
38
|
-
super(message);
|
|
39
|
-
this.status = status;
|
|
40
|
-
this.name = "RulesEngineHttpError";
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
async function assertBusinessRulesServiceAsync(config, timeoutSeconds = DEFAULT_TIMEOUT_SECONDS) {
|
|
44
|
-
const [error] = await catchError(postDebugEvaluate(config, {}, timeoutSeconds));
|
|
45
|
-
if (error && !(error instanceof RulesEngineHttpError && error.status === 400)) {
|
|
46
|
-
throw error;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
async function evaluateRuleDebugAsync(config, request, timeoutSeconds = DEFAULT_TIMEOUT_SECONDS) {
|
|
50
|
-
return postDebugEvaluate(config, request, timeoutSeconds);
|
|
51
|
-
}
|
|
52
|
-
async function postDebugEvaluate(config, request, timeoutSeconds) {
|
|
53
|
-
const url = `${config.baseUrl}/${encodeURIComponent(config.organizationId)}/${encodeURIComponent(config.tenantName)}/businessrules_${DEBUG_EVALUATE_PATH}`;
|
|
54
|
-
const [fetchError, response] = await catchError(fetch(url, {
|
|
55
|
-
method: "POST",
|
|
56
|
-
headers: {
|
|
57
|
-
Authorization: `Bearer ${config.authToken}`,
|
|
58
|
-
Accept: "application/json",
|
|
59
|
-
"Content-Type": "application/json",
|
|
60
|
-
...config.folderKey ? { "x-uipath-folderkey": config.folderKey } : {}
|
|
61
|
-
},
|
|
62
|
-
body: JSON.stringify(request),
|
|
63
|
-
signal: AbortSignal.timeout(timeoutSeconds * 1000)
|
|
64
|
-
}));
|
|
65
|
-
if (fetchError?.name === "TimeoutError") {
|
|
66
|
-
throw new RulesCommandError2(`The rules engine did not answer within ${timeoutSeconds} seconds.`, "timeout", "Run the command again, or pass a larger --timeout.", "RetryLater");
|
|
67
|
-
}
|
|
68
|
-
if (fetchError) {
|
|
69
|
-
throw fetchError;
|
|
70
|
-
}
|
|
71
|
-
if (!response.ok) {
|
|
72
|
-
throw await engineFailure(response, config.tenantName);
|
|
73
|
-
}
|
|
74
|
-
return await response.json();
|
|
75
|
-
}
|
|
76
|
-
async function engineFailure(response, tenantName) {
|
|
77
|
-
const text = await response.text().catch(() => "");
|
|
78
|
-
if (response.status === 404 && /Service: businessrules not found in Organization/i.test(text)) {
|
|
79
|
-
return new RulesCommandError2(`Business Rules is not enabled on tenant '${tenantName}'.`, "configuration_error", "Ask your UiPath contact to enable Business Rules for this tenant, or switch to a tenant that has it with 'uip login tenant set <tenant-name>'.");
|
|
80
|
-
}
|
|
81
|
-
const [, body] = catchError(() => JSON.parse(text));
|
|
82
|
-
const error = isJsonObject2(body) && isJsonObject2(body.error) ? body.error : {};
|
|
83
|
-
if (error.code === "STUDIO_FORBIDDEN") {
|
|
84
|
-
return new RulesCommandError2("Studio Web did not let the rules engine read the uploaded project.", "permission_denied", "Check in Studio Web that your account can open the uploaded solution.");
|
|
85
|
-
}
|
|
86
|
-
const message = typeof error.message === "string" ? error.message : "The rules engine request failed.";
|
|
87
|
-
return new RulesEngineHttpError(response.status, typeof error.code === "string" ? `${message} (${error.code})` : message);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// src/services/rules-debug-service.ts
|
|
91
|
-
async function debugRuleProjectAsync(projectPath, options) {
|
|
92
|
-
assertOneFolderOption2(options);
|
|
93
|
-
const inputs = [{ id: "1", data: await parseInput(options.inputs) }];
|
|
94
|
-
const fs = getFileSystem();
|
|
95
|
-
const projectDir = fs.path.resolve(projectPath);
|
|
96
|
-
const projectName = await readRulesProjectName(projectDir);
|
|
97
|
-
const solutionDir = fs.path.resolve(projectDir, "..");
|
|
98
|
-
await assertSolutionFolder(solutionDir);
|
|
99
|
-
const { config, organizationName } = await loggedInContext(options.loginValidity);
|
|
100
|
-
await assertBusinessRulesServiceAsync(config, options.timeout);
|
|
101
|
-
const folderKey = await evaluationFolderKey(options);
|
|
102
|
-
const existingSolutionId = (await findSolutionFile(fs, projectDir))?.solutionId;
|
|
103
|
-
logger.info(`Uploading the solution of '${projectName}' to Studio Web...`);
|
|
104
|
-
const uisPath = await buildSolutionPackageFromDir(fs, solutionDir);
|
|
105
|
-
const [uploadError, upload] = await catchError(uploadOrOverwriteSolution(config, organizationName, uisPath, existingSolutionId, fs));
|
|
106
|
-
await fs.rm(uisPath).catch(() => {
|
|
107
|
-
return;
|
|
108
|
-
});
|
|
109
|
-
if (uploadError) {
|
|
110
|
-
throw uploadError;
|
|
111
|
-
}
|
|
112
|
-
if (upload.id !== existingSolutionId) {
|
|
113
|
-
await updateSolutionFile(fs, projectDir, upload.id);
|
|
114
|
-
}
|
|
115
|
-
const project = upload.projects.find((p) => p.name === projectName);
|
|
116
|
-
if (!project) {
|
|
117
|
-
throw new RulesCommandError2(`Studio Web returned no project named '${projectName}' for the uploaded solution.`, "not_found", "Check that the project is listed in the solution's .uipx, then run the command again.");
|
|
118
|
-
}
|
|
119
|
-
logger.info(`Evaluating against Studio Web project ${project.id}...`);
|
|
120
|
-
const response = await evaluateRuleDebugAsync({ ...config, folderKey }, { projectId: project.id, explain: options.explain, inputs }, options.timeout);
|
|
121
|
-
return {
|
|
122
|
-
solutionId: upload.id,
|
|
123
|
-
projectId: project.id,
|
|
124
|
-
studioWebUrl: studioWebDesignerUrl(config.baseUrl, organizationName, project.id, upload.id),
|
|
125
|
-
response
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
async function parseInput(raw) {
|
|
129
|
-
if (raw === undefined || raw === "") {
|
|
130
|
-
return {};
|
|
131
|
-
}
|
|
132
|
-
const filePath = raw.startsWith("@") ? raw.slice(1) : undefined;
|
|
133
|
-
const [readError, text] = filePath === undefined ? [undefined, raw] : await catchError(getFileSystem().readFile(filePath, "utf-8"));
|
|
134
|
-
if (readError || text === null) {
|
|
135
|
-
throw new RulesCommandError2(`Input file '${filePath}' could not be read: ${readError?.message ?? "file not found"}.`, "invalid_argument", "Pass --inputs as a JSON object or @file.json pointing at an existing file.");
|
|
136
|
-
}
|
|
137
|
-
const [parseError, parsed] = catchError(() => JSON.parse(text));
|
|
138
|
-
if (parseError || !isJsonObject2(parsed)) {
|
|
139
|
-
throw new RulesCommandError2(parseError ? `--inputs is not valid JSON: ${parseError.message}` : "--inputs must be a JSON object of input values.", "invalid_argument", `Pass --inputs '{"<input>": <value>}' or @file.json holding one such object.`);
|
|
140
|
-
}
|
|
141
|
-
return parsed;
|
|
142
|
-
}
|
|
143
|
-
function studioWebDesignerUrl(baseUrl, organizationName, projectId, solutionId) {
|
|
144
|
-
return `${baseUrl}/${encodeURIComponent(organizationName)}/studio_/designer/${encodeURIComponent(projectId)}?solutionId=${encodeURIComponent(solutionId)}`;
|
|
145
|
-
}
|
|
146
|
-
async function readRulesProjectName(projectDir) {
|
|
147
|
-
const name = await readRulesProjectNameAsync(projectDir);
|
|
148
|
-
if (!name) {
|
|
149
|
-
throw new RulesCommandError2(`${projectDir}/project.uiproj has no Name.`, "invalid_argument", "Set Name in project.uiproj to the rules project's name, as 'uip rules init' writes it.");
|
|
150
|
-
}
|
|
151
|
-
return name;
|
|
152
|
-
}
|
|
153
|
-
async function assertSolutionFolder(solutionDir) {
|
|
154
|
-
const [, entries] = await catchError(getFileSystem().readdir(solutionDir));
|
|
155
|
-
if (!entries?.some((entry) => entry.endsWith(".uipx"))) {
|
|
156
|
-
throw new RulesCommandError2(`${solutionDir} holds no .uipx, so the rules project is not inside a solution.`, "invalid_argument", "Pass a rules project that sits directly inside its solution folder, as 'uip rules init' creates it.");
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
async function loggedInContext(loginValidity) {
|
|
160
|
-
const auth = await getAuthContext({
|
|
161
|
-
ensureTokenValidityMinutes: loginValidity,
|
|
162
|
-
requireOrganizationId: true,
|
|
163
|
-
requireOrganizationName: true,
|
|
164
|
-
requireTenantName: true
|
|
165
|
-
});
|
|
166
|
-
return {
|
|
167
|
-
config: {
|
|
168
|
-
baseUrl: auth.baseUrl,
|
|
169
|
-
organizationId: auth.organizationId,
|
|
170
|
-
tenantName: auth.tenantName,
|
|
171
|
-
tenantId: auth.tenantId,
|
|
172
|
-
authToken: auth.accessToken
|
|
173
|
-
},
|
|
174
|
-
organizationName: auth.organizationName
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
async function evaluationFolderKey(options) {
|
|
178
|
-
if (options.folderPath !== undefined || options.folderKey !== undefined) {
|
|
179
|
-
return (await resolveRequiredFolder2(options)).key;
|
|
180
|
-
}
|
|
181
|
-
const api = await createApiClient(PersonalWorkspacesApi, {});
|
|
182
|
-
const personal = await api.personalWorkspacesGetPersonalWorkspace();
|
|
183
|
-
if (!personal?.key) {
|
|
184
|
-
throw new RulesCommandError2("Could not find your personal workspace to run the rules engine in.", "invalid_argument", "Pass --folder-path <path> or --folder-key <key> to run in a folder you can read.");
|
|
185
|
-
}
|
|
186
|
-
return personal.key;
|
|
187
|
-
}
|
|
188
|
-
export {
|
|
189
|
-
debugRuleProjectAsync
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
//# debugId=D45024320EEC44A364756E2164756E21
|