@uipath/orchestrator-tool 1.203.0-preview.180 → 1.203.0-preview.182

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-cc3ztsff.js";
6
+ } from "./tool-z2x5wjsc.js";
7
7
  import"./tool-ayyhwvs8.js";
8
8
  import"./tool-1de529jm.js";
9
9
 
@@ -2104,7 +2104,7 @@ var package_default = {
2104
2104
  name: "@uipath/orchestrator-tool",
2105
2105
  author: "UiPath",
2106
2106
  license: "SEE LICENSE IN LICENSE.txt",
2107
- version: "1.203.0-preview.180",
2107
+ version: "1.203.0-preview.182",
2108
2108
  description: "Manage Orchestrator folders, jobs, processes, and releases.",
2109
2109
  private: false,
2110
2110
  repository: {
@@ -28494,6 +28494,22 @@ async function uploadJobAttachment(bytes, name, options = {}) {
28494
28494
  }
28495
28495
  }
28496
28496
  // ../orchestrator-sdk/src/release-resolver.ts
28497
+ class ReleaseNotFoundError extends Error {
28498
+ folderScoped;
28499
+ constructor(message, folderScoped) {
28500
+ super(message);
28501
+ this.name = "ReleaseNotFoundError";
28502
+ this.folderScoped = folderScoped;
28503
+ }
28504
+ }
28505
+ async function isFolderRequiredRefusal(error) {
28506
+ const response = error?.response;
28507
+ if (response?.status !== 400 || typeof response.clone !== "function") {
28508
+ return false;
28509
+ }
28510
+ const body = await response.clone().text().catch(() => "");
28511
+ return /a folder is required for this action/i.test(body);
28512
+ }
28497
28513
  var UUID_REGEX2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
28498
28514
  async function resolveRelease(releaseKey, options) {
28499
28515
  if (!UUID_REGEX2.test(releaseKey)) {
@@ -28501,12 +28517,27 @@ async function resolveRelease(releaseKey, options) {
28501
28517
  }
28502
28518
  const config = await createOrchestratorConfig(options);
28503
28519
  const releasesApi = new ReleasesApi(config);
28504
- const result = await releasesApi.releasesListReleases({
28505
- $filter: `Key eq '${releaseKey}'`,
28506
- $top: 1
28507
- });
28520
+ const folder = options?.folderPath ?? options?.folderKey;
28521
+ 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.`;
28522
+ let result;
28523
+ try {
28524
+ result = await releasesApi.releasesListReleases({
28525
+ $filter: `Key eq '${releaseKey}'`,
28526
+ $top: 1
28527
+ });
28528
+ } catch (error) {
28529
+ if (folder === undefined && await isFolderRequiredRefusal(error)) {
28530
+ const miss = new ReleaseNotFoundError(tenantWideMiss(), false);
28531
+ miss.cause = error;
28532
+ throw miss;
28533
+ }
28534
+ throw error;
28535
+ }
28508
28536
  if (!result.value || result.value.length === 0) {
28509
- throw new Error(`Process '${releaseKey}' not found. ` + `Use 'processes list --folder-path <path>' to verify.`);
28537
+ if (folder !== undefined) {
28538
+ throw new ReleaseNotFoundError(`Process '${releaseKey}' not found in folder '${folder}'. ` + `Use 'processes list --folder-path <path>' to verify.`, true);
28539
+ }
28540
+ throw new ReleaseNotFoundError(tenantWideMiss(), false);
28510
28541
  }
28511
28542
  const release = result.value[0];
28512
28543
  if (!release.id) {
@@ -32682,6 +32713,15 @@ function toResolved(machine, inputKey) {
32682
32713
  };
32683
32714
  }
32684
32715
 
32716
+ // src/utils/release-lookup.ts
32717
+ async function reportReleaseLookupFailure(message, error) {
32718
+ if (!(error instanceof ReleaseNotFoundError)) {
32719
+ await reportFailure(message, error);
32720
+ return;
32721
+ }
32722
+ reportNotFound(message, error.folderScoped ? error.message : `${error.message} Or re-run with --folder-path <path> or --folder-key <key> to look inside that folder.`);
32723
+ }
32724
+
32685
32725
  // src/commands/jobs.ts
32686
32726
  var JOB_LOG_LEVELS = ["Fatal", "Error", "Warning", "Info", "Trace"];
32687
32727
  function resolveJobForCommand(jobKey, tenant, errorContext) {
@@ -33213,12 +33253,16 @@ var registerJobsCommand = (program2) => {
33213
33253
  }
33214
33254
  const folderPath = options.folderPath;
33215
33255
  let folderKey = options.folderKey;
33256
+ let inferredRelease;
33216
33257
  if (!folderPath && !folderKey) {
33217
- const resolved = await resolveOrReportError(resolveRelease(releaseKey, {
33258
+ const [resolveError, resolved] = await catchError(resolveRelease(releaseKey, {
33218
33259
  tenant: options.tenant
33219
- }), "Error inferring folder from process");
33220
- if (resolved === null)
33260
+ }));
33261
+ if (resolveError) {
33262
+ await reportReleaseLookupFailure("Error inferring folder from process", resolveError);
33221
33263
  return;
33264
+ }
33265
+ inferredRelease = resolved;
33222
33266
  folderKey = resolved.folderKey;
33223
33267
  }
33224
33268
  const [apiError, api] = await catchError(createApiClient(JobsApi, {
@@ -33274,16 +33318,13 @@ var registerJobsCommand = (program2) => {
33274
33318
  let resolvedRobotIds;
33275
33319
  if (options.userKeys) {
33276
33320
  const keys = options.userKeys.split(",").map((k) => k.trim());
33277
- const [relError, rel] = await catchError(resolveRelease(releaseKey, {
33278
- tenant: options.tenant
33321
+ const [relError, rel] = inferredRelease ? [undefined, inferredRelease] : await catchError(resolveRelease(releaseKey, {
33322
+ tenant: options.tenant,
33323
+ folderPath,
33324
+ folderKey
33279
33325
  }));
33280
33326
  if (relError) {
33281
- OutputFormatter.error({
33282
- Result: RESULTS.Failure,
33283
- Message: "Error resolving process",
33284
- Instructions: relError.message
33285
- });
33286
- processContext.exit(1);
33327
+ await reportReleaseLookupFailure("Error resolving process", relError);
33287
33328
  return;
33288
33329
  }
33289
33330
  const [robotApiError, robotApi] = await catchError(createApiClient(RobotsApi, {
@@ -36480,6 +36521,21 @@ var JOB_PRIORITY_SPECIFIC_VALUE = {
36480
36521
  Normal: 45,
36481
36522
  High: 65
36482
36523
  };
36524
+ var ROBOT_SIZES = ["Small", "Standard", "Medium", "Large"];
36525
+ function parseRobotSizeOrExit(value) {
36526
+ const matched = ROBOT_SIZES.find((size) => size.toLowerCase() === value.toLowerCase());
36527
+ if (matched === undefined) {
36528
+ OutputFormatter.error({
36529
+ Result: RESULTS.Failure,
36530
+ ErrorCode: "invalid_argument",
36531
+ Message: "Invalid --robot-size",
36532
+ Instructions: `Must be one of: ${ROBOT_SIZES.join(", ")}`,
36533
+ Retry: "RetryWillNotFix"
36534
+ });
36535
+ processContext.exit(1);
36536
+ }
36537
+ return matched;
36538
+ }
36483
36539
  var PROCESSES_LIST_EXAMPLES = [
36484
36540
  {
36485
36541
  Description: "List processes in a folder",
@@ -36778,8 +36834,12 @@ var registerProcessesCommand = (program2) => {
36778
36834
  Data: processList
36779
36835
  });
36780
36836
  });
36781
- 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) => {
36782
- const [resolveError, resolved] = await catchError(resolveRelease(processKey, { tenant: options.tenant }));
36837
+ 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) => {
36838
+ const [resolveError, resolved] = await catchError(resolveRelease(processKey, {
36839
+ tenant: options.tenant,
36840
+ folderPath: options.folderPath,
36841
+ folderKey: options.folderKey
36842
+ }));
36783
36843
  if (resolveError) {
36784
36844
  OutputFormatter.error({
36785
36845
  Result: RESULTS.Failure,
@@ -36888,7 +36948,7 @@ var registerProcessesCommand = (program2) => {
36888
36948
  Data: versionHistory
36889
36949
  });
36890
36950
  });
36891
- 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) => {
36951
+ 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) => {
36892
36952
  if (options.jobPriority && options.specificPriority) {
36893
36953
  OutputFormatter.error({
36894
36954
  Result: RESULTS.Failure,
@@ -36991,18 +37051,10 @@ var registerProcessesCommand = (program2) => {
36991
37051
  return;
36992
37052
  }
36993
37053
  }
36994
- if (options.robotSize) {
36995
- const validSizes = ["Small", "Standard", "Medium", "Large"];
36996
- const matchedSize = validSizes.find((v) => v.toLowerCase() === options.robotSize?.toLowerCase());
36997
- if (!matchedSize) {
36998
- OutputFormatter.error({
36999
- Result: RESULTS.Failure,
37000
- Message: "Invalid --robot-size",
37001
- Instructions: `Must be one of: ${validSizes.join(", ")}`
37002
- });
37003
- processContext.exit(1);
37054
+ if (options.robotSize !== undefined) {
37055
+ const matchedSize = parseRobotSizeOrExit(options.robotSize);
37056
+ if (matchedSize === undefined)
37004
37057
  return;
37005
- }
37006
37058
  options.robotSize = matchedSize;
37007
37059
  }
37008
37060
  const [apiError, api] = await catchError(createApiClient(ReleasesApi, {
@@ -37140,7 +37192,7 @@ var registerProcessesCommand = (program2) => {
37140
37192
  });
37141
37193
  }
37142
37194
  });
37143
- 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) => {
37195
+ 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) => {
37144
37196
  if (options.hiddenForAttended && options.visibleForAttended) {
37145
37197
  OutputFormatter.error({
37146
37198
  Result: RESULTS.Failure,
@@ -37185,6 +37237,12 @@ var registerProcessesCommand = (program2) => {
37185
37237
  return;
37186
37238
  }
37187
37239
  }
37240
+ if (options.robotSize !== undefined) {
37241
+ const matchedSize = parseRobotSizeOrExit(options.robotSize);
37242
+ if (matchedSize === undefined)
37243
+ return;
37244
+ options.robotSize = matchedSize;
37245
+ }
37188
37246
  const validActions = ["Delete", "Archive", "None"];
37189
37247
  if (options.retentionAction) {
37190
37248
  const matched = validActions.find((v) => v.toLowerCase() === options.retentionAction?.toLowerCase());
@@ -37221,7 +37279,11 @@ var registerProcessesCommand = (program2) => {
37221
37279
  }
37222
37280
  options.staleRetentionAction = matched;
37223
37281
  }
37224
- const [resolveError, resolved] = await catchError(resolveRelease(processKey, { tenant: options.tenant }));
37282
+ const [resolveError, resolved] = await catchError(resolveRelease(processKey, {
37283
+ tenant: options.tenant,
37284
+ folderPath: options.folderPath,
37285
+ folderKey: options.folderKey
37286
+ }));
37225
37287
  if (resolveError) {
37226
37288
  OutputFormatter.error({
37227
37289
  Result: RESULTS.Failure,
@@ -37286,6 +37348,8 @@ var registerProcessesCommand = (program2) => {
37286
37348
  }
37287
37349
  if (options.specificPriority !== undefined)
37288
37350
  body.specificPriorityValue = parseInt(options.specificPriority, 10);
37351
+ if (options.robotSize !== undefined)
37352
+ body.robotSize = options.robotSize;
37289
37353
  if (options.autoUpdate !== undefined)
37290
37354
  body.autoUpdate = options.autoUpdate;
37291
37355
  if (options.hiddenForAttended === true)
@@ -41529,7 +41593,7 @@ var registerTriggersCommand = (program2) => {
41529
41593
  });
41530
41594
  }
41531
41595
  });
41532
- 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) => {
41596
+ 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) => {
41533
41597
  const triggerType = validateTriggerType(options.type);
41534
41598
  if (!triggerType) {
41535
41599
  emitInvalidTypeError(options.type);
@@ -41690,15 +41754,12 @@ async function createScheduleTrigger(options, isCronType) {
41690
41754
  return;
41691
41755
  }
41692
41756
  const [releaseError, release] = await catchError(resolveRelease(options.releaseKey, {
41693
- tenant: options.tenant
41757
+ tenant: options.tenant,
41758
+ folderPath: options.folderPath,
41759
+ folderKey: options.folderKey
41694
41760
  }));
41695
41761
  if (releaseError) {
41696
- OutputFormatter.error({
41697
- Result: RESULTS.Failure,
41698
- Message: "Error resolving release",
41699
- Instructions: releaseError.message
41700
- });
41701
- processContext.exit(1);
41762
+ await reportReleaseLookupFailure("Error resolving release", releaseError);
41702
41763
  return;
41703
41764
  }
41704
41765
  const folderId = release.folderId.toString();
@@ -41772,6 +41833,7 @@ async function createScheduleTrigger(options, isCronType) {
41772
41833
  if (options.target && options.target.length > 0) {
41773
41834
  const resolved = await resolveTargets(options.target, options.mappingMode ?? "dynamic", {
41774
41835
  tenant: options.tenant,
41836
+ folderId: release.folderId || undefined,
41775
41837
  folderPath: options.folderPath,
41776
41838
  folderKey: options.folderKey
41777
41839
  });
@@ -41928,15 +41990,12 @@ async function createApiTrigger(options) {
41928
41990
  options.callingMode = matchedCallingMode;
41929
41991
  }
41930
41992
  const [releaseError, release] = await catchError(resolveRelease(options.releaseKey, {
41931
- tenant: options.tenant
41993
+ tenant: options.tenant,
41994
+ folderPath: options.folderPath,
41995
+ folderKey: options.folderKey
41932
41996
  }));
41933
41997
  if (releaseError) {
41934
- OutputFormatter.error({
41935
- Result: RESULTS.Failure,
41936
- Message: "Error resolving release",
41937
- Instructions: releaseError.message
41938
- });
41939
- processContext.exit(1);
41998
+ await reportReleaseLookupFailure("Error resolving release", releaseError);
41940
41999
  return;
41941
42000
  }
41942
42001
  const [apiError, api] = await catchError(createApiClient(HttpTriggersApi, {
@@ -42246,17 +42305,21 @@ async function resolveTargets(specs, mode, ctx) {
42246
42305
  }
42247
42306
  let userByKey = new Map;
42248
42307
  if (userKeys.size > 0) {
42249
- const [folderError, folder] = await catchError(resolveFolder({ folderPath: ctx.folderPath, folderKey: ctx.folderKey }, { tenant: ctx.tenant }));
42250
- if (folderError || !folder || folder.id == null) {
42251
- OutputFormatter.error({
42252
- Result: RESULTS.Failure,
42253
- Message: "Error resolving folder for user lookup",
42254
- Instructions: folderError?.message ?? "--target with 'user' requires --folder-path or --folder-key"
42255
- });
42256
- processContext.exit(1);
42257
- return null;
42308
+ let folderId = ctx.folderId;
42309
+ if (folderId === undefined) {
42310
+ const [folderError, folder] = await catchError(resolveFolder({ folderPath: ctx.folderPath, folderKey: ctx.folderKey }, { tenant: ctx.tenant }));
42311
+ if (folderError || !folder || folder.id == null) {
42312
+ OutputFormatter.error({
42313
+ Result: RESULTS.Failure,
42314
+ Message: "Error resolving folder for user lookup",
42315
+ Instructions: folderError?.message ?? "--target with 'user' requires --folder-path or --folder-key"
42316
+ });
42317
+ processContext.exit(1);
42318
+ return null;
42319
+ }
42320
+ folderId = folder.id;
42258
42321
  }
42259
- const res = await resolveUsersToRobotsByKeys([...userKeys], folder.id, ctx.tenant);
42322
+ const res = await resolveUsersToRobotsByKeys([...userKeys], folderId, ctx.tenant);
42260
42323
  if (!res)
42261
42324
  return null;
42262
42325
  userByKey = res;
@@ -43649,4 +43712,4 @@ var registerCommands = async (program2) => {
43649
43712
 
43650
43713
  export { Command, metadata, registerCommands };
43651
43714
 
43652
- //# debugId=D22DB49452A5655C64756E2164756E21
43715
+ //# debugId=A185D58CEB44C0C964756E2164756E21
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./tool-cc3ztsff.js";
4
+ } from "./tool-z2x5wjsc.js";
5
5
  import"./tool-ayyhwvs8.js";
6
6
  import"./tool-1de529jm.js";
7
7
  export {
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.203.0-preview.180",
5
+ "version": "1.203.0-preview.182",
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": "4e0a51e3ab2c9d89afd3d35a7b087a7fa58133a0"
30
+ "gitHead": "f4f19f4d98117736cd2b34629dc1564ae6761aef"
31
31
  }