@uipath/uipath-typescript 1.2.1 → 1.3.0

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 +11 -27
  20. package/dist/entities/index.d.ts +38 -26
  21. package/dist/entities/index.mjs +11 -27
  22. package/dist/index.cjs +683 -284
  23. package/dist/index.d.ts +549 -75
  24. package/dist/index.mjs +683 -285
  25. package/dist/index.umd.js +680 -281
  26. package/dist/jobs/index.cjs +2264 -0
  27. package/dist/jobs/index.d.ts +860 -0
  28. package/dist/jobs/index.mjs +2260 -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.umd.js CHANGED
@@ -4389,6 +4389,235 @@
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
+ GET_BY_KEY: (identifier) => `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.GetByKey(identifier=${identifier})`,
4526
+ };
4527
+ /**
4528
+ * Orchestrator Asset Service Endpoints
4529
+ */
4530
+ const ASSET_ENDPOINTS = {
4531
+ GET_BY_FOLDER: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetFiltered`,
4532
+ GET_ALL: `${ORCHESTRATOR_BASE}/odata/Assets/UiPath.Server.Configuration.OData.GetAssetsAcrossFolders`,
4533
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Assets(${id})`,
4534
+ };
4535
+ /**
4536
+ * Orchestrator Attachment Service Endpoints
4537
+ */
4538
+ const ORCHESTRATOR_ATTACHMENT_ENDPOINTS = {
4539
+ GET_BY_ID: (id) => `${ORCHESTRATOR_BASE}/odata/Attachments(${id})`,
4540
+ };
4541
+
4542
+ /**
4543
+ * Maestro Service Endpoints
4544
+ */
4545
+ /**
4546
+ * Maestro Process Service Endpoints
4547
+ */
4548
+ const MAESTRO_ENDPOINTS = {
4549
+ PROCESSES: {
4550
+ GET_ALL: `${PIMS_BASE}/api/v1/processes/summary`,
4551
+ GET_SETTINGS: (processKey) => `${PIMS_BASE}/api/v1/processes/${processKey}/settings`,
4552
+ },
4553
+ INSTANCES: {
4554
+ GET_ALL: `${PIMS_BASE}/api/v1/instances`,
4555
+ GET_BY_ID: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}`,
4556
+ GET_EXECUTION_HISTORY: (instanceId) => `${PIMS_BASE}/api/v1/spans/${instanceId}`,
4557
+ GET_BPMN: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/bpmn`,
4558
+ GET_VARIABLES: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/variables`,
4559
+ CANCEL: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/cancel`,
4560
+ PAUSE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/pause`,
4561
+ RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume`,
4562
+ },
4563
+ INCIDENTS: {
4564
+ GET_ALL: `${PIMS_BASE}/api/v1/incidents/summary`,
4565
+ GET_BY_PROCESS: (processKey) => `${PIMS_BASE}/api/v1/incidents/process/${processKey}`,
4566
+ GET_BY_INSTANCE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/incidents`,
4567
+ },
4568
+ CASES: {
4569
+ GET_CASE_JSON: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/case-json`,
4570
+ GET_ELEMENT_EXECUTIONS: (instanceId) => `${PIMS_BASE}/api/v1/element-executions/case-instances/${instanceId}`,
4571
+ REOPEN: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/reopen`,
4572
+ },
4573
+ };
4574
+
4575
+ /**
4576
+ * Data Fabric Service Endpoints
4577
+ */
4578
+ /**
4579
+ * Data Fabric Entity Service Endpoints
4580
+ */
4581
+ const DATA_FABRIC_ENDPOINTS = {
4582
+ ENTITY: {
4583
+ GET_ALL: `${DATAFABRIC_BASE}/api/Entity`,
4584
+ GET_ENTITY_RECORDS: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read`,
4585
+ GET_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
4586
+ GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read/${recordId}`,
4587
+ INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert`,
4588
+ BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
4589
+ UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
4590
+ UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
4591
+ DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
4592
+ DOWNLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4593
+ UPLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4594
+ DELETE_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4595
+ },
4596
+ CHOICESETS: {
4597
+ GET_ALL: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
4598
+ GET_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/query_expansion`,
4599
+ },
4600
+ };
4601
+
4602
+ /**
4603
+ * Identity/Authentication Endpoints
4604
+ */
4605
+ /**
4606
+ * Identity Service Endpoints
4607
+ */
4608
+ const IDENTITY_ENDPOINTS = {
4609
+ TOKEN: `${IDENTITY_BASE}/connect/token`,
4610
+ AUTHORIZE: `${IDENTITY_BASE}/connect/authorize`,
4611
+ };
4612
+
4613
+ const TASK_TYPE_ENDPOINTS = {
4614
+ [exports.TaskType.Form]: TASK_ENDPOINTS.GET_TASK_FORM_BY_ID,
4615
+ [exports.TaskType.App]: TASK_ENDPOINTS.GET_APP_TASK_BY_ID,
4616
+ [exports.TaskType.DocumentValidation]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
4617
+ [exports.TaskType.DocumentClassification]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
4618
+ [exports.TaskType.External]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
4619
+ [exports.TaskType.DataLabeling]: TASK_ENDPOINTS.GET_GENERIC_TASK_BY_ID,
4620
+ };
4392
4621
  var ActionCenterEventNames;
4393
4622
  (function (ActionCenterEventNames) {
4394
4623
  ActionCenterEventNames["TOKENREFRESHED"] = "AC.tokenRefreshed";
@@ -4766,141 +4995,6 @@
4766
4995
  }
4767
4996
  }
4768
4997
 
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_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
4881
- UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
4882
- DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
4883
- DOWNLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4884
- UPLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4885
- DELETE_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
4886
- },
4887
- CHOICESETS: {
4888
- GET_ALL: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
4889
- GET_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/query_expansion`,
4890
- },
4891
- };
4892
-
4893
- /**
4894
- * Identity/Authentication Endpoints
4895
- */
4896
- /**
4897
- * Identity Service Endpoints
4898
- */
4899
- const IDENTITY_ENDPOINTS = {
4900
- TOKEN: `${IDENTITY_BASE}/connect/token`,
4901
- AUTHORIZE: `${IDENTITY_BASE}/connect/authorize`,
4902
- };
4903
-
4904
4998
  class AuthService {
4905
4999
  constructor(config, executionContext) {
4906
5000
  // Only use stored OAuth context when completing an active callback (URL has ?code=).
@@ -9083,7 +9177,7 @@
9083
9177
  // Connection string placeholder that will be replaced during build
9084
9178
  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";
9085
9179
  // SDK Version placeholder
9086
- const SDK_VERSION = "1.2.1";
9180
+ const SDK_VERSION = "1.3.0";
9087
9181
  const VERSION = "Version";
9088
9182
  const SERVICE = "Service";
9089
9183
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -11587,11 +11681,7 @@
11587
11681
  expansionLevel: options.expansionLevel
11588
11682
  });
