@uipath/uipath-typescript 1.2.1 → 1.2.2

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 (40) hide show
  1. package/dist/assets/index.cjs +1 -1
  2. package/dist/assets/index.d.ts +2 -1
  3. package/dist/assets/index.mjs +1 -1
  4. package/dist/attachments/index.cjs +1944 -0
  5. package/dist/attachments/index.d.ts +399 -0
  6. package/dist/attachments/index.mjs +1941 -0
  7. package/dist/buckets/index.cjs +1 -1
  8. package/dist/buckets/index.d.ts +4 -2
  9. package/dist/buckets/index.mjs +1 -1
  10. package/dist/cases/index.cjs +95 -48
  11. package/dist/cases/index.d.ts +31 -2
  12. package/dist/cases/index.mjs +95 -48
  13. package/dist/conversational-agent/index.cjs +1 -1
  14. package/dist/conversational-agent/index.d.ts +10 -5
  15. package/dist/conversational-agent/index.mjs +1 -1
  16. package/dist/core/index.cjs +109 -17
  17. package/dist/core/index.d.ts +1 -1
  18. package/dist/core/index.mjs +109 -17
  19. package/dist/entities/index.cjs +1 -1
  20. package/dist/entities/index.d.ts +33 -21
  21. package/dist/entities/index.mjs +1 -1
  22. package/dist/index.cjs +569 -307
  23. package/dist/index.d.ts +468 -70
  24. package/dist/index.mjs +570 -308
  25. package/dist/index.umd.js +566 -304
  26. package/dist/jobs/index.cjs +2036 -0
  27. package/dist/jobs/index.d.ts +724 -0
  28. package/dist/jobs/index.mjs +2033 -0
  29. package/dist/maestro-processes/index.cjs +1 -1
  30. package/dist/maestro-processes/index.mjs +1 -1
  31. package/dist/processes/index.cjs +67 -1
  32. package/dist/processes/index.d.ts +80 -15
  33. package/dist/processes/index.mjs +68 -2
  34. package/dist/queues/index.cjs +1 -1
  35. package/dist/queues/index.d.ts +2 -1
  36. package/dist/queues/index.mjs +1 -1
  37. package/dist/tasks/index.cjs +1319 -1272
  38. package/dist/tasks/index.d.ts +331 -287
  39. package/dist/tasks/index.mjs +1319 -1272
  40. package/package.json +23 -2
package/dist/index.cjs CHANGED
@@ -4387,6 +4387,234 @@ function getErrorDetails(error) {
4387
4387
  };
4388
4388
  }
4389
4389
 
