@uipath/common 1.202.1 → 1.203.0-preview.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD-PARTY-NOTICES.md +32 -1
- package/dist/catch-error.js +17 -1
- package/dist/command-help.d.ts +1 -1
- package/dist/entity-name-rules.js +17 -1
- package/dist/formatter.d.ts +33 -1
- package/dist/guid.js +17 -1
- package/dist/index.browser.d.ts +1 -0
- package/dist/index.browser.js +70 -16
- package/dist/index.js +326 -30
- package/dist/logger.d.ts +1 -1
- package/dist/output-format-context.d.ts +1 -1
- package/dist/output-formats.d.ts +34 -0
- package/dist/registry.d.ts +5 -0
- package/dist/telemetry/index.js +9 -6
- package/dist/timings.d.ts +19 -0
- package/dist/zip.d.ts +14 -0
- package/dist/zip.js +1380 -0
- package/package.json +7 -2
package/dist/index.js
CHANGED
|
@@ -7897,7 +7897,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
|
|
|
7897
7897
|
var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
7898
7898
|
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
7899
7899
|
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
7900
|
-
var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
7900
|
+
var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
7901
7901
|
var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
|
|
7902
7902
|
var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
|
|
7903
7903
|
var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
|
|
@@ -7944,7 +7944,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
|
|
|
7944
7944
|
`(?<![A-Za-z0-9])"(?:[^\\
|
|
7945
7945
|
]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
|
|
7946
7946
|
].join("|"), "g");
|
|
7947
|
-
var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
|
|
7947
|
+
var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
|
|
7948
7948
|
var COLLAPSED_BODY = "{…}";
|
|
7949
7949
|
var COLLAPSED_BODY_MARKER = "\x01body\x01";
|
|
7950
7950
|
var MAX_BODY_NESTING = 8;
|
|
@@ -7959,10 +7959,13 @@ function collapseJsonBodies(text) {
|
|
|
7959
7959
|
}
|
|
7960
7960
|
return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
|
|
7961
7961
|
}
|
|
7962
|
-
var TRAILING_PROSE_PUNCT =
|
|
7962
|
+
var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
|
|
7963
7963
|
function peelTrailingPunctuation(match) {
|
|
7964
|
-
|
|
7965
|
-
|
|
7964
|
+
let end = match.length;
|
|
7965
|
+
while (end > 0 && TRAILING_PROSE_PUNCT.includes(match[end - 1])) {
|
|
7966
|
+
end -= 1;
|
|
7967
|
+
}
|
|
7968
|
+
return [match.slice(0, end), match.slice(end)];
|
|
7966
7969
|
}
|
|
7967
7970
|
function redactUrl(raw) {
|
|
7968
7971
|
try {
|
|
@@ -8302,6 +8305,22 @@ function parseHttpStatusFromMessage(message) {
|
|
|
8302
8305
|
const status = Number(match[1]);
|
|
8303
8306
|
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
8304
8307
|
}
|
|
8308
|
+
function findHttpStatusInGraph(error) {
|
|
8309
|
+
for (const node of walkErrorGraph(error)) {
|
|
8310
|
+
const response = node.response;
|
|
8311
|
+
const explicit = typeof node.status === "number" ? node.status : response?.status;
|
|
8312
|
+
if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
|
|
8313
|
+
return explicit;
|
|
8314
|
+
}
|
|
8315
|
+
if (typeof node.message === "string") {
|
|
8316
|
+
const parsed = parseHttpStatusFromMessage(node.message);
|
|
8317
|
+
if (parsed !== undefined && parsed >= 400) {
|
|
8318
|
+
return parsed;
|
|
8319
|
+
}
|
|
8320
|
+
}
|
|
8321
|
+
}
|
|
8322
|
+
return;
|
|
8323
|
+
}
|
|
8305
8324
|
function isHtmlDocument(body) {
|
|
8306
8325
|
return /^\s*(<!doctype html|<html\b)/i.test(body);
|
|
8307
8326
|
}
|
|
@@ -8415,7 +8434,8 @@ async function extractErrorDetails(error, options) {
|
|
|
8415
8434
|
}
|
|
8416
8435
|
let message;
|
|
8417
8436
|
let result = "Failure";
|
|
8418
|
-
const
|
|
8437
|
+
const classificationStatus = status ?? findHttpStatusInGraph(error);
|
|
8438
|
+
const classification = classifyError(classificationStatus, error);
|
|
8419
8439
|
let retry = classification.retry;
|
|
8420
8440
|
if (status === 401) {
|
|
8421
8441
|
message = DEFAULT_401;
|
|
@@ -8491,8 +8511,8 @@ async function extractErrorDetails(error, options) {
|
|
|
8491
8511
|
details = describeThrownValue(error);
|
|
8492
8512
|
}
|
|
8493
8513
|
const context = {};
|
|
8494
|
-
if (
|
|
8495
|
-
context.httpStatus =
|
|
8514
|
+
if (classificationStatus) {
|
|
8515
|
+
context.httpStatus = classificationStatus;
|
|
8496
8516
|
}
|
|
8497
8517
|
if (parsedBody?.errorCode && typeof parsedBody.errorCode === "string") {
|
|
8498
8518
|
context.errorCode = parsedBody.errorCode;
|
|
@@ -8953,6 +8973,18 @@ function getOutputFilter() {
|
|
|
8953
8973
|
return filterSlot.get();
|
|
8954
8974
|
}
|
|
8955
8975
|
|
|
8976
|
+
// src/output-formats.ts
|
|
8977
|
+
var OUTPUT_FORMATS = [
|
|
8978
|
+
"table",
|
|
8979
|
+
"json",
|
|
8980
|
+
"yaml",
|
|
8981
|
+
"plain",
|
|
8982
|
+
"markdown"
|
|
8983
|
+
];
|
|
8984
|
+
function isOutputFormat(value) {
|
|
8985
|
+
return OUTPUT_FORMATS.includes(value);
|
|
8986
|
+
}
|
|
8987
|
+
|
|
8956
8988
|
// src/telemetry/command-terminal.ts
|
|
8957
8989
|
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
8958
8990
|
var AUTH_ERROR_CODES = new Set([
|
|
@@ -9191,7 +9223,8 @@ function readRegistryValue(keyPath, valueName) {
|
|
|
9191
9223
|
}
|
|
9192
9224
|
const [error, output] = catchError(() => execFileSync2("reg", ["query", keyPath, "/v", valueName], {
|
|
9193
9225
|
encoding: "utf-8",
|
|
9194
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
9226
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
9227
|
+
windowsHide: true
|
|
9195
9228
|
}));
|
|
9196
9229
|
if (error) {
|
|
9197
9230
|
return "";
|
|
@@ -9800,6 +9833,7 @@ class TelemetryService {
|
|
|
9800
9833
|
}
|
|
9801
9834
|
// src/timings.ts
|
|
9802
9835
|
var TIMINGS_ENV_VAR = "UIP_TIMINGS";
|
|
9836
|
+
var TIMINGS_FILE_ENV_VAR = "UIP_TIMINGS_FILE";
|
|
9803
9837
|
var TIMINGS_LINE_PREFIX = "[timing]";
|
|
9804
9838
|
function createStorage2() {
|
|
9805
9839
|
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
@@ -9866,7 +9900,7 @@ async function runWithTimings(fallbackCommand, fn) {
|
|
|
9866
9900
|
}
|
|
9867
9901
|
}
|
|
9868
9902
|
if (timingsEnabled()) {
|
|
9869
|
-
emitTimingReport(state, fallbackCommand);
|
|
9903
|
+
await emitTimingReport(state, fallbackCommand);
|
|
9870
9904
|
}
|
|
9871
9905
|
}
|
|
9872
9906
|
});
|
|
@@ -9882,6 +9916,13 @@ function timingsEnabled() {
|
|
|
9882
9916
|
const normalized = value.trim().toLowerCase();
|
|
9883
9917
|
return normalized === "1" || normalized === "true";
|
|
9884
9918
|
}
|
|
9919
|
+
function timingsFile() {
|
|
9920
|
+
if (typeof process === "undefined") {
|
|
9921
|
+
return;
|
|
9922
|
+
}
|
|
9923
|
+
const value = process.env?.[TIMINGS_FILE_ENV_VAR]?.trim();
|
|
9924
|
+
return value === undefined || value === "" ? undefined : value;
|
|
9925
|
+
}
|
|
9885
9926
|
function setTimingCommand(command) {
|
|
9886
9927
|
if (!timingsEnabled()) {
|
|
9887
9928
|
return;
|
|
@@ -9968,12 +10009,12 @@ function formatTimingReport(args) {
|
|
|
9968
10009
|
parts.push(`flush=${total - startup - command}ms`);
|
|
9969
10010
|
return parts.join(" ");
|
|
9970
10011
|
}
|
|
9971
|
-
function emitTimingReport(state, fallbackCommand) {
|
|
10012
|
+
async function emitTimingReport(state, fallbackCommand) {
|
|
9972
10013
|
if (state.suppressed) {
|
|
9973
10014
|
return;
|
|
9974
10015
|
}
|
|
9975
10016
|
const now = performance.now();
|
|
9976
|
-
|
|
10017
|
+
const line = formatTimingReport({
|
|
9977
10018
|
command: state.command ?? fallbackCommand,
|
|
9978
10019
|
exitCode: state.exitCode ?? 0,
|
|
9979
10020
|
totalMs: now - state.baseline,
|
|
@@ -9985,7 +10026,17 @@ function emitTimingReport(state, fallbackCommand) {
|
|
|
9985
10026
|
},
|
|
9986
10027
|
httpMs: state.httpMs,
|
|
9987
10028
|
httpCalls: state.httpCalls
|
|
9988
|
-
})
|
|
10029
|
+
});
|
|
10030
|
+
const file = timingsFile();
|
|
10031
|
+
if (file === undefined) {
|
|
10032
|
+
logger.report(line);
|
|
10033
|
+
return;
|
|
10034
|
+
}
|
|
10035
|
+
const [error] = await catchError(() => getFileSystem().appendFile(file, `${line}
|
|
10036
|
+
`));
|
|
10037
|
+
if (error) {
|
|
10038
|
+
logger.report(line);
|
|
10039
|
+
}
|
|
9989
10040
|
}
|
|
9990
10041
|
|
|
9991
10042
|
// src/telemetry/tracked-fetch.ts
|
|
@@ -10930,28 +10981,32 @@ function isPlainRecord(value) {
|
|
|
10930
10981
|
const prototype = Object.getPrototypeOf(value);
|
|
10931
10982
|
return prototype === Object.prototype || prototype === null;
|
|
10932
10983
|
}
|
|
10933
|
-
function
|
|
10984
|
+
function splitPagedEnvelope(value) {
|
|
10934
10985
|
if (Array.isArray(value) || !isPlainRecord(value))
|
|
10935
10986
|
return null;
|
|
10936
|
-
const entries = Object.
|
|
10987
|
+
const entries = Object.entries(value);
|
|
10937
10988
|
if (entries.length === 0)
|
|
10938
10989
|
return null;
|
|
10939
|
-
let
|
|
10940
|
-
|
|
10941
|
-
for (const entry of entries) {
|
|
10990
|
+
let found = null;
|
|
10991
|
+
const meta = Object.create(null);
|
|
10992
|
+
for (const [key, entry] of entries) {
|
|
10942
10993
|
if (Array.isArray(entry)) {
|
|
10943
|
-
if (
|
|
10994
|
+
if (found !== null)
|
|
10944
10995
|
return null;
|
|
10945
|
-
|
|
10996
|
+
found = { key, rows: entry };
|
|
10946
10997
|
} else if (entry !== null && typeof entry === "object") {
|
|
10947
10998
|
return null;
|
|
10948
10999
|
} else {
|
|
10949
|
-
|
|
11000
|
+
meta[key] = entry;
|
|
10950
11001
|
}
|
|
10951
11002
|
}
|
|
10952
|
-
if (
|
|
11003
|
+
if (found === null || Object.keys(meta).length === 0)
|
|
10953
11004
|
return null;
|
|
10954
|
-
return
|
|
11005
|
+
return { ...found, meta };
|
|
11006
|
+
}
|
|
11007
|
+
function extractPagedRows(value) {
|
|
11008
|
+
const paged = splitPagedEnvelope(value);
|
|
11009
|
+
return paged === null ? null : paged.rows;
|
|
10955
11010
|
}
|
|
10956
11011
|
function toLowerCamelCaseKey(key) {
|
|
10957
11012
|
if (!key)
|
|
@@ -11055,6 +11110,9 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
|
|
|
11055
11110
|
}
|
|
11056
11111
|
break;
|
|
11057
11112
|
}
|
|
11113
|
+
case "markdown":
|
|
11114
|
+
logFn(renderMarkdown(data));
|
|
11115
|
+
break;
|
|
11058
11116
|
default: {
|
|
11059
11117
|
const hasData = "Data" in data && data.Data != null;
|
|
11060
11118
|
const pagedRows = hasData ? extractPagedRows(data.Data) : null;
|
|
@@ -11079,6 +11137,10 @@ function logOutput(data, format = "json", tableRowStyle) {
|
|
|
11079
11137
|
printOutput(data, format, (msg) => sink.writeOut(`${msg}
|
|
11080
11138
|
`), needsAsciiSafeJson(sink), styleFn);
|
|
11081
11139
|
}
|
|
11140
|
+
var PLUMBING_KEYS = new Set(["code", "log"]);
|
|
11141
|
+
function isPlumbingKey(key) {
|
|
11142
|
+
return PLUMBING_KEYS.has(key.toLowerCase());
|
|
11143
|
+
}
|
|
11082
11144
|
function cellToString(val) {
|
|
11083
11145
|
return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
|
|
11084
11146
|
}
|
|
@@ -11094,7 +11156,7 @@ function wrapText(text, width) {
|
|
|
11094
11156
|
function printTable(data, logFn, externalLogValue, tableRowStyle) {
|
|
11095
11157
|
if (data.length === 0)
|
|
11096
11158
|
return;
|
|
11097
|
-
const keys = Object.keys(data[0]).filter((key) => !
|
|
11159
|
+
const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
|
|
11098
11160
|
const maxWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
|
|
11099
11161
|
const header = keys.map((key, i) => key.padEnd(maxWidths[i])).join(" | ");
|
|
11100
11162
|
logFn(header);
|
|
@@ -11116,7 +11178,7 @@ function isNonEmptyPlainObject(value) {
|
|
|
11116
11178
|
}
|
|
11117
11179
|
var NESTED_INDENT = " ";
|
|
11118
11180
|
function printVerticalTable(data, logFn = console.log, externalLogValue) {
|
|
11119
|
-
const keys = Object.keys(data).filter((key) => !
|
|
11181
|
+
const keys = Object.keys(data).filter((key) => !isPlumbingKey(key));
|
|
11120
11182
|
if (keys.length === 0)
|
|
11121
11183
|
return;
|
|
11122
11184
|
const isBlockValue = (value) => isPlainObjectArray(value) || isNonEmptyPlainObject(value);
|
|
@@ -11147,7 +11209,7 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
|
|
|
11147
11209
|
function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
|
|
11148
11210
|
if (data.length === 0)
|
|
11149
11211
|
return;
|
|
11150
|
-
const keys = Object.keys(data[0]).filter((key) => !
|
|
11212
|
+
const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
|
|
11151
11213
|
if (keys.length === 0)
|
|
11152
11214
|
return;
|
|
11153
11215
|
if (!process.stdout.isTTY) {
|
|
@@ -11221,6 +11283,220 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
|
|
|
11221
11283
|
logFn(`Log: ${externalLogValue}`);
|
|
11222
11284
|
}
|
|
11223
11285
|
}
|
|
11286
|
+
var MARKDOWN_MAX_CELL = 200;
|
|
11287
|
+
var MARKDOWN_MAX_DEPTH = 3;
|
|
11288
|
+
function markdownHeading(depth) {
|
|
11289
|
+
return "#".repeat(Math.min(3 + depth, 6));
|
|
11290
|
+
}
|
|
11291
|
+
var BACKTICK_RUN = /`+/g;
|
|
11292
|
+
function fencedBlock(text) {
|
|
11293
|
+
const first = text.trimStart()[0];
|
|
11294
|
+
const language = first === "<" ? "xml" : first === "{" || first === "[" ? "json" : "";
|
|
11295
|
+
const longestRun = Math.max(0, ...Array.from(text.matchAll(BACKTICK_RUN), (match) => match[0].length));
|
|
11296
|
+
const fence = "`".repeat(Math.max(3, longestRun + 1));
|
|
11297
|
+
return `${fence}${language}
|
|
11298
|
+
${text}
|
|
11299
|
+
${fence}`;
|
|
11300
|
+
}
|
|
11301
|
+
function collapseNewlineRuns(text) {
|
|
11302
|
+
return text.split(/(\s+)/).map((part, index) => index % 2 === 1 && part.includes(`
|
|
11303
|
+
`) ? " " : part).join("");
|
|
11304
|
+
}
|
|
11305
|
+
function markdownCell(value) {
|
|
11306
|
+
const text = value instanceof Date ? value.toISOString() : cellToString(value);
|
|
11307
|
+
return collapseNewlineRuns(text).replace(/\|/g, "\\|");
|
|
11308
|
+
}
|
|
11309
|
+
function markdownLabel(key) {
|
|
11310
|
+
return collapseNewlineRuns(key).replace(/[\\`*|]/g, "\\$&");
|
|
11311
|
+
}
|
|
11312
|
+
function withoutPlumbing(record) {
|
|
11313
|
+
const kept = Object.create(null);
|
|
11314
|
+
for (const [key, value] of Object.entries(record)) {
|
|
11315
|
+
if (!isPlumbingKey(key))
|
|
11316
|
+
kept[key] = value;
|
|
11317
|
+
}
|
|
11318
|
+
return kept;
|
|
11319
|
+
}
|
|
11320
|
+
function rowsWithoutPlumbing(rows) {
|
|
11321
|
+
return rows.map((row) => isPlainRecord(row) ? withoutPlumbing(row) : row);
|
|
11322
|
+
}
|
|
11323
|
+
function markdownTable(rows) {
|
|
11324
|
+
const columns = [];
|
|
11325
|
+
const seen = new Set;
|
|
11326
|
+
for (const row of rows) {
|
|
11327
|
+
for (const key of Object.keys(row)) {
|
|
11328
|
+
if (!seen.has(key)) {
|
|
11329
|
+
seen.add(key);
|
|
11330
|
+
columns.push(key);
|
|
11331
|
+
}
|
|
11332
|
+
}
|
|
11333
|
+
}
|
|
11334
|
+
if (columns.length === 0)
|
|
11335
|
+
return null;
|
|
11336
|
+
const cells = rows.map((row) => columns.map((key) => markdownCell(row[key])));
|
|
11337
|
+
if (cells.some((row) => row.some((c) => c.length > MARKDOWN_MAX_CELL))) {
|
|
11338
|
+
return null;
|
|
11339
|
+
}
|
|
11340
|
+
return [
|
|
11341
|
+
`| ${columns.map(markdownLabel).join(" | ")} |`,
|
|
11342
|
+
`| ${columns.map(() => "---").join(" | ")} |`,
|
|
11343
|
+
...cells.map((row) => `| ${row.join(" | ")} |`)
|
|
11344
|
+
].join(`
|
|
11345
|
+
`);
|
|
11346
|
+
}
|
|
11347
|
+
function extractMessageSequence(rows) {
|
|
11348
|
+
const messages = [];
|
|
11349
|
+
for (const row of rows) {
|
|
11350
|
+
const message = extractSingleMessage(row);
|
|
11351
|
+
if (message === null)
|
|
11352
|
+
return null;
|
|
11353
|
+
messages.push(message);
|
|
11354
|
+
}
|
|
11355
|
+
return messages.join(`
|
|
11356
|
+
|
|
11357
|
+
`);
|
|
11358
|
+
}
|
|
11359
|
+
function markdownRows(rows, depth) {
|
|
11360
|
+
if (rows.length === 0)
|
|
11361
|
+
return "(none)";
|
|
11362
|
+
if (!isPlainObjectArray(rows)) {
|
|
11363
|
+
return rows.map((item) => `- ${markdownCell(item)}`).join(`
|
|
11364
|
+
`);
|
|
11365
|
+
}
|
|
11366
|
+
const prose = extractMessageSequence(rows);
|
|
11367
|
+
if (prose !== null)
|
|
11368
|
+
return prose;
|
|
11369
|
+
const table = markdownTable(rows);
|
|
11370
|
+
if (table !== null)
|
|
11371
|
+
return table;
|
|
11372
|
+
if (depth >= MARKDOWN_MAX_DEPTH) {
|
|
11373
|
+
return fencedBlock(JSON.stringify(rows, null, 2));
|
|
11374
|
+
}
|
|
11375
|
+
return rows.map((row, index) => [
|
|
11376
|
+
`${markdownHeading(depth)} ${index + 1}`,
|
|
11377
|
+
markdownObject(row, depth + 1)
|
|
11378
|
+
].join(`
|
|
11379
|
+
|
|
11380
|
+
`)).join(`
|
|
11381
|
+
|
|
11382
|
+
`);
|
|
11383
|
+
}
|
|
11384
|
+
function markdownObject(obj, depth) {
|
|
11385
|
+
const scalars = [];
|
|
11386
|
+
const blocks = [];
|
|
11387
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
11388
|
+
if (value === undefined)
|
|
11389
|
+
continue;
|
|
11390
|
+
const label = markdownLabel(key);
|
|
11391
|
+
if (Array.isArray(value)) {
|
|
11392
|
+
blocks.push(`${markdownHeading(depth)} ${label}
|
|
11393
|
+
|
|
11394
|
+
${markdownRows(value, depth + 1)}`);
|
|
11395
|
+
} else if (isNonEmptyPlainObject(value)) {
|
|
11396
|
+
const nested = depth < MARKDOWN_MAX_DEPTH ? markdownObject(value, depth + 1) : fencedBlock(JSON.stringify(value, null, 2));
|
|
11397
|
+
if (nested !== "") {
|
|
11398
|
+
blocks.push(`${markdownHeading(depth)} ${label}
|
|
11399
|
+
|
|
11400
|
+
${nested}`);
|
|
11401
|
+
}
|
|
11402
|
+
} else if (typeof value === "string" && value.includes(`
|
|
11403
|
+
`)) {
|
|
11404
|
+
blocks.push(`**${label}:**
|
|
11405
|
+
|
|
11406
|
+
${fencedBlock(value)}`);
|
|
11407
|
+
} else {
|
|
11408
|
+
scalars.push(`**${label}:** ${markdownCell(value)}`);
|
|
11409
|
+
}
|
|
11410
|
+
}
|
|
11411
|
+
const sections = scalars.length > 0 ? [scalars.join(`
|
|
11412
|
+
`)] : [];
|
|
11413
|
+
sections.push(...blocks);
|
|
11414
|
+
return sections.join(`
|
|
11415
|
+
|
|
11416
|
+
`);
|
|
11417
|
+
}
|
|
11418
|
+
function extractSingleMessage(payload) {
|
|
11419
|
+
if (!isPlainRecord(payload))
|
|
11420
|
+
return null;
|
|
11421
|
+
const keys = Object.keys(payload);
|
|
11422
|
+
if (keys.length !== 1 || keys[0].toLowerCase() !== "message")
|
|
11423
|
+
return null;
|
|
11424
|
+
const value = payload[keys[0]];
|
|
11425
|
+
return typeof value === "string" ? value : null;
|
|
11426
|
+
}
|
|
11427
|
+
function markdownPayload(payload) {
|
|
11428
|
+
const message = extractSingleMessage(payload);
|
|
11429
|
+
if (message !== null)
|
|
11430
|
+
return message;
|
|
11431
|
+
if (Array.isArray(payload)) {
|
|
11432
|
+
return markdownRows(rowsWithoutPlumbing(payload), 0);
|
|
11433
|
+
}
|
|
11434
|
+
const visible = withoutPlumbing(payload);
|
|
11435
|
+
const paged = splitPagedEnvelope(visible);
|
|
11436
|
+
if (paged !== null) {
|
|
11437
|
+
const meta = markdownObject(paged.meta, 0);
|
|
11438
|
+
const rows = `${markdownHeading(0)} ${markdownLabel(paged.key)}
|
|
11439
|
+
|
|
11440
|
+
${markdownRows(rowsWithoutPlumbing(paged.rows), 1)}`;
|
|
11441
|
+
return meta === "" ? rows : `${meta}
|
|
11442
|
+
|
|
11443
|
+
${rows}`;
|
|
11444
|
+
}
|
|
11445
|
+
return markdownObject(visible, 0);
|
|
11446
|
+
}
|
|
11447
|
+
function isPaginationWorthShowing(value) {
|
|
11448
|
+
if (typeof value !== "object" || value === null)
|
|
11449
|
+
return false;
|
|
11450
|
+
const page = value;
|
|
11451
|
+
return page.HasMore === true || typeof page.Offset === "number" && page.Offset > 0;
|
|
11452
|
+
}
|
|
11453
|
+
function markdownEnvelopeNotes(data) {
|
|
11454
|
+
const envelope = data;
|
|
11455
|
+
const notes = [];
|
|
11456
|
+
const warning = envelope.Warning;
|
|
11457
|
+
if (typeof warning === "string" && warning !== "") {
|
|
11458
|
+
notes.push(`> **Warning:** ${warning}`);
|
|
11459
|
+
}
|
|
11460
|
+
const instructions = envelope.Instructions;
|
|
11461
|
+
if (typeof instructions === "string" && instructions !== "") {
|
|
11462
|
+
notes.push(`> ${instructions}`);
|
|
11463
|
+
}
|
|
11464
|
+
const pagination = envelope.Pagination;
|
|
11465
|
+
if (isPaginationWorthShowing(pagination)) {
|
|
11466
|
+
const body = markdownObject(pagination, 1);
|
|
11467
|
+
if (body !== "") {
|
|
11468
|
+
notes.push(`${markdownHeading(0)} Pagination
|
|
11469
|
+
|
|
11470
|
+
${body}`);
|
|
11471
|
+
}
|
|
11472
|
+
}
|
|
11473
|
+
const log = envelope.Log;
|
|
11474
|
+
if (typeof log === "string" && log !== "") {
|
|
11475
|
+
notes.push(`**Log:** ${log}`);
|
|
11476
|
+
}
|
|
11477
|
+
return notes;
|
|
11478
|
+
}
|
|
11479
|
+
function renderMarkdown(data) {
|
|
11480
|
+
if (data.Result !== RESULTS.Success) {
|
|
11481
|
+
const failure = data;
|
|
11482
|
+
const sections = [`**Failed:** ${failure.Message}`];
|
|
11483
|
+
if (failure.Data != null) {
|
|
11484
|
+
sections.push(markdownPayload(failure.Data));
|
|
11485
|
+
}
|
|
11486
|
+
if (failure.Instructions) {
|
|
11487
|
+
sections.push(`> ${failure.Instructions}`);
|
|
11488
|
+
}
|
|
11489
|
+
return sections.filter((section) => section !== "").join(`
|
|
11490
|
+
|
|
11491
|
+
`);
|
|
11492
|
+
}
|
|
11493
|
+
if (!("Data" in data) || data.Data == null) {
|
|
11494
|
+
return markdownObject(withoutPlumbing(data), 0);
|
|
11495
|
+
}
|
|
11496
|
+
return [markdownPayload(data.Data), ...markdownEnvelopeNotes(data)].filter((section) => section !== "").join(`
|
|
11497
|
+
|
|
11498
|
+
`);
|
|
11499
|
+
}
|
|
11224
11500
|
function toYaml(data) {
|
|
11225
11501
|
const codec = getYamlCodec();
|
|
11226
11502
|
if (!codec) {
|
|
@@ -11273,6 +11549,20 @@ class FilterImplicitLimitError extends Error {
|
|
|
11273
11549
|
this.instructions = "Pass --limit <n> to choose how many records the filter applies to. " + "To filter over all records, pass the command's maximum accepted --limit (see the option's description in --help).";
|
|
11274
11550
|
}
|
|
11275
11551
|
}
|
|
11552
|
+
|
|
11553
|
+
class ConfigurationError extends Error {
|
|
11554
|
+
__brand = "ConfigurationError";
|
|
11555
|
+
errorCode = "configuration_error";
|
|
11556
|
+
retry = "RetryWillNotFix";
|
|
11557
|
+
result = RESULTS.ConfigError;
|
|
11558
|
+
constructor(message) {
|
|
11559
|
+
super(message);
|
|
11560
|
+
this.name = "ConfigurationError";
|
|
11561
|
+
}
|
|
11562
|
+
}
|
|
11563
|
+
function isConfigurationError(error) {
|
|
11564
|
+
return typeof error === "object" && error !== null && "__brand" in error && error.__brand === "ConfigurationError";
|
|
11565
|
+
}
|
|
11276
11566
|
function applyFilter(data, filter) {
|
|
11277
11567
|
const codec = requireJmespath();
|
|
11278
11568
|
let result;
|
|
@@ -11999,18 +12289,17 @@ function extractCommandHelp(cmd, helper) {
|
|
|
11999
12289
|
}
|
|
12000
12290
|
return result;
|
|
12001
12291
|
}
|
|
12002
|
-
var VALID_FORMATS = ["table", "json", "yaml", "plain"];
|
|
12003
12292
|
function extractFormatFromArgs(args) {
|
|
12004
12293
|
for (let i = 0;i < args.length; i++) {
|
|
12005
12294
|
if (args[i] === "--output" && i + 1 < args.length) {
|
|
12006
12295
|
const value = args[i + 1];
|
|
12007
|
-
if (
|
|
12296
|
+
if (isOutputFormat(value)) {
|
|
12008
12297
|
return value;
|
|
12009
12298
|
}
|
|
12010
12299
|
}
|
|
12011
12300
|
if (args[i]?.startsWith("--output=")) {
|
|
12012
12301
|
const value = args[i].substring("--output=".length);
|
|
12013
|
-
if (
|
|
12302
|
+
if (isOutputFormat(value)) {
|
|
12014
12303
|
return value;
|
|
12015
12304
|
}
|
|
12016
12305
|
}
|
|
@@ -13509,6 +13798,7 @@ export {
|
|
|
13509
13798
|
CLI_ERROR_CODES,
|
|
13510
13799
|
CONFIG_FILENAME,
|
|
13511
13800
|
CommonTelemetryEvents,
|
|
13801
|
+
ConfigurationError,
|
|
13512
13802
|
ConsoleTelemetryProvider,
|
|
13513
13803
|
DEFAULT_AUTH_TIMEOUT_MS,
|
|
13514
13804
|
DEFAULT_BASE_URL,
|
|
@@ -13530,6 +13820,7 @@ export {
|
|
|
13530
13820
|
MAX_SPOOL_FILES,
|
|
13531
13821
|
MIN_INTERVAL_MS,
|
|
13532
13822
|
NodeContextStorage,
|
|
13823
|
+
OUTPUT_FORMATS,
|
|
13533
13824
|
OutputFormatter,
|
|
13534
13825
|
POLL_DEFAULTS,
|
|
13535
13826
|
Pagination,
|
|
@@ -13548,6 +13839,7 @@ export {
|
|
|
13548
13839
|
TELEMETRY_SESSION_SOURCE_PROPERTY,
|
|
13549
13840
|
TELEMETRY_TRACEPARENT_ENV,
|
|
13550
13841
|
TIMINGS_ENV_VAR,
|
|
13842
|
+
TIMINGS_FILE_ENV_VAR,
|
|
13551
13843
|
TIMINGS_LINE_PREFIX,
|
|
13552
13844
|
TelemetryService,
|
|
13553
13845
|
UIPATH_HOME_DIR,
|
|
@@ -13595,6 +13887,7 @@ export {
|
|
|
13595
13887
|
extractErrorMessage,
|
|
13596
13888
|
extractErrorMessageSync,
|
|
13597
13889
|
extractFormatFromArgs,
|
|
13890
|
+
extractSingleMessage,
|
|
13598
13891
|
findReservedNameError,
|
|
13599
13892
|
formatErrorChain,
|
|
13600
13893
|
formatTimingReport,
|
|
@@ -13633,9 +13926,11 @@ export {
|
|
|
13633
13926
|
invocationElapsedMs,
|
|
13634
13927
|
invocationStartedAt,
|
|
13635
13928
|
isCliErrorCode,
|
|
13929
|
+
isConfigurationError,
|
|
13636
13930
|
isFailureStatus,
|
|
13637
13931
|
isGuid,
|
|
13638
13932
|
isHtmlDocument,
|
|
13933
|
+
isOutputFormat,
|
|
13639
13934
|
isPreviewBuild,
|
|
13640
13935
|
isRetryHint,
|
|
13641
13936
|
isSuccessStatus,
|
|
@@ -13725,6 +14020,7 @@ export {
|
|
|
13725
14020
|
telemetryInit,
|
|
13726
14021
|
telemetryShutdownWithoutFlush,
|
|
13727
14022
|
timingsEnabled,
|
|
14023
|
+
timingsFile,
|
|
13728
14024
|
trackShipSucceeded,
|
|
13729
14025
|
unsupportedSolutionProjectType,
|
|
13730
14026
|
validateName,
|
|
@@ -13736,4 +14032,4 @@ export {
|
|
|
13736
14032
|
writeTelemetrySpoolFile
|
|
13737
14033
|
};
|
|
13738
14034
|
|
|
13739
|
-
//# debugId=
|
|
14035
|
+
//# debugId=1C8485A93560E50864756E2164756E21
|
package/dist/logger.d.ts
CHANGED
|
@@ -121,7 +121,7 @@ export declare function getLogFilePath(): string;
|
|
|
121
121
|
* // CLI entry point
|
|
122
122
|
* configureLogger({ sink: new TerminalSink() });
|
|
123
123
|
*
|
|
124
|
-
* // Browser entry point
|
|
124
|
+
* // Browser entry point (BrowserSink lives in packages/cli-browser)
|
|
125
125
|
* configureLogger({ sink: new BrowserSink() });
|
|
126
126
|
*
|
|
127
127
|
* // MCP — errors still surface via writeErr
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* OutputFormatter functions can apply them automatically without every
|
|
6
6
|
* command having to thread these values through.
|
|
7
7
|
*/
|
|
8
|
-
import type { OutputFormat } from "./
|
|
8
|
+
import type { OutputFormat } from "./output-formats";
|
|
9
9
|
/**
|
|
10
10
|
* Set the process-wide output format.
|
|
11
11
|
* Called once at CLI startup (from extractFormatFromArgs for early use via --output)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The accepted `--output` values and the type derived from them.
|
|
3
|
+
*
|
|
4
|
+
* This lives in its own dependency-free module, not in `formatter.ts`, because
|
|
5
|
+
* `command-help.ts` needs the list at runtime and is re-exported from
|
|
6
|
+
* `index.browser.ts`. `formatter.ts` transitively imports `telemetry-init`
|
|
7
|
+
* (and through it applicationinsights → cls-hooked → `node:async_hooks`), so
|
|
8
|
+
* a value import of it from any browser-reachable module breaks the browser
|
|
9
|
+
* bundle — see the exclusion list at the top of `index.browser.ts`.
|
|
10
|
+
*
|
|
11
|
+
* `formatter.ts` re-exports both names, so `@uipath/common` consumers see one
|
|
12
|
+
* import site regardless of which file defines them.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Accepted `--output` values, in the order `uip --help` lists them.
|
|
16
|
+
*
|
|
17
|
+
* {@link OutputFormat} is derived from this list, so the type and the
|
|
18
|
+
* accepted-value set cannot drift. Every caller that validates a raw
|
|
19
|
+
* `--output` value or prints the flag's help text reads it from here instead
|
|
20
|
+
* of repeating the literals.
|
|
21
|
+
*/
|
|
22
|
+
export declare const OUTPUT_FORMATS: readonly ["table", "json", "yaml", "plain", "markdown"];
|
|
23
|
+
export type OutputFormat = (typeof OUTPUT_FORMATS)[number];
|
|
24
|
+
/**
|
|
25
|
+
* Narrow a raw `--output` / `UIP_DEFAULT_OUTPUT` string to an accepted format.
|
|
26
|
+
*
|
|
27
|
+
* Every entry point receives the value as an arbitrary string; this is the one
|
|
28
|
+
* place that turns it into an {@link OutputFormat}, so no caller has to assert
|
|
29
|
+
* the cast the check was supposed to justify.
|
|
30
|
+
*
|
|
31
|
+
* @param value Raw value as typed on the command line or read from the env.
|
|
32
|
+
* @returns `true` when `value` is a member of {@link OUTPUT_FORMATS}.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isOutputFormat(value: string): value is OutputFormat;
|
package/dist/registry.d.ts
CHANGED
|
@@ -2,5 +2,10 @@
|
|
|
2
2
|
* Read a value from the Windows registry.
|
|
3
3
|
* reg utility always exist.
|
|
4
4
|
* Returns an empty string on non-Windows platforms or when the key/value is missing.
|
|
5
|
+
*
|
|
6
|
+
* `windowsHide` is required: a caller may have no console of its own — the
|
|
7
|
+
* telemetry sidecar is spawned `detached` with `stdio: "ignore"` — and
|
|
8
|
+
* Windows then allocates a new, visible console for `reg`, which flashes a
|
|
9
|
+
* terminal window on the user's desktop.
|
|
5
10
|
*/
|
|
6
11
|
export declare function readRegistryValue(keyPath: string, valueName: string): string;
|
package/dist/telemetry/index.js
CHANGED
|
@@ -18812,7 +18812,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
|
|
|
18812
18812
|
var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
18813
18813
|
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
18814
18814
|
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
18815
|
-
var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
18815
|
+
var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
18816
18816
|
var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
|
|
18817
18817
|
var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
|
|
18818
18818
|
var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
|
|
@@ -18859,7 +18859,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
|
|
|
18859
18859
|
`(?<![A-Za-z0-9])"(?:[^\\
|
|
18860
18860
|
]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
|
|
18861
18861
|
].join("|"), "g");
|
|
18862
|
-
var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
|
|
18862
|
+
var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
|
|
18863
18863
|
var COLLAPSED_BODY = "{…}";
|
|
18864
18864
|
var COLLAPSED_BODY_MARKER = "\x01body\x01";
|
|
18865
18865
|
var MAX_BODY_NESTING = 8;
|
|
@@ -18874,10 +18874,13 @@ function collapseJsonBodies(text) {
|
|
|
18874
18874
|
}
|
|
18875
18875
|
return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
|
|
18876
18876
|
}
|
|
18877
|
-
var TRAILING_PROSE_PUNCT =
|
|
18877
|
+
var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
|
|
18878
18878
|
function peelTrailingPunctuation(match) {
|
|
18879
|
-
|
|
18880
|
-
|
|
18879
|
+
let end = match.length;
|
|
18880
|
+
while (end > 0 && TRAILING_PROSE_PUNCT.includes(match[end - 1])) {
|
|
18881
|
+
end -= 1;
|
|
18882
|
+
}
|
|
18883
|
+
return [match.slice(0, end), match.slice(end)];
|
|
18881
18884
|
}
|
|
18882
18885
|
function redactUrl(raw) {
|
|
18883
18886
|
try {
|
|
@@ -19318,4 +19321,4 @@ export {
|
|
|
19318
19321
|
setExecutionContextAuthSignal
|
|
19319
19322
|
};
|
|
19320
19323
|
|
|
19321
|
-
//# debugId=
|
|
19324
|
+
//# debugId=92AE46794174C94B64756E2164756E21
|