@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,322 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./packager-tool-
|
|
4
|
-
import {
|
|
5
|
-
ConnectionsApi,
|
|
6
|
-
ElementsApi,
|
|
7
|
-
createApiClient,
|
|
8
|
-
getConnectorActivityMetadataV4,
|
|
9
|
-
isV4ActivityConfiguration
|
|
10
|
-
} from "./packager-tool-wr12ndwk.js";
|
|
11
|
-
import {
|
|
12
|
-
searchWithFilters
|
|
13
|
-
} from "./packager-tool-7hw344bt.js";
|
|
2
|
+
getLoginStatusAsync2
|
|
3
|
+
} from "./packager-tool-dn9d4ywm.js";
|
|
14
4
|
import {
|
|
15
|
-
|
|
16
|
-
} from "./packager-tool-
|
|
5
|
+
getFileSystem2
|
|
6
|
+
} from "./packager-tool-z070caqq.js";
|
|
17
7
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
catchError2,
|
|
9
|
+
classifyThrownError,
|
|
10
|
+
UIPATH_HOME_DIR2,
|
|
11
|
+
hashContent
|
|
12
|
+
} from "./packager-tool-psmb758n.js";
|
|
22
13
|
import {
|
|
23
14
|
MANIFEST_FEATURE_FLAGS,
|
|
24
15
|
ManifestClient
|
|
25
|
-
} from "./packager-tool-
|
|
16
|
+
} from "./packager-tool-17b466mr.js";
|
|
26
17
|
import {
|
|
27
|
-
|
|
28
|
-
} from "./packager-tool-
|
|
18
|
+
searchWithFilters2
|
|
19
|
+
} from "./packager-tool-xb16e3tz.js";
|
|
29
20
|
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
hashContent,
|
|
33
|
-
logger
|
|
34
|
-
} from "./packager-tool-83v804p7.js";
|
|
21
|
+
listKnownSdkNodes2
|
|
22
|
+
} from "./packager-tool-v11fx4dk.js";
|
|
35
23
|
import {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const method = context.find((c) => c.name === "method")?.value ?? "POST";
|
|
47
|
-
const operation = context.find((c) => c.name === "operation")?.value;
|
|
48
|
-
if (!connectorKey || !objectName)
|
|
49
|
-
return null;
|
|
50
|
-
return { connectorKey, objectName, method, operation };
|
|
51
|
-
}
|
|
52
|
-
function applyOptionalFieldProps(compact, field) {
|
|
53
|
-
if (field.enum?.length)
|
|
54
|
-
compact.enum = field.enum;
|
|
55
|
-
if (field.reference) {
|
|
56
|
-
compact.reference = {
|
|
57
|
-
objectName: field.reference.objectName,
|
|
58
|
-
lookupValue: field.reference.lookupValue,
|
|
59
|
-
lookupNames: field.reference.lookupNames,
|
|
60
|
-
path: field.reference.path,
|
|
61
|
-
childPath: field.reference.childPath,
|
|
62
|
-
scriptRef: field.reference.scriptRef
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function extractFields(metadata, method, requestOnly) {
|
|
67
|
-
const fieldsObj = metadata?.fields ?? {};
|
|
68
|
-
const fields = Array.isArray(fieldsObj) ? fieldsObj : Object.values(fieldsObj);
|
|
69
|
-
return fields.filter((field) => {
|
|
70
|
-
const methodInfo = field.method?.[method];
|
|
71
|
-
if (!methodInfo)
|
|
72
|
-
return false;
|
|
73
|
-
return requestOnly ? methodInfo.request === true || methodInfo.requestCurated === true : methodInfo.response === true || methodInfo.responseCurated === true;
|
|
74
|
-
}).map((field) => {
|
|
75
|
-
const compact = {
|
|
76
|
-
name: field.name,
|
|
77
|
-
displayName: field.displayName,
|
|
78
|
-
type: field.type,
|
|
79
|
-
dataType: field.type,
|
|
80
|
-
required: requestOnly ? field.method?.[method]?.required === true : false,
|
|
81
|
-
description: field.description
|
|
82
|
-
};
|
|
83
|
-
if (!requestOnly)
|
|
84
|
-
compact.responseOnly = true;
|
|
85
|
-
applyOptionalFieldProps(compact, field);
|
|
86
|
-
return compact;
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
function isConnectorNode(node) {
|
|
90
|
-
const nodeType = node.nodeType;
|
|
91
|
-
return nodeType?.startsWith("uipath.connector") || false;
|
|
92
|
-
}
|
|
93
|
-
function isConnectorTriggerNode(node) {
|
|
94
|
-
const nodeType = node.nodeType;
|
|
95
|
-
return nodeType?.startsWith("uipath.connector.trigger") || false;
|
|
96
|
-
}
|
|
97
|
-
function toCompactField(field, required) {
|
|
98
|
-
const compact = {
|
|
99
|
-
name: field.name,
|
|
100
|
-
displayName: field.displayName,
|
|
101
|
-
type: field.type,
|
|
102
|
-
dataType: field.type,
|
|
103
|
-
required,
|
|
104
|
-
description: field.description
|
|
105
|
-
};
|
|
106
|
-
applyOptionalFieldProps(compact, field);
|
|
107
|
-
return compact;
|
|
108
|
-
}
|
|
109
|
-
function extractTriggerEventParameters(metadata, operationName) {
|
|
110
|
-
const fields = Object.values(metadata?.fields ?? {});
|
|
111
|
-
return fields.filter((field) => !!field.events?.[operationName]).map((field) => toCompactField(field, field.events?.[operationName]?.required === true));
|
|
112
|
-
}
|
|
113
|
-
function extractTriggerFilterFields(metadata) {
|
|
114
|
-
const fields = Object.values(metadata?.fields ?? {});
|
|
115
|
-
return fields.filter((field) => field.order === 1).map((field) => toCompactField(field, false));
|
|
116
|
-
}
|
|
117
|
-
function extractActivityFilterFields(metadata, _method) {
|
|
118
|
-
const fieldsObj = metadata?.fields ?? {};
|
|
119
|
-
const fields = Array.isArray(fieldsObj) ? fieldsObj : Object.values(fieldsObj);
|
|
120
|
-
return fields.filter((field) => field.searchable === true).map((field) => {
|
|
121
|
-
const compact = {
|
|
122
|
-
name: field.name,
|
|
123
|
-
displayName: field.displayName,
|
|
124
|
-
type: field.type,
|
|
125
|
-
dataType: field.type,
|
|
126
|
-
required: false,
|
|
127
|
-
description: field.description
|
|
128
|
-
};
|
|
129
|
-
if (field.searchableOperators?.length) {
|
|
130
|
-
compact.searchableOperators = [...field.searchableOperators];
|
|
131
|
-
}
|
|
132
|
-
if (field.searchableNames?.length) {
|
|
133
|
-
compact.searchableNames = [...field.searchableNames];
|
|
134
|
-
}
|
|
135
|
-
applyOptionalFieldProps(compact, field);
|
|
136
|
-
return compact;
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
function extractTriggerOutputFields(metadata) {
|
|
140
|
-
const fields = Object.values(metadata?.fields ?? {});
|
|
141
|
-
return fields.map((field) => {
|
|
142
|
-
const compact = toCompactField(field, false);
|
|
143
|
-
compact.responseOnly = true;
|
|
144
|
-
return compact;
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
async function fetchConnectorTriggerMetadata(connectorKey, operationName, objectName, connectionId) {
|
|
148
|
-
const api = await createApiClient(ElementsApi);
|
|
149
|
-
const triggerMetadata = await api.getInstanceEventObjectMetadata({
|
|
150
|
-
connectionOrInstanceId: connectionId,
|
|
151
|
-
elementKey: connectorKey,
|
|
152
|
-
operationName,
|
|
153
|
-
objectName,
|
|
154
|
-
allFields: true
|
|
155
|
-
});
|
|
156
|
-
return triggerMetadata;
|
|
157
|
-
}
|
|
158
|
-
function getConfigurationString(node) {
|
|
159
|
-
const modelConfig = node.model?.configuration;
|
|
160
|
-
if (modelConfig)
|
|
161
|
-
return modelConfig;
|
|
162
|
-
const form = node.form;
|
|
163
|
-
for (const section of form?.sections ?? []) {
|
|
164
|
-
for (const field of section.fields ?? []) {
|
|
165
|
-
const config = field.componentProps?.connectorDetail?.configuration;
|
|
166
|
-
if (config)
|
|
167
|
-
return config;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
function getConnectorConfiguration(node) {
|
|
173
|
-
const configStr = getConfigurationString(node);
|
|
174
|
-
if (!configStr)
|
|
175
|
-
return null;
|
|
176
|
-
const [err, parsed] = catchError(() => JSON.parse(configStr));
|
|
177
|
-
return err ? null : parsed;
|
|
178
|
-
}
|
|
179
|
-
function getConnectorInfo(node) {
|
|
180
|
-
const context = parseContext(node);
|
|
181
|
-
const config = getConnectorConfiguration(node);
|
|
182
|
-
if (!context && !config)
|
|
183
|
-
return null;
|
|
184
|
-
const connectorKey = config?.connectorKey ?? context?.connectorKey ?? "";
|
|
185
|
-
const objectName = config?.objectName ?? context?.objectName ?? "";
|
|
186
|
-
if (!connectorKey || !objectName)
|
|
187
|
-
return null;
|
|
188
|
-
return {
|
|
189
|
-
connectorKey,
|
|
190
|
-
objectName,
|
|
191
|
-
method: config?.httpMethod ?? context?.method ?? "POST",
|
|
192
|
-
activityType: config?.activityType ?? ""
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
async function fetchConnectionInfo(connectionId) {
|
|
196
|
-
const api = await createApiClient(ConnectionsApi);
|
|
197
|
-
const response = await api.apiV1ConnectionsConnectionIdGet({
|
|
198
|
-
connectionId
|
|
199
|
-
});
|
|
200
|
-
const connector = response.connector;
|
|
201
|
-
return {
|
|
202
|
-
id: response.id ?? connectionId,
|
|
203
|
-
name: response.name ?? connectionId,
|
|
204
|
-
connectorKey: connector?.key ?? "",
|
|
205
|
-
connectorName: connector?.name ?? "",
|
|
206
|
-
connectorVersion: response.elementVersion ?? null,
|
|
207
|
-
pollingInterval: response.pollingIntervalInMinutes ?? null,
|
|
208
|
-
byoaConnection: response.byoaConnection === true,
|
|
209
|
-
elementInstanceId: response.elementInstanceId ?? null,
|
|
210
|
-
folderKey: response.folder?.key ?? null
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
async function fetchConnectorMetadata(connectorKey, objectName, connectionId) {
|
|
214
|
-
const api = await createApiClient(ElementsApi);
|
|
215
|
-
if (connectionId) {
|
|
216
|
-
const response2 = await api.getInstanceObjectMetadataRaw({
|
|
217
|
-
connectionOrInstanceId: connectionId,
|
|
218
|
-
elementKey: connectorKey,
|
|
219
|
-
objectName,
|
|
220
|
-
includeParentArray: true
|
|
221
|
-
});
|
|
222
|
-
return await response2.raw.json();
|
|
223
|
-
}
|
|
224
|
-
const response = await api.getObjectMetadataRaw({
|
|
225
|
-
elementKey: connectorKey,
|
|
226
|
-
objectName,
|
|
227
|
-
includeParentArray: true
|
|
228
|
-
});
|
|
229
|
-
return await response.raw.json();
|
|
230
|
-
}
|
|
231
|
-
async function fetchConnectorActivityMetadataV4(connectorKey, objectName) {
|
|
232
|
-
return await getConnectorActivityMetadataV4(undefined, connectorKey, objectName);
|
|
233
|
-
}
|
|
234
|
-
function buildEnrichedActivityNode(node, metadata, method) {
|
|
235
|
-
const connectorMethodInfo = metadata?.metadata?.method?.[method];
|
|
236
|
-
const inputFields = extractFields(metadata, method, true);
|
|
237
|
-
const outputFields = extractFields(metadata, method, false);
|
|
238
|
-
const filterFields = extractActivityFilterFields(metadata, method);
|
|
239
|
-
return {
|
|
240
|
-
...node,
|
|
241
|
-
...connectorMethodInfo && { connectorMethodInfo },
|
|
242
|
-
inputDefinition: node.inputDefinition && Object.keys(node.inputDefinition).length > 0 ? node.inputDefinition : { fields: inputFields },
|
|
243
|
-
outputResponseDefinition: { fields: outputFields },
|
|
244
|
-
...filterFields.length > 0 && {
|
|
245
|
-
filterFields: { fields: filterFields }
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
async function enrichConnectorActivityNode(node, connectionId) {
|
|
250
|
-
const parsed = parseContext(node);
|
|
251
|
-
const config = getConnectorConfiguration(node);
|
|
252
|
-
if (isV4ActivityConfiguration(config)) {
|
|
253
|
-
return enrichV4ConnectorActivityNode(node, connectionId, config);
|
|
254
|
-
}
|
|
255
|
-
if (!parsed)
|
|
256
|
-
return node;
|
|
257
|
-
const { connectorKey, objectName, method } = parsed;
|
|
258
|
-
const [error, metadata] = await catchError(fetchConnectorMetadata(connectorKey, objectName, connectionId));
|
|
259
|
-
if (error) {
|
|
260
|
-
return node;
|
|
261
|
-
}
|
|
262
|
-
return buildEnrichedActivityNode(node, metadata, method);
|
|
263
|
-
}
|
|
264
|
-
async function enrichV4ConnectorActivityNode(node, connectionId, config) {
|
|
265
|
-
const connectorKey = config?.connectorKey;
|
|
266
|
-
const objectName = config?.objectName;
|
|
267
|
-
const method = config?.httpMethod;
|
|
268
|
-
if (!connectorKey || !objectName || !method) {
|
|
269
|
-
logger.warn("v4 IS enrichment skipped: node configuration carries no connectorKey/objectName/httpMethod.");
|
|
270
|
-
return node;
|
|
271
|
-
}
|
|
272
|
-
if (connectionId) {
|
|
273
|
-
logger.warn("v4 metadata endpoints are not connection-scoped — --connection-id is ignored for 4.0.0 enrichment.");
|
|
274
|
-
}
|
|
275
|
-
const [error, metadata] = await catchError(fetchConnectorActivityMetadataV4(connectorKey, objectName));
|
|
276
|
-
if (error) {
|
|
277
|
-
logger.warn(`IS v4 enrichment failed: ${error.message}`);
|
|
278
|
-
return node;
|
|
279
|
-
}
|
|
280
|
-
return buildEnrichedActivityNode(node, metadata, method);
|
|
281
|
-
}
|
|
282
|
-
async function enrichConnectorNode(node, connectionId) {
|
|
283
|
-
if (!isConnectorNode(node))
|
|
284
|
-
return node;
|
|
285
|
-
return isConnectorTriggerNode(node) ? enrichConnectorTriggerNode(node, connectionId) : enrichConnectorActivityNode(node, connectionId);
|
|
286
|
-
}
|
|
287
|
-
async function enrichConnectorTriggerNode(node, connectionId) {
|
|
288
|
-
if (!connectionId) {
|
|
289
|
-
throw new Error("Trigger nodes require --connection-id for IS enrichment. Provide it with --connection-id <id>.");
|
|
290
|
-
}
|
|
291
|
-
const parsed = parseContext(node);
|
|
292
|
-
if (!parsed?.operation)
|
|
293
|
-
return node;
|
|
294
|
-
const { connectorKey, objectName, operation } = parsed;
|
|
295
|
-
const metadata = await fetchConnectorTriggerMetadata(connectorKey, operation, objectName, connectionId);
|
|
296
|
-
const eventParameters = extractTriggerEventParameters(metadata, operation);
|
|
297
|
-
const filterFields = extractTriggerFilterFields(metadata);
|
|
298
|
-
const outputFields = extractTriggerOutputFields(metadata);
|
|
299
|
-
let byoaConnection = false;
|
|
300
|
-
let elementInstanceId = null;
|
|
301
|
-
if (connectionId) {
|
|
302
|
-
const [connErr, connInfo] = await catchError(fetchConnectionInfo(connectionId));
|
|
303
|
-
if (!connErr) {
|
|
304
|
-
byoaConnection = connInfo.byoaConnection;
|
|
305
|
-
elementInstanceId = connInfo.elementInstanceId;
|
|
306
|
-
} else {
|
|
307
|
-
logger.warn(`Failed to fetch connection info for ${connectionId}: ${connErr.message}`);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
return {
|
|
311
|
-
...node,
|
|
312
|
-
eventMode: metadata.eventMode,
|
|
313
|
-
byoaConnection,
|
|
314
|
-
elementInstanceId,
|
|
315
|
-
eventParameters: { fields: eventParameters },
|
|
316
|
-
filterFields: { fields: filterFields },
|
|
317
|
-
outputResponseDefinition: { fields: outputFields }
|
|
318
|
-
};
|
|
319
|
-
}
|
|
24
|
+
findSolutionFromCwd2,
|
|
25
|
+
buildInSolutionNodes2,
|
|
26
|
+
unknownContractWarning2
|
|
27
|
+
} from "./packager-tool-tgehy324.js";
|
|
28
|
+
import {
|
|
29
|
+
resolveMaestroRegistry
|
|
30
|
+
} from "./packager-tool-s12s1dp6.js";
|
|
31
|
+
import {
|
|
32
|
+
enrichConnectorNode
|
|
33
|
+
} from "./packager-tool-k0ar6cn7.js";
|
|
320
34
|
|
|
321
35
|
// ../maestro-sdk/src/registry/is-precache.ts
|
|
322
36
|
async function resolveLibraryJsonDir() {
|
|
@@ -324,15 +38,15 @@ async function resolveLibraryJsonDir() {
|
|
|
324
38
|
return snapshot?.libraryJson ?? null;
|
|
325
39
|
}
|
|
326
40
|
async function readIndex() {
|
|
327
|
-
const fs =
|
|
41
|
+
const fs = getFileSystem2();
|
|
328
42
|
const dir = await resolveLibraryJsonDir();
|
|
329
43
|
if (!dir)
|
|
330
44
|
return null;
|
|
331
45
|
const indexPath = fs.path.join(dir, "index.json");
|
|
332
|
-
const [readError, content] = await
|
|
46
|
+
const [readError, content] = await catchError2(fs.readFile(indexPath, "utf-8"));
|
|
333
47
|
if (readError || content === null)
|
|
334
48
|
return null;
|
|
335
|
-
const [parseError, parsed] =
|
|
49
|
+
const [parseError, parsed] = catchError2(() => JSON.parse(content));
|
|
336
50
|
if (parseError || !parsed || !Array.isArray(parsed.entries))
|
|
337
51
|
return null;
|
|
338
52
|
return parsed.entries;
|
|
@@ -342,15 +56,15 @@ async function listPrecacheEntries() {
|
|
|
342
56
|
return entries ?? [];
|
|
343
57
|
}
|
|
344
58
|
async function getPrecacheNode(nodeType, options) {
|
|
345
|
-
const fs =
|
|
59
|
+
const fs = getFileSystem2();
|
|
346
60
|
const dir = await resolveLibraryJsonDir();
|
|
347
61
|
if (!dir)
|
|
348
62
|
return null;
|
|
349
63
|
const indexPath = fs.path.join(dir, "index.json");
|
|
350
|
-
const [indexReadError, indexContent] = await
|
|
64
|
+
const [indexReadError, indexContent] = await catchError2(fs.readFile(indexPath, "utf-8"));
|
|
351
65
|
if (indexReadError || indexContent === null)
|
|
352
66
|
return null;
|
|
353
|
-
const [indexParseError, parsed] =
|
|
67
|
+
const [indexParseError, parsed] = catchError2(() => JSON.parse(indexContent));
|
|
354
68
|
if (indexParseError || !parsed || !Array.isArray(parsed.entries))
|
|
355
69
|
return null;
|
|
356
70
|
const lowerNodeType = nodeType.toLowerCase();
|
|
@@ -363,17 +77,17 @@ async function getPrecacheNode(nodeType, options) {
|
|
|
363
77
|
return null;
|
|
364
78
|
const entry = matches[0];
|
|
365
79
|
const v1defPath = fs.path.join(dir, entry.path.replace(/\.json$/, ".v1def.json"));
|
|
366
|
-
const [readError, content] = await
|
|
80
|
+
const [readError, content] = await catchError2(fs.readFile(v1defPath, "utf-8"));
|
|
367
81
|
if (readError || content === null)
|
|
368
82
|
return null;
|
|
369
|
-
const [parseError, manifest] =
|
|
83
|
+
const [parseError, manifest] = catchError2(() => JSON.parse(content));
|
|
370
84
|
if (parseError || !manifest)
|
|
371
85
|
return null;
|
|
372
86
|
return manifest;
|
|
373
87
|
}
|
|
374
88
|
|
|
375
89
|
// ../maestro-sdk/src/registry/node-storage.ts
|
|
376
|
-
var CACHE_FORMAT_VERSION =
|
|
90
|
+
var CACHE_FORMAT_VERSION = 7;
|
|
377
91
|
var INDEX_FILE = "index.json";
|
|
378
92
|
var METADATA_FILE = "index.meta.json";
|
|
379
93
|
var SEARCH_INDEX_FILE = "search-index.json";
|
|
@@ -388,8 +102,8 @@ function nodeCacheScope(login) {
|
|
|
388
102
|
return [baseUrl, organizationId, tenantId].join("|").toLowerCase();
|
|
389
103
|
}
|
|
390
104
|
async function resolveNodeStorageDir() {
|
|
391
|
-
const fs =
|
|
392
|
-
return fs.path.join(fs.env.homedir(),
|
|
105
|
+
const fs = getFileSystem2();
|
|
106
|
+
return fs.path.join(fs.env.homedir(), UIPATH_HOME_DIR2, "nodes");
|
|
393
107
|
}
|
|
394
108
|
function buildSearchIndex(nodes) {
|
|
395
109
|
return nodes.map((node) => ({
|
|
@@ -455,74 +169,75 @@ async function writeNodeArtifacts(fs, dir, nodes, scope, missingSources) {
|
|
|
455
169
|
await writeTempAndRename(fs, metaPath, metadataContent);
|
|
456
170
|
return nodes.length;
|
|
457
171
|
}
|
|
458
|
-
async function
|
|
459
|
-
const fs =
|
|
460
|
-
const dir = await resolveNodeStorageDir();
|
|
461
|
-
await fs.mkdir(dir);
|
|
462
|
-
const lockPath = fs.path.join(dir, WRITE_LOCK_FILE);
|
|
463
|
-
const releaseLock = await fs.acquireLock(lockPath);
|
|
464
|
-
let result;
|
|
465
|
-
let writeError;
|
|
466
|
-
try {
|
|
467
|
-
result = await writeNodeArtifacts(fs, dir, nodes, scope, missingSources);
|
|
468
|
-
} catch (error) {
|
|
469
|
-
writeError = error;
|
|
470
|
-
}
|
|
471
|
-
const [releaseError] = await catchError(releaseLock());
|
|
472
|
-
if (writeError)
|
|
473
|
-
throw writeError;
|
|
474
|
-
if (releaseError)
|
|
475
|
-
throw releaseError;
|
|
476
|
-
if (result === undefined) {
|
|
477
|
-
throw new Error("Node index write did not complete.");
|
|
478
|
-
}
|
|
479
|
-
return result;
|
|
480
|
-
}
|
|
481
|
-
async function commitNodeIndex(nodes, scope, missingSources) {
|
|
482
|
-
const fs = getFileSystem();
|
|
172
|
+
async function commitNodeIndexUnderLock(nodes, scope, missingSources, protectExistingSources = false) {
|
|
173
|
+
const fs = getFileSystem2();
|
|
483
174
|
const dir = await resolveNodeStorageDir();
|
|
484
175
|
await fs.mkdir(dir);
|
|
485
176
|
const releaseLock = await fs.acquireLock(fs.path.join(dir, WRITE_LOCK_FILE));
|
|
486
|
-
const [writeError,
|
|
177
|
+
const [writeError, result] = await catchError2((async () => {
|
|
487
178
|
const current = await loadIndexMetadata();
|
|
179
|
+
const scopedSnapshot = scope !== undefined && current?.scope === scope ? await loadScopedNodeIndex(scope) : null;
|
|
180
|
+
if (protectExistingSources && scopedSnapshot !== null) {
|
|
181
|
+
const previouslyMissing = new Set(scopedSnapshot.metadata.missingSources?.map((failure) => failure.source) ?? []);
|
|
182
|
+
const newlyMissingSources = missingSources?.filter((failure) => !previouslyMissing.has(failure.source)) ?? [];
|
|
183
|
+
if (newlyMissingSources.length > 0) {
|
|
184
|
+
return { committed: false, newlyMissingSources };
|
|
185
|
+
}
|
|
186
|
+
}
|
|
488
187
|
const hash = await hashContent(JSON.stringify(nodes));
|
|
489
|
-
if (current && current.cacheVersion === CACHE_FORMAT_VERSION && current.hash === hash && current.scope === scope && await areDerivedArtifactsCurrent()) {
|
|
188
|
+
if (current && current.cacheVersion === CACHE_FORMAT_VERSION && current.hash === hash && current.scope === scope && (scope === undefined || scopedSnapshot !== null) && await areDerivedArtifactsCurrent()) {
|
|
490
189
|
const { missingSources: _previous, ...rest } = current;
|
|
491
190
|
await writeTempAndRename(fs, fs.path.join(dir, METADATA_FILE), JSON.stringify({
|
|
492
191
|
...rest,
|
|
192
|
+
cacheVersion: CACHE_FORMAT_VERSION,
|
|
493
193
|
lastSync: Date.now(),
|
|
494
194
|
...missingSources?.length && { missingSources }
|
|
495
195
|
}));
|
|
496
|
-
return
|
|
196
|
+
return {
|
|
197
|
+
committed: true,
|
|
198
|
+
nodeCount: current.nodeCount
|
|
199
|
+
};
|
|
497
200
|
}
|
|
498
|
-
return
|
|
201
|
+
return {
|
|
202
|
+
committed: true,
|
|
203
|
+
nodeCount: await writeNodeArtifacts(fs, dir, nodes, scope, missingSources)
|
|
204
|
+
};
|
|
499
205
|
})());
|
|
500
|
-
const [releaseError] = await
|
|
206
|
+
const [releaseError] = await catchError2(releaseLock());
|
|
501
207
|
if (writeError)
|
|
502
208
|
throw writeError;
|
|
503
209
|
if (releaseError)
|
|
504
210
|
throw releaseError;
|
|
505
|
-
return
|
|
211
|
+
return result;
|
|
212
|
+
}
|
|
213
|
+
async function commitNodeIndex(nodes, scope, missingSources) {
|
|
214
|
+
const result = await commitNodeIndexUnderLock(nodes, scope, missingSources);
|
|
215
|
+
if (!result.committed)
|
|
216
|
+
throw new Error("Unexpected refused node index commit");
|
|
217
|
+
return result.nodeCount;
|
|
218
|
+
}
|
|
219
|
+
async function commitNodeIndexForReader(nodes, scope, missingSources) {
|
|
220
|
+
return commitNodeIndexUnderLock(nodes, scope, missingSources, true);
|
|
506
221
|
}
|
|
507
222
|
async function loadScopedNodeIndex(scope) {
|
|
508
223
|
const metadata = await loadIndexMetadata();
|
|
509
224
|
if (!metadata || metadata.cacheVersion !== CACHE_FORMAT_VERSION || metadata.scope !== scope) {
|
|
510
225
|
return null;
|
|
511
226
|
}
|
|
512
|
-
const fs =
|
|
227
|
+
const fs = getFileSystem2();
|
|
513
228
|
const indexPath = fs.path.join(await resolveNodeStorageDir(), INDEX_FILE);
|
|
514
|
-
const [readError, content] = await
|
|
229
|
+
const [readError, content] = await catchError2(fs.readFile(indexPath, "utf-8"));
|
|
515
230
|
if (readError || content === null)
|
|
516
231
|
return null;
|
|
517
232
|
if (await hashContent(content) !== metadata.hash)
|
|
518
233
|
return null;
|
|
519
|
-
const [parseError, nodes] =
|
|
234
|
+
const [parseError, nodes] = catchError2(() => JSON.parse(content));
|
|
520
235
|
if (parseError || !Array.isArray(nodes))
|
|
521
236
|
return null;
|
|
522
237
|
return { nodes, metadata };
|
|
523
238
|
}
|
|
524
239
|
async function loadNodeIndex() {
|
|
525
|
-
const fs =
|
|
240
|
+
const fs = getFileSystem2();
|
|
526
241
|
const dir = await resolveNodeStorageDir();
|
|
527
242
|
const indexPath = fs.path.join(dir, INDEX_FILE);
|
|
528
243
|
if (!await fs.exists(indexPath)) {
|
|
@@ -532,41 +247,31 @@ async function loadNodeIndex() {
|
|
|
532
247
|
if (!metadata || metadata.cacheVersion !== CACHE_FORMAT_VERSION) {
|
|
533
248
|
throw new Error("Node index is outdated. Please run 'uip [flow|maestro] registry pull' to sync nodes first.");
|
|
534
249
|
}
|
|
535
|
-
const [error, content] = await
|
|
250
|
+
const [error, content] = await catchError2(fs.readFile(indexPath, "utf-8"));
|
|
536
251
|
if (error) {
|
|
537
252
|
throw new Error(`Failed to load node index: ${error.message}`);
|
|
538
253
|
}
|
|
539
254
|
if (content === null) {
|
|
540
255
|
throw new Error("No node index found. Please run 'uip [flow|maestro] registry pull' to sync nodes first.");
|
|
541
256
|
}
|
|
542
|
-
const [parseError, parsed] =
|
|
257
|
+
const [parseError, parsed] = catchError2(() => JSON.parse(content));
|
|
543
258
|
if (parseError) {
|
|
544
259
|
throw new Error(`Failed to load node index: ${parseError.message}`);
|
|
545
260
|
}
|
|
546
261
|
return parsed;
|
|
547
262
|
}
|
|
548
|
-
async function saveIndexMetadata(metadata) {
|
|
549
|
-
const fs = getFileSystem();
|
|
550
|
-
const dir = await resolveNodeStorageDir();
|
|
551
|
-
await fs.mkdir(dir);
|
|
552
|
-
const metaPath = fs.path.join(dir, METADATA_FILE);
|
|
553
|
-
await fs.writeFile(metaPath, JSON.stringify({
|
|
554
|
-
...metadata,
|
|
555
|
-
cacheVersion: metadata.cacheVersion ?? CACHE_FORMAT_VERSION
|
|
556
|
-
}));
|
|
557
|
-
}
|
|
558
263
|
async function loadIndexMetadata() {
|
|
559
|
-
const fs =
|
|
264
|
+
const fs = getFileSystem2();
|
|
560
265
|
const dir = await resolveNodeStorageDir();
|
|
561
266
|
const metaPath = fs.path.join(dir, METADATA_FILE);
|
|
562
267
|
if (!await fs.exists(metaPath)) {
|
|
563
268
|
return null;
|
|
564
269
|
}
|
|
565
|
-
const [error, content] = await
|
|
270
|
+
const [error, content] = await catchError2(fs.readFile(metaPath, "utf-8"));
|
|
566
271
|
if (error || content === null) {
|
|
567
272
|
return null;
|
|
568
273
|
}
|
|
569
|
-
const [parseError, parsed] =
|
|
274
|
+
const [parseError, parsed] = catchError2(() => JSON.parse(content));
|
|
570
275
|
if (parseError || parsed === null) {
|
|
571
276
|
return null;
|
|
572
277
|
}
|
|
@@ -578,36 +283,42 @@ function isDerivedArtifact(value) {
|
|
|
578
283
|
const artifact = value;
|
|
579
284
|
return typeof artifact.cacheVersion === "number" && typeof artifact.sourceHash === "string" && typeof artifact.generatedAt === "number" && Array.isArray(artifact.nodes);
|
|
580
285
|
}
|
|
581
|
-
async function loadValidDerivedArtifact(fileName) {
|
|
582
|
-
const fs =
|
|
286
|
+
async function loadValidDerivedArtifact(fileName, scope) {
|
|
287
|
+
const fs = getFileSystem2();
|
|
583
288
|
const dir = await resolveNodeStorageDir();
|
|
584
289
|
const indexPath = fs.path.join(dir, INDEX_FILE);
|
|
585
290
|
if (!await fs.exists(indexPath)) {
|
|
586
291
|
return null;
|
|
587
292
|
}
|
|
588
293
|
const metadata = await loadIndexMetadata();
|
|
589
|
-
if (!metadata || metadata.cacheVersion !== CACHE_FORMAT_VERSION || typeof metadata.hash !== "string") {
|
|
294
|
+
if (!metadata || metadata.cacheVersion !== CACHE_FORMAT_VERSION || typeof metadata.hash !== "string" || scope !== undefined && metadata.scope !== scope) {
|
|
590
295
|
return null;
|
|
591
296
|
}
|
|
592
297
|
const artifactPath = fs.path.join(dir, fileName);
|
|
593
|
-
const [readError, content] = await
|
|
298
|
+
const [readError, content] = await catchError2(fs.readFile(artifactPath, "utf-8"));
|
|
594
299
|
if (readError || content === null) {
|
|
595
300
|
return null;
|
|
596
301
|
}
|
|
597
|
-
const [parseError, parsed] =
|
|
302
|
+
const [parseError, parsed] = catchError2(() => JSON.parse(content));
|
|
598
303
|
if (parseError || !isDerivedArtifact(parsed)) {
|
|
599
304
|
return null;
|
|
600
305
|
}
|
|
601
306
|
if (parsed.cacheVersion !== CACHE_FORMAT_VERSION || parsed.sourceHash !== metadata.hash) {
|
|
602
307
|
return null;
|
|
603
308
|
}
|
|
604
|
-
return parsed.nodes;
|
|
309
|
+
return { nodes: parsed.nodes, metadata };
|
|
605
310
|
}
|
|
606
311
|
async function loadValidSearchIndex() {
|
|
607
|
-
return loadValidDerivedArtifact(SEARCH_INDEX_FILE);
|
|
312
|
+
return (await loadValidDerivedArtifact(SEARCH_INDEX_FILE))?.nodes ?? null;
|
|
608
313
|
}
|
|
609
314
|
async function loadValidEssentialsIndex() {
|
|
610
|
-
return loadValidDerivedArtifact(ESSENTIALS_INDEX_FILE);
|
|
315
|
+
return (await loadValidDerivedArtifact(ESSENTIALS_INDEX_FILE))?.nodes ?? null;
|
|
316
|
+
}
|
|
317
|
+
async function loadScopedSearchIndex(scope) {
|
|
318
|
+
return loadValidDerivedArtifact(SEARCH_INDEX_FILE, scope);
|
|
319
|
+
}
|
|
320
|
+
async function loadScopedEssentialsIndex(scope) {
|
|
321
|
+
return loadValidDerivedArtifact(ESSENTIALS_INDEX_FILE, scope);
|
|
611
322
|
}
|
|
612
323
|
async function areDerivedArtifactsCurrent() {
|
|
613
324
|
const searchIndex = await loadValidSearchIndex();
|
|
@@ -617,11 +328,11 @@ async function areDerivedArtifactsCurrent() {
|
|
|
617
328
|
return essentialsIndex !== null;
|
|
618
329
|
}
|
|
619
330
|
async function rederiveNodeIndexArtifacts() {
|
|
620
|
-
const fs =
|
|
331
|
+
const fs = getFileSystem2();
|
|
621
332
|
const dir = await resolveNodeStorageDir();
|
|
622
333
|
await fs.mkdir(dir);
|
|
623
334
|
const releaseLock = await fs.acquireLock(fs.path.join(dir, WRITE_LOCK_FILE));
|
|
624
|
-
const [rederiveError, count] = await
|
|
335
|
+
const [rederiveError, count] = await catchError2((async () => {
|
|
625
336
|
const nodes = await loadNodeIndex();
|
|
626
337
|
const metadata = await loadIndexMetadata();
|
|
627
338
|
const hash = await hashContent(JSON.stringify(nodes));
|
|
@@ -629,7 +340,7 @@ async function rederiveNodeIndexArtifacts() {
|
|
|
629
340
|
const scope = sameNodes ? metadata.scope : undefined;
|
|
630
341
|
return writeNodeArtifacts(fs, dir, nodes, scope, sameNodes ? metadata.missingSources : undefined);
|
|
631
342
|
})());
|
|
632
|
-
const [releaseError] = await
|
|
343
|
+
const [releaseError] = await catchError2(releaseLock());
|
|
633
344
|
if (rederiveError)
|
|
634
345
|
throw rederiveError;
|
|
635
346
|
if (releaseError)
|
|
@@ -639,21 +350,62 @@ async function rederiveNodeIndexArtifacts() {
|
|
|
639
350
|
|
|
640
351
|
// ../maestro-sdk/src/registry/node-sync-service.ts
|
|
641
352
|
var MANIFEST_VALIDATION_SOURCE = "manifest validation";
|
|
642
|
-
var
|
|
353
|
+
var MANIFEST_VALIDATION_NEXT_STEP2 = "Fix or remove the tenant resource named in the validation error, then run 'registry pull' again.";
|
|
643
354
|
var TENANT_MANIFEST_INVALID = "TenantManifestInvalid";
|
|
644
355
|
|
|
645
|
-
class
|
|
356
|
+
class TenantManifestInvalidError2 extends Error {
|
|
646
357
|
code = TENANT_MANIFEST_INVALID;
|
|
647
358
|
ootbNodes;
|
|
648
359
|
constructor(failures, ootbNodes = []) {
|
|
649
|
-
super(`The tenant manifest failed validation, so only OOTB nodes are available (${failures.map((f) => `${f.source}: ${f.reason}`).join("; ")}). ${
|
|
360
|
+
super(`The tenant manifest failed validation, so only OOTB nodes are available (${failures.map((f) => `${f.source}: ${f.reason}`).join("; ")}). ${MANIFEST_VALIDATION_NEXT_STEP2}`);
|
|
650
361
|
this.name = "TenantManifestInvalidError";
|
|
651
362
|
this.ootbNodes = ootbNodes;
|
|
652
363
|
}
|
|
653
364
|
}
|
|
654
|
-
function
|
|
365
|
+
function isTenantManifestInvalidError2(error) {
|
|
655
366
|
return error instanceof Error && error.code === TENANT_MANIFEST_INVALID;
|
|
656
367
|
}
|
|
368
|
+
var TENANT_MANIFEST_UNAVAILABLE = "TenantManifestUnavailable";
|
|
369
|
+
|
|
370
|
+
class PartialNodeSourcesError extends Error {
|
|
371
|
+
errorCode;
|
|
372
|
+
retry;
|
|
373
|
+
constructor(failures) {
|
|
374
|
+
super(`Unavailable node sources: ${failures.map((failure) => `${failure.source}: ${failure.reason}`).join("; ")}`);
|
|
375
|
+
this.name = "PartialNodeSourcesError";
|
|
376
|
+
this.errorCode = failures.some((failure) => /(?:\bHTTP\s+|\bfetch failed:\s*)401\b/i.test(failure.reason)) ? "authentication_required" : failures.some((failure) => /(?:\bHTTP\s+|\bfetch failed:\s*)403\b/i.test(failure.reason)) ? "permission_denied" : undefined;
|
|
377
|
+
this.retry = this.errorCode ? "RetryWillNotFix" : "RetryLater";
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
class TenantManifestUnavailableError2 extends Error {
|
|
382
|
+
code = TENANT_MANIFEST_UNAVAILABLE;
|
|
383
|
+
errorCode;
|
|
384
|
+
retry;
|
|
385
|
+
ootbNodes;
|
|
386
|
+
constructor(cause, ootbNodes = []) {
|
|
387
|
+
const inferred = classifyThrownError(cause);
|
|
388
|
+
const nextStep = inferred.errorCode === "authentication_required" ? "Run 'uip login', then run the command again." : inferred.errorCode === "permission_denied" ? "Ask for access to the missing node sources, then run the command again." : "Check your connection and run the command again; if your session expired, run 'uip login' first.";
|
|
389
|
+
const partialCacheStep = cause instanceof PartialNodeSourcesError ? " If this persists, run 'uip maestro flow registry pull --force' to cache the nodes that are available." : "";
|
|
390
|
+
super(`Could not refresh this tenant's nodes (${describeFailureReason(cause)}), so only OOTB nodes are available. ${nextStep}${partialCacheStep}`, { cause });
|
|
391
|
+
this.name = "TenantManifestUnavailableError";
|
|
392
|
+
this.ootbNodes = ootbNodes;
|
|
393
|
+
this.errorCode = inferred.errorCode;
|
|
394
|
+
this.retry = inferred.errorCode === "unknown_error" ? "RetryLater" : inferred.retry;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
function isTenantManifestUnavailableError2(error) {
|
|
398
|
+
return error instanceof Error && error.code === TENANT_MANIFEST_UNAVAILABLE;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
class SessionExpiredError extends Error {
|
|
402
|
+
errorCode = "authentication_required";
|
|
403
|
+
retry = "RetryWillNotFix";
|
|
404
|
+
constructor(loginStatus) {
|
|
405
|
+
super(loginStatus === "Refresh Failed" ? "your session could not be refreshed" : "your session expired");
|
|
406
|
+
this.name = "SessionExpiredError";
|
|
407
|
+
}
|
|
408
|
+
}
|
|
657
409
|
var MAX_FAILURE_REASON_LENGTH = 500;
|
|
658
410
|
function stringifyReason(reason) {
|
|
659
411
|
if (reason instanceof Error)
|
|
@@ -677,6 +429,10 @@ function toPullFailures(failures) {
|
|
|
677
429
|
}));
|
|
678
430
|
}
|
|
679
431
|
var CACHE_EXPIRATION = 30 * 60 * 1000;
|
|
432
|
+
async function readLoginStatus() {
|
|
433
|
+
const [loginError, loginStatus] = await catchError2(getLoginStatusAsync2());
|
|
434
|
+
return loginError ? { loginStatus: "Not logged in" } : loginStatus;
|
|
435
|
+
}
|
|
680
436
|
function loginScope(loginStatus) {
|
|
681
437
|
if (loginStatus.loginStatus !== "Logged in" || !loginStatus.accessToken) {
|
|
682
438
|
return;
|
|
@@ -689,20 +445,20 @@ function isFreshFor(meta, scope) {
|
|
|
689
445
|
function isMissingIndexError(error) {
|
|
690
446
|
return error.message.includes("No node index found") || error.message.includes("Node index is outdated");
|
|
691
447
|
}
|
|
692
|
-
async function
|
|
448
|
+
async function pullNodes2(options = {}) {
|
|
693
449
|
const { force = false } = options;
|
|
694
|
-
const loginStatus = await
|
|
450
|
+
const loginStatus = await getLoginStatusAsync2();
|
|
695
451
|
if (force) {
|
|
696
|
-
const
|
|
697
|
-
const
|
|
452
|
+
const refreshResult = await refreshNodes(loginStatus);
|
|
453
|
+
const meta = await loadIndexMetadata();
|
|
698
454
|
return {
|
|
699
|
-
syncedCount:
|
|
455
|
+
syncedCount: refreshResult.nodeCount || meta?.nodeCount || 0,
|
|
700
456
|
fromCache: false,
|
|
701
|
-
source:
|
|
702
|
-
cacheWritten:
|
|
703
|
-
info:
|
|
704
|
-
failures:
|
|
705
|
-
missingSources:
|
|
457
|
+
source: refreshResult.source,
|
|
458
|
+
cacheWritten: refreshResult.cacheWritten,
|
|
459
|
+
info: refreshResult.info,
|
|
460
|
+
failures: refreshResult.failures,
|
|
461
|
+
missingSources: refreshResult.missingSources
|
|
706
462
|
};
|
|
707
463
|
}
|
|
708
464
|
const meta = await loadIndexMetadata();
|
|
@@ -713,7 +469,7 @@ async function pullNodes(options = {}) {
|
|
|
713
469
|
if (isFreshFor(meta, scope)) {
|
|
714
470
|
let syncedCount = meta.nodeCount;
|
|
715
471
|
if (!await areDerivedArtifactsCurrent()) {
|
|
716
|
-
const [rederiveError, nodeCount] = await
|
|
472
|
+
const [rederiveError, nodeCount] = await catchError2(rederiveNodeIndexArtifacts());
|
|
717
473
|
if (rederiveError) {
|
|
718
474
|
if (!isMissingIndexError(rederiveError)) {
|
|
719
475
|
throw rederiveError;
|
|
@@ -747,7 +503,7 @@ async function pullNodes(options = {}) {
|
|
|
747
503
|
};
|
|
748
504
|
}
|
|
749
505
|
async function refreshNodes(loginStatus) {
|
|
750
|
-
const pullResult = await
|
|
506
|
+
const pullResult = await pullRemoteNodes2(loginStatus);
|
|
751
507
|
if (!pullResult.cacheable) {
|
|
752
508
|
return {
|
|
753
509
|
cacheWritten: false,
|
|
@@ -766,30 +522,37 @@ async function refreshNodes(loginStatus) {
|
|
|
766
522
|
};
|
|
767
523
|
}
|
|
768
524
|
var ENABLED_MANIFEST_FLAGS = new Set([
|
|
769
|
-
MANIFEST_FEATURE_FLAGS.CONNECTOR_NODES,
|
|
770
525
|
MANIFEST_FEATURE_FLAGS.EXTRACT_DOCUMENT,
|
|
771
|
-
MANIFEST_FEATURE_FLAGS.HITL,
|
|
772
|
-
MANIFEST_FEATURE_FLAGS.LOOP_CONTAINER,
|
|
773
|
-
MANIFEST_FEATURE_FLAGS.BATCH_TRANSFORM,
|
|
774
|
-
MANIFEST_FEATURE_FLAGS.SUMMARIZE,
|
|
775
526
|
MANIFEST_FEATURE_FLAGS.CONVERSATION_TRIGGER,
|
|
776
527
|
MANIFEST_FEATURE_FLAGS.CONVERSATIONAL_WAIT_FOR_MESSAGE,
|
|
777
528
|
MANIFEST_FEATURE_FLAGS.CONVERSATIONAL_SEND_MESSAGE,
|
|
778
529
|
MANIFEST_FEATURE_FLAGS.CONVERSATIONAL_GET_CONVERSATION_CONTEXT,
|
|
779
|
-
MANIFEST_FEATURE_FLAGS.CONVERSATIONAL_VOICE_INCOMING_CALL_TRIGGER,
|
|
780
|
-
MANIFEST_FEATURE_FLAGS.CONVERSATIONAL_VOICE_CREATE_OUTGOING_CALL,
|
|
781
|
-
MANIFEST_FEATURE_FLAGS.CONVERSATIONAL_VOICE_END_CALL,
|
|
782
530
|
MANIFEST_FEATURE_FLAGS.READ_ENTITY,
|
|
783
531
|
MANIFEST_FEATURE_FLAGS.CREATE_ENTITY,
|
|
784
532
|
MANIFEST_FEATURE_FLAGS.UPDATE_ENTITY,
|
|
785
|
-
MANIFEST_FEATURE_FLAGS.DELETE_ENTITY
|
|
533
|
+
MANIFEST_FEATURE_FLAGS.DELETE_ENTITY,
|
|
534
|
+
MANIFEST_FEATURE_FLAGS.READ_FILE,
|
|
535
|
+
MANIFEST_FEATURE_FLAGS.CREATE_FILE
|
|
786
536
|
]);
|
|
787
|
-
async function
|
|
788
|
-
loginStatus ??= await
|
|
537
|
+
async function pullRemoteNodes2(loginStatus) {
|
|
538
|
+
loginStatus ??= await getLoginStatusAsync2();
|
|
789
539
|
const client = new ManifestClient({
|
|
790
540
|
baseUrl: loginStatus.baseUrl || "localhost",
|
|
791
541
|
getFeatureFlag: (flag) => ENABLED_MANIFEST_FLAGS.has(flag)
|
|
792
542
|
});
|
|
543
|
+
if (loginStatus.loginStatus === "Expired" || loginStatus.loginStatus === "Refresh Failed") {
|
|
544
|
+
const sessionError = new SessionExpiredError(loginStatus.loginStatus);
|
|
545
|
+
const manifest = await client.getManifest({
|
|
546
|
+
inlineAgentNodes: true
|
|
547
|
+
});
|
|
548
|
+
return {
|
|
549
|
+
nodes: manifest.nodes || [],
|
|
550
|
+
source: "ootb",
|
|
551
|
+
cacheable: false,
|
|
552
|
+
info: `Using OOTB nodes because ${sessionError.message}. Run 'uip login' to get this tenant's nodes. Cache was not updated.`,
|
|
553
|
+
refreshError: sessionError
|
|
554
|
+
};
|
|
555
|
+
}
|
|
793
556
|
if (loginStatus.loginStatus !== "Logged in" || !loginStatus.baseUrl || !loginStatus.accessToken || !loginStatus.tenantId || !loginStatus.organizationId) {
|
|
794
557
|
const manifest = await client.getManifest({
|
|
795
558
|
inlineAgentNodes: true
|
|
@@ -806,7 +569,7 @@ async function pullRemoteNodes(loginStatus) {
|
|
|
806
569
|
tenantId: loginStatus.tenantId,
|
|
807
570
|
organizationId: loginStatus.organizationId
|
|
808
571
|
};
|
|
809
|
-
const [manifestError, diagnostics] = await
|
|
572
|
+
const [manifestError, diagnostics] = await catchError2(client.getManifestWithDiagnostics({
|
|
810
573
|
auth: authContext,
|
|
811
574
|
includeIntegrationTriggers: true,
|
|
812
575
|
inlineAgentNodes: true,
|
|
@@ -849,62 +612,87 @@ async function pullRemoteNodes(loginStatus) {
|
|
|
849
612
|
nodes: fallbackManifest.nodes || [],
|
|
850
613
|
source: "ootb",
|
|
851
614
|
cacheable: false,
|
|
852
|
-
info: `Failed to refresh authenticated nodes with error: ${manifestError}. Using OOTB nodes without updating cache
|
|
615
|
+
info: `Failed to refresh authenticated nodes with error: ${manifestError}. Using OOTB nodes without updating cache.`,
|
|
616
|
+
refreshError: manifestError
|
|
853
617
|
};
|
|
854
618
|
}
|
|
855
619
|
async function getNodesWithCacheFallback() {
|
|
856
|
-
const
|
|
857
|
-
if (
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
if (pullResult.failures?.length) {
|
|
863
|
-
throw new TenantManifestInvalidError(pullResult.failures, pullResult.nodes);
|
|
864
|
-
}
|
|
865
|
-
if (pullResult.cacheable) {
|
|
866
|
-
await saveNodeIndex(pullResult.nodes, pullResult.scope, pullResult.missingSources);
|
|
867
|
-
}
|
|
868
|
-
return pullResult.nodes;
|
|
620
|
+
const { nodes, failures, refreshError } = await loadCurrentTenantNodes2();
|
|
621
|
+
if (failures?.length) {
|
|
622
|
+
throw new TenantManifestInvalidError2(failures, nodes);
|
|
623
|
+
}
|
|
624
|
+
if (refreshError) {
|
|
625
|
+
throw new TenantManifestUnavailableError2(refreshError, nodes);
|
|
869
626
|
}
|
|
870
627
|
return nodes;
|
|
871
628
|
}
|
|
872
|
-
async function
|
|
873
|
-
const
|
|
874
|
-
|
|
629
|
+
async function loadFreshDerivedIndex(load) {
|
|
630
|
+
const scope = loginScope(await readLoginStatus());
|
|
631
|
+
if (scope === undefined)
|
|
632
|
+
return null;
|
|
633
|
+
const [, cached] = await catchError2(load(scope));
|
|
634
|
+
return cached && isFreshFor(cached.metadata, scope) ? cached.nodes : null;
|
|
635
|
+
}
|
|
636
|
+
async function loadCurrentTenantNodes2(options = {}) {
|
|
637
|
+
const loginStatus = await readLoginStatus();
|
|
875
638
|
const scope = loginScope(loginStatus);
|
|
876
|
-
if (
|
|
877
|
-
const [,
|
|
878
|
-
if (
|
|
879
|
-
return { nodes:
|
|
639
|
+
if (scope !== undefined) {
|
|
640
|
+
const [, scoped] = await catchError2(loadScopedNodeIndex(scope));
|
|
641
|
+
if (!options.force && scoped && isFreshFor(scoped.metadata, scope)) {
|
|
642
|
+
return { nodes: scoped.nodes, fromCache: true, source: "cache" };
|
|
880
643
|
}
|
|
881
644
|
}
|
|
882
|
-
const pullResult = await
|
|
645
|
+
const pullResult = await pullRemoteNodes2(loginStatus);
|
|
883
646
|
if (pullResult.cacheable) {
|
|
884
|
-
await
|
|
647
|
+
const [commitError, commit] = await catchError2(commitNodeIndexForReader(pullResult.nodes, pullResult.scope, pullResult.missingSources));
|
|
648
|
+
const unavailableSources = commit && !commit.committed ? commit.newlyMissingSources : commitError ? pullResult.missingSources : undefined;
|
|
649
|
+
if (unavailableSources?.length) {
|
|
650
|
+
if (commit && !commit.committed && scope !== undefined) {
|
|
651
|
+
const [, latest] = await catchError2(loadScopedNodeIndex(scope));
|
|
652
|
+
if (latest && isFreshFor(latest.metadata, scope) && !latest.metadata.missingSources?.length) {
|
|
653
|
+
return {
|
|
654
|
+
nodes: latest.nodes,
|
|
655
|
+
fromCache: true,
|
|
656
|
+
source: "cache"
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
const fallback = await pullRemoteNodes2({
|
|
661
|
+
loginStatus: "Not logged in"
|
|
662
|
+
});
|
|
663
|
+
const refreshError = new PartialNodeSourcesError(unavailableSources);
|
|
664
|
+
return {
|
|
665
|
+
nodes: fallback.nodes,
|
|
666
|
+
fromCache: false,
|
|
667
|
+
source: "ootb",
|
|
668
|
+
refreshError
|
|
669
|
+
};
|
|
670
|
+
}
|
|
885
671
|
}
|
|
886
672
|
return {
|
|
887
673
|
nodes: pullResult.nodes,
|
|
888
674
|
fromCache: false,
|
|
889
675
|
source: pullResult.source,
|
|
890
|
-
info: pullResult.info
|
|
676
|
+
info: pullResult.info,
|
|
677
|
+
failures: pullResult.failures,
|
|
678
|
+
refreshError: pullResult.refreshError
|
|
891
679
|
};
|
|
892
680
|
}
|
|
893
|
-
async function
|
|
894
|
-
const ctx = await
|
|
681
|
+
async function getLocalSolutionSnapshot2() {
|
|
682
|
+
const ctx = await findSolutionFromCwd2();
|
|
895
683
|
if (!ctx) {
|
|
896
684
|
throw new Error("No .uipx solution file found in current directory, its parent, or its grandparent. " + "Run this command from inside a solution project directory.");
|
|
897
685
|
}
|
|
898
|
-
return
|
|
686
|
+
return buildInSolutionNodes2(ctx);
|
|
899
687
|
}
|
|
900
688
|
async function getLocalSolutionNodes() {
|
|
901
|
-
return (await
|
|
689
|
+
return (await getLocalSolutionSnapshot2()).manifests;
|
|
902
690
|
}
|
|
903
|
-
function
|
|
691
|
+
function localContractWarning2(snapshot, shown) {
|
|
904
692
|
const types = new Set(shown.map((n) => n.nodeType).filter((t) => typeof t === "string").map((t) => t.toLowerCase()));
|
|
905
|
-
return
|
|
693
|
+
return unknownContractWarning2(snapshot.unknownContracts.filter((p) => p.nodeTypes.some((t) => types.has(t.toLowerCase()))));
|
|
906
694
|
}
|
|
907
|
-
function
|
|
695
|
+
function filterNodesByKeyword2(nodes, keyword) {
|
|
908
696
|
const lowerKeyword = keyword.toLowerCase();
|
|
909
697
|
return nodes.filter((node) => {
|
|
910
698
|
if (node.nodeType?.toLowerCase().includes(lowerKeyword)) {
|
|
@@ -928,11 +716,11 @@ function filterNodesByKeyword(nodes, keyword) {
|
|
|
928
716
|
return false;
|
|
929
717
|
});
|
|
930
718
|
}
|
|
931
|
-
function
|
|
719
|
+
function findNodeByType2(nodes, nodeType) {
|
|
932
720
|
const lowerNodeType = nodeType.toLowerCase();
|
|
933
721
|
return nodes.find((node) => node.nodeType?.toLowerCase() === lowerNodeType) ?? null;
|
|
934
722
|
}
|
|
935
|
-
async function
|
|
723
|
+
async function listNodes2(options) {
|
|
936
724
|
if (options?.local)
|
|
937
725
|
return getLocalSolutionNodes();
|
|
938
726
|
const precacheEntries = await listPrecacheEntries();
|
|
@@ -977,7 +765,7 @@ function unionWithKnownSdkNodes(tenantNodes) {
|
|
|
977
765
|
}
|
|
978
766
|
result.push(node);
|
|
979
767
|
}
|
|
980
|
-
for (const known of
|
|
768
|
+
for (const known of listKnownSdkNodes2()) {
|
|
981
769
|
const type = typeof known.nodeType === "string" ? known.nodeType.toLowerCase() : null;
|
|
982
770
|
if (type === null || seen.has(type))
|
|
983
771
|
continue;
|
|
@@ -987,34 +775,16 @@ function unionWithKnownSdkNodes(tenantNodes) {
|
|
|
987
775
|
return result;
|
|
988
776
|
}
|
|
989
777
|
async function loadSearchSummariesWithCacheFallback() {
|
|
990
|
-
|
|
991
|
-
if (validSearchIndex)
|
|
992
|
-
return validSearchIndex;
|
|
993
|
-
const [repairError] = await catchError(rederiveNodeIndexArtifacts());
|
|
994
|
-
if (!repairError) {
|
|
995
|
-
const repairedSearchIndex = await loadValidSearchIndex();
|
|
996
|
-
if (repairedSearchIndex)
|
|
997
|
-
return repairedSearchIndex;
|
|
998
|
-
}
|
|
999
|
-
return buildSearchIndex(await getNodesWithCacheFallback());
|
|
1000
|
-
}
|
|
1001
|
-
async function loadEssentialsIndexWithRepair() {
|
|
1002
|
-
const validEssentialsIndex = await loadValidEssentialsIndex();
|
|
1003
|
-
if (validEssentialsIndex)
|
|
1004
|
-
return validEssentialsIndex;
|
|
1005
|
-
const [repairError] = await catchError(rederiveNodeIndexArtifacts());
|
|
1006
|
-
if (repairError)
|
|
1007
|
-
return null;
|
|
1008
|
-
return loadValidEssentialsIndex();
|
|
778
|
+
return await loadFreshDerivedIndex(loadScopedSearchIndex) ?? buildSearchIndex(await getNodesWithCacheFallback());
|
|
1009
779
|
}
|
|
1010
|
-
async function
|
|
780
|
+
async function searchNodeSummariesWithAvailability2(keyword, filters) {
|
|
1011
781
|
const tenantNodes = await loadSearchSummariesWithCacheFallback();
|
|
1012
782
|
const tenantTypes = new Set(tenantNodes.map((node) => node.nodeType?.toLowerCase()).filter((type) => typeof type === "string"));
|
|
1013
783
|
const merged = tenantNodes.map((node) => ({
|
|
1014
784
|
node,
|
|
1015
785
|
availableOnTenant: true
|
|
1016
786
|
}));
|
|
1017
|
-
for (const knownNode of
|
|
787
|
+
for (const knownNode of listKnownSdkNodes2()) {
|
|
1018
788
|
const type = knownNode.nodeType?.toLowerCase();
|
|
1019
789
|
if (typeof type !== "string" || tenantTypes.has(type))
|
|
1020
790
|
continue;
|
|
@@ -1028,12 +798,12 @@ async function searchNodeSummariesWithAvailability(keyword, filters) {
|
|
|
1028
798
|
entry.node.nodeType.toLowerCase(),
|
|
1029
799
|
entry.availableOnTenant
|
|
1030
800
|
] : null).filter((entry) => entry !== null));
|
|
1031
|
-
return
|
|
801
|
+
return searchWithFilters2(merged.map((entry) => entry.node), keyword, filters).map((node) => ({
|
|
1032
802
|
node,
|
|
1033
803
|
availableOnTenant: typeof node.nodeType === "string" ? availabilityByType.get(node.nodeType.toLowerCase()) ?? true : true
|
|
1034
804
|
}));
|
|
1035
805
|
}
|
|
1036
|
-
async function
|
|
806
|
+
async function searchNodes2(keyword, options) {
|
|
1037
807
|
let nodes;
|
|
1038
808
|
if (options?.local) {
|
|
1039
809
|
nodes = await getLocalSolutionNodes();
|
|
@@ -1041,9 +811,9 @@ async function searchNodes(keyword, options) {
|
|
|
1041
811
|
const tenantNodes = await getNodesWithCacheFallback();
|
|
1042
812
|
nodes = unionWithKnownSdkNodes(tenantNodes);
|
|
1043
813
|
}
|
|
1044
|
-
return
|
|
814
|
+
return filterNodesByKeyword2(nodes, keyword);
|
|
1045
815
|
}
|
|
1046
|
-
async function
|
|
816
|
+
async function getNode2(nodeType, options) {
|
|
1047
817
|
const lowerNodeType = nodeType.toLowerCase();
|
|
1048
818
|
if (!options?.local && lowerNodeType.startsWith("uipath.connector.")) {
|
|
1049
819
|
const precached = await getPrecacheNode(nodeType);
|
|
@@ -1051,43 +821,43 @@ async function getNode(nodeType, options) {
|
|
|
1051
821
|
return precached;
|
|
1052
822
|
}
|
|
1053
823
|
if (!options?.local && isEssentialNodeType(nodeType)) {
|
|
1054
|
-
const essentials = await
|
|
1055
|
-
const node = essentials?.find((
|
|
824
|
+
const essentials = await loadFreshDerivedIndex(loadScopedEssentialsIndex);
|
|
825
|
+
const node = essentials?.find((node) => node.nodeType?.toLowerCase() === lowerNodeType) ?? null;
|
|
1056
826
|
if (node)
|
|
1057
827
|
return node;
|
|
1058
828
|
}
|
|
1059
829
|
if (options?.local) {
|
|
1060
|
-
return
|
|
830
|
+
return findNodeByType2(await getLocalSolutionNodes(), nodeType);
|
|
1061
831
|
}
|
|
1062
|
-
const [error, nodes] = await
|
|
832
|
+
const [error, nodes] = await catchError2(getNodesWithCacheFallback());
|
|
1063
833
|
if (error) {
|
|
1064
|
-
if (error instanceof
|
|
1065
|
-
const ootbNode =
|
|
834
|
+
if (error instanceof TenantManifestInvalidError2 || error instanceof TenantManifestUnavailableError2) {
|
|
835
|
+
const ootbNode = findNodeByType2(error.ootbNodes, nodeType);
|
|
1066
836
|
if (ootbNode)
|
|
1067
837
|
return ootbNode;
|
|
1068
838
|
}
|
|
1069
839
|
throw error;
|
|
1070
840
|
}
|
|
1071
|
-
return
|
|
841
|
+
return findNodeByType2(nodes, nodeType);
|
|
1072
842
|
}
|
|
1073
|
-
async function
|
|
1074
|
-
const node = await
|
|
843
|
+
async function getNodeEnriched2(nodeType, connectionId, options) {
|
|
844
|
+
const node = await getNode2(nodeType, options);
|
|
1075
845
|
if (!node) {
|
|
1076
846
|
return null;
|
|
1077
847
|
}
|
|
1078
848
|
return await enrichConnectorNode(node, connectionId);
|
|
1079
849
|
}
|
|
1080
|
-
async function
|
|
1081
|
-
const snapshot = await
|
|
1082
|
-
const node =
|
|
850
|
+
async function getLocalNodeEnriched2(nodeType, connectionId) {
|
|
851
|
+
const snapshot = await getLocalSolutionSnapshot2();
|
|
852
|
+
const node = findNodeByType2(snapshot.manifests, nodeType);
|
|
1083
853
|
if (!node)
|
|
1084
854
|
return { node: null };
|
|
1085
855
|
return {
|
|
1086
856
|
node: await enrichConnectorNode(node, connectionId),
|
|
1087
|
-
warning:
|
|
857
|
+
warning: localContractWarning2(snapshot, [node])
|
|
1088
858
|
};
|
|
1089
859
|
}
|
|
1090
|
-
async function
|
|
860
|
+
async function searchNodesWithFilters2(keyword, filters, options) {
|
|
1091
861
|
let nodes;
|
|
1092
862
|
if (options?.local) {
|
|
1093
863
|
nodes = await getLocalSolutionNodes();
|
|
@@ -1095,9 +865,9 @@ async function searchNodesWithFilters(keyword, filters, options) {
|
|
|
1095
865
|
const tenantNodes = await getNodesWithCacheFallback();
|
|
1096
866
|
nodes = unionWithKnownSdkNodes(tenantNodes);
|
|
1097
867
|
}
|
|
1098
|
-
return
|
|
868
|
+
return searchWithFilters2(nodes, keyword, filters);
|
|
1099
869
|
}
|
|
1100
870
|
|
|
1101
|
-
export {
|
|
871
|
+
export { MANIFEST_VALIDATION_NEXT_STEP2, TenantManifestInvalidError2, isTenantManifestInvalidError2, TenantManifestUnavailableError2, isTenantManifestUnavailableError2, pullNodes2, pullRemoteNodes2, loadCurrentTenantNodes2, getLocalSolutionSnapshot2, localContractWarning2, filterNodesByKeyword2, findNodeByType2, listNodes2, searchNodeSummariesWithAvailability2, searchNodes2, getNode2, getNodeEnriched2, getLocalNodeEnriched2, searchNodesWithFilters2 };
|
|
1102
872
|
|
|
1103
|
-
//# debugId=
|
|
873
|
+
//# debugId=BBA240B067D0BDAA64756E2164756E21
|