11589
11683
  const response = await this.get(DATA_FABRIC_ENDPOINTS.ENTITY.GET_RECORD_BY_ID(entityId, recordId), { params });
11590
- // Convert PascalCase response to camelCase
11591
- const camelResponse = pascalToCamelCaseKeys(response.data);
11592
- // Apply EntityMap transformations
11593
- const transformedResponse = transformData(camelResponse, EntityMap);
11594
- return transformedResponse;
11684
+ return response.data;
11595
11685
  }
11596
11686
  /**
11597
11687
  * Inserts a single record into an entity by entity ID
@@ -11624,9 +11714,7 @@
11624
11714
  params,
11625
11715
  ...options
11626
11716
  });
11627
- // Convert PascalCase response to camelCase
11628
- const camelResponse = pascalToCamelCaseKeys(response.data);
11629
- return camelResponse;
11717
+ return response.data;
11630
11718
  }
11631
11719
  /**
11632
11720
  * Inserts data into an entity by entity ID using batch insert
@@ -11667,9 +11755,7 @@
11667
11755
  params,
11668
11756
  ...options
11669
11757
  });
11670
- // Convert PascalCase response to camelCase
11671
- const camelResponse = pascalToCamelCaseKeys(response.data);
11672
- return camelResponse;
11758
+ return response.data;
11673
11759
  }
11674
11760
  /**
11675
11761
  * Updates a single record in an entity by entity ID
@@ -11703,9 +11789,7 @@
11703
11789
  params,
11704
11790
  ...options
11705
11791
  });
11706
- // Convert PascalCase response to camelCase
11707
- const camelResponse = pascalToCamelCaseKeys(response.data);
11708
- return camelResponse;
11792
+ return response.data;
11709
11793
  }
11710
11794
  /**
11711
11795
  * Updates data in an entity by entity ID
@@ -11747,9 +11831,7 @@
11747
11831
  params,
11748
11832
  ...options
11749
11833
  });
11750
- // Convert PascalCase response to camelCase
11751
- const camelResponse = pascalToCamelCaseKeys(response.data);
11752
- return camelResponse;
11834
+ return response.data;
11753
11835
  }
11754
11836
  /**
11755
11837
  * Deletes data from an entity by entity ID
@@ -11779,9 +11861,7 @@
11779
11861
  params,
11780
11862
  ...options
11781
11863
  });
11782
- // Convert PascalCase response to camelCase
11783
- const camelResponse = pascalToCamelCaseKeys(response.data);
11784
- return camelResponse;
11864
+ return response.data;
11785
11865
  }
11786
11866
  /**
11787
11867
  * Gets all entities in the system
@@ -11833,7 +11913,7 @@
11833
11913
  *
11834
11914
  * // Get the recordId from getAllRecords()
11835
11915
  * const records = await entities.getAllRecords(entityId);
11836
- * const recordId = records[0].id;
11916
+ * const recordId = records[0].Id;
11837
11917
  *
11838
11918
  * // Download attachment for a specific record and field
11839
11919
  * const blob = await entities.downloadAttachment(entityId, recordId, 'Documents');
@@ -11867,7 +11947,7 @@
11867
11947
  *
11868
11948
  * // Get the recordId from getAllRecords()
11869
11949
  * const records = await entities.getAllRecords(entityId);
11870
- * const recordId = records[0].id;
11950
+ * const recordId = records[0].Id;
11871
11951
  *
11872
11952
  * // Upload a file attachment
11873
11953
  * const response = await entities.uploadAttachment(entityId, recordId, 'Documents', file);
@@ -11883,9 +11963,7 @@
11883
11963
  }
11884
11964
  const params = createParams({ expansionLevel: options?.expansionLevel });
11885
11965
  const response = await this.post(DATA_FABRIC_ENDPOINTS.ENTITY.UPLOAD_ATTACHMENT(entityId, recordId, fieldName), formData, { params });
11886
- // Convert PascalCase response to camelCase
11887
- const camelResponse = pascalToCamelCaseKeys(response.data);
11888
- return camelResponse;
11966
+ return response.data;
11889
11967
  }
11890
11968
  /**
11891
11969
  * Removes an attachment from a File-type field of an entity record
@@ -11907,7 +11985,7 @@
11907
11985
  *
11908
11986
  * // Get the recordId from getAllRecords()
11909
11987
  * const records = await entities.getAllRecords(entityId);
11910
- * const recordId = records[0].id;
11988
+ * const recordId = records[0].Id;
11911
11989
  *
11912
11990
  * // Delete attachment for a specific record and field
11913
11991
  * await entities.deleteAttachment(entityId, recordId, 'Documents');
@@ -13078,64 +13156,28 @@
13078
13156
  * Default expand parameters for case instance tasks
13079
13157
  */
