@uipath/uipath-typescript 1.3.2 → 1.3.4

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.
Files changed (38) hide show
  1. package/dist/assets/index.cjs +21 -8
  2. package/dist/assets/index.mjs +21 -8
  3. package/dist/attachments/index.cjs +21 -8
  4. package/dist/attachments/index.mjs +21 -8
  5. package/dist/buckets/index.cjs +21 -8
  6. package/dist/buckets/index.mjs +21 -8
  7. package/dist/cases/index.cjs +41 -13
  8. package/dist/cases/index.d.ts +15 -0
  9. package/dist/cases/index.mjs +41 -13
  10. package/dist/conversational-agent/index.cjs +39 -8
  11. package/dist/conversational-agent/index.d.ts +55 -2
  12. package/dist/conversational-agent/index.mjs +39 -8
  13. package/dist/core/index.cjs +16 -1
  14. package/dist/core/index.d.ts +1 -1
  15. package/dist/core/index.mjs +16 -1
  16. package/dist/entities/index.cjs +55 -8
  17. package/dist/entities/index.d.ts +54 -0
  18. package/dist/entities/index.mjs +55 -8
  19. package/dist/feedback/index.cjs +1911 -0
  20. package/dist/feedback/index.d.ts +475 -0
  21. package/dist/feedback/index.mjs +1909 -0
  22. package/dist/index.cjs +451 -189
  23. package/dist/index.d.ts +388 -13
  24. package/dist/index.mjs +452 -190
  25. package/dist/index.umd.js +451 -189
  26. package/dist/jobs/index.cjs +384 -8
  27. package/dist/jobs/index.d.ts +220 -2
  28. package/dist/jobs/index.mjs +385 -9
  29. package/dist/maestro-processes/index.cjs +21 -8
  30. package/dist/maestro-processes/index.mjs +21 -8
  31. package/dist/processes/index.cjs +21 -8
  32. package/dist/processes/index.mjs +21 -8
  33. package/dist/queues/index.cjs +21 -8
  34. package/dist/queues/index.mjs +21 -8
  35. package/dist/tasks/index.cjs +41 -13
  36. package/dist/tasks/index.d.ts +25 -10
  37. package/dist/tasks/index.mjs +42 -14
  38. package/package.json +13 -2
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,9 @@
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`,
4543
+ RESTART: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.RestartJob`,
4526
4544
  };
4527
4545
  /**
4528
4546
  * Orchestrator Asset Service Endpoints
@@ -4594,6 +4612,7 @@
4594
4612
  BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
4595
4613
  UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
4596
4614
  UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
4615
+ DELETE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete/${recordId}`,
4597
4616
  DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
4598
4617
  UPSERT: `${DATAFABRIC_BASE}/api/Entity`,
4599
4618
  DELETE: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
@@ -9190,7 +9209,7 @@
9190
9209
  // Connection string placeholder that will be replaced during build
9191
9210
  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";
9192
9211
  // SDK Version placeholder
9193
- const SDK_VERSION = "1.3.2";
9212
+ const SDK_VERSION = "1.3.4";
9194
9213
  const VERSION = "Version";
9195
9214
  const SERVICE = "Service";
9196
9215
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -10025,6 +10044,8 @@
10025
10044
 
10026
10045
  const FOLDER_KEY = 'X-UIPATH-FolderKey';
10027
10046
  const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
10047
+ const TRACEPARENT = 'traceparent';
10048
+ const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
10028
10049
  /**
10029
10050
  * Content type constants for HTTP requests/responses
10030
10051
  */
@@ -10078,8 +10099,13 @@
10078
10099
  if (isFormData) {
10079
10100
  delete defaultHeaders['Content-Type'];
10080
10101
  }
10102
+ const traceId = crypto.randomUUID().replace(/-/g, '');
10103
+ const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
10104
+ const traceparentValue = `00-${traceId}-${spanId}-01`;
10081
10105
  const headers = {
10082
10106
  ...defaultHeaders,
10107
+ [TRACEPARENT]: traceparentValue,
10108
+ [UIPATH_TRACEPARENT_ID]: traceparentValue,
10083
10109
  ...options.headers
10084
10110
  };
10085
10111
  // Convert params to URLSearchParams
@@ -10119,7 +10145,11 @@
10119
10145
  const text = await response.text();
10120
10146
  return text;
10121
10147
  }
10122
- return response.json();
10148
+ const text = await response.text();
10149
+ if (!text) {
10150
+ return undefined;
10151
+ }
10152
+ return JSON.parse(text);
10123
10153
  }
10124
10154
  catch (error) {
10125
10155
  // If it's already one of our errors, re-throw it
@@ -11022,8 +11052,9 @@
11022
11052
  });
11023
11053
  }
11024
11054
  // Extract and transform items from response
11025
- const rawItems = response.data?.[itemsField];
11026
- const totalCount = response.data?.[totalCountField];
11055
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
11056
+ const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
11057
+ const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
11027
11058
  // Parse items - automatically handle JSON string responses
11028
11059
  const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
11029
11060
  const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
@@ -11219,7 +11250,7 @@
11219
11250
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
11220
11251
  // Prepare request parameters based on pagination type
11221
11252
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
11222
- // For POST requests, merge pagination params into body; for GET, use query params
11253
+ // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
11223
11254
  if (method.toUpperCase() === 'POST') {
11224
11255
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
11225
11256
  options.body = {
@@ -11227,6 +11258,7 @@
11227
11258
  ...options.params,
11228
11259
  ...requestParams
11229
11260
  };
11261
+ options.params = undefined;
11230
11262
  }
