@uipath/admin-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.
@@ -1,18 +1,20 @@
1
1
  import {
2
2
  getFileSystem,
3
3
  catchError,
4
- extractErrorMessage,
5
4
  RESULTS,
5
+ httpStatusOf,
6
+ extractErrorMessage,
7
+ notSupportedFailure,
6
8
  Option,
7
9
  OutputFormatter,
8
10
  processContext,
9
11
  getSdkUserAgentToken,
10
12
  addSdkUserAgentHeader,
11
13
  installSdkUserAgentHeader
12
- } from "./tool-q0vzqxdz.js";
14
+ } from "./tool-rs6k74yh.js";
13
15
  import {
14
16
  getAuthContext
15
- } from "./tool-2f8evsq2.js";
17
+ } from "./tool-q5964p9b.js";
16
18
 
17
19
  // ../oms-sdk/generated/v1/src/runtime.ts
18
20
  var BASE_PATH = "http://localhost".replace(/\/+$/, "");
@@ -733,7 +735,7 @@ var package_default = {
733
735
  name: "@uipath/oms-sdk",
734
736
  author: "UiPath",
735
737
  license: "SEE LICENSE IN LICENSE.txt",
736
- version: "1.206.0",
738
+ version: "1.207.0",
737
739
  description: "SDK for the UiPath Organization Management Service API.",
738
740
  repository: {
739
741
  type: "git",
@@ -2778,6 +2780,7 @@ var registerOrgServicesCommands = (organizations) => {
2778
2780
  });
2779
2781
  });
2780
2782
  };
2783
+ var REGIONS_NOT_SUPPORTED_INSTRUCTIONS = "The connected environment does not serve the list of regions an organization can be provisioned in. Read it from an environment that offers multi-region provisioning.";
2781
2784
  var registerRegionsCommands = (organizations) => {
2782
2785
  const regions = organizations.command("regions").description("Inspect the regions in which Portal can be provisioned. Use the `list` subcommand.");
2783
2786
  withLoginValidity(regions.command("list").description("List the regions in which Portal can be provisioned for the caller's company.").examples(REGIONS_EXAMPLES)).trackedAction(processContext, async (options) => {
@@ -2785,6 +2788,14 @@ var registerRegionsCommands = (organizations) => {
2785
2788
  if (!client)
2786
2789
  return;
2787
2790
  const [error, result] = await catchError(client.api.organizationGetAllSupportedRegions());
2791
+ if (httpStatusOf(error) === 404) {
2792
+ OutputFormatter.error({
2793
+ Code: "OmsRegionsList",
2794
+ ...notSupportedFailure("Listing provisionable regions", REGIONS_NOT_SUPPORTED_INSTRUCTIONS, { httpStatus: 404 })
2795
+ });
2796
+ processContext.exit(1);
2797
+ return;
2798
+ }
2788
2799
  if (error) {
2789
2800
  await emitFailure(error, LOGIN_INSTRUCTIONS);
2790
2801
  return;
@@ -3719,4 +3730,4 @@ export {
3719
3730
  registerCommands
3720
3731
  };
3721
3732
 
3722
- //# debugId=5BF8322E18C7660F64756E2164756E21
3733
+ //# debugId=13A68C3CA98D913264756E2164756E21
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getFileSystem,
3
3
  catchError,
4
+ RESULTS,
4
5
  extractErrorDetails,
5
6
  extractErrorMessage,
6
- RESULTS,
7
7
  logger,
8
8
  EXIT_CODES,
9
9
  OutputFormatter,
@@ -13,10 +13,10 @@ import {
13
13
  getSdkUserAgentToken,
14
14
  addSdkUserAgentHeader,
15
15
  installSdkUserAgentHeader
16
- } from "./tool-q0vzqxdz.js";
16
+ } from "./tool-rs6k74yh.js";
17
17
  import {
18
18
  getAuthContext
19
- } from "./tool-2f8evsq2.js";
19
+ } from "./tool-q5964p9b.js";
20
20
 
21
21
  // ../audit-sdk/generated/src/runtime.ts
22
22
  var BASE_PATH = "https://localhost:7008".replace(/\/+$/, "");
@@ -284,7 +284,7 @@ var package_default = {
284
284
  name: "@uipath/audit-sdk",
285
285
  author: "UiPath",
286
286
  license: "SEE LICENSE IN LICENSE.txt",
287
- version: "1.206.0",
287
+ version: "1.207.0",
288
288
  description: "SDK for the UiPath Audit Service — query audit event sources, list events, download long-term-store exports, and manage audit exclusion rules.",
289
289
  repository: {
290
290
  type: "git",
@@ -2402,4 +2402,4 @@ export {
2402
2402
  registerCommands
2403
2403
  };
2404
2404
 
2405
- //# debugId=A99146D44D8CCDE364756E2164756E21
2405
+ //# debugId=4E8BFF9F88CB95A264756E2164756E21
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  catchError,
3
+ RESULTS,
3
4
  extractErrorDetails,
4
5
  instructionsFor,
5
- RESULTS,
6
6
  InvalidArgumentError,
7
7
  Option,
8
8
  OutputFormatter,
@@ -10,10 +10,10 @@ import {
10
10
  getSdkUserAgentToken,
11
11
  addSdkUserAgentHeader,
12
12
  installSdkUserAgentHeader
13
- } from "./tool-q0vzqxdz.js";
13
+ } from "./tool-rs6k74yh.js";
14
14
  import {
15
15
  getAuthContext
16
- } from "./tool-2f8evsq2.js";
16
+ } from "./tool-q5964p9b.js";
17
17
 
18
18
  // ../vpngateway-sdk/generated/src/runtime.ts
19
19
  var BASE_PATH = "http://localhost".replace(/\/+$/, "");
@@ -269,7 +269,7 @@ var package_default = {
269
269
  name: "@uipath/admin-vpngateway-sdk",
270
270
  author: "UiPath",
271
271
  license: "SEE LICENSE IN LICENSE.txt",
272
- version: "1.206.0",
272
+ version: "1.207.0",
273
273
  description: "SDK for the UiPath Hypervisor VPN Gateway management APIs.",
274
274
  repository: {
275
275
  type: "git",
@@ -2237,4 +2237,4 @@ export {
2237
2237
  registerCommands
2238
2238
  };
2239
2239
 
2240
- //# debugId=F310845D137A348E64756E2164756E21
2240
+ //# debugId=1E3B655861A9A34F64756E2164756E21
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getAuthContext
3
- } from "./tool-2f8evsq2.js";
3
+ } from "./tool-q5964p9b.js";
4
4
  import {
5
5
  getFileSystem,
6
6
  catchError,
7
+ RESULTS,
7
8
  extractErrorMessage,
8
9
  hasIdentityInstructionContext,
9
- RESULTS,
10
10
  authContextFailure,
11
11
  InvalidArgumentError,
12
12
  Option,
@@ -15,11 +15,11 @@ import {
15
15
  getSdkUserAgentToken,
16
16
  addSdkUserAgentHeader,
17
17
  installSdkUserAgentHeader
18
- } from "./tool-q0vzqxdz.js";
18
+ } from "./tool-rs6k74yh.js";
19
19
  import {
20
20
  UserApi,
21
21
  createApiClient
22
- } from "./tool-dqwbxmff.js";
22
+ } from "./tool-7z8r0e5t.js";
23
23
 
24
24
  // ../authz-sdk/generated/src/runtime.ts
25
25
  var BASE_PATH = "http://localhost".replace(/\/+$/, "");
@@ -275,7 +275,7 @@ var package_default = {
275
275
  name: "@uipath/authz-sdk",
276
276
  author: "UiPath",
277
277
  license: "SEE LICENSE IN LICENSE.txt",
278
- version: "1.206.0",
278
+ version: "1.207.0",
279
279
  description: "SDK for the UiPath Authorization Service API.",
280
280
  repository: {
281
281
  type: "git",
@@ -2731,4 +2731,4 @@ export {
2731
2731
  registerCommands
2732
2732
  };
2733
2733
 
2734
- //# debugId=A99EE81F57B529D664756E2164756E21
2734
+ //# debugId=2A07F0A1C798DF8C64756E2164756E21
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  catchError,
3
- extractErrorMessage,
4
3
  RESULTS,
4
+ extractErrorMessage,
5
5
  Option,
6
6
  logger,
7
7
  OutputFormatter,
8
8
  processContext,
9
9
  DEFAULT_PAGE_SIZE,
10
10
  splitScopeList
11
- } from "./tool-q0vzqxdz.js";
11
+ } from "./tool-rs6k74yh.js";
12
12
  import {
13
13
  BaseAPI,
14
14
  RequiredError,
@@ -20,8 +20,8 @@ import {
20
20
  UserApi,
21
21
  createIdentityConfig,
22
22
  createApiClient
23
- } from "./tool-dqwbxmff.js";
24
- import"./tool-2f8evsq2.js";
23
+ } from "./tool-7z8r0e5t.js";
24
+ import"./tool-q5964p9b.js";
25
25
 
26
26
  // ../identity-sdk/generated/src/models/ApiScopeType.ts
27
27
  function ApiScopeTypeFromJSON(json) {
@@ -4432,4 +4432,4 @@ export {
4432
4432
  registerCommands
4433
4433
  };
4434
4434
 
4435
- //# debugId=CFE68FA83AA08B9D64756E2164756E21
4435
+ //# debugId=62575AA45156B10B64756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __commonJS
3
- } from "./tool-q0vzqxdz.js";
3
+ } from "./tool-rs6k74yh.js";
4
4
 
5
5
  // ../../../node_modules/jmespath/jmespath.js
6
6
  var require_jmespath = __commonJS(function(exports) {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getAuthContext
3
- } from "./tool-2f8evsq2.js";
3
+ } from "./tool-q5964p9b.js";
4
4
  import {
5
5
  getSdkUserAgentToken,
6
6
  addSdkUserAgentHeader,
7
7
  installSdkUserAgentHeader
8
- } from "./tool-q0vzqxdz.js";
8
+ } from "./tool-rs6k74yh.js";
9
9
 
