@uipath/integrationservice-tool 0.1.5 → 0.1.7
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 +435 -435
- package/dist/index.js +183 -118
- package/dist/tool.js +514 -379
- package/package.json +49 -49
package/dist/tool.js
CHANGED
|
@@ -4,25 +4,43 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
function __accessProp(key) {
|
|
8
|
+
return this[key];
|
|
9
|
+
}
|
|
10
|
+
var __toESMCache_node;
|
|
11
|
+
var __toESMCache_esm;
|
|
7
12
|
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
+
var canCache = mod != null && typeof mod === "object";
|
|
14
|
+
if (canCache) {
|
|
15
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
+
var cached = cache.get(mod);
|
|
17
|
+
if (cached)
|
|
18
|
+
return cached;
|
|
19
|
+
}
|
|
8
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
9
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
10
22
|
for (let key of __getOwnPropNames(mod))
|
|
11
23
|
if (!__hasOwnProp.call(to, key))
|
|
12
24
|
__defProp(to, key, {
|
|
13
|
-
get: (
|
|
25
|
+
get: __accessProp.bind(mod, key),
|
|
14
26
|
enumerable: true
|
|
15
27
|
});
|
|
28
|
+
if (canCache)
|
|
29
|
+
cache.set(mod, to);
|
|
16
30
|
return to;
|
|
17
31
|
};
|
|
18
32
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
|
+
var __returnValue = (v) => v;
|
|
34
|
+
function __exportSetter(name, newValue) {
|
|
35
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
36
|
+
}
|
|
19
37
|
var __export = (target, all) => {
|
|
20
38
|
for (var name in all)
|
|
21
39
|
__defProp(target, name, {
|
|
22
40
|
get: all[name],
|
|
23
41
|
enumerable: true,
|
|
24
42
|
configurable: true,
|
|
25
|
-
set: (
|
|
43
|
+
set: __exportSetter.bind(all, name)
|
|
26
44
|
});
|
|
27
45
|
};
|
|
28
46
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -4662,7 +4680,7 @@ class SimpleLogger {
|
|
|
4662
4680
|
return 0 /* DEBUG */;
|
|
4663
4681
|
}
|
|
4664
4682
|
} catch {}
|
|
4665
|
-
return
|
|
4683
|
+
return DEFAULT_LOG_LEVEL;
|
|
4666
4684
|
}
|
|
4667
4685
|
static parseLevel(value) {
|
|
4668
4686
|
switch (value.toLowerCase()) {
|
|
@@ -4795,7 +4813,7 @@ class SimpleLogger {
|
|
|
4795
4813
|
function getLogFilePath() {
|
|
4796
4814
|
return logger.getLogFilePath();
|
|
4797
4815
|
}
|
|
4798
|
-
var GLOBAL_KEY = "__uipcli_log_file_path__", logger;
|
|
4816
|
+
var GLOBAL_KEY = "__uipcli_log_file_path__", DEFAULT_LOG_LEVEL = 3 /* ERROR */, logger;
|
|
4799
4817
|
var init_logger = __esm(() => {
|
|
4800
4818
|
init_output_context();
|
|
4801
4819
|
logger = SimpleLogger.getInstance();
|
|
@@ -5066,7 +5084,7 @@ var init_telemetry = __esm(() => {
|
|
|
5066
5084
|
init_logger_telemetry_provider();
|
|
5067
5085
|
init_node_appinsights_telemetry_provider();
|
|
5068
5086
|
sessionId = getOrCreateSessionId();
|
|
5069
|
-
DEFAULT_AI_CONNECTION_STRING = Buffer.from("
|
|
5087
|
+
DEFAULT_AI_CONNECTION_STRING = Buffer.from("SW5zdHJ1bWVudGF0aW9uS2V5PTliZDM3NDgyLTgxMGUtNDQyYS1hYWE2LWQzOGVmNjVjNjY3NDtJbmdlc3Rpb25FbmRwb2ludD1odHRwczovL3dlc3RldXJvcGUtNS5pbi5hcHBsaWNhdGlvbmluc2lnaHRzLmF6dXJlLmNvbS87TGl2ZUVuZHBvaW50PWh0dHBzOi8vd2VzdGV1cm9wZS5saXZlZGlhZ25vc3RpY3MubW9uaXRvci5henVyZS5jb20vO0FwcGxpY2F0aW9uSWQ9MzU2OTdlZjEtOGJkMC00ZjE5LWEyN2MtZDg3Y2NhYzY2ZDJj", "base64").toString("utf-8");
|
|
5070
5088
|
telemetry = new Proxy({}, {
|
|
5071
5089
|
get(_, prop) {
|
|
5072
5090
|
const instance = getTelemetryInstance();
|
|
@@ -5080,7 +5098,7 @@ var init_telemetry = __esm(() => {
|
|
|
5080
5098
|
var CommonTelemetryEvents;
|
|
5081
5099
|
var init_telemetry_events = __esm(() => {
|
|
5082
5100
|
CommonTelemetryEvents = {
|
|
5083
|
-
Error: "
|
|
5101
|
+
Error: "uip.error"
|
|
5084
5102
|
};
|
|
5085
5103
|
});
|
|
5086
5104
|
|
|
@@ -5131,11 +5149,6 @@ function logOutput(data, format = "table") {
|
|
|
5131
5149
|
printOutput(data, format, (msg) => sink.writeOut(`${msg}
|
|
5132
5150
|
`));
|
|
5133
5151
|
}
|
|
5134
|
-
function errorOutput(data, format = "table") {
|
|
5135
|
-
const sink = getOutputSink();
|
|
5136
|
-
printOutput(data, format, (msg) => sink.writeErr(`${msg}
|
|
5137
|
-
`));
|
|
5138
|
-
}
|
|
5139
5152
|
function printTable(data, logFn = console.log, externalLogValue) {
|
|
5140
5153
|
if (data.length === 0)
|
|
5141
5154
|
return;
|
|
@@ -5198,7 +5211,7 @@ var init_formatter = __esm(() => {
|
|
|
5198
5211
|
result: data.Result,
|
|
5199
5212
|
message: data.Message
|
|
5200
5213
|
});
|
|
5201
|
-
|
|
5214
|
+
logOutput(data, getOutputFormat());
|
|
5202
5215
|
}
|
|
5203
5216
|
OutputFormatter.error = error;
|
|
5204
5217
|
function log(data) {
|
|
@@ -5236,6 +5249,12 @@ var init_command_help = __esm(() => {
|
|
|
5236
5249
|
init_output_format_context();
|
|
5237
5250
|
});
|
|
5238
5251
|
|
|
5252
|
+
// ../common/src/constants.ts
|
|
5253
|
+
var UIPATH_HOME_DIR = ".uipath", AUTH_FILENAME = ".auth", CONFIG_FILENAME = "config.json", LOCAL_CONFIG_FILENAME = "uipath.config.json", DEFAULT_BASE_URL = "https://cloud.uipath.com", DEFAULT_AUTH_TIMEOUT_MS;
|
|
5254
|
+
var init_constants = __esm(() => {
|
|
5255
|
+
DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
|
|
5256
|
+
});
|
|
5257
|
+
|
|
5239
5258
|
// ../../node_modules/jsonpath-plus/dist/index-node-esm.js
|
|
5240
5259
|
import vm from "vm";
|
|
5241
5260
|
|
|
@@ -6642,12 +6661,35 @@ var init_jsonpath = __esm(() => {
|
|
|
6642
6661
|
});
|
|
6643
6662
|
// ../common/src/trackedAction.ts
|
|
6644
6663
|
import { Command } from "commander";
|
|
6664
|
+
function deriveCommandPath(cmd) {
|
|
6665
|
+
const parts = [];
|
|
6666
|
+
let current = cmd;
|
|
6667
|
+
while (current) {
|
|
6668
|
+
const name = current.name();
|
|
6669
|
+
if (name) {
|
|
6670
|
+
parts.unshift(name);
|
|
6671
|
+
}
|
|
6672
|
+
current = current.parent;
|
|
6673
|
+
}
|
|
6674
|
+
if (parts.length > 1) {
|
|
6675
|
+
parts.shift();
|
|
6676
|
+
}
|
|
6677
|
+
return ["uip", ...parts.filter((p) => p !== "uip")].join(".");
|
|
6678
|
+
}
|
|
6679
|
+
var processContext;
|
|
6645
6680
|
var init_trackedAction = __esm(() => {
|
|
6646
6681
|
init_formatter();
|
|
6647
6682
|
init_logger();
|
|
6648
6683
|
init_telemetry();
|
|
6649
|
-
|
|
6684
|
+
processContext = {
|
|
6685
|
+
exit: (code) => {
|
|
6686
|
+
process.exitCode = code;
|
|
6687
|
+
}
|
|
6688
|
+
};
|
|
6689
|
+
Command.prototype.trackedAction = function(context, fn, properties) {
|
|
6690
|
+
const command = this;
|
|
6650
6691
|
return this.action(async (...args) => {
|
|
6692
|
+
const telemetryName = deriveCommandPath(command);
|
|
6651
6693
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
6652
6694
|
const startTime = performance.now();
|
|
6653
6695
|
let errorMessage;
|
|
@@ -6678,6 +6720,7 @@ var init_trackedAction = __esm(() => {
|
|
|
6678
6720
|
var init_src = __esm(() => {
|
|
6679
6721
|
init_node_appinsights_telemetry_provider();
|
|
6680
6722
|
init_command_help();
|
|
6723
|
+
init_constants();
|
|
6681
6724
|
init_formatter();
|
|
6682
6725
|
init_jsonpath();
|
|
6683
6726
|
init_logger();
|
|
@@ -6685,7 +6728,6 @@ var init_src = __esm(() => {
|
|
|
6685
6728
|
init_output_format_context();
|
|
6686
6729
|
init_registry();
|
|
6687
6730
|
init_telemetry();
|
|
6688
|
-
init_telemetry_events();
|
|
6689
6731
|
init_trackedAction();
|
|
6690
6732
|
});
|
|
6691
6733
|
|
|
@@ -7516,8 +7558,8 @@ var require_src = __commonJS((exports, module) => {
|
|
|
7516
7558
|
// package.json
|
|
7517
7559
|
var package_default = {
|
|
7518
7560
|
name: "@uipath/integrationservice-tool",
|
|
7519
|
-
version: "0.1.
|
|
7520
|
-
description: "
|
|
7561
|
+
version: "0.1.7",
|
|
7562
|
+
description: "Manage Integration Service connectors, connections, and triggers.",
|
|
7521
7563
|
private: false,
|
|
7522
7564
|
maintainers: [
|
|
7523
7565
|
"aoltean16",
|
|
@@ -7530,7 +7572,7 @@ var package_default = {
|
|
|
7530
7572
|
directory: "packages/integrationservice-tool"
|
|
7531
7573
|
},
|
|
7532
7574
|
publishConfig: {
|
|
7533
|
-
registry: "https://
|
|
7575
|
+
registry: "https://registry.npmjs.org/"
|
|
7534
7576
|
},
|
|
7535
7577
|
keywords: [
|
|
7536
7578
|
"uipcli-tool"
|
|
@@ -13836,6 +13878,12 @@ class ElementsApi extends BaseAPI2 {
|
|
|
13836
13878
|
await this.upsertActivityPackVersionRaw(requestParameters, initOverrides);
|
|
13837
13879
|
}
|
|
13838
13880
|
}
|
|
13881
|
+
// ../auth/src/index.ts
|
|
13882
|
+
init_src();
|
|
13883
|
+
|
|
13884
|
+
// ../auth/src/config.ts
|
|
13885
|
+
init_src();
|
|
13886
|
+
|
|
13839
13887
|
// ../auth/src/utils/loadConfig.ts
|
|
13840
13888
|
init_src();
|
|
13841
13889
|
|
|
@@ -27422,11 +27470,11 @@ var loadConfigAsync = async () => {
|
|
|
27422
27470
|
const fs7 = await getFs();
|
|
27423
27471
|
let configPath = fs7.env.getenv("UIPATH_CONFIG_PATH");
|
|
27424
27472
|
if (!configPath) {
|
|
27425
|
-
const localPath = fs7.path.join(fs7.env.cwd(),
|
|
27473
|
+
const localPath = fs7.path.join(fs7.env.cwd(), LOCAL_CONFIG_FILENAME);
|
|
27426
27474
|
if (await fs7.exists(localPath)) {
|
|
27427
27475
|
configPath = localPath;
|
|
27428
27476
|
} else {
|
|
27429
|
-
configPath = fs7.path.join(fs7.env.homedir(),
|
|
27477
|
+
configPath = fs7.path.join(fs7.env.homedir(), UIPATH_HOME_DIR, CONFIG_FILENAME);
|
|
27430
27478
|
}
|
|
27431
27479
|
}
|
|
27432
27480
|
if (!await fs7.exists(configPath)) {
|
|
@@ -27459,7 +27507,6 @@ Please ensure your config file contains valid JSON.`;
|
|
|
27459
27507
|
};
|
|
27460
27508
|
|
|
27461
27509
|
// ../auth/src/config.ts
|
|
27462
|
-
var DEFAULT_BASE_URL = "https://cloud.uipath.com";
|
|
27463
27510
|
var DEFAULT_CLIENT_ID = "36dea5b8-e8bb-423d-8e7b-c808df8f1c00";
|
|
27464
27511
|
|
|
27465
27512
|
class InvalidBaseUrlError extends Error {
|
|
@@ -27554,10 +27601,10 @@ init_src2();
|
|
|
27554
27601
|
|
|
27555
27602
|
// ../auth/src/telemetry-events.ts
|
|
27556
27603
|
var AuthTelemetryEvents = {
|
|
27557
|
-
Login: "
|
|
27558
|
-
TenantSelected: "
|
|
27559
|
-
TokenRefresh: "
|
|
27560
|
-
Logout: "
|
|
27604
|
+
Login: "uip.auth.login",
|
|
27605
|
+
TenantSelected: "uip.auth.tenant-selected",
|
|
27606
|
+
TokenRefresh: "uip.auth.token-refresh",
|
|
27607
|
+
Logout: "uip.auth.logout"
|
|
27561
27608
|
};
|
|
27562
27609
|
|
|
27563
27610
|
// ../auth/src/tenantSelection.ts
|
|
@@ -28078,9 +28125,7 @@ var Qe = `${t("gray", h)} `;
|
|
|
28078
28125
|
// ../auth/src/utils/envFile.ts
|
|
28079
28126
|
init_src();
|
|
28080
28127
|
init_src2();
|
|
28081
|
-
var
|
|
28082
|
-
var DEFAULT_AUTH_DIR = ".uipath";
|
|
28083
|
-
var DEFAULT_ENV_FILENAME = `${DEFAULT_AUTH_DIR}/${DEFAULT_AUTH_FILENAME}`;
|
|
28128
|
+
var DEFAULT_ENV_FILENAME = `${UIPATH_HOME_DIR}/${AUTH_FILENAME}`;
|
|
28084
28129
|
var resolveEnvFilePathAsync = async (envFilePath = DEFAULT_ENV_FILENAME) => {
|
|
28085
28130
|
const fs7 = getFileSystem();
|
|
28086
28131
|
if (fs7.path.isAbsolute(envFilePath)) {
|
|
@@ -28453,10 +28498,11 @@ var SWAGGER_DIR = join2(process.cwd(), "swagger");
|
|
|
28453
28498
|
var HTTP_METHODS = new Set(["get", "post", "put", "patch", "delete"]);
|
|
28454
28499
|
if (false) {}
|
|
28455
28500
|
// src/utils/metadata-cache.ts
|
|
28501
|
+
init_src();
|
|
28456
28502
|
import * as fs7 from "node:fs/promises";
|
|
28457
28503
|
import * as os3 from "node:os";
|
|
28458
28504
|
import * as path3 from "node:path";
|
|
28459
|
-
var CACHE_BASE = path3.join(os3.homedir(),
|
|
28505
|
+
var CACHE_BASE = path3.join(os3.homedir(), UIPATH_HOME_DIR, "cache", "integrationservice");
|
|
28460
28506
|
var METHOD_TO_OPERATION = {
|
|
28461
28507
|
GET: "List",
|
|
28462
28508
|
GETBYID: "Retrieve",
|
|
@@ -28694,7 +28740,7 @@ async function readCachedTriggerMetadata(connectorKey, connectionId, operation,
|
|
|
28694
28740
|
// src/commands/activities.ts
|
|
28695
28741
|
var registerActivitiesCommand = (program) => {
|
|
28696
28742
|
const activities = program.command("activities").description("Manage UiPath Integration Service activities");
|
|
28697
|
-
activities.command("list").description("List activities for a connector (use --triggers for trigger activities only)").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--refresh", "Force re-fetch from API, ignoring cache").option("--triggers", "List trigger activities only (isTrigger=true)").
|
|
28743
|
+
activities.command("list").description("List activities for a connector (use --triggers for trigger activities only)").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--refresh", "Force re-fetch from API, ignoring cache").option("--triggers", "List trigger activities only (isTrigger=true)").trackedAction(processContext, async (connectorKey, options) => {
|
|
28698
28744
|
const isTriggerMode = options.triggers === true;
|
|
28699
28745
|
const modeLabel = isTriggerMode ? "trigger" : "non-trigger";
|
|
28700
28746
|
logger.info(`Listing ${modeLabel} activities for connector: ${connectorKey}${options.refresh ? " [refresh]" : ""}`);
|
|
@@ -28715,7 +28761,7 @@ var registerActivitiesCommand = (program) => {
|
|
|
28715
28761
|
Message: "Error creating API client",
|
|
28716
28762
|
Instructions: error48.message
|
|
28717
28763
|
});
|
|
28718
|
-
|
|
28764
|
+
processContext.exit(1);
|
|
28719
28765
|
return;
|
|
28720
28766
|
}
|
|
28721
28767
|
const [fetchError, fetched] = await catchError(api2.getActivities({
|
|
@@ -28727,7 +28773,7 @@ var registerActivitiesCommand = (program) => {
|
|
|
28727
28773
|
Message: `Error listing activities for connector '${connectorKey}'`,
|
|
28728
28774
|
Instructions: fetchError.message
|
|
28729
28775
|
});
|
|
28730
|
-
|
|
28776
|
+
processContext.exit(1);
|
|
28731
28777
|
return;
|
|
28732
28778
|
}
|
|
28733
28779
|
activitiesResponse = fetched;
|
|
@@ -28794,85 +28840,107 @@ async function extractErrorMessage(error48) {
|
|
|
28794
28840
|
// src/commands/connections.ts
|
|
28795
28841
|
var registerConnectionsCommand = (program) => {
|
|
28796
28842
|
const connections = program.command("connections").description("Manage UiPath Integration Service connections");
|
|
28797
|
-
connections.command("list").description("List connections. Without a connector key, lists all connections across all connectors.").argument("[connector-key]", "Connector key to filter by (e.g., uipath-salesforce-sfdc)").option("--folder-key <key>", "Folder key (x-uipath-folderkey) to filter connections by folder (optional)").option("--connection-id <id>", "Filter results to a specific connection ID (optional)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--refresh", "Force re-fetch from API, ignoring cache").
|
|
28798
|
-
|
|
28799
|
-
|
|
28800
|
-
|
|
28801
|
-
|
|
28802
|
-
|
|
28843
|
+
connections.command("list").description("List connections. Without a connector key, lists all connections across all connectors.").argument("[connector-key]", "Connector key to filter by (e.g., uipath-salesforce-sfdc)").option("--folder-key <key>", "Folder key (x-uipath-folderkey) to filter connections by folder (optional)").option("--connection-id <id>", "Filter results to a specific connection ID (optional)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--refresh", "Force re-fetch from API, ignoring cache").trackedAction(processContext, async (connectorKey, options) => {
|
|
28844
|
+
logger.info(`Listing connections${connectorKey ? ` for connector: ${connectorKey}` : " (all connectors)"}${options.folderKey ? ` in folder: ${options.folderKey}` : ""}${options.connectionId ? ` filter by ID: ${options.connectionId}` : ""}${options.refresh ? " [refresh]" : ""}`);
|
|
28845
|
+
let connections2 = null;
|
|
28846
|
+
const [configError, config2] = await catchError(createConnectionsConfig({
|
|
28847
|
+
tenant: options.tenant
|
|
28848
|
+
}));
|
|
28849
|
+
if (configError) {
|
|
28850
|
+
OutputFormatter.error({
|
|
28851
|
+
Result: "Failure",
|
|
28852
|
+
Message: "Error listing connections",
|
|
28853
|
+
Instructions: configError.message
|
|
28803
28854
|
});
|
|
28804
|
-
|
|
28805
|
-
|
|
28806
|
-
|
|
28807
|
-
|
|
28808
|
-
|
|
28809
|
-
|
|
28855
|
+
processContext.exit(1);
|
|
28856
|
+
return;
|
|
28857
|
+
}
|
|
28858
|
+
if (connectorKey) {
|
|
28859
|
+
if (!options.refresh && !options.folderKey) {
|
|
28860
|
+
connections2 = await readCachedConnections(connectorKey);
|
|
28861
|
+
if (connections2) {
|
|
28862
|
+
logger.info(`Loaded ${connections2.length} connections from cache`);
|
|
28810
28863
|
}
|
|
28811
|
-
|
|
28812
|
-
|
|
28813
|
-
|
|
28814
|
-
|
|
28815
|
-
|
|
28816
|
-
|
|
28817
|
-
}
|
|
28864
|
+
}
|
|
28865
|
+
if (!connections2) {
|
|
28866
|
+
const connectorsApi = new ConnectorsApi(config2);
|
|
28867
|
+
const [fetchError, fetched] = await catchError(connectorsApi.apiV1ConnectorsKeyOrIdConnectionsGet({ keyOrId: connectorKey }, folderOverride(options.folderKey)));
|
|
28868
|
+
if (fetchError) {
|
|
28869
|
+
const errorMessage = await extractErrorMessage(fetchError);
|
|
28870
|
+
logger.error(`Error listing connections: ${errorMessage}`);
|
|
28871
|
+
OutputFormatter.error({
|
|
28872
|
+
Result: "Failure",
|
|
28873
|
+
Message: errorMessage,
|
|
28874
|
+
Instructions: fetchError.message
|
|
28875
|
+
});
|
|
28876
|
+
processContext.exit(1);
|
|
28877
|
+
return;
|
|
28818
28878
|
}
|
|
28819
|
-
|
|
28820
|
-
const connectionsApi = new ConnectionsApi(config2);
|
|
28821
|
-
connections2 = await connectionsApi.apiV1ConnectionsGet({}, folderOverride(options.folderKey));
|
|
28879
|
+
connections2 = fetched;
|
|
28822
28880
|
logger.info(`Fetched ${connections2?.length ?? 0} connections from API`);
|
|
28823
|
-
|
|
28824
|
-
|
|
28825
|
-
connections2 = connections2.filter((c) => c.id === options.connectionId);
|
|
28826
|
-
}
|
|
28827
|
-
if (connections2 && connections2.length > 0) {
|
|
28828
|
-
logger.info(`Returning ${connections2.length} connections: ${JSON.stringify(connections2)}`);
|
|
28829
|
-
const data = connections2.map((conn) => ({
|
|
28830
|
-
Id: conn.id,
|
|
28831
|
-
Name: conn.name,
|
|
28832
|
-
ConnectorKey: conn.connector?.key || conn.connectorKey || "",
|
|
28833
|
-
ConnectorName: conn.connector?.name || conn.connectorName || "",
|
|
28834
|
-
State: conn.state,
|
|
28835
|
-
Owner: conn.owner,
|
|
28836
|
-
IsDefault: conn.isDefault ? "Yes" : "No",
|
|
28837
|
-
Folder: conn.folder?.name || conn.folderName || "",
|
|
28838
|
-
FolderKey: conn.folder?.key || conn.folderKey || "",
|
|
28839
|
-
Created: conn.createTime ? new Date(conn.createTime).toISOString() : "",
|
|
28840
|
-
Updated: conn.updateTime ? new Date(conn.updateTime).toISOString() : ""
|
|
28841
|
-
}));
|
|
28842
|
-
const disabledConnections = connections2.filter((c) => c.state !== "Enabled" && c.state !== "enabled");
|
|
28843
|
-
const result = {
|
|
28844
|
-
Result: "Success",
|
|
28845
|
-
Code: "ConnectionList",
|
|
28846
|
-
Data: data
|
|
28847
|
-
};
|
|
28848
|
-
if (disabledConnections.length === connections2.length) {
|
|
28849
|
-
result.Warning = "All connections are not enabled. Run 'uip is connections edit <connection-id>' to re-authenticate, or 'uip is connections create <connector-key>' to create a new connection.";
|
|
28850
|
-
} else if (disabledConnections.length > 0) {
|
|
28851
|
-
const disabledIds = disabledConnections.map((c) => c.id).join(", ");
|
|
28852
|
-
result.Warning = `Connection(s) not enabled: ${disabledIds}. Only Enabled connections can be used for operations. Run 'uip is connections edit <connection-id>' to re-authenticate.`;
|
|
28881
|
+
if (!options.folderKey && connections2 && connections2.length > 0) {
|
|
28882
|
+
await cacheConnections(connectorKey, connections2);
|
|
28853
28883
|
}
|
|
28854
|
-
|
|
28855
|
-
|
|
28856
|
-
|
|
28857
|
-
|
|
28884
|
+
}
|
|
28885
|
+
} else {
|
|
28886
|
+
const connectionsApi = new ConnectionsApi(config2);
|
|
28887
|
+
const [fetchError, fetched] = await catchError(connectionsApi.apiV1ConnectionsGet({}, folderOverride(options.folderKey)));
|
|
28888
|
+
if (fetchError) {
|
|
28889
|
+
const errorMessage = await extractErrorMessage(fetchError);
|
|
28890
|
+
logger.error(`Error listing connections: ${errorMessage}`);
|
|
28858
28891
|
OutputFormatter.error({
|
|
28859
28892
|
Result: "Failure",
|
|
28860
|
-
Message:
|
|
28861
|
-
Instructions:
|
|
28893
|
+
Message: errorMessage,
|
|
28894
|
+
Instructions: fetchError.message
|
|
28862
28895
|
});
|
|
28896
|
+
processContext.exit(1);
|
|
28897
|
+
return;
|
|
28863
28898
|
}
|
|
28864
|
-
|
|
28865
|
-
|
|
28866
|
-
|
|
28899
|
+
connections2 = fetched;
|
|
28900
|
+
logger.info(`Fetched ${connections2?.length ?? 0} connections from API`);
|
|
28901
|
+
}
|
|
28902
|
+
if (options.connectionId && connections2) {
|
|
28903
|
+
connections2 = connections2.filter((c) => c.id === options.connectionId);
|
|
28904
|
+
}
|
|
28905
|
+
if (connections2 && connections2.length > 0) {
|
|
28906
|
+
logger.info(`Returning ${connections2.length} connections: ${JSON.stringify(connections2)}`);
|
|
28907
|
+
const data = connections2.map((conn) => ({
|
|
28908
|
+
Id: conn.id,
|
|
28909
|
+
Name: conn.name,
|
|
28910
|
+
ConnectorKey: conn.connector?.key || conn.connectorKey || "",
|
|
28911
|
+
ConnectorName: conn.connector?.name || conn.connectorName || "",
|
|
28912
|
+
State: conn.state,
|
|
28913
|
+
Owner: conn.owner,
|
|
28914
|
+
IsDefault: conn.isDefault ? "Yes" : "No",
|
|
28915
|
+
Folder: conn.folder?.name || conn.folderName || "",
|
|
28916
|
+
FolderKey: conn.folder?.key || conn.folderKey || "",
|
|
28917
|
+
Created: conn.createTime ? new Date(conn.createTime).toISOString() : "",
|
|
28918
|
+
Updated: conn.updateTime ? new Date(conn.updateTime).toISOString() : ""
|
|
28919
|
+
}));
|
|
28920
|
+
const disabledConnections = connections2.filter((c) => c.state !== "Enabled" && c.state !== "enabled");
|
|
28921
|
+
const result = {
|
|
28922
|
+
Result: "Success",
|
|
28923
|
+
Code: "ConnectionList",
|
|
28924
|
+
Data: data
|
|
28925
|
+
};
|
|
28926
|
+
if (disabledConnections.length === connections2.length) {
|
|
28927
|
+
result.Warning = "All connections are not enabled. Run 'uip is connections edit <connection-id>' to re-authenticate, or 'uip is connections create <connector-key>' to create a new connection.";
|
|
28928
|
+
} else if (disabledConnections.length > 0) {
|
|
28929
|
+
const disabledIds = disabledConnections.map((c) => c.id).join(", ");
|
|
28930
|
+
result.Warning = `Connection(s) not enabled: ${disabledIds}. Only Enabled connections can be used for operations. Run 'uip is connections edit <connection-id>' to re-authenticate.`;
|
|
28931
|
+
}
|
|
28932
|
+
OutputFormatter.success(result);
|
|
28933
|
+
} else {
|
|
28934
|
+
const context = options.connectionId ? `connection ID '${options.connectionId}'` : connectorKey ? `connector '${connectorKey}'` : "any connector";
|
|
28935
|
+
logger.warn(`No connections found for ${context}${options.folderKey ? ` in folder '${options.folderKey}'` : ""}`);
|
|
28867
28936
|
OutputFormatter.error({
|
|
28868
28937
|
Result: "Failure",
|
|
28869
|
-
Message:
|
|
28870
|
-
Instructions:
|
|
28938
|
+
Message: `No connections found for ${context}${options.folderKey ? ` in folder '${options.folderKey}'` : ""}.`,
|
|
28939
|
+
Instructions: "Check that the connector key is correct and that you have connections configured."
|
|
28871
28940
|
});
|
|
28872
|
-
process.exitCode = 1;
|
|
28873
28941
|
}
|
|
28874
28942
|
});
|
|
28875
|
-
connections.command("create").description("Create a new connection for a connector (OAuth flow)").argument("<connector-key>", "Connector key (e.g., uipath-doist-todoist)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--no-browser", "Don't automatically open browser (print URL instead)").
|
|
28943
|
+
connections.command("create").description("Create a new connection for a connector (OAuth flow)").argument("<connector-key>", "Connector key (e.g., uipath-doist-todoist)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--no-browser", "Don't automatically open browser (print URL instead)").trackedAction(processContext, async (connectorKey, options) => {
|
|
28876
28944
|
try {
|
|
28877
28945
|
logger.info(`
|
|
28878
28946
|
\uD83D\uDD17 Creating connection for connector: ${connectorKey}
|
|
@@ -28991,40 +29059,28 @@ ${createResponse.authUrl}
|
|
|
28991
29059
|
Message: errorMessage,
|
|
28992
29060
|
Instructions: `${error48 instanceof Error ? error48.message : String(error48)}`
|
|
28993
29061
|
});
|
|
28994
|
-
|
|
29062
|
+
processContext.exit(1);
|
|
28995
29063
|
}
|
|
28996
29064
|
});
|
|
28997
|
-
connections.command("ping").description("Check if a connection is active and enabled").argument("<connection-id>", "Connection ID to ping").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").
|
|
28998
|
-
|
|
28999
|
-
|
|
29000
|
-
|
|
29001
|
-
|
|
29002
|
-
|
|
29003
|
-
|
|
29004
|
-
|
|
29005
|
-
|
|
29065
|
+
connections.command("ping").description("Check if a connection is active and enabled").argument("<connection-id>", "Connection ID to ping").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").trackedAction(processContext, async (connectionId, options) => {
|
|
29066
|
+
logger.info(`Pinging connection: ${connectionId}`);
|
|
29067
|
+
const [configError, config2] = await catchError(createConnectionsConfig({
|
|
29068
|
+
tenant: options.tenant
|
|
29069
|
+
}));
|
|
29070
|
+
if (configError) {
|
|
29071
|
+
OutputFormatter.error({
|
|
29072
|
+
Result: "Failure",
|
|
29073
|
+
Message: configError.message,
|
|
29074
|
+
Instructions: "Run 'uip is connections edit <connection-id>' to re-authenticate, or 'uip is connections create <connector-key>' to create a new connection."
|
|
29006
29075
|
});
|
|
29007
|
-
|
|
29008
|
-
|
|
29009
|
-
|
|
29010
|
-
|
|
29011
|
-
|
|
29012
|
-
|
|
29013
|
-
|
|
29014
|
-
|
|
29015
|
-
Message: "Connection is active and ready for operations."
|
|
29016
|
-
}
|
|
29017
|
-
});
|
|
29018
|
-
} else {
|
|
29019
|
-
logger.warn(`Connection '${connectionId}' is not enabled (status: ${result.status})`);
|
|
29020
|
-
OutputFormatter.error({
|
|
29021
|
-
Result: "Failure",
|
|
29022
|
-
Code: "ConnectionNotEnabled",
|
|
29023
|
-
Message: `Connection '${connectionId}' is not enabled (status: ${result.status}).`,
|
|
29024
|
-
Instructions: "Run 'uip is connections edit <connection-id>' to re-authenticate, or 'uip is connections create <connector-key>' to create a new connection."
|
|
29025
|
-
});
|
|
29026
|
-
}
|
|
29027
|
-
} catch (error48) {
|
|
29076
|
+
processContext.exit(1);
|
|
29077
|
+
return;
|
|
29078
|
+
}
|
|
29079
|
+
const connectionsApi = new ConnectionsApi(config2);
|
|
29080
|
+
const [error48, result] = await catchError(connectionsApi.apiV1ConnectionsConnectionIdPingGet({
|
|
29081
|
+
connectionId
|
|
29082
|
+
}));
|
|
29083
|
+
if (error48) {
|
|
29028
29084
|
const errorMessage = await extractErrorMessage(error48);
|
|
29029
29085
|
logger.error(`Error pinging connection '${connectionId}': ${errorMessage}`);
|
|
29030
29086
|
OutputFormatter.error({
|
|
@@ -29032,9 +29088,31 @@ ${createResponse.authUrl}
|
|
|
29032
29088
|
Message: errorMessage,
|
|
29033
29089
|
Instructions: "Run 'uip is connections edit <connection-id>' to re-authenticate, or 'uip is connections create <connector-key>' to create a new connection."
|
|
29034
29090
|
});
|
|
29091
|
+
processContext.exit(1);
|
|
29092
|
+
return;
|
|
29093
|
+
}
|
|
29094
|
+
logger.info(`Ping result for connection '${connectionId}': ${JSON.stringify(result)}`);
|
|
29095
|
+
if (result.status === "Enabled" || result.status === "enabled") {
|
|
29096
|
+
OutputFormatter.success({
|
|
29097
|
+
Result: "Success",
|
|
29098
|
+
Code: "ConnectionPing",
|
|
29099
|
+
Data: {
|
|
29100
|
+
ConnectionId: connectionId,
|
|
29101
|
+
Status: result.status,
|
|
29102
|
+
Message: "Connection is active and ready for operations."
|
|
29103
|
+
}
|
|
29104
|
+
});
|
|
29105
|
+
} else {
|
|
29106
|
+
logger.warn(`Connection '${connectionId}' is not enabled (status: ${result.status})`);
|
|
29107
|
+
OutputFormatter.error({
|
|
29108
|
+
Result: "Failure",
|
|
29109
|
+
Code: "ConnectionNotEnabled",
|
|
29110
|
+
Message: `Connection '${connectionId}' is not enabled (status: ${result.status}).`,
|
|
29111
|
+
Instructions: "Run 'uip is connections edit <connection-id>' to re-authenticate, or 'uip is connections create <connector-key>' to create a new connection."
|
|
29112
|
+
});
|
|
29035
29113
|
}
|
|
29036
29114
|
});
|
|
29037
|
-
connections.command("edit").description("Re-authenticate a connection (OAuth flow)").argument("<connection-id>", "Connection ID to re-authenticate").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--no-browser", "Don't automatically open browser (print URL instead)").
|
|
29115
|
+
connections.command("edit").description("Re-authenticate a connection (OAuth flow)").argument("<connection-id>", "Connection ID to re-authenticate").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--no-browser", "Don't automatically open browser (print URL instead)").trackedAction(processContext, async (connectionId, options) => {
|
|
29038
29116
|
try {
|
|
29039
29117
|
logger.info(`
|
|
29040
29118
|
Re-authenticating connection: ${connectionId}
|
|
@@ -29126,6 +29204,7 @@ Authentication timeout!
|
|
|
29126
29204
|
Message: errorMessage,
|
|
29127
29205
|
Instructions: `${error48 instanceof Error ? error48.message : String(error48)}`
|
|
29128
29206
|
});
|
|
29207
|
+
processContext.exit(1);
|
|
29129
29208
|
}
|
|
29130
29209
|
});
|
|
29131
29210
|
};
|
|
@@ -29149,111 +29228,96 @@ function sleep(ms) {
|
|
|
29149
29228
|
init_src();
|
|
29150
29229
|
var registerConnectorsCommand = (program) => {
|
|
29151
29230
|
const connectors = program.command("connectors").description("Manage UiPath Integration Service connectors");
|
|
29152
|
-
connectors.command("list").description("List all connectors").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth").option("-f, --filter <filter>", "Filter connectors by name or key").option("--refresh", "Force re-fetch from API, ignoring cache").
|
|
29153
|
-
|
|
29154
|
-
|
|
29155
|
-
|
|
29156
|
-
|
|
29157
|
-
|
|
29158
|
-
|
|
29159
|
-
logger.info(`Loaded ${connectors2.length} connectors from cache`);
|
|
29160
|
-
}
|
|
29231
|
+
connectors.command("list").description("List all connectors").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth").option("-f, --filter <filter>", "Filter connectors by name or key").option("--refresh", "Force re-fetch from API, ignoring cache").trackedAction(processContext, async (options) => {
|
|
29232
|
+
logger.info(`Listing connectors${options.filter ? ` (filter: ${options.filter})` : ""}${options.refresh ? " [refresh]" : ""}`);
|
|
29233
|
+
let connectors2 = null;
|
|
29234
|
+
if (!options.refresh) {
|
|
29235
|
+
connectors2 = await readCachedConnectors();
|
|
29236
|
+
if (connectors2) {
|
|
29237
|
+
logger.info(`Loaded ${connectors2.length} connectors from cache`);
|
|
29161
29238
|
}
|
|
29162
|
-
|
|
29163
|
-
|
|
29164
|
-
|
|
29239
|
+
}
|
|
29240
|
+
if (!connectors2) {
|
|
29241
|
+
const [apiError, api2] = await catchError(createApiClient(ConnectorsApi, {
|
|
29242
|
+
tenant: options.tenant
|
|
29243
|
+
}));
|
|
29244
|
+
if (apiError) {
|
|
29245
|
+
OutputFormatter.error({
|
|
29246
|
+
Result: "Failure",
|
|
29247
|
+
Message: "Error listing connectors",
|
|
29248
|
+
Instructions: apiError.message
|
|
29165
29249
|
});
|
|
29166
|
-
|
|
29167
|
-
|
|
29168
|
-
if (connectors2.length > 0) {
|
|
29169
|
-
await cacheConnectors(connectors2);
|
|
29170
|
-
}
|
|
29250
|
+
processContext.exit(1);
|
|
29251
|
+
return;
|
|
29171
29252
|
}
|
|
29172
|
-
|
|
29173
|
-
|
|
29174
|
-
|
|
29253
|
+
const [fetchError, fetched] = await catchError(api2.apiV1ConnectorsGet({}));
|
|
29254
|
+
if (fetchError) {
|
|
29255
|
+
const errorMessage = await extractErrorMessage(fetchError);
|
|
29256
|
+
logger.error(`Error listing connectors: ${errorMessage}`);
|
|
29257
|
+
OutputFormatter.error({
|
|
29258
|
+
Result: "Failure",
|
|
29259
|
+
Message: "Error listing connectors",
|
|
29260
|
+
Instructions: errorMessage
|
|
29261
|
+
});
|
|
29262
|
+
processContext.exit(1);
|
|
29263
|
+
return;
|
|
29175
29264
|
}
|
|
29265
|
+
connectors2 = fetched;
|
|
29266
|
+
logger.info(`Fetched ${connectors2.length} connectors from API`);
|
|
29176
29267
|
if (connectors2.length > 0) {
|
|
29177
|
-
|
|
29178
|
-
Id: connector.id,
|
|
29179
|
-
Name: connector.name,
|
|
29180
|
-
Key: connector.key,
|
|
29181
|
-
Vendor: connector.vendorName,
|
|
29182
|
-
Active: connector.isActive ? "Yes" : "No",
|
|
29183
|
-
Version: connector.latestVersion,
|
|
29184
|
-
Stage: connector.lifecycleStage,
|
|
29185
|
-
DapCompatible: connector.dapCompatible ? "Yes" : "No"
|
|
29186
|
-
}));
|
|
29187
|
-
logger.info(`Returning ${data.length} connectors: ${JSON.stringify(data)}`);
|
|
29188
|
-
OutputFormatter.success({
|
|
29189
|
-
Result: "Success",
|
|
29190
|
-
Code: "ConnectorList",
|
|
29191
|
-
Data: data
|
|
29192
|
-
});
|
|
29193
|
-
} else {
|
|
29194
|
-
logger.warn("No connectors found after filtering");
|
|
29195
|
-
OutputFormatter.success({
|
|
29196
|
-
Result: "Success",
|
|
29197
|
-
Code: "Message",
|
|
29198
|
-
Data: {
|
|
29199
|
-
Message: "No connectors found."
|
|
29200
|
-
}
|
|
29201
|
-
});
|
|
29268
|
+
await cacheConnectors(connectors2);
|
|
29202
29269
|
}
|
|
29203
|
-
} catch (error48) {
|
|
29204
|
-
const errorMessage = await extractErrorMessage(error48);
|
|
29205
|
-
logger.error(`Error listing connectors: ${errorMessage}`);
|
|
29206
|
-
OutputFormatter.error({
|
|
29207
|
-
Result: "Failure",
|
|
29208
|
-
Message: "Error listing connectors",
|
|
29209
|
-
Instructions: errorMessage
|
|
29210
|
-
});
|
|
29211
|
-
process.exitCode = 1;
|
|
29212
29270
|
}
|
|
29213
|
-
|
|
29214
|
-
|
|
29215
|
-
|
|
29216
|
-
|
|
29217
|
-
|
|
29218
|
-
|
|
29219
|
-
});
|
|
29220
|
-
const connector = await api2.apiV1ConnectorsKeyOrIdGet({
|
|
29221
|
-
keyOrId: connectorKey
|
|
29222
|
-
});
|
|
29223
|
-
logger.info(`Fetched connector: ${JSON.stringify(connector)}`);
|
|
29224
|
-
const data = {
|
|
29271
|
+
if (options.filter) {
|
|
29272
|
+
const filterLower = options.filter.toLowerCase();
|
|
29273
|
+
connectors2 = connectors2.filter((c) => c.name.toLowerCase().includes(filterLower) || c.key.toLowerCase().includes(filterLower));
|
|
29274
|
+
}
|
|
29275
|
+
if (connectors2.length > 0) {
|
|
29276
|
+
const data = connectors2.map((connector) => ({
|
|
29225
29277
|
Id: connector.id,
|
|
29226
29278
|
Name: connector.name,
|
|
29227
29279
|
Key: connector.key,
|
|
29228
|
-
AppName: connector.appName,
|
|
29229
29280
|
Vendor: connector.vendorName,
|
|
29230
|
-
Description: connector.description || "No description",
|
|
29231
29281
|
Active: connector.isActive ? "Yes" : "No",
|
|
29232
29282
|
Version: connector.latestVersion,
|
|
29233
|
-
|
|
29234
|
-
|
|
29235
|
-
|
|
29236
|
-
|
|
29237
|
-
HasCruds: connector.hasCRUDs ? "Yes" : "No",
|
|
29238
|
-
HasMethods: connector.hasMethods ? "Yes" : "No",
|
|
29239
|
-
DapCompatible: connector.dapCompatible ? "Yes" : "No",
|
|
29240
|
-
MinDapVersion: connector.minimumDapVersion || "N/A",
|
|
29241
|
-
ActivityPackVersion: connector.activityPackVersion || "N/A",
|
|
29242
|
-
ActivityColor: connector.activityColor,
|
|
29243
|
-
Categories: connector.categories.join(", "),
|
|
29244
|
-
Tags: connector.tags,
|
|
29245
|
-
DocumentationUrl: connector.documentationUrl || "No documentation",
|
|
29246
|
-
Guid: connector.guid,
|
|
29247
|
-
Tier: connector.tier,
|
|
29248
|
-
CreatedAt: connector.createdAt ? new Date(connector.createdAt).toISOString() : "",
|
|
29249
|
-
UpdatedAt: connector.updatedAt ? new Date(connector.updatedAt).toISOString() : ""
|
|
29250
|
-
};
|
|
29283
|
+
Stage: connector.lifecycleStage,
|
|
29284
|
+
DapCompatible: connector.dapCompatible ? "Yes" : "No"
|
|
29285
|
+
}));
|
|
29286
|
+
logger.info(`Returning ${data.length} connectors: ${JSON.stringify(data)}`);
|
|
29251
29287
|
OutputFormatter.success({
|
|
29252
29288
|
Result: "Success",
|
|
29253
|
-
Code: "
|
|
29254
|
-
Data:
|
|
29289
|
+
Code: "ConnectorList",
|
|
29290
|
+
Data: data
|
|
29255
29291
|
});
|
|
29256
|
-
}
|
|
29292
|
+
} else {
|
|
29293
|
+
logger.warn("No connectors found after filtering");
|
|
29294
|
+
OutputFormatter.success({
|
|
29295
|
+
Result: "Success",
|
|
29296
|
+
Code: "Message",
|
|
29297
|
+
Data: {
|
|
29298
|
+
Message: "No connectors found."
|
|
29299
|
+
}
|
|
29300
|
+
});
|
|
29301
|
+
}
|
|
29302
|
+
});
|
|
29303
|
+
connectors.command("get").description("Get connector by key").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth").trackedAction(processContext, async (connectorKey, options) => {
|
|
29304
|
+
logger.info(`Getting connector: ${connectorKey}`);
|
|
29305
|
+
const [apiError, api2] = await catchError(createApiClient(ConnectorsApi, {
|
|
29306
|
+
tenant: options.tenant
|
|
29307
|
+
}));
|
|
29308
|
+
if (apiError) {
|
|
29309
|
+
OutputFormatter.error({
|
|
29310
|
+
Result: "Failure",
|
|
29311
|
+
Message: `Error getting connector '${connectorKey}'`,
|
|
29312
|
+
Instructions: apiError.message
|
|
29313
|
+
});
|
|
29314
|
+
processContext.exit(1);
|
|
29315
|
+
return;
|
|
29316
|
+
}
|
|
29317
|
+
const [error48, connector] = await catchError(api2.apiV1ConnectorsKeyOrIdGet({
|
|
29318
|
+
keyOrId: connectorKey
|
|
29319
|
+
}));
|
|
29320
|
+
if (error48) {
|
|
29257
29321
|
const errorMessage = await extractErrorMessage(error48);
|
|
29258
29322
|
logger.error(`Error getting connector '${connectorKey}': ${errorMessage}`);
|
|
29259
29323
|
OutputFormatter.error({
|
|
@@ -29261,8 +29325,42 @@ var registerConnectorsCommand = (program) => {
|
|
|
29261
29325
|
Message: errorMessage,
|
|
29262
29326
|
Instructions: `${error48 instanceof Error ? error48.message : String(error48)}`
|
|
29263
29327
|
});
|
|
29264
|
-
|
|
29328
|
+
processContext.exit(1);
|
|
29329
|
+
return;
|
|
29265
29330
|
}
|
|
29331
|
+
logger.info(`Fetched connector: ${JSON.stringify(connector)}`);
|
|
29332
|
+
const data = {
|
|
29333
|
+
Id: connector.id,
|
|
29334
|
+
Name: connector.name,
|
|
29335
|
+
Key: connector.key,
|
|
29336
|
+
AppName: connector.appName,
|
|
29337
|
+
Vendor: connector.vendorName,
|
|
29338
|
+
Description: connector.description || "No description",
|
|
29339
|
+
Active: connector.isActive ? "Yes" : "No",
|
|
29340
|
+
Version: connector.latestVersion,
|
|
29341
|
+
LifecycleStage: connector.lifecycleStage,
|
|
29342
|
+
DiscoveryType: connector.discoveryType,
|
|
29343
|
+
DefaultAuth: connector.defaultAuthenticationType,
|
|
29344
|
+
HasEvents: connector.hasEvents ? "Yes" : "No",
|
|
29345
|
+
HasCruds: connector.hasCRUDs ? "Yes" : "No",
|
|
29346
|
+
HasMethods: connector.hasMethods ? "Yes" : "No",
|
|
29347
|
+
DapCompatible: connector.dapCompatible ? "Yes" : "No",
|
|
29348
|
+
MinDapVersion: connector.minimumDapVersion || "N/A",
|
|
29349
|
+
ActivityPackVersion: connector.activityPackVersion || "N/A",
|
|
29350
|
+
ActivityColor: connector.activityColor,
|
|
29351
|
+
Categories: connector.categories.join(", "),
|
|
29352
|
+
Tags: connector.tags,
|
|
29353
|
+
DocumentationUrl: connector.documentationUrl || "No documentation",
|
|
29354
|
+
Guid: connector.guid,
|
|
29355
|
+
Tier: connector.tier,
|
|
29356
|
+
CreatedAt: connector.createdAt ? new Date(connector.createdAt).toISOString() : "",
|
|
29357
|
+
UpdatedAt: connector.updatedAt ? new Date(connector.updatedAt).toISOString() : ""
|
|
29358
|
+
};
|
|
29359
|
+
OutputFormatter.success({
|
|
29360
|
+
Result: "Success",
|
|
29361
|
+
Code: "Connector",
|
|
29362
|
+
Data: [data]
|
|
29363
|
+
});
|
|
29266
29364
|
});
|
|
29267
29365
|
};
|
|
29268
29366
|
|
|
@@ -29282,7 +29380,7 @@ var OPERATION_TO_METHOD = {
|
|
|
29282
29380
|
PATCH: "PATCH"
|
|
29283
29381
|
};
|
|
29284
29382
|
var VALID_OPERATIONS = "List, Retrieve, Create, Update, Delete, Replace";
|
|
29285
|
-
var CACHE_PATH_PREFIX =
|
|
29383
|
+
var CACHE_PATH_PREFIX = `~/${UIPATH_HOME_DIR}/cache/integrationservice`;
|
|
29286
29384
|
function resolveOperation(operation) {
|
|
29287
29385
|
return OPERATION_TO_METHOD[operation.toUpperCase()];
|
|
29288
29386
|
}
|
|
@@ -29462,191 +29560,228 @@ async function handleExecuteAction(connectorKey, objectName, httpMethod, normali
|
|
|
29462
29560
|
}
|
|
29463
29561
|
var registerResourcesCommand = (program) => {
|
|
29464
29562
|
const resources = program.command("resources").description("Manage UiPath Integration Service resources");
|
|
29465
|
-
resources.command("list").description("List available objects for a connector").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").option("--operation <operation>", `Filter by operation (${VALID_OPERATIONS})`).option("--connection-id <id>", "Connection/Instance ID (optional)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--refresh", "Force re-fetch from API, ignoring cache").
|
|
29466
|
-
|
|
29467
|
-
|
|
29468
|
-
|
|
29469
|
-
|
|
29470
|
-
|
|
29471
|
-
|
|
29472
|
-
|
|
29473
|
-
logger.info(`Loaded ${resourcesList.length} resources from cache`);
|
|
29474
|
-
}
|
|
29475
|
-
}
|
|
29476
|
-
if (!resourcesList) {
|
|
29477
|
-
const api2 = await createApiClient(ElementsApi, {
|
|
29478
|
-
tenant: options.tenant
|
|
29479
|
-
});
|
|
29480
|
-
if (options.connectionId) {
|
|
29481
|
-
resourcesList = await api2.getInstanceObjects({
|
|
29482
|
-
connectionOrInstanceId: options.connectionId,
|
|
29483
|
-
elementKey: connectorKey
|
|
29484
|
-
});
|
|
29485
|
-
} else {
|
|
29486
|
-
resourcesList = await api2.getObjects({
|
|
29487
|
-
elementKey: connectorKey
|
|
29488
|
-
});
|
|
29489
|
-
}
|
|
29490
|
-
logger.info(`Fetched ${resourcesList?.length ?? 0} resources from API`);
|
|
29491
|
-
if (resourcesList && resourcesList.length > 0) {
|
|
29492
|
-
await cacheResourcesList(connectorKey, connectionId, resourcesList);
|
|
29493
|
-
}
|
|
29563
|
+
resources.command("list").description("List available objects for a connector").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").option("--operation <operation>", `Filter by operation (${VALID_OPERATIONS})`).option("--connection-id <id>", "Connection/Instance ID (optional)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--refresh", "Force re-fetch from API, ignoring cache").trackedAction(processContext, async (connectorKey, options) => {
|
|
29564
|
+
logger.info(`Listing resources for connector: ${connectorKey}${options.connectionId ? ` (connection: ${options.connectionId})` : ""}${options.operation ? ` (operation: ${options.operation})` : ""}${options.refresh ? " [refresh]" : ""}`);
|
|
29565
|
+
const connectionId = resolveCacheKey(options.connectionId);
|
|
29566
|
+
let resourcesList = null;
|
|
29567
|
+
if (!options.refresh) {
|
|
29568
|
+
resourcesList = await readCachedResourcesList(connectorKey, connectionId);
|
|
29569
|
+
if (resourcesList) {
|
|
29570
|
+
logger.info(`Loaded ${resourcesList.length} resources from cache`);
|
|
29494
29571
|
}
|
|
29495
|
-
|
|
29572
|
+
}
|
|
29573
|
+
if (!resourcesList) {
|
|
29574
|
+
const [apiError, api2] = await catchError(createApiClient(ElementsApi, {
|
|
29575
|
+
tenant: options.tenant
|
|
29576
|
+
}));
|
|
29577
|
+
if (apiError) {
|
|
29496
29578
|
OutputFormatter.error({
|
|
29497
29579
|
Result: "Failure",
|
|
29498
|
-
Message: `
|
|
29499
|
-
Instructions:
|
|
29580
|
+
Message: `Error listing resources for connector '${connectorKey}'`,
|
|
29581
|
+
Instructions: apiError.message
|
|
29500
29582
|
});
|
|
29583
|
+
processContext.exit(1);
|
|
29501
29584
|
return;
|
|
29502
29585
|
}
|
|
29503
|
-
|
|
29504
|
-
|
|
29505
|
-
|
|
29506
|
-
|
|
29507
|
-
|
|
29508
|
-
|
|
29509
|
-
|
|
29510
|
-
|
|
29511
|
-
|
|
29512
|
-
|
|
29513
|
-
|
|
29514
|
-
|
|
29515
|
-
|
|
29516
|
-
|
|
29517
|
-
}
|
|
29518
|
-
if (resource.operations) {
|
|
29519
|
-
const opName = METHOD_TO_OPERATION[httpMethod] || httpMethod;
|
|
29520
|
-
return resource.operations.includes(opName);
|
|
29521
|
-
}
|
|
29522
|
-
return false;
|
|
29586
|
+
const fetchFn = options.connectionId ? api2.getInstanceObjects({
|
|
29587
|
+
connectionOrInstanceId: options.connectionId,
|
|
29588
|
+
elementKey: connectorKey
|
|
29589
|
+
}) : api2.getObjects({
|
|
29590
|
+
elementKey: connectorKey
|
|
29591
|
+
});
|
|
29592
|
+
const [fetchError, fetched] = await catchError(fetchFn);
|
|
29593
|
+
if (fetchError) {
|
|
29594
|
+
const errorMessage = await extractErrorMessage(fetchError);
|
|
29595
|
+
logger.error(`Error listing resources for connector '${connectorKey}': ${errorMessage}`);
|
|
29596
|
+
OutputFormatter.error({
|
|
29597
|
+
Result: "Failure",
|
|
29598
|
+
Message: errorMessage,
|
|
29599
|
+
Instructions: fetchError.message
|
|
29523
29600
|
});
|
|
29524
|
-
|
|
29525
|
-
|
|
29526
|
-
Result: "Failure",
|
|
29527
|
-
Message: `No resources found with operation '${options.operation}' for connector '${connectorKey}'.`,
|
|
29528
|
-
Instructions: "Try a different operation type or check the connector configuration."
|
|
29529
|
-
});
|
|
29530
|
-
return;
|
|
29531
|
-
}
|
|
29601
|
+
processContext.exit(1);
|
|
29602
|
+
return;
|
|
29532
29603
|
}
|
|
29533
|
-
|
|
29534
|
-
|
|
29535
|
-
|
|
29536
|
-
|
|
29537
|
-
Type: resource.type,
|
|
29538
|
-
SubType: resource.subType,
|
|
29539
|
-
Custom: resource.custom,
|
|
29540
|
-
ElementKey: resource.elementKey
|
|
29541
|
-
}));
|
|
29542
|
-
logger.info(`Returning ${data.length} resources: ${JSON.stringify(data)}`);
|
|
29543
|
-
const result = {
|
|
29544
|
-
Result: "Success",
|
|
29545
|
-
Code: "ResourceList",
|
|
29546
|
-
Data: data
|
|
29547
|
-
};
|
|
29548
|
-
if (!options.connectionId) {
|
|
29549
|
-
result.Warning = "Results may not include custom objects. Use --connection-id <id> for connection-specific resources including custom objects and fields. Run 'is connections list <connector-key>' to get available connection IDs.";
|
|
29604
|
+
resourcesList = fetched;
|
|
29605
|
+
logger.info(`Fetched ${resourcesList?.length ?? 0} resources from API`);
|
|
29606
|
+
if (resourcesList && resourcesList.length > 0) {
|
|
29607
|
+
await cacheResourcesList(connectorKey, connectionId, resourcesList);
|
|
29550
29608
|
}
|
|
29551
|
-
|
|
29552
|
-
|
|
29553
|
-
const errorMessage = await extractErrorMessage(error48);
|
|
29554
|
-
logger.error(`Error listing resources for connector '${connectorKey}': ${errorMessage}`);
|
|
29609
|
+
}
|
|
29610
|
+
if (!resourcesList || resourcesList.length === 0) {
|
|
29555
29611
|
OutputFormatter.error({
|
|
29556
29612
|
Result: "Failure",
|
|
29557
|
-
Message:
|
|
29558
|
-
Instructions:
|
|
29613
|
+
Message: `No resources found for connector '${connectorKey}'.`,
|
|
29614
|
+
Instructions: "Check that the connector key is correct."
|
|
29559
29615
|
});
|
|
29616
|
+
return;
|
|
29560
29617
|
}
|
|
29561
|
-
|
|
29562
|
-
|
|
29563
|
-
|
|
29564
|
-
|
|
29565
|
-
|
|
29566
|
-
|
|
29567
|
-
|
|
29568
|
-
|
|
29569
|
-
|
|
29570
|
-
|
|
29571
|
-
|
|
29572
|
-
|
|
29573
|
-
|
|
29574
|
-
return;
|
|
29618
|
+
let filtered = resourcesList;
|
|
29619
|
+
if (options.operation) {
|
|
29620
|
+
const httpMethod = resolveOperation(options.operation);
|
|
29621
|
+
if (!httpMethod) {
|
|
29622
|
+
OutputFormatter.error({
|
|
29623
|
+
Result: "Failure",
|
|
29624
|
+
Message: `Invalid operation '${options.operation}'. Must be one of: ${VALID_OPERATIONS}`,
|
|
29625
|
+
Instructions: "Please provide a valid operation type."
|
|
29626
|
+
});
|
|
29627
|
+
return;
|
|
29628
|
+
}
|
|
29629
|
+
filtered = resourcesList.filter((resource) => {
|
|
29630
|
+
if (resource.metadata?.method) {
|
|
29631
|
+
return resource.metadata.method[httpMethod] !== undefined;
|
|
29575
29632
|
}
|
|
29576
|
-
|
|
29577
|
-
|
|
29578
|
-
|
|
29579
|
-
if (cached3) {
|
|
29580
|
-
OutputFormatter.success({
|
|
29581
|
-
Result: "Success",
|
|
29582
|
-
Code: "ResourceMetadata",
|
|
29583
|
-
Data: buildDescribeSummary(cached3, connectorKey, connectionId, objectName, operationName, !!options.connectionId)
|
|
29584
|
-
});
|
|
29585
|
-
return;
|
|
29586
|
-
}
|
|
29633
|
+
if (resource.operations) {
|
|
29634
|
+
const opName = METHOD_TO_OPERATION[httpMethod] || httpMethod;
|
|
29635
|
+
return resource.operations.includes(opName);
|
|
29587
29636
|
}
|
|
29588
|
-
|
|
29589
|
-
|
|
29637
|
+
return false;
|
|
29638
|
+
});
|
|
29639
|
+
if (filtered.length === 0) {
|
|
29640
|
+
OutputFormatter.error({
|
|
29641
|
+
Result: "Failure",
|
|
29642
|
+
Message: `No resources found with operation '${options.operation}' for connector '${connectorKey}'.`,
|
|
29643
|
+
Instructions: "Try a different operation type or check the connector configuration."
|
|
29590
29644
|
});
|
|
29591
|
-
|
|
29592
|
-
|
|
29593
|
-
|
|
29594
|
-
|
|
29645
|
+
return;
|
|
29646
|
+
}
|
|
29647
|
+
}
|
|
29648
|
+
const data = filtered.map((resource) => ({
|
|
29649
|
+
Name: resource.name,
|
|
29650
|
+
DisplayName: resource.displayName,
|
|
29651
|
+
Path: resource.path,
|
|
29652
|
+
Type: resource.type,
|
|
29653
|
+
SubType: resource.subType,
|
|
29654
|
+
Custom: resource.custom,
|
|
29655
|
+
ElementKey: resource.elementKey
|
|
29656
|
+
}));
|
|
29657
|
+
logger.info(`Returning ${data.length} resources: ${JSON.stringify(data)}`);
|
|
29658
|
+
const result = {
|
|
29659
|
+
Result: "Success",
|
|
29660
|
+
Code: "ResourceList",
|
|
29661
|
+
Data: data
|
|
29662
|
+
};
|
|
29663
|
+
if (!options.connectionId) {
|
|
29664
|
+
result.Warning = "Results may not include custom objects. Use --connection-id <id> for connection-specific resources including custom objects and fields. Run 'is connections list <connector-key>' to get available connection IDs.";
|
|
29665
|
+
}
|
|
29666
|
+
OutputFormatter.success(result);
|
|
29667
|
+
});
|
|
29668
|
+
resources.command("describe").description("Describe object fields and operations").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., create_ticket)").option("--connection-id <id>", "Connection/Instance ID (optional)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--operation <operation>", `Filter fields by operation (${VALID_OPERATIONS})`).option("--refresh", "Force re-fetch from API, ignoring cache").trackedAction(processContext, async (connectorKey, objectName, options) => {
|
|
29669
|
+
logger.info(`Describing resource '${objectName}' for connector: ${connectorKey}${options.connectionId ? ` (connection: ${options.connectionId})` : ""}${options.operation ? ` (operation: ${options.operation})` : ""}`);
|
|
29670
|
+
const connectionId = resolveCacheKey(options.connectionId);
|
|
29671
|
+
if (options.operation) {
|
|
29672
|
+
const methodKey = resolveOperation(options.operation);
|
|
29673
|
+
if (!methodKey) {
|
|
29674
|
+
OutputFormatter.error({
|
|
29675
|
+
Result: "Failure",
|
|
29676
|
+
Message: `Invalid operation '${options.operation}'. Must be one of: ${VALID_OPERATIONS}`,
|
|
29677
|
+
Instructions: "Please provide a valid operation type."
|
|
29678
|
+
});
|
|
29679
|
+
return;
|
|
29680
|
+
}
|
|
29681
|
+
const operationName = METHOD_TO_OPERATION[methodKey] || methodKey;
|
|
29682
|
+
if (!options.refresh) {
|
|
29683
|
+
const cached3 = await readCachedOperationMetadata(connectorKey, connectionId, objectName, operationName);
|
|
29684
|
+
if (cached3) {
|
|
29595
29685
|
OutputFormatter.success({
|
|
29596
29686
|
Result: "Success",
|
|
29597
29687
|
Code: "ResourceMetadata",
|
|
29598
|
-
Data: buildDescribeSummary(
|
|
29599
|
-
});
|
|
29600
|
-
} else {
|
|
29601
|
-
OutputFormatter.error({
|
|
29602
|
-
Result: "Failure",
|
|
29603
|
-
Message: `Operation '${options.operation}' not found for resource '${objectName}'.`,
|
|
29604
|
-
Instructions: `Available operations are in cached files: ${Object.keys(cachedFiles2).join(", ") || "none found"}`
|
|
29688
|
+
Data: buildDescribeSummary(cached3, connectorKey, connectionId, objectName, operationName, !!options.connectionId)
|
|
29605
29689
|
});
|
|
29690
|
+
return;
|
|
29606
29691
|
}
|
|
29607
|
-
return;
|
|
29608
29692
|
}
|
|
29609
|
-
const
|
|
29693
|
+
const [apiError2, api3] = await catchError(createApiClient(ElementsApi, {
|
|
29610
29694
|
tenant: options.tenant
|
|
29611
|
-
});
|
|
29612
|
-
|
|
29613
|
-
|
|
29614
|
-
|
|
29615
|
-
|
|
29616
|
-
|
|
29617
|
-
|
|
29618
|
-
|
|
29619
|
-
|
|
29620
|
-
name: metadata?.name || objectName,
|
|
29621
|
-
displayName: metadata?.displayName,
|
|
29622
|
-
availableOperations: operations,
|
|
29623
|
-
files,
|
|
29624
|
-
hint: "Use --operation <Create|List|Retrieve|Update|Delete|Replace> to see fields, or read the files directly for full details."
|
|
29625
|
-
};
|
|
29626
|
-
if (!options.connectionId) {
|
|
29627
|
-
noOpData.Warning = "Results may not include custom fields. Use --connection-id <id> for connection-specific metadata including custom objects and fields. Run 'is connections list <connector-key>' to get available connection IDs.";
|
|
29695
|
+
}));
|
|
29696
|
+
if (apiError2) {
|
|
29697
|
+
OutputFormatter.error({
|
|
29698
|
+
Result: "Failure",
|
|
29699
|
+
Message: `Error describing resource '${objectName}'`,
|
|
29700
|
+
Instructions: apiError2.message
|
|
29701
|
+
});
|
|
29702
|
+
processContext.exit(1);
|
|
29703
|
+
return;
|
|
29628
29704
|
}
|
|
29629
|
-
|
|
29630
|
-
|
|
29631
|
-
|
|
29632
|
-
|
|
29705
|
+
const [metaError2, metadata2] = await catchError(fetchResourceMetadata(api3, connectorKey, objectName, options.connectionId));
|
|
29706
|
+
if (metaError2) {
|
|
29707
|
+
const errorMessage = await extractErrorMessage(metaError2);
|
|
29708
|
+
OutputFormatter.error({
|
|
29709
|
+
Result: "Failure",
|
|
29710
|
+
Message: errorMessage,
|
|
29711
|
+
Instructions: metaError2.message
|
|
29712
|
+
});
|
|
29713
|
+
processContext.exit(1);
|
|
29714
|
+
return;
|
|
29715
|
+
}
|
|
29716
|
+
const cachedFiles2 = await cacheResourceMetadata(connectorKey, connectionId, objectName, metadata2);
|
|
29717
|
+
const cached2 = await readCachedOperationMetadata(connectorKey, connectionId, objectName, operationName);
|
|
29718
|
+
if (cached2) {
|
|
29719
|
+
OutputFormatter.success({
|
|
29720
|
+
Result: "Success",
|
|
29721
|
+
Code: "ResourceMetadata",
|
|
29722
|
+
Data: buildDescribeSummary(cached2, connectorKey, connectionId, objectName, operationName)
|
|
29723
|
+
});
|
|
29724
|
+
} else {
|
|
29725
|
+
OutputFormatter.error({
|
|
29726
|
+
Result: "Failure",
|
|
29727
|
+
Message: `Operation '${options.operation}' not found for resource '${objectName}'.`,
|
|
29728
|
+
Instructions: `Available operations are in cached files: ${Object.keys(cachedFiles2).join(", ") || "none found"}`
|
|
29729
|
+
});
|
|
29730
|
+
}
|
|
29731
|
+
return;
|
|
29732
|
+
}
|
|
29733
|
+
const [apiError, api2] = await catchError(createApiClient(ElementsApi, {
|
|
29734
|
+
tenant: options.tenant
|
|
29735
|
+
}));
|
|
29736
|
+
if (apiError) {
|
|
29737
|
+
OutputFormatter.error({
|
|
29738
|
+
Result: "Failure",
|
|
29739
|
+
Message: `Error describing resource '${objectName}'`,
|
|
29740
|
+
Instructions: apiError.message
|
|
29633
29741
|
});
|
|
29634
|
-
|
|
29635
|
-
|
|
29742
|
+
processContext.exit(1);
|
|
29743
|
+
return;
|
|
29744
|
+
}
|
|
29745
|
+
const [metaError, metadata] = await catchError(fetchResourceMetadata(api2, connectorKey, objectName, options.connectionId));
|
|
29746
|
+
if (metaError) {
|
|
29747
|
+
const errorMessage = await extractErrorMessage(metaError);
|
|
29636
29748
|
OutputFormatter.error({
|
|
29637
29749
|
Result: "Failure",
|
|
29638
29750
|
Message: errorMessage,
|
|
29639
|
-
Instructions:
|
|
29751
|
+
Instructions: metaError.message
|
|
29640
29752
|
});
|
|
29753
|
+
processContext.exit(1);
|
|
29754
|
+
return;
|
|
29641
29755
|
}
|
|
29756
|
+
const cachedFiles = await cacheResourceMetadata(connectorKey, connectionId, objectName, metadata);
|
|
29757
|
+
const operations = Object.keys(cachedFiles);
|
|
29758
|
+
const files = {};
|
|
29759
|
+
for (const op of operations) {
|
|
29760
|
+
files[op] = metadataFilePath(connectorKey, connectionId, objectName, op);
|
|
29761
|
+
}
|
|
29762
|
+
const noOpData = {
|
|
29763
|
+
name: metadata?.name || objectName,
|
|
29764
|
+
displayName: metadata?.displayName,
|
|
29765
|
+
availableOperations: operations,
|
|
29766
|
+
files,
|
|
29767
|
+
hint: "Use --operation <Create|List|Retrieve|Update|Delete|Replace> to see fields, or read the files directly for full details."
|
|
29768
|
+
};
|
|
29769
|
+
if (!options.connectionId) {
|
|
29770
|
+
noOpData.Warning = "Results may not include custom fields. Use --connection-id <id> for connection-specific metadata including custom objects and fields. Run 'is connections list <connector-key>' to get available connection IDs.";
|
|
29771
|
+
}
|
|
29772
|
+
OutputFormatter.success({
|
|
29773
|
+
Result: "Success",
|
|
29774
|
+
Code: "ResourceMetadata",
|
|
29775
|
+
Data: noOpData
|
|
29776
|
+
});
|
|
29642
29777
|
});
|
|
29643
29778
|
const execute = resources.command("execute").description("Execute data operations on a connector");
|
|
29644
|
-
addExecuteOptions(execute.command("create").description("Create a new record").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., tickets)")).option("--body <json>", "Request body as JSON string (required)").
|
|
29645
|
-
addExecuteOptions(execute.command("list").description("List all records").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., tickets)")).
|
|
29646
|
-
addExecuteOptions(execute.command("get").description("Get a record by ID").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., tickets)")).
|
|
29647
|
-
addExecuteOptions(execute.command("update").description("Update a record").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., tickets)")).option("--body <json>", "Request body as JSON string (required)").
|
|
29648
|
-
addExecuteOptions(execute.command("replace").description("Replace a record").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., tickets)")).option("--body <json>", "Request body as JSON string (required)").
|
|
29649
|
-
addExecuteOptions(execute.command("delete").description("Delete a record").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., tickets)")).
|
|
29779
|
+
addExecuteOptions(execute.command("create").description("Create a new record").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., tickets)")).option("--body <json>", "Request body as JSON string (required)").trackedAction(processContext, (connectorKey, objectName, options) => handleExecuteAction(connectorKey, objectName, "POST", "POST", options, true));
|
|
29780
|
+
addExecuteOptions(execute.command("list").description("List all records").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., tickets)")).trackedAction(processContext, (connectorKey, objectName, options) => handleExecuteAction(connectorKey, objectName, "GET", "GET", options, false));
|
|
29781
|
+
addExecuteOptions(execute.command("get").description("Get a record by ID").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., tickets)")).trackedAction(processContext, (connectorKey, objectName, options) => handleExecuteAction(connectorKey, objectName, "GET", "GETBYID", options, false));
|
|
29782
|
+
addExecuteOptions(execute.command("update").description("Update a record").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., tickets)")).option("--body <json>", "Request body as JSON string (required)").trackedAction(processContext, (connectorKey, objectName, options) => handleExecuteAction(connectorKey, objectName, "PATCH", "PATCH", options, true));
|
|
29783
|
+
addExecuteOptions(execute.command("replace").description("Replace a record").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., tickets)")).option("--body <json>", "Request body as JSON string (required)").trackedAction(processContext, (connectorKey, objectName, options) => handleExecuteAction(connectorKey, objectName, "PUT", "PUT", options, true));
|
|
29784
|
+
addExecuteOptions(execute.command("delete").description("Delete a record").argument("<connector-key>", "Connector key (e.g., uipath-zoho-desk)").argument("<object-name>", "Object name (e.g., tickets)")).trackedAction(processContext, (connectorKey, objectName, options) => handleExecuteAction(connectorKey, objectName, "DELETE", "DELETE", options, false));
|
|
29650
29785
|
};
|
|
29651
29786
|
|
|
29652
29787
|
// src/commands/triggers.ts
|
|
@@ -29684,7 +29819,7 @@ async function fetchTriggerMetadata(api2, connectorKey, operationName, objectNam
|
|
|
29684
29819
|
}
|
|
29685
29820
|
var registerTriggersCommand = (program) => {
|
|
29686
29821
|
const triggers = program.command("triggers").description("Manage UiPath Integration Service trigger metadata");
|
|
29687
|
-
triggers.command("objects").description("List objects for a trigger operation (e.g., CREATED, UPDATED, DELETED)").argument("<connector-key>", "Connector key (e.g., uipath-salesforce-sfdc)").argument("<operation>", "Trigger operation (e.g., CREATED, UPDATED, DELETED)").option("--connection-id <id>", "Connection/Instance ID (optional)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--refresh", "Force re-fetch from API, ignoring cache").
|
|
29822
|
+
triggers.command("objects").description("List objects for a trigger operation (e.g., CREATED, UPDATED, DELETED)").argument("<connector-key>", "Connector key (e.g., uipath-salesforce-sfdc)").argument("<operation>", "Trigger operation (e.g., CREATED, UPDATED, DELETED)").option("--connection-id <id>", "Connection/Instance ID (optional)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--refresh", "Force re-fetch from API, ignoring cache").trackedAction(processContext, async (connectorKey, operation, options) => {
|
|
29688
29823
|
const normalizedOp = operation.toUpperCase();
|
|
29689
29824
|
logger.info(`Listing trigger objects for connector '${connectorKey}', operation '${normalizedOp}'${options.connectionId ? ` (connection: ${options.connectionId})` : ""}`);
|
|
29690
29825
|
if (!options.refresh && options.connectionId) {
|
|
@@ -29708,7 +29843,7 @@ var registerTriggersCommand = (program) => {
|
|
|
29708
29843
|
Message: "Error creating API client",
|
|
29709
29844
|
Instructions: clientError.message
|
|
29710
29845
|
});
|
|
29711
|
-
|
|
29846
|
+
processContext.exit(1);
|
|
29712
29847
|
return;
|
|
29713
29848
|
}
|
|
29714
29849
|
const [error48, objects] = await fetchTriggerObjects(api2, connectorKey, normalizedOp, options.connectionId);
|
|
@@ -29718,7 +29853,7 @@ var registerTriggersCommand = (program) => {
|
|
|
29718
29853
|
Message: `Error fetching trigger objects for operation '${normalizedOp}'`,
|
|
29719
29854
|
Instructions: error48.message
|
|
29720
29855
|
});
|
|
29721
|
-
|
|
29856
|
+
processContext.exit(1);
|
|
29722
29857
|
return;
|
|
29723
29858
|
}
|
|
29724
29859
|
const objectsList = Array.isArray(objects) ? objects : objects instanceof Set ? [...objects] : [];
|
|
@@ -29744,7 +29879,7 @@ var registerTriggersCommand = (program) => {
|
|
|
29744
29879
|
}
|
|
29745
29880
|
OutputFormatter.success(result);
|
|
29746
29881
|
});
|
|
29747
|
-
triggers.command("describe").description("Get metadata (fields) for a trigger object and operation").argument("<connector-key>", "Connector key (e.g., uipath-salesforce-sfdc)").argument("<operation>", "Trigger operation (e.g., CREATED, UPDATED, DELETED)").argument("<object-name>", "Object name (e.g., AccountHistory)").option("--connection-id <id>", "Connection/Instance ID (optional)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--refresh", "Force re-fetch from API, ignoring cache").
|
|
29882
|
+
triggers.command("describe").description("Get metadata (fields) for a trigger object and operation").argument("<connector-key>", "Connector key (e.g., uipath-salesforce-sfdc)").argument("<operation>", "Trigger operation (e.g., CREATED, UPDATED, DELETED)").argument("<object-name>", "Object name (e.g., AccountHistory)").option("--connection-id <id>", "Connection/Instance ID (optional)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to value selected during auth)").option("--refresh", "Force re-fetch from API, ignoring cache").trackedAction(processContext, async (connectorKey, operation, objectName, options) => {
|
|
29748
29883
|
const normalizedOp = operation.toUpperCase();
|
|
29749
29884
|
logger.info(`Describing trigger metadata for connector '${connectorKey}', operation '${normalizedOp}', object '${objectName}'${options.connectionId ? ` (connection: ${options.connectionId})` : ""}`);
|
|
29750
29885
|
if (!options.refresh && options.connectionId) {
|
|
@@ -29768,7 +29903,7 @@ var registerTriggersCommand = (program) => {
|
|
|
29768
29903
|
Message: "Error creating API client",
|
|
29769
29904
|
Instructions: clientError.message
|
|
29770
29905
|
});
|
|
29771
|
-
|
|
29906
|
+
processContext.exit(1);
|
|
29772
29907
|
return;
|
|
29773
29908
|
}
|
|
29774
29909
|
const [error48, metadata] = await fetchTriggerMetadata(api2, connectorKey, normalizedOp, objectName, options.connectionId);
|
|
@@ -29778,7 +29913,7 @@ var registerTriggersCommand = (program) => {
|
|
|
29778
29913
|
Message: `Error fetching trigger metadata for '${objectName}'`,
|
|
29779
29914
|
Instructions: error48.message
|
|
29780
29915
|
});
|
|
29781
|
-
|
|
29916
|
+
processContext.exit(1);
|
|
29782
29917
|
return;
|
|
29783
29918
|
}
|
|
29784
29919
|
if (!metadata || Object.keys(metadata).length === 0) {
|
|
@@ -29812,7 +29947,7 @@ var registerTriggersCommand = (program) => {
|
|
|
29812
29947
|
var metadata = {
|
|
29813
29948
|
name: "integrationservice-tool",
|
|
29814
29949
|
version: package_default.version,
|
|
29815
|
-
description: "
|
|
29950
|
+
description: "Manage Integration Service connectors, connections, and triggers.",
|
|
29816
29951
|
commandPrefix: "is"
|
|
29817
29952
|
};
|
|
29818
29953
|
var registerCommands = async (program) => {
|