11231
11263
  else {
11232
11264
  // Merge pagination parameters with existing parameters
@@ -11267,7 +11299,6 @@
11267
11299
  if (params.pageNumber && params.pageNumber > 1) {
11268
11300
  requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
11269
11301
  }
11270
- // Include total count for ODATA APIs
11271
11302
  {
11272
11303
  requestParams[countParam] = true;
11273
11304
  }
@@ -11295,8 +11326,9 @@
11295
11326
  const totalCountField = fields.totalCountField || 'totalRecordCount';
11296
11327
  const continuationTokenField = fields.continuationTokenField || 'continuationToken';
11297
11328
  // Extract items and metadata
11298
- const items = response.data[itemsField] || [];
11299
- const totalCount = response.data[totalCountField];
11329
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
11330
+ const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
11331
+ const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
11300
11332
  const continuationToken = response.data[continuationTokenField];
11301
11333
  // Determine if there are more pages
11302
11334
  const hasMore = this.determineHasMorePages(paginationType, {
@@ -11377,6 +11409,13 @@
11377
11409
  throw new Error('Entity ID is undefined');
11378
11410
  return service.deleteRecordsById(entityData.id, recordIds, options);
11379
11411
  },
11412
+ async deleteRecord(recordId) {
11413
+ if (!entityData.id)
11414
+ throw new Error('Entity ID is undefined');
11415
+ if (!recordId)
11416
+ throw new Error('Record ID is undefined');
11417
+ return service.deleteRecordById(entityData.id, recordId);
11418
+ },
11380
11419
  async getAllRecords(options) {
11381
11420
  if (!entityData.id)
11382
11421
  throw new Error('Entity ID is undefined');
@@ -11929,6 +11968,8 @@
11929
11968
  /**
11930
11969
  * Deletes data from an entity by entity ID
11931
11970
  *
11971
+ * Note: Records deleted using deleteRecordsById will not trigger Data Fabric trigger events. Use {@link deleteRecordById} if you need trigger events to fire for the deleted record.
11972
+ *
11932
11973
  * @param entityId - UUID of the entity
11933
11974
  * @param recordIds - Array of record UUIDs to delete
11934
11975
  * @param options - Delete options
@@ -11956,6 +11997,27 @@
11956
11997
  });
11957
11998
  return response.data;
11958
11999
  }
12000
+ /**
12001
+ * Deletes a single record from an entity by entity ID and record ID
12002
+ *
12003
+ * Note: Data Fabric supports trigger events only on individual deletes, not on deleting multiple records.
12004
+ * Use this method if you need trigger events to fire for the deleted record.
12005
+ *
12006
+ * @param entityId - UUID of the entity
12007
+ * @param recordId - UUID of the record to delete
12008
+ * @returns Promise resolving to void on success
12009
+ * @example
12010
+ * ```typescript
12011
+ * import { Entities } from '@uipath/uipath-typescript/entities';
12012
+ *
12013
+ * const entities = new Entities(sdk);
12014
+ *
12015
+ * await entities.deleteRecordById("<entityId>", "<recordId>");
12016
+ * ```
12017
+ */
12018
+ async deleteRecordById(entityId, recordId) {
12019
+ await this.delete(DATA_FABRIC_ENDPOINTS.ENTITY.DELETE_RECORD_BY_ID(entityId, recordId));
12020
+ }
11959
12021
  /**
11960
12022
  * Gets all entities in the system
11961
12023
  *
@@ -12508,6 +12570,9 @@
12508
12570
  __decorate([
12509
12571
  track('Entities.DeleteRecordsById')
12510
12572
  ], EntityService.prototype, "deleteRecordsById", null);
12573
+ __decorate([
12574
+ track('Entities.DeleteRecordById')
12575
+ ], EntityService.prototype, "deleteRecordById", null);
12511
12576
  __decorate([
12512
12577
  track('Entities.GetAll')
12513
12578
  ], EntityService.prototype, "getAll", null);
@@ -13693,15 +13758,15 @@
13693
13758
  return createTaskWithMethods(transformedData, this);
13694
13759
  }
13695
13760
  /**
13696
- * Gets users in the given folder who have Tasks.View and Tasks.Edit permissions
13761
+ * Gets task users (users, robots, groups etc) in the given folder who have Tasks.View and Tasks.Edit permissions
13697
13762
  *
13698
13763
  * The method returns either:
13699
- * - An array of users (when no pagination parameters are provided)
13764
+ * - An array of task users (when no pagination parameters are provided)
13700
13765
  * - A paginated result with navigation cursors (when any pagination parameter is provided)
13701
13766
  *
13702
- * @param folderId - The folder ID to get users from
13767
+ * @param folderId - The folder ID to get task users from
13703
13768
  * @param options - Optional query and pagination parameters
13704
- * @returns Promise resolving to an array of users or paginated result
13769
+ * @returns Promise resolving to an array of task users or paginated result
13705
13770
  *
13706
13771
  * @example
13707
13772
  * ```typescript
@@ -13712,7 +13777,7 @@
13712
13777
  * // Standard array return
13713
13778
  * const users = await tasks.getUsers(123);
13714
13779
  *
13715
- * // Get users with filtering
13780
+ * // Get task users with filtering
13716
13781
  * const users = await tasks.getUsers(123, {
13717
13782
  * filter: "name eq 'abc'"
13718
13783
  * });
@@ -15118,6 +15183,27 @@
15118
15183
  throw new Error('Job folderId is undefined');
15119
15184
  return service.getOutput(jobData.key, jobData.folderId);
15120
15185
  },
15186
+ async stop(options) {
15187
+ if (!jobData.key)
15188
+ throw new Error('Job key is undefined');
15189
+ if (!jobData.folderId)
15190
+ throw new Error('Job folderId is undefined');
15191
+ return service.stop([jobData.key], jobData.folderId, options);
15192
+ },
15193
+ async resume(options) {
15194
+ if (!jobData.key)
15195
+ throw new Error('Job key is undefined');
15196
+ if (!jobData.folderId)
15197
+ throw new Error('Job folderId is undefined');
15198
+ return service.resume(jobData.key, jobData.folderId, options);
15199
+ },
15200
+ async restart() {
15201
+ if (!jobData.key)
15202
+ throw new Error('Job key is undefined');
15203
+ if (!jobData.folderId)
15204
+ throw new Error('Job folderId is undefined');
15205
+ return service.restart(jobData.key, jobData.folderId);
15206
+ },
15121
15207
  };
15122
15208
  }
15123
15209
  /**
@@ -15132,6 +15218,8 @@
15132
15218
  return Object.assign({}, jobData, methods);
15133
15219
  }
15134
15220
 
15221
+ /** Maximum number of job keys to resolve in a single OData filter query */
15222
+ const JOB_KEY_RESOLUTION_CHUNK_SIZE = 50;
15135
15223
  /**
15136
15224
  * Maps fields for Job entities to ensure consistent naming
15137
15225
  * Semantic renames only — case conversion handled by pascalToCamelCaseKeys()
@@ -15190,6 +15278,182 @@
15190
15278
  track('Attachments.GetById')
15191
15279
  ], AttachmentService.prototype, "getById", null);
15192
15280
 
15281
+ /**
15282
+ * Enum for package types
15283
+ */
15284
+ exports.PackageType = void 0;
15285
+ (function (PackageType) {
15286
+ PackageType["Undefined"] = "Undefined";
15287
+ PackageType["Process"] = "Process";
15288
+ PackageType["ProcessOrchestration"] = "ProcessOrchestration";
15289
+ PackageType["WebApp"] = "WebApp";
15290
+ PackageType["Agent"] = "Agent";
15291
+ PackageType["TestAutomationProcess"] = "TestAutomationProcess";
15292
+ PackageType["Api"] = "Api";
15293
+ PackageType["MCPServer"] = "MCPServer";
15294
+ PackageType["BusinessRules"] = "BusinessRules";
15295
+ PackageType["CaseManagement"] = "CaseManagement";
15296
+ PackageType["Flow"] = "Flow";
15297
+ PackageType["Function"] = "Function";
15298
+ })(exports.PackageType || (exports.PackageType = {}));
15299
+ /**
15300
+ * Enum for job priority
15301
+ */
15302
+ exports.JobPriority = void 0;
15303
+ (function (JobPriority) {
15304
+ JobPriority["Low"] = "Low";
15305
+ JobPriority["Normal"] = "Normal";
15306
+ JobPriority["High"] = "High";
15307
+ })(exports.JobPriority || (exports.JobPriority = {}));
15308
+ /**
15309
+ * Enum for target framework
15310
+ */
15311
+ exports.TargetFramework = void 0;
15312
+ (function (TargetFramework) {
15313
+ TargetFramework["Legacy"] = "Legacy";
15314
+ TargetFramework["Windows"] = "Windows";
15315
+ TargetFramework["Portable"] = "Portable";
15316
+ })(exports.TargetFramework || (exports.TargetFramework = {}));
15317
+ /**
15318
+ * Enum for robot size
15319
+ */
15320
+ exports.RobotSize = void 0;
15321
+ (function (RobotSize) {
15322
+ RobotSize["Small"] = "Small";
15323
+ RobotSize["Standard"] = "Standard";
15324
+ RobotSize["Medium"] = "Medium";
15325
+ RobotSize["Large"] = "Large";
15326
+ })(exports.RobotSize || (exports.RobotSize = {}));
15327
+ /**
15328
+ * Enum for remote control access
15329
+ */
15330
+ exports.RemoteControlAccess = void 0;
15331
+ (function (RemoteControlAccess) {
15332
+ RemoteControlAccess["None"] = "None";
15333
+ RemoteControlAccess["ReadOnly"] = "ReadOnly";
15334
+ RemoteControlAccess["Full"] = "Full";
15335
+ })(exports.RemoteControlAccess || (exports.RemoteControlAccess = {}));
15336
+ /**
15337
+ * Enum for process start strategy
15338
+ */
15339
+ exports.StartStrategy = void 0;
15340
+ (function (StartStrategy) {
15341
+ StartStrategy["All"] = "All";
15342
+ StartStrategy["Specific"] = "Specific";
15343
+ StartStrategy["RobotCount"] = "RobotCount";
15344
+ StartStrategy["JobsCount"] = "JobsCount";
15345
+ StartStrategy["ModernJobsCount"] = "ModernJobsCount";
15346
+ })(exports.StartStrategy || (exports.StartStrategy = {}));
15347
+ /**
15348
+ * Enum for package source type
15349
+ */
15350
+ exports.PackageSourceType = void 0;
15351
+ (function (PackageSourceType) {
15352
+ PackageSourceType["Manual"] = "Manual";
15353
+ PackageSourceType["Schedule"] = "Schedule";
15354
+ PackageSourceType["Queue"] = "Queue";
15355
+ PackageSourceType["StudioWeb"] = "StudioWeb";
15356
+ PackageSourceType["IntegrationTrigger"] = "IntegrationTrigger";
15357
+ PackageSourceType["StudioDesktop"] = "StudioDesktop";
15358
+ PackageSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
15359
+ PackageSourceType["Apps"] = "Apps";
15360
+ PackageSourceType["SAP"] = "SAP";
15361
+ PackageSourceType["HttpTrigger"] = "HttpTrigger";
15362
+ PackageSourceType["HttpTriggerWithCallback"] = "HttpTriggerWithCallback";
15363
+ PackageSourceType["RobotAPI"] = "RobotAPI";
15364
+ PackageSourceType["Assistant"] = "Assistant";
15365
+ PackageSourceType["CommandLine"] = "CommandLine";
15366
+ PackageSourceType["RobotNetAPI"] = "RobotNetAPI";
15367
+ PackageSourceType["Autopilot"] = "Autopilot";
15368
+ PackageSourceType["TestManager"] = "TestManager";
15369
+ PackageSourceType["AgentService"] = "AgentService";
15370
+ PackageSourceType["ProcessOrchestration"] = "ProcessOrchestration";
15371
+ PackageSourceType["PluginEcosystem"] = "PluginEcosystem";
15372
+ PackageSourceType["PerformanceTesting"] = "PerformanceTesting";
15373
+ PackageSourceType["AgentHub"] = "AgentHub";
15374
+ PackageSourceType["ApiWorkflow"] = "ApiWorkflow";
15375
+ })(exports.PackageSourceType || (exports.PackageSourceType = {}));
15376
+ /**
15377
+ * Enum for job source type
15378
+ */
15379
+ exports.JobSourceType = void 0;
15380
+ (function (JobSourceType) {
15381
+ JobSourceType["Manual"] = "Manual";
15382
+ JobSourceType["Schedule"] = "Schedule";
15383
+ JobSourceType["Agent"] = "Agent";
15384
+ JobSourceType["Queue"] = "Queue";
15385
+ JobSourceType["StudioWeb"] = "StudioWeb";
15386
+ JobSourceType["IntegrationTrigger"] = "IntegrationTrigger";
15387
+ JobSourceType["StudioDesktop"] = "StudioDesktop";
15388
+ JobSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
15389
+ JobSourceType["Apps"] = "Apps";
15390
+ JobSourceType["SAP"] = "SAP";
15391
+ JobSourceType["HttpTrigger"] = "HttpTrigger";
15392
+ JobSourceType["HttpTriggerCallback"] = "HttpTriggerCallback";
15393
+ JobSourceType["RobotAPI"] = "RobotAPI";
15394
+ JobSourceType["CommandLine"] = "CommandLine";
15395
+ JobSourceType["RobotNetAPI"] = "RobotNetAPI";
15396
+ JobSourceType["Autopilot"] = "Autopilot";
15397
+ JobSourceType["TestManager"] = "TestManager";
15398
+ JobSourceType["AgentService"] = "AgentService";
15399
+ JobSourceType["ProcessOrchestration"] = "ProcessOrchestration";
15400
+ JobSourceType["PluginEcosystem"] = "PluginEcosystem";
15401
+ JobSourceType["PerformanceTesting"] = "PerformanceTesting";
15402
+ JobSourceType["AgentHub"] = "AgentHub";
15403
+ JobSourceType["ApiWorkflow"] = "ApiWorkflow";
15404
+ JobSourceType["CaseManagement"] = "CaseManagement";
15405
+ })(exports.JobSourceType || (exports.JobSourceType = {}));
15406
+ /**
15407
+ * Enum for stop strategy
15408
+ */
15409
+ exports.StopStrategy = void 0;
15410
+ (function (StopStrategy) {
15411
+ StopStrategy["SoftStop"] = "SoftStop";
15412
+ StopStrategy["Kill"] = "Kill";
15413
+ })(exports.StopStrategy || (exports.StopStrategy = {}));
15414
+ /**
15415
+ * Enum for runtime type
15416
+ */
15417
+ exports.RuntimeType = void 0;
15418
+ (function (RuntimeType) {
15419
+ RuntimeType["NonProduction"] = "NonProduction";
15420
+ RuntimeType["Attended"] = "Attended";
15421
+ RuntimeType["Unattended"] = "Unattended";
15422
+ RuntimeType["Development"] = "Development";
15423
+ RuntimeType["Studio"] = "Studio";
15424
+ RuntimeType["RpaDeveloper"] = "RpaDeveloper";
15425
+ RuntimeType["StudioX"] = "StudioX";
15426
+ RuntimeType["CitizenDeveloper"] = "CitizenDeveloper";
15427
+ RuntimeType["Headless"] = "Headless";
15428
+ RuntimeType["StudioPro"] = "StudioPro";
15429
+ RuntimeType["RpaDeveloperPro"] = "RpaDeveloperPro";
15430
+ RuntimeType["TestAutomation"] = "TestAutomation";
15431
+ RuntimeType["AutomationCloud"] = "AutomationCloud";
15432
+ RuntimeType["Serverless"] = "Serverless";
15433
+ RuntimeType["AutomationKit"] = "AutomationKit";
15434
+ RuntimeType["ServerlessTestAutomation"] = "ServerlessTestAutomation";
15435
+ RuntimeType["AutomationCloudTestAutomation"] = "AutomationCloudTestAutomation";
15436
+ RuntimeType["AttendedStudioWeb"] = "AttendedStudioWeb";
15437
+ RuntimeType["Hosting"] = "Hosting";
15438
+ RuntimeType["AssistantWeb"] = "AssistantWeb";
15439
+ RuntimeType["ProcessOrchestration"] = "ProcessOrchestration";
15440
+ RuntimeType["AgentService"] = "AgentService";
15441
+ RuntimeType["AppTest"] = "AppTest";
15442
+ RuntimeType["PerformanceTest"] = "PerformanceTest";
15443
+ RuntimeType["BusinessRule"] = "BusinessRule";
15444
+ RuntimeType["CaseManagement"] = "CaseManagement";
15445
+ RuntimeType["Flow"] = "Flow";
15446
+ })(exports.RuntimeType || (exports.RuntimeType = {}));
15447
+ /**
15448
+ * Enum for job type
15449
+ */
15450
+ exports.JobType = void 0;
15451
+ (function (JobType) {
15452
+ JobType["Unattended"] = "Unattended";
15453
+ JobType["Attended"] = "Attended";
15454
+ JobType["ServerlessGeneric"] = "ServerlessGeneric";
15455
+ })(exports.JobType || (exports.JobType = {}));
15456
+
15193
15457
  /**
15194
15458
  * Service for interacting with UiPath Orchestrator Jobs API
15195
15459
  */
@@ -15359,6 +15623,121 @@
15359
15623
  }
15360
15624
  return null;
15361
15625
  }
15626
+ /**
15627
+ * Stops one or more jobs by their UUID keys.
15628
+ *
15629
+ * Sends a stop request for the specified jobs to the Orchestrator. Throws if any keys cannot be resolved.
15630
+ *
15631
+ * @param jobKeys - Array of job UUID keys to stop (e.g., from {@link JobGetResponse}.key)
15632
+ * @param folderId - The folder ID where the jobs reside (required)
15633
+ * @param options - Optional {@link JobStopOptions} including stop strategy
15634
+ * @returns Promise that resolves when the jobs are stopped successfully, or rejects on failure
15635
+ *
15636
+ * @example
15637
+ * ```typescript
15638
+ * // Stop a single job with default soft stop
15639
+ * await jobs.stop([<jobKey>], <folderId>);
15640
+ * ```
15641
+ *
15642
+ * @example
15643
+ * ```typescript
15644
+ * import { StopStrategy } from '@uipath/uipath-typescript/jobs';
15645
+ *
15646
+ * // Force-kill multiple jobs
15647
+ * await jobs.stop(
15648
+ * [<jobKey1>, <jobKey2>],
15649
+ * <folderId>,
15650
+ * { strategy: StopStrategy.Kill }
15651
+ * );
15652
+ * ```
15653
+ */
15654
+ async stop(jobKeys, folderId, options) {
15655
+ if (jobKeys.length === 0) {
15656
+ return;
15657
+ }
15658
+ if (!folderId) {
15659
+ throw new ValidationError({ message: 'folderId is required for stop' });
15660
+ }
15661
+ const headers = createHeaders({ [FOLDER_ID]: folderId });
15662
+ const strategy = options?.strategy ?? exports.StopStrategy.SoftStop;
15663
+ const jobIds = await this.resolveJobKeys(jobKeys, folderId);
15664
+ await this.stopJobsByIds(jobIds, strategy, headers);
15665
+ }
15666
+ /**
15667
+ * Resumes a suspended job.
15668
+ *
15669
+ * Sends a resume request to a job that is currently in the `Suspended` state.
15670
+ * The job transitions to `Resumed` and then to `Running` as it continues execution. Optionally pass
15671
+ * input arguments to provide data for the resumed workflow.
15672
+ *
15673
+ * @param jobKey - The unique key (GUID) of the suspended job to resume
15674
+ * @param folderId - The folder ID where the job resides
15675
+ * @param options - Optional parameters including input arguments
15676
+ * @returns Promise that resolves when the job is resumed successfully, or rejects on failure
15677
+ *
15678
+ * @example
15679
+ * ```typescript
15680
+ * // Resume a suspended job
15681
+ * await jobs.resume(<jobKey>, <folderId>);
15682
+ * ```
15683
+ *
15684
+ * @example
15685
+ * ```typescript
15686
+ * // Resume with input arguments
15687
+ * await jobs.resume(<jobKey>, <folderId>, {
15688
+ * inputArguments: { approved: true }
15689
+ * });
15690
+ * ```
15691
+ */
15692
+ async resume(jobKey, folderId, options) {
15693
+ if (!jobKey) {
15694
+ throw new ValidationError({ message: 'jobKey is required for resume' });
15695
+ }
15696
+ if (!folderId) {
15697
+ throw new ValidationError({ message: 'folderId is required for resume' });
15698
+ }
15699
+ const headers = createHeaders({ [FOLDER_ID]: folderId });
15700
+ const body = { jobKey };
15701
+ if (options?.inputArguments) {
15702
+ body.inputArguments = JSON.stringify(options.inputArguments);
15703
+ }
15704
+ await this.post(JOB_ENDPOINTS.RESUME, body, { headers });
15705
+ }
15706
+ /**
15707
+ * Restarts a job in a final state (Successful, Faulted, or Stopped).
15708
+ *
15709
+ * Creates a **new** job execution from a previously successful, faulted, or stopped job.
15710
+ * The new job has its own unique `key`, starts in `Pending` state, and uses
15711
+ * the same process and input arguments as the original job.
15712
+ *
15713
+ * To monitor the new job's progress, poll with {@link getById}
15714
+ * using the returned job's key until the state reaches a final value.
15715
+ *
15716
+ * @param jobKey - The unique key (GUID) of the job to restart
15717
+ * @param folderId - The folder ID where the job resides
15718
+ * @returns Promise resolving to the new {@link JobGetResponse} with full job details
15719
+ *
15720
+ * @example
15721
+ * ```typescript
15722
+ * // Restart a faulted job
15723
+ * const newJob = await jobs.restart(<jobKey>, <folderId>);
15724
+ * console.log(newJob.state); // 'Pending'
15725
+ * console.log(newJob.key); // new job key (different from original)
15726
+ * ```
15727
+ */
15728
+ async restart(jobKey, folderId) {
15729
+ if (!jobKey) {
15730
+ throw new ValidationError({ message: 'jobKey is required for restart' });
15731
+ }
15732
+ if (!folderId) {
15733
+ throw new ValidationError({ message: 'folderId is required for restart' });
15734
+ }
15735
+ const [jobId] = await this.resolveJobKeys([jobKey], folderId);
15736
+ const headers = createHeaders({ [FOLDER_ID]: folderId });
15737
+ const response = await this.post(JOB_ENDPOINTS.RESTART, { jobId }, { headers });
15738
+ const rawJob = transformData(pascalToCamelCaseKeys(response.data), JobMap);
15739
+ return createJobWithMethods(rawJob, this);
15740
+ }
15362
15741
  /**
15363
15742
  * Downloads the output file content via the Attachments API.
15364
15743
  * 1. Fetches blob access info from the attachment using AttachmentService
@@ -15393,6 +15772,43 @@
15393
15772
  throw new ServerError({ message: 'Failed to parse job output file as JSON' });
15394
15773
  }
15395
15774
  }
15775
+ /**
15776
+ * Resolves job UUID keys to integer IDs via the getAll method.
15777
+ * Chunks keys into batches to avoid URL length limits.
15778
+ */
15779
+ async resolveJobKeys(jobKeys, folderId) {
15780
+ const uniqueKeys = [...new Set(jobKeys)];
15781
+ const keyToIdMap = new Map();
15782
+ const chunks = [];
15783
+ for (let i = 0; i < uniqueKeys.length; i += JOB_KEY_RESOLUTION_CHUNK_SIZE) {
15784
+ chunks.push(uniqueKeys.slice(i, i + JOB_KEY_RESOLUTION_CHUNK_SIZE));
15785
+ }
15786
+ const results = await Promise.all(chunks.map((chunk) => {
15787
+ const filterValues = chunk.map((key) => `'${key}'`).join(',');
15788
+ return this.getAll({
15789
+ folderId,
15790
+ filter: `key in (${filterValues})`,
15791
+ select: 'id,key',
15792
+ pageSize: chunk.length,
15793
+ });
15794
+ }));
15795
+ for (const response of results) {
15796
+ for (const job of response.items) {
15797
+ keyToIdMap.set(job.key, job.id);
15798
+ }
15799
+ }
15800
+ const missingKeys = uniqueKeys.filter((key) => !keyToIdMap.has(key));
15801
+ if (missingKeys.length > 0) {
15802
+ throw new ValidationError({ message: `Jobs not found for keys: ${missingKeys.join(', ')}` });
15803
+ }
15804
+ return uniqueKeys.map((key) => keyToIdMap.get(key));
15805
+ }
15806
+ /**
15807
+ * Calls the StopJobs OData action with resolved integer IDs.
15808
+ */
15809
+ async stopJobsByIds(jobIds, strategy, headers) {
15810
+ await this.post(JOB_ENDPOINTS.STOP, { jobIds, strategy }, { headers });
15811
+ }
15396
15812
  }
