@uipath/oms-commands 1.205.0-preview.300 → 1.205.0-preview.304

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +32 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -5608,6 +5608,18 @@ var OutputFormatter;
5608
5608
  }
5609
5609
  OutputFormatter.formatToString = formatToString;
5610
5610
  })(OutputFormatter ||= {});
5611
+
5612
+ // ../../common/src/classified-failure.ts
5613
+ function notSupportedFailure(operation, instructions, context) {
5614
+ return {
5615
+ Result: RESULTS.Failure,
5616
+ ErrorCode: "not_supported",
5617
+ Message: `${operation} isn't supported on the connected environment.`,
5618
+ Instructions: instructions,
5619
+ Retry: "RetryWillNotFix",
5620
+ ...context ? { Context: context } : {}
5621
+ };
5622
+ }
5611
5623
  // ../../../node_modules/commander/esm.mjs
5612
5624
  var import__ = __toESM(require_commander(), 1);
5613
5625
  var {
@@ -6298,6 +6310,16 @@ var HOST_GLOBAL_FLAGS = [
6298
6310
  ];
6299
6311
  var VALUE_OPTIONS = new Set(HOST_GLOBAL_OPTIONS_WITH_VALUE);
6300
6312
  var BOOLEAN_FLAGS = new Set(HOST_GLOBAL_FLAGS);
6313
+ // ../../common/src/http-status.ts
6314
+ function httpStatusOf(error) {
6315
+ if (!error || typeof error !== "object") {
6316
+ return;
6317
+ }
6318
+ if ("response" in error && error.response && typeof error.response === "object" && "status" in error.response && typeof error.response.status === "number") {
6319
+ return error.response.status;
6320
+ }
6321
+ return "status" in error && typeof error.status === "number" ? error.status : undefined;
6322
+ }
6301
6323
  // ../../common/src/interactivity-context.ts
6302
6324
  var modeSlot = singleton("InteractivityMode");
6303
6325
  var interactiveFlagSlot = singleton("InteractiveFlag");
@@ -13426,6 +13448,7 @@ var registerOrgServicesCommands = (organizations) => {
13426
13448
  });
13427
13449
  });
13428
13450
  };
13451
+ 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.";
13429
13452
  var registerRegionsCommands = (organizations) => {
13430
13453
  const regions = organizations.command("regions").description("Inspect the regions in which Portal can be provisioned. Use the `list` subcommand.");
13431
13454
  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) => {
@@ -13433,6 +13456,14 @@ var registerRegionsCommands = (organizations) => {
13433
13456
  if (!client)
13434
13457
  return;
13435
13458
  const [error, result] = await catchError(client.api.organizationGetAllSupportedRegions());
13459
+ if (httpStatusOf(error) === 404) {
13460
+ OutputFormatter.error({
13461
+ Code: "OmsRegionsList",
13462
+ ...notSupportedFailure("Listing provisionable regions", REGIONS_NOT_SUPPORTED_INSTRUCTIONS, { httpStatus: 404 })
13463
+ });
13464
+ processContext.exit(1);
13465
+ return;
13466
+ }
13436
13467
  if (error) {
13437
13468
  await emitFailure(error, LOGIN_INSTRUCTIONS);
13438
13469
  return;
@@ -14367,4 +14398,4 @@ export {
14367
14398
  registerCommands
14368
14399
  };
14369
14400
 
14370
- //# debugId=602CD6C1C34E187D64756E2164756E21
14401
+ //# debugId=0487B68D06A49CE464756E2164756E21
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/oms-commands",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.205.0-preview.300",
5
+ "version": "1.205.0-preview.304",
6
6
  "description": "Admin CLI commands for the UiPath Organization Management Service. Library composed by admin-tool, not a standalone CLI tool.",
7
7
  "private": false,
8
8
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "a83c69c893aa1bee8d083f61672d32b6796201a6"
29
+ "gitHead": "186bf75f4162dec3a07b468d6de2dec06c5f657c"
30
30
  }