@uipath/aops-tool 1.206.0-preview.301 → 1.207.0-preview.305

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
  metadata2,
5
5
  registerCommands2
6
- } from "./tool-pvfs4tx8.js";
6
+ } from "./tool-5pp3c3xn.js";
7
7
 
8
8
  // src/index.ts
9
9
  var program = new Command;
@@ -2082,7 +2082,7 @@ var package_default = {
2082
2082
  name: "@uipath/aops-tool",
2083
2083
  author: "UiPath",
2084
2084
  license: "SEE LICENSE IN LICENSE.txt",
2085
- version: "1.206.0-preview.301",
2085
+ version: "1.207.0-preview.305",
2086
2086
  description: "Manage UiPath StudioAdmin AOps — connections, repos, projects, solutions, pipelines, executions.",
2087
2087
  private: false,
2088
2088
  repository: {
@@ -2176,12 +2176,26 @@ class NodeFileSystem {
2176
2176
  throw error;
2177
2177
  }
2178
2178
  }
2179
- async writeFile(filePath, data) {
2179
+ async writeFile(filePath, data, options) {
2180
2180
  const dir = path.dirname(filePath);
2181
2181
  if (dir) {
2182
2182
  await fs.mkdir(dir, { recursive: true });
2183
2183
  }
2184
- await fs.writeFile(filePath, data);
2184
+ if (options?.mode === undefined || process.platform === "win32") {
2185
+ if (options?.exclusive) {
2186
+ await fs.writeFile(filePath, data, { flag: "wx" });
2187
+ } else {
2188
+ await fs.writeFile(filePath, data);
2189
+ }
2190
+ return;
2191
+ }
2192
+ const handle = await fs.open(filePath, options.exclusive ? "wx" : "w", options.mode);
2193
+ try {
2194
+ await handle.chmod(options.mode);
2195
+ await handle.writeFile(data);
2196
+ } finally {
2197
+ await handle.close();
2198
+ }
2185
2199
  }
2186
2200
  async appendFile(filePath, data) {
2187
2201
  const dir = path.dirname(filePath);
@@ -2216,7 +2230,8 @@ class NodeFileSystem {
2216
2230
  isDirectory: () => stats.isDirectory(),
2217
2231
  size: stats.size,
2218
2232
  mtimeMs: stats.mtimeMs,
2219
- ctimeMs: stats.ctimeMs
2233
+ ctimeMs: stats.ctimeMs,
2234
+ mode: stats.mode
2220
2235
  };
2221
2236
  } catch (error) {
2222
2237
  if (this.isEnoent(error))
@@ -2227,8 +2242,13 @@ class NodeFileSystem {
2227
2242
  async exists(filePath) {
2228
2243
  return existsSync(filePath);
2229
2244
  }
2230
- async mkdir(dirPath) {
2231
- await fs.mkdir(dirPath, { recursive: true });
2245
+ async mkdir(dirPath, options) {
2246
+ await fs.mkdir(dirPath, { recursive: true, mode: options?.mode });
2247
+ }
2248
+ async chmod(targetPath, mode) {
2249
+ if (process.platform === "win32")
2250
+ return;
2251
+ await fs.chmod(targetPath, mode);
2232
2252
  }
2233
2253
  async acquireLock(lockPath) {
2234
2254
  const canonicalPath = await this.canonicalizeLockTarget(lockPath);
@@ -2378,7 +2398,7 @@ class NodeFileSystem {
2378
2398
  async getTempDir() {
2379
2399
  return await fs.mkdtemp(path.join(os.tmpdir(), "uipath-fs-"));
2380
2400
  }
2381
- async copyDirectory(sourcePath, destPath) {
2401
+ async copyDirectory(sourcePath, destPath, options) {
2382
2402
  const sourceStats = await this.stat(sourcePath);
2383
2403
  if (!sourceStats) {
2384
2404
  throw new Error(`Source directory does not exist: ${sourcePath}`);
@@ -2395,7 +2415,9 @@ class NodeFileSystem {
2395
2415
  if (!entryStats)
2396
2416
  continue;
2397
2417
  if (entryStats.isDirectory()) {
2398
- await this.copyDirectory(srcEntry, destEntry);
2418
+ if (options?.skipDirectoryNames?.includes(entry))
2419
+ continue;
2420
+ await this.copyDirectory(srcEntry, destEntry, options);
2399
2421
  } else if (entryStats.isFile()) {
2400
2422
  const content = await this.readFile(srcEntry);
2401
2423
  if (content !== null) {
@@ -2458,13 +2480,15 @@ var ProjectDimensions = {
2458
2480
  SolutionKey: "SolutionKey",
2459
2481
  SolutionProjectKey: "SolutionProjectKey",
2460
2482
  SolutionIdentityStatus: "SolutionIdentityStatus",
2461
- PreviousSolutionKey: "PreviousSolutionKey"
2483
+ PreviousSolutionKey: "PreviousSolutionKey",
2484
+ PreviousProjectKey: "PreviousProjectKey"
2462
2485
  };
2463
2486
  var GUID_KEY_DIMENSIONS = new Set([
2464
2487
  ProjectDimensions.ProjectKey,
2465
2488
  ProjectDimensions.SolutionKey,
2466
2489
  ProjectDimensions.SolutionProjectKey,
2467
- ProjectDimensions.PreviousSolutionKey
2490
+ ProjectDimensions.PreviousSolutionKey,
2491
+ ProjectDimensions.PreviousProjectKey
2468
2492
  ]);
2469
2493
  var ShipDimensions = {
2470
2494
  ShipKind: "ShipKind",
@@ -2618,9 +2642,7 @@ async function withinProjectIdentityBudget(work, onTimeout) {
2618
2642
  }
2619
2643
  }
2620
2644
 
2621
- // ../common/src/telemetry/pseudonymize.ts
2622
- var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
2623
- var PSEUDONYM_HEX_LENGTH = 32;
2645
+ // ../common/src/sha256.ts
2624
2646
  var SHA256_K = new Uint32Array([
2625
2647
  1116352408,
2626
2648
  1899447441,
@@ -2700,7 +2722,7 @@ var SHA256_INITIAL_STATE = new Uint32Array([
2700
2722
  function rotr(value, bits) {
2701
2723
  return (value >>> bits | value << 32 - bits) >>> 0;
2702
2724
  }
2703
- function sha256Hex(input) {
2725
+ function sha256Words(input) {
2704
2726
  const bytes = new TextEncoder().encode(input);
2705
2727
  const paddedLength = bytes.length + 9 + 63 >> 6 << 6;
2706
2728
  const buffer = new Uint8Array(paddedLength);
@@ -2756,12 +2778,19 @@ function sha256Hex(input) {
2756
2778
  state[6] = state[6] + g >>> 0;
2757
2779
  state[7] = state[7] + h >>> 0;
2758
2780
  }
2781
+ return state;
2782
+ }
2783
+ function sha256Hex(input) {
2759
2784
  let hex = "";
2760
- for (const word of state) {
2785
+ for (const word of sha256Words(input)) {
2761
2786
  hex += word.toString(16).padStart(8, "0");
2762
2787
  }
2763
2788
  return hex;
2764
2789
  }
2790
+
2791
+ // ../common/src/telemetry/pseudonymize.ts
2792
+ var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
2793
+ var PSEUDONYM_HEX_LENGTH = 32;
2765
2794
  function resolveSha256Hex() {
2766
2795
  try {
2767
2796
  const nodeCrypto = __require("node:crypto");
@@ -3157,13 +3186,25 @@ function settlePromiseLike(thenable) {
3157
3186
  return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
3158
3187
  }
3159
3188
 
3189
+ // ../common/src/result-types.ts
3190
+ var RESULTS = {
3191
+ Success: "Success",
3192
+ Failure: "Failure",
3193
+ ConfigError: "ConfigError",
3194
+ AuthenticationError: "AuthenticationError",
3195
+ ValidationError: "ValidationError",
3196
+ TimeoutError: "TimeoutError"
3197
+ };
3198
+
3160
3199
  // ../common/src/error-codes.ts
3161
3200
  var CLI_ERROR_CODES = [
3162
3201
  "invalid_argument",
3202
+ "confirmation_required",
3163
3203
  "authentication_required",
3164
3204
  "permission_denied",
3165
3205
  "local_permission_denied",
3166
3206
  "not_found",
3207
+ "not_enabled",
3167
3208
  "rate_limited",
3168
3209
  "network_error",
3169
3210
  "timeout",
@@ -3202,6 +3243,12 @@ function carriedRetry(error) {
3202
3243
  const retry = error.retry;
3203
3244
  return isRetryHint(retry) ? retry : undefined;
3204
3245
  }
3246
+ function carriedResult(error) {
3247
+ if (!error || typeof error !== "object")
3248
+ return;
3249
+ const result = error.result;
3250
+ return typeof result === "string" && result !== RESULTS.Success && Object.values(RESULTS).includes(result) ? result : undefined;
3251
+ }
3205
3252
  function defaultRetryForErrorCode(errorCode) {
3206
3253
  switch (errorCode) {
3207
3254
  case "network_error":
@@ -3591,6 +3638,8 @@ async function extractErrorDetails(error, options) {
3591
3638
  }
3592
3639
  if (parsedBody?.errorCode && typeof parsedBody.errorCode === "string") {
3593
3640
  context.errorCode = parsedBody.errorCode;
3641
+ } else if (typeof parsedBody?.errorCode === "number") {
3642
+ context.errorCode = String(parsedBody.errorCode);
3594
3643
  } else if (parsedBody?.code && typeof parsedBody.code === "string") {
3595
3644
  context.errorCode = parsedBody.code;
3596
3645
  }
@@ -3651,15 +3700,6 @@ async function extractErrorMessage(error, options) {
3651
3700
  const { message } = await extractErrorDetails(error, options);
3652
3701
  return message;
3653
3702
  }
3654
- // ../common/src/result-types.ts
3655
- var RESULTS = {
3656
- Success: "Success",
3657
- Failure: "Failure",
3658
- ConfigError: "ConfigError",
3659
- AuthenticationError: "AuthenticationError",
3660
- ValidationError: "ValidationError",
3661
- TimeoutError: "TimeoutError"
3662
- };
3663
3703
  // ../../node_modules/commander/index.js
3664
3704
  var exports_commander = {};
3665
3705
  __exportCjs(exports_commander, {
@@ -4092,7 +4132,10 @@ var AUTH_ERROR_CODES = new Set([
4092
4132
  var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
4093
4133
  "local_permission_denied"
4094
4134
  ]);
4095
- var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
4135
+ var VALIDATION_ERROR_CODES = new Set([
4136
+ "invalid_argument",
4137
+ "confirmation_required"
4138
+ ]);
4096
4139
  var NETWORK_HTTP_ERROR_CODES = new Set([
4097
4140
  "network_error",
4098
4141
  "rate_limited",
@@ -4318,6 +4361,109 @@ var CommonTelemetryEvents = {
4318
4361
  ShipSucceeded: "Cli.ShipSucceeded"
4319
4362
  };
4320
4363
 
4364
+ // ../common/src/telemetry/global-telemetry-properties.ts
4365
+ var telemetryPropsSlot = singleton("TelemetryDefaultProps");
4366
+ function getGlobalTelemetryProperties() {
4367
+ return telemetryPropsSlot.get();
4368
+ }
4369
+
4370
+ // ../common/src/telemetry/trace-context.ts
4371
+ var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
4372
+ var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
4373
+ function getProcessEnv() {
4374
+ return globalThis.process?.env;
4375
+ }
4376
+ function parseInboundTraceparent(value) {
4377
+ if (!value) {
4378
+ return;
4379
+ }
4380
+ const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
4381
+ if (!match) {
4382
+ return;
4383
+ }
4384
+ const [, traceId, parentSpanId] = match;
4385
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
4386
+ return;
4387
+ }
4388
+ return { traceId, parentSpanId };
4389
+ }
4390
+ function getInboundTraceContext() {
4391
+ return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
4392
+ }
4393
+
4394
+ // ../common/src/telemetry/session-id.ts
4395
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
4396
+ var SESSION_ID_MAX_LENGTH = 64;
4397
+ var RANDOM_SESSION_ID_LENGTH = 32;
4398
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
4399
+ var CONTROL_CHARACTERS = /\p{Cc}/gu;
4400
+ var INHERITED_SESSION_SOURCES = [
4401
+ { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
4402
+ { envVar: "CODEX_THREAD_ID", source: "codex" },
4403
+ { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
4404
+ { envVar: "TERM_SESSION_ID", source: "terminal" },
4405
+ { envVar: "WT_SESSION", source: "terminal" }
4406
+ ];
4407
+ var telemetrySessionSlot = singleton("TelemetrySession");
4408
+ var telemetryOperationIdSlot = singleton("TelemetryOperationId");
4409
+ function getProcessEnv2() {
4410
+ return globalThis.process?.env;
4411
+ }
4412
+ function normalizeSessionId(value) {
4413
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
4414
+ return;
4415
+ }
4416
+ const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
4417
+ return cleaned || undefined;
4418
+ }
4419
+ function getConfiguredTelemetrySessionId() {
4420
+ return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
4421
+ }
4422
+ function getInheritedSession(env) {
4423
+ for (const candidate of INHERITED_SESSION_SOURCES) {
4424
+ const handle = normalizeSessionId(env[candidate.envVar]);
4425
+ if (handle) {
4426
+ return { id: handle, source: candidate.source };
4427
+ }
4428
+ }
4429
+ return;
4430
+ }
4431
+ function generateRandomSession() {
4432
+ const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
4433
+ crypto.getRandomValues(bytes);
4434
+ let hex = "";
4435
+ for (const byte of bytes) {
4436
+ hex += byte.toString(16).padStart(2, "0");
4437
+ }
4438
+ return { id: hex, source: "random" };
4439
+ }
4440
+ function resolveTelemetrySession() {
4441
+ const existing = telemetrySessionSlot.get();
4442
+ if (existing) {
4443
+ return existing;
4444
+ }
4445
+ const declaredHandle = getConfiguredTelemetrySessionId();
4446
+ const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
4447
+ telemetrySessionSlot.set(resolved);
4448
+ return resolved;
4449
+ }
4450
+ function getTelemetrySessionId() {
4451
+ return resolveTelemetrySession().id;
4452
+ }
4453
+ function getTelemetrySessionSource() {
4454
+ return resolveTelemetrySession().source;
4455
+ }
4456
+ function getTelemetryOperationId() {
4457
+ const existing = telemetryOperationIdSlot.get();
4458
+ if (existing) {
4459
+ return existing;
4460
+ }
4461
+ const inboundTraceId = getInboundTraceContext()?.traceId;
4462
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
4463
+ telemetryOperationIdSlot.set(generated);
4464
+ return generated;
4465
+ }
4466
+
4321
4467
  // ../common/src/registry.ts
4322
4468
  import { execFileSync } from "node:child_process";
4323
4469
  function readRegistryValue(keyPath, valueName) {
@@ -4539,108 +4685,6 @@ class NodeContextStorage {
4539
4685
  return this.storage.getStore();
4540
4686
  }
4541
4687
  }
4542
- // ../common/src/telemetry/trace-context.ts
4543
- var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
4544
- var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
4545
- function getProcessEnv() {
4546
- return globalThis.process?.env;
4547
- }
4548
- function parseInboundTraceparent(value) {
4549
- if (!value) {
4550
- return;
4551
- }
4552
- const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
4553
- if (!match) {
4554
- return;
4555
- }
4556
- const [, traceId, parentSpanId] = match;
4557
- if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
4558
- return;
4559
- }
4560
- return { traceId, parentSpanId };
4561
- }
4562
- function getInboundTraceContext() {
4563
- return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
4564
- }
4565
-
4566
- // ../common/src/telemetry/session-id.ts
4567
- var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
4568
- var SESSION_ID_MAX_LENGTH = 64;
4569
- var RANDOM_SESSION_ID_LENGTH = 32;
4570
- var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
4571
- var CONTROL_CHARACTERS = /\p{Cc}/gu;
4572
- var INHERITED_SESSION_SOURCES = [
4573
- { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
4574
- { envVar: "CODEX_THREAD_ID", source: "codex" },
4575
- { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
4576
- { envVar: "TERM_SESSION_ID", source: "terminal" },
4577
- { envVar: "WT_SESSION", source: "terminal" }
4578
- ];
4579
- var telemetrySessionSlot = singleton("TelemetrySession");
4580
- var telemetryOperationIdSlot = singleton("TelemetryOperationId");
4581
- function getProcessEnv2() {
4582
- return globalThis.process?.env;
4583
- }
4584
- function normalizeSessionId(value) {
4585
- if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
4586
- return;
4587
- }
4588
- const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
4589
- return cleaned || undefined;
4590
- }
4591
- function getConfiguredTelemetrySessionId() {
4592
- return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
4593
- }
4594
- function getInheritedSession(env) {
4595
- for (const candidate of INHERITED_SESSION_SOURCES) {
4596
- const handle = normalizeSessionId(env[candidate.envVar]);
4597
- if (handle) {
4598
- return { id: handle, source: candidate.source };
4599
- }
4600
- }
4601
- return;
4602
- }
4603
- function generateRandomSession() {
4604
- const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
4605
- crypto.getRandomValues(bytes);
4606
- let hex = "";
4607
- for (const byte of bytes) {
4608
- hex += byte.toString(16).padStart(2, "0");
4609
- }
4610
- return { id: hex, source: "random" };
4611
- }
4612
- function resolveTelemetrySession() {
4613
- const existing = telemetrySessionSlot.get();
4614
- if (existing) {
4615
- return existing;
4616
- }
4617
- const declaredHandle = getConfiguredTelemetrySessionId();
4618
- const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
4619
- telemetrySessionSlot.set(resolved);
4620
- return resolved;
4621
- }
4622
- function getTelemetrySessionId() {
4623
- return resolveTelemetrySession().id;
4624
- }
4625
- function getTelemetrySessionSource() {
4626
- return resolveTelemetrySession().source;
4627
- }
4628
- function getTelemetryOperationId() {
4629
- const existing = telemetryOperationIdSlot.get();
4630
- if (existing) {
4631
- return existing;
4632
- }
4633
- const inboundTraceId = getInboundTraceContext()?.traceId;
4634
- const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
4635
- telemetryOperationIdSlot.set(generated);
4636
- return generated;
4637
- }
4638
- // ../common/src/telemetry/global-telemetry-properties.ts
4639
- var telemetryPropsSlot = singleton("TelemetryDefaultProps");
4640
- function getGlobalTelemetryProperties() {
4641
- return telemetryPropsSlot.get();
4642
- }
4643
-
4644
4688
  // ../common/src/telemetry/span-clock.ts
4645
4689
  function startSpanClock() {
4646
4690
  const started = performance.now();
@@ -4854,6 +4898,7 @@ var MAX_SPOOL_AGE_MS = 72 * 60 * 60 * 1000;
4854
4898
  // ../common/src/telemetry/telemetry-init.ts
4855
4899
  var telemetryInstanceSlot = singleton("TelemetryService");
4856
4900
  var DEFAULT_AI_CONNECTION_STRING = atob("SW5zdHJ1bWVudGF0aW9uS2V5PTliZDM3NDgyLTgxMGUtNDQyYS1hYWE2LWQzOGVmNjVjNjY3NDtJbmdlc3Rpb25FbmRwb2ludD1odHRwczovL3dlc3RldXJvcGUtNS5pbi5hcHBsaWNhdGlvbmluc2lnaHRzLmF6dXJlLmNvbS87TGl2ZUVuZHBvaW50PWh0dHBzOi8vd2VzdGV1cm9wZS5saXZlZGlhZ25vc3RpY3MubW9uaXRvci5henVyZS5jb20vO0FwcGxpY2F0aW9uSWQ9MzU2OTdlZjEtOGJkMC00ZjE5LWEyN2MtZDg3Y2NhYzY2ZDJj");
4901
+ var browserProviderSlot = singleton("BrowserAppInsightsTelemetryProvider");
4857
4902
  function getGlobalTelemetryInstance() {
4858
4903
  const existing = telemetryInstanceSlot.get();
4859
4904
  if (existing && typeof existing === "object" && "trackEvent" in existing && typeof existing.trackEvent === "function") {
@@ -5037,7 +5082,7 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
5037
5082
  const pagedRows = extractPagedRows(data.Data);
5038
5083
  const items = pagedRows ?? (Array.isArray(data.Data) ? data.Data : [data.Data]);
5039
5084
  items.forEach((item) => {
5040
- const values = Object.values(item).map((v) => v ?? "").join("\t");
5085
+ const values = item === null || typeof item !== "object" ? String(item ?? "") : Object.values(item).map((v) => v ?? "").join("\t");
5041
5086
  logFn(values);
5042
5087
  });
5043
5088
  } else {
@@ -5052,7 +5097,8 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
5052
5097
  default: {
5053
5098
  const hasData = "Data" in data && data.Data != null;
5054
5099
  const pagedRows = hasData ? extractPagedRows(data.Data) : null;
5055
- const rows = pagedRows ? pagedRows : Array.isArray(data.Data) ? data.Data : null;
5100
+ const resolvedRows = pagedRows ? pagedRows : Array.isArray(data.Data) ? data.Data : null;
5101
+ const rows = resolvedRows && isPrimitiveArray(resolvedRows) ? resolvedRows.map((entry) => ({ Value: entry })) : resolvedRows;
5056
5102
  if (hasData && !(rows !== null && rows.length === 0)) {
5057
5103
  const logValue = data.Log;
5058
5104
  if (rows !== null) {
@@ -5109,6 +5155,9 @@ function printTable(data, logFn, externalLogValue, tableRowStyle) {
5109
5155
  function isPlainObjectArray(value) {
5110
5156
  return Array.isArray(value) && value.length > 0 && value.every(isPlainRecord);
5111
5157
  }
5158
+ function isPrimitiveArray(value) {
5159
+ return Array.isArray(value) && value.length > 0 && value.every((entry) => entry === null || typeof entry !== "object");
5160
+ }
5112
5161
  function isNonEmptyPlainObject(value) {
5113
5162
  return isPlainRecord(value) && Object.keys(value).length > 0;
5114
5163
  }
@@ -5455,12 +5504,12 @@ class FilterEvaluationError extends Error {
5455
5504
  instructions;
5456
5505
  retry = "RetryWillNotFix";
5457
5506
  result = RESULTS.ValidationError;
5458
- constructor(filter, cause) {
5507
+ constructor(filter, cause, hint) {
5459
5508
  const underlying = cause instanceof Error ? cause.message : String(cause);
5460
- super(`Filter '${filter}' failed to evaluate: ${underlying}`);
5509
+ super(`Filter '${filter}' failed to evaluate: ${underlying}` + (hint ? ` ${hint.detail}` : ""));
5461
5510
  this.name = "FilterEvaluationError";
5462
5511
  this.filter = filter;
5463
- this.instructions = `The --output-filter expression '${filter}' failed at evaluation time. ` + "Note that --output-filter operates on the 'Data' field of the envelope, not the full object. " + "For example, on a list result use 'length(@)' instead of 'Data | length(@)'.";
5512
+ this.instructions = (hint ? `${hint.instructions} ` : "") + `The --output-filter expression '${filter}' failed at evaluation time. ` + "Note that --output-filter operates on the 'Data' field of the envelope, not the full object. " + "For example, on a list result use 'length(@)' instead of 'Data | length(@)'.";
5464
5513
  }
5465
5514
  }
5466
5515
 
@@ -5582,6 +5631,93 @@ function nameList(names, cap = 12) {
5582
5631
  const rest = names.length - shown.length;
5583
5632
  return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
5584
5633
  }
5634
+ function notFieldsOn(names, scope) {
5635
+ return `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
5636
+ }
5637
+ function failingFieldRead(ast, isList, fn, argIndex) {
5638
+ const [left, right, condition] = ast.children ?? [];
5639
+ let scopes = [];
5640
+ if (!isList) {
5641
+ scopes = [ast];
5642
+ } else if (ast.type === "FilterProjection" && left?.type === "Identity") {
5643
+ scopes = [condition, right];
5644
+ } else if (ast.type === "Projection" && (left?.type === "Identity" || left?.type === "Flatten" && left.children?.[0]?.type === "Identity")) {
5645
+ scopes = [right];
5646
+ }
5647
+ const reads = new Set;
5648
+ let tracked = 0;
5649
+ const visit = (node) => {
5650
+ if (!node)
5651
+ return;
5652
+ switch (node.type) {
5653
+ case "Function": {
5654
+ const arg = node.children?.[argIndex - 1];
5655
+ if (node.name === fn && arg?.type === "Field" && arg.name) {
5656
+ reads.add(arg.name);
5657
+ tracked++;
5658
+ }
5659
+ node.children?.forEach(visit);
5660
+ return;
5661
+ }
5662
+ case "AndExpression":
5663
+ case "OrExpression":
5664
+ case "NotExpression":
5665
+ case "Comparator":
5666
+ case "MultiSelectList":
5667
+ case "MultiSelectHash":
5668
+ node.children?.forEach(visit);
5669
+ return;
5670
+ case "KeyValuePair":
5671
+ visit(node.value);
5672
+ return;
5673
+ }
5674
+ };
5675
+ scopes.forEach(visit);
5676
+ const calls = (node) => {
5677
+ if (node === null || typeof node !== "object")
5678
+ return 0;
5679
+ const own = node.type === "Function" && node.name === fn ? 1 : 0;
5680
+ const next = node.type === "KeyValuePair" ? [node.value] : node.children ?? [];
5681
+ return own + next.reduce((sum, child) => sum + calls(child), 0);
5682
+ };
5683
+ return reads.size === 1 && tracked === calls(ast) ? [...reads][0] : undefined;
5684
+ }
5685
+ function fieldExpression(name) {
5686
+ return /^[A-Za-z_]\w*$/.test(name) ? name : JSON.stringify(name);
5687
+ }
5688
+ function evaluationHint(codec, filter, data, cause) {
5689
+ const underlying = cause instanceof Error ? cause.message : String(cause);
5690
+ const failure = /\b(\w+)\(\) expected argument (\d+) to be type (\S+) but received type null\b/.exec(underlying);
5691
+ if (!failure)
5692
+ return;
5693
+ const [, fn, position, expected] = failure;
5694
+ const name = failingFieldRead(codec.compile(filter), Array.isArray(data), fn, Number(position));
5695
+ if (name === undefined)
5696
+ return;
5697
+ const present = availableFields(data);
5698
+ if (present.length === 0)
5699
+ return;
5700
+ const scope = `${countRecords(data)} record(s)`;
5701
+ if (!present.includes(name)) {
5702
+ return {
5703
+ detail: `${notFieldsOn([name], scope)}. Available fields: ${nameList(present)}.`,
5704
+ instructions: "Use a field the records have; names are case-sensitive."
5705
+ };
5706
+ }
5707
+ const records = Array.isArray(data) ? data : [data];
5708
+ const unset = records.filter((r) => r?.[name] == null).length;
5709
+ const field = fieldExpression(name);
5710
+ let fallback;
5711
+ if (expected.split(",").includes("string")) {
5712
+ fallback = "''";
5713
+ } else if (expected.split(",").includes("array")) {
5714
+ fallback = "`[]`";
5715
+ }
5716
+ return {
5717
+ detail: `\`${name}\` is null or missing on ${unset} of the ${scope} it read.`,
5718
+ instructions: fallback ? `Give it a default where ${fn}() reads it, e.g. \`${field} || ${fallback}\`.` : `Filter out the records where \`${name}\` is null before ${fn}() reads it.`
5719
+ };
5720
+ }
5585
5721
  function buildFilterWarning(filter, data, outcome) {
5586
5722
  const present = availableFields(data);
5587
5723
  const refs = referencedFields(filter);
@@ -5589,7 +5725,7 @@ function buildFilterWarning(filter, data, outcome) {
5589
5725
  const unchecked = refs.nested.filter((name) => !present.includes(name));
5590
5726
  const count = countRecords(data);
5591
5727
  const scope = `${count} record(s)`;
5592
- const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
5728
+ const isNotAField = (names) => notFieldsOn(names, scope);
5593
5729
  const soundness = unchecked.length > 0 ? `${nameList(unchecked)} ${unchecked.length === 1 ? "reads" : "read"} below the top level, so ${unchecked.length === 1 ? "it was" : "they were"} not checked against the record keys` : refs.top.length > 0 ? "every field it names exists" : "";
5594
5730
  const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
5595
5731
  let detail;
@@ -5640,7 +5776,8 @@ function applyFilter(data, filter, onWarning) {
5640
5776
  try {
5641
5777
  result = codec.search(data, filter);
5642
5778
  } catch (err) {
5643
- throw new FilterEvaluationError(filter, err);
5779
+ const [, hint] = catchError(() => evaluationHint(codec, filter, data, err));
5780
+ throw new FilterEvaluationError(filter, err, hint);
5644
5781
  }
5645
5782
  const inputCount = countRecords(data);
5646
5783
  const warn = (outcome) => {
@@ -6531,7 +6668,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
6531
6668
  logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
6532
6669
  const typed = error;
6533
6670
  const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
6534
- const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
6671
+ const customResult = carriedResult(error);
6535
6672
  const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
6536
6673
  const classified = cancellationExitCode === undefined ? await extractErrorDetails(error) : undefined;
6537
6674
  const finalResult = customResult ?? classified?.result ?? RESULTS.Failure;
@@ -6605,14 +6742,17 @@ Command.prototype.trackedAction = function(context, fn, properties) {
6605
6742
  // ../common/src/completer.ts
6606
6743
  var COMPLETER_SYMBOL = Symbol.for("@uipath/common/completer");
6607
6744
  // ../common/src/confirmation.ts
6608
- function requireConfirmation(flags, operation) {
6745
+ function requireConfirmation(flags, operation, options) {
6609
6746
  if (flags.yes === true || flags.force === true) {
6610
6747
  return true;
6611
6748
  }
6749
+ const message = options?.reversible ? `Confirmation required: this will ${operation}.` : `Confirmation required: this will ${operation} and cannot be undone.`;
6612
6750
  OutputFormatter.error({
6613
6751
  Result: RESULTS.Failure,
6614
- Message: `Confirmation required: this will ${operation} and cannot be undone.`,
6615
- Instructions: "Re-run with --yes to confirm."
6752
+ Message: message,
6753
+ Instructions: options?.instructions ?? "Re-run with --yes to confirm.",
6754
+ ErrorCode: "confirmation_required",
6755
+ Retry: "RetryWillNotFix"
6616
6756
  });
6617
6757
  processContext.exit(1);
6618
6758
  return false;
@@ -7377,6 +7517,8 @@ var FAILURE_STATUSES = new Set([
7377
7517
  "canceled",
7378
7518
  "stopped"
7379
7519
  ]);
7520
+ // ../common/src/relayed-output.ts
7521
+ var RELAYED_OUTPUT_SYMBOL = Symbol.for("@uipath/common/relayed-output");
7380
7522
  // ../common/src/screen-logger.ts
7381
7523
  var ScreenLogger;
7382
7524
  ((ScreenLogger) => {
@@ -7731,7 +7873,7 @@ var package_default2 = {
7731
7873
  name: "@uipath/sc-sdk",
7732
7874
  author: "UiPath",
7733
7875
  license: "SEE LICENSE IN LICENSE.txt",
7734
- version: "1.206.0",
7876
+ version: "1.207.0",
7735
7877
  description: "SDK for the UiPath SourceControl API — connections, repositories, automation projects, solutions.",
7736
7878
  repository: {
7737
7879
  type: "git",
@@ -8948,6 +9090,8 @@ function settlePromiseLike2(thenable) {
8948
9090
  // ../auth/src/constants.ts
8949
9091
  var UIPATH_HOME_DIR = ".uipath";
8950
9092
  var AUTH_FILENAME = ".auth";
9093
+ var AUTH_FILE_MODE = 384;
9094
+ var AUTH_DIR_MODE = 448;
8951
9095
  var DEFAULT_BASE_URL = "https://cloud.uipath.com";
8952
9096
  var DEFAULT_AUTH_TIMEOUT_MS2 = 5 * 60 * 1000;
8953
9097
 
@@ -9771,6 +9915,38 @@ var loadEnvFileAsync = async ({ envPath }) => {
9771
9915
  }
9772
9916
  return parseEnvContent(content);
9773
9917
  };
9918
+ var findAuthHomeDir = (fs, dir) => {
9919
+ let current = dir;
9920
+ for (;; ) {
9921
+ if (fs.path.basename(current) === UIPATH_HOME_DIR)
9922
+ return current;
9923
+ const parent = fs.path.dirname(current);
9924
+ if (parent === current)
9925
+ return;
9926
+ current = parent;
9927
+ }
9928
+ };
9929
+ var TEMP_FILE_ATTEMPTS = 5;
9930
+ var isFileExists = (error) => error instanceof Error && error.code === "EEXIST";
9931
+ var writeTempFile = async (fs, targetPath, content) => {
9932
+ for (let attempt = 1;; attempt++) {
9933
+ const tempPath = `${targetPath}.${crypto.randomUUID()}.tmp`;
9934
+ try {
9935
+ await fs.writeFile(tempPath, content, {
9936
+ mode: AUTH_FILE_MODE,
9937
+ exclusive: true
9938
+ });
9939
+ return tempPath;
9940
+ } catch (error) {
9941
+ if (!isFileExists(error)) {
9942
+ await fs.rm(tempPath).catch(() => {});
9943
+ throw error;
9944
+ }
9945
+ if (attempt === TEMP_FILE_ATTEMPTS)
9946
+ throw error;
9947
+ }
9948
+ }
9949
+ };
9774
9950
  var saveEnvFileAsync = async ({
9775
9951
  envPath,
9776
9952
  data,
@@ -9798,10 +9974,18 @@ var saveEnvFileAsync = async ({
9798
9974
  `)}
9799
9975
  `;
9800
9976
  const dir = fs.path.dirname(absolutePath);
9801
- await fs.mkdir(dir);
9802
- const tempPath = `${absolutePath}.tmp`;
9803
- await fs.writeFile(tempPath, content);
9804
- await fs.rename(tempPath, absolutePath);
9977
+ await fs.mkdir(dir, { mode: AUTH_DIR_MODE });
9978
+ const authHomeDir = findAuthHomeDir(fs, dir);
9979
+ if (authHomeDir !== undefined) {
9980
+ await fs.chmod?.(authHomeDir, AUTH_DIR_MODE);
9981
+ }
9982
+ const tempPath = await writeTempFile(fs, absolutePath, content);
9983
+ try {
9984
+ await fs.rename(tempPath, absolutePath);
9985
+ } catch (error) {
9986
+ await fs.rm(tempPath).catch(() => {});
9987
+ throw error;
9988
+ }
9805
9989
  };
9806
9990
 
9807
9991
  // ../auth/src/loginStatus.ts
@@ -10681,7 +10865,7 @@ var package_default3 = {
10681
10865
  name: "@uipath/cicd-sdk",
10682
10866
  author: "UiPath",
10683
10867
  license: "SEE LICENSE IN LICENSE.txt",
10684
- version: "1.206.0",
10868
+ version: "1.207.0",
10685
10869
  description: "SDK for the UiPath StudioAdmin CICD API — pipelines, pipeline executions, partition configuration.",
10686
10870
  repository: {
10687
10871
  type: "git",
@@ -14532,4 +14716,4 @@ var registerCommands2 = async (program) => {
14532
14716
 
14533
14717
  export { Command, metadata2, registerCommands2 };
14534
14718
 
14535
- //# debugId=3123EF04D5EEE22564756E2164756E21
14719
+ //# debugId=6EBD52D52F5BB2FA64756E2164756E21
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata2,
3
3
  registerCommands2
4
- } from "./tool-pvfs4tx8.js";
4
+ } from "./tool-5pp3c3xn.js";
5
5
  export {
6
6
  metadata2 as metadata,
7
7
  registerCommands2 as registerCommands
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/aops-tool",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.206.0-preview.301",
5
+ "version": "1.207.0-preview.305",
6
6
  "description": "Manage UiPath StudioAdmin AOps — connections, repos, projects, solutions, pipelines, executions.",
7
7
  "private": false,
8
8
  "repository": {
@@ -27,5 +27,5 @@
27
27
  "files": [
28
28
  "dist"
29
29
  ],
30
- "gitHead": "078afc3ef7ebf4c38353ee0059e321acf16a350d"
30
+ "gitHead": "1600aa89255c37c1b8bc68d9882c3395c1d5bff4"
31
31
  }