@uipath/flow-tool 1.201.0 → 1.202.0-preview.136
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/{authoring-7r6g06c7.js → authoring-wpa6d0vf.js} +74 -48
- package/dist/binding-service-dh91hw9e.js +141 -0
- package/dist/{browser-strategy-rkcvc6tn.js → browser-strategy-6atc7v8s.js} +3 -3
- package/dist/connector-service-d9ph9kx1.js +948 -0
- package/dist/{conversion-H2VEEYLB-ng48mbf7.js → conversion-QANACVCM-zs0hhfjv.js} +39 -33
- package/dist/{de-5KVP66U6-f7knj511.js → de-5KVP66U6-1bnf4zt5.js} +52 -52
- package/dist/de-6U7ECGHH-xwsw33fk.js +35 -0
- package/dist/{de-5HU6GFWV-4EZK6G7N-yrh21f52.js → de-7XQXX2DK-IDWR6CAR-n4z245kt.js} +857 -845
- package/dist/{de-5HU6GFWV-zheyw6d2.js → de-7XQXX2DK-tqdy5n2b.js} +857 -845
- package/dist/{de-HKTOVV4H-d5yw5j21.js → de-HKTOVV4H-pe9w0xn8.js} +46 -46
- package/dist/{de-XLT4QPIP-0rtw349w.js → de-XLT4QPIP-kj81dxjc.js} +9 -9
- package/dist/debug-conversation-trigger-452frzyz.js +41 -0
- package/dist/debug-http-client-wd6xb8v4.js +31 -0
- package/dist/debug-service-fvyexnb1.js +58 -0
- package/dist/edge-service-e77bndbe.js +162 -0
- package/dist/{elk.bundled-pydbzeez.js → elk.bundled-vpsbxz0p.js} +3 -3
- package/dist/{en-MABQK6C4-REWE2WG2-8dp4cqdg.js → en-5ZGC5VQ3-EWX7ILY7-rmtj70fk.js} +898 -898
- package/dist/{en-MABQK6C4-nkzq2j8t.js → en-5ZGC5VQ3-h581y30k.js} +897 -897
- package/dist/en-EPWMLP2N-2wvge238.js +28 -0
- package/dist/{en-UNT7BE26-rhh65jry.js → en-LQHKFSEY-vvbe8ve9.js} +13 -11
- package/dist/{en-P4AS26D7-szrzfxz1.js → en-P4AS26D7-zptp77bm.js} +45 -45
- package/dist/{en-4KXU7N7B-66fntxa2.js → en-X3S6IZ5J-nhkg6pwn.js} +54 -60
- package/dist/{es-MX-H2EAXLYI-qwnqt48x.js → es-MX-H2EAXLYI-j42kfkxy.js} +46 -46
- package/dist/es-MX-NHTIP5YM-ar6zfx95.js +35 -0
- package/dist/{es-MX-OKNDG2NH-c1k1s1tg.js → es-MX-OKNDG2NH-tcac6j4g.js} +9 -9
- package/dist/{es-MX-POESXYP2-UW6VP5QI-cd3a79g9.js → es-MX-U2VN3SZW-KYAJ2ONK-kdram1g1.js} +857 -845
- package/dist/{es-MX-POESXYP2-9538722k.js → es-MX-U2VN3SZW-anynsmd8.js} +857 -845
- package/dist/{es-MX-XAVLOQW3-9b3cp9n8.js → es-MX-XAVLOQW3-q00km2y7.js} +52 -52
- package/dist/{es-NQICVYSQ-aa9z3nhs.js → es-NQICVYSQ-3dtqgget.js} +9 -9
- package/dist/{es-O4PAV2CR-jwfaawwk.js → es-O4PAV2CR-0g23ve3v.js} +46 -46
- package/dist/es-PQ3RA33Q-y4kxhjfr.js +35 -0
- package/dist/{es-VFPNVMP5-thm0z9sr.js → es-VFPNVMP5-bx2c337j.js} +52 -52
- package/dist/{es-LUTYN7U7-IY5QWOUF-k2aefzc0.js → es-ZGCPPOME-24PJEGPV-rn86z9kn.js} +857 -845
- package/dist/{es-LUTYN7U7-ye5zn4sn.js → es-ZGCPPOME-8gazspjj.js} +857 -845
- package/dist/flow-api-wv8p8xbd.js +36 -0
- package/dist/flow-debug-service-tfbefas6.js +741 -0
- package/dist/flow-eval-node-target-c6wea7rz.js +44 -0
- package/dist/flow-eval-run-service-01kdky72.js +961 -0
- package/dist/flow-eval-service-ft8e16jz.js +1338 -0
- package/dist/flow-init-service-mva4crty.js +35 -0
- package/dist/flow-io-r318sjrw.js +36 -0
- package/dist/flow-migrate-service-rwcdx60q.js +119 -0
- package/dist/flow-pack-service-p4hxyj9e.js +280 -0
- package/dist/flow-validate-service-j25pxpwz.js +57 -0
- package/dist/{fr-5YRGHXF5-q6b63yg0.js → fr-5YRGHXF5-kz1ywpv6.js} +46 -46
- package/dist/{fr-E5MDO4EG-exvrs7ge.js → fr-E5MDO4EG-c3mkty2t.js} +52 -52
- package/dist/{fr-PFHIL7YZ-cxnshwa8.js → fr-PFHIL7YZ-2n589p47.js} +9 -9
- package/dist/fr-R4L3OAWI-30khpsmn.js +35 -0
- package/dist/{fr-LJIK56LW-STG6QR3T-cextvv8q.js → fr-T3G5GZCT-TU4IKBEG-k6xz1s1f.js} +857 -845
- package/dist/{fr-LJIK56LW-xf3xf2kh.js → fr-T3G5GZCT-y3f7xb1q.js} +857 -845
- package/dist/governance-fetcher-j9cx4f1d.js +391 -0
- package/dist/headless-h1myzz32.js +177196 -0
- package/dist/hitl-service-kvt5wms4.js +256 -0
- package/dist/index-1kgxzh8x.js +143 -0
- package/dist/index-4zrwgb3c.js +111 -0
- package/dist/index-ev4mdg5y.js +4801 -0
- package/dist/{index-er6vy3jk.js → index-eybzsdcc.js} +295 -317
- package/dist/{index-hsadteg4.js → index-h8cph72k.js} +4 -4
- package/dist/{index-p50kx6jv.js → index-k5tbd184.js} +276 -276
- package/dist/index-n33np76r.js +630 -0
- package/dist/{index-9f8q2ege.js → index-p3vk57z7.js} +27 -27
- package/dist/{index-dhcd9b82.js → index-w0z4s69j.js} +166 -81
- package/dist/index.js +29 -32
- package/dist/{index.umd.min-drpc57vn.js → index.umd.min-fqefd9kn.js} +3 -3
- package/dist/init.js +24 -25
- package/dist/input-reader-6pwhtp8v.js +11 -0
- package/dist/{ja-FGEGLBJ3-w9byjhze.js → ja-BI5K3JDZ-77zat4z2.js} +857 -845
- package/dist/{ja-FGEGLBJ3-MG3BSWXD-vq19zt2p.js → ja-BI5K3JDZ-GTIHISTZ-s6n3r2ab.js} +857 -845
- package/dist/{ja-DPO5PPLO-s2a7j3nj.js → ja-DPO5PPLO-mysfmznx.js} +52 -52
- package/dist/{ja-P4OSE367-8ywxep9a.js → ja-P4OSE367-srr3qypg.js} +9 -9
- package/dist/{ja-SDAPAVCR-943p5gx7.js → ja-SDAPAVCR-kg39dfap.js} +46 -46
- package/dist/ja-ZHKCBE5W-x73w6x3e.js +35 -0
- package/dist/{js-yaml-cggj6w7q.js → js-yaml-87cdx6bm.js} +27 -19
- package/dist/known-types-a20evmmg.js +20 -0
- package/dist/ko-6W7OGLLB-mnmqc584.js +35 -0
- package/dist/{ko-ITOPNIYI-qz39kamf.js → ko-ITOPNIYI-hmxd2asd.js} +52 -52
- package/dist/{ko-TUAK3G3A-s25w0ckg.js → ko-JOBF5V7N-4bv0mjje.js} +857 -845
- package/dist/{ko-TUAK3G3A-TBEBKOTM-ns78t2rv.js → ko-JOBF5V7N-O7T4HKIE-ape840y0.js} +857 -845
- package/dist/{ko-NAGOZLC3-wb3y9yhh.js → ko-NAGOZLC3-gaxxsnd2.js} +46 -46
- package/dist/{ko-PYOS2KJP-5sbj5bp8.js → ko-PYOS2KJP-e7dshyxy.js} +9 -9
- package/dist/localization-h8a53z6p.js +47 -0
- package/dist/{node-gd4469ea.js → node-cnrcrrb0.js} +7973 -7166
- package/dist/node-service-8g5x5d2y.js +70 -0
- package/dist/{node-strategy-8gzp67xs.js → node-strategy-gc4sg6a2.js} +132 -16
- package/dist/node-sync-service-e2reh33c.js +42 -0
- package/dist/{packager-tool-9qecd4wb.js → packager-tool-0gctz400.js} +5 -2
- package/dist/{packager-tool-1cb0d5e0.js → packager-tool-0v3s8r01.js} +2 -2
- package/dist/{packager-tool-wckvcay0.js → packager-tool-1yh8g550.js} +9 -7
- package/dist/packager-tool-27avrkyk.js +15 -0
- package/dist/packager-tool-2wefykg9.js +106 -0
- package/dist/packager-tool-4fhgws0x.js +757 -0
- package/dist/{packager-tool-7yjpwj92.js → packager-tool-4hx14snw.js} +49 -48
- package/dist/{packager-tool-3wygxefb.js → packager-tool-58q3tvh7.js} +10 -10
- package/dist/{packager-tool-cvwr40ax.js → packager-tool-5qaxht3k.js} +1425 -550
- package/dist/packager-tool-5z1eg3ea.js +33289 -0
- package/dist/{packager-tool-17cn3xb7.js → packager-tool-6m078z5s.js} +13388 -19366
- package/dist/packager-tool-7b6tpg7y.js +77 -0
- package/dist/packager-tool-7exrv6w7.js +23 -0
- package/dist/packager-tool-8dszjcg5.js +4892 -0
- package/dist/packager-tool-8j92afwp.js +58 -0
- package/dist/packager-tool-94w17vf8.js +85 -0
- package/dist/{packager-tool-vdd02vns.js → packager-tool-9bec251q.js} +543 -1493
- package/dist/packager-tool-a1hbfmws.js +399 -0
- package/dist/{packager-tool-tq9q9m77.js → packager-tool-a42jnpy5.js} +3 -9
- package/dist/packager-tool-abbtfk2v.js +54 -0
- package/dist/packager-tool-cdwpc9fh.js +4945 -0
- package/dist/packager-tool-e0p2zsyc.js +97 -0
- package/dist/packager-tool-eebq62fq.js +540 -0
- package/dist/{packager-tool-m6x5sczh.js → packager-tool-em5r6g6j.js} +14 -21
- package/dist/packager-tool-eypvc2kv.js +23 -0
- package/dist/packager-tool-f0kd5kq4.js +2327 -0
- package/dist/packager-tool-fjaa8d3v.js +289 -0
- package/dist/packager-tool-g0eha8ge.js +121 -0
- package/dist/packager-tool-g9y14b10.js +54 -0
- package/dist/packager-tool-gbgfwx8f.js +2 -0
- package/dist/packager-tool-jc34wvrw.js +64 -0
- package/dist/packager-tool-k99nf3pq.js +25 -0
- package/dist/{packager-tool-hr0xg6q8.js → packager-tool-kn91khp6.js} +17 -13
- package/dist/{packager-tool-jysvpt8p.js → packager-tool-m3wkcxf5.js} +2 -2
- package/dist/{packager-tool-78a3szsp.js → packager-tool-m5qfverj.js} +1720 -2014
- package/dist/packager-tool-mwvbq6ef.js +79 -0
- package/dist/packager-tool-nq4rcqqg.js +87 -0
- package/dist/packager-tool-nxx8naxv.js +4234 -0
- package/dist/{packager-tool-3y0k15sv.js → packager-tool-p9stswjj.js} +2858 -19342
- package/dist/packager-tool-r0xpcqwg.js +188 -0
- package/dist/packager-tool-raq2wbwp.js +18 -0
- package/dist/{packager-tool-y3dezh8k.js → packager-tool-rs6jm14d.js} +6 -4
- package/dist/packager-tool-s9ff3kk4.js +6 -0
- package/dist/{packager-tool-pbsghbmj.js → packager-tool-sykgshez.js} +2 -2
- package/dist/packager-tool-tf3d2y8z.js +31 -0
- package/dist/packager-tool-tn5e7wnb.js +384 -0
- package/dist/packager-tool-v2rkcehq.js +457 -0
- package/dist/packager-tool-v86fdwvs.js +262 -0
- package/dist/packager-tool-v9psxdy5.js +8185 -0
- package/dist/packager-tool-v9rrz038.js +602 -0
- package/dist/packager-tool-vpqyvh4c.js +304 -0
- package/dist/packager-tool-wcha0e5r.js +443 -0
- package/dist/{packager-tool-1gt6js73.js → packager-tool-xhzfwa5p.js} +6 -4
- package/dist/{packager-tool-5arsyj36.js → packager-tool-yc4kw997.js} +4 -2
- package/dist/{packager-tool-pkq70dec.js → packager-tool-ywqc9rtf.js} +31 -3
- package/dist/{packager-tool-0567pxpm.js → packager-tool-z9bfhmm5.js} +10 -10
- package/dist/{packager-tool-gmrwvnyh.js → packager-tool-zfrp8ecz.js} +8 -58
- package/dist/{packager-tool-3vdpx9ng.js → packager-tool-zke08y39.js} +1121 -1846
- package/dist/packager-tool.js +17 -17
- package/dist/{pt-7TR74ZMB-1g8my56g.js → pt-7TR74ZMB-bmphh4x2.js} +46 -46
- package/dist/{pt-BR-7XGDXRDJ-TR5D7JYL-533wvy7p.js → pt-BR-7DYX2YPT-LZYH4YFD-bx43vx3z.js} +857 -845
- package/dist/{pt-BR-7XGDXRDJ-espnkgrj.js → pt-BR-7DYX2YPT-fqxqzqtf.js} +857 -845
- package/dist/{pt-BR-BXURWX4W-dqr4dnf9.js → pt-BR-BXURWX4W-bwfcwhk1.js} +52 -52
- package/dist/{pt-BR-DXXSYJDO-bn84ewp7.js → pt-BR-DXXSYJDO-a2tp13v7.js} +46 -46
- package/dist/pt-BR-UQCYHKMJ-q78n7q70.js +35 -0
- package/dist/{pt-BR-Z3TUDJHM-n7ngej6s.js → pt-BR-Z3TUDJHM-8v73x9s7.js} +9 -9
- package/dist/pt-D6A6MVB2-yvxca8vz.js +35 -0
- package/dist/{pt-TMVOOITK-myha14p9.js → pt-HTXGGX6Y-97t21dty.js} +857 -845
- package/dist/{pt-TMVOOITK-H2ADYHSD-ezpggv33.js → pt-HTXGGX6Y-ZHQSDFKI-vehfxadc.js} +857 -845
- package/dist/{pt-KSBWHAVQ-hd52bpsz.js → pt-KSBWHAVQ-mhvhgr2p.js} +9 -9
- package/dist/{pt-YI4VE4YQ-v7gjeg82.js → pt-YI4VE4YQ-wdkn2dcf.js} +52 -52
- package/dist/ro-4TMBHS5M-jz0anpt6.js +35 -0
- package/dist/{ro-BJFER5OI-334n28rj.js → ro-BJFER5OI-83tq8vxh.js} +46 -46
- package/dist/{ro-2VALF3S5-NXBJUEZN-nqw1zs33.js → ro-KTNQ3MNU-XIE6YPQN-gen8p82z.js} +857 -845
- package/dist/{ro-2VALF3S5-cdz5afkr.js → ro-KTNQ3MNU-y08n1x5g.js} +857 -845
- package/dist/{ro-RKXZUG7Z-cm3xn3fj.js → ro-RKXZUG7Z-nndrrsq7.js} +52 -52
- package/dist/{ro-VZUZTAMR-tccygznf.js → ro-VZUZTAMR-f4q0g3em.js} +9 -9
- package/dist/{ru-GSCT4ARZ-qj8dm4dp.js → ru-GSCT4ARZ-1sa9wbr8.js} +1 -1
- package/dist/{ru-GSCT4ARZ-FTVCGQTL-5nh4jf2e.js → ru-GSCT4ARZ-FTVCGQTL-gee86v14.js} +1 -1
- package/dist/{ru-T73OPRTC-mp5gn7gs.js → ru-T73OPRTC-4knxw497.js} +1 -1
- package/dist/{ru-WBLQ5B2U-awt245ky.js → ru-WBLQ5B2U-8r3c7v6d.js} +1 -1
- package/dist/ru-WBLQ5B2U-kdey8qa4.js +10 -0
- package/dist/{ru-WBLQ5B2U-57ezmxzz.js → ru-WBLQ5B2U-wemdzdqd.js} +1 -1
- package/dist/{serialization-GAW7UFOK-9hkdmmd2.js → serialization-J5QK3HPY-bgewpt6f.js} +158 -152
- package/dist/services/expression-validator.d.ts +28 -0
- package/dist/services/flow-eval-schema/types.d.ts +17 -0
- package/dist/services/flow-validate-service.d.ts +26 -0
- package/dist/services/node-validators/js-expression-syntax-validator.d.ts +6 -3
- package/dist/services/tidy-service.d.ts +26 -0
- package/dist/services/vars-reference-rule.d.ts +156 -0
- package/dist/shared-utils-8xdq6f04.js +20 -0
- package/dist/tidy-service-ashgyfwj.js +34 -0
- package/dist/tool.js +30 -33
- package/dist/{tr-AA6O2WSR-ga1xnymp.js → tr-AA6O2WSR-86ba4bdf.js} +52 -52
- package/dist/tr-GSQQ6SOT-hv1gyeaa.js +35 -0
- package/dist/{tr-RQTZ2DMS-bpgd4kma.js → tr-RQTZ2DMS-w3cwv8s4.js} +46 -46
- package/dist/{tr-W4AVRSQ4-bt3qqqdy.js → tr-W4AVRSQ4-hjr81xzk.js} +9 -9
- package/dist/{tr-RIFCEXFH-BZS7S7QK-q465b62g.js → tr-XHSSPNK7-GW5KVXR3-2w3f1ss6.js} +857 -845
- package/dist/{tr-RIFCEXFH-hgkb4g8y.js → tr-XHSSPNK7-cmqyc4wd.js} +857 -845
- package/dist/utils/handle-expansion.d.ts +16 -0
- package/dist/validation.js +47 -27
- package/dist/variable-service-er7ph4br.js +152 -0
- package/dist/wait-for-flow-job-45p1a444.js +134 -0
- package/dist/{zh-CN-IP3FMXWM-H3JI2XUM-ta4yac7h.js → zh-CN-2EHQT23P-T5XRQCVS-ac17dpc1.js} +857 -845
- package/dist/{zh-CN-IP3FMXWM-1cfarhcp.js → zh-CN-2EHQT23P-mr63c4xz.js} +857 -845
- package/dist/{zh-CN-6YRAN57T-j7jp34ws.js → zh-CN-6YRAN57T-rd7x2tqs.js} +9 -9
- package/dist/zh-CN-EDFRBU32-vvj7tmaq.js +35 -0
- package/dist/{zh-CN-R2KLHXQV-wttmznep.js → zh-CN-R2KLHXQV-agqr45ds.js} +52 -52
- package/dist/{zh-CN-ZC6LT4IN-vty9mvv8.js → zh-CN-ZC6LT4IN-kbzvvzz5.js} +46 -46
- package/dist/zh-TW-HAICM6DE-rh7k3cq7.js +35 -0
- package/dist/{zh-TW-AGIDXIPF-R4XZRDJZ-cgxxz5k4.js → zh-TW-MGZCE5BT-P6FLIUAR-zmq07vhs.js} +857 -845
- package/dist/{zh-TW-AGIDXIPF-n6r6w7vy.js → zh-TW-MGZCE5BT-c4ekmrz9.js} +857 -845
- package/dist/{zh-TW-R7Y5KVMU-q81f4z2p.js → zh-TW-R7Y5KVMU-m61y07e3.js} +46 -46
- package/dist/{zh-TW-RJGCQANM-gqn0aca0.js → zh-TW-RJGCQANM-w0x3qc1p.js} +52 -52
- package/dist/{zh-TW-SO2245GN-m5kh88bg.js → zh-TW-SO2245GN-n2bn1gg4.js} +9 -9
- package/package.json +2 -2
- package/dist/de-5KVP66U6-t37qr521.js +0 -161
- package/dist/de-WMKOGI7B-6dc1zdnp.js +0 -143
- package/dist/en-4KXU7N7B-24v330b5.js +0 -118
- package/dist/en-X4DLPKLJ-1h9gj5c1.js +0 -110
- package/dist/es-BVPGJUWA-0k59eqfv.js +0 -143
- package/dist/es-MX-U6YL5KQX-k4qvpgd4.js +0 -143
- package/dist/es-MX-XAVLOQW3-47a405kf.js +0 -161
- package/dist/es-VFPNVMP5-6sftsdxe.js +0 -161
- package/dist/fr-E5MDO4EG-f3x1jeqw.js +0 -161
- package/dist/fr-EKTTDR7Z-m2t68j0m.js +0 -143
- package/dist/ja-DPO5PPLO-fmbg7zt2.js +0 -161
- package/dist/ja-Y2YBTXNN-5sszk2zv.js +0 -143
- package/dist/ko-ITOPNIYI-aqy82jk8.js +0 -161
- package/dist/ko-S33XAV26-rfsv9myd.js +0 -143
- package/dist/packager-tool-0sz8se22.js +0 -10671
- package/dist/packager-tool-8mqydhz8.js +0 -9850
- package/dist/packager-tool-p9j43p8h.js +0 -115
- package/dist/packager-tool-v74yk918.js +0 -107
- package/dist/packager-tool-xj0agqpk.js +0 -11
- package/dist/pt-BR-BXURWX4W-xzyndmrx.js +0 -161
- package/dist/pt-BR-JO45SCNI-mt93s33c.js +0 -143
- package/dist/pt-W3NA4LIZ-fwd1q4j0.js +0 -143
- package/dist/pt-YI4VE4YQ-521681zf.js +0 -161
- package/dist/ro-RKXZUG7Z-pdztdafr.js +0 -161
- package/dist/ro-WLKX6HF5-b9tj8q67.js +0 -143
- package/dist/ru-WBLQ5B2U-8xd4gpv2.js +0 -10
- package/dist/ru-WBLQ5B2U-mswqs9wc.js +0 -10
- package/dist/tr-3U2W2XCA-43ptfc0m.js +0 -143
- package/dist/tr-AA6O2WSR-bj9n80k8.js +0 -161
- package/dist/zh-CN-IPZYQR3P-egjmvyjf.js +0 -143
- package/dist/zh-CN-R2KLHXQV-x6gnk2n0.js +0 -161
- package/dist/zh-TW-RJGCQANM-tt8j5wv2.js +0 -161
- package/dist/zh-TW-YPVSQVGT-b378ztph.js +0 -143
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MaestroHttpError,
|
|
3
|
+
automationSolutionsGet,
|
|
4
|
+
debugPimsGet,
|
|
5
|
+
debugPimsPost,
|
|
6
|
+
orchestratorGet,
|
|
7
|
+
orchestratorPost,
|
|
8
|
+
studioWebPost
|
|
9
|
+
} from "./packager-tool-fjaa8d3v.js";
|
|
10
|
+
import {
|
|
11
|
+
RESULTS,
|
|
12
|
+
catchError,
|
|
13
|
+
logger
|
|
14
|
+
} from "./packager-tool-5qaxht3k.js";
|
|
15
|
+
|
|
16
|
+
// ../maestro-sdk/src/debug-service.ts
|
|
17
|
+
import { randomUUID } from "node:crypto";
|
|
18
|
+
var AGENT_TARGET_RUNTIME = "pythonAgent";
|
|
19
|
+
|
|
20
|
+
class FpsPropertiesInjectionError extends Error {
|
|
21
|
+
fpsProperties;
|
|
22
|
+
agentCount;
|
|
23
|
+
cause;
|
|
24
|
+
constructor(fpsProperties, agentCount, cause) {
|
|
25
|
+
super(`Cannot inject ${agentCount} inline agent(s): FpsProperties is not valid JSON.`);
|
|
26
|
+
this.fpsProperties = fpsProperties;
|
|
27
|
+
this.agentCount = agentCount;
|
|
28
|
+
this.name = "FpsPropertiesInjectionError";
|
|
29
|
+
this.cause = cause;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function injectInlineAgentProcessEntries(fpsProperties, inlineAgents, flowProjectId) {
|
|
33
|
+
if (!inlineAgents || inlineAgents.length === 0)
|
|
34
|
+
return fpsProperties;
|
|
35
|
+
const entries = inlineAgents.map((agent) => ({
|
|
36
|
+
name: agent.name,
|
|
37
|
+
projectType: "Agent",
|
|
38
|
+
isConversational: agent.isConversational,
|
|
39
|
+
entryPointPath: agent.entryPointPath,
|
|
40
|
+
targetRuntime: AGENT_TARGET_RUNTIME,
|
|
41
|
+
targetFramework: "Portable",
|
|
42
|
+
requiresUserInteraction: false,
|
|
43
|
+
executorInfo: JSON.stringify({
|
|
44
|
+
projectId: agent.hostProjectId ?? flowProjectId ?? agent.agentProjectId,
|
|
45
|
+
command: "debug",
|
|
46
|
+
args: ["--attach=none"],
|
|
47
|
+
entryPoint: agent.entryPointPath
|
|
48
|
+
})
|
|
49
|
+
}));
|
|
50
|
+
return appendProcessEntries(fpsProperties, entries, inlineAgents.length);
|
|
51
|
+
}
|
|
52
|
+
function injectSolutionProjectProcessEntries(fpsProperties, solutionProjects) {
|
|
53
|
+
if (!solutionProjects || solutionProjects.length === 0) {
|
|
54
|
+
return fpsProperties;
|
|
55
|
+
}
|
|
56
|
+
const entries = solutionProjects.map((project) => ({
|
|
57
|
+
name: project.name,
|
|
58
|
+
projectType: project.projectType,
|
|
59
|
+
executorInfo: JSON.stringify({
|
|
60
|
+
projectId: project.projectId,
|
|
61
|
+
debugArgs: {
|
|
62
|
+
debugMode: project.debugMode ?? DEBUG_MODE_MAP.Default,
|
|
63
|
+
studioWebProjectId: project.projectId,
|
|
64
|
+
processType: project.projectType,
|
|
65
|
+
solutionId: project.solutionId,
|
|
66
|
+
entryPoint: project.entryPoint
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
}));
|
|
70
|
+
return appendProcessEntries(fpsProperties, entries, solutionProjects.length);
|
|
71
|
+
}
|
|
72
|
+
function appendProcessEntries(fpsProperties, entries, entryCount) {
|
|
73
|
+
try {
|
|
74
|
+
const outer = fpsProperties ? JSON.parse(fpsProperties) : {};
|
|
75
|
+
const masterRaw = outer["debug.master"];
|
|
76
|
+
const master = typeof masterRaw === "string" ? JSON.parse(masterRaw) : masterRaw ?? {};
|
|
77
|
+
const existing = Array.isArray(master.processes) ? master.processes : [];
|
|
78
|
+
master.processes = [...existing, ...entries];
|
|
79
|
+
outer["debug.master"] = JSON.stringify(master);
|
|
80
|
+
if (!("debug.source" in outer)) {
|
|
81
|
+
outer["debug.source"] = "studioweb";
|
|
82
|
+
}
|
|
83
|
+
return JSON.stringify(outer);
|
|
84
|
+
} catch (err) {
|
|
85
|
+
throw new FpsPropertiesInjectionError(fpsProperties ?? "", entryCount, err);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function extractStartEventId(bpmnXml) {
|
|
89
|
+
const match = bpmnXml.match(/<bpmn:startEvent\s+id="([^"]+)"/);
|
|
90
|
+
return match?.[1] ?? "start";
|
|
91
|
+
}
|
|
92
|
+
async function getPersonalFolderKey(config) {
|
|
93
|
+
const result = await orchestratorGet(config, "/api/Folders/GetAllForCurrentUser", "get-personal-folder");
|
|
94
|
+
const personal = result.PageItems?.find((f) => f.FolderType === "Personal");
|
|
95
|
+
if (!personal) {
|
|
96
|
+
throw new Error("No personal workspace folder found. Ensure your account has a personal workspace.");
|
|
97
|
+
}
|
|
98
|
+
return { key: personal.Key, id: personal.Id };
|
|
99
|
+
}
|
|
100
|
+
async function getPersonalFolderInfo(config) {
|
|
101
|
+
const result = await orchestratorGet(config, "/api/Folders/GetAllForCurrentUser", "get-personal-folder");
|
|
102
|
+
const personal = result.PageItems?.find((f) => f.FolderType === "Personal");
|
|
103
|
+
if (!personal) {
|
|
104
|
+
throw new Error("No personal workspace folder found. Ensure your account has a personal workspace.");
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
key: personal.Key,
|
|
108
|
+
id: personal.Id,
|
|
109
|
+
displayName: personal.DisplayName,
|
|
110
|
+
fullyQualifiedName: personal.FullyQualifiedName,
|
|
111
|
+
parentKey: personal.ParentKey
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
var PROJECT_DEBUG_TIMEOUT_MS = 2 * 60 * 1000;
|
|
115
|
+
var PROJECT_DEBUG_POLL_INTERVAL_MS = 1000;
|
|
116
|
+
var TERMINAL_PROJECT_DEBUG_STATUSES = new Set([
|
|
117
|
+
"creationsucceeded",
|
|
118
|
+
"creationfailed",
|
|
119
|
+
"validationfailed"
|
|
120
|
+
]);
|
|
121
|
+
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
122
|
+
async function waitForProjectProvisioning(config, solutionId, sessionId, timeoutMs, pollIntervalMs) {
|
|
123
|
+
const deadline = Date.now() + timeoutMs;
|
|
124
|
+
const path = `/api/v1/solutions/${encodeURIComponent(solutionId)}/projects/debug/status` + `?debugSessionId=${encodeURIComponent(sessionId)}`;
|
|
125
|
+
while (Date.now() < deadline) {
|
|
126
|
+
const remainingMs = deadline - Date.now();
|
|
127
|
+
if (remainingMs <= 0)
|
|
128
|
+
break;
|
|
129
|
+
const [pollError, info] = await catchError(automationSolutionsGet(config, path, "poll-project-debug-status", AbortSignal.timeout(remainingMs)));
|
|
130
|
+
if (pollError) {
|
|
131
|
+
if (Date.now() >= deadline)
|
|
132
|
+
break;
|
|
133
|
+
throw pollError;
|
|
134
|
+
}
|
|
135
|
+
const status = info.status?.toLowerCase();
|
|
136
|
+
logger.debug(`Project debug provisioning status: ${info.status ?? "unknown"}`);
|
|
137
|
+
if (status && TERMINAL_PROJECT_DEBUG_STATUSES.has(status)) {
|
|
138
|
+
if (status !== "creationsucceeded") {
|
|
139
|
+
throw new Error(`Studio Web resource provisioning failed with status ${info.status ?? "unknown"}` + (info.errors?.length ? ` (${JSON.stringify(info.errors)})` : "."));
|
|
140
|
+
}
|
|
141
|
+
logger.info(`Studio Web resources provisioned${info.folderFullyQualifiedName ? ` in ${info.folderFullyQualifiedName}` : ""}`);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const remainingAfterPollMs = deadline - Date.now();
|
|
145
|
+
if (remainingAfterPollMs <= 0)
|
|
146
|
+
break;
|
|
147
|
+
await delay(Math.min(pollIntervalMs, remainingAfterPollMs));
|
|
148
|
+
}
|
|
149
|
+
throw new Error(`Timed out waiting for Studio Web resource provisioning after ${timeoutMs}ms.`);
|
|
150
|
+
}
|
|
151
|
+
async function prepareForCustomDebug(params) {
|
|
152
|
+
const sessionId = params.sessionId ?? randomUUID();
|
|
153
|
+
const query = new URLSearchParams({
|
|
154
|
+
sessionId,
|
|
155
|
+
solutionName: params.solutionName,
|
|
156
|
+
debugSessionId: sessionId,
|
|
157
|
+
solutionRootFolderName: params.solutionName,
|
|
158
|
+
installationFolderKey: params.folderKey,
|
|
159
|
+
forceProvisioning: "false"
|
|
160
|
+
});
|
|
161
|
+
const tenantIdHeader = params.config.tenantId ? { "X-UIPATH-TenantId": params.config.tenantId } : {};
|
|
162
|
+
const result = await studioWebPost(params.config, params.config.organizationName, `/resourcebuilder/solutions/${encodeURIComponent(params.solutionId)}/projects/${encodeURIComponent(params.projectId)}/debug?${query.toString()}`, new FormData, tenantIdHeader, "prepare-custom-debug");
|
|
163
|
+
let complete = result.complete;
|
|
164
|
+
if (complete === false) {
|
|
165
|
+
await waitForProjectProvisioning(params.config, params.solutionId, sessionId, params.provisioningTimeoutMs ?? PROJECT_DEBUG_TIMEOUT_MS, params.provisioningPollIntervalMs ?? PROJECT_DEBUG_POLL_INTERVAL_MS);
|
|
166
|
+
complete = true;
|
|
167
|
+
}
|
|
168
|
+
const hasDebugIds = typeof result.projectDebugId === "string" && typeof result.solutionDebugId === "string";
|
|
169
|
+
if (!hasDebugIds && complete !== true) {
|
|
170
|
+
throw new Error("Studio Web prepare custom debug response did not include projectDebugId and solutionDebugId.");
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
projectDebugId: result.projectDebugId ?? params.projectId,
|
|
174
|
+
solutionDebugId: result.solutionDebugId ?? params.solutionId
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
async function getFolderInfoById(config, folderId) {
|
|
178
|
+
const result = await orchestratorGet(config, `/odata/Folders(${folderId})`, "get-folder-by-id");
|
|
179
|
+
return {
|
|
180
|
+
key: result.Key,
|
|
181
|
+
id: result.Id,
|
|
182
|
+
displayName: result.DisplayName,
|
|
183
|
+
fullyQualifiedName: result.FullyQualifiedName,
|
|
184
|
+
parentKey: result.ParentKey
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
async function beginDebugSession(config, inputArguments = "{}", options) {
|
|
188
|
+
const fpsProperties = injectSolutionProjectProcessEntries(injectInlineAgentProcessEntries(options?.fpsProperties, options?.inlineAgents, options?.flowProjectId), options?.solutionProjects);
|
|
189
|
+
const body = {
|
|
190
|
+
JobsCount: 1,
|
|
191
|
+
JobPriority: null,
|
|
192
|
+
SpecificPriorityValue: null,
|
|
193
|
+
Strategy: "ModernJobsCount",
|
|
194
|
+
AutopilotForRobots: {},
|
|
195
|
+
ResumeOnSameContext: false,
|
|
196
|
+
RunAsMe: false,
|
|
197
|
+
RuntimeType: "Flow",
|
|
198
|
+
Source: "StudioWeb",
|
|
199
|
+
InputArguments: inputArguments,
|
|
200
|
+
...fpsProperties ? { FpsProperties: fpsProperties } : {}
|
|
201
|
+
};
|
|
202
|
+
const result = await orchestratorPost(config, "/api/robotdebug/BeginSession", body, "begin-debug-session");
|
|
203
|
+
if (!result.jobKey) {
|
|
204
|
+
throw new Error("BeginSession returned success but no jobKey was provided");
|
|
205
|
+
}
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
var DEBUG_MODE_MAP = {
|
|
209
|
+
None: 0,
|
|
210
|
+
Default: 1,
|
|
211
|
+
StepByStep: 2,
|
|
212
|
+
SingleStep: 3
|
|
213
|
+
};
|
|
214
|
+
var SIMULATION_MODE_MAP = {
|
|
215
|
+
None: 0,
|
|
216
|
+
All: 1,
|
|
217
|
+
Selective: 2
|
|
218
|
+
};
|
|
219
|
+
var CREATE_DEBUG_INSTANCE_RETRY_DELAYS_MS = [2000, 5000];
|
|
220
|
+
var CREATE_DEBUG_INSTANCE_RETRYABLE_STATUSES = new Set([500, 503]);
|
|
221
|
+
async function createDebugInstance(config, jobKey, solutionId, studioWebProjectId, entryPoint, processType = "Flow", debugMode = "Default", simulationMode = "None") {
|
|
222
|
+
const body = {
|
|
223
|
+
jobKey,
|
|
224
|
+
debugArgs: {
|
|
225
|
+
breakPoints: [],
|
|
226
|
+
debugMode: DEBUG_MODE_MAP[debugMode],
|
|
227
|
+
entryPoint,
|
|
228
|
+
processType,
|
|
229
|
+
simulationMode: SIMULATION_MODE_MAP[simulationMode],
|
|
230
|
+
solutionId,
|
|
231
|
+
studioWebProjectId,
|
|
232
|
+
variables: {}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
const totalAttempts = CREATE_DEBUG_INSTANCE_RETRY_DELAYS_MS.length + 1;
|
|
236
|
+
const traceIds = [];
|
|
237
|
+
let lastError;
|
|
238
|
+
for (let attempt = 1;attempt <= totalAttempts; attempt++) {
|
|
239
|
+
const [error, result] = await catchError(debugPimsPost(config, "/api/v1/debug-instances", body, "create-debug-instance"));
|
|
240
|
+
if (!error) {
|
|
241
|
+
if (!result.instanceId) {
|
|
242
|
+
throw new Error(`debug-instances API returned no instanceId: ${JSON.stringify(result)}`);
|
|
243
|
+
}
|
|
244
|
+
return result;
|
|
245
|
+
}
|
|
246
|
+
if (!(error instanceof MaestroHttpError) || !CREATE_DEBUG_INSTANCE_RETRYABLE_STATUSES.has(error.httpStatus)) {
|
|
247
|
+
if (attempt > 1 && error instanceof MaestroHttpError) {
|
|
248
|
+
if (error.parsedTraceId) {
|
|
249
|
+
traceIds.push(error.parsedTraceId);
|
|
250
|
+
}
|
|
251
|
+
throw error.recordAttempts(attempt, traceIds);
|
|
252
|
+
}
|
|
253
|
+
throw error;
|
|
254
|
+
}
|
|
255
|
+
lastError = error;
|
|
256
|
+
if (error.parsedTraceId) {
|
|
257
|
+
traceIds.push(error.parsedTraceId);
|
|
258
|
+
}
|
|
259
|
+
const retryDelay = CREATE_DEBUG_INSTANCE_RETRY_DELAYS_MS[attempt - 1];
|
|
260
|
+
if (retryDelay === undefined) {
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
logger.warn(`create-debug-instance returned HTTP ${error.httpStatus} (attempt ${attempt}/${totalAttempts}); retrying in ${retryDelay / 1000}s.`);
|
|
264
|
+
await delay(retryDelay);
|
|
265
|
+
}
|
|
266
|
+
if (!lastError) {
|
|
267
|
+
throw new Error("create-debug-instance failed without an error.");
|
|
268
|
+
}
|
|
269
|
+
throw lastError.recordAttempts(totalAttempts, traceIds);
|
|
270
|
+
}
|
|
271
|
+
var PIMS_TERMINAL_STATUSES = [
|
|
272
|
+
"Completed",
|
|
273
|
+
"Faulted",
|
|
274
|
+
"Cancelled",
|
|
275
|
+
"Failed"
|
|
276
|
+
];
|
|
277
|
+
var ORCHESTRATOR_TERMINAL_STATUSES = [
|
|
278
|
+
"Successful",
|
|
279
|
+
"Faulted",
|
|
280
|
+
"Stopped",
|
|
281
|
+
"Suspended"
|
|
282
|
+
];
|
|
283
|
+
var SUCCESS_DEBUG_STATUSES = new Set([
|
|
284
|
+
"Completed",
|
|
285
|
+
"Successful"
|
|
286
|
+
]);
|
|
287
|
+
var FAULTED_DEBUG_STATUSES = new Set([...PIMS_TERMINAL_STATUSES, ...ORCHESTRATOR_TERMINAL_STATUSES].filter((status) => !SUCCESS_DEBUG_STATUSES.has(status)));
|
|
288
|
+
|
|
289
|
+
class DebugPollTimeoutError extends Error {
|
|
290
|
+
instanceId;
|
|
291
|
+
jobKey;
|
|
292
|
+
lastStatus;
|
|
293
|
+
timeoutSeconds;
|
|
294
|
+
constructor(details) {
|
|
295
|
+
super(`Debug polling timed out after ${details.timeoutSeconds}s — instance ${details.instanceId} was still "${details.lastStatus}" (not a terminal status)`);
|
|
296
|
+
this.name = "DebugPollTimeoutError";
|
|
297
|
+
this.instanceId = details.instanceId;
|
|
298
|
+
this.jobKey = details.jobKey;
|
|
299
|
+
this.lastStatus = details.lastStatus;
|
|
300
|
+
this.timeoutSeconds = details.timeoutSeconds;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
function buildPollTimeoutFailureOutput(err, inspectCommand) {
|
|
304
|
+
const inspect = inspectCommand ? `Check it with '${inspectCommand} ${err.instanceId}', or re-run` : "Re-run";
|
|
305
|
+
return {
|
|
306
|
+
Result: RESULTS.Failure,
|
|
307
|
+
ErrorCode: "timeout",
|
|
308
|
+
Message: err.message,
|
|
309
|
+
Instructions: "The run was still going when the CLI stopped waiting — it is not " + `known to have failed. ${inspect} with a longer '--timeout' (seconds).`,
|
|
310
|
+
Retry: "RetryLater",
|
|
311
|
+
Context: { stage: "poll-instance-status" },
|
|
312
|
+
Data: {
|
|
313
|
+
instanceId: err.instanceId,
|
|
314
|
+
jobKey: err.jobKey,
|
|
315
|
+
lastStatus: err.lastStatus,
|
|
316
|
+
timeoutSeconds: err.timeoutSeconds
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
async function pollDebugInstanceStatus(config, instanceId, callbacks, pollInterval = 2000, maxPolls = 300, jobKey) {
|
|
321
|
+
let pollCount = 0;
|
|
322
|
+
let lastStatus = "";
|
|
323
|
+
while (pollCount < maxPolls) {
|
|
324
|
+
const status = await debugPimsGet(config, `/api/v1/debug-instances/${instanceId}/element-executions`, "poll-instance-status");
|
|
325
|
+
if (status.status !== lastStatus) {
|
|
326
|
+
lastStatus = status.status;
|
|
327
|
+
const elementExecutions = status.elementExecutions.map((e) => ({
|
|
328
|
+
elementId: e.elementId,
|
|
329
|
+
elementType: e.elementType,
|
|
330
|
+
status: e.status,
|
|
331
|
+
startedAt: e.startedTimeUtc,
|
|
332
|
+
completedAt: e.completedTimeUtc || undefined
|
|
333
|
+
}));
|
|
334
|
+
callbacks?.onStatusChange?.(status.status, elementExecutions);
|
|
335
|
+
} else if (pollCount % 5 === 0) {
|
|
336
|
+
const elapsed = (pollCount + 1) * pollInterval / 1000;
|
|
337
|
+
logger.info(`Still polling... status: ${lastStatus} (${elapsed}s elapsed)`);
|
|
338
|
+
}
|
|
339
|
+
if (PIMS_TERMINAL_STATUSES.includes(status.status)) {
|
|
340
|
+
logger.info(`Debug session reached terminal status: ${status.status}`);
|
|
341
|
+
return status;
|
|
342
|
+
}
|
|
343
|
+
if (jobKey && pollCount > 0 && pollCount % 5 === 0) {
|
|
344
|
+
const [, jobResponse] = await catchError(orchestratorGet(config, `/odata/Jobs?$filter=Key eq '${jobKey}'&$top=1`, "check-orchestrator-job-status"));
|
|
345
|
+
const jobState = jobResponse?.value?.[0]?.State;
|
|
346
|
+
if (jobState && ORCHESTRATOR_TERMINAL_STATUSES.includes(jobState)) {
|
|
347
|
+
const jobInfo = jobResponse?.value?.[0]?.Info ?? "";
|
|
348
|
+
logger.info(`Orchestrator job reached terminal status: ${jobState}${jobInfo ? ` — ${jobInfo}` : ""}`);
|
|
349
|
+
return { ...status, status: jobState };
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
353
|
+
pollCount++;
|
|
354
|
+
}
|
|
355
|
+
throw new DebugPollTimeoutError({
|
|
356
|
+
instanceId,
|
|
357
|
+
...jobKey === undefined ? {} : { jobKey },
|
|
358
|
+
lastStatus: lastStatus || "unknown",
|
|
359
|
+
timeoutSeconds: maxPolls * pollInterval / 1000
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
async function fetchDebugInstanceIncidents(config, instanceId) {
|
|
363
|
+
const result = await debugPimsGet(config, `/api/v1/debug-instances/${instanceId}/incidents`, "get-debug-instance-incidents");
|
|
364
|
+
return result ?? [];
|
|
365
|
+
}
|
|
366
|
+
var FETCH_VARIABLES_RETRY_DELAYS_MS = [2000, 4000];
|
|
367
|
+
var FETCH_VARIABLES_ATTEMPT_TIMEOUT_MS = 8000;
|
|
368
|
+
|
|
369
|
+
class DebugVariablesFetchFailedError extends Error {
|
|
370
|
+
details;
|
|
371
|
+
constructor(details) {
|
|
372
|
+
super(`Could not fetch output variables after ${details.attempts} attempt(s): ${details.message}`);
|
|
373
|
+
this.details = details;
|
|
374
|
+
this.name = "DebugVariablesFetchFailedError";
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
async function fetchDebugInstanceVariables(config, instanceId, options) {
|
|
378
|
+
const endpoint = `/api/v1/debug-instances/${encodeURIComponent(instanceId)}/variables`;
|
|
379
|
+
const delays = options?.delays ?? FETCH_VARIABLES_RETRY_DELAYS_MS;
|
|
380
|
+
const attemptTimeoutMs = options?.attemptTimeoutMs ?? FETCH_VARIABLES_ATTEMPT_TIMEOUT_MS;
|
|
381
|
+
const totalAttempts = delays.length + 1;
|
|
382
|
+
const traceIds = [];
|
|
383
|
+
let lastMessage = "";
|
|
384
|
+
let lastStatus;
|
|
385
|
+
for (let attempt = 1;attempt <= totalAttempts; attempt++) {
|
|
386
|
+
const controller = new AbortController;
|
|
387
|
+
const timer = setTimeout(() => controller.abort(), attemptTimeoutMs);
|
|
388
|
+
const [error, result] = await catchError(debugPimsGet(config, endpoint, "fetch-output-variables", { signal: controller.signal }));
|
|
389
|
+
clearTimeout(timer);
|
|
390
|
+
if (!error) {
|
|
391
|
+
return result;
|
|
392
|
+
}
|
|
393
|
+
if (controller.signal.aborted) {
|
|
394
|
+
lastMessage = `timed out after ${attemptTimeoutMs / 1000}s`;
|
|
395
|
+
lastStatus = undefined;
|
|
396
|
+
} else if (error instanceof MaestroHttpError) {
|
|
397
|
+
lastMessage = error.message;
|
|
398
|
+
lastStatus = error.httpStatus;
|
|
399
|
+
if (error.parsedTraceId) {
|
|
400
|
+
traceIds.push(error.parsedTraceId);
|
|
401
|
+
}
|
|
402
|
+
} else {
|
|
403
|
+
lastMessage = error.message;
|
|
404
|
+
lastStatus = undefined;
|
|
405
|
+
}
|
|
406
|
+
const retryDelay = delays[attempt - 1];
|
|
407
|
+
if (retryDelay === undefined) {
|
|
408
|
+
break;
|
|
409
|
+
}
|
|
410
|
+
logger.warn(`fetch-output-variables failed (attempt ${attempt}/${totalAttempts}): ${lastMessage}; retrying in ${retryDelay / 1000}s.`);
|
|
411
|
+
await delay(retryDelay);
|
|
412
|
+
}
|
|
413
|
+
throw new DebugVariablesFetchFailedError({
|
|
414
|
+
message: lastMessage,
|
|
415
|
+
...lastStatus === undefined ? {} : { httpStatus: lastStatus },
|
|
416
|
+
attempts: totalAttempts,
|
|
417
|
+
traceIds,
|
|
418
|
+
endpoint
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
function isFaultedDebugStatus(status) {
|
|
422
|
+
return FAULTED_DEBUG_STATUSES.has(status);
|
|
423
|
+
}
|
|
424
|
+
function isSuccessfulDebugStatus(status) {
|
|
425
|
+
return SUCCESS_DEBUG_STATUSES.has(status);
|
|
426
|
+
}
|
|
427
|
+
async function resolveFaultIncidents(config, instanceId, status) {
|
|
428
|
+
if (!isFaultedDebugStatus(status)) {
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
const [incidentError, fetched] = await catchError(fetchDebugInstanceIncidents(config, instanceId));
|
|
432
|
+
if (incidentError) {
|
|
433
|
+
logger.warn(`Could not fetch debug incidents: ${incidentError.message}`);
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
if (fetched.length === 0) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
const first = fetched[0];
|
|
440
|
+
logger.warn(`Debug session faulted with ${fetched.length} incident(s). ` + `First: [${first.errorCode ?? "no-code"}] ${first.errorMessage}` + (first.elementId ? ` (element ${first.elementId})` : ""));
|
|
441
|
+
return fetched;
|
|
442
|
+
}
|
|
443
|
+
function buildStudioWebDesignerUrl(params) {
|
|
444
|
+
return `${params.baseUrl}/${encodeURIComponent(params.organizationName)}` + `/studio_/designer/${encodeURIComponent(params.projectId)}` + `?solutionId=${encodeURIComponent(params.solutionId)}`;
|
|
445
|
+
}
|
|
446
|
+
async function uploadAndDebugSolution(params) {
|
|
447
|
+
const { apiConfig } = params;
|
|
448
|
+
logger.info("Uploading solution to Studio Web...");
|
|
449
|
+
const importResult = await params.upload();
|
|
450
|
+
const solutionId = importResult.id;
|
|
451
|
+
if (params.onSolutionId) {
|
|
452
|
+
await params.onSolutionId(solutionId);
|
|
453
|
+
}
|
|
454
|
+
const matchedProject = importResult.projects.find((p) => p.name === params.projectName);
|
|
455
|
+
const studioWebProjectId = (matchedProject ?? importResult.projects[0]).id;
|
|
456
|
+
const studioWebUrl = buildStudioWebDesignerUrl({
|
|
457
|
+
baseUrl: apiConfig.baseUrl,
|
|
458
|
+
organizationName: params.organizationName,
|
|
459
|
+
projectId: studioWebProjectId,
|
|
460
|
+
solutionId
|
|
461
|
+
});
|
|
462
|
+
logger.info(`Solution uploaded — solutionId: ${solutionId}, projectId: ${studioWebProjectId}`);
|
|
463
|
+
logger.info(`Studio Web URL: ${studioWebUrl}`);
|
|
464
|
+
params.callbacks?.onStudioWebUrl?.(studioWebUrl);
|
|
465
|
+
const folder = params.folder ?? await getPersonalFolderKey(apiConfig);
|
|
466
|
+
apiConfig.folderKey = folder.key;
|
|
467
|
+
apiConfig.organizationUnitId = folder.id;
|
|
468
|
+
logger.info(`Personal folder — key: ${folder.key}, id: ${folder.id}`);
|
|
469
|
+
const solutionProjects = params.buildSolutionProjects ? await params.buildSolutionProjects(importResult.projects, solutionId) : undefined;
|
|
470
|
+
if (solutionProjects && solutionProjects.length > 0) {
|
|
471
|
+
logger.info(`Registering ${solutionProjects.length} solution project(s) for debug: ${solutionProjects.map((p) => p.name).join(", ")}`);
|
|
472
|
+
}
|
|
473
|
+
const inlineAgents = params.inlineAgents?.map((agent) => {
|
|
474
|
+
if (!agent.hostProjectName)
|
|
475
|
+
return agent;
|
|
476
|
+
const hostProject = importResult.projects.find((project) => project.name === agent.hostProjectName);
|
|
477
|
+
if (!hostProject) {
|
|
478
|
+
throw new Error(`Could not match inline agent "${agent.name}" to uploaded host Flow "${agent.hostProjectName}".`);
|
|
479
|
+
}
|
|
480
|
+
return { ...agent, hostProjectId: hostProject.id };
|
|
481
|
+
});
|
|
482
|
+
let debugSolutionId = solutionId;
|
|
483
|
+
let debugProjectId = studioWebProjectId;
|
|
484
|
+
if (apiConfig.tenantId) {
|
|
485
|
+
const studioWebConfig = {
|
|
486
|
+
baseUrl: apiConfig.baseUrl,
|
|
487
|
+
organizationId: apiConfig.organizationId,
|
|
488
|
+
tenantId: apiConfig.tenantId,
|
|
489
|
+
tenantName: apiConfig.tenantName,
|
|
490
|
+
authToken: apiConfig.authToken,
|
|
491
|
+
organizationUnitId: apiConfig.organizationUnitId,
|
|
492
|
+
organizationName: params.organizationName
|
|
493
|
+
};
|
|
494
|
+
const [prepErr, prepIds] = await catchError(prepareForCustomDebug({
|
|
495
|
+
config: studioWebConfig,
|
|
496
|
+
solutionId,
|
|
497
|
+
projectId: studioWebProjectId,
|
|
498
|
+
solutionName: params.solutionName ?? params.projectName,
|
|
499
|
+
folderKey: folder.key
|
|
500
|
+
}));
|
|
501
|
+
if (prepErr) {
|
|
502
|
+
if (params.requireDebugPreparation)
|
|
503
|
+
throw prepErr;
|
|
504
|
+
logger.warn(`prepareForCustomDebug failed (${prepErr.message}) — continuing with original solution/project IDs. ` + "Sub-jobs (api-workflow / agent / process orchestration) may fault with a missing debugSessionId.");
|
|
505
|
+
} else {
|
|
506
|
+
debugSolutionId = prepIds.solutionDebugId;
|
|
507
|
+
debugProjectId = prepIds.projectDebugId;
|
|
508
|
+
logger.info(`Studio Web debug provisioned — solutionDebugId: ${debugSolutionId}, projectDebugId: ${debugProjectId}`);
|
|
509
|
+
}
|
|
510
|
+
} else {
|
|
511
|
+
if (params.requireDebugPreparation) {
|
|
512
|
+
throw new Error("Cannot prepare Studio Web debug because apiConfig.tenantId is not set.");
|
|
513
|
+
}
|
|
514
|
+
logger.warn("Skipping prepareForCustomDebug — apiConfig.tenantId is not set. " + "Sub-jobs (api-workflow / agent / process orchestration) may fault with a missing debugSessionId.");
|
|
515
|
+
}
|
|
516
|
+
logger.info("Beginning debug session in Orchestrator...");
|
|
517
|
+
const session = await beginDebugSession(apiConfig, params.beginSessionPayload, {
|
|
518
|
+
inlineAgents,
|
|
519
|
+
flowProjectId: studioWebProjectId,
|
|
520
|
+
...solutionProjects ? { solutionProjects } : {}
|
|
521
|
+
});
|
|
522
|
+
logger.info(`Debug session started — jobKey: ${session.jobKey}`);
|
|
523
|
+
logger.info("Creating debug instance in PIMS...");
|
|
524
|
+
const debugInstance = await createDebugInstance(apiConfig, session.jobKey, debugSolutionId, debugProjectId, params.entryPoint, params.projectType);
|
|
525
|
+
logger.info(`Debug instance created — instanceId: ${debugInstance.instanceId}`);
|
|
526
|
+
logger.info("Polling for completion...");
|
|
527
|
+
const finalResponse = await pollDebugInstanceStatus(apiConfig, debugInstance.instanceId, params.callbacks, params.pollInterval, params.maxPolls, session.jobKey);
|
|
528
|
+
const incidents = await resolveFaultIncidents(apiConfig, debugInstance.instanceId, finalResponse.status);
|
|
529
|
+
return {
|
|
530
|
+
jobKey: session.jobKey,
|
|
531
|
+
instanceId: debugInstance.instanceId,
|
|
532
|
+
runId: debugInstance.runId,
|
|
533
|
+
finalStatus: finalResponse.status,
|
|
534
|
+
elementExecutions: finalResponse.elementExecutions.map((e) => ({
|
|
535
|
+
elementId: e.elementId,
|
|
536
|
+
elementType: e.elementType,
|
|
537
|
+
status: e.status,
|
|
538
|
+
startedAt: e.startedTimeUtc,
|
|
539
|
+
completedAt: e.completedTimeUtc || undefined
|
|
540
|
+
})),
|
|
541
|
+
solutionId,
|
|
542
|
+
projectId: studioWebProjectId,
|
|
543
|
+
studioWebUrl,
|
|
544
|
+
incidents
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
async function patchConnectionOverwrites(config, organizationName, solutionId, solutionDir, folder, fs) {
|
|
548
|
+
const connectionsDir = fs.path.join(solutionDir, "resources", "solution_folder", "connection");
|
|
549
|
+
if (!await fs.exists(connectionsDir)) {
|
|
550
|
+
return 0;
|
|
551
|
+
}
|
|
552
|
+
const connectorDirs = await fs.readdir(connectionsDir);
|
|
553
|
+
const connectionResources = (await Promise.all(connectorDirs.map(async (connectorDir) => {
|
|
554
|
+
const connectorPath = fs.path.join(connectionsDir, connectorDir);
|
|
555
|
+
const stat = await fs.stat(connectorPath);
|
|
556
|
+
if (!stat.isDirectory())
|
|
557
|
+
return [];
|
|
558
|
+
const files = await fs.readdir(connectorPath);
|
|
559
|
+
const results = await Promise.all(files.filter((file) => file.endsWith(".json")).map(async (file) => {
|
|
560
|
+
const filePath = fs.path.join(connectorPath, file);
|
|
561
|
+
const [readErr, content] = await catchError(fs.readFile(filePath, "utf-8"));
|
|
562
|
+
if (readErr || !content)
|
|
563
|
+
return;
|
|
564
|
+
const [parseErr, parsed] = catchError(() => JSON.parse(content));
|
|
565
|
+
if (parseErr || parsed.resource?.kind !== "connection")
|
|
566
|
+
return;
|
|
567
|
+
return parsed;
|
|
568
|
+
}));
|
|
569
|
+
return results.filter((r) => r !== undefined);
|
|
570
|
+
}))).flat();
|
|
571
|
+
if (connectionResources.length === 0) {
|
|
572
|
+
return 0;
|
|
573
|
+
}
|
|
574
|
+
const tenantIdHeader = config.tenantId ? { "x-uipath-tenantid": config.tenantId } : {};
|
|
575
|
+
const folderPath = folder.parentKey ? `${folder.parentKey}.${folder.key}` : folder.key;
|
|
576
|
+
const folderPayload = {
|
|
577
|
+
fullyQualifiedName: folder.fullyQualifiedName || folder.displayName,
|
|
578
|
+
path: folderPath,
|
|
579
|
+
folderKey: folder.key
|
|
580
|
+
};
|
|
581
|
+
const apiPath = `/resourcebuilder/solutions/${solutionId}/resources/reference?api-version=2&forceUpdate=true`;
|
|
582
|
+
const validResources = connectionResources.filter((cr) => cr.resource.key && cr.resource.type);
|
|
583
|
+
let successCount = 0;
|
|
584
|
+
for (const cr of validResources) {
|
|
585
|
+
const [err] = await catchError(studioWebPost(config, organizationName, apiPath, {
|
|
586
|
+
kind: "connection",
|
|
587
|
+
type: cr.resource.type,
|
|
588
|
+
key: cr.resource.key,
|
|
589
|
+
folder: folderPayload
|
|
590
|
+
}, tenantIdHeader, "register-connection-resource"));
|
|
591
|
+
if (err) {
|
|
592
|
+
logger.warn(`Could not register connection resource ${cr.resource.key}: ${err.message}`);
|
|
593
|
+
continue;
|
|
594
|
+
}
|
|
595
|
+
successCount++;
|
|
596
|
+
}
|
|
597
|
+
return successCount;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
export { FpsPropertiesInjectionError, injectInlineAgentProcessEntries, injectSolutionProjectProcessEntries, extractStartEventId, getPersonalFolderKey, getPersonalFolderInfo, prepareForCustomDebug, getFolderInfoById, beginDebugSession, DEBUG_MODE_MAP, SIMULATION_MODE_MAP, createDebugInstance, DebugPollTimeoutError, buildPollTimeoutFailureOutput, pollDebugInstanceStatus, fetchDebugInstanceIncidents, DebugVariablesFetchFailedError, fetchDebugInstanceVariables, isFaultedDebugStatus, isSuccessfulDebugStatus, resolveFaultIncidents, buildStudioWebDesignerUrl, uploadAndDebugSolution, patchConnectionOverwrites };
|
|
601
|
+
|
|
602
|
+
//# debugId=50B9C8A084F4991B64756E2164756E21
|