@uipath/case-tool 1.204.0 → 1.205.0-preview.258
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 +24 -11
- package/dist/{authoring-6ckkzfc9.js → authoring-kqh34zzm.js} +49 -30
- package/dist/{business-rule-export-kg5bk8aw.js → business-rule-export-ey588rv7.js} +2 -2
- package/dist/canvas-notes-86fxx1t8.js +19 -0
- package/dist/{case-api-rvamfn02.js → case-api-sme7esce.js} +6 -6
- package/dist/case-bindings-service-cht20gqt.js +430 -0
- package/dist/case-debug-solution-projects-h3w2nx0a.js +34 -0
- package/dist/{case-debug-studio-web-service-xxfesw4v.js → case-debug-studio-web-service-3mkrtaet.js} +16 -10
- package/dist/{case-described-io-service-14hdnqcc.js → case-described-io-service-dx1f4nxe.js} +37 -11
- package/dist/case-event-trigger-bindings-g9ftnm4x.js +16 -0
- package/dist/{case-format-service-yb48785t.js → case-format-service-6aew6tqc.js} +2 -2
- package/dist/{case-pack-service-9185h6ez.js → case-pack-service-pqq8wnfd.js} +6 -6
- package/dist/case-schema-version-h820ne16.js +20 -0
- package/dist/{case-shape-reader-mw58avr0.js → case-shape-reader-dsbraetf.js} +1 -1
- package/dist/{case-splice-service-tkmb7xjp.js → case-splice-service-s5gccctq.js} +53 -8
- package/dist/{case-validate-service-c84e2bhv.js → case-validate-service-rey6btew.js} +128 -42
- package/dist/{connector-enrichment-service-hfv0kwht.js → connector-enrichment-service-crqs2216.js} +23 -20
- package/dist/{connector-lookup-service-whgjceyj.js → connector-lookup-service-dwv8q5eh.js} +6 -6
- package/dist/connector-task-shape-mpazkf7s.js +14 -0
- package/dist/{connector-task-spec-k0cwavrm.js → connector-task-spec-trs4tcb3.js} +196 -40
- 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-service-ch3v6jmm.js → debug-service-7q98j726.js} +3 -3
- package/dist/{embedded-file-reader-v8c2yj2a.js → embedded-file-reader-r66242ey.js} +2 -2
- 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/{enrichment-service-3f1kygjs.js → enrichment-service-hv7ff88p.js} +56 -12
- package/dist/{es-7SE7HX2X-8yh1aj2y.js → es-4UBUTCQA-m1ytpyx2.js} +29 -2
- 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-XXZJGC4R-2mr8jtgm.js → es-MX-TWZBRAXK-gqd9swzw.js} +237 -30
- package/dist/filter-engine-7ep90g7f.js +11 -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/index-332n0kxj.js +282 -0
- package/dist/{index-wmffgzmr.js → index-5dxh9z60.js} +21751 -11098
- package/dist/{index-aw2gqqat.js → index-a2fvrrth.js} +4 -4
- package/dist/{index-4yanx3rn.js → index-ekwtgx7y.js} +1089 -218
- package/dist/{index-ng2f77my.js → index-fyc0k5dd.js} +985 -617
- package/dist/index-n9qvnx4x.js +29 -0
- package/dist/{index-hhsf00x8.js → index-ngs0a2he.js} +1 -1
- package/dist/{index-j2r3jb6c.js → index-xq6ajhgq.js} +2 -2
- package/dist/index.js +12 -12
- package/dist/init-entry-points-hhpv3e3f.js +98 -0
- package/dist/{input-reader-1tcqt27f.js → input-reader-c7wz8ra2.js} +3 -3
- package/dist/{ja-UTQEAP34-8e0q6swp.js → ja-43QL7CGO-c3q8gre9.js} +29 -2
- package/dist/{ja-Q5PXKJ2V-p4msxzjd.js → ja-U2MCNHGT-gz0ap1jk.js} +235 -28
- package/dist/{known-types-0h9kqwyy.js → known-types-jvkdgmzz.js} +5 -4
- 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/localSolutionDiscovery-yyx234ak.js +13 -0
- package/dist/migration-diagnosis-ns5cw4e3.js +99 -0
- package/dist/{node-strategy-5pz40tee.js → node-strategy-v442hwgd.js} +1 -1
- package/dist/node-sync-service-1wkcyn1n.js +57 -0
- package/dist/out-target-wjgmna0r.js +111 -0
- package/dist/{packager-tool-85q4f3pq.js → packager-tool-1pcmxqny.js} +3 -3
- package/dist/{packager-tool-8a9yqfq7.js → packager-tool-1yfw674x.js} +4 -2
- package/dist/{packager-tool-pdhhzfr5.js → packager-tool-29x6vran.js} +296 -417
- package/dist/packager-tool-2sn7d8fd.js +41 -0
- package/dist/packager-tool-4p11fvf4.js +92 -0
- package/dist/{packager-tool-25hng8h4.js → packager-tool-4rtktkhv.js} +16211 -13084
- package/dist/{packager-tool-yfm83bzd.js → packager-tool-67vy1fz3.js} +4 -3
- package/dist/{packager-tool-d88rqwk8.js → packager-tool-6z1hsm2h.js} +13 -5
- package/dist/packager-tool-7hw344bt.js +107 -0
- package/dist/{packager-tool-3q3d1hk8.js → packager-tool-83v804p7.js} +56 -6
- package/dist/{packager-tool-00y70spr.js → packager-tool-87y6xw3a.js} +2 -1
- package/dist/packager-tool-93mdeqay.js +18 -0
- package/dist/{packager-tool-64rg5ekd.js → packager-tool-9e59z4d6.js} +75 -7
- package/dist/{packager-tool-vepqrsse.js → packager-tool-9kf3fqtr.js} +2 -2
- package/dist/packager-tool-9kvkzc05.js +74 -0
- package/dist/{packager-tool-s6619wtx.js → packager-tool-9sd483vs.js} +2 -2
- package/dist/{packager-tool-f78ntj5g.js → packager-tool-9y1w2wds.js} +51 -6
- package/dist/packager-tool-a17g0pj1.js +62 -0
- package/dist/{packager-tool-167qap9m.js → packager-tool-aagnvyba.js} +845 -38
- package/dist/{packager-tool-0p6dbsp0.js → packager-tool-c5q10254.js} +5 -5
- package/dist/{packager-tool-wj9d9mqe.js → packager-tool-e15kqpyh.js} +12 -13
- package/dist/{packager-tool-c31qx8kc.js → packager-tool-ezds6t5e.js} +2 -2
- package/dist/{packager-tool-d3zvghjd.js → packager-tool-f2z2dscy.js} +308 -120
- package/dist/{packager-tool-hvzjm2nk.js → packager-tool-f8vwy92w.js} +2093 -5805
- package/dist/{packager-tool-rgpdaxbx.js → packager-tool-gx2cer6a.js} +5385 -1098
- package/dist/{packager-tool-xdxr3ync.js → packager-tool-hdxtgckw.js} +11 -1
- package/dist/{packager-tool-mr149jsw.js → packager-tool-k5cpxdm4.js} +17 -7
- package/dist/packager-tool-k6jbedyc.js +69 -0
- package/dist/packager-tool-kdhey8gz.js +153 -0
- package/dist/{packager-tool-cenvh23g.js → packager-tool-kyrm4e5m.js} +718 -87
- package/dist/packager-tool-mqy97y5f.js +52 -0
- package/dist/{packager-tool-jfysbxdt.js → packager-tool-mzf4gmph.js} +4 -4
- package/dist/packager-tool-n7w9wx62.js +25 -0
- package/dist/{packager-tool-7q6z6npd.js → packager-tool-pcvhcn2k.js} +93 -11
- package/dist/packager-tool-r0x3qh59.js +307 -0
- package/dist/{packager-tool-w1b5pyj6.js → packager-tool-r6b5ktzb.js} +730 -14
- package/dist/{packager-tool-zbrda9sn.js → packager-tool-rk25wp3c.js} +1 -1
- package/dist/{packager-tool-xcd87qyx.js → packager-tool-v2kcgjbf.js} +2 -3
- package/dist/{case-bindings-service-d9vezn69.js → packager-tool-wekqkmgn.js} +20 -231
- package/dist/packager-tool-yct6zp4m.js +335 -0
- package/dist/{packager-tool-kpqr938m.js → packager-tool-ydyvtknp.js} +26 -3
- package/dist/{packager-tool-v99ygh9f.js → packager-tool-yn33pw57.js} +124 -58
- package/dist/{packager-tool-4rqd21wc.js → packager-tool-yn7r7zq2.js} +19 -5
- package/dist/{packager-tool-cmwets3m.js → packager-tool-zf8f9pmm.js} +1 -1
- package/dist/packager-tool.js +3 -3
- package/dist/{project-artifacts-rng5m6r2.js → project-artifacts-bgyyb0dm.js} +1 -1
- 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-3DIO5QWG-59b3f4bc.js → pt-RMIAKZB4-67enhx3m.js} +29 -2
- package/dist/{pt-ROXU257Y-2f6bxev4.js → pt-TO2DARY2-ftcce1bv.js} +237 -30
- package/dist/{resolved-check-p99hysaw.js → resolved-check-aqw7568y.js} +1 -1
- package/dist/{resourcesSyncService-zwjyp1qx.js → resourcesSyncService-d302jnap.js} +32 -170
- 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/{sdd-convert-service-vf0ps358.js → sdd-convert-service-8jpew7vz.js} +686 -445
- package/dist/{sdd-lookup-dwzpvvwn.js → sdd-lookup-fe900sdb.js} +2 -2
- package/dist/{sdd-resolve-service-mjqad2nn.js → sdd-resolve-service-qdtmxw9b.js} +38 -13
- package/dist/sdd-resolve-siblings-6kfxc2t6.js +53 -0
- package/dist/{solution-auth-kddmbm0p.js → solution-auth-30yycqtv.js} +3 -3
- package/dist/solution-discovery-g6ksnrg1.js +38 -0
- package/dist/{strict-case-rules-tz37bspw.js → strict-case-rules-4tjcaznr.js} +3 -2
- package/dist/{strict-entry-points-v14d7y50.js → strict-entry-points-g2pd4mf4.js} +29 -1
- package/dist/{strict-sdd-audit-4aqdeh59.js → strict-sdd-audit-q7tb9yj7.js} +7 -5
- package/dist/task-type-declaration-7a8fqdvs.js +46 -0
- package/dist/tool.js +12 -12
- package/dist/{tr-5IIHSFW5-hw4cewew.js → tr-GDTLECMM-k5fhmq13.js} +29 -2
- package/dist/{tr-JMIP7ZSL-c39b6pe4.js → tr-M3F5A6AU-bb0tg39m.js} +235 -28
- package/dist/{trigger-enrichment-service-g3vt051f.js → trigger-enrichment-service-sj0p2d1j.js} +23 -20
- package/dist/trigger-entry-point-id-yhqwnkx9.js +15 -0
- package/dist/{zh-CN-IFFXSEJS-9wm9gmrv.js → zh-CN-C5G4PC7C-ds9gkptg.js} +235 -28
- 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-IYBNYAMG-8727c7v2.js → zh-TW-62HZIG6O-787kdwex.js} +234 -27
- package/package.json +2 -2
- package/dist/migration-diagnosis-ag2sgd1e.js +0 -71
- package/dist/node-sync-service-2tfrgbjs.js +0 -36
- package/dist/out-target-jakehnd3.js +0 -70
- package/dist/packager-tool-57pzrd0g.js +0 -32
- package/dist/packager-tool-dthjwajc.js +0 -13
- package/dist/packager-tool-xy04yy0v.js +0 -32
|
@@ -1,137 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveMaestroRegistry
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-ezds6t5e.js";
|
|
4
4
|
import {
|
|
5
5
|
ConnectionsApi,
|
|
6
6
|
ElementsApi,
|
|
7
7
|
createApiClient,
|
|
8
8
|
getConnectorActivityMetadataV4,
|
|
9
9
|
isV4ActivityConfiguration
|
|
10
|
-
} from "./packager-tool-
|
|
10
|
+
} from "./packager-tool-r6b5ktzb.js";
|
|
11
|
+
import {
|
|
12
|
+
searchWithFilters
|
|
13
|
+
} from "./packager-tool-7hw344bt.js";
|
|
14
|
+
import {
|
|
15
|
+
listKnownSdkNodes
|
|
16
|
+
} from "./packager-tool-n7w9wx62.js";
|
|
17
|
+
import {
|
|
18
|
+
buildInSolutionNodes,
|
|
19
|
+
findSolutionFromCwd,
|
|
20
|
+
unknownContractWarning
|
|
21
|
+
} from "./packager-tool-yct6zp4m.js";
|
|
11
22
|
import {
|
|
12
23
|
MANIFEST_FEATURE_FLAGS,
|
|
13
|
-
ManifestClient
|
|
14
|
-
|
|
15
|
-
getServiceType,
|
|
16
|
-
listKnownSdkNodes,
|
|
17
|
-
taskDefinitionsToNodeManifests
|
|
18
|
-
} from "./packager-tool-25hng8h4.js";
|
|
24
|
+
ManifestClient
|
|
25
|
+
} from "./packager-tool-4rtktkhv.js";
|
|
19
26
|
import {
|
|
20
27
|
getLoginStatusAsync
|
|
21
|
-
} from "./packager-tool-
|
|
28
|
+
} from "./packager-tool-yn33pw57.js";
|
|
22
29
|
import {
|
|
23
30
|
UIPATH_HOME_DIR,
|
|
24
31
|
catchError,
|
|
25
32
|
hashContent,
|
|
26
33
|
logger
|
|
27
|
-
} from "./packager-tool-
|
|
34
|
+
} from "./packager-tool-83v804p7.js";
|
|
28
35
|
import {
|
|
29
36
|
getFileSystem
|
|
30
|
-
} from "./packager-tool-
|
|
31
|
-
|
|
32
|
-
// ../maestro-sdk/src/registry/filter-engine.ts
|
|
33
|
-
function filterNodes(nodes, parsedFilters) {
|
|
34
|
-
if (!parsedFilters.filters || parsedFilters.filters.length === 0) {
|
|
35
|
-
return nodes;
|
|
36
|
-
}
|
|
37
|
-
return nodes.filter((node) => {
|
|
38
|
-
if (parsedFilters.logic === "AND") {
|
|
39
|
-
return parsedFilters.filters.every((condition) => matchesCondition(node, condition));
|
|
40
|
-
} else {
|
|
41
|
-
return parsedFilters.filters.some((condition) => matchesCondition(node, condition));
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
function matchesCondition(node, condition) {
|
|
46
|
-
const fieldValue = getFieldValue(node, condition.field);
|
|
47
|
-
if (fieldValue === null || fieldValue === undefined) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
const searchValue = condition.value.toString().toLowerCase();
|
|
51
|
-
if (Array.isArray(fieldValue)) {
|
|
52
|
-
return matchesArrayField(fieldValue, condition.operator, searchValue);
|
|
53
|
-
}
|
|
54
|
-
const fieldString = fieldValue.toString().toLowerCase();
|
|
55
|
-
switch (condition.operator) {
|
|
56
|
-
case "equals":
|
|
57
|
-
return fieldString === searchValue;
|
|
58
|
-
case "contains":
|
|
59
|
-
return fieldString.includes(searchValue);
|
|
60
|
-
case "startsWith":
|
|
61
|
-
return fieldString.startsWith(searchValue);
|
|
62
|
-
case "endsWith":
|
|
63
|
-
return fieldString.endsWith(searchValue);
|
|
64
|
-
case "in": {
|
|
65
|
-
const values = searchValue.split(",").map((v) => v.trim());
|
|
66
|
-
return values.includes(fieldString);
|
|
67
|
-
}
|
|
68
|
-
default:
|
|
69
|
-
return fieldString === searchValue;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function matchesArrayField(arrayValue, operator, searchValue) {
|
|
73
|
-
const lowerArray = arrayValue.map((v) => v.toLowerCase());
|
|
74
|
-
switch (operator) {
|
|
75
|
-
case "equals":
|
|
76
|
-
return lowerArray.includes(searchValue);
|
|
77
|
-
case "contains":
|
|
78
|
-
return lowerArray.some((tag) => tag.includes(searchValue));
|
|
79
|
-
case "in": {
|
|
80
|
-
const values = searchValue.split(",").map((v) => v.trim());
|
|
81
|
-
return lowerArray.some((tag) => values.includes(tag));
|
|
82
|
-
}
|
|
83
|
-
default:
|
|
84
|
-
return lowerArray.includes(searchValue);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function getFieldValue(node, field) {
|
|
88
|
-
switch (field) {
|
|
89
|
-
case "category":
|
|
90
|
-
return node.category;
|
|
91
|
-
case "type":
|
|
92
|
-
case "nodetype":
|
|
93
|
-
return node.nodeType;
|
|
94
|
-
case "tags":
|
|
95
|
-
return node.tags;
|
|
96
|
-
case "displayname":
|
|
97
|
-
return node.display?.label;
|
|
98
|
-
case "description":
|
|
99
|
-
return node.description ?? node.display?.description;
|
|
100
|
-
default:
|
|
101
|
-
return node[field];
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function searchWithFilters(nodes, keyword, filters) {
|
|
105
|
-
let results = nodes;
|
|
106
|
-
if (filters && filters.filters.length > 0) {
|
|
107
|
-
results = filterNodes(results, filters);
|
|
108
|
-
}
|
|
109
|
-
if (keyword && keyword.trim() !== "") {
|
|
110
|
-
const lowerKeyword = keyword.toLowerCase();
|
|
111
|
-
results = results.filter((node) => {
|
|
112
|
-
if (node.nodeType?.toLowerCase().includes(lowerKeyword)) {
|
|
113
|
-
return true;
|
|
114
|
-
}
|
|
115
|
-
if (node.category?.toLowerCase().includes(lowerKeyword)) {
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
if (node.tags?.some((tag) => tag.toLowerCase().includes(lowerKeyword))) {
|
|
119
|
-
return true;
|
|
120
|
-
}
|
|
121
|
-
if (node.display?.label?.toLowerCase().includes(lowerKeyword)) {
|
|
122
|
-
return true;
|
|
123
|
-
}
|
|
124
|
-
if (node.description?.toString().toLowerCase().includes(lowerKeyword)) {
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
if (node.display?.description?.toLowerCase().includes(lowerKeyword)) {
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
return false;
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
return results;
|
|
134
|
-
}
|
|
37
|
+
} from "./packager-tool-hdxtgckw.js";
|
|
135
38
|
|
|
136
39
|
// ../maestro-sdk/src/registry/integration-service-fetcher.ts
|
|
137
40
|
function parseContext(node) {
|
|
@@ -273,6 +176,22 @@ function getConnectorConfiguration(node) {
|
|
|
273
176
|
const [err, parsed] = catchError(() => JSON.parse(configStr));
|
|
274
177
|
return err ? null : parsed;
|
|
275
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
|
+
}
|
|
276
195
|
async function fetchConnectionInfo(connectionId) {
|
|
277
196
|
const api = await createApiClient(ConnectionsApi);
|
|
278
197
|
const response = await api.apiV1ConnectionsConnectionIdGet({
|
|
@@ -454,12 +373,20 @@ async function getPrecacheNode(nodeType, options) {
|
|
|
454
373
|
}
|
|
455
374
|
|
|
456
375
|
// ../maestro-sdk/src/registry/node-storage.ts
|
|
457
|
-
var CACHE_FORMAT_VERSION =
|
|
376
|
+
var CACHE_FORMAT_VERSION = 6;
|
|
458
377
|
var INDEX_FILE = "index.json";
|
|
459
378
|
var METADATA_FILE = "index.meta.json";
|
|
460
379
|
var SEARCH_INDEX_FILE = "search-index.json";
|
|
461
380
|
var ESSENTIALS_INDEX_FILE = "get-essentials.json";
|
|
462
381
|
var WRITE_LOCK_FILE = ".index-write.lock";
|
|
382
|
+
function nodeCacheScope(login) {
|
|
383
|
+
const baseUrl = login.baseUrl?.trim().replace(/\/+$/, "");
|
|
384
|
+
const organizationId = login.organizationId?.trim();
|
|
385
|
+
const tenantId = login.tenantId?.trim();
|
|
386
|
+
if (!baseUrl || !organizationId || !tenantId)
|
|
387
|
+
return;
|
|
388
|
+
return [baseUrl, organizationId, tenantId].join("|").toLowerCase();
|
|
389
|
+
}
|
|
463
390
|
async function resolveNodeStorageDir() {
|
|
464
391
|
const fs = getFileSystem();
|
|
465
392
|
return fs.path.join(fs.env.homedir(), UIPATH_HOME_DIR, "nodes");
|
|
@@ -505,7 +432,7 @@ async function writeTempAndRename(fs, targetPath, content) {
|
|
|
505
432
|
await fs.writeFile(tempPath, content);
|
|
506
433
|
await fs.rename(tempPath, targetPath);
|
|
507
434
|
}
|
|
508
|
-
async function writeNodeArtifacts(fs, dir, nodes) {
|
|
435
|
+
async function writeNodeArtifacts(fs, dir, nodes, scope, missingSources) {
|
|
509
436
|
const indexPath = fs.path.join(dir, INDEX_FILE);
|
|
510
437
|
const searchIndexPath = fs.path.join(dir, SEARCH_INDEX_FILE);
|
|
511
438
|
const essentialsIndexPath = fs.path.join(dir, ESSENTIALS_INDEX_FILE);
|
|
@@ -518,7 +445,9 @@ async function writeNodeArtifacts(fs, dir, nodes) {
|
|
|
518
445
|
lastSync: Date.now(),
|
|
519
446
|
nodeCount: nodes.length,
|
|
520
447
|
hash,
|
|
521
|
-
cacheVersion: CACHE_FORMAT_VERSION
|
|
448
|
+
cacheVersion: CACHE_FORMAT_VERSION,
|
|
449
|
+
...scope && { scope },
|
|
450
|
+
...missingSources?.length && { missingSources }
|
|
522
451
|
});
|
|
523
452
|
await writeTempAndRename(fs, searchIndexPath, searchContent);
|
|
524
453
|
await writeTempAndRename(fs, essentialsIndexPath, essentialsContent);
|
|
@@ -526,7 +455,7 @@ async function writeNodeArtifacts(fs, dir, nodes) {
|
|
|
526
455
|
await writeTempAndRename(fs, metaPath, metadataContent);
|
|
527
456
|
return nodes.length;
|
|
528
457
|
}
|
|
529
|
-
async function saveNodeIndex(nodes) {
|
|
458
|
+
async function saveNodeIndex(nodes, scope, missingSources) {
|
|
530
459
|
const fs = getFileSystem();
|
|
531
460
|
const dir = await resolveNodeStorageDir();
|
|
532
461
|
await fs.mkdir(dir);
|
|
@@ -535,7 +464,7 @@ async function saveNodeIndex(nodes) {
|
|
|
535
464
|
let result;
|
|
536
465
|
let writeError;
|
|
537
466
|
try {
|
|
538
|
-
result = await writeNodeArtifacts(fs, dir, nodes);
|
|
467
|
+
result = await writeNodeArtifacts(fs, dir, nodes, scope, missingSources);
|
|
539
468
|
} catch (error) {
|
|
540
469
|
writeError = error;
|
|
541
470
|
}
|
|
@@ -549,6 +478,49 @@ async function saveNodeIndex(nodes) {
|
|
|
549
478
|
}
|
|
550
479
|
return result;
|
|
551
480
|
}
|
|
481
|
+
async function commitNodeIndex(nodes, scope, missingSources) {
|
|
482
|
+
const fs = getFileSystem();
|
|
483
|
+
const dir = await resolveNodeStorageDir();
|
|
484
|
+
await fs.mkdir(dir);
|
|
485
|
+
const releaseLock = await fs.acquireLock(fs.path.join(dir, WRITE_LOCK_FILE));
|
|
486
|
+
const [writeError, count] = await catchError((async () => {
|
|
487
|
+
const current = await loadIndexMetadata();
|
|
488
|
+
const hash = await hashContent(JSON.stringify(nodes));
|
|
489
|
+
if (current && current.cacheVersion === CACHE_FORMAT_VERSION && current.hash === hash && current.scope === scope && await areDerivedArtifactsCurrent()) {
|
|
490
|
+
const { missingSources: _previous, ...rest } = current;
|
|
491
|
+
await writeTempAndRename(fs, fs.path.join(dir, METADATA_FILE), JSON.stringify({
|
|
492
|
+
...rest,
|
|
493
|
+
lastSync: Date.now(),
|
|
494
|
+
...missingSources?.length && { missingSources }
|
|
495
|
+
}));
|
|
496
|
+
return current.nodeCount;
|
|
497
|
+
}
|
|
498
|
+
return writeNodeArtifacts(fs, dir, nodes, scope, missingSources);
|
|
499
|
+
})());
|
|
500
|
+
const [releaseError] = await catchError(releaseLock());
|
|
501
|
+
if (writeError)
|
|
502
|
+
throw writeError;
|
|
503
|
+
if (releaseError)
|
|
504
|
+
throw releaseError;
|
|
505
|
+
return count;
|
|
506
|
+
}
|
|
507
|
+
async function loadScopedNodeIndex(scope) {
|
|
508
|
+
const metadata = await loadIndexMetadata();
|
|
509
|
+
if (!metadata || metadata.cacheVersion !== CACHE_FORMAT_VERSION || metadata.scope !== scope) {
|
|
510
|
+
return null;
|
|
511
|
+
}
|
|
512
|
+
const fs = getFileSystem();
|
|
513
|
+
const indexPath = fs.path.join(await resolveNodeStorageDir(), INDEX_FILE);
|
|
514
|
+
const [readError, content] = await catchError(fs.readFile(indexPath, "utf-8"));
|
|
515
|
+
if (readError || content === null)
|
|
516
|
+
return null;
|
|
517
|
+
if (await hashContent(content) !== metadata.hash)
|
|
518
|
+
return null;
|
|
519
|
+
const [parseError, nodes] = catchError(() => JSON.parse(content));
|
|
520
|
+
if (parseError || !Array.isArray(nodes))
|
|
521
|
+
return null;
|
|
522
|
+
return { nodes, metadata };
|
|
523
|
+
}
|
|
552
524
|
async function loadNodeIndex() {
|
|
553
525
|
const fs = getFileSystem();
|
|
554
526
|
const dir = await resolveNodeStorageDir();
|
|
@@ -645,252 +617,101 @@ async function areDerivedArtifactsCurrent() {
|
|
|
645
617
|
return essentialsIndex !== null;
|
|
646
618
|
}
|
|
647
619
|
async function rederiveNodeIndexArtifacts() {
|
|
648
|
-
const
|
|
649
|
-
|
|
620
|
+
const fs = getFileSystem();
|
|
621
|
+
const dir = await resolveNodeStorageDir();
|
|
622
|
+
await fs.mkdir(dir);
|
|
623
|
+
const releaseLock = await fs.acquireLock(fs.path.join(dir, WRITE_LOCK_FILE));
|
|
624
|
+
const [rederiveError, count] = await catchError((async () => {
|
|
625
|
+
const nodes = await loadNodeIndex();
|
|
626
|
+
const metadata = await loadIndexMetadata();
|
|
627
|
+
const hash = await hashContent(JSON.stringify(nodes));
|
|
628
|
+
const sameNodes = metadata !== null && metadata.hash === hash;
|
|
629
|
+
const scope = sameNodes ? metadata.scope : undefined;
|
|
630
|
+
return writeNodeArtifacts(fs, dir, nodes, scope, sameNodes ? metadata.missingSources : undefined);
|
|
631
|
+
})());
|
|
632
|
+
const [releaseError] = await catchError(releaseLock());
|
|
633
|
+
if (rederiveError)
|
|
634
|
+
throw rederiveError;
|
|
635
|
+
if (releaseError)
|
|
636
|
+
throw releaseError;
|
|
637
|
+
return count;
|
|
650
638
|
}
|
|
651
639
|
|
|
652
|
-
// ../maestro-sdk/src/registry/
|
|
653
|
-
var
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
}
|
|
640
|
+
// ../maestro-sdk/src/registry/node-sync-service.ts
|
|
641
|
+
var MANIFEST_VALIDATION_SOURCE = "manifest validation";
|
|
642
|
+
var MANIFEST_VALIDATION_NEXT_STEP = "Fix or remove the tenant resource named in the validation error, then run 'registry pull' again.";
|
|
643
|
+
var TENANT_MANIFEST_INVALID = "TenantManifestInvalid";
|
|
657
644
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
};
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
for (const p of projects) {
|
|
666
|
-
const projDir = fs.path.resolve(solutionDir, fs.path.dirname(p.ProjectRelativePath));
|
|
667
|
-
if (cwd === projDir)
|
|
668
|
-
return p.Id;
|
|
669
|
-
const rel = fs.path.relative(projDir, cwd);
|
|
670
|
-
if (rel !== "" && !rel.startsWith("..") && !fs.path.isAbsolute(rel)) {
|
|
671
|
-
return p.Id;
|
|
672
|
-
}
|
|
645
|
+
class TenantManifestInvalidError extends Error {
|
|
646
|
+
code = TENANT_MANIFEST_INVALID;
|
|
647
|
+
ootbNodes;
|
|
648
|
+
constructor(failures, ootbNodes = []) {
|
|
649
|
+
super(`The tenant manifest failed validation, so only OOTB nodes are available (${failures.map((f) => `${f.source}: ${f.reason}`).join("; ")}). ${MANIFEST_VALIDATION_NEXT_STEP}`);
|
|
650
|
+
this.name = "TenantManifestInvalidError";
|
|
651
|
+
this.ootbNodes = ootbNodes;
|
|
673
652
|
}
|
|
674
|
-
return;
|
|
675
653
|
}
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
const cwd = fs.env.cwd();
|
|
679
|
-
const dirsToCheck = [
|
|
680
|
-
cwd,
|
|
681
|
-
fs.path.resolve(cwd, ".."),
|
|
682
|
-
fs.path.resolve(cwd, "../..")
|
|
683
|
-
];
|
|
684
|
-
for (const dir of dirsToCheck) {
|
|
685
|
-
const [readErr, entries] = await catchError(fs.readdir(dir));
|
|
686
|
-
if (readErr)
|
|
687
|
-
continue;
|
|
688
|
-
const uipxName = entries.find((e) => e.endsWith(".uipx"));
|
|
689
|
-
if (!uipxName)
|
|
690
|
-
continue;
|
|
691
|
-
const uipxPath = fs.path.join(dir, uipxName);
|
|
692
|
-
const [fileErr, content] = await catchError(fs.readFile(uipxPath, "utf-8"));
|
|
693
|
-
if (fileErr || !content)
|
|
694
|
-
continue;
|
|
695
|
-
const [parseErr, parsed] = catchError(() => JSON.parse(content));
|
|
696
|
-
if (parseErr || !parsed.SolutionId)
|
|
697
|
-
continue;
|
|
698
|
-
const projects = parsed.Projects ?? [];
|
|
699
|
-
return {
|
|
700
|
-
solutionId: parsed.SolutionId,
|
|
701
|
-
solutionDir: dir,
|
|
702
|
-
projects,
|
|
703
|
-
currentProjectId: findEnclosingProjectId(dir, projects, cwd)
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
return null;
|
|
654
|
+
function isTenantManifestInvalidError(error) {
|
|
655
|
+
return error instanceof Error && error.code === TENANT_MANIFEST_INVALID;
|
|
707
656
|
}
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
return
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
return fromBuild;
|
|
719
|
-
return EMPTY_IO;
|
|
720
|
-
}
|
|
721
|
-
async function readEntryPointsFile(...candidates) {
|
|
722
|
-
const fs = getFileSystem();
|
|
723
|
-
for (const filePath of candidates) {
|
|
724
|
-
const [err, content] = await catchError(fs.readFile(filePath, "utf-8"));
|
|
725
|
-
if (err || !content)
|
|
726
|
-
continue;
|
|
727
|
-
const [parseErr, parsed] = catchError(() => JSON.parse(content));
|
|
728
|
-
if (parseErr || !parsed.entryPoints?.length)
|
|
729
|
-
continue;
|
|
730
|
-
return extractIOFromEntryPoints(parsed);
|
|
657
|
+
var MAX_FAILURE_REASON_LENGTH = 500;
|
|
658
|
+
function stringifyReason(reason) {
|
|
659
|
+
if (reason instanceof Error)
|
|
660
|
+
return reason.message;
|
|
661
|
+
if (typeof reason === "string")
|
|
662
|
+
return reason;
|
|
663
|
+
try {
|
|
664
|
+
return JSON.stringify(reason) ?? String(reason);
|
|
665
|
+
} catch {
|
|
666
|
+
return String(reason);
|
|
731
667
|
}
|
|
732
|
-
return;
|
|
733
668
|
}
|
|
734
|
-
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
if (readErr || !Array.isArray(entries))
|
|
738
|
-
return;
|
|
739
|
-
const flowFileName = entries.find((entry) => entry.endsWith(".flow"));
|
|
740
|
-
if (!flowFileName)
|
|
741
|
-
return;
|
|
742
|
-
const flowPath = fs.path.join(projectDir, flowFileName);
|
|
743
|
-
const [readFileErr, content] = await catchError(fs.readFile(flowPath, "utf-8"));
|
|
744
|
-
if (readFileErr || !content)
|
|
745
|
-
return;
|
|
746
|
-
const [parseErr, parsed] = catchError(() => JSON.parse(content));
|
|
747
|
-
if (parseErr)
|
|
748
|
-
return;
|
|
749
|
-
const globals = parsed.variables?.globals;
|
|
750
|
-
if (!Array.isArray(globals) || globals.length === 0)
|
|
751
|
-
return;
|
|
752
|
-
const inputProps = {};
|
|
753
|
-
const outputProps = {};
|
|
754
|
-
for (const variable of globals) {
|
|
755
|
-
if (!variable?.id || !variable.direction)
|
|
756
|
-
continue;
|
|
757
|
-
const schema = {
|
|
758
|
-
type: variable.type ?? "string"
|
|
759
|
-
};
|
|
760
|
-
if (variable.description) {
|
|
761
|
-
schema.description = variable.description;
|
|
762
|
-
}
|
|
763
|
-
if (variable.direction === "in" || variable.direction === "inout") {
|
|
764
|
-
inputProps[variable.id] = schema;
|
|
765
|
-
}
|
|
766
|
-
if (variable.direction === "out" || variable.direction === "inout") {
|
|
767
|
-
outputProps[variable.id] = schema;
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
const hasInputs = Object.keys(inputProps).length > 0;
|
|
771
|
-
const hasOutputs = Object.keys(outputProps).length > 0;
|
|
772
|
-
if (!hasInputs && !hasOutputs)
|
|
773
|
-
return;
|
|
774
|
-
const synthetic = {
|
|
775
|
-
entryPoints: [
|
|
776
|
-
{
|
|
777
|
-
filePath: flowFileName,
|
|
778
|
-
input: hasInputs ? { type: "object", properties: inputProps } : undefined,
|
|
779
|
-
output: hasOutputs ? { type: "object", properties: outputProps } : undefined
|
|
780
|
-
}
|
|
781
|
-
]
|
|
782
|
-
};
|
|
783
|
-
return extractIOFromEntryPoints(synthetic);
|
|
669
|
+
function describeFailureReason(reason) {
|
|
670
|
+
const text = stringifyReason(reason);
|
|
671
|
+
return text.length > MAX_FAILURE_REASON_LENGTH ? `${text.slice(0, MAX_FAILURE_REASON_LENGTH)}...` : text;
|
|
784
672
|
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
const [parseErr, parsed] = catchError(() => JSON.parse(content));
|
|
791
|
-
if (!parseErr && parsed.Name)
|
|
792
|
-
return parsed.Name;
|
|
793
|
-
}
|
|
794
|
-
return fs.path.basename(projectDir);
|
|
673
|
+
function toPullFailures(failures) {
|
|
674
|
+
return failures.map((failure) => ({
|
|
675
|
+
source: failure.source,
|
|
676
|
+
reason: describeFailureReason(failure.reason)
|
|
677
|
+
}));
|
|
795
678
|
}
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
const [dirErr, typeDirs] = await catchError(fs.readdir(processDir));
|
|
801
|
-
if (dirErr)
|
|
802
|
-
return map;
|
|
803
|
-
for (const typeDir of typeDirs) {
|
|
804
|
-
const typePath = fs.path.join(processDir, typeDir);
|
|
805
|
-
const [filesErr, files] = await catchError(fs.readdir(typePath));
|
|
806
|
-
if (filesErr)
|
|
807
|
-
continue;
|
|
808
|
-
for (const file of files) {
|
|
809
|
-
if (!file.endsWith(".json"))
|
|
810
|
-
continue;
|
|
811
|
-
const filePath = fs.path.join(typePath, file);
|
|
812
|
-
const [readErr, content] = await catchError(fs.readFile(filePath, "utf-8"));
|
|
813
|
-
if (readErr || !content)
|
|
814
|
-
continue;
|
|
815
|
-
const [parseErr, parsed] = catchError(() => JSON.parse(content));
|
|
816
|
-
if (parseErr)
|
|
817
|
-
continue;
|
|
818
|
-
const projectKey = parsed.resource?.projectKey;
|
|
819
|
-
const resourceKey = parsed.resource?.key;
|
|
820
|
-
if (projectKey && resourceKey) {
|
|
821
|
-
map.set(projectKey, resourceKey);
|
|
822
|
-
}
|
|
823
|
-
}
|
|
679
|
+
var CACHE_EXPIRATION = 30 * 60 * 1000;
|
|
680
|
+
function loginScope(loginStatus) {
|
|
681
|
+
if (loginStatus.loginStatus !== "Logged in" || !loginStatus.accessToken) {
|
|
682
|
+
return;
|
|
824
683
|
}
|
|
825
|
-
return
|
|
684
|
+
return nodeCacheScope(loginStatus);
|
|
826
685
|
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
const manifests = [];
|
|
830
|
-
const resourceKeyMap = await loadResourceKeyMap(ctx.solutionDir);
|
|
831
|
-
for (const project of ctx.projects) {
|
|
832
|
-
if (ctx.currentProjectId && project.Id === ctx.currentProjectId)
|
|
833
|
-
continue;
|
|
834
|
-
const serviceType = getServiceType(project.Type);
|
|
835
|
-
if (!serviceType)
|
|
836
|
-
continue;
|
|
837
|
-
const projectDir = fs.path.resolve(ctx.solutionDir, fs.path.dirname(project.ProjectRelativePath));
|
|
838
|
-
const reader = getAgentProjectMetadataReader();
|
|
839
|
-
const [name, io, projectMetadata] = await Promise.all([
|
|
840
|
-
readProjectName(projectDir),
|
|
841
|
-
readProjectEntryPointIO(projectDir),
|
|
842
|
-
reader ? reader(projectDir, project.Type).catch((err) => {
|
|
843
|
-
logger.debug(`Agent metadata reader failed for ${projectDir}: ${String(err)}`);
|
|
844
|
-
return {};
|
|
845
|
-
}) : Promise.resolve({})
|
|
846
|
-
]);
|
|
847
|
-
const resourceKey = resourceKeyMap.get(project.Id) ?? project.Id;
|
|
848
|
-
const task = {
|
|
849
|
-
name,
|
|
850
|
-
type: serviceType,
|
|
851
|
-
resourceKey,
|
|
852
|
-
inputs: io.inputs,
|
|
853
|
-
outputs: io.outputs,
|
|
854
|
-
metadata: {
|
|
855
|
-
...projectMetadata,
|
|
856
|
-
description: `(In-solution) ${name}`,
|
|
857
|
-
key: resourceKey,
|
|
858
|
-
name,
|
|
859
|
-
tags: ["in-solution", "local"],
|
|
860
|
-
projectId: project.Id,
|
|
861
|
-
entryPointUniqueId: io.entryPointUniqueId,
|
|
862
|
-
inputProperties: io.inputProperties
|
|
863
|
-
}
|
|
864
|
-
};
|
|
865
|
-
const nodes = taskDefinitionsToNodeManifests({ [resourceKey]: task }, project.Type);
|
|
866
|
-
manifests.push(...nodes);
|
|
867
|
-
}
|
|
868
|
-
return manifests;
|
|
686
|
+
function isFreshFor(meta, scope) {
|
|
687
|
+
return meta !== null && scope !== undefined && meta.scope === scope && Date.now() - meta.lastSync < CACHE_EXPIRATION;
|
|
869
688
|
}
|
|
870
|
-
|
|
871
|
-
// ../maestro-sdk/src/registry/node-sync-service.ts
|
|
872
|
-
var CACHE_EXPIRATION = 30 * 60 * 1000;
|
|
873
689
|
function isMissingIndexError(error) {
|
|
874
690
|
return error.message.includes("No node index found") || error.message.includes("Node index is outdated");
|
|
875
691
|
}
|
|
876
692
|
async function pullNodes(options = {}) {
|
|
877
693
|
const { force = false } = options;
|
|
694
|
+
const loginStatus = await getLoginStatusAsync();
|
|
878
695
|
if (force) {
|
|
879
|
-
const refreshResult2 = await refreshNodes();
|
|
696
|
+
const refreshResult2 = await refreshNodes(loginStatus);
|
|
880
697
|
const meta2 = await loadIndexMetadata();
|
|
881
698
|
return {
|
|
882
699
|
syncedCount: refreshResult2.nodeCount || meta2?.nodeCount || 0,
|
|
883
700
|
fromCache: false,
|
|
884
701
|
source: refreshResult2.source,
|
|
885
702
|
cacheWritten: refreshResult2.cacheWritten,
|
|
886
|
-
info: refreshResult2.info
|
|
703
|
+
info: refreshResult2.info,
|
|
704
|
+
failures: refreshResult2.failures,
|
|
705
|
+
missingSources: refreshResult2.missingSources
|
|
887
706
|
};
|
|
888
707
|
}
|
|
889
708
|
const meta = await loadIndexMetadata();
|
|
709
|
+
const scope = loginScope(loginStatus);
|
|
890
710
|
if (meta) {
|
|
891
711
|
const ageMs = Date.now() - meta.lastSync;
|
|
892
712
|
let needsRefresh = false;
|
|
893
|
-
if (
|
|
713
|
+
if (isFreshFor(meta, scope)) {
|
|
714
|
+
let syncedCount = meta.nodeCount;
|
|
894
715
|
if (!await areDerivedArtifactsCurrent()) {
|
|
895
716
|
const [rederiveError, nodeCount] = await catchError(rederiveNodeIndexArtifacts());
|
|
896
717
|
if (rederiveError) {
|
|
@@ -899,71 +720,49 @@ async function pullNodes(options = {}) {
|
|
|
899
720
|
}
|
|
900
721
|
needsRefresh = true;
|
|
901
722
|
} else {
|
|
902
|
-
|
|
903
|
-
syncedCount: nodeCount,
|
|
904
|
-
fromCache: true,
|
|
905
|
-
ageMinutes: Math.round(ageMs / 60000)
|
|
906
|
-
};
|
|
723
|
+
syncedCount = nodeCount;
|
|
907
724
|
}
|
|
908
725
|
}
|
|
909
|
-
|
|
726
|
+
const current = await loadIndexMetadata();
|
|
727
|
+
if (!needsRefresh && isFreshFor(current, scope)) {
|
|
910
728
|
return {
|
|
911
|
-
syncedCount
|
|
729
|
+
syncedCount,
|
|
912
730
|
fromCache: true,
|
|
913
|
-
ageMinutes: Math.round(ageMs / 60000)
|
|
731
|
+
ageMinutes: Math.round(ageMs / 60000),
|
|
732
|
+
missingSources: current.missingSources
|
|
914
733
|
};
|
|
915
734
|
}
|
|
916
735
|
}
|
|
917
736
|
}
|
|
918
|
-
const refreshResult = await refreshNodes();
|
|
737
|
+
const refreshResult = await refreshNodes(loginStatus);
|
|
919
738
|
const refreshedMeta = await loadIndexMetadata();
|
|
920
739
|
return {
|
|
921
740
|
syncedCount: refreshResult.nodeCount || refreshedMeta?.nodeCount || 0,
|
|
922
741
|
fromCache: false,
|
|
923
742
|
source: refreshResult.source,
|
|
924
743
|
cacheWritten: refreshResult.cacheWritten,
|
|
925
|
-
info: refreshResult.info
|
|
744
|
+
info: refreshResult.info,
|
|
745
|
+
failures: refreshResult.failures,
|
|
746
|
+
missingSources: refreshResult.missingSources
|
|
926
747
|
};
|
|
927
748
|
}
|
|
928
|
-
async function refreshNodes() {
|
|
929
|
-
const
|
|
930
|
-
const pullResult = await pullRemoteNodes();
|
|
931
|
-
const allNodes = pullResult.nodes;
|
|
749
|
+
async function refreshNodes(loginStatus) {
|
|
750
|
+
const pullResult = await pullRemoteNodes(loginStatus);
|
|
932
751
|
if (!pullResult.cacheable) {
|
|
933
752
|
return {
|
|
934
753
|
cacheWritten: false,
|
|
935
|
-
nodeCount:
|
|
754
|
+
nodeCount: pullResult.nodes.length,
|
|
936
755
|
source: pullResult.source,
|
|
937
|
-
info: pullResult.info
|
|
938
|
-
|
|
939
|
-
}
|
|
940
|
-
const content = JSON.stringify(allNodes);
|
|
941
|
-
const newHash = await hashContent(content);
|
|
942
|
-
if (oldMeta && oldMeta.hash === newHash) {
|
|
943
|
-
if (!await areDerivedArtifactsCurrent()) {
|
|
944
|
-
await saveNodeIndex(allNodes);
|
|
945
|
-
return {
|
|
946
|
-
cacheWritten: true,
|
|
947
|
-
nodeCount: allNodes.length,
|
|
948
|
-
source: pullResult.source
|
|
949
|
-
};
|
|
950
|
-
}
|
|
951
|
-
await saveIndexMetadata({
|
|
952
|
-
lastSync: Date.now(),
|
|
953
|
-
nodeCount: oldMeta.nodeCount,
|
|
954
|
-
hash: oldMeta.hash
|
|
955
|
-
});
|
|
956
|
-
return {
|
|
957
|
-
cacheWritten: true,
|
|
958
|
-
nodeCount: oldMeta.nodeCount,
|
|
959
|
-
source: pullResult.source
|
|
756
|
+
info: pullResult.info,
|
|
757
|
+
failures: pullResult.failures
|
|
960
758
|
};
|
|
961
759
|
}
|
|
962
|
-
await
|
|
760
|
+
const nodeCount = await commitNodeIndex(pullResult.nodes, pullResult.scope, pullResult.missingSources);
|
|
963
761
|
return {
|
|
964
762
|
cacheWritten: true,
|
|
965
|
-
nodeCount
|
|
966
|
-
source: pullResult.source
|
|
763
|
+
nodeCount,
|
|
764
|
+
source: pullResult.source,
|
|
765
|
+
missingSources: pullResult.missingSources
|
|
967
766
|
};
|
|
968
767
|
}
|
|
969
768
|
var ENABLED_MANIFEST_FLAGS = new Set([
|
|
@@ -985,18 +784,18 @@ var ENABLED_MANIFEST_FLAGS = new Set([
|
|
|
985
784
|
MANIFEST_FEATURE_FLAGS.UPDATE_ENTITY,
|
|
986
785
|
MANIFEST_FEATURE_FLAGS.DELETE_ENTITY
|
|
987
786
|
]);
|
|
988
|
-
async function pullRemoteNodes() {
|
|
989
|
-
|
|
787
|
+
async function pullRemoteNodes(loginStatus) {
|
|
788
|
+
loginStatus ??= await getLoginStatusAsync();
|
|
990
789
|
const client = new ManifestClient({
|
|
991
790
|
baseUrl: loginStatus.baseUrl || "localhost",
|
|
992
791
|
getFeatureFlag: (flag) => ENABLED_MANIFEST_FLAGS.has(flag)
|
|
993
792
|
});
|
|
994
793
|
if (loginStatus.loginStatus !== "Logged in" || !loginStatus.baseUrl || !loginStatus.accessToken || !loginStatus.tenantId || !loginStatus.organizationId) {
|
|
995
|
-
const
|
|
794
|
+
const manifest = await client.getManifest({
|
|
996
795
|
inlineAgentNodes: true
|
|
997
796
|
});
|
|
998
797
|
return {
|
|
999
|
-
nodes:
|
|
798
|
+
nodes: manifest.nodes || [],
|
|
1000
799
|
source: "ootb",
|
|
1001
800
|
cacheable: false,
|
|
1002
801
|
info: "Using OOTB nodes because you are not logged in. Cache was not updated."
|
|
@@ -1007,7 +806,7 @@ async function pullRemoteNodes() {
|
|
|
1007
806
|
tenantId: loginStatus.tenantId,
|
|
1008
807
|
organizationId: loginStatus.organizationId
|
|
1009
808
|
};
|
|
1010
|
-
const [manifestError,
|
|
809
|
+
const [manifestError, diagnostics] = await catchError(client.getManifestWithDiagnostics({
|
|
1011
810
|
auth: authContext,
|
|
1012
811
|
includeIntegrationTriggers: true,
|
|
1013
812
|
inlineAgentNodes: true,
|
|
@@ -1015,10 +814,32 @@ async function pullRemoteNodes() {
|
|
|
1015
814
|
excludeIntsvcConnectorHttpRequest: true
|
|
1016
815
|
}));
|
|
1017
816
|
if (!manifestError) {
|
|
817
|
+
const nodes = diagnostics.manifest.nodes || [];
|
|
818
|
+
if (diagnostics.failures.length === 0) {
|
|
819
|
+
return {
|
|
820
|
+
nodes,
|
|
821
|
+
source: "authenticated",
|
|
822
|
+
cacheable: true,
|
|
823
|
+
scope: nodeCacheScope(loginStatus)
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
const failures = toPullFailures(diagnostics.failures);
|
|
827
|
+
const ootbOnly = failures.some((failure) => failure.source === MANIFEST_VALIDATION_SOURCE);
|
|
828
|
+
if (!ootbOnly) {
|
|
829
|
+
return {
|
|
830
|
+
nodes,
|
|
831
|
+
source: "authenticated",
|
|
832
|
+
cacheable: true,
|
|
833
|
+
scope: nodeCacheScope(loginStatus),
|
|
834
|
+
missingSources: failures
|
|
835
|
+
};
|
|
836
|
+
}
|
|
1018
837
|
return {
|
|
1019
|
-
nodes
|
|
1020
|
-
source: "
|
|
1021
|
-
cacheable:
|
|
838
|
+
nodes,
|
|
839
|
+
source: "ootb",
|
|
840
|
+
cacheable: false,
|
|
841
|
+
failures,
|
|
842
|
+
info: "The tenant manifest failed validation; using OOTB nodes without updating cache."
|
|
1022
843
|
};
|
|
1023
844
|
}
|
|
1024
845
|
const fallbackManifest = await client.getManifest({
|
|
@@ -1038,19 +859,78 @@ async function getNodesWithCacheFallback() {
|
|
|
1038
859
|
throw error;
|
|
1039
860
|
}
|
|
1040
861
|
const pullResult = await pullRemoteNodes();
|
|
862
|
+
if (pullResult.failures?.length) {
|
|
863
|
+
throw new TenantManifestInvalidError(pullResult.failures, pullResult.nodes);
|
|
864
|
+
}
|
|
1041
865
|
if (pullResult.cacheable) {
|
|
1042
|
-
await saveNodeIndex(pullResult.nodes);
|
|
866
|
+
await saveNodeIndex(pullResult.nodes, pullResult.scope, pullResult.missingSources);
|
|
1043
867
|
}
|
|
1044
868
|
return pullResult.nodes;
|
|
1045
869
|
}
|
|
1046
870
|
return nodes;
|
|
1047
871
|
}
|
|
1048
|
-
async function
|
|
872
|
+
async function loadCurrentTenantNodes(options = {}) {
|
|
873
|
+
const [loginError, readStatus] = await catchError(getLoginStatusAsync());
|
|
874
|
+
const loginStatus = loginError ? { loginStatus: "Not logged in" } : readStatus;
|
|
875
|
+
const scope = loginScope(loginStatus);
|
|
876
|
+
if (!options.force && scope !== undefined) {
|
|
877
|
+
const [, cached] = await catchError(loadScopedNodeIndex(scope));
|
|
878
|
+
if (cached && isFreshFor(cached.metadata, scope)) {
|
|
879
|
+
return { nodes: cached.nodes, fromCache: true, source: "cache" };
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
const pullResult = await pullRemoteNodes(loginStatus);
|
|
883
|
+
if (pullResult.cacheable) {
|
|
884
|
+
await catchError(commitNodeIndex(pullResult.nodes, pullResult.scope, pullResult.missingSources));
|
|
885
|
+
}
|
|
886
|
+
return {
|
|
887
|
+
nodes: pullResult.nodes,
|
|
888
|
+
fromCache: false,
|
|
889
|
+
source: pullResult.source,
|
|
890
|
+
info: pullResult.info
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
async function getLocalSolutionSnapshot() {
|
|
1049
894
|
const ctx = await findSolutionFromCwd();
|
|
1050
895
|
if (!ctx) {
|
|
1051
896
|
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.");
|
|
1052
897
|
}
|
|
1053
|
-
return
|
|
898
|
+
return buildInSolutionNodes(ctx);
|
|
899
|
+
}
|
|
900
|
+
async function getLocalSolutionNodes() {
|
|
901
|
+
return (await getLocalSolutionSnapshot()).manifests;
|
|
902
|
+
}
|
|
903
|
+
function localContractWarning(snapshot, shown) {
|
|
904
|
+
const types = new Set(shown.map((n) => n.nodeType).filter((t) => typeof t === "string").map((t) => t.toLowerCase()));
|
|
905
|
+
return unknownContractWarning(snapshot.unknownContracts.filter((p) => p.nodeTypes.some((t) => types.has(t.toLowerCase()))));
|
|
906
|
+
}
|
|
907
|
+
function filterNodesByKeyword(nodes, keyword) {
|
|
908
|
+
const lowerKeyword = keyword.toLowerCase();
|
|
909
|
+
return nodes.filter((node) => {
|
|
910
|
+
if (node.nodeType?.toLowerCase().includes(lowerKeyword)) {
|
|
911
|
+
return true;
|
|
912
|
+
}
|
|
913
|
+
if (node.category?.toLowerCase().includes(lowerKeyword)) {
|
|
914
|
+
return true;
|
|
915
|
+
}
|
|
916
|
+
if (node.tags?.some((tag) => tag.toLowerCase().includes(lowerKeyword))) {
|
|
917
|
+
return true;
|
|
918
|
+
}
|
|
919
|
+
if (node.display?.label?.toLowerCase().includes(lowerKeyword)) {
|
|
920
|
+
return true;
|
|
921
|
+
}
|
|
922
|
+
if (node.description?.toLowerCase().includes(lowerKeyword)) {
|
|
923
|
+
return true;
|
|
924
|
+
}
|
|
925
|
+
if (node.display?.description?.toLowerCase().includes(lowerKeyword)) {
|
|
926
|
+
return true;
|
|
927
|
+
}
|
|
928
|
+
return false;
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
function findNodeByType(nodes, nodeType) {
|
|
932
|
+
const lowerNodeType = nodeType.toLowerCase();
|
|
933
|
+
return nodes.find((node) => node.nodeType?.toLowerCase() === lowerNodeType) ?? null;
|
|
1054
934
|
}
|
|
1055
935
|
async function listNodes(options) {
|
|
1056
936
|
if (options?.local)
|
|
@@ -1161,28 +1041,7 @@ async function searchNodes(keyword, options) {
|
|
|
1161
1041
|
const tenantNodes = await getNodesWithCacheFallback();
|
|
1162
1042
|
nodes = unionWithKnownSdkNodes(tenantNodes);
|
|
1163
1043
|
}
|
|
1164
|
-
|
|
1165
|
-
return nodes.filter((node) => {
|
|
1166
|
-
if (node.nodeType?.toLowerCase().includes(lowerKeyword)) {
|
|
1167
|
-
return true;
|
|
1168
|
-
}
|
|
1169
|
-
if (node.category?.toLowerCase().includes(lowerKeyword)) {
|
|
1170
|
-
return true;
|
|
1171
|
-
}
|
|
1172
|
-
if (node.tags?.some((tag) => tag.toLowerCase().includes(lowerKeyword))) {
|
|
1173
|
-
return true;
|
|
1174
|
-
}
|
|
1175
|
-
if (node.display?.label?.toLowerCase().includes(lowerKeyword)) {
|
|
1176
|
-
return true;
|
|
1177
|
-
}
|
|
1178
|
-
if (node.description?.toLowerCase().includes(lowerKeyword)) {
|
|
1179
|
-
return true;
|
|
1180
|
-
}
|
|
1181
|
-
if (node.display?.description?.toLowerCase().includes(lowerKeyword)) {
|
|
1182
|
-
return true;
|
|
1183
|
-
}
|
|
1184
|
-
return false;
|
|
1185
|
-
});
|
|
1044
|
+
return filterNodesByKeyword(nodes, keyword);
|
|
1186
1045
|
}
|
|
1187
1046
|
async function getNode(nodeType, options) {
|
|
1188
1047
|
const lowerNodeType = nodeType.toLowerCase();
|
|
@@ -1193,13 +1052,23 @@ async function getNode(nodeType, options) {
|
|
|
1193
1052
|
}
|
|
1194
1053
|
if (!options?.local && isEssentialNodeType(nodeType)) {
|
|
1195
1054
|
const essentials = await loadEssentialsIndexWithRepair();
|
|
1196
|
-
const
|
|
1197
|
-
if (
|
|
1198
|
-
return
|
|
1055
|
+
const node = essentials?.find((node2) => node2.nodeType?.toLowerCase() === lowerNodeType) ?? null;
|
|
1056
|
+
if (node)
|
|
1057
|
+
return node;
|
|
1058
|
+
}
|
|
1059
|
+
if (options?.local) {
|
|
1060
|
+
return findNodeByType(await getLocalSolutionNodes(), nodeType);
|
|
1199
1061
|
}
|
|
1200
|
-
const nodes =
|
|
1201
|
-
|
|
1202
|
-
|
|
1062
|
+
const [error, nodes] = await catchError(getNodesWithCacheFallback());
|
|
1063
|
+
if (error) {
|
|
1064
|
+
if (error instanceof TenantManifestInvalidError) {
|
|
1065
|
+
const ootbNode = findNodeByType(error.ootbNodes, nodeType);
|
|
1066
|
+
if (ootbNode)
|
|
1067
|
+
return ootbNode;
|
|
1068
|
+
}
|
|
1069
|
+
throw error;
|
|
1070
|
+
}
|
|
1071
|
+
return findNodeByType(nodes, nodeType);
|
|
1203
1072
|
}
|
|
1204
1073
|
async function getNodeEnriched(nodeType, connectionId, options) {
|
|
1205
1074
|
const node = await getNode(nodeType, options);
|
|
@@ -1208,6 +1077,16 @@ async function getNodeEnriched(nodeType, connectionId, options) {
|
|
|
1208
1077
|
}
|
|
1209
1078
|
return await enrichConnectorNode(node, connectionId);
|
|
1210
1079
|
}
|
|
1080
|
+
async function getLocalNodeEnriched(nodeType, connectionId) {
|
|
1081
|
+
const snapshot = await getLocalSolutionSnapshot();
|
|
1082
|
+
const node = findNodeByType(snapshot.manifests, nodeType);
|
|
1083
|
+
if (!node)
|
|
1084
|
+
return { node: null };
|
|
1085
|
+
return {
|
|
1086
|
+
node: await enrichConnectorNode(node, connectionId),
|
|
1087
|
+
warning: localContractWarning(snapshot, [node])
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1211
1090
|
async function searchNodesWithFilters(keyword, filters, options) {
|
|
1212
1091
|
let nodes;
|
|
1213
1092
|
if (options?.local) {
|
|
@@ -1219,6 +1098,6 @@ async function searchNodesWithFilters(keyword, filters, options) {
|
|
|
1219
1098
|
return searchWithFilters(nodes, keyword, filters);
|
|
1220
1099
|
}
|
|
1221
1100
|
|
|
1222
|
-
export { extractTriggerEventParameters, extractTriggerFilterFields, extractActivityFilterFields, fetchConnectorTriggerMetadata, fetchConnectionInfo, fetchConnectorMetadata,
|
|
1101
|
+
export { isConnectorNode, isConnectorTriggerNode, extractTriggerEventParameters, extractTriggerFilterFields, extractActivityFilterFields, fetchConnectorTriggerMetadata, getConnectorConfiguration, getConnectorInfo, fetchConnectionInfo, fetchConnectorMetadata, fetchConnectorActivityMetadataV4, enrichConnectorNode, resolveNodeStorageDir, saveNodeIndex, loadNodeIndex, saveIndexMetadata, loadIndexMetadata, MANIFEST_VALIDATION_NEXT_STEP, TenantManifestInvalidError, isTenantManifestInvalidError, pullNodes, pullRemoteNodes, loadCurrentTenantNodes, getLocalSolutionSnapshot, localContractWarning, filterNodesByKeyword, findNodeByType, listNodes, searchNodeSummariesWithAvailability, searchNodes, getNode, getNodeEnriched, getLocalNodeEnriched, searchNodesWithFilters };
|
|
1223
1102
|
|
|
1224
|
-
//# debugId=
|
|
1103
|
+
//# debugId=84A6547C9B12968064756E2164756E21
|