@uipath/vertical-solutions-tool 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/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  Command,
4
4
  metadata,
5
5
  registerCommands
6
- } from "./tool-vf45zw6x.js";
6
+ } from "./tool-ysbp9nde.js";
7
7
  import"./tool-mpvp5rqs.js";
8
8
  import"./tool-1yh8g550.js";
9
9
 
@@ -6863,8 +6863,9 @@ var require_src6 = __commonJS(function(exports) {
6863
6863
  // package.json
6864
6864
  var package_default = {
6865
6865
  name: "@uipath/vertical-solutions-tool",
6866
+ author: "UiPath",
6866
6867
  license: "SEE LICENSE IN LICENSE.txt",
6867
- version: "1.202.1",
6868
+ version: "1.203.0-preview.180",
6868
6869
  description: "Scaffold and generate Vertical Solution projects.",
6869
6870
  private: false,
6870
6871
  repository: {
@@ -7431,7 +7432,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
7431
7432
  var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
7432
7433
  var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
7433
7434
  var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
7434
- var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
7435
+ var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
7435
7436
  var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
7436
7437
  var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
7437
7438
  var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
@@ -7478,7 +7479,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
7478
7479
  `(?<![A-Za-z0-9])"(?:[^\\
7479
7480
  ]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
7480
7481
  ].join("|"), "g");
7481
- var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
7482
+ var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
7482
7483
  var COLLAPSED_BODY = "{…}";
7483
7484
  var COLLAPSED_BODY_MARKER = "\x01body\x01";
7484
7485
  var MAX_BODY_NESTING = 8;
@@ -7493,10 +7494,13 @@ function collapseJsonBodies(text) {
7493
7494
  }
7494
7495
  return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
7495
7496
  }
7496
- var TRAILING_PROSE_PUNCT = /[.,;:!?)\]}>'"]+$/;
7497
+ var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
7497
7498
  function peelTrailingPunctuation(match) {
7498
- const trailing = match.match(TRAILING_PROSE_PUNCT)?.[0] ?? "";
7499
- return trailing ? [match.slice(0, -trailing.length), trailing] : [match, ""];
7499
+ let end = match.length;
7500
+ while (end > 0 && TRAILING_PROSE_PUNCT.includes(match[end - 1])) {
7501
+ end -= 1;
7502
+ }
7503
+ return [match.slice(0, end), match.slice(end)];
7500
7504
  }
7501
7505
  function redactUrl(raw) {
7502
7506
  try {
@@ -8198,7 +8202,8 @@ function readRegistryValue(keyPath, valueName) {
8198
8202
  }
8199
8203
  const [error, output] = catchError(() => execFileSync("reg", ["query", keyPath, "/v", valueName], {
8200
8204
  encoding: "utf-8",
8201
- stdio: ["pipe", "pipe", "pipe"]
8205
+ stdio: ["pipe", "pipe", "pipe"],
8206
+ windowsHide: true
8202
8207
  }));
8203
8208
  if (error) {
8204
8209
  return "";
@@ -8880,28 +8885,32 @@ function isPlainRecord(value) {
8880
8885
  const prototype = Object.getPrototypeOf(value);
8881
8886
  return prototype === Object.prototype || prototype === null;
8882
8887
  }
8883
- function extractPagedRows(value) {
8888
+ function splitPagedEnvelope(value) {
8884
8889
  if (Array.isArray(value) || !isPlainRecord(value))
8885
8890
  return null;
8886
- const entries = Object.values(value);
8891
+ const entries = Object.entries(value);
8887
8892
  if (entries.length === 0)
8888
8893
  return null;
8889
- let rows = null;
8890
- let hasScalarSibling = false;
8891
- for (const entry of entries) {
8894
+ let found = null;
8895
+ const meta = Object.create(null);
8896
+ for (const [key, entry] of entries) {
8892
8897
  if (Array.isArray(entry)) {
8893
- if (rows !== null)
8898
+ if (found !== null)
8894
8899
  return null;
8895
- rows = entry;
8900
+ found = { key, rows: entry };
8896
8901
  } else if (entry !== null && typeof entry === "object") {
8897
8902
  return null;
8898
8903
  } else {
8899
- hasScalarSibling = true;
8904
+ meta[key] = entry;
8900
8905
  }
8901
8906
  }
8902
- if (rows === null || !hasScalarSibling)
8907
+ if (found === null || Object.keys(meta).length === 0)
8903
8908
  return null;
8904
- return rows;
8909
+ return { ...found, meta };
8910
+ }
8911
+ function extractPagedRows(value) {
8912
+ const paged = splitPagedEnvelope(value);
8913
+ return paged === null ? null : paged.rows;
8905
8914
  }
8906
8915
  function toLowerCamelCaseKey(key) {
8907
8916
  if (!key)
@@ -9005,6 +9014,9 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
9005
9014
  }
9006
9015
  break;
9007
9016
  }
9017
+ case "markdown":
9018
+ logFn(renderMarkdown(data));
9019
+ break;
9008
9020
  default: {
9009
9021
  const hasData = "Data" in data && data.Data != null;
9010
9022
  const pagedRows = hasData ? extractPagedRows(data.Data) : null;
@@ -9029,6 +9041,10 @@ function logOutput(data, format = "json", tableRowStyle) {
9029
9041
  printOutput(data, format, (msg) => sink.writeOut(`${msg}
9030
9042
  `), needsAsciiSafeJson(sink), styleFn);
9031
9043
  }
9044
+ var PLUMBING_KEYS = new Set(["code", "log"]);
9045
+ function isPlumbingKey(key) {
9046
+ return PLUMBING_KEYS.has(key.toLowerCase());
9047
+ }
9032
9048
  function cellToString(val) {
9033
9049
  return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
9034
9050
  }
@@ -9044,7 +9060,7 @@ function wrapText(text, width) {
9044
9060
  function printTable(data, logFn, externalLogValue, tableRowStyle) {
9045
9061
  if (data.length === 0)
9046
9062
  return;
9047
- const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
9063
+ const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
9048
9064
  const maxWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
9049
9065
  const header = keys.map((key, i) => key.padEnd(maxWidths[i])).join(" | ");
9050
9066
  logFn(header);
@@ -9066,7 +9082,7 @@ function isNonEmptyPlainObject(value) {
9066
9082
  }
9067
9083
  var NESTED_INDENT = " ";
9068
9084
  function printVerticalTable(data, logFn = console.log, externalLogValue) {
9069
- const keys = Object.keys(data).filter((key) => !["code", "log"].includes(key.toLowerCase()));
9085
+ const keys = Object.keys(data).filter((key) => !isPlumbingKey(key));
9070
9086
  if (keys.length === 0)
9071
9087
  return;
9072
9088
  const isBlockValue = (value) => isPlainObjectArray(value) || isNonEmptyPlainObject(value);
@@ -9097,7 +9113,7 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
9097
9113
  function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
9098
9114
  if (data.length === 0)
9099
9115
  return;
9100
- const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
9116
+ const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
9101
9117
  if (keys.length === 0)
9102
9118
  return;
9103
9119
  if (!process.stdout.isTTY) {
@@ -9171,6 +9187,220 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
9171
9187
  logFn(`Log: ${externalLogValue}`);
9172
9188
  }
9173
9189
  }
9190
+ var MARKDOWN_MAX_CELL = 200;
9191
+ var MARKDOWN_MAX_DEPTH = 3;
9192
+ function markdownHeading(depth) {
9193
+ return "#".repeat(Math.min(3 + depth, 6));
9194
+ }
9195
+ var BACKTICK_RUN = /`+/g;
9196
+ function fencedBlock(text) {
9197
+ const first = text.trimStart()[0];
9198
+ const language = first === "<" ? "xml" : first === "{" || first === "[" ? "json" : "";
9199
+ const longestRun = Math.max(0, ...Array.from(text.matchAll(BACKTICK_RUN), (match) => match[0].length));
9200
+ const fence = "`".repeat(Math.max(3, longestRun + 1));
9201
+ return `${fence}${language}
9202
+ ${text}
9203
+ ${fence}`;
9204
+ }
9205
+ function collapseNewlineRuns(text) {
9206
+ return text.split(/(\s+)/).map((part, index) => index % 2 === 1 && part.includes(`
9207
+ `) ? " " : part).join("");
9208
+ }
9209
+ function markdownCell(value) {
9210
+ const text = value instanceof Date ? value.toISOString() : cellToString(value);
9211
+ return collapseNewlineRuns(text).replace(/\|/g, "\\|");
9212
+ }
9213
+ function markdownLabel(key) {
9214
+ return collapseNewlineRuns(key).replace(/[\\`*|]/g, "\\$&");
9215
+ }
9216
+ function withoutPlumbing(record) {
9217
+ const kept = Object.create(null);
9218
+ for (const [key, value] of Object.entries(record)) {
9219
+ if (!isPlumbingKey(key))
9220
+ kept[key] = value;
9221
+ }
9222
+ return kept;
9223
+ }
9224
+ function rowsWithoutPlumbing(rows) {
9225
+ return rows.map((row) => isPlainRecord(row) ? withoutPlumbing(row) : row);
9226
+ }
9227
+ function markdownTable(rows) {
9228
+ const columns = [];
9229
+ const seen = new Set;
9230
+ for (const row of rows) {
9231
+ for (const key of Object.keys(row)) {
9232
+ if (!seen.has(key)) {
9233
+ seen.add(key);
9234
+ columns.push(key);
9235
+ }
9236
+ }
9237
+ }
9238
+ if (columns.length === 0)
9239
+ return null;
9240
+ const cells = rows.map((row) => columns.map((key) => markdownCell(row[key])));
9241
+ if (cells.some((row) => row.some((c) => c.length > MARKDOWN_MAX_CELL))) {
9242
+ return null;
9243
+ }
9244
+ return [
9245
+ `| ${columns.map(markdownLabel).join(" | ")} |`,
9246
+ `| ${columns.map(() => "---").join(" | ")} |`,
9247
+ ...cells.map((row) => `| ${row.join(" | ")} |`)
9248
+ ].join(`
9249
+ `);
9250
+ }
9251
+ function extractMessageSequence(rows) {
9252
+ const messages = [];
9253
+ for (const row of rows) {
9254
+ const message = extractSingleMessage(row);
9255
+ if (message === null)
9256
+ return null;
9257
+ messages.push(message);
9258
+ }
9259
+ return messages.join(`
9260
+
9261
+ `);
9262
+ }
9263
+ function markdownRows(rows, depth) {
9264
+ if (rows.length === 0)
9265
+ return "(none)";
9266
+ if (!isPlainObjectArray(rows)) {
9267
+ return rows.map((item) => `- ${markdownCell(item)}`).join(`
9268
+ `);
9269
+ }
9270
+ const prose = extractMessageSequence(rows);
9271
+ if (prose !== null)
9272
+ return prose;
9273
+ const table = markdownTable(rows);
9274
+ if (table !== null)
9275
+ return table;
9276
+ if (depth >= MARKDOWN_MAX_DEPTH) {
9277
+ return fencedBlock(JSON.stringify(rows, null, 2));
9278
+ }
9279
+ return rows.map((row, index) => [
9280
+ `${markdownHeading(depth)} ${index + 1}`,
9281
+ markdownObject(row, depth + 1)
9282
+ ].join(`
9283
+
9284
+ `)).join(`
9285
+
9286
+ `);
9287
+ }
9288
+ function markdownObject(obj, depth) {
9289
+ const scalars = [];
9290
+ const blocks = [];
9291
+ for (const [key, value] of Object.entries(obj)) {
9292
+ if (value === undefined)
9293
+ continue;
9294
+ const label = markdownLabel(key);
9295
+ if (Array.isArray(value)) {
9296
+ blocks.push(`${markdownHeading(depth)} ${label}
9297
+
9298
+ ${markdownRows(value, depth + 1)}`);
9299
+ } else if (isNonEmptyPlainObject(value)) {
9300
+ const nested = depth < MARKDOWN_MAX_DEPTH ? markdownObject(value, depth + 1) : fencedBlock(JSON.stringify(value, null, 2));
9301
+ if (nested !== "") {
9302
+ blocks.push(`${markdownHeading(depth)} ${label}
9303
+
9304
+ ${nested}`);
9305
+ }
9306
+ } else if (typeof value === "string" && value.includes(`
9307
+ `)) {
9308
+ blocks.push(`**${label}:**
9309
+
9310
+ ${fencedBlock(value)}`);
9311
+ } else {
9312
+ scalars.push(`**${label}:** ${markdownCell(value)}`);
9313
+ }
9314
+ }
9315
+ const sections = scalars.length > 0 ? [scalars.join(`
9316
+ `)] : [];
9317
+ sections.push(...blocks);
9318
+ return sections.join(`
9319
+
9320
+ `);
9321
+ }
9322
+ function extractSingleMessage(payload) {
9323
+ if (!isPlainRecord(payload))
9324
+ return null;
9325
+ const keys = Object.keys(payload);
9326
+ if (keys.length !== 1 || keys[0].toLowerCase() !== "message")
9327
+ return null;
9328
+ const value = payload[keys[0]];
9329
+ return typeof value === "string" ? value : null;
9330
+ }
9331
+ function markdownPayload(payload) {
9332
+ const message = extractSingleMessage(payload);
9333
+ if (message !== null)
9334
+ return message;
9335
+ if (Array.isArray(payload)) {
9336
+ return markdownRows(rowsWithoutPlumbing(payload), 0);
9337
+ }
9338
+ const visible = withoutPlumbing(payload);
9339
+ const paged = splitPagedEnvelope(visible);
9340
+ if (paged !== null) {
9341
+ const meta = markdownObject(paged.meta, 0);
9342
+ const rows = `${markdownHeading(0)} ${markdownLabel(paged.key)}
9343
+
9344
+ ${markdownRows(rowsWithoutPlumbing(paged.rows), 1)}`;
9345
+ return meta === "" ? rows : `${meta}
9346
+
9347
+ ${rows}`;
9348
+ }
9349
+ return markdownObject(visible, 0);
9350
+ }
9351
+ function isPaginationWorthShowing(value) {
9352
+ if (typeof value !== "object" || value === null)
9353
+ return false;
9354
+ const page = value;
9355
+ return page.HasMore === true || typeof page.Offset === "number" && page.Offset > 0;
9356
+ }
9357
+ function markdownEnvelopeNotes(data) {
9358
+ const envelope = data;
9359
+ const notes = [];
9360
+ const warning = envelope.Warning;
9361
+ if (typeof warning === "string" && warning !== "") {
9362
+ notes.push(`> **Warning:** ${warning}`);
9363
+ }
9364
+ const instructions = envelope.Instructions;
9365
+ if (typeof instructions === "string" && instructions !== "") {
9366
+ notes.push(`> ${instructions}`);
9367
+ }
9368
+ const pagination = envelope.Pagination;
9369
+ if (isPaginationWorthShowing(pagination)) {
9370
+ const body = markdownObject(pagination, 1);
9371
+ if (body !== "") {
9372
+ notes.push(`${markdownHeading(0)} Pagination
9373
+
9374
+ ${body}`);
9375
+ }
9376
+ }
9377
+ const log = envelope.Log;
9378
+ if (typeof log === "string" && log !== "") {
9379
+ notes.push(`**Log:** ${log}`);
9380
+ }
9381
+ return notes;
9382
+ }
9383
+ function renderMarkdown(data) {
9384
+ if (data.Result !== RESULTS.Success) {
9385
+ const failure = data;
9386
+ const sections = [`**Failed:** ${failure.Message}`];
9387
+ if (failure.Data != null) {
9388
+ sections.push(markdownPayload(failure.Data));
9389
+ }
9390
+ if (failure.Instructions) {
9391
+ sections.push(`> ${failure.Instructions}`);
9392
+ }
9393
+ return sections.filter((section) => section !== "").join(`
9394
+
9395
+ `);
9396
+ }
9397
+ if (!("Data" in data) || data.Data == null) {
9398
+ return markdownObject(withoutPlumbing(data), 0);
9399
+ }
9400
+ return [markdownPayload(data.Data), ...markdownEnvelopeNotes(data)].filter((section) => section !== "").join(`
9401
+
9402
+ `);
9403
+ }
9174
9404
  function toYaml(data) {
9175
9405
  const codec = getYamlCodec();
9176
9406
  if (!codec) {
@@ -31426,16 +31656,7 @@ var resolveEnvFilePathAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) =
31426
31656
  errorMessage: location.source === "absolute" ? `Environment file not found: ${envFilePath}` : `Unable to locate environment file: ${envFilePath}. Run 'uip login' to authenticate.`
31427
31657
  };
31428
31658
  };
31429
- var loadEnvFileAsync = async ({ envPath }) => {
31430
- const fs2 = getFileSystem();
31431
- const absolutePath = fs2.path.isAbsolute(envPath) ? envPath : fs2.path.join(fs2.env.cwd(), envPath);
31432
- if (!await fs2.exists(absolutePath)) {
31433
- throw new Error(`Environment file not found: ${envPath}`);
31434
- }
31435
- const content = await fs2.readFile(absolutePath, "utf-8");
31436
- if (content === null) {
31437
- throw new Error(`Environment file not found: ${envPath}`);
31438
- }
31659
+ var parseEnvContent = (content) => {
31439
31660
  const env2 = {};
31440
31661
  for (const line of content.split(`
31441
31662
  `)) {
@@ -31456,6 +31677,18 @@ var loadEnvFileAsync = async ({ envPath }) => {
31456
31677
  }
31457
31678
  return env2;
31458
31679
  };
31680
+ var loadEnvFileAsync = async ({ envPath }) => {
31681
+ const fs2 = getFileSystem();
31682
+ const absolutePath = fs2.path.isAbsolute(envPath) ? envPath : fs2.path.join(fs2.env.cwd(), envPath);
31683
+ if (!await fs2.exists(absolutePath)) {
31684
+ throw new Error(`Environment file not found: ${envPath}`);
31685
+ }
31686
+ const content = await fs2.readFile(absolutePath, "utf-8");
31687
+ if (content === null) {
31688
+ throw new Error(`Environment file not found: ${envPath}`);
31689
+ }
31690
+ return parseEnvContent(content);
31691
+ };
31459
31692
  var saveEnvFileAsync = async ({
31460
31693
  envPath,
31461
31694
  data,
@@ -44317,4 +44550,4 @@ var registerCommands = async (program2) => {
44317
44550
 
44318
44551
  export { Command, metadata, registerCommands };
44319
44552
 
44320
- //# debugId=467252C8B808D9C064756E2164756E21
44553
+ //# debugId=31F12247BE0ED45164756E2164756E21
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./tool-vf45zw6x.js";
4
+ } from "./tool-ysbp9nde.js";
5
5
  import"./tool-mpvp5rqs.js";
6
6
  import"./tool-1yh8g550.js";
7
7
  export {
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@uipath/vertical-solutions-tool",
3
+ "author": "UiPath",
3
4
  "license": "SEE LICENSE IN LICENSE.txt",
4
- "version": "1.202.1",
5
+ "version": "1.203.0-preview.180",
5
6
  "description": "Scaffold and generate Vertical Solution projects.",
6
7
  "private": false,
7
8
  "repository": {
@@ -34,5 +35,5 @@
34
35
  "files": [
35
36
  "dist"
36
37
  ],
37
- "gitHead": "280b581b7893224d512dd194f47dd57243cc6a5c"
38
+ "gitHead": "4e0a51e3ab2c9d89afd3d35a7b087a7fa58133a0"
38
39
  }