4390
+ /**
4391
+ * Types of tasks available in Action Center.
4392
+ * Each type determines the task's behavior, UI rendering, and completion requirements.
4393
+ */
4394
+ exports.TaskType = void 0;
4395
+ (function (TaskType) {
4396
+ /** A form-based task that renders a UiPath form layout for user input */
4397
+ TaskType["Form"] = "FormTask";
4398
+ /** An externally managed task handled outside of Action Center */
4399
+ TaskType["External"] = "ExternalTask";
4400
+ /** A task powered by a UiPath App */
4401
+ TaskType["App"] = "AppTask";
4402
+ /** A document validation task for reviewing and correcting extracted document data */
4403
+ TaskType["DocumentValidation"] = "DocumentValidationTask";
4404
+ /** A document classification task for categorizing documents */
4405
+ TaskType["DocumentClassification"] = "DocumentClassificationTask";
4406
+ /** A data labeling task for annotating training data */
4407
+ TaskType["DataLabeling"] = "DataLabelingTask";
4408
+ })(exports.TaskType || (exports.TaskType = {}));
4409
+ exports.TaskPriority = void 0;
4410
+ (function (TaskPriority) {
4411
+ TaskPriority["Low"] = "Low";
4412
+ TaskPriority["Medium"] = "Medium";
4413
+ TaskPriority["High"] = "High";
4414
+ TaskPriority["Critical"] = "Critical";
4415
+ })(exports.TaskPriority || (exports.TaskPriority = {}));
4416
+ exports.TaskStatus = void 0;
4417
+ (function (TaskStatus) {
4418
+ TaskStatus["Unassigned"] = "Unassigned";
4419
+ TaskStatus["Pending"] = "Pending";
4420
+ TaskStatus["Completed"] = "Completed";
4421
+ })(exports.TaskStatus || (exports.TaskStatus = {}));
4422
+ exports.TaskSlaCriteria = void 0;
4423
+ (function (TaskSlaCriteria) {
4424
+ TaskSlaCriteria["TaskCreated"] = "TaskCreated";
4425
+ TaskSlaCriteria["TaskAssigned"] = "TaskAssigned";
4426
+ TaskSlaCriteria["TaskCompleted"] = "TaskCompleted";
4427
+ })(exports.TaskSlaCriteria || (exports.TaskSlaCriteria = {}));
4428
+ exports.TaskSlaStatus = void 0;
4429
+ (function (TaskSlaStatus) {
4430
+ TaskSlaStatus["OverdueLater"] = "OverdueLater";
4431
+ TaskSlaStatus["OverdueSoon"] = "OverdueSoon";
4432
+ TaskSlaStatus["Overdue"] = "Overdue";
4433
+ TaskSlaStatus["CompletedInTime"] = "CompletedInTime";
4434
+ })(exports.TaskSlaStatus || (exports.TaskSlaStatus = {}));
4435
+ exports.TaskSourceName = void 0;
4436
+ (function (TaskSourceName) {
4437
+ TaskSourceName["Agent"] = "Agent";
4438
+ TaskSourceName["Workflow"] = "Workflow";
4439
+ TaskSourceName["Maestro"] = "Maestro";
4440
+ TaskSourceName["Default"] = "Default";
4441
+ })(exports.TaskSourceName || (exports.TaskSourceName = {}));
4442
+ /**
4443
+ * Task activity types
4444
+ */
4445
+ exports.TaskActivityType = void 0;
4446
+ (function (TaskActivityType) {
4447
+ TaskActivityType["Created"] = "Created";
4448
+ TaskActivityType["Assigned"] = "Assigned";
4449
+ TaskActivityType["Reassigned"] = "Reassigned";
4450
+ TaskActivityType["Unassigned"] = "Unassigned";
4451
+ TaskActivityType["Saved"] = "Saved";
4452
+ TaskActivityType["Forwarded"] = "Forwarded";
4453
+ TaskActivityType["Completed"] = "Completed";
4454
+ TaskActivityType["Commented"] = "Commented";
4455
+ TaskActivityType["Deleted"] = "Deleted";
4456
+ TaskActivityType["BulkSaved"] = "BulkSaved";
4457
+ TaskActivityType["BulkCompleted"] = "BulkCompleted";
4458
+ TaskActivityType["FirstOpened"] = "FirstOpened";
4459
+ })(exports.TaskActivityType || (exports.TaskActivityType = {}));
4460
+
4461
+ /**
4462
+ * Base path constants for different services
4463
+ */
4464
+ const ORCHESTRATOR_BASE = 'orchestrator_';
4465
+ const PIMS_BASE = 'pims_';
4466
+ const DATAFABRIC_BASE = 'datafabric_';
4467
+ const IDENTITY_BASE = 'identity_';
4468
+
4469
+ /**
4470
+ * Orchestrator Service Endpoints
4471
+ */
4472
+ /**
4473
+ * Task Service (Action Center) Endpoints
4474
+ */
4475
+ const TASK_ENDPOINTS = {
4476
+ CREATE_GENERIC_TASK: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/CreateTask`,
4477
+ GET_TASK_USERS: (folderId) => `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTaskUsers(organizationUnitId=${folderId})`,
4478
+ GET_TASKS_ACROSS_FOLDERS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFolders`,
4479
+ GET_TASKS_ACROSS_FOLDERS_ADMIN: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFoldersForAdmin`,
4480
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Tasks(${id})`,
4481
+ ASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.AssignTasks`,
4482
+ REASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.ReassignTasks`,
4483
+ UNASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.UnassignTasks`,
4484
+ COMPLETE_FORM_TASK: `${ORCHESTRATOR_BASE}/forms/TaskForms/CompleteTask`,
4485
+ COMPLETE_APP_TASK: `${ORCHESTRATOR_BASE}/tasks/AppTasks/CompleteAppTask`,
4486
+ COMPLETE_GENERIC_TASK: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/CompleteTask`,
4487
+ GET_TASK_FORM_BY_ID: `${ORCHESTRATOR_BASE}/forms/TaskForms/GetTaskFormById`,
4488
+ GET_GENERIC_TASK_BY_ID: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/GetTaskDataById`,
4489
+ GET_APP_TASK_BY_ID: `${ORCHESTRATOR_BASE}/tasks/AppTasks/GetAppTaskById`,
4490
+ };
4491
+ /**
4492
+ * Orchestrator Bucket Endpoints
4493
+ */
4494
+ const BUCKET_ENDPOINTS = {
4495
+ GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Buckets`,
4496
+ GET_ALL: `${ORCHESTRATOR_BASE}/odata/Buckets/UiPath.Server.Configuration.OData.GetBucketsAcrossFolders`,
4497
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})`,
4498
+ GET_FILE_META_DATA: (id) => `${ORCHESTRATOR_BASE}/api/Buckets/${id}/ListFiles`,
4499
+ GET_READ_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetReadUri`,
4500
+ GET_WRITE_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetWriteUri`,
4501
+ };
4502
+ /**
4503
+ * Orchestrator Process Service Endpoints
4504
+ */
4505
+ const PROCESS_ENDPOINTS = {
4506
+ GET_ALL: `${ORCHESTRATOR_BASE}/odata/Releases`,
4507
+ START_PROCESS: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs`,
4508
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Releases(${id})`,
4509
+ };
4510
+ /**
4511
+ * Orchestrator Queue Service Endpoints
4512
+ */
4513
+ const QUEUE_ENDPOINTS = {
4514
+ GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/QueueDefinitions`,
4515
+ GET_ALL: `${ORCHESTRATOR_BASE}/odata/QueueDefinitions/UiPath.Server.Configuration.OData.GetQueuesAcrossFolders`,
4516
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/QueueDefinitions(${id})`,
4517
+ };
4518
+ /**
4519
+ * Orchestrator Job Service Endpoints
4520
+ */
4521
+ const JOB_ENDPOINTS = {
4522
+ GET_ALL: `${ORCHESTRATOR_BASE}/odata/Jobs`,
4523
+ };
4524
+ /**
4525
+ * Orchestrator Asset Service Endpoints
4526
+ */
4527
+ const ASSET_ENDPOINTS = {
4528
+ GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetFiltered`,
4529
+ GET_ALL: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetAssetsAcrossFolders`,
4530
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Assets(${id})`,
4531
+ };
4532
+ /**
4533
+ * Orchestrator Attachment Service Endpoints
4534
+ */
4535
+ const ORCHESTRATOR_ATTACHMENT_ENDPOINTS = {
4536
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Attachments(${id})`,
4537
+ };
4538
+
4539
+ /**
4540
+ * Maestro Service Endpoints
4541
+ */
4542
+ /**
4543
+ * Maestro Process Service Endpoints
4544
+ */
4545
+ const MAESTRO_ENDPOINTS = {
4546
+ PROCESSES: {
4547
+ GET_ALL: `${PIMS_BASE}/api/v1/processes/summary`,
4548
+ GET_SETTINGS: (processKey) => `${PIMS_BASE}/api/v1/processes/${processKey}/settings`,
4549
+ },
4550
+ INSTANCES: {
4551
+ GET_ALL: `${PIMS_BASE}/api/v1/instances`,
4552
+ GET_BY_ID: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}`,
4553
+ GET_EXECUTION_HISTORY: (instanceId) => `${PIMS_BASE}/api/v1/spans/${instanceId}`,
4554
+ GET_BPMN: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/bpmn`,
4555
+ GET_VARIABLES: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/variables`,
4556
+ CANCEL: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/cancel`,
4557
+ PAUSE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/pause`,
4558
+ RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume`,
4559
+ },
4560
+ INCIDENTS: {
4561
+ GET_ALL: `${PIMS_BASE}/api/v1/incidents/summary`,
4562
+ GET_BY_PROCESS: (processKey) => `${PIMS_BASE}/api/v1/incidents/process/${processKey}`,
4563
+ GET_BY_INSTANCE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/incidents`,
4564
+ },
4565
+ CASES: {
4566
+ GET_CASE_JSON: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/case-json`,
4567
+ GET_ELEMENT_EXECUTIONS: (instanceId) => `${PIMS_BASE}/api/v1/element-executions/case-instances/${instanceId}`,
4568
+ REOPEN: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/reopen`,
4569
+ },
4570
+ };
4571
+
4572
+ /**
4573
+ * Data Fabric Service Endpoints
4574
+ */
4575
+ /**
4576
+ * Data Fabric Entity Service Endpoints
4577
+ */
4578
+ const DATA_FABRIC_ENDPOINTS = {
4579
+ ENTITY: {
4580
+ GET_ALL: `${DATAFABRIC_BASE}/api/Entity`,
4581
+ GET_ENTITY_RECORDS: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read`,
4582
+ GET_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
4583
+ GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read/${recordId}`,
4584
+ INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert`,
4585
+ BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
4586
+ UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
4587
+ UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
4588
+ DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
4589
+ DOWNLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4590
+ UPLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4591
+ DELETE_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4592
+ },
4593
+ CHOICESETS: {
4594
+ GET_ALL: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
4595
+ GET_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/query_expansion`,
4596
+ },
4597
+ };
4598
+
4599
+ /**
4600
+ * Identity/Authentication Endpoints
4601
+ */
4602
+ /**
4603
+ * Identity Service Endpoints
4604
+ */
4605
+ const IDENTITY_ENDPOINTS = {
4606
+ TOKEN: `${IDENTITY_BASE}/connect/token`,
4607
+ AUTHORIZE: `${IDENTITY_BASE}/connect/authorize`,
4608
+ };
4609
+
4610
+ const TASK_TYPE_ENDPOINTS = {
4611
+ [exports.TaskType.Form]: TASK_ENDPOINTS.GET_TASK_FORM_BY_ID,
4612
+ [exports.TaskType.App]: TASK_ENDPOINTS.GET_APP_TASK_BY_ID,
4613
+ [exports.TaskType.DocumentValidation]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
4614
+ [exports.TaskType.DocumentClassification]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
4615
+ [exports.TaskType.External]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
4616
+ [exports.TaskType.DataLabeling]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
4617
+ };
4390
4618
  var ActionCenterEventNames;
