@uipath/admin-tool 1.204.0-preview.255 → 1.205.0-preview.256

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.
@@ -8,8 +8,8 @@ import {
8
8
  UserApi,
9
9
  createApiClient,
10
10
  createIdentityConfig
11
- } from "./tool-zg3eqb53.js";
12
- import"./tool-4qsa72nx.js";
11
+ } from "./tool-hsqb6sve.js";
12
+ import"./tool-nwbftwhg.js";
13
13
  import {
14
14
  DEFAULT_PAGE_SIZE,
15
15
  Option,
@@ -20,7 +20,7 @@ import {
20
20
  logger,
21
21
  processContext,
22
22
  splitScopeList
23
- } from "./tool-t5733z6f.js";
23
+ } from "./tool-2wtwtawb.js";
24
24
  import"./tool-1yh8g550.js";
25
25
 
26
26
  // ../identity-commands/src/commands/external-apps.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getLoginStatusAsync
3
- } from "./tool-4qsa72nx.js";
3
+ } from "./tool-nwbftwhg.js";
4
4
  import {
5
5
  EXIT_CODES,
6
6
  OutputFormatter,
@@ -16,7 +16,7 @@ import {
16
16
  logger,
17
17
  parseLimit,
18
18
  processContext
19
- } from "./tool-t5733z6f.js";
19
+ } from "./tool-2wtwtawb.js";
20
20
  import"./tool-1yh8g550.js";
21
21
 
22
22
  // ../audit-sdk/generated/src/runtime.ts
@@ -285,7 +285,7 @@ var package_default = {
285
285
  name: "@uipath/audit-sdk",
286
286
  author: "UiPath",
287
287
  license: "SEE LICENSE IN LICENSE.txt",
288
- version: "1.204.0",
288
+ version: "1.205.0",
289
289
  description: "SDK for the UiPath Audit Service — query audit event sources, list events, download long-term-store exports, and manage audit exclusion rules.",
290
290
  repository: {
291
291
  type: "git",
@@ -2408,4 +2408,4 @@ export {
2408
2408
  registerCommands
2409
2409
  };
2410
2410
 
2411
- //# debugId=FA243E6A665F869364756E2164756E21
2411
+ //# debugId=E384A04394AEF5EF64756E2164756E21
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  UserApi,
3
3
  createApiClient
4
- } from "./tool-zg3eqb53.js";
4
+ } from "./tool-hsqb6sve.js";
5
5
  import {
6
6
  getLoginStatusAsync
7
- } from "./tool-4qsa72nx.js";
7
+ } from "./tool-nwbftwhg.js";
8
8
  import {
9
9
  InvalidArgumentError,
10
10
  Option,
@@ -17,7 +17,7 @@ import {
17
17
  getSdkUserAgentToken,
18
18
  installSdkUserAgentHeader,
19
19
  processContext
20
- } from "./tool-t5733z6f.js";
20
+ } from "./tool-2wtwtawb.js";
21
21
  import"./tool-1yh8g550.js";
22
22
 
23
23
  // ../authz-sdk/generated/src/runtime.ts
@@ -274,7 +274,7 @@ var package_default = {
274
274
  name: "@uipath/authz-sdk",
275
275
  author: "UiPath",
276
276
  license: "SEE LICENSE IN LICENSE.txt",
277
- version: "1.204.0",
277
+ version: "1.205.0",
278
278
  description: "SDK for the UiPath Authorization Service API.",
279
279
  repository: {
280
280
  type: "git",
@@ -2737,4 +2737,4 @@ export {
2737
2737
  registerCommands
2738
2738
  };
2739
2739
 
2740
- //# debugId=BC57231B618E4E9864756E2164756E21
2740
+ //# debugId=4F3015C24C2A503D64756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getLoginStatusAsync
3
- } from "./tool-4qsa72nx.js";
3
+ } from "./tool-nwbftwhg.js";
4
4
  import {
5
5
  Option,
6
6
  OutputFormatter,
@@ -12,7 +12,7 @@ import {
12
12
  getSdkUserAgentToken,
13
13
  installSdkUserAgentHeader,
14
14
  processContext
15
- } from "./tool-t5733z6f.js";
15
+ } from "./tool-2wtwtawb.js";
16
16
  import {
17
17
  __export
18
18
  } from "./tool-1yh8g550.js";
