@uipath/uipath-typescript 1.3.1 → 1.3.3

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.umd.js CHANGED
@@ -4389,6 +4389,21 @@
4389
4389
  };
4390
4390
  }
4391
4391
 
4392
+ exports.TaskUserType = void 0;
4393
+ (function (TaskUserType) {
4394
+ /** A user of this type is supposed to be used by a human. */
4395
+ TaskUserType["User"] = "User";
4396
+ /** A user of this type is automatically created when adding a robot, is associated with Robot role and it is used by a robot when communicating with Orchestrator. */
4397
+ TaskUserType["Robot"] = "Robot";
4398
+ /** A user of type Directory User */
4399
+ TaskUserType["DirectoryUser"] = "DirectoryUser";
4400
+ /** A user of type Directory Group */
4401
+ TaskUserType["DirectoryGroup"] = "DirectoryGroup";
4402
+ /** A user of type Directory Robot Account */
4403
+ TaskUserType["DirectoryRobot"] = "DirectoryRobot";
4404
+ /** A user of type Directory External Application */
4405
+ TaskUserType["DirectoryExternalApplication"] = "DirectoryExternalApplication";
4406
+ })(exports.TaskUserType || (exports.TaskUserType = {}));
4392
4407
  /**
4393
4408
  * Types of tasks available in Action Center.
4394
4409
  * Each type determines the task's behavior, UI rendering, and completion requirements.
@@ -4523,6 +4538,8 @@
4523
4538
  const JOB_ENDPOINTS = {
4524
4539
  GET_ALL: `${ORCHESTRATOR_BASE}/odata/Jobs`,
4525
4540
  GET_BY_KEY: (identifier) => `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.GetByKey(identifier=${identifier})`,
4541
+ STOP: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.StopJobs`,
4542
+ RESUME: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.ResumeJob`,
4526
4543
  };
4527
4544
  /**
4528
4545
  * Orchestrator Asset Service Endpoints
@@ -5006,6 +5023,7 @@
5006
5023
  }
5007
5024
  }
5008
5025
 
5026
+ const GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
5009
5027
  class AuthService {
5010
5028
  constructor(config, executionContext) {
5011
5029
  // Only use stored OAuth context when completing an active callback (URL has ?code=).
@@ -5289,6 +5307,8 @@
5289
5307
  */
5290
5308
  getAuthorizationUrl(params) {
5291
5309
  const orgName = this.config.orgName;
5310
+ const isGuid = GUID_REGEX.test(orgName);
5311
+ const acrValues = isGuid ? `tenant:${orgName}` : `tenantName:${orgName}`;
5292
5312
  const queryParams = new URLSearchParams({
5293
5313
  response_type: 'code',
5294
5314
  client_id: params.clientId,
@@ -5298,13 +5318,12 @@
5298
5318
  scope: params.scope + ' offline_access',
5299
5319
  state: params.state || this.generateCodeVerifier().slice(0, 16)
5300
5320
  });
5301
- return `${this.config.baseUrl}/${orgName}/${IDENTITY_ENDPOINTS.AUTHORIZE}?${queryParams.toString()}`;
5321
+ return `${this.config.baseUrl}/${IDENTITY_ENDPOINTS.AUTHORIZE}?${queryParams.toString()}&acr_values=${acrValues}`;
5302
5322
  }
5303
5323
  /**
5304
5324
  * Exchanges the authorization code for an access token and automatically updates the current token
5305
5325
  */
