@uipath/uipath-typescript 1.2.0 → 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 +38 -7
  14. package/dist/conversational-agent/index.d.ts +72 -6
  15. package/dist/conversational-agent/index.mjs +38 -7
  16. package/dist/core/index.cjs +118 -17
  17. package/dist/core/index.d.ts +26 -2
  18. package/dist/core/index.mjs +118 -17
  19. package/dist/entities/index.cjs +48 -1
  20. package/dist/entities/index.d.ts +106 -19
  21. package/dist/entities/index.mjs +48 -1
  22. package/dist/index.cjs +585 -267
  23. package/dist/index.d.ts +595 -67
  24. package/dist/index.mjs +586 -268
  25. package/dist/index.umd.js +582 -264
  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 +25 -3
package/dist/index.umd.js CHANGED
@@ -4389,6 +4389,234 @@
4389
4389
  };
4390
4390
  }
4391
4391
 
4392
+ /**
4393
+ * Types of tasks available in Action Center.
4394
+ * Each type determines the task's behavior, UI rendering, and completion requirements.
4395
+ */
4396
+ exports.TaskType = void 0;
4397
+ (function (TaskType) {
4398
+ /** A form-based task that renders a UiPath form layout for user input */
4399
+ TaskType["Form"] = "FormTask";
4400
+ /** An externally managed task handled outside of Action Center */
4401
+ TaskType["External"] = "ExternalTask";
4402
+ /** A task powered by a UiPath App */
4403
+ TaskType["App"] = "AppTask";
4404
+ /** A document validation task for reviewing and correcting extracted document data */
4405
+ TaskType["DocumentValidation"] = "DocumentValidationTask";
4406
+ /** A document classification task for categorizing documents */
4407
+ TaskType["DocumentClassification"] = "DocumentClassificationTask";
4408
+ /** A data labeling task for annotating training data */
4409
+ TaskType["DataLabeling"] = "DataLabelingTask";
4410
+ })(exports.TaskType || (exports.TaskType = {}));
4411
+ exports.TaskPriority = void 0;
4412
+ (function (TaskPriority) {
4413
+ TaskPriority["Low"] = "Low";
4414
+ TaskPriority["Medium"] = "Medium";
4415
+ TaskPriority["High"] = "High";
4416
+ TaskPriority["Critical"] = "Critical";
4417
+ })(exports.TaskPriority || (exports.TaskPriority = {}));
4418
+ exports.TaskStatus = void 0;
4419
+ (function (TaskStatus) {
4420
+ TaskStatus["Unassigned"] = "Unassigned";
4421
+ TaskStatus["Pending"] = "Pending";
4422
+ TaskStatus["Completed"] = "Completed";
4423
+ })(exports.TaskStatus || (exports.TaskStatus = {}));
4424
+ exports.TaskSlaCriteria = void 0;
4425
+ (function (TaskSlaCriteria) {
4426
+ TaskSlaCriteria["TaskCreated"] = "TaskCreated";
4427
+ TaskSlaCriteria["TaskAssigned"] = "TaskAssigned";
4428
+ TaskSlaCriteria["TaskCompleted"] = "TaskCompleted";
4429
+ })(exports.TaskSlaCriteria || (exports.TaskSlaCriteria = {}));
4430
+ exports.TaskSlaStatus = void 0;
4431
+ (function (TaskSlaStatus) {
4432
+ TaskSlaStatus["OverdueLater"] = "OverdueLater";
4433
+ TaskSlaStatus["OverdueSoon"] = "OverdueSoon";
4434
+ TaskSlaStatus["Overdue"] = "Overdue";
4435
+ TaskSlaStatus["CompletedInTime"] = "CompletedInTime";
4436
+ })(exports.TaskSlaStatus || (exports.TaskSlaStatus = {}));
4437
+ exports.TaskSourceName = void 0;
4438
+ (function (TaskSourceName) {
4439
+ TaskSourceName["Agent"] = "Agent";
4440
+ TaskSourceName["Workflow"] = "Workflow";
4441
+ TaskSourceName["Maestro"] = "Maestro";
4442
+ TaskSourceName["Default"] = "Default";
4443
+ })(exports.TaskSourceName || (exports.TaskSourceName = {}));
4444
+ /**
4445
+ * Task activity types
4446
+ */
4447
+ exports.TaskActivityType = void 0;
4448
+ (function (TaskActivityType) {
4449
+ TaskActivityType["Created"] = "Created";
4450
+ TaskActivityType["Assigned"] = "Assigned";
4451
+ TaskActivityType["Reassigned"] = "Reassigned";
4452
+ TaskActivityType["Unassigned"] = "Unassigned";
4453
+ TaskActivityType["Saved"] = "Saved";
4454
+ TaskActivityType["Forwarded"] = "Forwarded";
4455
+ TaskActivityType["Completed"] = "Completed";
4456
+ TaskActivityType["Commented"] = "Commented";
4457
+ TaskActivityType["Deleted"] = "Deleted";
4458
+ TaskActivityType["BulkSaved"] = "BulkSaved";
4459
+ TaskActivityType["BulkCompleted"] = "BulkCompleted";
4460
+ TaskActivityType["FirstOpened"] = "FirstOpened";
4461
+ })(exports.TaskActivityType || (exports.TaskActivityType = {}));
4462
+
4463
+ /**
4464
+ * Base path constants for different services
4465
+ */
4466
+ const ORCHESTRATOR_BASE = 'orchestrator_';
4467
+ const PIMS_BASE = 'pims_';
4468
+ const DATAFABRIC_BASE = 'datafabric_';
4469
+ const IDENTITY_BASE = 'identity_';
4470
+
4471
+ /**
4472
+ * Orchestrator Service Endpoints
4473
+ */
4474
+ /**
4475
+ * Task Service (Action Center) Endpoints
4476
+ */
4477
+ const TASK_ENDPOINTS = {
4478
+ CREATE_GENERIC_TASK: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/CreateTask`,
4479
+ GET_TASK_USERS: (folderId) => `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTaskUsers(organizationUnitId=${folderId})`,
4480
+ GET_TASKS_ACROSS_FOLDERS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFolders`,
4481
+ GET_TASKS_ACROSS_FOLDERS_ADMIN: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFoldersForAdmin`,
4482
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Tasks(${id})`,
4483
+ ASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.AssignTasks`,
4484
+ REASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.ReassignTasks`,
4485
+ UNASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.UnassignTasks`,
4486
+ COMPLETE_FORM_TASK: `${ORCHESTRATOR_BASE}/forms/TaskForms/CompleteTask`,
4487
+ COMPLETE_APP_TASK: `${ORCHESTRATOR_BASE}/tasks/AppTasks/CompleteAppTask`,
4488
+ COMPLETE_GENERIC_TASK: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/CompleteTask`,
4489
+ GET_TASK_FORM_BY_ID: `${ORCHESTRATOR_BASE}/forms/TaskForms/GetTaskFormById`,
4490
+ GET_GENERIC_TASK_BY_ID: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/GetTaskDataById`,
4491
+ GET_APP_TASK_BY_ID: `${ORCHESTRATOR_BASE}/tasks/AppTasks/GetAppTaskById`,
4492
+ };
4493
+ /**
4494
+ * Orchestrator Bucket Endpoints
4495
+ */
4496
+ const BUCKET_ENDPOINTS = {
4497
+ GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Buckets`,
4498
+ GET_ALL: `${ORCHESTRATOR_BASE}/odata/Buckets/UiPath.Server.Configuration.OData.GetBucketsAcrossFolders`,
4499
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})`,
4500
+ GET_FILE_META_DATA: (id) => `${ORCHESTRATOR_BASE}/api/Buckets/${id}/ListFiles`,
4501
+ GET_READ_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetReadUri`,
4502
+ GET_WRITE_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetWriteUri`,
4503
+ };
4504
+ /**
4505
+ * Orchestrator Process Service Endpoints
4506
+ */
4507
+ const PROCESS_ENDPOINTS = {
4508
+ GET_ALL: `${ORCHESTRATOR_BASE}/odata/Releases`,
4509
+ START_PROCESS: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs`,
4510
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Releases(${id})`,
4511
+ };
4512
+ /**
4513
+ * Orchestrator Queue Service Endpoints
4514
+ */
4515
+ const QUEUE_ENDPOINTS = {
4516
+ GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/QueueDefinitions`,
4517
+ GET_ALL: `${ORCHESTRATOR_BASE}/odata/QueueDefinitions/UiPath.Server.Configuration.OData.GetQueuesAcrossFolders`,
4518
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/QueueDefinitions(${id})`,
4519
+ };
4520
+ /**
4521
+ * Orchestrator Job Service Endpoints
4522
+ */
4523
+ const JOB_ENDPOINTS = {
4524
+ GET_ALL: `${ORCHESTRATOR_BASE}/odata/Jobs`,
4525
+ };
4526
+ /**
4527
+ * Orchestrator Asset Service Endpoints
4528
+ */
4529
+ const ASSET_ENDPOINTS = {
4530
+ GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetFiltered`,
4531
+ GET_ALL: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetAssetsAcrossFolders`,
4532
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Assets(${id})`,
4533
+ };
4534
+ /**
4535
+ * Orchestrator Attachment Service Endpoints
4536
+ */
4537
+ const ORCHESTRATOR_ATTACHMENT_ENDPOINTS = {
4538
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Attachments(${id})`,
4539
+ };
4540
+
4541
+ /**
4542
+ * Maestro Service Endpoints
4543
+ */
4544
+ /**
4545
+ * Maestro Process Service Endpoints
4546
+ */
4547
+ const MAESTRO_ENDPOINTS = {
4548
+ PROCESSES: {
4549
+ GET_ALL: `${PIMS_BASE}/api/v1/processes/summary`,
4550
+ GET_SETTINGS: (processKey) => `${PIMS_BASE}/api/v1/processes/${processKey}/settings`,
4551
+ },
4552
+ INSTANCES: {
4553
+ GET_ALL: `${PIMS_BASE}/api/v1/instances`,
4554
+ GET_BY_ID: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}`,
4555
+ GET_EXECUTION_HISTORY: (instanceId) => `${PIMS_BASE}/api/v1/spans/${instanceId}`,
4556
+ GET_BPMN: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/bpmn`,
4557
+ GET_VARIABLES: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/variables`,
4558
+ CANCEL: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/cancel`,
4559
+ PAUSE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/pause`,
4560
+ RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume`,
4561
+ },
4562
+ INCIDENTS: {
4563
+ GET_ALL: `${PIMS_BASE}/api/v1/incidents/summary`,
4564
+ GET_BY_PROCESS: (processKey) => `${PIMS_BASE}/api/v1/incidents/process/${processKey}`,
4565
+ GET_BY_INSTANCE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/incidents`,
4566
+ },
4567
+ CASES: {
4568
+ GET_CASE_JSON: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/case-json`,
4569
+ GET_ELEMENT_EXECUTIONS: (instanceId) => `${PIMS_BASE}/api/v1/element-executions/case-instances/${instanceId}`,
4570
+ REOPEN: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/reopen`,
4571
+ },
4572
+ };
4573
+
4574
+ /**
4575
+ * Data Fabric Service Endpoints
4576
+ */
4577
+ /**
4578
+ * Data Fabric Entity Service Endpoints
4579
+ */
4580
+ const DATA_FABRIC_ENDPOINTS = {
4581
+ ENTITY: {
4582
+ GET_ALL: `${DATAFABRIC_BASE}/api/Entity`,
4583
+ GET_ENTITY_RECORDS: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read`,
4584
+ GET_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
4585
+ GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read/${recordId}`,
4586
+ INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert`,
4587
+ BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
4588
+ UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
4589
+ UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
4590
+ DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
4591
+ DOWNLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4592
+ UPLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4593
+ DELETE_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4594
+ },
4595
+ CHOICESETS: {
4596
+ GET_ALL: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
4597
+ GET_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/query_expansion`,
4598
+ },
4599
+ };
4600
+
4601
+ /**
4602
+ * Identity/Authentication Endpoints
4603
+ */
4604
+ /**
4605
+ * Identity Service Endpoints
4606
+ */
4607
+ const IDENTITY_ENDPOINTS = {
4608
+ TOKEN: `${IDENTITY_BASE}/connect/token`,
4609
+ AUTHORIZE: `${IDENTITY_BASE}/connect/authorize`,
4610
+ };
4611
+
4612
+ const TASK_TYPE_ENDPOINTS = {
4613
+ [exports.TaskType.Form]: TASK_ENDPOINTS.GET_TASK_FORM_BY_ID,
4614
+ [exports.TaskType.App]: TASK_ENDPOINTS.GET_APP_TASK_BY_ID,
4615
+ [exports.TaskType.DocumentValidation]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
4616
+ [exports.TaskType.DocumentClassification]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
4617
+ [exports.TaskType.External]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
4618
+ [exports.TaskType.DataLabeling]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
4619
+ };
4392
4620
  var ActionCenterEventNames;
