@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,33 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
isBrowser
|
|
4
|
-
} from "./packager-tool-0gctz400.js";
|
|
5
|
-
import {
|
|
6
|
-
catchError
|
|
7
|
-
} from "./packager-tool-qa9gftnj.js";
|
|
8
|
-
import {
|
|
2
|
+
UIPATH_HOME_DIR,
|
|
9
3
|
AUTH_FILENAME,
|
|
10
4
|
DEFAULT_BASE_URL,
|
|
11
|
-
DEFAULT_REDIRECT_URI
|
|
12
|
-
|
|
13
|
-
} from "./packager-tool-yc4kw997.js";
|
|
5
|
+
DEFAULT_REDIRECT_URI
|
|
6
|
+
} from "./packager-tool-q26hncjr.js";
|
|
14
7
|
import {
|
|
15
|
-
|
|
16
|
-
} from "./packager-tool-
|
|
8
|
+
getFileSystem2
|
|
9
|
+
} from "./packager-tool-z070caqq.js";
|
|
10
|
+
import {
|
|
11
|
+
isBrowser2,
|
|
12
|
+
getGlobalThis
|
|
13
|
+
} from "./packager-tool-z9fmqtm6.js";
|
|
14
|
+
import {
|
|
15
|
+
catchError
|
|
16
|
+
} from "./packager-tool-mxgybnmt.js";
|
|
17
17
|
import {
|
|
18
18
|
__require
|
|
19
|
-
} from "./packager-tool-
|
|
19
|
+
} from "./packager-tool-6an893wm.js";
|
|
20
20
|
|
|
21
21
|
// ../auth/src/config.ts
|
|
22
22
|
var DEFAULT_CLIENT_ID = "36dea5b8-e8bb-423d-8e7b-c808df8f1c00";
|
|
23
23
|
var AUTH_FILE_CONFIG_KEY = Symbol.for("@uipath/auth/AuthFileConfig");
|
|
24
24
|
var globalSlot = globalThis;
|
|
25
|
-
var
|
|
25
|
+
var setAuthFileConfig2 = (cfg) => {
|
|
26
26
|
globalSlot[AUTH_FILE_CONFIG_KEY] = cfg ?? {};
|
|
27
27
|
};
|
|
28
28
|
var getAuthFileConfig = () => globalSlot[AUTH_FILE_CONFIG_KEY] ?? {};
|
|
29
29
|
|
|
30
|
-
class
|
|
30
|
+
class InvalidBaseUrlError2 extends Error {
|
|
31
31
|
url;
|
|
32
32
|
reason;
|
|
33
33
|
constructor(url, reason) {
|
|
@@ -64,10 +64,10 @@ var normalizeAndValidateBaseUrl = (rawUrl) => {
|
|
|
64
64
|
const [urlError, url] = catchError(() => new URL(resolvedBaseUrl));
|
|
65
65
|
if (urlError) {
|
|
66
66
|
const shapeHint = !hasScheme && !hostCandidate.includes(".") ? ` "${rawUrl.trim()}" is not a URL or a host name. Pass the full authority URL — https://<host>, or just <host> (https:// is assumed).` : ` ${urlError instanceof Error ? urlError.message : "Unknown error"}`;
|
|
67
|
-
throw new
|
|
67
|
+
throw new InvalidBaseUrlError2(baseUrl, `Malformed URL.${shapeHint}`);
|
|
68
68
|
}
|
|
69
69
|
if (url.protocol !== "https:") {
|
|
70
|
-
throw new
|
|
70
|
+
throw new InvalidBaseUrlError2(baseUrl, `Authority must use https:// scheme, got ${url.protocol}//. OIDC token exchange requires TLS end-to-end.`);
|
|
71
71
|
}
|
|
72
72
|
return url.pathname.length > 1 ? url.origin : baseUrl;
|
|
73
73
|
};
|
|
@@ -289,14 +289,14 @@ function ClientSecretPost2(clientSecret) {
|
|
|
289
289
|
return ClientSecretPost(clientSecret);
|
|
290
290
|
}
|
|
291
291
|
tbi ||= new WeakMap;
|
|
292
|
-
return (as, client, body,
|
|
292
|
+
return (as, client, body, headers) => {
|
|
293
293
|
let auth;
|
|
294
294
|
if (!(auth = tbi.get(client))) {
|
|
295
295
|
assertString2(client.client_secret, '"metadata.client_secret"');
|
|
296
296
|
auth = ClientSecretPost(client.client_secret);
|
|
297
297
|
tbi.set(client, auth);
|
|
298
298
|
}
|
|
299
|
-
return auth(as, client, body,
|
|
299
|
+
return auth(as, client, body, headers);
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
302
|
function assertString2(input, it) {
|
|
@@ -463,7 +463,8 @@ var exchangeCodeForTokens = async ({
|
|
|
463
463
|
};
|
|
464
464
|
|
|
465
465
|
// ../auth/src/authProfile.ts
|
|
466
|
-
var
|
|
466
|
+
var DEFAULT_AUTH_PROFILE2 = "default";
|
|
467
|
+
var INHERITED_AUTH_PROFILE_ENV2 = "UIPATH_CLI_INHERITED_PROFILE";
|
|
467
468
|
var PROFILE_DIR = "profiles";
|
|
468
469
|
var PROFILE_NAME_RE = /^[A-Za-z0-9._-]+$/;
|
|
469
470
|
var ACTIVE_AUTH_PROFILE_KEY = Symbol.for("@uipath/auth/ActiveAuthProfile");
|
|
@@ -495,23 +496,23 @@ function getProfileStorage() {
|
|
|
495
496
|
}
|
|
496
497
|
var profileStorage = getProfileStorage();
|
|
497
498
|
|
|
498
|
-
class
|
|
499
|
+
class AuthProfileValidationError2 extends Error {
|
|
499
500
|
constructor(message) {
|
|
500
501
|
super(message);
|
|
501
502
|
this.name = "AuthProfileValidationError";
|
|
502
503
|
}
|
|
503
504
|
}
|
|
504
|
-
function
|
|
505
|
-
if (profile === undefined || profile ===
|
|
505
|
+
function normalizeAuthProfileName2(profile) {
|
|
506
|
+
if (profile === undefined || profile === DEFAULT_AUTH_PROFILE2) {
|
|
506
507
|
return;
|
|
507
508
|
}
|
|
508
509
|
if (profile.length === 0 || profile === "." || profile === ".." || !PROFILE_NAME_RE.test(profile)) {
|
|
509
|
-
throw new
|
|
510
|
+
throw new AuthProfileValidationError2(`Invalid profile name "${profile}". Profile names may contain only letters, numbers, '.', '_', and '-'.`);
|
|
510
511
|
}
|
|
511
512
|
return profile;
|
|
512
513
|
}
|
|
513
|
-
function
|
|
514
|
-
const normalized =
|
|
514
|
+
function setActiveAuthProfile2(profile) {
|
|
515
|
+
const normalized = normalizeAuthProfileName2(profile);
|
|
515
516
|
const scopedState = profileStorage.getStore();
|
|
516
517
|
if (scopedState !== undefined) {
|
|
517
518
|
if (normalized === undefined) {
|
|
@@ -527,7 +528,7 @@ function setActiveAuthProfile(profile) {
|
|
|
527
528
|
}
|
|
528
529
|
globalSlot2[ACTIVE_AUTH_PROFILE_KEY] = { profile: normalized };
|
|
529
530
|
}
|
|
530
|
-
function
|
|
531
|
+
function clearActiveAuthProfile2() {
|
|
531
532
|
const scopedState = profileStorage.getStore();
|
|
532
533
|
if (scopedState !== undefined) {
|
|
533
534
|
delete scopedState.profile;
|
|
@@ -535,44 +536,44 @@ function clearActiveAuthProfile() {
|
|
|
535
536
|
}
|
|
536
537
|
delete globalSlot2[ACTIVE_AUTH_PROFILE_KEY];
|
|
537
538
|
}
|
|
538
|
-
function
|
|
539
|
+
function getActiveAuthProfile2() {
|
|
539
540
|
const scopedState = profileStorage.getStore();
|
|
540
541
|
if (scopedState !== undefined) {
|
|
541
542
|
return scopedState.profile;
|
|
542
543
|
}
|
|
543
544
|
return globalSlot2[ACTIVE_AUTH_PROFILE_KEY]?.profile;
|
|
544
545
|
}
|
|
545
|
-
function
|
|
546
|
-
const normalized =
|
|
546
|
+
function runWithAuthProfile2(profile, fn) {
|
|
547
|
+
const normalized = normalizeAuthProfileName2(profile);
|
|
547
548
|
return profileStorage.run(normalized === undefined ? {} : { profile: normalized }, fn);
|
|
548
549
|
}
|
|
549
|
-
function
|
|
550
|
-
const normalized =
|
|
550
|
+
function resolveAuthProfileFilePath2(profile) {
|
|
551
|
+
const normalized = normalizeAuthProfileName2(profile);
|
|
551
552
|
if (normalized === undefined) {
|
|
552
|
-
throw new
|
|
553
|
+
throw new AuthProfileValidationError2(`"${DEFAULT_AUTH_PROFILE2}" is the built-in profile and does not have a profile file path.`);
|
|
553
554
|
}
|
|
554
|
-
const fs =
|
|
555
|
+
const fs = getFileSystem2();
|
|
555
556
|
return fs.path.join(fs.env.homedir(), UIPATH_HOME_DIR, PROFILE_DIR, normalized, AUTH_FILENAME);
|
|
556
557
|
}
|
|
557
|
-
function
|
|
558
|
-
const profile =
|
|
559
|
-
return profile ?
|
|
558
|
+
function getActiveAuthProfileFilePath2() {
|
|
559
|
+
const profile = getActiveAuthProfile2();
|
|
560
|
+
return profile ? resolveAuthProfileFilePath2(profile) : undefined;
|
|
560
561
|
}
|
|
561
|
-
function
|
|
562
|
-
const fs =
|
|
562
|
+
function getAuthProfilesRootPath2() {
|
|
563
|
+
const fs = getFileSystem2();
|
|
563
564
|
return fs.path.join(fs.env.homedir(), UIPATH_HOME_DIR, PROFILE_DIR);
|
|
564
565
|
}
|
|
565
|
-
function
|
|
566
|
-
const normalized =
|
|
566
|
+
function resolveAuthProfileDirPath2(profile) {
|
|
567
|
+
const normalized = normalizeAuthProfileName2(profile);
|
|
567
568
|
if (normalized === undefined) {
|
|
568
|
-
throw new
|
|
569
|
+
throw new AuthProfileValidationError2(`"${DEFAULT_AUTH_PROFILE2}" is the built-in profile and does not have a profile directory.`);
|
|
569
570
|
}
|
|
570
|
-
const fs =
|
|
571
|
-
return fs.path.join(
|
|
571
|
+
const fs = getFileSystem2();
|
|
572
|
+
return fs.path.join(getAuthProfilesRootPath2(), normalized);
|
|
572
573
|
}
|
|
573
|
-
async function
|
|
574
|
-
const fs =
|
|
575
|
-
const root =
|
|
574
|
+
async function listAuthProfileNamesAsync2() {
|
|
575
|
+
const fs = getFileSystem2();
|
|
576
|
+
const root = getAuthProfilesRootPath2();
|
|
576
577
|
if (!await fs.exists(root)) {
|
|
577
578
|
return [];
|
|
578
579
|
}
|
|
@@ -582,7 +583,7 @@ async function listAuthProfileNamesAsync() {
|
|
|
582
583
|
}
|
|
583
584
|
const names = [];
|
|
584
585
|
for (const entry of entries) {
|
|
585
|
-
if (!PROFILE_NAME_RE.test(entry) || entry ===
|
|
586
|
+
if (!PROFILE_NAME_RE.test(entry) || entry === DEFAULT_AUTH_PROFILE2) {
|
|
586
587
|
continue;
|
|
587
588
|
}
|
|
588
589
|
const stats = await fs.stat(fs.path.join(root, entry));
|
|
@@ -592,21 +593,21 @@ async function listAuthProfileNamesAsync() {
|
|
|
592
593
|
}
|
|
593
594
|
return names.sort((a, b) => a.localeCompare(b));
|
|
594
595
|
}
|
|
595
|
-
async function
|
|
596
|
-
const fs =
|
|
597
|
-
const [pathError, dir] = catchError(() =>
|
|
596
|
+
async function authProfileExistsAsync2(profile) {
|
|
597
|
+
const fs = getFileSystem2();
|
|
598
|
+
const [pathError, dir] = catchError(() => resolveAuthProfileDirPath2(profile));
|
|
598
599
|
if (pathError || dir === undefined) {
|
|
599
600
|
return false;
|
|
600
601
|
}
|
|
601
602
|
const stats = await fs.stat(dir);
|
|
602
603
|
return stats?.isDirectory() === true;
|
|
603
604
|
}
|
|
604
|
-
async function
|
|
605
|
-
const dir =
|
|
606
|
-
const fs =
|
|
607
|
-
const relativeToRoot = fs.path.relative(
|
|
605
|
+
async function deleteAuthProfileAsync2(profile) {
|
|
606
|
+
const dir = resolveAuthProfileDirPath2(profile);
|
|
607
|
+
const fs = getFileSystem2();
|
|
608
|
+
const relativeToRoot = fs.path.relative(getAuthProfilesRootPath2(), dir);
|
|
608
609
|
if (relativeToRoot === "" || relativeToRoot.startsWith("..") || fs.path.isAbsolute(relativeToRoot)) {
|
|
609
|
-
throw new
|
|
610
|
+
throw new AuthProfileValidationError2(`Refusing to delete "${profile}": resolved path escapes the profiles directory.`);
|
|
610
611
|
}
|
|
611
612
|
const stats = await fs.stat(dir);
|
|
612
613
|
if (stats?.isDirectory() !== true) {
|
|
@@ -632,7 +633,7 @@ class InvalidIssuerError extends Error {
|
|
|
632
633
|
this.name = "InvalidIssuerError";
|
|
633
634
|
}
|
|
634
635
|
}
|
|
635
|
-
var
|
|
636
|
+
var parseJWT2 = (token) => {
|
|
636
637
|
try {
|
|
637
638
|
const parts = token.split(".");
|
|
638
639
|
const base64Url = parts[1];
|
|
@@ -641,7 +642,7 @@ var parseJWT = (token) => {
|
|
|
641
642
|
}
|
|
642
643
|
const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
|
643
644
|
let decodedString;
|
|
644
|
-
if (
|
|
645
|
+
if (isBrowser2() && typeof atob !== "undefined") {
|
|
645
646
|
decodedString = atob(base64);
|
|
646
647
|
} else {
|
|
647
648
|
decodedString = Buffer.from(base64, "base64").toString();
|
|
@@ -656,7 +657,7 @@ var parseJWT = (token) => {
|
|
|
656
657
|
var assertIssuerMatchesAuthority = (token, authority) => {
|
|
657
658
|
let payload;
|
|
658
659
|
try {
|
|
659
|
-
payload =
|
|
660
|
+
payload = parseJWT2(token);
|
|
660
661
|
} catch (error) {
|
|
661
662
|
throw new InvalidIssuerError(`${authority.replace(/\/+$/, "")}/identity_`, `<unparseable: ${error instanceof Error ? error.message : "unknown error"}>`);
|
|
662
663
|
}
|
|
@@ -688,9 +689,9 @@ var getTokenExpiration = (accessToken) => {
|
|
|
688
689
|
};
|
|
689
690
|
|
|
690
691
|
// ../auth/src/sessionIdentity.ts
|
|
691
|
-
var
|
|
692
|
+
var parseAuthFlow2 = (value) => value === "authorization_code" || value === "client_credentials" || value === "federated_credentials" ? value : undefined;
|
|
692
693
|
var decodeClaims = (accessToken) => {
|
|
693
|
-
const [error, claims] = catchError(() =>
|
|
694
|
+
const [error, claims] = catchError(() => parseJWT2(accessToken));
|
|
694
695
|
return error ? undefined : claims;
|
|
695
696
|
};
|
|
696
697
|
var asString = (value) => typeof value === "string" && value.length > 0 ? value : undefined;
|
|
@@ -737,7 +738,7 @@ var pickScopes = (claims) => {
|
|
|
737
738
|
const scopes = Array.isArray(raw) ? raw.filter((entry) => asString(entry) !== undefined) : typeof raw === "string" ? raw.split(/\s+/).filter(Boolean) : [];
|
|
738
739
|
return scopes.length > 0 ? scopes : undefined;
|
|
739
740
|
};
|
|
740
|
-
var
|
|
741
|
+
var resolveSessionIdentity2 = (accessToken, authFlow) => {
|
|
741
742
|
const claims = accessToken ? decodeClaims(accessToken) : undefined;
|
|
742
743
|
const email = pickEmail(claims);
|
|
743
744
|
const type = resolveIdentityType(claims, authFlow, email);
|
|
@@ -768,12 +769,12 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
|
|
|
768
769
|
identity.applicationSubtype = applicationSubtype;
|
|
769
770
|
return identity;
|
|
770
771
|
};
|
|
771
|
-
var
|
|
772
|
+
var readTokenScopes2 = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
|
|
772
773
|
|
|
773
774
|
// ../auth/src/envAuth.ts
|
|
774
|
-
var
|
|
775
|
-
var
|
|
776
|
-
var
|
|
775
|
+
var ENV_AUTH_ENABLE_VAR2 = "UIPATH_CLI_ENABLE_ENV_AUTH";
|
|
776
|
+
var ENFORCE_ROBOT_AUTH_VAR2 = "UIPATH_CLI_ENFORCE_ROBOT_AUTH";
|
|
777
|
+
var ENV_AUTH_VARS2 = {
|
|
777
778
|
token: "UIPATH_CLI_AUTH_TOKEN",
|
|
778
779
|
organizationName: "UIPATH_CLI_ORGANIZATION_NAME",
|
|
779
780
|
organizationId: "UIPATH_CLI_ORGANIZATION_ID",
|
|
@@ -781,18 +782,20 @@ var ENV_AUTH_VARS = {
|
|
|
781
782
|
tenantId: "UIPATH_CLI_TENANT_ID"
|
|
782
783
|
};
|
|
783
784
|
|
|
784
|
-
class
|
|
785
|
+
class EnvAuthConfigError2 extends Error {
|
|
786
|
+
errorCode = "configuration_error";
|
|
787
|
+
retry = "RetryWillNotFix";
|
|
785
788
|
constructor(message) {
|
|
786
789
|
super(message);
|
|
787
790
|
this.name = "EnvAuthConfigError";
|
|
788
791
|
}
|
|
789
792
|
}
|
|
790
|
-
var
|
|
791
|
-
var
|
|
793
|
+
var isEnvAuthEnabled2 = () => process.env[ENV_AUTH_ENABLE_VAR2] === "true";
|
|
794
|
+
var isRobotAuthEnforced2 = () => process.env[ENFORCE_ROBOT_AUTH_VAR2] === "true";
|
|
792
795
|
var requireEnv = (name) => {
|
|
793
796
|
const value = process.env[name];
|
|
794
797
|
if (!value) {
|
|
795
|
-
throw new
|
|
798
|
+
throw new EnvAuthConfigError2(`${ENV_AUTH_ENABLE_VAR2}=true but ${name} is not set. ` + `Set ${name} to enable env-var authentication.`);
|
|
796
799
|
}
|
|
797
800
|
return value;
|
|
798
801
|
};
|
|
@@ -800,31 +803,31 @@ var OPAQUE_TOKEN_BASE_URL_VAR = "UIPATH_URL";
|
|
|
800
803
|
var resolveBaseUrl = (rawUrl, failureContext) => {
|
|
801
804
|
const [baseUrlError, baseUrl] = catchError(() => normalizeAndValidateBaseUrl(rawUrl));
|
|
802
805
|
if (baseUrlError) {
|
|
803
|
-
if (baseUrlError instanceof
|
|
806
|
+
if (baseUrlError instanceof InvalidBaseUrlError2) {
|
|
804
807
|
throw baseUrlError;
|
|
805
808
|
}
|
|
806
|
-
throw new
|
|
809
|
+
throw new EnvAuthConfigError2(`${failureContext}: ` + `${baseUrlError instanceof Error ? baseUrlError.message : String(baseUrlError)}`);
|
|
807
810
|
}
|
|
808
811
|
return baseUrl;
|
|
809
812
|
};
|
|
810
|
-
var
|
|
811
|
-
const accessToken = requireEnv(
|
|
812
|
-
const organizationName = requireEnv(
|
|
813
|
-
const organizationId = requireEnv(
|
|
814
|
-
const tenantName = requireEnv(
|
|
815
|
-
const tenantId = requireEnv(
|
|
816
|
-
const [parseError, payload] = catchError(() =>
|
|
813
|
+
var readAuthFromEnv2 = () => {
|
|
814
|
+
const accessToken = requireEnv(ENV_AUTH_VARS2.token);
|
|
815
|
+
const organizationName = requireEnv(ENV_AUTH_VARS2.organizationName);
|
|
816
|
+
const organizationId = requireEnv(ENV_AUTH_VARS2.organizationId);
|
|
817
|
+
const tenantName = requireEnv(ENV_AUTH_VARS2.tenantName);
|
|
818
|
+
const tenantId = requireEnv(ENV_AUTH_VARS2.tenantId);
|
|
819
|
+
const [parseError, payload] = catchError(() => parseJWT2(accessToken));
|
|
817
820
|
if (parseError) {
|
|
818
821
|
const parseErrorMessage = parseError instanceof Error ? parseError.message : String(parseError);
|
|
819
822
|
const rawUrl = process.env[OPAQUE_TOKEN_BASE_URL_VAR];
|
|
820
823
|
if (!rawUrl) {
|
|
821
|
-
throw new
|
|
824
|
+
throw new EnvAuthConfigError2(`${ENV_AUTH_VARS2.token} is not a JWT (treating it as an opaque token, ` + `e.g. a Personal Access Token). Set ${OPAQUE_TOKEN_BASE_URL_VAR} to the ` + `UiPath base URL if this is a PAT, or fix the token if it was meant to ` + `be a JWT (parse error: ${parseErrorMessage}).`);
|
|
822
825
|
}
|
|
823
|
-
const
|
|
826
|
+
const baseUrl = resolveBaseUrl(rawUrl, `Failed to validate ${OPAQUE_TOKEN_BASE_URL_VAR}`);
|
|
824
827
|
return {
|
|
825
828
|
loginStatus: "Logged in",
|
|
826
829
|
accessToken,
|
|
827
|
-
baseUrl
|
|
830
|
+
baseUrl,
|
|
828
831
|
organizationName,
|
|
829
832
|
organizationId,
|
|
830
833
|
tenantName,
|
|
@@ -835,13 +838,13 @@ var readAuthFromEnv = () => {
|
|
|
835
838
|
}
|
|
836
839
|
const iss = payload.iss;
|
|
837
840
|
if (typeof iss !== "string" || iss.length === 0) {
|
|
838
|
-
throw new
|
|
841
|
+
throw new EnvAuthConfigError2(`${ENV_AUTH_VARS2.token} has no 'iss' claim; cannot determine ` + `the UiPath server. Ensure the token was issued by a UiPath identity server.`);
|
|
839
842
|
}
|
|
840
843
|
const baseUrl = resolveBaseUrl(iss, "Failed to derive server URL from token 'iss' claim");
|
|
841
844
|
const expiration = getTokenExpiration(accessToken);
|
|
842
845
|
const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
|
|
843
|
-
const identity =
|
|
844
|
-
const scopes =
|
|
846
|
+
const identity = resolveSessionIdentity2(accessToken);
|
|
847
|
+
const scopes = readTokenScopes2(accessToken);
|
|
845
848
|
return {
|
|
846
849
|
loginStatus,
|
|
847
850
|
accessToken,
|
|
@@ -862,7 +865,7 @@ var BREAKER_SUFFIX = ".refresh-state";
|
|
|
862
865
|
var BACKOFF_BASE_MS = 60000;
|
|
863
866
|
var BACKOFF_CAP_MS = 60 * 60 * 1000;
|
|
864
867
|
var SURFACE_WINDOW_MS = 60 * 60 * 1000;
|
|
865
|
-
async function
|
|
868
|
+
async function refreshTokenFingerprint2(refreshToken) {
|
|
866
869
|
const bytes = new TextEncoder().encode(refreshToken);
|
|
867
870
|
if (globalThis.crypto?.subtle) {
|
|
868
871
|
const digest = await globalThis.crypto.subtle.digest("SHA-256", bytes);
|
|
@@ -874,8 +877,8 @@ async function refreshTokenFingerprint(refreshToken) {
|
|
|
874
877
|
function breakerPathFor(authPath) {
|
|
875
878
|
return `${authPath}${BREAKER_SUFFIX}`;
|
|
876
879
|
}
|
|
877
|
-
async function
|
|
878
|
-
const fs =
|
|
880
|
+
async function loadRefreshBreaker2(authPath) {
|
|
881
|
+
const fs = getFileSystem2();
|
|
879
882
|
try {
|
|
880
883
|
const content = await fs.readFile(breakerPathFor(authPath), "utf-8");
|
|
881
884
|
if (!content)
|
|
@@ -886,9 +889,9 @@ async function loadRefreshBreaker(authPath) {
|
|
|
886
889
|
return {};
|
|
887
890
|
}
|
|
888
891
|
}
|
|
889
|
-
async function
|
|
892
|
+
async function saveRefreshBreaker2(authPath, state) {
|
|
890
893
|
try {
|
|
891
|
-
const fs =
|
|
894
|
+
const fs = getFileSystem2();
|
|
892
895
|
const path = breakerPathFor(authPath);
|
|
893
896
|
await fs.mkdir(fs.path.dirname(path));
|
|
894
897
|
const tempPath = `${path}.tmp`;
|
|
@@ -896,8 +899,8 @@ async function saveRefreshBreaker(authPath, state) {
|
|
|
896
899
|
await fs.rename(tempPath, path);
|
|
897
900
|
} catch {}
|
|
898
901
|
}
|
|
899
|
-
async function
|
|
900
|
-
const fs =
|
|
902
|
+
async function clearRefreshBreaker2(authPath) {
|
|
903
|
+
const fs = getFileSystem2();
|
|
901
904
|
const path = breakerPathFor(authPath);
|
|
902
905
|
try {
|
|
903
906
|
if (await fs.exists(path)) {
|
|
@@ -922,7 +925,7 @@ var ROBOT_USER_SERVICES_PIPE = "UiPathUserServices";
|
|
|
922
925
|
var ROBOT_USER_SERVICES_ALTERNATE_PIPE = `${ROBOT_USER_SERVICES_PIPE}Alternate`;
|
|
923
926
|
var PIPE_NAME_MAX_LENGTH = 103;
|
|
924
927
|
var getRobotIpcPipeNames = async () => {
|
|
925
|
-
const fs =
|
|
928
|
+
const fs = getFileSystem2();
|
|
926
929
|
const username = fs.env.getenv("USER") ?? fs.env.getenv("USERNAME");
|
|
927
930
|
if (!username) {
|
|
928
931
|
throw new Error("Unable to determine current username");
|
|
@@ -938,7 +941,7 @@ var defaultIsRobotIpcAvailable = async () => {
|
|
|
938
941
|
if (pipeNamesError || !pipeNames) {
|
|
939
942
|
return false;
|
|
940
943
|
}
|
|
941
|
-
const fs =
|
|
944
|
+
const fs = getFileSystem2();
|
|
942
945
|
for (const pipeName of pipeNames) {
|
|
943
946
|
const [existsError, exists] = await catchError(fs.exists(pipeName));
|
|
944
947
|
if (!existsError && exists === true) {
|
|
@@ -969,7 +972,7 @@ var parseResourceUrl = (url) => {
|
|
|
969
972
|
};
|
|
970
973
|
};
|
|
971
974
|
var ROBOT_CLIENT_LOADER_KEY = Symbol.for("@uipath/auth/RobotClientLoader");
|
|
972
|
-
var
|
|
975
|
+
var registerRobotClientLoader2 = (loader) => {
|
|
973
976
|
globalThis[ROBOT_CLIENT_LOADER_KEY] = loader;
|
|
974
977
|
};
|
|
975
978
|
var getRegisteredRobotClientLoader = () => {
|
|
@@ -988,7 +991,7 @@ var defaultLoadModule = async () => {
|
|
|
988
991
|
return mod;
|
|
989
992
|
};
|
|
990
993
|
var tryRobotClientFallback = async (options = {}) => {
|
|
991
|
-
if (
|
|
994
|
+
if (isBrowser2())
|
|
992
995
|
return;
|
|
993
996
|
if (!options.force) {
|
|
994
997
|
if (process.env.CI || process.env.GITHUB_ACTIONS) {
|
|
@@ -1030,7 +1033,7 @@ var tryRobotClientFallback = async (options = {}) => {
|
|
|
1030
1033
|
let organizationIdFromToken;
|
|
1031
1034
|
let tenantIdFromToken;
|
|
1032
1035
|
let issuerFromToken;
|
|
1033
|
-
const [jwtError, claims] = catchError(() =>
|
|
1036
|
+
const [jwtError, claims] = catchError(() => parseJWT2(accessToken));
|
|
1034
1037
|
if (!jwtError && claims) {
|
|
1035
1038
|
const rawOrgId = claims.prtId ?? claims.organizationId ?? claims.prt_id;
|
|
1036
1039
|
if (typeof rawOrgId === "string" && rawOrgId.length > 0) {
|
|
@@ -1072,7 +1075,7 @@ var describeNonJsonResponse = (organizationId, response, parseError) => {
|
|
|
1072
1075
|
const contentType = response.headers.get("content-type") ?? "unknown";
|
|
1073
1076
|
return `The organization service returned a '${contentType}' response instead ` + `of JSON: ${parseError.message}. ${organizationHint(organizationId)}`;
|
|
1074
1077
|
};
|
|
1075
|
-
var
|
|
1078
|
+
var fetchTenantsAndOrganizations2 = async (baseUrl, accessToken, organizationId, signal) => {
|
|
1076
1079
|
const url = `${baseUrl}/${organizationId}/portal_/api/filtering/leftnav/tenantsAndOrganizationInfo`;
|
|
1077
1080
|
const response = await fetch(url, {
|
|
1078
1081
|
headers: {
|
|
@@ -1098,17 +1101,17 @@ var fetchTenantsAndOrganizations = async (baseUrl, accessToken, organizationId,
|
|
|
1098
1101
|
// ../auth/src/tokenRefresh.ts
|
|
1099
1102
|
var TOKEN_REFRESH_REAUTHENTICATE_MESSAGE = "Token refresh failed. Run 'uip login' to re-authenticate.";
|
|
1100
1103
|
|
|
1101
|
-
class
|
|
1104
|
+
class TokenRefreshOAuthError2 extends Error {
|
|
1102
1105
|
__brand = "TokenRefreshOAuthError";
|
|
1103
1106
|
constructor() {
|
|
1104
1107
|
super(TOKEN_REFRESH_REAUTHENTICATE_MESSAGE);
|
|
1105
1108
|
this.name = "TokenRefreshOAuthError";
|
|
1106
1109
|
}
|
|
1107
1110
|
}
|
|
1108
|
-
function
|
|
1109
|
-
return error instanceof
|
|
1111
|
+
function isTokenRefreshOAuthFailure2(error) {
|
|
1112
|
+
return error instanceof TokenRefreshOAuthError2;
|
|
1110
1113
|
}
|
|
1111
|
-
var
|
|
1114
|
+
var refreshAccessToken2 = async ({
|
|
1112
1115
|
refreshToken,
|
|
1113
1116
|
tokenEndpoint,
|
|
1114
1117
|
clientId,
|
|
@@ -1127,8 +1130,11 @@ var refreshAccessToken = async ({
|
|
|
1127
1130
|
body: tokenParams
|
|
1128
1131
|
});
|
|
1129
1132
|
const tokenData = await tokenResponse.json();
|
|
1133
|
+
if (tokenResponse.status === 400 || tokenResponse.status === 401) {
|
|
1134
|
+
throw new TokenRefreshOAuthError2;
|
|
1135
|
+
}
|
|
1130
1136
|
if (!tokenResponse.ok) {
|
|
1131
|
-
throw new
|
|
1137
|
+
throw new Error(`Token refresh failed: HTTP ${tokenResponse.status}`);
|
|
1132
1138
|
}
|
|
1133
1139
|
const newAccessToken = tokenData.access_token;
|
|
1134
1140
|
const newRefreshToken = tokenData.refresh_token;
|
|
@@ -1142,11 +1148,11 @@ var refreshAccessToken = async ({
|
|
|
1142
1148
|
};
|
|
1143
1149
|
|
|
1144
1150
|
// ../auth/src/types.ts
|
|
1145
|
-
var
|
|
1151
|
+
var AUTH_FLOW_ENV_VAR2 = "UIPATH_AUTH_FLOW";
|
|
1146
1152
|
|
|
1147
1153
|
// ../auth/src/utils/envFile.ts
|
|
1148
|
-
var
|
|
1149
|
-
var
|
|
1154
|
+
var DEFAULT_AUTH_FILENAME2 = AUTH_FILENAME;
|
|
1155
|
+
var DEFAULT_ENV_FILENAME2 = `${UIPATH_HOME_DIR}/${AUTH_FILENAME}`;
|
|
1150
1156
|
var KNOWN_ERROR_CODES = new Set([
|
|
1151
1157
|
"EISDIR",
|
|
1152
1158
|
"EACCES",
|
|
@@ -1190,23 +1196,23 @@ var probeAsync = async (fs, candidate) => {
|
|
|
1190
1196
|
};
|
|
1191
1197
|
}
|
|
1192
1198
|
};
|
|
1193
|
-
var
|
|
1194
|
-
const fs =
|
|
1199
|
+
var resolveEnvFileLocationAsync2 = async (envFilePath = DEFAULT_ENV_FILENAME2, opts) => {
|
|
1200
|
+
const fs = getFileSystem2();
|
|
1195
1201
|
if (fs.path.isAbsolute(envFilePath)) {
|
|
1196
|
-
const
|
|
1197
|
-
return
|
|
1202
|
+
const probe = await probeAsync(fs, envFilePath);
|
|
1203
|
+
return probe.exists ? { exists: true, absolutePath: envFilePath, source: "absolute" } : {
|
|
1198
1204
|
exists: false,
|
|
1199
1205
|
absolutePath: envFilePath,
|
|
1200
1206
|
source: "absolute",
|
|
1201
|
-
...
|
|
1207
|
+
...probe.unusable ? { unusable: probe.unusable } : {}
|
|
1202
1208
|
};
|
|
1203
1209
|
}
|
|
1204
1210
|
const cwd = opts?.cwd ?? fs.env.cwd();
|
|
1205
1211
|
let searchDir = cwd;
|
|
1206
1212
|
while (true) {
|
|
1207
1213
|
const candidate = fs.path.join(searchDir, envFilePath);
|
|
1208
|
-
const
|
|
1209
|
-
if (
|
|
1214
|
+
const probe = await probeAsync(fs, candidate);
|
|
1215
|
+
if (probe.exists) {
|
|
1210
1216
|
return {
|
|
1211
1217
|
exists: true,
|
|
1212
1218
|
absolutePath: candidate,
|
|
@@ -1231,8 +1237,8 @@ var resolveEnvFileLocationAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opt
|
|
|
1231
1237
|
...probe.unusable ? { unusable: probe.unusable } : {}
|
|
1232
1238
|
};
|
|
1233
1239
|
};
|
|
1234
|
-
var
|
|
1235
|
-
const location = await
|
|
1240
|
+
var resolveEnvFilePathAsync2 = async (envFilePath = DEFAULT_ENV_FILENAME2, opts) => {
|
|
1241
|
+
const location = await resolveEnvFileLocationAsync2(envFilePath, opts);
|
|
1236
1242
|
if (location.exists) {
|
|
1237
1243
|
return { absolutePath: location.absolutePath };
|
|
1238
1244
|
}
|
|
@@ -1262,8 +1268,8 @@ var parseEnvContent = (content) => {
|
|
|
1262
1268
|
}
|
|
1263
1269
|
return env;
|
|
1264
1270
|
};
|
|
1265
|
-
var
|
|
1266
|
-
const fs =
|
|
1271
|
+
var loadEnvFileAsync2 = async ({ envPath }) => {
|
|
1272
|
+
const fs = getFileSystem2();
|
|
1267
1273
|
const absolutePath = fs.path.isAbsolute(envPath) ? envPath : fs.path.join(fs.env.cwd(), envPath);
|
|
1268
1274
|
if (!await fs.exists(absolutePath)) {
|
|
1269
1275
|
throw new Error(`Environment file not found: ${envPath}`);
|
|
@@ -1274,17 +1280,17 @@ var loadEnvFileAsync = async ({ envPath }) => {
|
|
|
1274
1280
|
}
|
|
1275
1281
|
return parseEnvContent(content);
|
|
1276
1282
|
};
|
|
1277
|
-
var
|
|
1283
|
+
var saveEnvFileAsync2 = async ({
|
|
1278
1284
|
envPath,
|
|
1279
1285
|
data,
|
|
1280
1286
|
merge = true
|
|
1281
1287
|
}) => {
|
|
1282
|
-
const fs =
|
|
1288
|
+
const fs = getFileSystem2();
|
|
1283
1289
|
const absolutePath = fs.path.isAbsolute(envPath) ? envPath : fs.path.join(fs.env.homedir(), envPath);
|
|
1284
1290
|
let existingData = {};
|
|
1285
1291
|
if (merge && await fs.exists(absolutePath)) {
|
|
1286
1292
|
try {
|
|
1287
|
-
existingData = await
|
|
1293
|
+
existingData = await loadEnvFileAsync2({ envPath: absolutePath });
|
|
1288
1294
|
} catch {}
|
|
1289
1295
|
}
|
|
1290
1296
|
const finalData = { ...existingData, ...data };
|
|
@@ -1308,48 +1314,48 @@ var saveEnvFileAsync = async ({
|
|
|
1308
1314
|
};
|
|
1309
1315
|
|
|
1310
1316
|
// ../auth/src/loginStatus.ts
|
|
1311
|
-
var
|
|
1312
|
-
((
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
})(
|
|
1317
|
+
var CredentialSource2;
|
|
1318
|
+
((CredentialSource) => {
|
|
1319
|
+
CredentialSource["SavedLogin"] = "saved-login";
|
|
1320
|
+
CredentialSource["Robot"] = "robot";
|
|
1321
|
+
CredentialSource["EnvironmentVariables"] = "env-vars";
|
|
1322
|
+
})(CredentialSource2 ||= {});
|
|
1317
1323
|
var defaultRobotTenantIdCache = new Map;
|
|
1318
1324
|
var ROBOT_TENANT_LOOKUP_TIMEOUT_MS = 5000;
|
|
1319
|
-
var
|
|
1320
|
-
return
|
|
1325
|
+
var getLoginStatusAsync2 = async (options = {}) => {
|
|
1326
|
+
return getLoginStatusWithDeps2(options);
|
|
1321
1327
|
};
|
|
1322
|
-
var
|
|
1328
|
+
var getLoginStatusWithDeps2 = async (options = {}, deps = {}) => {
|
|
1323
1329
|
const {
|
|
1324
|
-
resolveEnvFilePath =
|
|
1325
|
-
loadEnvFile =
|
|
1326
|
-
saveEnvFile =
|
|
1327
|
-
getFs =
|
|
1328
|
-
refreshToken: refreshTokenFn =
|
|
1330
|
+
resolveEnvFilePath = resolveEnvFilePathAsync2,
|
|
1331
|
+
loadEnvFile = loadEnvFileAsync2,
|
|
1332
|
+
saveEnvFile = saveEnvFileAsync2,
|
|
1333
|
+
getFs = getFileSystem2,
|
|
1334
|
+
refreshToken: refreshTokenFn = refreshAccessToken2,
|
|
1329
1335
|
resolveConfig = resolveConfigAsync,
|
|
1330
1336
|
robotFallback = tryRobotClientFallback,
|
|
1331
|
-
fetchTenantsAndOrgs =
|
|
1337
|
+
fetchTenantsAndOrgs = fetchTenantsAndOrganizations2,
|
|
1332
1338
|
robotTenantIdCache = defaultRobotTenantIdCache,
|
|
1333
1339
|
robotTenantLookupTimeoutMs = ROBOT_TENANT_LOOKUP_TIMEOUT_MS,
|
|
1334
|
-
loadBreaker =
|
|
1335
|
-
saveBreaker =
|
|
1336
|
-
clearBreaker =
|
|
1340
|
+
loadBreaker = loadRefreshBreaker2,
|
|
1341
|
+
saveBreaker = saveRefreshBreaker2,
|
|
1342
|
+
clearBreaker = clearRefreshBreaker2
|
|
1337
1343
|
} = deps;
|
|
1338
1344
|
const robotDeps = {
|
|
1339
1345
|
fetchTenantsAndOrgs,
|
|
1340
1346
|
cache: robotTenantIdCache,
|
|
1341
1347
|
lookupTimeoutMs: robotTenantLookupTimeoutMs
|
|
1342
1348
|
};
|
|
1343
|
-
if (
|
|
1349
|
+
if (isRobotAuthEnforced2()) {
|
|
1344
1350
|
return resolveRobotEnforcedStatus(robotFallback, robotDeps);
|
|
1345
1351
|
}
|
|
1346
|
-
if (
|
|
1347
|
-
return
|
|
1352
|
+
if (isEnvAuthEnabled2()) {
|
|
1353
|
+
return readAuthFromEnv2();
|
|
1348
1354
|
}
|
|
1349
|
-
const activeProfile =
|
|
1350
|
-
const activeProfileFilePath =
|
|
1355
|
+
const activeProfile = getActiveAuthProfile2();
|
|
1356
|
+
const activeProfileFilePath = getActiveAuthProfileFilePath2();
|
|
1351
1357
|
const usingActiveProfile = activeProfile !== undefined && (options.envFilePath === undefined || options.envFilePath === activeProfileFilePath);
|
|
1352
|
-
const envFilePath = options.envFilePath ?? activeProfileFilePath ??
|
|
1358
|
+
const envFilePath = options.envFilePath ?? activeProfileFilePath ?? DEFAULT_ENV_FILENAME2;
|
|
1353
1359
|
const { ensureTokenValidityMinutes } = options;
|
|
1354
1360
|
const { absolutePath } = await resolveEnvFilePath(envFilePath);
|
|
1355
1361
|
if (absolutePath === undefined) {
|
|
@@ -1402,14 +1408,14 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
|
|
|
1402
1408
|
return buildFileStatus(tokens, credentials, globalHint);
|
|
1403
1409
|
};
|
|
1404
1410
|
async function resolveRobotEnforcedStatus(robotFallback, deps) {
|
|
1405
|
-
if (
|
|
1406
|
-
throw new
|
|
1411
|
+
if (isEnvAuthEnabled2()) {
|
|
1412
|
+
throw new EnvAuthConfigError2(`${ENV_AUTH_ENABLE_VAR2}=true and ${ENFORCE_ROBOT_AUTH_VAR2}=true ` + `are mutually exclusive. Unset one of them and re-run.`);
|
|
1407
1413
|
}
|
|
1408
1414
|
const robotCreds = await robotFallback({ force: true });
|
|
1409
1415
|
if (!robotCreds) {
|
|
1410
1416
|
return {
|
|
1411
1417
|
loginStatus: "Not logged in",
|
|
1412
|
-
hint: `${
|
|
1418
|
+
hint: `${ENFORCE_ROBOT_AUTH_VAR2}=true but the UiPath Robot ` + `session is unavailable. Start and sign in to the Assistant, ` + `or unset ${ENFORCE_ROBOT_AUTH_VAR2} to fall back to file or ` + `env-var authentication.`
|
|
1413
1419
|
};
|
|
1414
1420
|
}
|
|
1415
1421
|
return buildRobotStatus(robotCreds, deps);
|
|
@@ -1544,16 +1550,16 @@ async function buildFileStatus(tokens, credentials, globalHint) {
|
|
|
1544
1550
|
return result;
|
|
1545
1551
|
}
|
|
1546
1552
|
function identityFields(accessToken, credentials) {
|
|
1547
|
-
const identity =
|
|
1548
|
-
const scopes =
|
|
1553
|
+
const identity = resolveSessionIdentity2(accessToken, parseAuthFlow2(credentials[AUTH_FLOW_ENV_VAR2]));
|
|
1554
|
+
const scopes = readTokenScopes2(accessToken);
|
|
1549
1555
|
return {
|
|
1550
1556
|
...identity ? { identity } : {},
|
|
1551
1557
|
...scopes ? { scopes } : {}
|
|
1552
1558
|
};
|
|
1553
1559
|
}
|
|
1554
1560
|
async function buildRobotStatus(robotCreds, deps) {
|
|
1555
|
-
const identity =
|
|
1556
|
-
const scopes =
|
|
1561
|
+
const identity = resolveSessionIdentity2(robotCreds.accessToken);
|
|
1562
|
+
const scopes = readTokenScopes2(robotCreds.accessToken);
|
|
1557
1563
|
const tenant = robotCreds.tenantId ? { tenantId: robotCreds.tenantId } : await resolveRobotTenantId(robotCreds, deps);
|
|
1558
1564
|
return {
|
|
1559
1565
|
loginStatus: "Logged in",
|
|
@@ -1634,7 +1640,7 @@ async function circuitBreakerShortCircuit(ctx) {
|
|
|
1634
1640
|
saveBreaker,
|
|
1635
1641
|
clearBreaker
|
|
1636
1642
|
} = ctx;
|
|
1637
|
-
const fingerprint = await
|
|
1643
|
+
const fingerprint = await refreshTokenFingerprint2(refreshToken);
|
|
1638
1644
|
const breaker = await loadBreaker(absolutePath).catch(() => ({}));
|
|
1639
1645
|
if (breaker.deadTokenFp && breaker.deadTokenFp !== fingerprint) {
|
|
1640
1646
|
await clearBreaker(absolutePath);
|
|
@@ -1767,10 +1773,10 @@ async function runRefreshLocked(inputs) {
|
|
|
1767
1773
|
refreshedAccess = refreshed.accessToken;
|
|
1768
1774
|
refreshedRefresh = refreshed.refreshToken;
|
|
1769
1775
|
} catch (error) {
|
|
1770
|
-
const isOAuthFailure =
|
|
1776
|
+
const isOAuthFailure = isTokenRefreshOAuthFailure2(error);
|
|
1771
1777
|
const hint = isOAuthFailure ? "Run 'uip login' to re-authenticate — the stored refresh token is invalid or expired. In a non-interactive context, authenticate with: uip login --client-id <id> --client-secret <secret> -t <tenant>." : "Token refresh failed. Check your network connection, then retry or run 'uip login' to re-authenticate.";
|
|
1772
1778
|
const message = isOAuthFailure ? normalizeTokenRefreshFailure() : normalizeTokenRefreshUnavailableFailure();
|
|
1773
|
-
const fp = await
|
|
1779
|
+
const fp = await refreshTokenFingerprint2(tokenForIdP);
|
|
1774
1780
|
if (isOAuthFailure) {
|
|
1775
1781
|
await saveBreaker(absolutePath, { deadTokenFp: fp });
|
|
1776
1782
|
} else {
|
|
@@ -1855,26 +1861,38 @@ function errorMessage(error) {
|
|
|
1855
1861
|
}
|
|
1856
1862
|
|
|
1857
1863
|
// ../auth/src/authContext.ts
|
|
1858
|
-
|
|
1859
|
-
|
|
1864
|
+
class AuthContextUnavailableError2 extends Error {
|
|
1865
|
+
instructionContext;
|
|
1866
|
+
sessionHint;
|
|
1867
|
+
errorCode = "authentication_required";
|
|
1868
|
+
retry = "RetryWillNotFix";
|
|
1869
|
+
constructor(message, instructionContext = "auth", sessionHint) {
|
|
1870
|
+
super(message);
|
|
1871
|
+
this.instructionContext = instructionContext;
|
|
1872
|
+
this.sessionHint = sessionHint;
|
|
1873
|
+
this.name = "AuthContextUnavailableError";
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
var getAuthContext2 = async (options = {}) => {
|
|
1877
|
+
const status = await getLoginStatusAsync2({
|
|
1860
1878
|
ensureTokenValidityMinutes: options.ensureTokenValidityMinutes,
|
|
1861
1879
|
envFilePath: options.envFilePath
|
|
1862
1880
|
});
|
|
1863
1881
|
if (status.loginStatus !== "Logged in" || !status.baseUrl || !status.accessToken) {
|
|
1864
|
-
throw new
|
|
1882
|
+
throw new AuthContextUnavailableError2(status.hint ? `Not logged in. ${status.hint}` : "Not logged in. Run 'uip login' first.", "auth", status.hint);
|
|
1865
1883
|
}
|
|
1866
|
-
const tenantName = options.tenant
|
|
1884
|
+
const tenantName = options.tenant || status.tenantName;
|
|
1867
1885
|
if (options.requireOrganizationId && !status.organizationId) {
|
|
1868
|
-
throw new
|
|
1886
|
+
throw new AuthContextUnavailableError2("Organization ID not available. Ensure you are logged in with an organization context.", "identity");
|
|
1869
1887
|
}
|
|
1870
1888
|
if (options.requireOrganizationName && !status.organizationName) {
|
|
1871
|
-
throw new
|
|
1889
|
+
throw new AuthContextUnavailableError2("Organization name not available. Ensure you are logged in with an organization context.", "identity");
|
|
1872
1890
|
}
|
|
1873
1891
|
if (options.requireTenantId && !status.tenantId) {
|
|
1874
|
-
throw new
|
|
1892
|
+
throw new AuthContextUnavailableError2(`Tenant ID not available. Ensure UIPATH_TENANT_ID is set.${status.hint ? ` ${status.hint}` : ""}`, "identity", status.hint);
|
|
1875
1893
|
}
|
|
1876
|
-
if (options.requireTenantName && tenantName
|
|
1877
|
-
throw new
|
|
1894
|
+
if (options.requireTenantName && !tenantName) {
|
|
1895
|
+
throw new AuthContextUnavailableError2("Tenant not provided and UIPATH_TENANT_NAME not set. Run 'uip login' to select a tenant, or use 'uip login tenant set <tenant>' to switch tenants.", "identity");
|
|
1878
1896
|
}
|
|
1879
1897
|
return {
|
|
1880
1898
|
baseUrl: status.baseUrl,
|
|
@@ -1886,11 +1904,11 @@ var getAuthContext = async (options = {}) => {
|
|
|
1886
1904
|
identity: status.identity
|
|
1887
1905
|
};
|
|
1888
1906
|
};
|
|
1889
|
-
var
|
|
1907
|
+
var getAuthEnv2 = async (options = {}) => {
|
|
1890
1908
|
const authEnv = {};
|
|
1891
1909
|
let status;
|
|
1892
1910
|
try {
|
|
1893
|
-
status = await
|
|
1911
|
+
status = await getLoginStatusAsync2(options);
|
|
1894
1912
|
} catch {
|
|
1895
1913
|
return { authEnv };
|
|
1896
1914
|
}
|
|
@@ -1900,7 +1918,7 @@ var getAuthEnv = async (options = {}) => {
|
|
|
1900
1918
|
const org = status.organizationName || status.organizationId;
|
|
1901
1919
|
const tenant = status.tenantName || status.tenantId;
|
|
1902
1920
|
if (org && tenant) {
|
|
1903
|
-
authEnv.UIPATH_URL = `${status.baseUrl.replace(/\/+$/, "")}/${org}/${tenant}`;
|
|
1921
|
+
authEnv.UIPATH_URL = `${status.baseUrl.replace(/\/+$/, "")}/${encodeURIComponent(org)}/${encodeURIComponent(tenant)}`;
|
|
1904
1922
|
}
|
|
1905
1923
|
}
|
|
1906
1924
|
if (status.organizationId)
|
|
@@ -1941,7 +1959,7 @@ async function describeAuthProfileAsync(name, filePath, active) {
|
|
|
1941
1959
|
if (!filePath) {
|
|
1942
1960
|
return { ...base, status: "Not logged in" };
|
|
1943
1961
|
}
|
|
1944
|
-
const fs =
|
|
1962
|
+
const fs = getFileSystem2();
|
|
1945
1963
|
const [readError, content] = await catchError(fs.readFile(filePath, "utf-8"));
|
|
1946
1964
|
if (readError) {
|
|
1947
1965
|
return { ...base, status: "Unreadable" };
|
|
@@ -1958,14 +1976,14 @@ async function describeAuthProfileAsync(name, filePath, active) {
|
|
|
1958
1976
|
...statusFromToken(values[ACCESS_TOKEN_KEY])
|
|
1959
1977
|
};
|
|
1960
1978
|
}
|
|
1961
|
-
async function
|
|
1962
|
-
const activeProfile =
|
|
1963
|
-
const [defaultPathError, defaultLocation] = await catchError(
|
|
1979
|
+
async function describeAuthProfilesAsync2() {
|
|
1980
|
+
const activeProfile = getActiveAuthProfile2();
|
|
1981
|
+
const [defaultPathError, defaultLocation] = await catchError(resolveEnvFilePathAsync2());
|
|
1964
1982
|
const rows = [
|
|
1965
|
-
await describeAuthProfileAsync(
|
|
1983
|
+
await describeAuthProfileAsync(DEFAULT_AUTH_PROFILE2, defaultPathError ? undefined : defaultLocation?.absolutePath, activeProfile === undefined)
|
|
1966
1984
|
];
|
|
1967
|
-
for (const name of await
|
|
1968
|
-
rows.push(await describeAuthProfileAsync(name,
|
|
1985
|
+
for (const name of await listAuthProfileNamesAsync2()) {
|
|
1986
|
+
rows.push(await describeAuthProfileAsync(name, resolveAuthProfileFilePath2(name), activeProfile === name));
|
|
1969
1987
|
}
|
|
1970
1988
|
return rows;
|
|
1971
1989
|
}
|
|
@@ -2013,7 +2031,7 @@ var requestClientCredentialsToken = async ({
|
|
|
2013
2031
|
};
|
|
2014
2032
|
|
|
2015
2033
|
// ../auth/src/clientCredentials.ts
|
|
2016
|
-
class
|
|
2034
|
+
class ClientCredentialsAuthenticationError2 extends Error {
|
|
2017
2035
|
status;
|
|
2018
2036
|
constructor(message, status) {
|
|
2019
2037
|
super(message);
|
|
@@ -2042,11 +2060,11 @@ Troubleshooting:` + `
|
|
|
2042
2060
|
• The requested scopes may not be available for your account` + `
|
|
2043
2061
|
• Try using default scopes or contact your UiPath administrator`;
|
|
2044
2062
|
}
|
|
2045
|
-
return new
|
|
2063
|
+
return new ClientCredentialsAuthenticationError2(`Client Credentials authentication failed (${status})
|
|
2046
2064
|
` + `Error: ${errorType}
|
|
2047
2065
|
` + `Details: ${errorDesc}${troubleshooting}`, status);
|
|
2048
2066
|
};
|
|
2049
|
-
var
|
|
2067
|
+
var clientCredentialsLogin2 = async ({
|
|
2050
2068
|
clientId,
|
|
2051
2069
|
clientSecret,
|
|
2052
2070
|
scope,
|
|
@@ -2074,9 +2092,9 @@ var clientCredentialsLogin = async ({
|
|
|
2074
2092
|
});
|
|
2075
2093
|
};
|
|
2076
2094
|
// ../auth/src/federatedCredentials.ts
|
|
2077
|
-
var
|
|
2095
|
+
var JWT_BEARER_ASSERTION_TYPE2 = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
|
2078
2096
|
|
|
2079
|
-
class
|
|
2097
|
+
class FederatedCredentialsAuthenticationError2 extends Error {
|
|
2080
2098
|
status;
|
|
2081
2099
|
constructor(message, status) {
|
|
2082
2100
|
super(message);
|
|
@@ -2107,11 +2125,11 @@ Troubleshooting:` + `
|
|
|
2107
2125
|
• The requested scopes may not be available for your application` + `
|
|
2108
2126
|
• Try using default scopes or contact your UiPath administrator`;
|
|
2109
2127
|
}
|
|
2110
|
-
return new
|
|
2128
|
+
return new FederatedCredentialsAuthenticationError2(`Federated Credentials authentication failed (${status})
|
|
2111
2129
|
` + `Error: ${errorType}
|
|
2112
2130
|
` + `Details: ${errorDesc}${troubleshooting}`, status);
|
|
2113
2131
|
};
|
|
2114
|
-
var
|
|
2132
|
+
var federatedCredentialsLogin2 = async ({
|
|
2115
2133
|
clientId,
|
|
2116
2134
|
clientAssertion,
|
|
2117
2135
|
scope,
|
|
@@ -2127,7 +2145,7 @@ var federatedCredentialsLogin = async ({
|
|
|
2127
2145
|
grant_type: "client_credentials",
|
|
2128
2146
|
client_id: config.clientId,
|
|
2129
2147
|
client_assertion: clientAssertion,
|
|
2130
|
-
client_assertion_type:
|
|
2148
|
+
client_assertion_type: JWT_BEARER_ASSERTION_TYPE2
|
|
2131
2149
|
};
|
|
2132
2150
|
if (config.scopes.length > 0) {
|
|
2133
2151
|
params.scope = config.scopes.join(" ");
|
|
@@ -2140,10 +2158,10 @@ var federatedCredentialsLogin = async ({
|
|
|
2140
2158
|
});
|
|
2141
2159
|
};
|
|
2142
2160
|
// ../auth/src/selectTenant.ts
|
|
2143
|
-
var
|
|
2144
|
-
var
|
|
2161
|
+
var TENANT_SELECTION_REQUIRED_CODE2 = "TENANT_SELECTION_REQUIRED";
|
|
2162
|
+
var INVALID_TENANT_CODE2 = "INVALID_TENANT";
|
|
2145
2163
|
|
|
2146
|
-
class
|
|
2164
|
+
class TenantSelectionError2 extends Error {
|
|
2147
2165
|
availableTenants;
|
|
2148
2166
|
organizationName;
|
|
2149
2167
|
constructor(message, organizationName, availableTenants) {
|
|
@@ -2153,16 +2171,16 @@ class TenantSelectionError extends Error {
|
|
|
2153
2171
|
}
|
|
2154
2172
|
}
|
|
2155
2173
|
|
|
2156
|
-
class
|
|
2157
|
-
code =
|
|
2174
|
+
class TenantSelectionRequiredError2 extends TenantSelectionError2 {
|
|
2175
|
+
code = TENANT_SELECTION_REQUIRED_CODE2;
|
|
2158
2176
|
constructor(organizationName, availableTenants) {
|
|
2159
2177
|
super(`Multiple tenants available in organization "${organizationName}"; none selected.`, organizationName, availableTenants);
|
|
2160
2178
|
this.name = "TenantSelectionRequiredError";
|
|
2161
2179
|
}
|
|
2162
2180
|
}
|
|
2163
2181
|
|
|
2164
|
-
class
|
|
2165
|
-
code =
|
|
2182
|
+
class InvalidTenantError2 extends TenantSelectionError2 {
|
|
2183
|
+
code = INVALID_TENANT_CODE2;
|
|
2166
2184
|
requestedTenant;
|
|
2167
2185
|
constructor(requestedTenant, organizationName, availableTenants) {
|
|
2168
2186
|
super(`Invalid tenant requested: "${requestedTenant}"
|
|
@@ -2173,19 +2191,19 @@ class InvalidTenantError extends TenantSelectionError {
|
|
|
2173
2191
|
}
|
|
2174
2192
|
}
|
|
2175
2193
|
var TENANT_SELECTION_CODES = new Set([
|
|
2176
|
-
|
|
2177
|
-
|
|
2194
|
+
TENANT_SELECTION_REQUIRED_CODE2,
|
|
2195
|
+
INVALID_TENANT_CODE2
|
|
2178
2196
|
]);
|
|
2179
|
-
function
|
|
2197
|
+
function isTenantSelectionError2(error) {
|
|
2180
2198
|
if (!(error instanceof Object) || !("code" in error)) {
|
|
2181
2199
|
return false;
|
|
2182
2200
|
}
|
|
2183
2201
|
const code = error.code;
|
|
2184
2202
|
return typeof code === "string" && TENANT_SELECTION_CODES.has(code) && Array.isArray(error.availableTenants);
|
|
2185
2203
|
}
|
|
2186
|
-
var
|
|
2204
|
+
var selectTenantWithDeps2 = async (baseUrl, accessToken, organizationId, targetTenantName, interactive, deps = {}) => {
|
|
2187
2205
|
const {
|
|
2188
|
-
fetchTenantsAndOrgs =
|
|
2206
|
+
fetchTenantsAndOrgs = fetchTenantsAndOrganizations2,
|
|
2189
2207
|
selectFromList
|
|
2190
2208
|
} = deps;
|
|
2191
2209
|
const data = await fetchTenantsAndOrgs(baseUrl, accessToken, organizationId);
|
|
@@ -2198,7 +2216,7 @@ var selectTenantWithDeps = async (baseUrl, accessToken, organizationId, targetTe
|
|
|
2198
2216
|
if (targetTenantName !== undefined) {
|
|
2199
2217
|
selectedIndex = tenants.findIndex((tenant) => tenant.name === targetTenantName);
|
|
2200
2218
|
if (selectedIndex === -1) {
|
|
2201
|
-
throw new
|
|
2219
|
+
throw new InvalidTenantError2(targetTenantName, organization.name, tenantNames);
|
|
2202
2220
|
}
|
|
2203
2221
|
} else if (tenants.length === 1) {
|
|
2204
2222
|
selectedIndex = 0;
|
|
@@ -2208,25 +2226,25 @@ var selectTenantWithDeps = async (baseUrl, accessToken, organizationId, targetTe
|
|
|
2208
2226
|
}
|
|
2209
2227
|
selectedIndex = await selectFromList(tenantNames, "Select a tenant:");
|
|
2210
2228
|
} else {
|
|
2211
|
-
throw new
|
|
2229
|
+
throw new TenantSelectionRequiredError2(organization.name, tenantNames);
|
|
2212
2230
|
}
|
|
2213
2231
|
const selectedTenant = tenants[selectedIndex];
|
|
2214
2232
|
return [selectedTenant.name, selectedTenant.id, organization.name];
|
|
2215
2233
|
};
|
|
2216
2234
|
|
|
2217
2235
|
// ../auth/src/interactive.ts
|
|
2218
|
-
var
|
|
2236
|
+
var interactiveLoginWithDeps2 = async (options, deps) => {
|
|
2219
2237
|
const {
|
|
2220
2238
|
resolveConfig = resolveConfigAsync,
|
|
2221
|
-
clientCredentials =
|
|
2222
|
-
federatedCredentials =
|
|
2223
|
-
auth =
|
|
2224
|
-
saveEnvFile =
|
|
2225
|
-
loadEnvFile =
|
|
2226
|
-
getFs =
|
|
2227
|
-
jwtParser =
|
|
2239
|
+
clientCredentials = clientCredentialsLogin2,
|
|
2240
|
+
federatedCredentials = federatedCredentialsLogin2,
|
|
2241
|
+
auth = authenticate2,
|
|
2242
|
+
saveEnvFile = saveEnvFileAsync2,
|
|
2243
|
+
loadEnvFile = loadEnvFileAsync2,
|
|
2244
|
+
getFs = getFileSystem2,
|
|
2245
|
+
jwtParser = parseJWT2,
|
|
2228
2246
|
issuerAsserter = assertIssuerMatchesAuthority,
|
|
2229
|
-
tenantSelector = (baseUrl, accessToken, organizationId, tenantName,
|
|
2247
|
+
tenantSelector = (baseUrl, accessToken, organizationId, tenantName, interactive) => selectTenantWithDeps2(baseUrl, accessToken, organizationId, tenantName, interactive, { selectFromList: options.selectFromList })
|
|
2230
2248
|
} = deps;
|
|
2231
2249
|
const {
|
|
2232
2250
|
envFilePath,
|
|
@@ -2311,7 +2329,7 @@ var interactiveLoginWithDeps = async (options, deps) => {
|
|
|
2311
2329
|
const credentials = {
|
|
2312
2330
|
...tokens,
|
|
2313
2331
|
UIPATH_URL: config.baseUrl,
|
|
2314
|
-
[
|
|
2332
|
+
[AUTH_FLOW_ENV_VAR2]: authFlow
|
|
2315
2333
|
};
|
|
2316
2334
|
if (authFlow !== "authorization_code") {
|
|
2317
2335
|
credentials.UIPATH_REFRESH_TOKEN = undefined;
|
|
@@ -2331,7 +2349,7 @@ var interactiveLoginWithDeps = async (options, deps) => {
|
|
|
2331
2349
|
credentials.UIPATH_TENANT_NAME = tenantName;
|
|
2332
2350
|
credentials.UIPATH_TENANT_ID = tenantId;
|
|
2333
2351
|
} catch (error) {
|
|
2334
|
-
if (!
|
|
2352
|
+
if (!isTenantSelectionError2(error)) {
|
|
2335
2353
|
emit({
|
|
2336
2354
|
type: "tenant-fetch-failed",
|
|
2337
2355
|
message: error instanceof Error ? error.message : String(error)
|
|
@@ -2340,7 +2358,7 @@ var interactiveLoginWithDeps = async (options, deps) => {
|
|
|
2340
2358
|
throw error;
|
|
2341
2359
|
}
|
|
2342
2360
|
const fs = getFs();
|
|
2343
|
-
const requestedPath = envFilePath ??
|
|
2361
|
+
const requestedPath = envFilePath ?? DEFAULT_ENV_FILENAME2;
|
|
2344
2362
|
let savePath = requestedPath;
|
|
2345
2363
|
let savedLocally = false;
|
|
2346
2364
|
if (!fs.path.isAbsolute(savePath)) {
|
|
@@ -2366,8 +2384,12 @@ var interactiveLoginWithDeps = async (options, deps) => {
|
|
|
2366
2384
|
searchDir = parentDir;
|
|
2367
2385
|
}
|
|
2368
2386
|
}
|
|
2387
|
+
if (!fs.path.isAbsolute(savePath)) {
|
|
2388
|
+
savePath = fs.path.join(fs.env.homedir(), savePath);
|
|
2389
|
+
}
|
|
2369
2390
|
let saveRelease;
|
|
2370
2391
|
try {
|
|
2392
|
+
await fs.mkdir(fs.path.dirname(savePath));
|
|
2371
2393
|
if (typeof fs.acquireLock === "function") {
|
|
2372
2394
|
saveRelease = await fs.acquireLock(savePath);
|
|
2373
2395
|
}
|
|
@@ -2385,24 +2407,23 @@ var interactiveLoginWithDeps = async (options, deps) => {
|
|
|
2385
2407
|
await saveRelease().catch(() => {});
|
|
2386
2408
|
}
|
|
2387
2409
|
}
|
|
2388
|
-
const reportedPath = fs.path.isAbsolute(savePath) ? savePath : fs.path.join(fs.env.homedir(), savePath);
|
|
2389
2410
|
emit({
|
|
2390
2411
|
type: "saved",
|
|
2391
|
-
path:
|
|
2412
|
+
path: savePath,
|
|
2392
2413
|
locality: savedLocally ? "local" : "global"
|
|
2393
2414
|
});
|
|
2394
2415
|
return credentials;
|
|
2395
2416
|
};
|
|
2396
|
-
var
|
|
2397
|
-
return
|
|
2417
|
+
var interactiveLogin2 = async (options) => {
|
|
2418
|
+
return interactiveLoginWithDeps2(options, {});
|
|
2398
2419
|
};
|
|
2399
2420
|
// ../auth/src/logout.ts
|
|
2400
|
-
async function
|
|
2421
|
+
async function logoutWithDeps2(options, deps = {}) {
|
|
2401
2422
|
const {
|
|
2402
|
-
resolveEnvFilePath =
|
|
2403
|
-
getFileSystem: getFs =
|
|
2404
|
-
clearBreaker =
|
|
2405
|
-
getActiveProfileFilePath =
|
|
2423
|
+
resolveEnvFilePath = resolveEnvFilePathAsync2,
|
|
2424
|
+
getFileSystem: getFs = getFileSystem2,
|
|
2425
|
+
clearBreaker = clearRefreshBreaker2,
|
|
2426
|
+
getActiveProfileFilePath = getActiveAuthProfileFilePath2
|
|
2406
2427
|
} = deps;
|
|
2407
2428
|
const fs = getFs();
|
|
2408
2429
|
const { absolutePath } = await resolveEnvFilePath(options.file ?? getActiveProfileFilePath());
|
|
@@ -2435,12 +2456,12 @@ async function logoutWithDeps(options, deps = {}) {
|
|
|
2435
2456
|
reason: "no_credentials_file"
|
|
2436
2457
|
};
|
|
2437
2458
|
}
|
|
2438
|
-
async function
|
|
2439
|
-
return
|
|
2459
|
+
async function logout2(options) {
|
|
2460
|
+
return logoutWithDeps2(options);
|
|
2440
2461
|
}
|
|
2441
2462
|
|
|
2442
2463
|
// ../auth/src/index.ts
|
|
2443
|
-
var
|
|
2464
|
+
var authenticate2 = async ({
|
|
2444
2465
|
baseUrl,
|
|
2445
2466
|
clientId,
|
|
2446
2467
|
clientSecret,
|
|
@@ -2470,7 +2491,7 @@ var authenticate = async ({
|
|
|
2470
2491
|
let effectiveRedirectUri;
|
|
2471
2492
|
if (redirectUri) {
|
|
2472
2493
|
effectiveRedirectUri = redirectUri.toString();
|
|
2473
|
-
} else if (
|
|
2494
|
+
} else if (isBrowser2()) {
|
|
2474
2495
|
const origin = getGlobalThis()?.window?.location?.origin ?? "";
|
|
2475
2496
|
effectiveRedirectUri = `${origin}/oidc/login`;
|
|
2476
2497
|
} else {
|
|
@@ -2494,11 +2515,11 @@ var authenticate = async ({
|
|
|
2494
2515
|
}
|
|
2495
2516
|
const authUrl = `${authorizationEndpoint}?${authParams.toString()}`;
|
|
2496
2517
|
let strategy;
|
|
2497
|
-
if (
|
|
2498
|
-
const { BrowserAuthStrategy } = await import("./browser-strategy-
|
|
2518
|
+
if (isBrowser2()) {
|
|
2519
|
+
const { BrowserAuthStrategy } = await import("./browser-strategy-627rrg7z.js");
|
|
2499
2520
|
strategy = new BrowserAuthStrategy;
|
|
2500
2521
|
} else {
|
|
2501
|
-
const { NodeAuthStrategy } = await import("./node-strategy-
|
|
2522
|
+
const { NodeAuthStrategy } = await import("./node-strategy-2mqzg36t.js");
|
|
2502
2523
|
strategy = new NodeAuthStrategy;
|
|
2503
2524
|
}
|
|
2504
2525
|
const code = await strategy.execute(authUrl, effectiveRedirectUriUrl, state, {
|
|
@@ -2518,6 +2539,6 @@ var authenticate = async ({
|
|
|
2518
2539
|
});
|
|
2519
2540
|
};
|
|
2520
2541
|
|
|
2521
|
-
export {
|
|
2542
|
+
export { setAuthFileConfig2, InvalidBaseUrlError2, DEFAULT_AUTH_PROFILE2, INHERITED_AUTH_PROFILE_ENV2, AuthProfileValidationError2, normalizeAuthProfileName2, setActiveAuthProfile2, clearActiveAuthProfile2, getActiveAuthProfile2, runWithAuthProfile2, resolveAuthProfileFilePath2, getActiveAuthProfileFilePath2, getAuthProfilesRootPath2, resolveAuthProfileDirPath2, listAuthProfileNamesAsync2, authProfileExistsAsync2, deleteAuthProfileAsync2, parseJWT2, parseAuthFlow2, resolveSessionIdentity2, readTokenScopes2, ENV_AUTH_ENABLE_VAR2, ENFORCE_ROBOT_AUTH_VAR2, ENV_AUTH_VARS2, EnvAuthConfigError2, isEnvAuthEnabled2, isRobotAuthEnforced2, readAuthFromEnv2, refreshTokenFingerprint2, loadRefreshBreaker2, saveRefreshBreaker2, clearRefreshBreaker2, registerRobotClientLoader2, fetchTenantsAndOrganizations2, TokenRefreshOAuthError2, isTokenRefreshOAuthFailure2, refreshAccessToken2, AUTH_FLOW_ENV_VAR2, DEFAULT_AUTH_FILENAME2, DEFAULT_ENV_FILENAME2, resolveEnvFileLocationAsync2, resolveEnvFilePathAsync2, loadEnvFileAsync2, saveEnvFileAsync2, CredentialSource2, getLoginStatusAsync2, getLoginStatusWithDeps2, AuthContextUnavailableError2, getAuthContext2, getAuthEnv2, describeAuthProfilesAsync2, ClientCredentialsAuthenticationError2, clientCredentialsLogin2, JWT_BEARER_ASSERTION_TYPE2, FederatedCredentialsAuthenticationError2, federatedCredentialsLogin2, TENANT_SELECTION_REQUIRED_CODE2, INVALID_TENANT_CODE2, TenantSelectionError2, TenantSelectionRequiredError2, InvalidTenantError2, isTenantSelectionError2, selectTenantWithDeps2, interactiveLoginWithDeps2, interactiveLogin2, logoutWithDeps2, logout2, authenticate2 };
|
|
2522
2543
|
|
|
2523
|
-
//# debugId=
|
|
2544
|
+
//# debugId=2A9B3B8B0AC5890564756E2164756E21
|