@uipath/orchestrator-tool 1.202.1 → 1.202.2-preview.183

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  Command,
4
4
  metadata,
5
5
  registerCommands
6
- } from "./tool-2p58ckbh.js";
6
+ } from "./tool-32ebxyj7.js";
7
7
  import"./tool-ayyhwvs8.js";
8
8
  import"./tool-1de529jm.js";
9
9
 
@@ -2103,7 +2103,7 @@ var require_commander = __commonJS(function(exports) {
2103
2103
  var package_default = {
2104
2104
  name: "@uipath/orchestrator-tool",
2105
2105
  license: "SEE LICENSE IN LICENSE.txt",
2106
- version: "1.202.1",
2106
+ version: "1.202.2-preview.183",
2107
2107
  description: "Manage Orchestrator folders, jobs, processes, and releases.",
2108
2108
  private: false,
2109
2109
  repository: {
@@ -28244,6 +28244,22 @@ async function uploadJobAttachment(bytes, name, options = {}) {
28244
28244
  }
28245
28245
  }
28246
28246
  // ../orchestrator-sdk/src/release-resolver.ts
28247
+ class ReleaseNotFoundError extends Error {
28248
+ folderScoped;
28249
+ constructor(message, folderScoped) {
28250
+ super(message);
28251
+ this.name = "ReleaseNotFoundError";
28252
+ this.folderScoped = folderScoped;
28253
+ }
28254
+ }
28255
+ async function isFolderRequiredRefusal(error) {
28256
+ const response = error?.response;
28257
+ if (response?.status !== 400 || typeof response.clone !== "function") {
28258
+ return false;
28259
+ }
28260
+ const body = await response.clone().text().catch(() => "");
28261
+ return /a folder is required for this action/i.test(body);
28262
+ }
28247
28263
  var UUID_REGEX2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
28248
28264
  async function resolveRelease(releaseKey, options) {
28249
28265
  if (!UUID_REGEX2.test(releaseKey)) {
@@ -28251,12 +28267,27 @@ async function resolveRelease(releaseKey, options) {
28251
28267
  }
28252
28268
  const config = await createOrchestratorConfig(options);
28253
28269
  const releasesApi = new ReleasesApi(config);
28254
- const result = await releasesApi.releasesListReleases({
28255
- $filter: `Key eq '${releaseKey}'`,
28256
- $top: 1
28257
- });
28270
+ const folder = options?.folderPath ?? options?.folderKey;
28271
+ const tenantWideMiss = () => `Process '${releaseKey}' not found. ` + `The lookup searched tenant-wide, which an identity with only a folder-level role (such as an external app) cannot read. ` + `Use 'processes list --folder-path <path>' to verify.`;
28272
+ let result;
28273
+ try {
28274
+ result = await releasesApi.releasesListReleases({
28275
+ $filter: `Key eq '${releaseKey}'`,
28276
+ $top: 1
28277
+ });
28278
+ } catch (error) {
28279
+ if (folder === undefined && await isFolderRequiredRefusal(error)) {
28280
+ const miss = new ReleaseNotFoundError(tenantWideMiss(), false);
28281
+ miss.cause = error;
28282
+ throw miss;
28283
+ }
28284
+ throw error;
28285
+ }
28258
28286
  if (!result.value || result.value.length === 0) {
28259
- throw new Error(`Process '${releaseKey}' not found. ` + `Use 'processes list --folder-path <path>' to verify.`);
28287
+ if (folder !== undefined) {
28288
+ throw new ReleaseNotFoundError(`Process '${releaseKey}' not found in folder '${folder}'. ` + `Use 'processes list --folder-path <path>' to verify.`, true);
28289
+ }
28290
+ throw new ReleaseNotFoundError(tenantWideMiss(), false);
28260
28291
  }
28261
28292
  const release = result.value[0];
28262
28293
  if (!release.id) {
@@ -34086,6 +34117,23 @@ function toResolved(machine, inputKey) {
34086
34117
  };
34087
34118
  }
34088
34119
 
34120
+ // src/utils/release-lookup.ts
34121
+ async function reportReleaseLookupFailure(message, error) {
34122
+ if (!(error instanceof ReleaseNotFoundError)) {
34123
+ OutputFormatter.error(await classifiedFailure(message, error));
34124
+ processContext.exit(1);
34125
+ return;
34126
+ }
34127
+ OutputFormatter.error({
34128
+ Result: RESULTS.Failure,
34129
+ ErrorCode: "not_found",
34130
+ Message: message,
34131
+ Instructions: error.folderScoped ? error.message : `${error.message} Or re-run with --folder-path <path> or --folder-key <key> to look inside that folder.`,
34132
+ Retry: "RetryWillNotFix"
34133
+ });
34134
+ processContext.exit(1);
34135
+ }
34136
+
34089
34137
  // src/commands/jobs.ts
34090
34138
  var JOB_LOG_LEVELS = ["Fatal", "Error", "Warning", "Info", "Trace"];
34091
34139
  function resolveJobForCommand(jobKey, tenant, errorContext) {
@@ -34623,12 +34671,16 @@ var registerJobsCommand = (program2) => {
34623
34671
  }
34624
34672
  const folderPath = options.folderPath;
34625
34673
  let folderKey = options.folderKey;
34674
+ let inferredRelease;
34626
34675
  if (!folderPath && !folderKey) {
34627
- const resolved = await resolveOrReportError(resolveRelease(releaseKey, {
34676
+ const [resolveError, resolved] = await catchError(resolveRelease(releaseKey, {
34628
34677
  tenant: options.tenant
34629
- }), "Error inferring folder from process");
34630
- if (resolved === null)
34678
+ }));
34679
+ if (resolveError) {
34680
+ await reportReleaseLookupFailure("Error inferring folder from process", resolveError);
34631
34681
  return;
34682
+ }
34683
+ inferredRelease = resolved;
34632
34684
  folderKey = resolved.folderKey;
34633
34685
  }
34634
34686
  const [apiError, api] = await catchError(createApiClient(JobsApi, {
@@ -34684,16 +34736,13 @@ var registerJobsCommand = (program2) => {
34684
34736
  let resolvedRobotIds;
34685
34737
  if (options.userKeys) {
34686
34738
  const keys = options.userKeys.split(",").map((k) => k.trim());
34687
- const [relError, rel] = await catchError(resolveRelease(releaseKey, {
34688
- tenant: options.tenant
34739
+ const [relError, rel] = inferredRelease ? [undefined, inferredRelease] : await catchError(resolveRelease(releaseKey, {
34740
+ tenant: options.tenant,
34741
+ folderPath,
34742
+ folderKey
34689
34743
  }));
34690
34744
  if (relError) {
34691
- OutputFormatter.error({
34692
- Result: RESULTS.Failure,
34693
- Message: "Error resolving process",
34694
- Instructions: relError.message
34695
- });
34696
- processContext.exit(1);
34745
+ await reportReleaseLookupFailure("Error resolving process", relError);
34697
34746
  return;
34698
34747
  }
34699
34748
  const [robotApiError, robotApi] = await catchError(createApiClient(RobotsApi, {
@@ -38015,6 +38064,21 @@ var JOB_PRIORITY_SPECIFIC_VALUE = {
38015
38064
  Normal: 45,
38016
38065
  High: 65
38017
38066
  };
38067
+ var ROBOT_SIZES = ["Small", "Standard", "Medium", "Large"];
38068
+ function parseRobotSizeOrExit(value) {
38069
+ const matched = ROBOT_SIZES.find((size) => size.toLowerCase() === value.toLowerCase());
38070
+ if (matched === undefined) {
38071
+ OutputFormatter.error({
38072
+ Result: RESULTS.Failure,
38073
+ ErrorCode: "invalid_argument",
38074
+ Message: "Invalid --robot-size",
38075
+ Instructions: `Must be one of: ${ROBOT_SIZES.join(", ")}`,
38076
+ Retry: "RetryWillNotFix"
38077
+ });
38078
+ processContext.exit(1);
38079
+ }
38080
+ return matched;
38081
+ }
38018
38082
  var PROCESSES_LIST_EXAMPLES = [
38019
38083
  {
38020
38084
  Description: "List processes in a folder",
@@ -38310,8 +38374,12 @@ var registerProcessesCommand = (program2) => {
38310
38374
  Data: processList
38311
38375
  });
38312
38376
  });
38313
- processes.command("get").description("Get detailed process information by key (GUID). " + "Returns version, entry point, input/output argument schemas, process type, and configuration. " + "No folder context needed — the key is globally unique. " + "Use 'processes list' to find process keys.").argument("<process-key>", "Process key (GUID)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--all-fields", "Return all fields from the API response instead of a curated summary").examples(PROCESSES_GET_EXAMPLES).trackedAction(processContext, async (processKey, options) => {
38314
- const [resolveError, resolved] = await catchError(resolveRelease(processKey, { tenant: options.tenant }));
38377
+ processes.command("get").description("Get detailed process information by key (GUID). " + "Returns version, entry point, input/output argument schemas, process type, and configuration. " + "Resolves the key tenant-wide; pass --folder-path/--folder-key to scope the lookup to a folder, which a folder-only identity (such as an external app) needs. " + "Use 'processes list' to find process keys.").argument("<process-key>", "Process 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(PROCESSES_GET_EXAMPLES).trackedAction(processContext, async (processKey, options) => {
38378
+ const [resolveError, resolved] = await catchError(resolveRelease(processKey, {
38379
+ tenant: options.tenant,
38380
+ folderPath: options.folderPath,
38381
+ folderKey: options.folderKey
38382
+ }));
38315
38383
  if (resolveError) {
38316
38384
  OutputFormatter.error({
38317
38385
  Result: RESULTS.Failure,
@@ -38426,7 +38494,7 @@ var registerProcessesCommand = (program2) => {
38426
38494
  Data: versionHistory
38427
38495
  });
38428
38496
  });
38429
- processes.command("create").description("Create a new process by binding a package to a folder. Requires --folder-path or --folder-key. " + "Use the package Id from 'packages list' or 'packages get', and 'packages versions' to find available versions. " + "After creation, start the process with 'jobs start <process-key>'.").requiredOption("--name <name>", "Process name (how it will appear in the folder)").requiredOption("--package-key <key>", "Package ID / process key from packages list/get output (Id field); pass the version separately with --package-version").requiredOption("--package-version <version>", "Package version (e.g., '1.0.0') — use 'packages versions' to list available versions").option("--description <desc>", "Process description").option("--entry-point <path>", "Entry point workflow path (for multi-entry-point packages — use 'packages entry-points' to list them)").option("--input-arguments <json>", "Default input arguments as JSON string").option("--job-priority <priority>", "Default job priority (Low, Normal, High)").option("--specific-priority <value>", "Specific priority value (1-100). Mutually exclusive with --job-priority.").option("--robot-size <size>", "Cloud robot size: Small, Standard, Medium, Large").option("--tags <tags>", "Comma-separated list of tag names").option("--environment-variables <pairs>", "Environment variables as newline-separated KEY=VALUE pairs").option("--auto-update", "Enable auto-update to latest package version").option("--no-auto-update", "Disable auto-update to latest package version").option("--hidden-for-attended", "Hide from attended robot users").option("--visible-for-attended", "Show to attended robot users").option("--auto-create-triggers", "Auto-create connected triggers on deploy").option("--no-auto-create-triggers", "Disable auto-create connected triggers on deploy").option("--retention-period <days>", "Job retention period in days (1–180)", "30").option("--retention-action <action>", "Retention action when period expires (Delete, Archive, None)", "Delete").option("--retention-bucket <id>", "Storage bucket ID for archived jobs (required when action is Archive)").option("--stale-retention-period <days>", "Stale job retention period in days").option("--stale-retention-action <action>", "Stale retention action (Delete, Archive, None)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--folder-path <path>", "Folder path (e.g., 'Shared')").option("--folder-key <key>", "Folder key (GUID)").examples(PROCESSES_CREATE_EXAMPLES).trackedAction(processContext, async (options) => {
38497
+ processes.command("create").description("Create a new process by binding a package to a folder. Requires --folder-path or --folder-key. " + "Use the package Id from 'packages list' or 'packages get', and 'packages versions' to find available versions. " + "After creation, start the process with 'jobs start <process-key>'.").requiredOption("--name <name>", "Process name (how it will appear in the folder)").requiredOption("--package-key <key>", "Package ID / process key from packages list/get output (Id field); pass the version separately with --package-version").requiredOption("--package-version <version>", "Package version (e.g., '1.0.0') — use 'packages versions' to list available versions").option("--description <desc>", "Process description").option("--entry-point <path>", "Entry point workflow path (for multi-entry-point packages — use 'packages entry-points' to list them)").option("--input-arguments <json>", "Default input arguments as JSON string").option("--job-priority <priority>", "Default job priority (Low, Normal, High)").option("--specific-priority <value>", "Specific priority value (1-100). Mutually exclusive with --job-priority.").option("--robot-size <size>", "Cloud serverless machine size: Small, Standard, Medium, Large").option("--tags <tags>", "Comma-separated list of tag names").option("--environment-variables <pairs>", "Environment variables as newline-separated KEY=VALUE pairs").option("--auto-update", "Enable auto-update to latest package version").option("--no-auto-update", "Disable auto-update to latest package version").option("--hidden-for-attended", "Hide from attended robot users").option("--visible-for-attended", "Show to attended robot users").option("--auto-create-triggers", "Auto-create connected triggers on deploy").option("--no-auto-create-triggers", "Disable auto-create connected triggers on deploy").option("--retention-period <days>", "Job retention period in days (1–180)", "30").option("--retention-action <action>", "Retention action when period expires (Delete, Archive, None)", "Delete").option("--retention-bucket <id>", "Storage bucket ID for archived jobs (required when action is Archive)").option("--stale-retention-period <days>", "Stale job retention period in days").option("--stale-retention-action <action>", "Stale retention action (Delete, Archive, None)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--folder-path <path>", "Folder path (e.g., 'Shared')").option("--folder-key <key>", "Folder key (GUID)").examples(PROCESSES_CREATE_EXAMPLES).trackedAction(processContext, async (options) => {
38430
38498
  if (options.jobPriority && options.specificPriority) {
38431
38499
  OutputFormatter.error({
38432
38500
  Result: RESULTS.Failure,
@@ -38529,18 +38597,10 @@ var registerProcessesCommand = (program2) => {
38529
38597
  return;
38530
38598
  }
38531
38599
  }
38532
- if (options.robotSize) {
38533
- const validSizes = ["Small", "Standard", "Medium", "Large"];
38534
- const matchedSize = validSizes.find((v) => v.toLowerCase() === options.robotSize?.toLowerCase());
38535
- if (!matchedSize) {
38536
- OutputFormatter.error({
38537
- Result: RESULTS.Failure,
38538
- Message: "Invalid --robot-size",
38539
- Instructions: `Must be one of: ${validSizes.join(", ")}`
38540
- });
38541
- processContext.exit(1);
38600
+ if (options.robotSize !== undefined) {
38601
+ const matchedSize = parseRobotSizeOrExit(options.robotSize);
38602
+ if (matchedSize === undefined)
38542
38603
  return;
38543
- }
38544
38604
  options.robotSize = matchedSize;
38545
38605
  }
38546
38606
  const [apiError, api] = await catchError(createApiClient(ReleasesApi, {
@@ -38702,7 +38762,7 @@ var registerProcessesCommand = (program2) => {
38702
38762
  });
38703
38763
  }
38704
38764
  });
38705
- processes.command("update").alias("edit").description("Update process settings by key (GUID). No folder needed — resolves cross-folder. " + "Only provided fields are updated (PATCH). " + "Use 'processes get' to see current values.").argument("<process-key>", "Process key (GUID)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-n, --name <name>", "Process display name").option("-d, --description <desc>", "Process description").option("--entry-point <path>", "Entry point workflow path (for multi-entry-point packages)").option("--input-arguments <json>", "Default input arguments as JSON string").option("--environment-variables <pairs>", "Environment variables as newline-separated KEY=VALUE pairs. Pass '' to clear them.").option("--job-priority <priority>", "Default job priority (Low, Normal, High)").option("--specific-priority <value>", "Specific priority value (1-100). Mutually exclusive with --job-priority.").option("--auto-update", "Enable auto-update to latest package version").option("--no-auto-update", "Disable auto-update to latest package version").option("--hidden-for-attended", "Hide from attended robot users").option("--visible-for-attended", "Show to attended robot users").option("--auto-create-triggers", "Auto-create connected triggers on deploy").option("--no-auto-create-triggers", "Disable auto-create connected triggers on deploy").option("--healing-agent", "Enable Healing Agent (Autopilot for Robots) for this process. Future jobs use it by default; tenant-level Autopilot must already be enabled.").option("--no-healing-agent", "Disable Healing Agent (Autopilot for Robots) for this process").option("--retention-period <days>", "Job retention period in days (1–180)").option("--retention-action <action>", "Retention action (Delete, Archive, None)").option("--retention-bucket <id>", "Storage bucket ID for archived jobs (required when action is Archive)").option("--stale-retention-period <days>", "Stale job retention period in days").option("--stale-retention-action <action>", "Stale retention action (Delete, Archive, None)").examples(PROCESSES_EDIT_EXAMPLES).trackedAction(processContext, async (processKey, options) => {
38765
+ processes.command("update").alias("edit").description("Update process settings by key (GUID). Resolves the key tenant-wide by default; " + "pass --folder-path/--folder-key to scope the lookup to a folder, which a folder-only identity (such as an external app) needs. " + "Only provided fields are updated (PATCH). " + "Use 'processes get' to see current values.").argument("<process-key>", "Process 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("-n, --name <name>", "Process display name").option("-d, --description <desc>", "Process description").option("--entry-point <path>", "Entry point workflow path (for multi-entry-point packages)").option("--input-arguments <json>", "Default input arguments as JSON string").option("--environment-variables <pairs>", "Environment variables as newline-separated KEY=VALUE pairs. Pass '' to clear them.").option("--job-priority <priority>", "Default job priority (Low, Normal, High)").option("--specific-priority <value>", "Specific priority value (1-100). Mutually exclusive with --job-priority.").option("--robot-size <size>", "Cloud serverless machine size: Small, Standard, Medium, Large").option("--auto-update", "Enable auto-update to latest package version").option("--no-auto-update", "Disable auto-update to latest package version").option("--hidden-for-attended", "Hide from attended robot users").option("--visible-for-attended", "Show to attended robot users").option("--auto-create-triggers", "Auto-create connected triggers on deploy").option("--no-auto-create-triggers", "Disable auto-create connected triggers on deploy").option("--healing-agent", "Enable Healing Agent (Autopilot for Robots) for this process. Future jobs use it by default; tenant-level Autopilot must already be enabled.").option("--no-healing-agent", "Disable Healing Agent (Autopilot for Robots) for this process").option("--retention-period <days>", "Job retention period in days (1–180)").option("--retention-action <action>", "Retention action (Delete, Archive, None)").option("--retention-bucket <id>", "Storage bucket ID for archived jobs (required when action is Archive)").option("--stale-retention-period <days>", "Stale job retention period in days").option("--stale-retention-action <action>", "Stale retention action (Delete, Archive, None)").examples(PROCESSES_EDIT_EXAMPLES).trackedAction(processContext, async (processKey, options) => {
38706
38766
  if (options.hiddenForAttended && options.visibleForAttended) {
38707
38767
  OutputFormatter.error({
38708
38768
  Result: RESULTS.Failure,
@@ -38747,6 +38807,12 @@ var registerProcessesCommand = (program2) => {
38747
38807
  return;
38748
38808
  }
38749
38809
  }
38810
+ if (options.robotSize !== undefined) {
38811
+ const matchedSize = parseRobotSizeOrExit(options.robotSize);
38812
+ if (matchedSize === undefined)
38813
+ return;
38814
+ options.robotSize = matchedSize;
38815
+ }
38750
38816
  const validActions = ["Delete", "Archive", "None"];
38751
38817
  if (options.retentionAction) {
38752
38818
  const matched = validActions.find((v) => v.toLowerCase() === options.retentionAction?.toLowerCase());
@@ -38783,7 +38849,11 @@ var registerProcessesCommand = (program2) => {
38783
38849
  }
38784
38850
  options.staleRetentionAction = matched;
38785
38851
  }
38786
- const [resolveError, resolved] = await catchError(resolveRelease(processKey, { tenant: options.tenant }));
38852
+ const [resolveError, resolved] = await catchError(resolveRelease(processKey, {
38853
+ tenant: options.tenant,
38854
+ folderPath: options.folderPath,
38855
+ folderKey: options.folderKey
38856
+ }));
38787
38857
  if (resolveError) {
38788
38858
  OutputFormatter.error({
38789
38859
  Result: RESULTS.Failure,
@@ -38853,6 +38923,8 @@ var registerProcessesCommand = (program2) => {
38853
38923
  }
38854
38924
  if (options.specificPriority !== undefined)
38855
38925
  body.specificPriorityValue = parseInt(options.specificPriority, 10);
38926
+ if (options.robotSize !== undefined)
38927
+ body.robotSize = options.robotSize;
38856
38928
  if (options.autoUpdate !== undefined)
38857
38929
  body.autoUpdate = options.autoUpdate;
38858
38930
  if (options.hiddenForAttended === true)
@@ -43692,7 +43764,7 @@ var registerTriggersCommand = (program2) => {
43692
43764
  });
43693
43765
  }
43694
43766
  });
43695
- triggers.command("create").description("Create a new trigger. --type selects trigger type: time (default), queue, or api. Requires --name, --release-key, --runtime-type. " + "Time triggers need --cron; queue triggers need --queue-key. " + "API triggers need --slug and --method. " + "Folder is derived from --release-key. " + "Use 'processes list' to find the release key.").option("--type <type>", "Trigger type (time, queue, api)", "time").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).requiredOption("--name <name>", "Trigger name").option("-d, --description <text>", "Trigger description").requiredOption("--release-key <key>", "Release key (GUID) of the process to trigger").option("--input-arguments <json>", `Input arguments as JSON string (e.g., '{"Arg1":"value"}')`).option("--calendar-key <key>", "Calendar key (GUID) for excluding non-working days. Use 'calendars list' to find keys.").option("--stop-strategy <strategy>", "How to stop running jobs: SoftStop or Kill").option("--kill-process-expression <expression>", "Cron expression for force-killing jobs (requires --stop-strategy Kill)").option("--cron <expression>", "Cron expression in Quartz 6-field format: 'sec min hour day month weekday' (e.g., '0 0 12 * * ?' for daily at noon). Note: standard Unix 5-field cron is not supported.").option("--time-zone <timezone>", "IANA time zone ID, e.g. 'UTC' or 'Europe/Bucharest' (applies to time-of-day fields)").option("--queue-key <key>", "Queue key (GUID) for queue trigger (queue only)").option("--items-threshold <number>", "Minimum queue items to trigger activation (queue only)", "1").option("--max-jobs <number>", "Maximum concurrent jobs for queue activation (queue only)", "1").option("--items-per-job <number>", "Target ratio of queue items per job (queue only)", "1").option("--activate-on-complete", "Re-trigger when a job completes (queue only)").option("--resume-on-same-context", "Resume suspended jobs on the same machine").option("--run-as-me", "Run job under the trigger creator's identity").option("--disabled", "Create the trigger in disabled state (default: enabled)").requiredOption("--runtime-type <type>", "Execution runtime (Serverless, Unattended, Headless, NonProduction, AgentService)").requiredOption("--job-priority <priority>", "Job execution priority (Low, Normal, High)", "Normal").option("--slug <slug>", "URL slug for API trigger (api only)").option("--method <method>", "HTTP method: Get, Post, Put, Delete (api only)").option("--calling-mode <mode>", "Calling mode: AsyncRequestReply, AsyncCallback, LongPolling, FireAndForget (api only)").option("--target <spec>", "Run target as 'machine=<guid>,user=<guid>,session=<int>' (any field optional). Repeat for multiple targets. Use 'machines list' and 'users list' to find keys.", (val, prev) => prev ? [...prev, val] : [val]).option("--mapping-mode <mode>", "Validation mode for --target: 'dynamic' (default) allows any combination of machine/user/session (session requires machine); 'strict' requires both machine and user on every target (use when the folder has 'Enable account-machine mappings' turned on).", "dynamic").examples(TRIGGERS_CREATE_EXAMPLES).trackedAction(processContext, async (options) => {
43767
+ triggers.command("create").description("Create a new trigger. --type selects trigger type: time (default), queue, or api. Requires --name, --release-key, --runtime-type. " + "Time triggers need --cron; queue triggers need --queue-key. " + "API triggers need --slug and --method. " + "Folder is inferred from --release-key; pass --folder-path or --folder-key when your identity only has a folder-level role (such as an external app), since it cannot look processes up tenant-wide. " + "Use 'processes list' to find the release key.").option("--type <type>", "Trigger type (time, queue, api)", "time").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).requiredOption("--name <name>", "Trigger name").option("-d, --description <text>", "Trigger description").requiredOption("--release-key <key>", "Release key (GUID) of the process to trigger").option("--folder-path <path>", "Folder path of the process (e.g., 'Shared'). Optional — inferred from --release-key if not given").option("--folder-key <key>", "Folder key (GUID) of the process. Optional — inferred from --release-key if not given").option("--input-arguments <json>", `Input arguments as JSON string (e.g., '{"Arg1":"value"}')`).option("--calendar-key <key>", "Calendar key (GUID) for excluding non-working days. Use 'calendars list' to find keys.").option("--stop-strategy <strategy>", "How to stop running jobs: SoftStop or Kill").option("--kill-process-expression <expression>", "Cron expression for force-killing jobs (requires --stop-strategy Kill)").option("--cron <expression>", "Cron expression in Quartz 6-field format: 'sec min hour day month weekday' (e.g., '0 0 12 * * ?' for daily at noon). Note: standard Unix 5-field cron is not supported.").option("--time-zone <timezone>", "IANA time zone ID, e.g. 'UTC' or 'Europe/Bucharest' (applies to time-of-day fields)").option("--queue-key <key>", "Queue key (GUID) for queue trigger (queue only)").option("--items-threshold <number>", "Minimum queue items to trigger activation (queue only)", "1").option("--max-jobs <number>", "Maximum concurrent jobs for queue activation (queue only)", "1").option("--items-per-job <number>", "Target ratio of queue items per job (queue only)", "1").option("--activate-on-complete", "Re-trigger when a job completes (queue only)").option("--resume-on-same-context", "Resume suspended jobs on the same machine").option("--run-as-me", "Run job under the trigger creator's identity").option("--disabled", "Create the trigger in disabled state (default: enabled)").requiredOption("--runtime-type <type>", "Execution runtime (Serverless, Unattended, Headless, NonProduction, AgentService)").requiredOption("--job-priority <priority>", "Job execution priority (Low, Normal, High)", "Normal").option("--slug <slug>", "URL slug for API trigger (api only)").option("--method <method>", "HTTP method: Get, Post, Put, Delete (api only)").option("--calling-mode <mode>", "Calling mode: AsyncRequestReply, AsyncCallback, LongPolling, FireAndForget (api only)").option("--target <spec>", "Run target as 'machine=<guid>,user=<guid>,session=<int>' (any field optional). Repeat for multiple targets. Use 'machines list' and 'users list' to find keys.", (val, prev) => prev ? [...prev, val] : [val]).option("--mapping-mode <mode>", "Validation mode for --target: 'dynamic' (default) allows any combination of machine/user/session (session requires machine); 'strict' requires both machine and user on every target (use when the folder has 'Enable account-machine mappings' turned on).", "dynamic").examples(TRIGGERS_CREATE_EXAMPLES).trackedAction(processContext, async (options) => {
43696
43768
  const triggerType = validateTriggerType(options.type);
43697
43769
  if (!triggerType) {
43698
43770
  emitInvalidTypeError(options.type);
@@ -43883,15 +43955,12 @@ async function createScheduleTrigger(options, isCronType) {
43883
43955
  return;
43884
43956
  }
43885
43957
  const [releaseError, release] = await catchError(resolveRelease(options.releaseKey, {
43886
- tenant: options.tenant
43958
+ tenant: options.tenant,
43959
+ folderPath: options.folderPath,
43960
+ folderKey: options.folderKey
43887
43961
  }));
43888
43962
  if (releaseError) {
43889
- OutputFormatter.error({
43890
- Result: RESULTS.Failure,
43891
- Message: "Error resolving release",
43892
- Instructions: releaseError.message
43893
- });
43894
- processContext.exit(1);
43963
+ await reportReleaseLookupFailure("Error resolving release", releaseError);
43895
43964
  return;
43896
43965
  }
43897
43966
  const folderId = release.folderId.toString();
@@ -43971,6 +44040,7 @@ async function createScheduleTrigger(options, isCronType) {
43971
44040
  if (options.target && options.target.length > 0) {
43972
44041
  const resolved = await resolveTargets(options.target, options.mappingMode ?? "dynamic", {
43973
44042
  tenant: options.tenant,
44043
+ folderId: release.folderId || undefined,
43974
44044
  folderPath: options.folderPath,
43975
44045
  folderKey: options.folderKey
43976
44046
  });
@@ -44138,15 +44208,12 @@ async function createApiTrigger(options) {
44138
44208
  options.callingMode = matchedCallingMode;
44139
44209
  }
44140
44210
  const [releaseError, release] = await catchError(resolveRelease(options.releaseKey, {
44141
- tenant: options.tenant
44211
+ tenant: options.tenant,
44212
+ folderPath: options.folderPath,
44213
+ folderKey: options.folderKey
44142
44214
  }));
44143
44215
  if (releaseError) {
44144
- OutputFormatter.error({
44145
- Result: RESULTS.Failure,
44146
- Message: "Error resolving release",
44147
- Instructions: releaseError.message
44148
- });
44149
- processContext.exit(1);
44216
+ await reportReleaseLookupFailure("Error resolving release", releaseError);
44150
44217
  return;
44151
44218
  }
44152
44219
  const [apiError, api] = await catchError(createApiClient(HttpTriggersApi, {
@@ -44497,17 +44564,21 @@ async function resolveTargets(specs, mode, ctx) {
44497
44564
  }
44498
44565
  let userByKey = new Map;
44499
44566
  if (userKeys.size > 0) {
44500
- const [folderError, folder] = await catchError(resolveFolder({ folderPath: ctx.folderPath, folderKey: ctx.folderKey }, { tenant: ctx.tenant }));
44501
- if (folderError || !folder || folder.id == null) {
44502
- OutputFormatter.error({
44503
- Result: RESULTS.Failure,
44504
- Message: "Error resolving folder for user lookup",
44505
- Instructions: folderError?.message ?? "--target with 'user' requires --folder-path or --folder-key"
44506
- });
44507
- processContext.exit(1);
44508
- return null;
44567
+ let folderId = ctx.folderId;
44568
+ if (folderId === undefined) {
44569
+ const [folderError, folder] = await catchError(resolveFolder({ folderPath: ctx.folderPath, folderKey: ctx.folderKey }, { tenant: ctx.tenant }));
44570
+ if (folderError || !folder || folder.id == null) {
44571
+ OutputFormatter.error({
44572
+ Result: RESULTS.Failure,
44573
+ Message: "Error resolving folder for user lookup",
44574
+ Instructions: folderError?.message ?? "--target with 'user' requires --folder-path or --folder-key"
44575
+ });
44576
+ processContext.exit(1);
44577
+ return null;
44578
+ }
44579
+ folderId = folder.id;
44509
44580
  }
44510
- const res = await resolveUsersToRobotsByKeys([...userKeys], folder.id, ctx.tenant);
44581
+ const res = await resolveUsersToRobotsByKeys([...userKeys], folderId, ctx.tenant);
44511
44582
  if (!res)
44512
44583
  return null;
44513
44584
  userByKey = res;
@@ -46020,4 +46091,4 @@ var registerCommands = async (program2) => {
46020
46091
 
46021
46092
  export { Command, metadata, registerCommands };
46022
46093
 
46023
- //# debugId=12235F6CA9A30DE364756E2164756E21
46094
+ //# debugId=FFDB5CF9C206934E64756E2164756E21
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./tool-2p58ckbh.js";
4
+ } from "./tool-32ebxyj7.js";
5
5
  import"./tool-ayyhwvs8.js";
6
6
  import"./tool-1de529jm.js";
7
7
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/orchestrator-tool",
3
3
  "license": "SEE LICENSE IN LICENSE.txt",
4
- "version": "1.202.1",
4
+ "version": "1.202.2-preview.183",
5
5
  "description": "Manage Orchestrator folders, jobs, processes, and releases.",
6
6
  "private": false,
7
7
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "280b581b7893224d512dd194f47dd57243cc6a5c"
29
+ "gitHead": "b512d14a5465ea9bbdbc7773d42b5cfb4c2ae200"
30
30
  }