4393
4621
  (function (ActionCenterEventNames) {
4394
4622
  ActionCenterEventNames["TOKENREFRESHED"] = "AC.tokenRefreshed";
@@ -4738,167 +4966,33 @@
4738
4966
  const orgName = this.config.orgName;
4739
4967
  const body = new URLSearchParams({
4740
4968
  grant_type: 'refresh_token',
4741
- client_id: this.config.clientId,
4742
- refresh_token: tokenInfo.refreshToken
4743
- });
4744
- const response = await fetch(`${this.config.baseUrl}/${orgName}/identity_/connect/token`, {
4745
- method: 'POST',
4746
- headers: {
4747
- 'Content-Type': 'application/x-www-form-urlencoded'
4748
- },
4749
- body: body.toString()
4750
- });
4751
- if (!response.ok) {
4752
- const errorData = await response.json().catch(() => ({ message: response.statusText }));
4753
- console.error("Token refresh error:", errorData);
4754
- // Clear the invalid token to prevent further failed requests
4755
- this.clearToken();
4756
- throw new Error(`Failed to refresh access token: ${JSON.stringify(errorData)}`);
4757
- }
4758
- const token = await response.json();
4759
- this.setToken({
4760
- token: token.access_token,
4761
- type: 'oauth',
4762
- expiresAt: new Date(Date.now() + token.expires_in * 1000),
4763
- refreshToken: token.refresh_token
4764
- });
4765
- return token;
4766
- }
4767
- }
4768
-
4769
- /**
4770
- * Base path constants for different services
4771
- */
4772
- const ORCHESTRATOR_BASE = 'orchestrator_';
4773
- const PIMS_BASE = 'pims_';
4774
- const DATAFABRIC_BASE = 'datafabric_';
4775
- const IDENTITY_BASE = 'identity_';
4776
-
4777
- /**
4778
- * Orchestrator Service Endpoints
4779
- */
4780
- /**
4781
- * Task Service (Action Center) Endpoints
4782
- */
4783
- const TASK_ENDPOINTS = {
4784
- CREATE_GENERIC_TASK: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/CreateTask`,
4785
- GET_TASK_USERS: (folderId) => `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTaskUsers(organizationUnitId=${folderId})`,
4786
- GET_TASKS_ACROSS_FOLDERS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFolders`,
4787
- GET_TASKS_ACROSS_FOLDERS_ADMIN: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFoldersForAdmin`,
4788
- GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Tasks(${id})`,
4789
- ASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.AssignTasks`,
4790
- REASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.ReassignTasks`,
4791
- UNASSIGN_TASKS: `${ORCHESTRATOR_BASE}/odata/Tasks/UiPath.Server.Configuration.OData.UnassignTasks`,
4792
- COMPLETE_FORM_TASK: `${ORCHESTRATOR_BASE}/forms/TaskForms/CompleteTask`,
4793
- COMPLETE_APP_TASK: `${ORCHESTRATOR_BASE}/tasks/AppTasks/CompleteAppTask`,
4794
- COMPLETE_GENERIC_TASK: `${ORCHESTRATOR_BASE}/tasks/GenericTasks/CompleteTask`,
4795
- GET_TASK_FORM_BY_ID: `${ORCHESTRATOR_BASE}/forms/TaskForms/GetTaskFormById`,
4796
- };
4797
- /**
4798
- * Orchestrator Bucket Endpoints
4799
- */
4800
- const BUCKET_ENDPOINTS = {
4801
- GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Buckets`,
4802
- GET_ALL: `${ORCHESTRATOR_BASE}/odata/Buckets/UiPath.Server.Configuration.OData.GetBucketsAcrossFolders`,
4803
- GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})`,
4804
- GET_FILE_META_DATA: (id) => `${ORCHESTRATOR_BASE}/api/Buckets/${id}/ListFiles`,
4805
- GET_READ_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetReadUri`,
4806
- GET_WRITE_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetWriteUri`,
4807
- };
4808
- /**
4809
- * Orchestrator Process Service Endpoints
4810
- */
4811
- const PROCESS_ENDPOINTS = {
4812
- GET_ALL: `${ORCHESTRATOR_BASE}/odata/Releases`,
4813
- START_PROCESS: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs`,
4814
- GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Releases(${id})`,
4815
- };
4816
- /**
4817
- * Orchestrator Queue Service Endpoints
4818
- */
4819
- const QUEUE_ENDPOINTS = {
4820
- GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/QueueDefinitions`,
4821
- GET_ALL: `${ORCHESTRATOR_BASE}/odata/QueueDefinitions/UiPath.Server.Configuration.OData.GetQueuesAcrossFolders`,
4822
- GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/QueueDefinitions(${id})`,
4823
- };
4824
- /**
4825
- * Orchestrator Asset Service Endpoints
4826
- */
4827
- const ASSET_ENDPOINTS = {
4828
- GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetFiltered`,
4829
- GET_ALL: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetAssetsAcrossFolders`,
4830
- GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Assets(${id})`,
4831
- };
4832
-
4833
- /**
4834
- * Maestro Service Endpoints
4835
- */
4836
- /**
4837
- * Maestro Process Service Endpoints
4838
- */
4839
- const MAESTRO_ENDPOINTS = {
4840
- PROCESSES: {
4841
- GET_ALL: `${PIMS_BASE}/api/v1/processes/summary`,
4842
- GET_SETTINGS: (processKey) => `${PIMS_BASE}/api/v1/processes/${processKey}/settings`,
4843
- },
4844
- INSTANCES: {
4845
- GET_ALL: `${PIMS_BASE}/api/v1/instances`,
4846
- GET_BY_ID: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}`,
4847
- GET_EXECUTION_HISTORY: (instanceId) => `${PIMS_BASE}/api/v1/spans/${instanceId}`,
4848
- GET_BPMN: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/bpmn`,
4849
- GET_VARIABLES: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/variables`,
4850
- CANCEL: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/cancel`,
4851
- PAUSE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/pause`,
4852
- RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume`,
4853
- },
4854
- INCIDENTS: {
4855
- GET_ALL: `${PIMS_BASE}/api/v1/incidents/summary`,
4856
- GET_BY_PROCESS: (processKey) => `${PIMS_BASE}/api/v1/incidents/process/${processKey}`,
4857
- GET_BY_INSTANCE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/incidents`,
4858
- },
4859
- CASES: {
4860
- GET_CASE_JSON: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/case-json`,
4861
- GET_ELEMENT_EXECUTIONS: (instanceId) => `${PIMS_BASE}/api/v1/element-executions/case-instances/${instanceId}`,
4862
- REOPEN: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/reopen`,
4863
- },
4864
- };
4865
-
4866
- /**
4867
- * Data Fabric Service Endpoints
4868
- */
4869
- /**
4870
- * Data Fabric Entity Service Endpoints
4871
- */
4872
- const DATA_FABRIC_ENDPOINTS = {
4873
- ENTITY: {
4874
- GET_ALL: `${DATAFABRIC_BASE}/api/Entity`,
4875
- GET_ENTITY_RECORDS: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read`,
4876
- GET_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
4877
- GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read/${recordId}`,
4878
- INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert`,
4879
- BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
4880
- UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
4881
- DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
4882
- DOWNLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4883
- UPLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4884
- DELETE_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4885
- },
4886
- CHOICESETS: {
4887
- GET_ALL: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
4888
- GET_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/query_expansion`,
4889
- },
4890
- };
4891
-
4892
- /**
4893
- * Identity/Authentication Endpoints
4894
- */
4895
- /**
4896
- * Identity Service Endpoints
4897
- */
4898
- const IDENTITY_ENDPOINTS = {
4899
- TOKEN: `${IDENTITY_BASE}/connect/token`,
4900
- AUTHORIZE: `${IDENTITY_BASE}/connect/authorize`,
4901
- };
4969
+ client_id: this.config.clientId,
4970
+ refresh_token: tokenInfo.refreshToken
4971
+ });
4972
+ const response = await fetch(`${this.config.baseUrl}/${orgName}/identity_/connect/token`, {
4973
+ method: 'POST',
4974
+ headers: {
4975
+ 'Content-Type': 'application/x-www-form-urlencoded'
4976
+ },
4977
+ body: body.toString()
4978
+ });
4979
+ if (!response.ok) {
4980
+ const errorData = await response.json().catch(() => ({ message: response.statusText }));
4981
+ console.error("Token refresh error:", errorData);
4982
+ // Clear the invalid token to prevent further failed requests
4983
+ this.clearToken();
4984
+ throw new Error(`Failed to refresh access token: ${JSON.stringify(errorData)}`);
4985
+ }
4986
+ const token = await response.json();
4987
+ this.setToken({
4988
+ token: token.access_token,
4989
+ type: 'oauth',
4990
+ expiresAt: new Date(Date.now() + token.expires_in * 1000),
4991
+ refreshToken: token.refresh_token
4992
+ });
4993
+ return token;
4994
+ }
4995
+ }
4902
4996
 