13080
13158
  const CASE_INSTANCE_TASK_EXPAND = 'AssignedToUser,Activities';
13081
-
13082
- exports.TaskType = void 0;
13083
- (function (TaskType) {
13084
- TaskType["Form"] = "FormTask";
13085
- TaskType["External"] = "ExternalTask";
13086
- TaskType["App"] = "AppTask";
13087
- })(exports.TaskType || (exports.TaskType = {}));
13088
- exports.TaskPriority = void 0;
13089
- (function (TaskPriority) {
13090
- TaskPriority["Low"] = "Low";
13091
- TaskPriority["Medium"] = "Medium";
13092
- TaskPriority["High"] = "High";
13093
- TaskPriority["Critical"] = "Critical";
13094
- })(exports.TaskPriority || (exports.TaskPriority = {}));
13095
- exports.TaskStatus = void 0;
13096
- (function (TaskStatus) {
13097
- TaskStatus["Unassigned"] = "Unassigned";
13098
- TaskStatus["Pending"] = "Pending";
13099
- TaskStatus["Completed"] = "Completed";
13100
- })(exports.TaskStatus || (exports.TaskStatus = {}));
13101
- exports.TaskSlaCriteria = void 0;
13102
- (function (TaskSlaCriteria) {
13103
- TaskSlaCriteria["TaskCreated"] = "TaskCreated";
13104
- TaskSlaCriteria["TaskAssigned"] = "TaskAssigned";
13105
- TaskSlaCriteria["TaskCompleted"] = "TaskCompleted";
13106
- })(exports.TaskSlaCriteria || (exports.TaskSlaCriteria = {}));
13107
- exports.TaskSlaStatus = void 0;
13108
- (function (TaskSlaStatus) {
13109
- TaskSlaStatus["OverdueLater"] = "OverdueLater";
13110
- TaskSlaStatus["OverdueSoon"] = "OverdueSoon";
13111
- TaskSlaStatus["Overdue"] = "Overdue";
13112
- TaskSlaStatus["CompletedInTime"] = "CompletedInTime";
13113
- })(exports.TaskSlaStatus || (exports.TaskSlaStatus = {}));
13114
- exports.TaskSourceName = void 0;
13115
- (function (TaskSourceName) {
13116
- TaskSourceName["Agent"] = "Agent";
13117
- TaskSourceName["Workflow"] = "Workflow";
13118
- TaskSourceName["Maestro"] = "Maestro";
13119
- TaskSourceName["Default"] = "Default";
13120
- })(exports.TaskSourceName || (exports.TaskSourceName = {}));
13159
+
13121
13160
  /**
13122
- * Task activity types
13161
+ * Maps numeric TaskStatus values (from API) to TaskStatus enum values.
13162
+ * Extend this file with additional field mappings as needed.
13123
13163
  */
13124
- exports.TaskActivityType = void 0;
13125
- (function (TaskActivityType) {
13126
- TaskActivityType["Created"] = "Created";
13127
- TaskActivityType["Assigned"] = "Assigned";
13128
- TaskActivityType["Reassigned"] = "Reassigned";
13129
- TaskActivityType["Unassigned"] = "Unassigned";
13130
- TaskActivityType["Saved"] = "Saved";
13131
- TaskActivityType["Forwarded"] = "Forwarded";
13132
- TaskActivityType["Completed"] = "Completed";
13133
- TaskActivityType["Commented"] = "Commented";
13134
- TaskActivityType["Deleted"] = "Deleted";
13135
- TaskActivityType["BulkSaved"] = "BulkSaved";
13136
- TaskActivityType["BulkCompleted"] = "BulkCompleted";
13137
- TaskActivityType["FirstOpened"] = "FirstOpened";
13138
- })(exports.TaskActivityType || (exports.TaskActivityType = {}));
13164
+ const TaskStatusMap = {
13165
+ 0: exports.TaskStatus.Unassigned,
13166
+ 1: exports.TaskStatus.Pending,
13167
+ 2: exports.TaskStatus.Completed,
13168
+ };
13169
+ // Field mapping for time-related fields to ensure consistent naming
13170
+ const TaskMap = {
13171
+ completionTime: 'completedTime',
13172
+ deletionTime: 'deletedTime',
13173
+ lastModificationTime: 'lastModifiedTime',
13174
+ creationTime: 'createdTime',
13175
+ organizationUnitId: 'folderId'
13176
+ };
13177
+ /**
13178
+ * Default expand parameters
13179
+ */
13180
+ const DEFAULT_TASK_EXPAND = 'AssignedToUser,CreatorUser,LastModifierUser';
13139
13181
 
13140
13182
  /**
13141
13183
  * Creates methods for a task
@@ -13194,28 +13236,6 @@
13194
13236
  return Object.assign({}, taskData, methods);
13195
13237
  }
13196
13238
 
13197
- /**
13198
- * Maps numeric TaskStatus values (from API) to TaskStatus enum values.
13199
- * Extend this file with additional field mappings as needed.
13200
- */
13201
- const TaskStatusMap = {
13202
- 0: exports.TaskStatus.Unassigned,
13203
- 1: exports.TaskStatus.Pending,
13204
- 2: exports.TaskStatus.Completed,
13205
- };
13206
- // Field mapping for time-related fields to ensure consistent naming
13207
- const TaskMap = {
13208
- completionTime: 'completedTime',
13209
- deletionTime: 'deletedTime',
13210
- lastModificationTime: 'lastModifiedTime',
13211
- creationTime: 'createdTime',
13212
- organizationUnitId: 'folderId'
13213
- };
13214
- /**
13215
- * Default expand parameters
13216
- */
13217
- const DEFAULT_TASK_EXPAND = 'AssignedToUser,CreatorUser,LastModifierUser';
13218
-
13219
13239
  /**
13220
13240
  * Service for interacting with UiPath Tasks API
13221
13241
  */
