@uipath/integrationservice-tool 1.202.0 → 1.203.0-preview.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -2
- package/dist/index.js +1 -1
- package/dist/{tool-5qsk24j9.js → tool-f7xtwj1c.js} +569 -86
- package/dist/tool.js +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -234,6 +234,7 @@ Commands:
|
|
|
234
234
|
update <connector-key> <object-name> Update a record
|
|
235
235
|
replace <connector-key> <object-name> Replace a record
|
|
236
236
|
delete <connector-key> <object-name> Delete a record
|
|
237
|
+
script Run an action script against a connection
|
|
237
238
|
```
|
|
238
239
|
|
|
239
240
|
**Create a record:**
|
|
@@ -291,13 +292,57 @@ uip is resources run delete uipath-zoho-desk tickets \
|
|
|
291
292
|
--query "id=123"
|
|
292
293
|
```
|
|
293
294
|
|
|
294
|
-
**Available Options (
|
|
295
|
+
**Available Options (CRUDS run subcommands):**
|
|
295
296
|
- `--connection-id <id>` - Connection/Instance ID (required)
|
|
296
297
|
- `--body <json>` - Request body as JSON string (required for create, update, replace)
|
|
297
298
|
- `--query <params>` - Query parameters as key=value pairs, separated by `&`
|
|
298
299
|
- `-t, --tenant <name>` - Specify tenant (optional)
|
|
299
300
|
- `--output <format>` - Output format: table, json, yaml, plain (default: json)
|
|
300
301
|
|
|
302
|
+
#### Run an Activity Script
|
|
303
|
+
|
|
304
|
+
`run script` does not go through the v3 element-instance route. It posts a
|
|
305
|
+
request body for running the script (`POST /elements_/v4/execute`), which resolves
|
|
306
|
+
the connection's credential, so no token is handled by the CLI or
|
|
307
|
+
visible to the script. It takes no positional arguments: the connection is the
|
|
308
|
+
target, and the connector key is only needed to resolve a published script.
|
|
309
|
+
|
|
310
|
+
Pick exactly one script source:
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
# A local script file: any value ending in .js is read from disk. --body is
|
|
314
|
+
# the script's input, read as context.request.body.
|
|
315
|
+
uip is resources run script --connection-id <id> \
|
|
316
|
+
--inline-script ./ChannelArchive.js \
|
|
317
|
+
--body '{"channel":"C0A66HP9KKM"}'
|
|
318
|
+
|
|
319
|
+
# A published script, by reference. --connector-key is required here.
|
|
320
|
+
uip is resources run script --connection-id <id> \
|
|
321
|
+
--connector-key uipath-salesforce-slack \
|
|
322
|
+
--script-ref list_usergroups \
|
|
323
|
+
--query pageSize=1000
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
There is no script-less passthrough: the CLI cannot point the connection's
|
|
327
|
+
credential at an arbitrary vendor URL. Every vendor call is made by a script.
|
|
328
|
+
|
|
329
|
+
The runtime answers with the vendor's own response, so a vendor 4xx/5xx is a
|
|
330
|
+
`Success` envelope with `Code: "ScriptExecuted"` carrying `Data.Status`,
|
|
331
|
+
`Data.Headers` and `Data.Body` (the vendor's JSON, parsed). A runtime
|
|
332
|
+
refusal is relayed the same way, with the runtime's
|
|
333
|
+
own status and its raw error body as a string. Only a request that got no answer at all (network, login) is a `Failure`.
|
|
334
|
+
Source mistakes (none, both, or `--script-ref` without `--connector-key`) are
|
|
335
|
+
`ValidationError` with exit `3`.
|
|
336
|
+
|
|
337
|
+
**Options (`run script`):**
|
|
338
|
+
- `--connection-id <id>` - Connection/Instance ID (required)
|
|
339
|
+
- `--inline-script <source>` - JavaScript source, or a path ending in `.js` to read a file
|
|
340
|
+
- `--script-ref <name>` - A published script's reference (needs `--connector-key`)
|
|
341
|
+
- `--connector-key <key>` - Connector key, required with `--script-ref`
|
|
342
|
+
- `--body <json>` - Script input, read as `context.request.body`
|
|
343
|
+
- `--query <params>` - Query parameters the script reads as `context.request.query` (`key=value&key=value` or JSON)
|
|
344
|
+
- `--header <name=value...>` - Headers the script reads as `context.request.headers`
|
|
345
|
+
|
|
301
346
|
---
|
|
302
347
|
|
|
303
348
|
## Common Options
|
|
@@ -501,7 +546,8 @@ The tool interacts with these Integration Service APIs:
|
|
|
501
546
|
| `activities list` | `GET /elements_/v3/element/elements/{key}/activities` |
|
|
502
547
|
| `resources list` | `GET /elements_/v3/element/[instances/{id}/]elements/{key}/objects` |
|
|
503
548
|
| `resources describe` | `GET /elements_/v3/element/[instances/{id}/]elements/{key}/objects/{name}/metadata` |
|
|
504
|
-
| `resources run
|
|
549
|
+
| `resources run create|list|get|update|replace|delete` | `{METHOD} /elements_/v3/element/instances/{id}/{objectName}` |
|
|
550
|
+
| `resources run script` | `POST /elements_/v4/execute` |
|
|
505
551
|
|
|
506
552
|
---
|
|
507
553
|
|
package/dist/index.js
CHANGED
|
@@ -2099,8 +2099,9 @@ var require_commander = __commonJS(function(exports) {
|
|
|
2099
2099
|
// package.json
|
|
2100
2100
|
var package_default = {
|
|
2101
2101
|
name: "@uipath/integrationservice-tool",
|
|
2102
|
+
author: "UiPath",
|
|
2102
2103
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
2103
|
-
version: "1.
|
|
2104
|
+
version: "1.203.0-preview.160",
|
|
2104
2105
|
description: "Manage Integration Service connectors, connections, and triggers.",
|
|
2105
2106
|
private: false,
|
|
2106
2107
|
repository: {
|
|
@@ -2139,7 +2140,6 @@ var package_default = {
|
|
|
2139
2140
|
"@uipath/filesystem": "workspace:*",
|
|
2140
2141
|
"@uipath/integrationservice-sdk": "workspace:*",
|
|
2141
2142
|
"@types/node": "^25.5.2",
|
|
2142
|
-
"adm-zip": "^0.6.0",
|
|
2143
2143
|
fflate: "^0.8.2",
|
|
2144
2144
|
commander: "^14.0.3",
|
|
2145
2145
|
typescript: "^7.0.2"
|
|
@@ -2658,7 +2658,7 @@ var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{1
|
|
|
2658
2658
|
var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
2659
2659
|
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
2660
2660
|
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
2661
|
-
var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
2661
|
+
var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
2662
2662
|
var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
|
|
2663
2663
|
var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
|
|
2664
2664
|
var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
|
|
@@ -2705,7 +2705,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
|
|
|
2705
2705
|
`(?<![A-Za-z0-9])"(?:[^\\
|
|
2706
2706
|
]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
|
|
2707
2707
|
].join("|"), "g");
|
|
2708
|
-
var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
|
|
2708
|
+
var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
|
|
2709
2709
|
var COLLAPSED_BODY = "{…}";
|
|
2710
2710
|
var COLLAPSED_BODY_MARKER = "\x01body\x01";
|
|
2711
2711
|
var MAX_BODY_NESTING = 8;
|
|
@@ -2720,10 +2720,13 @@ function collapseJsonBodies(text) {
|
|
|
2720
2720
|
}
|
|
2721
2721
|
return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
|
|
2722
2722
|
}
|
|
2723
|
-
var TRAILING_PROSE_PUNCT =
|
|
2723
|
+
var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
|
|
2724
2724
|
function peelTrailingPunctuation(match) {
|
|
2725
|
-
|
|
2726
|
-
|
|
2725
|
+
let end = match.length;
|
|
2726
|
+
while (end > 0 && TRAILING_PROSE_PUNCT.includes(match[end - 1])) {
|
|
2727
|
+
end -= 1;
|
|
2728
|
+
}
|
|
2729
|
+
return [match.slice(0, end), match.slice(end)];
|
|
2727
2730
|
}
|
|
2728
2731
|
function redactUrl(raw) {
|
|
2729
2732
|
try {
|
|
@@ -3026,6 +3029,22 @@ function parseHttpStatusFromMessage(message) {
|
|
|
3026
3029
|
const status = Number(match[1]);
|
|
3027
3030
|
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
3028
3031
|
}
|
|
3032
|
+
function findHttpStatusInGraph(error) {
|
|
3033
|
+
for (const node of walkErrorGraph(error)) {
|
|
3034
|
+
const response = node.response;
|
|
3035
|
+
const explicit = typeof node.status === "number" ? node.status : response?.status;
|
|
3036
|
+
if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
|
|
3037
|
+
return explicit;
|
|
3038
|
+
}
|
|
3039
|
+
if (typeof node.message === "string") {
|
|
3040
|
+
const parsed = parseHttpStatusFromMessage(node.message);
|
|
3041
|
+
if (parsed !== undefined && parsed >= 400) {
|
|
3042
|
+
return parsed;
|
|
3043
|
+
}
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
return;
|
|
3047
|
+
}
|
|
3029
3048
|
function isHtmlDocument(body) {
|
|
3030
3049
|
return /^\s*(<!doctype html|<html\b)/i.test(body);
|
|
3031
3050
|
}
|
|
@@ -3139,7 +3158,8 @@ async function extractErrorDetails(error, options) {
|
|
|
3139
3158
|
}
|
|
3140
3159
|
let message;
|
|
3141
3160
|
let result = "Failure";
|
|
3142
|
-
const
|
|
3161
|
+
const classificationStatus = status ?? findHttpStatusInGraph(error);
|
|
3162
|
+
const classification = classifyError(classificationStatus, error);
|
|
3143
3163
|
let retry = classification.retry;
|
|
3144
3164
|
if (status === 401) {
|
|
3145
3165
|
message = DEFAULT_401;
|
|
@@ -3215,8 +3235,8 @@ async function extractErrorDetails(error, options) {
|
|
|
3215
3235
|
details = describeThrownValue(error);
|
|
3216
3236
|
}
|
|
3217
3237
|
const context = {};
|
|
3218
|
-
if (
|
|
3219
|
-
context.httpStatus =
|
|
3238
|
+
if (classificationStatus) {
|
|
3239
|
+
context.httpStatus = classificationStatus;
|
|
3220
3240
|
}
|
|
3221
3241
|
if (parsedBody?.errorCode && typeof parsedBody.errorCode === "string") {
|
|
3222
3242
|
context.errorCode = parsedBody.errorCode;
|
|
@@ -3778,7 +3798,8 @@ function readRegistryValue(keyPath, valueName) {
|
|
|
3778
3798
|
}
|
|
3779
3799
|
const [error, output] = catchError(() => execFileSync("reg", ["query", keyPath, "/v", valueName], {
|
|
3780
3800
|
encoding: "utf-8",
|
|
3781
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
3801
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
3802
|
+
windowsHide: true
|
|
3782
3803
|
}));
|
|
3783
3804
|
if (error) {
|
|
3784
3805
|
return "";
|
|
@@ -4460,28 +4481,32 @@ function isPlainRecord(value) {
|
|
|
4460
4481
|
const prototype = Object.getPrototypeOf(value);
|
|
4461
4482
|
return prototype === Object.prototype || prototype === null;
|
|
4462
4483
|
}
|
|
4463
|
-
function
|
|
4484
|
+
function splitPagedEnvelope(value) {
|
|
4464
4485
|
if (Array.isArray(value) || !isPlainRecord(value))
|
|
4465
4486
|
return null;
|
|
4466
|
-
const entries = Object.
|
|
4487
|
+
const entries = Object.entries(value);
|
|
4467
4488
|
if (entries.length === 0)
|
|
4468
4489
|
return null;
|
|
4469
|
-
let
|
|
4470
|
-
|
|
4471
|
-
for (const entry of entries) {
|
|
4490
|
+
let found = null;
|
|
4491
|
+
const meta = Object.create(null);
|
|
4492
|
+
for (const [key, entry] of entries) {
|
|
4472
4493
|
if (Array.isArray(entry)) {
|
|
4473
|
-
if (
|
|
4494
|
+
if (found !== null)
|
|
4474
4495
|
return null;
|
|
4475
|
-
|
|
4496
|
+
found = { key, rows: entry };
|
|
4476
4497
|
} else if (entry !== null && typeof entry === "object") {
|
|
4477
4498
|
return null;
|
|
4478
4499
|
} else {
|
|
4479
|
-
|
|
4500
|
+
meta[key] = entry;
|
|
4480
4501
|
}
|
|
4481
4502
|
}
|
|
4482
|
-
if (
|
|
4503
|
+
if (found === null || Object.keys(meta).length === 0)
|
|
4483
4504
|
return null;
|
|
4484
|
-
return
|
|
4505
|
+
return { ...found, meta };
|
|
4506
|
+
}
|
|
4507
|
+
function extractPagedRows(value) {
|
|
4508
|
+
const paged = splitPagedEnvelope(value);
|
|
4509
|
+
return paged === null ? null : paged.rows;
|
|
4485
4510
|
}
|
|
4486
4511
|
function toLowerCamelCaseKey(key) {
|
|
4487
4512
|
if (!key)
|
|
@@ -4585,6 +4610,9 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
|
|
|
4585
4610
|
}
|
|
4586
4611
|
break;
|
|
4587
4612
|
}
|
|
4613
|
+
case "markdown":
|
|
4614
|
+
logFn(renderMarkdown(data));
|
|
4615
|
+
break;
|
|
4588
4616
|
default: {
|
|
4589
4617
|
const hasData = "Data" in data && data.Data != null;
|
|
4590
4618
|
const pagedRows = hasData ? extractPagedRows(data.Data) : null;
|
|
@@ -4609,6 +4637,10 @@ function logOutput(data, format = "json", tableRowStyle) {
|
|
|
4609
4637
|
printOutput(data, format, (msg) => sink.writeOut(`${msg}
|
|
4610
4638
|
`), needsAsciiSafeJson(sink), styleFn);
|
|
4611
4639
|
}
|
|
4640
|
+
var PLUMBING_KEYS = new Set(["code", "log"]);
|
|
4641
|
+
function isPlumbingKey(key) {
|
|
4642
|
+
return PLUMBING_KEYS.has(key.toLowerCase());
|
|
4643
|
+
}
|
|
4612
4644
|
function cellToString(val) {
|
|
4613
4645
|
return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
|
|
4614
4646
|
}
|
|
@@ -4624,7 +4656,7 @@ function wrapText(text, width) {
|
|
|
4624
4656
|
function printTable(data, logFn, externalLogValue, tableRowStyle) {
|
|
4625
4657
|
if (data.length === 0)
|
|
4626
4658
|
return;
|
|
4627
|
-
const keys = Object.keys(data[0]).filter((key) => !
|
|
4659
|
+
const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
|
|
4628
4660
|
const maxWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
|
|
4629
4661
|
const header = keys.map((key, i) => key.padEnd(maxWidths[i])).join(" | ");
|
|
4630
4662
|
logFn(header);
|
|
@@ -4646,7 +4678,7 @@ function isNonEmptyPlainObject(value) {
|
|
|
4646
4678
|
}
|
|
4647
4679
|
var NESTED_INDENT = " ";
|
|
4648
4680
|
function printVerticalTable(data, logFn = console.log, externalLogValue) {
|
|
4649
|
-
const keys = Object.keys(data).filter((key) => !
|
|
4681
|
+
const keys = Object.keys(data).filter((key) => !isPlumbingKey(key));
|
|
4650
4682
|
if (keys.length === 0)
|
|
4651
4683
|
return;
|
|
4652
4684
|
const isBlockValue = (value) => isPlainObjectArray(value) || isNonEmptyPlainObject(value);
|
|
@@ -4677,7 +4709,7 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
|
|
|
4677
4709
|
function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
|
|
4678
4710
|
if (data.length === 0)
|
|
4679
4711
|
return;
|
|
4680
|
-
const keys = Object.keys(data[0]).filter((key) => !
|
|
4712
|
+
const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
|
|
4681
4713
|
if (keys.length === 0)
|
|
4682
4714
|
return;
|
|
4683
4715
|
if (!process.stdout.isTTY) {
|
|
@@ -4751,6 +4783,220 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
|
|
|
4751
4783
|
logFn(`Log: ${externalLogValue}`);
|
|
4752
4784
|
}
|
|
4753
4785
|
}
|
|
4786
|
+
var MARKDOWN_MAX_CELL = 200;
|
|
4787
|
+
var MARKDOWN_MAX_DEPTH = 3;
|
|
4788
|
+
function markdownHeading(depth) {
|
|
4789
|
+
return "#".repeat(Math.min(3 + depth, 6));
|
|
4790
|
+
}
|
|
4791
|
+
var BACKTICK_RUN = /`+/g;
|
|
4792
|
+
function fencedBlock(text) {
|
|
4793
|
+
const first = text.trimStart()[0];
|
|
4794
|
+
const language = first === "<" ? "xml" : first === "{" || first === "[" ? "json" : "";
|
|
4795
|
+
const longestRun = Math.max(0, ...Array.from(text.matchAll(BACKTICK_RUN), (match) => match[0].length));
|
|
4796
|
+
const fence = "`".repeat(Math.max(3, longestRun + 1));
|
|
4797
|
+
return `${fence}${language}
|
|
4798
|
+
${text}
|
|
4799
|
+
${fence}`;
|
|
4800
|
+
}
|
|
4801
|
+
function collapseNewlineRuns(text) {
|
|
4802
|
+
return text.split(/(\s+)/).map((part, index) => index % 2 === 1 && part.includes(`
|
|
4803
|
+
`) ? " " : part).join("");
|
|
4804
|
+
}
|
|
4805
|
+
function markdownCell(value) {
|
|
4806
|
+
const text = value instanceof Date ? value.toISOString() : cellToString(value);
|
|
4807
|
+
return collapseNewlineRuns(text).replace(/\|/g, "\\|");
|
|
4808
|
+
}
|
|
4809
|
+
function markdownLabel(key) {
|
|
4810
|
+
return collapseNewlineRuns(key).replace(/[\\`*|]/g, "\\$&");
|
|
4811
|
+
}
|
|
4812
|
+
function withoutPlumbing(record) {
|
|
4813
|
+
const kept = Object.create(null);
|
|
4814
|
+
for (const [key, value] of Object.entries(record)) {
|
|
4815
|
+
if (!isPlumbingKey(key))
|
|
4816
|
+
kept[key] = value;
|
|
4817
|
+
}
|
|
4818
|
+
return kept;
|
|
4819
|
+
}
|
|
4820
|
+
function rowsWithoutPlumbing(rows) {
|
|
4821
|
+
return rows.map((row) => isPlainRecord(row) ? withoutPlumbing(row) : row);
|
|
4822
|
+
}
|
|
4823
|
+
function markdownTable(rows) {
|
|
4824
|
+
const columns = [];
|
|
4825
|
+
const seen = new Set;
|
|
4826
|
+
for (const row of rows) {
|
|
4827
|
+
for (const key of Object.keys(row)) {
|
|
4828
|
+
if (!seen.has(key)) {
|
|
4829
|
+
seen.add(key);
|
|
4830
|
+
columns.push(key);
|
|
4831
|
+
}
|
|
4832
|
+
}
|
|
4833
|
+
}
|
|
4834
|
+
if (columns.length === 0)
|
|
4835
|
+
return null;
|
|
4836
|
+
const cells = rows.map((row) => columns.map((key) => markdownCell(row[key])));
|
|
4837
|
+
if (cells.some((row) => row.some((c) => c.length > MARKDOWN_MAX_CELL))) {
|
|
4838
|
+
return null;
|
|
4839
|
+
}
|
|
4840
|
+
return [
|
|
4841
|
+
`| ${columns.map(markdownLabel).join(" | ")} |`,
|
|
4842
|
+
`| ${columns.map(() => "---").join(" | ")} |`,
|
|
4843
|
+
...cells.map((row) => `| ${row.join(" | ")} |`)
|
|
4844
|
+
].join(`
|
|
4845
|
+
`);
|
|
4846
|
+
}
|
|
4847
|
+
function extractMessageSequence(rows) {
|
|
4848
|
+
const messages = [];
|
|
4849
|
+
for (const row of rows) {
|
|
4850
|
+
const message = extractSingleMessage(row);
|
|
4851
|
+
if (message === null)
|
|
4852
|
+
return null;
|
|
4853
|
+
messages.push(message);
|
|
4854
|
+
}
|
|
4855
|
+
return messages.join(`
|
|
4856
|
+
|
|
4857
|
+
`);
|
|
4858
|
+
}
|
|
4859
|
+
function markdownRows(rows, depth) {
|
|
4860
|
+
if (rows.length === 0)
|
|
4861
|
+
return "(none)";
|
|
4862
|
+
if (!isPlainObjectArray(rows)) {
|
|
4863
|
+
return rows.map((item) => `- ${markdownCell(item)}`).join(`
|
|
4864
|
+
`);
|
|
4865
|
+
}
|
|
4866
|
+
const prose = extractMessageSequence(rows);
|
|
4867
|
+
if (prose !== null)
|
|
4868
|
+
return prose;
|
|
4869
|
+
const table = markdownTable(rows);
|
|
4870
|
+
if (table !== null)
|
|
4871
|
+
return table;
|
|
4872
|
+
if (depth >= MARKDOWN_MAX_DEPTH) {
|
|
4873
|
+
return fencedBlock(JSON.stringify(rows, null, 2));
|
|
4874
|
+
}
|
|
4875
|
+
return rows.map((row, index) => [
|
|
4876
|
+
`${markdownHeading(depth)} ${index + 1}`,
|
|
4877
|
+
markdownObject(row, depth + 1)
|
|
4878
|
+
].join(`
|
|
4879
|
+
|
|
4880
|
+
`)).join(`
|
|
4881
|
+
|
|
4882
|
+
`);
|
|
4883
|
+
}
|
|
4884
|
+
function markdownObject(obj, depth) {
|
|
4885
|
+
const scalars = [];
|
|
4886
|
+
const blocks = [];
|
|
4887
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
4888
|
+
if (value === undefined)
|
|
4889
|
+
continue;
|
|
4890
|
+
const label = markdownLabel(key);
|
|
4891
|
+
if (Array.isArray(value)) {
|
|
4892
|
+
blocks.push(`${markdownHeading(depth)} ${label}
|
|
4893
|
+
|
|
4894
|
+
${markdownRows(value, depth + 1)}`);
|
|
4895
|
+
} else if (isNonEmptyPlainObject(value)) {
|
|
4896
|
+
const nested = depth < MARKDOWN_MAX_DEPTH ? markdownObject(value, depth + 1) : fencedBlock(JSON.stringify(value, null, 2));
|
|
4897
|
+
if (nested !== "") {
|
|
4898
|
+
blocks.push(`${markdownHeading(depth)} ${label}
|
|
4899
|
+
|
|
4900
|
+
${nested}`);
|
|
4901
|
+
}
|
|
4902
|
+
} else if (typeof value === "string" && value.includes(`
|
|
4903
|
+
`)) {
|
|
4904
|
+
blocks.push(`**${label}:**
|
|
4905
|
+
|
|
4906
|
+
${fencedBlock(value)}`);
|
|
4907
|
+
} else {
|
|
4908
|
+
scalars.push(`**${label}:** ${markdownCell(value)}`);
|
|
4909
|
+
}
|
|
4910
|
+
}
|
|
4911
|
+
const sections = scalars.length > 0 ? [scalars.join(`
|
|
4912
|
+
`)] : [];
|
|
4913
|
+
sections.push(...blocks);
|
|
4914
|
+
return sections.join(`
|
|
4915
|
+
|
|
4916
|
+
`);
|
|
4917
|
+
}
|
|
4918
|
+
function extractSingleMessage(payload) {
|
|
4919
|
+
if (!isPlainRecord(payload))
|
|
4920
|
+
return null;
|
|
4921
|
+
const keys = Object.keys(payload);
|
|
4922
|
+
if (keys.length !== 1 || keys[0].toLowerCase() !== "message")
|
|
4923
|
+
return null;
|
|
4924
|
+
const value = payload[keys[0]];
|
|
4925
|
+
return typeof value === "string" ? value : null;
|
|
4926
|
+
}
|
|
4927
|
+
function markdownPayload(payload) {
|
|
4928
|
+
const message = extractSingleMessage(payload);
|
|
4929
|
+
if (message !== null)
|
|
4930
|
+
return message;
|
|
4931
|
+
if (Array.isArray(payload)) {
|
|
4932
|
+
return markdownRows(rowsWithoutPlumbing(payload), 0);
|
|
4933
|
+
}
|
|
4934
|
+
const visible = withoutPlumbing(payload);
|
|
4935
|
+
const paged = splitPagedEnvelope(visible);
|
|
4936
|
+
if (paged !== null) {
|
|
4937
|
+
const meta = markdownObject(paged.meta, 0);
|
|
4938
|
+
const rows = `${markdownHeading(0)} ${markdownLabel(paged.key)}
|
|
4939
|
+
|
|
4940
|
+
${markdownRows(rowsWithoutPlumbing(paged.rows), 1)}`;
|
|
4941
|
+
return meta === "" ? rows : `${meta}
|
|
4942
|
+
|
|
4943
|
+
${rows}`;
|
|
4944
|
+
}
|
|
4945
|
+
return markdownObject(visible, 0);
|
|
4946
|
+
}
|
|
4947
|
+
function isPaginationWorthShowing(value) {
|
|
4948
|
+
if (typeof value !== "object" || value === null)
|
|
4949
|
+
return false;
|
|
4950
|
+
const page = value;
|
|
4951
|
+
return page.HasMore === true || typeof page.Offset === "number" && page.Offset > 0;
|
|
4952
|
+
}
|
|
4953
|
+
function markdownEnvelopeNotes(data) {
|
|
4954
|
+
const envelope = data;
|
|
4955
|
+
const notes = [];
|
|
4956
|
+
const warning = envelope.Warning;
|
|
4957
|
+
if (typeof warning === "string" && warning !== "") {
|
|
4958
|
+
notes.push(`> **Warning:** ${warning}`);
|
|
4959
|
+
}
|
|
4960
|
+
const instructions = envelope.Instructions;
|
|
4961
|
+
if (typeof instructions === "string" && instructions !== "") {
|
|
4962
|
+
notes.push(`> ${instructions}`);
|
|
4963
|
+
}
|
|
4964
|
+
const pagination = envelope.Pagination;
|
|
4965
|
+
if (isPaginationWorthShowing(pagination)) {
|
|
4966
|
+
const body = markdownObject(pagination, 1);
|
|
4967
|
+
if (body !== "") {
|
|
4968
|
+
notes.push(`${markdownHeading(0)} Pagination
|
|
4969
|
+
|
|
4970
|
+
${body}`);
|
|
4971
|
+
}
|
|
4972
|
+
}
|
|
4973
|
+
const log = envelope.Log;
|
|
4974
|
+
if (typeof log === "string" && log !== "") {
|
|
4975
|
+
notes.push(`**Log:** ${log}`);
|
|
4976
|
+
}
|
|
4977
|
+
return notes;
|
|
4978
|
+
}
|
|
4979
|
+
function renderMarkdown(data) {
|
|
4980
|
+
if (data.Result !== RESULTS.Success) {
|
|
4981
|
+
const failure = data;
|
|
4982
|
+
const sections = [`**Failed:** ${failure.Message}`];
|
|
4983
|
+
if (failure.Data != null) {
|
|
4984
|
+
sections.push(markdownPayload(failure.Data));
|
|
4985
|
+
}
|
|
4986
|
+
if (failure.Instructions) {
|
|
4987
|
+
sections.push(`> ${failure.Instructions}`);
|
|
4988
|
+
}
|
|
4989
|
+
return sections.filter((section) => section !== "").join(`
|
|
4990
|
+
|
|
4991
|
+
`);
|
|
4992
|
+
}
|
|
4993
|
+
if (!("Data" in data) || data.Data == null) {
|
|
4994
|
+
return markdownObject(withoutPlumbing(data), 0);
|
|
4995
|
+
}
|
|
4996
|
+
return [markdownPayload(data.Data), ...markdownEnvelopeNotes(data)].filter((section) => section !== "").join(`
|
|
4997
|
+
|
|
4998
|
+
`);
|
|
4999
|
+
}
|
|
4754
5000
|
function toYaml(data) {
|
|
4755
5001
|
const codec = getYamlCodec();
|
|
4756
5002
|
if (!codec) {
|
|
@@ -6774,8 +7020,9 @@ class TextApiResponse {
|
|
|
6774
7020
|
// ../integrationservice-sdk/package.json
|
|
6775
7021
|
var package_default2 = {
|
|
6776
7022
|
name: "@uipath/integrationservice-sdk",
|
|
7023
|
+
author: "UiPath",
|
|
6777
7024
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
6778
|
-
version: "1.
|
|
7025
|
+
version: "1.203.0-preview.160",
|
|
6779
7026
|
repository: {
|
|
6780
7027
|
type: "git",
|
|
6781
7028
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -13283,16 +13530,7 @@ var resolveEnvFilePathAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) =
|
|
|
13283
13530
|
errorMessage: location.source === "absolute" ? `Environment file not found: ${envFilePath}` : `Unable to locate environment file: ${envFilePath}. Run 'uip login' to authenticate.`
|
|
13284
13531
|
};
|
|
13285
13532
|
};
|
|
13286
|
-
var
|
|
13287
|
-
const fs2 = getFileSystem();
|
|
13288
|
-
const absolutePath = fs2.path.isAbsolute(envPath) ? envPath : fs2.path.join(fs2.env.cwd(), envPath);
|
|
13289
|
-
if (!await fs2.exists(absolutePath)) {
|
|
13290
|
-
throw new Error(`Environment file not found: ${envPath}`);
|
|
13291
|
-
}
|
|
13292
|
-
const content = await fs2.readFile(absolutePath, "utf-8");
|
|
13293
|
-
if (content === null) {
|
|
13294
|
-
throw new Error(`Environment file not found: ${envPath}`);
|
|
13295
|
-
}
|
|
13533
|
+
var parseEnvContent = (content) => {
|
|
13296
13534
|
const env = {};
|
|
13297
13535
|
for (const line of content.split(`
|
|
13298
13536
|
`)) {
|
|
@@ -13313,6 +13551,18 @@ var loadEnvFileAsync = async ({ envPath }) => {
|
|
|
13313
13551
|
}
|
|
13314
13552
|
return env;
|
|
13315
13553
|
};
|
|
13554
|
+
var loadEnvFileAsync = async ({ envPath }) => {
|
|
13555
|
+
const fs2 = getFileSystem();
|
|
13556
|
+
const absolutePath = fs2.path.isAbsolute(envPath) ? envPath : fs2.path.join(fs2.env.cwd(), envPath);
|
|
13557
|
+
if (!await fs2.exists(absolutePath)) {
|
|
13558
|
+
throw new Error(`Environment file not found: ${envPath}`);
|
|
13559
|
+
}
|
|
13560
|
+
const content = await fs2.readFile(absolutePath, "utf-8");
|
|
13561
|
+
if (content === null) {
|
|
13562
|
+
throw new Error(`Environment file not found: ${envPath}`);
|
|
13563
|
+
}
|
|
13564
|
+
return parseEnvContent(content);
|
|
13565
|
+
};
|
|
13316
13566
|
var saveEnvFileAsync = async ({
|
|
13317
13567
|
envPath,
|
|
13318
13568
|
data,
|
|
@@ -14012,9 +14262,9 @@ var SUPPORTED_ACTIVITY_VERSIONS = [
|
|
|
14012
14262
|
ACTIVITY_VERSION_V1,
|
|
14013
14263
|
ACTIVITY_VERSION_V4
|
|
14014
14264
|
];
|
|
14015
|
-
async function getConnectorActivityMetadataV4(options, connectorKey,
|
|
14265
|
+
async function getConnectorActivityMetadataV4(options, connectorKey, objectName) {
|
|
14016
14266
|
const { baseUrl, accessToken, organizationId, tenantName } = await getValidatedAuthContext(options);
|
|
14017
|
-
const url = `${baseUrl}/${organizationId}/${tenantName}/elements_/v4/element/connectors/${encodeURIComponent(connectorKey)}/
|
|
14267
|
+
const url = `${baseUrl}/${organizationId}/${tenantName}/elements_/v4/element/connectors/${encodeURIComponent(connectorKey)}/objects/${encodeURIComponent(objectName)}/metadata`;
|
|
14018
14268
|
const response = await fetch(url, {
|
|
14019
14269
|
headers: addSdkUserAgentHeader({
|
|
14020
14270
|
Authorization: `Bearer ${accessToken}`,
|
|
@@ -14663,6 +14913,75 @@ var hasMoreElementsPages = (token) => {
|
|
|
14663
14913
|
const cursor = decodeElementsNextPageToken(token)?.providerNextPage;
|
|
14664
14914
|
return typeof cursor === "string" && cursor.length > 0 && cursor !== ELEMENTS_NEXT_PAGE_DONE;
|
|
14665
14915
|
};
|
|
14916
|
+
// ../integrationservice-sdk/src/runtime/connector-execute-helper.ts
|
|
14917
|
+
var EXECUTE_PATH = "elements_/v4/execute";
|
|
14918
|
+
function resolveExecuteUrl(ctx) {
|
|
14919
|
+
const base = ctx.baseUrl.replace(/\/+$/, "");
|
|
14920
|
+
return `${base}/${ctx.organizationId}/${ctx.tenantName}/${EXECUTE_PATH}`;
|
|
14921
|
+
}
|
|
14922
|
+
async function executeRequest(input) {
|
|
14923
|
+
const options = input.tenant ? { tenant: input.tenant } : undefined;
|
|
14924
|
+
const { baseUrl, accessToken, organizationId, tenantName } = await getValidatedAuthContext(options);
|
|
14925
|
+
const requestBody = buildRequestBody(input);
|
|
14926
|
+
const headers = {
|
|
14927
|
+
"Content-Type": "application/json",
|
|
14928
|
+
Authorization: `Bearer ${accessToken}`,
|
|
14929
|
+
"X-UIPATH-OrganizationId": organizationId,
|
|
14930
|
+
"X-UIPATH-TenantId": tenantName,
|
|
14931
|
+
"User-Agent": SDK_USER_AGENT
|
|
14932
|
+
};
|
|
14933
|
+
const url = resolveExecuteUrl({ baseUrl, organizationId, tenantName });
|
|
14934
|
+
const response = await fetch(url, {
|
|
14935
|
+
method: "POST",
|
|
14936
|
+
headers,
|
|
14937
|
+
body: JSON.stringify(requestBody)
|
|
14938
|
+
});
|
|
14939
|
+
const body = await response.text();
|
|
14940
|
+
const responseHeaders = Object.fromEntries(response.headers.entries());
|
|
14941
|
+
if (response.status < 200 || response.status >= 300) {
|
|
14942
|
+
return { status: response.status, headers: responseHeaders, body };
|
|
14943
|
+
}
|
|
14944
|
+
const envelope = parseEnvelope(body);
|
|
14945
|
+
if (envelope === undefined) {
|
|
14946
|
+
return { status: response.status, headers: responseHeaders, body };
|
|
14947
|
+
}
|
|
14948
|
+
return {
|
|
14949
|
+
status: envelope.status ?? response.status,
|
|
14950
|
+
headers: envelope.headers ?? responseHeaders,
|
|
14951
|
+
body: envelope.body ?? []
|
|
14952
|
+
};
|
|
14953
|
+
}
|
|
14954
|
+
function parseEnvelope(body) {
|
|
14955
|
+
try {
|
|
14956
|
+
const parsed = JSON.parse(body);
|
|
14957
|
+
if (parsed === null || typeof parsed !== "object") {
|
|
14958
|
+
return;
|
|
14959
|
+
}
|
|
14960
|
+
return parsed;
|
|
14961
|
+
} catch {
|
|
14962
|
+
return;
|
|
14963
|
+
}
|
|
14964
|
+
}
|
|
14965
|
+
function buildRequestBody(input) {
|
|
14966
|
+
const context = {
|
|
14967
|
+
connectionId: input.connectionId
|
|
14968
|
+
};
|
|
14969
|
+
if (input.connectorKey) {
|
|
14970
|
+
context.connectorKey = input.connectorKey;
|
|
14971
|
+
}
|
|
14972
|
+
if (input.inlineScript !== undefined) {
|
|
14973
|
+
context.script = {
|
|
14974
|
+
inlineScript: input.inlineScript
|
|
14975
|
+
};
|
|
14976
|
+
} else if (input.scriptRef !== undefined) {
|
|
14977
|
+
context.script = { reference: input.scriptRef };
|
|
14978
|
+
}
|
|
14979
|
+
const requestBody = { context };
|
|
14980
|
+
if (input.request) {
|
|
14981
|
+
requestBody.request = input.request;
|
|
14982
|
+
}
|
|
14983
|
+
return requestBody;
|
|
14984
|
+
}
|
|
14666
14985
|
// src/helpers/activities.ts
|
|
14667
14986
|
function formatActivityList(activities) {
|
|
14668
14987
|
return activities.map((activity) => ({
|
|
@@ -14678,9 +14997,6 @@ function formatActivityList(activities) {
|
|
|
14678
14997
|
function filterByTriggerMode(activities, isTrigger) {
|
|
14679
14998
|
return activities.filter((a) => a.isTrigger === isTrigger);
|
|
14680
14999
|
}
|
|
14681
|
-
function filterExcluded(activities, connectorKey) {
|
|
14682
|
-
return activities.filter((a) => connectorKey !== "uipath-uipath-dataservice" || !/_V3$/i.test(String(a.name ?? "")));
|
|
14683
|
-
}
|
|
14684
15000
|
|
|
14685
15001
|
// src/store/cache.ts
|
|
14686
15002
|
var fs2 = getFileSystem();
|
|
@@ -14695,6 +15011,7 @@ var TTL = {
|
|
|
14695
15011
|
triggerObjects: 4 * HOUR,
|
|
14696
15012
|
triggerMetadata: 4 * HOUR
|
|
14697
15013
|
};
|
|
15014
|
+
var CONNECTORS_CACHE_SCHEMA = 2;
|
|
14698
15015
|
var memoMap = new Map;
|
|
14699
15016
|
async function resolveTenantId(tenantName) {
|
|
14700
15017
|
const key = tenantName ?? "__default__";
|
|
@@ -14733,7 +15050,7 @@ async function buildPath(parts, tenantName) {
|
|
|
14733
15050
|
function sanitizeObjectNameForFile(objectName) {
|
|
14734
15051
|
return objectName.replace(/[<>:"/\\|?*]/g, "_");
|
|
14735
15052
|
}
|
|
14736
|
-
async function readJson(filePath, ttlMs) {
|
|
15053
|
+
async function readJson(filePath, ttlMs, schema) {
|
|
14737
15054
|
if (filePath === null)
|
|
14738
15055
|
return null;
|
|
14739
15056
|
const [err, raw] = await catchError(fs2.readFile(filePath, "utf-8"));
|
|
@@ -14747,12 +15064,18 @@ async function readJson(filePath, ttlMs) {
|
|
|
14747
15064
|
return null;
|
|
14748
15065
|
if (Date.now() - envelope.cachedAt > ttlMs)
|
|
14749
15066
|
return null;
|
|
15067
|
+
if (schema !== undefined && envelope.schema !== schema)
|
|
15068
|
+
return null;
|
|
14750
15069
|
return envelope.data;
|
|
14751
15070
|
}
|
|
14752
|
-
async function writeJson(filePath, data) {
|
|
15071
|
+
async function writeJson(filePath, data, schema) {
|
|
14753
15072
|
if (filePath === null)
|
|
14754
15073
|
return;
|
|
14755
|
-
const envelope = {
|
|
15074
|
+
const envelope = {
|
|
15075
|
+
cachedAt: Date.now(),
|
|
15076
|
+
data,
|
|
15077
|
+
...schema === undefined ? {} : { schema }
|
|
15078
|
+
};
|
|
14756
15079
|
const [err] = await catchError(async () => {
|
|
14757
15080
|
await fs2.mkdir(fs2.path.dirname(filePath), { recursive: true });
|
|
14758
15081
|
await fs2.writeFile(filePath, JSON.stringify(envelope, null, 2), "utf-8");
|
|
@@ -14765,28 +15088,22 @@ function resolveCacheKey(id) {
|
|
|
14765
15088
|
return id || "_static";
|
|
14766
15089
|
}
|
|
14767
15090
|
async function readConnectors(tenantName) {
|
|
14768
|
-
return readJson(await buildPath(["connectors.json"], tenantName), TTL.connectors);
|
|
15091
|
+
return readJson(await buildPath(["connectors.json"], tenantName), TTL.connectors, CONNECTORS_CACHE_SCHEMA);
|
|
14769
15092
|
}
|
|
14770
15093
|
async function writeConnectors(connectors, tenantName) {
|
|
14771
15094
|
const compact = connectors.map((c) => ({
|
|
14772
15095
|
id: c.id,
|
|
14773
15096
|
name: c.name,
|
|
14774
15097
|
key: c.key,
|
|
14775
|
-
|
|
14776
|
-
|
|
14777
|
-
latestVersion: c.latestVersion,
|
|
14778
|
-
lifecycleStage: c.lifecycleStage,
|
|
15098
|
+
enabled: c.enabled,
|
|
15099
|
+
lifeCycleStage: c.lifeCycleStage,
|
|
14779
15100
|
description: c.description,
|
|
14780
15101
|
hasEvents: c.hasEvents,
|
|
14781
|
-
hasCRUDs: c.hasCRUDs,
|
|
14782
|
-
hasMethods: c.hasMethods,
|
|
14783
15102
|
categories: c.categories,
|
|
14784
15103
|
tags: c.tags,
|
|
14785
|
-
authentication: c.authentication
|
|
14786
|
-
defaultAuthenticationType: c.defaultAuthenticationType,
|
|
14787
|
-
dapCompatible: c.dapCompatible
|
|
15104
|
+
authentication: c.authentication
|
|
14788
15105
|
}));
|
|
14789
|
-
await writeJson(await buildPath(["connectors.json"], tenantName), compact);
|
|
15106
|
+
await writeJson(await buildPath(["connectors.json"], tenantName), compact, CONNECTORS_CACHE_SCHEMA);
|
|
14790
15107
|
}
|
|
14791
15108
|
function connectionsFile(folderKey, allFolders) {
|
|
14792
15109
|
if (allFolders)
|
|
@@ -14994,7 +15311,7 @@ var registerActivitiesCommand = (program2) => {
|
|
|
14994
15311
|
if (data && data.length > 0)
|
|
14995
15312
|
await writeActivities(connectorKey, data, options.tenant);
|
|
14996
15313
|
}
|
|
14997
|
-
const filtered =
|
|
15314
|
+
const filtered = data ? filterByTriggerMode(data, isTriggerMode) : [];
|
|
14998
15315
|
OutputFormatter.emitList(isTriggerMode ? "TriggerActivityList" : "ActivityList", formatActivityList(filtered), {
|
|
14999
15316
|
emptyInstructions: !data || data.length === 0 ? `No activities found for connector '${connectorKey}'. Check that the connector key is correct.` : isTriggerMode ? `No trigger activities found for connector '${connectorKey}'. This connector has no trigger activities.` : `No non-trigger activities found for connector '${connectorKey}'. All activities are triggers — use --triggers to list them.`
|
|
15000
15317
|
});
|
|
@@ -16027,12 +16344,8 @@ function formatConnectorList(connectors) {
|
|
|
16027
16344
|
Id: c.id,
|
|
16028
16345
|
Name: c.name,
|
|
16029
16346
|
Key: c.key,
|
|
16030
|
-
|
|
16031
|
-
|
|
16032
|
-
CatalogActive: c.isActive ? "Yes" : "No",
|
|
16033
|
-
Version: c.latestVersion,
|
|
16034
|
-
Stage: c.lifecycleStage,
|
|
16035
|
-
DapCompatible: c.dapCompatible ? "Yes" : "No"
|
|
16347
|
+
Active: c.enabled ? "Yes" : "No",
|
|
16348
|
+
Stage: c.lifeCycleStage ?? ""
|
|
16036
16349
|
}));
|
|
16037
16350
|
}
|
|
16038
16351
|
function formatConnectorDetail(connector) {
|
|
@@ -28645,26 +28958,18 @@ var CONNECTORS_LIST_EXAMPLES = [
|
|
|
28645
28958
|
Code: "ConnectorList",
|
|
28646
28959
|
Data: [
|
|
28647
28960
|
{
|
|
28648
|
-
Id:
|
|
28961
|
+
Id: 3137,
|
|
28649
28962
|
Name: "Zoho Desk",
|
|
28650
28963
|
Key: "uipath-zoho-desk",
|
|
28651
|
-
|
|
28652
|
-
|
|
28653
|
-
CatalogActive: "No",
|
|
28654
|
-
Version: "",
|
|
28655
|
-
Stage: "",
|
|
28656
|
-
DapCompatible: "No"
|
|
28964
|
+
Active: "Yes",
|
|
28965
|
+
Stage: "GA"
|
|
28657
28966
|
},
|
|
28658
28967
|
{
|
|
28659
|
-
Id:
|
|
28968
|
+
Id: 4637,
|
|
28660
28969
|
Name: "Zoho Mail",
|
|
28661
28970
|
Key: "uipath-zoho-mail",
|
|
28662
|
-
|
|
28663
|
-
|
|
28664
|
-
CatalogActive: "No",
|
|
28665
|
-
Version: "",
|
|
28666
|
-
Stage: "",
|
|
28667
|
-
DapCompatible: "No"
|
|
28971
|
+
Active: "Yes",
|
|
28972
|
+
Stage: "GA"
|
|
28668
28973
|
}
|
|
28669
28974
|
]
|
|
28670
28975
|
}
|
|
@@ -28678,22 +28983,22 @@ var CONNECTORS_GET_EXAMPLES = [
|
|
|
28678
28983
|
Code: "Connector",
|
|
28679
28984
|
Data: [
|
|
28680
28985
|
{
|
|
28681
|
-
Id:
|
|
28986
|
+
Id: 3137,
|
|
28682
28987
|
Name: "Zoho Desk",
|
|
28683
28988
|
Key: "uipath-zoho-desk",
|
|
28684
|
-
AppName: "",
|
|
28685
|
-
Vendor: "",
|
|
28989
|
+
AppName: "desk",
|
|
28990
|
+
Vendor: "zoho",
|
|
28686
28991
|
Description: "Zoho Desk streamlines customer service, boosts agent efficiency and deliver lasting customer experiences",
|
|
28687
28992
|
Image: "https://example.com/zoho-desk/image",
|
|
28688
|
-
Active: "
|
|
28993
|
+
Active: "Yes",
|
|
28689
28994
|
HasEvents: "Yes",
|
|
28690
|
-
HasCruds: "
|
|
28995
|
+
HasCruds: "Yes",
|
|
28691
28996
|
HasMethods: "No",
|
|
28692
28997
|
HasHttpRequest: "Yes",
|
|
28693
|
-
DapCompatible: "
|
|
28998
|
+
DapCompatible: "Yes",
|
|
28694
28999
|
Categories: "IT and help desk",
|
|
28695
29000
|
Tags: "Service desk, Agents, Tickets",
|
|
28696
|
-
DocumentationUrl: "
|
|
29001
|
+
DocumentationUrl: "https://docs.uipath.com/integration-service/automation-cloud/latest/user-guide/uipath-zoho-desk"
|
|
28697
29002
|
}
|
|
28698
29003
|
]
|
|
28699
29004
|
}
|
|
@@ -29504,6 +29809,105 @@ function setMethodParameters(metadataNode, httpMethod, parameters) {
|
|
|
29504
29809
|
return cloned;
|
|
29505
29810
|
}
|
|
29506
29811
|
|
|
29812
|
+
// src/helpers/scripts-execute.ts
|
|
29813
|
+
var MODE_FLAGS = ["--inline-script", "--script-ref"];
|
|
29814
|
+
function validateMode(options) {
|
|
29815
|
+
if (!options.connectionId) {
|
|
29816
|
+
return {
|
|
29817
|
+
message: "Missing required option '--connection-id'",
|
|
29818
|
+
instructions: "Provide a connection ID: uip is connections list <connector-key> --all-folders"
|
|
29819
|
+
};
|
|
29820
|
+
}
|
|
29821
|
+
const given = [
|
|
29822
|
+
options.inlineScript !== undefined,
|
|
29823
|
+
options.scriptRef !== undefined
|
|
29824
|
+
].filter(Boolean).length;
|
|
29825
|
+
if (given === 0) {
|
|
29826
|
+
return {
|
|
29827
|
+
message: `Provide exactly one of ${MODE_FLAGS.join(", ")}`,
|
|
29828
|
+
instructions: "Use --inline-script for local script source, or --script-ref for a published script."
|
|
29829
|
+
};
|
|
29830
|
+
}
|
|
29831
|
+
if (given > 1) {
|
|
29832
|
+
return {
|
|
29833
|
+
message: `Only one of ${MODE_FLAGS.join(", ")} may be given`,
|
|
29834
|
+
instructions: "Only one script runs per call. Drop the extra flag."
|
|
29835
|
+
};
|
|
29836
|
+
}
|
|
29837
|
+
if (options.scriptRef !== undefined && !options.connectorKey) {
|
|
29838
|
+
return {
|
|
29839
|
+
message: "--script-ref requires --connector-key",
|
|
29840
|
+
instructions: "A published script is resolved by connector key and cross-checked against the connection. Add --connector-key <key>."
|
|
29841
|
+
};
|
|
29842
|
+
}
|
|
29843
|
+
return;
|
|
29844
|
+
}
|
|
29845
|
+
async function readInlineScript(value) {
|
|
29846
|
+
if (value.endsWith(".js")) {
|
|
29847
|
+
const fs3 = getFileSystem();
|
|
29848
|
+
const source = await fs3.readFile(value, "utf-8");
|
|
29849
|
+
if (source === null || source === undefined) {
|
|
29850
|
+
throw new Error(`script file not found: ${value}`);
|
|
29851
|
+
}
|
|
29852
|
+
return source;
|
|
29853
|
+
}
|
|
29854
|
+
return value;
|
|
29855
|
+
}
|
|
29856
|
+
function parseQuery(raw) {
|
|
29857
|
+
if (!raw) {
|
|
29858
|
+
return;
|
|
29859
|
+
}
|
|
29860
|
+
if (raw.trimStart().startsWith("{")) {
|
|
29861
|
+
return JSON.parse(raw);
|
|
29862
|
+
}
|
|
29863
|
+
const out = {};
|
|
29864
|
+
for (const pair of raw.split("&")) {
|
|
29865
|
+
if (!pair) {
|
|
29866
|
+
continue;
|
|
29867
|
+
}
|
|
29868
|
+
const eq = pair.indexOf("=");
|
|
29869
|
+
if (eq === -1) {
|
|
29870
|
+
out[pair] = "";
|
|
29871
|
+
continue;
|
|
29872
|
+
}
|
|
29873
|
+
out[pair.slice(0, eq)] = pair.slice(eq + 1);
|
|
29874
|
+
}
|
|
29875
|
+
return out;
|
|
29876
|
+
}
|
|
29877
|
+
function parseHeaders2(raw) {
|
|
29878
|
+
if (!raw || raw.length === 0) {
|
|
29879
|
+
return;
|
|
29880
|
+
}
|
|
29881
|
+
const out = {};
|
|
29882
|
+
for (const entry of raw) {
|
|
29883
|
+
const eq = entry.indexOf("=");
|
|
29884
|
+
if (eq > 0) {
|
|
29885
|
+
out[entry.slice(0, eq)] = entry.slice(eq + 1);
|
|
29886
|
+
}
|
|
29887
|
+
}
|
|
29888
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
29889
|
+
}
|
|
29890
|
+
function buildExecuteInput(options, inlineSource) {
|
|
29891
|
+
const query = parseQuery(options.query);
|
|
29892
|
+
const headers = parseHeaders2(options.header);
|
|
29893
|
+
const input = {
|
|
29894
|
+
connectionId: options.connectionId,
|
|
29895
|
+
connectorKey: options.connectorKey,
|
|
29896
|
+
tenant: options.tenant
|
|
29897
|
+
};
|
|
29898
|
+
if (inlineSource !== undefined) {
|
|
29899
|
+
input.inlineScript = inlineSource;
|
|
29900
|
+
} else {
|
|
29901
|
+
input.scriptRef = options.scriptRef;
|
|
29902
|
+
}
|
|
29903
|
+
input.request = {
|
|
29904
|
+
body: options.body ? JSON.parse(options.body) : undefined,
|
|
29905
|
+
query,
|
|
29906
|
+
headers
|
|
29907
|
+
};
|
|
29908
|
+
return input;
|
|
29909
|
+
}
|
|
29910
|
+
|
|
29507
29911
|
// src/commands/resources.ts
|
|
29508
29912
|
var VALID_OPERATIONS = "List, Retrieve, Create, Update, Delete, Replace";
|
|
29509
29913
|
var RESOURCES_LIST_EXAMPLES = [
|
|
@@ -29537,7 +29941,7 @@ var RESOURCES_LIST_EXAMPLES = [
|
|
|
29537
29941
|
];
|
|
29538
29942
|
var RESOURCES_DESCRIBE_EXAMPLES = [
|
|
29539
29943
|
{
|
|
29540
|
-
Description: "Describe a 4.0.0 activity by
|
|
29944
|
+
Description: "Describe a 4.0.0 activity by object name (v4 elements endpoints)",
|
|
29541
29945
|
Command: "uip is resources describe uipath-salesforce-slack add_users_to_usergroup --activity-version 4.0.0",
|
|
29542
29946
|
Output: {
|
|
29543
29947
|
Code: "ResourceMetadata",
|
|
@@ -29939,6 +30343,84 @@ async function handleExecuteAction(connectorKey, objectName, httpMethod, normali
|
|
|
29939
30343
|
}, { preserveDataKeys: true });
|
|
29940
30344
|
}
|
|
29941
30345
|
}
|
|
30346
|
+
var RUN_SCRIPT_EXAMPLES = [
|
|
30347
|
+
{
|
|
30348
|
+
Description: "Run a local action script against a connection",
|
|
30349
|
+
Command: `uip is resources run script --connection-id 849e85d8-1aa9-4d52-8bbd-20041c8f05d8 --inline-script ./ChannelArchive.js --body '{"channel":"C0A66HP9KKM"}'`,
|
|
30350
|
+
Output: {
|
|
30351
|
+
Code: "ScriptExecuted",
|
|
30352
|
+
Data: {
|
|
30353
|
+
Status: 200,
|
|
30354
|
+
Headers: { "content-type": "application/json" },
|
|
30355
|
+
Body: { ok: true, channel: "C0A66HP9KKM" }
|
|
30356
|
+
}
|
|
30357
|
+
}
|
|
30358
|
+
},
|
|
30359
|
+
{
|
|
30360
|
+
Description: "Run a published script by reference (needs the connector key)",
|
|
30361
|
+
Command: "uip is resources run script --connection-id 675e641b-70e1-401d-b652-568dfd03c1d2 --connector-key uipath-salesforce-slack --script-ref list_usergroups --query pageSize=1000",
|
|
30362
|
+
Output: {
|
|
30363
|
+
Code: "ScriptExecuted",
|
|
30364
|
+
Data: {
|
|
30365
|
+
Status: 200,
|
|
30366
|
+
Headers: { "content-type": "application/json" },
|
|
30367
|
+
Body: [
|
|
30368
|
+
{
|
|
30369
|
+
id: "SM81EET33",
|
|
30370
|
+
name: "Japan Product Translation",
|
|
30371
|
+
handle: "jp-pt-group"
|
|
30372
|
+
}
|
|
30373
|
+
]
|
|
30374
|
+
}
|
|
30375
|
+
}
|
|
30376
|
+
}
|
|
30377
|
+
];
|
|
30378
|
+
async function handleScriptAction(options) {
|
|
30379
|
+
const modeError = validateMode(options);
|
|
30380
|
+
if (modeError) {
|
|
30381
|
+
OutputFormatter.error({
|
|
30382
|
+
Result: RESULTS.ValidationError,
|
|
30383
|
+
Message: modeError.message,
|
|
30384
|
+
Instructions: modeError.instructions
|
|
30385
|
+
});
|
|
30386
|
+
processContext.exit(3);
|
|
30387
|
+
return;
|
|
30388
|
+
}
|
|
30389
|
+
let inlineSource;
|
|
30390
|
+
if (options.inlineScript !== undefined) {
|
|
30391
|
+
const [readError, source] = await catchError(readInlineScript(options.inlineScript));
|
|
30392
|
+
if (readError) {
|
|
30393
|
+
OutputFormatter.error({
|
|
30394
|
+
Result: RESULTS.Failure,
|
|
30395
|
+
Message: `Could not read the script: ${readError.message}`,
|
|
30396
|
+
Instructions: "Check the .js path, or pass the source directly."
|
|
30397
|
+
});
|
|
30398
|
+
processContext.exit(1);
|
|
30399
|
+
return;
|
|
30400
|
+
}
|
|
30401
|
+
inlineSource = source;
|
|
30402
|
+
}
|
|
30403
|
+
logger.info(`Executing script against connection ${options.connectionId}`);
|
|
30404
|
+
const [execError, result] = await catchError(executeRequest(buildExecuteInput(options, inlineSource)));
|
|
30405
|
+
if (execError) {
|
|
30406
|
+
OutputFormatter.error({
|
|
30407
|
+
Result: RESULTS.Failure,
|
|
30408
|
+
Message: `Could not reach Integration Service: ${execError.message}`,
|
|
30409
|
+
Instructions: "Check your network and login (uip login), then retry."
|
|
30410
|
+
});
|
|
30411
|
+
processContext.exit(1);
|
|
30412
|
+
return;
|
|
30413
|
+
}
|
|
30414
|
+
OutputFormatter.success({
|
|
30415
|
+
Result: RESULTS.Success,
|
|
30416
|
+
Code: "ScriptExecuted",
|
|
30417
|
+
Data: {
|
|
30418
|
+
Status: result.status,
|
|
30419
|
+
Headers: result.headers,
|
|
30420
|
+
Body: result.body
|
|
30421
|
+
}
|
|
30422
|
+
});
|
|
30423
|
+
}
|
|
29942
30424
|
var registerResourcesCommand = (program2) => {
|
|
29943
30425
|
const resources = program2.command("resources").description("Manage UiPath Integration Service resources");
|
|
29944
30426
|
resources.command("list").description("List available objects for a connector").argument("<connector-key>", "Connector key").option("--operation <operation>", `Filter by operation (${VALID_OPERATIONS})`).option("--connection-id <id>", "Connection/Instance ID").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--refresh", "Force re-fetch from API, ignoring cache").examples(RESOURCES_LIST_EXAMPLES).trackedAction(processContext, async (connectorKey, options) => {
|
|
@@ -30002,7 +30484,7 @@ var registerResourcesCommand = (program2) => {
|
|
|
30002
30484
|
})();
|
|
30003
30485
|
OutputFormatter.emitList("ResourceList", formatResourceList(filtered), { emptyInstructions, warning });
|
|
30004
30486
|
});
|
|
30005
|
-
resources.command("describe").description("Describe object fields and operations").argument("<connector-key>", "Connector key").argument("<object-name>", "Object name
|
|
30487
|
+
resources.command("describe").description("Describe object fields and operations").argument("<connector-key>", "Connector key").argument("<object-name>", "Object name (the `objectName` from the activity's configuration JSON).").option("--connection-id <id>", "Connection/Instance ID").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--operation <operation>", `Filter to a single operation (${VALID_OPERATIONS})`).option("--activity-version <version>", "Activity metadata version: 1.0.0 (default, v3 elements endpoints, connection-scoped) or 4.0.0 (v4 elements endpoints, not connection-scoped). Both are addressed by object name.").option("--refresh", "Force re-fetch from API, ignoring cache").option("-f, --field <name=value>", "Parent-field value (repeatable) — runs the api-type ObjectAction (e.g. Jira GenerateSchema, Salesforce GenerateQuerySchema) and merges its custom-field response into requestFields. Requires --connection-id and --operation. If the result comes back holding only the fields you supplied, the response carries a Warning: one of the values does not exist on the connection.", (value, prev = []) => [...prev, value], []).option("--action <name>", "Explicit api-type ObjectAction name (e.g. GenerateSchema). Optional — inferred from --field rules when omitted.").examples(RESOURCES_DESCRIBE_EXAMPLES).trackedAction(processContext, async (connectorKey, objectName, options) => {
|
|
30006
30488
|
if (options.activityVersion && !SUPPORTED_ACTIVITY_VERSIONS.includes(options.activityVersion)) {
|
|
30007
30489
|
OutputFormatter.error({
|
|
30008
30490
|
Result: RESULTS.Failure,
|
|
@@ -30150,7 +30632,7 @@ var registerResourcesCommand = (program2) => {
|
|
|
30150
30632
|
}
|
|
30151
30633
|
emitResourceMetadata(metadataRecord, operation?.name, parentOnlyWarning);
|
|
30152
30634
|
});
|
|
30153
|
-
const execute = resources.command("run").description("Run data operations on a connector");
|
|
30635
|
+
const execute = resources.command("run").description("Run data operations on a connector, or an activity script against a connection");
|
|
30154
30636
|
addExecuteOptions(execute.command("create").description("Create a new record").argument("<connector-key>", "Connector key").argument("<object-name>", "Object name")).option("--body <json>", "Request body as JSON (required)").examples(RESOURCES_EXECUTE_CREATE_EXAMPLES).trackedAction(processContext, (c, o, opts) => handleExecuteAction(c, o, "POST", "POST", opts, true));
|
|
30155
30637
|
addExecuteOptions(execute.command("list").description("List all records").argument("<connector-key>", "Connector key").argument("<object-name>", "Object name")).examples(RESOURCES_EXECUTE_LIST_EXAMPLES).trackedAction(processContext, (c, o, opts) => handleExecuteAction(c, o, "GET", "GET", opts, false));
|
|
30156
30638
|
addExecuteOptions(execute.command("get").description("Get a record by ID").argument("<connector-key>", "Connector key").argument("<object-name>", "Object name")).examples(RESOURCES_EXECUTE_GET_EXAMPLES).trackedAction(processContext, (c, o, opts) => handleExecuteAction(c, o, "GET", "GETBYID", opts, false));
|
|
@@ -30161,6 +30643,7 @@ var registerResourcesCommand = (program2) => {
|
|
|
30161
30643
|
return;
|
|
30162
30644
|
await handleExecuteAction(c, o, "DELETE", "DELETE", opts, false);
|
|
30163
30645
|
});
|
|
30646
|
+
execute.command("script").description("Run an action script against a connection").option("--connection-id <id>", "Connection/Instance ID (required)").option("--connector-key <key>", "Connector key (required with --script-ref)").option("--inline-script <source>", "JavaScript source, or a path ending in .js to read a file").option("--script-ref <name>", "A published script's reference").option("--body <json>", "Script input, read by the script as context.request.body").option("--query <params>", "Query parameters (key=value&key=value or JSON)").option("--header <headers...>", "Request headers as name=value").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).examples(RUN_SCRIPT_EXAMPLES).trackedAction(processContext, handleScriptAction);
|
|
30164
30647
|
};
|
|
30165
30648
|
// src/commands/triggers.ts
|
|
30166
30649
|
var TRIGGERS_OBJECTS_EXAMPLES = [
|
|
@@ -30642,4 +31125,4 @@ var registerCommands = async (program2) => {
|
|
|
30642
31125
|
|
|
30643
31126
|
export { Command, metadata, registerCommands };
|
|
30644
31127
|
|
|
30645
|
-
//# debugId=
|
|
31128
|
+
//# debugId=5DFA468B35CB7BFB64756E2164756E21
|
package/dist/tool.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/integrationservice-tool",
|
|
3
|
+
"author": "UiPath",
|
|
3
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
4
|
-
"version": "1.
|
|
5
|
+
"version": "1.203.0-preview.160",
|
|
5
6
|
"description": "Manage Integration Service connectors, connections, and triggers.",
|
|
6
7
|
"private": false,
|
|
7
8
|
"repository": {
|
|
@@ -26,5 +27,5 @@
|
|
|
26
27
|
"files": [
|
|
27
28
|
"dist"
|
|
28
29
|
],
|
|
29
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "3a42062ba731afca4595ba9aa8a80afc9667528d"
|
|
30
31
|
}
|