4903
4997
  class AuthService {
4904
4998
  constructor(config, executionContext) {
@@ -9082,7 +9176,7 @@
9082
9176
  // Connection string placeholder that will be replaced during build
9083
9177
  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";
9084
9178
  // SDK Version placeholder
9085
- const SDK_VERSION = "1.2.0";
9179
+ const SDK_VERSION = "1.2.2";
9086
9180
  const VERSION = "Version";
9087
9181
  const SERVICE = "Service";
9088
9182
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -9613,6 +9707,15 @@
9613
9707
  __classPrivateFieldGet(this, _UiPath_authService, "f")?.logout();
9614
9708
  __classPrivateFieldSet(this, _UiPath_initialized, false, "f");
9615
9709
  }
9710
+ /**
9711
+ * Updates the access token used for API requests.
9712
+ * Use this to inject or refresh a token externally.
9713
+ *
9714
+ * @param tokenInfo - The token information containing the access token, type, expiration, and optional refresh token
9715
+ */
9716
+ updateToken(tokenInfo) {
9717
+ __classPrivateFieldGet(this, _UiPath_authService, "f")?.updateToken(tokenInfo);
9718
+ }
9616
9719
  };
9617
9720
  _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_initialized = new WeakMap(), _UiPath_partialConfig = new WeakMap(), _UiPath_instances = new WeakSet(), _UiPath_initializeWithConfig = function _UiPath_initializeWithConfig(config) {
9618
9721
  // Validate and normalize the configuration
@@ -11246,6 +11349,13 @@
11246
11349
  throw new Error('Entity ID is undefined');
11247
11350
  return service.insertRecordsById(entityData.id, data, options);
11248
11351
  },