15397
15813
  __decorate([
15398
15814
  track('Jobs.GetAll')
@@ -15403,6 +15819,15 @@
15403
15819
  __decorate([
15404
15820
  track('Jobs.GetOutput')
15405
15821
  ], JobService.prototype, "getOutput", null);
15822
+ __decorate([
15823
+ track('Jobs.Stop')
15824
+ ], JobService.prototype, "stop", null);
15825
+ __decorate([
15826
+ track('Jobs.Resume')
15827
+ ], JobService.prototype, "resume", null);
15828
+ __decorate([
15829
+ track('Jobs.Restart')
15830
+ ], JobService.prototype, "restart", null);
15406
15831
 
15407
15832
  /**
15408
15833
  * Enum for job sub-state
@@ -15613,182 +16038,6 @@
15613
16038
  track('Processes.GetById')
15614
16039
  ], ProcessService.prototype, "getById", null);
15615
16040
 
15616
- /**
15617
- * Enum for package types
15618
- */
15619
- exports.PackageType = void 0;
15620
- (function (PackageType) {
15621
- PackageType["Undefined"] = "Undefined";
15622
- PackageType["Process"] = "Process";
15623
- PackageType["ProcessOrchestration"] = "ProcessOrchestration";
15624
- PackageType["WebApp"] = "WebApp";
15625
- PackageType["Agent"] = "Agent";
15626
- PackageType["TestAutomationProcess"] = "TestAutomationProcess";
15627
- PackageType["Api"] = "Api";
15628
- PackageType["MCPServer"] = "MCPServer";
15629
- PackageType["BusinessRules"] = "BusinessRules";
15630
- PackageType["CaseManagement"] = "CaseManagement";
15631
- PackageType["Flow"] = "Flow";
15632
- PackageType["Function"] = "Function";
15633
- })(exports.PackageType || (exports.PackageType = {}));
15634
- /**
15635
- * Enum for job priority
15636
- */
15637
- exports.JobPriority = void 0;
15638
- (function (JobPriority) {
15639
- JobPriority["Low"] = "Low";
15640
- JobPriority["Normal"] = "Normal";
15641
- JobPriority["High"] = "High";
15642
- })(exports.JobPriority || (exports.JobPriority = {}));
15643
- /**
15644
- * Enum for target framework
15645
- */
15646
- exports.TargetFramework = void 0;
15647
- (function (TargetFramework) {
15648
- TargetFramework["Legacy"] = "Legacy";
15649
- TargetFramework["Windows"] = "Windows";
15650
- TargetFramework["Portable"] = "Portable";
15651
- })(exports.TargetFramework || (exports.TargetFramework = {}));
15652
- /**
15653
- * Enum for robot size
15654
- */
15655
- exports.RobotSize = void 0;
15656
- (function (RobotSize) {
15657
- RobotSize["Small"] = "Small";
15658
- RobotSize["Standard"] = "Standard";
15659
- RobotSize["Medium"] = "Medium";
15660
- RobotSize["Large"] = "Large";
15661
- })(exports.RobotSize || (exports.RobotSize = {}));
15662
- /**
15663
- * Enum for remote control access
15664
- */
15665
- exports.RemoteControlAccess = void 0;
15666
- (function (RemoteControlAccess) {
15667
- RemoteControlAccess["None"] = "None";
15668
- RemoteControlAccess["ReadOnly"] = "ReadOnly";
15669
- RemoteControlAccess["Full"] = "Full";
15670
- })(exports.RemoteControlAccess || (exports.RemoteControlAccess = {}));
15671
- /**
15672
- * Enum for process start strategy
15673
- */
15674
- exports.StartStrategy = void 0;
15675
- (function (StartStrategy) {
15676
- StartStrategy["All"] = "All";
15677
- StartStrategy["Specific"] = "Specific";
15678
- StartStrategy["RobotCount"] = "RobotCount";
15679
- StartStrategy["JobsCount"] = "JobsCount";
15680
- StartStrategy["ModernJobsCount"] = "ModernJobsCount";
15681
- })(exports.StartStrategy || (exports.StartStrategy = {}));
15682
- /**
15683
- * Enum for package source type
15684
- */
15685
- exports.PackageSourceType = void 0;
15686
- (function (PackageSourceType) {
15687
- PackageSourceType["Manual"] = "Manual";
15688
- PackageSourceType["Schedule"] = "Schedule";
15689
- PackageSourceType["Queue"] = "Queue";
15690
- PackageSourceType["StudioWeb"] = "StudioWeb";
15691
- PackageSourceType["IntegrationTrigger"] = "IntegrationTrigger";
15692
- PackageSourceType["StudioDesktop"] = "StudioDesktop";
15693
- PackageSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
15694
- PackageSourceType["Apps"] = "Apps";
15695
- PackageSourceType["SAP"] = "SAP";
15696
- PackageSourceType["HttpTrigger"] = "HttpTrigger";
15697
- PackageSourceType["HttpTriggerWithCallback"] = "HttpTriggerWithCallback";
15698
- PackageSourceType["RobotAPI"] = "RobotAPI";
15699
- PackageSourceType["Assistant"] = "Assistant";
15700
- PackageSourceType["CommandLine"] = "CommandLine";
15701
- PackageSourceType["RobotNetAPI"] = "RobotNetAPI";
15702
- PackageSourceType["Autopilot"] = "Autopilot";
15703
- PackageSourceType["TestManager"] = "TestManager";
15704
- PackageSourceType["AgentService"] = "AgentService";
15705
- PackageSourceType["ProcessOrchestration"] = "ProcessOrchestration";
15706
- PackageSourceType["PluginEcosystem"] = "PluginEcosystem";
15707
- PackageSourceType["PerformanceTesting"] = "PerformanceTesting";
15708
- PackageSourceType["AgentHub"] = "AgentHub";
15709
- PackageSourceType["ApiWorkflow"] = "ApiWorkflow";
15710
- })(exports.PackageSourceType || (exports.PackageSourceType = {}));
15711
- /**
15712
- * Enum for job source type
15713
- */
15714
- exports.JobSourceType = void 0;
15715
- (function (JobSourceType) {
15716
- JobSourceType["Manual"] = "Manual";
15717
- JobSourceType["Schedule"] = "Schedule";
15718
- JobSourceType["Agent"] = "Agent";
15719
- JobSourceType["Queue"] = "Queue";
15720
- JobSourceType["StudioWeb"] = "StudioWeb";
15721
- JobSourceType["IntegrationTrigger"] = "IntegrationTrigger";
15722
- JobSourceType["StudioDesktop"] = "StudioDesktop";
15723
- JobSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
15724
- JobSourceType["Apps"] = "Apps";
15725
- JobSourceType["SAP"] = "SAP";
15726
- JobSourceType["HttpTrigger"] = "HttpTrigger";
15727
- JobSourceType["HttpTriggerCallback"] = "HttpTriggerCallback";
15728
- JobSourceType["RobotAPI"] = "RobotAPI";
15729
- JobSourceType["CommandLine"] = "CommandLine";
15730
- JobSourceType["RobotNetAPI"] = "RobotNetAPI";
15731
- JobSourceType["Autopilot"] = "Autopilot";
15732
- JobSourceType["TestManager"] = "TestManager";
15733
- JobSourceType["AgentService"] = "AgentService";
15734
- JobSourceType["ProcessOrchestration"] = "ProcessOrchestration";
15735
- JobSourceType["PluginEcosystem"] = "PluginEcosystem";
15736
- JobSourceType["PerformanceTesting"] = "PerformanceTesting";
15737
- JobSourceType["AgentHub"] = "AgentHub";
15738
- JobSourceType["ApiWorkflow"] = "ApiWorkflow";
15739
- JobSourceType["CaseManagement"] = "CaseManagement";
15740
- })(exports.JobSourceType || (exports.JobSourceType = {}));
15741
- /**
15742
- * Enum for stop strategy
15743
- */
15744
- exports.StopStrategy = void 0;
15745
- (function (StopStrategy) {
15746
- StopStrategy["SoftStop"] = "SoftStop";
15747
- StopStrategy["Kill"] = "Kill";
15748
- })(exports.StopStrategy || (exports.StopStrategy = {}));
15749
- /**
15750
- * Enum for runtime type
15751
- */
15752
- exports.RuntimeType = void 0;
15753
- (function (RuntimeType) {
15754
- RuntimeType["NonProduction"] = "NonProduction";
15755
- RuntimeType["Attended"] = "Attended";
15756
- RuntimeType["Unattended"] = "Unattended";
15757
- RuntimeType["Development"] = "Development";
15758
- RuntimeType["Studio"] = "Studio";
15759
- RuntimeType["RpaDeveloper"] = "RpaDeveloper";
15760
- RuntimeType["StudioX"] = "StudioX";
15761
- RuntimeType["CitizenDeveloper"] = "CitizenDeveloper";
15762
- RuntimeType["Headless"] = "Headless";
15763
- RuntimeType["StudioPro"] = "StudioPro";
15764
- RuntimeType["RpaDeveloperPro"] = "RpaDeveloperPro";
15765
- RuntimeType["TestAutomation"] = "TestAutomation";
15766
- RuntimeType["AutomationCloud"] = "AutomationCloud";
15767
- RuntimeType["Serverless"] = "Serverless";
15768
- RuntimeType["AutomationKit"] = "AutomationKit";
15769
- RuntimeType["ServerlessTestAutomation"] = "ServerlessTestAutomation";
15770
- RuntimeType["AutomationCloudTestAutomation"] = "AutomationCloudTestAutomation";
15771
- RuntimeType["AttendedStudioWeb"] = "AttendedStudioWeb";
15772
- RuntimeType["Hosting"] = "Hosting";
15773
- RuntimeType["AssistantWeb"] = "AssistantWeb";
15774
- RuntimeType["ProcessOrchestration"] = "ProcessOrchestration";
15775
- RuntimeType["AgentService"] = "AgentService";
15776
- RuntimeType["AppTest"] = "AppTest";
15777
- RuntimeType["PerformanceTest"] = "PerformanceTest";
15778
- RuntimeType["BusinessRule"] = "BusinessRule";
15779
- RuntimeType["CaseManagement"] = "CaseManagement";
15780
- RuntimeType["Flow"] = "Flow";
15781
- })(exports.RuntimeType || (exports.RuntimeType = {}));
15782
- /**
15783
- * Enum for job type
15784
- */
15785
- exports.JobType = void 0;
15786
- (function (JobType) {
15787
- JobType["Unattended"] = "Unattended";
15788
- JobType["Attended"] = "Attended";
15789
- JobType["ServerlessGeneric"] = "ServerlessGeneric";
15790
- })(exports.JobType || (exports.JobType = {}));
15791
-
15792
16041
  /**
15793
16042
  * Maps fields for Queue entities to ensure consistent naming
15794
16043
  */
@@ -16274,6 +16523,19 @@
16274
16523
  ...CommonFieldMap
16275
16524
  };
16276
16525
 
16526
+ /**
16527
+ * Status of a feedback entry in the review workflow
16528
+ */
16529
+ exports.FeedbackStatus = void 0;
16530
+ (function (FeedbackStatus) {
16531
+ /** Feedback is awaiting review */
16532
+ FeedbackStatus[FeedbackStatus["Pending"] = 0] = "Pending";
16533
+ /** Feedback has been approved and confirmed */
16534
+ FeedbackStatus[FeedbackStatus["Approved"] = 1] = "Approved";
16535
+ /** Feedback has been dismissed */
16536
+ FeedbackStatus[FeedbackStatus["Dismissed"] = 2] = "Dismissed";
16537
+ })(exports.FeedbackStatus || (exports.FeedbackStatus = {}));
16538
+
16277
16539
  /**
16278
16540
  * Asset resolution utilities for UiPath Coded Apps
16279
16541
  *