@uipath/case-tool 1.205.0-preview.281 → 1.206.0-preview.282
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/THIRD-PARTY-NOTICES.md +68 -7
- package/dist/applicationinsights-web-8m26566f.js +17209 -0
- package/dist/{authoring-kqh34zzm.js → authoring-vg90pqrn.js} +488 -213
- package/dist/bindings-v2-1da35xsc.js +27 -0
- package/dist/{browser-strategy-6atc7v8s.js → browser-strategy-627rrg7z.js} +6 -7
- package/dist/{business-rule-export-ey588rv7.js → business-rule-export-jv60r9jf.js} +3 -7
- package/dist/carry-forward-sfdnta6q.js +52 -0
- package/dist/{case-api-sme7esce.js → case-api-by95rf40.js} +38 -37
- package/dist/{case-bindings-service-cht20gqt.js → case-bindings-service-pp3c9g1e.js} +93 -45
- package/dist/{case-debug-solution-projects-qqd3h10v.js → case-debug-solution-projects-je7h4hmq.js} +3 -7
- package/dist/{case-debug-studio-web-service-nqzmwbr5.js → case-debug-studio-web-service-d83h3atd.js} +48 -45
- package/dist/{case-described-io-service-dx1f4nxe.js → case-described-io-service-tsm8r189.js} +33 -15
- package/dist/case-event-trigger-bindings-qbs8ywf5.js +17 -0
- package/dist/{case-format-service-6aew6tqc.js → case-format-service-3sab2297.js} +9 -10
- package/dist/{case-pack-service-pqq8wnfd.js → case-pack-service-txnv711n.js} +47 -42
- package/dist/case-schema-version-cw0h2nrv.js +18 -0
- package/dist/case-shape-reader-xaxmrd40.js +14 -0
- package/dist/{case-splice-service-s5gccctq.js → case-splice-service-6y35w83e.js} +139 -51
- package/dist/{case-validate-service-vq38va33.js → case-validate-service-hz0j90we.js} +234 -170
- package/dist/connector-enrichment-service-sjjmb9dy.js +56 -0
- package/dist/connector-library-1yw5r47w.js +99 -0
- package/dist/connector-lookup-service-yerhg9cd.js +20 -0
- package/dist/connector-task-shape-bgywpbqc.js +13 -0
- package/dist/{de-WLW6KWOJ-2qnsqdtw.js → de-2BEKRUMY-x4dx0nn9.js} +190 -10
- package/dist/{de-UZI7FJDO-mwvc4cxe.js → de-AI7ML6JM-km47f8k4.js} +20 -5
- package/dist/debug-service-h4jxbn1r.js +56 -0
- package/dist/{embedded-file-reader-r66242ey.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/en-LAVDF7IQ-yzy20n6d.js +254 -0
- package/dist/en-X6T4SP2Y-xm47mf18.js +2752 -0
- package/dist/{enrichment-service-hv7ff88p.js → enrichment-service-wpprec7k.js} +36 -37
- package/dist/{es-5THCNRFN-tqwyrdgy.js → es-7ZTQTGKN-11sj0yjx.js} +190 -10
- package/dist/{es-MX-5RELIXKI-9jhqtddc.js → es-MX-7KJZPEQN-1fq0a9jr.js} +20 -5
- package/dist/{es-MX-TWZBRAXK-gqd9swzw.js → es-MX-IHGRIEWH-g63p0gb4.js} +191 -11
- package/dist/{es-4UBUTCQA-m1ytpyx2.js → es-SPNKTD5Y-vw5cbgv5.js} +20 -5
- package/dist/filter-engine-dh9s90gb.js +10 -0
- package/dist/first-party-service-ahcc6xc6.js +8 -0
- package/dist/{fr-CERONSRC-edpxhbmb.js → fr-7ZDL4MVO-pd27vwh6.js} +191 -11
- package/dist/{fr-VBM5WRC2-63z7w4mh.js → fr-AXJGUT53-hdg3pmd4.js} +20 -5
- package/dist/index-21kns9qg.js +10 -0
- package/dist/{index-fyc0k5dd.js → index-5pzp2qeb.js} +5350 -3271
- package/dist/{connector-task-spec-pzfzmfr5.js → index-9f8naxbk.js} +320 -144
- package/dist/{index-5dxh9z60.js → index-a7y7etmy.js} +6 -5
- package/dist/{index-ekwtgx7y.js → index-ec115v05.js} +309 -287
- package/dist/index-j9t2k52h.js +35 -0
- package/dist/index-myf7b4a5.js +26 -0
- package/dist/index-nj3axvya.js +159 -0
- package/dist/{index-h8cph72k.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-pg9wmyrf.js +36 -0
- package/dist/index-z2qk2qn6.js +24 -0
- package/dist/index.js +19 -25
- package/dist/index.umd.min-ttg1qc0x.js +7814 -0
- package/dist/{init-entry-points-hhpv3e3f.js → init-entry-points-pc128f7z.js} +22 -35
- package/dist/input-reader-9ym8mkbc.js +10 -0
- package/dist/{ja-43QL7CGO-c3q8gre9.js → ja-C7GZV6YP-hvtbngr5.js} +20 -5
- package/dist/{ja-U2MCNHGT-gz0ap1jk.js → ja-LGAM5HKR-sgrtjqjh.js} +190 -10
- package/dist/{jmespath-e4a59c8w.js → jmespath-wwym30dp.js} +1 -1
- package/dist/{js-yaml-87cdx6bm.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/known-types-gak9by1w.js +11 -0
- package/dist/{ko-XAUYQWDR-zp81gjp4.js → ko-7B4SUZB7-c8wr20sc.js} +190 -10
- package/dist/{ko-TLL6Z6CD-wrt3n8a9.js → ko-Q24HSSL4-5vn55pte.js} +20 -5
- package/dist/localSolutionDiscovery-48d1bnkj.js +15 -0
- package/dist/{migration-diagnosis-ns5cw4e3.js → migration-diagnosis-myqqgwj0.js} +1 -4
- package/dist/{node-strategy-v442hwgd.js → node-strategy-2mqzg36t.js} +15 -18
- package/dist/node-sync-service-y8b5w1rd.js +56 -0
- package/dist/{out-target-wjgmna0r.js → out-target-eqsttq1k.js} +18 -22
- package/dist/{packager-tool-f8vwy92w.js → packager-tool-0te1tyhf.js} +186 -16
- package/dist/{packager-tool-ydyvtknp.js → packager-tool-0w4fsdzv.js} +44 -20
- package/dist/{packager-tool-8ftat1vn.js → packager-tool-17b466mr.js} +59158 -59666
- package/dist/packager-tool-1nfdj0zm.js +425 -0
- package/dist/packager-tool-1wgav5ma.js +139 -0
- package/dist/{packager-tool-b1nw50ev.js → packager-tool-265h946t.js} +256 -486
- package/dist/{packager-tool-nj4seavy.js → packager-tool-35c9npcy.js} +26 -7
- package/dist/{packager-tool-r0x3qh59.js → packager-tool-388vyja1.js} +185 -29
- package/dist/packager-tool-3m8482sw.js +78 -0
- package/dist/packager-tool-3r23qsca.js +4832 -0
- package/dist/packager-tool-3xehbdyd.js +1302 -0
- package/dist/packager-tool-4avchhz8.js +539 -0
- package/dist/{packager-tool-9kvkzc05.js → packager-tool-5w0gjcck.js} +4 -4
- package/dist/packager-tool-68648y3j.js +6 -0
- package/dist/{packager-tool-1yh8g550.js → packager-tool-6an893wm.js} +12 -3
- package/dist/{packager-tool-aagnvyba.js → packager-tool-76zhn5pa.js} +131 -432
- package/dist/packager-tool-7x1tmb8a.js +46 -0
- package/dist/{packager-tool-kyrm4e5m.js → packager-tool-9ar5829n.js} +781 -741
- package/dist/{packager-tool-4p11fvf4.js → packager-tool-b2q8m9pq.js} +10 -13
- package/dist/packager-tool-bg3tdpva.js +27 -0
- package/dist/{packager-tool-wr12ndwk.js → packager-tool-ccejfs0r.js} +252 -468
- package/dist/{packager-tool-yn33pw57.js → packager-tool-dn9d4ywm.js} +246 -225
- package/dist/{packager-tool-kdhey8gz.js → packager-tool-e02jkmrq.js} +41 -29
- package/dist/{packager-tool-sq931c23.js → packager-tool-e1tx5mqg.js} +1 -1
- package/dist/{packager-tool-qn3zkrrc.js → packager-tool-ehjw672b.js} +32 -15
- package/dist/packager-tool-gy4yjqhf.js +178 -0
- package/dist/packager-tool-h2ar8xf8.js +222 -0
- package/dist/{packager-tool-v2kcgjbf.js → packager-tool-j6nfje7t.js} +5 -4
- package/dist/packager-tool-k0ar6cn7.js +295 -0
- package/dist/packager-tool-kz7zz79p.js +71 -0
- package/dist/{packager-tool-1gwbq864.js → packager-tool-m5384a1s.js} +66 -82
- package/dist/{packager-tool-9e59z4d6.js → packager-tool-me8gd22q.js} +82 -83
- package/dist/packager-tool-mk9fmzdy.js +20 -0
- package/dist/{packager-tool-yfmby4dd.js → packager-tool-mkt1njk2.js} +630 -689
- package/dist/{packager-tool-gdtpsdn7.js → packager-tool-mm1x18d6.js} +223 -28
- package/dist/{packager-tool-mqy97y5f.js → packager-tool-p5gs9xqy.js} +14 -14
- package/dist/{packager-tool-83v804p7.js → packager-tool-psmb758n.js} +3108 -2627
- package/dist/packager-tool-q26hncjr.js +13 -0
- package/dist/packager-tool-q9fnx278.js +77 -0
- package/dist/{packager-tool-ezds6t5e.js → packager-tool-s12s1dp6.js} +11 -11
- package/dist/packager-tool-scy94jyb.js +5424 -0
- package/dist/{packager-tool-yn7r7zq2.js → packager-tool-snesn0bt.js} +177 -96
- package/dist/{packager-tool-d8e2mrkq.js → packager-tool-tgehy324.js} +56 -56
- package/dist/{packager-tool-tqn0j6f9.js → packager-tool-v11fx4dk.js} +7 -7
- package/dist/{packager-tool-67vy1fz3.js → packager-tool-v6rkp2ay.js} +24 -92
- package/dist/{packager-tool-9sd483vs.js → packager-tool-vs7gqa4r.js} +15 -15
- package/dist/packager-tool-vyavrbym.js +488 -0
- package/dist/{packager-tool-b098y4a2.js → packager-tool-wbksf242.js} +97 -97
- package/dist/{packager-tool-2sn7d8fd.js → packager-tool-x74mmjkw.js} +9 -13
- package/dist/{packager-tool-7hw344bt.js → packager-tool-xb16e3tz.js} +5 -5
- package/dist/{packager-tool-a17g0pj1.js → packager-tool-xd1wbvay.js} +10 -8
- package/dist/{packager-tool-1yfw674x.js → packager-tool-xehhk3c3.js} +10 -5
- package/dist/packager-tool-yh8mmj3p.js +123 -0
- package/dist/{packager-tool-hdxtgckw.js → packager-tool-z070caqq.js} +56 -12
- package/dist/{packager-tool-b250k6w4.js → packager-tool-z1fw9a8v.js} +41 -9
- package/dist/{packager-tool-0gctz400.js → packager-tool-z9fmqtm6.js} +4 -4
- package/dist/{packager-tool-mzf4gmph.js → packager-tool-zbx189j3.js} +11 -8
- package/dist/{packager-tool-zf8f9pmm.js → packager-tool-zrbnms9b.js} +3 -4
- package/dist/packager-tool.js +10 -11
- package/dist/prepare-uip-ad7mfs8t.js +92 -0
- package/dist/{project-artifacts-bgyyb0dm.js → project-artifacts-q0c0zghw.js} +2 -6
- package/dist/{pt-BR-USP2T7GD-pedn77m1.js → pt-BR-BIUJXIPU-2sqzhr8y.js} +20 -5
- package/dist/{pt-BR-GNQNAAZ2-xadharv4.js → pt-BR-PHLFHMXZ-n6de4s7z.js} +191 -11
- package/dist/{pt-RMIAKZB4-67enhx3m.js → pt-MHX6JGAX-xfgvdqwg.js} +20 -5
- package/dist/{pt-TO2DARY2-ftcce1bv.js → pt-N7ZTJT4W-d6c67xcn.js} +190 -10
- package/dist/{resolved-check-aqw7568y.js → resolved-check-dz8eqrf6.js} +2 -3
- package/dist/{resourcesSyncService-8ac6ncq2.js → resourcesSyncService-yrhhh62m.js} +81 -141
- package/dist/{ro-GHOBYW2S-mhnqsgaa.js → ro-3RKJNGJZ-xqj14e3d.js} +20 -5
- package/dist/{ro-WUYJV6OW-a8d9qy1n.js → ro-FLNXVYJI-ytrwabg2.js} +190 -10
- package/dist/ru-GSCT4ARZ-c2cfq4h1.js +7 -0
- package/dist/ru-WBLQ5B2U-bf20yr5y.js +7 -0
- package/dist/{rule-group-members-zje7n3kf.js → rule-group-members-p0nv1rmj.js} +1 -3
- package/dist/rule-type-declaration-s2nxpcfy.js +77 -0
- package/dist/{sdd-convert-service-8jpew7vz.js → sdd-convert-service-ffbx00k6.js} +481 -504
- package/dist/{sdd-lookup-fe900sdb.js → sdd-lookup-sah7wj5j.js} +8 -9
- package/dist/{sdd-resolve-service-qdtmxw9b.js → sdd-resolve-service-6nt10vhq.js} +28 -20
- package/dist/{sdd-resolve-siblings-8gf9zjwf.js → sdd-resolve-siblings-ap8j1c8h.js} +11 -14
- package/dist/solution-auth-a1p22hq1.js +11 -0
- package/dist/solution-discovery-r1y550sz.js +33 -0
- package/dist/{strict-case-rules-4tjcaznr.js → strict-case-rules-045kbjvv.js} +16 -28
- package/dist/{strict-entry-points-g2pd4mf4.js → strict-entry-points-40ha9afz.js} +15 -14
- package/dist/strict-sdd-audit-bp7fq2tg.js +26 -0
- package/dist/{task-selector-8bjn35dv.js → task-selector-jt60hdbt.js} +1 -3
- package/dist/{task-type-declaration-7a8fqdvs.js → task-type-declaration-yhczvj05.js} +9 -9
- package/dist/tool.js +18 -24
- package/dist/{tr-M3F5A6AU-bb0tg39m.js → tr-7AIZZWZ6-pdzp9n0p.js} +190 -10
- package/dist/{tr-GDTLECMM-k5fhmq13.js → tr-PQLUUHPC-qsb7btxn.js} +20 -5
- package/dist/{trigger-enrichment-service-agvnhdf7.js → trigger-enrichment-service-z8kxy6qr.js} +53 -57
- package/dist/trigger-entry-point-id-751v48qd.js +14 -0
- package/dist/{zh-CN-C5G4PC7C-ds9gkptg.js → zh-CN-CN2ARPFS-e0p2qrxf.js} +190 -10
- package/dist/{zh-CN-I5D7WHBD-sr5h0a98.js → zh-CN-OHNTHZRI-b0hjkfqn.js} +20 -5
- package/dist/{zh-TW-62HZIG6O-787kdwex.js → zh-TW-7RUFEVFK-qd7myw31.js} +190 -10
- package/dist/{zh-TW-2AVLM723-288pkc1z.js → zh-TW-E4D3Y6ZR-tn3bmzz5.js} +20 -5
- package/package.json +2 -2
- package/dist/canvas-notes-86fxx1t8.js +0 -19
- package/dist/case-event-trigger-bindings-g9ftnm4x.js +0 -16
- package/dist/case-schema-version-h820ne16.js +0 -20
- package/dist/case-shape-reader-dsbraetf.js +0 -13
- package/dist/connector-enrichment-service-6kskfevq.js +0 -65
- package/dist/connector-lookup-service-yyn8kkw7.js +0 -22
- package/dist/connector-task-shape-mpazkf7s.js +0 -14
- package/dist/debug-service-7q98j726.js +0 -59
- package/dist/en-EJCBA3LK-dtpdghgj.js +0 -146
- package/dist/en-M7GQYBV2-5nfmpnfz.js +0 -2018
- package/dist/filter-engine-7ep90g7f.js +0 -11
- package/dist/first-party-service-srxaftkn.js +0 -27
- package/dist/index-0d7qc2gs.js +0 -282
- package/dist/index-jmv5by9z.js +0 -666
- package/dist/index-kmp9fmhb.js +0 -25
- package/dist/index-n9qvnx4x.js +0 -29
- package/dist/index-ngs0a2he.js +0 -15
- package/dist/index-xq6ajhgq.js +0 -157
- package/dist/index.umd.min-fqefd9kn.js +0 -7814
- package/dist/input-reader-c7wz8ra2.js +0 -11
- package/dist/known-types-5b6yrsqn.js +0 -16
- package/dist/localSolutionDiscovery-yyx234ak.js +0 -13
- package/dist/node-sync-service-2ezr3akv.js +0 -57
- package/dist/packager-tool-53w8skv5.js +0 -262
- package/dist/packager-tool-6z1hsm2h.js +0 -143
- package/dist/packager-tool-93mdeqay.js +0 -18
- package/dist/packager-tool-9kf3fqtr.js +0 -23
- package/dist/packager-tool-bfgdz1zh.js +0 -73
- package/dist/packager-tool-e15kqpyh.js +0 -266
- package/dist/packager-tool-gmykn1ef.js +0 -5365
- package/dist/packager-tool-jysvpt8p.js +0 -11
- package/dist/packager-tool-pcvhcn2k.js +0 -2019
- package/dist/packager-tool-rk25wp3c.js +0 -28
- package/dist/packager-tool-sc961w0q.js +0 -16
- package/dist/packager-tool-wekqkmgn.js +0 -265
- package/dist/packager-tool-yc4kw997.js +0 -13
- package/dist/packager-tool-zgpsnxkd.js +0 -13189
- package/dist/ru-GSCT4ARZ-1sa9wbr8.js +0 -10
- package/dist/ru-WBLQ5B2U-s4em88p0.js +0 -10
- package/dist/solution-auth-30yycqtv.js +0 -14
- package/dist/solution-discovery-e9mamp6w.js +0 -38
- package/dist/strict-sdd-audit-q7tb9yj7.js +0 -25
- package/dist/trigger-entry-point-id-yhqwnkx9.js +0 -15
- /package/dist/{packager-tool-5qp9xza1.js → packager-tool-1c30ttpm.js} +0 -0
- /package/dist/{packager-tool-mknccck5.js → packager-tool-1h7abxw6.js} +0 -0
- /package/dist/{packager-tool-9y1w2wds.js → packager-tool-fcektt1g.js} +0 -0
- /package/dist/{packager-tool-k6jbedyc.js → packager-tool-hcdnc420.js} +0 -0
- /package/dist/{packager-tool-7nxppa3d.js → packager-tool-jv5byaww.js} +0 -0
- /package/dist/{packager-tool-qa9gftnj.js → packager-tool-mxgybnmt.js} +0 -0
- /package/dist/{packager-tool-87y6xw3a.js → packager-tool-nfhtwa72.js} +0 -0
- /package/dist/{packager-tool-cv05dwac.js → packager-tool-p0rdmmvk.js} +0 -0
- /package/dist/{packager-tool-21qfsbxn.js → packager-tool-yaertxsw.js} +0 -0
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import {
|
|
2
|
+
norm,
|
|
3
|
+
stripTicks
|
|
4
|
+
} from "./packager-tool-fcektt1g.js";
|
|
5
|
+
import {
|
|
6
|
+
isExpressionNamespace
|
|
7
|
+
} from "./packager-tool-mk9fmzdy.js";
|
|
8
|
+
import {
|
|
9
|
+
outputSourceFor
|
|
10
|
+
} from "./packager-tool-0w4fsdzv.js";
|
|
11
|
+
import {
|
|
12
|
+
stageSpellings,
|
|
13
|
+
indexKey,
|
|
14
|
+
modelKey,
|
|
15
|
+
dedupedId,
|
|
16
|
+
exactKey,
|
|
17
|
+
lookupOutput
|
|
18
|
+
} from "./packager-tool-5w0gjcck.js";
|
|
19
|
+
|
|
20
|
+
// src/services/sdd-convert/xrefs.ts
|
|
21
|
+
var QUOTED = String.raw`(?:'((?:\\.|[^'\\])*)'|"((?:\\.|[^"\\])*)"|` + "`((?:\\\\.|[^`\\\\])*)`" + String.raw`|\u201c([^\u201d]*)\u201d)`;
|
|
22
|
+
var XREF_CALL = new RegExp(String.raw`vars\.\$xref\(\s*${QUOTED}\s*,\s*${QUOTED}\s*,\s*${QUOTED}\s*\)`, "g");
|
|
23
|
+
var argumentOf = (groups) => groups.find((value) => value !== undefined) ?? "";
|
|
24
|
+
var unresolvedXrefDetail = (whole, found) => {
|
|
25
|
+
if (found === undefined) {
|
|
26
|
+
return `\`${whole}\` names an output this SDD does not declare, so the marker is left in place rather than pointed at a guess`;
|
|
27
|
+
}
|
|
28
|
+
const spellings = new Set(found.names);
|
|
29
|
+
const listed = [...spellings].map((name) => `\`${name}\``).join(", ");
|
|
30
|
+
if (spellings.size < found.names.length) {
|
|
31
|
+
return `\`${whole}\` names a task that ${found.names.length} tasks in that stage answer to (${listed}), so the marker is left in place rather than pointed at one of them. Task names are unique across the case, so rename all but one`;
|
|
32
|
+
}
|
|
33
|
+
return `\`${whole}\` names its task in a spelling that ${found.names.length} tasks answer to (${listed}), so the marker is left in place rather than pointed at one of them — write the task's name as its heading spells it`;
|
|
34
|
+
};
|
|
35
|
+
var DOTTED_READ = /^\.[A-Za-z_$]/;
|
|
36
|
+
var deferredOutputs = new WeakMap;
|
|
37
|
+
var markDeferredOutputs = (index, ids) => {
|
|
38
|
+
deferredOutputs.set(index, ids);
|
|
39
|
+
};
|
|
40
|
+
var expandXrefs = (text, context) => text.replace(XREF_CALL, (whole, ...rest) => {
|
|
41
|
+
const offset = rest[rest.length - 2];
|
|
42
|
+
const captured = rest.slice(0, -2);
|
|
43
|
+
const stage = argumentOf(captured.slice(0, 4));
|
|
44
|
+
const task = argumentOf(captured.slice(4, 8));
|
|
45
|
+
const output = argumentOf(captured.slice(8, 12));
|
|
46
|
+
const found = lookupOutput(context.outputs, `${indexKey(stage)}|${indexKey(task)}|${indexKey(output)}`, task);
|
|
47
|
+
if (found !== undefined && "id" in found) {
|
|
48
|
+
if (deferredOutputs.get(context.outputs)?.has(found.id)) {
|
|
49
|
+
context.unresolved.push({
|
|
50
|
+
kind: "placeholder",
|
|
51
|
+
where: context.where,
|
|
52
|
+
detail: `\`${whole}\` reads an output of a task the resolved file defers, so \`vars.${found.id}\` resolves to nothing until that task is filled`
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const after = text.slice(offset + whole.length);
|
|
56
|
+
return DOTTED_READ.test(after) ? `vars.${found.id}?` : `vars.${found.id}`;
|
|
57
|
+
}
|
|
58
|
+
context.unresolved.push({
|
|
59
|
+
kind: "producer-reference",
|
|
60
|
+
where: context.where,
|
|
61
|
+
detail: unresolvedXrefDetail(whole, found)
|
|
62
|
+
});
|
|
63
|
+
return whole;
|
|
64
|
+
});
|
|
65
|
+
var expandOutputMarkers = (output, context) => {
|
|
66
|
+
const expand = (value) => typeof value === "string" && value.includes("$xref") ? expandXrefs(value, context) : value;
|
|
67
|
+
const value = expand(output.value);
|
|
68
|
+
const source = expand(output.source);
|
|
69
|
+
return value === output.value && source === output.source ? output : { ...output, value, source };
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/services/sdd-condition-cell.ts
|
|
73
|
+
var STAGE_SELECTOR_RULES = new Set([
|
|
74
|
+
"selected-stage-completed",
|
|
75
|
+
"selected-stage-exited"
|
|
76
|
+
]);
|
|
77
|
+
var TASK_SELECTOR_RULES = new Set(["selected-tasks-completed"]);
|
|
78
|
+
var IF_PARTS = new Map([
|
|
79
|
+
["conditionexpression", "expression"],
|
|
80
|
+
["selected tasks", "tasks"],
|
|
81
|
+
["selected task", "tasks"],
|
|
82
|
+
["selected stage", "stage"],
|
|
83
|
+
["selected stages", "stage"]
|
|
84
|
+
]);
|
|
85
|
+
var splitIfParts = (text) => {
|
|
86
|
+
const pieces = [];
|
|
87
|
+
let current = "";
|
|
88
|
+
let quote;
|
|
89
|
+
for (let index = 0;index < text.length; index += 1) {
|
|
90
|
+
const char = text[index];
|
|
91
|
+
if (quote !== undefined) {
|
|
92
|
+
current += char;
|
|
93
|
+
if (char === "\\") {
|
|
94
|
+
current += text[index + 1] ?? "";
|
|
95
|
+
index += 1;
|
|
96
|
+
} else if (char === quote)
|
|
97
|
+
quote = undefined;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
101
|
+
quote = char;
|
|
102
|
+
current += char;
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (char !== ";") {
|
|
106
|
+
current += char;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
pieces.push(current);
|
|
110
|
+
current = "";
|
|
111
|
+
}
|
|
112
|
+
pieces.push(current);
|
|
113
|
+
return pieces;
|
|
114
|
+
};
|
|
115
|
+
var parseIfCell = (cell) => {
|
|
116
|
+
const text = cell.trim();
|
|
117
|
+
const found = {
|
|
118
|
+
expression: ""
|
|
119
|
+
};
|
|
120
|
+
const parts = [];
|
|
121
|
+
let structured = false;
|
|
122
|
+
const partKey = (text2) => text2.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
|
|
123
|
+
for (const piece of splitIfParts(text)) {
|
|
124
|
+
const at = piece.indexOf(":");
|
|
125
|
+
const key = at === -1 ? "" : partKey(piece.slice(0, at));
|
|
126
|
+
const slot = IF_PARTS.get(key);
|
|
127
|
+
if (slot === undefined) {
|
|
128
|
+
parts.push(piece);
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
structured = true;
|
|
132
|
+
const value = piece.slice(at + 1).trim();
|
|
133
|
+
if (slot === "expression")
|
|
134
|
+
found.expression = value;
|
|
135
|
+
else if (slot === "tasks")
|
|
136
|
+
found.tasks = value;
|
|
137
|
+
else
|
|
138
|
+
found.stage = value;
|
|
139
|
+
}
|
|
140
|
+
if (!structured)
|
|
141
|
+
return { expression: text };
|
|
142
|
+
return found;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// src/services/output-types.ts
|
|
146
|
+
var OUTPUT_TYPE_LITERALS = new Map([
|
|
147
|
+
["string", "string"],
|
|
148
|
+
["date", "string"],
|
|
149
|
+
["datetime", "string"],
|
|
150
|
+
["time", "string"],
|
|
151
|
+
["number", "number"],
|
|
152
|
+
["float", "number"],
|
|
153
|
+
["double", "number"],
|
|
154
|
+
["integer", "integer"],
|
|
155
|
+
["int", "integer"],
|
|
156
|
+
["boolean", "boolean"],
|
|
157
|
+
["bool", "boolean"],
|
|
158
|
+
["file", "file"],
|
|
159
|
+
["any", "any"],
|
|
160
|
+
["object", "jsonSchema"],
|
|
161
|
+
["array", "jsonSchema"],
|
|
162
|
+
["json", "jsonSchema"],
|
|
163
|
+
["jsonschema", "jsonSchema"],
|
|
164
|
+
["dictionary", "jsonSchema"]
|
|
165
|
+
]);
|
|
166
|
+
var outputTypeKey = (text) => norm(text).replaceAll(" ", "");
|
|
167
|
+
var outputTypeCell = (cell) => {
|
|
168
|
+
const text = typeof cell === "string" ? stripTicks(cell) : "";
|
|
169
|
+
if (text === "")
|
|
170
|
+
return {};
|
|
171
|
+
const type = OUTPUT_TYPE_LITERALS.get(outputTypeKey(text));
|
|
172
|
+
return type === undefined ? { unmapped: text } : { type };
|
|
173
|
+
};
|
|
174
|
+
var OUTPUT_TYPE_NAMES = [...new Set(OUTPUT_TYPE_LITERALS.values())];
|
|
175
|
+
|
|
176
|
+
// src/services/sdd-convert/io.ts
|
|
177
|
+
var taskMatcher = (model, taskName) => {
|
|
178
|
+
const mine = exactKey(taskName);
|
|
179
|
+
const folded = indexKey(taskName);
|
|
180
|
+
const filed = modelKey(taskName);
|
|
181
|
+
let unique = true;
|
|
182
|
+
let filedUnique = true;
|
|
183
|
+
for (const stage of model.stages) {
|
|
184
|
+
for (const other of stage.tasks) {
|
|
185
|
+
const name = exactKey(String(other.name ?? ""));
|
|
186
|
+
if (name === mine)
|
|
187
|
+
continue;
|
|
188
|
+
if (indexKey(name) === folded)
|
|
189
|
+
unique = false;
|
|
190
|
+
if (modelKey(name) === filed)
|
|
191
|
+
filedUnique = false;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
names: (spelled) => exactKey(spelled) === mine || unique && indexKey(spelled) === folded,
|
|
196
|
+
unique,
|
|
197
|
+
filedUnique
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
var declaredOutputs = (model, stageName, position, task) => {
|
|
201
|
+
const taskName = String(task.name ?? "");
|
|
202
|
+
const { names: own, slug, ordinal } = stageSpellings(stageName, position);
|
|
203
|
+
const names = [...own, ...slug === undefined ? [] : [slug], ordinal].map(indexKey);
|
|
204
|
+
const matcher = taskMatcher(model, taskName);
|
|
205
|
+
const mine = (producer) => names.includes(indexKey(producer.stage)) && matcher.names(producer.task);
|
|
206
|
+
const rows = (task.outputRows ?? []).map((row) => ({ row, aliases: [] }));
|
|
207
|
+
const sameOutput = (a, b) => indexKey(a) === indexKey(b) || (!a.includes(".") || !b.includes(".")) && indexKey(emittedName(a)) === indexKey(emittedName(b));
|
|
208
|
+
const dotted = (one) => [one.row, ...one.aliases].find((spelling) => spelling.includes("."));
|
|
209
|
+
const takes = (one, name) => {
|
|
210
|
+
if (!sameOutput(one.row, name))
|
|
211
|
+
return false;
|
|
212
|
+
if (!name.includes("."))
|
|
213
|
+
return true;
|
|
214
|
+
const held = dotted(one);
|
|
215
|
+
return held === undefined || indexKey(held) === indexKey(name);
|
|
216
|
+
};
|
|
217
|
+
const add = (name) => {
|
|
218
|
+
if (name === "")
|
|
219
|
+
return;
|
|
220
|
+
const found = rows.find((one) => takes(one, name));
|
|
221
|
+
if (found === undefined)
|
|
222
|
+
rows.push({ row: name, aliases: [] });
|
|
223
|
+
else if (found.row !== name && !found.aliases.includes(name)) {
|
|
224
|
+
found.aliases.push(name);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
if (matcher.filedUnique) {
|
|
228
|
+
for (const name of model.resourceOutputs[modelKey(taskName)] ?? []) {
|
|
229
|
+
add(name);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
for (const producer of model.xrefOutputs) {
|
|
233
|
+
if (mine(producer))
|
|
234
|
+
add(producer.output);
|
|
235
|
+
}
|
|
236
|
+
for (const stage of model.stages) {
|
|
237
|
+
for (const other of stage.tasks) {
|
|
238
|
+
for (const row of other.producerInputs ?? []) {
|
|
239
|
+
const producer = row.producer;
|
|
240
|
+
if (producer !== undefined && mine(producer)) {
|
|
241
|
+
add(producer.output);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return rows;
|
|
247
|
+
};
|
|
248
|
+
var emittedName = (row) => row.split(".").at(-1) ?? row;
|
|
249
|
+
var OUTPUT_TYPES = new Map([
|
|
250
|
+
["string", "string"],
|
|
251
|
+
["object", "jsonSchema"],
|
|
252
|
+
["json", "jsonSchema"],
|
|
253
|
+
["jsonschema", "jsonSchema"],
|
|
254
|
+
["array", "jsonSchema"]
|
|
255
|
+
]);
|
|
256
|
+
var readsOutput = (reference, row) => indexKey(reference) === indexKey(row) || !reference.includes(".") && indexKey(reference) === indexKey(emittedName(row));
|
|
257
|
+
var outputTypeFor = (model, stageNames, taskName, output) => {
|
|
258
|
+
const matcher = taskMatcher(model, taskName);
|
|
259
|
+
for (const stage of model.stages) {
|
|
260
|
+
for (const task of stage.tasks) {
|
|
261
|
+
for (const row of task.producerInputs ?? []) {
|
|
262
|
+
const producer = row.producer;
|
|
263
|
+
if (producer === undefined || row.direct !== true || typeof row.type !== "string" || !stageNames.includes(indexKey(producer.stage)) || !matcher.names(producer.task) || !readsOutput(producer.output, output)) {
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
const mapped = OUTPUT_TYPES.get(row.type.trim().toLowerCase().replaceAll(" ", ""));
|
|
267
|
+
if (mapped !== undefined)
|
|
268
|
+
return mapped;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return;
|
|
273
|
+
};
|
|
274
|
+
var outputIdentity = (leaf, taken) => {
|
|
275
|
+
const base = leaf === "" ? leaf : `${leaf[0].toLowerCase()}${leaf.slice(1)}`;
|
|
276
|
+
if (!isExpressionNamespace(base)) {
|
|
277
|
+
return { id: dedupedId(base, taken), name: leaf };
|
|
278
|
+
}
|
|
279
|
+
const id = dedupedId(base, new Set([...taken, base]));
|
|
280
|
+
taken.add(id);
|
|
281
|
+
return { id, name: id };
|
|
282
|
+
};
|
|
283
|
+
var outputFor = (row, elementId, taken, type, taskType) => {
|
|
284
|
+
const leaf = row.split(".").at(-1) ?? row;
|
|
285
|
+
const { id, name } = outputIdentity(leaf, taken);
|
|
286
|
+
return {
|
|
287
|
+
name,
|
|
288
|
+
...type !== undefined && { type },
|
|
289
|
+
id,
|
|
290
|
+
var: id,
|
|
291
|
+
value: id,
|
|
292
|
+
source: outputSourceFor(taskType, row),
|
|
293
|
+
target: `=${id}`,
|
|
294
|
+
elementId
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
var variableOutputType = (model, variable) => {
|
|
298
|
+
const declared = model.variableTypes[modelKey(variable)];
|
|
299
|
+
if (typeof declared !== "string" || declared.trim() === "") {
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
const key = declared.trim().toLowerCase().replaceAll(" ", "");
|
|
303
|
+
return OUTPUT_TYPES.get(key) ?? "string";
|
|
304
|
+
};
|
|
305
|
+
var rowOutputType = (cell) => outputTypeCell(cell);
|
|
306
|
+
var unmappedOutputType = (where, cell, fallback) => ({
|
|
307
|
+
kind: "output-type",
|
|
308
|
+
where,
|
|
309
|
+
detail: `the SDD row types this output "${cell}", which names no output type the Case Designer writes (${OUTPUT_TYPE_NAMES.join(", ")}), so ${fallback === undefined ? "the output has no type" : `the output falls back to "${fallback}"`}; correct the row's Type cell to the resource's output-schema type`
|
|
310
|
+
});
|
|
311
|
+
var extractOutputFor = (row, elementId, taken, type, taskType) => {
|
|
312
|
+
const leaf = row.field.split(".").at(-1) ?? row.field;
|
|
313
|
+
const { id, name } = outputIdentity(leaf, taken);
|
|
314
|
+
return {
|
|
315
|
+
name,
|
|
316
|
+
...type !== undefined && { type },
|
|
317
|
+
id,
|
|
318
|
+
var: row.variable,
|
|
319
|
+
value: row.variable,
|
|
320
|
+
source: outputSourceFor(taskType, row.field),
|
|
321
|
+
target: `=${id}`,
|
|
322
|
+
originalVar: id,
|
|
323
|
+
elementId
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
var customOutputFor = (row, type) => ({
|
|
327
|
+
name: row.variable,
|
|
328
|
+
...type !== undefined && { type },
|
|
329
|
+
custom: true,
|
|
330
|
+
var: row.variable,
|
|
331
|
+
value: canonicalExpression(unquoteLiteral(row.expression)),
|
|
332
|
+
source: canonicalExpression(unquoteLiteral(row.expression)),
|
|
333
|
+
target: "",
|
|
334
|
+
body: "",
|
|
335
|
+
elementId: "root"
|
|
336
|
+
});
|
|
337
|
+
var canonicalExpression = (value) => value.startsWith("=metadata.") ? `=js:${value.slice(1)}` : value;
|
|
338
|
+
var unquoteLiteral = (cell) => {
|
|
339
|
+
const text = cell.trim();
|
|
340
|
+
const quote = text[0];
|
|
341
|
+
if (quote !== '"' && quote !== "'")
|
|
342
|
+
return cell;
|
|
343
|
+
if (text.length < 2 || text[text.length - 1] !== quote)
|
|
344
|
+
return cell;
|
|
345
|
+
const inner = text.slice(1, -1);
|
|
346
|
+
for (let at = 0;at < inner.length; at += 1) {
|
|
347
|
+
if (inner[at] === "\\") {
|
|
348
|
+
at += 1;
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
if (inner[at] === quote)
|
|
352
|
+
return cell;
|
|
353
|
+
}
|
|
354
|
+
return inner.replaceAll(`\\${quote}`, quote);
|
|
355
|
+
};
|
|
356
|
+
var RANK_LITERAL = 1;
|
|
357
|
+
var RANK_PRODUCER = 2;
|
|
358
|
+
var RANK_EXPRESSION = 3;
|
|
359
|
+
var unboundProducerDetail = (target, found) => {
|
|
360
|
+
if (found === undefined) {
|
|
361
|
+
return `the Inputs row reads an output (${target}) that no task in this SDD declares`;
|
|
362
|
+
}
|
|
363
|
+
const spellings = new Set(found.names);
|
|
364
|
+
const listed = [...spellings].map((task) => `"${task}"`).join(", ");
|
|
365
|
+
if (spellings.size < found.names.length) {
|
|
366
|
+
return `the Inputs row reads an output (${target}) of a task that ${found.names.length} tasks in that stage answer to (${listed}), so it is left unbound rather than pointed at one of them. Task names are unique across the case, so rename all but one`;
|
|
367
|
+
}
|
|
368
|
+
return `the Inputs row reads an output (${target}) whose task spelling ${found.names.length} tasks answer to (${listed}), so it is left unbound rather than pointed at one of them`;
|
|
369
|
+
};
|
|
370
|
+
var inputsFor = (task, elementId, where, unresolved, outputs) => {
|
|
371
|
+
const ranked = new Map;
|
|
372
|
+
const offer = (name, rank, input) => {
|
|
373
|
+
const existing = ranked.get(name);
|
|
374
|
+
if (existing === undefined || rank > existing.rank) {
|
|
375
|
+
ranked.set(name, { rank, input });
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
for (const row of task.literalInputs ?? []) {
|
|
379
|
+
offer(String(row.name ?? ""), RANK_LITERAL, {
|
|
380
|
+
name: String(row.name ?? ""),
|
|
381
|
+
value: unquoteLiteral(String(row.value ?? "")),
|
|
382
|
+
elementId
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
for (const row of task.expressionInputs ?? []) {
|
|
386
|
+
offer(String(row.name ?? ""), RANK_EXPRESSION, {
|
|
387
|
+
name: String(row.name ?? ""),
|
|
388
|
+
value: canonicalExpression(expandXrefs(String(row.expression ?? row.value ?? ""), {
|
|
389
|
+
outputs,
|
|
390
|
+
where,
|
|
391
|
+
unresolved
|
|
392
|
+
})),
|
|
393
|
+
elementId
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
for (const row of task.producerInputs ?? []) {
|
|
397
|
+
const name = String(row.name ?? "");
|
|
398
|
+
const producer = row.producer;
|
|
399
|
+
const found = producer === undefined ? undefined : lookupOutput(outputs, `${indexKey(producer.stage)}|${indexKey(producer.task)}|${indexKey(producer.output)}`, producer.task);
|
|
400
|
+
if (found === undefined || !("id" in found)) {
|
|
401
|
+
const target = producer === undefined ? "unnamed producer" : `"${producer.stage}"."${producer.task}".${producer.output}`;
|
|
402
|
+
unresolved.push({
|
|
403
|
+
kind: "producer-reference",
|
|
404
|
+
where: `${where}.inputs[${name}]`,
|
|
405
|
+
detail: unboundProducerDetail(target, found)
|
|
406
|
+
});
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
const id = found.id;
|
|
410
|
+
offer(name, RANK_PRODUCER, {
|
|
411
|
+
name,
|
|
412
|
+
value: row.direct === false ? expandXrefs(String(row.value ?? `=js:vars.${id}`), {
|
|
413
|
+
outputs,
|
|
414
|
+
where,
|
|
415
|
+
unresolved
|
|
416
|
+
}) : `=vars.${id}`,
|
|
417
|
+
elementId
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
return [...ranked.values()].map((entry) => entry.input);
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
export { STAGE_SELECTOR_RULES, TASK_SELECTOR_RULES, parseIfCell, outputTypeCell, markDeferredOutputs, expandXrefs, expandOutputMarkers, declaredOutputs, outputTypeFor, outputFor, variableOutputType, rowOutputType, unmappedOutputType, extractOutputFor, customOutputFor, canonicalExpression, unquoteLiteral, inputsFor };
|
|
424
|
+
|
|
425
|
+
//# debugId=6333C5A436172EF864756E2164756E21
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// ../packager/packager-tool-case/src/case-roles.ts
|
|
2
|
+
var CASE_APP_ROLE_ACTIONS = {
|
|
3
|
+
View: "CaseManagement.Cases.View",
|
|
4
|
+
Create: "CaseManagement.Cases.Create",
|
|
5
|
+
Edit: "CaseManagement.Cases.Edit",
|
|
6
|
+
Close: "CaseManagement.Cases.Close",
|
|
7
|
+
Reopen: "CaseManagement.Cases.Reopen",
|
|
8
|
+
Assign: "CaseManagement.Cases.Assign",
|
|
9
|
+
ManageSLA: "CaseManagement.Cases.ManageSLA",
|
|
10
|
+
RunAdhocTasks: "CaseManagement.Cases.RunAdhocTasks",
|
|
11
|
+
SelectStage: "CaseManagement.Cases.SelectStage",
|
|
12
|
+
ViewSummary: "CaseManagement.Cases.ViewSummary",
|
|
13
|
+
LogsView: "Orchestrator.Logs.View",
|
|
14
|
+
TasksView: "Orchestrator.Tasks.View",
|
|
15
|
+
TasksCreate: "Orchestrator.Tasks.Create",
|
|
16
|
+
TasksEdit: "Orchestrator.Tasks.Edit",
|
|
17
|
+
TasksDelete: "Orchestrator.Tasks.Delete",
|
|
18
|
+
TaskAssignmentView: "Orchestrator.TaskAssignment.View",
|
|
19
|
+
TaskAssignmentCreate: "Orchestrator.TaskAssignment.Create",
|
|
20
|
+
TaskAssignmentEdit: "Orchestrator.TaskAssignment.Edit",
|
|
21
|
+
TaskAssignmentDelete: "Orchestrator.TaskAssignment.Delete",
|
|
22
|
+
TaskSelfAssignmentCreate: "Orchestrator.TaskSelfAssignment.Create",
|
|
23
|
+
TaskSelfAssignmentEdit: "Orchestrator.TaskSelfAssignment.Edit",
|
|
24
|
+
TaskSelfAssignmentDelete: "Orchestrator.TaskSelfAssignment.Delete"
|
|
25
|
+
};
|
|
26
|
+
var LEGACY_CASE_APP_ROLE_ACTIONS = [
|
|
27
|
+
"CaseManagement.Cases.Manage"
|
|
28
|
+
];
|
|
29
|
+
var CASE_APP_ROLE_ACTION_KEYS = Object.keys(CASE_APP_ROLE_ACTIONS);
|
|
30
|
+
var STAGE_ALLOWED_ROLE_ACTION_KEYS = [
|
|
31
|
+
"View",
|
|
32
|
+
"Assign",
|
|
33
|
+
"ManageSLA",
|
|
34
|
+
"RunAdhocTasks"
|
|
35
|
+
];
|
|
36
|
+
var TENANT_GATED_ROLE_ACTIONS = [
|
|
37
|
+
{ flag: "panel-enableCaseRoleAssign", keys: ["Assign"] },
|
|
38
|
+
{
|
|
39
|
+
flag: "panel-enableCaseRoleTaskPermissions",
|
|
40
|
+
keys: [
|
|
41
|
+
"TasksView",
|
|
42
|
+
"TasksCreate",
|
|
43
|
+
"TasksEdit",
|
|
44
|
+
"TasksDelete",
|
|
45
|
+
"TaskAssignmentView",
|
|
46
|
+
"TaskAssignmentCreate",
|
|
47
|
+
"TaskAssignmentEdit",
|
|
48
|
+
"TaskAssignmentDelete",
|
|
49
|
+
"TaskSelfAssignmentCreate",
|
|
50
|
+
"TaskSelfAssignmentEdit",
|
|
51
|
+
"TaskSelfAssignmentDelete"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
var roleActionGateOf = (key) => TENANT_GATED_ROLE_ACTIONS.find((gate) => gate.keys.includes(key))?.flag;
|
|
56
|
+
var CASE_ROLE_NAME_MAX_LENGTH = 64;
|
|
57
|
+
var CASE_ROLE_DESCRIPTION_MAX_LENGTH = 500;
|
|
58
|
+
var CASE_ROLE_NAME_FORBIDDEN = /[<>"%;&']/;
|
|
59
|
+
var CASE_APP_VERSIONS_WITH_ROLES = ["v2", "custom"];
|
|
60
|
+
var ACTION_KEY_BY_LITERAL = new Map(CASE_APP_ROLE_ACTION_KEYS.map((key) => [CASE_APP_ROLE_ACTIONS[key], key]));
|
|
61
|
+
var ACTION_KEY_BY_FOLDED = new Map(CASE_APP_ROLE_ACTION_KEYS.map((key) => [key.toLowerCase(), key]));
|
|
62
|
+
var isLegacyRoleAction = (literal) => LEGACY_CASE_APP_ROLE_ACTIONS.includes(literal);
|
|
63
|
+
var roleActionKeyOf = (literal) => ACTION_KEY_BY_LITERAL.get(literal);
|
|
64
|
+
var roleActionKeyFor = (text) => {
|
|
65
|
+
const trimmed = text.trim();
|
|
66
|
+
return ACTION_KEY_BY_LITERAL.get(trimmed) ?? ACTION_KEY_BY_FOLDED.get(trimmed.toLowerCase());
|
|
67
|
+
};
|
|
68
|
+
var roleDescriptionOf = (role) => role.description?.trim() || role.name;
|
|
69
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
70
|
+
var STAGE_NODE_TYPE = "case-management:Stage";
|
|
71
|
+
var caseStageLabels = (nodes) => {
|
|
72
|
+
const labels = new Map;
|
|
73
|
+
for (const node of Array.isArray(nodes) ? nodes : []) {
|
|
74
|
+
if (!isRecord(node))
|
|
75
|
+
continue;
|
|
76
|
+
const { id, type, data } = node;
|
|
77
|
+
if (type !== STAGE_NODE_TYPE || typeof id !== "string")
|
|
78
|
+
continue;
|
|
79
|
+
const label = isRecord(data) ? data.label : undefined;
|
|
80
|
+
if (typeof label === "string" && label.trim() !== "") {
|
|
81
|
+
labels.set(id, label);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return labels;
|
|
85
|
+
};
|
|
86
|
+
var liveStageIdsOf = (role, stages) => (role.stageIds ?? []).filter((stageId) => stages.has(stageId));
|
|
87
|
+
var publishedRoleActions = (role) => role.actions.filter((action) => {
|
|
88
|
+
const key = roleActionKeyOf(action);
|
|
89
|
+
if (key === undefined)
|
|
90
|
+
return false;
|
|
91
|
+
return role.scope !== "stages" || STAGE_ALLOWED_ROLE_ACTION_KEYS.includes(key);
|
|
92
|
+
});
|
|
93
|
+
var roleDeploys = (role, stages) => publishedRoleActions(role).length > 0 && (role.scope !== "stages" || liveStageIdsOf(role, stages).length > 0);
|
|
94
|
+
var roleResourceKey = (name) => name.trim().toLowerCase();
|
|
95
|
+
var CASE_ROLE_FIELDS = [
|
|
96
|
+
"id",
|
|
97
|
+
"name",
|
|
98
|
+
"description",
|
|
99
|
+
"isDefault",
|
|
100
|
+
"actions",
|
|
101
|
+
"scope",
|
|
102
|
+
"stageIds"
|
|
103
|
+
];
|
|
104
|
+
var caseRoleEntries = (plan) => {
|
|
105
|
+
if (!isRecord(plan) || !isRecord(plan.metadata))
|
|
106
|
+
return [];
|
|
107
|
+
const entries = plan.metadata.caseRoles;
|
|
108
|
+
return Array.isArray(entries) ? entries : [];
|
|
109
|
+
};
|
|
110
|
+
var readCaseRole = (entry) => {
|
|
111
|
+
if (!isRecord(entry))
|
|
112
|
+
return;
|
|
113
|
+
const { id, name, description, isDefault, actions, scope, stageIds } = entry;
|
|
114
|
+
if (typeof name !== "string" || name.trim() === "")
|
|
115
|
+
return;
|
|
116
|
+
if (scope !== "case" && scope !== "stages")
|
|
117
|
+
return;
|
|
118
|
+
if (!Array.isArray(actions))
|
|
119
|
+
return;
|
|
120
|
+
return {
|
|
121
|
+
id: typeof id === "string" ? id : name,
|
|
122
|
+
name,
|
|
123
|
+
...typeof description === "string" && { description },
|
|
124
|
+
...typeof isDefault === "boolean" && { isDefault },
|
|
125
|
+
actions: actions.filter((action) => typeof action === "string" && (roleActionKeyOf(action) !== undefined || isLegacyRoleAction(action))),
|
|
126
|
+
scope,
|
|
127
|
+
...Array.isArray(stageIds) && {
|
|
128
|
+
stageIds: stageIds.filter((stageId) => typeof stageId === "string")
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
var readCaseRoles = (plan) => caseRoleEntries(plan).flatMap((entry) => {
|
|
133
|
+
const role = readCaseRole(entry);
|
|
134
|
+
return role === undefined ? [] : [role];
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
export { CASE_APP_ROLE_ACTIONS, CASE_APP_ROLE_ACTION_KEYS, STAGE_ALLOWED_ROLE_ACTION_KEYS, roleActionGateOf, CASE_ROLE_NAME_MAX_LENGTH, CASE_ROLE_DESCRIPTION_MAX_LENGTH, CASE_ROLE_NAME_FORBIDDEN, CASE_APP_VERSIONS_WITH_ROLES, roleActionKeyOf, roleActionKeyFor, roleDescriptionOf, caseStageLabels, liveStageIdsOf, publishedRoleActions, roleDeploys, roleResourceKey, CASE_ROLE_FIELDS, caseRoleEntries, readCaseRole, readCaseRoles };
|
|
138
|
+
|
|
139
|
+
//# debugId=975EE435E70BFF6A64756E2164756E21
|