11352
+ async updateRecord(recordId, data, options) {
11353
+ if (!entityData.id)
11354
+ throw new Error('Entity ID is undefined');
11355
+ if (!recordId)
11356
+ throw new Error('Record ID is undefined');
11357
+ return service.updateRecordById(entityData.id, recordId, data, options);
11358
+ },
11249
11359
  async updateRecords(data, options) {
11250
11360
  if (!entityData.id)
11251
11361
  throw new Error('Entity ID is undefined');
@@ -11654,6 +11764,42 @@
11654
11764
  const camelResponse = pascalToCamelCaseKeys(response.data);
11655
11765
  return camelResponse;
11656
11766
  }
11767
+ /**
11768
+ * Updates a single record in an entity by entity ID
11769
+ *
11770
+ * @param entityId - UUID of the entity
11771
+ * @param recordId - UUID of the record to update
11772
+ * @param data - Key-value pairs of fields to update
11773
+ * @param options - Update options
11774
+ * @returns Promise resolving to the updated record
11775
+ *
11776
+ * @example
11777
+ * ```typescript
11778
+ * import { Entities } from '@uipath/uipath-typescript/entities';
11779
+ *
11780
+ * const entities = new Entities(sdk);
11781
+ *
11782
+ * // Basic usage
11783
+ * const result = await entities.updateRecordById("<entityId>", "<recordId>", { name: "John Updated", age: 31 });
11784
+ *
11785
+ * // With options
11786
+ * const result = await entities.updateRecordById("<entityId>", "<recordId>", { name: "John Updated", age: 31 }, {
11787
+ * expansionLevel: 1
11788
+ * });
11789
+ * ```
11790
+ */
11791
+ async updateRecordById(entityId, recordId, data, options = {}) {
11792
+ const params = createParams({
11793
+ expansionLevel: options.expansionLevel
11794
+ });
11795
+ const response = await this.post(DATA_FABRIC_ENDPOINTS.ENTITY.UPDATE_RECORD_BY_ID(entityId, recordId), data, {
11796
+ params,
11797
+ ...options
11798
+ });
11799
+ // Convert PascalCase response to camelCase
11800
+ const camelResponse = pascalToCamelCaseKeys(response.data);
11801
+ return camelResponse;
11802
+ }
11657
11803
  /**
11658
11804
  * Updates data in an entity by entity ID
11659
11805
  *
@@ -11985,6 +12131,9 @@
11985
12131
  __decorate([
11986
12132
  track('Entities.InsertRecordsById')
11987
12133
  ], EntityService.prototype, "insertRecordsById", null);
12134
+ __decorate([
12135
+ track('Entities.UpdateRecordById')
12136
+ ], EntityService.prototype, "updateRecordById", null);
11988
12137
  __decorate([
11989
12138
  track('Entities.UpdateRecordsById')
11990
12139
  ], EntityService.prototype, "updateRecordsById", null);
@@ -13023,63 +13172,27 @@
13023
13172
  */
