@uipath/case-tool 1.205.0-preview.281 → 1.206.0-preview.282
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD-PARTY-NOTICES.md +68 -7
- package/dist/applicationinsights-web-8m26566f.js +17209 -0
- package/dist/{authoring-kqh34zzm.js → authoring-vg90pqrn.js} +488 -213
- package/dist/bindings-v2-1da35xsc.js +27 -0
- package/dist/{browser-strategy-6atc7v8s.js → browser-strategy-627rrg7z.js} +6 -7
- package/dist/{business-rule-export-ey588rv7.js → business-rule-export-jv60r9jf.js} +3 -7
- package/dist/carry-forward-sfdnta6q.js +52 -0
- package/dist/{case-api-sme7esce.js → case-api-by95rf40.js} +38 -37
- package/dist/{case-bindings-service-cht20gqt.js → case-bindings-service-pp3c9g1e.js} +93 -45
- package/dist/{case-debug-solution-projects-qqd3h10v.js → case-debug-solution-projects-je7h4hmq.js} +3 -7
- package/dist/{case-debug-studio-web-service-nqzmwbr5.js → case-debug-studio-web-service-d83h3atd.js} +48 -45
- package/dist/{case-described-io-service-dx1f4nxe.js → case-described-io-service-tsm8r189.js} +33 -15
- package/dist/case-event-trigger-bindings-qbs8ywf5.js +17 -0
- package/dist/{case-format-service-6aew6tqc.js → case-format-service-3sab2297.js} +9 -10
- package/dist/{case-pack-service-pqq8wnfd.js → case-pack-service-txnv711n.js} +47 -42
- package/dist/case-schema-version-cw0h2nrv.js +18 -0
- package/dist/case-shape-reader-xaxmrd40.js +14 -0
- package/dist/{case-splice-service-s5gccctq.js → case-splice-service-6y35w83e.js} +139 -51
- package/dist/{case-validate-service-vq38va33.js → case-validate-service-hz0j90we.js} +234 -170
- package/dist/connector-enrichment-service-sjjmb9dy.js +56 -0
- package/dist/connector-library-1yw5r47w.js +99 -0
- package/dist/connector-lookup-service-yerhg9cd.js +20 -0
- package/dist/connector-task-shape-bgywpbqc.js +13 -0
- package/dist/{de-WLW6KWOJ-2qnsqdtw.js → de-2BEKRUMY-x4dx0nn9.js} +190 -10
- package/dist/{de-UZI7FJDO-mwvc4cxe.js → de-AI7ML6JM-km47f8k4.js} +20 -5
- package/dist/debug-service-h4jxbn1r.js +56 -0
- package/dist/{embedded-file-reader-r66242ey.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/en-LAVDF7IQ-yzy20n6d.js +254 -0
- package/dist/en-X6T4SP2Y-xm47mf18.js +2752 -0
- package/dist/{enrichment-service-hv7ff88p.js → enrichment-service-wpprec7k.js} +36 -37
- package/dist/{es-5THCNRFN-tqwyrdgy.js → es-7ZTQTGKN-11sj0yjx.js} +190 -10
- package/dist/{es-MX-5RELIXKI-9jhqtddc.js → es-MX-7KJZPEQN-1fq0a9jr.js} +20 -5
- package/dist/{es-MX-TWZBRAXK-gqd9swzw.js → es-MX-IHGRIEWH-g63p0gb4.js} +191 -11
- package/dist/{es-4UBUTCQA-m1ytpyx2.js → es-SPNKTD5Y-vw5cbgv5.js} +20 -5
- package/dist/filter-engine-dh9s90gb.js +10 -0
- package/dist/first-party-service-ahcc6xc6.js +8 -0
- package/dist/{fr-CERONSRC-edpxhbmb.js → fr-7ZDL4MVO-pd27vwh6.js} +191 -11
- package/dist/{fr-VBM5WRC2-63z7w4mh.js → fr-AXJGUT53-hdg3pmd4.js} +20 -5
- package/dist/index-21kns9qg.js +10 -0
- package/dist/{index-fyc0k5dd.js → index-5pzp2qeb.js} +5350 -3271
- package/dist/{connector-task-spec-pzfzmfr5.js → index-9f8naxbk.js} +320 -144
- package/dist/{index-5dxh9z60.js → index-a7y7etmy.js} +6 -5
- package/dist/{index-ekwtgx7y.js → index-ec115v05.js} +309 -287
- package/dist/index-j9t2k52h.js +35 -0
- package/dist/index-myf7b4a5.js +26 -0
- package/dist/index-nj3axvya.js +159 -0
- package/dist/{index-h8cph72k.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-pg9wmyrf.js +36 -0
- package/dist/index-z2qk2qn6.js +24 -0
- package/dist/index.js +19 -25
- package/dist/index.umd.min-ttg1qc0x.js +7814 -0
- package/dist/{init-entry-points-hhpv3e3f.js → init-entry-points-pc128f7z.js} +22 -35
- package/dist/input-reader-9ym8mkbc.js +10 -0
- package/dist/{ja-43QL7CGO-c3q8gre9.js → ja-C7GZV6YP-hvtbngr5.js} +20 -5
- package/dist/{ja-U2MCNHGT-gz0ap1jk.js → ja-LGAM5HKR-sgrtjqjh.js} +190 -10
- package/dist/{jmespath-e4a59c8w.js → jmespath-wwym30dp.js} +1 -1
- package/dist/{js-yaml-87cdx6bm.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/known-types-gak9by1w.js +11 -0
- package/dist/{ko-XAUYQWDR-zp81gjp4.js → ko-7B4SUZB7-c8wr20sc.js} +190 -10
- package/dist/{ko-TLL6Z6CD-wrt3n8a9.js → ko-Q24HSSL4-5vn55pte.js} +20 -5
- package/dist/localSolutionDiscovery-48d1bnkj.js +15 -0
- package/dist/{migration-diagnosis-ns5cw4e3.js → migration-diagnosis-myqqgwj0.js} +1 -4
- package/dist/{node-strategy-v442hwgd.js → node-strategy-2mqzg36t.js} +15 -18
- package/dist/node-sync-service-y8b5w1rd.js +56 -0
- package/dist/{out-target-wjgmna0r.js → out-target-eqsttq1k.js} +18 -22
- package/dist/{packager-tool-f8vwy92w.js → packager-tool-0te1tyhf.js} +186 -16
- package/dist/{packager-tool-ydyvtknp.js → packager-tool-0w4fsdzv.js} +44 -20
- package/dist/{packager-tool-8ftat1vn.js → packager-tool-17b466mr.js} +59158 -59666
- package/dist/packager-tool-1nfdj0zm.js +425 -0
- package/dist/packager-tool-1wgav5ma.js +139 -0
- package/dist/{packager-tool-b1nw50ev.js → packager-tool-265h946t.js} +256 -486
- package/dist/{packager-tool-nj4seavy.js → packager-tool-35c9npcy.js} +26 -7
- package/dist/{packager-tool-r0x3qh59.js → packager-tool-388vyja1.js} +185 -29
- package/dist/packager-tool-3m8482sw.js +78 -0
- package/dist/packager-tool-3r23qsca.js +4832 -0
- package/dist/packager-tool-3xehbdyd.js +1302 -0
- package/dist/packager-tool-4avchhz8.js +539 -0
- package/dist/{packager-tool-9kvkzc05.js → packager-tool-5w0gjcck.js} +4 -4
- package/dist/packager-tool-68648y3j.js +6 -0
- package/dist/{packager-tool-1yh8g550.js → packager-tool-6an893wm.js} +12 -3
- package/dist/{packager-tool-aagnvyba.js → packager-tool-76zhn5pa.js} +131 -432
- package/dist/packager-tool-7x1tmb8a.js +46 -0
- package/dist/{packager-tool-kyrm4e5m.js → packager-tool-9ar5829n.js} +781 -741
- package/dist/{packager-tool-4p11fvf4.js → packager-tool-b2q8m9pq.js} +10 -13
- package/dist/packager-tool-bg3tdpva.js +27 -0
- package/dist/{packager-tool-wr12ndwk.js → packager-tool-ccejfs0r.js} +252 -468
- package/dist/{packager-tool-yn33pw57.js → packager-tool-dn9d4ywm.js} +246 -225
- package/dist/{packager-tool-kdhey8gz.js → packager-tool-e02jkmrq.js} +41 -29
- package/dist/{packager-tool-sq931c23.js → packager-tool-e1tx5mqg.js} +1 -1
- package/dist/{packager-tool-qn3zkrrc.js → packager-tool-ehjw672b.js} +32 -15
- package/dist/packager-tool-gy4yjqhf.js +178 -0
- package/dist/packager-tool-h2ar8xf8.js +222 -0
- package/dist/{packager-tool-v2kcgjbf.js → packager-tool-j6nfje7t.js} +5 -4
- package/dist/packager-tool-k0ar6cn7.js +295 -0
- package/dist/packager-tool-kz7zz79p.js +71 -0
- package/dist/{packager-tool-1gwbq864.js → packager-tool-m5384a1s.js} +66 -82
- package/dist/{packager-tool-9e59z4d6.js → packager-tool-me8gd22q.js} +82 -83
- package/dist/packager-tool-mk9fmzdy.js +20 -0
- package/dist/{packager-tool-yfmby4dd.js → packager-tool-mkt1njk2.js} +630 -689
- package/dist/{packager-tool-gdtpsdn7.js → packager-tool-mm1x18d6.js} +223 -28
- package/dist/{packager-tool-mqy97y5f.js → packager-tool-p5gs9xqy.js} +14 -14
- package/dist/{packager-tool-83v804p7.js → packager-tool-psmb758n.js} +3108 -2627
- package/dist/packager-tool-q26hncjr.js +13 -0
- package/dist/packager-tool-q9fnx278.js +77 -0
- package/dist/{packager-tool-ezds6t5e.js → packager-tool-s12s1dp6.js} +11 -11
- package/dist/packager-tool-scy94jyb.js +5424 -0
- package/dist/{packager-tool-yn7r7zq2.js → packager-tool-snesn0bt.js} +177 -96
- package/dist/{packager-tool-d8e2mrkq.js → packager-tool-tgehy324.js} +56 -56
- package/dist/{packager-tool-tqn0j6f9.js → packager-tool-v11fx4dk.js} +7 -7
- package/dist/{packager-tool-67vy1fz3.js → packager-tool-v6rkp2ay.js} +24 -92
- package/dist/{packager-tool-9sd483vs.js → packager-tool-vs7gqa4r.js} +15 -15
- package/dist/packager-tool-vyavrbym.js +488 -0
- package/dist/{packager-tool-b098y4a2.js → packager-tool-wbksf242.js} +97 -97
- package/dist/{packager-tool-2sn7d8fd.js → packager-tool-x74mmjkw.js} +9 -13
- package/dist/{packager-tool-7hw344bt.js → packager-tool-xb16e3tz.js} +5 -5
- package/dist/{packager-tool-a17g0pj1.js → packager-tool-xd1wbvay.js} +10 -8
- package/dist/{packager-tool-1yfw674x.js → packager-tool-xehhk3c3.js} +10 -5
- package/dist/packager-tool-yh8mmj3p.js +123 -0
- package/dist/{packager-tool-hdxtgckw.js → packager-tool-z070caqq.js} +56 -12
- package/dist/{packager-tool-b250k6w4.js → packager-tool-z1fw9a8v.js} +41 -9
- package/dist/{packager-tool-0gctz400.js → packager-tool-z9fmqtm6.js} +4 -4
- package/dist/{packager-tool-mzf4gmph.js → packager-tool-zbx189j3.js} +11 -8
- package/dist/{packager-tool-zf8f9pmm.js → packager-tool-zrbnms9b.js} +3 -4
- package/dist/packager-tool.js +10 -11
- package/dist/prepare-uip-ad7mfs8t.js +92 -0
- package/dist/{project-artifacts-bgyyb0dm.js → project-artifacts-q0c0zghw.js} +2 -6
- package/dist/{pt-BR-USP2T7GD-pedn77m1.js → pt-BR-BIUJXIPU-2sqzhr8y.js} +20 -5
- package/dist/{pt-BR-GNQNAAZ2-xadharv4.js → pt-BR-PHLFHMXZ-n6de4s7z.js} +191 -11
- package/dist/{pt-RMIAKZB4-67enhx3m.js → pt-MHX6JGAX-xfgvdqwg.js} +20 -5
- package/dist/{pt-TO2DARY2-ftcce1bv.js → pt-N7ZTJT4W-d6c67xcn.js} +190 -10
- package/dist/{resolved-check-aqw7568y.js → resolved-check-dz8eqrf6.js} +2 -3
- package/dist/{resourcesSyncService-8ac6ncq2.js → resourcesSyncService-yrhhh62m.js} +81 -141
- package/dist/{ro-GHOBYW2S-mhnqsgaa.js → ro-3RKJNGJZ-xqj14e3d.js} +20 -5
- package/dist/{ro-WUYJV6OW-a8d9qy1n.js → ro-FLNXVYJI-ytrwabg2.js} +190 -10
- package/dist/ru-GSCT4ARZ-c2cfq4h1.js +7 -0
- package/dist/ru-WBLQ5B2U-bf20yr5y.js +7 -0
- package/dist/{rule-group-members-zje7n3kf.js → rule-group-members-p0nv1rmj.js} +1 -3
- package/dist/rule-type-declaration-s2nxpcfy.js +77 -0
- package/dist/{sdd-convert-service-8jpew7vz.js → sdd-convert-service-ffbx00k6.js} +481 -504
- package/dist/{sdd-lookup-fe900sdb.js → sdd-lookup-sah7wj5j.js} +8 -9
- package/dist/{sdd-resolve-service-qdtmxw9b.js → sdd-resolve-service-6nt10vhq.js} +28 -20
- package/dist/{sdd-resolve-siblings-8gf9zjwf.js → sdd-resolve-siblings-ap8j1c8h.js} +11 -14
- package/dist/solution-auth-a1p22hq1.js +11 -0
- package/dist/solution-discovery-r1y550sz.js +33 -0
- package/dist/{strict-case-rules-4tjcaznr.js → strict-case-rules-045kbjvv.js} +16 -28
- package/dist/{strict-entry-points-g2pd4mf4.js → strict-entry-points-40ha9afz.js} +15 -14
- package/dist/strict-sdd-audit-bp7fq2tg.js +26 -0
- package/dist/{task-selector-8bjn35dv.js → task-selector-jt60hdbt.js} +1 -3
- package/dist/{task-type-declaration-7a8fqdvs.js → task-type-declaration-yhczvj05.js} +9 -9
- package/dist/tool.js +18 -24
- package/dist/{tr-M3F5A6AU-bb0tg39m.js → tr-7AIZZWZ6-pdzp9n0p.js} +190 -10
- package/dist/{tr-GDTLECMM-k5fhmq13.js → tr-PQLUUHPC-qsb7btxn.js} +20 -5
- package/dist/{trigger-enrichment-service-agvnhdf7.js → trigger-enrichment-service-z8kxy6qr.js} +53 -57
- package/dist/trigger-entry-point-id-751v48qd.js +14 -0
- package/dist/{zh-CN-C5G4PC7C-ds9gkptg.js → zh-CN-CN2ARPFS-e0p2qrxf.js} +190 -10
- package/dist/{zh-CN-I5D7WHBD-sr5h0a98.js → zh-CN-OHNTHZRI-b0hjkfqn.js} +20 -5
- package/dist/{zh-TW-62HZIG6O-787kdwex.js → zh-TW-7RUFEVFK-qd7myw31.js} +190 -10
- package/dist/{zh-TW-2AVLM723-288pkc1z.js → zh-TW-E4D3Y6ZR-tn3bmzz5.js} +20 -5
- package/package.json +2 -2
- package/dist/canvas-notes-86fxx1t8.js +0 -19
- package/dist/case-event-trigger-bindings-g9ftnm4x.js +0 -16
- package/dist/case-schema-version-h820ne16.js +0 -20
- package/dist/case-shape-reader-dsbraetf.js +0 -13
- package/dist/connector-enrichment-service-6kskfevq.js +0 -65
- package/dist/connector-lookup-service-yyn8kkw7.js +0 -22
- package/dist/connector-task-shape-mpazkf7s.js +0 -14
- package/dist/debug-service-7q98j726.js +0 -59
- package/dist/en-EJCBA3LK-dtpdghgj.js +0 -146
- package/dist/en-M7GQYBV2-5nfmpnfz.js +0 -2018
- package/dist/filter-engine-7ep90g7f.js +0 -11
- package/dist/first-party-service-srxaftkn.js +0 -27
- package/dist/index-0d7qc2gs.js +0 -282
- package/dist/index-jmv5by9z.js +0 -666
- package/dist/index-kmp9fmhb.js +0 -25
- package/dist/index-n9qvnx4x.js +0 -29
- package/dist/index-ngs0a2he.js +0 -15
- package/dist/index-xq6ajhgq.js +0 -157
- package/dist/index.umd.min-fqefd9kn.js +0 -7814
- package/dist/input-reader-c7wz8ra2.js +0 -11
- package/dist/known-types-5b6yrsqn.js +0 -16
- package/dist/localSolutionDiscovery-yyx234ak.js +0 -13
- package/dist/node-sync-service-2ezr3akv.js +0 -57
- package/dist/packager-tool-53w8skv5.js +0 -262
- package/dist/packager-tool-6z1hsm2h.js +0 -143
- package/dist/packager-tool-93mdeqay.js +0 -18
- package/dist/packager-tool-9kf3fqtr.js +0 -23
- package/dist/packager-tool-bfgdz1zh.js +0 -73
- package/dist/packager-tool-e15kqpyh.js +0 -266
- package/dist/packager-tool-gmykn1ef.js +0 -5365
- package/dist/packager-tool-jysvpt8p.js +0 -11
- package/dist/packager-tool-pcvhcn2k.js +0 -2019
- package/dist/packager-tool-rk25wp3c.js +0 -28
- package/dist/packager-tool-sc961w0q.js +0 -16
- package/dist/packager-tool-wekqkmgn.js +0 -265
- package/dist/packager-tool-yc4kw997.js +0 -13
- package/dist/packager-tool-zgpsnxkd.js +0 -13189
- package/dist/ru-GSCT4ARZ-1sa9wbr8.js +0 -10
- package/dist/ru-WBLQ5B2U-s4em88p0.js +0 -10
- package/dist/solution-auth-30yycqtv.js +0 -14
- package/dist/solution-discovery-e9mamp6w.js +0 -38
- package/dist/strict-sdd-audit-q7tb9yj7.js +0 -25
- package/dist/trigger-entry-point-id-yhqwnkx9.js +0 -15
- /package/dist/{packager-tool-5qp9xza1.js → packager-tool-1c30ttpm.js} +0 -0
- /package/dist/{packager-tool-mknccck5.js → packager-tool-1h7abxw6.js} +0 -0
- /package/dist/{packager-tool-9y1w2wds.js → packager-tool-fcektt1g.js} +0 -0
- /package/dist/{packager-tool-k6jbedyc.js → packager-tool-hcdnc420.js} +0 -0
- /package/dist/{packager-tool-7nxppa3d.js → packager-tool-jv5byaww.js} +0 -0
- /package/dist/{packager-tool-qa9gftnj.js → packager-tool-mxgybnmt.js} +0 -0
- /package/dist/{packager-tool-87y6xw3a.js → packager-tool-nfhtwa72.js} +0 -0
- /package/dist/{packager-tool-cv05dwac.js → packager-tool-p0rdmmvk.js} +0 -0
- /package/dist/{packager-tool-21qfsbxn.js → packager-tool-yaertxsw.js} +0 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catchError2,
|
|
3
|
+
logger
|
|
4
|
+
} from "./packager-tool-psmb758n.js";
|
|
5
|
+
import {
|
|
6
|
+
ConnectionsApi,
|
|
7
|
+
ElementsApi,
|
|
8
|
+
createApiClient,
|
|
9
|
+
isV4ActivityConfiguration,
|
|
10
|
+
getConnectorActivityMetadataV4
|
|
11
|
+
} from "./packager-tool-ccejfs0r.js";
|
|
12
|
+
|
|
13
|
+
// ../maestro-sdk/src/registry/integration-service-fetcher.ts
|
|
14
|
+
function parseContext(node) {
|
|
15
|
+
const context = node.model?.context;
|
|
16
|
+
if (!Array.isArray(context))
|
|
17
|
+
return null;
|
|
18
|
+
const connectorKey = context.find((c) => c.name === "connectorKey")?.value;
|
|
19
|
+
const objectName = context.find((c) => c.name === "objectName")?.value;
|
|
20
|
+
const method = context.find((c) => c.name === "method")?.value ?? "POST";
|
|
21
|
+
const operation = context.find((c) => c.name === "operation")?.value;
|
|
22
|
+
if (!connectorKey || !objectName)
|
|
23
|
+
return null;
|
|
24
|
+
return { connectorKey, objectName, method, operation };
|
|
25
|
+
}
|
|
26
|
+
function applyOptionalFieldProps(compact, field) {
|
|
27
|
+
if (field.enum?.length)
|
|
28
|
+
compact.enum = field.enum;
|
|
29
|
+
if (field.reference) {
|
|
30
|
+
compact.reference = {
|
|
31
|
+
objectName: field.reference.objectName,
|
|
32
|
+
lookupValue: field.reference.lookupValue,
|
|
33
|
+
lookupNames: field.reference.lookupNames,
|
|
34
|
+
path: field.reference.path,
|
|
35
|
+
childPath: field.reference.childPath,
|
|
36
|
+
scriptRef: field.reference.scriptRef
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function extractFields(metadata, method, requestOnly) {
|
|
41
|
+
const fieldsObj = metadata?.fields ?? {};
|
|
42
|
+
const fields = Array.isArray(fieldsObj) ? fieldsObj : Object.values(fieldsObj);
|
|
43
|
+
return fields.filter((field) => {
|
|
44
|
+
const methodInfo = field.method?.[method];
|
|
45
|
+
if (!methodInfo)
|
|
46
|
+
return false;
|
|
47
|
+
return requestOnly ? methodInfo.request === true || methodInfo.requestCurated === true : methodInfo.response === true || methodInfo.responseCurated === true;
|
|
48
|
+
}).map((field) => {
|
|
49
|
+
const compact = {
|
|
50
|
+
name: field.name,
|
|
51
|
+
displayName: field.displayName,
|
|
52
|
+
type: field.type,
|
|
53
|
+
dataType: field.type,
|
|
54
|
+
required: requestOnly ? field.method?.[method]?.required === true : false,
|
|
55
|
+
description: field.description
|
|
56
|
+
};
|
|
57
|
+
if (!requestOnly)
|
|
58
|
+
compact.responseOnly = true;
|
|
59
|
+
applyOptionalFieldProps(compact, field);
|
|
60
|
+
return compact;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function isConnectorNode(node) {
|
|
64
|
+
const nodeType = node.nodeType;
|
|
65
|
+
return nodeType?.startsWith("uipath.connector") || false;
|
|
66
|
+
}
|
|
67
|
+
function isConnectorTriggerNode(node) {
|
|
68
|
+
const nodeType = node.nodeType;
|
|
69
|
+
return nodeType?.startsWith("uipath.connector.trigger") || false;
|
|
70
|
+
}
|
|
71
|
+
function toCompactField(field, required) {
|
|
72
|
+
const compact = {
|
|
73
|
+
name: field.name,
|
|
74
|
+
displayName: field.displayName,
|
|
75
|
+
type: field.type,
|
|
76
|
+
dataType: field.type,
|
|
77
|
+
required,
|
|
78
|
+
description: field.description
|
|
79
|
+
};
|
|
80
|
+
applyOptionalFieldProps(compact, field);
|
|
81
|
+
return compact;
|
|
82
|
+
}
|
|
83
|
+
function extractTriggerEventParameters(metadata, operationName) {
|
|
84
|
+
const fields = Object.values(metadata?.fields ?? {});
|
|
85
|
+
return fields.filter((field) => !!field.events?.[operationName]).map((field) => toCompactField(field, field.events?.[operationName]?.required === true));
|
|
86
|
+
}
|
|
87
|
+
function extractTriggerFilterFields(metadata) {
|
|
88
|
+
const fields = Object.values(metadata?.fields ?? {});
|
|
89
|
+
return fields.filter((field) => field.order === 1).map((field) => toCompactField(field, false));
|
|
90
|
+
}
|
|
91
|
+
function extractActivityFilterFields(metadata, _method) {
|
|
92
|
+
const fieldsObj = metadata?.fields ?? {};
|
|
93
|
+
const fields = Array.isArray(fieldsObj) ? fieldsObj : Object.values(fieldsObj);
|
|
94
|
+
return fields.filter((field) => field.searchable === true).map((field) => {
|
|
95
|
+
const compact = {
|
|
96
|
+
name: field.name,
|
|
97
|
+
displayName: field.displayName,
|
|
98
|
+
type: field.type,
|
|
99
|
+
dataType: field.type,
|
|
100
|
+
required: false,
|
|
101
|
+
description: field.description
|
|
102
|
+
};
|
|
103
|
+
if (field.searchableOperators?.length) {
|
|
104
|
+
compact.searchableOperators = [...field.searchableOperators];
|
|
105
|
+
}
|
|
106
|
+
if (field.searchableNames?.length) {
|
|
107
|
+
compact.searchableNames = [...field.searchableNames];
|
|
108
|
+
}
|
|
109
|
+
applyOptionalFieldProps(compact, field);
|
|
110
|
+
return compact;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function extractTriggerOutputFields(metadata) {
|
|
114
|
+
const fields = Object.values(metadata?.fields ?? {});
|
|
115
|
+
return fields.map((field) => {
|
|
116
|
+
const compact = toCompactField(field, false);
|
|
117
|
+
compact.responseOnly = true;
|
|
118
|
+
return compact;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
async function fetchConnectorTriggerMetadata(connectorKey, operationName, objectName, connectionId) {
|
|
122
|
+
const api = await createApiClient(ElementsApi);
|
|
123
|
+
const triggerMetadata = await api.getInstanceEventObjectMetadata({
|
|
124
|
+
connectionOrInstanceId: connectionId,
|
|
125
|
+
elementKey: connectorKey,
|
|
126
|
+
operationName,
|
|
127
|
+
objectName,
|
|
128
|
+
allFields: true
|
|
129
|
+
});
|
|
130
|
+
return triggerMetadata;
|
|
131
|
+
}
|
|
132
|
+
function getConfigurationString(node) {
|
|
133
|
+
const modelConfig = node.model?.configuration;
|
|
134
|
+
if (modelConfig)
|
|
135
|
+
return modelConfig;
|
|
136
|
+
const form = node.form;
|
|
137
|
+
for (const section of form?.sections ?? []) {
|
|
138
|
+
for (const field of section.fields ?? []) {
|
|
139
|
+
const config = field.componentProps?.connectorDetail?.configuration;
|
|
140
|
+
if (config)
|
|
141
|
+
return config;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
function getConnectorConfiguration(node) {
|
|
147
|
+
const configStr = getConfigurationString(node);
|
|
148
|
+
if (!configStr)
|
|
149
|
+
return null;
|
|
150
|
+
const [err, parsed] = catchError2(() => JSON.parse(configStr));
|
|
151
|
+
return err ? null : parsed;
|
|
152
|
+
}
|
|
153
|
+
class ConnectionConnectorMismatchError2 extends Error {
|
|
154
|
+
instructions;
|
|
155
|
+
constructor(message, instructions) {
|
|
156
|
+
super(message);
|
|
157
|
+
this.instructions = instructions;
|
|
158
|
+
this.name = "ConnectionConnectorMismatchError";
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function assertConnectionConnector(connectionId, info, connectorKey, subject) {
|
|
162
|
+
if (!info.connectorKey || !connectorKey || info.connectorKey.toLowerCase() === connectorKey.toLowerCase()) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
throw new ConnectionConnectorMismatchError2(`Connection "${connectionId}" is a ${info.connectorKey} connection, but ${subject} runs on ${connectorKey}.`, `Pass a ${connectorKey} connection: 'uip is connections list ${connectorKey} --all-folders'.`);
|
|
166
|
+
}
|
|
167
|
+
async function fetchConnectionInfo(connectionId) {
|
|
168
|
+
const api = await createApiClient(ConnectionsApi);
|
|
169
|
+
const response = await api.apiV1ConnectionsConnectionIdGet({
|
|
170
|
+
connectionId
|
|
171
|
+
});
|
|
172
|
+
const connector = response.connector;
|
|
173
|
+
return {
|
|
174
|
+
id: response.id ?? connectionId,
|
|
175
|
+
name: response.name ?? connectionId,
|
|
176
|
+
connectorKey: connector?.key ?? "",
|
|
177
|
+
connectorName: connector?.name ?? "",
|
|
178
|
+
connectorVersion: response.elementVersion ?? null,
|
|
179
|
+
pollingInterval: response.pollingIntervalInMinutes ?? null,
|
|
180
|
+
byoaConnection: response.byoaConnection === true,
|
|
181
|
+
elementInstanceId: response.elementInstanceId ?? null,
|
|
182
|
+
folderKey: response.folder?.key ?? null
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
async function fetchConnectorMetadata2(connectorKey, objectName, connectionId) {
|
|
186
|
+
const api = await createApiClient(ElementsApi);
|
|
187
|
+
if (connectionId) {
|
|
188
|
+
const response = await api.getInstanceObjectMetadataRaw({
|
|
189
|
+
connectionOrInstanceId: connectionId,
|
|
190
|
+
elementKey: connectorKey,
|
|
191
|
+
objectName,
|
|
192
|
+
includeParentArray: true
|
|
193
|
+
});
|
|
194
|
+
return await response.raw.json();
|
|
195
|
+
}
|
|
196
|
+
const response = await api.getObjectMetadataRaw({
|
|
197
|
+
elementKey: connectorKey,
|
|
198
|
+
objectName,
|
|
199
|
+
includeParentArray: true
|
|
200
|
+
});
|
|
201
|
+
return await response.raw.json();
|
|
202
|
+
}
|
|
203
|
+
async function fetchConnectorActivityMetadataV4(connectorKey, objectName) {
|
|
204
|
+
return await getConnectorActivityMetadataV4(undefined, connectorKey, objectName);
|
|
205
|
+
}
|
|
206
|
+
function buildEnrichedActivityNode(node, metadata, method) {
|
|
207
|
+
const connectorMethodInfo = metadata?.metadata?.method?.[method];
|
|
208
|
+
const inputFields = extractFields(metadata, method, true);
|
|
209
|
+
const outputFields = extractFields(metadata, method, false);
|
|
210
|
+
const filterFields = extractActivityFilterFields(metadata, method);
|
|
211
|
+
return {
|
|
212
|
+
...node,
|
|
213
|
+
...connectorMethodInfo && { connectorMethodInfo },
|
|
214
|
+
inputDefinition: node.inputDefinition && Object.keys(node.inputDefinition).length > 0 ? node.inputDefinition : { fields: inputFields },
|
|
215
|
+
outputResponseDefinition: { fields: outputFields },
|
|
216
|
+
...filterFields.length > 0 && {
|
|
217
|
+
filterFields: { fields: filterFields }
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
async function enrichConnectorActivityNode(node, connectionId) {
|
|
222
|
+
const parsed = parseContext(node);
|
|
223
|
+
const config = getConnectorConfiguration(node);
|
|
224
|
+
if (isV4ActivityConfiguration(config)) {
|
|
225
|
+
return enrichV4ConnectorActivityNode(node, connectionId, config);
|
|
226
|
+
}
|
|
227
|
+
if (!parsed)
|
|
228
|
+
return node;
|
|
229
|
+
const { connectorKey, objectName, method } = parsed;
|
|
230
|
+
const [error, metadata] = await catchError2(fetchConnectorMetadata2(connectorKey, objectName, connectionId));
|
|
231
|
+
if (error) {
|
|
232
|
+
return node;
|
|
233
|
+
}
|
|
234
|
+
return buildEnrichedActivityNode(node, metadata, method);
|
|
235
|
+
}
|
|
236
|
+
async function enrichV4ConnectorActivityNode(node, connectionId, config) {
|
|
237
|
+
const connectorKey = config?.connectorKey;
|
|
238
|
+
const objectName = config?.objectName;
|
|
239
|
+
const method = config?.httpMethod;
|
|
240
|
+
if (!connectorKey || !objectName || !method) {
|
|
241
|
+
logger.warn("v4 IS enrichment skipped: node configuration carries no connectorKey/objectName/httpMethod.");
|
|
242
|
+
return node;
|
|
243
|
+
}
|
|
244
|
+
if (connectionId) {
|
|
245
|
+
logger.warn("v4 metadata endpoints are not connection-scoped — --connection-id is ignored for 4.0.0 enrichment.");
|
|
246
|
+
}
|
|
247
|
+
const [error, metadata] = await catchError2(fetchConnectorActivityMetadataV4(connectorKey, objectName));
|
|
248
|
+
if (error) {
|
|
249
|
+
logger.warn(`IS v4 enrichment failed: ${error.message}`);
|
|
250
|
+
return node;
|
|
251
|
+
}
|
|
252
|
+
return buildEnrichedActivityNode(node, metadata, method);
|
|
253
|
+
}
|
|
254
|
+
async function enrichConnectorNode(node, connectionId) {
|
|
255
|
+
if (!isConnectorNode(node))
|
|
256
|
+
return node;
|
|
257
|
+
return isConnectorTriggerNode(node) ? enrichConnectorTriggerNode(node, connectionId) : enrichConnectorActivityNode(node, connectionId);
|
|
258
|
+
}
|
|
259
|
+
async function enrichConnectorTriggerNode(node, connectionId) {
|
|
260
|
+
if (!connectionId) {
|
|
261
|
+
throw new Error("Trigger nodes require --connection-id for IS enrichment. Provide it with --connection-id <id>.");
|
|
262
|
+
}
|
|
263
|
+
const parsed = parseContext(node);
|
|
264
|
+
if (!parsed?.operation)
|
|
265
|
+
return node;
|
|
266
|
+
const { connectorKey, objectName, operation } = parsed;
|
|
267
|
+
const metadata = await fetchConnectorTriggerMetadata(connectorKey, operation, objectName, connectionId);
|
|
268
|
+
const eventParameters = extractTriggerEventParameters(metadata, operation);
|
|
269
|
+
const filterFields = extractTriggerFilterFields(metadata);
|
|
270
|
+
const outputFields = extractTriggerOutputFields(metadata);
|
|
271
|
+
let byoaConnection = false;
|
|
272
|
+
let elementInstanceId = null;
|
|
273
|
+
if (connectionId) {
|
|
274
|
+
const [connErr, connInfo] = await catchError2(fetchConnectionInfo(connectionId));
|
|
275
|
+
if (!connErr) {
|
|
276
|
+
byoaConnection = connInfo.byoaConnection;
|
|
277
|
+
elementInstanceId = connInfo.elementInstanceId;
|
|
278
|
+
} else {
|
|
279
|
+
logger.warn(`Failed to fetch connection info for ${connectionId}: ${connErr.message}`);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return {
|
|
283
|
+
...node,
|
|
284
|
+
eventMode: metadata.eventMode,
|
|
285
|
+
byoaConnection,
|
|
286
|
+
elementInstanceId,
|
|
287
|
+
eventParameters: { fields: eventParameters },
|
|
288
|
+
filterFields: { fields: filterFields },
|
|
289
|
+
outputResponseDefinition: { fields: outputFields }
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export { extractTriggerEventParameters, extractTriggerFilterFields, extractActivityFilterFields, fetchConnectorTriggerMetadata, ConnectionConnectorMismatchError2, assertConnectionConnector, fetchConnectionInfo, fetchConnectorMetadata2, enrichConnectorNode };
|
|
294
|
+
|
|
295
|
+
//# debugId=1F5E5EEBDAE1651764756E2164756E21
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catchError2
|
|
3
|
+
} from "./packager-tool-psmb758n.js";
|
|
4
|
+
import {
|
|
5
|
+
byCodeUnit
|
|
6
|
+
} from "./packager-tool-1c30ttpm.js";
|
|
7
|
+
|
|
8
|
+
// src/services/bindings-v2.ts
|
|
9
|
+
var BINDINGS_V2_FILE_NAME2 = "bindings_v2.json";
|
|
10
|
+
var BINDINGS_V2_VERSION = "2.0";
|
|
11
|
+
var CONNECTION_ID_PROPERTY2 = "ConnectionId";
|
|
12
|
+
var FOLDER_KEY_PROPERTY2 = "folderKey";
|
|
13
|
+
var sortBindingsV2Resources = (resources) => [...resources].sort((a, b) => byCodeUnit(a.resource, b.resource) || byCodeUnit(a.key, b.key));
|
|
14
|
+
var serializeBindingsV2File2 = (resources) => {
|
|
15
|
+
const file = {
|
|
16
|
+
version: BINDINGS_V2_VERSION,
|
|
17
|
+
resources: sortBindingsV2Resources(resources)
|
|
18
|
+
};
|
|
19
|
+
return `${JSON.stringify(file, null, 2)}
|
|
20
|
+
`;
|
|
21
|
+
};
|
|
22
|
+
var readBindingsV2Resources2 = (raw) => {
|
|
23
|
+
const [error, parsed] = catchError2(() => JSON.parse(raw));
|
|
24
|
+
if (error)
|
|
25
|
+
return;
|
|
26
|
+
if (parsed === null || typeof parsed !== "object")
|
|
27
|
+
return;
|
|
28
|
+
const resources = parsed.resources;
|
|
29
|
+
if (!Array.isArray(resources))
|
|
30
|
+
return;
|
|
31
|
+
return resources.filter((entry) => entry !== null && typeof entry === "object" && typeof entry.key === "string");
|
|
32
|
+
};
|
|
33
|
+
var identity = (entry) => `${entry.resource}:${entry.key}`;
|
|
34
|
+
var asSaved = (entry, found) => {
|
|
35
|
+
let saved = entry;
|
|
36
|
+
if (entry.resource === "Connection" && entry.value[FOLDER_KEY_PROPERTY2] !== undefined && found.value?.[FOLDER_KEY_PROPERTY2] === undefined) {
|
|
37
|
+
const { [FOLDER_KEY_PROPERTY2]: _dropped, ...value } = entry.value;
|
|
38
|
+
saved = { ...saved, value };
|
|
39
|
+
}
|
|
40
|
+
if (saved.metadata?.ActivityName !== undefined && found.metadata?.ActivityName === undefined) {
|
|
41
|
+
const { ActivityName: _label, ...metadata } = saved.metadata;
|
|
42
|
+
saved = { ...saved, metadata };
|
|
43
|
+
}
|
|
44
|
+
return saved;
|
|
45
|
+
};
|
|
46
|
+
var diffBindingsV22 = (expected, actual) => {
|
|
47
|
+
const expectedByKey = new Map(expected.map((e) => [identity(e), e]));
|
|
48
|
+
const actualByKey = new Map(actual.map((e) => [identity(e), e]));
|
|
49
|
+
const missing = [];
|
|
50
|
+
const changed = [];
|
|
51
|
+
for (const [key, entry] of expectedByKey) {
|
|
52
|
+
const found = actualByKey.get(key);
|
|
53
|
+
if (found === undefined) {
|
|
54
|
+
missing.push(entry.key);
|
|
55
|
+
} else if (JSON.stringify(found) !== JSON.stringify(asSaved(entry, found))) {
|
|
56
|
+
changed.push(entry.key);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const extra = [...actualByKey.values()].filter((entry) => !expectedByKey.has(identity(entry))).map((entry) => entry.key);
|
|
60
|
+
const alphabetically = (left, right) => left.localeCompare(right);
|
|
61
|
+
return {
|
|
62
|
+
missing: missing.sort(alphabetically),
|
|
63
|
+
extra: extra.sort(alphabetically),
|
|
64
|
+
changed: changed.sort(alphabetically)
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
var hasBindingsV2Difference2 = (difference) => difference.missing.length > 0 || difference.extra.length > 0 || difference.changed.length > 0;
|
|
68
|
+
|
|
69
|
+
export { BINDINGS_V2_FILE_NAME2, CONNECTION_ID_PROPERTY2, FOLDER_KEY_PROPERTY2, serializeBindingsV2File2, readBindingsV2Resources2, diffBindingsV22, hasBindingsV2Difference2 };
|
|
70
|
+
|
|
71
|
+
//# debugId=A1ABBB615ABF984E64756E2164756E21
|
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./packager-tool-qn3zkrrc.js";
|
|
5
|
-
import {
|
|
6
|
-
addVarIdsToInputsOutputs,
|
|
7
|
-
buildErrorOutput
|
|
8
|
-
} from "./packager-tool-ydyvtknp.js";
|
|
9
|
-
import {
|
|
10
|
-
fetchConnectorMetadata
|
|
11
|
-
} from "./packager-tool-b1nw50ev.js";
|
|
2
|
+
catchError2
|
|
3
|
+
} from "./packager-tool-psmb758n.js";
|
|
12
4
|
import {
|
|
13
5
|
ElementsApi,
|
|
14
|
-
assertActivityMetadataResolved,
|
|
15
|
-
buildInputMetadata,
|
|
16
6
|
createApiClient,
|
|
17
7
|
createConfiguredActivityClient,
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
assertActivityMetadataResolved,
|
|
9
|
+
extractMultipartParameters,
|
|
10
|
+
buildInputMetadata
|
|
11
|
+
} from "./packager-tool-ccejfs0r.js";
|
|
12
|
+
import {
|
|
13
|
+
guardJsonString
|
|
14
|
+
} from "./packager-tool-h2ar8xf8.js";
|
|
15
|
+
import {
|
|
16
|
+
lookupTypeCacheEntry2,
|
|
17
|
+
fetchConnectorConnections2
|
|
18
|
+
} from "./packager-tool-ehjw672b.js";
|
|
19
|
+
import {
|
|
20
|
+
buildErrorOutput,
|
|
21
|
+
addVarIdsToInputsOutputs
|
|
22
|
+
} from "./packager-tool-0w4fsdzv.js";
|
|
23
|
+
import {
|
|
24
|
+
fetchConnectorMetadata2
|
|
25
|
+
} from "./packager-tool-k0ar6cn7.js";
|
|
20
26
|
import {
|
|
21
27
|
createConnectorBindings
|
|
22
|
-
} from "./packager-tool-
|
|
28
|
+
} from "./packager-tool-e1tx5mqg.js";
|
|
23
29
|
import {
|
|
24
|
-
|
|
25
|
-
} from "./packager-tool-
|
|
30
|
+
v2ConfigurationVersionEntry
|
|
31
|
+
} from "./packager-tool-68648y3j.js";
|
|
26
32
|
|
|
27
33
|
// src/services/connector-enrichment-service.ts
|
|
28
|
-
function
|
|
34
|
+
function parseEntryConfiguration2(entry) {
|
|
29
35
|
if (!entry.configuration)
|
|
30
36
|
return {};
|
|
31
37
|
try {
|
|
@@ -35,15 +41,15 @@ function parseEntryConfiguration(entry) {
|
|
|
35
41
|
}
|
|
36
42
|
}
|
|
37
43
|
async function fetchMetadataSafe(connectorKey, objectName, connectionId) {
|
|
38
|
-
const [err, result] = await
|
|
44
|
+
const [err, result] = await catchError2(fetchConnectorMetadata2(connectorKey, objectName, connectionId));
|
|
39
45
|
return err ? undefined : result;
|
|
40
46
|
}
|
|
41
|
-
async function
|
|
42
|
-
const [apiError, api] = await
|
|
47
|
+
async function resolveActivityOperation2(connectorKey, displayName, operation) {
|
|
48
|
+
const [apiError, api] = await catchError2(createApiClient(ElementsApi));
|
|
43
49
|
if (apiError) {
|
|
44
50
|
return operation;
|
|
45
51
|
}
|
|
46
|
-
const [fetchError, activities] = await
|
|
52
|
+
const [fetchError, activities] = await catchError2(api.getActivities({ elementKey: connectorKey }));
|
|
47
53
|
if (fetchError) {
|
|
48
54
|
return operation;
|
|
49
55
|
}
|
|
@@ -52,9 +58,9 @@ async function resolveActivityOperation(connectorKey, displayName, operation) {
|
|
|
52
58
|
}
|
|
53
59
|
const list = activities;
|
|
54
60
|
if (operation) {
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
61
|
+
const match = list.find((a) => a.operation === operation && !a.isTrigger);
|
|
62
|
+
if (match) {
|
|
63
|
+
return match.name;
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
const match = list.find((a) => a.displayName === displayName && !a.isTrigger);
|
|
@@ -63,31 +69,31 @@ async function resolveActivityOperation(connectorKey, displayName, operation) {
|
|
|
63
69
|
}
|
|
64
70
|
return operation;
|
|
65
71
|
}
|
|
66
|
-
async function
|
|
67
|
-
const [apiError, api] = await
|
|
72
|
+
async function fetchObjectSwaggerPath2(connectorKey, objectName) {
|
|
73
|
+
const [apiError, api] = await catchError2(createApiClient(ElementsApi));
|
|
68
74
|
if (apiError) {
|
|
69
75
|
return;
|
|
70
76
|
}
|
|
71
|
-
const [fetchError, swagger] = await
|
|
77
|
+
const [fetchError, swagger] = await catchError2(api.getObjectSwagger({
|
|
72
78
|
elementKey: connectorKey,
|
|
73
79
|
objectName
|
|
74
80
|
}));
|
|
75
81
|
if (fetchError) {
|
|
76
82
|
return;
|
|
77
83
|
}
|
|
78
|
-
const [parseError, parsed] =
|
|
84
|
+
const [parseError, parsed] = catchError2(() => typeof swagger === "string" ? JSON.parse(swagger) : swagger);
|
|
79
85
|
if (parseError || !parsed?.paths) {
|
|
80
86
|
return;
|
|
81
87
|
}
|
|
82
88
|
const pathKeys = Object.keys(parsed.paths).filter((k) => k.startsWith("/"));
|
|
83
89
|
return pathKeys[0];
|
|
84
90
|
}
|
|
85
|
-
async function
|
|
86
|
-
const [apiError, api] = await
|
|
91
|
+
async function fetchObjectMethodConfig2(connectorKey, objectName, httpMethod) {
|
|
92
|
+
const [apiError, api] = await catchError2(createApiClient(ElementsApi));
|
|
87
93
|
if (apiError) {
|
|
88
94
|
return;
|
|
89
95
|
}
|
|
90
|
-
const [fetchError, objects] = await
|
|
96
|
+
const [fetchError, objects] = await catchError2(api.getObjects({ elementKey: connectorKey }));
|
|
91
97
|
if (fetchError) {
|
|
92
98
|
return;
|
|
93
99
|
}
|
|
@@ -104,7 +110,7 @@ async function fetchObjectMethodConfig(connectorKey, objectName, httpMethod) {
|
|
|
104
110
|
}
|
|
105
111
|
async function buildActivityPropertyConfig(params) {
|
|
106
112
|
const { entry, uiPathActivityTypeId, connectionId } = params;
|
|
107
|
-
const instanceParameters =
|
|
113
|
+
const instanceParameters = parseEntryConfiguration2(entry);
|
|
108
114
|
const activityClient = await createConfiguredActivityClient({
|
|
109
115
|
instanceParameters,
|
|
110
116
|
connectionId
|
|
@@ -115,7 +121,7 @@ async function buildActivityPropertyConfig(params) {
|
|
|
115
121
|
const multipartParams = extractMultipartParameters(params.objectMethodConfig?.parameters ?? []);
|
|
116
122
|
return {
|
|
117
123
|
...multipartParams.length > 0 ? { multipartParameters: multipartParams } : {},
|
|
118
|
-
configuration:
|
|
124
|
+
configuration: guardJsonString(JSON.stringify(essentialConfig)),
|
|
119
125
|
uiPathActivityTypeId,
|
|
120
126
|
errorState: { issues: [] }
|
|
121
127
|
};
|
|
@@ -125,7 +131,7 @@ function buildInputMetadataFromParams(objectMethodConfig, resolvedOperation) {
|
|
|
125
131
|
const multipartParams = extractMultipartParameters(params);
|
|
126
132
|
return buildInputMetadata(multipartParams, resolvedOperation ?? "list") ?? undefined;
|
|
127
133
|
}
|
|
128
|
-
function
|
|
134
|
+
function extractFields2(metadata) {
|
|
129
135
|
if (metadata.fields) {
|
|
130
136
|
return metadata.fields;
|
|
131
137
|
}
|
|
@@ -135,36 +141,18 @@ function extractFields(metadata) {
|
|
|
135
141
|
}
|
|
136
142
|
return;
|
|
137
143
|
}
|
|
138
|
-
function
|
|
144
|
+
function normalizeFields2(raw) {
|
|
139
145
|
if (Array.isArray(raw)) {
|
|
140
146
|
return raw;
|
|
141
147
|
}
|
|
142
148
|
return Object.values(raw);
|
|
143
149
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const result = {};
|
|
147
|
-
for (const [key, value] of Object.entries(flat)) {
|
|
148
|
-
const parts = key.split(".");
|
|
149
|
-
if (parts.some((p) => UNSAFE_KEYS.has(p)))
|
|
150
|
-
continue;
|
|
151
|
-
let current = result;
|
|
152
|
-
for (let i = 0;i < parts.length - 1; i++) {
|
|
153
|
-
if (!Object.hasOwn(current, parts[i]) || typeof current[parts[i]] !== "object" || current[parts[i]] === null) {
|
|
154
|
-
current[parts[i]] = {};
|
|
155
|
-
}
|
|
156
|
-
current = current[parts[i]];
|
|
157
|
-
}
|
|
158
|
-
current[parts[parts.length - 1]] = value;
|
|
159
|
-
}
|
|
160
|
-
return result;
|
|
161
|
-
}
|
|
162
|
-
function mapISFieldsToInputOutputs(metadata, httpMethod) {
|
|
163
|
-
const rawFields = extractFields(metadata);
|
|
150
|
+
function mapISFieldsToInputOutputs2(metadata, httpMethod) {
|
|
151
|
+
const rawFields = extractFields2(metadata);
|
|
164
152
|
if (!rawFields) {
|
|
165
153
|
return { inputs: [], outputs: [] };
|
|
166
154
|
}
|
|
167
|
-
const fields =
|
|
155
|
+
const fields = normalizeFields2(rawFields);
|
|
168
156
|
const method = httpMethod ?? "POST";
|
|
169
157
|
const requestFields = [];
|
|
170
158
|
const responseFields = [];
|
|
@@ -214,7 +202,7 @@ function mapISFieldsToInputOutputs(metadata, httpMethod) {
|
|
|
214
202
|
outputs.push(buildErrorOutput());
|
|
215
203
|
return { inputs, outputs };
|
|
216
204
|
}
|
|
217
|
-
function
|
|
205
|
+
function buildParameterInputs2(objectMethodConfig, activityPropertyConfig) {
|
|
218
206
|
const inputs = [];
|
|
219
207
|
inputs.push({
|
|
220
208
|
name: "pathParameters",
|
|
@@ -269,7 +257,7 @@ function httpMethodToOperationType(method) {
|
|
|
269
257
|
return "";
|
|
270
258
|
}
|
|
271
259
|
}
|
|
272
|
-
function
|
|
260
|
+
function buildConnectorContext2(params) {
|
|
273
261
|
const {
|
|
274
262
|
config,
|
|
275
263
|
entry,
|
|
@@ -339,26 +327,22 @@ function buildConnectorContext(params) {
|
|
|
339
327
|
primaryKeyName: ""
|
|
340
328
|
}
|
|
341
329
|
};
|
|
342
|
-
context.push({
|
|
343
|
-
name: "metadata",
|
|
344
|
-
type: "json",
|
|
345
|
-
body: metadataBody
|
|
346
|
-
});
|
|
330
|
+
context.push({ name: "metadata", type: "json", body: metadataBody }, v2ConfigurationVersionEntry());
|
|
347
331
|
return context;
|
|
348
332
|
}
|
|
349
|
-
async function
|
|
333
|
+
async function extractFieldDefinitions2(connectorKey, objectName, httpMethod, prefetched) {
|
|
350
334
|
const result = {};
|
|
351
335
|
if (!objectName)
|
|
352
336
|
return result;
|
|
353
337
|
const method = httpMethod ?? "POST";
|
|
354
338
|
const [metadata, methodConfig] = prefetched ? [prefetched.metadata, prefetched.methodConfig] : await Promise.all([
|
|
355
339
|
fetchMetadataSafe(connectorKey, objectName),
|
|
356
|
-
|
|
340
|
+
fetchObjectMethodConfig2(connectorKey, objectName, method)
|
|
357
341
|
]);
|
|
358
342
|
if (metadata) {
|
|
359
|
-
const rawFields =
|
|
343
|
+
const rawFields = extractFields2(metadata);
|
|
360
344
|
if (rawFields) {
|
|
361
|
-
const fields =
|
|
345
|
+
const fields = normalizeFields2(rawFields);
|
|
362
346
|
const bodyDefs = {};
|
|
363
347
|
for (const field of fields) {
|
|
364
348
|
const mc = field.method?.[method];
|
|
@@ -414,7 +398,7 @@ async function extractFieldDefinitions(connectorKey, objectName, httpMethod, pre
|
|
|
414
398
|
}
|
|
415
399
|
return result;
|
|
416
400
|
}
|
|
417
|
-
async function
|
|
401
|
+
async function enrichConnectorRegistryEntry2(config, connectionId) {
|
|
418
402
|
if (!config.objectName || !config.httpMethod) {
|
|
419
403
|
return null;
|
|
420
404
|
}
|
|
@@ -422,11 +406,11 @@ async function enrichConnectorRegistryEntry(config, connectionId) {
|
|
|
422
406
|
if (!metadata) {
|
|
423
407
|
return null;
|
|
424
408
|
}
|
|
425
|
-
const rawFields =
|
|
409
|
+
const rawFields = extractFields2(metadata);
|
|
426
410
|
if (!rawFields) {
|
|
427
411
|
return null;
|
|
428
412
|
}
|
|
429
|
-
const fields =
|
|
413
|
+
const fields = normalizeFields2(rawFields);
|
|
430
414
|
const method = config.httpMethod;
|
|
431
415
|
const inputFields = [];
|
|
432
416
|
const outputFields = [];
|
|
@@ -460,9 +444,9 @@ async function enrichConnectorRegistryEntry(config, connectionId) {
|
|
|
460
444
|
outputDefinition: { fields: outputFields }
|
|
461
445
|
};
|
|
462
446
|
}
|
|
463
|
-
async function
|
|
464
|
-
const { entry, config } = await
|
|
465
|
-
const resolvedOperation = await
|
|
447
|
+
async function enrichConnectorActivity2(activityTypeId, connectionId, indexType = "typecache-activities") {
|
|
448
|
+
const { entry, config } = await lookupTypeCacheEntry2(activityTypeId, indexType);
|
|
449
|
+
const resolvedOperation = await resolveActivityOperation2(config.connectorKey, entry.displayName, config.operation);
|
|
466
450
|
let inputs = [];
|
|
467
451
|
let outputs = [];
|
|
468
452
|
let objectSwaggerPath;
|
|
@@ -472,13 +456,13 @@ async function enrichConnectorActivity(activityTypeId, connectionId, indexType =
|
|
|
472
456
|
if (config.objectName) {
|
|
473
457
|
const [md, swaggerPath, mc] = await Promise.all([
|
|
474
458
|
fetchMetadataSafe(config.connectorKey, config.objectName),
|
|
475
|
-
|
|
476
|
-
|
|
459
|
+
fetchObjectSwaggerPath2(config.connectorKey, config.objectName),
|
|
460
|
+
fetchObjectMethodConfig2(config.connectorKey, config.objectName, config.httpMethod)
|
|
477
461
|
]);
|
|
478
462
|
metadata = md ?? undefined;
|
|
479
463
|
objectMethodConfig = mc ?? undefined;
|
|
480
464
|
if (metadata) {
|
|
481
|
-
const io =
|
|
465
|
+
const io = mapISFieldsToInputOutputs2(metadata, config.httpMethod);
|
|
482
466
|
inputs = io.inputs;
|
|
483
467
|
outputs = io.outputs;
|
|
484
468
|
inputMetadata = buildInputMetadataFromParams(objectMethodConfig, resolvedOperation ?? config.operation);
|
|
@@ -496,10 +480,10 @@ async function enrichConnectorActivity(activityTypeId, connectionId, indexType =
|
|
|
496
480
|
if (config.objectName) {
|
|
497
481
|
inputs = [
|
|
498
482
|
...inputs,
|
|
499
|
-
...
|
|
483
|
+
...buildParameterInputs2(objectMethodConfig, activityPropertyConfig)
|
|
500
484
|
];
|
|
501
485
|
}
|
|
502
|
-
const connections = await
|
|
486
|
+
const connections = await fetchConnectorConnections2(config.connectorKey);
|
|
503
487
|
const connection = connections.find((c) => c.id === connectionId);
|
|
504
488
|
if (!connection) {
|
|
505
489
|
throw new Error(`Connection "${connectionId}" not found for connector "${config.connectorKey}"`);
|
|
@@ -511,7 +495,7 @@ async function enrichConnectorActivity(activityTypeId, connectionId, indexType =
|
|
|
511
495
|
if (folderKeyBinding) {
|
|
512
496
|
bindings.push(folderKeyBinding);
|
|
513
497
|
}
|
|
514
|
-
const context =
|
|
498
|
+
const context = buildConnectorContext2({
|
|
515
499
|
config,
|
|
516
500
|
entry,
|
|
517
501
|
connectionBindingId: connectionBinding.id,
|
|
@@ -541,6 +525,6 @@ async function enrichConnectorActivity(activityTypeId, connectionId, indexType =
|
|
|
541
525
|
};
|
|
542
526
|
}
|
|
543
527
|
|
|
544
|
-
export {
|
|
528
|
+
export { parseEntryConfiguration2, resolveActivityOperation2, fetchObjectSwaggerPath2, fetchObjectMethodConfig2, extractFields2, normalizeFields2, mapISFieldsToInputOutputs2, buildParameterInputs2, buildConnectorContext2, extractFieldDefinitions2, enrichConnectorRegistryEntry2, enrichConnectorActivity2 };
|
|
545
529
|
|
|
546
|
-
//# debugId=
|
|
530
|
+
//# debugId=E98C74933F9F2C6D64756E2164756E21
|