@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.mjs CHANGED
@@ -4385,6 +4385,21 @@ function getErrorDetails(error) {
4385
4385
  };
4386
4386
  }
4387
4387
 
4388
+ var TaskUserType;
4389
+ (function (TaskUserType) {
4390
+ /** A user of this type is supposed to be used by a human. */
4391
+ TaskUserType["User"] = "User";
4392
+ /** 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. */
4393
+ TaskUserType["Robot"] = "Robot";
4394
+ /** A user of type Directory User */
4395
+ TaskUserType["DirectoryUser"] = "DirectoryUser";
4396
+ /** A user of type Directory Group */
4397
+ TaskUserType["DirectoryGroup"] = "DirectoryGroup";
4398
+ /** A user of type Directory Robot Account */
4399
+ TaskUserType["DirectoryRobot"] = "DirectoryRobot";
4400
+ /** A user of type Directory External Application */
4401
+ TaskUserType["DirectoryExternalApplication"] = "DirectoryExternalApplication";
4402
+ })(TaskUserType || (TaskUserType = {}));
4388
4403
  /**
4389
4404
  * Types of tasks available in Action Center.
4390
4405
  * Each type determines the task's behavior, UI rendering, and completion requirements.
@@ -4519,6 +4534,8 @@ const QUEUE_ENDPOINTS = {
4519
4534
  const JOB_ENDPOINTS = {
4520
4535
  GET_ALL: `${ORCHESTRATOR_BASE}/odata/Jobs`,
4521
4536
  GET_BY_KEY: (identifier) => `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.GetByKey(identifier=${identifier})`,
4537
+ STOP: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.StopJobs`,
4538
+ RESUME: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.ResumeJob`,
4522
4539
  };
4523
4540
  /**
4524
4541
  * Orchestrator Asset Service Endpoints
@@ -5002,6 +5019,7 @@ class TokenManager {
5002
5019
  }
5003
5020
  }
5004
5021
 
5022
+ const GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
5005
5023
  class AuthService {
5006
5024
  constructor(config, executionContext) {
5007
5025
  // Only use stored OAuth context when completing an active callback (URL has ?code=).
@@ -5285,6 +5303,8 @@ class AuthService {
5285
5303
  */