13024
13173
  const CASE_INSTANCE_TASK_EXPAND = 'AssignedToUser,Activities';
13025
13174
 
13026
- exports.TaskType = void 0;
13027
- (function (TaskType) {
13028
- TaskType["Form"] = "FormTask";
13029
- TaskType["External"] = "ExternalTask";
13030
- TaskType["App"] = "AppTask";
13031
- })(exports.TaskType || (exports.TaskType = {}));
13032
- exports.TaskPriority = void 0;
13033
- (function (TaskPriority) {
13034
- TaskPriority["Low"] = "Low";
13035
- TaskPriority["Medium"] = "Medium";
13036
- TaskPriority["High"] = "High";
13037
- TaskPriority["Critical"] = "Critical";
13038
- })(exports.TaskPriority || (exports.TaskPriority = {}));
13039
- exports.TaskStatus = void 0;
13040
- (function (TaskStatus) {
13041
- TaskStatus["Unassigned"] = "Unassigned";
13042
- TaskStatus["Pending"] = "Pending";
13043
- TaskStatus["Completed"] = "Completed";
13044
- })(exports.TaskStatus || (exports.TaskStatus = {}));
13045
- exports.TaskSlaCriteria = void 0;
13046
- (function (TaskSlaCriteria) {
13047
- TaskSlaCriteria["TaskCreated"] = "TaskCreated";
13048
- TaskSlaCriteria["TaskAssigned"] = "TaskAssigned";
13049
- TaskSlaCriteria["TaskCompleted"] = "TaskCompleted";
13050
- })(exports.TaskSlaCriteria || (exports.TaskSlaCriteria = {}));
13051
- exports.TaskSlaStatus = void 0;
13052
- (function (TaskSlaStatus) {
13053
- TaskSlaStatus["OverdueLater"] = "OverdueLater";
13054
- TaskSlaStatus["OverdueSoon"] = "OverdueSoon";
13055
- TaskSlaStatus["Overdue"] = "Overdue";
13056
- TaskSlaStatus["CompletedInTime"] = "CompletedInTime";
13057
- })(exports.TaskSlaStatus || (exports.TaskSlaStatus = {}));
13058
- exports.TaskSourceName = void 0;
13059
- (function (TaskSourceName) {
13060
- TaskSourceName["Agent"] = "Agent";
13061
- TaskSourceName["Workflow"] = "Workflow";
13062
- TaskSourceName["Maestro"] = "Maestro";
13063
- TaskSourceName["Default"] = "Default";
13064
- })(exports.TaskSourceName || (exports.TaskSourceName = {}));
13065
13175
  /**
13066
- * Task activity types
13176
+ * Maps numeric TaskStatus values (from API) to TaskStatus enum values.
13177
+ * Extend this file with additional field mappings as needed.
13067
13178
  */
13068
- exports.TaskActivityType = void 0;
13069
- (function (TaskActivityType) {
13070
- TaskActivityType["Created"] = "Created";
13071
- TaskActivityType["Assigned"] = "Assigned";
13072
- TaskActivityType["Reassigned"] = "Reassigned";
13073
- TaskActivityType["Unassigned"] = "Unassigned";
13074
- TaskActivityType["Saved"] = "Saved";
13075
- TaskActivityType["Forwarded"] = "Forwarded";
13076
- TaskActivityType["Completed"] = "Completed";
13077
- TaskActivityType["Commented"] = "Commented";
13078
- TaskActivityType["Deleted"] = "Deleted";
13079
- TaskActivityType["BulkSaved"] = "BulkSaved";
13080
- TaskActivityType["BulkCompleted"] = "BulkCompleted";
13081
- TaskActivityType["FirstOpened"] = "FirstOpened";
13082
- })(exports.TaskActivityType || (exports.TaskActivityType = {}));
13179
+ const TaskStatusMap = {
13180
+ 0: exports.TaskStatus.Unassigned,
13181
+ 1: exports.TaskStatus.Pending,
13182
+ 2: exports.TaskStatus.Completed,
13183
+ };
13184
+ // Field mapping for time-related fields to ensure consistent naming
13185
+ const TaskMap = {
13186
+ completionTime: 'completedTime',
13187
+ deletionTime: 'deletedTime',
13188
+ lastModificationTime: 'lastModifiedTime',
13189
+ creationTime: 'createdTime',
13190
+ organizationUnitId: 'folderId'
13191
+ };
13192
+ /**
13193
+ * Default expand parameters
13194
+ */
13195
+ const DEFAULT_TASK_EXPAND = 'AssignedToUser,CreatorUser,LastModifierUser';
13083
13196
 
13084
13197
  /**
13085
13198
  * Creates methods for a task
@@ -13138,28 +13251,6 @@
13138
13251
  return Object.assign({}, taskData, methods);
13139
13252
  }
13140
13253
 
13141
- /**
13142
- * Maps numeric TaskStatus values (from API) to TaskStatus enum values.
13143
- * Extend this file with additional field mappings as needed.
13144
- */
13145
- const TaskStatusMap = {
13146
- 0: exports.TaskStatus.Unassigned,
13147
- 1: exports.TaskStatus.Pending,
13148
- 2: exports.TaskStatus.Completed,
13149
- };
13150
- // Field mapping for time-related fields to ensure consistent naming
13151
- const TaskMap = {
13152
- completionTime: 'completedTime',
13153
- deletionTime: 'deletedTime',
13154
- lastModificationTime: 'lastModifiedTime',
13155
- creationTime: 'createdTime',
13156
- organizationUnitId: 'folderId'
13157
- };
13158
- /**
13159
- * Default expand parameters
13160
- */
13161
- const DEFAULT_TASK_EXPAND = 'AssignedToUser,CreatorUser,LastModifierUser';
13162
-
13163
13254
  /**
13164
13255
  * Service for interacting with UiPath Tasks API
13165
13256
  */