10
10
  // ../identity-sdk/generated/src/runtime.ts
11
11
  var BASE_PATH = "https://alpha.uipath.com/identity_".replace(/\/+$/, "");
@@ -786,7 +786,7 @@ var package_default = {
786
786
  name: "@uipath/identity-sdk",
787
787
  author: "UiPath",
788
788
  license: "SEE LICENSE IN LICENSE.txt",
789
- version: "1.206.0",
789
+ version: "1.207.0",
790
790
  repository: {
791
791
  type: "git",
792
792
  url: "https://github.com/UiPath/cli.git",
@@ -864,4 +864,4 @@ async function createApiClient(ApiClass, options) {
864
864
  }
865
865
  export { BaseAPI, RequiredError, JSONApiResponse, VoidApiResponse, TextApiResponse, UserTypeFromJSON, UserDtoFromJSON, UserApi, createIdentityConfig, createApiClient };
866
866
 
867
- //# debugId=E2BE0258AC6D6A6164756E2164756E21
867
+ //# debugId=C4581A67DDBD8C9264756E2164756E21
@@ -1,24 +1,26 @@
1
1
  import {
2
2
  getFileSystem,
3
3
  catchError,
4
- extractErrorMessage,
5
4
  RESULTS,
5
+ isHtmlDocument,
6
+ extractErrorMessage,
6
7
  authContextFailure,
8
+ notSupportedFailure,
7
9
  OutputFormatter,
8
10
  processContext,
9
11
  getSdkUserAgentToken,
10
12
  addSdkUserAgentHeader,
11
13
  installSdkUserAgentHeader
12
- } from "./tool-q0vzqxdz.js";
14
+ } from "./tool-rs6k74yh.js";
13
15
  import {
14
16
  getAuthContext
15
- } from "./tool-2f8evsq2.js";
17
+ } from "./tool-q5964p9b.js";
16
18
  // ../apms-tool/package.json