@@ -13410,29 +13430,38 @@
13410
13430
  }
13411
13431
  /**
13412
13432
  * Gets a task by ID
13413
- * IMPORTANT: For form tasks, folderId must be provided.
13414
- *
13415
13433
  * @param id - The ID of the task to retrieve
13416
- * @param options - Optional query parameters
13417
- * @param folderId - Optional folder ID (REQUIRED for form tasks)
13418
- * @returns Promise resolving to the task (form tasks will return form-specific data)
13419
- *
13434
+ * @param options - Optional query parameters including taskType for faster retrieval {@link TaskGetByIdOptions}
13435
+ * @param folderId - Optional folder ID (REQUIRED when options.taskType is provided)
13436
+ * @returns Promise resolving to the task
13437
+ * {@link TaskGetResponse}
13420
13438
  * @example
13421
13439
  * ```typescript
13422
- * import { Tasks } from '@uipath/uipath-typescript/tasks';
13440
+ * // Get a task by ID
13441
+ * const task = await tasks.getById(<taskId>);
13423
13442
  *
13424
- * const tasks = new Tasks(sdk);
13443
+ * // Get a form task by ID
13444
+ * const formTask = await tasks.getById(<taskId>, {}, <folderId>);
13425
13445
  *
13426
- * // Get task by ID
13427
- * const task = await tasks.getById(123);
13446
+ * // Access form task properties
13447
+ * console.log(formTask.formLayout);
13428
13448
  *
13429
- * // If the task is a form task, it will automatically return form-specific data
13449
+ * // Get a document validation task by ID (faster with taskType provided in the options)
13450
+ * const dvTask = await tasks.getById(<taskId>, { taskType: TaskType.DocumentValidation }, <folderId>);
13430
13451
  * ```
13431
13452
  */
13432
13453
  async getById(id, options = {}, folderId) {
13454
+ const { taskType, ...restOptions } = options;
13455
+ // If taskType is provided, skip the generic GET_BY_ID call and go directly to the type-specific endpoint
13456
+ if (taskType && taskType in TASK_TYPE_ENDPOINTS) {
13457
+ if (!folderId) {
13458
+ throw new ValidationError({ message: 'folderId is required when taskType is provided' });
13459
+ }
13460
+ return this.getByTaskType(id, folderId, taskType, restOptions);
13461
+ }
13433
13462
  const headers = createHeaders({ [FOLDER_ID]: folderId });
13434
13463
  // Add default expand parameters
13435
- const modifiedOptions = this.addDefaultExpand(options);
13464
+ const modifiedOptions = this.addDefaultExpand(restOptions);
13436
13465
  // prefix all keys in options
13437
13466
  const keysToPrefix = Object.keys(modifiedOptions);
13438
13467
  const apiOptions = addPrefixToKeys(modifiedOptions, ODATA_PREFIX, keysToPrefix);
@@ -13442,10 +13471,10 @@
13442
13471
  });
13443
13472
  // Transform response from PascalCase to camelCase and normalize time fields
13444
13473
  const transformedTask = transformData(pascalToCamelCaseKeys(response.data), TaskMap);
13445
- // Check if this is a form task and get form-specific data if it is
13446
- if (transformedTask.type === exports.TaskType.Form) {
13447
- const formOptions = { expandOnFormLayout: true };
13448
- return this.getFormTaskById(id, folderId || transformedTask.folderId, formOptions);
13474
+ // Get task type from response and fetch type-specific data
13475
+ const resolvedFolderId = folderId || transformedTask.folderId;
13476
+ if (transformedTask.type in TASK_TYPE_ENDPOINTS) {
13477
+ return this.getByTaskType(id, resolvedFolderId, transformedTask.type, restOptions);
13449
13478
  }
13450
13479
  return createTaskWithMethods(applyDataTransforms(transformedTask, { field: 'status', valueMap: TaskStatusMap }), this);
13451
13480
  }
@@ -13634,24 +13663,33 @@
13634
13663
  };
13635
13664
  }
13636
13665
  /**
13637
- * Gets a form task by ID (private method)
13666
+ * Routes to the type-specific endpoint based on task type.
13667
+ */
13668
+ getByTaskType(id, folderId, taskType, options = {}) {
13669
+ const endpoint = TASK_TYPE_ENDPOINTS[taskType];
13670
+ const extraParams = taskType === exports.TaskType.Form ? { expandOnFormLayout: true, ...options } : options;
13671
+ return this.getTaskByTypeEndpoint(id, folderId, endpoint, extraParams);
13672
+ }
13673
+ /**
13674
+ * Fetches a task from a type-specific endpoint.
13638
13675
  *
13639
- * @param id - The ID of the form task to retrieve
13676
+ * @param id - The task ID
13640
13677
  * @param folderId - Required folder ID
13641
- * @param options - Optional query parameters
13642
- * @returns Promise resolving to the form task
13678
+ * @param endpoint - The type-specific endpoint to call
13679
+ * @param extraParams - Additional query parameters (e.g. form options)
13680
+ * @returns Promise resolving to the task
13643
13681
  */
