@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
|
@@ -1,44 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
DEBUG_MODE_MAP,
|
|
6
|
-
SIMULATION_MODE_MAP,
|
|
7
|
-
beginDebugSession,
|
|
8
|
-
createDebugInstance,
|
|
9
|
-
debugPimsGet,
|
|
10
|
-
debugPimsPatch,
|
|
11
|
-
debugPimsPost,
|
|
12
|
-
debugPimsPut,
|
|
13
|
-
fetchDebugInstanceVariables,
|
|
14
|
-
getPersonalFolderKey
|
|
15
|
-
} from "./packager-tool-9e59z4d6.js";
|
|
16
|
-
import {
|
|
17
|
-
getAuthContext,
|
|
18
|
-
getLoginStatusAsync
|
|
19
|
-
} from "./packager-tool-yn33pw57.js";
|
|
20
|
-
import {
|
|
21
|
-
DEFAULT_PAGE_SIZE,
|
|
22
|
-
EXIT_CODES,
|
|
2
|
+
catchError2,
|
|
3
|
+
extractErrorMessage,
|
|
4
|
+
RESULTS,
|
|
23
5
|
InvalidArgumentError,
|
|
24
|
-
|
|
6
|
+
logger,
|
|
7
|
+
EXIT_CODES,
|
|
25
8
|
Pagination,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
9
|
+
OutputFormatter,
|
|
10
|
+
processContext,
|
|
11
|
+
DEFAULT_PAGE_SIZE,
|
|
29
12
|
isGuid,
|
|
30
|
-
logger,
|
|
31
|
-
parseBoundedInt,
|
|
32
13
|
parseLimit,
|
|
33
14
|
parseOffset,
|
|
34
|
-
|
|
35
|
-
} from "./packager-tool-
|
|
15
|
+
parseBoundedInt
|
|
16
|
+
} from "./packager-tool-psmb758n.js";
|
|
17
|
+
import {
|
|
18
|
+
getAuthContext2
|
|
19
|
+
} from "./packager-tool-dn9d4ywm.js";
|
|
20
|
+
import {
|
|
21
|
+
DEBUG_MODE_MAP2,
|
|
22
|
+
SIMULATION_MODE_MAP2
|
|
23
|
+
} from "./packager-tool-me8gd22q.js";
|
|
24
|
+
import {
|
|
25
|
+
resolveJsonInput
|
|
26
|
+
} from "./packager-tool-zbx189j3.js";
|
|
36
27
|
|
|
37
28
|
// ../maestro-sdk/src/client.ts
|
|
38
29
|
function parseBackendErrorBody(body) {
|
|
39
30
|
if (!body)
|
|
40
31
|
return {};
|
|
41
|
-
const [parseErr, parsed] =
|
|
32
|
+
const [parseErr, parsed] = catchError2(() => JSON.parse(body));
|
|
42
33
|
if (parseErr || !parsed || typeof parsed !== "object")
|
|
43
34
|
return {};
|
|
44
35
|
const result = {};
|
|
@@ -122,7 +113,7 @@ async function pimsGet(config, path, options) {
|
|
|
122
113
|
const text = await response.text();
|
|
123
114
|
if (!text)
|
|
124
115
|
return {};
|
|
125
|
-
const [parseErr, parsed] =
|
|
116
|
+
const [parseErr, parsed] = catchError2(() => JSON.parse(text));
|
|
126
117
|
if (parseErr)
|
|
127
118
|
throw new Error(`Failed to parse API response body: ${parseErr.message}`);
|
|
128
119
|
return parsed;
|
|
@@ -149,7 +140,7 @@ async function pimsRequest(config, method, path, body, options) {
|
|
|
149
140
|
const text = await response.text();
|
|
150
141
|
if (!text)
|
|
151
142
|
return {};
|
|
152
|
-
const [parseErr, parsed] =
|
|
143
|
+
const [parseErr, parsed] = catchError2(() => JSON.parse(text));
|
|
153
144
|
if (parseErr) {
|
|
154
145
|
throw new Error(`Failed to parse API response body: ${parseErr.message}`);
|
|
155
146
|
}
|
|
@@ -167,7 +158,7 @@ async function pimsPatch(config, path, body, options) {
|
|
|
167
158
|
|
|
168
159
|
// ../maestro-sdk/src/client-factory.ts
|
|
169
160
|
async function createPimsConfig() {
|
|
170
|
-
const ctx = await
|
|
161
|
+
const ctx = await getAuthContext2({
|
|
171
162
|
ensureTokenValidityMinutes: 10,
|
|
172
163
|
requireOrganizationId: true,
|
|
173
164
|
requireTenantId: true
|
|
@@ -199,67 +190,6 @@ function buildQueryString(params) {
|
|
|
199
190
|
return `?${new URLSearchParams(entries).toString()}`;
|
|
200
191
|
}
|
|
201
192
|
|
|
202
|
-
// ../maestro-sdk/src/with-debug-pims-call.ts
|
|
203
|
-
async function createDebugPimsConfig() {
|
|
204
|
-
const status = await getLoginStatusAsync({
|
|
205
|
-
ensureTokenValidityMinutes: 10
|
|
206
|
-
});
|
|
207
|
-
if (status.loginStatus !== "Logged in" || !status.baseUrl || !status.accessToken) {
|
|
208
|
-
throw new Error(status.hint ? `Not logged in. ${status.hint}` : "Not logged in. Run 'uip login' first.");
|
|
209
|
-
}
|
|
210
|
-
if (!status.organizationId) {
|
|
211
|
-
throw new Error("Organization ID not available. Ensure you are logged in with an organization context.");
|
|
212
|
-
}
|
|
213
|
-
if (!status.tenantId) {
|
|
214
|
-
throw new Error("Tenant ID not available. Ensure UIPATH_TENANT_ID is set.");
|
|
215
|
-
}
|
|
216
|
-
if (!status.tenantName) {
|
|
217
|
-
throw new Error("Tenant name not available. Ensure you are logged in with a tenant context.");
|
|
218
|
-
}
|
|
219
|
-
return {
|
|
220
|
-
baseUrl: status.baseUrl,
|
|
221
|
-
organizationId: status.organizationId,
|
|
222
|
-
tenantName: status.tenantName,
|
|
223
|
-
tenantId: status.tenantId,
|
|
224
|
-
authToken: status.accessToken
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
async function withDebugPimsCall(fn, errorMessage) {
|
|
228
|
-
const [configError, config] = await catchError(createDebugPimsConfig());
|
|
229
|
-
if (configError) {
|
|
230
|
-
logger.warn(`${errorMessage}: ${configError.message}`);
|
|
231
|
-
OutputFormatter.error({
|
|
232
|
-
Result: RESULTS.Failure,
|
|
233
|
-
Message: errorMessage,
|
|
234
|
-
Instructions: configError.message
|
|
235
|
-
});
|
|
236
|
-
processContext.exit(1);
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
if (!config.folderKey) {
|
|
240
|
-
const [folderError, folder] = await catchError(getPersonalFolderKey(config));
|
|
241
|
-
if (folderError) {
|
|
242
|
-
logger.warn(`Could not resolve personal folder: ${folderError.message}`);
|
|
243
|
-
} else {
|
|
244
|
-
config.folderKey = folder.key;
|
|
245
|
-
config.organizationUnitId = folder.id;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
const [error, result] = await catchError(fn(config));
|
|
249
|
-
if (error) {
|
|
250
|
-
const msg = await extractErrorMessage(error);
|
|
251
|
-
logger.warn(`${errorMessage}: ${msg}`);
|
|
252
|
-
OutputFormatter.error({
|
|
253
|
-
Result: RESULTS.Failure,
|
|
254
|
-
Message: errorMessage,
|
|
255
|
-
Instructions: msg
|
|
256
|
-
});
|
|
257
|
-
processContext.exit(1);
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
return result;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
193
|
// ../maestro-sdk/src/shared-commands/examples.ts
|
|
264
194
|
var INSTANCE = "f4a1c2b3-0000-4000-8000-000000000001";
|
|
265
195
|
var FOLDER = "b2c3d4e5-0000-4000-8000-000000000002";
|
|
@@ -270,13 +200,13 @@ var SOLUTION = "e5f6a7b8-0000-4000-8000-000000000009";
|
|
|
270
200
|
var PROJECT = "f6a7b8c9-0000-4000-8000-00000000000a";
|
|
271
201
|
var operation = (verb, code, description, status) => (prefix) => ({
|
|
272
202
|
Description: description,
|
|
273
|
-
Command: `${prefix}
|
|
203
|
+
Command: `${prefix} instances ${verb} ${INSTANCE} --folder-key ${FOLDER}`,
|
|
274
204
|
Output: { Code: code, Data: { InstanceId: INSTANCE, Status: status } }
|
|
275
205
|
});
|
|
276
206
|
var EXAMPLES = {
|
|
277
|
-
"
|
|
207
|
+
"instances list": (prefix) => ({
|
|
278
208
|
Description: "List the faulted instances in a folder",
|
|
279
|
-
Command: `${prefix}
|
|
209
|
+
Command: `${prefix} instances list --folder-key ${FOLDER} --status Faulted --limit 2`,
|
|
280
210
|
Output: {
|
|
281
211
|
Code: "InstanceList",
|
|
282
212
|
Data: [
|
|
@@ -291,9 +221,9 @@ var EXAMPLES = {
|
|
|
291
221
|
]
|
|
292
222
|
}
|
|
293
223
|
}),
|
|
294
|
-
"
|
|
224
|
+
"instances get": (prefix) => ({
|
|
295
225
|
Description: "Get one instance and its latest run",
|
|
296
|
-
Command: `${prefix}
|
|
226
|
+
Command: `${prefix} instances get ${INSTANCE} --folder-key ${FOLDER}`,
|
|
297
227
|
Output: {
|
|
298
228
|
Code: "InstanceGet",
|
|
299
229
|
Data: {
|
|
@@ -307,13 +237,13 @@ var EXAMPLES = {
|
|
|
307
237
|
}
|
|
308
238
|
}
|
|
309
239
|
}),
|
|
310
|
-
"
|
|
311
|
-
"
|
|
312
|
-
"
|
|
313
|
-
"
|
|
314
|
-
"
|
|
240
|
+
"instances pause": operation("pause", "InstancePaused", "Pause a running instance", "Paused"),
|
|
241
|
+
"instances resume": operation("resume", "InstanceResumed", "Resume a paused instance", "Running"),
|
|
242
|
+
"instances cancel": operation("cancel", "InstanceCanceled", "Cancel an instance", "Canceling"),
|
|
243
|
+
"instances retry": operation("retry", "InstanceRetried", "Retry a faulted instance from where it failed", "Running"),
|
|
244
|
+
"instances variables": (prefix) => ({
|
|
315
245
|
Description: "Read an instance's variables",
|
|
316
|
-
Command: `${prefix}
|
|
246
|
+
Command: `${prefix} instances variables ${INSTANCE} --folder-key ${FOLDER}`,
|
|
317
247
|
Output: {
|
|
318
248
|
Code: "InstanceVariables",
|
|
319
249
|
Data: {
|
|
@@ -333,9 +263,9 @@ var EXAMPLES = {
|
|
|
333
263
|
}
|
|
334
264
|
}
|
|
335
265
|
}),
|
|
336
|
-
"
|
|
266
|
+
"instances variables-all": (prefix) => ({
|
|
337
267
|
Description: "Read the variables of every scope in an instance",
|
|
338
|
-
Command: `${prefix}
|
|
268
|
+
Command: `${prefix} instances variables-all ${INSTANCE} --folder-key ${FOLDER}`,
|
|
339
269
|
Output: {
|
|
340
270
|
Code: "InstanceVariablesAll",
|
|
341
271
|
Data: {
|
|
@@ -350,9 +280,9 @@ var EXAMPLES = {
|
|
|
350
280
|
}
|
|
351
281
|
}
|
|
352
282
|
}),
|
|
353
|
-
"
|
|
283
|
+
"instances global-variables": (prefix) => ({
|
|
354
284
|
Description: "Read an instance's global variables",
|
|
355
|
-
Command: `${prefix}
|
|
285
|
+
Command: `${prefix} instances global-variables ${INSTANCE} --folder-key ${FOLDER}`,
|
|
356
286
|
Output: {
|
|
357
287
|
Code: "InstanceGlobalVariables",
|
|
358
288
|
Data: {
|
|
@@ -363,17 +293,17 @@ var EXAMPLES = {
|
|
|
363
293
|
}
|
|
364
294
|
}
|
|
365
295
|
}),
|
|
366
|
-
"
|
|
296
|
+
"instances variables-set": (prefix) => ({
|
|
367
297
|
Description: "Patch variables on a running instance from a file",
|
|
368
|
-
Command: `${prefix}
|
|
298
|
+
Command: `${prefix} instances variables-set ${INSTANCE} --folder-key ${FOLDER} --inputs @patch.json`,
|
|
369
299
|
Output: {
|
|
370
300
|
Code: "InstanceVariablesSet",
|
|
371
301
|
Data: {}
|
|
372
302
|
}
|
|
373
303
|
}),
|
|
374
|
-
"
|
|
304
|
+
"instances incidents": (prefix) => ({
|
|
375
305
|
Description: "List the incidents an instance raised",
|
|
376
|
-
Command: `${prefix}
|
|
306
|
+
Command: `${prefix} instances incidents ${INSTANCE} --folder-key ${FOLDER}`,
|
|
377
307
|
Output: {
|
|
378
308
|
Code: "InstanceIncidents",
|
|
379
309
|
Data: [
|
|
@@ -388,38 +318,38 @@ var EXAMPLES = {
|
|
|
388
318
|
]
|
|
389
319
|
}
|
|
390
320
|
}),
|
|
391
|
-
"
|
|
321
|
+
"instances asset": (prefix) => ({
|
|
392
322
|
Description: "Get the asset an instance runs",
|
|
393
|
-
Command: `${prefix}
|
|
323
|
+
Command: `${prefix} instances asset ${INSTANCE} --folder-key ${FOLDER}`,
|
|
394
324
|
Output: { Code: "InstanceAsset", Data: {} }
|
|
395
325
|
}),
|
|
396
|
-
"
|
|
326
|
+
"instances migrate": (prefix) => ({
|
|
397
327
|
Description: "Move an instance to a newer package version",
|
|
398
|
-
Command: `${prefix}
|
|
328
|
+
Command: `${prefix} instances migrate ${INSTANCE} 1.0.4 --folder-key ${FOLDER} --comment "Fix review step"`,
|
|
399
329
|
Output: {
|
|
400
330
|
Code: "InstanceMigrated",
|
|
401
331
|
Data: { InstanceId: INSTANCE, Status: "Running" }
|
|
402
332
|
}
|
|
403
333
|
}),
|
|
404
|
-
"
|
|
334
|
+
"instances goto": (prefix) => ({
|
|
405
335
|
Description: "Move an instance's cursor from one element to another",
|
|
406
|
-
Command: `${prefix}
|
|
336
|
+
Command: `${prefix} instances goto ${INSTANCE} '[{"sourceElementId":"${ELEMENT}","targetElementId":"Task_Approve"}]' --folder-key ${FOLDER}`,
|
|
407
337
|
Output: {
|
|
408
338
|
Code: "InstanceGoto",
|
|
409
339
|
Data: { InstanceId: INSTANCE, Status: "Running" }
|
|
410
340
|
}
|
|
411
341
|
}),
|
|
412
|
-
"
|
|
342
|
+
"instances cursors": (prefix) => ({
|
|
413
343
|
Description: "List the elements an instance is currently at",
|
|
414
|
-
Command: `${prefix}
|
|
344
|
+
Command: `${prefix} instances cursors ${INSTANCE} --folder-key ${FOLDER}`,
|
|
415
345
|
Output: {
|
|
416
346
|
Code: "InstanceCursors",
|
|
417
347
|
Data: { ElementIds: [ELEMENT] }
|
|
418
348
|
}
|
|
419
349
|
}),
|
|
420
|
-
"
|
|
350
|
+
"instances messages send": (prefix) => ({
|
|
421
351
|
Description: "Send a message to the instances waiting for it",
|
|
422
|
-
Command: `${prefix}
|
|
352
|
+
Command: `${prefix} instances messages send --folder-key ${FOLDER} --inputs @message.json`,
|
|
423
353
|
Output: {
|
|
424
354
|
Code: "MessageSent",
|
|
425
355
|
Data: {
|
|
@@ -428,9 +358,9 @@ var EXAMPLES = {
|
|
|
428
358
|
}
|
|
429
359
|
}
|
|
430
360
|
}),
|
|
431
|
-
"
|
|
361
|
+
"instances element-executions": (prefix) => ({
|
|
432
362
|
Description: "List how each element of an instance ran",
|
|
433
|
-
Command: `${prefix}
|
|
363
|
+
Command: `${prefix} instances element-executions ${INSTANCE} --folder-key ${FOLDER}`,
|
|
434
364
|
Output: {
|
|
435
365
|
Code: "InstanceElementExecutions",
|
|
436
366
|
Data: {
|
|
@@ -448,25 +378,25 @@ var EXAMPLES = {
|
|
|
448
378
|
}
|
|
449
379
|
}
|
|
450
380
|
}),
|
|
451
|
-
"
|
|
381
|
+
"instances elements cancel": (prefix) => ({
|
|
452
382
|
Description: "Cancel one running element of an instance",
|
|
453
|
-
Command: `${prefix}
|
|
383
|
+
Command: `${prefix} instances elements cancel ${INSTANCE} ${ELEMENT} --folder-key ${FOLDER}`,
|
|
454
384
|
Output: {
|
|
455
385
|
Code: "ElementCanceled",
|
|
456
386
|
Data: { InstanceId: INSTANCE, Status: "Running" }
|
|
457
387
|
}
|
|
458
388
|
}),
|
|
459
|
-
"
|
|
389
|
+
"instances elements retry": (prefix) => ({
|
|
460
390
|
Description: "Retry one faulted element of an instance",
|
|
461
|
-
Command: `${prefix}
|
|
391
|
+
Command: `${prefix} instances elements retry ${INSTANCE} ${ELEMENT} --folder-key ${FOLDER}`,
|
|
462
392
|
Output: {
|
|
463
393
|
Code: "ElementRetried",
|
|
464
394
|
Data: { InstanceId: INSTANCE, Status: "Running" }
|
|
465
395
|
}
|
|
466
396
|
}),
|
|
467
|
-
"
|
|
397
|
+
"incidents summary": (prefix) => ({
|
|
468
398
|
Description: "Summarize the open incidents in a folder by error",
|
|
469
|
-
Command: `${prefix}
|
|
399
|
+
Command: `${prefix} incidents summary --folder-key ${FOLDER} --limit 2`,
|
|
470
400
|
Output: {
|
|
471
401
|
Code: "IncidentSummary",
|
|
472
402
|
Data: [
|
|
@@ -480,9 +410,9 @@ var EXAMPLES = {
|
|
|
480
410
|
]
|
|
481
411
|
}
|
|
482
412
|
}),
|
|
483
|
-
"
|
|
413
|
+
"incidents get": (prefix) => ({
|
|
484
414
|
Description: "Get one incident with its error details",
|
|
485
|
-
Command: `${prefix}
|
|
415
|
+
Command: `${prefix} incidents get ${INCIDENT} --folder-key ${FOLDER}`,
|
|
486
416
|
Output: {
|
|
487
417
|
Code: "IncidentGet",
|
|
488
418
|
Data: {
|
|
@@ -641,9 +571,9 @@ var EXAMPLES = {
|
|
|
641
571
|
]
|
|
642
572
|
}
|
|
643
573
|
}),
|
|
644
|
-
"debug-
|
|
574
|
+
"debug-instances create": (prefix) => ({
|
|
645
575
|
Description: "Start a debug run of an uploaded solution's entry point",
|
|
646
|
-
Command: `${prefix} debug-
|
|
576
|
+
Command: `${prefix} debug-instances create --solution-id ${SOLUTION} --project-id ${PROJECT} --entry-point "/Main.bpmn#start" --debug-mode StepByStep`,
|
|
647
577
|
Output: {
|
|
648
578
|
Code: "DebugInstanceCreated",
|
|
649
579
|
Data: {
|
|
@@ -653,9 +583,9 @@ var EXAMPLES = {
|
|
|
653
583
|
}
|
|
654
584
|
}
|
|
655
585
|
}),
|
|
656
|
-
"debug-
|
|
586
|
+
"debug-instances status": (prefix) => ({
|
|
657
587
|
Description: "Check where a debug run is",
|
|
658
|
-
Command: `${prefix} debug-
|
|
588
|
+
Command: `${prefix} debug-instances status ${INSTANCE}`,
|
|
659
589
|
Output: {
|
|
660
590
|
Code: "DebugInstanceStatus",
|
|
661
591
|
Data: {
|
|
@@ -666,33 +596,33 @@ var EXAMPLES = {
|
|
|
666
596
|
}
|
|
667
597
|
}
|
|
668
598
|
}),
|
|
669
|
-
"debug-
|
|
599
|
+
"debug-instances breakpoints": (prefix) => ({
|
|
670
600
|
Description: "Replace a debug run's breakpoints from a file",
|
|
671
|
-
Command: `${prefix} debug-
|
|
601
|
+
Command: `${prefix} debug-instances breakpoints ${INSTANCE} --inputs @breakpoints.json`,
|
|
672
602
|
Output: {
|
|
673
603
|
Code: "DebugInstanceBreakpointsUpdated",
|
|
674
604
|
Data: {}
|
|
675
605
|
}
|
|
676
606
|
}),
|
|
677
|
-
"debug-
|
|
607
|
+
"debug-instances cancel": (prefix) => ({
|
|
678
608
|
Description: "Stop a debug run",
|
|
679
|
-
Command: `${prefix} debug-
|
|
609
|
+
Command: `${prefix} debug-instances cancel ${INSTANCE}`,
|
|
680
610
|
Output: {
|
|
681
611
|
Code: "DebugInstanceCanceled",
|
|
682
612
|
Data: {}
|
|
683
613
|
}
|
|
684
614
|
}),
|
|
685
|
-
"debug-
|
|
615
|
+
"debug-instances continue": (prefix) => ({
|
|
686
616
|
Description: "Continue a paused debug run",
|
|
687
|
-
Command: `${prefix} debug-
|
|
617
|
+
Command: `${prefix} debug-instances continue ${INSTANCE}`,
|
|
688
618
|
Output: {
|
|
689
619
|
Code: "DebugInstanceContinued",
|
|
690
620
|
Data: {}
|
|
691
621
|
}
|
|
692
622
|
}),
|
|
693
|
-
"debug-
|
|
623
|
+
"debug-instances incidents": (prefix) => ({
|
|
694
624
|
Description: "List the incidents a debug run raised",
|
|
695
|
-
Command: `${prefix} debug-
|
|
625
|
+
Command: `${prefix} debug-instances incidents ${INSTANCE}`,
|
|
696
626
|
Output: {
|
|
697
627
|
Code: "DebugInstanceIncidents",
|
|
698
628
|
Data: [
|
|
@@ -704,25 +634,25 @@ var EXAMPLES = {
|
|
|
704
634
|
]
|
|
705
635
|
}
|
|
706
636
|
}),
|
|
707
|
-
"debug-
|
|
637
|
+
"debug-instances variables": (prefix) => ({
|
|
708
638
|
Description: "Read a paused debug run's variables",
|
|
709
|
-
Command: `${prefix} debug-
|
|
639
|
+
Command: `${prefix} debug-instances variables ${INSTANCE}`,
|
|
710
640
|
Output: {
|
|
711
641
|
Code: "DebugInstanceVariables",
|
|
712
642
|
Data: { InstanceId: INSTANCE, Globals: {}, Elements: [] }
|
|
713
643
|
}
|
|
714
644
|
}),
|
|
715
|
-
"debug-
|
|
645
|
+
"debug-instances variables-set": (prefix) => ({
|
|
716
646
|
Description: "Patch a paused debug run's variables from a file",
|
|
717
|
-
Command: `${prefix} debug-
|
|
647
|
+
Command: `${prefix} debug-instances variables-set ${INSTANCE} --inputs @patch.json`,
|
|
718
648
|
Output: {
|
|
719
649
|
Code: "DebugInstanceVariablesSet",
|
|
720
650
|
Data: {}
|
|
721
651
|
}
|
|
722
652
|
}),
|
|
723
|
-
"debug-
|
|
653
|
+
"debug-instances variables-all": (prefix) => ({
|
|
724
654
|
Description: "Read the variables of every scope in a debug run",
|
|
725
|
-
Command: `${prefix} debug-
|
|
655
|
+
Command: `${prefix} debug-instances variables-all ${INSTANCE}`,
|
|
726
656
|
Output: {
|
|
727
657
|
Code: "DebugInstanceVariablesAll",
|
|
728
658
|
Data: { Variables: [] }
|
|
@@ -760,239 +690,8 @@ var attachSharedExamples = (group) => {
|
|
|
760
690
|
};
|
|
761
691
|
|
|
762
692
|
// ../maestro-sdk/src/shared-commands/debug-instances.ts
|
|
763
|
-
var
|
|
764
|
-
var
|
|
765
|
-
var VALID_SIMULATION_MODES = Object.keys(SIMULATION_MODE_MAP);
|
|
766
|
-
var registerSharedDebugInstanceCommands = (program, config) => {
|
|
767
|
-
const { toolLabel } = config;
|
|
768
|
-
const debugInstance = program.command("debug-instance").description(`Manage ${toolLabel} debug instance operations`);
|
|
769
|
-
debugInstance.command("create").description(`Create a ${toolLabel} debug instance from an already-uploaded solution`).requiredOption("--solution-id <id>", "Solution ID (from a previous upload or Studio Web)").requiredOption("--project-id <id>", "Studio Web project ID within the solution").requiredOption("--entry-point <path>", 'Entry point path (e.g. "/Main.bpmn#start")').option("--process-type <type>", "Process type", "processOrchestration").option("--debug-mode <mode>", "Debug mode: Default (pause at breakpoints), StepByStep (pause at every step), SingleStep (one step only)", "Default").option("--simulation-mode <mode>", "Simulation mode: None, All (simulate all elements), Selective (simulate except opt-outs)", "None").option("-i, --inputs <json>", "Input arguments as JSON string", "{}").trackedAction(processContext, async (options) => {
|
|
770
|
-
if (!VALID_DEBUG_MODES.includes(options.debugMode)) {
|
|
771
|
-
OutputFormatter.error({
|
|
772
|
-
Result: RESULTS.Failure,
|
|
773
|
-
Message: `Invalid --debug-mode "${options.debugMode}". Valid values: ${VALID_DEBUG_MODES.join(", ")}.`,
|
|
774
|
-
Instructions: ""
|
|
775
|
-
});
|
|
776
|
-
processContext.exit(1);
|
|
777
|
-
return;
|
|
778
|
-
}
|
|
779
|
-
if (!VALID_SIMULATION_MODES.includes(options.simulationMode)) {
|
|
780
|
-
OutputFormatter.error({
|
|
781
|
-
Result: RESULTS.Failure,
|
|
782
|
-
Message: `Invalid --simulation-mode "${options.simulationMode}". Valid values: ${VALID_SIMULATION_MODES.join(", ")}.`,
|
|
783
|
-
Instructions: ""
|
|
784
|
-
});
|
|
785
|
-
processContext.exit(1);
|
|
786
|
-
return;
|
|
787
|
-
}
|
|
788
|
-
const [configError, config2] = await catchError(createDebugPimsConfig());
|
|
789
|
-
if (configError) {
|
|
790
|
-
OutputFormatter.error({
|
|
791
|
-
Result: RESULTS.Failure,
|
|
792
|
-
Message: "Error creating debug instance",
|
|
793
|
-
Instructions: configError.message
|
|
794
|
-
});
|
|
795
|
-
processContext.exit(1);
|
|
796
|
-
return;
|
|
797
|
-
}
|
|
798
|
-
const [folderError, folder] = await catchError(getPersonalFolderKey(config2));
|
|
799
|
-
if (folderError) {
|
|
800
|
-
OutputFormatter.error({
|
|
801
|
-
Result: RESULTS.Failure,
|
|
802
|
-
Message: "Error getting personal workspace folder",
|
|
803
|
-
Instructions: folderError.message
|
|
804
|
-
});
|
|
805
|
-
processContext.exit(1);
|
|
806
|
-
return;
|
|
807
|
-
}
|
|
808
|
-
config2.folderKey = folder.key;
|
|
809
|
-
config2.organizationUnitId = folder.id;
|
|
810
|
-
const [sessionError, session] = await catchError(beginDebugSession(config2, options.inputs));
|
|
811
|
-
if (sessionError) {
|
|
812
|
-
OutputFormatter.error({
|
|
813
|
-
Result: RESULTS.Failure,
|
|
814
|
-
Message: "Error beginning debug session",
|
|
815
|
-
Instructions: sessionError.message
|
|
816
|
-
});
|
|
817
|
-
processContext.exit(1);
|
|
818
|
-
return;
|
|
819
|
-
}
|
|
820
|
-
const [createError, result] = await catchError(createDebugInstance(config2, session.jobKey, options.solutionId, options.projectId, options.entryPoint, options.processType, options.debugMode, options.simulationMode));
|
|
821
|
-
if (createError) {
|
|
822
|
-
OutputFormatter.error({
|
|
823
|
-
Result: RESULTS.Failure,
|
|
824
|
-
Message: "Error creating debug instance",
|
|
825
|
-
Instructions: createError.message
|
|
826
|
-
});
|
|
827
|
-
processContext.exit(1);
|
|
828
|
-
return;
|
|
829
|
-
}
|
|
830
|
-
OutputFormatter.success({
|
|
831
|
-
Result: RESULTS.Success,
|
|
832
|
-
Code: "DebugInstanceCreated",
|
|
833
|
-
Data: {
|
|
834
|
-
instanceId: result.instanceId,
|
|
835
|
-
runId: result.runId,
|
|
836
|
-
jobKey: session.jobKey
|
|
837
|
-
},
|
|
838
|
-
Instructions: "Use 'debug-instance status <instance-id>' to check the run. Use 'debug-instance incidents <instance-id>' or 'debug-instance variables <instance-id>' to inspect it."
|
|
839
|
-
});
|
|
840
|
-
});
|
|
841
|
-
debugInstance.command("status").description(`Get the current status of a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").trackedAction(processContext, async (instanceId) => {
|
|
842
|
-
const result = await withDebugPimsCall((cfg) => debugPimsGet(cfg, `${DEBUG_API_PREFIX}/${instanceId}/element-executions`, "get-debug-instance-status"), "Error getting debug instance status");
|
|
843
|
-
if (!result)
|
|
844
|
-
return;
|
|
845
|
-
OutputFormatter.success({
|
|
846
|
-
Result: RESULTS.Success,
|
|
847
|
-
Code: "DebugInstanceStatus",
|
|
848
|
-
Data: result
|
|
849
|
-
});
|
|
850
|
-
});
|
|
851
|
-
debugInstance.command("breakpoints").description(`Update breakpoints for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").option("--inputs <value>", "Breakpoints payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (instanceId, options) => {
|
|
852
|
-
const [readError, data] = await catchError(resolveJsonInput({
|
|
853
|
-
inline: options.inputs,
|
|
854
|
-
allowStdin: true
|
|
855
|
-
}));
|
|
856
|
-
if (readError) {
|
|
857
|
-
OutputFormatter.error({
|
|
858
|
-
Result: RESULTS.Failure,
|
|
859
|
-
Message: "Error reading breakpoints input",
|
|
860
|
-
Instructions: readError.message
|
|
861
|
-
});
|
|
862
|
-
processContext.exit(1);
|
|
863
|
-
return;
|
|
864
|
-
}
|
|
865
|
-
const body = data ?? {
|
|
866
|
-
breakpoints: []
|
|
867
|
-
};
|
|
868
|
-
const result = await withDebugPimsCall((cfg) => debugPimsPut(cfg, `${DEBUG_API_PREFIX}/${instanceId}/breakpoints`, body), "Error updating breakpoints");
|
|
869
|
-
if (!result)
|
|
870
|
-
return;
|
|
871
|
-
OutputFormatter.success({
|
|
872
|
-
Result: RESULTS.Success,
|
|
873
|
-
Code: "DebugInstanceBreakpointsUpdated",
|
|
874
|
-
Data: result
|
|
875
|
-
});
|
|
876
|
-
});
|
|
877
|
-
debugInstance.command("cancel").description(`Cancel a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").trackedAction(processContext, async (instanceId) => {
|
|
878
|
-
const result = await withDebugPimsCall((cfg) => debugPimsPost(cfg, `${DEBUG_API_PREFIX}/${instanceId}/cancel`, { comment: "" }), "Error canceling debug instance");
|
|
879
|
-
if (!result)
|
|
880
|
-
return;
|
|
881
|
-
OutputFormatter.success({
|
|
882
|
-
Result: RESULTS.Success,
|
|
883
|
-
Code: "DebugInstanceCanceled",
|
|
884
|
-
Data: result
|
|
885
|
-
});
|
|
886
|
-
});
|
|
887
|
-
debugInstance.command("continue").description(`Continue execution on a paused ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").option("--inputs <value>", "Continue payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (instanceId, options) => {
|
|
888
|
-
const [readError, data] = await catchError(resolveJsonInput({
|
|
889
|
-
inline: options.inputs,
|
|
890
|
-
allowStdin: true
|
|
891
|
-
}));
|
|
892
|
-
if (readError) {
|
|
893
|
-
OutputFormatter.error({
|
|
894
|
-
Result: RESULTS.Failure,
|
|
895
|
-
Message: "Error reading continue input",
|
|
896
|
-
Instructions: readError.message
|
|
897
|
-
});
|
|
898
|
-
processContext.exit(1);
|
|
899
|
-
return;
|
|
900
|
-
}
|
|
901
|
-
const body = data ?? {
|
|
902
|
-
nextStep: false
|
|
903
|
-
};
|
|
904
|
-
const result = await withDebugPimsCall((cfg) => debugPimsPost(cfg, `${DEBUG_API_PREFIX}/${instanceId}/continue`, body), "Error continuing debug instance");
|
|
905
|
-
if (!result)
|
|
906
|
-
return;
|
|
907
|
-
OutputFormatter.success({
|
|
908
|
-
Result: RESULTS.Success,
|
|
909
|
-
Code: "DebugInstanceContinued",
|
|
910
|
-
Data: result
|
|
911
|
-
});
|
|
912
|
-
});
|
|
913
|
-
debugInstance.command("incidents").description(`Get incidents for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").trackedAction(processContext, async (instanceId) => {
|
|
914
|
-
const result = await withDebugPimsCall((cfg) => debugPimsGet(cfg, `${DEBUG_API_PREFIX}/${instanceId}/incidents`), "Error getting debug instance incidents");
|
|
915
|
-
if (!result)
|
|
916
|
-
return;
|
|
917
|
-
OutputFormatter.success({
|
|
918
|
-
Result: RESULTS.Success,
|
|
919
|
-
Code: "DebugInstanceIncidents",
|
|
920
|
-
Data: result ?? []
|
|
921
|
-
});
|
|
922
|
-
});
|
|
923
|
-
debugInstance.command("variables").description(`Get variables for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").option("--parent-element-id <id>", "Filter variables by parent element ID").option("--expected-outputs <ids...>", "Output variable ids the record must define; retried until it does, failed if it never does").trackedAction(processContext, async (instanceId, options) => {
|
|
924
|
-
const expectGlobals = options.expectedOutputs ?? [];
|
|
925
|
-
if (expectGlobals.length > 0 && options.parentElementId !== undefined) {
|
|
926
|
-
OutputFormatter.error({
|
|
927
|
-
Result: RESULTS.Failure,
|
|
928
|
-
Message: "--expected-outputs cannot be combined with --parent-element-id",
|
|
929
|
-
Instructions: "Drop --parent-element-id: --expected-outputs checks the instance's root variables record."
|
|
930
|
-
});
|
|
931
|
-
processContext.exit(1);
|
|
932
|
-
return;
|
|
933
|
-
}
|
|
934
|
-
const query = buildQueryString({
|
|
935
|
-
parentElementId: options.parentElementId
|
|
936
|
-
});
|
|
937
|
-
const result = await withDebugPimsCall((cfg) => expectGlobals.length > 0 ? fetchDebugInstanceVariables(cfg, instanceId, {
|
|
938
|
-
expectGlobals
|
|
939
|
-
}) : debugPimsGet(cfg, `${DEBUG_API_PREFIX}/${instanceId}/variables${query}`), "Error getting debug instance variables");
|
|
940
|
-
if (!result)
|
|
941
|
-
return;
|
|
942
|
-
OutputFormatter.success({
|
|
943
|
-
Result: RESULTS.Success,
|
|
944
|
-
Code: "DebugInstanceVariables",
|
|
945
|
-
Data: result
|
|
946
|
-
});
|
|
947
|
-
});
|
|
948
|
-
debugInstance.command("variables-set").description(`Update variables for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").option("--inputs <value>", "Patch variables payload as JSON string, @file path, or piped via stdin").option("--parent-element-id <id>", "Filter by parent element ID").trackedAction(processContext, async (instanceId, options) => {
|
|
949
|
-
const [readError, data] = await catchError(resolveJsonInput({
|
|
950
|
-
inline: options.inputs,
|
|
951
|
-
allowStdin: true
|
|
952
|
-
}));
|
|
953
|
-
if (readError) {
|
|
954
|
-
OutputFormatter.error({
|
|
955
|
-
Result: RESULTS.Failure,
|
|
956
|
-
Message: "Error reading variables payload",
|
|
957
|
-
Instructions: readError.message
|
|
958
|
-
});
|
|
959
|
-
processContext.exit(1);
|
|
960
|
-
return;
|
|
961
|
-
}
|
|
962
|
-
if (data === undefined) {
|
|
963
|
-
OutputFormatter.error({
|
|
964
|
-
Result: RESULTS.Failure,
|
|
965
|
-
Message: "Missing variables payload",
|
|
966
|
-
Instructions: "Provide --inputs <json|@file> or pipe JSON via stdin."
|
|
967
|
-
});
|
|
968
|
-
processContext.exit(1);
|
|
969
|
-
return;
|
|
970
|
-
}
|
|
971
|
-
const body = data;
|
|
972
|
-
const query = buildQueryString({
|
|
973
|
-
parentElementId: options.parentElementId
|
|
974
|
-
});
|
|
975
|
-
const result = await withDebugPimsCall((cfg) => debugPimsPatch(cfg, `${DEBUG_API_PREFIX}/${instanceId}/variables${query}`, body), "Error updating debug instance variables");
|
|
976
|
-
if (!result)
|
|
977
|
-
return;
|
|
978
|
-
OutputFormatter.success({
|
|
979
|
-
Result: RESULTS.Success,
|
|
980
|
-
Code: "DebugInstanceVariablesSet",
|
|
981
|
-
Data: result
|
|
982
|
-
});
|
|
983
|
-
});
|
|
984
|
-
debugInstance.command("variables-all").description(`Get all variables including subprocesses for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").trackedAction(processContext, async (instanceId) => {
|
|
985
|
-
const result = await withDebugPimsCall((cfg) => debugPimsGet(cfg, `${DEBUG_API_PREFIX}/${instanceId}/variables-all`), "Error getting all debug instance variables");
|
|
986
|
-
if (!result)
|
|
987
|
-
return;
|
|
988
|
-
OutputFormatter.success({
|
|
989
|
-
Result: RESULTS.Success,
|
|
990
|
-
Code: "DebugInstanceVariablesAll",
|
|
991
|
-
Data: result
|
|
992
|
-
});
|
|
993
|
-
});
|
|
994
|
-
attachSharedExamples(debugInstance);
|
|
995
|
-
};
|
|
693
|
+
var VALID_DEBUG_MODES = Object.keys(DEBUG_MODE_MAP2);
|
|
694
|
+
var VALID_SIMULATION_MODES = Object.keys(SIMULATION_MODE_MAP2);
|
|
996
695
|
|
|
997
696
|
// ../maestro-sdk/src/with-pims-call.ts
|
|
998
697
|
var NETWORK_ERROR_CODES = new Set([
|
|
@@ -1100,7 +799,7 @@ function resolvePimsEnvelope(error, errorMessage, hint) {
|
|
|
1100
799
|
};
|
|
1101
800
|
}
|
|
1102
801
|
async function withPimsCall(fn, errorMessage, hint) {
|
|
1103
|
-
const [configError, config] = await
|
|
802
|
+
const [configError, config] = await catchError2(createPimsConfig());
|
|
1104
803
|
if (configError) {
|
|
1105
804
|
logger.warn(`${errorMessage}: ${configError.message}`);
|
|
1106
805
|
OutputFormatter.error({
|
|
@@ -1112,16 +811,16 @@ async function withPimsCall(fn, errorMessage, hint) {
|
|
|
1112
811
|
processContext.exit(1);
|
|
1113
812
|
return;
|
|
1114
813
|
}
|
|
1115
|
-
const [error, result] = await
|
|
814
|
+
const [error, result] = await catchError2(fn(config));
|
|
1116
815
|
if (error) {
|
|
1117
816
|
if (isNetworkError(error)) {
|
|
1118
|
-
const
|
|
1119
|
-
logger.warn(`${errorMessage}: ${
|
|
817
|
+
const msg = await extractErrorMessage(error);
|
|
818
|
+
logger.warn(`${errorMessage}: ${msg}`);
|
|
1120
819
|
OutputFormatter.error({
|
|
1121
820
|
Result: RESULTS.Failure,
|
|
1122
821
|
Code: "NetworkError",
|
|
1123
822
|
Message: errorMessage,
|
|
1124
|
-
Instructions:
|
|
823
|
+
Instructions: msg
|
|
1125
824
|
});
|
|
1126
825
|
processContext.exit(1);
|
|
1127
826
|
return;
|
|
@@ -1156,7 +855,7 @@ async function withPimsCall(fn, errorMessage, hint) {
|
|
|
1156
855
|
// ../maestro-sdk/src/shared-commands/incidents.ts
|
|
1157
856
|
var registerSharedIncidentCommands = (program, config) => {
|
|
1158
857
|
const { toolLabel } = config;
|
|
1159
|
-
const incident = program.command("incident").description(`Manage ${toolLabel} incidents`);
|
|
858
|
+
const incident = program.command("incidents").alias("incident").description(`Manage ${toolLabel} incidents`);
|
|
1160
859
|
incident.command("summary").description(`Get ${toolLabel} incident summaries across processes`).option("--folder-key <key>", "Folder key").option("-l, --limit <number>", "Number of items to return (1-10000)", parseLimit).option("--offset <number>", "Number of items to skip (0-1000000)", parseOffset, 0).option("--process-key <process-key>", "Filter by process key").option("--status <status>", "Filter by incident status").option("--severity <severity>", "Filter by incident severity").trackedAction(processContext, async (options) => {
|
|
1161
860
|
const query = buildQueryString({
|
|
1162
861
|
processKey: options.processKey,
|
|
@@ -1166,7 +865,7 @@ var registerSharedIncidentCommands = (program, config) => {
|
|
|
1166
865
|
$skip: options.offset !== 0 ? options.offset : undefined
|
|
1167
866
|
});
|
|
1168
867
|
const reqOptions = { folderKey: options.folderKey };
|
|
1169
|
-
const result = await withPimsCall((
|
|
868
|
+
const result = await withPimsCall((config) => pimsGet(config, `/incidents/summary${query}`, reqOptions), "Error listing incidents");
|
|
1170
869
|
if (!result)
|
|
1171
870
|
return;
|
|
1172
871
|
OutputFormatter.success({
|
|
@@ -1177,7 +876,7 @@ var registerSharedIncidentCommands = (program, config) => {
|
|
|
1177
876
|
});
|
|
1178
877
|
incident.command("get").description(`Get a single ${toolLabel} incident by ID`).argument("<incident-id>", "Incident ID").requiredOption("-f, --folder-key <key>", "Folder key").trackedAction(processContext, async (incidentId, options) => {
|
|
1179
878
|
const reqOptions = { folderKey: options.folderKey };
|
|
1180
|
-
const result = await withPimsCall((
|
|
879
|
+
const result = await withPimsCall((config) => pimsGet(config, `/incidents/${encodeURIComponent(incidentId)}`, reqOptions), "Error getting incident", { resource: "incident", id: incidentId });
|
|
1181
880
|
if (!result)
|
|
1182
881
|
return;
|
|
1183
882
|
OutputFormatter.success({
|
|
@@ -1282,7 +981,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1282
981
|
listFolderKeyRequired = folderKeyRequired
|
|
1283
982
|
} = config;
|
|
1284
983
|
const withFolderKey = (cmd, required = folderKeyRequired) => required ? cmd.requiredOption("-f, --folder-key <key>", "Folder key (GUID)") : cmd.option("-f, --folder-key <key>", "Folder key (GUID)");
|
|
1285
|
-
const instances = program.command("instance").description(`Manage ${toolLabel} process instances`);
|
|
984
|
+
const instances = program.command("instances").alias("instance").description(`Manage ${toolLabel} process instances`);
|
|
1286
985
|
const listCmd = instances.command("list").description(`List ${toolLabel} process instances. Filters are applied by the ` + "server: --status narrows by run status, --process-key by " + "process key (GUID), --package-id by package identifier, and " + "--from-date/--to-date by start time. Results page by cursor " + "— read Pagination.NextPage and pass it back via --next-page.");
|
|
1287
986
|
withFolderKey(listCmd, listFolderKeyRequired).option("-l, --limit <number>", `Number of items to return (1-${MAX_INSTANCE_PAGE_SIZE})`, parseInstanceLimit, DEFAULT_PAGE_SIZE).option("--offset <number>", "Not supported by the instances API — use --next-page instead").option("--next-page <cursor>", "Cursor from a previous response's Pagination.NextPage").option("--process-key <process-key>", "Filter by process key (GUID). For the dotted package " + "identifier use --package-id.").option("--package-id <id>", "Filter by package ID").option("--error-code <code>", "Filter by error code").option("--status <status>", "Filter by instance status (repeatable; OR-semantics). " + `Values: ${INSTANCE_STATUS_LIST}.`, collectStatus, []).option("--from-date <iso-8601>", "Only include instances started at or after this ISO-8601 " + "timestamp (e.g. 2026-01-01T00:00:00Z).").option("--to-date <iso-8601>", "Only include instances started at or before this ISO-8601 " + "timestamp (e.g. 2026-02-01T00:00:00Z).").trackedAction(processContext, async (options) => {
|
|
1288
987
|
const filters = resolveListFilters(options);
|
|
@@ -1300,7 +999,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1300
999
|
nextPage: options.nextPage
|
|
1301
1000
|
});
|
|
1302
1001
|
const reqOptions = { folderKey: options.folderKey };
|
|
1303
|
-
const result = await withPimsCall((
|
|
1002
|
+
const result = await withPimsCall((config) => pimsGet(config, `/instances${query}`, reqOptions), "Error listing instances");
|
|
1304
1003
|
if (!result)
|
|
1305
1004
|
return;
|
|
1306
1005
|
const instanceList = extractProcessInstances(result);
|
|
@@ -1319,7 +1018,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1319
1018
|
});
|
|
1320
1019
|
const getCmd = instances.command("get").description(`Get a ${toolLabel} process instance by ID`).argument("<instance-id>", "Process instance ID");
|
|
1321
1020
|
withFolderKey(getCmd).trackedAction(processContext, async (instanceId, options) => {
|
|
1322
|
-
const result = await withPimsCall((
|
|
1021
|
+
const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}`, { folderKey: options.folderKey }), "Error getting instance", { resource: "instance", id: instanceId });
|
|
1323
1022
|
if (!result)
|
|
1324
1023
|
return;
|
|
1325
1024
|
OutputFormatter.success({
|
|
@@ -1332,7 +1031,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1332
1031
|
withFolderKey(pauseCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
|
|
1333
1032
|
const body = { comment: options.comment || "" };
|
|
1334
1033
|
const reqOptions = { folderKey: options.folderKey };
|
|
1335
|
-
const result = await withPimsCall((
|
|
1034
|
+
const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/pause`, body, reqOptions), "Error pausing instance");
|
|
1336
1035
|
if (!result)
|
|
1337
1036
|
return;
|
|
1338
1037
|
OutputFormatter.success({
|
|
@@ -1345,7 +1044,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1345
1044
|
withFolderKey(resumeCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
|
|
1346
1045
|
const body = { comment: options.comment || "" };
|
|
1347
1046
|
const reqOptions = { folderKey: options.folderKey };
|
|
1348
|
-
const result = await withPimsCall((
|
|
1047
|
+
const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/resume`, body, reqOptions), "Error resuming instance");
|
|
1349
1048
|
if (!result)
|
|
1350
1049
|
return;
|
|
1351
1050
|
OutputFormatter.success({
|
|
@@ -1358,7 +1057,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1358
1057
|
withFolderKey(cancelCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
|
|
1359
1058
|
const body = { comment: options.comment || "" };
|
|
1360
1059
|
const reqOptions = { folderKey: options.folderKey };
|
|
1361
|
-
const result = await withPimsCall((
|
|
1060
|
+
const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/cancel`, body, reqOptions), "Error canceling instance");
|
|
1362
1061
|
if (!result)
|
|
1363
1062
|
return;
|
|
1364
1063
|
OutputFormatter.success({
|
|
@@ -1373,7 +1072,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1373
1072
|
parentElementId: options.parentElementId
|
|
1374
1073
|
});
|
|
1375
1074
|
const reqOptions = { folderKey: options.folderKey };
|
|
1376
|
-
const result = await withPimsCall((
|
|
1075
|
+
const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/variables${query}`, reqOptions), "Error getting variables");
|
|
1377
1076
|
if (!result)
|
|
1378
1077
|
return;
|
|
1379
1078
|
OutputFormatter.success({
|
|
@@ -1384,7 +1083,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1384
1083
|
});
|
|
1385
1084
|
const incidentsCmd = instances.command("incidents").description(`Get incidents for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
|
|
1386
1085
|
withFolderKey(incidentsCmd).trackedAction(processContext, async (instanceId, options) => {
|
|
1387
|
-
const result = await withPimsCall((
|
|
1086
|
+
const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/incidents`, { folderKey: options.folderKey }), "Error getting incidents");
|
|
1388
1087
|
if (!result)
|
|
1389
1088
|
return;
|
|
1390
1089
|
OutputFormatter.success({
|
|
@@ -1395,7 +1094,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1395
1094
|
});
|
|
1396
1095
|
const assetCmd = instances.command("asset").description(`Get the ${toolLabel} definition for a process instance`).argument("<instance-id>", "Process instance ID");
|
|
1397
1096
|
withFolderKey(assetCmd).trackedAction(processContext, async (instanceId, options) => {
|
|
1398
|
-
const result = await withPimsCall((
|
|
1097
|
+
const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/asset?type=${assetType}`, { folderKey: options.folderKey }), "Error getting asset");
|
|
1399
1098
|
if (!result)
|
|
1400
1099
|
return;
|
|
1401
1100
|
OutputFormatter.success({
|
|
@@ -1408,7 +1107,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1408
1107
|
withFolderKey(retryCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
|
|
1409
1108
|
const body = { comment: options.comment || "" };
|
|
1410
1109
|
const reqOptions = { folderKey: options.folderKey };
|
|
1411
|
-
const result = await withPimsCall((
|
|
1110
|
+
const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/retry`, body, reqOptions), "Error retrying instance");
|
|
1412
1111
|
if (!result)
|
|
1413
1112
|
return;
|
|
1414
1113
|
OutputFormatter.success({
|
|
@@ -1424,7 +1123,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1424
1123
|
comment: options.comment || ""
|
|
1425
1124
|
};
|
|
1426
1125
|
const reqOptions = { folderKey: options.folderKey };
|
|
1427
|
-
const result = await withPimsCall((
|
|
1126
|
+
const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/upgrade`, body, reqOptions), "Error migrating instance");
|
|
1428
1127
|
if (!result)
|
|
1429
1128
|
return;
|
|
1430
1129
|
OutputFormatter.success({
|
|
@@ -1435,7 +1134,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1435
1134
|
});
|
|
1436
1135
|
const gotoCmd = instances.command("goto").description("Move execution cursor from one element to another").argument("<instance-id>", "Process instance ID").argument("<transitions>", `JSON array of transitions, e.g. '[{"sourceElementId":"A","targetElementId":"B"}]'`);
|
|
1437
1136
|
withFolderKey(gotoCmd).trackedAction(processContext, async (instanceId, transitionsJson, options) => {
|
|
1438
|
-
const [parseError, transitions] =
|
|
1137
|
+
const [parseError, transitions] = catchError2(() => JSON.parse(transitionsJson));
|
|
1439
1138
|
const isValidShape = !parseError && Array.isArray(transitions) && transitions.every((t) => t?.sourceElementId != null && t?.targetElementId != null);
|
|
1440
1139
|
if (!isValidShape) {
|
|
1441
1140
|
OutputFormatter.error({
|
|
@@ -1448,7 +1147,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1448
1147
|
}
|
|
1449
1148
|
const body = { transitions };
|
|
1450
1149
|
const reqOptions = { folderKey: options.folderKey };
|
|
1451
|
-
const result = await withPimsCall((
|
|
1150
|
+
const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/goto`, body, reqOptions), "Error applying goto");
|
|
1452
1151
|
if (!result)
|
|
1453
1152
|
return;
|
|
1454
1153
|
OutputFormatter.success({
|
|
@@ -1459,7 +1158,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1459
1158
|
});
|
|
1460
1159
|
const cursorsCmd = instances.command("cursors").description(`Get current execution cursor positions for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
|
|
1461
1160
|
withFolderKey(cursorsCmd).trackedAction(processContext, async (instanceId, options) => {
|
|
1462
|
-
const result = await withPimsCall((
|
|
1161
|
+
const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/goto/cursors`, { folderKey: options.folderKey }), "Error getting cursors");
|
|
1463
1162
|
if (!result)
|
|
1464
1163
|
return;
|
|
1465
1164
|
OutputFormatter.success({
|
|
@@ -1468,9 +1167,9 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1468
1167
|
Data: result
|
|
1469
1168
|
});
|
|
1470
1169
|
});
|
|
1471
|
-
const messageCmd = instances.command("message").description(`Manage ${toolLabel} instance messages`);
|
|
1170
|
+
const messageCmd = instances.command("messages").alias("message").description(`Manage ${toolLabel} instance messages`);
|
|
1472
1171
|
messageCmd.command("send").description(`Send a message to ${toolLabel} workflow subscriptions`).requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--inputs <value>", "Message payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (options) => {
|
|
1473
|
-
const [readError, body] = await
|
|
1172
|
+
const [readError, body] = await catchError2(resolveJsonInput({
|
|
1474
1173
|
inline: options.inputs,
|
|
1475
1174
|
allowStdin: true
|
|
1476
1175
|
}));
|
|
@@ -1493,7 +1192,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1493
1192
|
return;
|
|
1494
1193
|
}
|
|
1495
1194
|
const reqOptions = { folderKey: options.folderKey };
|
|
1496
|
-
const result = await withPimsCall((
|
|
1195
|
+
const result = await withPimsCall((config) => pimsPost(config, "/instances/messages/send", body, reqOptions), "Error sending message");
|
|
1497
1196
|
if (!result)
|
|
1498
1197
|
return;
|
|
1499
1198
|
OutputFormatter.success({
|
|
@@ -1505,7 +1204,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1505
1204
|
if (includeElementExecutions) {
|
|
1506
1205
|
const elementExeCmd = instances.command("element-executions").description(`Get element executions for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
|
|
1507
1206
|
withFolderKey(elementExeCmd).trackedAction(processContext, async (instanceId, options) => {
|
|
1508
|
-
const result = await withPimsCall((
|
|
1207
|
+
const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/element-executions`, { folderKey: options.folderKey }), "Error getting element executions");
|
|
1509
1208
|
if (!result)
|
|
1510
1209
|
return;
|
|
1511
1210
|
OutputFormatter.success({
|
|
@@ -1517,7 +1216,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1517
1216
|
}
|
|
1518
1217
|
const variablesSetCmd = instances.command("variables-set").description(`Update variables for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
|
|
1519
1218
|
withFolderKey(variablesSetCmd).option("--inputs <value>", "Patch variables payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (instanceId, options) => {
|
|
1520
|
-
const [readError, data] = await
|
|
1219
|
+
const [readError, data] = await catchError2(resolveJsonInput({
|
|
1521
1220
|
inline: options.inputs,
|
|
1522
1221
|
allowStdin: true
|
|
1523
1222
|
}));
|
|
@@ -1541,7 +1240,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1541
1240
|
}
|
|
1542
1241
|
const body = data;
|
|
1543
1242
|
const reqOptions = { folderKey: options.folderKey };
|
|
1544
|
-
const result = await withPimsCall((
|
|
1243
|
+
const result = await withPimsCall((config) => pimsPatch(config, `/instances/${instanceId}/variables`, body, reqOptions), "Error updating variables");
|
|
1545
1244
|
if (!result)
|
|
1546
1245
|
return;
|
|
1547
1246
|
OutputFormatter.success({
|
|
@@ -1552,7 +1251,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1552
1251
|
});
|
|
1553
1252
|
const variablesAllCmd = instances.command("variables-all").description(`Get all variables (including subprocesses) for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
|
|
1554
1253
|
withFolderKey(variablesAllCmd).trackedAction(processContext, async (instanceId, options) => {
|
|
1555
|
-
const result = await withPimsCall((
|
|
1254
|
+
const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/variables-all`, { folderKey: options.folderKey }), "Error getting all variables");
|
|
1556
1255
|
if (!result)
|
|
1557
1256
|
return;
|
|
1558
1257
|
OutputFormatter.success({
|
|
@@ -1563,7 +1262,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1563
1262
|
});
|
|
1564
1263
|
const globalVarsCmd = instances.command("global-variables").description(`Get global variables for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
|
|
1565
1264
|
withFolderKey(globalVarsCmd).trackedAction(processContext, async (instanceId, options) => {
|
|
1566
|
-
const result = await withPimsCall((
|
|
1265
|
+
const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/global-variables`, { folderKey: options.folderKey }), "Error getting global variables");
|
|
1567
1266
|
if (!result)
|
|
1568
1267
|
return;
|
|
1569
1268
|
OutputFormatter.success({
|
|
@@ -1572,12 +1271,12 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1572
1271
|
Data: result
|
|
1573
1272
|
});
|
|
1574
1273
|
});
|
|
1575
|
-
const element = instances.command("element").description(`Manage elements within a ${toolLabel} process instance`);
|
|
1274
|
+
const element = instances.command("elements").alias("element").description(`Manage elements within a ${toolLabel} process instance`);
|
|
1576
1275
|
const elementCancelCmd = element.command("cancel").description(`Cancel a specific element in a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID").argument("<element-id>", "Element ID");
|
|
1577
1276
|
withFolderKey(elementCancelCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, elementId, options) => {
|
|
1578
1277
|
const body = { comment: options.comment || "" };
|
|
1579
1278
|
const reqOptions = { folderKey: options.folderKey };
|
|
1580
|
-
const result = await withPimsCall((
|
|
1279
|
+
const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/element/${elementId}/cancel`, body, reqOptions), "Error canceling element");
|
|
1581
1280
|
if (!result)
|
|
1582
1281
|
return;
|
|
1583
1282
|
OutputFormatter.success({
|
|
@@ -1590,7 +1289,7 @@ var registerSharedInstanceCommands = (program, config) => {
|
|
|
1590
1289
|
withFolderKey(elementRetryCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, elementId, options) => {
|
|
1591
1290
|
const body = { comment: options.comment || "" };
|
|
1592
1291
|
const reqOptions = { folderKey: options.folderKey };
|
|
1593
|
-
const result = await withPimsCall((
|
|
1292
|
+
const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/element/${elementId}/retry`, body, reqOptions), "Error retrying element");
|
|
1594
1293
|
if (!result)
|
|
1595
1294
|
return;
|
|
1596
1295
|
OutputFormatter.success({
|
|
@@ -1693,7 +1392,7 @@ var resolveTagFlags = (options) => {
|
|
|
1693
1392
|
};
|
|
1694
1393
|
};
|
|
1695
1394
|
var setVariableTagsFromPayload = async (processKey, options) => {
|
|
1696
|
-
const [fileError, variableTags] = await
|
|
1395
|
+
const [fileError, variableTags] = await catchError2(resolveJsonInput({ inline: options.inputs, allowStdin: true }));
|
|
1697
1396
|
if (fileError) {
|
|
1698
1397
|
OutputFormatter.error({
|
|
1699
1398
|
Result: RESULTS.Failure,
|
|
@@ -1736,7 +1435,7 @@ var setVariableTagsFromFlags = async (processKey, options) => {
|
|
|
1736
1435
|
sourcePackageVersion: "",
|
|
1737
1436
|
lastUpdateTimeUtc: ""
|
|
1738
1437
|
};
|
|
1739
|
-
const [mutateError, updated] =
|
|
1438
|
+
const [mutateError, updated] = catchError2(() => applyFriendlyVariableTags(variableTags, resolveTagFlags(options)));
|
|
1740
1439
|
if (mutateError) {
|
|
1741
1440
|
OutputFormatter.error({
|
|
1742
1441
|
Result: RESULTS.Failure,
|
|
@@ -1761,7 +1460,7 @@ var registerSharedProcessCommands = (processCmd, config) => {
|
|
|
1761
1460
|
const settingsCmd = processCmd.command("settings").description(`Manage ${toolLabel} process settings`);
|
|
1762
1461
|
settingsCmd.command("get").description(`Get settings for a ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext, async (processKey, options) => {
|
|
1763
1462
|
const reqOptions = { folderKey: options.folderKey };
|
|
1764
|
-
const result = await withPimsCall((
|
|
1463
|
+
const result = await withPimsCall((config) => pimsGet(config, `/processes/${encodeURIComponent(processKey)}/settings`, reqOptions), "Error getting process settings", { resource: "process", id: processKey });
|
|
1765
1464
|
if (!result)
|
|
1766
1465
|
return;
|
|
1767
1466
|
OutputFormatter.success({
|
|
@@ -1771,7 +1470,7 @@ var registerSharedProcessCommands = (processCmd, config) => {
|
|
|
1771
1470
|
});
|
|
1772
1471
|
});
|
|
1773
1472
|
settingsCmd.command("set").description(`Update settings for a ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--inputs <value>", "Settings payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (processKey, options) => {
|
|
1774
|
-
const [fileError, body] = await
|
|
1473
|
+
const [fileError, body] = await catchError2(resolveJsonInput({
|
|
1775
1474
|
inline: options.inputs,
|
|
1776
1475
|
allowStdin: true
|
|
1777
1476
|
}));
|
|
@@ -1794,7 +1493,7 @@ var registerSharedProcessCommands = (processCmd, config) => {
|
|
|
1794
1493
|
return;
|
|
1795
1494
|
}
|
|
1796
1495
|
const reqOptions = { folderKey: options.folderKey };
|
|
1797
|
-
const result = await withPimsCall((
|
|
1496
|
+
const result = await withPimsCall((config) => pimsPut(config, `/processes/${encodeURIComponent(processKey)}/settings`, body, reqOptions), "Error updating process settings");
|
|
1798
1497
|
if (!result)
|
|
1799
1498
|
return;
|
|
1800
1499
|
OutputFormatter.success({
|
|
@@ -1806,7 +1505,7 @@ var registerSharedProcessCommands = (processCmd, config) => {
|
|
|
1806
1505
|
const variableTagsCmd = processCmd.command("variable-tags").description(`Manage ${toolLabel} process variable tags`);
|
|
1807
1506
|
variableTagsCmd.command("get").description(`Get variable tags for a ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext, async (processKey, options) => {
|
|
1808
1507
|
const reqOptions = { folderKey: options.folderKey };
|
|
1809
|
-
const result = await withPimsCall((
|
|
1508
|
+
const result = await withPimsCall((config) => pimsGet(config, `/processes/${encodeURIComponent(processKey)}/settings`, reqOptions), "Error getting variable tags", { resource: "process", id: processKey });
|
|
1810
1509
|
if (!result)
|
|
1811
1510
|
return;
|
|
1812
1511
|
OutputFormatter.success({
|
|
@@ -1864,7 +1563,7 @@ var registerSharedProcessesCommands = (program, config) => {
|
|
|
1864
1563
|
$skip: options.offset !== 0 ? options.offset : undefined
|
|
1865
1564
|
});
|
|
1866
1565
|
const reqOptions = { folderKey: options.folderKey };
|
|
1867
|
-
const result = await withPimsCall((
|
|
1566
|
+
const result = await withPimsCall((config) => pimsGet(config, `/processes/summary${query}`, reqOptions), "Error listing processes");
|
|
1868
1567
|
if (!result)
|
|
1869
1568
|
return;
|
|
1870
1569
|
OutputFormatter.success({
|
|
@@ -1875,7 +1574,7 @@ var registerSharedProcessesCommands = (program, config) => {
|
|
|
1875
1574
|
});
|
|
1876
1575
|
processes.command("incidents").description(`Get incidents for a specific ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("--folder-key <key>", "Folder key").trackedAction(processContext, async (processKey, options) => {
|
|
1877
1576
|
const reqOptions = { folderKey: options.folderKey };
|
|
1878
|
-
const result = await withPimsCall((
|
|
1577
|
+
const result = await withPimsCall((config) => pimsGet(config, `/incidents/process/${encodeURIComponent(processKey)}${incidentsQuery}`, reqOptions), "Error getting process incidents", { resource: "process", id: processKey });
|
|
1879
1578
|
if (!result)
|
|
1880
1579
|
return;
|
|
1881
1580
|
OutputFormatter.success({
|
|
@@ -1885,10 +1584,10 @@ var registerSharedProcessesCommands = (program, config) => {
|
|
|
1885
1584
|
});
|
|
1886
1585
|
});
|
|
1887
1586
|
processes.command("diagnose").description(`Correlate ${toolLabel} process summary, incidents, and error codes`).argument("<process-key>", "Process definition key").requiredOption("--folder-key <key>", "Folder key").trackedAction(processContext, async (processKey, options) => {
|
|
1888
|
-
const result = await withPimsCall(async (
|
|
1889
|
-
const summary = await findProcessSummary(
|
|
1890
|
-
const incidents = await pimsGet(
|
|
1891
|
-
const errorCodes = await pimsGet(
|
|
1587
|
+
const result = await withPimsCall(async (config) => {
|
|
1588
|
+
const summary = await findProcessSummary(config, processKey, options.folderKey, processType);
|
|
1589
|
+
const incidents = await pimsGet(config, `/incidents/process/${encodeURIComponent(processKey)}${incidentsQuery}`, { folderKey: options.folderKey });
|
|
1590
|
+
const errorCodes = await pimsGet(config, `/incidents/process/${encodeURIComponent(processKey)}/error-codes`, { folderKey: options.folderKey });
|
|
1892
1591
|
return {
|
|
1893
1592
|
summary,
|
|
1894
1593
|
incidents,
|
|
@@ -1915,7 +1614,7 @@ var registerSharedProcessesCommands = (program, config) => {
|
|
|
1915
1614
|
});
|
|
1916
1615
|
processes.command("error-codes").description(`Get unique error codes for a specific ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("--folder-key <key>", "Folder key").trackedAction(processContext, async (processKey, options) => {
|
|
1917
1616
|
const reqOptions = { folderKey: options.folderKey };
|
|
1918
|
-
const result = await withPimsCall((
|
|
1617
|
+
const result = await withPimsCall((config) => pimsGet(config, `/incidents/process/${encodeURIComponent(processKey)}/error-codes`, reqOptions), "Error getting process error codes", { resource: "process", id: processKey });
|
|
1919
1618
|
if (!result)
|
|
1920
1619
|
return;
|
|
1921
1620
|
OutputFormatter.success({
|
|
@@ -1927,6 +1626,6 @@ var registerSharedProcessesCommands = (program, config) => {
|
|
|
1927
1626
|
attachSharedExamples(processes);
|
|
1928
1627
|
};
|
|
1929
1628
|
|
|
1930
|
-
export {
|
|
1629
|
+
export { registerSharedIncidentCommands, registerSharedInstanceCommands, registerSharedProcessCommands, registerSharedProcessesCommands };
|
|
1931
1630
|
|
|
1932
|
-
//# debugId=
|
|
1631
|
+
//# debugId=F564E4FAC8D5A56764756E2164756E21
|