@uipath/flow-tool 1.204.0-preview.254 → 1.205.0-preview.256
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/README.md +9 -9
- package/dist/THIRD-PARTY-NOTICES.md +36 -12
- package/dist/{authoring-bppe07p0.js → authoring-e1k40hyw.js} +6 -5
- package/dist/{binding-service-9t9gqe9c.js → binding-service-yw91615m.js} +38 -30
- package/dist/{connector-service-xm05bmhz.js → connector-service-ttm75a4n.js} +224 -47
- package/dist/de-UZI7FJDO-awjpqfz0.js +200 -0
- package/dist/{de-MUJPA4EB-dpg7t2rw.js → de-UZI7FJDO-mwvc4cxe.js} +29 -2
- package/dist/{de-FGHEJRCI-rv513mfh.js → de-WLW6KWOJ-2qnsqdtw.js} +238 -31
- package/dist/debug-conversation-trigger-xsm3ycqx.js +30 -0
- package/dist/{debug-http-client-p4kf38yt.js → debug-http-client-yqjzsnhw.js} +5 -4
- package/dist/{debug-service-893erynq.js → debug-service-nra3n02y.js} +6 -5
- package/dist/{edge-service-rms6p69f.js → edge-service-8fv0m681.js} +16 -12
- package/dist/{embedded-file-reader-v8c2yj2a.js → embedded-file-reader-r66242ey.js} +2 -2
- package/dist/en-EJCBA3LK-0wb3b1xy.js +146 -0
- package/dist/{en-FBPVNKFN-dqt573xn.js → en-EJCBA3LK-dtpdghgj.js} +12 -4
- package/dist/{en-BWGKA5OE-1qkvb9rn.js → en-M7GQYBV2-5nfmpnfz.js} +88 -6
- package/dist/{es-7SE7HX2X-8yh1aj2y.js → es-4UBUTCQA-m1ytpyx2.js} +29 -2
- package/dist/es-4UBUTCQA-t7hsackg.js +200 -0
- package/dist/{es-KR3ZSNMP-84zphx0x.js → es-5THCNRFN-tqwyrdgy.js} +235 -28
- package/dist/{es-MX-2MYFZU7X-3rek4r73.js → es-MX-5RELIXKI-9jhqtddc.js} +29 -2
- package/dist/es-MX-5RELIXKI-jtjbcxbb.js +200 -0
- package/dist/{es-MX-XXZJGC4R-2mr8jtgm.js → es-MX-TWZBRAXK-gqd9swzw.js} +237 -30
- package/dist/filter-engine-7ep90g7f.js +11 -0
- package/dist/{flow-api-kjvpsxhw.js → flow-api-sat010z1.js} +16 -10
- package/dist/{flow-debug-service-3wtns3k7.js → flow-debug-service-cgawm96k.js} +96 -58
- package/dist/{flow-eval-node-target-ee6vbq8a.js → flow-eval-node-target-dah1gmmh.js} +17 -17
- package/dist/flow-eval-run-api-xdygjzfv.js +13 -0
- package/dist/{flow-eval-run-service-0ne6bjff.js → flow-eval-run-service-03j1szf6.js} +73 -80
- package/dist/{flow-eval-service-kbbq3wwq.js → flow-eval-service-9j46ta9k.js} +167 -415
- package/dist/{flow-init-sdk-source-z9qx1zkt.js → flow-init-sdk-source-xvdvkq7d.js} +6 -5
- package/dist/{flow-init-service-cefvmek0.js → flow-init-service-0a4y3a46.js} +19 -15
- package/dist/{flow-io-ykx6eb1v.js → flow-io-1wabd32s.js} +15 -11
- package/dist/{flow-migrate-service-c4hcjfc8.js → flow-migrate-service-mkqpbwtv.js} +16 -12
- package/dist/{flow-pack-service-6wqe1mj3.js → flow-pack-service-7dj2hhyz.js} +47 -38
- package/dist/flow-validate-service-1ktjayjv.js +70 -0
- package/dist/{fr-Y6NPVODW-8vr1ja4b.js → fr-CERONSRC-edpxhbmb.js} +237 -30
- package/dist/{fr-MDFKNZ4C-h4a122k9.js → fr-VBM5WRC2-63z7w4mh.js} +29 -2
- package/dist/fr-VBM5WRC2-707ha692.js +200 -0
- package/dist/{governance-fetcher-fgwewrfq.js → governance-fetcher-76hxssjm.js} +7 -6
- package/dist/{hitl-service-0tct4x3e.js → hitl-service-vcbhd4cb.js} +15 -11
- package/dist/{index-aaq9rwfv.js → index-1b2je9n2.js} +1088 -233
- package/dist/index-d090f35d.js +66 -0
- package/dist/{index-yj4xk2aw.js → index-dgdnbb2g.js} +7 -5
- package/dist/{index-ng2f77my.js → index-fyc0k5dd.js} +985 -617
- package/dist/{index-tzky1ynd.js → index-hz008fep.js} +6 -5
- package/dist/{index-vrhcbxnk.js → index-nsn889vf.js} +6 -5
- package/dist/{index-2s8rmmw6.js → index-sqhbn7ew.js} +4 -4
- package/dist/{index-tnz5ks4t.js → index-wycgq0ff.js} +65 -2230
- package/dist/index.js +17 -14
- package/dist/init.js +19 -15
- package/dist/inline-entity-resolver-64pqwk86.js +45 -0
- package/dist/input-reader-n7kzdrev.js +12 -0
- package/dist/{ja-UTQEAP34-8e0q6swp.js → ja-43QL7CGO-c3q8gre9.js} +29 -2
- package/dist/ja-43QL7CGO-h6qfxfay.js +200 -0
- package/dist/{ja-Q5PXKJ2V-p4msxzjd.js → ja-U2MCNHGT-gz0ap1jk.js} +235 -28
- package/dist/{known-types-q6fcyq2e.js → known-types-3025scz1.js} +5 -5
- package/dist/ko-TLL6Z6CD-ag6gjynr.js +200 -0
- package/dist/{ko-AXCHW2OK-askct7f6.js → ko-TLL6Z6CD-wrt3n8a9.js} +29 -2
- package/dist/{ko-AYBDSRZG-41mdmsg1.js → ko-XAUYQWDR-zp81gjp4.js} +237 -30
- package/dist/{maestro-automate-entry-qak46eg0.js → maestro-automate-entry-6f9act3w.js} +2 -2
- package/dist/{node-ey7dteda.js → node-hz6cvp9d.js} +29 -15
- package/dist/{node-service-z8s4nm09.js → node-service-7wz8gx7h.js} +41 -30
- package/dist/{node-strategy-fdnkvq4a.js → node-strategy-1dmmhvf3.js} +1 -1
- package/dist/node-sync-service-yvyf7chw.js +61 -0
- package/dist/packager-tool-10vc8pq4.js +2 -0
- package/dist/{packager-tool-wq9k7pq8.js → packager-tool-2h15x2kb.js} +6 -6
- package/dist/{packager-tool-c4909mw9.js → packager-tool-2z0r1f32.js} +668 -57
- package/dist/packager-tool-4kr6g0zw.js +16 -0
- package/dist/packager-tool-4x7tzvv0.js +1176 -0
- package/dist/{packager-tool-d88rqwk8.js → packager-tool-6z1hsm2h.js} +13 -5
- package/dist/packager-tool-7hw344bt.js +107 -0
- package/dist/{packager-tool-fjcbc1bb.js → packager-tool-7wnxyvf9.js} +519 -437
- package/dist/{packager-tool-m8xtf5ej.js → packager-tool-8g5931fz.js} +7 -4
- package/dist/{packager-tool-h9tzz0qd.js → packager-tool-961vsbsc.js} +15 -10
- package/dist/packager-tool-9era57c0.js +28 -0
- package/dist/packager-tool-9gprvfcy.js +23 -0
- package/dist/packager-tool-9jxzgsxc.js +14 -0
- package/dist/{packager-tool-zxp4hya4.js → packager-tool-a5afh1dc.js} +34 -13
- package/dist/{packager-tool-02f63a08.js → packager-tool-apawc11t.js} +88 -762
- package/dist/{packager-tool-tf3d2y8z.js → packager-tool-aw9v0raw.js} +2 -2
- package/dist/packager-tool-cqtsj6yh.js +2 -0
- package/dist/{packager-tool-5nqhxb9e.js → packager-tool-dwd6cc01.js} +16110 -13031
- package/dist/{packager-tool-t605qewm.js → packager-tool-dxgrhfq5.js} +2 -2
- package/dist/{packager-tool-awkq26v0.js → packager-tool-e7kvq8hf.js} +5 -3
- package/dist/{packager-tool-m6abv2vy.js → packager-tool-fjqpf1y6.js} +6 -24
- package/dist/{packager-tool-3dc9gz35.js → packager-tool-frjt46rb.js} +1 -1
- package/dist/{packager-tool-y8egb0fa.js → packager-tool-gqq3vkgh.js} +2573 -535
- package/dist/{packager-tool-w5a1hhyj.js → packager-tool-hxyjn885.js} +13 -2
- package/dist/packager-tool-j3228zs9.js +35 -0
- package/dist/{packager-tool-hhy1gr2k.js → packager-tool-jgfzfqjm.js} +1 -1
- package/dist/{packager-tool-n4m8yrm2.js → packager-tool-kb520rm5.js} +172 -71
- package/dist/{packager-tool-4fhedj18.js → packager-tool-kmv2p8z4.js} +20 -8
- package/dist/{packager-tool-6h69pd2a.js → packager-tool-kn86394c.js} +127 -61
- package/dist/packager-tool-mgcz986r.js +143 -0
- package/dist/{packager-tool-3h2ktz6q.js → packager-tool-myhbp761.js} +11 -1
- package/dist/{packager-tool-2xycknte.js → packager-tool-ns9xn7zq.js} +13 -13
- package/dist/{packager-tool-vbfz8k7w.js → packager-tool-p8gab24q.js} +52 -32
- package/dist/{packager-tool-stq8800d.js → packager-tool-pacrqxv2.js} +17 -4
- package/dist/{packager-tool-7q6z6npd.js → packager-tool-pcvhcn2k.js} +93 -11
- package/dist/packager-tool-phw8ydjx.js +331 -0
- package/dist/{packager-tool-c7nmvv5g.js → packager-tool-q8akejne.js} +6 -4
- package/dist/packager-tool-qcqb9hf8.js +26 -0
- package/dist/{packager-tool-n89vrpex.js → packager-tool-skcjythd.js} +10907 -25608
- package/dist/{packager-tool-vnwq9t1v.js → packager-tool-sphnextf.js} +5 -6
- package/dist/{packager-tool-1ca047de.js → packager-tool-sqpesv2e.js} +12 -56
- package/dist/packager-tool-t7ahhaer.js +877 -0
- package/dist/{packager-tool-0d375dbz.js → packager-tool-thnkpqwc.js} +1802 -378
- package/dist/{packager-tool-peawy22c.js → packager-tool-tqjfdpda.js} +53 -8
- package/dist/{packager-tool-qsa2nf80.js → packager-tool-vd3rn4fj.js} +463 -327
- package/dist/{packager-tool-5tjzg56t.js → packager-tool-wh660fny.js} +1 -1
- package/dist/{packager-tool-tyg399d6.js → packager-tool-wze74wyk.js} +74 -47
- package/dist/{packager-tool-arbswyqr.js → packager-tool-x20684x5.js} +1 -1
- package/dist/packager-tool-xj0agqpk.js +11 -0
- package/dist/packager-tool-xk78j7dz.js +1256 -0
- package/dist/{packager-tool-py93409h.js → packager-tool-ymma2s85.js} +2 -2
- package/dist/packager-tool-z0yxfhdj.js +40 -0
- package/dist/packager-tool.js +13 -10
- package/dist/{pt-BR-TKHNHMET-sn91xyq0.js → pt-BR-GNQNAAZ2-xadharv4.js} +237 -30
- package/dist/{pt-BR-Y6K6XHXK-mp3hwhw1.js → pt-BR-USP2T7GD-pedn77m1.js} +29 -2
- package/dist/pt-BR-USP2T7GD-rppy42ym.js +200 -0
- package/dist/{pt-3DIO5QWG-59b3f4bc.js → pt-RMIAKZB4-67enhx3m.js} +29 -2
- package/dist/pt-RMIAKZB4-t80exmp7.js +200 -0
- package/dist/{pt-ROXU257Y-2f6bxev4.js → pt-TO2DARY2-ftcce1bv.js} +237 -30
- package/dist/ro-GHOBYW2S-4zevc9dy.js +200 -0
- package/dist/{ro-BWR3ONRR-vzx3hy8a.js → ro-GHOBYW2S-mhnqsgaa.js} +29 -2
- package/dist/{ro-AVAWPKOO-b89pw79r.js → ro-WUYJV6OW-a8d9qy1n.js} +235 -28
- package/dist/ru-WBLQ5B2U-dpqvtfwr.js +10 -0
- package/dist/services/connector-request-buckets.d.ts +1 -0
- package/dist/services/flow-eval-file-store.d.ts +1 -11
- package/dist/services/flow-eval-utils.d.ts +1 -32
- package/dist/services/flow-validate-service.d.ts +51 -0
- package/dist/services/inline-entity-resolver.d.ts +22 -0
- package/dist/services/node-service.d.ts +21 -1
- package/dist/services/packaging-utils.d.ts +15 -2
- package/dist/{shared-utils-pnbvyyb2.js → shared-utils-tqnx96mg.js} +4 -3
- package/dist/solution-auth-8qz5pw7z.js +14 -0
- package/dist/solution-discovery-vqravtkh.js +44 -0
- package/dist/{tidy-service-chs0s9pw.js → tidy-service-tqjea6g2.js} +143 -39
- package/dist/tool.js +17 -14
- package/dist/{tr-5IIHSFW5-hw4cewew.js → tr-GDTLECMM-k5fhmq13.js} +29 -2
- package/dist/tr-GDTLECMM-kngksm3r.js +200 -0
- package/dist/{tr-JMIP7ZSL-c39b6pe4.js → tr-M3F5A6AU-bb0tg39m.js} +235 -28
- package/dist/utils/flow-io.d.ts +2 -1
- package/dist/validation.js +39 -33
- package/dist/{variable-service-6ky17hts.js → variable-service-kqnqxmx2.js} +16 -12
- package/dist/{wait-for-flow-job-d8m6mqb4.js → wait-for-flow-job-b0vj8828.js} +15 -12
- package/dist/{zh-CN-IFFXSEJS-9wm9gmrv.js → zh-CN-C5G4PC7C-ds9gkptg.js} +235 -28
- package/dist/zh-CN-I5D7WHBD-ge92tbx9.js +200 -0
- package/dist/{zh-CN-R2KU4U5L-tc1hat59.js → zh-CN-I5D7WHBD-sr5h0a98.js} +29 -2
- package/dist/{zh-TW-GNKMELBF-j674515r.js → zh-TW-2AVLM723-288pkc1z.js} +29 -2
- package/dist/zh-TW-2AVLM723-xsmap3gk.js +200 -0
- package/dist/{zh-TW-IYBNYAMG-8727c7v2.js → zh-TW-62HZIG6O-787kdwex.js} +234 -27
- package/package.json +2 -2
- package/dist/debug-conversation-trigger-mqzrtt1v.js +0 -44
- package/dist/flow-eval-run-api-byx3cacw.js +0 -13
- package/dist/flow-validate-service-5pbh3s4p.js +0 -64
- package/dist/input-reader-vhar4g0k.js +0 -11
- package/dist/node-sync-service-ak1wgysc.js +0 -40
- package/dist/packager-tool-2m06764j.js +0 -454
- package/dist/packager-tool-6c3szt0w.js +0 -265
- package/dist/packager-tool-8ak76pc3.js +0 -15
- package/dist/packager-tool-pz5nqg0s.js +0 -64
- package/dist/packager-tool-t3ysatjd.js +0 -521
- package/dist/packager-tool-vd6jt4n8.js +0 -208
- package/dist/services/flow-debug-service.d.ts +0 -320
- package/dist/services/flow-eval-schema/deterministic-evaluators.d.ts +0 -110
- package/dist/services/flow-eval-schema/evaluator-fields.d.ts +0 -66
- package/dist/services/flow-eval-schema/helpers.d.ts +0 -9
- package/dist/services/flow-eval-schema/index.d.ts +0 -4
- package/dist/services/flow-eval-schema/llm-judge-evaluators.d.ts +0 -174
- package/dist/services/flow-eval-schema/prompts.d.ts +0 -2
- package/dist/services/flow-eval-schema/registry.d.ts +0 -375
- package/dist/services/flow-eval-schema/tool-call-evaluators.d.ts +0 -93
- package/dist/services/flow-eval-schema/types.d.ts +0 -95
- package/dist/services/flow-eval-types.d.ts +0 -6
- package/dist/utils/write-resolved-flow.d.ts +0 -7
- /package/dist/{headless-45dypanh.js → headless-fw8pwyzm.js} +0 -0
- /package/dist/{localization-xecwjpe2.js → localization-d6gjmrsw.js} +0 -0
|
@@ -1,146 +1,48 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveMaestroRegistry
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-dxgrhfq5.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./packager-tool-
|
|
5
|
+
searchWithFilters
|
|
6
|
+
} from "./packager-tool-7hw344bt.js";
|
|
7
|
+
import {
|
|
8
|
+
buildInSolutionNodes,
|
|
9
|
+
findSolutionFromCwd,
|
|
10
|
+
unknownContractWarning
|
|
11
|
+
} from "./packager-tool-phw8ydjx.js";
|
|
7
12
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./packager-tool-
|
|
13
|
+
listKnownSdkNodes
|
|
14
|
+
} from "./packager-tool-e7kvq8hf.js";
|
|
10
15
|
import {
|
|
11
16
|
getAuthContext,
|
|
12
17
|
getLoginStatusAsync
|
|
13
|
-
} from "./packager-tool-
|
|
18
|
+
} from "./packager-tool-kn86394c.js";
|
|
14
19
|
import {
|
|
15
20
|
isBrowser
|
|
16
21
|
} from "./packager-tool-0gctz400.js";
|
|
17
22
|
import {
|
|
18
23
|
MANIFEST_FEATURE_FLAGS,
|
|
19
|
-
ManifestClient
|
|
20
|
-
|
|
21
|
-
getServiceType,
|
|
22
|
-
taskDefinitionsToNodeManifests
|
|
23
|
-
} from "./packager-tool-5nqhxb9e.js";
|
|
24
|
+
ManifestClient
|
|
25
|
+
} from "./packager-tool-dwd6cc01.js";
|
|
24
26
|
import {
|
|
25
27
|
UIPATH_HOME_DIR,
|
|
26
28
|
addSdkUserAgentHeader,
|
|
27
|
-
|
|
29
|
+
extractErrorMessage,
|
|
28
30
|
getSdkUserAgentToken,
|
|
29
31
|
hashContent,
|
|
32
|
+
httpStatusOf,
|
|
30
33
|
installSdkUserAgentHeader,
|
|
31
34
|
logger
|
|
32
|
-
} from "./packager-tool-
|
|
35
|
+
} from "./packager-tool-apawc11t.js";
|
|
36
|
+
import {
|
|
37
|
+
catchError
|
|
38
|
+
} from "./packager-tool-t7ahhaer.js";
|
|
33
39
|
import {
|
|
34
40
|
getFileSystem
|
|
35
|
-
} from "./packager-tool-
|
|
41
|
+
} from "./packager-tool-myhbp761.js";
|
|
36
42
|
import {
|
|
37
43
|
__require
|
|
38
44
|
} from "./packager-tool-1yh8g550.js";
|
|
39
45
|
|
|
40
|
-
// ../maestro-sdk/src/registry/filter-engine.ts
|
|
41
|
-
function filterNodes(nodes, parsedFilters) {
|
|
42
|
-
if (!parsedFilters.filters || parsedFilters.filters.length === 0) {
|
|
43
|
-
return nodes;
|
|
44
|
-
}
|
|
45
|
-
return nodes.filter((node) => {
|
|
46
|
-
if (parsedFilters.logic === "AND") {
|
|
47
|
-
return parsedFilters.filters.every((condition) => matchesCondition(node, condition));
|
|
48
|
-
} else {
|
|
49
|
-
return parsedFilters.filters.some((condition) => matchesCondition(node, condition));
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
function matchesCondition(node, condition) {
|
|
54
|
-
const fieldValue = getFieldValue(node, condition.field);
|
|
55
|
-
if (fieldValue === null || fieldValue === undefined) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
const searchValue = condition.value.toString().toLowerCase();
|
|
59
|
-
if (Array.isArray(fieldValue)) {
|
|
60
|
-
return matchesArrayField(fieldValue, condition.operator, searchValue);
|
|
61
|
-
}
|
|
62
|
-
const fieldString = fieldValue.toString().toLowerCase();
|
|
63
|
-
switch (condition.operator) {
|
|
64
|
-
case "equals":
|
|
65
|
-
return fieldString === searchValue;
|
|
66
|
-
case "contains":
|
|
67
|
-
return fieldString.includes(searchValue);
|
|
68
|
-
case "startsWith":
|
|
69
|
-
return fieldString.startsWith(searchValue);
|
|
70
|
-
case "endsWith":
|
|
71
|
-
return fieldString.endsWith(searchValue);
|
|
72
|
-
case "in": {
|
|
73
|
-
const values = searchValue.split(",").map((v) => v.trim());
|
|
74
|
-
return values.includes(fieldString);
|
|
75
|
-
}
|
|
76
|
-
default:
|
|
77
|
-
return fieldString === searchValue;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function matchesArrayField(arrayValue, operator, searchValue) {
|
|
81
|
-
const lowerArray = arrayValue.map((v) => v.toLowerCase());
|
|
82
|
-
switch (operator) {
|
|
83
|
-
case "equals":
|
|
84
|
-
return lowerArray.includes(searchValue);
|
|
85
|
-
case "contains":
|
|
86
|
-
return lowerArray.some((tag) => tag.includes(searchValue));
|
|
87
|
-
case "in": {
|
|
88
|
-
const values = searchValue.split(",").map((v) => v.trim());
|
|
89
|
-
return lowerArray.some((tag) => values.includes(tag));
|
|
90
|
-
}
|
|
91
|
-
default:
|
|
92
|
-
return lowerArray.includes(searchValue);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function getFieldValue(node, field) {
|
|
96
|
-
switch (field) {
|
|
97
|
-
case "category":
|
|
98
|
-
return node.category;
|
|
99
|
-
case "type":
|
|
100
|
-
case "nodetype":
|
|
101
|
-
return node.nodeType;
|
|
102
|
-
case "tags":
|
|
103
|
-
return node.tags;
|
|
104
|
-
case "displayname":
|
|
105
|
-
return node.display?.label;
|
|
106
|
-
case "description":
|
|
107
|
-
return node.description ?? node.display?.description;
|
|
108
|
-
default:
|
|
109
|
-
return node[field];
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
function searchWithFilters(nodes, keyword, filters) {
|
|
113
|
-
let results = nodes;
|
|
114
|
-
if (filters && filters.filters.length > 0) {
|
|
115
|
-
results = filterNodes(results, filters);
|
|
116
|
-
}
|
|
117
|
-
if (keyword && keyword.trim() !== "") {
|
|
118
|
-
const lowerKeyword = keyword.toLowerCase();
|
|
119
|
-
results = results.filter((node) => {
|
|
120
|
-
if (node.nodeType?.toLowerCase().includes(lowerKeyword)) {
|
|
121
|
-
return true;
|
|
122
|
-
}
|
|
123
|
-
if (node.category?.toLowerCase().includes(lowerKeyword)) {
|
|
124
|
-
return true;
|
|
125
|
-
}
|
|
126
|
-
if (node.tags?.some((tag) => tag.toLowerCase().includes(lowerKeyword))) {
|
|
127
|
-
return true;
|
|
128
|
-
}
|
|
129
|
-
if (node.display?.label?.toLowerCase().includes(lowerKeyword)) {
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
if (node.description?.toString().toLowerCase().includes(lowerKeyword)) {
|
|
133
|
-
return true;
|
|
134
|
-
}
|
|
135
|
-
if (node.display?.description?.toLowerCase().includes(lowerKeyword)) {
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
138
|
-
return false;
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
return results;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
46
|
// ../integrationservice-sdk/generated/connections/src/runtime.ts
|
|
145
47
|
var BASE_PATH = "https://alpha.uipath.com/entity/Azure/connections_".replace(/\/+$/, "");
|
|
146
48
|
|
|
@@ -672,7 +574,7 @@ var package_default = {
|
|
|
672
574
|
name: "@uipath/integrationservice-sdk",
|
|
673
575
|
author: "UiPath",
|
|
674
576
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
675
|
-
version: "1.
|
|
577
|
+
version: "1.205.0-preview.256",
|
|
676
578
|
repository: {
|
|
677
579
|
type: "git",
|
|
678
580
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -708,12 +610,13 @@ var package_default = {
|
|
|
708
610
|
devDependencies: {
|
|
709
611
|
"@uipath/auth": "workspace:*",
|
|
710
612
|
"@uipath/common": "workspace:*",
|
|
613
|
+
"@uipath/solution-sdk": "workspace:*",
|
|
711
614
|
"@openapitools/openapi-generator-cli": "^2.31.1",
|
|
712
615
|
"@types/node": "^25.5.2",
|
|
713
616
|
typescript: "^7.0.2"
|
|
714
617
|
},
|
|
715
618
|
dependencies: {
|
|
716
|
-
"@uipath/integration-service-design-time": "
|
|
619
|
+
"@uipath/integration-service-design-time": "2.10.0"
|
|
717
620
|
}
|
|
718
621
|
};
|
|
719
622
|
|
|
@@ -6506,6 +6409,43 @@ var CONNECTION_STATE_NAMES = new Map([
|
|
|
6506
6409
|
[ConnectionState.Expired, "Expired"],
|
|
6507
6410
|
[ConnectionState.Failed, "Failed"]
|
|
6508
6411
|
]);
|
|
6412
|
+
// ../integrationservice-sdk/src/dap/activity-bindings.ts
|
|
6413
|
+
var DROPPED_RESOURCES = ["connection", "eventtrigger"];
|
|
6414
|
+
var isResourceType = (resource, types) => types.includes((resource ?? "").toLowerCase());
|
|
6415
|
+
function storedActivityBindings(bindings) {
|
|
6416
|
+
return bindings.filter((binding) => !isResourceType(binding.resource, DROPPED_RESOURCES));
|
|
6417
|
+
}
|
|
6418
|
+
function planResourceBindings(stored, resolved) {
|
|
6419
|
+
const plans = [];
|
|
6420
|
+
for (const { field, companion, selection } of resolved) {
|
|
6421
|
+
const entry = stored.find((binding) => binding.key?.toLowerCase() === selection.key.toLowerCase() && !isResourceType(binding.resource, ["property"]));
|
|
6422
|
+
if (entry === undefined)
|
|
6423
|
+
continue;
|
|
6424
|
+
const displayName = entry.value?.name?.displayName ?? field;
|
|
6425
|
+
const rows = [
|
|
6426
|
+
{
|
|
6427
|
+
field,
|
|
6428
|
+
propertyAttribute: "name",
|
|
6429
|
+
name: displayName,
|
|
6430
|
+
default: selection.name
|
|
6431
|
+
}
|
|
6432
|
+
];
|
|
6433
|
+
if (entry.value?.folderKey && selection.folderKey) {
|
|
6434
|
+
rows.push({
|
|
6435
|
+
field: companion,
|
|
6436
|
+
propertyAttribute: "folderKey",
|
|
6437
|
+
name: `${displayName} folder`,
|
|
6438
|
+
default: selection.folderKey
|
|
6439
|
+
});
|
|
6440
|
+
}
|
|
6441
|
+
plans.push({
|
|
6442
|
+
resource: entry.resource,
|
|
6443
|
+
resourceKey: selection.key,
|
|
6444
|
+
rows
|
|
6445
|
+
});
|
|
6446
|
+
}
|
|
6447
|
+
return plans;
|
|
6448
|
+
}
|
|
6509
6449
|
// ../integrationservice-sdk/src/dap/filter-builder/index.ts
|
|
6510
6450
|
class FilterNotSupportedError extends Error {
|
|
6511
6451
|
constructor(message) {
|
|
@@ -6643,6 +6583,177 @@ function createLiveConnectionsProvider() {
|
|
|
6643
6583
|
};
|
|
6644
6584
|
}
|
|
6645
6585
|
|
|
6586
|
+
// ../integrationservice-sdk/src/dap/resource-field-resolver.ts
|
|
6587
|
+
var FIELD_ARRAY_MARKER = "[*]";
|
|
6588
|
+
function resourceFolderKeyFieldName(fieldName) {
|
|
6589
|
+
const base = fieldName.endsWith(FIELD_ARRAY_MARKER) ? fieldName.slice(0, -FIELD_ARRAY_MARKER.length) : fieldName;
|
|
6590
|
+
return `${base}_folderKey`;
|
|
6591
|
+
}
|
|
6592
|
+
function isResourceSelection(value) {
|
|
6593
|
+
return typeof value === "object" && value !== null && typeof value.key === "string" && typeof value.name === "string";
|
|
6594
|
+
}
|
|
6595
|
+
|
|
6596
|
+
class ResourceFieldResolutionError extends Error {
|
|
6597
|
+
constructor(message) {
|
|
6598
|
+
super(message);
|
|
6599
|
+
this.name = "ResourceFieldResolutionError";
|
|
6600
|
+
}
|
|
6601
|
+
}
|
|
6602
|
+
async function resolveResourceFieldValues(fieldValues, resourceFields, solutionDir) {
|
|
6603
|
+
let solution;
|
|
6604
|
+
const openOnce = async () => {
|
|
6605
|
+
solution ??= await openSolution(solutionDir);
|
|
6606
|
+
return solution;
|
|
6607
|
+
};
|
|
6608
|
+
const [resolveError, resolved] = await catchError(resolveEach(fieldValues, resourceFields, openOnce));
|
|
6609
|
+
const saveError = solution ? await saveSolution(solution, solutionDir) : null;
|
|
6610
|
+
if (resolveError) {
|
|
6611
|
+
if (saveError) {
|
|
6612
|
+
resolveError.message += ` The solution at '${solutionDir}' also failed to save: ${saveError.message}`;
|
|
6613
|
+
}
|
|
6614
|
+
throw resolveError;
|
|
6615
|
+
}
|
|
6616
|
+
if (saveError) {
|
|
6617
|
+
throw new ResourceFieldResolutionError(`The resource was referenced but the solution at '${solutionDir}' could not be saved: ${saveError.message}`);
|
|
6618
|
+
}
|
|
6619
|
+
return resolved;
|
|
6620
|
+
}
|
|
6621
|
+
async function resolveEach(fieldValues, resourceFields, openOnce) {
|
|
6622
|
+
const resolved = [];
|
|
6623
|
+
for (const field of resourceFields) {
|
|
6624
|
+
const value = fieldValues[field.name];
|
|
6625
|
+
if (value == null || value === "" || isResourceSelection(value) || typeof value === "string" && value.startsWith("=")) {
|
|
6626
|
+
continue;
|
|
6627
|
+
}
|
|
6628
|
+
if (Array.isArray(value)) {
|
|
6629
|
+
throw new ResourceFieldResolutionError(`'${field.name}' is a multi-select ${field.kind} picker, which the CLI cannot resolve yet — pick one ${field.kind} by name.`);
|
|
6630
|
+
}
|
|
6631
|
+
if (typeof value !== "string") {
|
|
6632
|
+
throw new ResourceFieldResolutionError(`'${field.name}' is a ${field.kind} picker on this activity — pass the ${field.kind} name as a string.`);
|
|
6633
|
+
}
|
|
6634
|
+
const companion = resourceFolderKeyFieldName(field.name);
|
|
6635
|
+
const folderHint = fieldValues[companion];
|
|
6636
|
+
const selection = await referenceResource(await openOnce(), field, value, typeof folderHint === "string" && folderHint !== "" ? folderHint : undefined, companion);
|
|
6637
|
+
fieldValues[field.name] = selection;
|
|
6638
|
+
delete fieldValues[companion];
|
|
6639
|
+
resolved.push({ field: field.name, companion, selection });
|
|
6640
|
+
}
|
|
6641
|
+
return resolved;
|
|
6642
|
+
}
|
|
6643
|
+
async function openSolution(solutionDir) {
|
|
6644
|
+
const [error, solution] = await catchError((async () => {
|
|
6645
|
+
const { getSolutionAuthContext } = await import("./solution-auth-8qz5pw7z.js");
|
|
6646
|
+
await getSolutionAuthContext({});
|
|
6647
|
+
const resources = await import("./index-1b2je9n2.js");
|
|
6648
|
+
await resources.normalizeResourceFileCasing(solutionDir);
|
|
6649
|
+
const services = await resources.createResourceBuilderServices();
|
|
6650
|
+
return {
|
|
6651
|
+
resources,
|
|
6652
|
+
builder: await services.getSolutionBuilder(solutionDir)
|
|
6653
|
+
};
|
|
6654
|
+
})());
|
|
6655
|
+
if (error) {
|
|
6656
|
+
throw new ResourceFieldResolutionError(`A resource picker needs the solution the resource is referenced into, and '${solutionDir}' could not be opened: ${error.message}. ` + "Check the project sits in a solution and you are logged in (run 'uip login').");
|
|
6657
|
+
}
|
|
6658
|
+
return solution;
|
|
6659
|
+
}
|
|
6660
|
+
async function saveSolution({ resources, builder }, solutionDir) {
|
|
6661
|
+
const error = await resources.saveCasingNormalized(builder);
|
|
6662
|
+
if (!error)
|
|
6663
|
+
await resources.normalizeResourceFileCasing(solutionDir);
|
|
6664
|
+
return error;
|
|
6665
|
+
}
|
|
6666
|
+
async function referenceResource({ resources, builder }, field, name, folderHint, companion) {
|
|
6667
|
+
const matches = await resources.searchRcsResources(builder, field.kind, name);
|
|
6668
|
+
const candidates = matches.filter((match2) => match2.name.toLowerCase() === name.toLowerCase() && (folderHint === undefined || matchesFolder(resources, match2, folderHint)));
|
|
6669
|
+
if (candidates.length === 0) {
|
|
6670
|
+
throw new ResourceFieldResolutionError(`No ${field.kind} named '${name}'${folderHint ? ` in folder '${folderHint}'` : ""} was found. ` + "If a failed resource catalog lookup was logged above, check your login and retry. " + `Otherwise run 'uip solution resources list --source remote --kind ${field.kind} --search "${name}"' to discover candidates.`);
|
|
6671
|
+
}
|
|
6672
|
+
if (candidates.length > 1) {
|
|
6673
|
+
const folders = candidates.map((match2) => ` - ${match2.folder?.fullyQualifiedName ?? "<tenant>"} (folder key ${match2.folder?.folderKey ?? "<none>"})`).join(`
|
|
6674
|
+
`);
|
|
6675
|
+
throw new ResourceFieldResolutionError(`${candidates.length} ${field.kind} resources are named '${name}'. Pass the folder key or path as '${companion}' to pick one:
|
|
6676
|
+
${folders}`);
|
|
6677
|
+
}
|
|
6678
|
+
const [match] = candidates;
|
|
6679
|
+
const [loadError, solution] = await catchError(builder.context.loadAsync());
|
|
6680
|
+
if (loadError) {
|
|
6681
|
+
throw new ResourceFieldResolutionError(`Failed to read the solution before referencing ${field.kind} '${name}': ${loadError.message}`);
|
|
6682
|
+
}
|
|
6683
|
+
const existing = solution.resources.find((resource) => resource.key.toLowerCase() === match.key.toLowerCase());
|
|
6684
|
+
if (existing) {
|
|
6685
|
+
return {
|
|
6686
|
+
key: existing.key,
|
|
6687
|
+
name: match.name,
|
|
6688
|
+
folderKey: match.folder?.folderKey,
|
|
6689
|
+
folderPath: match.folder?.fullyQualifiedName
|
|
6690
|
+
};
|
|
6691
|
+
}
|
|
6692
|
+
const [referenceError, response] = await catchError(builder.addOrUpdateResourceToSolutionAsync({
|
|
6693
|
+
kind: field.kind,
|
|
6694
|
+
type: match.type,
|
|
6695
|
+
key: match.key,
|
|
6696
|
+
name: match.name,
|
|
6697
|
+
folder: match.folder
|
|
6698
|
+
}, true));
|
|
6699
|
+
if (referenceError) {
|
|
6700
|
+
throw new ResourceFieldResolutionError(`Failed to reference ${field.kind} '${name}' into the solution: ${referenceError.message}`);
|
|
6701
|
+
}
|
|
6702
|
+
return {
|
|
6703
|
+
key: response.resource.key,
|
|
6704
|
+
name: match.name,
|
|
6705
|
+
folderKey: match.folder?.folderKey,
|
|
6706
|
+
folderPath: match.folder?.fullyQualifiedName
|
|
6707
|
+
};
|
|
6708
|
+
}
|
|
6709
|
+
function matchesFolder({ normalizeFolderPath }, match, folderHint) {
|
|
6710
|
+
const folder = match.folder;
|
|
6711
|
+
if (!folder)
|
|
6712
|
+
return false;
|
|
6713
|
+
if (folder.folderKey.toLowerCase() === folderHint.toLowerCase())
|
|
6714
|
+
return true;
|
|
6715
|
+
const hint = normalizeFolderPath(folderHint);
|
|
6716
|
+
return normalizeFolderPath(folder.fullyQualifiedName) === hint || folder.path !== undefined && normalizeFolderPath(folder.path) === hint;
|
|
6717
|
+
}
|
|
6718
|
+
|
|
6719
|
+
// ../integrationservice-sdk/src/dap/solution-resource-configurations.ts
|
|
6720
|
+
var CATALOG_MISS = "was not found in the solution or in the resource catalog";
|
|
6721
|
+
function createSolutionResourceConfigurationsProvider(solutionDir, namesByKey = new Map, openedEngine) {
|
|
6722
|
+
let engine = openedEngine ? Promise.resolve(openedEngine) : undefined;
|
|
6723
|
+
const ensureEngine = () => {
|
|
6724
|
+
engine ??= openEngine().catch((err) => {
|
|
6725
|
+
engine = undefined;
|
|
6726
|
+
throw err;
|
|
6727
|
+
});
|
|
6728
|
+
return engine;
|
|
6729
|
+
};
|
|
6730
|
+
const where = solutionDir ? `in ${solutionDir} or the resource catalog` : "in the resource catalog";
|
|
6731
|
+
return {
|
|
6732
|
+
async getAllConfigurations(resourceKey) {
|
|
6733
|
+
const { resources, services } = await ensureEngine();
|
|
6734
|
+
const builder = solutionDir ? await services.getSolutionBuilder(solutionDir, true) : undefined;
|
|
6735
|
+
const [error, graph] = await catchError(resources.readResourceConfigurationsAsync(services, builder, resourceKey, { name: namesByKey.get(resourceKey) }));
|
|
6736
|
+
await builder?.disposeAsync();
|
|
6737
|
+
if (error) {
|
|
6738
|
+
const status = httpStatusOf(error) ?? (error.message.endsWith(CATALOG_MISS) ? 404 : undefined);
|
|
6739
|
+
throw Object.assign(new Error(`Failed to read configuration for solution resource '${resourceKey}' ${where}: ${await extractErrorMessage(error)}`, { cause: error }), { status });
|
|
6740
|
+
}
|
|
6741
|
+
return {
|
|
6742
|
+
resources: graph.resources ?? []
|
|
6743
|
+
};
|
|
6744
|
+
}
|
|
6745
|
+
};
|
|
6746
|
+
}
|
|
6747
|
+
async function openEngine() {
|
|
6748
|
+
const { getSolutionAuthContext } = await import("./solution-auth-8qz5pw7z.js");
|
|
6749
|
+
await getSolutionAuthContext({});
|
|
6750
|
+
const resources = await import("./index-1b2je9n2.js");
|
|
6751
|
+
return {
|
|
6752
|
+
resources,
|
|
6753
|
+
services: await resources.createResourceBuilderServices()
|
|
6754
|
+
};
|
|
6755
|
+
}
|
|
6756
|
+
|
|
6646
6757
|
// ../integrationservice-sdk/src/dap/essential-config.ts
|
|
6647
6758
|
var MANAGED_HTTP_CONNECTOR_KEY = "uipath-uipath-http";
|
|
6648
6759
|
var MANAGED_HTTP_CONNECTOR_VERSION = "1.4.50";
|
|
@@ -6677,26 +6788,41 @@ function computeSavedJitInputFieldId(operation, parameters, objectName) {
|
|
|
6677
6788
|
return;
|
|
6678
6789
|
return `in_${objectName}`;
|
|
6679
6790
|
}
|
|
6680
|
-
async function
|
|
6791
|
+
async function configureActivityClient({
|
|
6681
6792
|
instanceParameters,
|
|
6682
6793
|
connectionId,
|
|
6683
6794
|
savedFilterTrees = null,
|
|
6684
6795
|
customFieldsRequestDetails = null,
|
|
6685
|
-
fieldValues = null
|
|
6796
|
+
fieldValues = null,
|
|
6797
|
+
solutionDir = null
|
|
6686
6798
|
}) {
|
|
6687
6799
|
if (savedFilterTrees) {
|
|
6688
6800
|
for (const tree of Object.values(savedFilterTrees)) {
|
|
6689
6801
|
assertFilterTreeSupported(tree);
|
|
6690
6802
|
}
|
|
6691
6803
|
}
|
|
6692
|
-
const { DesignTimeActivityClient } = await import("./index-
|
|
6693
|
-
const
|
|
6804
|
+
const { DesignTimeActivityClient } = await import("./index-fyc0k5dd.js");
|
|
6805
|
+
const initiateOptions = {
|
|
6806
|
+
connectionsProvider: createLiveConnectionsProvider(),
|
|
6807
|
+
...solutionDir ? {
|
|
6808
|
+
solutionResourceConfigurationsProvider: createSolutionResourceConfigurationsProvider(solutionDir)
|
|
6809
|
+
} : {}
|
|
6810
|
+
};
|
|
6811
|
+
const client = await DesignTimeActivityClient.initiate({ instanceParameters, uiPathActivityTypeId: "" }, initiateOptions);
|
|
6694
6812
|
await client.updateConnection({ connectionId });
|
|
6813
|
+
const resourceFields = fieldValues && (solutionDir || customFieldsRequestDetails) ? await client.getResourceFields() : [];
|
|
6814
|
+
const pickerNames = new Set(resourceFields.map((field) => field.name));
|
|
6815
|
+
const resolvedResources = solutionDir && fieldValues ? await resolveResourceFieldValues(fieldValues, resourceFields, solutionDir) : [];
|
|
6695
6816
|
if (customFieldsRequestDetails) {
|
|
6696
6817
|
for (const [
|
|
6697
6818
|
fieldId,
|
|
6698
6819
|
value
|
|
6699
6820
|
] of customFieldsRequestDetails.parameterValues) {
|
|
6821
|
+
const selection = fieldValues?.[fieldId];
|
|
6822
|
+
if (pickerNames.has(fieldId) && isResourceSelection(selection)) {
|
|
6823
|
+
await client.setFieldValues({ [fieldId]: selection });
|
|
6824
|
+
continue;
|
|
6825
|
+
}
|
|
6700
6826
|
await client.updateProperty({
|
|
6701
6827
|
propertyName: fieldId,
|
|
6702
6828
|
valueType: "widget",
|
|
@@ -6715,7 +6841,7 @@ async function createConfiguredActivityClient({
|
|
|
6715
6841
|
await applySavedFilterTree(client, filterParam, tree);
|
|
6716
6842
|
}
|
|
6717
6843
|
}
|
|
6718
|
-
return client;
|
|
6844
|
+
return { client, resolvedResources };
|
|
6719
6845
|
}
|
|
6720
6846
|
async function applySavedFilterTree(client, propertyName, tree) {
|
|
6721
6847
|
await client.updateProperty({
|
|
@@ -6946,7 +7072,7 @@ function validateEventType(context) {
|
|
|
6946
7072
|
function validateConfiguration(context) {
|
|
6947
7073
|
if (!context.configuration?.trim()) {
|
|
6948
7074
|
return [
|
|
6949
|
-
issue(context, "configuration", "Error", 'Configuration is missing or empty. Expected `=jsonString:` prefix wrapping a JSON string with shape `{"essentialConfiguration": {"objectName": "...", "connectionId": "...", ...}}`. Re-run `uip maestro flow
|
|
7075
|
+
issue(context, "configuration", "Error", 'Configuration is missing or empty. Expected `=jsonString:` prefix wrapping a JSON string with shape `{"essentialConfiguration": {"objectName": "...", "connectionId": "...", ...}}`. Re-run `uip maestro flow nodes configure` to populate this field correctly.')
|
|
6950
7076
|
];
|
|
6951
7077
|
}
|
|
6952
7078
|
const jsonStr = context.configuration.startsWith("=jsonString:") ? context.configuration.slice("=jsonString:".length) : context.configuration;
|
|
@@ -6954,12 +7080,12 @@ function validateConfiguration(context) {
|
|
|
6954
7080
|
const parsed = JSON.parse(jsonStr);
|
|
6955
7081
|
if (!parsed.essentialConfiguration) {
|
|
6956
7082
|
return [
|
|
6957
|
-
issue(context, "configuration", "Error", "Configuration is missing the essentialConfiguration envelope. The decoded `=jsonString:` value must be an object whose only top-level key is `essentialConfiguration` (which itself carries `objectName`, `connectionId`, `instanceParameters`, etc.). Re-run `uip maestro flow
|
|
7083
|
+
issue(context, "configuration", "Error", "Configuration is missing the essentialConfiguration envelope. The decoded `=jsonString:` value must be an object whose only top-level key is `essentialConfiguration` (which itself carries `objectName`, `connectionId`, `instanceParameters`, etc.). Re-run `uip maestro flow nodes configure` rather than hand-editing.")
|
|
6958
7084
|
];
|
|
6959
7085
|
}
|
|
6960
7086
|
} catch {
|
|
6961
7087
|
return [
|
|
6962
|
-
issue(context, "configuration", "Error", 'Configuration contains invalid JSON. The `=jsonString:` prefix must be followed by a single JSON-encoded string (one level of quoting), e.g. `"=jsonString:{\\"essentialConfiguration\\":{...}}"`. Re-run `uip maestro flow
|
|
7088
|
+
issue(context, "configuration", "Error", 'Configuration contains invalid JSON. The `=jsonString:` prefix must be followed by a single JSON-encoded string (one level of quoting), e.g. `"=jsonString:{\\"essentialConfiguration\\":{...}}"`. Re-run `uip maestro flow nodes configure` to regenerate.')
|
|
6963
7089
|
];
|
|
6964
7090
|
}
|
|
6965
7091
|
return [];
|
|
@@ -7423,12 +7549,20 @@ async function getPrecacheNode(nodeType, options) {
|
|
|
7423
7549
|
}
|
|
7424
7550
|
|
|
7425
7551
|
// ../maestro-sdk/src/registry/node-storage.ts
|
|
7426
|
-
var CACHE_FORMAT_VERSION =
|
|
7552
|
+
var CACHE_FORMAT_VERSION = 6;
|
|
7427
7553
|
var INDEX_FILE = "index.json";
|
|
7428
7554
|
var METADATA_FILE = "index.meta.json";
|
|
7429
7555
|
var SEARCH_INDEX_FILE = "search-index.json";
|
|
7430
7556
|
var ESSENTIALS_INDEX_FILE = "get-essentials.json";
|
|
7431
7557
|
var WRITE_LOCK_FILE = ".index-write.lock";
|
|
7558
|
+
function nodeCacheScope(login) {
|
|
7559
|
+
const baseUrl = login.baseUrl?.trim().replace(/\/+$/, "");
|
|
7560
|
+
const organizationId = login.organizationId?.trim();
|
|
7561
|
+
const tenantId = login.tenantId?.trim();
|
|
7562
|
+
if (!baseUrl || !organizationId || !tenantId)
|
|
7563
|
+
return;
|
|
7564
|
+
return [baseUrl, organizationId, tenantId].join("|").toLowerCase();
|
|
7565
|
+
}
|
|
7432
7566
|
async function resolveNodeStorageDir() {
|
|
7433
7567
|
const fs = getFileSystem();
|
|
7434
7568
|
return fs.path.join(fs.env.homedir(), UIPATH_HOME_DIR, "nodes");
|
|
@@ -7474,7 +7608,7 @@ async function writeTempAndRename(fs, targetPath, content) {
|
|
|
7474
7608
|
await fs.writeFile(tempPath, content);
|
|
7475
7609
|
await fs.rename(tempPath, targetPath);
|
|
7476
7610
|
}
|
|
7477
|
-
async function writeNodeArtifacts(fs, dir, nodes) {
|
|
7611
|
+
async function writeNodeArtifacts(fs, dir, nodes, scope, missingSources) {
|
|
7478
7612
|
const indexPath = fs.path.join(dir, INDEX_FILE);
|
|
7479
7613
|
const searchIndexPath = fs.path.join(dir, SEARCH_INDEX_FILE);
|
|
7480
7614
|
const essentialsIndexPath = fs.path.join(dir, ESSENTIALS_INDEX_FILE);
|
|
@@ -7487,7 +7621,9 @@ async function writeNodeArtifacts(fs, dir, nodes) {
|
|
|
7487
7621
|
lastSync: Date.now(),
|
|
7488
7622
|
nodeCount: nodes.length,
|
|
7489
7623
|
hash,
|
|
7490
|
-
cacheVersion: CACHE_FORMAT_VERSION
|
|
7624
|
+
cacheVersion: CACHE_FORMAT_VERSION,
|
|
7625
|
+
...scope && { scope },
|
|
7626
|
+
...missingSources?.length && { missingSources }
|
|
7491
7627
|
});
|
|
7492
7628
|
await writeTempAndRename(fs, searchIndexPath, searchContent);
|
|
7493
7629
|
await writeTempAndRename(fs, essentialsIndexPath, essentialsContent);
|
|
@@ -7495,7 +7631,7 @@ async function writeNodeArtifacts(fs, dir, nodes) {
|
|
|
7495
7631
|
await writeTempAndRename(fs, metaPath, metadataContent);
|
|
7496
7632
|
return nodes.length;
|
|
7497
7633
|
}
|
|
7498
|
-
async function saveNodeIndex(nodes) {
|
|
7634
|
+
async function saveNodeIndex(nodes, scope, missingSources) {
|
|
7499
7635
|
const fs = getFileSystem();
|
|
7500
7636
|
const dir = await resolveNodeStorageDir();
|
|
7501
7637
|
await fs.mkdir(dir);
|
|
@@ -7504,7 +7640,7 @@ async function saveNodeIndex(nodes) {
|
|
|
7504
7640
|
let result;
|
|
7505
7641
|
let writeError;
|
|
7506
7642
|
try {
|
|
7507
|
-
result = await writeNodeArtifacts(fs, dir, nodes);
|
|
7643
|
+
result = await writeNodeArtifacts(fs, dir, nodes, scope, missingSources);
|
|
7508
7644
|
} catch (error) {
|
|
7509
7645
|
writeError = error;
|
|
7510
7646
|
}
|
|
@@ -7518,6 +7654,49 @@ async function saveNodeIndex(nodes) {
|
|
|
7518
7654
|
}
|
|
7519
7655
|
return result;
|
|
7520
7656
|
}
|
|
7657
|
+
async function commitNodeIndex(nodes, scope, missingSources) {
|
|
7658
|
+
const fs = getFileSystem();
|
|
7659
|
+
const dir = await resolveNodeStorageDir();
|
|
7660
|
+
await fs.mkdir(dir);
|
|
7661
|
+
const releaseLock = await fs.acquireLock(fs.path.join(dir, WRITE_LOCK_FILE));
|
|
7662
|
+
const [writeError, count] = await catchError((async () => {
|
|
7663
|
+
const current = await loadIndexMetadata();
|
|
7664
|
+
const hash = await hashContent(JSON.stringify(nodes));
|
|
7665
|
+
if (current && current.cacheVersion === CACHE_FORMAT_VERSION && current.hash === hash && current.scope === scope && await areDerivedArtifactsCurrent()) {
|
|
7666
|
+
const { missingSources: _previous, ...rest } = current;
|
|
7667
|
+
await writeTempAndRename(fs, fs.path.join(dir, METADATA_FILE), JSON.stringify({
|
|
7668
|
+
...rest,
|
|
7669
|
+
lastSync: Date.now(),
|
|
7670
|
+
...missingSources?.length && { missingSources }
|
|
7671
|
+
}));
|
|
7672
|
+
return current.nodeCount;
|
|
7673
|
+
}
|
|
7674
|
+
return writeNodeArtifacts(fs, dir, nodes, scope, missingSources);
|
|
7675
|
+
})());
|
|
7676
|
+
const [releaseError] = await catchError(releaseLock());
|
|
7677
|
+
if (writeError)
|
|
7678
|
+
throw writeError;
|
|
7679
|
+
if (releaseError)
|
|
7680
|
+
throw releaseError;
|
|
7681
|
+
return count;
|
|
7682
|
+
}
|
|
7683
|
+
async function loadScopedNodeIndex(scope) {
|
|
7684
|
+
const metadata = await loadIndexMetadata();
|
|
7685
|
+
if (!metadata || metadata.cacheVersion !== CACHE_FORMAT_VERSION || metadata.scope !== scope) {
|
|
7686
|
+
return null;
|
|
7687
|
+
}
|
|
7688
|
+
const fs = getFileSystem();
|
|
7689
|
+
const indexPath = fs.path.join(await resolveNodeStorageDir(), INDEX_FILE);
|
|
7690
|
+
const [readError, content] = await catchError(fs.readFile(indexPath, "utf-8"));
|
|
7691
|
+
if (readError || content === null)
|
|
7692
|
+
return null;
|
|
7693
|
+
if (await hashContent(content) !== metadata.hash)
|
|
7694
|
+
return null;
|
|
7695
|
+
const [parseError, nodes] = catchError(() => JSON.parse(content));
|
|
7696
|
+
if (parseError || !Array.isArray(nodes))
|
|
7697
|
+
return null;
|
|
7698
|
+
return { nodes, metadata };
|
|
7699
|
+
}
|
|
7521
7700
|
async function loadNodeIndex() {
|
|
7522
7701
|
const fs = getFileSystem();
|
|
7523
7702
|
const dir = await resolveNodeStorageDir();
|
|
@@ -7542,16 +7721,6 @@ async function loadNodeIndex() {
|
|
|
7542
7721
|
}
|
|
7543
7722
|
return parsed;
|
|
7544
7723
|
}
|
|
7545
|
-
async function saveIndexMetadata(metadata) {
|
|
7546
|
-
const fs = getFileSystem();
|
|
7547
|
-
const dir = await resolveNodeStorageDir();
|
|
7548
|
-
await fs.mkdir(dir);
|
|
7549
|
-
const metaPath = fs.path.join(dir, METADATA_FILE);
|
|
7550
|
-
await fs.writeFile(metaPath, JSON.stringify({
|
|
7551
|
-
...metadata,
|
|
7552
|
-
cacheVersion: metadata.cacheVersion ?? CACHE_FORMAT_VERSION
|
|
7553
|
-
}));
|
|
7554
|
-
}
|
|
7555
7724
|
async function loadIndexMetadata() {
|
|
7556
7725
|
const fs = getFileSystem();
|
|
7557
7726
|
const dir = await resolveNodeStorageDir();
|
|
@@ -7614,246 +7783,101 @@ async function areDerivedArtifactsCurrent() {
|
|
|
7614
7783
|
return essentialsIndex !== null;
|
|
7615
7784
|
}
|
|
7616
7785
|
async function rederiveNodeIndexArtifacts() {
|
|
7617
|
-
const
|
|
7618
|
-
|
|
7786
|
+
const fs = getFileSystem();
|
|
7787
|
+
const dir = await resolveNodeStorageDir();
|
|
7788
|
+
await fs.mkdir(dir);
|
|
7789
|
+
const releaseLock = await fs.acquireLock(fs.path.join(dir, WRITE_LOCK_FILE));
|
|
7790
|
+
const [rederiveError, count] = await catchError((async () => {
|
|
7791
|
+
const nodes = await loadNodeIndex();
|
|
7792
|
+
const metadata = await loadIndexMetadata();
|
|
7793
|
+
const hash = await hashContent(JSON.stringify(nodes));
|
|
7794
|
+
const sameNodes = metadata !== null && metadata.hash === hash;
|
|
7795
|
+
const scope = sameNodes ? metadata.scope : undefined;
|
|
7796
|
+
return writeNodeArtifacts(fs, dir, nodes, scope, sameNodes ? metadata.missingSources : undefined);
|
|
7797
|
+
})());
|
|
7798
|
+
const [releaseError] = await catchError(releaseLock());
|
|
7799
|
+
if (rederiveError)
|
|
7800
|
+
throw rederiveError;
|
|
7801
|
+
if (releaseError)
|
|
7802
|
+
throw releaseError;
|
|
7803
|
+
return count;
|
|
7619
7804
|
}
|
|
7620
7805
|
|
|
7621
|
-
// ../maestro-sdk/src/registry/
|
|
7622
|
-
var
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7806
|
+
// ../maestro-sdk/src/registry/node-sync-service.ts
|
|
7807
|
+
var MANIFEST_VALIDATION_SOURCE = "manifest validation";
|
|
7808
|
+
var MANIFEST_VALIDATION_NEXT_STEP = "Fix or remove the tenant resource named in the validation error, then run 'registry pull' again.";
|
|
7809
|
+
var TENANT_MANIFEST_INVALID = "TenantManifestInvalid";
|
|
7810
|
+
|
|
7811
|
+
class TenantManifestInvalidError extends Error {
|
|
7812
|
+
code = TENANT_MANIFEST_INVALID;
|
|
7813
|
+
ootbNodes;
|
|
7814
|
+
constructor(failures, ootbNodes = []) {
|
|
7815
|
+
super(`The tenant manifest failed validation, so only OOTB nodes are available (${failures.map((f) => `${f.source}: ${f.reason}`).join("; ")}). ${MANIFEST_VALIDATION_NEXT_STEP}`);
|
|
7816
|
+
this.name = "TenantManifestInvalidError";
|
|
7817
|
+
this.ootbNodes = ootbNodes;
|
|
7818
|
+
}
|
|
7819
|
+
}
|
|
7820
|
+
function isTenantManifestInvalidError(error) {
|
|
7821
|
+
return error instanceof Error && error.code === TENANT_MANIFEST_INVALID;
|
|
7822
|
+
}
|
|
7823
|
+
var MAX_FAILURE_REASON_LENGTH = 500;
|
|
7824
|
+
function stringifyReason(reason) {
|
|
7825
|
+
if (reason instanceof Error)
|
|
7826
|
+
return reason.message;
|
|
7827
|
+
if (typeof reason === "string")
|
|
7828
|
+
return reason;
|
|
7829
|
+
try {
|
|
7830
|
+
return JSON.stringify(reason) ?? String(reason);
|
|
7831
|
+
} catch {
|
|
7832
|
+
return String(reason);
|
|
7636
7833
|
}
|
|
7637
|
-
return;
|
|
7638
7834
|
}
|
|
7639
|
-
|
|
7640
|
-
const
|
|
7641
|
-
|
|
7642
|
-
const dirsToCheck = [
|
|
7643
|
-
cwd,
|
|
7644
|
-
fs.path.resolve(cwd, ".."),
|
|
7645
|
-
fs.path.resolve(cwd, "../..")
|
|
7646
|
-
];
|
|
7647
|
-
for (const dir of dirsToCheck) {
|
|
7648
|
-
const [readErr, entries] = await catchError(fs.readdir(dir));
|
|
7649
|
-
if (readErr)
|
|
7650
|
-
continue;
|
|
7651
|
-
const uipxName = entries.find((e) => e.endsWith(".uipx"));
|
|
7652
|
-
if (!uipxName)
|
|
7653
|
-
continue;
|
|
7654
|
-
const uipxPath = fs.path.join(dir, uipxName);
|
|
7655
|
-
const [fileErr, content] = await catchError(fs.readFile(uipxPath, "utf-8"));
|
|
7656
|
-
if (fileErr || !content)
|
|
7657
|
-
continue;
|
|
7658
|
-
const [parseErr, parsed] = catchError(() => JSON.parse(content));
|
|
7659
|
-
if (parseErr || !parsed.SolutionId)
|
|
7660
|
-
continue;
|
|
7661
|
-
const projects = parsed.Projects ?? [];
|
|
7662
|
-
return {
|
|
7663
|
-
solutionId: parsed.SolutionId,
|
|
7664
|
-
solutionDir: dir,
|
|
7665
|
-
projects,
|
|
7666
|
-
currentProjectId: findEnclosingProjectId(dir, projects, cwd)
|
|
7667
|
-
};
|
|
7668
|
-
}
|
|
7669
|
-
return null;
|
|
7835
|
+
function describeFailureReason(reason) {
|
|
7836
|
+
const text = stringifyReason(reason);
|
|
7837
|
+
return text.length > MAX_FAILURE_REASON_LENGTH ? `${text.slice(0, MAX_FAILURE_REASON_LENGTH)}...` : text;
|
|
7670
7838
|
}
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
const fromFlow = await readProjectIOFromFlowVariables(projectDir);
|
|
7677
|
-
if (fromFlow)
|
|
7678
|
-
return fromFlow;
|
|
7679
|
-
const fromBuild = await readEntryPointsFile(fs.path.join(projectDir, ".local", "content", "entry-points.json"));
|
|
7680
|
-
if (fromBuild)
|
|
7681
|
-
return fromBuild;
|
|
7682
|
-
return EMPTY_IO;
|
|
7683
|
-
}
|
|
7684
|
-
async function readEntryPointsFile(...candidates) {
|
|
7685
|
-
const fs = getFileSystem();
|
|
7686
|
-
for (const filePath of candidates) {
|
|
7687
|
-
const [err, content] = await catchError(fs.readFile(filePath, "utf-8"));
|
|
7688
|
-
if (err || !content)
|
|
7689
|
-
continue;
|
|
7690
|
-
const [parseErr, parsed] = catchError(() => JSON.parse(content));
|
|
7691
|
-
if (parseErr || !parsed.entryPoints?.length)
|
|
7692
|
-
continue;
|
|
7693
|
-
return extractIOFromEntryPoints(parsed);
|
|
7694
|
-
}
|
|
7695
|
-
return;
|
|
7839
|
+
function toPullFailures(failures) {
|
|
7840
|
+
return failures.map((failure) => ({
|
|
7841
|
+
source: failure.source,
|
|
7842
|
+
reason: describeFailureReason(failure.reason)
|
|
7843
|
+
}));
|
|
7696
7844
|
}
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
if (readErr || !Array.isArray(entries))
|
|
7701
|
-
return;
|
|
7702
|
-
const flowFileName = entries.find((entry) => entry.endsWith(".flow"));
|
|
7703
|
-
if (!flowFileName)
|
|
7704
|
-
return;
|
|
7705
|
-
const flowPath = fs.path.join(projectDir, flowFileName);
|
|
7706
|
-
const [readFileErr, content] = await catchError(fs.readFile(flowPath, "utf-8"));
|
|
7707
|
-
if (readFileErr || !content)
|
|
7708
|
-
return;
|
|
7709
|
-
const [parseErr, parsed] = catchError(() => JSON.parse(content));
|
|
7710
|
-
if (parseErr)
|
|
7711
|
-
return;
|
|
7712
|
-
const globals = parsed.variables?.globals;
|
|
7713
|
-
if (!Array.isArray(globals) || globals.length === 0)
|
|
7714
|
-
return;
|
|
7715
|
-
const inputProps = {};
|
|
7716
|
-
const outputProps = {};
|
|
7717
|
-
for (const variable of globals) {
|
|
7718
|
-
if (!variable?.id || !variable.direction)
|
|
7719
|
-
continue;
|
|
7720
|
-
const schema = {
|
|
7721
|
-
type: variable.type ?? "string"
|
|
7722
|
-
};
|
|
7723
|
-
if (variable.description) {
|
|
7724
|
-
schema.description = variable.description;
|
|
7725
|
-
}
|
|
7726
|
-
if (variable.direction === "in" || variable.direction === "inout") {
|
|
7727
|
-
inputProps[variable.id] = schema;
|
|
7728
|
-
}
|
|
7729
|
-
if (variable.direction === "out" || variable.direction === "inout") {
|
|
7730
|
-
outputProps[variable.id] = schema;
|
|
7731
|
-
}
|
|
7732
|
-
}
|
|
7733
|
-
const hasInputs = Object.keys(inputProps).length > 0;
|
|
7734
|
-
const hasOutputs = Object.keys(outputProps).length > 0;
|
|
7735
|
-
if (!hasInputs && !hasOutputs)
|
|
7845
|
+
var CACHE_EXPIRATION = 30 * 60 * 1000;
|
|
7846
|
+
function loginScope(loginStatus) {
|
|
7847
|
+
if (loginStatus.loginStatus !== "Logged in" || !loginStatus.accessToken) {
|
|
7736
7848
|
return;
|
|
7737
|
-
const synthetic = {
|
|
7738
|
-
entryPoints: [
|
|
7739
|
-
{
|
|
7740
|
-
filePath: flowFileName,
|
|
7741
|
-
input: hasInputs ? { type: "object", properties: inputProps } : undefined,
|
|
7742
|
-
output: hasOutputs ? { type: "object", properties: outputProps } : undefined
|
|
7743
|
-
}
|
|
7744
|
-
]
|
|
7745
|
-
};
|
|
7746
|
-
return extractIOFromEntryPoints(synthetic);
|
|
7747
|
-
}
|
|
7748
|
-
async function readProjectName(projectDir) {
|
|
7749
|
-
const fs = getFileSystem();
|
|
7750
|
-
const uiprojPath = fs.path.join(projectDir, "project.uiproj");
|
|
7751
|
-
const [err, content] = await catchError(fs.readFile(uiprojPath, "utf-8"));
|
|
7752
|
-
if (!err && content) {
|
|
7753
|
-
const [parseErr, parsed] = catchError(() => JSON.parse(content));
|
|
7754
|
-
if (!parseErr && parsed.Name)
|
|
7755
|
-
return parsed.Name;
|
|
7756
7849
|
}
|
|
7757
|
-
return
|
|
7850
|
+
return nodeCacheScope(loginStatus);
|
|
7758
7851
|
}
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
const map = new Map;
|
|
7762
|
-
const processDir = fs.path.join(solutionDir, "resources", "solution_folder", "process");
|
|
7763
|
-
const [dirErr, typeDirs] = await catchError(fs.readdir(processDir));
|
|
7764
|
-
if (dirErr)
|
|
7765
|
-
return map;
|
|
7766
|
-
for (const typeDir of typeDirs) {
|
|
7767
|
-
const typePath = fs.path.join(processDir, typeDir);
|
|
7768
|
-
const [filesErr, files] = await catchError(fs.readdir(typePath));
|
|
7769
|
-
if (filesErr)
|
|
7770
|
-
continue;
|
|
7771
|
-
for (const file of files) {
|
|
7772
|
-
if (!file.endsWith(".json"))
|
|
7773
|
-
continue;
|
|
7774
|
-
const filePath = fs.path.join(typePath, file);
|
|
7775
|
-
const [readErr, content] = await catchError(fs.readFile(filePath, "utf-8"));
|
|
7776
|
-
if (readErr || !content)
|
|
7777
|
-
continue;
|
|
7778
|
-
const [parseErr, parsed] = catchError(() => JSON.parse(content));
|
|
7779
|
-
if (parseErr)
|
|
7780
|
-
continue;
|
|
7781
|
-
const projectKey = parsed.resource?.projectKey;
|
|
7782
|
-
const resourceKey = parsed.resource?.key;
|
|
7783
|
-
if (projectKey && resourceKey) {
|
|
7784
|
-
map.set(projectKey, resourceKey);
|
|
7785
|
-
}
|
|
7786
|
-
}
|
|
7787
|
-
}
|
|
7788
|
-
return map;
|
|
7852
|
+
function isFreshFor(meta, scope) {
|
|
7853
|
+
return meta !== null && scope !== undefined && meta.scope === scope && Date.now() - meta.lastSync < CACHE_EXPIRATION;
|
|
7789
7854
|
}
|
|
7790
|
-
async function buildInSolutionNodeManifests(ctx) {
|
|
7791
|
-
const fs = getFileSystem();
|
|
7792
|
-
const manifests = [];
|
|
7793
|
-
const resourceKeyMap = await loadResourceKeyMap(ctx.solutionDir);
|
|
7794
|
-
for (const project of ctx.projects) {
|
|
7795
|
-
if (ctx.currentProjectId && project.Id === ctx.currentProjectId)
|
|
7796
|
-
continue;
|
|
7797
|
-
const serviceType = getServiceType(project.Type);
|
|
7798
|
-
if (!serviceType)
|
|
7799
|
-
continue;
|
|
7800
|
-
const projectDir = fs.path.resolve(ctx.solutionDir, fs.path.dirname(project.ProjectRelativePath));
|
|
7801
|
-
const reader = getAgentProjectMetadataReader();
|
|
7802
|
-
const [name, io, projectMetadata] = await Promise.all([
|
|
7803
|
-
readProjectName(projectDir),
|
|
7804
|
-
readProjectEntryPointIO(projectDir),
|
|
7805
|
-
reader ? reader(projectDir, project.Type).catch((err) => {
|
|
7806
|
-
logger.debug(`Agent metadata reader failed for ${projectDir}: ${String(err)}`);
|
|
7807
|
-
return {};
|
|
7808
|
-
}) : Promise.resolve({})
|
|
7809
|
-
]);
|
|
7810
|
-
const resourceKey = resourceKeyMap.get(project.Id) ?? project.Id;
|
|
7811
|
-
const task = {
|
|
7812
|
-
name,
|
|
7813
|
-
type: serviceType,
|
|
7814
|
-
resourceKey,
|
|
7815
|
-
inputs: io.inputs,
|
|
7816
|
-
outputs: io.outputs,
|
|
7817
|
-
metadata: {
|
|
7818
|
-
...projectMetadata,
|
|
7819
|
-
description: `(In-solution) ${name}`,
|
|
7820
|
-
key: resourceKey,
|
|
7821
|
-
name,
|
|
7822
|
-
tags: ["in-solution", "local"],
|
|
7823
|
-
projectId: project.Id,
|
|
7824
|
-
entryPointUniqueId: io.entryPointUniqueId,
|
|
7825
|
-
inputProperties: io.inputProperties
|
|
7826
|
-
}
|
|
7827
|
-
};
|
|
7828
|
-
const nodes = taskDefinitionsToNodeManifests({ [resourceKey]: task }, project.Type);
|
|
7829
|
-
manifests.push(...nodes);
|
|
7830
|
-
}
|
|
7831
|
-
return manifests;
|
|
7832
|
-
}
|
|
7833
|
-
|
|
7834
|
-
// ../maestro-sdk/src/registry/node-sync-service.ts
|
|
7835
|
-
var CACHE_EXPIRATION = 30 * 60 * 1000;
|
|
7836
7855
|
function isMissingIndexError(error) {
|
|
7837
7856
|
return error.message.includes("No node index found") || error.message.includes("Node index is outdated");
|
|
7838
7857
|
}
|
|
7839
7858
|
async function pullNodes(options = {}) {
|
|
7840
7859
|
const { force = false } = options;
|
|
7860
|
+
const loginStatus = await getLoginStatusAsync();
|
|
7841
7861
|
if (force) {
|
|
7842
|
-
const refreshResult2 = await refreshNodes();
|
|
7862
|
+
const refreshResult2 = await refreshNodes(loginStatus);
|
|
7843
7863
|
const meta2 = await loadIndexMetadata();
|
|
7844
7864
|
return {
|
|
7845
7865
|
syncedCount: refreshResult2.nodeCount || meta2?.nodeCount || 0,
|
|
7846
7866
|
fromCache: false,
|
|
7847
7867
|
source: refreshResult2.source,
|
|
7848
7868
|
cacheWritten: refreshResult2.cacheWritten,
|
|
7849
|
-
info: refreshResult2.info
|
|
7869
|
+
info: refreshResult2.info,
|
|
7870
|
+
failures: refreshResult2.failures,
|
|
7871
|
+
missingSources: refreshResult2.missingSources
|
|
7850
7872
|
};
|
|
7851
7873
|
}
|
|
7852
7874
|
const meta = await loadIndexMetadata();
|
|
7875
|
+
const scope = loginScope(loginStatus);
|
|
7853
7876
|
if (meta) {
|
|
7854
7877
|
const ageMs = Date.now() - meta.lastSync;
|
|
7855
7878
|
let needsRefresh = false;
|
|
7856
|
-
if (
|
|
7879
|
+
if (isFreshFor(meta, scope)) {
|
|
7880
|
+
let syncedCount = meta.nodeCount;
|
|
7857
7881
|
if (!await areDerivedArtifactsCurrent()) {
|
|
7858
7882
|
const [rederiveError, nodeCount] = await catchError(rederiveNodeIndexArtifacts());
|
|
7859
7883
|
if (rederiveError) {
|
|
@@ -7862,71 +7886,49 @@ async function pullNodes(options = {}) {
|
|
|
7862
7886
|
}
|
|
7863
7887
|
needsRefresh = true;
|
|
7864
7888
|
} else {
|
|
7865
|
-
|
|
7866
|
-
syncedCount: nodeCount,
|
|
7867
|
-
fromCache: true,
|
|
7868
|
-
ageMinutes: Math.round(ageMs / 60000)
|
|
7869
|
-
};
|
|
7889
|
+
syncedCount = nodeCount;
|
|
7870
7890
|
}
|
|
7871
7891
|
}
|
|
7872
|
-
|
|
7892
|
+
const current = await loadIndexMetadata();
|
|
7893
|
+
if (!needsRefresh && isFreshFor(current, scope)) {
|
|
7873
7894
|
return {
|
|
7874
|
-
syncedCount
|
|
7895
|
+
syncedCount,
|
|
7875
7896
|
fromCache: true,
|
|
7876
|
-
ageMinutes: Math.round(ageMs / 60000)
|
|
7897
|
+
ageMinutes: Math.round(ageMs / 60000),
|
|
7898
|
+
missingSources: current.missingSources
|
|
7877
7899
|
};
|
|
7878
7900
|
}
|
|
7879
7901
|
}
|
|
7880
7902
|
}
|
|
7881
|
-
const refreshResult = await refreshNodes();
|
|
7903
|
+
const refreshResult = await refreshNodes(loginStatus);
|
|
7882
7904
|
const refreshedMeta = await loadIndexMetadata();
|
|
7883
7905
|
return {
|
|
7884
7906
|
syncedCount: refreshResult.nodeCount || refreshedMeta?.nodeCount || 0,
|
|
7885
7907
|
fromCache: false,
|
|
7886
7908
|
source: refreshResult.source,
|
|
7887
7909
|
cacheWritten: refreshResult.cacheWritten,
|
|
7888
|
-
info: refreshResult.info
|
|
7910
|
+
info: refreshResult.info,
|
|
7911
|
+
failures: refreshResult.failures,
|
|
7912
|
+
missingSources: refreshResult.missingSources
|
|
7889
7913
|
};
|
|
7890
7914
|
}
|
|
7891
|
-
async function refreshNodes() {
|
|
7892
|
-
const
|
|
7893
|
-
const pullResult = await pullRemoteNodes();
|
|
7894
|
-
const allNodes = pullResult.nodes;
|
|
7915
|
+
async function refreshNodes(loginStatus) {
|
|
7916
|
+
const pullResult = await pullRemoteNodes(loginStatus);
|
|
7895
7917
|
if (!pullResult.cacheable) {
|
|
7896
7918
|
return {
|
|
7897
7919
|
cacheWritten: false,
|
|
7898
|
-
nodeCount:
|
|
7920
|
+
nodeCount: pullResult.nodes.length,
|
|
7899
7921
|
source: pullResult.source,
|
|
7900
|
-
info: pullResult.info
|
|
7901
|
-
|
|
7902
|
-
}
|
|
7903
|
-
const content = JSON.stringify(allNodes);
|
|
7904
|
-
const newHash = await hashContent(content);
|
|
7905
|
-
if (oldMeta && oldMeta.hash === newHash) {
|
|
7906
|
-
if (!await areDerivedArtifactsCurrent()) {
|
|
7907
|
-
await saveNodeIndex(allNodes);
|
|
7908
|
-
return {
|
|
7909
|
-
cacheWritten: true,
|
|
7910
|
-
nodeCount: allNodes.length,
|
|
7911
|
-
source: pullResult.source
|
|
7912
|
-
};
|
|
7913
|
-
}
|
|
7914
|
-
await saveIndexMetadata({
|
|
7915
|
-
lastSync: Date.now(),
|
|
7916
|
-
nodeCount: oldMeta.nodeCount,
|
|
7917
|
-
hash: oldMeta.hash
|
|
7918
|
-
});
|
|
7919
|
-
return {
|
|
7920
|
-
cacheWritten: true,
|
|
7921
|
-
nodeCount: oldMeta.nodeCount,
|
|
7922
|
-
source: pullResult.source
|
|
7922
|
+
info: pullResult.info,
|
|
7923
|
+
failures: pullResult.failures
|
|
7923
7924
|
};
|
|
7924
7925
|
}
|
|
7925
|
-
await
|
|
7926
|
+
const nodeCount = await commitNodeIndex(pullResult.nodes, pullResult.scope, pullResult.missingSources);
|
|
7926
7927
|
return {
|
|
7927
7928
|
cacheWritten: true,
|
|
7928
|
-
nodeCount
|
|
7929
|
-
source: pullResult.source
|
|
7929
|
+
nodeCount,
|
|
7930
|
+
source: pullResult.source,
|
|
7931
|
+
missingSources: pullResult.missingSources
|
|
7930
7932
|
};
|
|
7931
7933
|
}
|
|
7932
7934
|
var ENABLED_MANIFEST_FLAGS = new Set([
|
|
@@ -7948,18 +7950,18 @@ var ENABLED_MANIFEST_FLAGS = new Set([
|
|
|
7948
7950
|
MANIFEST_FEATURE_FLAGS.UPDATE_ENTITY,
|
|
7949
7951
|
MANIFEST_FEATURE_FLAGS.DELETE_ENTITY
|
|
7950
7952
|
]);
|
|
7951
|
-
async function pullRemoteNodes() {
|
|
7952
|
-
|
|
7953
|
+
async function pullRemoteNodes(loginStatus) {
|
|
7954
|
+
loginStatus ??= await getLoginStatusAsync();
|
|
7953
7955
|
const client = new ManifestClient({
|
|
7954
7956
|
baseUrl: loginStatus.baseUrl || "localhost",
|
|
7955
7957
|
getFeatureFlag: (flag) => ENABLED_MANIFEST_FLAGS.has(flag)
|
|
7956
7958
|
});
|
|
7957
7959
|
if (loginStatus.loginStatus !== "Logged in" || !loginStatus.baseUrl || !loginStatus.accessToken || !loginStatus.tenantId || !loginStatus.organizationId) {
|
|
7958
|
-
const
|
|
7960
|
+
const manifest = await client.getManifest({
|
|
7959
7961
|
inlineAgentNodes: true
|
|
7960
7962
|
});
|
|
7961
7963
|
return {
|
|
7962
|
-
nodes:
|
|
7964
|
+
nodes: manifest.nodes || [],
|
|
7963
7965
|
source: "ootb",
|
|
7964
7966
|
cacheable: false,
|
|
7965
7967
|
info: "Using OOTB nodes because you are not logged in. Cache was not updated."
|
|
@@ -7970,7 +7972,7 @@ async function pullRemoteNodes() {
|
|
|
7970
7972
|
tenantId: loginStatus.tenantId,
|
|
7971
7973
|
organizationId: loginStatus.organizationId
|
|
7972
7974
|
};
|
|
7973
|
-
const [manifestError,
|
|
7975
|
+
const [manifestError, diagnostics] = await catchError(client.getManifestWithDiagnostics({
|
|
7974
7976
|
auth: authContext,
|
|
7975
7977
|
includeIntegrationTriggers: true,
|
|
7976
7978
|
inlineAgentNodes: true,
|
|
@@ -7978,10 +7980,32 @@ async function pullRemoteNodes() {
|
|
|
7978
7980
|
excludeIntsvcConnectorHttpRequest: true
|
|
7979
7981
|
}));
|
|
7980
7982
|
if (!manifestError) {
|
|
7983
|
+
const nodes = diagnostics.manifest.nodes || [];
|
|
7984
|
+
if (diagnostics.failures.length === 0) {
|
|
7985
|
+
return {
|
|
7986
|
+
nodes,
|
|
7987
|
+
source: "authenticated",
|
|
7988
|
+
cacheable: true,
|
|
7989
|
+
scope: nodeCacheScope(loginStatus)
|
|
7990
|
+
};
|
|
7991
|
+
}
|
|
7992
|
+
const failures = toPullFailures(diagnostics.failures);
|
|
7993
|
+
const ootbOnly = failures.some((failure) => failure.source === MANIFEST_VALIDATION_SOURCE);
|
|
7994
|
+
if (!ootbOnly) {
|
|
7995
|
+
return {
|
|
7996
|
+
nodes,
|
|
7997
|
+
source: "authenticated",
|
|
7998
|
+
cacheable: true,
|
|
7999
|
+
scope: nodeCacheScope(loginStatus),
|
|
8000
|
+
missingSources: failures
|
|
8001
|
+
};
|
|
8002
|
+
}
|
|
7981
8003
|
return {
|
|
7982
|
-
nodes
|
|
7983
|
-
source: "
|
|
7984
|
-
cacheable:
|
|
8004
|
+
nodes,
|
|
8005
|
+
source: "ootb",
|
|
8006
|
+
cacheable: false,
|
|
8007
|
+
failures,
|
|
8008
|
+
info: "The tenant manifest failed validation; using OOTB nodes without updating cache."
|
|
7985
8009
|
};
|
|
7986
8010
|
}
|
|
7987
8011
|
const fallbackManifest = await client.getManifest({
|
|
@@ -8001,19 +8025,78 @@ async function getNodesWithCacheFallback() {
|
|
|
8001
8025
|
throw error;
|
|
8002
8026
|
}
|
|
8003
8027
|
const pullResult = await pullRemoteNodes();
|
|
8028
|
+
if (pullResult.failures?.length) {
|
|
8029
|
+
throw new TenantManifestInvalidError(pullResult.failures, pullResult.nodes);
|
|
8030
|
+
}
|
|
8004
8031
|
if (pullResult.cacheable) {
|
|
8005
|
-
await saveNodeIndex(pullResult.nodes);
|
|
8032
|
+
await saveNodeIndex(pullResult.nodes, pullResult.scope, pullResult.missingSources);
|
|
8006
8033
|
}
|
|
8007
8034
|
return pullResult.nodes;
|
|
8008
8035
|
}
|
|
8009
8036
|
return nodes;
|
|
8010
8037
|
}
|
|
8011
|
-
async function
|
|
8038
|
+
async function loadCurrentTenantNodes(options = {}) {
|
|
8039
|
+
const [loginError, readStatus] = await catchError(getLoginStatusAsync());
|
|
8040
|
+
const loginStatus = loginError ? { loginStatus: "Not logged in" } : readStatus;
|
|
8041
|
+
const scope = loginScope(loginStatus);
|
|
8042
|
+
if (!options.force && scope !== undefined) {
|
|
8043
|
+
const [, cached] = await catchError(loadScopedNodeIndex(scope));
|
|
8044
|
+
if (cached && isFreshFor(cached.metadata, scope)) {
|
|
8045
|
+
return { nodes: cached.nodes, fromCache: true, source: "cache" };
|
|
8046
|
+
}
|
|
8047
|
+
}
|
|
8048
|
+
const pullResult = await pullRemoteNodes(loginStatus);
|
|
8049
|
+
if (pullResult.cacheable) {
|
|
8050
|
+
await catchError(commitNodeIndex(pullResult.nodes, pullResult.scope, pullResult.missingSources));
|
|
8051
|
+
}
|
|
8052
|
+
return {
|
|
8053
|
+
nodes: pullResult.nodes,
|
|
8054
|
+
fromCache: false,
|
|
8055
|
+
source: pullResult.source,
|
|
8056
|
+
info: pullResult.info
|
|
8057
|
+
};
|
|
8058
|
+
}
|
|
8059
|
+
async function getLocalSolutionSnapshot() {
|
|
8012
8060
|
const ctx = await findSolutionFromCwd();
|
|
8013
8061
|
if (!ctx) {
|
|
8014
8062
|
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.");
|
|
8015
8063
|
}
|
|
8016
|
-
return
|
|
8064
|
+
return buildInSolutionNodes(ctx);
|
|
8065
|
+
}
|
|
8066
|
+
async function getLocalSolutionNodes() {
|
|
8067
|
+
return (await getLocalSolutionSnapshot()).manifests;
|
|
8068
|
+
}
|
|
8069
|
+
function localContractWarning(snapshot, shown) {
|
|
8070
|
+
const types = new Set(shown.map((n) => n.nodeType).filter((t) => typeof t === "string").map((t) => t.toLowerCase()));
|
|
8071
|
+
return unknownContractWarning(snapshot.unknownContracts.filter((p) => p.nodeTypes.some((t) => types.has(t.toLowerCase()))));
|
|
8072
|
+
}
|
|
8073
|
+
function filterNodesByKeyword(nodes, keyword) {
|
|
8074
|
+
const lowerKeyword = keyword.toLowerCase();
|
|
8075
|
+
return nodes.filter((node) => {
|
|
8076
|
+
if (node.nodeType?.toLowerCase().includes(lowerKeyword)) {
|
|
8077
|
+
return true;
|
|
8078
|
+
}
|
|
8079
|
+
if (node.category?.toLowerCase().includes(lowerKeyword)) {
|
|
8080
|
+
return true;
|
|
8081
|
+
}
|
|
8082
|
+
if (node.tags?.some((tag) => tag.toLowerCase().includes(lowerKeyword))) {
|
|
8083
|
+
return true;
|
|
8084
|
+
}
|
|
8085
|
+
if (node.display?.label?.toLowerCase().includes(lowerKeyword)) {
|
|
8086
|
+
return true;
|
|
8087
|
+
}
|
|
8088
|
+
if (node.description?.toLowerCase().includes(lowerKeyword)) {
|
|
8089
|
+
return true;
|
|
8090
|
+
}
|
|
8091
|
+
if (node.display?.description?.toLowerCase().includes(lowerKeyword)) {
|
|
8092
|
+
return true;
|
|
8093
|
+
}
|
|
8094
|
+
return false;
|
|
8095
|
+
});
|
|
8096
|
+
}
|
|
8097
|
+
function findNodeByType(nodes, nodeType) {
|
|
8098
|
+
const lowerNodeType = nodeType.toLowerCase();
|
|
8099
|
+
return nodes.find((node) => node.nodeType?.toLowerCase() === lowerNodeType) ?? null;
|
|
8017
8100
|
}
|
|
8018
8101
|
async function listNodes(options) {
|
|
8019
8102
|
if (options?.local)
|
|
@@ -8124,28 +8207,7 @@ async function searchNodes(keyword, options) {
|
|
|
8124
8207
|
const tenantNodes = await getNodesWithCacheFallback();
|
|
8125
8208
|
nodes = unionWithKnownSdkNodes(tenantNodes);
|
|
8126
8209
|
}
|
|
8127
|
-
|
|
8128
|
-
return nodes.filter((node) => {
|
|
8129
|
-
if (node.nodeType?.toLowerCase().includes(lowerKeyword)) {
|
|
8130
|
-
return true;
|
|
8131
|
-
}
|
|
8132
|
-
if (node.category?.toLowerCase().includes(lowerKeyword)) {
|
|
8133
|
-
return true;
|
|
8134
|
-
}
|
|
8135
|
-
if (node.tags?.some((tag) => tag.toLowerCase().includes(lowerKeyword))) {
|
|
8136
|
-
return true;
|
|
8137
|
-
}
|
|
8138
|
-
if (node.display?.label?.toLowerCase().includes(lowerKeyword)) {
|
|
8139
|
-
return true;
|
|
8140
|
-
}
|
|
8141
|
-
if (node.description?.toLowerCase().includes(lowerKeyword)) {
|
|
8142
|
-
return true;
|
|
8143
|
-
}
|
|
8144
|
-
if (node.display?.description?.toLowerCase().includes(lowerKeyword)) {
|
|
8145
|
-
return true;
|
|
8146
|
-
}
|
|
8147
|
-
return false;
|
|
8148
|
-
});
|
|
8210
|
+
return filterNodesByKeyword(nodes, keyword);
|
|
8149
8211
|
}
|
|
8150
8212
|
async function getNode(nodeType, options) {
|
|
8151
8213
|
const lowerNodeType = nodeType.toLowerCase();
|
|
@@ -8156,13 +8218,23 @@ async function getNode(nodeType, options) {
|
|
|
8156
8218
|
}
|
|
8157
8219
|
if (!options?.local && isEssentialNodeType(nodeType)) {
|
|
8158
8220
|
const essentials = await loadEssentialsIndexWithRepair();
|
|
8159
|
-
const
|
|
8160
|
-
if (
|
|
8161
|
-
return
|
|
8221
|
+
const node = essentials?.find((node2) => node2.nodeType?.toLowerCase() === lowerNodeType) ?? null;
|
|
8222
|
+
if (node)
|
|
8223
|
+
return node;
|
|
8162
8224
|
}
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8225
|
+
if (options?.local) {
|
|
8226
|
+
return findNodeByType(await getLocalSolutionNodes(), nodeType);
|
|
8227
|
+
}
|
|
8228
|
+
const [error, nodes] = await catchError(getNodesWithCacheFallback());
|
|
8229
|
+
if (error) {
|
|
8230
|
+
if (error instanceof TenantManifestInvalidError) {
|
|
8231
|
+
const ootbNode = findNodeByType(error.ootbNodes, nodeType);
|
|
8232
|
+
if (ootbNode)
|
|
8233
|
+
return ootbNode;
|
|
8234
|
+
}
|
|
8235
|
+
throw error;
|
|
8236
|
+
}
|
|
8237
|
+
return findNodeByType(nodes, nodeType);
|
|
8166
8238
|
}
|
|
8167
8239
|
async function getNodeEnriched(nodeType, connectionId, options) {
|
|
8168
8240
|
const node = await getNode(nodeType, options);
|
|
@@ -8171,6 +8243,16 @@ async function getNodeEnriched(nodeType, connectionId, options) {
|
|
|
8171
8243
|
}
|
|
8172
8244
|
return await enrichConnectorNode(node, connectionId);
|
|
8173
8245
|
}
|
|
8246
|
+
async function getLocalNodeEnriched(nodeType, connectionId) {
|
|
8247
|
+
const snapshot = await getLocalSolutionSnapshot();
|
|
8248
|
+
const node = findNodeByType(snapshot.manifests, nodeType);
|
|
8249
|
+
if (!node)
|
|
8250
|
+
return { node: null };
|
|
8251
|
+
return {
|
|
8252
|
+
node: await enrichConnectorNode(node, connectionId),
|
|
8253
|
+
warning: localContractWarning(snapshot, [node])
|
|
8254
|
+
};
|
|
8255
|
+
}
|
|
8174
8256
|
async function searchNodesWithFilters(keyword, filters, options) {
|
|
8175
8257
|
let nodes;
|
|
8176
8258
|
if (options?.local) {
|
|
@@ -8182,6 +8264,6 @@ async function searchNodesWithFilters(keyword, filters, options) {
|
|
|
8182
8264
|
return searchWithFilters(nodes, keyword, filters);
|
|
8183
8265
|
}
|
|
8184
8266
|
|
|
8185
|
-
export { ACTIVITY_VERSION_V4, isV4ActivityConfiguration, FilterNotSupportedError, substituteFilterVariables, MANAGED_HTTP_CONNECTOR_KEY, buildActivityEssentialConfiguration,
|
|
8267
|
+
export { ACTIVITY_VERSION_V4, isV4ActivityConfiguration, storedActivityBindings, planResourceBindings, FilterNotSupportedError, substituteFilterVariables, MANAGED_HTTP_CONNECTOR_KEY, buildActivityEssentialConfiguration, configureActivityClient, applySavedFilterTree, assertActivityMetadataResolved, buildManagedHttpEssentialConfiguration, extractMultipartParameters, inlineMultipartFileValues, isListOperation, buildInputMetadata, normalizeHttpMethod, validateIntSvcNode, isConnectorNode, getConnectorInfo, fetchConnectionInfo, fetchConnectorMetadata, fetchConnectorActivityMetadataV4, MANIFEST_VALIDATION_NEXT_STEP, TenantManifestInvalidError, isTenantManifestInvalidError, pullNodes, pullRemoteNodes, loadCurrentTenantNodes, getLocalSolutionSnapshot, localContractWarning, filterNodesByKeyword, findNodeByType, listNodes, searchNodeSummariesWithAvailability, searchNodes, getNode, getNodeEnriched, getLocalNodeEnriched, searchNodesWithFilters };
|
|
8186
8268
|
|
|
8187
|
-
//# debugId=
|
|
8269
|
+
//# debugId=E08A55B7C74E5E3864756E2164756E21
|