@uipath/apms-tool 1.202.0-preview.159 → 1.203.0-preview.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/{tool-t0p9es8t.js → tool-e9hz8cbb.js} +286 -35
- package/dist/tool.js +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -2099,8 +2099,9 @@ var require_commander = __commonJS(function(exports) {
|
|
|
2099
2099
|
// package.json
|
|
2100
2100
|
var package_default = {
|
|
2101
2101
|
name: "@uipath/apms-tool",
|
|
2102
|
+
author: "UiPath",
|
|
2102
2103
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
2103
|
-
version: "1.
|
|
2104
|
+
version: "1.203.0-preview.160",
|
|
2104
2105
|
description: "CLI plugin for the UiPath Access Policy Management Service.",
|
|
2105
2106
|
private: false,
|
|
2106
2107
|
repository: {
|
|
@@ -2507,8 +2508,9 @@ class VoidApiResponse {
|
|
|
2507
2508
|
// ../apms-sdk/package.json
|
|
2508
2509
|
var package_default2 = {
|
|
2509
2510
|
name: "@uipath/apms-sdk",
|
|
2511
|
+
author: "UiPath",
|
|
2510
2512
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
2511
|
-
version: "1.
|
|
2513
|
+
version: "1.203.0",
|
|
2512
2514
|
description: "SDK for the UiPath Access Policy Management Service API.",
|
|
2513
2515
|
repository: {
|
|
2514
2516
|
type: "git",
|
|
@@ -4532,16 +4534,7 @@ var resolveEnvFilePathAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) =
|
|
|
4532
4534
|
errorMessage: location.source === "absolute" ? `Environment file not found: ${envFilePath}` : `Unable to locate environment file: ${envFilePath}. Run 'uip login' to authenticate.`
|
|
4533
4535
|
};
|
|
4534
4536
|
};
|
|
4535
|
-
var
|
|
4536
|
-
const fs2 = getFileSystem();
|
|
4537
|
-
const absolutePath = fs2.path.isAbsolute(envPath) ? envPath : fs2.path.join(fs2.env.cwd(), envPath);
|
|
4538
|
-
if (!await fs2.exists(absolutePath)) {
|
|
4539
|
-
throw new Error(`Environment file not found: ${envPath}`);
|
|
4540
|
-
}
|
|
4541
|
-
const content = await fs2.readFile(absolutePath, "utf-8");
|
|
4542
|
-
if (content === null) {
|
|
4543
|
-
throw new Error(`Environment file not found: ${envPath}`);
|
|
4544
|
-
}
|
|
4537
|
+
var parseEnvContent = (content) => {
|
|
4545
4538
|
const env = {};
|
|
4546
4539
|
for (const line of content.split(`
|
|
4547
4540
|
`)) {
|
|
@@ -4562,6 +4555,18 @@ var loadEnvFileAsync = async ({ envPath }) => {
|
|
|
4562
4555
|
}
|
|
4563
4556
|
return env;
|
|
4564
4557
|
};
|
|
4558
|
+
var loadEnvFileAsync = async ({ envPath }) => {
|
|
4559
|
+
const fs2 = getFileSystem();
|
|
4560
|
+
const absolutePath = fs2.path.isAbsolute(envPath) ? envPath : fs2.path.join(fs2.env.cwd(), envPath);
|
|
4561
|
+
if (!await fs2.exists(absolutePath)) {
|
|
4562
|
+
throw new Error(`Environment file not found: ${envPath}`);
|
|
4563
|
+
}
|
|
4564
|
+
const content = await fs2.readFile(absolutePath, "utf-8");
|
|
4565
|
+
if (content === null) {
|
|
4566
|
+
throw new Error(`Environment file not found: ${envPath}`);
|
|
4567
|
+
}
|
|
4568
|
+
return parseEnvContent(content);
|
|
4569
|
+
};
|
|
4565
4570
|
var saveEnvFileAsync = async ({
|
|
4566
4571
|
envPath,
|
|
4567
4572
|
data,
|
|
@@ -5375,7 +5380,7 @@ var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{1
|
|
|
5375
5380
|
var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
5376
5381
|
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
5377
5382
|
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
5378
|
-
var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
5383
|
+
var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
5379
5384
|
var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
|
|
5380
5385
|
var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
|
|
5381
5386
|
var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
|
|
@@ -5422,7 +5427,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
|
|
|
5422
5427
|
`(?<![A-Za-z0-9])"(?:[^\\
|
|
5423
5428
|
]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
|
|
5424
5429
|
].join("|"), "g");
|
|
5425
|
-
var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
|
|
5430
|
+
var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
|
|
5426
5431
|
var COLLAPSED_BODY = "{…}";
|
|
5427
5432
|
var COLLAPSED_BODY_MARKER = "\x01body\x01";
|
|
5428
5433
|
var MAX_BODY_NESTING = 8;
|
|
@@ -5437,10 +5442,13 @@ function collapseJsonBodies(text) {
|
|
|
5437
5442
|
}
|
|
5438
5443
|
return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
|
|
5439
5444
|
}
|
|
5440
|
-
var TRAILING_PROSE_PUNCT =
|
|
5445
|
+
var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
|
|
5441
5446
|
function peelTrailingPunctuation(match) {
|
|
5442
|
-
|
|
5443
|
-
|
|
5447
|
+
let end = match.length;
|
|
5448
|
+
while (end > 0 && TRAILING_PROSE_PUNCT.includes(match[end - 1])) {
|
|
5449
|
+
end -= 1;
|
|
5450
|
+
}
|
|
5451
|
+
return [match.slice(0, end), match.slice(end)];
|
|
5444
5452
|
}
|
|
5445
5453
|
function redactUrl(raw) {
|
|
5446
5454
|
try {
|
|
@@ -5743,6 +5751,22 @@ function parseHttpStatusFromMessage(message) {
|
|
|
5743
5751
|
const status = Number(match[1]);
|
|
5744
5752
|
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
5745
5753
|
}
|
|
5754
|
+
function findHttpStatusInGraph(error) {
|
|
5755
|
+
for (const node of walkErrorGraph(error)) {
|
|
5756
|
+
const response = node.response;
|
|
5757
|
+
const explicit = typeof node.status === "number" ? node.status : response?.status;
|
|
5758
|
+
if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
|
|
5759
|
+
return explicit;
|
|
5760
|
+
}
|
|
5761
|
+
if (typeof node.message === "string") {
|
|
5762
|
+
const parsed = parseHttpStatusFromMessage(node.message);
|
|
5763
|
+
if (parsed !== undefined && parsed >= 400) {
|
|
5764
|
+
return parsed;
|
|
5765
|
+
}
|
|
5766
|
+
}
|
|
5767
|
+
}
|
|
5768
|
+
return;
|
|
5769
|
+
}
|
|
5746
5770
|
function isHtmlDocument(body) {
|
|
5747
5771
|
return /^\s*(<!doctype html|<html\b)/i.test(body);
|
|
5748
5772
|
}
|
|
@@ -5856,7 +5880,8 @@ async function extractErrorDetails(error, options) {
|
|
|
5856
5880
|
}
|
|
5857
5881
|
let message;
|
|
5858
5882
|
let result = "Failure";
|
|
5859
|
-
const
|
|
5883
|
+
const classificationStatus = status ?? findHttpStatusInGraph(error);
|
|
5884
|
+
const classification = classifyError(classificationStatus, error);
|
|
5860
5885
|
let retry = classification.retry;
|
|
5861
5886
|
if (status === 401) {
|
|
5862
5887
|
message = DEFAULT_401;
|
|
@@ -5932,8 +5957,8 @@ async function extractErrorDetails(error, options) {
|
|
|
5932
5957
|
details = describeThrownValue(error);
|
|
5933
5958
|
}
|
|
5934
5959
|
const context = {};
|
|
5935
|
-
if (
|
|
5936
|
-
context.httpStatus =
|
|
5960
|
+
if (classificationStatus) {
|
|
5961
|
+
context.httpStatus = classificationStatus;
|
|
5937
5962
|
}
|
|
5938
5963
|
if (parsedBody?.errorCode && typeof parsedBody.errorCode === "string") {
|
|
5939
5964
|
context.errorCode = parsedBody.errorCode;
|
|
@@ -6495,7 +6520,8 @@ function readRegistryValue(keyPath, valueName) {
|
|
|
6495
6520
|
}
|
|
6496
6521
|
const [error, output] = catchError2(() => execFileSync("reg", ["query", keyPath, "/v", valueName], {
|
|
6497
6522
|
encoding: "utf-8",
|
|
6498
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
6523
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
6524
|
+
windowsHide: true
|
|
6499
6525
|
}));
|
|
6500
6526
|
if (error) {
|
|
6501
6527
|
return "";
|
|
@@ -7171,28 +7197,32 @@ function isPlainRecord(value) {
|
|
|
7171
7197
|
const prototype = Object.getPrototypeOf(value);
|
|
7172
7198
|
return prototype === Object.prototype || prototype === null;
|
|
7173
7199
|
}
|
|
7174
|
-
function
|
|
7200
|
+
function splitPagedEnvelope(value) {
|
|
7175
7201
|
if (Array.isArray(value) || !isPlainRecord(value))
|
|
7176
7202
|
return null;
|
|
7177
|
-
const entries = Object.
|
|
7203
|
+
const entries = Object.entries(value);
|
|
7178
7204
|
if (entries.length === 0)
|
|
7179
7205
|
return null;
|
|
7180
|
-
let
|
|
7181
|
-
|
|
7182
|
-
for (const entry of entries) {
|
|
7206
|
+
let found = null;
|
|
7207
|
+
const meta = Object.create(null);
|
|
7208
|
+
for (const [key, entry] of entries) {
|
|
7183
7209
|
if (Array.isArray(entry)) {
|
|
7184
|
-
if (
|
|
7210
|
+
if (found !== null)
|
|
7185
7211
|
return null;
|
|
7186
|
-
|
|
7212
|
+
found = { key, rows: entry };
|
|
7187
7213
|
} else if (entry !== null && typeof entry === "object") {
|
|
7188
7214
|
return null;
|
|
7189
7215
|
} else {
|
|
7190
|
-
|
|
7216
|
+
meta[key] = entry;
|
|
7191
7217
|
}
|
|
7192
7218
|
}
|
|
7193
|
-
if (
|
|
7219
|
+
if (found === null || Object.keys(meta).length === 0)
|
|
7194
7220
|
return null;
|
|
7195
|
-
return
|
|
7221
|
+
return { ...found, meta };
|
|
7222
|
+
}
|
|
7223
|
+
function extractPagedRows(value) {
|
|
7224
|
+
const paged = splitPagedEnvelope(value);
|
|
7225
|
+
return paged === null ? null : paged.rows;
|
|
7196
7226
|
}
|
|
7197
7227
|
function toLowerCamelCaseKey(key) {
|
|
7198
7228
|
if (!key)
|
|
@@ -7296,6 +7326,9 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
|
|
|
7296
7326
|
}
|
|
7297
7327
|
break;
|
|
7298
7328
|
}
|
|
7329
|
+
case "markdown":
|
|
7330
|
+
logFn(renderMarkdown(data));
|
|
7331
|
+
break;
|
|
7299
7332
|
default: {
|
|
7300
7333
|
const hasData = "Data" in data && data.Data != null;
|
|
7301
7334
|
const pagedRows = hasData ? extractPagedRows(data.Data) : null;
|
|
@@ -7320,6 +7353,10 @@ function logOutput(data, format = "json", tableRowStyle) {
|
|
|
7320
7353
|
printOutput(data, format, (msg) => sink.writeOut(`${msg}
|
|
7321
7354
|
`), needsAsciiSafeJson(sink), styleFn);
|
|
7322
7355
|
}
|
|
7356
|
+
var PLUMBING_KEYS = new Set(["code", "log"]);
|
|
7357
|
+
function isPlumbingKey(key) {
|
|
7358
|
+
return PLUMBING_KEYS.has(key.toLowerCase());
|
|
7359
|
+
}
|
|
7323
7360
|
function cellToString(val) {
|
|
7324
7361
|
return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
|
|
7325
7362
|
}
|
|
@@ -7335,7 +7372,7 @@ function wrapText(text, width) {
|
|
|
7335
7372
|
function printTable(data, logFn, externalLogValue, tableRowStyle) {
|
|
7336
7373
|
if (data.length === 0)
|
|
7337
7374
|
return;
|
|
7338
|
-
const keys = Object.keys(data[0]).filter((key) => !
|
|
7375
|
+
const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
|
|
7339
7376
|
const maxWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
|
|
7340
7377
|
const header = keys.map((key, i) => key.padEnd(maxWidths[i])).join(" | ");
|
|
7341
7378
|
logFn(header);
|
|
@@ -7357,7 +7394,7 @@ function isNonEmptyPlainObject(value) {
|
|
|
7357
7394
|
}
|
|
7358
7395
|
var NESTED_INDENT = " ";
|
|
7359
7396
|
function printVerticalTable(data, logFn = console.log, externalLogValue) {
|
|
7360
|
-
const keys = Object.keys(data).filter((key) => !
|
|
7397
|
+
const keys = Object.keys(data).filter((key) => !isPlumbingKey(key));
|
|
7361
7398
|
if (keys.length === 0)
|
|
7362
7399
|
return;
|
|
7363
7400
|
const isBlockValue = (value) => isPlainObjectArray(value) || isNonEmptyPlainObject(value);
|
|
@@ -7388,7 +7425,7 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
|
|
|
7388
7425
|
function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
|
|
7389
7426
|
if (data.length === 0)
|
|
7390
7427
|
return;
|
|
7391
|
-
const keys = Object.keys(data[0]).filter((key) => !
|
|
7428
|
+
const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
|
|
7392
7429
|
if (keys.length === 0)
|
|
7393
7430
|
return;
|
|
7394
7431
|
if (!process.stdout.isTTY) {
|
|
@@ -7462,6 +7499,220 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
|
|
|
7462
7499
|
logFn(`Log: ${externalLogValue}`);
|
|
7463
7500
|
}
|
|
7464
7501
|
}
|
|
7502
|
+
var MARKDOWN_MAX_CELL = 200;
|
|
7503
|
+
var MARKDOWN_MAX_DEPTH = 3;
|
|
7504
|
+
function markdownHeading(depth) {
|
|
7505
|
+
return "#".repeat(Math.min(3 + depth, 6));
|
|
7506
|
+
}
|
|
7507
|
+
var BACKTICK_RUN = /`+/g;
|
|
7508
|
+
function fencedBlock(text) {
|
|
7509
|
+
const first = text.trimStart()[0];
|
|
7510
|
+
const language = first === "<" ? "xml" : first === "{" || first === "[" ? "json" : "";
|
|
7511
|
+
const longestRun = Math.max(0, ...Array.from(text.matchAll(BACKTICK_RUN), (match) => match[0].length));
|
|
7512
|
+
const fence = "`".repeat(Math.max(3, longestRun + 1));
|
|
7513
|
+
return `${fence}${language}
|
|
7514
|
+
${text}
|
|
7515
|
+
${fence}`;
|
|
7516
|
+
}
|
|
7517
|
+
function collapseNewlineRuns(text) {
|
|
7518
|
+
return text.split(/(\s+)/).map((part, index) => index % 2 === 1 && part.includes(`
|
|
7519
|
+
`) ? " " : part).join("");
|
|
7520
|
+
}
|
|
7521
|
+
function markdownCell(value) {
|
|
7522
|
+
const text = value instanceof Date ? value.toISOString() : cellToString(value);
|
|
7523
|
+
return collapseNewlineRuns(text).replace(/\|/g, "\\|");
|
|
7524
|
+
}
|
|
7525
|
+
function markdownLabel(key) {
|
|
7526
|
+
return collapseNewlineRuns(key).replace(/[\\`*|]/g, "\\$&");
|
|
7527
|
+
}
|
|
7528
|
+
function withoutPlumbing(record) {
|
|
7529
|
+
const kept = Object.create(null);
|
|
7530
|
+
for (const [key, value] of Object.entries(record)) {
|
|
7531
|
+
if (!isPlumbingKey(key))
|
|
7532
|
+
kept[key] = value;
|
|
7533
|
+
}
|
|
7534
|
+
return kept;
|
|
7535
|
+
}
|
|
7536
|
+
function rowsWithoutPlumbing(rows) {
|
|
7537
|
+
return rows.map((row) => isPlainRecord(row) ? withoutPlumbing(row) : row);
|
|
7538
|
+
}
|
|
7539
|
+
function markdownTable(rows) {
|
|
7540
|
+
const columns = [];
|
|
7541
|
+
const seen = new Set;
|
|
7542
|
+
for (const row of rows) {
|
|
7543
|
+
for (const key of Object.keys(row)) {
|
|
7544
|
+
if (!seen.has(key)) {
|
|
7545
|
+
seen.add(key);
|
|
7546
|
+
columns.push(key);
|
|
7547
|
+
}
|
|
7548
|
+
}
|
|
7549
|
+
}
|
|
7550
|
+
if (columns.length === 0)
|
|
7551
|
+
return null;
|
|
7552
|
+
const cells = rows.map((row) => columns.map((key) => markdownCell(row[key])));
|
|
7553
|
+
if (cells.some((row) => row.some((c) => c.length > MARKDOWN_MAX_CELL))) {
|
|
7554
|
+
return null;
|
|
7555
|
+
}
|
|
7556
|
+
return [
|
|
7557
|
+
`| ${columns.map(markdownLabel).join(" | ")} |`,
|
|
7558
|
+
`| ${columns.map(() => "---").join(" | ")} |`,
|
|
7559
|
+
...cells.map((row) => `| ${row.join(" | ")} |`)
|
|
7560
|
+
].join(`
|
|
7561
|
+
`);
|
|
7562
|
+
}
|
|
7563
|
+
function extractMessageSequence(rows) {
|
|
7564
|
+
const messages = [];
|
|
7565
|
+
for (const row of rows) {
|
|
7566
|
+
const message = extractSingleMessage(row);
|
|
7567
|
+
if (message === null)
|
|
7568
|
+
return null;
|
|
7569
|
+
messages.push(message);
|
|
7570
|
+
}
|
|
7571
|
+
return messages.join(`
|
|
7572
|
+
|
|
7573
|
+
`);
|
|
7574
|
+
}
|
|
7575
|
+
function markdownRows(rows, depth) {
|
|
7576
|
+
if (rows.length === 0)
|
|
7577
|
+
return "(none)";
|
|
7578
|
+
if (!isPlainObjectArray(rows)) {
|
|
7579
|
+
return rows.map((item) => `- ${markdownCell(item)}`).join(`
|
|
7580
|
+
`);
|
|
7581
|
+
}
|
|
7582
|
+
const prose = extractMessageSequence(rows);
|
|
7583
|
+
if (prose !== null)
|
|
7584
|
+
return prose;
|
|
7585
|
+
const table = markdownTable(rows);
|
|
7586
|
+
if (table !== null)
|
|
7587
|
+
return table;
|
|
7588
|
+
if (depth >= MARKDOWN_MAX_DEPTH) {
|
|
7589
|
+
return fencedBlock(JSON.stringify(rows, null, 2));
|
|
7590
|
+
}
|
|
7591
|
+
return rows.map((row, index) => [
|
|
7592
|
+
`${markdownHeading(depth)} ${index + 1}`,
|
|
7593
|
+
markdownObject(row, depth + 1)
|
|
7594
|
+
].join(`
|
|
7595
|
+
|
|
7596
|
+
`)).join(`
|
|
7597
|
+
|
|
7598
|
+
`);
|
|
7599
|
+
}
|
|
7600
|
+
function markdownObject(obj, depth) {
|
|
7601
|
+
const scalars = [];
|
|
7602
|
+
const blocks = [];
|
|
7603
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
7604
|
+
if (value === undefined)
|
|
7605
|
+
continue;
|
|
7606
|
+
const label = markdownLabel(key);
|
|
7607
|
+
if (Array.isArray(value)) {
|
|
7608
|
+
blocks.push(`${markdownHeading(depth)} ${label}
|
|
7609
|
+
|
|
7610
|
+
${markdownRows(value, depth + 1)}`);
|
|
7611
|
+
} else if (isNonEmptyPlainObject(value)) {
|
|
7612
|
+
const nested = depth < MARKDOWN_MAX_DEPTH ? markdownObject(value, depth + 1) : fencedBlock(JSON.stringify(value, null, 2));
|
|
7613
|
+
if (nested !== "") {
|
|
7614
|
+
blocks.push(`${markdownHeading(depth)} ${label}
|
|
7615
|
+
|
|
7616
|
+
${nested}`);
|
|
7617
|
+
}
|
|
7618
|
+
} else if (typeof value === "string" && value.includes(`
|
|
7619
|
+
`)) {
|
|
7620
|
+
blocks.push(`**${label}:**
|
|
7621
|
+
|
|
7622
|
+
${fencedBlock(value)}`);
|
|
7623
|
+
} else {
|
|
7624
|
+
scalars.push(`**${label}:** ${markdownCell(value)}`);
|
|
7625
|
+
}
|
|
7626
|
+
}
|
|
7627
|
+
const sections = scalars.length > 0 ? [scalars.join(`
|
|
7628
|
+
`)] : [];
|
|
7629
|
+
sections.push(...blocks);
|
|
7630
|
+
return sections.join(`
|
|
7631
|
+
|
|
7632
|
+
`);
|
|
7633
|
+
}
|
|
7634
|
+
function extractSingleMessage(payload) {
|
|
7635
|
+
if (!isPlainRecord(payload))
|
|
7636
|
+
return null;
|
|
7637
|
+
const keys = Object.keys(payload);
|
|
7638
|
+
if (keys.length !== 1 || keys[0].toLowerCase() !== "message")
|
|
7639
|
+
return null;
|
|
7640
|
+
const value = payload[keys[0]];
|
|
7641
|
+
return typeof value === "string" ? value : null;
|
|
7642
|
+
}
|
|
7643
|
+
function markdownPayload(payload) {
|
|
7644
|
+
const message = extractSingleMessage(payload);
|
|
7645
|
+
if (message !== null)
|
|
7646
|
+
return message;
|
|
7647
|
+
if (Array.isArray(payload)) {
|
|
7648
|
+
return markdownRows(rowsWithoutPlumbing(payload), 0);
|
|
7649
|
+
}
|
|
7650
|
+
const visible = withoutPlumbing(payload);
|
|
7651
|
+
const paged = splitPagedEnvelope(visible);
|
|
7652
|
+
if (paged !== null) {
|
|
7653
|
+
const meta = markdownObject(paged.meta, 0);
|
|
7654
|
+
const rows = `${markdownHeading(0)} ${markdownLabel(paged.key)}
|
|
7655
|
+
|
|
7656
|
+
${markdownRows(rowsWithoutPlumbing(paged.rows), 1)}`;
|
|
7657
|
+
return meta === "" ? rows : `${meta}
|
|
7658
|
+
|
|
7659
|
+
${rows}`;
|
|
7660
|
+
}
|
|
7661
|
+
return markdownObject(visible, 0);
|
|
7662
|
+
}
|
|
7663
|
+
function isPaginationWorthShowing(value) {
|
|
7664
|
+
if (typeof value !== "object" || value === null)
|
|
7665
|
+
return false;
|
|
7666
|
+
const page = value;
|
|
7667
|
+
return page.HasMore === true || typeof page.Offset === "number" && page.Offset > 0;
|
|
7668
|
+
}
|
|
7669
|
+
function markdownEnvelopeNotes(data) {
|
|
7670
|
+
const envelope = data;
|
|
7671
|
+
const notes = [];
|
|
7672
|
+
const warning = envelope.Warning;
|
|
7673
|
+
if (typeof warning === "string" && warning !== "") {
|
|
7674
|
+
notes.push(`> **Warning:** ${warning}`);
|
|
7675
|
+
}
|
|
7676
|
+
const instructions = envelope.Instructions;
|
|
7677
|
+
if (typeof instructions === "string" && instructions !== "") {
|
|
7678
|
+
notes.push(`> ${instructions}`);
|
|
7679
|
+
}
|
|
7680
|
+
const pagination = envelope.Pagination;
|
|
7681
|
+
if (isPaginationWorthShowing(pagination)) {
|
|
7682
|
+
const body = markdownObject(pagination, 1);
|
|
7683
|
+
if (body !== "") {
|
|
7684
|
+
notes.push(`${markdownHeading(0)} Pagination
|
|
7685
|
+
|
|
7686
|
+
${body}`);
|
|
7687
|
+
}
|
|
7688
|
+
}
|
|
7689
|
+
const log = envelope.Log;
|
|
7690
|
+
if (typeof log === "string" && log !== "") {
|
|
7691
|
+
notes.push(`**Log:** ${log}`);
|
|
7692
|
+
}
|
|
7693
|
+
return notes;
|
|
7694
|
+
}
|
|
7695
|
+
function renderMarkdown(data) {
|
|
7696
|
+
if (data.Result !== RESULTS.Success) {
|
|
7697
|
+
const failure = data;
|
|
7698
|
+
const sections = [`**Failed:** ${failure.Message}`];
|
|
7699
|
+
if (failure.Data != null) {
|
|
7700
|
+
sections.push(markdownPayload(failure.Data));
|
|
7701
|
+
}
|
|
7702
|
+
if (failure.Instructions) {
|
|
7703
|
+
sections.push(`> ${failure.Instructions}`);
|
|
7704
|
+
}
|
|
7705
|
+
return sections.filter((section) => section !== "").join(`
|
|
7706
|
+
|
|
7707
|
+
`);
|
|
7708
|
+
}
|
|
7709
|
+
if (!("Data" in data) || data.Data == null) {
|
|
7710
|
+
return markdownObject(withoutPlumbing(data), 0);
|
|
7711
|
+
}
|
|
7712
|
+
return [markdownPayload(data.Data), ...markdownEnvelopeNotes(data)].filter((section) => section !== "").join(`
|
|
7713
|
+
|
|
7714
|
+
`);
|
|
7715
|
+
}
|
|
7465
7716
|
function toYaml(data) {
|
|
7466
7717
|
const codec = getYamlCodec();
|
|
7467
7718
|
if (!codec) {
|
|
@@ -9546,4 +9797,4 @@ var registerCommands = async (program2) => {
|
|
|
9546
9797
|
|
|
9547
9798
|
export { Command, metadata, registerCommands };
|
|
9548
9799
|
|
|
9549
|
-
//# debugId=
|
|
9800
|
+
//# debugId=18DF4FB6F1833B8464756E2164756E21
|
package/dist/tool.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/apms-tool",
|
|
3
|
+
"author": "UiPath",
|
|
3
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
4
|
-
"version": "1.
|
|
5
|
+
"version": "1.203.0-preview.160",
|
|
5
6
|
"description": "CLI plugin for the UiPath Access Policy Management Service.",
|
|
6
7
|
"private": false,
|
|
7
8
|
"repository": {
|
|
@@ -26,5 +27,5 @@
|
|
|
26
27
|
"files": [
|
|
27
28
|
"dist"
|
|
28
29
|
],
|
|
29
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "3a42062ba731afca4595ba9aa8a80afc9667528d"
|
|
30
31
|
}
|