13644
- async getFormTaskById(id, folderId, options = {}) {
13682
+ async getTaskByTypeEndpoint(id, folderId, endpoint, extraParams = {}) {
13645
13683
  const headers = createHeaders({ [FOLDER_ID]: folderId });
13646
- const response = await this.get(TASK_ENDPOINTS.GET_TASK_FORM_BY_ID, {
13684
+ const response = await this.get(endpoint, {
13647
13685
  params: {
13648
13686
  taskId: id,
13649
- ...options
13687
+ ...extraParams
13650
13688
  },
13651
13689
  headers
13652
13690
  });
13653
- const transformedFormTask = transformData(response.data, TaskMap);
13654
- return createTaskWithMethods(applyDataTransforms(transformedFormTask, { field: 'status', valueMap: TaskStatusMap }), this);
13691
+ const transformedTask = transformData(response.data, TaskMap);
13692
+ return createTaskWithMethods(applyDataTransforms(transformedTask, { field: 'status', valueMap: TaskStatusMap }), this);
13655
13693
  }
13656
13694
  /**
13657
13695
  * Adds default expand parameters to options
@@ -14666,6 +14704,316 @@
14666
14704
  BucketOptions["AccessDataThroughOrchestrator"] = "AccessDataThroughOrchestrator";
14667
14705
  })(exports.BucketOptions || (exports.BucketOptions = {}));
14668
14706
 
14707
+ /**
14708
+ * Creates methods for a job response object.
14709
+ *
14710
+ * @param jobData - The raw job data from API
14711
+ * @param service - The job service instance
14712
+ * @returns Object containing job methods
14713
+ */
14714
+ function createJobMethods(jobData, service) {
14715
+ return {
14716
+ async getOutput() {
14717
+ if (!jobData.key)
14718
+ throw new Error('Job key is undefined');
14719
+ if (!jobData.folderId)
14720
+ throw new Error('Job folderId is undefined');
14721
+ return service.getOutput(jobData.key, jobData.folderId);
14722
+ },
14723
+ };
14724
+ }
14725
+ /**
14726
+ * Creates a job response with bound methods.
14727
+ *
14728
+ * @param jobData - The raw job data from API
14729
+ * @param service - The job service instance
14730
+ * @returns A job object with added methods
14731
+ */
14732
+ function createJobWithMethods(jobData, service) {
14733
+ const methods = createJobMethods(jobData, service);
14734
+ return Object.assign({}, jobData, methods);
14735
+ }
14736
+
14737
+ /**
14738
+ * Maps fields for Job entities to ensure consistent naming
14739
+ * Semantic renames only — case conversion handled by pascalToCamelCaseKeys()
14740
+ */
14741
+ const JobMap = {
14742
+ creationTime: 'createdTime',
14743
+ lastModificationTime: 'lastModifiedTime',
14744
+ organizationUnitId: 'folderId',
14745
+ organizationUnitFullyQualifiedName: 'folderName',
14746
+ releaseName: 'processName',
14747
+ releaseVersionId: 'processVersionId',
14748
+ processType: 'packageType',
14749
+ release: 'process',
14750
+ };
14751
+
14752
+ /**
14753
+ * Maps fields for Attachment entities to ensure consistent naming
14754
+ */
14755
+ const AttachmentsMap = {
14756
+ creationTime: 'createdTime',
14757
+ lastModificationTime: 'lastModifiedTime'
14758
+ };
14759
+
14760
+ class AttachmentService extends BaseService {
14761
+ /**
14762
+ * Gets an attachment by ID
14763
+ * @param id - The UUID of the attachment to retrieve
14764
+ * @param options - Optional query parameters (expand, select)
14765
+ * @returns Promise resolving to the attachment
14766
+ *
14767
+ * @example
14768
+ * ```typescript
14769
+ * import { Attachments } from '@uipath/uipath-typescript/attachments';
14770
+ *
14771
+ * const attachments = new Attachments(sdk);
14772
+ * const attachment = await attachments.getById('12345678-1234-1234-1234-123456789abc');
14773
+ * ```
14774
+ */
14775
+ async getById(id, options = {}) {
14776
+ if (!id) {
14777
+ throw new ValidationError({ message: 'id is required for getById' });
14778
+ }
14779
+ // Prefix all keys in options with $ for OData
14780
+ const keysToPrefix = Object.keys(options);
14781
+ const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
14782
+ const response = await this.get(ORCHESTRATOR_ATTACHMENT_ENDPOINTS.GET_BY_ID(id), {
14783
+ params: apiOptions,
14784
+ });
14785
+ // Transform response from PascalCase to camelCase, then apply field maps
14786
+ const camelCased = pascalToCamelCaseKeys(response.data);
14787
+ camelCased.blobFileAccess = transformData(camelCased.blobFileAccess, BucketMap);
14788
+ return transformData(camelCased, AttachmentsMap);
14789
+ }
14790
+ }
14791
+ __decorate([
14792
+ track('Attachments.GetById')
14793
+ ], AttachmentService.prototype, "getById", null);
14794
+
14795
+ /**
14796
+ * Service for interacting with UiPath Orchestrator Jobs API
14797
+ */
14798
+ class JobService extends FolderScopedService {
14799
+ /**
14800
+ * Creates an instance of the Jobs service.
14801
+ *
14802
+ * @param instance - UiPath SDK instance providing authentication and configuration
14803
+ */
14804
+ constructor(instance) {
14805
+ super(instance);
14806
+ this.attachmentService = new AttachmentService(instance);
14807
+ }
14808
+ /**
14809
+ * Gets all jobs across folders with optional filtering and pagination.
14810
+ *
14811
+ * Returns jobs with full details including state, timing, and input/output arguments.
14812
+ * Pass `folderId` to scope the query to a specific folder.
14813
+ *
14814
+ * !!! info "Input and output fields are not included in `getAll` responses"
14815
+ * The `inputArguments`, `inputFile`, `outputArguments`, and `outputFile` fields will always be `null` in the `getAll` response. To retrieve a job's output, use the {@link getOutput} method with the job's `key` and `folderId`.
14816
+ *
14817
+ * @param options - Query options including optional folderId, filtering, and pagination options
14818
+ * @returns Promise resolving to either an array of jobs {@link NonPaginatedResponse}<{@link JobGetResponse}> or a {@link PaginatedResponse}<{@link JobGetResponse}> when pagination options are used.
14819
+ * {@link JobGetResponse}
14820
+ * @example
14821
+ * ```typescript
14822
+ * // Get all jobs
14823
+ * const allJobs = await jobs.getAll();
14824
+ *
14825
+ * // Get all jobs in a specific folder
14826
+ * const folderJobs = await jobs.getAll({ folderId: <folderId> });
14827
+ *
14828
+ * // With filtering
14829
+ * const runningJobs = await jobs.getAll({
14830
+ * filter: "state eq 'Running'"
14831
+ * });
14832
+ *
14833
+ * // First page with pagination
14834
+ * const page1 = await jobs.getAll({ pageSize: 10 });
14835
+ *
14836
+ * // Navigate using cursor
14837
+ * if (page1.hasNextPage) {
14838
+ * const page2 = await jobs.getAll({ cursor: page1.nextCursor });
14839
+ * }
14840
+ *
14841
+ * // Jump to specific page
14842
+ * const page5 = await jobs.getAll({
14843
+ * jumpToPage: 5,
14844
+ * pageSize: 10
14845
+ * });
14846
+ * ```
14847
+ */
14848
+ async getAll(options) {
14849
+ const transformJobResponse = (job) => {
14850
+ const rawJob = transformData(pascalToCamelCaseKeys(job), JobMap);
14851
+ return createJobWithMethods(rawJob, this);
14852
+ };
14853
+ return PaginationHelpers.getAll({
14854
+ serviceAccess: this.createPaginationServiceAccess(),
14855
+ getEndpoint: () => JOB_ENDPOINTS.GET_ALL,
14856
+ getByFolderEndpoint: JOB_ENDPOINTS.GET_ALL,
14857
+ transformFn: transformJobResponse,
14858
+ pagination: {
14859
+ paginationType: PaginationType.OFFSET,
14860
+ itemsField: ODATA_PAGINATION.ITEMS_FIELD,
14861
+ totalCountField: ODATA_PAGINATION.TOTAL_COUNT_FIELD,
14862
+ paginationParams: {
14863
+ pageSizeParam: ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM,
14864
+ offsetParam: ODATA_OFFSET_PARAMS.OFFSET_PARAM,
14865
+ countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM,
14866
+ },
14867
+ },
14868
+ }, options);
14869
+ }
14870
+ /**
14871
+ * Gets the output of a completed job.
14872
+ *
14873
+ * Retrieves the job's output arguments, handling both inline output (stored directly on the job
14874
+ * as a JSON string in `outputArguments`) and file-based output (stored as a blob attachment for
14875
+ * large outputs). Returns the parsed JSON output or `null` if the job has no output.
14876
+ *
14877
+ * @param jobKey - The unique key (GUID) of the job to retrieve output from
14878
+ * @param folderId - The folder ID where the job resides
14879
+ * @returns Promise resolving to the parsed output as `Record<string, unknown>`, or `null` if no output exists
14880
+ *
14881
+ * @example
14882
+ * ```typescript
14883
+ * // Get output from a completed job
14884
+ * const output = await jobs.getOutput(<jobKey>, <folderId>);
14885
+ *
14886
+ * if (output) {
14887
+ * console.log('Job output:', output);
14888
+ * }
14889
+ * ```
14890
+ *
14891
+ * @example
14892
+ * ```typescript
14893
+ * // Get output using bound method (jobKey and folderId are taken from the job object)
14894
+ * const allJobs = await jobs.getAll();
14895
+ * const completedJob = allJobs.items.find(j => j.state === JobState.Successful);
14896
+ *
14897
+ * if (completedJob) {
14898
+ * const output = await completedJob.getOutput();
14899
+ * }
14900
+ * ```
14901
+ */
14902
+ async getOutput(jobKey, folderId) {
14903
+ if (!jobKey) {
14904
+ throw new ValidationError({ message: 'jobKey is required for getOutput' });
14905
+ }
14906
+ const job = await this.fetchJobByKey(jobKey, folderId);
14907
+ if (job.OutputArguments) {
14908
+ try {
14909
+ return JSON.parse(job.OutputArguments);
14910
+ }
14911
+ catch {
14912
+ throw new ServerError({ message: 'Failed to parse job output arguments as JSON' });
14913
+ }
14914
+ }
14915
+ if (job.OutputFile) {
14916
+ return this.downloadOutputFile(job.OutputFile);
14917
+ }
14918
+ return null;
14919
+ }
14920
+ /**
14921
+ * Fetches a job by its Key (GUID) using the GetByKey endpoint.
14922
+ * Only selects fields needed for output extraction.
14923
+ */
14924
+ async fetchJobByKey(jobKey, folderId) {
14925
+ const headers = createHeaders({ [FOLDER_ID]: folderId });
14926
+ const response = await this.get(JOB_ENDPOINTS.GET_BY_KEY(jobKey), {
14927
+ params: {
14928
+ $select: 'OutputArguments,OutputFile',
14929
+ },
14930
+ headers,
14931
+ });
14932
+ return response.data;
14933
+ }
14934
+ /**
14935
+ * Downloads the output file content via the Attachments API.
14936
+ * 1. Fetches blob access info from the attachment using AttachmentService
14937
+ * 2. Downloads content from the presigned blob URI
14938
+ * 3. Parses and returns the JSON content
14939
+ */
14940
+ async downloadOutputFile(outputFileKey) {
14941
+ const attachment = await this.attachmentService.getById(outputFileKey);
14942
+ const blobAccess = attachment.blobFileAccess;
14943
+ if (!blobAccess?.uri) {
14944
+ return null;
14945
+ }
14946
+ const blobHeaders = { ...blobAccess.headers };
14947
+ // Add auth header if the blob URI requires authenticated access
14948
+ if (blobAccess.requiresAuth) {
14949
+ const token = await this.getValidAuthToken();
14950
+ blobHeaders['Authorization'] = `Bearer ${token}`;
14951
+ }
14952
+ const blobResponse = await fetch(blobAccess.uri, {
14953
+ method: 'GET',
14954
+ headers: blobHeaders,
14955
+ });
14956
+ if (!blobResponse.ok) {
14957
+ const errorInfo = await errorResponseParser.parse(blobResponse);
14958
+ throw ErrorFactory.createFromHttpStatus(blobResponse.status, errorInfo);
14959
+ }
14960
+ const content = await blobResponse.text();
14961
+ try {
14962
+ return JSON.parse(content);
14963
+ }
14964
+ catch {
14965
+ throw new ServerError({ message: 'Failed to parse job output file as JSON' });
14966
+ }
14967
+ }
14968
+ }
14969
+ __decorate([
14970
+ track('Jobs.GetAll')
14971
+ ], JobService.prototype, "getAll", null);
14972
+ __decorate([
14973
+ track('Jobs.GetOutput')
14974
+ ], JobService.prototype, "getOutput", null);
14975
+
14976
+ /**
14977
+ * Enum for job sub-state
14978
+ */
14979
+ exports.JobSubState = void 0;
14980
+ (function (JobSubState) {
14981
+ JobSubState["WithFaults"] = "WITH_FAULTS";
14982
+ JobSubState["Manually"] = "MANUALLY";
14983
+ })(exports.JobSubState || (exports.JobSubState = {}));
14984
+ /**
14985
+ * Enum for serverless job type
14986
+ */
14987
+ exports.ServerlessJobType = void 0;
14988
+ (function (ServerlessJobType) {
14989
+ ServerlessJobType["RobotJob"] = "RobotJob";
14990
+ ServerlessJobType["WebApp"] = "WebApp";
14991
+ ServerlessJobType["LoadTest"] = "LoadTest";
14992
+ ServerlessJobType["StudioWebDesigner"] = "StudioWebDesigner";
14993
+ ServerlessJobType["PublishStudioProject"] = "PublishStudioProject";
14994
+ ServerlessJobType["JsApi"] = "JsApi";
14995
+ ServerlessJobType["PythonCodedAgent"] = "PythonCodedAgent";
14996
+ ServerlessJobType["MCPServer"] = "MCPServer";
14997
+ ServerlessJobType["PythonCodedSystemAgent"] = "PythonCodedSystemAgent";
14998
+ ServerlessJobType["PythonAgent"] = "PythonAgent";
14999
+ })(exports.ServerlessJobType || (exports.ServerlessJobType = {}));
15000
+
15001
+ /**
15002
+ * Common enum for job state used across services
15003
+ */
15004
+ exports.JobState = void 0;
15005
+ (function (JobState) {
15006
+ JobState["Pending"] = "Pending";
15007
+ JobState["Running"] = "Running";
15008
+ JobState["Stopping"] = "Stopping";
15009
+ JobState["Terminating"] = "Terminating";
15010
+ JobState["Faulted"] = "Faulted";
15011
+ JobState["Successful"] = "Successful";
15012
+ JobState["Stopped"] = "Stopped";
15013
+ JobState["Suspended"] = "Suspended";
15014
+ JobState["Resumed"] = "Resumed";
15015
+ })(exports.JobState || (exports.JobState = {}));
15016
+
14669
15017
  /**
14670
15018
  * Maps fields for Process entities to ensure consistent naming
14671
15019
  */
@@ -14848,6 +15196,9 @@
14848
15196
  PackageType["Api"] = "Api";
14849
15197
  PackageType["MCPServer"] = "MCPServer";
14850
15198
  PackageType["BusinessRules"] = "BusinessRules";
15199
+ PackageType["CaseManagement"] = "CaseManagement";
15200
+ PackageType["Flow"] = "Flow";
15201
+ PackageType["Function"] = "Function";
14851
15202
  })(exports.PackageType || (exports.PackageType = {}));
14852
15203
  /**
14853
15204
  * Enum for job priority
@@ -14926,6 +15277,36 @@
14926
15277
  PackageSourceType["AgentHub"] = "AgentHub";
14927
15278
  PackageSourceType["ApiWorkflow"] = "ApiWorkflow";
14928
15279
  })(exports.PackageSourceType || (exports.PackageSourceType = {}));
15280
+ /**
15281
+ * Enum for job source type
15282
+ */
15283
+ exports.JobSourceType = void 0;
15284
+ (function (JobSourceType) {
15285
+ JobSourceType["Manual"] = "Manual";
15286
+ JobSourceType["Schedule"] = "Schedule";
15287
+ JobSourceType["Agent"] = "Agent";
15288
+ JobSourceType["Queue"] = "Queue";
15289
+ JobSourceType["StudioWeb"] = "StudioWeb";
15290
+ JobSourceType["IntegrationTrigger"] = "IntegrationTrigger";
15291
+ JobSourceType["StudioDesktop"] = "StudioDesktop";
15292
+ JobSourceType["AutomationOpsPipelines"] = "AutomationOpsPipelines";
15293
+ JobSourceType["Apps"] = "Apps";
15294
+ JobSourceType["SAP"] = "SAP";
15295
+ JobSourceType["HttpTrigger"] = "HttpTrigger";
15296
+ JobSourceType["HttpTriggerCallback"] = "HttpTriggerCallback";
15297
+ JobSourceType["RobotAPI"] = "RobotAPI";
15298
+ JobSourceType["CommandLine"] = "CommandLine";
15299
+ JobSourceType["RobotNetAPI"] = "RobotNetAPI";
15300
+ JobSourceType["Autopilot"] = "Autopilot";
15301
+ JobSourceType["TestManager"] = "TestManager";
15302
+ JobSourceType["AgentService"] = "AgentService";
15303
+ JobSourceType["ProcessOrchestration"] = "ProcessOrchestration";
15304
+ JobSourceType["PluginEcosystem"] = "PluginEcosystem";
15305
+ JobSourceType["PerformanceTesting"] = "PerformanceTesting";
15306
+ JobSourceType["AgentHub"] = "AgentHub";
15307
+ JobSourceType["ApiWorkflow"] = "ApiWorkflow";
15308
+ JobSourceType["CaseManagement"] = "CaseManagement";
15309
+ })(exports.JobSourceType || (exports.JobSourceType = {}));
14929
15310
  /**
14930
15311
  * Enum for stop strategy
14931
15312
  */
@@ -14934,6 +15315,39 @@
14934
15315
  StopStrategy["SoftStop"] = "SoftStop";
14935
15316
  StopStrategy["Kill"] = "Kill";
14936
15317
  })(exports.StopStrategy || (exports.StopStrategy = {}));