5286
5304
  getAuthorizationUrl(params) {
5287
5305
  const orgName = this.config.orgName;
5306
+ const isGuid = GUID_REGEX.test(orgName);
5307
+ const acrValues = isGuid ? `tenant:${orgName}` : `tenantName:${orgName}`;
5288
5308
  const queryParams = new URLSearchParams({
5289
5309
  response_type: 'code',
5290
5310
  client_id: params.clientId,
@@ -5294,13 +5314,12 @@ class AuthService {
5294
5314
  scope: params.scope + ' offline_access',
5295
5315
  state: params.state || this.generateCodeVerifier().slice(0, 16)
5296
5316
  });
5297
- return `${this.config.baseUrl}/${orgName}/${IDENTITY_ENDPOINTS.AUTHORIZE}?${queryParams.toString()}`;
5317
+ return `${this.config.baseUrl}/${IDENTITY_ENDPOINTS.AUTHORIZE}?${queryParams.toString()}&acr_values=${acrValues}`;
5298
5318
  }
5299
5319
  /**
5300
5320
  * Exchanges the authorization code for an access token and automatically updates the current token
5301
5321
  */
5302
5322
  async _getAccessToken(params) {
5303
- const orgName = this.config.orgName;
5304
5323
  const body = new URLSearchParams({
5305
5324
  grant_type: 'authorization_code',
5306
5325
  client_id: params.clientId,
@@ -5308,7 +5327,7 @@ class AuthService {
5308
5327
  redirect_uri: params.redirectUri,
5309
5328
  code_verifier: params.codeVerifier
5310
5329
  });
5311
- const response = await fetch(`${this.config.baseUrl}/${orgName}/${IDENTITY_ENDPOINTS.TOKEN}`, {
5330
+ const response = await fetch(`${this.config.baseUrl}/${IDENTITY_ENDPOINTS.TOKEN}`, {
5312
5331
  method: 'POST',
5313
5332
  headers: {
5314
5333
  'Content-Type': 'application/x-www-form-urlencoded'
@@ -5429,7 +5448,7 @@ function normalizeBaseUrl(url) {
5429
5448
  // Connection string placeholder that will be replaced during build
5430
5449
  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";
5431
5450
  // SDK Version placeholder
5432
- const SDK_VERSION = "1.3.1";
5451
+ const SDK_VERSION = "1.3.3";
5433
5452
  const VERSION = "Version";
5434
5453
  const SERVICE = "Service";
5435
5454
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -6358,7 +6377,11 @@ class ApiClient {
6358
6377
  const text = await response.text();
6359
6378
  return text;
6360
6379
  }
6361
- return response.json();
6380
+ const text = await response.text();
6381
+ if (!text) {
6382
+ return undefined;
6383
+ }
6384
+ return JSON.parse(text);
6362
6385
  }
6363
6386
  catch (error) {
6364
6387
  // If it's already one of our errors, re-throw it
@@ -7261,8 +7284,9 @@ class PaginationHelpers {
7261
7284
  });
7262
7285
  }
7263
7286
  // Extract and transform items from response
7264
- const rawItems = response.data?.[itemsField];
7265
- const totalCount = response.data?.[totalCountField];
7287
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
7288
+ const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
7289
+ const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
7266
7290
  // Parse items - automatically handle JSON string responses
7267
7291
  const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
7268
7292
  const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
@@ -7458,7 +7482,7 @@ class BaseService {
7458
7482
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
7459
7483
  // Prepare request parameters based on pagination type
7460
7484
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
7461
- // For POST requests, merge pagination params into body; for GET, use query params
7485
+ // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
7462
7486
  if (method.toUpperCase() === 'POST') {
7463
7487
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
7464
7488
  options.body = {
@@ -7466,6 +7490,7 @@ class BaseService {
7466
7490
  ...options.params,
7467
7491
  ...requestParams
7468
7492
  };
7493
+ options.params = undefined;
7469
7494
  }
7470
7495
  else {
7471
7496
  // Merge pagination parameters with existing parameters
@@ -7506,7 +7531,6 @@ class BaseService {
7506
7531
  if (params.pageNumber && params.pageNumber > 1) {
7507
7532
  requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
7508
7533
  }
7509
- // Include total count for ODATA APIs
7510
7534
  {
7511
7535
  requestParams[countParam] = true;
7512
7536
  }
@@ -7534,8 +7558,9 @@ class BaseService {
7534
7558
  const totalCountField = fields.totalCountField || 'totalRecordCount';
7535
7559
  const continuationTokenField = fields.continuationTokenField || 'continuationToken';
7536
7560
  // Extract items and metadata
7537
- const items = response.data[itemsField] || [];
7538
- const totalCount = response.data[totalCountField];
7561
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
7562
+ const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
7563
+ const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
7539
7564
  const continuationToken = response.data[continuationTokenField];
7540
7565
  // Determine if there are more pages
7541
7566
  const hasMore = this.determineHasMorePages(paginationType, {
@@ -9932,15 +9957,15 @@ class TaskService extends BaseService {
9932
9957
  return createTaskWithMethods(transformedData, this);
9933
9958
  }
9934
9959
  /**
9935
- * Gets users in the given folder who have Tasks.View and Tasks.Edit permissions
9960
+ * Gets task users (users, robots, groups etc) in the given folder who have Tasks.View and Tasks.Edit permissions
9936
9961
  *
9937
9962
  * The method returns either:
9938
- * - An array of users (when no pagination parameters are provided)
9963
+ * - An array of task users (when no pagination parameters are provided)
9939
9964
  * - A paginated result with navigation cursors (when any pagination parameter is provided)
9940
9965
  *
9941
- * @param folderId - The folder ID to get users from
9966
+ * @param folderId - The folder ID to get task users from
9942
9967
  * @param options - Optional query and pagination parameters
9943
- * @returns Promise resolving to an array of users or paginated result
9968
+ * @returns Promise resolving to an array of task users or paginated result
9944
9969
  *
9945
9970
  * @example
9946
9971
  * ```typescript
@@ -9951,7 +9976,7 @@ class TaskService extends BaseService {
9951
9976
  * // Standard array return
9952
9977
  * const users = await tasks.getUsers(123);
9953
9978
  *
9954
- * // Get users with filtering
9979
+ * // Get task users with filtering
9955
9980
  * const users = await tasks.getUsers(123, {
9956
9981
  * filter: "name eq 'abc'"
9957
9982
  * });
@@ -11357,6 +11382,20 @@ function createJobMethods(jobData, service) {
11357
11382
  throw new Error('Job folderId is undefined');
11358
11383
  return service.getOutput(jobData.key, jobData.folderId);
11359
11384
  },
11385
+ async stop(options) {
11386
+ if (!jobData.key)
11387
+ throw new Error('Job key is undefined');
11388
+ if (!jobData.folderId)
11389
+ throw new Error('Job folderId is undefined');
11390
+ return service.stop([jobData.key], jobData.folderId, options);
11391
+ },
11392
+ async resume(options) {
11393
+ if (!jobData.key)
11394
+ throw new Error('Job key is undefined');
11395
+ if (!jobData.folderId)
11396
+ throw new Error('Job folderId is undefined');
11397
+ return service.resume(jobData.key, jobData.folderId, options);
11398
+ },
11360
11399
  };
11361
11400
  }
11362
11401
  /**
@@ -11371,6 +11410,8 @@ function createJobWithMethods(jobData, service) {
11371
11410
  return Object.assign({}, jobData, methods);
11372
11411
  }
11373
11412
 
11413
+ /** Maximum number of job keys to resolve in a single OData filter query */
11414
+ const JOB_KEY_RESOLUTION_CHUNK_SIZE = 50;
11374
11415
  /**
11375
11416
  * Maps fields for Job entities to ensure consistent naming
11376
11417
  * Semantic renames only — case conversion handled by pascalToCamelCaseKeys()
@@ -11429,6 +11470,182 @@ __decorate([
11429
11470
  track('Attachments.GetById')
11430
11471
  ], AttachmentService.prototype, "getById", null);
11431
11472
 
11473
+ /**
11474
+ * Enum for package types
11475
+ */
11476
+ var PackageType;
11477
+ (function (PackageType) {
11478
+ PackageType["Undefined"] = "Undefined";
11479
+ PackageType["Process"] = "Process";
11480
+ PackageType["ProcessOrchestration"] = "ProcessOrchestration";
11481
+ PackageType["WebApp"] = "WebApp";
11482
+ PackageType["Agent"] = "Agent";
11483
+ PackageType["TestAutomationProcess"] = "TestAutomationProcess";
11484
+ PackageType["Api"] = "Api";
11485
+ PackageType["MCPServer"] = "MCPServer";
11486
+ PackageType["BusinessRules"] = "BusinessRules";
11487
+ PackageType["CaseManagement"] = "CaseManagement";
11488
+ PackageType["Flow"] = "Flow";
11489
+ PackageType["Function"] = "Function";
11490
+ })(PackageType || (PackageType = {}));
11491
+ /**
11492
+ * Enum for job priority
11493
+ */
11494
+ var JobPriority;
11495
+ (function (JobPriority) {
11496
+ JobPriority["Low"] = "Low";
11497
+ JobPriority["Normal"] = "Normal";
11498
+ JobPriority["High"] = "High";
11499
+ })(JobPriority || (JobPriority = {}));
11500
+ /**
11501
+ * Enum for target framework
11502
+ */
11503
+ var TargetFramework;
11504
+ (function (TargetFramework) {
11505
+ TargetFramework["Legacy"] = "Legacy";
11506
+ TargetFramework["Windows"] = "Windows";
11507
+ TargetFramework["Portable"] = "Portable";
11508
+ })(TargetFramework || (TargetFramework = {}));
11509
+ /**
11510
+ * Enum for robot size
11511
+ */
11512
+ var RobotSize;
11513
+ (function (RobotSize) {
11514
+ RobotSize["Small"] = "Small";
11515
+ RobotSize["Standard"] = "Standard";
11516
+ RobotSize["Medium"] = "Medium";
11517
+ RobotSize["Large"] = "Large";
11518
+ })(RobotSize || (RobotSize = {}));
11519
+ /**
11520
+ * Enum for remote control access
11521
+ */
11522
+ var RemoteControlAccess;
11523
+ (function (RemoteControlAccess) {
11524
+ RemoteControlAccess["None"] = "None";
11525
+ RemoteControlAccess["ReadOnly"] = "ReadOnly";
11526
+ RemoteControlAccess["Full"] = "Full";
11527
+ })(RemoteControlAccess || (RemoteControlAccess = {}));
11528
+ /**
11529
+ * Enum for process start strategy
11530
+ */
11531
+ var StartStrategy;
11532
+ (function (StartStrategy) {
11533
+ StartStrategy["All"] = "All";
11534
+ StartStrategy["Specific"] = "Specific";
11535
+ StartStrategy["RobotCount"] = "RobotCount";
11536
+ StartStrategy["JobsCount"] = "JobsCount";
11537
+ StartStrategy["ModernJobsCount"] = "ModernJobsCount";
11538
+ })(StartStrategy || (StartStrategy = {}));
11539
+ /**
11540
+ * Enum for package source type
11541
+ */
11542
+ var PackageSourceType;
11543
+ (function (PackageSourceType) {
11544
+ PackageSourceType["Manual"] = "Manual";
11545
+ PackageSourceType["Schedule"] = "Schedule";
11546
+ PackageSourceType["Queue"] = "Queue";
11547
+ PackageSourceType["StudioWeb"] = "StudioWeb";
11548
+ PackageSourceType["IntegrationTrigger"] = "IntegrationTrigger";
11549
+ PackageSourceType["StudioDesktop"] = "StudioDesktop";
11550
+ PackageSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
11551
+ PackageSourceType["Apps"] = "Apps";
11552
+ PackageSourceType["SAP"] = "SAP";
11553
+ PackageSourceType["HttpTrigger"] = "HttpTrigger";
11554
+ PackageSourceType["HttpTriggerWithCallback"] = "HttpTriggerWithCallback";
11555
+ PackageSourceType["RobotAPI"] = "RobotAPI";
11556
+ PackageSourceType["Assistant"] = "Assistant";
11557
+ PackageSourceType["CommandLine"] = "CommandLine";
11558
+ PackageSourceType["RobotNetAPI"] = "RobotNetAPI";
11559
+ PackageSourceType["Autopilot"] = "Autopilot";
11560
+ PackageSourceType["TestManager"] = "TestManager";
11561
+ PackageSourceType["AgentService"] = "AgentService";
11562
+ PackageSourceType["ProcessOrchestration"] = "ProcessOrchestration";
11563
+ PackageSourceType["PluginEcosystem"] = "PluginEcosystem";
11564
+ PackageSourceType["PerformanceTesting"] = "PerformanceTesting";
11565
+ PackageSourceType["AgentHub"] = "AgentHub";
11566
+ PackageSourceType["ApiWorkflow"] = "ApiWorkflow";
11567
+ })(PackageSourceType || (PackageSourceType = {}));
11568
+ /**
11569
+ * Enum for job source type
11570
+ */
11571
+ var JobSourceType;
11572
+ (function (JobSourceType) {
11573
+ JobSourceType["Manual"] = "Manual";
11574
+ JobSourceType["Schedule"] = "Schedule";
11575
+ JobSourceType["Agent"] = "Agent";
11576
+ JobSourceType["Queue"] = "Queue";
11577
+ JobSourceType["StudioWeb"] = "StudioWeb";
11578
+ JobSourceType["IntegrationTrigger"] = "IntegrationTrigger";
11579
+ JobSourceType["StudioDesktop"] = "StudioDesktop";
11580
+ JobSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
11581
+ JobSourceType["Apps"] = "Apps";
11582
+ JobSourceType["SAP"] = "SAP";
11583
+ JobSourceType["HttpTrigger"] = "HttpTrigger";
11584
+ JobSourceType["HttpTriggerCallback"] = "HttpTriggerCallback";
11585
+ JobSourceType["RobotAPI"] = "RobotAPI";
11586
+ JobSourceType["CommandLine"] = "CommandLine";
11587
+ JobSourceType["RobotNetAPI"] = "RobotNetAPI";
11588
+ JobSourceType["Autopilot"] = "Autopilot";
11589
+ JobSourceType["TestManager"] = "TestManager";
11590
+ JobSourceType["AgentService"] = "AgentService";
11591
+ JobSourceType["ProcessOrchestration"] = "ProcessOrchestration";
11592
+ JobSourceType["PluginEcosystem"] = "PluginEcosystem";
11593
+ JobSourceType["PerformanceTesting"] = "PerformanceTesting";
11594
+ JobSourceType["AgentHub"] = "AgentHub";
11595
+ JobSourceType["ApiWorkflow"] = "ApiWorkflow";
11596
+ JobSourceType["CaseManagement"] = "CaseManagement";
11597
+ })(JobSourceType || (JobSourceType = {}));
11598
+ /**
11599
+ * Enum for stop strategy
11600
+ */
11601
+ var StopStrategy;
11602
+ (function (StopStrategy) {
11603
+ StopStrategy["SoftStop"] = "SoftStop";
11604
+ StopStrategy["Kill"] = "Kill";
11605
+ })(StopStrategy || (StopStrategy = {}));
11606
+ /**
11607
+ * Enum for runtime type
11608
+ */
11609
+ var RuntimeType;
11610
+ (function (RuntimeType) {
11611
+ RuntimeType["NonProduction"] = "NonProduction";
11612
+ RuntimeType["Attended"] = "Attended";
11613
+ RuntimeType["Unattended"] = "Unattended";
11614
+ RuntimeType["Development"] = "Development";
11615
+ RuntimeType["Studio"] = "Studio";
11616
+ RuntimeType["RpaDeveloper"] = "RpaDeveloper";
11617
+ RuntimeType["StudioX"] = "StudioX";
11618
+ RuntimeType["CitizenDeveloper"] = "CitizenDeveloper";
11619
+ RuntimeType["Headless"] = "Headless";
11620
+ RuntimeType["StudioPro"] = "StudioPro";
11621
+ RuntimeType["RpaDeveloperPro"] = "RpaDeveloperPro";
11622
+ RuntimeType["TestAutomation"] = "TestAutomation";
11623
+ RuntimeType["AutomationCloud"] = "AutomationCloud";
11624
+ RuntimeType["Serverless"] = "Serverless";
11625
+ RuntimeType["AutomationKit"] = "AutomationKit";
11626
+ RuntimeType["ServerlessTestAutomation"] = "ServerlessTestAutomation";
11627
+ RuntimeType["AutomationCloudTestAutomation"] = "AutomationCloudTestAutomation";
11628
+ RuntimeType["AttendedStudioWeb"] = "AttendedStudioWeb";
11629
+ RuntimeType["Hosting"] = "Hosting";
11630
+ RuntimeType["AssistantWeb"] = "AssistantWeb";
11631
+ RuntimeType["ProcessOrchestration"] = "ProcessOrchestration";
11632
+ RuntimeType["AgentService"] = "AgentService";
11633
+ RuntimeType["AppTest"] = "AppTest";
11634
+ RuntimeType["PerformanceTest"] = "PerformanceTest";
11635
+ RuntimeType["BusinessRule"] = "BusinessRule";
11636
+ RuntimeType["CaseManagement"] = "CaseManagement";
11637
+ RuntimeType["Flow"] = "Flow";
11638
+ })(RuntimeType || (RuntimeType = {}));
11639
+ /**
11640
+ * Enum for job type
11641
+ */
11642
+ var JobType;
11643
+ (function (JobType) {
11644
+ JobType["Unattended"] = "Unattended";
11645
+ JobType["Attended"] = "Attended";
11646
+ JobType["ServerlessGeneric"] = "ServerlessGeneric";
11647
+ })(JobType || (JobType = {}));
11648
+
11432
11649
  /**
11433
11650
  * Service for interacting with UiPath Orchestrator Jobs API
11434
11651
  */
@@ -11598,6 +11815,86 @@ class JobService extends FolderScopedService {
11598
11815
  }
11599
11816
  return null;
11600
11817
  }
11818
+ /**
11819
+ * Stops one or more jobs by their UUID keys.
11820
+ *
11821
+ * Sends a stop request for the specified jobs to the Orchestrator. Throws if any keys cannot be resolved.
11822
+ *
11823
+ * @param jobKeys - Array of job UUID keys to stop (e.g., from {@link JobGetResponse}.key)
11824
+ * @param folderId - The folder ID where the jobs reside (required)
11825
+ * @param options - Optional {@link JobStopOptions} including stop strategy
11826
+ * @returns Promise that resolves when the jobs are stopped successfully, or rejects on failure
11827
+ *
11828
+ * @example
11829
+ * ```typescript
11830
+ * // Stop a single job with default soft stop
11831
+ * await jobs.stop([<jobKey>], <folderId>);
11832
+ * ```
11833
+ *
11834
+ * @example
11835
+ * ```typescript
11836
+ * import { StopStrategy } from '@uipath/uipath-typescript/jobs';
11837
+ *
11838
+ * // Force-kill multiple jobs
11839
+ * await jobs.stop(
11840
+ * [<jobKey1>, <jobKey2>],
11841
+ * <folderId>,
11842
+ * { strategy: StopStrategy.Kill }
11843
+ * );
11844
+ * ```
11845
+ */
11846
+ async stop(jobKeys, folderId, options) {
11847
+ if (jobKeys.length === 0) {
11848
+ return;
11849
+ }
11850
+ if (!folderId) {
11851
+ throw new ValidationError({ message: 'folderId is required for stop' });
11852
+ }
11853
+ const headers = createHeaders({ [FOLDER_ID]: folderId });
11854
+ const strategy = options?.strategy ?? StopStrategy.SoftStop;
11855
+ const jobIds = await this.resolveJobKeys(jobKeys, folderId);
11856
+ await this.stopJobsByIds(jobIds, strategy, headers);
11857
+ }
11858
+ /**
11859
+ * Resumes a suspended job.
11860
+ *
11861
+ * Sends a resume request to a job that is currently in the `Suspended` state.
11862
+ * The job transitions to `Resumed` and then to `Running` as it continues execution. Optionally pass
11863
+ * input arguments to provide data for the resumed workflow.
11864
+ *
11865
+ * @param jobKey - The unique key (GUID) of the suspended job to resume
11866
+ * @param folderId - The folder ID where the job resides
11867
+ * @param options - Optional parameters including input arguments
11868
+ * @returns Promise that resolves when the job is resumed successfully, or rejects on failure
11869
+ *
11870
+ * @example
11871
+ * ```typescript
11872
+ * // Resume a suspended job
11873
+ * await jobs.resume(<jobKey>, <folderId>);
11874
+ * ```
11875
+ *
11876
+ * @example
11877
+ * ```typescript
11878
+ * // Resume with input arguments
11879
+ * await jobs.resume(<jobKey>, <folderId>, {
11880
+ * inputArguments: { approved: true }
11881
+ * });
11882
+ * ```
11883
+ */
11884
+ async resume(jobKey, folderId, options) {
11885
+ if (!jobKey) {
11886
+ throw new ValidationError({ message: 'jobKey is required for resume' });
11887
+ }
11888
+ if (!folderId) {
11889
+ throw new ValidationError({ message: 'folderId is required for resume' });
11890
+ }
11891
+ const headers = createHeaders({ [FOLDER_ID]: folderId });
11892
+ const body = { jobKey };
11893
+ if (options?.inputArguments) {
11894
+ body.inputArguments = JSON.stringify(options.inputArguments);
11895
+ }
11896
+ await this.post(JOB_ENDPOINTS.RESUME, body, { headers });
11897
+ }
11601
11898
  /**
11602
11899
  * Downloads the output file content via the Attachments API.
11603
11900
  * 1. Fetches blob access info from the attachment using AttachmentService
@@ -11632,6 +11929,43 @@ class JobService extends FolderScopedService {
11632
11929
  throw new ServerError({ message: 'Failed to parse job output file as JSON' });
11633
11930
  }
11634
11931
  }
11932
+ /**
11933
+ * Resolves job UUID keys to integer IDs via the getAll method.
11934
+ * Chunks keys into batches to avoid URL length limits.
11935
+ */
11936
+ async resolveJobKeys(jobKeys, folderId) {
11937
+ const uniqueKeys = [...new Set(jobKeys)];
11938
+ const keyToIdMap = new Map();
11939
+ const chunks = [];
11940
+ for (let i = 0; i < uniqueKeys.length; i += JOB_KEY_RESOLUTION_CHUNK_SIZE) {
11941
+ chunks.push(uniqueKeys.slice(i, i + JOB_KEY_RESOLUTION_CHUNK_SIZE));
11942
+ }
11943
+ const results = await Promise.all(chunks.map((chunk) => {
11944
+ const filterValues = chunk.map((key) => `'${key}'`).join(',');
11945
+ return this.getAll({
11946
+ folderId,
11947
+ filter: `key in (${filterValues})`,
11948
+ select: 'id,key',
11949
+ pageSize: chunk.length,
11950
+ });
11951
+ }));
11952
+ for (const response of results) {
11953
+ for (const job of response.items) {
11954
+ keyToIdMap.set(job.key, job.id);
11955
+ }
11956
+ }
11957
+ const missingKeys = uniqueKeys.filter((key) => !keyToIdMap.has(key));
11958
+ if (missingKeys.length > 0) {
11959
+ throw new ValidationError({ message: `Jobs not found for keys: ${missingKeys.join(', ')}` });
11960
+ }
11961
+ return uniqueKeys.map((key) => keyToIdMap.get(key));
11962
+ }
11963
+ /**
11964
+ * Calls the StopJobs OData action with resolved integer IDs.
11965
+ */
11966
+ async stopJobsByIds(jobIds, strategy, headers) {
11967
+ await this.post(JOB_ENDPOINTS.STOP, { jobIds, strategy }, { headers });
11968
+ }
11635
11969
  }
11636
11970
  __decorate([
11637
11971
  track('Jobs.GetAll')
@@ -11642,6 +11976,12 @@ __decorate([
11642
11976
  __decorate([
11643
11977
  track('Jobs.GetOutput')
11644
11978
  ], JobService.prototype, "getOutput", null);
11979
+ __decorate([
11980
+ track('Jobs.Stop')
11981
+ ], JobService.prototype, "stop", null);
11982
+ __decorate([
11983
+ track('Jobs.Resume')
11984
+ ], JobService.prototype, "resume", null);
11645
11985
 
11646
11986
  /**
11647
11987
  * Enum for job sub-state
@@ -11852,182 +12192,6 @@ __decorate([
11852
12192
  track('Processes.GetById')
11853
12193
  ], ProcessService.prototype, "getById", null);
11854
12194
 
11855
- /**
11856
- * Enum for package types
11857
- */
11858
- var PackageType;
11859
- (function (PackageType) {
11860
- PackageType["Undefined"] = "Undefined";
11861
- PackageType["Process"] = "Process";
11862
- PackageType["ProcessOrchestration"] = "ProcessOrchestration";
11863
- PackageType["WebApp"] = "WebApp";
11864
- PackageType["Agent"] = "Agent";
11865
- PackageType["TestAutomationProcess"] = "TestAutomationProcess";
11866
- PackageType["Api"] = "Api";
11867
- PackageType["MCPServer"] = "MCPServer";
11868
- PackageType["BusinessRules"] = "BusinessRules";
11869
- PackageType["CaseManagement"] = "CaseManagement";
11870
- PackageType["Flow"] = "Flow";
11871
- PackageType["Function"] = "Function";
11872
- })(PackageType || (PackageType = {}));
11873
- /**
11874
- * Enum for job priority
11875
- */
11876
- var JobPriority;
11877
- (function (JobPriority) {
11878
- JobPriority["Low"] = "Low";
11879
- JobPriority["Normal"] = "Normal";
11880
- JobPriority["High"] = "High";
11881
- })(JobPriority || (JobPriority = {}));
11882
- /**
11883
- * Enum for target framework
11884
- */
11885
- var TargetFramework;
11886
- (function (TargetFramework) {
11887
- TargetFramework["Legacy"] = "Legacy";
11888
- TargetFramework["Windows"] = "Windows";
11889
- TargetFramework["Portable"] = "Portable";
11890
- })(TargetFramework || (TargetFramework = {}));
11891
- /**
11892
- * Enum for robot size
11893
- */
11894
- var RobotSize;
11895
- (function (RobotSize) {
11896
- RobotSize["Small"] = "Small";
11897
- RobotSize["Standard"] = "Standard";
11898
- RobotSize["Medium"] = "Medium";
11899
- RobotSize["Large"] = "Large";
11900
- })(RobotSize || (RobotSize = {}));
11901
- /**
11902
- * Enum for remote control access
11903
- */
11904
- var RemoteControlAccess;
11905
- (function (RemoteControlAccess) {
11906
- RemoteControlAccess["None"] = "None";
11907
- RemoteControlAccess["ReadOnly"] = "ReadOnly";
11908
- RemoteControlAccess["Full"] = "Full";
11909
- })(RemoteControlAccess || (RemoteControlAccess = {}));
11910
- /**
11911
- * Enum for process start strategy
11912
- */
11913
- var StartStrategy;
11914
- (function (StartStrategy) {
11915
- StartStrategy["All"] = "All";
11916
- StartStrategy["Specific"] = "Specific";
11917
- StartStrategy["RobotCount"] = "RobotCount";
11918
- StartStrategy["JobsCount"] = "JobsCount";
11919
- StartStrategy["ModernJobsCount"] = "ModernJobsCount";
11920
- })(StartStrategy || (StartStrategy = {}));
11921
- /**
11922
- * Enum for package source type
11923
- */
11924
- var PackageSourceType;
11925
- (function (PackageSourceType) {
11926
- PackageSourceType["Manual"] = "Manual";
11927
- PackageSourceType["Schedule"] = "Schedule";
11928
- PackageSourceType["Queue"] = "Queue";
11929
- PackageSourceType["StudioWeb"] = "StudioWeb";
11930
- PackageSourceType["IntegrationTrigger"] = "IntegrationTrigger";
11931
- PackageSourceType["StudioDesktop"] = "StudioDesktop";
11932
- PackageSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
11933
- PackageSourceType["Apps"] = "Apps";
11934
- PackageSourceType["SAP"] = "SAP";
11935
- PackageSourceType["HttpTrigger"] = "HttpTrigger";
11936
- PackageSourceType["HttpTriggerWithCallback"] = "HttpTriggerWithCallback";
11937
- PackageSourceType["RobotAPI"] = "RobotAPI";
11938
- PackageSourceType["Assistant"] = "Assistant";
11939
- PackageSourceType["CommandLine"] = "CommandLine";
11940
- PackageSourceType["RobotNetAPI"] = "RobotNetAPI";
11941
- PackageSourceType["Autopilot"] = "Autopilot";
11942
- PackageSourceType["TestManager"] = "TestManager";
11943
- PackageSourceType["AgentService"] = "AgentService";
11944
- PackageSourceType["ProcessOrchestration"] = "ProcessOrchestration";
11945
- PackageSourceType["PluginEcosystem"] = "PluginEcosystem";
11946
- PackageSourceType["PerformanceTesting"] = "PerformanceTesting";
11947
- PackageSourceType["AgentHub"] = "AgentHub";
11948
- PackageSourceType["ApiWorkflow"] = "ApiWorkflow";
11949
- })(PackageSourceType || (PackageSourceType = {}));
11950
- /**
11951
- * Enum for job source type
11952
- */
11953
- var JobSourceType;
11954
- (function (JobSourceType) {
11955
- JobSourceType["Manual"] = "Manual";
11956
- JobSourceType["Schedule"] = "Schedule";
11957
- JobSourceType["Agent"] = "Agent";
11958
- JobSourceType["Queue"] = "Queue";
11959
- JobSourceType["StudioWeb"] = "StudioWeb";
11960
- JobSourceType["IntegrationTrigger"] = "IntegrationTrigger";
11961
- JobSourceType["StudioDesktop"] = "StudioDesktop";
11962
- JobSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
11963
- JobSourceType["Apps"] = "Apps";
11964
- JobSourceType["SAP"] = "SAP";
11965
- JobSourceType["HttpTrigger"] = "HttpTrigger";
11966
- JobSourceType["HttpTriggerCallback"] = "HttpTriggerCallback";
11967
- JobSourceType["RobotAPI"] = "RobotAPI";
11968
- JobSourceType["CommandLine"] = "CommandLine";
11969
- JobSourceType["RobotNetAPI"] = "RobotNetAPI";
11970
- JobSourceType["Autopilot"] = "Autopilot";
11971
- JobSourceType["TestManager"] = "TestManager";
11972
- JobSourceType["AgentService"] = "AgentService";
11973
- JobSourceType["ProcessOrchestration"] = "ProcessOrchestration";
11974
- JobSourceType["PluginEcosystem"] = "PluginEcosystem";
11975
- JobSourceType["PerformanceTesting"] = "PerformanceTesting";
11976
- JobSourceType["AgentHub"] = "AgentHub";
11977
- JobSourceType["ApiWorkflow"] = "ApiWorkflow";
11978
- JobSourceType["CaseManagement"] = "CaseManagement";
11979
- })(JobSourceType || (JobSourceType = {}));
11980
- /**
11981
- * Enum for stop strategy
11982
- */
11983
- var StopStrategy;
11984
- (function (StopStrategy) {
11985
- StopStrategy["SoftStop"] = "SoftStop";
11986
- StopStrategy["Kill"] = "Kill";
11987
- })(StopStrategy || (StopStrategy = {}));
11988
- /**
11989
- * Enum for runtime type
11990
- */
11991
- var RuntimeType;
11992
- (function (RuntimeType) {
11993
- RuntimeType["NonProduction"] = "NonProduction";
11994
- RuntimeType["Attended"] = "Attended";
11995
- RuntimeType["Unattended"] = "Unattended";
11996
- RuntimeType["Development"] = "Development";
11997
- RuntimeType["Studio"] = "Studio";
11998
- RuntimeType["RpaDeveloper"] = "RpaDeveloper";
11999
- RuntimeType["StudioX"] = "StudioX";
12000
- RuntimeType["CitizenDeveloper"] = "CitizenDeveloper";
12001
- RuntimeType["Headless"] = "Headless";
12002
- RuntimeType["StudioPro"] = "StudioPro";
12003
- RuntimeType["RpaDeveloperPro"] = "RpaDeveloperPro";
12004
- RuntimeType["TestAutomation"] = "TestAutomation";
12005
- RuntimeType["AutomationCloud"] = "AutomationCloud";
12006
- RuntimeType["Serverless"] = "Serverless";
12007
- RuntimeType["AutomationKit"] = "AutomationKit";
12008
- RuntimeType["ServerlessTestAutomation"] = "ServerlessTestAutomation";
12009
- RuntimeType["AutomationCloudTestAutomation"] = "AutomationCloudTestAutomation";
12010
- RuntimeType["AttendedStudioWeb"] = "AttendedStudioWeb";
12011
- RuntimeType["Hosting"] = "Hosting";
12012
- RuntimeType["AssistantWeb"] = "AssistantWeb";
12013
- RuntimeType["ProcessOrchestration"] = "ProcessOrchestration";
12014
- RuntimeType["AgentService"] = "AgentService";
12015
- RuntimeType["AppTest"] = "AppTest";
12016
- RuntimeType["PerformanceTest"] = "PerformanceTest";
12017
- RuntimeType["BusinessRule"] = "BusinessRule";
12018
- RuntimeType["CaseManagement"] = "CaseManagement";
12019
- RuntimeType["Flow"] = "Flow";
12020
- })(RuntimeType || (RuntimeType = {}));
12021
- /**
12022
- * Enum for job type
12023
- */
12024
- var JobType;
12025
- (function (JobType) {
12026
- JobType["Unattended"] = "Unattended";
12027
- JobType["Attended"] = "Attended";
12028
- JobType["ServerlessGeneric"] = "ServerlessGeneric";
12029
- })(JobType || (JobType = {}));
12030
-
12031
12195
  /**
12032
12196
  * Maps fields for Queue entities to ensure consistent naming
12033
12197
  */
@@ -12513,6 +12677,19 @@ const UserSettingsMap = {
12513
12677
  ...CommonFieldMap
12514
12678
  };
12515
12679
 
12680
+ /**
12681
+ * Status of a feedback entry in the review workflow
12682
+ */
12683
+ var FeedbackStatus;
12684
+ (function (FeedbackStatus) {
12685
+ /** Feedback is awaiting review */
12686
+ FeedbackStatus[FeedbackStatus["Pending"] = 0] = "Pending";
12687
+ /** Feedback has been approved and confirmed */
12688
+ FeedbackStatus[FeedbackStatus["Approved"] = 1] = "Approved";
12689
+ /** Feedback has been dismissed */
12690
+ FeedbackStatus[FeedbackStatus["Dismissed"] = 2] = "Dismissed";
12691
+ })(FeedbackStatus || (FeedbackStatus = {}));
12692
+
12516
12693
  /**
12517
12694
  * Asset resolution utilities for UiPath Coded Apps
12518
12695
  *
@@ -12588,4 +12765,4 @@ function getAppBase() {
12588
12765
  return getMetaTagContent(UiPathMetaTags.APP_BASE) || '/';
12589
12766
  }
12590
12767
 
12591
- export { APP_NAME, AgentMap, AssetValueScope, AssetValueType, AuthenticationError, AuthorizationError, BucketOptions, CLOUD_CLIENT_ID, CLOUD_ORGANIZATION_NAME, CLOUD_REDIRECT_URI, CLOUD_ROLE_NAME, CLOUD_TENANT_NAME, CLOUD_URL, CONNECTION_STRING, CitationErrorType, ConversationMap, DEFAULT_ITEMS_FIELD, DEFAULT_PAGE_SIZE, DEFAULT_TOTAL_COUNT_FIELD, DataDirectionType, DebugMode, EntityFieldDataType, EntityType, ErrorType, EscalationActionType, EscalationRecipientScope, EscalationTriggerType, ExchangeMap, FeedbackRating, FieldDisplayType, HttpStatus, InputStreamSpeechSensitivity, InterruptType, JobPriority, JobSourceType, JobState, JobSubState, JobType, JoinType, LogicalOperator, MAX_PAGE_SIZE, MessageMap, MessageRole, NetworkError, NotFoundError, PackageSourceType, PackageType, ProcessIncidentSeverity, ProcessIncidentStatus, ProcessIncidentType, QueryFilterOperator, RateLimitError, ReferenceType, RemoteControlAccess, RobotSize, RuntimeType, SDK_LOGGER_NAME, SDK_RUN_EVENT, SDK_SERVICE_NAME, SDK_VERSION, SERVICE, SLADurationUnit, ServerError, ServerlessJobType, SortOrder, StageTaskType, StartStrategy, StopStrategy, TargetFramework, TaskActivityType, TaskPriority, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, UNKNOWN$1 as UNKNOWN, UiPath, UiPathError, UiPathMetaTags, UserSettingsMap, VERSION, ValidationError, createAgentWithMethods, createCaseInstanceWithMethods, createConversationWithMethods, createEntityWithMethods, createJobWithMethods, createProcessInstanceWithMethods, createProcessWithMethods, createTaskWithMethods, getAppBase, getAsset, getErrorDetails, getLimitedPageSize, isAuthenticationError, isAuthorizationError, isNetworkError, isNotFoundError, isRateLimitError, isServerError, isUiPathError, isValidationError, loadFromMetaTags, telemetryClient, track, trackEvent };
12768
+ export { APP_NAME, AgentMap, AssetValueScope, AssetValueType, AuthenticationError, AuthorizationError, BucketOptions, CLOUD_CLIENT_ID, CLOUD_ORGANIZATION_NAME, CLOUD_REDIRECT_URI, CLOUD_ROLE_NAME, CLOUD_TENANT_NAME, CLOUD_URL, CONNECTION_STRING, CitationErrorType, ConversationMap, DEFAULT_ITEMS_FIELD, DEFAULT_PAGE_SIZE, DEFAULT_TOTAL_COUNT_FIELD, DataDirectionType, DebugMode, EntityFieldDataType, EntityType, ErrorType, EscalationActionType, EscalationRecipientScope, EscalationTriggerType, ExchangeMap, FeedbackRating, FeedbackStatus, FieldDisplayType, HttpStatus, InputStreamSpeechSensitivity, InterruptType, JobPriority, JobSourceType, JobState, JobSubState, JobType, JoinType, LogicalOperator, MAX_PAGE_SIZE, MessageMap, MessageRole, NetworkError, NotFoundError, PackageSourceType, PackageType, ProcessIncidentSeverity, ProcessIncidentStatus, ProcessIncidentType, QueryFilterOperator, RateLimitError, ReferenceType, RemoteControlAccess, RobotSize, RuntimeType, SDK_LOGGER_NAME, SDK_RUN_EVENT, SDK_SERVICE_NAME, SDK_VERSION, SERVICE, SLADurationUnit, ServerError, ServerlessJobType, SortOrder, StageTaskType, StartStrategy, StopStrategy, TargetFramework, TaskActivityType, TaskPriority, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskUserType, UNKNOWN$1 as UNKNOWN, UiPath, UiPathError, UiPathMetaTags, UserSettingsMap, VERSION, ValidationError, createAgentWithMethods, createCaseInstanceWithMethods, createConversationWithMethods, createEntityWithMethods, createJobWithMethods, createProcessInstanceWithMethods, createProcessWithMethods, createTaskWithMethods, getAppBase, getAsset, getErrorDetails, getLimitedPageSize, isAuthenticationError, isAuthorizationError, isNetworkError, isNotFoundError, isRateLimitError, isServerError, isUiPathError, isValidationError, loadFromMetaTags, telemetryClient, track, trackEvent };