4391
4619
  (function (ActionCenterEventNames) {
4392
4620
  ActionCenterEventNames["TOKENREFRESHED"] = "AC.tokenRefreshed";
@@ -4694,210 +4922,75 @@ class TokenManager {
4694
4922
  * Updates execution context with token information
4695
4923
  */
4696
4924
  _updateExecutionContext(tokenInfo) {
4697
- this.executionContext.set('tokenInfo', tokenInfo);
4698
- }
4699
- /**
4700
- * Refreshes the access token using the stored refresh token.
4701
- * This method only works for OAuth flow.
4702
- * Uses a lock mechanism to prevent multiple simultaneous refreshes.
4703
- * @returns A promise that resolves to the new AuthToken
4704
- * @throws Error if not in OAuth flow, refresh token is missing, or the request fails
4705
- */
4706
- async refreshAccessToken() {
4707
- // If there's already a refresh in progress, return that promise
4708
- if (this.refreshPromise) {
4709
- return this.refreshPromise;
4710
- }
4711
- try {
4712
- // Create new refresh promise
4713
- this.refreshPromise = this._doRefreshToken();
4714
- // Wait for refresh to complete
4715
- const result = await this.refreshPromise;
4716
- return result;
4717
- }
4718
- finally {
4719
- // Clear the refresh promise when done (success or failure)
4720
- this.refreshPromise = null;
4721
- }
4722
- }
4723
- /**
4724
- * Internal method to perform the actual token refresh
4725
- */
4726
- async _doRefreshToken() {
4727
- // Check if we're in OAuth flow
4728
- if (!hasOAuthConfig(this.config)) {
4729
- throw new Error('refreshAccessToken is only available in OAuth flow');
4730
- }
4731
- // Get current token info from token manager
4732
- const tokenInfo = this.getTokenInfo();
4733
- if (!tokenInfo?.refreshToken) {
4734
- throw new Error('No refresh token available. User may need to re-authenticate.');
4735
- }
4736
- const orgName = this.config.orgName;
4737
- const body = new URLSearchParams({
4738
- grant_type: 'refresh_token',
4739
- client_id: this.config.clientId,
4740
- refresh_token: tokenInfo.refreshToken
4741
- });
4742
- const response = await fetch(`${this.config.baseUrl}/${orgName}/identity_/connect/token`, {
4743
- method: 'POST',
4744
- headers: {
4745
- 'Content-Type': 'application/x-www-form-urlencoded'
4746
- },
4747
- body: body.toString()
4748
- });
4749
- if (!response.ok) {
4750
- const errorData = await response.json().catch(() => ({ message: response.statusText }));
4751
- console.error("Token refresh error:", errorData);
4752
- // Clear the invalid token to prevent further failed requests
4753
- this.clearToken();
4754
- throw new Error(`Failed to refresh access token: ${JSON.stringify(errorData)}`);
4755
- }
4756
- const token = await response.json();
4757
- this.setToken({
4758
- token: token.access_token,
4759
- type: 'oauth',
4760
- expiresAt: new Date(Date.now() + token.expires_in * 1000),
4761
- refreshToken: token.refresh_token
4762
- });
4763
- return token;
4764
- }
4765
- }
4766
-
4767
- /**
4768
- * Base path constants for different services
4769
- */
4770
- const ORCHESTRATOR_BASE = 'orchestrator_';
4771
- const PIMS_BASE = 'pims_';
4772
- const DATAFABRIC_BASE = 'datafabric_';
4773
- const IDENTITY_BASE = 'identity_';
4774
-
4775
- /**
4776
- * Orchestrator Service Endpoints
4777
- */
4778
- /**
4779
- * Task Service (Action Center) Endpoints
4780
- */
4781
- const TASK_ENDPOINTS = {
4782
- CREATE_GENERIC_TASK: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/CreateTask`,
4783
- GET_TASK_USERS: (folderId) => `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTaskUsers(organizationUnitId=${folderId})`,
4784
- GET_TASKS_ACROSS_FOLDERS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFolders`,
4785
- GET_TASKS_ACROSS_FOLDERS_ADMIN: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFoldersForAdmin`,
4786
- GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Tasks(${id})`,
4787
- ASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.AssignTasks`,
4788
- REASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.ReassignTasks`,
4789
- UNASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.UnassignTasks`,
4790
- COMPLETE_FORM_TASK: `${ORCHESTRATOR_BASE}/forms/TaskForms/CompleteTask`,
4791
- COMPLETE_APP_TASK: `${ORCHESTRATOR_BASE}/tasks/AppTasks/CompleteAppTask`,
4792
- COMPLETE_GENERIC_TASK: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/CompleteTask`,
4793
- GET_TASK_FORM_BY_ID: `${ORCHESTRATOR_BASE}/forms/TaskForms/GetTaskFormById`,
4794
- };
4795
- /**
4796
- * Orchestrator Bucket Endpoints
4797
- */
4798
- const BUCKET_ENDPOINTS = {
4799
- GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Buckets`,
4800
- GET_ALL: `${ORCHESTRATOR_BASE}/odata/Buckets/UiPath.Server.Configuration.OData.GetBucketsAcrossFolders`,
4801
- GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})`,
4802
- GET_FILE_META_DATA: (id) => `${ORCHESTRATOR_BASE}/api/Buckets/${id}/ListFiles`,
4803
- GET_READ_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetReadUri`,
4804
- GET_WRITE_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetWriteUri`,
4805
- };
4806
- /**
4807
- * Orchestrator Process Service Endpoints
4808
- */
4809
- const PROCESS_ENDPOINTS = {
4810
- GET_ALL: `${ORCHESTRATOR_BASE}/odata/Releases`,
4811
- START_PROCESS: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs`,
4812
- GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Releases(${id})`,
4813
- };
4814
- /**
4815
- * Orchestrator Queue Service Endpoints
4816
- */
4817
- const QUEUE_ENDPOINTS = {
4818
- GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/QueueDefinitions`,
4819
- GET_ALL: `${ORCHESTRATOR_BASE}/odata/QueueDefinitions/UiPath.Server.Configuration.OData.GetQueuesAcrossFolders`,
4820
- GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/QueueDefinitions(${id})`,
4821
- };
4822
- /**
4823
- * Orchestrator Asset Service Endpoints
4824
- */
4825
- const ASSET_ENDPOINTS = {
4826
- GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetFiltered`,
4827
- GET_ALL: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetAssetsAcrossFolders`,
4828
- GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Assets(${id})`,
4829
- };
4830
-
4831
- /**
4832
- * Maestro Service Endpoints
4833
- */
4834
- /**
4835
- * Maestro Process Service Endpoints
4836
- */
4837
- const MAESTRO_ENDPOINTS = {
4838
- PROCESSES: {
4839
- GET_ALL: `${PIMS_BASE}/api/v1/processes/summary`,
4840
- GET_SETTINGS: (processKey) => `${PIMS_BASE}/api/v1/processes/${processKey}/settings`,
4841
- },
4842
- INSTANCES: {
4843
- GET_ALL: `${PIMS_BASE}/api/v1/instances`,
4844
- GET_BY_ID: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}`,
4845
- GET_EXECUTION_HISTORY: (instanceId) => `${PIMS_BASE}/api/v1/spans/${instanceId}`,
4846
- GET_BPMN: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/bpmn`,
4847
- GET_VARIABLES: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/variables`,
4848
- CANCEL: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/cancel`,
4849
- PAUSE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/pause`,
4850
- RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume`,
4851
- },
4852
- INCIDENTS: {
4853
- GET_ALL: `${PIMS_BASE}/api/v1/incidents/summary`,
4854
- GET_BY_PROCESS: (processKey) => `${PIMS_BASE}/api/v1/incidents/process/${processKey}`,
4855
- GET_BY_INSTANCE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/incidents`,
4856
- },
4857
- CASES: {
4858
- GET_CASE_JSON: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/case-json`,
4859
- GET_ELEMENT_EXECUTIONS: (instanceId) => `${PIMS_BASE}/api/v1/element-executions/case-instances/${instanceId}`,
4860
- REOPEN: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/reopen`,
4861
- },
4862
- };
4863
-
4864
- /**
4865
- * Data Fabric Service Endpoints
4866
- */
4867
- /**
4868
- * Data Fabric Entity Service Endpoints
4869
- */
4870
- const DATA_FABRIC_ENDPOINTS = {
4871
- ENTITY: {
4872
- GET_ALL: `${DATAFABRIC_BASE}/api/Entity`,
4873
- GET_ENTITY_RECORDS: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read`,
4874
- GET_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
4875
- GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read/${recordId}`,
4876
- INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert`,
4877
- BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
4878
- UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
4879
- UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
4880
- DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
4881
- DOWNLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4882
- UPLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4883
- DELETE_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4884
- },
4885
- CHOICESETS: {
4886
- GET_ALL: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
4887
- GET_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/query_expansion`,
4888
- },
4889
- };
4890
-
4891
- /**
4892
- * Identity/Authentication Endpoints
4893
- */
4894
- /**
4895
- * Identity Service Endpoints
4896
- */
4897
- const IDENTITY_ENDPOINTS = {
4898
- TOKEN: `${IDENTITY_BASE}/connect/token`,
4899
- AUTHORIZE: `${IDENTITY_BASE}/connect/authorize`,
4900
- };
4925
+ this.executionContext.set('tokenInfo', tokenInfo);
4926
+ }
4927
+ /**
4928
+ * Refreshes the access token using the stored refresh token.
4929
+ * This method only works for OAuth flow.
4930
+ * Uses a lock mechanism to prevent multiple simultaneous refreshes.
4931
+ * @returns A promise that resolves to the new AuthToken
4932
+ * @throws Error if not in OAuth flow, refresh token is missing, or the request fails
4933
+ */
4934
+ async refreshAccessToken() {
4935
+ // If there's already a refresh in progress, return that promise
4936
+ if (this.refreshPromise) {
4937
+ return this.refreshPromise;
4938
+ }
4939
+ try {
4940
+ // Create new refresh promise
4941
+ this.refreshPromise = this._doRefreshToken();
4942
+ // Wait for refresh to complete
4943
+ const result = await this.refreshPromise;
4944
+ return result;
4945
+ }
4946
+ finally {
4947
+ // Clear the refresh promise when done (success or failure)
4948
+ this.refreshPromise = null;
4949
+ }
4950
+ }
4951
+ /**
4952
+ * Internal method to perform the actual token refresh
4953
+ */
4954
+ async _doRefreshToken() {
4955
+ // Check if we're in OAuth flow
4956
+ if (!hasOAuthConfig(this.config)) {
4957
+ throw new Error('refreshAccessToken is only available in OAuth flow');
4958
+ }
4959
+ // Get current token info from token manager
4960
+ const tokenInfo = this.getTokenInfo();
4961
+ if (!tokenInfo?.refreshToken) {
4962
+ throw new Error('No refresh token available. User may need to re-authenticate.');
4963
+ }
4964
+ const orgName = this.config.orgName;
4965
+ const body = new URLSearchParams({
4966
+ grant_type: 'refresh_token',
4967
+ client_id: this.config.clientId,
4968
+ refresh_token: tokenInfo.refreshToken
4969
+ });
4970
+ const response = await fetch(`${this.config.baseUrl}/${orgName}/identity_/connect/token`, {
4971
+ method: 'POST',
4972
+ headers: {
4973
+ 'Content-Type': 'application/x-www-form-urlencoded'
4974
+ },
4975
+ body: body.toString()
4976
+ });
4977
+ if (!response.ok) {
4978
+ const errorData = await response.json().catch(() => ({ message: response.statusText }));
4979
+ console.error("Token refresh error:", errorData);
4980
+ // Clear the invalid token to prevent further failed requests
4981
+ this.clearToken();
4982
+ throw new Error(`Failed to refresh access token: ${JSON.stringify(errorData)}`);
4983
+ }
4984
+ const token = await response.json();
4985
+ this.setToken({
4986
+ token: token.access_token,
4987
+ type: 'oauth',
4988
+ expiresAt: new Date(Date.now() + token.expires_in * 1000),
4989
+ refreshToken: token.refresh_token
4990
+ });
4991
+ return token;
4992
+ }
4993
+ }
4901
4994
 