15318
+ /**
15319
+ * Enum for runtime type
15320
+ */
15321
+ exports.RuntimeType = void 0;
15322
+ (function (RuntimeType) {
15323
+ RuntimeType["NonProduction"] = "NonProduction";
15324
+ RuntimeType["Attended"] = "Attended";
15325
+ RuntimeType["Unattended"] = "Unattended";
15326
+ RuntimeType["Development"] = "Development";
15327
+ RuntimeType["Studio"] = "Studio";
15328
+ RuntimeType["RpaDeveloper"] = "RpaDeveloper";
15329
+ RuntimeType["StudioX"] = "StudioX";
15330
+ RuntimeType["CitizenDeveloper"] = "CitizenDeveloper";
15331
+ RuntimeType["Headless"] = "Headless";
15332
+ RuntimeType["StudioPro"] = "StudioPro";
15333
+ RuntimeType["RpaDeveloperPro"] = "RpaDeveloperPro";
15334
+ RuntimeType["TestAutomation"] = "TestAutomation";
15335
+ RuntimeType["AutomationCloud"] = "AutomationCloud";
15336
+ RuntimeType["Serverless"] = "Serverless";
15337
+ RuntimeType["AutomationKit"] = "AutomationKit";
15338
+ RuntimeType["ServerlessTestAutomation"] = "ServerlessTestAutomation";
15339
+ RuntimeType["AutomationCloudTestAutomation"] = "AutomationCloudTestAutomation";
15340
+ RuntimeType["AttendedStudioWeb"] = "AttendedStudioWeb";
15341
+ RuntimeType["Hosting"] = "Hosting";
15342
+ RuntimeType["AssistantWeb"] = "AssistantWeb";
15343
+ RuntimeType["ProcessOrchestration"] = "ProcessOrchestration";
15344
+ RuntimeType["AgentService"] = "AgentService";
15345
+ RuntimeType["AppTest"] = "AppTest";
15346
+ RuntimeType["PerformanceTest"] = "PerformanceTest";
15347
+ RuntimeType["BusinessRule"] = "BusinessRule";
15348
+ RuntimeType["CaseManagement"] = "CaseManagement";
15349
+ RuntimeType["Flow"] = "Flow";
15350
+ })(exports.RuntimeType || (exports.RuntimeType = {}));
14937
15351
  /**
14938
15352
  * Enum for job type
14939
15353
  */