@@ -13354,29 +13445,38 @@
13354
13445
  }
13355
13446
  /**
13356
13447
  * Gets a task by ID
13357
- * IMPORTANT: For form tasks, folderId must be provided.
13358
- *
13359
13448
  * @param id - The ID of the task to retrieve
13360
- * @param options - Optional query parameters
13361
- * @param folderId - Optional folder ID (REQUIRED for form tasks)
13362
- * @returns Promise resolving to the task (form tasks will return form-specific data)
13363
- *
13449
+ * @param options - Optional query parameters including taskType for faster retrieval {@link TaskGetByIdOptions}
13450
+ * @param folderId - Optional folder ID (REQUIRED when options.taskType is provided)
13451
+ * @returns Promise resolving to the task
13452
+ * {@link TaskGetResponse}
13364
13453
  * @example
13365
13454
  * ```typescript
13366
- * import { Tasks } from '@uipath/uipath-typescript/tasks';
13455
+ * // Get a task by ID
13456
+ * const task = await tasks.getById(<taskId>);
13367
13457
  *
13368
- * const tasks = new Tasks(sdk);
13458
+ * // Get a form task by ID
13459
+ * const formTask = await tasks.getById(<taskId>, {}, <folderId>);
13369
13460
  *
13370
- * // Get task by ID
13371
- * const task = await tasks.getById(123);
13461
+ * // Access form task properties
13462
+ * console.log(formTask.formLayout);
13372
13463
  *
13373
- * // If the task is a form task, it will automatically return form-specific data
13464
+ * // Get a document validation task by ID (faster with taskType provided in the options)
13465
+ * const dvTask = await tasks.getById(<taskId>, { taskType: TaskType.DocumentValidation }, <folderId>);
13374
13466
  * ```
13375
13467
  */
13376
13468
  async getById(id, options = {}, folderId) {
13469
+ const { taskType, ...restOptions } = options;
13470
+ // If taskType is provided, skip the generic GET_BY_ID call and go directly to the type-specific endpoint
13471
+ if (taskType && taskType in TASK_TYPE_ENDPOINTS) {
13472
+ if (!folderId) {
13473
+ throw new ValidationError({ message: 'folderId is required when taskType is provided' });
13474
+ }
13475
+ return this.getByTaskType(id, folderId, taskType, restOptions);
13476
+ }
13377
13477
  const headers = createHeaders({ [FOLDER_ID]: folderId });
13378
13478
  // Add default expand parameters
13379
- const modifiedOptions = this.addDefaultExpand(options);
13479
+ const modifiedOptions = this.addDefaultExpand(restOptions);
13380
13480
  // prefix all keys in options
13381
13481
  const keysToPrefix = Object.keys(modifiedOptions);
13382
13482
  const apiOptions = addPrefixToKeys(modifiedOptions, ODATA_PREFIX, keysToPrefix);
@@ -13386,10 +13486,10 @@
13386
13486
  });
13387
13487
  // Transform response from PascalCase to camelCase and normalize time fields
13388
13488
  const transformedTask = transformData(pascalToCamelCaseKeys(response.data), TaskMap);
13389
- // Check if this is a form task and get form-specific data if it is
13390
- if (transformedTask.type === exports.TaskType.Form) {
13391
- const formOptions = { expandOnFormLayout: true };
13392
- return this.getFormTaskById(id, folderId || transformedTask.folderId, formOptions);
13489
+ // Get task type from response and fetch type-specific data
13490
+ const resolvedFolderId = folderId || transformedTask.folderId;
13491
+ if (transformedTask.type in TASK_TYPE_ENDPOINTS) {
13492
+ return this.getByTaskType(id, resolvedFolderId, transformedTask.type, restOptions);
13393
13493
  }
13394
13494
  return createTaskWithMethods(applyDataTransforms(transformedTask, { field: 'status', valueMap: TaskStatusMap }), this);
13395
13495
  }
@@ -13578,24 +13678,33 @@
13578
13678
  };
13579
13679
  }
13580
13680
  /**
13581
- * Gets a form task by ID (private method)
13681
+ * Routes to the type-specific endpoint based on task type.
13682
+ */
13683
+ getByTaskType(id, folderId, taskType, options = {}) {
13684
+ const endpoint = TASK_TYPE_ENDPOINTS[taskType];
13685
+ const extraParams = taskType === exports.TaskType.Form ? { expandOnFormLayout: true, ...options } : options;
13686
+ return this.getTaskByTypeEndpoint(id, folderId, endpoint, extraParams);
13687
+ }
13688
+ /**
13689
+ * Fetches a task from a type-specific endpoint.
13582
13690
  *
13583
- * @param id - The ID of the form task to retrieve
13691
+ * @param id - The task ID
13584
13692
  * @param folderId - Required folder ID
13585
- * @param options - Optional query parameters
13586
- * @returns Promise resolving to the form task
13693
+ * @param endpoint - The type-specific endpoint to call
13694
+ * @param extraParams - Additional query parameters (e.g. form options)
13695
+ * @returns Promise resolving to the task
13587
13696
  */
