@uipath/gov-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.
Files changed (2) hide show
  1. package/dist/tool.js +322 -66
  2. package/package.json +3 -2
package/dist/tool.js CHANGED
@@ -7652,8 +7652,9 @@ var require_commander = __commonJS(function(exports) {
7652
7652
  // package.json
7653
7653
  var package_default = {
7654
7654
  name: "@uipath/gov-tool",
7655
+ author: "UiPath",
7655
7656
  license: "SEE LICENSE IN LICENSE.txt",
7656
- version: "1.202.0",
7657
+ version: "1.203.0-preview.160",
7657
7658
  description: "Manage UiPath governance — AOps policies, Access policies, and compliance packs.",
7658
7659
  private: false,
7659
7660
  repository: {
@@ -8058,8 +8059,9 @@ class VoidApiResponse {
8058
8059
  // ../../admin/authz-sdk/package.json
8059
8060
  var package_default2 = {
8060
8061
  name: "@uipath/authz-sdk",
8062
+ author: "UiPath",
8061
8063
  license: "SEE LICENSE IN LICENSE.txt",
8062
- version: "1.202.0",
8064
+ version: "1.203.0",
8063
8065
  description: "SDK for the UiPath Authorization Service API.",
8064
8066
  repository: {
8065
8067
  type: "git",
@@ -9433,16 +9435,7 @@ var resolveEnvFilePathAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) =
9433
9435
  errorMessage: location.source === "absolute" ? `Environment file not found: ${envFilePath}` : `Unable to locate environment file: ${envFilePath}. Run 'uip login' to authenticate.`
9434
9436
  };
9435
9437
  };
9436
- var loadEnvFileAsync = async ({ envPath }) => {
9437
- const fs7 = getFileSystem();
9438
- const absolutePath = fs7.path.isAbsolute(envPath) ? envPath : fs7.path.join(fs7.env.cwd(), envPath);
9439
- if (!await fs7.exists(absolutePath)) {
9440
- throw new Error(`Environment file not found: ${envPath}`);
9441
- }
9442
- const content = await fs7.readFile(absolutePath, "utf-8");
9443
- if (content === null) {
9444
- throw new Error(`Environment file not found: ${envPath}`);
9445
- }
9438
+ var parseEnvContent = (content) => {
9446
9439
  const env = {};
9447
9440
  for (const line of content.split(`
9448
9441
  `)) {
@@ -9463,6 +9456,18 @@ var loadEnvFileAsync = async ({ envPath }) => {
9463
9456
  }
9464
9457
  return env;
9465
9458
  };
9459
+ var loadEnvFileAsync = async ({ envPath }) => {
9460
+ const fs7 = getFileSystem();
9461
+ const absolutePath = fs7.path.isAbsolute(envPath) ? envPath : fs7.path.join(fs7.env.cwd(), envPath);
9462
+ if (!await fs7.exists(absolutePath)) {
9463
+ throw new Error(`Environment file not found: ${envPath}`);
9464
+ }
9465
+ const content = await fs7.readFile(absolutePath, "utf-8");
9466
+ if (content === null) {
9467
+ throw new Error(`Environment file not found: ${envPath}`);
9468
+ }
9469
+ return parseEnvContent(content);
9470
+ };
9466
9471
  var saveEnvFileAsync = async ({
9467
9472
  envPath,
9468
9473
  data,
@@ -9971,6 +9976,8 @@ function normalizeTokenRefreshUnavailableFailure() {
9971
9976
  function errorMessage(error) {
9972
9977
  return error instanceof Error ? error.message : String(error);
9973
9978
  }
9979
+ // ../../auth/src/authProfileDetails.ts
9980
+ init_src();
9974
9981
  // ../../auth/src/index.ts
9975
9982
  init_constants();
9976
9983
 
@@ -10283,7 +10290,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
10283
10290
  var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
10284
10291
  var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
10285
10292
  var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
10286
- var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
10293
+ var PADDED_BASE64_PATTERN = /(?<![A-Za-z0-9+/])[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
10287
10294
  var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
10288
10295
  var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
10289
10296
  var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
@@ -10330,7 +10337,7 @@ var QUOTED_LITERAL_PATTERN = new RegExp([
10330
10337
  `(?<![A-Za-z0-9])"(?:[^\\
10331
10338
  ]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
10332
10339
  ].join("|"), "g");
10333
- var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
10340
+ var JSON_BODY_PATTERN = /[{[][^{}[\]:,]*[:,][^{}[\]]*[\]}]/g;
10334
10341
  var COLLAPSED_BODY = "{…}";
10335
10342
  var COLLAPSED_BODY_MARKER = "\x01body\x01";
10336
10343
  var MAX_BODY_NESTING = 8;
@@ -10345,10 +10352,13 @@ function collapseJsonBodies(text) {
10345
10352
  }
10346
10353
  return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
10347
10354
  }
10348
- var TRAILING_PROSE_PUNCT = /[.,;:!?)\]}>'"]+$/;
10355
+ var TRAILING_PROSE_PUNCT = `.,;:!?)]}>'"`;
10349
10356
  function peelTrailingPunctuation(match) {
10350
- const trailing = match.match(TRAILING_PROSE_PUNCT)?.[0] ?? "";
10351
- return trailing ? [match.slice(0, -trailing.length), trailing] : [match, ""];
10357
+ let end = match.length;
10358
+ while (end > 0 && TRAILING_PROSE_PUNCT.includes(match[end - 1])) {
10359
+ end -= 1;
10360
+ }
10361
+ return [match.slice(0, end), match.slice(end)];
10352
10362
  }
10353
10363
  function redactUrl(raw) {
10354
10364
  try {
@@ -10651,6 +10661,22 @@ function parseHttpStatusFromMessage(message) {
10651
10661
  const status = Number(match[1]);
10652
10662
  return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
10653
10663
  }
10664
+ function findHttpStatusInGraph(error) {
10665
+ for (const node of walkErrorGraph(error)) {
10666
+ const response = node.response;
10667
+ const explicit = typeof node.status === "number" ? node.status : response?.status;
10668
+ if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
10669
+ return explicit;
10670
+ }
10671
+ if (typeof node.message === "string") {
10672
+ const parsed = parseHttpStatusFromMessage(node.message);
10673
+ if (parsed !== undefined && parsed >= 400) {
10674
+ return parsed;
10675
+ }
10676
+ }
10677
+ }
10678
+ return;
10679
+ }
10654
10680
  function isHtmlDocument(body) {
10655
10681
  return /^\s*(<!doctype html|<html\b)/i.test(body);
10656
10682
  }
@@ -10764,7 +10790,8 @@ async function extractErrorDetails(error, options) {
10764
10790
  }
10765
10791
  let message;
10766
10792
  let result = "Failure";
10767
- const classification = classifyError(status, error);
10793
+ const classificationStatus = status ?? findHttpStatusInGraph(error);
10794
+ const classification = classifyError(classificationStatus, error);
10768
10795
  let retry = classification.retry;
10769
10796
  if (status === 401) {
10770
10797
  message = DEFAULT_401;
@@ -10840,8 +10867,8 @@ async function extractErrorDetails(error, options) {
10840
10867
  details = describeThrownValue(error);
10841
10868
  }
10842
10869
  const context = {};
10843
- if (status) {
10844
- context.httpStatus = status;
10870
+ if (classificationStatus) {
10871
+ context.httpStatus = classificationStatus;
10845
10872
  }
10846
10873
  if (parsedBody?.errorCode && typeof parsedBody.errorCode === "string") {
10847
10874
  context.errorCode = parsedBody.errorCode;
@@ -11409,7 +11436,8 @@ function readRegistryValue(keyPath, valueName) {
11409
11436
  }
11410
11437
  const [error, output] = catchError2(() => execFileSync2("reg", ["query", keyPath, "/v", valueName], {
11411
11438
  encoding: "utf-8",
11412
- stdio: ["pipe", "pipe", "pipe"]
11439
+ stdio: ["pipe", "pipe", "pipe"],
11440
+ windowsHide: true
11413
11441
  }));
11414
11442
  if (error) {
11415
11443
  return "";
@@ -11899,6 +11927,7 @@ class TelemetryService {
11899
11927
  }
11900
11928
  }
11901
11929
  // ../../common/src/timings.ts
11930
+ init_src();
11902
11931
  var TIMINGS_ENV_VAR = "UIP_TIMINGS";
11903
11932
  function createStorage2() {
11904
11933
  const [error, mod] = catchError2(() => __require("node:async_hooks"));
@@ -12086,28 +12115,32 @@ function isPlainRecord(value) {
12086
12115
  const prototype = Object.getPrototypeOf(value);
12087
12116
  return prototype === Object.prototype || prototype === null;
12088
12117
  }
12089
- function extractPagedRows(value) {
12118
+ function splitPagedEnvelope(value) {
12090
12119
  if (Array.isArray(value) || !isPlainRecord(value))
12091
12120
  return null;
12092
- const entries = Object.values(value);
12121
+ const entries = Object.entries(value);
12093
12122
  if (entries.length === 0)
12094
12123
  return null;
12095
- let rows = null;
12096
- let hasScalarSibling = false;
12097
- for (const entry of entries) {
12124
+ let found = null;
12125
+ const meta = Object.create(null);
12126
+ for (const [key, entry] of entries) {
12098
12127
  if (Array.isArray(entry)) {
12099
- if (rows !== null)
12128
+ if (found !== null)
12100
12129
  return null;
12101
- rows = entry;
12130
+ found = { key, rows: entry };
12102
12131
  } else if (entry !== null && typeof entry === "object") {
12103
12132
  return null;
12104
12133
  } else {
12105
- hasScalarSibling = true;
12134
+ meta[key] = entry;
12106
12135
  }
12107
12136
  }
12108
- if (rows === null || !hasScalarSibling)
12137
+ if (found === null || Object.keys(meta).length === 0)
12109
12138
  return null;
12110
- return rows;
12139
+ return { ...found, meta };
12140
+ }
12141
+ function extractPagedRows(value) {
12142
+ const paged = splitPagedEnvelope(value);
12143
+ return paged === null ? null : paged.rows;
12111
12144
  }
12112
12145
  function toLowerCamelCaseKey(key) {
12113
12146
  if (!key)
@@ -12211,6 +12244,9 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
12211
12244
  }
12212
12245
  break;
12213
12246
  }
12247
+ case "markdown":
12248
+ logFn(renderMarkdown(data));
12249
+ break;
12214
12250
  default: {
12215
12251
  const hasData = "Data" in data && data.Data != null;
12216
12252
  const pagedRows = hasData ? extractPagedRows(data.Data) : null;
@@ -12235,6 +12271,10 @@ function logOutput(data, format = "json", tableRowStyle) {
12235
12271
  printOutput(data, format, (msg) => sink.writeOut(`${msg}
12236
12272
  `), needsAsciiSafeJson(sink), styleFn);
12237
12273
  }
12274
+ var PLUMBING_KEYS = new Set(["code", "log"]);
12275
+ function isPlumbingKey(key) {
12276
+ return PLUMBING_KEYS.has(key.toLowerCase());
12277
+ }
12238
12278
  function cellToString(val) {
12239
12279
  return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
12240
12280
  }
@@ -12250,7 +12290,7 @@ function wrapText(text, width) {
12250
12290
  function printTable(data, logFn, externalLogValue, tableRowStyle) {
12251
12291
  if (data.length === 0)
12252
12292
  return;
12253
- const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
12293
+ const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
12254
12294
  const maxWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
12255
12295
  const header = keys.map((key, i) => key.padEnd(maxWidths[i])).join(" | ");
12256
12296
  logFn(header);
@@ -12272,7 +12312,7 @@ function isNonEmptyPlainObject(value) {
12272
12312
  }
12273
12313
  var NESTED_INDENT = " ";
12274
12314
  function printVerticalTable(data, logFn = console.log, externalLogValue) {
12275
- const keys = Object.keys(data).filter((key) => !["code", "log"].includes(key.toLowerCase()));
12315
+ const keys = Object.keys(data).filter((key) => !isPlumbingKey(key));
12276
12316
  if (keys.length === 0)
12277
12317
  return;
12278
12318
  const isBlockValue = (value) => isPlainObjectArray(value) || isNonEmptyPlainObject(value);
@@ -12303,7 +12343,7 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
12303
12343
  function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
12304
12344
  if (data.length === 0)
12305
12345
  return;
12306
- const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
12346
+ const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
12307
12347
  if (keys.length === 0)
12308
12348
  return;
12309
12349
  if (!process.stdout.isTTY) {
@@ -12377,6 +12417,220 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
12377
12417
  logFn(`Log: ${externalLogValue}`);
12378
12418
  }
12379
12419
  }
12420
+ var MARKDOWN_MAX_CELL = 200;
12421
+ var MARKDOWN_MAX_DEPTH = 3;
12422
+ function markdownHeading(depth) {
12423
+ return "#".repeat(Math.min(3 + depth, 6));
12424
+ }
12425
+ var BACKTICK_RUN = /`+/g;
12426
+ function fencedBlock(text) {
12427
+ const first = text.trimStart()[0];
12428
+ const language = first === "<" ? "xml" : first === "{" || first === "[" ? "json" : "";
12429
+ const longestRun = Math.max(0, ...Array.from(text.matchAll(BACKTICK_RUN), (match) => match[0].length));
12430
+ const fence = "`".repeat(Math.max(3, longestRun + 1));
12431
+ return `${fence}${language}
12432
+ ${text}
12433
+ ${fence}`;
12434
+ }
12435
+ function collapseNewlineRuns(text) {
12436
+ return text.split(/(\s+)/).map((part, index) => index % 2 === 1 && part.includes(`
12437
+ `) ? " " : part).join("");
12438
+ }
12439
+ function markdownCell(value) {
12440
+ const text = value instanceof Date ? value.toISOString() : cellToString(value);
12441
+ return collapseNewlineRuns(text).replace(/\|/g, "\\|");
12442
+ }
12443
+ function markdownLabel(key) {
12444
+ return collapseNewlineRuns(key).replace(/[\\`*|]/g, "\\$&");
12445
+ }
12446
+ function withoutPlumbing(record) {
12447
+ const kept = Object.create(null);
12448
+ for (const [key, value] of Object.entries(record)) {
12449
+ if (!isPlumbingKey(key))
12450
+ kept[key] = value;
12451
+ }
12452
+ return kept;
12453
+ }
12454
+ function rowsWithoutPlumbing(rows) {
12455
+ return rows.map((row) => isPlainRecord(row) ? withoutPlumbing(row) : row);
12456
+ }
12457
+ function markdownTable(rows) {
12458
+ const columns = [];
12459
+ const seen = new Set;
12460
+ for (const row of rows) {
12461
+ for (const key of Object.keys(row)) {
12462
+ if (!seen.has(key)) {
12463
+ seen.add(key);
12464
+ columns.push(key);
12465
+ }
12466
+ }
12467
+ }
12468
+ if (columns.length === 0)
12469
+ return null;
12470
+ const cells = rows.map((row) => columns.map((key) => markdownCell(row[key])));
12471
+ if (cells.some((row) => row.some((c) => c.length > MARKDOWN_MAX_CELL))) {
12472
+ return null;
12473
+ }
12474
+ return [
12475
+ `| ${columns.map(markdownLabel).join(" | ")} |`,
12476
+ `| ${columns.map(() => "---").join(" | ")} |`,
12477
+ ...cells.map((row) => `| ${row.join(" | ")} |`)
12478
+ ].join(`
12479
+ `);
12480
+ }
12481
+ function extractMessageSequence(rows) {
12482
+ const messages = [];
12483
+ for (const row of rows) {
12484
+ const message = extractSingleMessage(row);
12485
+ if (message === null)
12486
+ return null;
12487
+ messages.push(message);
12488
+ }
12489
+ return messages.join(`
12490
+
12491
+ `);
12492
+ }
12493
+ function markdownRows(rows, depth) {
12494
+ if (rows.length === 0)
12495
+ return "(none)";
12496
+ if (!isPlainObjectArray(rows)) {
12497
+ return rows.map((item) => `- ${markdownCell(item)}`).join(`
12498
+ `);
12499
+ }
12500
+ const prose = extractMessageSequence(rows);
12501
+ if (prose !== null)
12502
+ return prose;
12503
+ const table = markdownTable(rows);
12504
+ if (table !== null)
12505
+ return table;
12506
+ if (depth >= MARKDOWN_MAX_DEPTH) {
12507
+ return fencedBlock(JSON.stringify(rows, null, 2));
12508
+ }
12509
+ return rows.map((row, index) => [
12510
+ `${markdownHeading(depth)} ${index + 1}`,
12511
+ markdownObject(row, depth + 1)
12512
+ ].join(`
12513
+
12514
+ `)).join(`
12515
+
12516
+ `);
12517
+ }
12518
+ function markdownObject(obj, depth) {
12519
+ const scalars = [];
12520
+ const blocks = [];
12521
+ for (const [key, value] of Object.entries(obj)) {
12522
+ if (value === undefined)
12523
+ continue;
12524
+ const label = markdownLabel(key);
12525
+ if (Array.isArray(value)) {
12526
+ blocks.push(`${markdownHeading(depth)} ${label}
12527
+
12528
+ ${markdownRows(value, depth + 1)}`);
12529
+ } else if (isNonEmptyPlainObject(value)) {
12530
+ const nested = depth < MARKDOWN_MAX_DEPTH ? markdownObject(value, depth + 1) : fencedBlock(JSON.stringify(value, null, 2));
12531
+ if (nested !== "") {
12532
+ blocks.push(`${markdownHeading(depth)} ${label}
12533
+
12534
+ ${nested}`);
12535
+ }
12536
+ } else if (typeof value === "string" && value.includes(`
12537
+ `)) {
12538
+ blocks.push(`**${label}:**
12539
+
12540
+ ${fencedBlock(value)}`);
12541
+ } else {
12542
+ scalars.push(`**${label}:** ${markdownCell(value)}`);
12543
+ }
12544
+ }
12545
+ const sections = scalars.length > 0 ? [scalars.join(`
12546
+ `)] : [];
12547
+ sections.push(...blocks);
12548
+ return sections.join(`
12549
+
12550
+ `);
12551
+ }
12552
+ function extractSingleMessage(payload) {
12553
+ if (!isPlainRecord(payload))
12554
+ return null;
12555
+ const keys = Object.keys(payload);
12556
+ if (keys.length !== 1 || keys[0].toLowerCase() !== "message")
12557
+ return null;
12558
+ const value = payload[keys[0]];
12559
+ return typeof value === "string" ? value : null;
12560
+ }
12561
+ function markdownPayload(payload) {
12562
+ const message = extractSingleMessage(payload);
12563
+ if (message !== null)
12564
+ return message;
12565
+ if (Array.isArray(payload)) {
12566
+ return markdownRows(rowsWithoutPlumbing(payload), 0);
12567
+ }
12568
+ const visible = withoutPlumbing(payload);
12569
+ const paged = splitPagedEnvelope(visible);
12570
+ if (paged !== null) {
12571
+ const meta = markdownObject(paged.meta, 0);
12572
+ const rows = `${markdownHeading(0)} ${markdownLabel(paged.key)}
12573
+
12574
+ ${markdownRows(rowsWithoutPlumbing(paged.rows), 1)}`;
12575
+ return meta === "" ? rows : `${meta}
12576
+
12577
+ ${rows}`;
12578
+ }
12579
+ return markdownObject(visible, 0);
12580
+ }
12581
+ function isPaginationWorthShowing(value) {
12582
+ if (typeof value !== "object" || value === null)
12583
+ return false;
12584
+ const page = value;
12585
+ return page.HasMore === true || typeof page.Offset === "number" && page.Offset > 0;
12586
+ }
12587
+ function markdownEnvelopeNotes(data) {
12588
+ const envelope = data;
12589
+ const notes = [];
12590
+ const warning = envelope.Warning;
12591
+ if (typeof warning === "string" && warning !== "") {
12592
+ notes.push(`> **Warning:** ${warning}`);
12593
+ }
12594
+ const instructions = envelope.Instructions;
12595
+ if (typeof instructions === "string" && instructions !== "") {
12596
+ notes.push(`> ${instructions}`);
12597
+ }
12598
+ const pagination = envelope.Pagination;
12599
+ if (isPaginationWorthShowing(pagination)) {
12600
+ const body = markdownObject(pagination, 1);
12601
+ if (body !== "") {
12602
+ notes.push(`${markdownHeading(0)} Pagination
12603
+
12604
+ ${body}`);
12605
+ }
12606
+ }
12607
+ const log = envelope.Log;
12608
+ if (typeof log === "string" && log !== "") {
12609
+ notes.push(`**Log:** ${log}`);
12610
+ }
12611
+ return notes;
12612
+ }
12613
+ function renderMarkdown(data) {
12614
+ if (data.Result !== RESULTS.Success) {
12615
+ const failure = data;
12616
+ const sections = [`**Failed:** ${failure.Message}`];
12617
+ if (failure.Data != null) {
12618
+ sections.push(markdownPayload(failure.Data));
12619
+ }
12620
+ if (failure.Instructions) {
12621
+ sections.push(`> ${failure.Instructions}`);
12622
+ }
12623
+ return sections.filter((section) => section !== "").join(`
12624
+
12625
+ `);
12626
+ }
12627
+ if (!("Data" in data) || data.Data == null) {
12628
+ return markdownObject(withoutPlumbing(data), 0);
12629
+ }
12630
+ return [markdownPayload(data.Data), ...markdownEnvelopeNotes(data)].filter((section) => section !== "").join(`
12631
+
12632
+ `);
12633
+ }
12380
12634
  function toYaml(data) {
12381
12635
  const codec = getYamlCodec();
12382
12636
  if (!codec) {
@@ -14001,8 +14255,9 @@ class TextApiResponse {
14001
14255
  // ../aops-policy-sdk/package.json
14002
14256
  var package_default3 = {
14003
14257
  name: "@uipath/aops-policy-sdk",
14258
+ author: "UiPath",
14004
14259
  license: "SEE LICENSE IN LICENSE.txt",
14005
- version: "1.202.0",
14260
+ version: "1.203.0-preview.160",
14006
14261
  description: "SDK for the UiPath AOps Governance API — policy management and deployment.",
14007
14262
  repository: {
14008
14263
  type: "git",
@@ -14025,16 +14280,21 @@ var package_default3 = {
14025
14280
  ".": {
14026
14281
  types: "./dist/src/index.d.ts",
14027
14282
  default: "./dist/index.js"
14283
+ },
14284
+ "./resolver": {
14285
+ types: "./dist/src/policy-resolver.d.ts",
14286
+ default: "./dist/policy-resolver.js"
14028
14287
  }
14029
14288
  },
14030
14289
  files: [
14031
14290
  "dist"
14032
14291
  ],
14033
- private: true,
14292
+ private: false,
14034
14293
  scripts: {
14035
- build: "bun build ./src/index.ts --outdir dist --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
14294
+ build: "bun build ./src/index.ts ./src/policy-resolver.ts --outdir dist --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
14036
14295
  generate: "bun run src/scripts/generate-sdk.ts",
14037
- lint: "biome check ."
14296
+ lint: "biome check .",
14297
+ test: "vitest run"
14038
14298
  },
14039
14299
  devDependencies: {
14040
14300
  "@openapitools/openapi-generator-cli": "^2.31.1",
@@ -20402,7 +20662,7 @@ var registerTemplateCommands = (aopsPolicy) => {
20402
20662
  templateLocaleResourceFile
20403
20663
  }
20404
20664
  }
20405
- });
20665
+ }, { preserveDataKeys: ["formData", "template"] });
20406
20666
  });
20407
20667
  template.command("list").description("Fetch every product's active Form.io template and dump a full artifact set per product. " + "For each product, writes three files under <output-dir>/<ProductName>/: " + "`form-template.json` (the raw DTO returned by the governance API, for debugging/reference); " + "`form-data.json` (the fillable blueprint — edit this and submit to create/update a policy); " + "`form-template-locale-resource.json` (the locale-resolved reference — open this first to understand each field, its options, and its validation rules before filling `form-data.json`; see `template get --help` for the file's shape). " + "Per-product fetch failures are collected and do not abort the run; the command exits 1 only if every product fails. Use this instead of looping `template get` to dump all products in one pass.").requiredOption("--output-dir <path>", "Directory under which <ProductName>/ folders (containing the three artifacts) will be created.").option("--login-validity <minutes>", "Login token validity in minutes", (v) => Number.parseInt(v, 10)).examples(LIST_EXAMPLES8).trackedAction(processContext, async (options) => {
20408
20668
  const [productsError, products] = await catchError2((async () => {
@@ -20580,6 +20840,9 @@ async function readPolicyDataFile(dataFile) {
20580
20840
  const parsed = await readJsonFile(dataFile);
20581
20841
  return { data: parsed };
20582
20842
  }
20843
+ function succeedWithFormData(code, data) {
20844
+ OutputFormatter.success({ Result: RESULTS.Success, Code: code, Data: data }, { preserveDataKeys: ["data"] });
20845
+ }
20583
20846
  var registerAopsPolicyCommand = (program2) => {
20584
20847
  const aopsPolicy = program2.command("aops-policy").description([
20585
20848
  "Manage UiPath AOps governance policies end-to-end.",
@@ -20674,11 +20937,7 @@ var registerAopsPolicyCommand = (program2) => {
20674
20937
  processContext.exit(1);
20675
20938
  return;
20676
20939
  }
20677
- OutputFormatter.success({
20678
- Result: RESULTS.Success,
20679
- Code: "AopsPolicyGet",
20680
- Data: result
20681
- });
20940
+ succeedWithFormData("AopsPolicyGet", result);
20682
20941
  });
20683
20942
  aopsPolicy.command("create").description([
20684
20943
  "Create a new governance policy for a product.",
@@ -20717,11 +20976,7 @@ var registerAopsPolicyCommand = (program2) => {
20717
20976
  processContext.exit(1);
20718
20977
  return;
20719
20978
  }
20720
- OutputFormatter.success({
20721
- Result: RESULTS.Success,
20722
- Code: "AopsPolicyCreate",
20723
- Data: result
20724
- });
20979
+ succeedWithFormData("AopsPolicyCreate", result);
20725
20980
  });
20726
20981
  aopsPolicy.command("update").description([
20727
20982
  "Replace the fields of an existing governance policy.",
@@ -20761,11 +21016,7 @@ var registerAopsPolicyCommand = (program2) => {
20761
21016
  processContext.exit(1);
20762
21017
  return;
20763
21018
  }
20764
- OutputFormatter.success({
20765
- Result: RESULTS.Success,
20766
- Code: "AopsPolicyUpdate",
20767
- Data: result
20768
- });
21019
+ succeedWithFormData("AopsPolicyUpdate", result);
20769
21020
  });
20770
21021
  aopsPolicy.command("delete").description([
20771
21022
  "Permanently delete a governance policy.",
@@ -22088,8 +22339,9 @@ class VoidApiResponse3 {
22088
22339
  }
22089
22340
  var package_default4 = {
22090
22341
  name: "@uipath/compliance-packs-sdk",
22342
+ author: "UiPath",
22091
22343
  license: "SEE LICENSE IN LICENSE.txt",
22092
- version: "1.202.0",
22344
+ version: "1.203.0",
22093
22345
  description: "SDK for the UiPath Governance Server Compliance Packs API.",
22094
22346
  repository: {
22095
22347
  type: "git",
@@ -23482,16 +23734,7 @@ var resolveEnvFilePathAsync2 = async (envFilePath = DEFAULT_ENV_FILENAME2, opts)
23482
23734
  errorMessage: location.source === "absolute" ? `Environment file not found: ${envFilePath}` : `Unable to locate environment file: ${envFilePath}. Run 'uip login' to authenticate.`
23483
23735
  };
23484
23736
  };
23485
- var loadEnvFileAsync2 = async ({ envPath }) => {
23486
- const fs72 = getFileSystem2();
23487
- const absolutePath = fs72.path.isAbsolute(envPath) ? envPath : fs72.path.join(fs72.env.cwd(), envPath);
23488
- if (!await fs72.exists(absolutePath)) {
23489
- throw new Error(`Environment file not found: ${envPath}`);
23490
- }
23491
- const content = await fs72.readFile(absolutePath, "utf-8");
23492
- if (content === null) {
23493
- throw new Error(`Environment file not found: ${envPath}`);
23494
- }
23737
+ var parseEnvContent2 = (content) => {
23495
23738
  const env = {};
23496
23739
  for (const line of content.split(`
23497
23740
  `)) {
@@ -23512,6 +23755,18 @@ var loadEnvFileAsync2 = async ({ envPath }) => {
23512
23755
  }
23513
23756
  return env;
23514
23757
  };
23758
+ var loadEnvFileAsync2 = async ({ envPath }) => {
23759
+ const fs72 = getFileSystem2();
23760
+ const absolutePath = fs72.path.isAbsolute(envPath) ? envPath : fs72.path.join(fs72.env.cwd(), envPath);
23761
+ if (!await fs72.exists(absolutePath)) {
23762
+ throw new Error(`Environment file not found: ${envPath}`);
23763
+ }
23764
+ const content = await fs72.readFile(absolutePath, "utf-8");
23765
+ if (content === null) {
23766
+ throw new Error(`Environment file not found: ${envPath}`);
23767
+ }
23768
+ return parseEnvContent2(content);
23769
+ };
23515
23770
  var saveEnvFileAsync2 = async ({
23516
23771
  envPath,
23517
23772
  data,
@@ -24018,6 +24273,7 @@ function normalizeTokenRefreshUnavailableFailure2() {
24018
24273
  function errorMessage2(error) {
24019
24274
  return error instanceof Error ? error.message : String(error);
24020
24275
  }
24276
+ init_src2();
24021
24277
  init_constants2();
24022
24278
  init_src2();
24023
24279
  init_constants2();
@@ -24512,4 +24768,4 @@ export {
24512
24768
  registerCommands
24513
24769
  };
24514
24770
 
24515
- //# debugId=EB77F3D7124046CE64756E2164756E21
24771
+ //# debugId=DD8D399116C2E11F64756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@uipath/gov-tool",
3
+ "author": "UiPath",
3
4
  "license": "SEE LICENSE IN LICENSE.txt",
4
- "version": "1.202.0",
5
+ "version": "1.203.0-preview.160",
5
6
  "description": "Manage UiPath governance — AOps policies, Access policies, and compliance packs.",
6
7
  "private": false,
7
8
  "repository": {
@@ -23,5 +24,5 @@
23
24
  "files": [
24
25
  "dist"
25
26
  ],
26
- "gitHead": "23b5a7038ead7264439af18f8b807c7cc99a29d5"
27
+ "gitHead": "3a42062ba731afca4595ba9aa8a80afc9667528d"
27
28
  }