@@ -15171,22 +15585,6 @@
15171
15585
  }
15172
15586
  }
15173
15587
 
15174
- /**
15175
- * Common enum for job state used across services
15176
- */
15177
- exports.JobState = void 0;
15178
- (function (JobState) {
15179
- JobState["Pending"] = "Pending";
15180
- JobState["Running"] = "Running";
15181
- JobState["Stopping"] = "Stopping";
15182
- JobState["Terminating"] = "Terminating";
15183
- JobState["Faulted"] = "Faulted";
15184
- JobState["Successful"] = "Successful";
15185
- JobState["Stopped"] = "Stopped";
15186
- JobState["Suspended"] = "Suspended";
15187
- JobState["Resumed"] = "Resumed";
15188
- })(exports.JobState || (exports.JobState = {}));
15189
-
15190
15588
  /**
15191
15589
  * Common Constants for Conversational Agent
15192
15590
  */
@@ -15559,6 +15957,7 @@
15559
15957
  exports.createCaseInstanceWithMethods = createCaseInstanceWithMethods;
15560
15958
  exports.createConversationWithMethods = createConversationWithMethods;
15561
15959
  exports.createEntityWithMethods = createEntityWithMethods;
15960
+ exports.createJobWithMethods = createJobWithMethods;
15562
15961
  exports.createProcessInstanceWithMethods = createProcessInstanceWithMethods;
15563
15962
  exports.createProcessWithMethods = createProcessWithMethods;
15564
15963
  exports.createTaskWithMethods = createTaskWithMethods;