5306
5326
  async _getAccessToken(params) {
5307
- const orgName = this.config.orgName;
5308
5327
  const body = new URLSearchParams({
5309
5328
  grant_type: 'authorization_code',
5310
5329
  client_id: params.clientId,
@@ -5312,7 +5331,7 @@
5312
5331
  redirect_uri: params.redirectUri,
5313
5332
  code_verifier: params.codeVerifier
5314
5333
  });
5315
- const response = await fetch(`${this.config.baseUrl}/${orgName}/${IDENTITY_ENDPOINTS.TOKEN}`, {
5334
+ const response = await fetch(`${this.config.baseUrl}/${IDENTITY_ENDPOINTS.TOKEN}`, {
5316
5335
  method: 'POST',
5317
5336
  headers: {
5318
5337
  'Content-Type': 'application/x-www-form-urlencoded'
@@ -9188,7 +9207,7 @@
9188
9207
  // Connection string placeholder that will be replaced during build
9189
9208
  const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
9190
9209
  // SDK Version placeholder
9191
- const SDK_VERSION = "1.3.1";
9210
+ const SDK_VERSION = "1.3.3";
9192
9211
  const VERSION = "Version";
9193
9212
  const SERVICE = "Service";
9194
9213
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -10117,7 +10136,11 @@
10117
10136
  const text = await response.text();
10118
10137
  return text;
10119
10138
  }
10120
- return response.json();
10139
+ const text = await response.text();
10140
+ if (!text) {
10141
+ return undefined;
10142
+ }
10143
+ return JSON.parse(text);
10121
10144
  }
10122
10145
  catch (error) {
10123
10146
  // If it's already one of our errors, re-throw it
@@ -11020,8 +11043,9 @@
11020
11043
  });
11021
11044
  }
11022
11045
  // Extract and transform items from response
11023
- const rawItems = response.data?.[itemsField];
11024
- const totalCount = response.data?.[totalCountField];
11046
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
11047
+ const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
11048
+ const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
11025
11049
  // Parse items - automatically handle JSON string responses
11026
11050
  const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
11027
11051
  const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
@@ -11217,7 +11241,7 @@
11217
11241
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
11218
11242
  // Prepare request parameters based on pagination type
11219
11243
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
11220
- // For POST requests, merge pagination params into body; for GET, use query params
11244
+ // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
11221
11245
  if (method.toUpperCase() === 'POST') {
11222
11246
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
11223
11247
  options.body = {
@@ -11225,6 +11249,7 @@
11225
11249
  ...options.params,
11226
11250
  ...requestParams
11227
11251
  };
11252
+ options.params = undefined;
11228
11253
  }
11229
11254
  else {
11230
11255
  // Merge pagination parameters with existing parameters
@@ -11265,7 +11290,6 @@
11265
11290
  if (params.pageNumber && params.pageNumber > 1) {
11266
11291
  requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
11267
11292
  }
11268
- // Include total count for ODATA APIs
11269
11293
  {
11270
11294
  requestParams[countParam] = true;
11271
11295
  }
@@ -11293,8 +11317,9 @@
11293
11317
  const totalCountField = fields.totalCountField || 'totalRecordCount';
11294
11318
  const continuationTokenField = fields.continuationTokenField || 'continuationToken';
11295
11319
  // Extract items and metadata
11296
- const items = response.data[itemsField] || [];
11297
- const totalCount = response.data[totalCountField];
11320
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
11321
+ const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
11322
+ const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
11298
11323
  const continuationToken = response.data[continuationTokenField];
11299
11324
  // Determine if there are more pages
11300
11325
  const hasMore = this.determineHasMorePages(paginationType, {
@@ -13691,15 +13716,15 @@
13691
13716
  return createTaskWithMethods(transformedData, this);
13692
13717
  }
13693
13718
  /**
13694
- * Gets users in the given folder who have Tasks.View and Tasks.Edit permissions
13719
+ * Gets task users (users, robots, groups etc) in the given folder who have Tasks.View and Tasks.Edit permissions
13695
13720
  *
13696
13721
  * The method returns either:
13697
- * - An array of users (when no pagination parameters are provided)
13722
+ * - An array of task users (when no pagination parameters are provided)
13698
13723
  * - A paginated result with navigation cursors (when any pagination parameter is provided)
13699
13724
  *
13700
- * @param folderId - The folder ID to get users from
13725
+ * @param folderId - The folder ID to get task users from
13701
13726
  * @param options - Optional query and pagination parameters
13702
- * @returns Promise resolving to an array of users or paginated result
13727
+ * @returns Promise resolving to an array of task users or paginated result
13703
13728
  *
13704
13729
  * @example
13705
13730
  * ```typescript
@@ -13710,7 +13735,7 @@
13710
13735
  * // Standard array return
13711
13736
  * const users = await tasks.getUsers(123);
13712
13737
  *
13713
- * // Get users with filtering
13738
+ * // Get task users with filtering
13714
13739
  * const users = await tasks.getUsers(123, {
13715
13740
  * filter: "name eq 'abc'"
13716
13741
  * });
@@ -15116,6 +15141,20 @@
15116
15141
  throw new Error('Job folderId is undefined');
15117
15142
  return service.getOutput(jobData.key, jobData.folderId);
15118
15143
  },
15144
+ async stop(options) {
15145
+ if (!jobData.key)
15146
+ throw new Error('Job key is undefined');
15147
+ if (!jobData.folderId)
15148
+ throw new Error('Job folderId is undefined');
15149
+ return service.stop([jobData.key], jobData.folderId, options);
15150
+ },
15151
+ async resume(options) {
15152
+ if (!jobData.key)
15153
+ throw new Error('Job key is undefined');
15154
+ if (!jobData.folderId)
15155
+ throw new Error('Job folderId is undefined');
15156
+ return service.resume(jobData.key, jobData.folderId, options);
15157
+ },
15119
15158
  };
15120
15159
  }
15121
15160
  /**
@@ -15130,6 +15169,8 @@
15130
15169
  return Object.assign({}, jobData, methods);
15131
15170
  }
15132
15171
 
15172
+ /** Maximum number of job keys to resolve in a single OData filter query */
15173
+ const JOB_KEY_RESOLUTION_CHUNK_SIZE = 50;
15133
15174
  /**
15134
15175
  * Maps fields for Job entities to ensure consistent naming
15135
15176
  * Semantic renames only — case conversion handled by pascalToCamelCaseKeys()
@@ -15188,6 +15229,182 @@
15188
15229
  track('Attachments.GetById')
15189
15230
  ], AttachmentService.prototype, "getById", null);
15190
15231
 
15232
+ /**
15233
+ * Enum for package types
15234
+ */
15235
+ exports.PackageType = void 0;
15236
+ (function (PackageType) {
15237
+ PackageType["Undefined"] = "Undefined";
15238
+ PackageType["Process"] = "Process";
15239
+ PackageType["ProcessOrchestration"] = "ProcessOrchestration";
15240
+ PackageType["WebApp"] = "WebApp";
15241
+ PackageType["Agent"] = "Agent";
15242
+ PackageType["TestAutomationProcess"] = "TestAutomationProcess";
15243
+ PackageType["Api"] = "Api";
15244
+ PackageType["MCPServer"] = "MCPServer";
15245
+ PackageType["BusinessRules"] = "BusinessRules";
15246
+ PackageType["CaseManagement"] = "CaseManagement";
15247
+ PackageType["Flow"] = "Flow";
15248
+ PackageType["Function"] = "Function";
15249
+ })(exports.PackageType || (exports.PackageType = {}));
15250
+ /**
15251
+ * Enum for job priority
15252
+ */
15253
+ exports.JobPriority = void 0;
15254
+ (function (JobPriority) {
15255
+ JobPriority["Low"] = "Low";
15256
+ JobPriority["Normal"] = "Normal";
15257
+ JobPriority["High"] = "High";
15258
+ })(exports.JobPriority || (exports.JobPriority = {}));
15259
+ /**
15260
+ * Enum for target framework
15261
+ */
15262
+ exports.TargetFramework = void 0;
15263
+ (function (TargetFramework) {
15264
+ TargetFramework["Legacy"] = "Legacy";
15265
+ TargetFramework["Windows"] = "Windows";
15266
+ TargetFramework["Portable"] = "Portable";
15267
+ })(exports.TargetFramework || (exports.TargetFramework = {}));
15268
+ /**
15269
+ * Enum for robot size
15270
+ */
15271
+ exports.RobotSize = void 0;
15272
+ (function (RobotSize) {
15273
+ RobotSize["Small"] = "Small";
15274
+ RobotSize["Standard"] = "Standard";
15275
+ RobotSize["Medium"] = "Medium";
15276
+ RobotSize["Large"] = "Large";
15277
+ })(exports.RobotSize || (exports.RobotSize = {}));
15278
+ /**
15279
+ * Enum for remote control access
15280
+ */
15281
+ exports.RemoteControlAccess = void 0;
15282
+ (function (RemoteControlAccess) {
15283
+ RemoteControlAccess["None"] = "None";
15284
+ RemoteControlAccess["ReadOnly"] = "ReadOnly";
15285
+ RemoteControlAccess["Full"] = "Full";
15286
+ })(exports.RemoteControlAccess || (exports.RemoteControlAccess = {}));
15287
+ /**
15288
+ * Enum for process start strategy
15289
+ */
15290
+ exports.StartStrategy = void 0;
15291
+ (function (StartStrategy) {
15292
+ StartStrategy["All"] = "All";
15293
+ StartStrategy["Specific"] = "Specific";
15294
+ StartStrategy["RobotCount"] = "RobotCount";
15295
+ StartStrategy["JobsCount"] = "JobsCount";
15296
+ StartStrategy["ModernJobsCount"] = "ModernJobsCount";
15297
+ })(exports.StartStrategy || (exports.StartStrategy = {}));
15298
+ /**
15299
+ * Enum for package source type
15300
+ */
15301
+ exports.PackageSourceType = void 0;
15302
+ (function (PackageSourceType) {
15303
+ PackageSourceType["Manual"] = "Manual";
15304
+ PackageSourceType["Schedule"] = "Schedule";
15305
+ PackageSourceType["Queue"] = "Queue";
15306
+ PackageSourceType["StudioWeb"] = "StudioWeb";
15307
+ PackageSourceType["IntegrationTrigger"] = "IntegrationTrigger";
15308
+ PackageSourceType["StudioDesktop"] = "StudioDesktop";
15309
+ PackageSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
15310
+ PackageSourceType["Apps"] = "Apps";
15311
+ PackageSourceType["SAP"] = "SAP";
15312
+ PackageSourceType["HttpTrigger"] = "HttpTrigger";
15313
+ PackageSourceType["HttpTriggerWithCallback"] = "HttpTriggerWithCallback";
15314
+ PackageSourceType["RobotAPI"] = "RobotAPI";
15315
+ PackageSourceType["Assistant"] = "Assistant";
15316
+ PackageSourceType["CommandLine"] = "CommandLine";
15317
+ PackageSourceType["RobotNetAPI"] = "RobotNetAPI";
15318
+ PackageSourceType["Autopilot"] = "Autopilot";
15319
+ PackageSourceType["TestManager"] = "TestManager";
15320
+ PackageSourceType["AgentService"] = "AgentService";
15321
+ PackageSourceType["ProcessOrchestration"] = "ProcessOrchestration";
15322
+ PackageSourceType["PluginEcosystem"] = "PluginEcosystem";
15323
+ PackageSourceType["PerformanceTesting"] = "PerformanceTesting";
15324
+ PackageSourceType["AgentHub"] = "AgentHub";
15325
+ PackageSourceType["ApiWorkflow"] = "ApiWorkflow";
15326
+ })(exports.PackageSourceType || (exports.PackageSourceType = {}));
15327
+ /**
15328
+ * Enum for job source type
15329
+ */
15330
+ exports.JobSourceType = void 0;
15331
+ (function (JobSourceType) {
15332
+ JobSourceType["Manual"] = "Manual";
15333
+ JobSourceType["Schedule"] = "Schedule";
15334
+ JobSourceType["Agent"] = "Agent";
15335
+ JobSourceType["Queue"] = "Queue";
15336
+ JobSourceType["StudioWeb"] = "StudioWeb";
15337
+ JobSourceType["IntegrationTrigger"] = "IntegrationTrigger";
15338
+ JobSourceType["StudioDesktop"] = "StudioDesktop";
15339
+ JobSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
15340
+ JobSourceType["Apps"] = "Apps";
15341
+ JobSourceType["SAP"] = "SAP";
15342
+ JobSourceType["HttpTrigger"] = "HttpTrigger";
15343
+ JobSourceType["HttpTriggerCallback"] = "HttpTriggerCallback";
15344
+ JobSourceType["RobotAPI"] = "RobotAPI";
15345
+ JobSourceType["CommandLine"] = "CommandLine";
15346
+ JobSourceType["RobotNetAPI"] = "RobotNetAPI";
15347
+ JobSourceType["Autopilot"] = "Autopilot";
15348
+ JobSourceType["TestManager"] = "TestManager";
15349
+ JobSourceType["AgentService"] = "AgentService";
15350
+ JobSourceType["ProcessOrchestration"] = "ProcessOrchestration";
15351
+ JobSourceType["PluginEcosystem"] = "PluginEcosystem";
15352
+ JobSourceType["PerformanceTesting"] = "PerformanceTesting";
15353
+ JobSourceType["AgentHub"] = "AgentHub";
15354
+ JobSourceType["ApiWorkflow"] = "ApiWorkflow";
15355
+ JobSourceType["CaseManagement"] = "CaseManagement";
15356
+ })(exports.JobSourceType || (exports.JobSourceType = {}));
15357
+ /**
15358
+ * Enum for stop strategy
15359
+ */
15360
+ exports.StopStrategy = void 0;
15361
+ (function (StopStrategy) {
15362
+ StopStrategy["SoftStop"] = "SoftStop";
15363
+ StopStrategy["Kill"] = "Kill";
15364
+ })(exports.StopStrategy || (exports.StopStrategy = {}));
15365
+ /**
15366
+ * Enum for runtime type
15367
+ */
15368
+ exports.RuntimeType = void 0;
15369
+ (function (RuntimeType) {
15370
+ RuntimeType["NonProduction"] = "NonProduction";
15371
+ RuntimeType["Attended"] = "Attended";
15372
+ RuntimeType["Unattended"] = "Unattended";
15373
+ RuntimeType["Development"] = "Development";
15374
+ RuntimeType["Studio"] = "Studio";
15375
+ RuntimeType["RpaDeveloper"] = "RpaDeveloper";
15376
+ RuntimeType["StudioX"] = "StudioX";
15377
+ RuntimeType["CitizenDeveloper"] = "CitizenDeveloper";
15378
+ RuntimeType["Headless"] = "Headless";
15379
+ RuntimeType["StudioPro"] = "StudioPro";
15380
+ RuntimeType["RpaDeveloperPro"] = "RpaDeveloperPro";
15381
+ RuntimeType["TestAutomation"] = "TestAutomation";
15382
+ RuntimeType["AutomationCloud"] = "AutomationCloud";
15383
+ RuntimeType["Serverless"] = "Serverless";
15384
+ RuntimeType["AutomationKit"] = "AutomationKit";
15385
+ RuntimeType["ServerlessTestAutomation"] = "ServerlessTestAutomation";
15386
+ RuntimeType["AutomationCloudTestAutomation"] = "AutomationCloudTestAutomation";
15387
+ RuntimeType["AttendedStudioWeb"] = "AttendedStudioWeb";
15388
+ RuntimeType["Hosting"] = "Hosting";
15389
+ RuntimeType["AssistantWeb"] = "AssistantWeb";
15390
+ RuntimeType["ProcessOrchestration"] = "ProcessOrchestration";
15391
+ RuntimeType["AgentService"] = "AgentService";
15392
+ RuntimeType["AppTest"] = "AppTest";
15393
+ RuntimeType["PerformanceTest"] = "PerformanceTest";
15394
+ RuntimeType["BusinessRule"] = "BusinessRule";
15395
+ RuntimeType["CaseManagement"] = "CaseManagement";
15396
+ RuntimeType["Flow"] = "Flow";
15397
+ })(exports.RuntimeType || (exports.RuntimeType = {}));
15398
+ /**
15399
+ * Enum for job type
15400
+ */
15401
+ exports.JobType = void 0;
15402
+ (function (JobType) {
15403
+ JobType["Unattended"] = "Unattended";
15404
+ JobType["Attended"] = "Attended";
15405
+ JobType["ServerlessGeneric"] = "ServerlessGeneric";
15406
+ })(exports.JobType || (exports.JobType = {}));
15407
+
15191
15408
  /**
15192
15409
  * Service for interacting with UiPath Orchestrator Jobs API
15193
15410
  */
@@ -15357,6 +15574,86 @@
15357
15574
  }
15358
15575
  return null;
15359
15576
  }
15577
+ /**
15578
+ * Stops one or more jobs by their UUID keys.
15579
+ *
15580
+ * Sends a stop request for the specified jobs to the Orchestrator. Throws if any keys cannot be resolved.
15581
+ *
15582
+ * @param jobKeys - Array of job UUID keys to stop (e.g., from {@link JobGetResponse}.key)
15583
+ * @param folderId - The folder ID where the jobs reside (required)
15584
+ * @param options - Optional {@link JobStopOptions} including stop strategy
15585
+ * @returns Promise that resolves when the jobs are stopped successfully, or rejects on failure
15586
+ *
15587
+ * @example
15588
+ * ```typescript
15589
+ * // Stop a single job with default soft stop
15590
+ * await jobs.stop([<jobKey>], <folderId>);
15591
+ * ```
15592
+ *
15593
+ * @example
15594
+ * ```typescript
15595
+ * import { StopStrategy } from '@uipath/uipath-typescript/jobs';
15596
+ *
15597
+ * // Force-kill multiple jobs
15598
+ * await jobs.stop(
15599
+ * [<jobKey1>, <jobKey2>],
15600
+ * <folderId>,
15601
+ * { strategy: StopStrategy.Kill }
15602
+ * );
15603
+ * ```
15604
+ */
15605
+ async stop(jobKeys, folderId, options) {
15606
+ if (jobKeys.length === 0) {
15607
+ return;
15608
+ }
15609
+ if (!folderId) {
15610
+ throw new ValidationError({ message: 'folderId is required for stop' });
15611
+ }
15612
+ const headers = createHeaders({ [FOLDER_ID]: folderId });
15613
+ const strategy = options?.strategy ?? exports.StopStrategy.SoftStop;
15614
+ const jobIds = await this.resolveJobKeys(jobKeys, folderId);
15615
+ await this.stopJobsByIds(jobIds, strategy, headers);
15616
+ }
15617
+ /**
15618
+ * Resumes a suspended job.
15619
+ *
15620
+ * Sends a resume request to a job that is currently in the `Suspended` state.
15621
+ * The job transitions to `Resumed` and then to `Running` as it continues execution. Optionally pass
15622
+ * input arguments to provide data for the resumed workflow.
15623
+ *
15624
+ * @param jobKey - The unique key (GUID) of the suspended job to resume
15625
+ * @param folderId - The folder ID where the job resides
15626
+ * @param options - Optional parameters including input arguments
15627
+ * @returns Promise that resolves when the job is resumed successfully, or rejects on failure
15628
+ *
15629
+ * @example
15630
+ * ```typescript
15631
+ * // Resume a suspended job
15632
+ * await jobs.resume(<jobKey>, <folderId>);
15633
+ * ```
15634
+ *
15635
+ * @example
15636
+ * ```typescript
15637
+ * // Resume with input arguments
15638
+ * await jobs.resume(<jobKey>, <folderId>, {
15639
+ * inputArguments: { approved: true }
15640
+ * });
15641
+ * ```
15642
+ */
15643
+ async resume(jobKey, folderId, options) {
15644
+ if (!jobKey) {
15645
+ throw new ValidationError({ message: 'jobKey is required for resume' });
15646
+ }
15647
+ if (!folderId) {
15648
+ throw new ValidationError({ message: 'folderId is required for resume' });
15649
+ }
15650
+ const headers = createHeaders({ [FOLDER_ID]: folderId });
15651
+ const body = { jobKey };
15652
+ if (options?.inputArguments) {
15653
+ body.inputArguments = JSON.stringify(options.inputArguments);
15654
+ }
15655
+ await this.post(JOB_ENDPOINTS.RESUME, body, { headers });
15656
+ }
15360
15657
  /**
15361
15658
  * Downloads the output file content via the Attachments API.
15362
15659
  * 1. Fetches blob access info from the attachment using AttachmentService
@@ -15391,6 +15688,43 @@
15391
15688
  throw new ServerError({ message: 'Failed to parse job output file as JSON' });
15392
15689
  }
15393
15690
  }
15691
+ /**
15692
+ * Resolves job UUID keys to integer IDs via the getAll method.
15693
+ * Chunks keys into batches to avoid URL length limits.
15694
+ */
15695
+ async resolveJobKeys(jobKeys, folderId) {
15696
+ const uniqueKeys = [...new Set(jobKeys)];
15697
+ const keyToIdMap = new Map();
15698
+ const chunks = [];
15699
+ for (let i = 0; i < uniqueKeys.length; i += JOB_KEY_RESOLUTION_CHUNK_SIZE) {
15700
+ chunks.push(uniqueKeys.slice(i, i + JOB_KEY_RESOLUTION_CHUNK_SIZE));
15701
+ }
15702
+ const results = await Promise.all(chunks.map((chunk) => {
15703
+ const filterValues = chunk.map((key) => `'${key}'`).join(',');
15704
+ return this.getAll({
15705
+ folderId,
15706
+ filter: `key in (${filterValues})`,
15707
+ select: 'id,key',
15708
+ pageSize: chunk.length,
15709
+ });
15710
+ }));
15711
+ for (const response of results) {
15712
+ for (const job of response.items) {
15713
+ keyToIdMap.set(job.key, job.id);
15714
+ }
15715
+ }
15716
+ const missingKeys = uniqueKeys.filter((key) => !keyToIdMap.has(key));
15717
+ if (missingKeys.length > 0) {
15718
+ throw new ValidationError({ message: `Jobs not found for keys: ${missingKeys.join(', ')}` });
15719
+ }
15720
+ return uniqueKeys.map((key) => keyToIdMap.get(key));
15721
+ }
15722
+ /**
15723
+ * Calls the StopJobs OData action with resolved integer IDs.
15724
+ */
15725
+ async stopJobsByIds(jobIds, strategy, headers) {
15726
+ await this.post(JOB_ENDPOINTS.STOP, { jobIds, strategy }, { headers });
15727
+ }
15394
15728
  }
15395
15729
  __decorate([
15396
15730
  track('Jobs.GetAll')
@@ -15401,6 +15735,12 @@
15401
15735
  __decorate([
15402
15736
  track('Jobs.GetOutput')
15403
15737
  ], JobService.prototype, "getOutput", null);
15738
+ __decorate([
15739
+ track('Jobs.Stop')
15740
+ ], JobService.prototype, "stop", null);
15741
+ __decorate([
15742
+ track('Jobs.Resume')
15743
+ ], JobService.prototype, "resume", null);
15404
15744
 
15405
15745
  /**
15406
15746
  * Enum for job sub-state
@@ -15611,182 +15951,6 @@
15611
15951
  track('Processes.GetById')
15612
15952
  ], ProcessService.prototype, "getById", null);
15613
15953
 
15614
- /**
15615
- * Enum for package types
15616
- */
15617
- exports.PackageType = void 0;
15618
- (function (PackageType) {
15619
- PackageType["Undefined"] = "Undefined";
15620
- PackageType["Process"] = "Process";
15621
- PackageType["ProcessOrchestration"] = "ProcessOrchestration";
15622
- PackageType["WebApp"] = "WebApp";
15623
- PackageType["Agent"] = "Agent";
15624
- PackageType["TestAutomationProcess"] = "TestAutomationProcess";
15625
- PackageType["Api"] = "Api";
15626
- PackageType["MCPServer"] = "MCPServer";
15627
- PackageType["BusinessRules"] = "BusinessRules";
15628
- PackageType["CaseManagement"] = "CaseManagement";
15629
- PackageType["Flow"] = "Flow";
15630
- PackageType["Function"] = "Function";
15631
- })(exports.PackageType || (exports.PackageType = {}));
15632
- /**
15633
- * Enum for job priority
15634
- */
15635
- exports.JobPriority = void 0;
15636
- (function (JobPriority) {
15637
- JobPriority["Low"] = "Low";
15638
- JobPriority["Normal"] = "Normal";
15639
- JobPriority["High"] = "High";
15640
- })(exports.JobPriority || (exports.JobPriority = {}));
15641
- /**
15642
- * Enum for target framework
15643
- */
15644
- exports.TargetFramework = void 0;
15645
- (function (TargetFramework) {
15646
- TargetFramework["Legacy"] = "Legacy";
15647
- TargetFramework["Windows"] = "Windows";
15648
- TargetFramework["Portable"] = "Portable";
15649
- })(exports.TargetFramework || (exports.TargetFramework = {}));
15650
- /**
15651
- * Enum for robot size
15652
- */
15653
- exports.RobotSize = void 0;
15654
- (function (RobotSize) {
15655
- RobotSize["Small"] = "Small";
15656
- RobotSize["Standard"] = "Standard";
15657
- RobotSize["Medium"] = "Medium";
15658
- RobotSize["Large"] = "Large";
15659
- })(exports.RobotSize || (exports.RobotSize = {}));
15660
- /**
15661
- * Enum for remote control access
15662
- */
15663
- exports.RemoteControlAccess = void 0;
15664
- (function (RemoteControlAccess) {
15665
- RemoteControlAccess["None"] = "None";
15666
- RemoteControlAccess["ReadOnly"] = "ReadOnly";
15667
- RemoteControlAccess["Full"] = "Full";
15668
- })(exports.RemoteControlAccess || (exports.RemoteControlAccess = {}));
15669
- /**
15670
- * Enum for process start strategy
15671
- */
15672
- exports.StartStrategy = void 0;
15673
- (function (StartStrategy) {
15674
- StartStrategy["All"] = "All";
15675
- StartStrategy["Specific"] = "Specific";
15676
- StartStrategy["RobotCount"] = "RobotCount";
15677
- StartStrategy["JobsCount"] = "JobsCount";
15678
- StartStrategy["ModernJobsCount"] = "ModernJobsCount";
15679
- })(exports.StartStrategy || (exports.StartStrategy = {}));
15680
- /**
15681
- * Enum for package source type
15682
- */
15683
- exports.PackageSourceType = void 0;
15684
- (function (PackageSourceType) {
15685
- PackageSourceType["Manual"] = "Manual";
15686
- PackageSourceType["Schedule"] = "Schedule";
15687
- PackageSourceType["Queue"] = "Queue";
15688
- PackageSourceType["StudioWeb"] = "StudioWeb";
15689
- PackageSourceType["IntegrationTrigger"] = "IntegrationTrigger";
15690
- PackageSourceType["StudioDesktop"] = "StudioDesktop";
15691
- PackageSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
15692
- PackageSourceType["Apps"] = "Apps";
15693
- PackageSourceType["SAP"] = "SAP";
15694
- PackageSourceType["HttpTrigger"] = "HttpTrigger";
15695
- PackageSourceType["HttpTriggerWithCallback"] = "HttpTriggerWithCallback";
15696
- PackageSourceType["RobotAPI"] = "RobotAPI";
15697
- PackageSourceType["Assistant"] = "Assistant";
15698
- PackageSourceType["CommandLine"] = "CommandLine";
15699
- PackageSourceType["RobotNetAPI"] = "RobotNetAPI";
15700
- PackageSourceType["Autopilot"] = "Autopilot";
15701
- PackageSourceType["TestManager"] = "TestManager";
15702
- PackageSourceType["AgentService"] = "AgentService";
15703
- PackageSourceType["ProcessOrchestration"] = "ProcessOrchestration";
15704
- PackageSourceType["PluginEcosystem"] = "PluginEcosystem";
15705
- PackageSourceType["PerformanceTesting"] = "PerformanceTesting";
15706
- PackageSourceType["AgentHub"] = "AgentHub";
15707
- PackageSourceType["ApiWorkflow"] = "ApiWorkflow";
15708
- })(exports.PackageSourceType || (exports.PackageSourceType = {}));
15709
- /**
15710
- * Enum for job source type
15711
- */
15712
- exports.JobSourceType = void 0;
15713
- (function (JobSourceType) {
15714
- JobSourceType["Manual"] = "Manual";
15715
- JobSourceType["Schedule"] = "Schedule";
15716
- JobSourceType["Agent"] = "Agent";
15717
- JobSourceType["Queue"] = "Queue";
15718
- JobSourceType["StudioWeb"] = "StudioWeb";
15719
- JobSourceType["IntegrationTrigger"] = "IntegrationTrigger";
15720
- JobSourceType["StudioDesktop"] = "StudioDesktop";
15721
- JobSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
15722
- JobSourceType["Apps"] = "Apps";
15723
- JobSourceType["SAP"] = "SAP";
15724
- JobSourceType["HttpTrigger"] = "HttpTrigger";
15725
- JobSourceType["HttpTriggerCallback"] = "HttpTriggerCallback";
15726
- JobSourceType["RobotAPI"] = "RobotAPI";
15727
- JobSourceType["CommandLine"] = "CommandLine";
15728
- JobSourceType["RobotNetAPI"] = "RobotNetAPI";
15729
- JobSourceType["Autopilot"] = "Autopilot";
15730
- JobSourceType["TestManager"] = "TestManager";
15731
- JobSourceType["AgentService"] = "AgentService";
15732
- JobSourceType["ProcessOrchestration"] = "ProcessOrchestration";
15733
- JobSourceType["PluginEcosystem"] = "PluginEcosystem";
15734
- JobSourceType["PerformanceTesting"] = "PerformanceTesting";
15735
- JobSourceType["AgentHub"] = "AgentHub";
15736
- JobSourceType["ApiWorkflow"] = "ApiWorkflow";
15737
- JobSourceType["CaseManagement"] = "CaseManagement";
15738
- })(exports.JobSourceType || (exports.JobSourceType = {}));
15739
- /**
15740
- * Enum for stop strategy
15741
- */
15742
- exports.StopStrategy = void 0;
15743
- (function (StopStrategy) {
15744
- StopStrategy["SoftStop"] = "SoftStop";
15745
- StopStrategy["Kill"] = "Kill";
15746
- })(exports.StopStrategy || (exports.StopStrategy = {}));
15747
- /**
15748
- * Enum for runtime type
15749
- */
15750
- exports.RuntimeType = void 0;
15751
- (function (RuntimeType) {
15752
- RuntimeType["NonProduction"] = "NonProduction";
15753
- RuntimeType["Attended"] = "Attended";
15754
- RuntimeType["Unattended"] = "Unattended";
15755
- RuntimeType["Development"] = "Development";
15756
- RuntimeType["Studio"] = "Studio";
15757
- RuntimeType["RpaDeveloper"] = "RpaDeveloper";
15758
- RuntimeType["StudioX"] = "StudioX";
15759
- RuntimeType["CitizenDeveloper"] = "CitizenDeveloper";
15760
- RuntimeType["Headless"] = "Headless";
15761
- RuntimeType["StudioPro"] = "StudioPro";
15762
- RuntimeType["RpaDeveloperPro"] = "RpaDeveloperPro";
15763
- RuntimeType["TestAutomation"] = "TestAutomation";
15764
- RuntimeType["AutomationCloud"] = "AutomationCloud";
15765
- RuntimeType["Serverless"] = "Serverless";
15766
- RuntimeType["AutomationKit"] = "AutomationKit";
15767
- RuntimeType["ServerlessTestAutomation"] = "ServerlessTestAutomation";
15768
- RuntimeType["AutomationCloudTestAutomation"] = "AutomationCloudTestAutomation";
15769
- RuntimeType["AttendedStudioWeb"] = "AttendedStudioWeb";
15770
- RuntimeType["Hosting"] = "Hosting";
15771
- RuntimeType["AssistantWeb"] = "AssistantWeb";
15772
- RuntimeType["ProcessOrchestration"] = "ProcessOrchestration";
15773
- RuntimeType["AgentService"] = "AgentService";
15774
- RuntimeType["AppTest"] = "AppTest";
15775
- RuntimeType["PerformanceTest"] = "PerformanceTest";
15776
- RuntimeType["BusinessRule"] = "BusinessRule";
15777
- RuntimeType["CaseManagement"] = "CaseManagement";
15778
- RuntimeType["Flow"] = "Flow";
15779
- })(exports.RuntimeType || (exports.RuntimeType = {}));
15780
- /**
15781
- * Enum for job type
15782
- */
15783
- exports.JobType = void 0;
15784
- (function (JobType) {
15785
- JobType["Unattended"] = "Unattended";
15786
- JobType["Attended"] = "Attended";
15787
- JobType["ServerlessGeneric"] = "ServerlessGeneric";
15788
- })(exports.JobType || (exports.JobType = {}));
15789
-
15790
15954
  /**
15791
15955
  * Maps fields for Queue entities to ensure consistent naming
15792
15956
  */
@@ -16272,6 +16436,19 @@
16272
16436
  ...CommonFieldMap
16273
16437
  };
16274
16438
 
16439
+ /**
16440
+ * Status of a feedback entry in the review workflow
16441
+ */
16442
+ exports.FeedbackStatus = void 0;
16443
+ (function (FeedbackStatus) {
16444
+ /** Feedback is awaiting review */
16445
+ FeedbackStatus[FeedbackStatus["Pending"] = 0] = "Pending";
16446
+ /** Feedback has been approved and confirmed */
16447
+ FeedbackStatus[FeedbackStatus["Approved"] = 1] = "Approved";
16448
+ /** Feedback has been dismissed */
16449
+ FeedbackStatus[FeedbackStatus["Dismissed"] = 2] = "Dismissed";
16450
+ })(exports.FeedbackStatus || (exports.FeedbackStatus = {}));
16451
+
16275
16452
  /**
16276
16453
  * Asset resolution utilities for UiPath Coded Apps
16277
16454
  *