13588
- async getFormTaskById(id, folderId, options = {}) {
13697
+ async getTaskByTypeEndpoint(id, folderId, endpoint, extraParams = {}) {
13589
13698
  const headers = createHeaders({ [FOLDER_ID]: folderId });
13590
- const response = await this.get(TASK_ENDPOINTS.GET_TASK_FORM_BY_ID, {
13699
+ const response = await this.get(endpoint, {
13591
13700
  params: {
13592
13701
  taskId: id,
13593
- ...options
13702
+ ...extraParams
13594
13703
  },
13595
13704
  headers
13596
13705
  });
13597
- const transformedFormTask = transformData(response.data, TaskMap);
13598
- return createTaskWithMethods(applyDataTransforms(transformedFormTask, { field: 'status', valueMap: TaskStatusMap }), this);
13706
+ const transformedTask = transformData(response.data, TaskMap);
13707
+ return createTaskWithMethods(applyDataTransforms(transformedTask, { field: 'status', valueMap: TaskStatusMap }), this);
13599
13708
  }
13600
13709
  /**
13601
13710
  * Adds default expand parameters to options
@@ -14610,6 +14719,106 @@
14610
14719
  BucketOptions["AccessDataThroughOrchestrator"] = "AccessDataThroughOrchestrator";
14611
14720
  })(exports.BucketOptions || (exports.BucketOptions = {}));
14612
14721
 
14722
+ /**
14723
+ * Maps fields for Job entities to ensure consistent naming
14724
+ * Semantic renames only — case conversion handled by pascalToCamelCaseKeys()
14725
+ */
14726
+ const JobMap = {
14727
+ creationTime: 'createdTime',
14728
+ lastModificationTime: 'lastModifiedTime',
14729
+ organizationUnitId: 'folderId',
14730
+ organizationUnitFullyQualifiedName: 'folderName',
14731
+ releaseName: 'processName',
14732
+ releaseVersionId: 'processVersionId',
14733
+ processType: 'packageType',
14734
+ release: 'process',
14735
+ };
14736
+
14737
+ /**
14738
+ * Service for interacting with UiPath Orchestrator Jobs API
14739
+ */
14740
+ class JobService extends FolderScopedService {
14741
+ /**
14742
+ * Gets all jobs across folders with optional filtering
14743
+ *
14744
+ * @param options - Query options including optional folderId and pagination options
14745
+ * @returns Promise resolving to array of jobs or paginated response
14746
+ *
14747
+ * @example
14748
+ * ```typescript
14749
+ * import { Jobs } from '@uipath/uipath-typescript/jobs';
14750
+ *
14751
+ * const jobs = new Jobs(sdk);
14752
+ *
14753
+ * // Get all jobs
14754
+ * const allJobs = await jobs.getAll();
14755
+ *
14756
+ * // Get all jobs in a specific folder
14757
+ * const folderJobs = await jobs.getAll({ folderId: 123 });
14758
+ *
14759
+ * // With filtering
14760
+ * const runningJobs = await jobs.getAll({
14761
+ * filter: "state eq 'Running'"
14762
+ * });
14763
+ *
14764
+ * // First page with pagination
14765
+ * const page1 = await jobs.getAll({ pageSize: 10 });
14766
+ *
14767
+ * // Navigate using cursor
14768
+ * if (page1.hasNextPage) {
14769
+ * const page2 = await jobs.getAll({ cursor: page1.nextCursor });
14770
+ * }
14771
+ * ```
14772
+ */
14773
+ async getAll(options) {
14774
+ const transformJobResponse = (job) => transformData(pascalToCamelCaseKeys(job), JobMap);
14775
+ return PaginationHelpers.getAll({
14776
+ serviceAccess: this.createPaginationServiceAccess(),
14777
+ getEndpoint: () => JOB_ENDPOINTS.GET_ALL,
14778
+ getByFolderEndpoint: JOB_ENDPOINTS.GET_ALL,
14779
+ transformFn: transformJobResponse,
14780
+ pagination: {
14781
+ paginationType: PaginationType.OFFSET,
14782
+ itemsField: ODATA_PAGINATION.ITEMS_FIELD,
14783
+ totalCountField: ODATA_PAGINATION.TOTAL_COUNT_FIELD,
14784
+ paginationParams: {
14785
+ pageSizeParam: ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM,
14786
+ offsetParam: ODATA_OFFSET_PARAMS.OFFSET_PARAM,
14787
+ countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM,
14788
+ },
14789
+ },
14790
+ }, options);
14791
+ }
14792
+ }
14793
+ __decorate([
14794
+ track('Jobs.GetAll')
14795
+ ], JobService.prototype, "getAll", null);
14796
+
14797
+ /**
14798
+ * Enum for job sub-state
14799
+ */
14800
+ exports.JobSubState = void 0;
14801
+ (function (JobSubState) {
14802
+ JobSubState["WithFaults"] = "WITH_FAULTS";
14803
+ JobSubState["Manually"] = "MANUALLY";
14804
+ })(exports.JobSubState || (exports.JobSubState = {}));
14805
+ /**
14806
+ * Enum for serverless job type
14807
+ */
14808
+ exports.ServerlessJobType = void 0;
14809
+ (function (ServerlessJobType) {
14810
+ ServerlessJobType["RobotJob"] = "RobotJob";
14811
+ ServerlessJobType["WebApp"] = "WebApp";
14812
+ ServerlessJobType["LoadTest"] = "LoadTest";
14813
+ ServerlessJobType["StudioWebDesigner"] = "StudioWebDesigner";
14814
+ ServerlessJobType["PublishStudioProject"] = "PublishStudioProject";
14815
+ ServerlessJobType["JsApi"] = "JsApi";
14816
+ ServerlessJobType["PythonCodedAgent"] = "PythonCodedAgent";
14817
+ ServerlessJobType["MCPServer"] = "MCPServer";
14818
+ ServerlessJobType["PythonCodedSystemAgent"] = "PythonCodedSystemAgent";
14819
+ ServerlessJobType["PythonAgent"] = "PythonAgent";
14820
+ })(exports.ServerlessJobType || (exports.ServerlessJobType = {}));
14821
+
14613
14822
  /**
14614
14823
  * Maps fields for Process entities to ensure consistent naming
14615
14824
  */
@@ -14792,6 +15001,9 @@
14792
15001
  PackageType["Api"] = "Api";
14793
15002
  PackageType["MCPServer"] = "MCPServer";
14794
15003
  PackageType["BusinessRules"] = "BusinessRules";
15004
+ PackageType["CaseManagement"] = "CaseManagement";
15005
+ PackageType["Flow"] = "Flow";
15006
+ PackageType["Function"] = "Function";
14795
15007
  })(exports.PackageType || (exports.PackageType = {}));
14796
15008
  /**
14797
15009
  * Enum for job priority
@@ -14870,6 +15082,36 @@
14870
15082
  PackageSourceType["AgentHub"] = "AgentHub";
14871
15083
  PackageSourceType["ApiWorkflow"] = "ApiWorkflow";
14872
15084
  })(exports.PackageSourceType || (exports.PackageSourceType = {}));
15085
+ /**
15086
+ * Enum for job source type
15087
+ */
15088
+ exports.JobSourceType = void 0;
15089
+ (function (JobSourceType) {
15090
+ JobSourceType["Manual"] = "Manual";
15091
+ JobSourceType["Schedule"] = "Schedule";
15092
+ JobSourceType["Agent"] = "Agent";
15093
+ JobSourceType["Queue"] = "Queue";
15094
+ JobSourceType["StudioWeb"] = "StudioWeb";
15095
+ JobSourceType["IntegrationTrigger"] = "IntegrationTrigger";
15096
+ JobSourceType["StudioDesktop"] = "StudioDesktop";
15097
+ JobSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
15098
+ JobSourceType["Apps"] = "Apps";
15099
+ JobSourceType["SAP"] = "SAP";
15100
+ JobSourceType["HttpTrigger"] = "HttpTrigger";
15101
+ JobSourceType["HttpTriggerCallback"] = "HttpTriggerCallback";
15102
+ JobSourceType["RobotAPI"] = "RobotAPI";
15103
+ JobSourceType["CommandLine"] = "CommandLine";
15104
+ JobSourceType["RobotNetAPI"] = "RobotNetAPI";
15105
+ JobSourceType["Autopilot"] = "Autopilot";
15106
+ JobSourceType["TestManager"] = "TestManager";
15107
+ JobSourceType["AgentService"] = "AgentService";
15108
+ JobSourceType["ProcessOrchestration"] = "ProcessOrchestration";
15109
+ JobSourceType["PluginEcosystem"] = "PluginEcosystem";
15110
+ JobSourceType["PerformanceTesting"] = "PerformanceTesting";
15111
+ JobSourceType["AgentHub"] = "AgentHub";
15112
+ JobSourceType["ApiWorkflow"] = "ApiWorkflow";
15113
+ JobSourceType["CaseManagement"] = "CaseManagement";
15114
+ })(exports.JobSourceType || (exports.JobSourceType = {}));
14873
15115
  /**
14874
15116
  * Enum for stop strategy
14875
15117
  */
@@ -14878,6 +15120,39 @@
14878
15120
  StopStrategy["SoftStop"] = "SoftStop";
14879
15121
  StopStrategy["Kill"] = "Kill";
14880
15122
  })(exports.StopStrategy || (exports.StopStrategy = {}));