17
19
  var package_default = {
18
20
  name: "@uipath/apms-tool",
19
21
  author: "UiPath",
20
22
  license: "SEE LICENSE IN LICENSE.txt",
21
- version: "1.206.0-preview.301",
23
+ version: "1.207.0-preview.305",
22
24
  description: "CLI plugin for the UiPath Access Policy Management Service.",
23
25
  private: false,
24
26
  repository: {
@@ -317,7 +319,7 @@ var package_default2 = {
317
319
  name: "@uipath/apms-sdk",
318
320
  author: "UiPath",
319
321
  license: "SEE LICENSE IN LICENSE.txt",
320
- version: "1.206.0",
322
+ version: "1.207.0",
321
323
  description: "SDK for the UiPath Access Policy Management Service API.",
322
324
  repository: {
323
325
  type: "git",
@@ -1345,6 +1347,43 @@ var STRIP_PREFIX_RE = /\/accesspolicy_\/api\/(?:accessPolicy\/)?organization\/[^
1345
1347
  function rewriteApmsUrl(url) {
1346
1348
  return url.replace(STRIP_PREFIX_RE, "/accesspolicy_");
1347
1349
  }
1350
+ var APMS_UNAVAILABLE_ERROR = "ApmsUnavailableError";
1351
+
1352
+ class ApmsUnavailableError extends Error {
1353
+ constructor(url) {
1354
+ super(`The Access Policy Management Service is not available: ${url} is not served by the API.`);
1355
+ this.name = APMS_UNAVAILABLE_ERROR;
1356
+ }
1357
+ }
1358
+ var isApmsUnavailableError = (error) => error instanceof Error && error.name === APMS_UNAVAILABLE_ERROR;
1359
+ var APMS_SIGN_IN_REDIRECT_ERROR = "ApmsSignInRedirectError";
1360
+
1361
+ class ApmsSignInRedirectError extends Error {
1362
+ status = 401;
1363
+ constructor(url) {
1364
+ super(`The request was redirected to the sign-in page (${url}).`);
1365
+ this.name = APMS_SIGN_IN_REDIRECT_ERROR;
1366
+ }
1367
+ }
1368
+ var SIGN_IN_URL_RE = /\/identity_\/|\/(?:account\/)?(?:login|signin)\b/i;
1369
+ var isSignInRedirect = (response) => response.redirected && SIGN_IN_URL_RE.test(response.url);
1370
+ async function isHtmlPage(response) {
1371
+ if (!response.ok)
1372
+ return false;
1373
+ if (/json/i.test(response.headers.get("content-type") ?? ""))
1374
+ return false;
1375
+ return isHtmlDocument(await response.clone().text());
1376
+ }
1377
+ var rejectHtmlPages = {
1378
+ async post({ url, response }) {
1379
+ if (!await isHtmlPage(response))
1380
+ return response;
1381
+ if (isSignInRedirect(response)) {
1382
+ throw new ApmsSignInRedirectError(response.url);
1383
+ }
1384
+ throw new ApmsUnavailableError(url);
1385
+ }
1386
+ };
1348
1387
  async function resolveConfig(options) {
1349
1388
  const auth = await getAuthContext({
1350
1389
  ensureTokenValidityMinutes: options?.loginValidity,
@@ -1366,7 +1405,8 @@ async function resolveConfig(options) {
1366
1405
  basePath,
1367
1406
  accessToken: async () => bearerToken,
1368
1407
  headers: addSdkUserAgentHeader(undefined, SDK_USER_AGENT),
1369
- fetchApi
1408
+ fetchApi,
1409
+ middleware: [rejectHtmlPages]
1370
1410
  }),
1371
1411
  organizationId: auth.organizationId
1372
1412
  };
@@ -1380,6 +1420,8 @@ async function createApiClient(ApiClass, options) {
1380
1420
  }
1381
1421
  // ../apms-tool/src/commands/_shared.ts
1382
1422
  var LOGIN_INSTRUCTIONS = "Ensure you are logged in with 'uip login' and have access to the Access Policy Management service.";
1423
+ var IP_RESTRICTION_NOT_SUPPORTED_INSTRUCTIONS = "The connected environment does not run the Access Policy Management service that IP restriction needs. Manage IP restriction on an environment that runs it.";
1424
+ var MY_IP_NOT_SUPPORTED_INSTRUCTIONS = "The platform reports the public IP its edge network saw for the caller, and the connected environment answered without one. Find the address another way, such as from your network administrator.";
1383
1425
  var NON_NEGATIVE_INTEGER_RE = /^\d+$/;
1384
1426
  var parseIntOption = (raw) => {
1385
1427
  const trimmed = raw.trim();
@@ -1429,7 +1471,12 @@ var emitLoadError = (err) => {
1429
1471
  processContext.exit(1);
1430
1472
  };
1431
1473
  var emitFailure = async (error, instructions) => {
1432
- if (error instanceof Error && (error.name === "AuthContextUnavailableError" || error.name === "EnvAuthConfigError")) {
1474
+ if (isApmsUnavailableError(error)) {
1475
+ OutputFormatter.error(notSupportedFailure("IP restriction", IP_RESTRICTION_NOT_SUPPORTED_INSTRUCTIONS));
1476
+ processContext.exit(1);
1477
+ return;
1478
+ }
1479
+ if (error instanceof Error && (error.name === "AuthContextUnavailableError" || error.name === "EnvAuthConfigError" || error.name === "ApmsSignInRedirectError")) {
1433
1480
  OutputFormatter.error(await authContextFailure(error, instructions));
1434
1481
  processContext.exit(1);
1435
1482
  return;
@@ -1465,13 +1512,19 @@ async function fetchCurrentIp(loginValidity) {
1465
1512
  method: "GET",
1466
1513
  headers: { Authorization: `Bearer ${auth.accessToken}` }
1467
1514
  });
1515
+ if (isSignInRedirect(res))
1516
+ throw new ApmsSignInRedirectError(res.url);
1468
1517
  const text = (await res.text()).trim();
1518
+ if (res.status === 404)
1519
+ throw new ApmsUnavailableError(url);
1469
1520
  if (!res.ok) {
1470
1521
  throw new Error(`HTTP ${res.status}${res.statusText ? ` ${res.statusText}` : ""}${text ? `: ${text}` : ""}`);
1471
1522
  }
1472
1523
  if (isIPv4(text)) {
1473
1524
  return { body: { ipAddress: text }, ip: text };
1474
1525
  }
1526
+ if (isHtmlDocument(text))
1527
+ throw new ApmsUnavailableError(url);
1475
1528
  const [, parsed] = catchError(() => JSON.parse(text));
1476
1529
  if (typeof parsed === "string" && isIPv4(parsed)) {
1477
1530
  return { body: { ipAddress: parsed }, ip: parsed };
@@ -2483,6 +2536,11 @@ var registerMyIpCommand = (apms) => {
2483
2536
  await emitFailure(err ?? new Error("Failed to determine current IP"), LOGIN_INSTRUCTIONS);
2484
2537
  return;
2485
2538
  }
2539
+ if (result.ip === undefined && Object.keys(result.body).length === 0) {
2540
+ OutputFormatter.error(notSupportedFailure("Showing the caller's public IP", MY_IP_NOT_SUPPORTED_INSTRUCTIONS));
2541
+ processContext.exit(1);
2542
+ return;
2543
+ }
2486
2544
  OutputFormatter.success({
2487
2545
  Result: RESULTS.Success,
2488
2546
  Code: "ApmsMyIpGet",
@@ -2523,4 +2581,4 @@ export {
2523
2581
  registerCommands
2524
2582
  };
2525
2583
 
2526
- //# debugId=56C135548DF3B84064756E2164756E21
2584
+ //# debugId=76A41F13A26FA49764756E2164756E21
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  catchError,
3
- extractErrorMessage,
4
3
  RESULTS,
4
+ extractErrorMessage,
5
5
  Option,
6
6
  OutputFormatter,
7
7
  processContext,
@@ -12,16 +12,16 @@ import {
12
12
  getSdkUserAgentToken,
13
13
  addSdkUserAgentHeader,
14
14
  installSdkUserAgentHeader
15
- } from "./tool-q0vzqxdz.js";
15
+ } from "./tool-rs6k74yh.js";
16
16
  import {
17
17
  getAuthContext
18
- } from "./tool-2f8evsq2.js";
18
+ } from "./tool-q5964p9b.js";
19
19
  // ../resourcecatalog-tool/package.json
20
20
  var package_default = {
21
21
  name: "@uipath/resourcecatalog-tool",
22
22
  author: "UiPath",
23
23
  license: "SEE LICENSE IN LICENSE.txt",
24
- version: "1.206.0-preview.301",
24
+ version: "1.207.0-preview.305",
25
25
  description: "CLI plugin for the UiPath Resource Catalog Service.",
26
26
  private: false,
27
27
  repository: {
@@ -318,7 +318,7 @@ var package_default2 = {
318
318
  name: "@uipath/resourcecatalog-sdk",
319
319
  author: "UiPath",
320
320
  license: "SEE LICENSE IN LICENSE.txt",
321
- version: "1.206.0",
321
+ version: "1.207.0",
322
322
  description: "SDK for the UiPath Resource Catalog Service API.",
323
323
  repository: {
324
324
  type: "git",
@@ -1966,4 +1966,4 @@ export {
1966
1966
  registerCommands
1967
1967
  };
1968
1968
 
1969
- //# debugId=21E4D4ED2B44D9A864756E2164756E21
1969
+ //# debugId=492DC38903E7C00264756E2164756E21
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __require,
3
3
  getFileSystem
4
- } from "./tool-q0vzqxdz.js";
4
+ } from "./tool-rs6k74yh.js";
5
5
 
6
6
  // ../../auth/src/catch-error.ts
7
7
  function isPromiseLike(value) {
@@ -34,6 +34,8 @@ function settlePromiseLike(thenable) {
34
34
  // ../../auth/src/constants.ts
35
35
  var UIPATH_HOME_DIR = ".uipath";
36
36
  var AUTH_FILENAME = ".auth";
37
+ var AUTH_FILE_MODE = 384;
38
+ var AUTH_DIR_MODE = 448;
37
39
  var DEFAULT_BASE_URL = "https://cloud.uipath.com";
38
40
  var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
39
41
 
@@ -857,6 +859,38 @@ var loadEnvFileAsync = async ({ envPath }) => {
857
859
  }
858
860
  return parseEnvContent(content);
859
861
  };
862
+ var findAuthHomeDir = (fs, dir) => {
863
+ let current = dir;
864
+ for (;; ) {
865
+ if (fs.path.basename(current) === UIPATH_HOME_DIR)
866
+ return current;
867
+ const parent = fs.path.dirname(current);
868
+ if (parent === current)
869
+ return;
870
+ current = parent;
871
+ }
872
+ };
873
+ var TEMP_FILE_ATTEMPTS = 5;
874
+ var isFileExists = (error) => error instanceof Error && error.code === "EEXIST";
875
+ var writeTempFile = async (fs, targetPath, content) => {
876
+ for (let attempt = 1;; attempt++) {
877
+ const tempPath = `${targetPath}.${crypto.randomUUID()}.tmp`;
878
+ try {
879
+ await fs.writeFile(tempPath, content, {
880
+ mode: AUTH_FILE_MODE,
881
+ exclusive: true
882
+ });
883
+ return tempPath;
884
+ } catch (error) {
885
+ if (!isFileExists(error)) {
886
+ await fs.rm(tempPath).catch(() => {});
887
+ throw error;
888
+ }
889
+ if (attempt === TEMP_FILE_ATTEMPTS)
890
+ throw error;
891
+ }
892
+ }
893
+ };
860
894
  var saveEnvFileAsync = async ({
861
895
  envPath,
862
896
  data,
@@ -884,10 +918,18 @@ var saveEnvFileAsync = async ({
884
918
  `)}
885
919
  `;
886
920
  const dir = fs.path.dirname(absolutePath);
887
- await fs.mkdir(dir);
888
- const tempPath = `${absolutePath}.tmp`;
889
- await fs.writeFile(tempPath, content);
890
- await fs.rename(tempPath, absolutePath);
921
+ await fs.mkdir(dir, { mode: AUTH_DIR_MODE });
922
+ const authHomeDir = findAuthHomeDir(fs, dir);
923
+ if (authHomeDir !== undefined) {
924
+ await fs.chmod?.(authHomeDir, AUTH_DIR_MODE);
925
+ }
926
+ const tempPath = await writeTempFile(fs, absolutePath, content);
927
+ try {
928
+ await fs.rename(tempPath, absolutePath);
929
+ } catch (error) {
930
+ await fs.rm(tempPath).catch(() => {});
931
+ throw error;
932
+ }
891
933
  };
892
934
 
893
935
  // ../../auth/src/loginStatus.ts
@@ -1484,4 +1526,4 @@ var TENANT_SELECTION_CODES = new Set([
1484
1526
  ]);
1485
1527
  export { getAuthContext };
1486
1528
 
1487
- //# debugId=7D6E6CA9B0054FEF64756E2164756E21
1529
+ //# debugId=E66A14DE3A2DF11964756E2164756E21
@@ -2200,12 +2200,26 @@ class NodeFileSystem {
2200
2200
  throw error;
2201
2201
  }
2202
2202
  }
2203
- async writeFile(filePath, data) {
2203
+ async writeFile(filePath, data, options) {
2204
2204
  const dir = path.dirname(filePath);
2205
2205
  if (dir) {
2206
2206
  await fs.mkdir(dir, { recursive: true });
2207
2207
  }
2208
- await fs.writeFile(filePath, data);
2208
+ if (options?.mode === undefined || process.platform === "win32") {
2209
+ if (options?.exclusive) {
2210
+ await fs.writeFile(filePath, data, { flag: "wx" });
2211
+ } else {
2212
+ await fs.writeFile(filePath, data);
2213
+ }
2214
+ return;
2215
+ }
2216
+ const handle = await fs.open(filePath, options.exclusive ? "wx" : "w", options.mode);
2217
+ try {
2218
+ await handle.chmod(options.mode);
2219
+ await handle.writeFile(data);
2220
+ } finally {
2221
+ await handle.close();
2222
+ }
2209
2223
  }
2210
2224
  async appendFile(filePath, data) {
2211
2225
  const dir = path.dirname(filePath);
@@ -2240,7 +2254,8 @@ class NodeFileSystem {
2240
2254
  isDirectory: () => stats.isDirectory(),
2241
2255
  size: stats.size,
2242
2256
  mtimeMs: stats.mtimeMs,
2243
- ctimeMs: stats.ctimeMs
2257
+ ctimeMs: stats.ctimeMs,
2258
+ mode: stats.mode
2244
2259
  };
2245
2260
  } catch (error) {
2246
2261
  if (this.isEnoent(error))
@@ -2251,8 +2266,13 @@ class NodeFileSystem {
2251
2266
  async exists(filePath) {
2252
2267
  return existsSync(filePath);
2253
2268
  }
2254
- async mkdir(dirPath) {
2255
- await fs.mkdir(dirPath, { recursive: true });
2269
+ async mkdir(dirPath, options) {
2270
+ await fs.mkdir(dirPath, { recursive: true, mode: options?.mode });
2271
+ }
2272
+ async chmod(targetPath, mode) {
2273
+ if (process.platform === "win32")
2274
+ return;
2275
+ await fs.chmod(targetPath, mode);
2256
2276
  }
2257
2277
  async acquireLock(lockPath) {
2258
2278
  const canonicalPath = await this.canonicalizeLockTarget(lockPath);
@@ -2402,7 +2422,7 @@ class NodeFileSystem {
2402
2422
  async getTempDir() {
2403
2423
  return await fs.mkdtemp(path.join(os.tmpdir(), "uipath-fs-"));
2404
2424
  }
2405
- async copyDirectory(sourcePath, destPath) {
2425
+ async copyDirectory(sourcePath, destPath, options) {
2406
2426
  const sourceStats = await this.stat(sourcePath);
2407
2427
  if (!sourceStats) {
2408
2428
  throw new Error(`Source directory does not exist: ${sourcePath}`);
@@ -2419,7 +2439,9 @@ class NodeFileSystem {
2419
2439
  if (!entryStats)
2420
2440
  continue;
2421
2441
  if (entryStats.isDirectory()) {
2422
- await this.copyDirectory(srcEntry, destEntry);
2442
+ if (options?.skipDirectoryNames?.includes(entry))
2443
+ continue;
2444
+ await this.copyDirectory(srcEntry, destEntry, options);
2423
2445
  } else if (entryStats.isFile()) {
2424
2446
  const content = await this.readFile(srcEntry);
2425
2447
  if (content !== null) {
@@ -2482,13 +2504,15 @@ var ProjectDimensions = {
2482
2504
  SolutionKey: "SolutionKey",
2483
2505
  SolutionProjectKey: "SolutionProjectKey",
2484
2506
  SolutionIdentityStatus: "SolutionIdentityStatus",
2485
- PreviousSolutionKey: "PreviousSolutionKey"
2507
+ PreviousSolutionKey: "PreviousSolutionKey",
2508
+ PreviousProjectKey: "PreviousProjectKey"
2486
2509
  };
2487
2510
  var GUID_KEY_DIMENSIONS = new Set([
2488
2511
  ProjectDimensions.ProjectKey,
2489
2512
  ProjectDimensions.SolutionKey,
2490
2513
  ProjectDimensions.SolutionProjectKey,
2491
- ProjectDimensions.PreviousSolutionKey
2514
+ ProjectDimensions.PreviousSolutionKey,
2515
+ ProjectDimensions.PreviousProjectKey
2492
2516
  ]);
2493
2517
  var ShipDimensions = {
2494
2518
  ShipKind: "ShipKind",
@@ -2642,9 +2666,7 @@ async function withinProjectIdentityBudget(work, onTimeout) {
2642
2666
  }
2643
2667
  }
2644
2668
 
2645
- // ../../common/src/telemetry/pseudonymize.ts
2646
- var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
2647
- var PSEUDONYM_HEX_LENGTH = 32;
2669
+ // ../../common/src/sha256.ts
2648
2670
  var SHA256_K = new Uint32Array([
2649
2671
  1116352408,
2650
2672
  1899447441,
@@ -2724,7 +2746,7 @@ var SHA256_INITIAL_STATE = new Uint32Array([
2724
2746
  function rotr(value, bits) {
2725
2747
  return (value >>> bits | value << 32 - bits) >>> 0;
2726
2748
  }
2727
- function sha256Hex(input) {
2749
+ function sha256Words(input) {
2728
2750
  const bytes = new TextEncoder().encode(input);
2729
2751
  const paddedLength = bytes.length + 9 + 63 >> 6 << 6;
2730
2752
  const buffer = new Uint8Array(paddedLength);
@@ -2780,12 +2802,19 @@ function sha256Hex(input) {
2780
2802
  state[6] = state[6] + g >>> 0;
2781
2803
  state[7] = state[7] + h >>> 0;
2782
2804
  }
2805
+ return state;
2806
+ }
2807
+ function sha256Hex(input) {
2783
2808
  let hex = "";
2784
- for (const word of state) {
2809
+ for (const word of sha256Words(input)) {
2785
2810
  hex += word.toString(16).padStart(8, "0");
2786
2811
  }
2787
2812
  return hex;
2788
2813
  }
2814
+
2815
+ // ../../common/src/telemetry/pseudonymize.ts
2816
+ var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
2817
+ var PSEUDONYM_HEX_LENGTH = 32;
2789
2818
  function resolveSha256Hex() {
2790
2819
  try {
2791
2820
  const nodeCrypto = __require("node:crypto");
@@ -3181,13 +3210,25 @@ function settlePromiseLike(thenable) {
3181
3210
  return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
3182
3211
  }
3183
3212
 
3213
+ // ../../common/src/result-types.ts
3214
+ var RESULTS = {
3215
+ Success: "Success",
3216
+ Failure: "Failure",
3217
+ ConfigError: "ConfigError",
3218
+ AuthenticationError: "AuthenticationError",
3219
+ ValidationError: "ValidationError",
3220
+ TimeoutError: "TimeoutError"
3221
+ };
3222
+
3184
3223
  // ../../common/src/error-codes.ts
3185
3224
  var CLI_ERROR_CODES = [
3186
3225
  "invalid_argument",
3226
+ "confirmation_required",
3187
3227
  "authentication_required",
3188
3228
  "permission_denied",
3189
3229
  "local_permission_denied",
3190
3230
  "not_found",
3231
+ "not_enabled",
3191
3232
  "rate_limited",
3192
3233
  "network_error",
3193
3234
  "timeout",
@@ -3226,6 +3267,12 @@ function carriedRetry(error) {
3226
3267
  const retry = error.retry;
3227
3268
  return isRetryHint(retry) ? retry : undefined;
3228
3269
  }
3270
+ function carriedResult(error) {
3271
+ if (!error || typeof error !== "object")
3272
+ return;
3273
+ const result = error.result;
3274
+ return typeof result === "string" && result !== RESULTS.Success && Object.values(RESULTS).includes(result) ? result : undefined;
3275
+ }
3229
3276
  function defaultRetryForErrorCode(errorCode) {
3230
3277
  switch (errorCode) {
3231
3278
  case "network_error":
@@ -3283,6 +3330,15 @@ function findHttpStatusInGraph(error) {
3283
3330
  }
3284
3331
 
3285
3332
  // ../../common/src/http-status.ts
3333
+ function httpStatusOf(error) {
3334
+ if (!error || typeof error !== "object") {
3335
+ return;
3336
+ }
3337
+ if ("response" in error && error.response && typeof error.response === "object" && "status" in error.response && typeof error.response.status === "number") {
3338
+ return error.response.status;
3339
+ }
3340
+ return "status" in error && typeof error.status === "number" ? error.status : undefined;
3341
+ }
3286
3342
  function classifyHttpStatus(status) {
3287
3343
  if (status === undefined)
3288
3344
  return;
@@ -3615,6 +3671,8 @@ async function extractErrorDetails(error, options) {
3615
3671
  }
3616
3672
  if (parsedBody?.errorCode && typeof parsedBody.errorCode === "string") {
3617
3673
  context.errorCode = parsedBody.errorCode;
3674
+ } else if (typeof parsedBody?.errorCode === "number") {
3675
+ context.errorCode = String(parsedBody.errorCode);
3618
3676
  } else if (parsedBody?.code && typeof parsedBody.code === "string") {
3619
3677
  context.errorCode = parsedBody.code;
3620
3678
  }
@@ -3753,16 +3811,6 @@ function instructionsFor(ctx, err) {
3753
3811
  }
3754
3812
  }
3755
3813
 
3756
- // ../../common/src/result-types.ts
3757
- var RESULTS = {
3758
- Success: "Success",
3759
- Failure: "Failure",
3760
- ConfigError: "ConfigError",
3761
- AuthenticationError: "AuthenticationError",
3762
- ValidationError: "ValidationError",
3763
- TimeoutError: "TimeoutError"
3764
- };
3765
-
3766
3814
  // ../../common/src/classified-failure.ts
3767
3815
  async function authContextFailure(error, sessionInstructions) {
3768
3816
  const details = await extractErrorDetails(error);
@@ -3776,6 +3824,16 @@ async function authContextFailure(error, sessionInstructions) {
3776
3824
  ...details.context ? { Context: details.context } : {}
3777
3825
  };
3778
3826
  }
3827
+ function notSupportedFailure(operation, instructions, context) {
3828
+ return {
3829
+ Result: RESULTS.Failure,
3830
+ ErrorCode: "not_supported",
3831
+ Message: `${operation} isn't supported on the connected environment.`,
3832
+ Instructions: instructions,
3833
+ Retry: "RetryWillNotFix",
3834
+ ...context ? { Context: context } : {}
3835
+ };
3836
+ }
3779
3837
  // ../../../node_modules/commander/index.js
3780
3838
  var exports_commander = {};
3781
3839
  __exportCjs(exports_commander, {
@@ -4174,7 +4232,7 @@ async function loadOutputCodecsAsync(needed) {
4174
4232
  }));
4175
4233
  }
4176
4234
  if (needed.filter && jmespathSlot.get() === undefined) {
4177
- loads.push(import("./jmespath-j5nd2wx4.js").then((m)=>__toESM(m.default,1)).then((mod) => {
4235
+ loads.push(import("./jmespath-4h5v1jy3.js").then((m)=>__toESM(m.default,1)).then((mod) => {
4178
4236
  jmespathSlot.set(mod);
4179
4237
  }));
4180
4238
  }
@@ -4208,7 +4266,10 @@ var AUTH_ERROR_CODES = new Set([
4208
4266
  var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
4209
4267
  "local_permission_denied"
4210
4268
  ]);
4211
- var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
4269
+ var VALIDATION_ERROR_CODES = new Set([
4270
+ "invalid_argument",
4271
+ "confirmation_required"
4272
+ ]);
4212
4273
  var NETWORK_HTTP_ERROR_CODES = new Set([
4213
4274
  "network_error",
4214
4275
  "rate_limited",
@@ -4434,6 +4495,109 @@ var CommonTelemetryEvents = {
4434
4495
  ShipSucceeded: "Cli.ShipSucceeded"
4435
4496
  };
4436
4497
 
4498
+ // ../../common/src/telemetry/global-telemetry-properties.ts
4499
+ var telemetryPropsSlot = singleton("TelemetryDefaultProps");
4500
+ function getGlobalTelemetryProperties() {
4501
+ return telemetryPropsSlot.get();
4502
+ }
4503
+
4504
+ // ../../common/src/telemetry/trace-context.ts
4505
+ var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
4506
+ var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
4507
+ function getProcessEnv() {
4508
+ return globalThis.process?.env;
4509
+ }
4510
+ function parseInboundTraceparent(value) {
4511
+ if (!value) {
4512
+ return;
4513
+ }
4514
+ const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
4515
+ if (!match) {
4516
+ return;
4517
+ }
4518
+ const [, traceId, parentSpanId] = match;
4519
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
4520
+ return;
4521
+ }
4522
+ return { traceId, parentSpanId };
4523
+ }
4524
+ function getInboundTraceContext() {
4525
+ return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
4526
+ }
4527
+
4528
+ // ../../common/src/telemetry/session-id.ts
4529
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
4530
+ var SESSION_ID_MAX_LENGTH = 64;
4531
+ var RANDOM_SESSION_ID_LENGTH = 32;
4532
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
4533
+ var CONTROL_CHARACTERS = /\p{Cc}/gu;
4534
+ var INHERITED_SESSION_SOURCES = [
4535
+ { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
4536
+ { envVar: "CODEX_THREAD_ID", source: "codex" },
4537
+ { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
4538
+ { envVar: "TERM_SESSION_ID", source: "terminal" },
4539
+ { envVar: "WT_SESSION", source: "terminal" }
4540
+ ];
4541
+ var telemetrySessionSlot = singleton("TelemetrySession");
4542
+ var telemetryOperationIdSlot = singleton("TelemetryOperationId");
4543
+ function getProcessEnv2() {
4544
+ return globalThis.process?.env;
4545
+ }
4546
+ function normalizeSessionId(value) {
4547
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
4548
+ return;
4549
+ }
4550
+ const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
4551
+ return cleaned || undefined;
4552
+ }
4553
+ function getConfiguredTelemetrySessionId() {
4554
+ return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
4555
+ }
4556
+ function getInheritedSession(env) {
4557
+ for (const candidate of INHERITED_SESSION_SOURCES) {
4558
+ const handle = normalizeSessionId(env[candidate.envVar]);
4559
+ if (handle) {
4560
+ return { id: handle, source: candidate.source };
4561
+ }
4562
+ }
4563
+ return;
4564
+ }
4565
+ function generateRandomSession() {
4566
+ const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
4567
+ crypto.getRandomValues(bytes);
4568
+ let hex = "";
4569
+ for (const byte of bytes) {
4570
+ hex += byte.toString(16).padStart(2, "0");
4571
+ }
4572
+ return { id: hex, source: "random" };
4573
+ }
4574
+ function resolveTelemetrySession() {
4575
+ const existing = telemetrySessionSlot.get();
4576
+ if (existing) {
4577
+ return existing;
4578
+ }
4579
+ const declaredHandle = getConfiguredTelemetrySessionId();
4580
+ const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
4581
+ telemetrySessionSlot.set(resolved);
4582
+ return resolved;
4583
+ }
4584
+ function getTelemetrySessionId() {
4585
+ return resolveTelemetrySession().id;
4586
+ }
4587
+ function getTelemetrySessionSource() {
4588
+ return resolveTelemetrySession().source;
4589
+ }
4590
+ function getTelemetryOperationId() {
4591
+ const existing = telemetryOperationIdSlot.get();
4592
+ if (existing) {
4593
+ return existing;
4594
+ }
4595
+ const inboundTraceId = getInboundTraceContext()?.traceId;
4596
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
4597
+ telemetryOperationIdSlot.set(generated);
4598
+ return generated;
4599
+ }
4600
+
4437
4601
  // ../../common/src/registry.ts
4438
4602
  import { execFileSync } from "node:child_process";
4439
4603
  function readRegistryValue(keyPath, valueName) {
@@ -4655,108 +4819,6 @@ class NodeContextStorage {
4655
4819
  return this.storage.getStore();
4656
4820
  }
4657
4821
  }
4658
- // ../../common/src/telemetry/trace-context.ts
4659
- var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
4660
- var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
4661
- function getProcessEnv() {
4662
- return globalThis.process?.env;
4663
- }
4664
- function parseInboundTraceparent(value) {
4665
- if (!value) {
4666
- return;
4667
- }
4668
- const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
4669
- if (!match) {
4670
- return;
4671
- }
4672
- const [, traceId, parentSpanId] = match;
4673
- if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
4674
- return;
4675
- }
4676
- return { traceId, parentSpanId };
4677
- }
4678
- function getInboundTraceContext() {
4679
- return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
4680
- }
4681
-
4682
- // ../../common/src/telemetry/session-id.ts
4683
- var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
4684
- var SESSION_ID_MAX_LENGTH = 64;
4685
- var RANDOM_SESSION_ID_LENGTH = 32;
4686
- var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
4687
- var CONTROL_CHARACTERS = /\p{Cc}/gu;
4688
- var INHERITED_SESSION_SOURCES = [
4689
- { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
4690
- { envVar: "CODEX_THREAD_ID", source: "codex" },
4691
- { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
4692
- { envVar: "TERM_SESSION_ID", source: "terminal" },
4693
- { envVar: "WT_SESSION", source: "terminal" }
4694
- ];
4695
- var telemetrySessionSlot = singleton("TelemetrySession");
4696
- var telemetryOperationIdSlot = singleton("TelemetryOperationId");
4697
- function getProcessEnv2() {
4698
- return globalThis.process?.env;
4699
- }
4700
- function normalizeSessionId(value) {
4701
- if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
4702
- return;
4703
- }
4704
- const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
4705
- return cleaned || undefined;
4706
- }
4707
- function getConfiguredTelemetrySessionId() {
4708
- return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
4709
- }
4710
- function getInheritedSession(env) {
4711
- for (const candidate of INHERITED_SESSION_SOURCES) {
4712
- const handle = normalizeSessionId(env[candidate.envVar]);
4713
- if (handle) {
4714
- return { id: handle, source: candidate.source };
4715
- }
4716
- }
4717
- return;
4718
- }
4719
- function generateRandomSession() {
4720
- const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
4721
- crypto.getRandomValues(bytes);
4722
- let hex = "";
4723
- for (const byte of bytes) {
4724
- hex += byte.toString(16).padStart(2, "0");
4725
- }
4726
- return { id: hex, source: "random" };
4727
- }
4728
- function resolveTelemetrySession() {
4729
- const existing = telemetrySessionSlot.get();
4730
- if (existing) {
4731
- return existing;
4732
- }
4733
- const declaredHandle = getConfiguredTelemetrySessionId();
4734
- const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
4735
- telemetrySessionSlot.set(resolved);
4736
- return resolved;
4737
- }
4738
- function getTelemetrySessionId() {
4739
- return resolveTelemetrySession().id;
4740
- }
4741
- function getTelemetrySessionSource() {
4742
- return resolveTelemetrySession().source;
4743
- }
4744
- function getTelemetryOperationId() {
4745
- const existing = telemetryOperationIdSlot.get();
4746
- if (existing) {
4747
- return existing;
4748
- }
4749
- const inboundTraceId = getInboundTraceContext()?.traceId;
4750
- const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
4751
- telemetryOperationIdSlot.set(generated);
4752
- return generated;
4753
- }
4754
- // ../../common/src/telemetry/global-telemetry-properties.ts
4755
- var telemetryPropsSlot = singleton("TelemetryDefaultProps");
4756
- function getGlobalTelemetryProperties() {
4757
- return telemetryPropsSlot.get();
4758
- }
4759
-
4760
4822
  // ../../common/src/telemetry/span-clock.ts
4761
4823
  function startSpanClock() {
4762
4824
  const started = performance.now();
@@ -4970,6 +5032,7 @@ var MAX_SPOOL_AGE_MS = 72 * 60 * 60 * 1000;
4970
5032
  // ../../common/src/telemetry/telemetry-init.ts
4971
5033
  var telemetryInstanceSlot = singleton("TelemetryService");
4972
5034
  var DEFAULT_AI_CONNECTION_STRING = atob("SW5zdHJ1bWVudGF0aW9uS2V5PTliZDM3NDgyLTgxMGUtNDQyYS1hYWE2LWQzOGVmNjVjNjY3NDtJbmdlc3Rpb25FbmRwb2ludD1odHRwczovL3dlc3RldXJvcGUtNS5pbi5hcHBsaWNhdGlvbmluc2lnaHRzLmF6dXJlLmNvbS87TGl2ZUVuZHBvaW50PWh0dHBzOi8vd2VzdGV1cm9wZS5saXZlZGlhZ25vc3RpY3MubW9uaXRvci5henVyZS5jb20vO0FwcGxpY2F0aW9uSWQ9MzU2OTdlZjEtOGJkMC00ZjE5LWEyN2MtZDg3Y2NhYzY2ZDJj");
5035
+ var browserProviderSlot = singleton("BrowserAppInsightsTelemetryProvider");
4973
5036
  function getGlobalTelemetryInstance() {
4974
5037
  const existing = telemetryInstanceSlot.get();
4975
5038
  if (existing && typeof existing === "object" && "trackEvent" in existing && typeof existing.trackEvent === "function") {
@@ -5153,7 +5216,7 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
5153
5216
  const pagedRows = extractPagedRows(data.Data);
5154
5217
  const items = pagedRows ?? (Array.isArray(data.Data) ? data.Data : [data.Data]);
5155
5218
  items.forEach((item) => {
5156
- const values = Object.values(item).map((v) => v ?? "").join("\t");
5219
+ const values = item === null || typeof item !== "object" ? String(item ?? "") : Object.values(item).map((v) => v ?? "").join("\t");
5157
5220
  logFn(values);
5158
5221
  });
5159
5222
  } else {
@@ -5168,7 +5231,8 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
5168
5231
  default: {
5169
5232
  const hasData = "Data" in data && data.Data != null;
5170
5233
  const pagedRows = hasData ? extractPagedRows(data.Data) : null;
5171
- const rows = pagedRows ? pagedRows : Array.isArray(data.Data) ? data.Data : null;
5234
+ const resolvedRows = pagedRows ? pagedRows : Array.isArray(data.Data) ? data.Data : null;
5235
+ const rows = resolvedRows && isPrimitiveArray(resolvedRows) ? resolvedRows.map((entry) => ({ Value: entry })) : resolvedRows;
5172
5236
  if (hasData && !(rows !== null && rows.length === 0)) {
5173
5237
  const logValue = data.Log;
5174
5238
  if (rows !== null) {
@@ -5225,6 +5289,9 @@ function printTable(data, logFn, externalLogValue, tableRowStyle) {
5225
5289
  function isPlainObjectArray(value) {
5226
5290
  return Array.isArray(value) && value.length > 0 && value.every(isPlainRecord);
5227
5291
  }
5292
+ function isPrimitiveArray(value) {
5293
+ return Array.isArray(value) && value.length > 0 && value.every((entry) => entry === null || typeof entry !== "object");
5294
+ }
5228
5295
  function isNonEmptyPlainObject(value) {
5229
5296
  return isPlainRecord(value) && Object.keys(value).length > 0;
5230
5297
  }
@@ -5571,12 +5638,12 @@ class FilterEvaluationError extends Error {
5571
5638
  instructions;
5572
5639
  retry = "RetryWillNotFix";
5573
5640
  result = RESULTS.ValidationError;
5574
- constructor(filter, cause) {
5641
+ constructor(filter, cause, hint) {
5575
5642
  const underlying = cause instanceof Error ? cause.message : String(cause);
5576
- super(`Filter '${filter}' failed to evaluate: ${underlying}`);
5643
+ super(`Filter '${filter}' failed to evaluate: ${underlying}` + (hint ? ` ${hint.detail}` : ""));
5577
5644
  this.name = "FilterEvaluationError";
5578
5645
  this.filter = filter;
5579
- 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(@)'.";
5646
+ 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(@)'.";
5580
5647
  }
5581
5648
  }
5582
5649
 
@@ -5698,6 +5765,93 @@ function nameList(names, cap = 12) {
5698
5765
  const rest = names.length - shown.length;
5699
5766
  return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
5700
5767
  }
5768
+ function notFieldsOn(names, scope) {
5769
+ return `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
5770
+ }
5771
+ function failingFieldRead(ast, isList, fn, argIndex) {
5772
+ const [left, right, condition] = ast.children ?? [];
5773
+ let scopes = [];
5774
+ if (!isList) {
5775
+ scopes = [ast];
5776
+ } else if (ast.type === "FilterProjection" && left?.type === "Identity") {
5777
+ scopes = [condition, right];
5778
+ } else if (ast.type === "Projection" && (left?.type === "Identity" || left?.type === "Flatten" && left.children?.[0]?.type === "Identity")) {
5779
+ scopes = [right];
5780
+ }
5781
+ const reads = new Set;
5782
+ let tracked = 0;
5783
+ const visit = (node) => {
5784
+ if (!node)
5785
+ return;
5786
+ switch (node.type) {
5787
+ case "Function": {
5788
+ const arg = node.children?.[argIndex - 1];
5789
+ if (node.name === fn && arg?.type === "Field" && arg.name) {
5790
+ reads.add(arg.name);
5791
+ tracked++;
5792
+ }
5793
+ node.children?.forEach(visit);
5794
+ return;
5795
+ }
5796
+ case "AndExpression":
5797
+ case "OrExpression":
5798
+ case "NotExpression":
5799
+ case "Comparator":
5800
+ case "MultiSelectList":
5801
+ case "MultiSelectHash":
5802
+ node.children?.forEach(visit);
5803
+ return;
5804
+ case "KeyValuePair":
5805
+ visit(node.value);
5806
+ return;
5807
+ }
5808
+ };
5809
+ scopes.forEach(visit);
5810
+ const calls = (node) => {
5811
+ if (node === null || typeof node !== "object")
5812
+ return 0;
5813
+ const own = node.type === "Function" && node.name === fn ? 1 : 0;
5814
+ const next = node.type === "KeyValuePair" ? [node.value] : node.children ?? [];
5815
+ return own + next.reduce((sum, child) => sum + calls(child), 0);
5816
+ };
5817
+ return reads.size === 1 && tracked === calls(ast) ? [...reads][0] : undefined;
5818
+ }
5819
+ function fieldExpression(name) {
5820
+ return /^[A-Za-z_]\w*$/.test(name) ? name : JSON.stringify(name);
5821
+ }
5822
+ function evaluationHint(codec, filter, data, cause) {
5823
+ const underlying = cause instanceof Error ? cause.message : String(cause);
5824
+ const failure = /\b(\w+)\(\) expected argument (\d+) to be type (\S+) but received type null\b/.exec(underlying);
5825
+ if (!failure)
5826
+ return;
5827
+ const [, fn, position, expected] = failure;
5828
+ const name = failingFieldRead(codec.compile(filter), Array.isArray(data), fn, Number(position));
5829
+ if (name === undefined)
5830
+ return;
5831
+ const present = availableFields(data);
5832
+ if (present.length === 0)
5833
+ return;
5834
+ const scope = `${countRecords(data)} record(s)`;
5835
+ if (!present.includes(name)) {
5836
+ return {
5837
+ detail: `${notFieldsOn([name], scope)}. Available fields: ${nameList(present)}.`,
5838
+ instructions: "Use a field the records have; names are case-sensitive."
5839
+ };
5840
+ }
5841
+ const records = Array.isArray(data) ? data : [data];
5842
+ const unset = records.filter((r) => r?.[name] == null).length;
5843
+ const field = fieldExpression(name);
5844
+ let fallback;
5845
+ if (expected.split(",").includes("string")) {
5846
+ fallback = "''";
5847
+ } else if (expected.split(",").includes("array")) {
5848
+ fallback = "`[]`";
5849
+ }
5850
+ return {
5851
+ detail: `\`${name}\` is null or missing on ${unset} of the ${scope} it read.`,
5852
+ 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.`
5853
+ };
5854
+ }
5701
5855
  function buildFilterWarning(filter, data, outcome) {
5702
5856
  const present = availableFields(data);
5703
5857
  const refs = referencedFields(filter);
@@ -5705,7 +5859,7 @@ function buildFilterWarning(filter, data, outcome) {
5705
5859
  const unchecked = refs.nested.filter((name) => !present.includes(name));
5706
5860
  const count = countRecords(data);
5707
5861
  const scope = `${count} record(s)`;
5708
- const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
5862
+ const isNotAField = (names) => notFieldsOn(names, scope);
5709
5863
  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" : "";
5710
5864
  const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
5711
5865
  let detail;
@@ -5756,7 +5910,8 @@ function applyFilter(data, filter, onWarning) {
5756
5910
  try {
5757
5911
  result = codec.search(data, filter);
5758
5912
  } catch (err) {
5759
- throw new FilterEvaluationError(filter, err);
5913
+ const [, hint] = catchError(() => evaluationHint(codec, filter, data, err));
5914
+ throw new FilterEvaluationError(filter, err, hint);
5760
5915
  }
5761
5916
  const inputCount = countRecords(data);
5762
5917
  const warn = (outcome) => {
@@ -6647,7 +6802,7 @@ Command2.prototype.trackedAction = function(context, fn, properties) {
6647
6802
  logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
6648
6803
  const typed = error;
6649
6804
  const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
6650
- const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
6805
+ const customResult = carriedResult(error);
6651
6806
  const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
6652
6807
  const classified = cancellationExitCode === undefined ? await extractErrorDetails(error) : undefined;
6653
6808
  const finalResult = customResult ?? classified?.result ?? RESULTS.Failure;
@@ -7063,6 +7218,8 @@ var FAILURE_STATUSES = new Set([
7063
7218
  "canceled",
7064
7219
  "stopped"
7065
7220
  ]);
7221
+ // ../../common/src/relayed-output.ts
7222
+ var RELAYED_OUTPUT_SYMBOL = Symbol.for("@uipath/common/relayed-output");
7066
7223
  // ../../common/src/screen-logger.ts
7067
7224
  var ScreenLogger;
7068
7225
  ((ScreenLogger) => {
@@ -7151,6 +7308,6 @@ function installSdkUserAgentHeader(BaseApiClass, userAgent) {
7151
7308
  var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
7152
7309
  // ../../common/src/tool-provider.ts
7153
7310
  var factorySlot = singleton("PackagerFactoryProvider");
7154
- export { __commonJS, __require, getFileSystem, catchError, extractErrorDetails, extractErrorMessage, hasIdentityInstructionContext, instructionsFor, RESULTS, authContextFailure, InvalidArgumentError, Option, logger, EXIT_CODES, OutputFormatter, processContext, DEFAULT_PAGE_SIZE, isGuid, stripHostGlobalOptions, resolveDeprecatedOptionAlias, warnDeprecatedOptionAlias, createHiddenDeprecatedTenantOption, parseLimit, splitScopeList, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader };
7311
+ export { __commonJS, __require, getFileSystem, catchError, RESULTS, httpStatusOf, isHtmlDocument, extractErrorDetails, extractErrorMessage, hasIdentityInstructionContext, instructionsFor, authContextFailure, notSupportedFailure, InvalidArgumentError, Option, logger, EXIT_CODES, OutputFormatter, processContext, DEFAULT_PAGE_SIZE, isGuid, stripHostGlobalOptions, resolveDeprecatedOptionAlias, warnDeprecatedOptionAlias, createHiddenDeprecatedTenantOption, parseLimit, splitScopeList, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader };
7155
7312
 
7156
- //# debugId=61BAF08102743B0064756E2164756E21
7313
+ //# debugId=219C943CF8BC864764756E2164756E21
package/dist/tool.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  stripHostGlobalOptions
3
- } from "./tool-q0vzqxdz.js";
3
+ } from "./tool-rs6k74yh.js";
4
4
  // package.json
5
5
  var package_default = {
6
6
  name: "@uipath/admin-tool",
7
7
  author: "UiPath",
8
8
  license: "SEE LICENSE IN LICENSE.txt",
9
- version: "1.206.0-preview.301",
9
+ version: "1.207.0-preview.305",
10
10
  description: "Manage UiPath admin resources — Identity Server, Resource Catalog Service, Audit Service, VPN Gateway.",
11
11
  private: false,
12
12
  repository: {
@@ -70,31 +70,31 @@ var BRANCHES = [
70
70
  "smtp",
71
71
  "users"
72
72
  ],
73
- load: async () => (await import("./index-db7xvvwq.js")).registerCommands
73
+ load: async () => (await import("./index-regsyrqx.js")).registerCommands
74
74
  },
75
75
  {
76
76
  commands: ["ip-restriction"],
77
- load: async () => (await import("./tool-4586zzqb.js")).registerCommands
77
+ load: async () => (await import("./tool-87z2vsnz.js")).registerCommands
78
78
  },
79
79
  {
80
80
  commands: ["authorization"],
81
- load: async () => (await import("./index-nycd20k5.js")).registerCommands
81
+ load: async () => (await import("./index-f8f5dhpd.js")).registerCommands
82
82
  },
83
83
  {
84
84
  commands: ["organizations", "tenants"],
85
- load: async () => (await import("./index-7n80g17v.js")).registerCommands
85
+ load: async () => (await import("./index-0kk3t5j4.js")).registerCommands
86
86
  },
87
87
  {
88
88
  commands: ["rcs"],
89
- load: async () => (await import("./tool-w6c1tph3.js")).registerCommands
89
+ load: async () => (await import("./tool-gr9m06t5.js")).registerCommands
90
90
  },
91
91
  {
92
92
  commands: ["audit"],
93
- load: async () => (await import("./index-12qjgrqm.js")).registerCommands
93
+ load: async () => (await import("./index-2ja3n3vb.js")).registerCommands
94
94
  },
95
95
  {
96
96
  commands: ["integrations"],
97
- load: async () => (await import("./index-m1sfzb2e.js")).registerCommands
97
+ load: async () => (await import("./index-dar4xzeg.js")).registerCommands
98
98
  }
99
99
  ];
100
100
  function branchesFor(argv) {
@@ -119,4 +119,4 @@ export {
119
119
  registerCommands
120
120
  };
121
121
 
122
- //# debugId=54C629A44518084E64756E2164756E21
122
+ //# debugId=D13A3DB6D723C90F64756E2164756E21
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/admin-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 admin resources — Identity Server, Resource Catalog Service, Audit Service, VPN Gateway.",
7
7
  "private": false,
8
8
  "repository": {
@@ -24,5 +24,5 @@
24
24
  "files": [
25
25
  "dist"
26
26
  ],
27
- "gitHead": "078afc3ef7ebf4c38353ee0059e321acf16a350d"
27
+ "gitHead": "1600aa89255c37c1b8bc68d9882c3395c1d5bff4"
28
28
  }