@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,14 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAuthContext
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-yn33pw57.js";
|
|
4
4
|
import {
|
|
5
5
|
isBrowser
|
|
6
6
|
} from "./packager-tool-0gctz400.js";
|
|
7
7
|
import {
|
|
8
8
|
addSdkUserAgentHeader,
|
|
9
|
+
catchError,
|
|
10
|
+
extractErrorMessage,
|
|
9
11
|
getSdkUserAgentToken,
|
|
12
|
+
httpStatusOf,
|
|
10
13
|
installSdkUserAgentHeader
|
|
11
|
-
} from "./packager-tool-
|
|
14
|
+
} from "./packager-tool-83v804p7.js";
|
|
12
15
|
import {
|
|
13
16
|
__require
|
|
14
17
|
} from "./packager-tool-1yh8g550.js";
|
|
@@ -6240,7 +6243,7 @@ var package_default = {
|
|
|
6240
6243
|
name: "@uipath/integrationservice-sdk",
|
|
6241
6244
|
author: "UiPath",
|
|
6242
6245
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
6243
|
-
version: "1.
|
|
6246
|
+
version: "1.205.0-preview.258",
|
|
6244
6247
|
repository: {
|
|
6245
6248
|
type: "git",
|
|
6246
6249
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -6276,12 +6279,13 @@ var package_default = {
|
|
|
6276
6279
|
devDependencies: {
|
|
6277
6280
|
"@uipath/auth": "workspace:*",
|
|
6278
6281
|
"@uipath/common": "workspace:*",
|
|
6282
|
+
"@uipath/solution-sdk": "workspace:*",
|
|
6279
6283
|
"@openapitools/openapi-generator-cli": "^2.31.1",
|
|
6280
6284
|
"@types/node": "^25.5.2",
|
|
6281
6285
|
typescript: "^7.0.2"
|
|
6282
6286
|
},
|
|
6283
6287
|
dependencies: {
|
|
6284
|
-
"@uipath/integration-service-design-time": "
|
|
6288
|
+
"@uipath/integration-service-design-time": "2.10.0"
|
|
6285
6289
|
}
|
|
6286
6290
|
};
|
|
6287
6291
|
|
|
@@ -6355,7 +6359,12 @@ async function createApiClient(ApiClass, options) {
|
|
|
6355
6359
|
const config = domain === "connections" ? await createConnectionsConfig(options) : await createElementsConfig(options);
|
|
6356
6360
|
return new ApiClass(config);
|
|
6357
6361
|
}
|
|
6362
|
+
var ACTIVITY_VERSION_V1 = "1.0.0";
|
|
6358
6363
|
var ACTIVITY_VERSION_V4 = "4.0.0";
|
|
6364
|
+
var SUPPORTED_ACTIVITY_VERSIONS = [
|
|
6365
|
+
ACTIVITY_VERSION_V1,
|
|
6366
|
+
ACTIVITY_VERSION_V4
|
|
6367
|
+
];
|
|
6359
6368
|
function isV4ActivityConfiguration(instanceParameters) {
|
|
6360
6369
|
if (!instanceParameters)
|
|
6361
6370
|
return false;
|
|
@@ -6377,6 +6386,34 @@ async function getConnectorActivityMetadataV4(options, connectorKey, objectName)
|
|
|
6377
6386
|
}
|
|
6378
6387
|
return await response.json();
|
|
6379
6388
|
}
|
|
6389
|
+
async function runInstanceDesignAction(options, connectionOrInstanceId, method, relativeUrl, body) {
|
|
6390
|
+
const { baseUrl, accessToken, organizationId, tenantName } = await getValidatedAuthContext(options);
|
|
6391
|
+
const url = `${baseUrl}/${organizationId}/${tenantName}/elements_/v3/element/instances/${encodeURIComponent(connectionOrInstanceId)}${relativeUrl}`;
|
|
6392
|
+
const headers = addSdkUserAgentHeader({
|
|
6393
|
+
Authorization: `Bearer ${accessToken}`,
|
|
6394
|
+
Accept: "application/json",
|
|
6395
|
+
"x-uipath-source": "UiPath.CodingAgent"
|
|
6396
|
+
}, SDK_USER_AGENT);
|
|
6397
|
+
const init = { method, headers };
|
|
6398
|
+
if (body && Object.keys(body).length > 0) {
|
|
6399
|
+
headers["Content-Type"] = "application/json";
|
|
6400
|
+
init.body = JSON.stringify(body);
|
|
6401
|
+
}
|
|
6402
|
+
const response = await connectorApiFetch(url, init);
|
|
6403
|
+
const text = await response.text();
|
|
6404
|
+
let parsed;
|
|
6405
|
+
try {
|
|
6406
|
+
parsed = JSON.parse(text);
|
|
6407
|
+
} catch {
|
|
6408
|
+
parsed = text;
|
|
6409
|
+
}
|
|
6410
|
+
return {
|
|
6411
|
+
ok: response.ok,
|
|
6412
|
+
status: response.status,
|
|
6413
|
+
statusText: response.statusText,
|
|
6414
|
+
body: parsed
|
|
6415
|
+
};
|
|
6416
|
+
}
|
|
6380
6417
|
async function getEventOperationObjects(options, elementInstanceId, connectorKey, eventOperation) {
|
|
6381
6418
|
const { baseUrl, accessToken, organizationId, tenantName } = await getValidatedAuthContext(options);
|
|
6382
6419
|
const url = `${baseUrl}/${organizationId}/${tenantName}/elements_/v3/element/instances/${encodeURIComponent(String(elementInstanceId))}/elements/${encodeURIComponent(connectorKey)}/events/operations/${encodeURIComponent(eventOperation)}/objects`;
|
|
@@ -6393,6 +6430,97 @@ async function getEventOperationObjects(options, elementInstanceId, connectorKey
|
|
|
6393
6430
|
}
|
|
6394
6431
|
return await response.json();
|
|
6395
6432
|
}
|
|
6433
|
+
var CONNECTOR_REQUEST_TIMEOUT_MS = 60000;
|
|
6434
|
+
async function connectorApiFetch(url, init) {
|
|
6435
|
+
try {
|
|
6436
|
+
return await fetch(url, {
|
|
6437
|
+
...init,
|
|
6438
|
+
redirect: "manual",
|
|
6439
|
+
signal: AbortSignal.timeout(CONNECTOR_REQUEST_TIMEOUT_MS)
|
|
6440
|
+
});
|
|
6441
|
+
} catch (e) {
|
|
6442
|
+
if (e instanceof Error && e.name === "TimeoutError") {
|
|
6443
|
+
throw new Error(`Request timed out after ${CONNECTOR_REQUEST_TIMEOUT_MS / 1000}s: ${url}. Check connectivity to the tenant and retry.`);
|
|
6444
|
+
}
|
|
6445
|
+
throw e;
|
|
6446
|
+
}
|
|
6447
|
+
}
|
|
6448
|
+
|
|
6449
|
+
// ../integrationservice-sdk/src/dap/activity-bindings.ts
|
|
6450
|
+
var DROPPED_RESOURCES = ["connection", "eventtrigger"];
|
|
6451
|
+
var isResourceType = (resource, types) => types.includes((resource ?? "").toLowerCase());
|
|
6452
|
+
function storedActivityBindings(bindings) {
|
|
6453
|
+
return bindings.filter((binding) => !isResourceType(binding.resource, DROPPED_RESOURCES));
|
|
6454
|
+
}
|
|
6455
|
+
function planResourceBindings(stored, resolved) {
|
|
6456
|
+
const plans = [];
|
|
6457
|
+
for (const { field, companion, selection } of resolved) {
|
|
6458
|
+
const entry = stored.find((binding) => binding.key?.toLowerCase() === selection.key.toLowerCase() && !isResourceType(binding.resource, ["property"]));
|
|
6459
|
+
if (entry === undefined)
|
|
6460
|
+
continue;
|
|
6461
|
+
const displayName = entry.value?.name?.displayName ?? field;
|
|
6462
|
+
const rows = [
|
|
6463
|
+
{
|
|
6464
|
+
field,
|
|
6465
|
+
propertyAttribute: "name",
|
|
6466
|
+
name: displayName,
|
|
6467
|
+
default: selection.name
|
|
6468
|
+
}
|
|
6469
|
+
];
|
|
6470
|
+
if (entry.value?.folderKey && selection.folderKey) {
|
|
6471
|
+
rows.push({
|
|
6472
|
+
field: companion,
|
|
6473
|
+
propertyAttribute: "folderKey",
|
|
6474
|
+
name: `${displayName} folder`,
|
|
6475
|
+
default: selection.folderKey
|
|
6476
|
+
});
|
|
6477
|
+
}
|
|
6478
|
+
plans.push({
|
|
6479
|
+
resource: entry.resource,
|
|
6480
|
+
resourceKey: selection.key,
|
|
6481
|
+
rows
|
|
6482
|
+
});
|
|
6483
|
+
}
|
|
6484
|
+
return plans;
|
|
6485
|
+
}
|
|
6486
|
+
|
|
6487
|
+
// ../integrationservice-sdk/src/dap/solution-resource-configurations.ts
|
|
6488
|
+
var CATALOG_MISS = "was not found in the solution or in the resource catalog";
|
|
6489
|
+
function createSolutionResourceConfigurationsProvider(solutionDir, namesByKey = new Map, openedEngine) {
|
|
6490
|
+
let engine = openedEngine ? Promise.resolve(openedEngine) : undefined;
|
|
6491
|
+
const ensureEngine = () => {
|
|
6492
|
+
engine ??= openEngine().catch((err) => {
|
|
6493
|
+
engine = undefined;
|
|
6494
|
+
throw err;
|
|
6495
|
+
});
|
|
6496
|
+
return engine;
|
|
6497
|
+
};
|
|
6498
|
+
const where = solutionDir ? `in ${solutionDir} or the resource catalog` : "in the resource catalog";
|
|
6499
|
+
return {
|
|
6500
|
+
async getAllConfigurations(resourceKey) {
|
|
6501
|
+
const { resources, services } = await ensureEngine();
|
|
6502
|
+
const builder = solutionDir ? await services.getSolutionBuilder(solutionDir, true) : undefined;
|
|
6503
|
+
const [error, graph] = await catchError(resources.readResourceConfigurationsAsync(services, builder, resourceKey, { name: namesByKey.get(resourceKey) }));
|
|
6504
|
+
await builder?.disposeAsync();
|
|
6505
|
+
if (error) {
|
|
6506
|
+
const status = httpStatusOf(error) ?? (error.message.endsWith(CATALOG_MISS) ? 404 : undefined);
|
|
6507
|
+
throw Object.assign(new Error(`Failed to read configuration for solution resource '${resourceKey}' ${where}: ${await extractErrorMessage(error)}`, { cause: error }), { status });
|
|
6508
|
+
}
|
|
6509
|
+
return {
|
|
6510
|
+
resources: graph.resources ?? []
|
|
6511
|
+
};
|
|
6512
|
+
}
|
|
6513
|
+
};
|
|
6514
|
+
}
|
|
6515
|
+
async function openEngine() {
|
|
6516
|
+
const { getSolutionAuthContext } = await import("./solution-auth-30yycqtv.js");
|
|
6517
|
+
await getSolutionAuthContext({});
|
|
6518
|
+
const resources = await import("./index-ekwtgx7y.js");
|
|
6519
|
+
return {
|
|
6520
|
+
resources,
|
|
6521
|
+
services: await resources.createResourceBuilderServices()
|
|
6522
|
+
};
|
|
6523
|
+
}
|
|
6396
6524
|
|
|
6397
6525
|
// ../integrationservice-sdk/src/dap/filter-builder/index.ts
|
|
6398
6526
|
class FilterNotSupportedError extends Error {
|
|
@@ -6453,7 +6581,142 @@ function createLiveConnectionsProvider() {
|
|
|
6453
6581
|
};
|
|
6454
6582
|
}
|
|
6455
6583
|
|
|
6584
|
+
// ../integrationservice-sdk/src/dap/resource-field-resolver.ts
|
|
6585
|
+
var FIELD_ARRAY_MARKER = "[*]";
|
|
6586
|
+
function resourceFolderKeyFieldName(fieldName) {
|
|
6587
|
+
const base = fieldName.endsWith(FIELD_ARRAY_MARKER) ? fieldName.slice(0, -FIELD_ARRAY_MARKER.length) : fieldName;
|
|
6588
|
+
return `${base}_folderKey`;
|
|
6589
|
+
}
|
|
6590
|
+
function isResourceSelection(value) {
|
|
6591
|
+
return typeof value === "object" && value !== null && typeof value.key === "string" && typeof value.name === "string";
|
|
6592
|
+
}
|
|
6593
|
+
|
|
6594
|
+
class ResourceFieldResolutionError extends Error {
|
|
6595
|
+
constructor(message) {
|
|
6596
|
+
super(message);
|
|
6597
|
+
this.name = "ResourceFieldResolutionError";
|
|
6598
|
+
}
|
|
6599
|
+
}
|
|
6600
|
+
async function resolveResourceFieldValues(fieldValues, resourceFields, solutionDir) {
|
|
6601
|
+
let solution;
|
|
6602
|
+
const openOnce = async () => {
|
|
6603
|
+
solution ??= await openSolution(solutionDir);
|
|
6604
|
+
return solution;
|
|
6605
|
+
};
|
|
6606
|
+
const [resolveError, resolved] = await catchError(resolveEach(fieldValues, resourceFields, openOnce));
|
|
6607
|
+
const saveError = solution ? await saveSolution(solution, solutionDir) : null;
|
|
6608
|
+
if (resolveError) {
|
|
6609
|
+
if (saveError) {
|
|
6610
|
+
resolveError.message += ` The solution at '${solutionDir}' also failed to save: ${saveError.message}`;
|
|
6611
|
+
}
|
|
6612
|
+
throw resolveError;
|
|
6613
|
+
}
|
|
6614
|
+
if (saveError) {
|
|
6615
|
+
throw new ResourceFieldResolutionError(`The resource was referenced but the solution at '${solutionDir}' could not be saved: ${saveError.message}`);
|
|
6616
|
+
}
|
|
6617
|
+
return resolved;
|
|
6618
|
+
}
|
|
6619
|
+
async function resolveEach(fieldValues, resourceFields, openOnce) {
|
|
6620
|
+
const resolved = [];
|
|
6621
|
+
for (const field of resourceFields) {
|
|
6622
|
+
const value = fieldValues[field.name];
|
|
6623
|
+
if (value == null || value === "" || isResourceSelection(value) || typeof value === "string" && value.startsWith("=")) {
|
|
6624
|
+
continue;
|
|
6625
|
+
}
|
|
6626
|
+
if (Array.isArray(value)) {
|
|
6627
|
+
throw new ResourceFieldResolutionError(`'${field.name}' is a multi-select ${field.kind} picker, which the CLI cannot resolve yet — pick one ${field.kind} by name.`);
|
|
6628
|
+
}
|
|
6629
|
+
if (typeof value !== "string") {
|
|
6630
|
+
throw new ResourceFieldResolutionError(`'${field.name}' is a ${field.kind} picker on this activity — pass the ${field.kind} name as a string.`);
|
|
6631
|
+
}
|
|
6632
|
+
const companion = resourceFolderKeyFieldName(field.name);
|
|
6633
|
+
const folderHint = fieldValues[companion];
|
|
6634
|
+
const selection = await referenceResource(await openOnce(), field, value, typeof folderHint === "string" && folderHint !== "" ? folderHint : undefined, companion);
|
|
6635
|
+
fieldValues[field.name] = selection;
|
|
6636
|
+
delete fieldValues[companion];
|
|
6637
|
+
resolved.push({ field: field.name, companion, selection });
|
|
6638
|
+
}
|
|
6639
|
+
return resolved;
|
|
6640
|
+
}
|
|
6641
|
+
async function openSolution(solutionDir) {
|
|
6642
|
+
const [error, solution] = await catchError((async () => {
|
|
6643
|
+
const { getSolutionAuthContext } = await import("./solution-auth-30yycqtv.js");
|
|
6644
|
+
await getSolutionAuthContext({});
|
|
6645
|
+
const resources = await import("./index-ekwtgx7y.js");
|
|
6646
|
+
await resources.normalizeResourceFileCasing(solutionDir);
|
|
6647
|
+
const services = await resources.createResourceBuilderServices();
|
|
6648
|
+
return {
|
|
6649
|
+
resources,
|
|
6650
|
+
builder: await services.getSolutionBuilder(solutionDir)
|
|
6651
|
+
};
|
|
6652
|
+
})());
|
|
6653
|
+
if (error) {
|
|
6654
|
+
throw new ResourceFieldResolutionError(`A resource picker needs the solution the resource is referenced into, and '${solutionDir}' could not be opened: ${error.message}. ` + "Check the project sits in a solution and you are logged in (run 'uip login').");
|
|
6655
|
+
}
|
|
6656
|
+
return solution;
|
|
6657
|
+
}
|
|
6658
|
+
async function saveSolution({ resources, builder }, solutionDir) {
|
|
6659
|
+
const error = await resources.saveCasingNormalized(builder);
|
|
6660
|
+
if (!error)
|
|
6661
|
+
await resources.normalizeResourceFileCasing(solutionDir);
|
|
6662
|
+
return error;
|
|
6663
|
+
}
|
|
6664
|
+
async function referenceResource({ resources, builder }, field, name, folderHint, companion) {
|
|
6665
|
+
const matches = await resources.searchRcsResources(builder, field.kind, name);
|
|
6666
|
+
const candidates = matches.filter((match2) => match2.name.toLowerCase() === name.toLowerCase() && (folderHint === undefined || matchesFolder(resources, match2, folderHint)));
|
|
6667
|
+
if (candidates.length === 0) {
|
|
6668
|
+
throw new ResourceFieldResolutionError(`No ${field.kind} named '${name}'${folderHint ? ` in folder '${folderHint}'` : ""} was found. ` + "If a failed resource catalog lookup was logged above, check your login and retry. " + `Otherwise run 'uip solution resources list --source remote --kind ${field.kind} --search "${name}"' to discover candidates.`);
|
|
6669
|
+
}
|
|
6670
|
+
if (candidates.length > 1) {
|
|
6671
|
+
const folders = candidates.map((match2) => ` - ${match2.folder?.fullyQualifiedName ?? "<tenant>"} (folder key ${match2.folder?.folderKey ?? "<none>"})`).join(`
|
|
6672
|
+
`);
|
|
6673
|
+
throw new ResourceFieldResolutionError(`${candidates.length} ${field.kind} resources are named '${name}'. Pass the folder key or path as '${companion}' to pick one:
|
|
6674
|
+
${folders}`);
|
|
6675
|
+
}
|
|
6676
|
+
const [match] = candidates;
|
|
6677
|
+
const [loadError, solution] = await catchError(builder.context.loadAsync());
|
|
6678
|
+
if (loadError) {
|
|
6679
|
+
throw new ResourceFieldResolutionError(`Failed to read the solution before referencing ${field.kind} '${name}': ${loadError.message}`);
|
|
6680
|
+
}
|
|
6681
|
+
const existing = solution.resources.find((resource) => resource.key.toLowerCase() === match.key.toLowerCase());
|
|
6682
|
+
if (existing) {
|
|
6683
|
+
return {
|
|
6684
|
+
key: existing.key,
|
|
6685
|
+
name: match.name,
|
|
6686
|
+
folderKey: match.folder?.folderKey,
|
|
6687
|
+
folderPath: match.folder?.fullyQualifiedName
|
|
6688
|
+
};
|
|
6689
|
+
}
|
|
6690
|
+
const [referenceError, response] = await catchError(builder.addOrUpdateResourceToSolutionAsync({
|
|
6691
|
+
kind: field.kind,
|
|
6692
|
+
type: match.type,
|
|
6693
|
+
key: match.key,
|
|
6694
|
+
name: match.name,
|
|
6695
|
+
folder: match.folder
|
|
6696
|
+
}, true));
|
|
6697
|
+
if (referenceError) {
|
|
6698
|
+
throw new ResourceFieldResolutionError(`Failed to reference ${field.kind} '${name}' into the solution: ${referenceError.message}`);
|
|
6699
|
+
}
|
|
6700
|
+
return {
|
|
6701
|
+
key: response.resource.key,
|
|
6702
|
+
name: match.name,
|
|
6703
|
+
folderKey: match.folder?.folderKey,
|
|
6704
|
+
folderPath: match.folder?.fullyQualifiedName
|
|
6705
|
+
};
|
|
6706
|
+
}
|
|
6707
|
+
function matchesFolder({ normalizeFolderPath }, match, folderHint) {
|
|
6708
|
+
const folder = match.folder;
|
|
6709
|
+
if (!folder)
|
|
6710
|
+
return false;
|
|
6711
|
+
if (folder.folderKey.toLowerCase() === folderHint.toLowerCase())
|
|
6712
|
+
return true;
|
|
6713
|
+
const hint = normalizeFolderPath(folderHint);
|
|
6714
|
+
return normalizeFolderPath(folder.fullyQualifiedName) === hint || folder.path !== undefined && normalizeFolderPath(folder.path) === hint;
|
|
6715
|
+
}
|
|
6716
|
+
|
|
6456
6717
|
// ../integrationservice-sdk/src/dap/essential-config.ts
|
|
6718
|
+
var MANAGED_HTTP_CONNECTOR_KEY = "uipath-uipath-http";
|
|
6719
|
+
var MANAGED_HTTP_CONNECTOR_VERSION = "1.4.50";
|
|
6457
6720
|
function buildActivityEssentialConfiguration(instanceParameters, methodInfo, savedFilterTrees = null, customFieldsRequestDetails = null) {
|
|
6458
6721
|
const operation = methodInfo.operation.toLowerCase();
|
|
6459
6722
|
const savedJitInputFieldId = computeSavedJitInputFieldId(operation, methodInfo.parameters, instanceParameters.objectName);
|
|
@@ -6485,26 +6748,44 @@ function computeSavedJitInputFieldId(operation, parameters, objectName) {
|
|
|
6485
6748
|
return;
|
|
6486
6749
|
return `in_${objectName}`;
|
|
6487
6750
|
}
|
|
6488
|
-
async function createConfiguredActivityClient({
|
|
6751
|
+
async function createConfiguredActivityClient(options) {
|
|
6752
|
+
return (await configureActivityClient(options)).client;
|
|
6753
|
+
}
|
|
6754
|
+
async function configureActivityClient({
|
|
6489
6755
|
instanceParameters,
|
|
6490
6756
|
connectionId,
|
|
6491
6757
|
savedFilterTrees = null,
|
|
6492
6758
|
customFieldsRequestDetails = null,
|
|
6493
|
-
fieldValues = null
|
|
6759
|
+
fieldValues = null,
|
|
6760
|
+
solutionDir = null
|
|
6494
6761
|
}) {
|
|
6495
6762
|
if (savedFilterTrees) {
|
|
6496
6763
|
for (const tree of Object.values(savedFilterTrees)) {
|
|
6497
6764
|
assertFilterTreeSupported(tree);
|
|
6498
6765
|
}
|
|
6499
6766
|
}
|
|
6500
|
-
const { DesignTimeActivityClient } = await import("./index-
|
|
6501
|
-
const
|
|
6767
|
+
const { DesignTimeActivityClient } = await import("./index-fyc0k5dd.js");
|
|
6768
|
+
const initiateOptions = {
|
|
6769
|
+
connectionsProvider: createLiveConnectionsProvider(),
|
|
6770
|
+
...solutionDir ? {
|
|
6771
|
+
solutionResourceConfigurationsProvider: createSolutionResourceConfigurationsProvider(solutionDir)
|
|
6772
|
+
} : {}
|
|
6773
|
+
};
|
|
6774
|
+
const client = await DesignTimeActivityClient.initiate({ instanceParameters, uiPathActivityTypeId: "" }, initiateOptions);
|
|
6502
6775
|
await client.updateConnection({ connectionId });
|
|
6776
|
+
const resourceFields = fieldValues && (solutionDir || customFieldsRequestDetails) ? await client.getResourceFields() : [];
|
|
6777
|
+
const pickerNames = new Set(resourceFields.map((field) => field.name));
|
|
6778
|
+
const resolvedResources = solutionDir && fieldValues ? await resolveResourceFieldValues(fieldValues, resourceFields, solutionDir) : [];
|
|
6503
6779
|
if (customFieldsRequestDetails) {
|
|
6504
6780
|
for (const [
|
|
6505
6781
|
fieldId,
|
|
6506
6782
|
value
|
|
6507
6783
|
] of customFieldsRequestDetails.parameterValues) {
|
|
6784
|
+
const selection = fieldValues?.[fieldId];
|
|
6785
|
+
if (pickerNames.has(fieldId) && isResourceSelection(selection)) {
|
|
6786
|
+
await client.setFieldValues({ [fieldId]: selection });
|
|
6787
|
+
continue;
|
|
6788
|
+
}
|
|
6508
6789
|
await client.updateProperty({
|
|
6509
6790
|
propertyName: fieldId,
|
|
6510
6791
|
valueType: "widget",
|
|
@@ -6523,7 +6804,7 @@ async function createConfiguredActivityClient({
|
|
|
6523
6804
|
await applySavedFilterTree(client, filterParam, tree);
|
|
6524
6805
|
}
|
|
6525
6806
|
}
|
|
6526
|
-
return client;
|
|
6807
|
+
return { client, resolvedResources };
|
|
6527
6808
|
}
|
|
6528
6809
|
async function applySavedFilterTree(client, propertyName, tree) {
|
|
6529
6810
|
await client.updateProperty({
|
|
@@ -6537,6 +6818,28 @@ function assertActivityMetadataResolved(essentialConfiguration, connectionId) {
|
|
|
6537
6818
|
throw new Error(`Connector activity metadata was not resolved for connection '${connectionId}' (no connectorVersion). Check the connection is enabled and you are logged in (run 'uip login').`);
|
|
6538
6819
|
}
|
|
6539
6820
|
}
|
|
6821
|
+
function buildManagedHttpEssentialConfiguration() {
|
|
6822
|
+
const essentialConfiguration = {
|
|
6823
|
+
connectorVersion: MANAGED_HTTP_CONNECTOR_VERSION,
|
|
6824
|
+
executionType: null,
|
|
6825
|
+
customFieldsRequestDetails: null,
|
|
6826
|
+
instanceParameters: {
|
|
6827
|
+
connectorKey: MANAGED_HTTP_CONNECTOR_KEY,
|
|
6828
|
+
objectName: "http-request",
|
|
6829
|
+
httpMethod: "POST",
|
|
6830
|
+
activityType: "Curated",
|
|
6831
|
+
version: "1.0.0"
|
|
6832
|
+
},
|
|
6833
|
+
objectName: "http-request",
|
|
6834
|
+
operation: "create",
|
|
6835
|
+
packageVersion: "1.0.0",
|
|
6836
|
+
httpMethod: "POST",
|
|
6837
|
+
path: "/http-request",
|
|
6838
|
+
unifiedTypesCompatible: true,
|
|
6839
|
+
savedJitInputFieldId: "in_http-request"
|
|
6840
|
+
};
|
|
6841
|
+
return { essentialConfiguration };
|
|
6842
|
+
}
|
|
6540
6843
|
|
|
6541
6844
|
// ../integrationservice-sdk/src/dap/input-metadata.ts
|
|
6542
6845
|
function findMultipartBodyField(params) {
|
|
@@ -6545,6 +6848,25 @@ function findMultipartBodyField(params) {
|
|
|
6545
6848
|
function extractMultipartParameters(params) {
|
|
6546
6849
|
return params.filter((p) => p.type === "multipart").map((p) => ({ name: p.name, dataType: p.dataType }));
|
|
6547
6850
|
}
|
|
6851
|
+
function inlineMultipartFileValues(multipartParams, bodyParameters) {
|
|
6852
|
+
if (!bodyParameters || multipartParams.length === 0) {
|
|
6853
|
+
return { multipartParams, bodyParameters };
|
|
6854
|
+
}
|
|
6855
|
+
const nextBody = { ...bodyParameters };
|
|
6856
|
+
const nextParams = multipartParams.map((param) => {
|
|
6857
|
+
if (param.dataType !== "file")
|
|
6858
|
+
return param;
|
|
6859
|
+
const value = nextBody[param.name];
|
|
6860
|
+
if (typeof value !== "string")
|
|
6861
|
+
return param;
|
|
6862
|
+
delete nextBody[param.name];
|
|
6863
|
+
return { ...param, value };
|
|
6864
|
+
});
|
|
6865
|
+
return {
|
|
6866
|
+
multipartParams: nextParams,
|
|
6867
|
+
bodyParameters: Object.keys(nextBody).length > 0 ? nextBody : undefined
|
|
6868
|
+
};
|
|
6869
|
+
}
|
|
6548
6870
|
var DEFAULT_MAX_PAGE_SIZE = 1000;
|
|
6549
6871
|
function isListOperation(operation) {
|
|
6550
6872
|
return typeof operation === "string" && operation.toLowerCase() === "list";
|
|
@@ -6605,6 +6927,14 @@ function validateFolderKey(context) {
|
|
|
6605
6927
|
return [];
|
|
6606
6928
|
}
|
|
6607
6929
|
var VALID_HTTP_METHODS = new Set(["GET", "POST", "PUT", "PATCH", "DELETE"]);
|
|
6930
|
+
var METHOD_TO_OPERATION = {
|
|
6931
|
+
GET: "List",
|
|
6932
|
+
GETBYID: "Retrieve",
|
|
6933
|
+
POST: "Create",
|
|
6934
|
+
PATCH: "Update",
|
|
6935
|
+
DELETE: "Delete",
|
|
6936
|
+
PUT: "Replace"
|
|
6937
|
+
};
|
|
6608
6938
|
var OPERATION_TO_METHOD = {
|
|
6609
6939
|
LIST: "GET",
|
|
6610
6940
|
RETRIEVE: "GETBYID",
|
|
@@ -6714,7 +7044,7 @@ function validateEventType(context) {
|
|
|
6714
7044
|
function validateConfiguration(context) {
|
|
6715
7045
|
if (!context.configuration?.trim()) {
|
|
6716
7046
|
return [
|
|
6717
|
-
issue(context, "configuration", "Error", 'Configuration is missing or empty. Expected `=jsonString:` prefix wrapping a JSON string with shape `{"essentialConfiguration": {"objectName": "...", "connectionId": "...", ...}}`. Re-run `uip maestro flow
|
|
7047
|
+
issue(context, "configuration", "Error", 'Configuration is missing or empty. Expected `=jsonString:` prefix wrapping a JSON string with shape `{"essentialConfiguration": {"objectName": "...", "connectionId": "...", ...}}`. Re-run `uip maestro flow nodes configure` to populate this field correctly.')
|
|
6718
7048
|
];
|
|
6719
7049
|
}
|
|
6720
7050
|
const jsonStr = context.configuration.startsWith("=jsonString:") ? context.configuration.slice("=jsonString:".length) : context.configuration;
|
|
@@ -6722,12 +7052,12 @@ function validateConfiguration(context) {
|
|
|
6722
7052
|
const parsed = JSON.parse(jsonStr);
|
|
6723
7053
|
if (!parsed.essentialConfiguration) {
|
|
6724
7054
|
return [
|
|
6725
|
-
issue(context, "configuration", "Error", "Configuration is missing the essentialConfiguration envelope. The decoded `=jsonString:` value must be an object whose only top-level key is `essentialConfiguration` (which itself carries `objectName`, `connectionId`, `instanceParameters`, etc.). Re-run `uip maestro flow
|
|
7055
|
+
issue(context, "configuration", "Error", "Configuration is missing the essentialConfiguration envelope. The decoded `=jsonString:` value must be an object whose only top-level key is `essentialConfiguration` (which itself carries `objectName`, `connectionId`, `instanceParameters`, etc.). Re-run `uip maestro flow nodes configure` rather than hand-editing.")
|
|
6726
7056
|
];
|
|
6727
7057
|
}
|
|
6728
7058
|
} catch {
|
|
6729
7059
|
return [
|
|
6730
|
-
issue(context, "configuration", "Error", 'Configuration contains invalid JSON. The `=jsonString:` prefix must be followed by a single JSON-encoded string (one level of quoting), e.g. `"=jsonString:{\\"essentialConfiguration\\":{...}}"`. Re-run `uip maestro flow
|
|
7060
|
+
issue(context, "configuration", "Error", 'Configuration contains invalid JSON. The `=jsonString:` prefix must be followed by a single JSON-encoded string (one level of quoting), e.g. `"=jsonString:{\\"essentialConfiguration\\":{...}}"`. Re-run `uip maestro flow nodes configure` to regenerate.')
|
|
6731
7061
|
];
|
|
6732
7062
|
}
|
|
6733
7063
|
return [];
|
|
@@ -6852,6 +7182,177 @@ var DEFAULT_RULES = [
|
|
|
6852
7182
|
function validateIntSvcNode(context, rules = DEFAULT_RULES) {
|
|
6853
7183
|
return rules.flatMap((rule) => rule(context));
|
|
6854
7184
|
}
|
|
7185
|
+
// ../integrationservice-sdk/src/metadata/design-actions.ts
|
|
7186
|
+
var DESIGN_ACTION_TYPE = "api";
|
|
7187
|
+
function matchApiAction(actions, fieldValues, actionName) {
|
|
7188
|
+
let matched = null;
|
|
7189
|
+
for (const candidate of actions) {
|
|
7190
|
+
const type = candidate.actionType ?? candidate.ActionType;
|
|
7191
|
+
if (typeof type !== "string" || type.toLowerCase() !== DESIGN_ACTION_TYPE) {
|
|
7192
|
+
continue;
|
|
7193
|
+
}
|
|
7194
|
+
const name = candidate.name ?? candidate.Name;
|
|
7195
|
+
if (actionName && name !== actionName)
|
|
7196
|
+
continue;
|
|
7197
|
+
const rules = candidate.rules ?? candidate.Rules ?? [];
|
|
7198
|
+
if (!rules.every((rule) => ruleSatisfied(rule, fieldValues)))
|
|
7199
|
+
continue;
|
|
7200
|
+
matched = candidate;
|
|
7201
|
+
break;
|
|
7202
|
+
}
|
|
7203
|
+
if (!matched)
|
|
7204
|
+
return null;
|
|
7205
|
+
return normalizeAction(matched);
|
|
7206
|
+
}
|
|
7207
|
+
function ruleSatisfied(rule, fieldValues) {
|
|
7208
|
+
const fieldName = rule.refFieldName ?? rule.RefFieldName;
|
|
7209
|
+
if (typeof fieldName !== "string")
|
|
7210
|
+
return true;
|
|
7211
|
+
const value = fieldValues[fieldName];
|
|
7212
|
+
const isEmpty = value === undefined || value === "";
|
|
7213
|
+
if ((rule.isCleared ?? rule.IsCleared) === true)
|
|
7214
|
+
return isEmpty;
|
|
7215
|
+
if (isEmpty)
|
|
7216
|
+
return false;
|
|
7217
|
+
const allowed = rule.refFieldValues ?? rule.RefFieldValues;
|
|
7218
|
+
if (!Array.isArray(allowed) || allowed.length === 0)
|
|
7219
|
+
return true;
|
|
7220
|
+
return allowed.some((v) => v === "*" || String(v) === value);
|
|
7221
|
+
}
|
|
7222
|
+
function normalizeAction(action) {
|
|
7223
|
+
const apiConfig = action.apiConfiguration ?? action.ApiConfiguration;
|
|
7224
|
+
if (!apiConfig) {
|
|
7225
|
+
throw new Error(`Action '${String(action.name ?? action.Name)}' has no apiConfiguration.`);
|
|
7226
|
+
}
|
|
7227
|
+
const method = apiConfig.method ?? apiConfig.Method ?? "GET";
|
|
7228
|
+
const url = apiConfig.url ?? apiConfig.Url ?? "";
|
|
7229
|
+
let body = null;
|
|
7230
|
+
const rawBody = apiConfig.body ?? apiConfig.Body;
|
|
7231
|
+
if (rawBody && typeof rawBody === "object") {
|
|
7232
|
+
body = {};
|
|
7233
|
+
for (const [k, v] of Object.entries(rawBody)) {
|
|
7234
|
+
body[k] = String(v ?? "");
|
|
7235
|
+
}
|
|
7236
|
+
}
|
|
7237
|
+
const onSuccessRaw = action.onSuccess ?? action.OnSuccess;
|
|
7238
|
+
const remap = onSuccessRaw?.remapConfiguration ?? onSuccessRaw?.RemapConfiguration;
|
|
7239
|
+
const onSuccess = {
|
|
7240
|
+
input: remap?.input ?? remap?.Input ?? "replace",
|
|
7241
|
+
output: remap?.output ?? remap?.Output ?? "noop"
|
|
7242
|
+
};
|
|
7243
|
+
const rules = action.rules ?? action.Rules ?? [];
|
|
7244
|
+
const ruleFieldNames = rules.map((r) => r.refFieldName ?? r.RefFieldName).filter((n) => typeof n === "string");
|
|
7245
|
+
return {
|
|
7246
|
+
name: String(action.name ?? action.Name ?? ""),
|
|
7247
|
+
method: method.toUpperCase(),
|
|
7248
|
+
url,
|
|
7249
|
+
body,
|
|
7250
|
+
onSuccess,
|
|
7251
|
+
rules: ruleFieldNames
|
|
7252
|
+
};
|
|
7253
|
+
}
|
|
7254
|
+
var loadDesignTime = () => import("./index-fyc0k5dd.js");
|
|
7255
|
+
var RESOURCE_KEY_EXPRESSION = "resourceKey";
|
|
7256
|
+
var SAFE_RESOURCE_KEY = /^(?!\.+$)[A-Za-z0-9._:-]+$/;
|
|
7257
|
+
function sentRequest(designTime, action) {
|
|
7258
|
+
return designTime.httpMethodSupportsRequestBody(action.method) ? action : { ...action, body: null };
|
|
7259
|
+
}
|
|
7260
|
+
function assertRequestTokensResolvable(designTime, action, fieldValues, solutionResources) {
|
|
7261
|
+
for (const token of designTime.getCustomFieldsRequestTokens(action)) {
|
|
7262
|
+
if (token.expression === undefined) {
|
|
7263
|
+
const value = fieldValues[token.fieldName];
|
|
7264
|
+
if (value === undefined || value === "") {
|
|
7265
|
+
throw new Error(`Action '${action.name}' requires a value for field '${token.fieldName}'.`);
|
|
7266
|
+
}
|
|
7267
|
+
} else if (token.expression !== RESOURCE_KEY_EXPRESSION || !solutionResources[token.fieldName]) {
|
|
7268
|
+
throw new Error(`Action '${action.name}' uses expression token '{${token.token}}' which cannot be resolved from literal field values.`);
|
|
7269
|
+
}
|
|
7270
|
+
}
|
|
7271
|
+
}
|
|
7272
|
+
function toResourceSelections(designTime, action, solutionResources) {
|
|
7273
|
+
const keysInUrl = new Set(designTime.getCustomFieldsRequestTokens({ ...action, body: null }).filter((token) => token.expression === RESOURCE_KEY_EXPRESSION).map((token) => token.fieldName));
|
|
7274
|
+
const resourceSelections = {};
|
|
7275
|
+
for (const [field, resource] of Object.entries(solutionResources)) {
|
|
7276
|
+
if (keysInUrl.has(field) && !SAFE_RESOURCE_KEY.test(resource.resourceKey)) {
|
|
7277
|
+
throw new Error(`Solution resource key '${resource.resourceKey}' for '${field}' is not a plain identifier, so it cannot be sent in the design action's URL.`);
|
|
7278
|
+
}
|
|
7279
|
+
resourceSelections[field] = { key: resource.resourceKey };
|
|
7280
|
+
}
|
|
7281
|
+
return resourceSelections;
|
|
7282
|
+
}
|
|
7283
|
+
async function resourcePickersRequestNeeds(action, parameters) {
|
|
7284
|
+
if (parameters.length === 0)
|
|
7285
|
+
return [];
|
|
7286
|
+
const designTime = await loadDesignTime();
|
|
7287
|
+
const fields = designTime.getResourceFieldsFromMetadata(parameters);
|
|
7288
|
+
if (fields.length === 0)
|
|
7289
|
+
return [];
|
|
7290
|
+
const tokens = designTime.getCustomFieldsRequestTokens(sentRequest(designTime, action));
|
|
7291
|
+
const referenced = new Set(tokens.map((t) => t.fieldName));
|
|
7292
|
+
const keyRead = new Set(tokens.filter((t) => t.expression === RESOURCE_KEY_EXPRESSION).map((t) => t.fieldName));
|
|
7293
|
+
const sendsBody = designTime.httpMethodSupportsRequestBody(action.method);
|
|
7294
|
+
return fields.filter((field) => referenced.has(field.name) && (sendsBody || keyRead.has(field.name))).map((field) => ({
|
|
7295
|
+
field,
|
|
7296
|
+
readsKey: keyRead.has(field.name),
|
|
7297
|
+
folderKeyField: designTime.solutionResourceFolderKeyFieldName(field.name)
|
|
7298
|
+
}));
|
|
7299
|
+
}
|
|
7300
|
+
async function runDesignAction(options, connectionId, action, fieldValues, solutionResources = {}, configurationsProvider) {
|
|
7301
|
+
const designTime = await loadDesignTime();
|
|
7302
|
+
const sent = sentRequest(designTime, action);
|
|
7303
|
+
assertRequestTokensResolvable(designTime, sent, fieldValues, solutionResources);
|
|
7304
|
+
const resourceSelections = toResourceSelections(designTime, sent, solutionResources);
|
|
7305
|
+
const { url } = designTime.buildCustomFieldsRequest({
|
|
7306
|
+
apiConfiguration: sent,
|
|
7307
|
+
fieldValues: Object.fromEntries(Object.entries(fieldValues).map(([k, v]) => [
|
|
7308
|
+
k,
|
|
7309
|
+
encodeURIComponent(v)
|
|
7310
|
+
])),
|
|
7311
|
+
resourceSelections
|
|
7312
|
+
});
|
|
7313
|
+
const request = await designTime.buildCustomFieldsRequestAsync({ apiConfiguration: sent, fieldValues, resourceSelections }, configurationsProvider);
|
|
7314
|
+
const result = await runInstanceDesignAction(options, connectionId, request.method, url, request.body);
|
|
7315
|
+
if (!result.ok) {
|
|
7316
|
+
const detail = typeof result.body === "string" ? result.body : JSON.stringify(result.body);
|
|
7317
|
+
throw Object.assign(new Error(`Design action '${action.name}' failed: ${result.status} ${result.statusText} — ${detail}`), { status: result.status });
|
|
7318
|
+
}
|
|
7319
|
+
if (result.body === null || typeof result.body !== "object" || Array.isArray(result.body)) {
|
|
7320
|
+
throw new Error(`Design action '${action.name}' returned an unexpected payload shape.`);
|
|
7321
|
+
}
|
|
7322
|
+
return result.body;
|
|
7323
|
+
}
|
|
7324
|
+
|
|
7325
|
+
// ../integrationservice-sdk/src/metadata/trigger-design-actions.ts
|
|
7326
|
+
async function findTriggerDesignAction(eventObject, fieldValues, target, actionName) {
|
|
7327
|
+
const design = eventObject.design;
|
|
7328
|
+
const declared = matchApiAction(design?.actions ?? [], fieldValues, actionName);
|
|
7329
|
+
if (!declared)
|
|
7330
|
+
return null;
|
|
7331
|
+
const { routeTriggerObjectAction } = await loadDesignTime();
|
|
7332
|
+
return { ...declared, ...routeTriggerObjectAction(declared, target) };
|
|
7333
|
+
}
|
|
7334
|
+
function triggerEventParameters(eventObject) {
|
|
7335
|
+
return Array.isArray(eventObject.parameters) ? eventObject.parameters : [];
|
|
7336
|
+
}
|
|
7337
|
+
function applyTriggerDesignActionRemap(base, response, onSuccess) {
|
|
7338
|
+
const mode = (onSuccess.input || "replace").toLowerCase();
|
|
7339
|
+
if (mode === "noop")
|
|
7340
|
+
return base;
|
|
7341
|
+
const baseFields = base.fields ?? {};
|
|
7342
|
+
const responseFields = response.fields ?? {};
|
|
7343
|
+
let fields;
|
|
7344
|
+
if (mode === "replace")
|
|
7345
|
+
fields = responseFields;
|
|
7346
|
+
else if (mode === "prepend")
|
|
7347
|
+
fields = { ...responseFields, ...baseFields };
|
|
7348
|
+
else
|
|
7349
|
+
fields = { ...baseFields, ...responseFields };
|
|
7350
|
+
return { ...base, fields };
|
|
7351
|
+
}
|
|
7352
|
+
async function runTriggerDesignAction(options, connectionId, baseMetadata, action, fieldValues, solutionResources = {}, configurationsProvider) {
|
|
7353
|
+
const response = await runDesignAction(options, connectionId, action, fieldValues, solutionResources, configurationsProvider);
|
|
7354
|
+
return applyTriggerDesignActionRemap(baseMetadata, response, action.onSuccess);
|
|
7355
|
+
}
|
|
6855
7356
|
// ../integrationservice-sdk/src/connection-state.ts
|
|
6856
7357
|
var CONNECTION_STATE_NAMES = new Map([
|
|
6857
7358
|
[ConnectionState.Enabled, "Enabled"],
|
|
@@ -6859,8 +7360,223 @@ var CONNECTION_STATE_NAMES = new Map([
|
|
|
6859
7360
|
[ConnectionState.Expired, "Expired"],
|
|
6860
7361
|
[ConnectionState.Failed, "Failed"]
|
|
6861
7362
|
]);
|
|
7363
|
+
function normalizeConnectionStatus(status) {
|
|
7364
|
+
if (typeof status === "number") {
|
|
7365
|
+
return CONNECTION_STATE_NAMES.get(status) ?? String(status);
|
|
7366
|
+
}
|
|
7367
|
+
if (typeof status === "string") {
|
|
7368
|
+
const numericStatus = Number(status);
|
|
7369
|
+
if (Number.isInteger(numericStatus)) {
|
|
7370
|
+
return CONNECTION_STATE_NAMES.get(numericStatus) ?? status;
|
|
7371
|
+
}
|
|
7372
|
+
const normalized = status.toLowerCase();
|
|
7373
|
+
if (normalized === "enabled")
|
|
7374
|
+
return "Enabled";
|
|
7375
|
+
if (normalized === "disabled")
|
|
7376
|
+
return "Disabled";
|
|
7377
|
+
if (normalized === "expired")
|
|
7378
|
+
return "Expired";
|
|
7379
|
+
if (normalized === "failed")
|
|
7380
|
+
return "Failed";
|
|
7381
|
+
return status;
|
|
7382
|
+
}
|
|
7383
|
+
return "Unknown";
|
|
7384
|
+
}
|
|
6862
7385
|
// ../integrationservice-sdk/src/metadata/resource-metadata.ts
|
|
7386
|
+
async function fetchRawMetadata(api, connectorKey, objectName, connectionId) {
|
|
7387
|
+
if (connectionId) {
|
|
7388
|
+
const response2 = await api.getInstanceObjectMetadataRaw({
|
|
7389
|
+
connectionOrInstanceId: connectionId,
|
|
7390
|
+
elementKey: connectorKey,
|
|
7391
|
+
objectName,
|
|
7392
|
+
includeParentArray: true
|
|
7393
|
+
});
|
|
7394
|
+
return await response2.raw.json();
|
|
7395
|
+
}
|
|
7396
|
+
const response = await api.getObjectMetadataRaw({
|
|
7397
|
+
elementKey: connectorKey,
|
|
7398
|
+
objectName,
|
|
7399
|
+
includeParentArray: true
|
|
7400
|
+
});
|
|
7401
|
+
return await response.raw.json();
|
|
7402
|
+
}
|
|
7403
|
+
function buildResourceCompactSummary(metadata, operation) {
|
|
7404
|
+
const metadataObj = metadata.metadata;
|
|
7405
|
+
const methods = metadataObj?.method || {};
|
|
7406
|
+
const fields = metadata.fields || {};
|
|
7407
|
+
if (!operation) {
|
|
7408
|
+
const availableOperations = Object.entries(methods).map(([methodKey, methodVal]) => {
|
|
7409
|
+
const curated2 = methodVal.curated;
|
|
7410
|
+
return {
|
|
7411
|
+
method: methodKey,
|
|
7412
|
+
name: METHOD_TO_OPERATION[methodKey] || methodKey,
|
|
7413
|
+
description: methodVal.description,
|
|
7414
|
+
path: methodVal.path,
|
|
7415
|
+
curated: curated2?.displayName
|
|
7416
|
+
};
|
|
7417
|
+
});
|
|
7418
|
+
return {
|
|
7419
|
+
name: metadata.name,
|
|
7420
|
+
displayName: metadata.displayName,
|
|
7421
|
+
elementKey: metadata.elementKey,
|
|
7422
|
+
availableOperations,
|
|
7423
|
+
hint: "Use --operation <Create|List|Retrieve|Update|Delete|Replace> to see fields for a specific operation."
|
|
7424
|
+
};
|
|
7425
|
+
}
|
|
7426
|
+
const httpMethod = OPERATION_TO_METHOD[operation.toUpperCase()] || operation.toUpperCase();
|
|
7427
|
+
const methodInfo = methods[httpMethod];
|
|
7428
|
+
if (!methodInfo) {
|
|
7429
|
+
return {
|
|
7430
|
+
name: metadata.name,
|
|
7431
|
+
displayName: metadata.displayName,
|
|
7432
|
+
elementKey: metadata.elementKey,
|
|
7433
|
+
error: `Operation '${operation}' not found. Available: ${Object.keys(methods).map((k) => METHOD_TO_OPERATION[k] || k).join(", ")}`
|
|
7434
|
+
};
|
|
7435
|
+
}
|
|
7436
|
+
const rawParams = methodInfo.parameters || [];
|
|
7437
|
+
const parameters = rawParams.filter((p) => p.type === "path" || p.type === "query" || p.type === "multipart").map((p) => {
|
|
7438
|
+
const param = {
|
|
7439
|
+
name: p.name,
|
|
7440
|
+
type: p.type,
|
|
7441
|
+
dataType: p.dataType,
|
|
7442
|
+
required: p.required === true,
|
|
7443
|
+
displayName: p.displayName
|
|
7444
|
+
};
|
|
7445
|
+
if (p.description)
|
|
7446
|
+
param.description = p.description;
|
|
7447
|
+
if (p.defaultValue !== undefined)
|
|
7448
|
+
param.defaultValue = p.defaultValue;
|
|
7449
|
+
if (p.reference)
|
|
7450
|
+
param.reference = p.reference;
|
|
7451
|
+
return param;
|
|
7452
|
+
});
|
|
7453
|
+
const requestFields = [];
|
|
7454
|
+
const responseFields = [];
|
|
7455
|
+
for (const [, fieldDef] of Object.entries(fields)) {
|
|
7456
|
+
const design = fieldDef.design;
|
|
7457
|
+
const isHidden = design?.isHidden === true;
|
|
7458
|
+
const fieldMethod = fieldDef.method?.[httpMethod];
|
|
7459
|
+
if (!fieldMethod)
|
|
7460
|
+
continue;
|
|
7461
|
+
const compact = {
|
|
7462
|
+
name: fieldDef.name,
|
|
7463
|
+
type: fieldDef.type,
|
|
7464
|
+
displayName: fieldDef.displayName
|
|
7465
|
+
};
|
|
7466
|
+
if (fieldDef.description)
|
|
7467
|
+
compact.description = fieldDef.description;
|
|
7468
|
+
if (fieldDef.reference)
|
|
7469
|
+
compact.reference = fieldDef.reference;
|
|
7470
|
+
if (Array.isArray(fieldDef.enum) && fieldDef.enum.length > 0) {
|
|
7471
|
+
compact.enum = fieldDef.enum.map((e) => e.value ?? e);
|
|
7472
|
+
}
|
|
7473
|
+
if (fieldDef.primaryKey === true)
|
|
7474
|
+
compact.primaryKey = true;
|
|
7475
|
+
if (fieldDef.searchable === true)
|
|
7476
|
+
compact.searchable = true;
|
|
7477
|
+
if (fieldDef.searchableOperators !== undefined)
|
|
7478
|
+
compact.searchableOperators = fieldDef.searchableOperators;
|
|
7479
|
+
if (fieldDef.searchableNames !== undefined)
|
|
7480
|
+
compact.searchableNames = fieldDef.searchableNames;
|
|
7481
|
+
if (!isHidden && (fieldMethod.request === true || fieldMethod.requestCurated === true)) {
|
|
7482
|
+
requestFields.push({
|
|
7483
|
+
...compact,
|
|
7484
|
+
required: fieldMethod.required === true
|
|
7485
|
+
});
|
|
7486
|
+
}
|
|
7487
|
+
if (fieldMethod.response === true || fieldMethod.responseCurated === true) {
|
|
7488
|
+
responseFields.push(compact);
|
|
7489
|
+
}
|
|
7490
|
+
}
|
|
7491
|
+
const curated = methodInfo.curated;
|
|
7492
|
+
return {
|
|
7493
|
+
name: metadata.name,
|
|
7494
|
+
displayName: metadata.displayName,
|
|
7495
|
+
elementKey: metadata.elementKey,
|
|
7496
|
+
operation: {
|
|
7497
|
+
method: httpMethod,
|
|
7498
|
+
name: METHOD_TO_OPERATION[httpMethod] || httpMethod,
|
|
7499
|
+
description: methodInfo.description,
|
|
7500
|
+
path: methodInfo.path,
|
|
7501
|
+
curated: curated?.displayName
|
|
7502
|
+
},
|
|
7503
|
+
parameters,
|
|
7504
|
+
requestFields,
|
|
7505
|
+
responseFields,
|
|
7506
|
+
...Object.keys(methods).length > 0 && {
|
|
7507
|
+
method: JSON.stringify(methods)
|
|
7508
|
+
}
|
|
7509
|
+
};
|
|
7510
|
+
}
|
|
6863
7511
|
var CRUD_OPERATIONS = new Set(["CREATED", "UPDATED", "DELETED"]);
|
|
6864
|
-
|
|
7512
|
+
async function fetchTriggerMetadata(api, connectorKey, operationName, objectName, connectionId) {
|
|
7513
|
+
if (connectionId) {
|
|
7514
|
+
return catchError(api.getInstanceEventObjectMetadata({
|
|
7515
|
+
connectionOrInstanceId: connectionId,
|
|
7516
|
+
elementKey: connectorKey,
|
|
7517
|
+
operationName,
|
|
7518
|
+
objectName,
|
|
7519
|
+
allFields: true
|
|
7520
|
+
}));
|
|
7521
|
+
}
|
|
7522
|
+
return catchError(api.getEventObjectMetadata({
|
|
7523
|
+
elementKey: connectorKey,
|
|
7524
|
+
operationName,
|
|
7525
|
+
objectName,
|
|
7526
|
+
allFields: true
|
|
7527
|
+
}));
|
|
7528
|
+
}
|
|
7529
|
+
function buildCompactField(fieldDef, fieldName) {
|
|
7530
|
+
const compact = {
|
|
7531
|
+
name: fieldDef.name ?? fieldName,
|
|
7532
|
+
type: fieldDef.type ?? fieldDef.dataType,
|
|
7533
|
+
displayName: fieldDef.displayName
|
|
7534
|
+
};
|
|
7535
|
+
if (fieldDef.description)
|
|
7536
|
+
compact.description = fieldDef.description;
|
|
7537
|
+
if (fieldDef.reference)
|
|
7538
|
+
compact.reference = fieldDef.reference;
|
|
7539
|
+
if (Array.isArray(fieldDef.enum) && fieldDef.enum.length > 0) {
|
|
7540
|
+
compact.enum = fieldDef.enum.map((e) => e.value ?? e);
|
|
7541
|
+
}
|
|
7542
|
+
return compact;
|
|
7543
|
+
}
|
|
7544
|
+
function buildTriggerCompactSummary(metadata, operationName) {
|
|
7545
|
+
const fields = metadata.fields ?? {};
|
|
7546
|
+
const eventParameters = [];
|
|
7547
|
+
const filterFields = [];
|
|
7548
|
+
const outputFields = [];
|
|
7549
|
+
for (const [fieldName, fieldDef] of Object.entries(fields)) {
|
|
7550
|
+
const compact = buildCompactField(fieldDef, fieldName);
|
|
7551
|
+
outputFields.push({ ...compact });
|
|
7552
|
+
const events = fieldDef.events;
|
|
7553
|
+
if (events?.[operationName]) {
|
|
7554
|
+
const eventDef = events[operationName];
|
|
7555
|
+
const overrides = eventDef.designOverrides;
|
|
7556
|
+
eventParameters.push({
|
|
7557
|
+
...compact,
|
|
7558
|
+
displayName: overrides?.displayName ?? compact.displayName,
|
|
7559
|
+
description: overrides?.description ?? compact.description,
|
|
7560
|
+
required: eventDef.required === true
|
|
7561
|
+
});
|
|
7562
|
+
}
|
|
7563
|
+
if (fieldDef.order === 1 || fieldDef.isCuratedEventField === true) {
|
|
7564
|
+
filterFields.push({ ...compact });
|
|
7565
|
+
}
|
|
7566
|
+
}
|
|
7567
|
+
return {
|
|
7568
|
+
name: metadata.name,
|
|
7569
|
+
displayName: metadata.displayName,
|
|
7570
|
+
elementKey: metadata.elementKey,
|
|
7571
|
+
operation: operationName,
|
|
7572
|
+
eventMode: metadata.eventMode,
|
|
7573
|
+
byoaConnection: metadata.byoaConnection === true,
|
|
7574
|
+
isWebhookUrlVisible: metadata.isWebhookUrlVisible === true,
|
|
7575
|
+
eventParameters,
|
|
7576
|
+
filterFields,
|
|
7577
|
+
outputFields
|
|
7578
|
+
};
|
|
7579
|
+
}
|
|
7580
|
+
export { ConnectionOperationsApi, ConnectionsApi, ConnectorsApi, ElementsApi, createApiClient, ACTIVITY_VERSION_V4, SUPPORTED_ACTIVITY_VERSIONS, isV4ActivityConfiguration, getConnectorActivityMetadataV4, getEventOperationObjects, normalizeConnectionStatus, storedActivityBindings, planResourceBindings, createSolutionResourceConfigurationsProvider, MANAGED_HTTP_CONNECTOR_KEY, buildActivityEssentialConfiguration, createConfiguredActivityClient, configureActivityClient, applySavedFilterTree, assertActivityMetadataResolved, buildManagedHttpEssentialConfiguration, extractMultipartParameters, inlineMultipartFileValues, buildInputMetadata, validateIntSvcNode, resourcePickersRequestNeeds, fetchRawMetadata, buildResourceCompactSummary, fetchTriggerMetadata, buildTriggerCompactSummary, findTriggerDesignAction, triggerEventParameters, runTriggerDesignAction };
|
|
6865
7581
|
|
|
6866
|
-
//# debugId=
|
|
7582
|
+
//# debugId=A6C4EE71CA44755064756E2164756E21
|