@uipath/codedapp-tool 1.202.0 → 1.203.0-preview.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD-PARTY-NOTICES.md +84 -807
- package/dist/{index-ythqf0qg.js → embedded-file-reader-0sjt4nkj.js} +96 -18441
- package/dist/first-party-service-srxaftkn.js +27 -0
- package/dist/index-6zef5vcv.js +18543 -0
- package/dist/{index-d9c1ecq8.js → index-8yrjtchg.js} +15 -3
- package/dist/index-kmp9fmhb.js +25 -0
- package/dist/index.js +7 -8
- package/dist/packager-tool-53w8skv5.js +262 -0
- package/dist/{packager-tool-ma7s1htk.js → packager-tool-8zzy6ght.js} +8252 -33742
- package/dist/{packager-tool-8hncwr6a.js → packager-tool-bvm4jqr1.js} +131 -16
- package/dist/{packager-tool-6658b9xv.js → packager-tool-f1ptyxe1.js} +298 -104
- package/dist/packager-tool-gdtpsdn7.js +342 -0
- package/dist/packager-tool-shwgy5p6.js +27197 -0
- package/dist/packager-tool.js +4 -4
- package/dist/tool.js +7 -8
- package/package.json +3 -2
- package/dist/multipart-parser-ab4q7byb.js +0 -353
- package/dist/packager-tool-05wez2xw.js +0 -1837
- package/dist/packager-tool-vv9c52ax.js +0 -4452
|
@@ -2398,7 +2398,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
|
|
|
2398
2398
|
var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
2399
2399
|
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
2400
2400
|
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
2401
|
-
var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
2401
|
+
var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
2402
2402
|
var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
|
|
2403
2403
|
var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
|
|
2404
2404
|
var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
|
|
@@ -2445,7 +2445,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
|
|
|
2445
2445
|
`(?<![A-Za-z0-9])"(?:[^\\
|
|
2446
2446
|
]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
|
|
2447
2447
|
].join("|"), "g");
|
|
2448
|
-
var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
|
|
2448
|
+
var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
|
|
2449
2449
|
var COLLAPSED_BODY = "{…}";
|
|
2450
2450
|
var COLLAPSED_BODY_MARKER = "\x01body\x01";
|
|
2451
2451
|
var MAX_BODY_NESTING = 8;
|
|
@@ -2460,10 +2460,13 @@ function collapseJsonBodies(text) {
|
|
|
2460
2460
|
}
|
|
2461
2461
|
return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
|
|
2462
2462
|
}
|
|
2463
|
-
var TRAILING_PROSE_PUNCT =
|
|
2463
|
+
var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
|
|
2464
2464
|
function peelTrailingPunctuation(match) {
|
|
2465
|
-
|
|
2466
|
-
|
|
2465
|
+
let end = match.length;
|
|
2466
|
+
while (end > 0 && TRAILING_PROSE_PUNCT.includes(match[end - 1])) {
|
|
2467
|
+
end -= 1;
|
|
2468
|
+
}
|
|
2469
|
+
return [match.slice(0, end), match.slice(end)];
|
|
2467
2470
|
}
|
|
2468
2471
|
function redactUrl(raw) {
|
|
2469
2472
|
try {
|
|
@@ -2766,6 +2769,22 @@ function parseHttpStatusFromMessage(message) {
|
|
|
2766
2769
|
const status = Number(match[1]);
|
|
2767
2770
|
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
2768
2771
|
}
|
|
2772
|
+
function findHttpStatusInGraph(error) {
|
|
2773
|
+
for (const node of walkErrorGraph(error)) {
|
|
2774
|
+
const response = node.response;
|
|
2775
|
+
const explicit = typeof node.status === "number" ? node.status : response?.status;
|
|
2776
|
+
if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
|
|
2777
|
+
return explicit;
|
|
2778
|
+
}
|
|
2779
|
+
if (typeof node.message === "string") {
|
|
2780
|
+
const parsed = parseHttpStatusFromMessage(node.message);
|
|
2781
|
+
if (parsed !== undefined && parsed >= 400) {
|
|
2782
|
+
return parsed;
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
return;
|
|
2787
|
+
}
|
|
2769
2788
|
function isHtmlDocument(body) {
|
|
2770
2789
|
return /^\s*(<!doctype html|<html\b)/i.test(body);
|
|
2771
2790
|
}
|
|
@@ -2879,7 +2898,8 @@ async function extractErrorDetails(error, options) {
|
|
|
2879
2898
|
}
|
|
2880
2899
|
let message;
|
|
2881
2900
|
let result = "Failure";
|
|
2882
|
-
const
|
|
2901
|
+
const classificationStatus = status ?? findHttpStatusInGraph(error);
|
|
2902
|
+
const classification = classifyError(classificationStatus, error);
|
|
2883
2903
|
let retry = classification.retry;
|
|
2884
2904
|
if (status === 401) {
|
|
2885
2905
|
message = DEFAULT_401;
|
|
@@ -2955,8 +2975,8 @@ async function extractErrorDetails(error, options) {
|
|
|
2955
2975
|
details = describeThrownValue(error);
|
|
2956
2976
|
}
|
|
2957
2977
|
const context = {};
|
|
2958
|
-
if (
|
|
2959
|
-
context.httpStatus =
|
|
2978
|
+
if (classificationStatus) {
|
|
2979
|
+
context.httpStatus = classificationStatus;
|
|
2960
2980
|
}
|
|
2961
2981
|
if (parsedBody?.errorCode && typeof parsedBody.errorCode === "string") {
|
|
2962
2982
|
context.errorCode = parsedBody.errorCode;
|
|
@@ -3519,7 +3539,8 @@ function readRegistryValue(keyPath, valueName) {
|
|
|
3519
3539
|
}
|
|
3520
3540
|
const [error, output] = catchError(() => execFileSync("reg", ["query", keyPath, "/v", valueName], {
|
|
3521
3541
|
encoding: "utf-8",
|
|
3522
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
3542
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
3543
|
+
windowsHide: true
|
|
3523
3544
|
}));
|
|
3524
3545
|
if (error) {
|
|
3525
3546
|
return "";
|
|
@@ -4089,86 +4110,6 @@ function recordCommandDuration(durationMs) {
|
|
|
4089
4110
|
}
|
|
4090
4111
|
getState().commandMs = durationMs;
|
|
4091
4112
|
}
|
|
4092
|
-
function recordHttpCall(durationMs) {
|
|
4093
|
-
if (!timingsEnabled()) {
|
|
4094
|
-
return;
|
|
4095
|
-
}
|
|
4096
|
-
const state = getState();
|
|
4097
|
-
state.httpMs += durationMs;
|
|
4098
|
-
state.httpCalls += 1;
|
|
4099
|
-
}
|
|
4100
|
-
|
|
4101
|
-
// ../common/src/telemetry/tracked-fetch.ts
|
|
4102
|
-
var W3C_TRACE_FLAGS_SAMPLED = "01";
|
|
4103
|
-
function makeTrackedFetch(realFetch) {
|
|
4104
|
-
return async (input, init) => {
|
|
4105
|
-
const context = telemetry.createDependencyContext();
|
|
4106
|
-
const url = resolveUrl(input);
|
|
4107
|
-
if (!context || !url) {
|
|
4108
|
-
return realFetch(input, init);
|
|
4109
|
-
}
|
|
4110
|
-
const method = resolveMethod(input, init).toUpperCase();
|
|
4111
|
-
const headers = mergeHeaders(input, init);
|
|
4112
|
-
if (!headers.has("traceparent")) {
|
|
4113
|
-
headers.set("traceparent", `00-${context.operationId}-${context.id}-${W3C_TRACE_FLAGS_SAMPLED}`);
|
|
4114
|
-
}
|
|
4115
|
-
const name = `${method} ${url.pathname}`;
|
|
4116
|
-
const clock = startSpanClock();
|
|
4117
|
-
context.startedAt = clock.startedAt;
|
|
4118
|
-
try {
|
|
4119
|
-
const response = await realFetch(input, { ...init, headers });
|
|
4120
|
-
const durationMs = clock.elapsedMs();
|
|
4121
|
-
recordHttpCall(durationMs);
|
|
4122
|
-
telemetry.trackDependencyResult(name, "HTTP", durationMs, response.ok, {
|
|
4123
|
-
"server.address": url.host,
|
|
4124
|
-
"http.request.method": method,
|
|
4125
|
-
"http.response.status_code": response.status
|
|
4126
|
-
}, context, String(response.status));
|
|
4127
|
-
return response;
|
|
4128
|
-
} catch (error) {
|
|
4129
|
-
const durationMs = clock.elapsedMs();
|
|
4130
|
-
recordHttpCall(durationMs);
|
|
4131
|
-
telemetry.trackDependencyResult(name, "HTTP", durationMs, false, {
|
|
4132
|
-
"server.address": url.host,
|
|
4133
|
-
"http.request.method": method,
|
|
4134
|
-
errorMessage: error instanceof Error ? error.message : String(error)
|
|
4135
|
-
}, context);
|
|
4136
|
-
throw error;
|
|
4137
|
-
}
|
|
4138
|
-
};
|
|
4139
|
-
}
|
|
4140
|
-
function resolveUrl(input) {
|
|
4141
|
-
try {
|
|
4142
|
-
if (typeof input === "string")
|
|
4143
|
-
return new URL(input);
|
|
4144
|
-
if (input instanceof URL)
|
|
4145
|
-
return input;
|
|
4146
|
-
if (input instanceof Request)
|
|
4147
|
-
return new URL(input.url);
|
|
4148
|
-
} catch {}
|
|
4149
|
-
return;
|
|
4150
|
-
}
|
|
4151
|
-
function resolveMethod(input, init) {
|
|
4152
|
-
if (init?.method)
|
|
4153
|
-
return init.method;
|
|
4154
|
-
if (input instanceof Request)
|
|
4155
|
-
return input.method;
|
|
4156
|
-
return "GET";
|
|
4157
|
-
}
|
|
4158
|
-
function mergeHeaders(input, init) {
|
|
4159
|
-
const headers = new Headers;
|
|
4160
|
-
if (input instanceof Request) {
|
|
4161
|
-
input.headers.forEach((value, key) => {
|
|
4162
|
-
headers.set(key, value);
|
|
4163
|
-
});
|
|
4164
|
-
}
|
|
4165
|
-
if (init?.headers) {
|
|
4166
|
-
new Headers(init.headers).forEach((value, key) => {
|
|
4167
|
-
headers.set(key, value);
|
|
4168
|
-
});
|
|
4169
|
-
}
|
|
4170
|
-
return headers;
|
|
4171
|
-
}
|
|
4172
4113
|
// ../common/src/telemetry/proxy-http-agent.ts
|
|
4173
4114
|
var slot = singleton("ProxyAuthHttpsAgent");
|
|
4174
4115
|
|
|
@@ -4281,28 +4222,32 @@ function isPlainRecord(value) {
|
|
|
4281
4222
|
const prototype = Object.getPrototypeOf(value);
|
|
4282
4223
|
return prototype === Object.prototype || prototype === null;
|
|
4283
4224
|
}
|
|
4284
|
-
function
|
|
4225
|
+
function splitPagedEnvelope(value) {
|
|
4285
4226
|
if (Array.isArray(value) || !isPlainRecord(value))
|
|
4286
4227
|
return null;
|
|
4287
|
-
const entries = Object.
|
|
4228
|
+
const entries = Object.entries(value);
|
|
4288
4229
|
if (entries.length === 0)
|
|
4289
4230
|
return null;
|
|
4290
|
-
let
|
|
4291
|
-
|
|
4292
|
-
for (const entry of entries) {
|
|
4231
|
+
let found = null;
|
|
4232
|
+
const meta = Object.create(null);
|
|
4233
|
+
for (const [key, entry] of entries) {
|
|
4293
4234
|
if (Array.isArray(entry)) {
|
|
4294
|
-
if (
|
|
4235
|
+
if (found !== null)
|
|
4295
4236
|
return null;
|
|
4296
|
-
|
|
4237
|
+
found = { key, rows: entry };
|
|
4297
4238
|
} else if (entry !== null && typeof entry === "object") {
|
|
4298
4239
|
return null;
|
|
4299
4240
|
} else {
|
|
4300
|
-
|
|
4241
|
+
meta[key] = entry;
|
|
4301
4242
|
}
|
|
4302
4243
|
}
|
|
4303
|
-
if (
|
|
4244
|
+
if (found === null || Object.keys(meta).length === 0)
|
|
4304
4245
|
return null;
|
|
4305
|
-
return
|
|
4246
|
+
return { ...found, meta };
|
|
4247
|
+
}
|
|
4248
|
+
function extractPagedRows(value) {
|
|
4249
|
+
const paged = splitPagedEnvelope(value);
|
|
4250
|
+
return paged === null ? null : paged.rows;
|
|
4306
4251
|
}
|
|
4307
4252
|
function toLowerCamelCaseKey(key) {
|
|
4308
4253
|
if (!key)
|
|
@@ -4406,6 +4351,9 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
|
|
|
4406
4351
|
}
|
|
4407
4352
|
break;
|
|
4408
4353
|
}
|
|
4354
|
+
case "markdown":
|
|
4355
|
+
logFn(renderMarkdown(data));
|
|
4356
|
+
break;
|
|
4409
4357
|
default: {
|
|
4410
4358
|
const hasData = "Data" in data && data.Data != null;
|
|
4411
4359
|
const pagedRows = hasData ? extractPagedRows(data.Data) : null;
|
|
@@ -4430,6 +4378,10 @@ function logOutput(data, format = "json", tableRowStyle) {
|
|
|
4430
4378
|
printOutput(data, format, (msg) => sink.writeOut(`${msg}
|
|
4431
4379
|
`), needsAsciiSafeJson(sink), styleFn);
|
|
4432
4380
|
}
|
|
4381
|
+
var PLUMBING_KEYS = new Set(["code", "log"]);
|
|
4382
|
+
function isPlumbingKey(key) {
|
|
4383
|
+
return PLUMBING_KEYS.has(key.toLowerCase());
|
|
4384
|
+
}
|
|
4433
4385
|
function cellToString(val) {
|
|
4434
4386
|
return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
|
|
4435
4387
|
}
|
|
@@ -4445,7 +4397,7 @@ function wrapText(text, width) {
|
|
|
4445
4397
|
function printTable(data, logFn, externalLogValue, tableRowStyle) {
|
|
4446
4398
|
if (data.length === 0)
|
|
4447
4399
|
return;
|
|
4448
|
-
const keys = Object.keys(data[0]).filter((key) => !
|
|
4400
|
+
const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
|
|
4449
4401
|
const maxWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
|
|
4450
4402
|
const header = keys.map((key, i) => key.padEnd(maxWidths[i])).join(" | ");
|
|
4451
4403
|
logFn(header);
|
|
@@ -4467,7 +4419,7 @@ function isNonEmptyPlainObject(value) {
|
|
|
4467
4419
|
}
|
|
4468
4420
|
var NESTED_INDENT = " ";
|
|
4469
4421
|
function printVerticalTable(data, logFn = console.log, externalLogValue) {
|
|
4470
|
-
const keys = Object.keys(data).filter((key) => !
|
|
4422
|
+
const keys = Object.keys(data).filter((key) => !isPlumbingKey(key));
|
|
4471
4423
|
if (keys.length === 0)
|
|
4472
4424
|
return;
|
|
4473
4425
|
const isBlockValue = (value) => isPlainObjectArray(value) || isNonEmptyPlainObject(value);
|
|
@@ -4498,7 +4450,7 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
|
|
|
4498
4450
|
function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
|
|
4499
4451
|
if (data.length === 0)
|
|
4500
4452
|
return;
|
|
4501
|
-
const keys = Object.keys(data[0]).filter((key) => !
|
|
4453
|
+
const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
|
|
4502
4454
|
if (keys.length === 0)
|
|
4503
4455
|
return;
|
|
4504
4456
|
if (!process.stdout.isTTY) {
|
|
@@ -4572,6 +4524,220 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
|
|
|
4572
4524
|
logFn(`Log: ${externalLogValue}`);
|
|
4573
4525
|
}
|
|
4574
4526
|
}
|
|
4527
|
+
var MARKDOWN_MAX_CELL = 200;
|
|
4528
|
+
var MARKDOWN_MAX_DEPTH = 3;
|
|
4529
|
+
function markdownHeading(depth) {
|
|
4530
|
+
return "#".repeat(Math.min(3 + depth, 6));
|
|
4531
|
+
}
|
|
4532
|
+
var BACKTICK_RUN = /`+/g;
|
|
4533
|
+
function fencedBlock(text) {
|
|
4534
|
+
const first = text.trimStart()[0];
|
|
4535
|
+
const language = first === "<" ? "xml" : first === "{" || first === "[" ? "json" : "";
|
|
4536
|
+
const longestRun = Math.max(0, ...Array.from(text.matchAll(BACKTICK_RUN), (match) => match[0].length));
|
|
4537
|
+
const fence = "`".repeat(Math.max(3, longestRun + 1));
|
|
4538
|
+
return `${fence}${language}
|
|
4539
|
+
${text}
|
|
4540
|
+
${fence}`;
|
|
4541
|
+
}
|
|
4542
|
+
function collapseNewlineRuns(text) {
|
|
4543
|
+
return text.split(/(\s+)/).map((part, index) => index % 2 === 1 && part.includes(`
|
|
4544
|
+
`) ? " " : part).join("");
|
|
4545
|
+
}
|
|
4546
|
+
function markdownCell(value) {
|
|
4547
|
+
const text = value instanceof Date ? value.toISOString() : cellToString(value);
|
|
4548
|
+
return collapseNewlineRuns(text).replace(/\|/g, "\\|");
|
|
4549
|
+
}
|
|
4550
|
+
function markdownLabel(key) {
|
|
4551
|
+
return collapseNewlineRuns(key).replace(/[\\`*|]/g, "\\$&");
|
|
4552
|
+
}
|
|
4553
|
+
function withoutPlumbing(record) {
|
|
4554
|
+
const kept = Object.create(null);
|
|
4555
|
+
for (const [key, value] of Object.entries(record)) {
|
|
4556
|
+
if (!isPlumbingKey(key))
|
|
4557
|
+
kept[key] = value;
|
|
4558
|
+
}
|
|
4559
|
+
return kept;
|
|
4560
|
+
}
|
|
4561
|
+
function rowsWithoutPlumbing(rows) {
|
|
4562
|
+
return rows.map((row) => isPlainRecord(row) ? withoutPlumbing(row) : row);
|
|
4563
|
+
}
|
|
4564
|
+
function markdownTable(rows) {
|
|
4565
|
+
const columns = [];
|
|
4566
|
+
const seen = new Set;
|
|
4567
|
+
for (const row of rows) {
|
|
4568
|
+
for (const key of Object.keys(row)) {
|
|
4569
|
+
if (!seen.has(key)) {
|
|
4570
|
+
seen.add(key);
|
|
4571
|
+
columns.push(key);
|
|
4572
|
+
}
|
|
4573
|
+
}
|
|
4574
|
+
}
|
|
4575
|
+
if (columns.length === 0)
|
|
4576
|
+
return null;
|
|
4577
|
+
const cells = rows.map((row) => columns.map((key) => markdownCell(row[key])));
|
|
4578
|
+
if (cells.some((row) => row.some((c) => c.length > MARKDOWN_MAX_CELL))) {
|
|
4579
|
+
return null;
|
|
4580
|
+
}
|
|
4581
|
+
return [
|
|
4582
|
+
`| ${columns.map(markdownLabel).join(" | ")} |`,
|
|
4583
|
+
`| ${columns.map(() => "---").join(" | ")} |`,
|
|
4584
|
+
...cells.map((row) => `| ${row.join(" | ")} |`)
|
|
4585
|
+
].join(`
|
|
4586
|
+
`);
|
|
4587
|
+
}
|
|
4588
|
+
function extractMessageSequence(rows) {
|
|
4589
|
+
const messages = [];
|
|
4590
|
+
for (const row of rows) {
|
|
4591
|
+
const message = extractSingleMessage(row);
|
|
4592
|
+
if (message === null)
|
|
4593
|
+
return null;
|
|
4594
|
+
messages.push(message);
|
|
4595
|
+
}
|
|
4596
|
+
return messages.join(`
|
|
4597
|
+
|
|
4598
|
+
`);
|
|
4599
|
+
}
|
|
4600
|
+
function markdownRows(rows, depth) {
|
|
4601
|
+
if (rows.length === 0)
|
|
4602
|
+
return "(none)";
|
|
4603
|
+
if (!isPlainObjectArray(rows)) {
|
|
4604
|
+
return rows.map((item) => `- ${markdownCell(item)}`).join(`
|
|
4605
|
+
`);
|
|
4606
|
+
}
|
|
4607
|
+
const prose = extractMessageSequence(rows);
|
|
4608
|
+
if (prose !== null)
|
|
4609
|
+
return prose;
|
|
4610
|
+
const table = markdownTable(rows);
|
|
4611
|
+
if (table !== null)
|
|
4612
|
+
return table;
|
|
4613
|
+
if (depth >= MARKDOWN_MAX_DEPTH) {
|
|
4614
|
+
return fencedBlock(JSON.stringify(rows, null, 2));
|
|
4615
|
+
}
|
|
4616
|
+
return rows.map((row, index) => [
|
|
4617
|
+
`${markdownHeading(depth)} ${index + 1}`,
|
|
4618
|
+
markdownObject(row, depth + 1)
|
|
4619
|
+
].join(`
|
|
4620
|
+
|
|
4621
|
+
`)).join(`
|
|
4622
|
+
|
|
4623
|
+
`);
|
|
4624
|
+
}
|
|
4625
|
+
function markdownObject(obj, depth) {
|
|
4626
|
+
const scalars = [];
|
|
4627
|
+
const blocks = [];
|
|
4628
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
4629
|
+
if (value === undefined)
|
|
4630
|
+
continue;
|
|
4631
|
+
const label = markdownLabel(key);
|
|
4632
|
+
if (Array.isArray(value)) {
|
|
4633
|
+
blocks.push(`${markdownHeading(depth)} ${label}
|
|
4634
|
+
|
|
4635
|
+
${markdownRows(value, depth + 1)}`);
|
|
4636
|
+
} else if (isNonEmptyPlainObject(value)) {
|
|
4637
|
+
const nested = depth < MARKDOWN_MAX_DEPTH ? markdownObject(value, depth + 1) : fencedBlock(JSON.stringify(value, null, 2));
|
|
4638
|
+
if (nested !== "") {
|
|
4639
|
+
blocks.push(`${markdownHeading(depth)} ${label}
|
|
4640
|
+
|
|
4641
|
+
${nested}`);
|
|
4642
|
+
}
|
|
4643
|
+
} else if (typeof value === "string" && value.includes(`
|
|
4644
|
+
`)) {
|
|
4645
|
+
blocks.push(`**${label}:**
|
|
4646
|
+
|
|
4647
|
+
${fencedBlock(value)}`);
|
|
4648
|
+
} else {
|
|
4649
|
+
scalars.push(`**${label}:** ${markdownCell(value)}`);
|
|
4650
|
+
}
|
|
4651
|
+
}
|
|
4652
|
+
const sections = scalars.length > 0 ? [scalars.join(`
|
|
4653
|
+
`)] : [];
|
|
4654
|
+
sections.push(...blocks);
|
|
4655
|
+
return sections.join(`
|
|
4656
|
+
|
|
4657
|
+
`);
|
|
4658
|
+
}
|
|
4659
|
+
function extractSingleMessage(payload) {
|
|
4660
|
+
if (!isPlainRecord(payload))
|
|
4661
|
+
return null;
|
|
4662
|
+
const keys = Object.keys(payload);
|
|
4663
|
+
if (keys.length !== 1 || keys[0].toLowerCase() !== "message")
|
|
4664
|
+
return null;
|
|
4665
|
+
const value = payload[keys[0]];
|
|
4666
|
+
return typeof value === "string" ? value : null;
|
|
4667
|
+
}
|
|
4668
|
+
function markdownPayload(payload) {
|
|
4669
|
+
const message = extractSingleMessage(payload);
|
|
4670
|
+
if (message !== null)
|
|
4671
|
+
return message;
|
|
4672
|
+
if (Array.isArray(payload)) {
|
|
4673
|
+
return markdownRows(rowsWithoutPlumbing(payload), 0);
|
|
4674
|
+
}
|
|
4675
|
+
const visible = withoutPlumbing(payload);
|
|
4676
|
+
const paged = splitPagedEnvelope(visible);
|
|
4677
|
+
if (paged !== null) {
|
|
4678
|
+
const meta = markdownObject(paged.meta, 0);
|
|
4679
|
+
const rows = `${markdownHeading(0)} ${markdownLabel(paged.key)}
|
|
4680
|
+
|
|
4681
|
+
${markdownRows(rowsWithoutPlumbing(paged.rows), 1)}`;
|
|
4682
|
+
return meta === "" ? rows : `${meta}
|
|
4683
|
+
|
|
4684
|
+
${rows}`;
|
|
4685
|
+
}
|
|
4686
|
+
return markdownObject(visible, 0);
|
|
4687
|
+
}
|
|
4688
|
+
function isPaginationWorthShowing(value) {
|
|
4689
|
+
if (typeof value !== "object" || value === null)
|
|
4690
|
+
return false;
|
|
4691
|
+
const page = value;
|
|
4692
|
+
return page.HasMore === true || typeof page.Offset === "number" && page.Offset > 0;
|
|
4693
|
+
}
|
|
4694
|
+
function markdownEnvelopeNotes(data) {
|
|
4695
|
+
const envelope = data;
|
|
4696
|
+
const notes = [];
|
|
4697
|
+
const warning = envelope.Warning;
|
|
4698
|
+
if (typeof warning === "string" && warning !== "") {
|
|
4699
|
+
notes.push(`> **Warning:** ${warning}`);
|
|
4700
|
+
}
|
|
4701
|
+
const instructions = envelope.Instructions;
|
|
4702
|
+
if (typeof instructions === "string" && instructions !== "") {
|
|
4703
|
+
notes.push(`> ${instructions}`);
|
|
4704
|
+
}
|
|
4705
|
+
const pagination = envelope.Pagination;
|
|
4706
|
+
if (isPaginationWorthShowing(pagination)) {
|
|
4707
|
+
const body = markdownObject(pagination, 1);
|
|
4708
|
+
if (body !== "") {
|
|
4709
|
+
notes.push(`${markdownHeading(0)} Pagination
|
|
4710
|
+
|
|
4711
|
+
${body}`);
|
|
4712
|
+
}
|
|
4713
|
+
}
|
|
4714
|
+
const log = envelope.Log;
|
|
4715
|
+
if (typeof log === "string" && log !== "") {
|
|
4716
|
+
notes.push(`**Log:** ${log}`);
|
|
4717
|
+
}
|
|
4718
|
+
return notes;
|
|
4719
|
+
}
|
|
4720
|
+
function renderMarkdown(data) {
|
|
4721
|
+
if (data.Result !== RESULTS.Success) {
|
|
4722
|
+
const failure = data;
|
|
4723
|
+
const sections = [`**Failed:** ${failure.Message}`];
|
|
4724
|
+
if (failure.Data != null) {
|
|
4725
|
+
sections.push(markdownPayload(failure.Data));
|
|
4726
|
+
}
|
|
4727
|
+
if (failure.Instructions) {
|
|
4728
|
+
sections.push(`> ${failure.Instructions}`);
|
|
4729
|
+
}
|
|
4730
|
+
return sections.filter((section) => section !== "").join(`
|
|
4731
|
+
|
|
4732
|
+
`);
|
|
4733
|
+
}
|
|
4734
|
+
if (!("Data" in data) || data.Data == null) {
|
|
4735
|
+
return markdownObject(withoutPlumbing(data), 0);
|
|
4736
|
+
}
|
|
4737
|
+
return [markdownPayload(data.Data), ...markdownEnvelopeNotes(data)].filter((section) => section !== "").join(`
|
|
4738
|
+
|
|
4739
|
+
`);
|
|
4740
|
+
}
|
|
4575
4741
|
function toYaml(data) {
|
|
4576
4742
|
const codec = getYamlCodec();
|
|
4577
4743
|
if (!codec) {
|
|
@@ -4615,6 +4781,20 @@ class FilterImplicitLimitError extends Error {
|
|
|
4615
4781
|
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).";
|
|
4616
4782
|
}
|
|
4617
4783
|
}
|
|
4784
|
+
|
|
4785
|
+
class ConfigurationError extends Error {
|
|
4786
|
+
__brand = "ConfigurationError";
|
|
4787
|
+
errorCode = "configuration_error";
|
|
4788
|
+
retry = "RetryWillNotFix";
|
|
4789
|
+
result = RESULTS.ConfigError;
|
|
4790
|
+
constructor(message) {
|
|
4791
|
+
super(message);
|
|
4792
|
+
this.name = "ConfigurationError";
|
|
4793
|
+
}
|
|
4794
|
+
}
|
|
4795
|
+
function isConfigurationError(error) {
|
|
4796
|
+
return typeof error === "object" && error !== null && "__brand" in error && error.__brand === "ConfigurationError";
|
|
4797
|
+
}
|
|
4618
4798
|
function applyFilter(data, filter) {
|
|
4619
4799
|
const codec = requireJmespath();
|
|
4620
4800
|
let result;
|
|
@@ -5213,6 +5393,20 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5213
5393
|
});
|
|
5214
5394
|
};
|
|
5215
5395
|
|
|
5396
|
+
// ../common/src/confirmation.ts
|
|
5397
|
+
function requireConfirmation(flags, operation) {
|
|
5398
|
+
if (flags.yes === true || flags.force === true) {
|
|
5399
|
+
return true;
|
|
5400
|
+
}
|
|
5401
|
+
OutputFormatter.error({
|
|
5402
|
+
Result: RESULTS.Failure,
|
|
5403
|
+
Message: `Confirmation required: this will ${operation} and cannot be undone.`,
|
|
5404
|
+
Instructions: "Re-run with --yes to confirm."
|
|
5405
|
+
});
|
|
5406
|
+
processContext.exit(1);
|
|
5407
|
+
return false;
|
|
5408
|
+
}
|
|
5409
|
+
|
|
5216
5410
|
// ../common/src/package-metadata-options.ts
|
|
5217
5411
|
function registerPackageMetadataOptions(command) {
|
|
5218
5412
|
return command.option("--author <author>", "Package author").option("--description <text>", "Package description").option("--repository-url <url>", "Source repository URL (recorded in the package for traceability)").option("--repository-commit <sha>", "Source repository commit hash (recorded in the package for traceability)").option("--repository-branch <branch>", "Source repository branch").option("--repository-type <type>", "Source repository type (defaults to 'git' when --repository-url is set)").option("--release-notes <text>", "Release notes for the package").option("--project-url <url>", "Automation Hub idea URL");
|
|
@@ -6000,6 +6194,6 @@ async function findSolutionFileUpward(fs, startDir) {
|
|
|
6000
6194
|
}
|
|
6001
6195
|
}
|
|
6002
6196
|
|
|
6003
|
-
export { catchError, describeConnectivityError, extractErrorDetails, extractErrorMessage, getOutputSink, logger,
|
|
6197
|
+
export { catchError, describeConnectivityError, extractErrorDetails, extractErrorMessage, getOutputSink, logger, RESULTS, EXIT_CODES, ConfigurationError, isConfigurationError, OutputFormatter, InvalidArgumentError, Command, Option, processContext, requireConfirmation, isGuid, canPrompt, registerPackageMetadataOptions, mapPackageMetadataOptions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, trackShipSucceeded, normalizeProjectType, toPortableRelativePath, tryRegisterProjectInParentSolution, findNearestParentUipxFile, findSolutionFileUpward };
|
|
6004
6198
|
|
|
6005
|
-
//# debugId=
|
|
6199
|
+
//# debugId=401ACF1EEAAA614364756E2164756E21
|