@@ -833,7 +833,7 @@ var package_default = {
833
833
  name: "@uipath/oms-sdk",
834
834
  author: "UiPath",
835
835
  license: "SEE LICENSE IN LICENSE.txt",
836
- version: "1.204.0",
836
+ version: "1.205.0",
837
837
  description: "SDK for the UiPath Organization Management Service API.",
838
838
  repository: {
839
839
  type: "git",
@@ -5577,7 +5577,7 @@ var registerRegionsCommands = (organizations) => {
5577
5577
  };
5578
5578
  var registerOperationCommands = (organizations) => {
5579
5579
  const operation = organizations.command("operation").description("Inspect async operations on the caller's organization.");
5580
- withLoginValidity(operation.command("get").description("Return the status of an async OMS operation by id (e.g. service provisioning).").argument("<operationId>", "Operation UUID returned from a previous async call.").examples(OPERATION_EXAMPLES)).trackedAction(processContext, async (operationId, options) => {
5580
+ withLoginValidity(operation.command("get").description("Return the status of an async OMS operation by id (e.g. service provisioning).").argument("<operation-id>", "Operation UUID returned from a previous async call.").examples(OPERATION_EXAMPLES)).trackedAction(processContext, async (operationId, options) => {
5581
5581
  const client = await getOrgApi(options);
5582
5582
  if (!client)
5583
5583
  return;
@@ -6498,4 +6498,4 @@ export {
6498
6498
  registerCommands
6499
6499
  };
6500
6500
 
6501
- //# debugId=81BDF51B6C371D3564756E2164756E21
6501
+ //# debugId=F4CEE5477512D6D164756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getLoginStatusAsync
3
- } from "./tool-4qsa72nx.js";
3
+ } from "./tool-nwbftwhg.js";
4
4
  import {
5
5
  InvalidArgumentError,
6
6
  Option,
@@ -13,7 +13,7 @@ import {
13
13
  installSdkUserAgentHeader,
14
14
  instructionsFor,
15
15
  processContext
16
- } from "./tool-t5733z6f.js";
16
+ } from "./tool-2wtwtawb.js";
17
17
  import"./tool-1yh8g550.js";
18
18
 
19
19
  // ../vpngateway-sdk/generated/src/runtime.ts
@@ -270,7 +270,7 @@ var package_default = {
270
270
  name: "@uipath/admin-vpngateway-sdk",
271
271
  author: "UiPath",
272
272
  license: "SEE LICENSE IN LICENSE.txt",
273
- version: "1.204.0",
273
+ version: "1.205.0",
274
274
  description: "SDK for the UiPath Hypervisor VPN Gateway management APIs.",
275
275
  repository: {
276
276
  type: "git",
@@ -2243,4 +2243,4 @@ export {
2243
2243
  registerCommands
2244
2244
  };
2245
2245
 
2246
- //# debugId=7894022BB1A452E864756E2164756E21
2246
+ //# debugId=F7B7DA646F9E6FE964756E2164756E21
@@ -2312,6 +2312,16 @@ class NodeFileSystem {
2312
2312
  async rename(oldPath, newPath) {
2313
2313
  await fs.rename(oldPath, newPath);
2314
2314
  }
2315
+ async isSymbolicLink(filePath) {
2316
+ try {
2317
+ return (await fs.lstat(filePath)).isSymbolicLink();
2318
+ } catch (error) {
2319
+ if (this.isEnoent(error) || this.hasErrnoCode(error, "ENOTDIR")) {
2320
+ return false;
2321
+ }
2322
+ throw error;
2323
+ }
2324
+ }
2315
2325
  async realpath(filePath) {
2316
2326
  try {
2317
2327
  return await fs.realpath(filePath);
@@ -3347,7 +3357,7 @@ function setGlobalLogFilePath(path2) {
3347
3357
  function getGlobalLogFilePath() {
3348
3358
  return logFilePathSlot.get("");
3349
3359
  }
3350
- var DEFAULT_LOG_LEVEL = 3 /* ERROR */;
3360
+ var DEFAULT_LOG_LEVEL = 2 /* WARN */;
3351
3361
 
3352
3362
  class SimpleLogger {
3353
3363
  __brand = "SimpleLogger";
@@ -3614,7 +3624,9 @@ var ErrorDimensions = {
3614
3624
  Result: "Result",
3615
3625
  ErrorCode: "ErrorCode",
3616
3626
  Retry: "Retry",
3617
- ErrorMessage: "ErrorMessage"
3627
+ ErrorMessage: "ErrorMessage",
3628
+ HttpStatus: "HttpStatus",
3629
+ UpstreamErrorCode: "UpstreamErrorCode"
3618
3630
  };
3619
3631
  var AuthDimensions = {
3620
3632
  AuthenticationMethod: "AuthenticationMethod",
@@ -4602,7 +4614,9 @@ var CLI_ERROR_CODES = [
4602
4614
  "timeout",
4603
4615
  "server_error",
4604
4616
  "method_not_allowed",
4617
+ "not_supported",
4605
4618
  "configuration_error",
4619
+ "execution_failed",
4606
4620
  "unknown_error"
4607
4621
  ];
4608
4622
  var RETRY_HINTS = [
@@ -5559,7 +5573,9 @@ var OutputFormatter;
5559
5573
  [ErrorDimensions.Result]: data.Result,
5560
5574
  [ErrorDimensions.ErrorCode]: data.ErrorCode,
5561
5575
  [ErrorDimensions.Retry]: data.Retry,
5562
- [ErrorDimensions.ErrorMessage]: data.Message
5576
+ [ErrorDimensions.ErrorMessage]: data.Message,
5577
+ [ErrorDimensions.HttpStatus]: data.Context?.httpStatus?.toString(),
5578
+ [ErrorDimensions.UpstreamErrorCode]: data.Context?.errorCode
5563
5579
  });
5564
5580
  }
5565
5581
  logOutput(normalizeOutputKeys(envelope), getOutputFormat());
@@ -6600,4 +6616,4 @@ var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
6600
6616
  var factorySlot = singleton("PackagerFactoryProvider");
6601
6617
  export { getFileSystem, catchError, extractErrorDetails, extractErrorMessage, logger, RESULTS, EXIT_CODES, OutputFormatter, InvalidArgumentError, Option, processContext, DEFAULT_PAGE_SIZE, instructionsFor, isGuid, stripHostGlobalOptions, resolveDeprecatedOptionAlias, warnDeprecatedOptionAlias, createHiddenDeprecatedTenantOption, parseLimit, splitScopeList, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader };
6602
6618
 
6603
- //# debugId=369A45C0483E586B64756E2164756E21
6619
+ //# debugId=B08C2FB5059F6FCC64756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getLoginStatusAsync
3
- } from "./tool-4qsa72nx.js";
3
+ } from "./tool-nwbftwhg.js";
4
4
  import {
5
5
  OutputFormatter,
6
6
  RESULTS,
@@ -11,14 +11,14 @@ import {
11
11
  getSdkUserAgentToken,
12
12
  installSdkUserAgentHeader,
13
13
  processContext
14
- } from "./tool-t5733z6f.js";
14
+ } from "./tool-2wtwtawb.js";
15
15
  import"./tool-1yh8g550.js";
16
16
  // ../apms-tool/package.json
17
17
  var package_default = {
18
18
  name: "@uipath/apms-tool",
19
19
  author: "UiPath",
20
20
  license: "SEE LICENSE IN LICENSE.txt",
21
- version: "1.204.0-preview.255",
21
+ version: "1.205.0-preview.256",
22
22
  description: "CLI plugin for the UiPath Access Policy Management Service.",
23
23
  private: false,
24
24
  repository: {
@@ -316,7 +316,7 @@ var package_default2 = {
316
316
  name: "@uipath/apms-sdk",
317
317
  author: "UiPath",
318
318
  license: "SEE LICENSE IN LICENSE.txt",
319
- version: "1.204.0",
319
+ version: "1.205.0",
320
320
  description: "SDK for the UiPath Access Policy Management Service API.",
321
321
  repository: {
322
322
  type: "git",
@@ -2528,4 +2528,4 @@ export {
2528
2528
  registerCommands
2529
2529
  };
2530
2530
 
2531
- //# debugId=B38F7BCC9AA5CA5864756E2164756E21
2531
+ //# debugId=3C02F9832F91FA5B64756E2164756E21
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getAuthContext
3
- } from "./tool-4qsa72nx.js";
3
+ } from "./tool-nwbftwhg.js";
4
4
  import {
5
5
  addSdkUserAgentHeader,
6
6
  getSdkUserAgentToken,
7
7
  installSdkUserAgentHeader
8
- } from "./tool-t5733z6f.js";
8
+ } from "./tool-2wtwtawb.js";
9
9
 
10
10
  // ../identity-sdk/generated/src/runtime.ts
11
11
  var BASE_PATH = "https://alpha.uipath.com/identity_".replace(/\/+$/, "");
@@ -2778,7 +2778,7 @@ var package_default = {
2778
2778
  name: "@uipath/identity-sdk",
2779
2779
  author: "UiPath",
2780
2780
  license: "SEE LICENSE IN LICENSE.txt",
2781
- version: "1.204.0",
2781
+ version: "1.205.0",
2782
2782
  repository: {
2783
2783
  type: "git",
2784
2784
  url: "https://github.com/UiPath/cli.git",
@@ -2856,4 +2856,4 @@ async function createApiClient(ApiClass, options) {
2856
2856
  }
2857
2857
  export { ExternalApiResourceApi, ExternalClientApi, GroupApi, ReferenceTokenApi, RobotAccountApi, SettingApi, UserApi, createIdentityConfig, createApiClient };
2858
2858
 
2859
- //# debugId=77F8D0DA3024A47F64756E2164756E21
2859
+ //# debugId=095D2F366A958E3064756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFileSystem
3
- } from "./tool-t5733z6f.js";
3
+ } from "./tool-2wtwtawb.js";
4
4
  import {
5
5
  __require
6
6
  } from "./tool-1yh8g550.js";
@@ -182,22 +182,12 @@ var resolveConfigAsync = async ({
182
182
  baseUrl = DEFAULT_BASE_URL;
183
183
  }
184
184
  baseUrl = normalizeAndValidateBaseUrl(baseUrl);
185
- let clientId = customClientId;
186
- if (!clientId && fileAuth.clientId) {
187
- clientId = fileAuth.clientId;
188
- }
189
- if (!clientId) {
190
- clientId = DEFAULT_CLIENT_ID;
191
- }
192
- let clientSecret = customClientSecret;
193
- if (!clientSecret && fileAuth.clientSecret) {
194
- clientSecret = fileAuth.clientSecret;
195
- }
196
- const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && (Boolean(clientSecret) || Boolean(customClientAssertion));
185
+ const clientId = customClientId || DEFAULT_CLIENT_ID;
186
+ const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && (Boolean(customClientSecret) || Boolean(customClientAssertion));
197
187
  const scopes = resolveScopes(isExternalAppAuth, customScopes, fileAuth.scopes);
198
188
  return {
199
189
  clientId,
200
- clientSecret,
190
+ clientSecret: customClientSecret,
201
191
  scopes,
202
192
  baseUrl,
203
193
  authorizationEndpoint: `${baseUrl}/identity_/connect/authorize`,
@@ -303,6 +293,16 @@ var resolveIdentityType = (claims, authFlow, email) => {
303
293
  }
304
294
  return;
305
295
  };
296
+ var resolveApplicationSubtype = (claims, authFlow) => {
297
+ switch (asString(claims?.sub_type)) {
298
+ case "service.external":
299
+ return "External";
300
+ case "service.internal":
301
+ return "Internal";
302
+ default:
303
+ return authFlow === "client_credentials" || authFlow === "federated_credentials" ? "External" : undefined;
304
+ }
305
+ };
306
306
  var looksLikeEmail = (value) => value?.includes("@") ?? false;
307
307
  var pickEmail = (claims) => {
308
308
  for (const candidate of [claims?.email, claims?.preferred_username]) {
@@ -344,6 +344,12 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
344
344
  const clientId = asString(claims?.client_id);
345
345
  if (clientId)
346
346
  identity.clientId = clientId;
347
+ const subType = asString(claims?.sub_type);
348
+ if (subType)
349
+ identity.subType = subType;
350
+ const applicationSubtype = resolveApplicationSubtype(claims, authFlow);
351
+ if (applicationSubtype)
352
+ identity.applicationSubtype = applicationSubtype;
347
353
  return identity;
348
354
  };
349
355
  var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
@@ -636,6 +642,40 @@ var tryRobotClientFallback = async (options = {}) => {
636
642
  }
637
643
  };
638
644
 
645
+ // ../../auth/src/tenantSelection.ts
646
+ var LOGIN_STATUS_HINT = "Run 'uip login status' to see the organization the CLI is signed in to.";
647
+ var organizationHint = (organizationId) => `The request used '${organizationId}' as the organization. ${LOGIN_STATUS_HINT}`;
648
+ var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
649
+ var describeNonJsonResponse = (organizationId, response, parseError) => {
650
+ if (response.redirected) {
651
+ return `Could not find organization '${organizationId}': the request was ` + `redirected to a sign-in page instead of the organization's tenant ` + `list. ${LOGIN_STATUS_HINT}`;
652
+ }
653
+ const contentType = response.headers.get("content-type") ?? "unknown";
654
+ return `The organization service returned a '${contentType}' response instead ` + `of JSON: ${parseError.message}. ${organizationHint(organizationId)}`;
655
+ };
656
+ var fetchTenantsAndOrganizations = async (baseUrl, accessToken, organizationId, signal) => {
657
+ const url = `${baseUrl}/${organizationId}/portal_/api/filtering/leftnav/tenantsAndOrganizationInfo`;
658
+ const response = await fetch(url, {
659
+ headers: {
660
+ Authorization: `Bearer ${accessToken}`
661
+ },
662
+ ...signal ? { signal } : {}
663
+ });
664
+ if (!response.ok) {
665
+ if (response.status === 401) {
666
+ throw new Error(`Unauthorized: the access token was rejected, it was not ` + `issued for organization '${organizationId}', or ` + `'${organizationId}' was not accepted as an organization ` + `URL segment in this environment. ` + LOGIN_STATUS_HINT);
667
+ }
668
+ const errorText = await response.text();
669
+ const message = `Failed to get tenants and organizations: ${response.status} ${errorText}`;
670
+ throw new Error(IDENTIFIER_STATUSES.has(response.status) ? `${message}. ${organizationHint(organizationId)}` : message);
671
+ }
672
+ const [parseError, data] = await catchError(response.json());
673
+ if (parseError) {
674
+ throw new Error(describeNonJsonResponse(organizationId, response, parseError));
675
+ }
676
+ return data;
677
+ };
678
+
639
679
  // ../../auth/src/tokenRefresh.ts
640
680
  var TOKEN_REFRESH_REAUTHENTICATE_MESSAGE = "Token refresh failed. Run 'uip login' to re-authenticate.";
641
681
 
@@ -848,6 +888,8 @@ var saveEnvFileAsync = async ({
848
888
  };
849
889
 
850
890
  // ../../auth/src/loginStatus.ts
891
+ var defaultRobotTenantIdCache = new Map;
892
+ var ROBOT_TENANT_LOOKUP_TIMEOUT_MS = 5000;
851
893
  var getLoginStatusAsync = async (options = {}) => {
852
894
  return getLoginStatusWithDeps(options);
853
895
  };
@@ -860,12 +902,20 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
860
902
  refreshToken: refreshTokenFn = refreshAccessToken,
861
903
  resolveConfig = resolveConfigAsync,
862
904
  robotFallback = tryRobotClientFallback,
905
+ fetchTenantsAndOrgs = fetchTenantsAndOrganizations,
906
+ robotTenantIdCache = defaultRobotTenantIdCache,
907
+ robotTenantLookupTimeoutMs = ROBOT_TENANT_LOOKUP_TIMEOUT_MS,
863
908
  loadBreaker = loadRefreshBreaker,
864
909
  saveBreaker = saveRefreshBreaker,
865
910
  clearBreaker = clearRefreshBreaker
866
911
  } = deps;
912
+ const robotDeps = {
913
+ fetchTenantsAndOrgs,
914
+ cache: robotTenantIdCache,
915
+ lookupTimeoutMs: robotTenantLookupTimeoutMs
916
+ };
867
917
  if (isRobotAuthEnforced()) {
868
- return resolveRobotEnforcedStatus(robotFallback);
918
+ return resolveRobotEnforcedStatus(robotFallback, robotDeps);
869
919
  }
870
920
  if (isEnvAuthEnabled()) {
871
921
  return readAuthFromEnv();
@@ -883,7 +933,7 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
883
933
  hint: `No credentials found for profile "${activeProfile}". Run 'uip login --profile ${activeProfile}' to authenticate this profile.`
884
934
  };
885
935
  }
886
- return resolveBorrowedRobotStatus(robotFallback);
936
+ return resolveBorrowedRobotStatus(robotFallback, robotDeps);
887
937
  }
888
938
  const loaded = await loadFileCredentials(loadEnvFile, absolutePath);
889
939
  if ("status" in loaded) {
@@ -925,7 +975,7 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
925
975
  }
926
976
  return buildFileStatus(tokens, credentials, globalHint);
927
977
  };
928
- async function resolveRobotEnforcedStatus(robotFallback) {
978
+ async function resolveRobotEnforcedStatus(robotFallback, deps) {
929
979
  if (isEnvAuthEnabled()) {
930
980
  throw new EnvAuthConfigError(`${ENV_AUTH_ENABLE_VAR}=true and ${ENFORCE_ROBOT_AUTH_VAR}=true ` + `are mutually exclusive. Unset one of them and re-run.`);
931
981
  }
@@ -936,11 +986,11 @@ async function resolveRobotEnforcedStatus(robotFallback) {
936
986
  hint: `${ENFORCE_ROBOT_AUTH_VAR}=true but the UiPath Robot ` + `session is unavailable. Start and sign in to the Assistant, ` + `or unset ${ENFORCE_ROBOT_AUTH_VAR} to fall back to file or ` + `env-var authentication.`
937
987
  };
938
988
  }
939
- return buildRobotStatus(robotCreds);
989
+ return buildRobotStatus(robotCreds, deps);
940
990
  }
941
- async function resolveBorrowedRobotStatus(robotFallback) {
991
+ async function resolveBorrowedRobotStatus(robotFallback, deps) {
942
992
  const robotCreds = await robotFallback();
943
- return robotCreds ? buildRobotStatus(robotCreds) : { loginStatus: "Not logged in" };
993
+ return robotCreds ? buildRobotStatus(robotCreds, deps) : { loginStatus: "Not logged in" };
944
994
  }
945
995
  async function loadFileCredentials(loadEnvFile, absolutePath) {
946
996
  let credentials;
@@ -1075,9 +1125,10 @@ function identityFields(accessToken, credentials) {
1075
1125
  ...scopes ? { scopes } : {}
1076
1126
  };
1077
1127
  }
1078
- function buildRobotStatus(robotCreds) {
1128
+ async function buildRobotStatus(robotCreds, deps) {
1079
1129
  const identity = resolveSessionIdentity(robotCreds.accessToken);
1080
1130
  const scopes = readTokenScopes(robotCreds.accessToken);
1131
+ const tenant = robotCreds.tenantId ? { tenantId: robotCreds.tenantId } : await resolveRobotTenantId(robotCreds, deps);
1081
1132
  return {
1082
1133
  loginStatus: "Logged in",
1083
1134
  accessToken: robotCreds.accessToken,
@@ -1085,14 +1136,62 @@ function buildRobotStatus(robotCreds) {
1085
1136
  organizationName: robotCreds.organizationName,
1086
1137
  organizationId: robotCreds.organizationId,
1087
1138
  tenantName: robotCreds.tenantName,
1088
- tenantId: robotCreds.tenantId,
1139
+ tenantId: tenant.tenantId,
1089
1140
  issuer: robotCreds.issuer,
1090
1141
  expiration: getTokenExpiration(robotCreds.accessToken),
1091
1142
  source: "robot" /* Robot */,
1143
+ ...tenant.hint ? { hint: tenant.hint } : {},
1092
1144
  ...identity ? { identity } : {},
1093
1145
  ...scopes ? { scopes } : {}
1094
1146
  };
1095
1147
  }
1148
+ async function resolveRobotTenantId(robotCreds, deps) {
1149
+ const { baseUrl, accessToken, tenantName } = robotCreds;
1150
+ const organization = robotCreds.organizationName ?? robotCreds.organizationId;
1151
+ if (!tenantName || !organization) {
1152
+ return {};
1153
+ }
1154
+ const key = `${baseUrl}|${organization}|${tenantName}|${accessToken}`;
1155
+ let pending = deps.cache.get(key);
1156
+ if (!pending) {
1157
+ pending = catchError(lookupRobotTenantId({ baseUrl, accessToken, organization, tenantName }, deps)).then(([error, resolution]) => {
1158
+ const settled = error ? { hint: tenantLookupFailureHint(tenantName, error.message) } : resolution;
1159
+ if (!settled.tenantId) {
1160
+ deps.cache.delete(key);
1161
+ }
1162
+ return settled;
1163
+ });
1164
+ deps.cache.set(key, pending);
1165
+ }
1166
+ return pending;
1167
+ }
1168
+ async function lookupRobotTenantId(target, deps) {
1169
+ const { baseUrl, accessToken, organization, tenantName } = target;
1170
+ const [error, data] = await catchError(deps.fetchTenantsAndOrgs(baseUrl, accessToken, organization, AbortSignal.timeout(deps.lookupTimeoutMs)));
1171
+ if (error) {
1172
+ const reason = error.name === "TimeoutError" ? `the tenant list did not answer within ${deps.lookupTimeoutMs} ms.` : error.message;
1173
+ return { hint: tenantLookupFailureHint(tenantName, reason) };
1174
+ }
1175
+ const rows = data?.tenants;
1176
+ const tenants = Array.isArray(rows) ? rows.filter((tenant) => typeof tenant?.id === "string" && typeof tenant?.name === "string") : [];
1177
+ const wantedName = decodePathSegment(tenantName);
1178
+ const wanted = wantedName.toLowerCase();
1179
+ const match = tenants.find((tenant) => tenant.name === wantedName) ?? tenants.find((tenant) => tenant.name.toLowerCase() === wanted);
1180
+ if (!match) {
1181
+ const names = tenants.map((tenant) => tenant.name).join(", ");
1182
+ return {
1183
+ hint: `The Robot session targets tenant '${tenantName}', but ` + `organization '${organization}' lists no tenant of that name` + `${names ? ` (available: ${names})` : ""}. Commands that need ` + `the tenant id will fail until it can be resolved.`
1184
+ };
1185
+ }
1186
+ return { tenantId: match.id };
1187
+ }
1188
+ function tenantLookupFailureHint(tenantName, reason) {
1189
+ return `Could not resolve the id of tenant '${tenantName}' from the ` + `Robot session: ${reason} Commands that need the tenant id will ` + `fail until it can be resolved.`;
1190
+ }
1191
+ function decodePathSegment(segment) {
1192
+ const [error, decoded] = catchError(() => decodeURIComponent(segment));
1193
+ return error ? segment : decoded;
1194
+ }
1096
1195
  var isFileNotFoundError = (error) => {
1097
1196
  if (!(error instanceof Object))
1098
1197
  return false;
@@ -1361,9 +1460,6 @@ var getAuthContext = async (options = {}) => {
1361
1460
  identity: status.identity
1362
1461
  };
1363
1462
  };
1364
- // ../../auth/src/tenantSelection.ts
1365
- var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
1366
-
1367
1463
  // ../../auth/src/selectTenant.ts
1368
1464
  var TENANT_SELECTION_REQUIRED_CODE = "TENANT_SELECTION_REQUIRED";
1369
1465
  var INVALID_TENANT_CODE = "INVALID_TENANT";
@@ -1373,4 +1469,4 @@ var TENANT_SELECTION_CODES = new Set([
1373
1469
  ]);
1374
1470
  export { getLoginStatusAsync, getAuthContext };
1375
1471
 
1376
- //# debugId=63A10E01C760B95B64756E2164756E21
1472
+ //# debugId=F3581BB00728E2A764756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getLoginStatusAsync
3
- } from "./tool-4qsa72nx.js";
3
+ } from "./tool-nwbftwhg.js";
4
4
  import {
5
5
  DEFAULT_PAGE_SIZE,
6
6
  Option,
@@ -15,14 +15,14 @@ import {
15
15
  processContext,
16
16
  resolveDeprecatedOptionAlias,
17
17
  warnDeprecatedOptionAlias
18
- } from "./tool-t5733z6f.js";
18
+ } from "./tool-2wtwtawb.js";
19
19
  import"./tool-1yh8g550.js";
20
20
  // ../resourcecatalog-tool/package.json
21
21
  var package_default = {
22
22
  name: "@uipath/resourcecatalog-tool",
23
23
  author: "UiPath",
24
24
  license: "SEE LICENSE IN LICENSE.txt",
25
- version: "1.204.0-preview.255",
25
+ version: "1.205.0-preview.256",
26
26
  description: "CLI plugin for the UiPath Resource Catalog Service.",
27
27
  private: false,
28
28
  repository: {
@@ -319,7 +319,7 @@ var package_default2 = {
319
319
  name: "@uipath/resourcecatalog-sdk",
320
320
  author: "UiPath",
321
321
  license: "SEE LICENSE IN LICENSE.txt",
322
- version: "1.204.0",
322
+ version: "1.205.0",
323
323
  description: "SDK for the UiPath Resource Catalog Service API.",
324
324
  repository: {
325
325
  type: "git",
@@ -1974,4 +1974,4 @@ export {
1974
1974
  registerCommands
1975
1975
  };
1976
1976
 
1977
- //# debugId=332663E1FBF747F364756E2164756E21
1977
+ //# debugId=E6FB0D3F926F183C64756E2164756E21
package/dist/tool.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  stripHostGlobalOptions
3
- } from "./tool-t5733z6f.js";
3
+ } from "./tool-2wtwtawb.js";
4
4
  import {
5
5
  __require
6
6
  } from "./tool-1yh8g550.js";
@@ -9,7 +9,7 @@ var package_default = {
9
9
  name: "@uipath/admin-tool",
10
10
  author: "UiPath",
11
11
  license: "SEE LICENSE IN LICENSE.txt",
12
- version: "1.204.0-preview.255",
12
+ version: "1.205.0-preview.256",
13
13
  description: "Manage UiPath admin resources — Identity Server, Resource Catalog Service, Audit Service, VPN Gateway.",
14
14
  private: false,
15
15
  repository: {
@@ -72,31 +72,31 @@ var BRANCHES = [
72
72
  "smtp",
73
73
  "users"
74
74
  ],
75
- load: async () => (await import("./index-hga2rj66.js")).registerCommands
75
+ load: async () => (await import("./index-00ks13f2.js")).registerCommands
76
76
  },
77
77
  {
78
78
  commands: ["ip-restriction"],
79
- load: async () => (await import("./tool-nthg9hdv.js")).registerCommands
79
+ load: async () => (await import("./tool-5bac7fm4.js")).registerCommands
80
80
  },
81
81
  {
82
82
  commands: ["authorization"],
83
- load: async () => (await import("./index-2sv42egp.js")).registerCommands
83
+ load: async () => (await import("./index-3mgpezgw.js")).registerCommands
84
84
  },
85
85
  {
86
86
  commands: ["organizations", "tenants"],
87
- load: async () => (await import("./index-9dbj5g2r.js")).registerCommands
87
+ load: async () => (await import("./index-3v0kv44y.js")).registerCommands
88
88
  },
89
89
  {
90
90
  commands: ["rcs"],
91
- load: async () => (await import("./tool-g160keqa.js")).registerCommands
91
+ load: async () => (await import("./tool-rbpkn287.js")).registerCommands
92
92
  },
93
93
  {
94
94
  commands: ["audit"],
95
- load: async () => (await import("./index-8qe9jd5p.js")).registerCommands
95
+ load: async () => (await import("./index-37jrt4wz.js")).registerCommands
96
96
  },
97
97
  {
98
98
  commands: ["integrations"],
99
- load: async () => (await import("./index-04pe88vr.js")).registerCommands
99
+ load: async () => (await import("./index-6s9xyeev.js")).registerCommands
100
100
  }
101
101
  ];
102
102
  function branchesFor(argv) {
@@ -121,4 +121,4 @@ export {
121
121
  registerCommands
122
122
  };
123
123
 
124
- //# debugId=8987795C297775F264756E2164756E21
124
+ //# debugId=06A7DD67279DF5BA64756E2164756E21
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.204.0-preview.255",
5
+ "version": "1.205.0-preview.256",
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": "699c58dabb59414557755a8933bcbe40aa420df3"
27
+ "gitHead": "63740c6cbb7ff282fa9118cc16a148eb030b245f"
28
28
  }