@uipath/orchestrator-tool 1.205.0-preview.284 → 1.205.0-preview.285

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
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  metadata,
4
4
  registerCommands
5
- } from "./tool-m66yfwkm.js";
5
+ } from "./tool-aawrv9n7.js";
6
6
  import {
7
7
  Command
8
8
  } from "./tool-qeyyg5yr.js";
@@ -92,7 +92,7 @@ var package_default = {
92
92
  name: "@uipath/orchestrator-tool",
93
93
  author: "UiPath",
94
94
  license: "SEE LICENSE IN LICENSE.txt",
95
- version: "1.205.0-preview.284",
95
+ version: "1.205.0-preview.285",
96
96
  description: "Manage Orchestrator folders, jobs, processes, and releases.",
97
97
  private: false,
98
98
  repository: {
@@ -166,6 +166,18 @@ async function resolveQueueByKey(api, key) {
166
166
  }
167
167
  return queue;
168
168
  }
169
+ async function resolveQueueByKeyInFolder(api, key, folderLabel) {
170
+ validateUuid(key, "queue");
171
+ const result = await api.queueDefinitionsListQueues({
172
+ $filter: `QueueDefinitionKey eq ${key}`,
173
+ $top: 1
174
+ });
175
+ const id = result.value?.[0]?.queueDefinitionId;
176
+ if (id == null) {
177
+ throw Object.assign(new Error(`Queue not found for key: '${key}' in folder '${folderLabel}'.`), { errorCode: "not_found", retry: "RetryWillNotFix" });
178
+ }
179
+ return { id };
180
+ }
169
181
  var QUEUE_NAME_PAGE_SIZE = 100;
170
182
  var QUEUE_NAME_MAX_PAGES = 20;
171
183
  async function collectQueuesNamed(api, name, folderId) {
@@ -1260,6 +1272,32 @@ function formatDuplicateAssetInstructions(name, options) {
1260
1272
  return `Asset '${name}' already exists in ${folderReference}. List assets${listScope} to find the existing asset key, then use 'uip or assets update <asset-key> <value>' to modify it or 'uip or assets delete <asset-key>' before creating it again.`;
1261
1273
  }
1262
1274
 
1275
+ // src/utils/folder-scope.ts
1276
+ function invalidArgument(message) {
1277
+ return Object.assign(new Error(message), {
1278
+ errorCode: "invalid_argument",
1279
+ retry: "RetryWillNotFix"
1280
+ });
1281
+ }
1282
+ function bothFolderSelectorsError(scope) {
1283
+ return scope.folderPath !== undefined && scope.folderKey !== undefined ? invalidArgument("Provide either --folder-path or --folder-key, not both.") : undefined;
1284
+ }
1285
+ async function assertEntityInFolder(kind, key, entityFolderIds, scope) {
1286
+ if (scope.folderPath === undefined && scope.folderKey === undefined) {
1287
+ return;
1288
+ }
1289
+ const bothSelectors = bothFolderSelectorsError(scope);
1290
+ if (bothSelectors) {
1291
+ throw bothSelectors;
1292
+ }
1293
+ const folder = await resolveFolder({ folderPath: scope.folderPath, folderKey: scope.folderKey }, { tenant: scope.tenant });
1294
+ if (folder !== undefined && entityFolderIds.includes(folder.id)) {
1295
+ return folder.id;
1296
+ }
1297
+ const where = folder?.path ?? scope.folderPath ?? scope.folderKey;
1298
+ throw Object.assign(new Error(`${kind} '${key}' was not found in folder '${where}'. ` + `Drop the folder option to look it up tenant-wide, or use '${kind.toLowerCase()}s list --folder-path <path>' to find it.`), { errorCode: "not_found", retry: "RetryWillNotFix" });
1299
+ }
1300
+
1263
1301
  // src/utils/job-resolver.ts
1264
1302
  async function resolveJob(jobKey, options) {
1265
1303
  const [apiError, api] = await catchError(createApiClient(JobsApi, { tenant: options?.tenant }));
@@ -1284,6 +1322,7 @@ async function resolveJob(jobKey, options) {
1284
1322
  if (!jobInfo.organizationUnitId) {
1285
1323
  throw new Error(`Job '${jobKey}' has no folder association — cannot resolve folder context.`);
1286
1324
  }
1325
+ await assertEntityInFolder("Job", jobKey, [jobInfo.organizationUnitId], options ?? {});
1287
1326
  if (!job.folderKey) {
1288
1327
  throw new Error(`Job '${jobKey}' has no folder key — cannot resolve folder context.`);
1289
1328
  }
@@ -4340,8 +4379,12 @@ async function reportReleaseLookupFailure(message, error, options) {
4340
4379
 
4341
4380
  // src/commands/jobs.ts
4342
4381
  var JOB_LOG_LEVELS = ["Fatal", "Error", "Warning", "Info", "Trace"];
4343
- function resolveJobForCommand(jobKey, tenant, errorContext) {
4344
- return resolveOrReportError(resolveJob(jobKey, { tenant }), errorContext);
4382
+ function resolveJobForCommand(jobKey, tenant, errorContext, folder) {
4383
+ return resolveOrReportError(resolveJob(jobKey, {
4384
+ tenant,
4385
+ folderPath: folder?.folderPath,
4386
+ folderKey: folder?.folderKey
4387
+ }), errorContext);
4345
4388
  }
4346
4389
  function resolveMachinesForCommand(keys, tenant, errorContext) {
4347
4390
  return resolveOrReportError(resolveMachines(keys, { tenant }), errorContext);
@@ -4757,7 +4800,7 @@ var registerJobsCommand = (program) => {
4757
4800
  Data: jobList
4758
4801
  });
4759
4802
  });
4760
- jobs.command("get").description("Get a job by its key (GUID). " + "Returns state, input/output arguments, timing, machine info, and error details if faulted. " + "If the job is in Pending state, also includes diagnostic reasons (robot availability, capacity, etc.). " + "No folder context needed — the key is globally unique. " + "Use 'jobs list' to find job keys.").argument("<job-key>", "Job key (GUID)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--output-dir <path>", "Directory for downloading OutputFile (default: current directory)").option("--no-download", "Skip automatic OutputFile download").option("--all-fields", "Return all fields from the API response instead of a curated summary").examples(JOBS_GET_EXAMPLES).trackedAction(processContext, async (jobKey, options) => {
4803
+ jobs.command("get").description("Get a job by its key (GUID). " + "Returns state, input/output arguments, timing, machine info, and error details if faulted. " + "If the job is in Pending state, also includes diagnostic reasons (robot availability, capacity, etc.). " + "No folder context needed — the key is globally unique, so the lookup is tenant-wide; " + "pass --folder-path/--folder-key to require the job to be in that folder. " + "Use 'jobs list' to find job keys.").argument("<job-key>", "Job key (GUID)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--folder-path <path>", "Folder path (e.g., 'Shared') - scopes the lookup instead of resolving tenant-wide").option("--folder-key <key>", "Folder key (GUID) - scopes the lookup instead of resolving tenant-wide").option("--output-dir <path>", "Directory for downloading OutputFile (default: current directory)").option("--no-download", "Skip automatic OutputFile download").option("--all-fields", "Return all fields from the API response instead of a curated summary").examples(JOBS_GET_EXAMPLES).trackedAction(processContext, async (jobKey, options) => {
4761
4804
  if (!isGuid(jobKey)) {
4762
4805
  OutputFormatter.error({
4763
4806
  Result: RESULTS.Failure,
@@ -4767,7 +4810,7 @@ var registerJobsCommand = (program) => {
4767
4810
  processContext.exit(1);
4768
4811
  return;
4769
4812
  }
4770
- const resolved = await resolveJobForCommand(jobKey, options.tenant, "Error getting job");
4813
+ const resolved = await resolveJobForCommand(jobKey, options.tenant, "Error getting job", options);
4771
4814
  if (resolved === null)
4772
4815
  return;
4773
4816
  const data = options.allFields ? { ...resolved.job } : await buildJobCompletionOutput(resolved.job, undefined, {
@@ -5230,7 +5273,7 @@ var registerJobsCommand = (program) => {
5230
5273
  }
5231
5274
  });
5232
5275
  });
5233
- jobs.command("logs").description("Get robot execution logs for a job. " + "Filter by --level to quickly find errors. " + "Folder context is inferred from the job key. " + "Logs are returned newest-first.").argument("<job-key>", "Job key (GUID)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--level <level>", `Filter by log level (${JOB_LOG_LEVELS.join(", ")})`).option("-l, --limit <number>", "Number of log entries to return", String(DEFAULT_PAGE_SIZE)).option("--offset <number>", "Number of entries to skip", "0").option("--export", "Export logs to CSV file instead of listing in terminal").option("-d, --destination <path>", "CSV export file path (only with --export)").addOption(new Option("-o, --output <path>", "Deprecated alias for --destination").hideHelp()).examples(JOBS_LOGS_EXAMPLES).trackedAction(processContext, async (jobKey, options) => {
5276
+ jobs.command("logs").description("Get robot execution logs for a job. " + "Filter by --level to quickly find errors. " + "Folder context is inferred from the job key; pass --folder-path/--folder-key to require the job to be in that folder. " + "Logs are returned newest-first.").argument("<job-key>", "Job key (GUID)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--folder-path <path>", "Folder path (e.g., 'Shared') - scopes the lookup instead of resolving tenant-wide").option("--folder-key <key>", "Folder key (GUID) - scopes the lookup instead of resolving tenant-wide").option("--level <level>", `Filter by log level (${JOB_LOG_LEVELS.join(", ")})`).option("-l, --limit <number>", "Number of log entries to return", String(DEFAULT_PAGE_SIZE)).option("--offset <number>", "Number of entries to skip", "0").option("--export", "Export logs to CSV file instead of listing in terminal").option("-d, --destination <path>", "CSV export file path (only with --export)").addOption(new Option("-o, --output <path>", "Deprecated alias for --destination").hideHelp()).examples(JOBS_LOGS_EXAMPLES).trackedAction(processContext, async (jobKey, options) => {
5234
5277
  if (!isGuid(jobKey)) {
5235
5278
  OutputFormatter.error({
5236
5279
  Result: RESULTS.Failure,
@@ -5249,7 +5292,7 @@ var registerJobsCommand = (program) => {
5249
5292
  processContext.exit(1);
5250
5293
  return;
5251
5294
  }
5252
- const resolved = await resolveJobForCommand(jobKey, options.tenant, "Error getting job logs");
5295
+ const resolved = await resolveJobForCommand(jobKey, options.tenant, "Error getting job logs", options);
5253
5296
  if (resolved === null)
5254
5297
  return;
5255
5298
  const [apiError, api] = await catchError(createApiClient(RobotLogsApi, {
@@ -10597,6 +10640,43 @@ function formatQueueStats(s) {
10597
10640
  QueueFoldersCount: s.queueFoldersCount ?? 0
10598
10641
  };
10599
10642
  }
10643
+ var CROSS_FOLDER_MISS_HINT = " If the queue was just created, pass its folder with --folder-path or --folder-key: the lookup without a folder can take a while to list a queue in a new folder.";
10644
+ async function resolveQueueTarget(queueKey, options, errorMessage) {
10645
+ if (options.folderPath !== undefined || options.folderKey !== undefined) {
10646
+ const bothSelectors = bothFolderSelectorsError(options);
10647
+ if (bothSelectors) {
10648
+ await reportFailure(errorMessage, bothSelectors);
10649
+ return;
10650
+ }
10651
+ const scope = {
10652
+ tenant: options.tenant,
10653
+ folderPath: options.folderPath,
10654
+ folderKey: options.folderKey
10655
+ };
10656
+ const folderLabel = options.folderPath ?? options.folderKey;
10657
+ const resolved2 = await resolveEntityOrFail(QueueDefinitionsApi, scope, (api, key) => resolveQueueByKeyInFolder(api, key, folderLabel), queueKey, errorMessage);
10658
+ return resolved2 ? { id: resolved2.entity.id, scope } : undefined;
10659
+ }
10660
+ const resolved = await resolveEntityOrFail(QueueDefinitionsApi, { tenant: options.tenant }, resolveQueueByKey, queueKey, errorMessage, (instructions) => instructions.startsWith("Queue not found") ? instructions + CROSS_FOLDER_MISS_HINT : instructions);
10661
+ if (!resolved)
10662
+ return;
10663
+ if (resolved.entity.organizationUnitId == null) {
10664
+ OutputFormatter.error({
10665
+ Result: RESULTS.Failure,
10666
+ Message: errorMessage,
10667
+ Instructions: `Queue '${queueKey}' is missing folder context.`
10668
+ });
10669
+ processContext.exit(1);
10670
+ return;
10671
+ }
10672
+ return {
10673
+ id: resolved.entity.id,
10674
+ scope: {
10675
+ tenant: options.tenant,
10676
+ folderId: resolved.entity.organizationUnitId.toString()
10677
+ }
10678
+ };
10679
+ }
10600
10680
  var QUEUES_LIST_EXAMPLES = [
10601
10681
  {
10602
10682
  Description: "List queues in a folder",
@@ -10749,6 +10829,27 @@ var QUEUES_UPDATE_EXAMPLES = [
10749
10829
  id: 1206025
10750
10830
  }
10751
10831
  }
10832
+ },
10833
+ {
10834
+ Description: "Update a queue just created in a new folder, looking the key up in that folder",
10835
+ Command: "uip or queues update a1b2c3d4-0000-0000-0000-000000000001 --folder-path Finance --description 'Invoices to process'",
10836
+ Output: {
10837
+ Code: "QueueUpdated",
10838
+ Data: {
10839
+ key: "a1b2c3d4-0000-0000-0000-000000000001",
10840
+ name: "Invoices",
10841
+ description: "Invoices to process",
10842
+ maxNumberOfRetries: 0,
10843
+ acceptAutomaticallyRetry: true,
10844
+ retryAbandonedItems: false,
10845
+ enforceUniqueReference: false,
10846
+ encrypted: false,
10847
+ creationTime: "2026-01-15T10:00:00.000Z",
10848
+ foldersCount: 1,
10849
+ tags: [],
10850
+ id: 1206025
10851
+ }
10852
+ }
10752
10853
  }
10753
10854
  ];
10754
10855
  var QUEUES_DELETE_EXAMPLES = [
@@ -10967,7 +11068,7 @@ var registerQueuesCommand = (program) => {
10967
11068
  Data: options.allFields ? items : items.map((q) => formatQueueRow(q))
10968
11069
  });
10969
11070
  });
10970
- queues.command("get").description("Get queue details by key (GUID). No folder needed -- resolves cross-folder. " + "Use 'queues list' to retrieve the key.").argument("<queue-key>", "Queue key (GUID)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--all-fields", "Return all fields from the API response instead of a curated summary").examples(QUEUES_GET_EXAMPLES).trackedAction(processContext, async (queueKey, options) => {
11071
+ queues.command("get").description("Get queue details by key (GUID). No folder needed -- resolves cross-folder; " + "pass --folder-path/--folder-key to require the queue to be in that folder. " + "Use 'queues list' to retrieve the key.").argument("<queue-key>", "Queue key (GUID)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--folder-path <path>", "Folder path (e.g., 'Shared') - scopes the lookup instead of resolving tenant-wide").option("--folder-key <key>", "Folder key (GUID) - scopes the lookup instead of resolving tenant-wide").option("--all-fields", "Return all fields from the API response instead of a curated summary").examples(QUEUES_GET_EXAMPLES).trackedAction(processContext, async (queueKey, options) => {
10971
11072
  const resolved = await resolveEntityOrFail(QueueDefinitionsApi, { tenant: options.tenant }, resolveQueueByKey, queueKey, "Error getting queue");
10972
11073
  if (!resolved)
10973
11074
  return;
@@ -10980,9 +11081,32 @@ var registerQueuesCommand = (program) => {
10980
11081
  processContext.exit(1);
10981
11082
  return;
10982
11083
  }
11084
+ const folderNamed = options.folderPath !== undefined || options.folderKey !== undefined;
11085
+ const memberFolderIds = [
11086
+ resolved.entity.organizationUnitId
11087
+ ];
11088
+ if (folderNamed) {
11089
+ const [sharedError, shared] = await catchError(resolved.api.queueDefinitionsGetFoldersForQueueById({
11090
+ id: resolved.entity.id
11091
+ }));
11092
+ if (sharedError) {
11093
+ await reportFailure("Error getting queue", sharedError);
11094
+ return;
11095
+ }
11096
+ for (const folder of shared.accessibleFolders ?? []) {
11097
+ if (folder.id != null) {
11098
+ memberFolderIds.push(folder.id);
11099
+ }
11100
+ }
11101
+ }
11102
+ const [scopeError, scopedFolderId] = await catchError(assertEntityInFolder("Queue", queueKey, memberFolderIds, options));
11103
+ if (scopeError) {
11104
+ await reportFailure("Error getting queue", scopeError);
11105
+ return;
11106
+ }
10983
11107
  const [folderApiError, folderApi] = await catchError(createApiClient(QueueDefinitionsApi, {
10984
11108
  tenant: options.tenant,
10985
- folderId: resolved.entity.organizationUnitId.toString()
11109
+ folderId: (scopedFolderId ?? resolved.entity.organizationUnitId).toString()
10986
11110
  }));
10987
11111
  if (folderApiError) {
10988
11112
  await reportFailure("Error getting queue", folderApiError);
@@ -11051,7 +11175,7 @@ var registerQueuesCommand = (program) => {
11051
11175
  Data: queue
11052
11176
  });
11053
11177
  });
11054
- queues.command("update").description("Update queue properties by key (GUID). No folder needed -- resolves cross-folder. " + "Only provided fields are changed. " + "Archive retention needs a storage bucket (--retention-bucket / --stale-retention-bucket); the current bucket is kept while the action stays Archive and cleared when it changes. " + "Use 'queues list' to retrieve the key.").argument("<queue-key>", "Queue key (GUID)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-n, --name <name>", "New queue name").option("-d, --description <text>", "Description of the queue").option("--max-retries <number>", "Maximum number of retry attempts for failed items").option("--sla-in-minutes <minutes>", "Queue item processing SLA in minutes").option("--risk-sla-in-minutes <minutes>", "Queue item processing risk SLA in minutes").option("--auto-retry", "Enable automatic retry of failed items").option("--no-auto-retry", "Disable automatic retry of failed items").option("--retry-abandoned-items", "Enable automatic retry of abandoned items").option("--no-retry-abandoned-items", "Disable automatic retry of abandoned items").option("--enforce-unique-reference", "Enforce unique reference values for queue items").option("--no-enforce-unique-reference", "Disable unique reference enforcement for queue items").option("--encrypted", "Store queue item data in encrypted format").option("--retention-action <action>", "Action for completed items, one of: Delete, Archive, None (e.g. --retention-action Archive). Switching to Archive requires --retention-bucket unless the queue already archives").option("--retention-period <days>", "Retention period in days for completed items").option("--retention-bucket <bucket-key>", "Storage bucket key (GUID) for archived completed items. Omit to keep the current bucket; it is cleared automatically when the action is no longer Archive. The bucket must be in, or shared to, the queue's folder. Use 'buckets list' to retrieve the key").option("--stale-retention-action <action>", "Action for uncompleted items, one of: Delete, Archive, None (e.g. --stale-retention-action Archive). Switching to Archive requires --stale-retention-bucket unless the queue already archives them").option("--stale-retention-period <days>", "Retention period in days for uncompleted items").option("--stale-retention-bucket <bucket-key>", "Storage bucket key (GUID) for archived uncompleted items. Omit to keep the current bucket; it is cleared automatically when the action is no longer Archive. The bucket must be in, or shared to, the queue's folder. Use 'buckets list' to retrieve the key").examples(QUEUES_UPDATE_EXAMPLES).trackedAction(processContext, async (queueKey, options) => {
11178
+ queues.command("update").description("Update queue properties by key (GUID). No folder needed -- resolves cross-folder; pass --folder-path or --folder-key to look the key up in that folder instead. " + "Only provided fields are changed. " + "Archive retention needs a storage bucket (--retention-bucket / --stale-retention-bucket); the current bucket is kept while the action stays Archive and cleared when it changes. " + "Use 'queues list' to retrieve the key.").argument("<queue-key>", "Queue key (GUID)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--folder-path <path>", "Path of the folder that holds the queue (e.g., 'Shared'). Looks the key up in that folder only").option("--folder-key <key>", "Key (GUID) of the folder that holds the queue. Looks the key up in that folder only").option("-n, --name <name>", "New queue name").option("-d, --description <text>", "Description of the queue").option("--max-retries <number>", "Maximum number of retry attempts for failed items").option("--sla-in-minutes <minutes>", "Queue item processing SLA in minutes").option("--risk-sla-in-minutes <minutes>", "Queue item processing risk SLA in minutes").option("--auto-retry", "Enable automatic retry of failed items").option("--no-auto-retry", "Disable automatic retry of failed items").option("--retry-abandoned-items", "Enable automatic retry of abandoned items").option("--no-retry-abandoned-items", "Disable automatic retry of abandoned items").option("--enforce-unique-reference", "Enforce unique reference values for queue items").option("--no-enforce-unique-reference", "Disable unique reference enforcement for queue items").option("--encrypted", "Store queue item data in encrypted format").option("--retention-action <action>", "Action for completed items, one of: Delete, Archive, None (e.g. --retention-action Archive). Switching to Archive requires --retention-bucket unless the queue already archives").option("--retention-period <days>", "Retention period in days for completed items").option("--retention-bucket <bucket-key>", "Storage bucket key (GUID) for archived completed items. Omit to keep the current bucket; it is cleared automatically when the action is no longer Archive. The bucket must be in, or shared to, the queue's folder. Use 'buckets list' to retrieve the key").option("--stale-retention-action <action>", "Action for uncompleted items, one of: Delete, Archive, None (e.g. --stale-retention-action Archive). Switching to Archive requires --stale-retention-bucket unless the queue already archives them").option("--stale-retention-period <days>", "Retention period in days for uncompleted items").option("--stale-retention-bucket <bucket-key>", "Storage bucket key (GUID) for archived uncompleted items. Omit to keep the current bucket; it is cleared automatically when the action is no longer Archive. The bucket must be in, or shared to, the queue's folder. Use 'buckets list' to retrieve the key").examples(QUEUES_UPDATE_EXAMPLES).trackedAction(processContext, async (queueKey, options) => {
11055
11179
  const slaInMinutes = parseOptionalMinutes(options.slaInMinutes, "--sla-in-minutes", "Error updating queue");
11056
11180
  if (options.slaInMinutes !== undefined && slaInMinutes === undefined) {
11057
11181
  return;
@@ -11086,23 +11210,10 @@ var registerQueuesCommand = (program) => {
11086
11210
  reportRetentionFailure(bucketPrecheck);
11087
11211
  return;
11088
11212
  }
11089
- const resolved = await resolveEntityOrFail(QueueDefinitionsApi, { tenant: options.tenant }, resolveQueueByKey, queueKey, "Error updating queue");
11090
- if (!resolved)
11213
+ const existing = await resolveQueueTarget(queueKey, options, "Error updating queue");
11214
+ if (!existing)
11091
11215
  return;
11092
- const { entity: existing } = resolved;
11093
- if (existing.organizationUnitId == null) {
11094
- OutputFormatter.error({
11095
- Result: RESULTS.Failure,
11096
- Message: "Error updating queue",
11097
- Instructions: `Queue '${queueKey}' is missing folder context.`
11098
- });
11099
- processContext.exit(1);
11100
- return;
11101
- }
11102
- const [folderApiError, api] = await catchError(createApiClient(QueueDefinitionsApi, {
11103
- tenant: options.tenant,
11104
- folderId: existing.organizationUnitId.toString()
11105
- }));
11216
+ const [folderApiError, api] = await catchError(createApiClient(QueueDefinitionsApi, existing.scope));
11106
11217
  if (folderApiError) {
11107
11218
  await reportFailure("Error updating queue", folderApiError);
11108
11219
  return;
@@ -11151,32 +11262,20 @@ var registerQueuesCommand = (program) => {
11151
11262
  Data: updated
11152
11263
  });
11153
11264
  });
11154
- queues.command("delete").description("Delete a queue by key (GUID). No folder needed -- resolves cross-folder. " + "Refuses to delete a queue that still has items unless you pass --force " + "(deleting the queue deletes its items too). " + "Use 'queues list' to retrieve the key.").argument("<queue-key>", "Queue key (GUID) to delete").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-y, --yes", "Confirm this irreversible operation (required; the CLI never prompts)").option("-f, --force", "Delete the queue even if it still has items (the items are deleted too; implies --yes)").examples(QUEUES_DELETE_EXAMPLES).trackedAction(processContext, async (queueKey, options) => {
11265
+ queues.command("delete").description("Delete a queue by key (GUID). No folder needed -- resolves cross-folder; pass --folder-path or --folder-key to look the key up in that folder instead. " + "Refuses to delete a queue that still has items unless you pass --force " + "(deleting the queue deletes its items too). " + "Use 'queues list' to retrieve the key.").argument("<queue-key>", "Queue key (GUID) to delete").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--folder-path <path>", "Path of the folder that holds the queue (e.g., 'Shared'). Looks the key up in that folder only").option("--folder-key <key>", "Key (GUID) of the folder that holds the queue. Looks the key up in that folder only").option("-y, --yes", "Confirm this irreversible operation (required; the CLI never prompts)").option("-f, --force", "Delete the queue even if it still has items (the items are deleted too; implies --yes)").examples(QUEUES_DELETE_EXAMPLES).trackedAction(processContext, async (queueKey, options) => {
11155
11266
  if (!requireConfirmation(options, `delete queue '${queueKey}'`))
11156
11267
  return;
11157
- const resolved = await resolveEntityOrFail(QueueDefinitionsApi, { tenant: options.tenant }, resolveQueueByKey, queueKey, "Error deleting queue");
11158
- if (!resolved)
11159
- return;
11160
- if (resolved.entity.organizationUnitId == null) {
11161
- OutputFormatter.error({
11162
- Result: RESULTS.Failure,
11163
- Message: "Error deleting queue",
11164
- Instructions: `Queue '${queueKey}' is missing folder context.`
11165
- });
11166
- processContext.exit(1);
11268
+ const target = await resolveQueueTarget(queueKey, options, "Error deleting queue");
11269
+ if (!target)
11167
11270
  return;
11168
- }
11169
11271
  if (!options.force) {
11170
- const [itemsApiError, itemsApi] = await catchError(createApiClient(QueueItemsApi, {
11171
- tenant: options.tenant,
11172
- folderId: resolved.entity.organizationUnitId.toString()
11173
- }));
11272
+ const [itemsApiError, itemsApi] = await catchError(createApiClient(QueueItemsApi, target.scope));
11174
11273
  if (itemsApiError) {
11175
11274
  await reportFailure("Error deleting queue", itemsApiError);
11176
11275
  return;
11177
11276
  }
11178
11277
  const [countError, itemsResult] = await catchError(itemsApi.queueItemsGet({
11179
- $filter: `QueueDefinitionId eq ${resolved.entity.id} and Status ne 'Deleted'`,
11278
+ $filter: `QueueDefinitionId eq ${target.id} and Status ne 'Deleted'`,
11180
11279
  $top: 1
11181
11280
  }));
11182
11281
  if (countError) {
@@ -11193,16 +11292,13 @@ var registerQueuesCommand = (program) => {
11193
11292
  return;
11194
11293
  }
11195
11294
  }
11196
- const [folderApiError, folderApi] = await catchError(createApiClient(QueueDefinitionsApi, {
11197
- tenant: options.tenant,
11198
- folderId: resolved.entity.organizationUnitId.toString()
11199
- }));
11295
+ const [folderApiError, folderApi] = await catchError(createApiClient(QueueDefinitionsApi, target.scope));
11200
11296
  if (folderApiError) {
11201
11297
  await reportFailure("Error deleting queue", folderApiError);
11202
11298
  return;
11203
11299
  }
11204
11300
  const [deleteError] = await catchError(folderApi.queueDefinitionsDeleteById({
11205
- key: resolved.entity.id
11301
+ key: target.id
11206
11302
  }));
11207
11303
  if (deleteError) {
11208
11304
  await reportFailure("Error deleting queue", deleteError);
@@ -16146,4 +16242,4 @@ var registerCommands = async (program) => {
16146
16242
 
16147
16243
  export { metadata, registerCommands };
16148
16244
 
16149
- //# debugId=76D4C80628D30C4464756E2164756E21
16245
+ //# debugId=1954DFB83C20609364756E2164756E21
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./tool-m66yfwkm.js";
4
+ } from "./tool-aawrv9n7.js";
5
5
  import"./tool-qeyyg5yr.js";
6
6
  import"./tool-6mw7b49q.js";
7
7
  import"./tool-1de529jm.js";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/orchestrator-tool",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.205.0-preview.284",
5
+ "version": "1.205.0-preview.285",
6
6
  "description": "Manage Orchestrator folders, jobs, processes, and releases.",
7
7
  "private": false,
8
8
  "repository": {
@@ -27,5 +27,5 @@
27
27
  "files": [
28
28
  "dist"
29
29
  ],
30
- "gitHead": "a4c5d26ade993d3215fc16f6982179053a8a5f07"
30
+ "gitHead": "00ea7c5c3848404ab828ed1b58116130063dcf24"
31
31
  }