@uipath/resourcecatalog-tool 0.1.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +958 -105
- package/dist/tool.js +960 -104
- package/package.json +4 -12
package/dist/tool.js
CHANGED
|
@@ -383,11 +383,11 @@ import path from "node:path";
|
|
|
383
383
|
import { fileURLToPath } from "node:url";
|
|
384
384
|
import childProcess3 from "node:child_process";
|
|
385
385
|
import fs5, { constants as fsConstants2 } from "node:fs/promises";
|
|
386
|
-
function detectArchBinary(
|
|
387
|
-
if (typeof
|
|
388
|
-
return
|
|
386
|
+
function detectArchBinary(binary) {
|
|
387
|
+
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
388
|
+
return binary;
|
|
389
389
|
}
|
|
390
|
-
const { [arch]: archBinary } =
|
|
390
|
+
const { [arch]: archBinary } = binary;
|
|
391
391
|
if (!archBinary) {
|
|
392
392
|
throw new Error(`${arch} is not supported`);
|
|
393
393
|
}
|
|
@@ -800,9 +800,7 @@ var init_node = __esm(() => {
|
|
|
800
800
|
init_open();
|
|
801
801
|
});
|
|
802
802
|
// ../../filesystem/src/index.ts
|
|
803
|
-
var fsInstance, getFileSystem = () =>
|
|
804
|
-
return fsInstance;
|
|
805
|
-
};
|
|
803
|
+
var fsInstance, getFileSystem = () => fsInstance;
|
|
806
804
|
var init_src = __esm(() => {
|
|
807
805
|
init_node();
|
|
808
806
|
init_node();
|
|
@@ -850,7 +848,7 @@ function isBrowser() {
|
|
|
850
848
|
|
|
851
849
|
// ../../../node_modules/@uipath/coreipc/index.js
|
|
852
850
|
var require_coreipc = __commonJS((exports, module) => {
|
|
853
|
-
var __dirname = "/
|
|
851
|
+
var __dirname = "/Users/alexandru.oltean/github/cli/node_modules/@uipath/coreipc";
|
|
854
852
|
/*! For license information please see index.js.LICENSE.txt */
|
|
855
853
|
(function(e, t) {
|
|
856
854
|
typeof exports == "object" && typeof module == "object" ? module.exports = t() : typeof define == "function" && define.amd ? define([], t) : typeof exports == "object" ? exports.ipc = t() : e.ipc = t();
|
|
@@ -19045,7 +19043,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
19045
19043
|
// package.json
|
|
19046
19044
|
var package_default = {
|
|
19047
19045
|
name: "@uipath/resourcecatalog-tool",
|
|
19048
|
-
version: "
|
|
19046
|
+
version: "1.1.0",
|
|
19049
19047
|
description: "CLI plugin for the UiPath Resource Catalog Service.",
|
|
19050
19048
|
private: false,
|
|
19051
19049
|
repository: {
|
|
@@ -19087,6 +19085,9 @@ var package_default = {
|
|
|
19087
19085
|
}
|
|
19088
19086
|
};
|
|
19089
19087
|
|
|
19088
|
+
// ../../common/src/attachment-binding.ts
|
|
19089
|
+
init_src();
|
|
19090
|
+
|
|
19090
19091
|
// ../../common/src/catch-error.ts
|
|
19091
19092
|
function isPromiseLike(value) {
|
|
19092
19093
|
return value !== null && typeof value === "object" && typeof value.then === "function";
|
|
@@ -19114,79 +19115,7 @@ function settlePromiseLike(thenable) {
|
|
|
19114
19115
|
undefined
|
|
19115
19116
|
]);
|
|
19116
19117
|
}
|
|
19117
|
-
// ../../common/src/command-examples.ts
|
|
19118
|
-
import { Command } from "commander";
|
|
19119
|
-
var examplesByCommand = new WeakMap;
|
|
19120
|
-
Command.prototype.examples = function(examples) {
|
|
19121
|
-
examplesByCommand.set(this, examples);
|
|
19122
|
-
return this;
|
|
19123
|
-
};
|
|
19124
|
-
// ../../common/src/singleton.ts
|
|
19125
|
-
var PREFIX = "@uipath/common/";
|
|
19126
|
-
var _g = globalThis;
|
|
19127
|
-
function singleton(ctorOrName) {
|
|
19128
|
-
const name = typeof ctorOrName === "string" ? ctorOrName : ctorOrName.name;
|
|
19129
|
-
const key = Symbol.for(PREFIX + name);
|
|
19130
|
-
return {
|
|
19131
|
-
get(fallback) {
|
|
19132
|
-
return _g[key] ?? fallback;
|
|
19133
|
-
},
|
|
19134
|
-
set(value) {
|
|
19135
|
-
_g[key] = value;
|
|
19136
|
-
},
|
|
19137
|
-
clear() {
|
|
19138
|
-
delete _g[key];
|
|
19139
|
-
},
|
|
19140
|
-
getOrInit(factory, guard) {
|
|
19141
|
-
const existing = _g[key];
|
|
19142
|
-
if (existing != null && typeof existing === "object") {
|
|
19143
|
-
if (!guard || guard(existing)) {
|
|
19144
|
-
return existing;
|
|
19145
|
-
}
|
|
19146
|
-
}
|
|
19147
|
-
const instance = factory();
|
|
19148
|
-
_g[key] = instance;
|
|
19149
|
-
return instance;
|
|
19150
|
-
}
|
|
19151
|
-
};
|
|
19152
|
-
}
|
|
19153
19118
|
|
|
19154
|
-
// ../../common/src/output-context.ts
|
|
19155
|
-
function createStorage() {
|
|
19156
|
-
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
19157
|
-
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
19158
|
-
return {
|
|
19159
|
-
getStore: () => {
|
|
19160
|
-
return;
|
|
19161
|
-
},
|
|
19162
|
-
run: (_store, fn) => fn()
|
|
19163
|
-
};
|
|
19164
|
-
}
|
|
19165
|
-
return new mod.AsyncLocalStorage;
|
|
19166
|
-
}
|
|
19167
|
-
var storageSingleton = singleton("OutputStorage");
|
|
19168
|
-
var sinkSlot = singleton("OutputSink");
|
|
19169
|
-
var outputStorage = storageSingleton.getOrInit(createStorage, (v) => ("getStore" in v));
|
|
19170
|
-
var CONSOLE_FALLBACK = {
|
|
19171
|
-
writeOut: (str) => process.stdout.write(str),
|
|
19172
|
-
writeErr: (str) => process.stderr.write(str),
|
|
19173
|
-
writeLog: (str) => process.stdout.write(str),
|
|
19174
|
-
capabilities: {
|
|
19175
|
-
isInteractive: false,
|
|
19176
|
-
supportsColor: false,
|
|
19177
|
-
outputWidth: 80
|
|
19178
|
-
}
|
|
19179
|
-
};
|
|
19180
|
-
function getOutputSink() {
|
|
19181
|
-
return outputStorage.getStore() ?? sinkSlot.get() ?? CONSOLE_FALLBACK;
|
|
19182
|
-
}
|
|
19183
|
-
// ../../common/src/completer.ts
|
|
19184
|
-
var COMPLETER_SYMBOL = Symbol.for("@uipath/common/completer");
|
|
19185
|
-
// ../../common/src/console-guard.ts
|
|
19186
|
-
var guardInstalledSlot = singleton("ConsoleGuardInstalled");
|
|
19187
|
-
var savedOriginalsSlot = singleton("ConsoleGuardOriginals");
|
|
19188
|
-
// ../../common/src/constants.ts
|
|
19189
|
-
var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
|
|
19190
19119
|
// ../../common/src/error-handler.ts
|
|
19191
19120
|
var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.";
|
|
19192
19121
|
var DEFAULT_403 = "Forbidden (403). Ensure the account has the required permissions.";
|
|
@@ -19322,6 +19251,80 @@ async function extractErrorMessage(error, options) {
|
|
|
19322
19251
|
const { message } = await extractErrorDetails(error, options);
|
|
19323
19252
|
return message;
|
|
19324
19253
|
}
|
|
19254
|
+
// ../../common/src/command-examples.ts
|
|
19255
|
+
import { Command } from "commander";
|
|
19256
|
+
var examplesByCommand = new WeakMap;
|
|
19257
|
+
Command.prototype.examples = function(examples) {
|
|
19258
|
+
examplesByCommand.set(this, examples);
|
|
19259
|
+
return this;
|
|
19260
|
+
};
|
|
19261
|
+
// ../../common/src/singleton.ts
|
|
19262
|
+
var PREFIX = "@uipath/common/";
|
|
19263
|
+
var _g = globalThis;
|
|
19264
|
+
function singleton(ctorOrName) {
|
|
19265
|
+
const name = typeof ctorOrName === "string" ? ctorOrName : ctorOrName.name;
|
|
19266
|
+
const key = Symbol.for(PREFIX + name);
|
|
19267
|
+
return {
|
|
19268
|
+
get(fallback) {
|
|
19269
|
+
return _g[key] ?? fallback;
|
|
19270
|
+
},
|
|
19271
|
+
set(value) {
|
|
19272
|
+
_g[key] = value;
|
|
19273
|
+
},
|
|
19274
|
+
clear() {
|
|
19275
|
+
delete _g[key];
|
|
19276
|
+
},
|
|
19277
|
+
getOrInit(factory, guard) {
|
|
19278
|
+
const existing = _g[key];
|
|
19279
|
+
if (existing != null && typeof existing === "object") {
|
|
19280
|
+
if (!guard || guard(existing)) {
|
|
19281
|
+
return existing;
|
|
19282
|
+
}
|
|
19283
|
+
}
|
|
19284
|
+
const instance = factory();
|
|
19285
|
+
_g[key] = instance;
|
|
19286
|
+
return instance;
|
|
19287
|
+
}
|
|
19288
|
+
};
|
|
19289
|
+
}
|
|
19290
|
+
|
|
19291
|
+
// ../../common/src/output-context.ts
|
|
19292
|
+
function createStorage() {
|
|
19293
|
+
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
19294
|
+
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
19295
|
+
return {
|
|
19296
|
+
getStore: () => {
|
|
19297
|
+
return;
|
|
19298
|
+
},
|
|
19299
|
+
run: (_store, fn) => fn()
|
|
19300
|
+
};
|
|
19301
|
+
}
|
|
19302
|
+
return new mod.AsyncLocalStorage;
|
|
19303
|
+
}
|
|
19304
|
+
var storageSingleton = singleton("OutputStorage");
|
|
19305
|
+
var sinkSlot = singleton("OutputSink");
|
|
19306
|
+
var outputStorage = storageSingleton.getOrInit(createStorage, (v) => ("getStore" in v));
|
|
19307
|
+
var CONSOLE_FALLBACK = {
|
|
19308
|
+
writeOut: (str) => process.stdout.write(str),
|
|
19309
|
+
writeErr: (str) => process.stderr.write(str),
|
|
19310
|
+
writeLog: (str) => process.stdout.write(str),
|
|
19311
|
+
capabilities: {
|
|
19312
|
+
isInteractive: false,
|
|
19313
|
+
supportsColor: false,
|
|
19314
|
+
outputWidth: 80
|
|
19315
|
+
}
|
|
19316
|
+
};
|
|
19317
|
+
function getOutputSink() {
|
|
19318
|
+
return outputStorage.getStore() ?? sinkSlot.get() ?? CONSOLE_FALLBACK;
|
|
19319
|
+
}
|
|
19320
|
+
// ../../common/src/completer.ts
|
|
19321
|
+
var COMPLETER_SYMBOL = Symbol.for("@uipath/common/completer");
|
|
19322
|
+
// ../../common/src/console-guard.ts
|
|
19323
|
+
var guardInstalledSlot = singleton("ConsoleGuardInstalled");
|
|
19324
|
+
var savedOriginalsSlot = singleton("ConsoleGuardOriginals");
|
|
19325
|
+
// ../../common/src/constants.ts
|
|
19326
|
+
var DEFAULT_PAGE_SIZE = 50;
|
|
19327
|
+
var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
|
|
19325
19328
|
// ../../../node_modules/@jmespath-community/jmespath/dist/index.mjs
|
|
19326
19329
|
var isObject = (obj) => {
|
|
19327
19330
|
return obj !== null && Object.prototype.toString.call(obj) === "[object Object]";
|
|
@@ -24366,15 +24369,26 @@ class SuccessOutput {
|
|
|
24366
24369
|
}
|
|
24367
24370
|
}
|
|
24368
24371
|
}
|
|
24369
|
-
function
|
|
24372
|
+
function escapeNonAscii(jsonText) {
|
|
24373
|
+
return jsonText.replace(/[\u0080-\uffff]/g, (c) => {
|
|
24374
|
+
const hex = c.charCodeAt(0).toString(16).padStart(4, "0");
|
|
24375
|
+
return `\\u${hex}`;
|
|
24376
|
+
});
|
|
24377
|
+
}
|
|
24378
|
+
function needsAsciiSafeJson(sink) {
|
|
24379
|
+
return process.platform === "win32" && !sink.capabilities.isInteractive;
|
|
24380
|
+
}
|
|
24381
|
+
function printOutput(data, format = "json", logFn, asciiSafe = false) {
|
|
24370
24382
|
if (!data) {
|
|
24371
24383
|
logFn("Empty response object. No data to display.");
|
|
24372
24384
|
return;
|
|
24373
24385
|
}
|
|
24374
24386
|
switch (format) {
|
|
24375
|
-
case "json":
|
|
24376
|
-
|
|
24387
|
+
case "json": {
|
|
24388
|
+
const json2 = JSON.stringify(data, null, 2);
|
|
24389
|
+
logFn(asciiSafe ? escapeNonAscii(json2) : json2);
|
|
24377
24390
|
break;
|
|
24391
|
+
}
|
|
24378
24392
|
case "yaml":
|
|
24379
24393
|
logFn(toYaml(data));
|
|
24380
24394
|
break;
|
|
@@ -24409,7 +24423,7 @@ function printOutput(data, format = "json", logFn) {
|
|
|
24409
24423
|
function logOutput(data, format = "json") {
|
|
24410
24424
|
const sink = getOutputSink();
|
|
24411
24425
|
printOutput(data, format, (msg) => sink.writeOut(`${msg}
|
|
24412
|
-
`));
|
|
24426
|
+
`), needsAsciiSafeJson(sink));
|
|
24413
24427
|
}
|
|
24414
24428
|
function cellToString(val) {
|
|
24415
24429
|
return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
|
|
@@ -24589,7 +24603,9 @@ var OutputFormatter;
|
|
|
24589
24603
|
const format = getOutputFormat();
|
|
24590
24604
|
const sink = getOutputSink();
|
|
24591
24605
|
if (format === "json") {
|
|
24592
|
-
|
|
24606
|
+
const json2 = JSON.stringify(data);
|
|
24607
|
+
const safe = needsAsciiSafeJson(sink) ? escapeNonAscii(json2) : json2;
|
|
24608
|
+
sink.writeErr(`${safe}
|
|
24593
24609
|
`);
|
|
24594
24610
|
} else {
|
|
24595
24611
|
for (const [key, value] of Object.entries(data)) {
|
|
@@ -24605,9 +24621,10 @@ var OutputFormatter;
|
|
|
24605
24621
|
data.Data = applyFilter(data.Data, filter);
|
|
24606
24622
|
}
|
|
24607
24623
|
const lines = [];
|
|
24624
|
+
const sink = getOutputSink();
|
|
24608
24625
|
printOutput(data, getOutputFormat(), (msg) => {
|
|
24609
24626
|
lines.push(msg);
|
|
24610
|
-
});
|
|
24627
|
+
}, needsAsciiSafeJson(sink));
|
|
24611
24628
|
return lines.join(`
|
|
24612
24629
|
`);
|
|
24613
24630
|
}
|
|
@@ -26016,6 +26033,47 @@ JSONPath.prototype.safeVm = {
|
|
|
26016
26033
|
Script: SafeScript
|
|
26017
26034
|
};
|
|
26018
26035
|
JSONPath.prototype.vm = vm;
|
|
26036
|
+
// ../../common/src/option-aliases.ts
|
|
26037
|
+
import { Option } from "commander";
|
|
26038
|
+
function resolveDeprecatedOptionAlias({
|
|
26039
|
+
preferredValue,
|
|
26040
|
+
deprecatedValue,
|
|
26041
|
+
preferredFlag,
|
|
26042
|
+
deprecatedFlag
|
|
26043
|
+
}) {
|
|
26044
|
+
const hasPreferred = preferredValue !== undefined;
|
|
26045
|
+
const hasDeprecated = deprecatedValue !== undefined;
|
|
26046
|
+
if (hasPreferred && hasDeprecated) {
|
|
26047
|
+
return {
|
|
26048
|
+
value: undefined,
|
|
26049
|
+
usedDeprecated: true,
|
|
26050
|
+
error: {
|
|
26051
|
+
message: `${deprecatedFlag} and ${preferredFlag} are aliases. Use only ${preferredFlag}.`,
|
|
26052
|
+
instructions: `Replace ${deprecatedFlag} with ${preferredFlag}.`
|
|
26053
|
+
}
|
|
26054
|
+
};
|
|
26055
|
+
}
|
|
26056
|
+
return {
|
|
26057
|
+
value: hasPreferred ? preferredValue : deprecatedValue,
|
|
26058
|
+
usedDeprecated: hasDeprecated
|
|
26059
|
+
};
|
|
26060
|
+
}
|
|
26061
|
+
function warnDeprecatedOptionAlias(deprecatedFlag, preferredFlag) {
|
|
26062
|
+
getOutputSink().writeErr(`[WARN] ${deprecatedFlag} is deprecated. Use ${preferredFlag} instead.
|
|
26063
|
+
`);
|
|
26064
|
+
}
|
|
26065
|
+
var TENANT_SWITCH_COMMAND = "uip login tenant set <tenant>";
|
|
26066
|
+
function createHiddenDeprecatedTenantOption(flags = "-t, --tenant <tenant-name>") {
|
|
26067
|
+
return new Option(flags, `Tenant name. Deprecated; use ${TENANT_SWITCH_COMMAND} to switch active tenants.`).hideHelp().argParser((tenant) => {
|
|
26068
|
+
warnDeprecatedTenantOption(tenant);
|
|
26069
|
+
return tenant;
|
|
26070
|
+
});
|
|
26071
|
+
}
|
|
26072
|
+
function warnDeprecatedTenantOption(tenant) {
|
|
26073
|
+
if (tenant === undefined)
|
|
26074
|
+
return;
|
|
26075
|
+
warnDeprecatedOptionAlias("--tenant", TENANT_SWITCH_COMMAND);
|
|
26076
|
+
}
|
|
26019
26077
|
// ../../common/src/option-validators.ts
|
|
26020
26078
|
import { InvalidArgumentError } from "commander";
|
|
26021
26079
|
// ../../common/src/polling/terminal-statuses.ts
|
|
@@ -26499,6 +26557,14 @@ class VoidApiResponse {
|
|
|
26499
26557
|
}
|
|
26500
26558
|
}
|
|
26501
26559
|
|
|
26560
|
+
// ../resourcecatalog-sdk/generated/src/models/EntitySearchState.ts
|
|
26561
|
+
function EntitySearchStateFromJSON(json2) {
|
|
26562
|
+
return EntitySearchStateFromJSONTyped(json2, false);
|
|
26563
|
+
}
|
|
26564
|
+
function EntitySearchStateFromJSONTyped(json2, ignoreDiscriminator) {
|
|
26565
|
+
return json2;
|
|
26566
|
+
}
|
|
26567
|
+
|
|
26502
26568
|
// ../resourcecatalog-sdk/generated/src/models/TagType.ts
|
|
26503
26569
|
var TagType = {
|
|
26504
26570
|
Label: "Label",
|
|
@@ -26514,6 +26580,168 @@ function TagTypeToJSON(value) {
|
|
|
26514
26580
|
return value;
|
|
26515
26581
|
}
|
|
26516
26582
|
|
|
26583
|
+
// ../resourcecatalog-sdk/generated/src/models/TagModel.ts
|
|
26584
|
+
function TagModelFromJSON(json2) {
|
|
26585
|
+
return TagModelFromJSONTyped(json2, false);
|
|
26586
|
+
}
|
|
26587
|
+
function TagModelFromJSONTyped(json2, ignoreDiscriminator) {
|
|
26588
|
+
if (json2 == null) {
|
|
26589
|
+
return json2;
|
|
26590
|
+
}
|
|
26591
|
+
return {
|
|
26592
|
+
key: json2["key"] == null ? undefined : json2["key"],
|
|
26593
|
+
displayName: json2["displayName"] == null ? undefined : json2["displayName"],
|
|
26594
|
+
name: json2["name"] == null ? undefined : json2["name"],
|
|
26595
|
+
displayValue: json2["displayValue"] == null ? undefined : json2["displayValue"],
|
|
26596
|
+
value: json2["value"] == null ? undefined : json2["value"],
|
|
26597
|
+
type: json2["type"] == null ? undefined : TagTypeFromJSON(json2["type"]),
|
|
26598
|
+
accountKey: json2["accountKey"] == null ? undefined : json2["accountKey"],
|
|
26599
|
+
tenantKey: json2["tenantKey"] == null ? undefined : json2["tenantKey"],
|
|
26600
|
+
userKey: json2["userKey"] == null ? undefined : json2["userKey"]
|
|
26601
|
+
};
|
|
26602
|
+
}
|
|
26603
|
+
|
|
26604
|
+
// ../resourcecatalog-sdk/generated/src/models/EntityScope.ts
|
|
26605
|
+
function EntityScopeFromJSON(json2) {
|
|
26606
|
+
return EntityScopeFromJSONTyped(json2, false);
|
|
26607
|
+
}
|
|
26608
|
+
function EntityScopeFromJSONTyped(json2, ignoreDiscriminator) {
|
|
26609
|
+
return json2;
|
|
26610
|
+
}
|
|
26611
|
+
|
|
26612
|
+
// ../resourcecatalog-sdk/generated/src/models/FolderType.ts
|
|
26613
|
+
function FolderTypeFromJSON(json2) {
|
|
26614
|
+
return FolderTypeFromJSONTyped(json2, false);
|
|
26615
|
+
}
|
|
26616
|
+
function FolderTypeFromJSONTyped(json2, ignoreDiscriminator) {
|
|
26617
|
+
return json2;
|
|
26618
|
+
}
|
|
26619
|
+
|
|
26620
|
+
// ../resourcecatalog-sdk/generated/src/models/FolderModel.ts
|
|
26621
|
+
function FolderModelFromJSON(json2) {
|
|
26622
|
+
return FolderModelFromJSONTyped(json2, false);
|
|
26623
|
+
}
|
|
26624
|
+
function FolderModelFromJSONTyped(json2, ignoreDiscriminator) {
|
|
26625
|
+
if (json2 == null) {
|
|
26626
|
+
return json2;
|
|
26627
|
+
}
|
|
26628
|
+
return {
|
|
26629
|
+
id: json2["id"] == null ? undefined : json2["id"],
|
|
26630
|
+
key: json2["key"] == null ? undefined : json2["key"],
|
|
26631
|
+
displayName: json2["displayName"] == null ? undefined : json2["displayName"],
|
|
26632
|
+
code: json2["code"] == null ? undefined : json2["code"],
|
|
26633
|
+
fullyQualifiedName: json2["fullyQualifiedName"] == null ? undefined : json2["fullyQualifiedName"],
|
|
26634
|
+
timestamp: json2["timestamp"] == null ? undefined : new Date(json2["timestamp"]),
|
|
26635
|
+
tenantKey: json2["tenantKey"] == null ? undefined : json2["tenantKey"],
|
|
26636
|
+
accountKey: json2["accountKey"] == null ? undefined : json2["accountKey"],
|
|
26637
|
+
userKey: json2["userKey"] == null ? undefined : json2["userKey"],
|
|
26638
|
+
type: json2["type"] == null ? undefined : FolderTypeFromJSON(json2["type"]),
|
|
26639
|
+
path: json2["path"] == null ? undefined : json2["path"],
|
|
26640
|
+
permissions: json2["permissions"] == null ? undefined : json2["permissions"]
|
|
26641
|
+
};
|
|
26642
|
+
}
|
|
26643
|
+
|
|
26644
|
+
// ../resourcecatalog-sdk/generated/src/models/EntityModel.ts
|
|
26645
|
+
function EntityModelFromJSON(json2) {
|
|
26646
|
+
return EntityModelFromJSONTyped(json2, false);
|
|
26647
|
+
}
|
|
26648
|
+
function EntityModelFromJSONTyped(json2, ignoreDiscriminator) {
|
|
26649
|
+
if (json2 == null) {
|
|
26650
|
+
return json2;
|
|
26651
|
+
}
|
|
26652
|
+
return {
|
|
26653
|
+
entityKey: json2["entityKey"] == null ? undefined : json2["entityKey"],
|
|
26654
|
+
name: json2["name"] == null ? undefined : json2["name"],
|
|
26655
|
+
description: json2["description"] == null ? undefined : json2["description"],
|
|
26656
|
+
entityType: json2["entityType"] == null ? undefined : json2["entityType"],
|
|
26657
|
+
tags: json2["tags"] == null ? undefined : json2["tags"].map(TagModelFromJSON),
|
|
26658
|
+
folders: json2["folders"] == null ? undefined : json2["folders"].map(FolderModelFromJSON),
|
|
26659
|
+
linkedFoldersCount: json2["linkedFoldersCount"] == null ? undefined : json2["linkedFoldersCount"],
|
|
26660
|
+
source: json2["source"] == null ? undefined : json2["source"],
|
|
26661
|
+
scope: json2["scope"] == null ? undefined : EntityScopeFromJSON(json2["scope"]),
|
|
26662
|
+
searchState: json2["searchState"] == null ? undefined : EntitySearchStateFromJSON(json2["searchState"]),
|
|
26663
|
+
timestamp: json2["timestamp"] == null ? undefined : new Date(json2["timestamp"]),
|
|
26664
|
+
folderKey: json2["folderKey"] == null ? undefined : json2["folderKey"],
|
|
26665
|
+
folderKeys: json2["folderKeys"] == null ? undefined : json2["folderKeys"],
|
|
26666
|
+
tenantKey: json2["tenantKey"] == null ? undefined : json2["tenantKey"],
|
|
26667
|
+
accountKey: json2["accountKey"] == null ? undefined : json2["accountKey"],
|
|
26668
|
+
userKey: json2["userKey"] == null ? undefined : json2["userKey"],
|
|
26669
|
+
dependencies: json2["dependencies"] == null ? undefined : json2["dependencies"],
|
|
26670
|
+
customData: json2["customData"] == null ? undefined : json2["customData"],
|
|
26671
|
+
entitySubType: json2["entitySubType"] == null ? undefined : json2["entitySubType"]
|
|
26672
|
+
};
|
|
26673
|
+
}
|
|
26674
|
+
|
|
26675
|
+
// ../resourcecatalog-sdk/generated/src/models/EntityModelPaginationResult.ts
|
|
26676
|
+
function EntityModelPaginationResultFromJSON(json2) {
|
|
26677
|
+
return EntityModelPaginationResultFromJSONTyped(json2, false);
|
|
26678
|
+
}
|
|
26679
|
+
function EntityModelPaginationResultFromJSONTyped(json2, ignoreDiscriminator) {
|
|
26680
|
+
if (json2 == null) {
|
|
26681
|
+
return json2;
|
|
26682
|
+
}
|
|
26683
|
+
return {
|
|
26684
|
+
count: json2["count"] == null ? undefined : json2["count"],
|
|
26685
|
+
value: json2["value"] == null ? undefined : json2["value"].map(EntityModelFromJSON)
|
|
26686
|
+
};
|
|
26687
|
+
}
|
|
26688
|
+
|
|
26689
|
+
// ../resourcecatalog-sdk/generated/src/models/FolderDto.ts
|
|
26690
|
+
function FolderDtoFromJSON(json2) {
|
|
26691
|
+
return FolderDtoFromJSONTyped(json2, false);
|
|
26692
|
+
}
|
|
26693
|
+
function FolderDtoFromJSONTyped(json2, ignoreDiscriminator) {
|
|
26694
|
+
if (json2 == null) {
|
|
26695
|
+
return json2;
|
|
26696
|
+
}
|
|
26697
|
+
return {
|
|
26698
|
+
key: json2["key"] == null ? undefined : json2["key"],
|
|
26699
|
+
fullyQualifiedName: json2["fullyQualifiedName"] == null ? undefined : json2["fullyQualifiedName"],
|
|
26700
|
+
isPersonal: json2["isPersonal"] == null ? undefined : json2["isPersonal"],
|
|
26701
|
+
folderType: json2["folderType"] == null ? undefined : FolderTypeFromJSON(json2["folderType"])
|
|
26702
|
+
};
|
|
26703
|
+
}
|
|
26704
|
+
|
|
26705
|
+
// ../resourcecatalog-sdk/generated/src/models/FolderEntityModel.ts
|
|
26706
|
+
function FolderEntityModelFromJSON(json2) {
|
|
26707
|
+
return FolderEntityModelFromJSONTyped(json2, false);
|
|
26708
|
+
}
|
|
26709
|
+
function FolderEntityModelFromJSONTyped(json2, ignoreDiscriminator) {
|
|
26710
|
+
if (json2 == null) {
|
|
26711
|
+
return json2;
|
|
26712
|
+
}
|
|
26713
|
+
return {
|
|
26714
|
+
folderKey: json2["folderKey"] == null ? undefined : json2["folderKey"],
|
|
26715
|
+
folderName: json2["folderName"] == null ? undefined : json2["folderName"],
|
|
26716
|
+
folderCode: json2["folderCode"] == null ? undefined : json2["folderCode"],
|
|
26717
|
+
fullyQualifiedName: json2["fullyQualifiedName"] == null ? undefined : json2["fullyQualifiedName"],
|
|
26718
|
+
folderType: json2["folderType"] == null ? undefined : FolderTypeFromJSON(json2["folderType"]),
|
|
26719
|
+
folderPath: json2["folderPath"] == null ? undefined : json2["folderPath"],
|
|
26720
|
+
entityKey: json2["entityKey"] == null ? undefined : json2["entityKey"],
|
|
26721
|
+
entityName: json2["entityName"] == null ? undefined : json2["entityName"],
|
|
26722
|
+
entityDescription: json2["entityDescription"] == null ? undefined : json2["entityDescription"],
|
|
26723
|
+
entityType: json2["entityType"] == null ? undefined : json2["entityType"],
|
|
26724
|
+
entitySubType: json2["entitySubType"] == null ? undefined : json2["entitySubType"],
|
|
26725
|
+
entitySource: json2["entitySource"] == null ? undefined : json2["entitySource"]
|
|
26726
|
+
};
|
|
26727
|
+
}
|
|
26728
|
+
|
|
26729
|
+
// ../resourcecatalog-sdk/generated/src/models/FolderEntityModelCursorPaginationResult.ts
|
|
26730
|
+
function FolderEntityModelCursorPaginationResultFromJSON(json2) {
|
|
26731
|
+
return FolderEntityModelCursorPaginationResultFromJSONTyped(json2, false);
|
|
26732
|
+
}
|
|
26733
|
+
function FolderEntityModelCursorPaginationResultFromJSONTyped(json2, ignoreDiscriminator) {
|
|
26734
|
+
if (json2 == null) {
|
|
26735
|
+
return json2;
|
|
26736
|
+
}
|
|
26737
|
+
return {
|
|
26738
|
+
items: json2["items"] == null ? undefined : json2["items"].map(FolderEntityModelFromJSON),
|
|
26739
|
+
totalCount: json2["totalCount"] == null ? undefined : json2["totalCount"],
|
|
26740
|
+
nextPage: json2["nextPage"] == null ? undefined : json2["nextPage"],
|
|
26741
|
+
previousPage: json2["previousPage"] == null ? undefined : json2["previousPage"]
|
|
26742
|
+
};
|
|
26743
|
+
}
|
|
26744
|
+
|
|
26517
26745
|
// ../resourcecatalog-sdk/generated/src/models/TagReferencesModel.ts
|
|
26518
26746
|
function TagReferencesModelFromJSON(json2) {
|
|
26519
26747
|
return TagReferencesModelFromJSONTyped(json2, false);
|
|
@@ -26658,7 +26886,444 @@ function ValueModelToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
26658
26886
|
};
|
|
26659
26887
|
}
|
|
26660
26888
|
|
|
26661
|
-
// ../resourcecatalog-sdk/generated/src/apis/
|
|
26889
|
+
// ../resourcecatalog-sdk/generated/src/apis/EntitiesApi.ts
|
|
26890
|
+
class EntitiesApi extends BaseAPI {
|
|
26891
|
+
async entitiesGetRaw(requestParameters, initOverrides) {
|
|
26892
|
+
if (requestParameters["xUiPathInternalAccountId"] == null) {
|
|
26893
|
+
throw new RequiredError("xUiPathInternalAccountId", 'Required parameter "xUiPathInternalAccountId" was null or undefined when calling entitiesGet().');
|
|
26894
|
+
}
|
|
26895
|
+
const queryParameters = {};
|
|
26896
|
+
if (requestParameters["skip"] != null) {
|
|
26897
|
+
queryParameters["skip"] = requestParameters["skip"];
|
|
26898
|
+
}
|
|
26899
|
+
if (requestParameters["take"] != null) {
|
|
26900
|
+
queryParameters["take"] = requestParameters["take"];
|
|
26901
|
+
}
|
|
26902
|
+
if (requestParameters["entityTypes"] != null) {
|
|
26903
|
+
queryParameters["entityTypes"] = requestParameters["entityTypes"];
|
|
26904
|
+
}
|
|
26905
|
+
if (requestParameters["entitySubType"] != null) {
|
|
26906
|
+
queryParameters["entitySubType"] = requestParameters["entitySubType"];
|
|
26907
|
+
}
|
|
26908
|
+
if (requestParameters["apiVersion"] != null) {
|
|
26909
|
+
queryParameters["api-version"] = requestParameters["apiVersion"];
|
|
26910
|
+
}
|
|
26911
|
+
const headerParameters = {};
|
|
26912
|
+
if (requestParameters["xVersion"] != null) {
|
|
26913
|
+
headerParameters["X-Version"] = String(requestParameters["xVersion"]);
|
|
26914
|
+
}
|
|
26915
|
+
if (requestParameters["xUiPathInternalAccountId"] != null) {
|
|
26916
|
+
headerParameters["X-UiPath-Internal-AccountId"] = String(requestParameters["xUiPathInternalAccountId"]);
|
|
26917
|
+
}
|
|
26918
|
+
if (requestParameters["xUiPathInternalTenantId"] != null) {
|
|
26919
|
+
headerParameters["X-UiPath-Internal-TenantId"] = String(requestParameters["xUiPathInternalTenantId"]);
|
|
26920
|
+
}
|
|
26921
|
+
if (requestParameters["xUIPATHOrganizationUnitId"] != null) {
|
|
26922
|
+
headerParameters["X-UIPATH-OrganizationUnitId"] = String(requestParameters["xUIPATHOrganizationUnitId"]);
|
|
26923
|
+
}
|
|
26924
|
+
if (requestParameters["xUIPATHFolderPath"] != null) {
|
|
26925
|
+
headerParameters["X-UIPATH-FolderPath"] = String(requestParameters["xUIPATHFolderPath"]);
|
|
26926
|
+
}
|
|
26927
|
+
if (requestParameters["xUIPATHFolderPathEncoded"] != null) {
|
|
26928
|
+
headerParameters["X-UIPATH-FolderPath-Encoded"] = String(requestParameters["xUIPATHFolderPathEncoded"]);
|
|
26929
|
+
}
|
|
26930
|
+
if (requestParameters["xUIPATHFolderKey"] != null) {
|
|
26931
|
+
headerParameters["X-UIPATH-FolderKey"] = String(requestParameters["xUIPATHFolderKey"]);
|
|
26932
|
+
}
|
|
26933
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
26934
|
+
const token = this.configuration.accessToken;
|
|
26935
|
+
const tokenString = await token("Bearer", []);
|
|
26936
|
+
if (tokenString) {
|
|
26937
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
26938
|
+
}
|
|
26939
|
+
}
|
|
26940
|
+
let urlPath = `/Entities`;
|
|
26941
|
+
const response = await this.request({
|
|
26942
|
+
path: urlPath,
|
|
26943
|
+
method: "GET",
|
|
26944
|
+
headers: headerParameters,
|
|
26945
|
+
query: queryParameters
|
|
26946
|
+
}, initOverrides);
|
|
26947
|
+
return new JSONApiResponse(response, (jsonValue) => EntityModelPaginationResultFromJSON(jsonValue));
|
|
26948
|
+
}
|
|
26949
|
+
async entitiesGet(requestParameters, initOverrides) {
|
|
26950
|
+
const response = await this.entitiesGetRaw(requestParameters, initOverrides);
|
|
26951
|
+
return await response.value();
|
|
26952
|
+
}
|
|
26953
|
+
async entitiesGetByEntityTypeRaw(requestParameters, initOverrides) {
|
|
26954
|
+
if (requestParameters["entityType"] == null) {
|
|
26955
|
+
throw new RequiredError("entityType", 'Required parameter "entityType" was null or undefined when calling entitiesGetByEntityType().');
|
|
26956
|
+
}
|
|
26957
|
+
if (requestParameters["xUiPathInternalAccountId"] == null) {
|
|
26958
|
+
throw new RequiredError("xUiPathInternalAccountId", 'Required parameter "xUiPathInternalAccountId" was null or undefined when calling entitiesGetByEntityType().');
|
|
26959
|
+
}
|
|
26960
|
+
const queryParameters = {};
|
|
26961
|
+
if (requestParameters["name"] != null) {
|
|
26962
|
+
queryParameters["name"] = requestParameters["name"];
|
|
26963
|
+
}
|
|
26964
|
+
if (requestParameters["skip"] != null) {
|
|
26965
|
+
queryParameters["skip"] = requestParameters["skip"];
|
|
26966
|
+
}
|
|
26967
|
+
if (requestParameters["take"] != null) {
|
|
26968
|
+
queryParameters["take"] = requestParameters["take"];
|
|
26969
|
+
}
|
|
26970
|
+
if (requestParameters["entitySubType"] != null) {
|
|
26971
|
+
queryParameters["entitySubType"] = requestParameters["entitySubType"];
|
|
26972
|
+
}
|
|
26973
|
+
if (requestParameters["apiVersion"] != null) {
|
|
26974
|
+
queryParameters["api-version"] = requestParameters["apiVersion"];
|
|
26975
|
+
}
|
|
26976
|
+
const headerParameters = {};
|
|
26977
|
+
if (requestParameters["xVersion"] != null) {
|
|
26978
|
+
headerParameters["X-Version"] = String(requestParameters["xVersion"]);
|
|
26979
|
+
}
|
|
26980
|
+
if (requestParameters["xUiPathInternalAccountId"] != null) {
|
|
26981
|
+
headerParameters["X-UiPath-Internal-AccountId"] = String(requestParameters["xUiPathInternalAccountId"]);
|
|
26982
|
+
}
|
|
26983
|
+
if (requestParameters["xUiPathInternalTenantId"] != null) {
|
|
26984
|
+
headerParameters["X-UiPath-Internal-TenantId"] = String(requestParameters["xUiPathInternalTenantId"]);
|
|
26985
|
+
}
|
|
26986
|
+
if (requestParameters["xUIPATHOrganizationUnitId"] != null) {
|
|
26987
|
+
headerParameters["X-UIPATH-OrganizationUnitId"] = String(requestParameters["xUIPATHOrganizationUnitId"]);
|
|
26988
|
+
}
|
|
26989
|
+
if (requestParameters["xUIPATHFolderPath"] != null) {
|
|
26990
|
+
headerParameters["X-UIPATH-FolderPath"] = String(requestParameters["xUIPATHFolderPath"]);
|
|
26991
|
+
}
|
|
26992
|
+
if (requestParameters["xUIPATHFolderPathEncoded"] != null) {
|
|
26993
|
+
headerParameters["X-UIPATH-FolderPath-Encoded"] = String(requestParameters["xUIPATHFolderPathEncoded"]);
|
|
26994
|
+
}
|
|
26995
|
+
if (requestParameters["xUIPATHFolderKey"] != null) {
|
|
26996
|
+
headerParameters["X-UIPATH-FolderKey"] = String(requestParameters["xUIPATHFolderKey"]);
|
|
26997
|
+
}
|
|
26998
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
26999
|
+
const token = this.configuration.accessToken;
|
|
27000
|
+
const tokenString = await token("Bearer", []);
|
|
27001
|
+
if (tokenString) {
|
|
27002
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
27003
|
+
}
|
|
27004
|
+
}
|
|
27005
|
+
let urlPath = `/Entities/{entityType}`;
|
|
27006
|
+
urlPath = urlPath.replace(`{${"entityType"}}`, encodeURIComponent(String(requestParameters["entityType"])));
|
|
27007
|
+
const response = await this.request({
|
|
27008
|
+
path: urlPath,
|
|
27009
|
+
method: "GET",
|
|
27010
|
+
headers: headerParameters,
|
|
27011
|
+
query: queryParameters
|
|
27012
|
+
}, initOverrides);
|
|
27013
|
+
return new JSONApiResponse(response, (jsonValue) => EntityModelPaginationResultFromJSON(jsonValue));
|
|
27014
|
+
}
|
|
27015
|
+
async entitiesGetByEntityType(requestParameters, initOverrides) {
|
|
27016
|
+
const response = await this.entitiesGetByEntityTypeRaw(requestParameters, initOverrides);
|
|
27017
|
+
return await response.value();
|
|
27018
|
+
}
|
|
27019
|
+
async entitiesGetDependenciesRaw(requestParameters, initOverrides) {
|
|
27020
|
+
if (requestParameters["entityKey"] == null) {
|
|
27021
|
+
throw new RequiredError("entityKey", 'Required parameter "entityKey" was null or undefined when calling entitiesGetDependencies().');
|
|
27022
|
+
}
|
|
27023
|
+
if (requestParameters["xUiPathInternalAccountId"] == null) {
|
|
27024
|
+
throw new RequiredError("xUiPathInternalAccountId", 'Required parameter "xUiPathInternalAccountId" was null or undefined when calling entitiesGetDependencies().');
|
|
27025
|
+
}
|
|
27026
|
+
const queryParameters = {};
|
|
27027
|
+
if (requestParameters["apiVersion"] != null) {
|
|
27028
|
+
queryParameters["api-version"] = requestParameters["apiVersion"];
|
|
27029
|
+
}
|
|
27030
|
+
const headerParameters = {};
|
|
27031
|
+
if (requestParameters["xVersion"] != null) {
|
|
27032
|
+
headerParameters["X-Version"] = String(requestParameters["xVersion"]);
|
|
27033
|
+
}
|
|
27034
|
+
if (requestParameters["xUiPathInternalAccountId"] != null) {
|
|
27035
|
+
headerParameters["X-UiPath-Internal-AccountId"] = String(requestParameters["xUiPathInternalAccountId"]);
|
|
27036
|
+
}
|
|
27037
|
+
if (requestParameters["xUiPathInternalTenantId"] != null) {
|
|
27038
|
+
headerParameters["X-UiPath-Internal-TenantId"] = String(requestParameters["xUiPathInternalTenantId"]);
|
|
27039
|
+
}
|
|
27040
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
27041
|
+
const token = this.configuration.accessToken;
|
|
27042
|
+
const tokenString = await token("Bearer", []);
|
|
27043
|
+
if (tokenString) {
|
|
27044
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
27045
|
+
}
|
|
27046
|
+
}
|
|
27047
|
+
let urlPath = `/Entities/{entityKey}/Dependencies`;
|
|
27048
|
+
urlPath = urlPath.replace(`{${"entityKey"}}`, encodeURIComponent(String(requestParameters["entityKey"])));
|
|
27049
|
+
const response = await this.request({
|
|
27050
|
+
path: urlPath,
|
|
27051
|
+
method: "GET",
|
|
27052
|
+
headers: headerParameters,
|
|
27053
|
+
query: queryParameters
|
|
27054
|
+
}, initOverrides);
|
|
27055
|
+
return new JSONApiResponse(response, (jsonValue) => jsonValue.map(EntityModelFromJSON));
|
|
27056
|
+
}
|
|
27057
|
+
async entitiesGetDependencies(requestParameters, initOverrides) {
|
|
27058
|
+
const response = await this.entitiesGetDependenciesRaw(requestParameters, initOverrides);
|
|
27059
|
+
return await response.value();
|
|
27060
|
+
}
|
|
27061
|
+
async entitiesGetEntitiesByKeysRaw(requestParameters, initOverrides) {
|
|
27062
|
+
if (requestParameters["xUiPathInternalAccountId"] == null) {
|
|
27063
|
+
throw new RequiredError("xUiPathInternalAccountId", 'Required parameter "xUiPathInternalAccountId" was null or undefined when calling entitiesGetEntitiesByKeys().');
|
|
27064
|
+
}
|
|
27065
|
+
const queryParameters = {};
|
|
27066
|
+
if (requestParameters["apiVersion"] != null) {
|
|
27067
|
+
queryParameters["api-version"] = requestParameters["apiVersion"];
|
|
27068
|
+
}
|
|
27069
|
+
const headerParameters = {};
|
|
27070
|
+
headerParameters["Content-Type"] = "application/json";
|
|
27071
|
+
if (requestParameters["xVersion"] != null) {
|
|
27072
|
+
headerParameters["X-Version"] = String(requestParameters["xVersion"]);
|
|
27073
|
+
}
|
|
27074
|
+
if (requestParameters["xUiPathInternalAccountId"] != null) {
|
|
27075
|
+
headerParameters["X-UiPath-Internal-AccountId"] = String(requestParameters["xUiPathInternalAccountId"]);
|
|
27076
|
+
}
|
|
27077
|
+
if (requestParameters["xUiPathInternalTenantId"] != null) {
|
|
27078
|
+
headerParameters["X-UiPath-Internal-TenantId"] = String(requestParameters["xUiPathInternalTenantId"]);
|
|
27079
|
+
}
|
|
27080
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
27081
|
+
const token = this.configuration.accessToken;
|
|
27082
|
+
const tokenString = await token("Bearer", []);
|
|
27083
|
+
if (tokenString) {
|
|
27084
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
27085
|
+
}
|
|
27086
|
+
}
|
|
27087
|
+
let urlPath = `/Entities/GetEntitiesByKeys`;
|
|
27088
|
+
const response = await this.request({
|
|
27089
|
+
path: urlPath,
|
|
27090
|
+
method: "POST",
|
|
27091
|
+
headers: headerParameters,
|
|
27092
|
+
query: queryParameters,
|
|
27093
|
+
body: requestParameters["requestBody"]
|
|
27094
|
+
}, initOverrides);
|
|
27095
|
+
return new JSONApiResponse(response, (jsonValue) => jsonValue.map(EntityModelFromJSON));
|
|
27096
|
+
}
|
|
27097
|
+
async entitiesGetEntitiesByKeys(requestParameters, initOverrides) {
|
|
27098
|
+
const response = await this.entitiesGetEntitiesByKeysRaw(requestParameters, initOverrides);
|
|
27099
|
+
return await response.value();
|
|
27100
|
+
}
|
|
27101
|
+
async entitiesGetFoldersRaw(requestParameters, initOverrides) {
|
|
27102
|
+
if (requestParameters["entityType"] == null) {
|
|
27103
|
+
throw new RequiredError("entityType", 'Required parameter "entityType" was null or undefined when calling entitiesGetFolders().');
|
|
27104
|
+
}
|
|
27105
|
+
if (requestParameters["xUiPathInternalAccountId"] == null) {
|
|
27106
|
+
throw new RequiredError("xUiPathInternalAccountId", 'Required parameter "xUiPathInternalAccountId" was null or undefined when calling entitiesGetFolders().');
|
|
27107
|
+
}
|
|
27108
|
+
const queryParameters = {};
|
|
27109
|
+
if (requestParameters["permissions"] != null) {
|
|
27110
|
+
queryParameters["permissions"] = requestParameters["permissions"];
|
|
27111
|
+
}
|
|
27112
|
+
if (requestParameters["folderTypes"] != null) {
|
|
27113
|
+
queryParameters["folderTypes"] = requestParameters["folderTypes"];
|
|
27114
|
+
}
|
|
27115
|
+
if (requestParameters["apiVersion"] != null) {
|
|
27116
|
+
queryParameters["api-version"] = requestParameters["apiVersion"];
|
|
27117
|
+
}
|
|
27118
|
+
const headerParameters = {};
|
|
27119
|
+
if (requestParameters["xVersion"] != null) {
|
|
27120
|
+
headerParameters["X-Version"] = String(requestParameters["xVersion"]);
|
|
27121
|
+
}
|
|
27122
|
+
if (requestParameters["xUiPathInternalAccountId"] != null) {
|
|
27123
|
+
headerParameters["X-UiPath-Internal-AccountId"] = String(requestParameters["xUiPathInternalAccountId"]);
|
|
27124
|
+
}
|
|
27125
|
+
if (requestParameters["xUiPathInternalTenantId"] != null) {
|
|
27126
|
+
headerParameters["X-UiPath-Internal-TenantId"] = String(requestParameters["xUiPathInternalTenantId"]);
|
|
27127
|
+
}
|
|
27128
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
27129
|
+
const token = this.configuration.accessToken;
|
|
27130
|
+
const tokenString = await token("Bearer", []);
|
|
27131
|
+
if (tokenString) {
|
|
27132
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
27133
|
+
}
|
|
27134
|
+
}
|
|
27135
|
+
let urlPath = `/Entities/{entityType}/Folders`;
|
|
27136
|
+
urlPath = urlPath.replace(`{${"entityType"}}`, encodeURIComponent(String(requestParameters["entityType"])));
|
|
27137
|
+
const response = await this.request({
|
|
27138
|
+
path: urlPath,
|
|
27139
|
+
method: "GET",
|
|
27140
|
+
headers: headerParameters,
|
|
27141
|
+
query: queryParameters
|
|
27142
|
+
}, initOverrides);
|
|
27143
|
+
return new JSONApiResponse(response, (jsonValue) => jsonValue.map(FolderDtoFromJSON));
|
|
27144
|
+
}
|
|
27145
|
+
async entitiesGetFolders(requestParameters, initOverrides) {
|
|
27146
|
+
const response = await this.entitiesGetFoldersRaw(requestParameters, initOverrides);
|
|
27147
|
+
return await response.value();
|
|
27148
|
+
}
|
|
27149
|
+
async entitiesGetPermissionsRaw(requestParameters, initOverrides) {
|
|
27150
|
+
if (requestParameters["entityType"] == null) {
|
|
27151
|
+
throw new RequiredError("entityType", 'Required parameter "entityType" was null or undefined when calling entitiesGetPermissions().');
|
|
27152
|
+
}
|
|
27153
|
+
if (requestParameters["xUiPathInternalAccountId"] == null) {
|
|
27154
|
+
throw new RequiredError("xUiPathInternalAccountId", 'Required parameter "xUiPathInternalAccountId" was null or undefined when calling entitiesGetPermissions().');
|
|
27155
|
+
}
|
|
27156
|
+
const queryParameters = {};
|
|
27157
|
+
if (requestParameters["apiVersion"] != null) {
|
|
27158
|
+
queryParameters["api-version"] = requestParameters["apiVersion"];
|
|
27159
|
+
}
|
|
27160
|
+
const headerParameters = {};
|
|
27161
|
+
if (requestParameters["xVersion"] != null) {
|
|
27162
|
+
headerParameters["X-Version"] = String(requestParameters["xVersion"]);
|
|
27163
|
+
}
|
|
27164
|
+
if (requestParameters["xUiPathInternalAccountId"] != null) {
|
|
27165
|
+
headerParameters["X-UiPath-Internal-AccountId"] = String(requestParameters["xUiPathInternalAccountId"]);
|
|
27166
|
+
}
|
|
27167
|
+
if (requestParameters["xUiPathInternalTenantId"] != null) {
|
|
27168
|
+
headerParameters["X-UiPath-Internal-TenantId"] = String(requestParameters["xUiPathInternalTenantId"]);
|
|
27169
|
+
}
|
|
27170
|
+
if (requestParameters["xUIPATHOrganizationUnitId"] != null) {
|
|
27171
|
+
headerParameters["X-UIPATH-OrganizationUnitId"] = String(requestParameters["xUIPATHOrganizationUnitId"]);
|
|
27172
|
+
}
|
|
27173
|
+
if (requestParameters["xUIPATHFolderPath"] != null) {
|
|
27174
|
+
headerParameters["X-UIPATH-FolderPath"] = String(requestParameters["xUIPATHFolderPath"]);
|
|
27175
|
+
}
|
|
27176
|
+
if (requestParameters["xUIPATHFolderPathEncoded"] != null) {
|
|
27177
|
+
headerParameters["X-UIPATH-FolderPath-Encoded"] = String(requestParameters["xUIPATHFolderPathEncoded"]);
|
|
27178
|
+
}
|
|
27179
|
+
if (requestParameters["xUIPATHFolderKey"] != null) {
|
|
27180
|
+
headerParameters["X-UIPATH-FolderKey"] = String(requestParameters["xUIPATHFolderKey"]);
|
|
27181
|
+
}
|
|
27182
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
27183
|
+
const token = this.configuration.accessToken;
|
|
27184
|
+
const tokenString = await token("Bearer", []);
|
|
27185
|
+
if (tokenString) {
|
|
27186
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
27187
|
+
}
|
|
27188
|
+
}
|
|
27189
|
+
let urlPath = `/Entities/{entityType}/Permissions`;
|
|
27190
|
+
urlPath = urlPath.replace(`{${"entityType"}}`, encodeURIComponent(String(requestParameters["entityType"])));
|
|
27191
|
+
const response = await this.request({
|
|
27192
|
+
path: urlPath,
|
|
27193
|
+
method: "GET",
|
|
27194
|
+
headers: headerParameters,
|
|
27195
|
+
query: queryParameters
|
|
27196
|
+
}, initOverrides);
|
|
27197
|
+
return new JSONApiResponse(response);
|
|
27198
|
+
}
|
|
27199
|
+
async entitiesGetPermissions(requestParameters, initOverrides) {
|
|
27200
|
+
const response = await this.entitiesGetPermissionsRaw(requestParameters, initOverrides);
|
|
27201
|
+
return await response.value();
|
|
27202
|
+
}
|
|
27203
|
+
async entitiesSearchRaw(requestParameters, initOverrides) {
|
|
27204
|
+
if (requestParameters["xUiPathInternalAccountId"] == null) {
|
|
27205
|
+
throw new RequiredError("xUiPathInternalAccountId", 'Required parameter "xUiPathInternalAccountId" was null or undefined when calling entitiesSearch().');
|
|
27206
|
+
}
|
|
27207
|
+
const queryParameters = {};
|
|
27208
|
+
if (requestParameters["name"] != null) {
|
|
27209
|
+
queryParameters["name"] = requestParameters["name"];
|
|
27210
|
+
}
|
|
27211
|
+
if (requestParameters["skip"] != null) {
|
|
27212
|
+
queryParameters["skip"] = requestParameters["skip"];
|
|
27213
|
+
}
|
|
27214
|
+
if (requestParameters["take"] != null) {
|
|
27215
|
+
queryParameters["take"] = requestParameters["take"];
|
|
27216
|
+
}
|
|
27217
|
+
if (requestParameters["entityTypes"] != null) {
|
|
27218
|
+
queryParameters["entityTypes"] = requestParameters["entityTypes"];
|
|
27219
|
+
}
|
|
27220
|
+
if (requestParameters["entitySubType"] != null) {
|
|
27221
|
+
queryParameters["entitySubType"] = requestParameters["entitySubType"];
|
|
27222
|
+
}
|
|
27223
|
+
if (requestParameters["apiVersion"] != null) {
|
|
27224
|
+
queryParameters["api-version"] = requestParameters["apiVersion"];
|
|
27225
|
+
}
|
|
27226
|
+
const headerParameters = {};
|
|
27227
|
+
if (requestParameters["xVersion"] != null) {
|
|
27228
|
+
headerParameters["X-Version"] = String(requestParameters["xVersion"]);
|
|
27229
|
+
}
|
|
27230
|
+
if (requestParameters["xUiPathInternalAccountId"] != null) {
|
|
27231
|
+
headerParameters["X-UiPath-Internal-AccountId"] = String(requestParameters["xUiPathInternalAccountId"]);
|
|
27232
|
+
}
|
|
27233
|
+
if (requestParameters["xUiPathInternalTenantId"] != null) {
|
|
27234
|
+
headerParameters["X-UiPath-Internal-TenantId"] = String(requestParameters["xUiPathInternalTenantId"]);
|
|
27235
|
+
}
|
|
27236
|
+
if (requestParameters["xUIPATHOrganizationUnitId"] != null) {
|
|
27237
|
+
headerParameters["X-UIPATH-OrganizationUnitId"] = String(requestParameters["xUIPATHOrganizationUnitId"]);
|
|
27238
|
+
}
|
|
27239
|
+
if (requestParameters["xUIPATHFolderPath"] != null) {
|
|
27240
|
+
headerParameters["X-UIPATH-FolderPath"] = String(requestParameters["xUIPATHFolderPath"]);
|
|
27241
|
+
}
|
|
27242
|
+
if (requestParameters["xUIPATHFolderPathEncoded"] != null) {
|
|
27243
|
+
headerParameters["X-UIPATH-FolderPath-Encoded"] = String(requestParameters["xUIPATHFolderPathEncoded"]);
|
|
27244
|
+
}
|
|
27245
|
+
if (requestParameters["xUIPATHFolderKey"] != null) {
|
|
27246
|
+
headerParameters["X-UIPATH-FolderKey"] = String(requestParameters["xUIPATHFolderKey"]);
|
|
27247
|
+
}
|
|
27248
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
27249
|
+
const token = this.configuration.accessToken;
|
|
27250
|
+
const tokenString = await token("Bearer", []);
|
|
27251
|
+
if (tokenString) {
|
|
27252
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
27253
|
+
}
|
|
27254
|
+
}
|
|
27255
|
+
let urlPath = `/Entities/Search`;
|
|
27256
|
+
const response = await this.request({
|
|
27257
|
+
path: urlPath,
|
|
27258
|
+
method: "GET",
|
|
27259
|
+
headers: headerParameters,
|
|
27260
|
+
query: queryParameters
|
|
27261
|
+
}, initOverrides);
|
|
27262
|
+
return new JSONApiResponse(response, (jsonValue) => EntityModelPaginationResultFromJSON(jsonValue));
|
|
27263
|
+
}
|
|
27264
|
+
async entitiesSearch(requestParameters, initOverrides) {
|
|
27265
|
+
const response = await this.entitiesSearchRaw(requestParameters, initOverrides);
|
|
27266
|
+
return await response.value();
|
|
27267
|
+
}
|
|
27268
|
+
async entitiesSearchFolderEntitiesRaw(requestParameters, initOverrides) {
|
|
27269
|
+
if (requestParameters["xUiPathInternalAccountId"] == null) {
|
|
27270
|
+
throw new RequiredError("xUiPathInternalAccountId", 'Required parameter "xUiPathInternalAccountId" was null or undefined when calling entitiesSearchFolderEntities().');
|
|
27271
|
+
}
|
|
27272
|
+
const queryParameters = {};
|
|
27273
|
+
if (requestParameters["name"] != null) {
|
|
27274
|
+
queryParameters["name"] = requestParameters["name"];
|
|
27275
|
+
}
|
|
27276
|
+
if (requestParameters["pageCursor"] != null) {
|
|
27277
|
+
queryParameters["pageCursor"] = requestParameters["pageCursor"];
|
|
27278
|
+
}
|
|
27279
|
+
if (requestParameters["pageSize"] != null) {
|
|
27280
|
+
queryParameters["pageSize"] = requestParameters["pageSize"];
|
|
27281
|
+
}
|
|
27282
|
+
if (requestParameters["entityTypes"] != null) {
|
|
27283
|
+
queryParameters["entityTypes"] = requestParameters["entityTypes"];
|
|
27284
|
+
}
|
|
27285
|
+
if (requestParameters["entitySubTypes"] != null) {
|
|
27286
|
+
queryParameters["entitySubTypes"] = requestParameters["entitySubTypes"];
|
|
27287
|
+
}
|
|
27288
|
+
if (requestParameters["folderTypes"] != null) {
|
|
27289
|
+
queryParameters["folderTypes"] = requestParameters["folderTypes"];
|
|
27290
|
+
}
|
|
27291
|
+
if (requestParameters["apiVersion"] != null) {
|
|
27292
|
+
queryParameters["api-version"] = requestParameters["apiVersion"];
|
|
27293
|
+
}
|
|
27294
|
+
const headerParameters = {};
|
|
27295
|
+
if (requestParameters["xVersion"] != null) {
|
|
27296
|
+
headerParameters["X-Version"] = String(requestParameters["xVersion"]);
|
|
27297
|
+
}
|
|
27298
|
+
if (requestParameters["xUiPathInternalAccountId"] != null) {
|
|
27299
|
+
headerParameters["X-UiPath-Internal-AccountId"] = String(requestParameters["xUiPathInternalAccountId"]);
|
|
27300
|
+
}
|
|
27301
|
+
if (requestParameters["xUiPathInternalTenantId"] != null) {
|
|
27302
|
+
headerParameters["X-UiPath-Internal-TenantId"] = String(requestParameters["xUiPathInternalTenantId"]);
|
|
27303
|
+
}
|
|
27304
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
27305
|
+
const token = this.configuration.accessToken;
|
|
27306
|
+
const tokenString = await token("Bearer", []);
|
|
27307
|
+
if (tokenString) {
|
|
27308
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
27309
|
+
}
|
|
27310
|
+
}
|
|
27311
|
+
let urlPath = `/Entities/SearchFolderEntities`;
|
|
27312
|
+
const response = await this.request({
|
|
27313
|
+
path: urlPath,
|
|
27314
|
+
method: "GET",
|
|
27315
|
+
headers: headerParameters,
|
|
27316
|
+
query: queryParameters
|
|
27317
|
+
}, initOverrides);
|
|
27318
|
+
return new JSONApiResponse(response, (jsonValue) => FolderEntityModelCursorPaginationResultFromJSON(jsonValue));
|
|
27319
|
+
}
|
|
27320
|
+
async entitiesSearchFolderEntities(requestParameters, initOverrides) {
|
|
27321
|
+
const response = await this.entitiesSearchFolderEntitiesRaw(requestParameters, initOverrides);
|
|
27322
|
+
return await response.value();
|
|
27323
|
+
}
|
|
27324
|
+
}
|
|
27325
|
+
|
|
27326
|
+
// ../resourcecatalog-sdk/generated/src/apis/TagsApi.ts
|
|
26662
27327
|
class TagsApi extends BaseAPI {
|
|
26663
27328
|
async tagsBulkDeleteRaw(requestParameters, initOverrides) {
|
|
26664
27329
|
if (requestParameters["xUiPathInternalAccountId"] == null) {
|
|
@@ -27278,7 +27943,9 @@ var DEFAULT_SCOPES = [
|
|
|
27278
27943
|
"AutomationSolutions",
|
|
27279
27944
|
"StudioWebTypeCacheService",
|
|
27280
27945
|
"Docs.GPT.Search",
|
|
27281
|
-
"Insights"
|
|
27946
|
+
"Insights",
|
|
27947
|
+
"ReferenceToken",
|
|
27948
|
+
"Audit.Read"
|
|
27282
27949
|
];
|
|
27283
27950
|
var normalizeAndValidateBaseUrl = (rawUrl) => {
|
|
27284
27951
|
let baseUrl = rawUrl;
|
|
@@ -27417,6 +28084,7 @@ var getTokenExpiration = (accessToken) => {
|
|
|
27417
28084
|
|
|
27418
28085
|
// ../../auth/src/envAuth.ts
|
|
27419
28086
|
var ENV_AUTH_ENABLE_VAR = "UIPATH_CLI_ENABLE_ENV_AUTH";
|
|
28087
|
+
var ENFORCE_ROBOT_AUTH_VAR = "UIPATH_CLI_ENFORCE_ROBOT_AUTH";
|
|
27420
28088
|
var ENV_AUTH_VARS = {
|
|
27421
28089
|
token: "UIPATH_CLI_AUTH_TOKEN",
|
|
27422
28090
|
organizationName: "UIPATH_CLI_ORGANIZATION_NAME",
|
|
@@ -27432,6 +28100,7 @@ class EnvAuthConfigError extends Error {
|
|
|
27432
28100
|
}
|
|
27433
28101
|
}
|
|
27434
28102
|
var isEnvAuthEnabled = () => process.env[ENV_AUTH_ENABLE_VAR] === "true";
|
|
28103
|
+
var isRobotAuthEnforced = () => process.env[ENFORCE_ROBOT_AUTH_VAR] === "true";
|
|
27435
28104
|
var requireEnv = (name) => {
|
|
27436
28105
|
const value = process.env[name];
|
|
27437
28106
|
if (!value) {
|
|
@@ -27473,7 +28142,9 @@ var readAuthFromEnv = () => {
|
|
|
27473
28142
|
expiration
|
|
27474
28143
|
};
|
|
27475
28144
|
};
|
|
28145
|
+
|
|
27476
28146
|
// ../../auth/src/robotClientFallback.ts
|
|
28147
|
+
init_src();
|
|
27477
28148
|
var DEFAULT_TIMEOUT_MS = 1000;
|
|
27478
28149
|
var CLOSE_TIMEOUT_MS = 500;
|
|
27479
28150
|
var NOTICE_SENTINEL = Symbol.for("@uipath/auth/robotFallbackNoticePrinted");
|
|
@@ -27485,6 +28156,35 @@ var printNoticeOnce = () => {
|
|
|
27485
28156
|
catchError2(() => process.stderr.write(`Using UiPath Robot credentials. Run 'uip login' for a dedicated session.
|
|
27486
28157
|
`));
|
|
27487
28158
|
};
|
|
28159
|
+
var ROBOT_USER_SERVICES_PIPE = "UiPathUserServices";
|
|
28160
|
+
var ROBOT_USER_SERVICES_ALTERNATE_PIPE = `${ROBOT_USER_SERVICES_PIPE}Alternate`;
|
|
28161
|
+
var PIPE_NAME_MAX_LENGTH = 103;
|
|
28162
|
+
var getRobotIpcPipeNames = async () => {
|
|
28163
|
+
const fs7 = getFileSystem();
|
|
28164
|
+
const username = fs7.env.getenv("USER") ?? fs7.env.getenv("USERNAME");
|
|
28165
|
+
if (!username) {
|
|
28166
|
+
throw new Error("Unable to determine current username");
|
|
28167
|
+
}
|
|
28168
|
+
const tempPath = fs7.env.getenv("TMPDIR") ?? "/tmp/";
|
|
28169
|
+
return [ROBOT_USER_SERVICES_PIPE, ROBOT_USER_SERVICES_ALTERNATE_PIPE].map((baseName) => fs7.path.join(tempPath, `${baseName}_${username}`).substring(0, PIPE_NAME_MAX_LENGTH));
|
|
28170
|
+
};
|
|
28171
|
+
var defaultIsRobotIpcAvailable = async () => {
|
|
28172
|
+
if (process.platform === "win32") {
|
|
28173
|
+
return true;
|
|
28174
|
+
}
|
|
28175
|
+
const [pipeNamesError, pipeNames] = await catchError2(getRobotIpcPipeNames());
|
|
28176
|
+
if (pipeNamesError || !pipeNames) {
|
|
28177
|
+
return false;
|
|
28178
|
+
}
|
|
28179
|
+
const fs7 = getFileSystem();
|
|
28180
|
+
for (const pipeName of pipeNames) {
|
|
28181
|
+
const [existsError, exists] = await catchError2(fs7.exists(pipeName));
|
|
28182
|
+
if (!existsError && exists === true) {
|
|
28183
|
+
return true;
|
|
28184
|
+
}
|
|
28185
|
+
}
|
|
28186
|
+
return false;
|
|
28187
|
+
};
|
|
27488
28188
|
var withTimeout = (promise, timeoutMs) => new Promise((resolve2, reject) => {
|
|
27489
28189
|
const timer = setTimeout(() => reject(new Error(`Robot IPC call timed out after ${timeoutMs}ms`)), timeoutMs);
|
|
27490
28190
|
promise.then((value) => {
|
|
@@ -27516,14 +28216,20 @@ var defaultLoadModule = async () => {
|
|
|
27516
28216
|
var tryRobotClientFallback = async (options = {}) => {
|
|
27517
28217
|
if (isBrowser())
|
|
27518
28218
|
return;
|
|
27519
|
-
if (
|
|
27520
|
-
|
|
27521
|
-
|
|
27522
|
-
|
|
27523
|
-
|
|
28219
|
+
if (!options.force) {
|
|
28220
|
+
if (process.env.CI || process.env.GITHUB_ACTIONS) {
|
|
28221
|
+
return;
|
|
28222
|
+
}
|
|
28223
|
+
if (process.env.UIPATH_URL) {
|
|
28224
|
+
return;
|
|
28225
|
+
}
|
|
27524
28226
|
}
|
|
27525
28227
|
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
28228
|
+
const isRobotIpcAvailable = options.isRobotIpcAvailable ?? defaultIsRobotIpcAvailable;
|
|
27526
28229
|
const loadModule = options.loadModule ?? defaultLoadModule;
|
|
28230
|
+
if (!await isRobotIpcAvailable()) {
|
|
28231
|
+
return;
|
|
28232
|
+
}
|
|
27527
28233
|
const mod2 = await loadModule();
|
|
27528
28234
|
if (!mod2)
|
|
27529
28235
|
return;
|
|
@@ -27791,10 +28497,6 @@ function normalizeTokenRefreshUnavailableFailure() {
|
|
|
27791
28497
|
return "token refresh failed before authentication completed";
|
|
27792
28498
|
}
|
|
27793
28499
|
var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
|
|
27794
|
-
if (isEnvAuthEnabled()) {
|
|
27795
|
-
return readAuthFromEnv();
|
|
27796
|
-
}
|
|
27797
|
-
const { envFilePath = DEFAULT_ENV_FILENAME, ensureTokenValidityMinutes } = options;
|
|
27798
28500
|
const {
|
|
27799
28501
|
resolveEnvFilePath = resolveEnvFilePathAsync,
|
|
27800
28502
|
loadEnvFile = loadEnvFileAsync,
|
|
@@ -27804,6 +28506,34 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
|
|
|
27804
28506
|
resolveConfig = resolveConfigAsync,
|
|
27805
28507
|
robotFallback = tryRobotClientFallback
|
|
27806
28508
|
} = deps;
|
|
28509
|
+
if (isRobotAuthEnforced()) {
|
|
28510
|
+
if (isEnvAuthEnabled()) {
|
|
28511
|
+
throw new EnvAuthConfigError(`${ENV_AUTH_ENABLE_VAR}=true and ${ENFORCE_ROBOT_AUTH_VAR}=true ` + `are mutually exclusive. Unset one of them and re-run.`);
|
|
28512
|
+
}
|
|
28513
|
+
const robotCreds = await robotFallback({ force: true });
|
|
28514
|
+
if (!robotCreds) {
|
|
28515
|
+
return {
|
|
28516
|
+
loginStatus: "Not logged in",
|
|
28517
|
+
hint: `${ENFORCE_ROBOT_AUTH_VAR}=true but the UiPath Robot ` + `session is unavailable. Start and sign in to the Assistant, ` + `or unset ${ENFORCE_ROBOT_AUTH_VAR} to fall back to file or ` + `env-var authentication.`
|
|
28518
|
+
};
|
|
28519
|
+
}
|
|
28520
|
+
const expiration2 = getTokenExpiration(robotCreds.accessToken);
|
|
28521
|
+
return {
|
|
28522
|
+
loginStatus: "Logged in",
|
|
28523
|
+
accessToken: robotCreds.accessToken,
|
|
28524
|
+
baseUrl: robotCreds.baseUrl,
|
|
28525
|
+
organizationName: robotCreds.organizationName,
|
|
28526
|
+
organizationId: robotCreds.organizationId,
|
|
28527
|
+
tenantName: robotCreds.tenantName,
|
|
28528
|
+
tenantId: robotCreds.tenantId,
|
|
28529
|
+
expiration: expiration2,
|
|
28530
|
+
source: "robot" /* Robot */
|
|
28531
|
+
};
|
|
28532
|
+
}
|
|
28533
|
+
if (isEnvAuthEnabled()) {
|
|
28534
|
+
return readAuthFromEnv();
|
|
28535
|
+
}
|
|
28536
|
+
const { envFilePath = DEFAULT_ENV_FILENAME, ensureTokenValidityMinutes } = options;
|
|
27807
28537
|
const { absolutePath } = await resolveEnvFilePath(envFilePath);
|
|
27808
28538
|
if (absolutePath === undefined) {
|
|
27809
28539
|
const robotCreds = await robotFallback();
|
|
@@ -27967,7 +28697,7 @@ async function resolveConfig(options) {
|
|
|
27967
28697
|
}
|
|
27968
28698
|
const tenant = options?.tenantName ?? status.tenantName;
|
|
27969
28699
|
if (!tenant) {
|
|
27970
|
-
throw new Error("Tenant not available.
|
|
28700
|
+
throw new Error("Tenant not available. Run 'uip login' to select a tenant, or use 'uip login tenant set <tenant>' to switch tenants.");
|
|
27971
28701
|
}
|
|
27972
28702
|
const basePath = `${status.baseUrl}/${status.organizationId}/${tenant}/resourcecatalog_`;
|
|
27973
28703
|
const bearerToken = options?.s2sToken ?? status.accessToken;
|
|
@@ -27988,8 +28718,114 @@ async function createApiClient(ApiClass, options) {
|
|
|
27988
28718
|
tenantName
|
|
27989
28719
|
};
|
|
27990
28720
|
}
|
|
28721
|
+
// src/commands/search.ts
|
|
28722
|
+
import { Option as Option2 } from "commander";
|
|
28723
|
+
var LOGIN_INSTRUCTIONS = "Ensure you are logged in with 'uip login' and have access to the Resource Catalog service.";
|
|
28724
|
+
var SEARCH_EXAMPLES = [
|
|
28725
|
+
{
|
|
28726
|
+
Description: "Search RCS Process entities by entitySubType (matches the Orchestrator UI Add-Tool picker)",
|
|
28727
|
+
Command: "uip admin rcs search --entity-type Process --entity-sub-type ProcessOrchestration --limit 8",
|
|
28728
|
+
Output: {
|
|
28729
|
+
Code: "RcsSearch",
|
|
28730
|
+
Data: {
|
|
28731
|
+
items: [
|
|
28732
|
+
{
|
|
28733
|
+
entityKey: "entity-guid",
|
|
28734
|
+
name: "Sample Orchestrator",
|
|
28735
|
+
entityType: "Process",
|
|
28736
|
+
entitySubType: "ProcessOrchestration"
|
|
28737
|
+
}
|
|
28738
|
+
],
|
|
28739
|
+
count: 1
|
|
28740
|
+
}
|
|
28741
|
+
}
|
|
28742
|
+
},
|
|
28743
|
+
{
|
|
28744
|
+
Description: "Search across one folder by key",
|
|
28745
|
+
Command: "uip admin rcs search --entity-type Process --folder-key 11111111-1111-1111-1111-111111111111",
|
|
28746
|
+
Output: {
|
|
28747
|
+
Code: "RcsSearch",
|
|
28748
|
+
Data: { items: [], count: 0 }
|
|
28749
|
+
}
|
|
28750
|
+
}
|
|
28751
|
+
];
|
|
28752
|
+
var registerSearchCommands = (rcs) => {
|
|
28753
|
+
rcs.command("search").description([
|
|
28754
|
+
"Search Resource Catalog entities (RCS GET /Entities/Search).",
|
|
28755
|
+
"",
|
|
28756
|
+
"Filters: --entity-type, --entity-sub-type (each repeatable),",
|
|
28757
|
+
"--name (substring on entity name), --folder-key/--folder-path",
|
|
28758
|
+
"(sent as X-UIPATH-FolderKey/X-UIPATH-FolderPath headers).",
|
|
28759
|
+
"",
|
|
28760
|
+
"Returns the standard paging envelope {items, total, count, next}."
|
|
28761
|
+
].join(`
|
|
28762
|
+
`)).addOption(createHiddenDeprecatedTenantOption("--tenant <name>")).option("--entity-type <value>", "RCS entityTypes filter entry. Repeat to pass multiple values (e.g. --entity-type Process).", (value, previous = []) => [...previous, value]).option("--entity-sub-type <value>", "RCS entitySubType filter entry. Repeat to pass multiple values (e.g. --entity-sub-type ProcessOrchestration).", (value, previous = []) => [...previous, value]).option("--name <text>", "Substring filter on entity name (RCS `name` query param).").option("--folder-key <guid>", "Folder GUID to scope the call (sets X-UIPATH-FolderKey).").option("--folder-path <path>", "Folder path to scope the call (sets X-UIPATH-FolderPath).").option("--limit <n>", `Page size. Maps to RCS take. Defaults to ${DEFAULT_PAGE_SIZE}.`, (v) => Number.parseInt(v, 10)).option("--offset <n>", "Row offset. Maps to RCS skip. Defaults to 0.", (v) => Number.parseInt(v, 10)).addOption(new Option2("--skip <n>").hideHelp().argParser((v) => Number.parseInt(v, 10))).option("--login-validity <minutes>", "Override the interactive-login token lifetime for this call. Rarely needed.", (v) => Number.parseInt(v, 10)).examples(SEARCH_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
28763
|
+
const offset = resolveDeprecatedOptionAlias({
|
|
28764
|
+
preferredValue: options.offset,
|
|
28765
|
+
deprecatedValue: options.skip,
|
|
28766
|
+
preferredFlag: "--offset",
|
|
28767
|
+
deprecatedFlag: "--skip"
|
|
28768
|
+
});
|
|
28769
|
+
if (offset.error) {
|
|
28770
|
+
OutputFormatter.error({
|
|
28771
|
+
Result: RESULTS.Failure,
|
|
28772
|
+
Message: offset.error.message,
|
|
28773
|
+
Instructions: offset.error.instructions
|
|
28774
|
+
});
|
|
28775
|
+
processContext.exit(1);
|
|
28776
|
+
return;
|
|
28777
|
+
}
|
|
28778
|
+
if (offset.usedDeprecated) {
|
|
28779
|
+
warnDeprecatedOptionAlias("--skip", "--offset");
|
|
28780
|
+
}
|
|
28781
|
+
const resolvedOffset = offset.value ?? 0;
|
|
28782
|
+
const resolvedLimit = options.limit ?? DEFAULT_PAGE_SIZE;
|
|
28783
|
+
const [error, result] = await catchError((async () => {
|
|
28784
|
+
const { api, organizationId } = await createApiClient(EntitiesApi, {
|
|
28785
|
+
loginValidity: options.loginValidity,
|
|
28786
|
+
tenantName: options.tenant
|
|
28787
|
+
});
|
|
28788
|
+
return await api.entitiesSearch({
|
|
28789
|
+
xUiPathInternalAccountId: organizationId,
|
|
28790
|
+
name: options.name,
|
|
28791
|
+
skip: resolvedOffset,
|
|
28792
|
+
take: resolvedLimit,
|
|
28793
|
+
entityTypes: options.entityType,
|
|
28794
|
+
entitySubType: options.entitySubType,
|
|
28795
|
+
xUIPATHFolderKey: options.folderKey,
|
|
28796
|
+
xUIPATHFolderPath: options.folderPath
|
|
28797
|
+
});
|
|
28798
|
+
})());
|
|
28799
|
+
if (error) {
|
|
28800
|
+
OutputFormatter.error({
|
|
28801
|
+
Result: RESULTS.Failure,
|
|
28802
|
+
Message: await extractErrorMessage(error),
|
|
28803
|
+
Instructions: LOGIN_INSTRUCTIONS
|
|
28804
|
+
});
|
|
28805
|
+
processContext.exit(1);
|
|
28806
|
+
return;
|
|
28807
|
+
}
|
|
28808
|
+
const items = result?.value ?? [];
|
|
28809
|
+
const total = result?.count;
|
|
28810
|
+
const count = items.length;
|
|
28811
|
+
const nextSkip = resolvedOffset + count;
|
|
28812
|
+
const next = typeof total === "number" && nextSkip < total ? { skip: nextSkip, take: resolvedLimit } : undefined;
|
|
28813
|
+
OutputFormatter.success({
|
|
28814
|
+
Result: RESULTS.Success,
|
|
28815
|
+
Code: "RcsSearch",
|
|
28816
|
+
Data: {
|
|
28817
|
+
items,
|
|
28818
|
+
total,
|
|
28819
|
+
count,
|
|
28820
|
+
...next ? { next } : {}
|
|
28821
|
+
}
|
|
28822
|
+
});
|
|
28823
|
+
});
|
|
28824
|
+
};
|
|
28825
|
+
|
|
27991
28826
|
// src/commands/tag.ts
|
|
27992
|
-
|
|
28827
|
+
import { Option as Option3 } from "commander";
|
|
28828
|
+
var LOGIN_INSTRUCTIONS2 = "Ensure you are logged in with 'uip login' and have access to the Resource Catalog service. If you see 'Invalid scope(s)', re-run 'uip login' to pick up the RCS.Tags scope.";
|
|
27993
28829
|
var LIST_EXAMPLES = [
|
|
27994
28830
|
{
|
|
27995
28831
|
Description: "List all Label tags for the current tenant",
|
|
@@ -28031,11 +28867,29 @@ var registerTagCommands = (rcs) => {
|
|
|
28031
28867
|
"List tags for a tenant in the current organization.",
|
|
28032
28868
|
"",
|
|
28033
28869
|
"By default returns TagType.Label tags for the tenant in your login context.",
|
|
28034
|
-
"
|
|
28870
|
+
"Use 'uip login tenant set <tenant>' to target a different tenant in the same organization",
|
|
28035
28871
|
"(your account must have RCS access to that tenant). Use --type KeyValue",
|
|
28036
28872
|
"for key/value tags, or --starts-with to filter by name prefix."
|
|
28037
28873
|
].join(`
|
|
28038
|
-
`)).
|
|
28874
|
+
`)).addOption(createHiddenDeprecatedTenantOption("--tenant <name>")).option("--type <type>", "Tag type to list: 'Label' (default) or 'KeyValue'. Case-sensitive.", "Label").option("--starts-with <prefix>", "Return only tags whose normalized name starts with this prefix (case-insensitive).").option("--limit <n>", "Page size — how many tags to return in one call. Defaults to 100.", (v) => Number.parseInt(v, 10), 100).option("--offset <n>", "Row offset into the result set. Defaults to 0.", (v) => Number.parseInt(v, 10)).addOption(new Option3("--skip <n>").hideHelp().argParser((v) => Number.parseInt(v, 10))).option("--login-validity <minutes>", "Override the interactive-login token lifetime for this call. Rarely needed.", (v) => Number.parseInt(v, 10)).examples(LIST_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
28875
|
+
const offset = resolveDeprecatedOptionAlias({
|
|
28876
|
+
preferredValue: options.offset,
|
|
28877
|
+
deprecatedValue: options.skip,
|
|
28878
|
+
preferredFlag: "--offset",
|
|
28879
|
+
deprecatedFlag: "--skip"
|
|
28880
|
+
});
|
|
28881
|
+
if (offset.error) {
|
|
28882
|
+
OutputFormatter.error({
|
|
28883
|
+
Result: RESULTS.Failure,
|
|
28884
|
+
Message: offset.error.message,
|
|
28885
|
+
Instructions: offset.error.instructions
|
|
28886
|
+
});
|
|
28887
|
+
processContext.exit(1);
|
|
28888
|
+
return;
|
|
28889
|
+
}
|
|
28890
|
+
if (offset.usedDeprecated) {
|
|
28891
|
+
warnDeprecatedOptionAlias("--skip", "--offset");
|
|
28892
|
+
}
|
|
28039
28893
|
const [error, result] = await catchError((async () => {
|
|
28040
28894
|
if (options.type !== TagType.Label && options.type !== TagType.KeyValue) {
|
|
28041
28895
|
throw new Error(`Invalid --type '${options.type}'. Use 'Label' or 'KeyValue'.`);
|
|
@@ -28049,14 +28903,14 @@ var registerTagCommands = (rcs) => {
|
|
|
28049
28903
|
type: options.type,
|
|
28050
28904
|
startsWith: options.startsWith,
|
|
28051
28905
|
take: options.limit,
|
|
28052
|
-
skip:
|
|
28906
|
+
skip: offset.value ?? 0
|
|
28053
28907
|
});
|
|
28054
28908
|
})());
|
|
28055
28909
|
if (error) {
|
|
28056
28910
|
OutputFormatter.error({
|
|
28057
28911
|
Result: RESULTS.Failure,
|
|
28058
28912
|
Message: await extractErrorMessage(error),
|
|
28059
|
-
Instructions:
|
|
28913
|
+
Instructions: LOGIN_INSTRUCTIONS2
|
|
28060
28914
|
});
|
|
28061
28915
|
processContext.exit(1);
|
|
28062
28916
|
return;
|
|
@@ -28075,9 +28929,11 @@ var registerRcsCommand = (program) => {
|
|
|
28075
28929
|
"Manage UiPath Resource Catalog Service resources.",
|
|
28076
28930
|
"",
|
|
28077
28931
|
"Subcommand groups:",
|
|
28932
|
+
" search — search tenant- or folder-scoped RCS entities.",
|
|
28078
28933
|
" tag — list tenant-scoped tags."
|
|
28079
28934
|
].join(`
|
|
28080
28935
|
`));
|
|
28936
|
+
registerSearchCommands(rcs);
|
|
28081
28937
|
registerTagCommands(rcs);
|
|
28082
28938
|
};
|
|
28083
28939
|
|