15123
+ /**
15124
+ * Enum for runtime type
15125
+ */
15126
+ exports.RuntimeType = void 0;
15127
+ (function (RuntimeType) {
15128
+ RuntimeType["NonProduction"] = "NonProduction";
15129
+ RuntimeType["Attended"] = "Attended";
15130
+ RuntimeType["Unattended"] = "Unattended";
15131
+ RuntimeType["Development"] = "Development";
15132
+ RuntimeType["Studio"] = "Studio";
15133
+ RuntimeType["RpaDeveloper"] = "RpaDeveloper";
15134
+ RuntimeType["StudioX"] = "StudioX";
15135
+ RuntimeType["CitizenDeveloper"] = "CitizenDeveloper";
15136
+ RuntimeType["Headless"] = "Headless";
15137
+ RuntimeType["StudioPro"] = "StudioPro";
15138
+ RuntimeType["RpaDeveloperPro"] = "RpaDeveloperPro";
15139
+ RuntimeType["TestAutomation"] = "TestAutomation";
15140
+ RuntimeType["AutomationCloud"] = "AutomationCloud";
15141
+ RuntimeType["Serverless"] = "Serverless";
15142
+ RuntimeType["AutomationKit"] = "AutomationKit";
15143
+ RuntimeType["ServerlessTestAutomation"] = "ServerlessTestAutomation";
15144
+ RuntimeType["AutomationCloudTestAutomation"] = "AutomationCloudTestAutomation";
15145
+ RuntimeType["AttendedStudioWeb"] = "AttendedStudioWeb";
15146
+ RuntimeType["Hosting"] = "Hosting";
15147
+ RuntimeType["AssistantWeb"] = "AssistantWeb";
15148
+ RuntimeType["ProcessOrchestration"] = "ProcessOrchestration";
15149
+ RuntimeType["AgentService"] = "AgentService";
15150
+ RuntimeType["AppTest"] = "AppTest";
15151
+ RuntimeType["PerformanceTest"] = "PerformanceTest";
15152
+ RuntimeType["BusinessRule"] = "BusinessRule";
15153
+ RuntimeType["CaseManagement"] = "CaseManagement";
15154
+ RuntimeType["Flow"] = "Flow";
15155
+ })(exports.RuntimeType || (exports.RuntimeType = {}));
14881
15156
  /**
14882
15157
  * Enum for job type
14883
15158
  */
@@ -15000,6 +15275,49 @@
15000
15275
  track('Queues.GetById')
15001
15276
  ], QueueService.prototype, "getById", null);
15002
15277
 
15278
+ /**
15279
+ * Maps fields for Attachment entities to ensure consistent naming
15280
+ */
15281
+ const AttachmentsMap = {
15282
+ creationTime: 'createdTime',
15283
+ lastModificationTime: 'lastModifiedTime'
15284
+ };
15285
+
15286
+ class AttachmentService extends BaseService {
15287
+ /**
15288
+ * Gets an attachment by ID
15289
+ * @param id - The UUID of the attachment to retrieve
15290
+ * @param options - Optional query parameters (expand, select)
15291
+ * @returns Promise resolving to the attachment
15292
+ *
15293
+ * @example
15294
+ * ```typescript
15295
+ * import { Attachments } from '@uipath/uipath-typescript/attachments';
15296
+ *
15297
+ * const attachments = new Attachments(sdk);
15298
+ * const attachment = await attachments.getById('12345678-1234-1234-1234-123456789abc');
15299
+ * ```
15300
+ */
15301
+ async getById(id, options = {}) {
15302
+ if (!id) {
15303
+ throw new ValidationError({ message: 'id is required for getById' });
15304
+ }
15305
+ // Prefix all keys in options with $ for OData
15306
+ const keysToPrefix = Object.keys(options);
15307
+ const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
15308
+ const response = await this.get(ORCHESTRATOR_ATTACHMENT_ENDPOINTS.GET_BY_ID(id), {
15309
+ params: apiOptions,
15310
+ });
15311
+ // Transform response from PascalCase to camelCase, then apply field maps
15312
+ const camelCased = pascalToCamelCaseKeys(response.data);
15313
+ camelCased.blobFileAccess = transformData(camelCased.blobFileAccess, BucketMap);
15314
+ return transformData(camelCased, AttachmentsMap);
15315
+ }
15316
+ }
15317
+ __decorate([
15318
+ track('Attachments.GetById')
15319
+ ], AttachmentService.prototype, "getById", null);
15320
+
15003
15321
  /**
15004
15322
  * UiPath SDK - Legacy class providing all services through property getters.
15005
15323
  *