4902
4995
  class AuthService {
4903
4996
  constructor(config, executionContext) {
@@ -5326,7 +5419,7 @@ function normalizeBaseUrl(url) {
5326
5419
  // Connection string placeholder that will be replaced during build
5327
5420
  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";
5328
5421
  // SDK Version placeholder
5329
- const SDK_VERSION = "1.2.1";
5422
+ const SDK_VERSION = "1.2.2";
5330
5423
  const VERSION = "Version";
5331
5424
  const SERVICE = "Service";
5332
5425
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -9322,63 +9415,27 @@ const CASE_INSTANCE_TASK_FILTER = (caseInstanceId) => `Tags/any(tags:tags/Displa
9322
9415
  */
9323
9416
  const CASE_INSTANCE_TASK_EXPAND = 'AssignedToUser,Activities';
9324
9417
 
9325
- exports.TaskType = void 0;
9326
- (function (TaskType) {
9327
- TaskType["Form"] = "FormTask";
9328
- TaskType["External"] = "ExternalTask";
9329
- TaskType["App"] = "AppTask";
9330
- })(exports.TaskType || (exports.TaskType = {}));
9331
- exports.TaskPriority = void 0;
9332
- (function (TaskPriority) {
9333
- TaskPriority["Low"] = "Low";
9334
- TaskPriority["Medium"] = "Medium";
9335
- TaskPriority["High"] = "High";
9336
- TaskPriority["Critical"] = "Critical";
9337
- })(exports.TaskPriority || (exports.TaskPriority = {}));
9338
- exports.TaskStatus = void 0;
9339
- (function (TaskStatus) {
9340
- TaskStatus["Unassigned"] = "Unassigned";
9341
- TaskStatus["Pending"] = "Pending";
9342
- TaskStatus["Completed"] = "Completed";
9343
- })(exports.TaskStatus || (exports.TaskStatus = {}));
9344
- exports.TaskSlaCriteria = void 0;
9345
- (function (TaskSlaCriteria) {
9346
- TaskSlaCriteria["TaskCreated"] = "TaskCreated";
9347
- TaskSlaCriteria["TaskAssigned"] = "TaskAssigned";
9348
- TaskSlaCriteria["TaskCompleted"] = "TaskCompleted";
9349
- })(exports.TaskSlaCriteria || (exports.TaskSlaCriteria = {}));
9350
- exports.TaskSlaStatus = void 0;
9351
- (function (TaskSlaStatus) {
9352
- TaskSlaStatus["OverdueLater"] = "OverdueLater";
9353
- TaskSlaStatus["OverdueSoon"] = "OverdueSoon";
9354
- TaskSlaStatus["Overdue"] = "Overdue";
9355
- TaskSlaStatus["CompletedInTime"] = "CompletedInTime";
9356
- })(exports.TaskSlaStatus || (exports.TaskSlaStatus = {}));
9357
- exports.TaskSourceName = void 0;
9358
- (function (TaskSourceName) {
9359
- TaskSourceName["Agent"] = "Agent";
9360
- TaskSourceName["Workflow"] = "Workflow";
9361
- TaskSourceName["Maestro"] = "Maestro";
9362
- TaskSourceName["Default"] = "Default";
9363
- })(exports.TaskSourceName || (exports.TaskSourceName = {}));
9364
9418
  /**
9365
- * Task activity types
9419
+ * Maps numeric TaskStatus values (from API) to TaskStatus enum values.
9420
+ * Extend this file with additional field mappings as needed.
9366
9421
  */
9367
- exports.TaskActivityType = void 0;
9368
- (function (TaskActivityType) {
9369
- TaskActivityType["Created"] = "Created";
9370
- TaskActivityType["Assigned"] = "Assigned";
9371
- TaskActivityType["Reassigned"] = "Reassigned";
9372
- TaskActivityType["Unassigned"] = "Unassigned";
9373
- TaskActivityType["Saved"] = "Saved";
9374
- TaskActivityType["Forwarded"] = "Forwarded";
9375
- TaskActivityType["Completed"] = "Completed";
9376
- TaskActivityType["Commented"] = "Commented";
9377
- TaskActivityType["Deleted"] = "Deleted";
9378
- TaskActivityType["BulkSaved"] = "BulkSaved";
9379
- TaskActivityType["BulkCompleted"] = "BulkCompleted";
9380
- TaskActivityType["FirstOpened"] = "FirstOpened";
9381
- })(exports.TaskActivityType || (exports.TaskActivityType = {}));
9422
+ const TaskStatusMap = {
9423
+ 0: exports.TaskStatus.Unassigned,
9424
+ 1: exports.TaskStatus.Pending,
9425
+ 2: exports.TaskStatus.Completed,
9426
+ };
9427
+ // Field mapping for time-related fields to ensure consistent naming
9428
+ const TaskMap = {
9429
+ completionTime: 'completedTime',
9430
+ deletionTime: 'deletedTime',
9431
+ lastModificationTime: 'lastModifiedTime',
9432
+ creationTime: 'createdTime',
9433
+ organizationUnitId: 'folderId'
9434
+ };
9435
+ /**
9436
+ * Default expand parameters
9437
+ */
9438
+ const DEFAULT_TASK_EXPAND = 'AssignedToUser,CreatorUser,LastModifierUser';
9382
9439
 
9383
9440
  /**
9384
9441
  * Creates methods for a task
@@ -9437,28 +9494,6 @@ function createTaskWithMethods(taskData, service) {
9437
9494
  return Object.assign({}, taskData, methods);
9438
9495
  }
9439
9496
 
9440
- /**
9441
- * Maps numeric TaskStatus values (from API) to TaskStatus enum values.
9442
- * Extend this file with additional field mappings as needed.
9443
- */
9444
- const TaskStatusMap = {
9445
- 0: exports.TaskStatus.Unassigned,
9446
- 1: exports.TaskStatus.Pending,
9447
- 2: exports.TaskStatus.Completed,
9448
- };
9449
- // Field mapping for time-related fields to ensure consistent naming
9450
- const TaskMap = {
9451
- completionTime: 'completedTime',
9452
- deletionTime: 'deletedTime',
9453
- lastModificationTime: 'lastModifiedTime',
9454
- creationTime: 'createdTime',
9455
- organizationUnitId: 'folderId'
9456
- };
9457
- /**
9458
- * Default expand parameters
9459
- */
9460
- const DEFAULT_TASK_EXPAND = 'AssignedToUser,CreatorUser,LastModifierUser';
9461
-
9462
9497
  /**
9463
9498
  * Service for interacting with UiPath Tasks API
9464
9499
  */
@@ -9653,29 +9688,38 @@ class TaskService extends BaseService {
9653
9688
  }
9654
9689
  /**
9655
9690
  * Gets a task by ID
9656
- * IMPORTANT: For form tasks, folderId must be provided.
9657
- *
9658
9691
  * @param id - The ID of the task to retrieve
9659
- * @param options - Optional query parameters
9660
- * @param folderId - Optional folder ID (REQUIRED for form tasks)
9661
- * @returns Promise resolving to the task (form tasks will return form-specific data)
9662
- *
9692
+ * @param options - Optional query parameters including taskType for faster retrieval {@link TaskGetByIdOptions}
9693
+ * @param folderId - Optional folder ID (REQUIRED when options.taskType is provided)
9694
+ * @returns Promise resolving to the task
9695
+ * {@link TaskGetResponse}
9663
9696
  * @example
9664
9697
  * ```typescript
9665
- * import { Tasks } from '@uipath/uipath-typescript/tasks';
9698
+ * // Get a task by ID
9699
+ * const task = await tasks.getById(<taskId>);
9666
9700
  *
9667
- * const tasks = new Tasks(sdk);
9701
+ * // Get a form task by ID
9702
+ * const formTask = await tasks.getById(<taskId>, {}, <folderId>);
9668
9703
  *
9669
- * // Get task by ID
9670
- * const task = await tasks.getById(123);
9704
+ * // Access form task properties
9705
+ * console.log(formTask.formLayout);
9671
9706
  *
9672
- * // If the task is a form task, it will automatically return form-specific data
9707
+ * // Get a document validation task by ID (faster with taskType provided in the options)
9708
+ * const dvTask = await tasks.getById(<taskId>, { taskType: TaskType.DocumentValidation }, <folderId>);
9673
9709
  * ```
9674
9710
  */
9675
9711
  async getById(id, options = {}, folderId) {
9712
+ const { taskType, ...restOptions } = options;
9713
+ // If taskType is provided, skip the generic GET_BY_ID call and go directly to the type-specific endpoint
9714
+ if (taskType && taskType in TASK_TYPE_ENDPOINTS) {
9715
+ if (!folderId) {
9716
+ throw new ValidationError({ message: 'folderId is required when taskType is provided' });
9717
+ }
9718
+ return this.getByTaskType(id, folderId, taskType, restOptions);
9719
+ }
9676
9720
  const headers = createHeaders({ [FOLDER_ID]: folderId });
9677
9721
  // Add default expand parameters
9678
- const modifiedOptions = this.addDefaultExpand(options);
9722
+ const modifiedOptions = this.addDefaultExpand(restOptions);
9679
9723
  // prefix all keys in options
9680
9724
  const keysToPrefix = Object.keys(modifiedOptions);
9681
9725
  const apiOptions = addPrefixToKeys(modifiedOptions, ODATA_PREFIX, keysToPrefix);
@@ -9685,10 +9729,10 @@ class TaskService extends BaseService {
9685
9729
  });
9686
9730
  // Transform response from PascalCase to camelCase and normalize time fields
9687
9731
  const transformedTask = transformData(pascalToCamelCaseKeys(response.data), TaskMap);
9688
- // Check if this is a form task and get form-specific data if it is
9689
- if (transformedTask.type === exports.TaskType.Form) {
9690
- const formOptions = { expandOnFormLayout: true };
9691
- return this.getFormTaskById(id, folderId || transformedTask.folderId, formOptions);
9732
+ // Get task type from response and fetch type-specific data
9733
+ const resolvedFolderId = folderId || transformedTask.folderId;
9734
+ if (transformedTask.type in TASK_TYPE_ENDPOINTS) {
9735
+ return this.getByTaskType(id, resolvedFolderId, transformedTask.type, restOptions);
9692
9736
  }
9693
9737
  return createTaskWithMethods(applyDataTransforms(transformedTask, { field: 'status', valueMap: TaskStatusMap }), this);
9694
9738
  }
@@ -9877,24 +9921,33 @@ class TaskService extends BaseService {
9877
9921
  };
9878
9922
  }
9879
9923
  /**
9880
- * Gets a form task by ID (private method)
9924
+ * Routes to the type-specific endpoint based on task type.
9925
+ */
9926
+ getByTaskType(id, folderId, taskType, options = {}) {
9927
+ const endpoint = TASK_TYPE_ENDPOINTS[taskType];
9928
+ const extraParams = taskType === exports.TaskType.Form ? { expandOnFormLayout: true, ...options } : options;
9929
+ return this.getTaskByTypeEndpoint(id, folderId, endpoint, extraParams);
9930
+ }
9931
+ /**
9932
+ * Fetches a task from a type-specific endpoint.
9881
9933
  *
9882
- * @param id - The ID of the form task to retrieve
9934
+ * @param id - The task ID
9883
9935
  * @param folderId - Required folder ID
9884
- * @param options - Optional query parameters
9885
- * @returns Promise resolving to the form task
9936
+ * @param endpoint - The type-specific endpoint to call
9937
+ * @param extraParams - Additional query parameters (e.g. form options)
9938
+ * @returns Promise resolving to the task
9886
9939
  */
9887
- async getFormTaskById(id, folderId, options = {}) {
9940
+ async getTaskByTypeEndpoint(id, folderId, endpoint, extraParams = {}) {
9888
9941
  const headers = createHeaders({ [FOLDER_ID]: folderId });
9889
- const response = await this.get(TASK_ENDPOINTS.GET_TASK_FORM_BY_ID, {
9942
+ const response = await this.get(endpoint, {
9890
9943
  params: {
9891
9944
  taskId: id,
9892
- ...options
9945
+ ...extraParams
9893
9946
  },
9894
9947
  headers
9895
9948
  });
9896
- const transformedFormTask = transformData(response.data, TaskMap);
9897
- return createTaskWithMethods(applyDataTransforms(transformedFormTask, { field: 'status', valueMap: TaskStatusMap }), this);
9949
+ const transformedTask = transformData(response.data, TaskMap);
9950
+ return createTaskWithMethods(applyDataTransforms(transformedTask, { field: 'status', valueMap: TaskStatusMap }), this);
9898
9951
  }
9899
9952
  /**
9900
9953
  * Adds default expand parameters to options
@@ -10909,6 +10962,106 @@ exports.BucketOptions = void 0;
10909
10962
  BucketOptions["AccessDataThroughOrchestrator"] = "AccessDataThroughOrchestrator";
10910
10963
  })(exports.BucketOptions || (exports.BucketOptions = {}));
10911
10964
 
10965
+ /**
10966
+ * Maps fields for Job entities to ensure consistent naming
10967
+ * Semantic renames only — case conversion handled by pascalToCamelCaseKeys()
10968
+ */
10969
+ const JobMap = {
10970
+ creationTime: 'createdTime',
10971
+ lastModificationTime: 'lastModifiedTime',
10972
+ organizationUnitId: 'folderId',
10973
+ organizationUnitFullyQualifiedName: 'folderName',
10974
+ releaseName: 'processName',
10975
+ releaseVersionId: 'processVersionId',
10976
+ processType: 'packageType',
10977
+ release: 'process',
10978
+ };
10979
+
10980
+ /**
10981
+ * Service for interacting with UiPath Orchestrator Jobs API
10982
+ */
10983
+ class JobService extends FolderScopedService {
10984
+ /**
10985
+ * Gets all jobs across folders with optional filtering
10986
+ *
10987
+ * @param options - Query options including optional folderId and pagination options
10988
+ * @returns Promise resolving to array of jobs or paginated response
10989
+ *
10990
+ * @example
10991
+ * ```typescript
10992
+ * import { Jobs } from '@uipath/uipath-typescript/jobs';
10993
+ *
10994
+ * const jobs = new Jobs(sdk);
10995
+ *
10996
+ * // Get all jobs
10997
+ * const allJobs = await jobs.getAll();
10998
+ *
10999
+ * // Get all jobs in a specific folder
11000
+ * const folderJobs = await jobs.getAll({ folderId: 123 });
11001
+ *
11002
+ * // With filtering
11003
+ * const runningJobs = await jobs.getAll({
11004
+ * filter: "state eq 'Running'"
11005
+ * });
11006
+ *
11007
+ * // First page with pagination
11008
+ * const page1 = await jobs.getAll({ pageSize: 10 });
11009
+ *
11010
+ * // Navigate using cursor
11011
+ * if (page1.hasNextPage) {
11012
+ * const page2 = await jobs.getAll({ cursor: page1.nextCursor });
11013
+ * }
11014
+ * ```
11015
+ */
11016
+ async getAll(options) {
11017
+ const transformJobResponse = (job) => transformData(pascalToCamelCaseKeys(job), JobMap);
11018
+ return PaginationHelpers.getAll({
11019
+ serviceAccess: this.createPaginationServiceAccess(),
11020
+ getEndpoint: () => JOB_ENDPOINTS.GET_ALL,
11021
+ getByFolderEndpoint: JOB_ENDPOINTS.GET_ALL,
11022
+ transformFn: transformJobResponse,
11023
+ pagination: {
11024
+ paginationType: PaginationType.OFFSET,
11025
+ itemsField: ODATA_PAGINATION.ITEMS_FIELD,
11026
+ totalCountField: ODATA_PAGINATION.TOTAL_COUNT_FIELD,
11027
+ paginationParams: {
11028
+ pageSizeParam: ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM,
11029
+ offsetParam: ODATA_OFFSET_PARAMS.OFFSET_PARAM,
11030
+ countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM,
11031
+ },
11032
+ },
11033
+ }, options);
11034
+ }
11035
+ }
11036
+ __decorate([
11037
+ track('Jobs.GetAll')
11038
+ ], JobService.prototype, "getAll", null);
11039
+
11040
+ /**
11041
+ * Enum for job sub-state
11042
+ */
11043
+ exports.JobSubState = void 0;
11044
+ (function (JobSubState) {
11045
+ JobSubState["WithFaults"] = "WITH_FAULTS";
11046
+ JobSubState["Manually"] = "MANUALLY";
11047
+ })(exports.JobSubState || (exports.JobSubState = {}));
11048
+ /**
11049
+ * Enum for serverless job type
11050
+ */
11051
+ exports.ServerlessJobType = void 0;
11052
+ (function (ServerlessJobType) {
11053
+ ServerlessJobType["RobotJob"] = "RobotJob";
11054
+ ServerlessJobType["WebApp"] = "WebApp";
11055
+ ServerlessJobType["LoadTest"] = "LoadTest";
11056
+ ServerlessJobType["StudioWebDesigner"] = "StudioWebDesigner";
11057
+ ServerlessJobType["PublishStudioProject"] = "PublishStudioProject";
11058
+ ServerlessJobType["JsApi"] = "JsApi";
11059
+ ServerlessJobType["PythonCodedAgent"] = "PythonCodedAgent";
11060
+ ServerlessJobType["MCPServer"] = "MCPServer";
11061
+ ServerlessJobType["PythonCodedSystemAgent"] = "PythonCodedSystemAgent";
11062
+ ServerlessJobType["PythonAgent"] = "PythonAgent";
11063
+ })(exports.ServerlessJobType || (exports.ServerlessJobType = {}));
11064
+
10912
11065
  /**
10913
11066
  * Maps fields for Process entities to ensure consistent naming
10914
11067
  */
@@ -11091,6 +11244,9 @@ exports.PackageType = void 0;
11091
11244
  PackageType["Api"] = "Api";
11092
11245
  PackageType["MCPServer"] = "MCPServer";
11093
11246
  PackageType["BusinessRules"] = "BusinessRules";
11247
+ PackageType["CaseManagement"] = "CaseManagement";
11248
+ PackageType["Flow"] = "Flow";
11249
+ PackageType["Function"] = "Function";
11094
11250
  })(exports.PackageType || (exports.PackageType = {}));
11095
11251
  /**
11096
11252
  * Enum for job priority
@@ -11169,6 +11325,36 @@ exports.PackageSourceType = void 0;
11169
11325
  PackageSourceType["AgentHub"] = "AgentHub";
11170
11326
  PackageSourceType["ApiWorkflow"] = "ApiWorkflow";
11171
11327
  })(exports.PackageSourceType || (exports.PackageSourceType = {}));
11328
+ /**
11329
+ * Enum for job source type
11330
+ */
11331
+ exports.JobSourceType = void 0;
11332
+ (function (JobSourceType) {
11333
+ JobSourceType["Manual"] = "Manual";
11334
+ JobSourceType["Schedule"] = "Schedule";
11335
+ JobSourceType["Agent"] = "Agent";
11336
+ JobSourceType["Queue"] = "Queue";
11337
+ JobSourceType["StudioWeb"] = "StudioWeb";
11338
+ JobSourceType["IntegrationTrigger"] = "IntegrationTrigger";
11339
+ JobSourceType["StudioDesktop"] = "StudioDesktop";
11340
+ JobSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
11341
+ JobSourceType["Apps"] = "Apps";
11342
+ JobSourceType["SAP"] = "SAP";
11343
+ JobSourceType["HttpTrigger"] = "HttpTrigger";
11344
+ JobSourceType["HttpTriggerCallback"] = "HttpTriggerCallback";
11345
+ JobSourceType["RobotAPI"] = "RobotAPI";
11346
+ JobSourceType["CommandLine"] = "CommandLine";
11347
+ JobSourceType["RobotNetAPI"] = "RobotNetAPI";
11348
+ JobSourceType["Autopilot"] = "Autopilot";
11349
+ JobSourceType["TestManager"] = "TestManager";
11350
+ JobSourceType["AgentService"] = "AgentService";
11351
+ JobSourceType["ProcessOrchestration"] = "ProcessOrchestration";
11352
+ JobSourceType["PluginEcosystem"] = "PluginEcosystem";
11353
+ JobSourceType["PerformanceTesting"] = "PerformanceTesting";
11354
+ JobSourceType["AgentHub"] = "AgentHub";
11355
+ JobSourceType["ApiWorkflow"] = "ApiWorkflow";
11356
+ JobSourceType["CaseManagement"] = "CaseManagement";
11357
+ })(exports.JobSourceType || (exports.JobSourceType = {}));
11172
11358
  /**
11173
11359
  * Enum for stop strategy
11174
11360
  */
@@ -11177,6 +11363,39 @@ exports.StopStrategy = void 0;
11177
11363
  StopStrategy["SoftStop"] = "SoftStop";
11178
11364
  StopStrategy["Kill"] = "Kill";
11179
11365
  })(exports.StopStrategy || (exports.StopStrategy = {}));
11366
+ /**
11367
+ * Enum for runtime type
11368
+ */
11369
+ exports.RuntimeType = void 0;
11370
+ (function (RuntimeType) {
11371
+ RuntimeType["NonProduction"] = "NonProduction";
11372
+ RuntimeType["Attended"] = "Attended";
11373
+ RuntimeType["Unattended"] = "Unattended";
11374
+ RuntimeType["Development"] = "Development";
11375
+ RuntimeType["Studio"] = "Studio";
11376
+ RuntimeType["RpaDeveloper"] = "RpaDeveloper";
11377
+ RuntimeType["StudioX"] = "StudioX";
11378
+ RuntimeType["CitizenDeveloper"] = "CitizenDeveloper";
11379
+ RuntimeType["Headless"] = "Headless";
11380
+ RuntimeType["StudioPro"] = "StudioPro";
11381
+ RuntimeType["RpaDeveloperPro"] = "RpaDeveloperPro";
11382
+ RuntimeType["TestAutomation"] = "TestAutomation";
11383
+ RuntimeType["AutomationCloud"] = "AutomationCloud";
11384
+ RuntimeType["Serverless"] = "Serverless";
11385
+ RuntimeType["AutomationKit"] = "AutomationKit";
11386
+ RuntimeType["ServerlessTestAutomation"] = "ServerlessTestAutomation";
11387
+ RuntimeType["AutomationCloudTestAutomation"] = "AutomationCloudTestAutomation";
11388
+ RuntimeType["AttendedStudioWeb"] = "AttendedStudioWeb";
11389
+ RuntimeType["Hosting"] = "Hosting";
11390
+ RuntimeType["AssistantWeb"] = "AssistantWeb";
11391
+ RuntimeType["ProcessOrchestration"] = "ProcessOrchestration";
11392
+ RuntimeType["AgentService"] = "AgentService";
11393
+ RuntimeType["AppTest"] = "AppTest";
11394
+ RuntimeType["PerformanceTest"] = "PerformanceTest";
11395
+ RuntimeType["BusinessRule"] = "BusinessRule";
11396
+ RuntimeType["CaseManagement"] = "CaseManagement";
11397
+ RuntimeType["Flow"] = "Flow";
11398
+ })(exports.RuntimeType || (exports.RuntimeType = {}));
11180
11399
  /**
11181
11400
  * Enum for job type
11182
11401
  */
@@ -11299,6 +11518,49 @@ __decorate([
11299
11518
  track('Queues.GetById')
11300
11519
  ], QueueService.prototype, "getById", null);
11301
11520
 
11521
+ /**
11522
+ * Maps fields for Attachment entities to ensure consistent naming
11523
+ */
11524
+ const AttachmentsMap = {
11525
+ creationTime: 'createdTime',
11526
+ lastModificationTime: 'lastModifiedTime'
11527
+ };
11528
+
11529
+ class AttachmentService extends BaseService {
11530
+ /**
11531
+ * Gets an attachment by ID
11532
+ * @param id - The UUID of the attachment to retrieve
11533
+ * @param options - Optional query parameters (expand, select)
11534
+ * @returns Promise resolving to the attachment
11535
+ *
11536
+ * @example
11537
+ * ```typescript
11538
+ * import { Attachments } from '@uipath/uipath-typescript/attachments';
11539
+ *
11540
+ * const attachments = new Attachments(sdk);
11541
+ * const attachment = await attachments.getById('12345678-1234-1234-1234-123456789abc');
11542
+ * ```
11543
+ */
11544
+ async getById(id, options = {}) {
11545
+ if (!id) {
11546
+ throw new ValidationError({ message: 'id is required for getById' });
11547
+ }
11548
+ // Prefix all keys in options with $ for OData
11549
+ const keysToPrefix = Object.keys(options);
11550
+ const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
11551
+ const response = await this.get(ORCHESTRATOR_ATTACHMENT_ENDPOINTS.GET_BY_ID(id), {
11552
+ params: apiOptions,
11553
+ });
11554
+ // Transform response from PascalCase to camelCase, then apply field maps
11555
+ const camelCased = pascalToCamelCaseKeys(response.data);
11556
+ camelCased.blobFileAccess = transformData(camelCased.blobFileAccess, BucketMap);
11557
+ return transformData(camelCased, AttachmentsMap);
11558
+ }
11559
+ }
11560
+ __decorate([
11561
+ track('Attachments.GetById')
11562
+ ], AttachmentService.prototype, "getById", null);
11563
+
11302
11564
  /**
11303
11565
  * UiPath SDK - Legacy class providing all services through property getters.
11304
11566
  *