@uipath/uipath-typescript 1.0.0-beta.13 → 1.0.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1077,7 +1077,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
1077
1077
  /**
1078
1078
  * Process information with instance statistics
1079
1079
  */
1080
- interface MaestroProcessGetAllResponse {
1080
+ interface RawMaestroProcessGetAllResponse {
1081
1081
  /** Unique key identifying the process */
1082
1082
  processKey: string;
1083
1083
  /** Package identifier */
@@ -1114,6 +1114,68 @@ interface MaestroProcessGetAllResponse {
1114
1114
  cancelingCount: number;
1115
1115
  }
1116
1116
 
1117
+ /**
1118
+ * Process Incident Status
1119
+ */
1120
+ declare enum ProcessIncidentStatus {
1121
+ Open = "Open",
1122
+ Closed = "Closed"
1123
+ }
1124
+ /**
1125
+ * Process Incident Type
1126
+ */
1127
+ declare enum ProcessIncidentType {
1128
+ System = "System",
1129
+ User = "User",
1130
+ Deployment = "Deployment"
1131
+ }
1132
+ /**
1133
+ * Process Incident Severity
1134
+ */
1135
+ declare enum ProcessIncidentSeverity {
1136
+ Error = "Error",
1137
+ Warning = "Warning"
1138
+ }
1139
+ /**
1140
+ * Process Incident Debug Mode
1141
+ */
1142
+ declare enum DebugMode {
1143
+ None = "None",
1144
+ Default = "Default",
1145
+ StepByStep = "StepByStep",
1146
+ SingleStep = "SingleStep"
1147
+ }
1148
+ /**
1149
+ * Process Incident Get Response
1150
+ */
1151
+ interface ProcessIncidentGetResponse {
1152
+ instanceId: string;
1153
+ elementId: string;
1154
+ folderKey: string;
1155
+ processKey: string;
1156
+ incidentId: string;
1157
+ incidentStatus: ProcessIncidentStatus;
1158
+ incidentType: ProcessIncidentType | null;
1159
+ errorCode: string;
1160
+ errorMessage: string;
1161
+ errorTime: string;
1162
+ errorDetails: string;
1163
+ debugMode: DebugMode;
1164
+ incidentSeverity: ProcessIncidentSeverity | null;
1165
+ incidentElementActivityType: string;
1166
+ incidentElementActivityName: string;
1167
+ }
1168
+ /**
1169
+ * Process Incident Summary Get Response
1170
+ */
1171
+ interface ProcessIncidentGetAllResponse {
1172
+ count: number;
1173
+ errorMessage: string;
1174
+ errorCode: string;
1175
+ firstOccuranceTime: string;
1176
+ processKey: string;
1177
+ }
1178
+
1117
1179
  /**
1118
1180
  * Maestro Process Models
1119
1181
  * Model classes for Maestro processes
@@ -1126,24 +1188,66 @@ interface MaestroProcessGetAllResponse {
1126
1188
  */
1127
1189
  interface MaestroProcessesServiceModel {
1128
1190
  /**
1129
- * @returns Promise resolving to array of MaestroProcess objects
1191
+ * @returns Promise resolving to array of MaestroProcess objects with methods
1130
1192
  * {@link MaestroProcessGetAllResponse}
1131
1193
  * @example
1132
1194
  * ```typescript
1133
1195
  * // Get all processes
1134
1196
  * const processes = await sdk.maestro.processes.getAll();
1135
1197
  *
1136
- * // Access process information
1198
+ * // Access process information and incidents
1137
1199
  * for (const process of processes) {
1138
1200
  * console.log(`Process: ${process.processKey}`);
1139
1201
  * console.log(`Running instances: ${process.runningCount}`);
1140
1202
  * console.log(`Faulted instances: ${process.faultedCount}`);
1203
+ *
1204
+ * // Get incidents for this process
1205
+ * const incidents = await process.getIncidents();
1206
+ * console.log(`Incidents: ${incidents.length}`);
1141
1207
  * }
1142
1208
  *
1143
1209
  * ```
1144
1210
  */
1145
1211
  getAll(): Promise<MaestroProcessGetAllResponse[]>;
1212
+ /**
1213
+ * Get incidents for a specific process
1214
+ *
1215
+ * @param processKey The key of the process to get incidents for
1216
+ * @param folderKey The folder key for authorization
1217
+ * @returns Promise resolving to array of incidents for the process
1218
+ * {@link ProcessIncidentGetResponse}
1219
+ * @example
1220
+ * ```typescript
1221
+ * // Get incidents for a specific process
1222
+ * const incidents = await sdk.maestro.processes.getIncidents('<processKey>', '<folderKey>');
1223
+ *
1224
+ * // Access incident details
1225
+ * for (const incident of incidents) {
1226
+ * console.log(`Element: ${incident.incidentElementActivityName} (${incident.incidentElementActivityType})`);
1227
+ * console.log(`Status: ${incident.incidentStatus}`);
1228
+ * console.log(`Error: ${incident.errorMessage}`);
1229
+ * }
1230
+ * ```
1231
+ */
1232
+ getIncidents(processKey: string, folderKey: string): Promise<ProcessIncidentGetResponse[]>;
1233
+ }
1234
+ interface ProcessMethods {
1235
+ /**
1236
+ * Gets incidents for this process
1237
+ *
1238
+ * @returns Promise resolving to array of process incidents
1239
+ */
1240
+ getIncidents(): Promise<ProcessIncidentGetResponse[]>;
1146
1241
  }
1242
+ type MaestroProcessGetAllResponse = RawMaestroProcessGetAllResponse & ProcessMethods;
1243
+ /**
1244
+ * Creates an actionable process by combining API process data with operational methods.
1245
+ *
1246
+ * @param processData - The process data from API
1247
+ * @param service - The process service instance
1248
+ * @returns A process object with added methods
1249
+ */
1250
+ declare function createProcessWithMethods(processData: MaestroProcessGetAllResponse, service: MaestroProcessesServiceModel): MaestroProcessGetAllResponse;
1147
1251
 
1148
1252
  /**
1149
1253
  * Constants used throughout the pagination system
@@ -1453,32 +1557,23 @@ interface ProcessInstancesServiceModel {
1453
1557
  * <folderKey>
1454
1558
  * );
1455
1559
  *
1456
- * if (result.success) {
1457
- * console.log(`Instance ${result.data.instanceId} now has status: ${result.data.status}`);
1458
- * }
1560
+ * or
1459
1561
  *
1460
- * // Cancel with a comment
1461
- * const result = await sdk.maestro.processes.instances.cancel(
1562
+ * const instance = await sdk.maestro.processes.instances.getById(
1462
1563
  * <instanceId>,
1463
- * <folderKey>,
1464
- * { comment: <comment> }
1564
+ * <folderKey>
1465
1565
  * );
1566
+ * const result = await instance.cancel();
1466
1567
  *
1467
- * // Cancel multiple faulted instances
1468
- * const instances = await sdk.maestro.processes.instances.getAll({
1469
- * latestRunStatus: "Faulted"
1568
+ * console.log(`Cancelled: ${result.success}`);
1569
+ *
1570
+ * // Cancel with a comment
1571
+ * const result = await instance.cancel({
1572
+ * comment: 'Cancelling due to invalid input data'
1470
1573
  * });
1471
1574
  *
1472
- * for (const instance of instances.items) {
1473
- * const result = await sdk.maestro.processes.instances.cancel(
1474
- * instance.instanceId,
1475
- * instance.folderKey,
1476
- * { comment: <comment> }
1477
- * );
1478
- *
1479
- * if (result.success) {
1480
- * console.log(`Cancelled instance: ${result.data.instanceId}`);
1481
- * }
1575
+ * if (result.success) {
1576
+ * console.log(`Instance ${result.data.instanceId} status: ${result.data.status}`);
1482
1577
  * }
1483
1578
  * ```
1484
1579
  */
@@ -1535,6 +1630,27 @@ interface ProcessInstancesServiceModel {
1535
1630
  * ```
1536
1631
  */
1537
1632
  getVariables(instanceId: string, folderKey: string, options?: ProcessInstanceGetVariablesOptions): Promise<ProcessInstanceGetVariablesResponse>;
1633
+ /**
1634
+ * Get incidents for a process instance
1635
+ *
1636
+ * @param instanceId The ID of the instance to get incidents for
1637
+ * @param folderKey The folder key for authorization
1638
+ * @returns Promise resolving to array of incidents for the processinstance
1639
+ * {@link ProcessIncidentGetResponse}
1640
+ * @example
1641
+ * ```typescript
1642
+ * // Get incidents for a specific instance
1643
+ * const incidents = await sdk.maestro.processes.instances.getIncidents('<instanceId>', '<folderKey>');
1644
+ *
1645
+ * // Access process incident details
1646
+ * for (const incident of incidents) {
1647
+ * console.log(`Element: ${incident.incidentElementActivityName} (${incident.incidentElementActivityType})`);
1648
+ * console.log(`Severity: ${incident.incidentSeverity}`);
1649
+ * console.log(`Error: ${incident.errorMessage}`);
1650
+ * }
1651
+ * ```
1652
+ */
1653
+ getIncidents(instanceId: string, folderKey: string): Promise<ProcessIncidentGetResponse[]>;
1538
1654
  }
1539
1655
  interface ProcessInstanceMethods {
1540
1656
  /**
@@ -1558,6 +1674,31 @@ interface ProcessInstanceMethods {
1558
1674
  * @returns Promise resolving to operation result
1559
1675
  */
1560
1676
  resume(options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1677
+ /**
1678
+ * Gets incidents for this process instance
1679
+ *
1680
+ * @returns Promise resolving to array of incidents for this instance
1681
+ */
1682
+ getIncidents(): Promise<ProcessIncidentGetResponse[]>;
1683
+ /**
1684
+ * Gets execution history (spans) for this process instance
1685
+ *
1686
+ * @returns Promise resolving to execution history
1687
+ */
1688
+ getExecutionHistory(): Promise<ProcessInstanceExecutionHistoryResponse[]>;
1689
+ /**
1690
+ * Gets BPMN XML file for this process instance
1691
+ *
1692
+ * @returns Promise resolving to BPMN XML file
1693
+ */
1694
+ getBpmn(): Promise<BpmnXmlString>;
1695
+ /**
1696
+ * Gets global variables for this process instance
1697
+ *
1698
+ * @param options - Optional options including parentElementId to filter by parent element
1699
+ * @returns Promise resolving to variables response with elements and globals
1700
+ */
1701
+ getVariables(options?: ProcessInstanceGetVariablesOptions): Promise<ProcessInstanceGetVariablesResponse>;
1561
1702
  }
1562
1703
  type ProcessInstanceGetResponse = RawProcessInstanceGetResponse & ProcessInstanceMethods;
1563
1704
  /**
@@ -1570,177 +1711,1476 @@ type ProcessInstanceGetResponse = RawProcessInstanceGetResponse & ProcessInstanc
1570
1711
  declare function createProcessInstanceWithMethods(instanceData: RawProcessInstanceGetResponse, service: ProcessInstancesServiceModel): ProcessInstanceGetResponse;
1571
1712
 
1572
1713
  /**
1573
- * Service for interacting with Maestro Processes
1714
+ * Service for managing UiPath Maestro Process incidents
1715
+ *
1716
+ * Maestro Process incidents helps you identify, investigate, and resolve errors that occur during process execution. [UiPath Maestro Process Incidents Guide](https://docs.uipath.com/maestro/automation-cloud/latest/user-guide/all-incidents-view)
1574
1717
  */
1575
- declare class MaestroProcessesService extends BaseService implements MaestroProcessesServiceModel {
1576
- /**
1577
- * @hideconstructor
1578
- */
1579
- constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
1718
+ interface ProcessIncidentsServiceModel {
1580
1719
  /**
1581
- * Get all processes with their instance statistics
1582
- * @returns Promise resolving to array of MaestroProcess objects
1720
+ * Get all process incidents across all folders
1583
1721
  *
1722
+ * @returns Promise resolving to array of process incident
1723
+ * {@link ProcessIncidentGetAllResponse}
1584
1724
  * @example
1585
1725
  * ```typescript
1586
- * // Get all processes
1587
- * const processes = await sdk.maestro.processes.getAll();
1588
- *
1589
- * // Access process information
1590
- * for (const process of processes) {
1591
- * console.log(`Process: ${process.processKey}`);
1592
- * console.log(`Running instances: ${process.runningCount}`);
1593
- * console.log(`Faulted instances: ${process.faultedCount}`);
1726
+ * // Get all process incidents across all folders
1727
+ * const incidents = await sdk.maestro.processes.incidents.getAll();
1728
+ *
1729
+ * // Access process incident information
1730
+ * for (const incident of incidents) {
1731
+ * console.log(`Process: ${incident.processKey}`);
1732
+ * console.log(`Error: ${incident.errorMessage}`);
1733
+ * console.log(`Count: ${incident.count}`);
1734
+ * console.log(`First occurrence: ${incident.firstOccuranceTime}`);
1594
1735
  * }
1595
- *
1596
1736
  * ```
1597
1737
  */
1598
- getAll(): Promise<MaestroProcessGetAllResponse[]>;
1738
+ getAll(): Promise<ProcessIncidentGetAllResponse[]>;
1599
1739
  }
1600
1740
 
1601
- declare class ProcessInstancesService extends BaseService implements ProcessInstancesServiceModel {
1602
- /**
1603
- * @hideconstructor
1604
- */
1605
- constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
1741
+ /**
1742
+ * Maestro Cases Types
1743
+ * Types and interfaces for Maestro case management
1744
+ */
1745
+ /**
1746
+ * Case information with instance statistics
1747
+ */
1748
+ interface CaseGetAllResponse {
1749
+ /** Unique key identifying the case process */
1750
+ processKey: string;
1751
+ /** Package identifier */
1752
+ packageId: string;
1753
+ /** Case name */
1754
+ name: string;
1755
+ /** Folder key of the folder where case process is located */
1756
+ folderKey: string;
1757
+ /** Name of the folder where case process is located */
1758
+ folderName: string;
1759
+ /** Available package versions */
1760
+ packageVersions: string[];
1761
+ /** Total number of versions */
1762
+ versionCount: number;
1763
+ /** Case instance count - pending */
1764
+ pendingCount: number;
1765
+ /** Case instance count - running */
1766
+ runningCount: number;
1767
+ /** Case instance count - completed */
1768
+ completedCount: number;
1769
+ /** Case instance count - paused */
1770
+ pausedCount: number;
1771
+ /** Case instance count - cancelled */
1772
+ cancelledCount: number;
1773
+ /** Case instance count - faulted */
1774
+ faultedCount: number;
1775
+ /** Case instance count - retrying */
1776
+ retryingCount: number;
1777
+ /** Case instance count - resuming */
1778
+ resumingCount: number;
1779
+ /** Case instance count - pausing */
1780
+ pausingCount: number;
1781
+ /** Case instance count - canceling */
1782
+ cancelingCount: number;
1783
+ }
1784
+
1785
+ /**
1786
+ * Maestro Cases Models
1787
+ * Model classes for Maestro cases
1788
+ */
1789
+
1790
+ /**
1791
+ * Service for managing UiPath Maestro Cases
1792
+ *
1793
+ * UiPath Maestro Case Management describes solutions that help manage and automate the full flow of complex E2E scenarios.
1794
+ */
1795
+ interface CasesServiceModel {
1606
1796
  /**
1607
- * Get all process instances with optional filtering and pagination
1608
- *
1609
- * The method returns either:
1610
- * - A NonPaginatedResponse with items array (when no pagination parameters are provided)
1611
- * - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
1612
- *
1613
- * @param options Query parameters for filtering instances and pagination
1614
- * @returns Promise resolving to process instances or paginated result
1615
- *
1797
+ * @returns Promise resolving to array of Case objects
1798
+ * {@link CaseGetAllResponse}
1616
1799
  * @example
1617
1800
  * ```typescript
1618
- * // Get all instances (non-paginated)
1619
- * const instances = await sdk.maestro.processes.instances.getAll();
1620
- *
1621
- * // Cancel faulted instances using methods directly on instances
1622
- * for (const instance of instances.items) {
1623
- * if (instance.latestRunStatus === 'Faulted') {
1624
- * await instance.cancel({ comment: 'Cancelling faulted instance' });
1625
- * }
1801
+ * // Get all case management processes
1802
+ * const cases = await sdk.maestro.cases.getAll();
1803
+ *
1804
+ * // Access case information
1805
+ * for (const caseProcess of cases) {
1806
+ * console.log(`Case Process: ${caseProcess.processKey}`);
1807
+ * console.log(`Running instances: ${caseProcess.runningCount}`);
1808
+ * console.log(`Completed instances: ${caseProcess.completedCount}`);
1626
1809
  * }
1627
1810
  *
1628
- * // With filtering
1629
- * const instances = await sdk.maestro.processes.instances.getAll({
1630
- * processKey: 'MyProcess'
1631
- * });
1632
- *
1633
- * // First page with pagination
1634
- * const page1 = await sdk.maestro.processes.instances.getAll({ pageSize: 10 });
1635
- *
1636
- * // Navigate using cursor
1637
- * if (page1.hasNextPage) {
1638
- * const page2 = await sdk.maestro.processes.instances.getAll({ cursor: page1.nextCursor });
1639
- * }
1640
1811
  * ```
1641
1812
  */
1642
- getAll<T extends ProcessInstanceGetAllWithPaginationOptions = ProcessInstanceGetAllWithPaginationOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessInstanceGetResponse> : NonPaginatedResponse<ProcessInstanceGetResponse>>;
1643
- /**
1644
- * Get a process instance by ID with operation methods (cancel, pause, resume)
1645
- * @param id The ID of the instance to retrieve
1646
- * @param folderKey The folder key for authorization
1647
- * @returns Promise<ProcessInstanceGetResponse>
1648
- */
1649
- getById(id: string, folderKey: string): Promise<ProcessInstanceGetResponse>;
1650
- /**
1651
- * Get execution history (spans) for a process instance
1652
- * @param instanceId The ID of the instance to get history for
1653
- * @returns Promise<ProcessInstanceExecutionHistoryResponse[]>
1654
- */
1655
- getExecutionHistory(instanceId: string): Promise<ProcessInstanceExecutionHistoryResponse[]>;
1656
- /**
1657
- * Get BPMN XML file for a process instance
1658
- * @param instanceId The ID of the instance to get BPMN for
1659
- * @param folderKey The folder key for authorization
1660
- * @returns Promise<BpmnXmlString> The BPMN XML contents as a string
1661
- */
1662
- getBpmn(instanceId: string, folderKey: string): Promise<BpmnXmlString>;
1663
- /**
1664
- * Cancel a process instance
1665
- * @param instanceId The ID of the instance to cancel
1666
- * @param folderKey The folder key for authorization
1667
- * @param options Optional cancellation options with comment
1668
- * @returns Promise resolving to operation result with updated instance data
1669
- */
1670
- cancel(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1671
- /**
1672
- * Pause a process instance
1673
- * @param instanceId The ID of the instance to pause
1674
- * @param folderKey The folder key for authorization
1675
- * @param options Optional pause options with comment
1676
- * @returns Promise resolving to operation result with updated instance data
1677
- */
1678
- pause(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1679
- /**
1680
- * Resume a process instance
1681
- * @param instanceId The ID of the instance to resume
1682
- * @param folderKey The folder key for authorization
1683
- * @param options Optional resume options with comment
1684
- * @returns Promise resolving to operation result with updated instance data
1685
- */
1686
- resume(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1687
- /**
1688
- * Parses BPMN XML to extract variable metadata from uipath:inputOutput elements
1689
- * @private
1690
- * @param bpmnXml The BPMN XML string
1691
- * @returns Map of variable ID to metadata
1692
- */
1693
- private parseBpmnVariables;
1694
- /**
1695
- * Extracts element names from BPMN XML and maps them to their element IDs
1696
- * @private
1697
- * @param bpmnXml The BPMN XML string
1698
- * @returns Map of elementId to element name
1699
- */
1700
- private getVariableSource;
1701
- /**
1702
- * Enriches global variables with metadata from BPMN
1703
- * @private
1704
- * @param globals The raw globals object from API response
1705
- * @param variableMetadata The parsed BPMN variable metadata
1706
- * @returns Array of global variables
1707
- */
1708
- private transformGlobalVariables;
1709
- /**
1710
- * Get global variables for a process instance
1711
- * @param instanceId The ID of the instance to get variables for
1712
- * @param folderKey The folder key for authorization
1713
- * @param options Optional options including parentElementId to filter by parent element
1714
- * @returns Promise<ProcessInstanceGetVariablesResponse>
1715
- */
1716
- getVariables(instanceId: string, folderKey: string, options?: ProcessInstanceGetVariablesOptions): Promise<ProcessInstanceGetVariablesResponse>;
1813
+ getAll(): Promise<CaseGetAllResponse[]>;
1717
1814
  }
1718
1815
 
1719
1816
  /**
1720
- * Base service for services that need folder-specific functionality
1817
+ * Case Instance Types
1818
+ * Types and interfaces for Maestro case instance management
1721
1819
  */
1722
- declare class FolderScopedService extends BaseService {
1723
- constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
1724
- /**
1725
- * Gets resources in a folder with optional query parameters
1726
- *
1727
- * @param endpoint - API endpoint to call
1728
- * @param folderId - required folder ID
1729
- * @param options - Query options
1730
- * @param transformFn - Optional function to transform the response data
1731
- * @returns Promise resolving to an array of resources
1732
- */
1733
- protected _getByFolder<T, R = T>(endpoint: string, folderId: number, options?: Record<string, any>, transformFn?: (item: T) => R): Promise<R[]>;
1734
- }
1735
1820
 
1736
1821
  /**
1737
- * Enum for Asset Value Scope
1822
+ * Response for getting a single case instance
1738
1823
  */
1739
- declare enum AssetValueScope {
1740
- Global = "Global",
1741
- PerRobot = "PerRobot"
1742
- }
1743
- /**
1824
+ interface RawCaseInstanceGetResponse {
1825
+ instanceId: string;
1826
+ packageKey: string;
1827
+ packageId: string;
1828
+ packageVersion: string;
1829
+ latestRunId: string;
1830
+ latestRunStatus: string;
1831
+ processKey: string;
1832
+ folderKey: string;
1833
+ userId: number;
1834
+ instanceDisplayName: string;
1835
+ startedByUser: string;
1836
+ source: string;
1837
+ creatorUserKey: string;
1838
+ startedTime: string;
1839
+ completedTime: string;
1840
+ instanceRuns: CaseInstanceRun[];
1841
+ caseAppConfig?: CaseAppConfig;
1842
+ caseType?: string;
1843
+ caseTitle?: string;
1844
+ }
1845
+ /**
1846
+ * Case instance run information
1847
+ */
1848
+ interface CaseInstanceRun {
1849
+ runId: string;
1850
+ status: string;
1851
+ startedTime: string;
1852
+ completedTime: string;
1853
+ }
1854
+ /**
1855
+ * Query options for getting case instances
1856
+ */
1857
+ interface CaseInstanceGetAllOptions {
1858
+ packageId?: string;
1859
+ packageVersion?: string;
1860
+ processKey?: string;
1861
+ errorCode?: string;
1862
+ }
1863
+ /**
1864
+ * Query options for getting case instances with pagination support
1865
+ */
1866
+ type CaseInstanceGetAllWithPaginationOptions = CaseInstanceGetAllOptions & PaginationOptions;
1867
+ /**
1868
+ * Request for case instance operations (close, pause, resume)
1869
+ */
1870
+ interface CaseInstanceOperationOptions {
1871
+ comment?: string;
1872
+ }
1873
+ /**
1874
+ * Response for case instance operations (close, pause, resume)
1875
+ */
1876
+ interface CaseInstanceOperationResponse {
1877
+ instanceId: string;
1878
+ status: string;
1879
+ }
1880
+ /**
1881
+ * Case App Configuration Overview
1882
+ */
1883
+ interface CaseAppOverview {
1884
+ title: string;
1885
+ details: string;
1886
+ }
1887
+ /**
1888
+ * Case App Configuration from case JSON
1889
+ */
1890
+ interface CaseAppConfig {
1891
+ caseSummary?: string;
1892
+ overview?: CaseAppOverview[];
1893
+ }
1894
+ /**
1895
+ * Case stage task type
1896
+ */
1897
+ declare enum StageTaskType {
1898
+ EXTERNAL_AGENT = "external-agent",
1899
+ RPA = "rpa",
1900
+ AGENTIC_PROCESS = "process",
1901
+ AGENT = "agent",
1902
+ ACTION = "action",
1903
+ API_WORKFLOW = "api-workflow"
1904
+ }
1905
+ /**
1906
+ * Stage task information
1907
+ */
1908
+ interface StageTask {
1909
+ id: string;
1910
+ name: string;
1911
+ completedTime: string;
1912
+ startedTime: string;
1913
+ status: string;
1914
+ type: StageTaskType;
1915
+ }
1916
+ /**
1917
+ * Escalation recipient scope
1918
+ */
1919
+ declare enum EscalationRecipientScope {
1920
+ USER = "user",
1921
+ USER_GROUP = "usergroup"
1922
+ }
1923
+ /**
1924
+ * Escalation rule recipient information
1925
+ */
1926
+ interface EscalationRecipient {
1927
+ /** Type of recipient (user or usergroup) */
1928
+ scope: EscalationRecipientScope;
1929
+ /** Identifier for a user/usergroup */
1930
+ target: string;
1931
+ /** The email id of the user/usergroup */
1932
+ value: string;
1933
+ }
1934
+ /**
1935
+ * Escalation action type
1936
+ */
1937
+ declare enum EscalationActionType {
1938
+ NOTIFICATION = "notification"
1939
+ }
1940
+ /**
1941
+ * Escalation rule action configuration
1942
+ */
1943
+ interface EscalationAction {
1944
+ type: EscalationActionType;
1945
+ recipients: EscalationRecipient[];
1946
+ }
1947
+ /**
1948
+ * Escalation rule trigger type
1949
+ */
1950
+ declare enum EscalationTriggerType {
1951
+ SLA_BREACHED = "sla-breached",
1952
+ AT_RISK = "at-risk"
1953
+ }
1954
+ /**
1955
+ * Escalation rule trigger metadata
1956
+ */
1957
+ interface EscalationTriggerMetadata {
1958
+ type?: EscalationTriggerType;
1959
+ atRiskPercentage?: number;
1960
+ }
1961
+ /**
1962
+ * Escalation rule configuration
1963
+ */
1964
+ interface EscalationRule {
1965
+ triggerInfo: EscalationTriggerMetadata;
1966
+ action?: EscalationAction;
1967
+ }
1968
+ /**
1969
+ * SLA duration unit
1970
+ */
1971
+ declare enum SLADurationUnit {
1972
+ HOURS = "h",
1973
+ DAYS = "d",
1974
+ WEEKS = "w",
1975
+ MONTHS = "m"
1976
+ }
1977
+ /**
1978
+ * SLA configuration for stages
1979
+ */
1980
+ interface StageSLA {
1981
+ length?: number;
1982
+ duration?: SLADurationUnit;
1983
+ escalationRule?: EscalationRule[];
1984
+ }
1985
+ /**
1986
+ * Stage information from case instances
1987
+ */
1988
+ interface CaseGetStageResponse {
1989
+ id: string;
1990
+ name: string;
1991
+ sla?: StageSLA;
1992
+ status: string;
1993
+ tasks: StageTask[][];
1994
+ }
1995
+ /**
1996
+ * Case element execution metadata
1997
+ */
1998
+ interface ElementExecutionMetadata {
1999
+ completedTime: string | null;
2000
+ elementId: string;
2001
+ elementName: string;
2002
+ parentElementId: string | null;
2003
+ startedTime: string;
2004
+ /** Element status (e.g., "Completed", "Faulted", "Running") */
2005
+ status: string;
2006
+ processKey: string;
2007
+ /** External reference link, eg link to the HITL task in Action Center */
2008
+ externalLink: string;
2009
+ /** List of element runs for the element */
2010
+ elementRuns: ElementRunMetadata[];
2011
+ }
2012
+ /**
2013
+ * Response for getting case instance element executions
2014
+ */
2015
+ interface CaseInstanceExecutionHistoryResponse {
2016
+ creationUserKey: string | null;
2017
+ folderKey: string;
2018
+ instanceDisplayName: string;
2019
+ instanceId: string;
2020
+ packageId: string;
2021
+ packageKey: string;
2022
+ packageVersion: string;
2023
+ processKey: string;
2024
+ source: string;
2025
+ /** Element status (e.g., "Completed", "Faulted", "Running", "Pausing", "Canceling") */
2026
+ status: string;
2027
+ startedTime: string;
2028
+ completedTime: string | null;
2029
+ elementExecutions: ElementExecutionMetadata[];
2030
+ }
2031
+ /**
2032
+ * Element run metadata
2033
+ */
2034
+ interface ElementRunMetadata {
2035
+ status: string;
2036
+ startedTime: string;
2037
+ completedTime: string | null;
2038
+ elementRunId: string;
2039
+ parentElementRunId: string | null;
2040
+ }
2041
+
2042
+ interface UserLoginInfo {
2043
+ name: string;
2044
+ surname: string;
2045
+ userName: string;
2046
+ emailAddress: string;
2047
+ displayName: string;
2048
+ id: number;
2049
+ }
2050
+ declare enum TaskType {
2051
+ Form = "FormTask",
2052
+ External = "ExternalTask",
2053
+ App = "AppTask"
2054
+ }
2055
+ declare enum TaskPriority {
2056
+ Low = "Low",
2057
+ Medium = "Medium",
2058
+ High = "High",
2059
+ Critical = "Critical"
2060
+ }
2061
+ declare enum TaskStatus {
2062
+ Unassigned = "Unassigned",
2063
+ Pending = "Pending",
2064
+ Completed = "Completed"
2065
+ }
2066
+ declare enum TaskSlaCriteria {
2067
+ TaskCreated = "TaskCreated",
2068
+ TaskAssigned = "TaskAssigned",
2069
+ TaskCompleted = "TaskCompleted"
2070
+ }
2071
+ declare enum TaskSlaStatus {
2072
+ OverdueLater = "OverdueLater",
2073
+ OverdueSoon = "OverdueSoon",
2074
+ Overdue = "Overdue",
2075
+ CompletedInTime = "CompletedInTime"
2076
+ }
2077
+ declare enum TaskSourceName {
2078
+ Agent = "Agent",
2079
+ Workflow = "Workflow",
2080
+ Maestro = "Maestro",
2081
+ Default = "Default"
2082
+ }
2083
+ interface TaskSource {
2084
+ sourceName: TaskSourceName;
2085
+ sourceId: string;
2086
+ taskSourceMetadata: Record<string, unknown>;
2087
+ }
2088
+ /**
2089
+ * Task activity types
2090
+ */
2091
+ declare enum TaskActivityType {
2092
+ Created = "Created",
2093
+ Assigned = "Assigned",
2094
+ Reassigned = "Reassigned",
2095
+ Unassigned = "Unassigned",
2096
+ Saved = "Saved",
2097
+ Forwarded = "Forwarded",
2098
+ Completed = "Completed",
2099
+ Commented = "Commented",
2100
+ Deleted = "Deleted",
2101
+ BulkSaved = "BulkSaved",
2102
+ BulkCompleted = "BulkCompleted",
2103
+ FirstOpened = "FirstOpened"
2104
+ }
2105
+ /**
2106
+ * Tag information for tasks
2107
+ */
2108
+ interface Tag {
2109
+ name: string;
2110
+ displayName: string;
2111
+ displayValue: string;
2112
+ }
2113
+ /**
2114
+ * Task activity information
2115
+ */
2116
+ interface TaskActivity {
2117
+ task?: RawTaskGetResponse;
2118
+ organizationUnitId: number;
2119
+ taskId: number;
2120
+ taskKey: string;
2121
+ activityType: TaskActivityType;
2122
+ creatorUserId: number;
2123
+ targetUserId: number | null;
2124
+ creationTime: string;
2125
+ }
2126
+ interface TaskSlaDetail {
2127
+ expiryTime?: string;
2128
+ startCriteria?: TaskSlaCriteria;
2129
+ endCriteria?: TaskSlaCriteria;
2130
+ status?: TaskSlaStatus;
2131
+ }
2132
+ interface TaskAssignment {
2133
+ assignee?: UserLoginInfo;
2134
+ task?: RawTaskGetResponse;
2135
+ id?: number;
2136
+ }
2137
+ /**
2138
+ * Base interface containing common fields shared across all task response types
2139
+ */
2140
+ interface TaskBaseResponse {
2141
+ status: TaskStatus;
2142
+ title: string;
2143
+ type: TaskType;
2144
+ priority: TaskPriority;
2145
+ folderId: number;
2146
+ key: string;
2147
+ isDeleted: boolean;
2148
+ creationTime: string;
2149
+ id: number;
2150
+ action: string | null;
2151
+ externalTag: string | null;
2152
+ lastAssignedTime: string | null;
2153
+ completionTime: string | null;
2154
+ parentOperationId: string | null;
2155
+ deleterUserId: number | null;
2156
+ deletionTime: string | null;
2157
+ lastModificationTime: string | null;
2158
+ }
2159
+ interface TaskCreateOptions {
2160
+ title: string;
2161
+ priority?: TaskPriority;
2162
+ }
2163
+ interface RawTaskCreateResponse extends TaskBaseResponse {
2164
+ waitJobState: JobState | null;
2165
+ assignedToUser: UserLoginInfo | null;
2166
+ taskSlaDetails: TaskSlaDetail[] | null;
2167
+ completedByUser: UserLoginInfo | null;
2168
+ taskAssignees: UserLoginInfo[] | null;
2169
+ processingTime: number | null;
2170
+ data: Record<string, unknown> | null;
2171
+ }
2172
+ interface RawTaskGetResponse extends TaskBaseResponse {
2173
+ isCompleted: boolean;
2174
+ encrypted: boolean;
2175
+ bulkFormLayoutId: number | null;
2176
+ formLayoutId: number | null;
2177
+ taskSlaDetail: TaskSlaDetail | null;
2178
+ taskAssigneeName: string | null;
2179
+ lastModifierUserId: number | null;
2180
+ assignedToUser: UserLoginInfo | null;
2181
+ creatorUser?: UserLoginInfo;
2182
+ lastModifierUser?: UserLoginInfo;
2183
+ taskAssignments?: TaskAssignment[];
2184
+ activities?: TaskActivity[];
2185
+ tags?: Tag[];
2186
+ formLayout?: Record<string, unknown>;
2187
+ actionLabel?: string | null;
2188
+ taskSlaDetails?: TaskSlaDetail[] | null;
2189
+ completedByUser?: UserLoginInfo | null;
2190
+ taskAssignmentCriteria?: string;
2191
+ taskAssignees?: UserLoginInfo[] | null;
2192
+ taskSource?: TaskSource | null;
2193
+ processingTime?: number | null;
2194
+ data?: Record<string, unknown> | null;
2195
+ }
2196
+ /**
2197
+ * Options for task assignment operations when called from a task instance
2198
+ * Requires either userId or userNameOrEmail, but not both
2199
+ */
2200
+ type TaskAssignOptions = {
2201
+ userId: number;
2202
+ userNameOrEmail?: never;
2203
+ } | {
2204
+ userId?: never;
2205
+ userNameOrEmail: string;
2206
+ };
2207
+ /**
2208
+ * Options for task assignment operations when called from the service
2209
+ * Extends TaskAssignOptions with the required taskId field
2210
+ */
2211
+ type TaskAssignmentOptions = {
2212
+ taskId: number;
2213
+ } & TaskAssignOptions;
2214
+ interface TasksUnassignOptions {
2215
+ taskIds: number[];
2216
+ }
2217
+ interface TaskAssignmentResponse {
2218
+ taskId?: number;
2219
+ userId?: number;
2220
+ errorCode?: number;
2221
+ errorMessage?: string;
2222
+ userNameOrEmail?: string;
2223
+ }
2224
+ /**
2225
+ * Options for completing a task
2226
+ */
2227
+ type TaskCompleteOptions = {
2228
+ type: TaskType.External;
2229
+ data?: any;
2230
+ action?: string;
2231
+ } | {
2232
+ type: Exclude<TaskType, TaskType.External>;
2233
+ data: any;
2234
+ action: string;
2235
+ };
2236
+ /**
2237
+ * Options for completing a task when called from the service
2238
+ * Extends TaskCompleteOptions with the required taskId field
2239
+ */
2240
+ type TaskCompletionOptions = TaskCompleteOptions & {
2241
+ taskId: number;
2242
+ };
2243
+ /**
2244
+ * Options for getting tasks across folders
2245
+ */
2246
+ type TaskGetAllOptions = RequestOptions & PaginationOptions & {
2247
+ /**
2248
+ * Optional folder ID to filter tasks by folder
2249
+ */
2250
+ folderId?: number;
2251
+ };
2252
+ /**
2253
+ * Query options for getting a task by ID
2254
+ */
2255
+ type TaskGetByIdOptions = BaseOptions;
2256
+ /**
2257
+ * Options for getting users with task permissions
2258
+ */
2259
+ type TaskGetUsersOptions = RequestOptions & PaginationOptions;
2260
+
2261
+ /**
2262
+ * Service for managing UiPath Action Center
2263
+ *
2264
+ * Tasks are task-based automation components that can be integrated into applications and processes. They represent discrete units of work that can be triggered and monitored through the UiPath API. [UiPath Action Center Guide](https://docs.uipath.com/automation-cloud/docs/actions)
2265
+ *
2266
+ */
2267
+ interface TaskServiceModel {
2268
+ /**
2269
+ * Gets all tasks across folders with optional filtering
2270
+ *
2271
+ * @param options - Query options including optional folderId and pagination options
2272
+ * @returns Promise resolving to either an array of tasks NonPaginatedResponse<TaskGetResponse> or a PaginatedResponse<TaskGetResponse> when pagination options are used.
2273
+ * {@link TaskGetResponse}
2274
+ * @example
2275
+ * ```typescript
2276
+ * // Standard array return
2277
+ * const tasks = await sdk.tasks.getAll();
2278
+ *
2279
+ * // Get tasks within a specific folder
2280
+ * const tasks = await sdk.tasks.getAll({
2281
+ * folderId: 123
2282
+ * });
2283
+ *
2284
+ * // First page with pagination
2285
+ * const page1 = await sdk.tasks.getAll({ pageSize: 10 });
2286
+ *
2287
+ * // Navigate using cursor
2288
+ * if (page1.hasNextPage) {
2289
+ * const page2 = await sdk.tasks.getAll({ cursor: page1.nextCursor });
2290
+ * }
2291
+ *
2292
+ * // Jump to specific page
2293
+ * const page5 = await sdk.tasks.getAll({
2294
+ * jumpToPage: 5,
2295
+ * pageSize: 10
2296
+ * });
2297
+ * ```
2298
+ */
2299
+ getAll<T extends TaskGetAllOptions = TaskGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<TaskGetResponse> : NonPaginatedResponse<TaskGetResponse>>;
2300
+ /**
2301
+ * Gets a task by ID
2302
+ * IMPORTANT: For form tasks, folderId must be provided.
2303
+ * @param id - The ID of the task to retrieve
2304
+ * @param options - Optional query parameters
2305
+ * @param folderId - Optional folder ID (REQUIRED for form tasks)
2306
+ * @returns Promise resolving to the task
2307
+ * {@link TaskGetResponse}
2308
+ * @example
2309
+ * ```typescript
2310
+ * // Get a task by ID
2311
+ * const task = await sdk.tasks.getById(<taskId>);
2312
+ *
2313
+ * // Get a form task by ID
2314
+ * const formTask = await sdk.tasks.getById(<taskId>, <folderId>);
2315
+ *
2316
+ * // Access form task properties
2317
+ * console.log(formTask.formLayout);
2318
+ * ```
2319
+ */
2320
+ getById(id: number, options?: TaskGetByIdOptions, folderId?: number): Promise<TaskGetResponse>;
2321
+ /**
2322
+ * Creates a new task
2323
+ *
2324
+ * @param options - The task to be created
2325
+ * @param folderId - Required folder ID
2326
+ * @returns Promise resolving to the created task
2327
+ * {@link TaskCreateResponse}
2328
+ * @example
2329
+ * ```typescript
2330
+ * import { TaskPriority } from '@uipath/uipath-typescript';
2331
+ * const task = await sdk.tasks.create({
2332
+ * title: "My Task",
2333
+ * priority: TaskPriority.Medium
2334
+ * }, <folderId>); // folderId is required
2335
+ * ```
2336
+ */
2337
+ create(options: TaskCreateOptions, folderId: number): Promise<TaskCreateResponse>;
2338
+ /**
2339
+ * Assigns tasks to users
2340
+ *
2341
+ * @param options - Single task assignment or array of task assignments
2342
+ * @returns Promise resolving to array of task assignment results
2343
+ * {@link TaskAssignmentResponse}
2344
+ * @example
2345
+ * ```typescript
2346
+ * // Assign a single task to a user by ID
2347
+ * const result = await sdk.tasks.assign({
2348
+ * taskId: <taskId>,
2349
+ * userId: <userId>
2350
+ * });
2351
+ *
2352
+ * or
2353
+ *
2354
+ * const task = await sdk.tasks.getById(<taskId>);
2355
+ * const result = await task.assign({
2356
+ * userId: <userId>
2357
+ * });
2358
+ *
2359
+ * // Assign a single task to a user by email
2360
+ * const result = await sdk.tasks.assign({
2361
+ * taskId: <taskId>,
2362
+ * userNameOrEmail: "user@example.com"
2363
+ * });
2364
+ *
2365
+ * // Assign multiple tasks
2366
+ * const result = await sdk.tasks.assign([
2367
+ * { taskId: <taskId1>, userId: <userId> },
2368
+ * { taskId: <taskId2>, userNameOrEmail: "user@example.com" }
2369
+ * ]);
2370
+ * ```
2371
+ */
2372
+ assign(options: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
2373
+ /**
2374
+ * Reassigns tasks to new users
2375
+ *
2376
+ * @param options - Single task assignment or array of task assignments
2377
+ * @returns Promise resolving to array of task assignment results
2378
+ * {@link TaskAssignmentResponse}
2379
+ * @example
2380
+ * ```typescript
2381
+ * // Reassign a single task to a user by ID
2382
+ * const result = await sdk.tasks.reassign({
2383
+ * taskId: <taskId>,
2384
+ * userId: <userId>
2385
+ * });
2386
+ *
2387
+ * or
2388
+ *
2389
+ * const task = await sdk.tasks.getById(<taskId>);
2390
+ * const result = await task.reassign({
2391
+ * userId: <userId>
2392
+ * });
2393
+ *
2394
+ * // Reassign a single task to a user by email
2395
+ * const result = await sdk.tasks.reassign({
2396
+ * taskId: <taskId>,
2397
+ * userNameOrEmail: "user@example.com"
2398
+ * });
2399
+ *
2400
+ * // Reassign multiple tasks
2401
+ * const result = await sdk.tasks.reassign([
2402
+ * { taskId: <taskId1>, userId: <userId> },
2403
+ * { taskId: <taskId2>, userNameOrEmail: "user@example.com" }
2404
+ * ]);
2405
+ * ```
2406
+ */
2407
+ reassign(options: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
2408
+ /**
2409
+ * Unassigns tasks (removes current assignees)
2410
+ *
2411
+ * @param taskId - Single task ID or array of task IDs to unassign
2412
+ * @returns Promise resolving to array of task assignment results
2413
+ * {@link TaskAssignmentResponse}
2414
+ * @example
2415
+ * ```typescript
2416
+ * // Unassign a single task
2417
+ * const result = await sdk.tasks.unassign(<taskId>);
2418
+ *
2419
+ * or
2420
+ *
2421
+ * const task = await sdk.tasks.getById(<taskId>);
2422
+ * const result = await task.unassign();
2423
+ *
2424
+ * // Unassign multiple tasks
2425
+ * const result = await sdk.tasks.unassign([<taskId1>, <taskId2>, <taskId3>]);
2426
+ * ```
2427
+ */
2428
+ unassign(taskId: number | number[]): Promise<OperationResponse<{
2429
+ taskId: number;
2430
+ }[] | TaskAssignmentResponse[]>>;
2431
+ /**
2432
+ * Completes a task with the specified type and data
2433
+ *
2434
+ * @param options - The completion options including task type, taskId, data, and action
2435
+ * @param folderId - Required folder ID
2436
+ * @returns Promise resolving to completion result
2437
+ * {@link TaskCompleteOptions}
2438
+ * @example
2439
+ * ```typescript
2440
+ * // Complete an app task
2441
+ * await sdk.tasks.complete({
2442
+ * type: TaskType.App,
2443
+ * taskId: <taskId>,
2444
+ * data: {},
2445
+ * action: "submit"
2446
+ * }, <folderId>); // folderId is required
2447
+ *
2448
+ * // Complete an external task
2449
+ * await sdk.tasks.complete({
2450
+ * type: TaskType.External,
2451
+ * taskId: <taskId>
2452
+ * }, <folderId>); // folderId is required
2453
+ * ```
2454
+ */
2455
+ complete(options: TaskCompletionOptions, folderId: number): Promise<OperationResponse<TaskCompletionOptions>>;
2456
+ /**
2457
+ * Gets users in the given folder who have Tasks.View and Tasks.Edit permissions
2458
+ * Returns a NonPaginatedResponse with data and totalCount when no pagination parameters are provided,
2459
+ * or a PaginatedResponse when any pagination parameter is provided
2460
+ *
2461
+ * @param folderId - The folder ID to get users from
2462
+ * @param options - Optional query and pagination parameters
2463
+ * @returns Promise resolving to either an array of users NonPaginatedResponse<UserLoginInfo> or a PaginatedResponse<UserLoginInfo> when pagination options are used.
2464
+ * {@link UserLoginInfo}
2465
+ * @example
2466
+ * ```typescript
2467
+ * // Get users from a folder
2468
+ * const users = await sdk.tasks.getUsers(<folderId>);
2469
+ *
2470
+ * // Access user properties
2471
+ * console.log(users.items[0].name);
2472
+ * console.log(users.items[0].emailAddress);
2473
+ * ```
2474
+ */
2475
+ getUsers<T extends TaskGetUsersOptions = TaskGetUsersOptions>(folderId: number, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<UserLoginInfo> : NonPaginatedResponse<UserLoginInfo>>;
2476
+ }
2477
+ interface TaskMethods {
2478
+ /**
2479
+ * Assigns this task to a user or users
2480
+ *
2481
+ * @param options - Assignment options (requires at least one of: userId, userNameOrEmail)
2482
+ * @returns Promise resolving to task assignment results
2483
+ */
2484
+ assign(options: TaskAssignOptions): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
2485
+ /**
2486
+ * Reassigns this task to a new user
2487
+ *
2488
+ * @param options - Assignment options (requires at least one of: userId, userNameOrEmail)
2489
+ * @returns Promise resolving to task assignment results
2490
+ */
2491
+ reassign(options: TaskAssignOptions): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
2492
+ /**
2493
+ * Unassigns this task (removes current assignee)
2494
+ *
2495
+ * @returns Promise resolving to task assignment results
2496
+ */
2497
+ unassign(): Promise<OperationResponse<{
2498
+ taskId: number;
2499
+ }[] | TaskAssignmentResponse[]>>;
2500
+ /**
2501
+ * Completes this task with optional data and action
2502
+ *
2503
+ * @param options - Completion options
2504
+ * @returns Promise resolving to completion result
2505
+ */
2506
+ complete(options: TaskCompleteOptions): Promise<OperationResponse<TaskCompletionOptions>>;
2507
+ }
2508
+ type TaskGetResponse = RawTaskGetResponse & TaskMethods;
2509
+ type TaskCreateResponse = RawTaskCreateResponse & TaskMethods;
2510
+ /**
2511
+ * Creates an actionable task by combining API task data with operational methods.
2512
+ *
2513
+ * @param taskData - The task data from API
2514
+ * @param service - The task service instance
2515
+ * @returns A task object with added methods
2516
+ */
2517
+ declare function createTaskWithMethods(taskData: RawTaskGetResponse | RawTaskCreateResponse, service: TaskServiceModel): TaskGetResponse | TaskCreateResponse;
2518
+
2519
+ /**
2520
+ * Service model for managing Maestro Case Instances
2521
+ *
2522
+ * Maestro case instances are the running instances of Maestro cases.
2523
+ */
2524
+ interface CaseInstancesServiceModel {
2525
+ /**
2526
+ * Get all case instances with optional filtering and pagination
2527
+ *
2528
+ * @param options Query parameters for filtering instances and pagination
2529
+ * @returns Promise resolving to either an array of case instances NonPaginatedResponse<CaseInstanceGetResponse> or a PaginatedResponse<CaseInstanceGetResponse> when pagination options are used.
2530
+ * {@link CaseInstanceGetResponse}
2531
+ * @example
2532
+ * ```typescript
2533
+ * // Get all case instances (non-paginated)
2534
+ * const instances = await sdk.maestro.cases.instances.getAll();
2535
+ *
2536
+ * // Cancel/Close faulted instances using methods directly on instances
2537
+ * for (const instance of instances.items) {
2538
+ * if (instance.latestRunStatus === 'Faulted') {
2539
+ * await instance.close({ comment: 'Closing faulted case instance' });
2540
+ * }
2541
+ * }
2542
+ *
2543
+ * // With filtering
2544
+ * const instances = await sdk.maestro.cases.instances.getAll({
2545
+ * processKey: 'MyCaseProcess'
2546
+ * });
2547
+ *
2548
+ * // First page with pagination
2549
+ * const page1 = await sdk.maestro.cases.instances.getAll({ pageSize: 10 });
2550
+ *
2551
+ * // Navigate using cursor
2552
+ * if (page1.hasNextPage) {
2553
+ * const page2 = await sdk.maestro.cases.instances.getAll({ cursor: page1.nextCursor });
2554
+ * }
2555
+ * ```
2556
+ */
2557
+ getAll<T extends CaseInstanceGetAllWithPaginationOptions = CaseInstanceGetAllWithPaginationOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<CaseInstanceGetResponse> : NonPaginatedResponse<CaseInstanceGetResponse>>;
2558
+ /**
2559
+ * Get a specific case instance by ID
2560
+ * @param instanceId - The case instance ID
2561
+ * @param folderKey - Required folder key
2562
+ * @returns Promise resolving to case instance with methods
2563
+ * {@link CaseInstanceGetResponse}
2564
+ * @example
2565
+ * ```typescript
2566
+ * // Get a specific case instance
2567
+ * const instance = await sdk.maestro.cases.instances.getById(
2568
+ * <instanceId>,
2569
+ * <folderKey>
2570
+ * );
2571
+ *
2572
+ * // Access instance properties
2573
+ * console.log(`Status: ${instance.latestRunStatus}`);
2574
+ *
2575
+ * ```
2576
+ */
2577
+ getById(instanceId: string, folderKey: string): Promise<CaseInstanceGetResponse>;
2578
+ /**
2579
+ * Close/Cancel a case instance
2580
+ * @param instanceId - The ID of the instance to cancel
2581
+ * @param folderKey - Required folder key
2582
+ * @param options - Optional close options with comment
2583
+ * @returns Promise resolving to operation result with instance data
2584
+ * @example
2585
+ * ```typescript
2586
+ * // Close a case instance
2587
+ * const result = await sdk.maestro.cases.instances.close(
2588
+ * <instanceId>,
2589
+ * <folderKey>
2590
+ * );
2591
+ *
2592
+ * or
2593
+ *
2594
+ * const instance = await sdk.maestro.cases.instances.getById(
2595
+ * <instanceId>,
2596
+ * <folderKey>
2597
+ * );
2598
+ * const result = await instance.close();
2599
+ *
2600
+ * console.log(`Closed: ${result.success}`);
2601
+ *
2602
+ * // Close with a comment
2603
+ * const result = await instance.close({
2604
+ * comment: 'Closing due to invalid input data'
2605
+ * });
2606
+ *
2607
+ * if (result.success) {
2608
+ * console.log(`Instance ${result.data.instanceId} status: ${result.data.status}`);
2609
+ * }
2610
+ * ```
2611
+ */
2612
+ close(instanceId: string, folderKey: string, options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2613
+ /**
2614
+ * Pause a case instance
2615
+ * @param instanceId - The ID of the instance to pause
2616
+ * @param folderKey - Required folder key
2617
+ * @param options - Optional pause options with comment
2618
+ * @returns Promise resolving to operation result with instance data
2619
+ */
2620
+ pause(instanceId: string, folderKey: string, options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2621
+ /**
2622
+ * Resume a case instance
2623
+ * @param instanceId - The ID of the instance to resume
2624
+ * @param folderKey - Required folder key
2625
+ * @param options - Optional resume options with comment
2626
+ * @returns Promise resolving to operation result with instance data
2627
+ */
2628
+ resume(instanceId: string, folderKey: string, options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2629
+ /**
2630
+ * Get execution history for a case instance
2631
+ * @param instanceId - The ID of the case instance
2632
+ * @param folderKey - Required folder key
2633
+ * @returns Promise resolving to instance execution history
2634
+ * {@link CaseInstanceExecutionHistoryResponse}
2635
+ * @example
2636
+ * ```typescript
2637
+ * // Get execution history for a case instance
2638
+ * const history = await sdk.maestro.cases.instances.getExecutionHistory(
2639
+ * <instanceId>,
2640
+ * <folderKey>
2641
+ * );
2642
+ *
2643
+ * // Access element executions
2644
+ * if (history.elementExecutions) {
2645
+ * for (const execution of history.elementExecutions) {
2646
+ * console.log(`Element: ${execution.elementName} - Status: ${execution.status}`);
2647
+ * }
2648
+ * }
2649
+ * ```
2650
+ */
2651
+ getExecutionHistory(instanceId: string, folderKey: string): Promise<CaseInstanceExecutionHistoryResponse>;
2652
+ /**
2653
+ * Get stages and its associated tasks information for a case instance
2654
+ * @param caseInstanceId - The ID of the case instance
2655
+ * @param folderKey - Required folder key
2656
+ * @returns Promise resolving to an array of case stages with their tasks and status
2657
+ * @example
2658
+ * ```typescript
2659
+ * // Get stages for a case instance
2660
+ * const stages = await sdk.maestro.cases.instances.getStages(
2661
+ * <caseInstanceId>,
2662
+ * <folderKey>
2663
+ * );
2664
+ *
2665
+ * // Iterate through stages
2666
+ * for (const stage of stages) {
2667
+ * console.log(`Stage: ${stage.name} - Status: ${stage.status}`);
2668
+ *
2669
+ * // Check tasks in the stage
2670
+ * for (const taskGroup of stage.tasks) {
2671
+ * for (const task of taskGroup) {
2672
+ * console.log(` Task: ${task.name} - Status: ${task.status}`);
2673
+ * }
2674
+ * }
2675
+ * }
2676
+ * ```
2677
+ */
2678
+ getStages(caseInstanceId: string, folderKey: string): Promise<CaseGetStageResponse[]>;
2679
+ /**
2680
+ * Get human in the loop tasks associated with a case instance
2681
+ *
2682
+ * The method returns either:
2683
+ * - An array of tasks (when no pagination parameters are provided)
2684
+ * - A paginated result with navigation cursors (when any pagination parameter is provided)
2685
+ *
2686
+ * @param caseInstanceId - The ID of the case instance
2687
+ * @param options - Optional filtering and pagination options
2688
+ * @returns Promise resolving to human in the loop tasks associated with the case instance
2689
+ * @example
2690
+ * ```typescript
2691
+ * // Get all tasks for a case instance (non-paginated)
2692
+ * const tasks = await sdk.maestro.cases.instances.getActionTasks(
2693
+ * <caseInstanceId>,
2694
+ * );
2695
+ *
2696
+ * // First page with pagination
2697
+ * const page1 = await sdk.maestro.cases.instances.getActionTasks(
2698
+ * <caseInstanceId>,
2699
+ * { pageSize: 10 }
2700
+ * );
2701
+ * // Iterate through tasks
2702
+ * for (const task of page1.items) {
2703
+ * console.log(`Task: ${task.title}`);
2704
+ * console.log(`Task: ${task.status}`);
2705
+ * }
2706
+ *
2707
+ * // Jump to specific page
2708
+ * const page5 = await sdk.maestro.cases.instances.getActionTasks(
2709
+ * <caseInstanceId>,
2710
+ * {
2711
+ * jumpToPage: 5,
2712
+ * pageSize: 10
2713
+ * }
2714
+ * );
2715
+ * ```
2716
+ */
2717
+ getActionTasks<T extends TaskGetAllOptions = TaskGetAllOptions>(caseInstanceId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<TaskGetResponse> : NonPaginatedResponse<TaskGetResponse>>;
2718
+ }
2719
+ interface CaseInstanceMethods {
2720
+ /**
2721
+ * Closes/cancels this case instance
2722
+ *
2723
+ * @param options - Optional close options with comment
2724
+ * @returns Promise resolving to operation result
2725
+ */
2726
+ close(options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2727
+ /**
2728
+ * Pauses this case instance
2729
+ *
2730
+ * @param options - Optional pause options with comment
2731
+ * @returns Promise resolving to operation result
2732
+ */
2733
+ pause(options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2734
+ /**
2735
+ * Resumes this case instance
2736
+ *
2737
+ * @param options - Optional resume options with comment
2738
+ * @returns Promise resolving to operation result
2739
+ */
2740
+ resume(options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2741
+ /**
2742
+ * Gets execution history for this case instance
2743
+ *
2744
+ * @returns Promise resolving to instance execution history
2745
+ */
2746
+ getExecutionHistory(): Promise<CaseInstanceExecutionHistoryResponse>;
2747
+ /**
2748
+ * Gets stages and their associated tasks for this case instance
2749
+ *
2750
+ * @returns Promise resolving to an array of case stages with their tasks and status
2751
+ */
2752
+ getStages(): Promise<CaseGetStageResponse[]>;
2753
+ /**
2754
+ * Gets human in the loop tasks associated with this case instance
2755
+ *
2756
+ * @param options - Optional filtering and pagination options
2757
+ * @returns Promise resolving to human in the loop tasks associated with the case instance
2758
+ */
2759
+ getActionTasks<T extends TaskGetAllOptions = TaskGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<TaskGetResponse> : NonPaginatedResponse<TaskGetResponse>>;
2760
+ }
2761
+ type CaseInstanceGetResponse = RawCaseInstanceGetResponse & CaseInstanceMethods;
2762
+ /**
2763
+ * Creates an actionable case instance by combining API case instance data with operational methods.
2764
+ *
2765
+ * @param instanceData - The case instance data from API
2766
+ * @param service - The case instance service instance
2767
+ * @returns A case instance object with added methods
2768
+ */
2769
+ declare function createCaseInstanceWithMethods(instanceData: RawCaseInstanceGetResponse, service: CaseInstancesServiceModel): CaseInstanceGetResponse;
2770
+
2771
+ /**
2772
+ * Service for interacting with Maestro Processes
2773
+ */
2774
+ declare class MaestroProcessesService extends BaseService implements MaestroProcessesServiceModel {
2775
+ private processInstancesService;
2776
+ /**
2777
+ * @hideconstructor
2778
+ */
2779
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
2780
+ /**
2781
+ * Get all processes with their instance statistics
2782
+ * @returns Promise resolving to array of MaestroProcess objects
2783
+ *
2784
+ * @example
2785
+ * ```typescript
2786
+ * // Get all processes
2787
+ * const processes = await sdk.maestro.processes.getAll();
2788
+ *
2789
+ * // Access process information
2790
+ * for (const process of processes) {
2791
+ * console.log(`Process: ${process.processKey}`);
2792
+ * console.log(`Running instances: ${process.runningCount}`);
2793
+ * console.log(`Faulted instances: ${process.faultedCount}`);
2794
+ * }
2795
+ *
2796
+ * ```
2797
+ */
2798
+ getAll(): Promise<MaestroProcessGetAllResponse[]>;
2799
+ /**
2800
+ * Get incidents for a specific process
2801
+ */
2802
+ getIncidents(processKey: string, folderKey: string): Promise<ProcessIncidentGetResponse[]>;
2803
+ }
2804
+
2805
+ declare class ProcessInstancesService extends BaseService implements ProcessInstancesServiceModel {
2806
+ /**
2807
+ * @hideconstructor
2808
+ */
2809
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
2810
+ /**
2811
+ * Get all process instances with optional filtering and pagination
2812
+ *
2813
+ * The method returns either:
2814
+ * - A NonPaginatedResponse with items array (when no pagination parameters are provided)
2815
+ * - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
2816
+ *
2817
+ * @param options Query parameters for filtering instances and pagination
2818
+ * @returns Promise resolving to process instances or paginated result
2819
+ *
2820
+ * @example
2821
+ * ```typescript
2822
+ * // Get all instances (non-paginated)
2823
+ * const instances = await sdk.maestro.processes.instances.getAll();
2824
+ *
2825
+ * // Cancel faulted instances using methods directly on instances
2826
+ * for (const instance of instances.items) {
2827
+ * if (instance.latestRunStatus === 'Faulted') {
2828
+ * await instance.cancel({ comment: 'Cancelling faulted instance' });
2829
+ * }
2830
+ * }
2831
+ *
2832
+ * // With filtering
2833
+ * const instances = await sdk.maestro.processes.instances.getAll({
2834
+ * processKey: 'MyProcess'
2835
+ * });
2836
+ *
2837
+ * // First page with pagination
2838
+ * const page1 = await sdk.maestro.processes.instances.getAll({ pageSize: 10 });
2839
+ *
2840
+ * // Navigate using cursor
2841
+ * if (page1.hasNextPage) {
2842
+ * const page2 = await sdk.maestro.processes.instances.getAll({ cursor: page1.nextCursor });
2843
+ * }
2844
+ * ```
2845
+ */
2846
+ getAll<T extends ProcessInstanceGetAllWithPaginationOptions = ProcessInstanceGetAllWithPaginationOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessInstanceGetResponse> : NonPaginatedResponse<ProcessInstanceGetResponse>>;
2847
+ /**
2848
+ * Get a process instance by ID with operation methods (cancel, pause, resume)
2849
+ * @param id The ID of the instance to retrieve
2850
+ * @param folderKey The folder key for authorization
2851
+ * @returns Promise<ProcessInstanceGetResponse>
2852
+ */
2853
+ getById(id: string, folderKey: string): Promise<ProcessInstanceGetResponse>;
2854
+ /**
2855
+ * Get execution history (spans) for a process instance
2856
+ * @param instanceId The ID of the instance to get history for
2857
+ * @returns Promise<ProcessInstanceExecutionHistoryResponse[]>
2858
+ */
2859
+ getExecutionHistory(instanceId: string): Promise<ProcessInstanceExecutionHistoryResponse[]>;
2860
+ /**
2861
+ * Get BPMN XML file for a process instance
2862
+ * @param instanceId The ID of the instance to get BPMN for
2863
+ * @param folderKey The folder key for authorization
2864
+ * @returns Promise<BpmnXmlString> The BPMN XML contents as a string
2865
+ */
2866
+ getBpmn(instanceId: string, folderKey: string): Promise<BpmnXmlString>;
2867
+ /**
2868
+ * Cancel a process instance
2869
+ * @param instanceId The ID of the instance to cancel
2870
+ * @param folderKey The folder key for authorization
2871
+ * @param options Optional cancellation options with comment
2872
+ * @returns Promise resolving to operation result with updated instance data
2873
+ */
2874
+ cancel(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
2875
+ /**
2876
+ * Pause a process instance
2877
+ * @param instanceId The ID of the instance to pause
2878
+ * @param folderKey The folder key for authorization
2879
+ * @param options Optional pause options with comment
2880
+ * @returns Promise resolving to operation result with updated instance data
2881
+ */
2882
+ pause(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
2883
+ /**
2884
+ * Resume a process instance
2885
+ * @param instanceId The ID of the instance to resume
2886
+ * @param folderKey The folder key for authorization
2887
+ * @param options Optional resume options with comment
2888
+ * @returns Promise resolving to operation result with updated instance data
2889
+ */
2890
+ resume(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
2891
+ /**
2892
+ * Parses BPMN XML to extract variable metadata from uipath:inputOutput elements
2893
+ * @private
2894
+ * @param bpmnXml The BPMN XML string
2895
+ * @returns Map of variable ID to metadata
2896
+ */
2897
+ private parseBpmnVariables;
2898
+ /**
2899
+ * Extracts element names from BPMN XML and maps them to their element IDs
2900
+ * @private
2901
+ * @param bpmnXml The BPMN XML string
2902
+ * @returns Map of elementId to element name
2903
+ */
2904
+ private getVariableSource;
2905
+ /**
2906
+ * Enriches global variables with metadata from BPMN
2907
+ * @private
2908
+ * @param globals The raw globals object from API response
2909
+ * @param variableMetadata The parsed BPMN variable metadata
2910
+ * @returns Array of global variables
2911
+ */
2912
+ private transformGlobalVariables;
2913
+ /**
2914
+ * Get global variables for a process instance
2915
+ * @param instanceId The ID of the instance to get variables for
2916
+ * @param folderKey The folder key for authorization
2917
+ * @param options Optional options including parentElementId to filter by parent element
2918
+ * @returns Promise<ProcessInstanceGetVariablesResponse>
2919
+ */
2920
+ getVariables(instanceId: string, folderKey: string, options?: ProcessInstanceGetVariablesOptions): Promise<ProcessInstanceGetVariablesResponse>;
2921
+ /**
2922
+ * Get incidents for a process instance
2923
+ * @param instanceId The ID of the instance to get incidents for
2924
+ * @param folderKey The folder key for authorization
2925
+ * @returns Promise<ProcessIncidentGetResponse[]>
2926
+ */
2927
+ getIncidents(instanceId: string, folderKey: string): Promise<ProcessIncidentGetResponse[]>;
2928
+ }
2929
+
2930
+ /**
2931
+ * Service class for Maestro Process Incidents
2932
+ */
2933
+ declare class ProcessIncidentsService extends BaseService implements ProcessIncidentsServiceModel {
2934
+ /**
2935
+ * Get all process incidents across all folders
2936
+ *
2937
+ * @returns Promise resolving to array of process incident
2938
+ * {@link ProcessIncidentGetAllResponse}
2939
+ * @example
2940
+ * ```typescript
2941
+ * // Get all process incidents across all folders
2942
+ * const incidents = await sdk.maestro.processes.incidents.getAll();
2943
+ *
2944
+ * // Access process incident information
2945
+ * for (const incident of incidents) {
2946
+ * console.log(`Process: ${incident.processKey}`);
2947
+ * console.log(`Error: ${incident.errorMessage}`);
2948
+ * console.log(`Count: ${incident.count}`);
2949
+ * console.log(`First occurrence: ${incident.firstOccuranceTime}`);
2950
+ * }
2951
+ * ```
2952
+ */
2953
+ getAll(): Promise<ProcessIncidentGetAllResponse[]>;
2954
+ }
2955
+
2956
+ /**
2957
+ * Service for interacting with UiPath Maestro Cases
2958
+ */
2959
+ declare class CasesService extends BaseService implements CasesServiceModel {
2960
+ /**
2961
+ * @hideconstructor
2962
+ */
2963
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
2964
+ /**
2965
+ * Get all case management processes with their instance statistics
2966
+ * @returns Promise resolving to array of Case objects
2967
+ *
2968
+ * @example
2969
+ * ```typescript
2970
+ * // Get all case management processes
2971
+ * const cases = await sdk.maestro.cases.getAll();
2972
+ *
2973
+ * // Access case information
2974
+ * for (const caseProcess of cases) {
2975
+ * console.log(`Case Process: ${caseProcess.processKey}`);
2976
+ * console.log(`Running instances: ${caseProcess.runningCount}`);
2977
+ * console.log(`Completed instances: ${caseProcess.completedCount}`);
2978
+ * }
2979
+ *
2980
+ * ```
2981
+ */
2982
+ getAll(): Promise<CaseGetAllResponse[]>;
2983
+ /**
2984
+ * Extract a readable case name from the packageId
2985
+ * @param packageId - The full package identifier
2986
+ * @returns A human-readable case name
2987
+ * @private
2988
+ */
2989
+ private extractCaseName;
2990
+ }
2991
+
2992
+ declare class CaseInstancesService extends BaseService implements CaseInstancesServiceModel {
2993
+ private taskService;
2994
+ /**
2995
+ * @hideconstructor
2996
+ */
2997
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
2998
+ /**
2999
+ * Get all case instances with optional filtering and pagination
3000
+ *
3001
+ * The method returns either:
3002
+ * - A NonPaginatedResponse with items array (when no pagination parameters are provided)
3003
+ * - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
3004
+ *
3005
+ * @param options -Query parameters for filtering instances and pagination
3006
+ * @returns Promise resolving to case instances or paginated result
3007
+ *
3008
+ * @example
3009
+ * ```typescript
3010
+ * // Get all case instances (non-paginated)
3011
+ * const instances = await sdk.maestro.cases.instances.getAll();
3012
+ *
3013
+ * // Close faulted instances using methods directly on instances
3014
+ * for (const instance of instances.items) {
3015
+ * if (instance.latestRunStatus === 'Faulted') {
3016
+ * await instance.close({ comment: 'Closing faulted case instance' });
3017
+ * }
3018
+ * }
3019
+ *
3020
+ * // With filtering
3021
+ * const instances = await sdk.maestro.cases.instances.getAll({
3022
+ * processKey: 'MyCaseProcess'
3023
+ * });
3024
+ *
3025
+ * // First page with pagination
3026
+ * const page1 = await sdk.maestro.cases.instances.getAll({ pageSize: 10 });
3027
+ *
3028
+ * // Navigate using cursor
3029
+ * if (page1.hasNextPage) {
3030
+ * const page2 = await sdk.maestro.cases.instances.getAll({ cursor: page1.nextCursor });
3031
+ * }
3032
+ * ```
3033
+ */
3034
+ getAll<T extends CaseInstanceGetAllWithPaginationOptions = CaseInstanceGetAllWithPaginationOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<CaseInstanceGetResponse> : NonPaginatedResponse<CaseInstanceGetResponse>>;
3035
+ /**
3036
+ * Get a case instance by ID with operation methods (close, pause, resume)
3037
+ * @param instanceId - The ID of the instance to retrieve
3038
+ * @param folderKey - Required folder key
3039
+ * @returns Promise<CaseInstanceGetResponse>
3040
+ */
3041
+ getById(instanceId: string, folderKey: string): Promise<CaseInstanceGetResponse>;
3042
+ /**
3043
+ * Enhance a single case instance with case JSON data
3044
+ * @param instance - The case instance to enhance
3045
+ * @returns Promise resolving to enhanced instance
3046
+ * @private
3047
+ */
3048
+ private enhanceInstanceWithCaseJson;
3049
+ /**
3050
+ * Enhance multiple case instances with case JSON data
3051
+ * @param instances - Array of case instances to enhance
3052
+ * @returns Promise resolving to array of enhanced instances
3053
+ * @private
3054
+ */
3055
+ private enhanceInstancesWithCaseJson;
3056
+ /**
3057
+ * Get case JSON for a specific instance
3058
+ * @param instanceId - The case instance ID
3059
+ * @param folderKey - Required folder key
3060
+ * @returns Promise resolving to case JSON data
3061
+ * @private
3062
+ */
3063
+ private getCaseJson;
3064
+ /**
3065
+ * Close a case instance
3066
+ * @param instanceId - The ID of the instance to cancel
3067
+ * @param folderKey - Required folder key
3068
+ * @param options - Optional cancellation options with comment
3069
+ * @returns Promise resolving to operation result with updated instance data
3070
+ */
3071
+ close(instanceId: string, folderKey: string, options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
3072
+ /**
3073
+ * Pause a case instance
3074
+ * @param instanceId - The ID of the instance to pause
3075
+ * @param folderKey - Required folder key
3076
+ * @param options - Optional pause options with comment
3077
+ * @returns Promise resolving to operation result with updated instance data
3078
+ */
3079
+ pause(instanceId: string, folderKey: string, options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
3080
+ /**
3081
+ * Resume a case instance
3082
+ * @param instanceId - The ID of the instance to resume
3083
+ * @param folderKey - Required folder key
3084
+ * @param options - Optional resume options with comment
3085
+ * @returns Promise resolving to operation result with updated instance data
3086
+ */
3087
+ resume(instanceId: string, folderKey: string, options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
3088
+ /**
3089
+ * Get execution history for a case instance
3090
+ * @param instanceId - The ID of the case instance
3091
+ * @param folderKey - Required folder key
3092
+ * @returns Promise resolving to instance execution history
3093
+ * @example
3094
+ * ```typescript
3095
+ * // Get execution history for a case instance
3096
+ * const history = await sdk.maestro.cases.instances.getExecutionHistory(
3097
+ * 'instance-id',
3098
+ * 'folder-key'
3099
+ * );
3100
+ * ```
3101
+ */
3102
+ getExecutionHistory(instanceId: string, folderKey: string): Promise<CaseInstanceExecutionHistoryResponse>;
3103
+ /**
3104
+ * Get case stages with their associated tasks and execution status
3105
+ * @param caseInstanceId - The ID of the case instance
3106
+ * @param folderKey - Required folder key
3107
+ * @returns Promise resolving to an array of case stages, each containing their tasks with execution details
3108
+ */
3109
+ getStages(caseInstanceId: string, folderKey: string): Promise<CaseGetStageResponse[]>;
3110
+ /**
3111
+ * Create a map of element ID to execution data
3112
+ * @param executionHistory - The execution history response
3113
+ * @returns Map of elementId to execution metadata
3114
+ * @private
3115
+ */
3116
+ private createExecutionMap;
3117
+ /**
3118
+ * Create a map of binding IDs to their values
3119
+ * @param caseJsonResponse - The case JSON response
3120
+ * @returns Map of binding ID to binding object
3121
+ * @private
3122
+ */
3123
+ private createBindingsMap;
3124
+ /**
3125
+ * Resolve binding values from binding expressions
3126
+ * @param value - The value that may contain binding references
3127
+ * @param bindingsMap - Map of binding IDs to binding objects
3128
+ * @returns Resolved value
3129
+ * @private
3130
+ */
3131
+ private resolveBinding;
3132
+ /**
3133
+ * Process tasks for a stage node
3134
+ * @param node - The stage node containing tasks
3135
+ * @param executionMap - Map of element IDs to execution data
3136
+ * @param bindingsMap - Map of binding IDs to binding objects
3137
+ * @returns Processed tasks array
3138
+ * @private
3139
+ */
3140
+ private processTasks;
3141
+ /**
3142
+ * Create a stage from a case node
3143
+ * @param node - The case node to process
3144
+ * @param executionMap - Map of element IDs to execution data
3145
+ * @param bindingsMap - Map of binding IDs to binding objects
3146
+ * @returns CaseGetStageResponse object
3147
+ * @private
3148
+ */
3149
+ private createStageFromNode;
3150
+ /**
3151
+ * Get human in the loop tasks associated with a case instance
3152
+ * @param caseInstanceId - The ID of the case instance
3153
+ * @param options - Optional filtering and pagination options
3154
+ * @returns Promise resolving to human in the loop tasks associated with the case instance
3155
+ */
3156
+ getActionTasks<T extends TaskGetAllOptions = TaskGetAllOptions>(caseInstanceId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<TaskGetResponse> : NonPaginatedResponse<TaskGetResponse>>;
3157
+ }
3158
+
3159
+ /**
3160
+ * Base service for services that need folder-specific functionality
3161
+ */
3162
+ declare class FolderScopedService extends BaseService {
3163
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
3164
+ /**
3165
+ * Gets resources in a folder with optional query parameters
3166
+ *
3167
+ * @param endpoint - API endpoint to call
3168
+ * @param folderId - required folder ID
3169
+ * @param options - Query options
3170
+ * @param transformFn - Optional function to transform the response data
3171
+ * @returns Promise resolving to an array of resources
3172
+ */
3173
+ protected _getByFolder<T, R = T>(endpoint: string, folderId: number, options?: Record<string, any>, transformFn?: (item: T) => R): Promise<R[]>;
3174
+ }
3175
+
3176
+ /**
3177
+ * Enum for Asset Value Scope
3178
+ */
3179
+ declare enum AssetValueScope {
3180
+ Global = "Global",
3181
+ PerRobot = "PerRobot"
3182
+ }
3183
+ /**
1744
3184
  * Enum for Asset Value Type
1745
3185
  */
1746
3186
  declare enum AssetValueType {
@@ -1983,15 +3423,6 @@ interface BucketGetUriOptions extends BaseOptions {
1983
3423
  * Request options for getting a read URI for a file in a bucket
1984
3424
  */
1985
3425
  type BucketGetReadUriOptions = BucketGetUriOptions;
1986
- /**
1987
- * Request options for getting a write URI for a file in a bucket
1988
- */
1989
- interface BucketGetWriteUriOptions extends BucketGetUriOptions {
1990
- /**
1991
- * ContentType for S3 access policy
1992
- */
1993
- contentType?: string;
1994
- }
1995
3426
  /**
1996
3427
  * Request options for getting files in a bucket
1997
3428
  */
@@ -2059,11 +3490,6 @@ interface BucketUploadFileOptions {
2059
3490
  * File content to upload
2060
3491
  */
2061
3492
  content: Blob | Buffer | File;
2062
- /**
2063
- * Optional MIME type of the file
2064
- * If not provided, it will be auto-detected
2065
- */
2066
- contentType?: string;
2067
3493
  }
2068
3494
  /**
2069
3495
  * Response from file upload operations
@@ -2207,14 +3633,13 @@ interface BucketServiceModel {
2207
3633
  * content: file
2208
3634
  * });
2209
3635
  *
2210
- * // In Node env with explicit content type
3636
+ * // In Node env with Buffer
2211
3637
  * const buffer = Buffer.from('file content');
2212
3638
  * const result = await sdk.buckets.uploadFile({
2213
3639
  * bucketId: <bucketId>,
2214
3640
  * folderId: <folderId>,
2215
3641
  * path: '/folder/example.txt',
2216
3642
  * content: buffer,
2217
- * contentType: 'text/plain'
2218
3643
  * });
2219
3644
  * ```
2220
3645
  */
@@ -2331,36 +3756,38 @@ declare class BucketService extends FolderScopedService implements BucketService
2331
3756
  * content: file
2332
3757
  * });
2333
3758
  *
2334
- * // In Node env with explicit content type
3759
+ * // In Node env with Buffer
2335
3760
  * const buffer = Buffer.from('file content');
2336
3761
  * const result = await sdk.buckets.uploadFile({
2337
3762
  * bucketId: 123,
2338
3763
  * folderId: 456,
2339
3764
  * path: '/folder/example.txt',
2340
- * content: buffer,
2341
- * contentType: 'text/plain'
3765
+ * content: buffer
2342
3766
  * });
2343
3767
  * ```
2344
3768
  */
2345
3769
  uploadFile(options: BucketUploadFileOptions): Promise<BucketUploadResponse>;
2346
3770
  /**
2347
- * Determines the content type of the file based on the content and path
2348
- * Uses a hybrid approach:
2349
- * 1. Checks Blob/File type if available (browser)
2350
- * 2. Uses content-based detection with file-type (primarily Node.js)
2351
- * 3. Falls back to extension-based detection with mime-types
2352
- * 4. Finally defaults to application/octet-stream
3771
+ * Gets a direct download URL for a file in the bucket
2353
3772
  *
2354
- * @param content - The file content
2355
- * @param path - The file path
2356
- * @returns The determined content type or default
3773
+ * @param options - Contains bucketId, folderId, file path and optional expiry time
3774
+ * @returns Promise resolving to blob file access information
3775
+ *
3776
+ * @example
3777
+ * ```typescript
3778
+ * // Get download URL for a file
3779
+ * const fileAccess = await sdk.buckets.getReadUri({
3780
+ * bucketId: 123,
3781
+ * folderId: 456,
3782
+ * path: '/folder/file.pdf'
3783
+ * });
3784
+ * ```
2357
3785
  */
2358
- private _determineContentType;
3786
+ getReadUri(options: BucketGetReadUriOptions): Promise<BucketGetUriResponse>;
2359
3787
  /**
2360
3788
  * Uploads content to the provided URI
2361
3789
  * @param uriResponse - Response from getWriteUri containing URL and headers
2362
3790
  * @param content - The content to upload
2363
- * @param contentType - The content type of the file
2364
3791
  * @returns The response from the upload request with status info
2365
3792
  */
2366
3793
  private _uploadToUri;
@@ -2374,27 +3801,10 @@ declare class BucketService extends FolderScopedService implements BucketService
2374
3801
  * @returns Promise resolving to blob file access information
2375
3802
  */
2376
3803
  private _getUri;
2377
- /**
2378
- * Gets a direct download URL for a file in the bucket
2379
- *
2380
- * @param options - Contains bucketId, folderId, file path and optional expiry time
2381
- * @returns Promise resolving to blob file access information
2382
- *
2383
- * @example
2384
- * ```typescript
2385
- * // Get download URL for a file
2386
- * const fileAccess = await sdk.buckets.getReadUri({
2387
- * bucketId: 123,
2388
- * folderId: 456,
2389
- * path: '/folder/file.pdf'
2390
- * });
2391
- * ```
2392
- */
2393
- getReadUri(options: BucketGetReadUriOptions): Promise<BucketGetUriResponse>;
2394
3804
  /**
2395
3805
  * Gets a direct upload URL for a file in the bucket
2396
3806
  *
2397
- * @param options - Contains bucketId, folderId, file path, optional expiry time and content type
3807
+ * @param options - Contains bucketId, folderId, file path, optional expiry time
2398
3808
  * @returns Promise resolving to blob file access information
2399
3809
  */
2400
3810
  private _getWriteUri;
@@ -2681,600 +4091,347 @@ interface ProcessGetResponse extends ProcessProperties, FolderProperties {
2681
4091
  */
2682
4092
  type ProcessGetAllOptions = RequestOptions & PaginationOptions & {
2683
4093
  /**
2684
- * Optional folder ID to filter processes by folder
2685
- */
2686
- folderId?: number;
2687
- };
2688
- /**
2689
- * Options for getting a single process by ID
2690
- */
2691
- type ProcessGetByIdOptions = BaseOptions;
2692
-
2693
- /**
2694
- * Service for managing and executing UiPath Automation Processes.
2695
- *
2696
- * Processes (also known as automations or workflows) are the core units of automation in UiPath, representing sequences of activities that perform specific business tasks. [UiPath Processes Guide](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-processes)
2697
- */
2698
- interface ProcessServiceModel {
2699
- /**
2700
- * Gets all processes across folders with optional filtering
2701
- * Returns a NonPaginatedResponse with data and totalCount when no pagination parameters are provided,
2702
- * or a PaginatedResponse when any pagination parameter is provided
2703
- *
2704
- * @param options - Query options including optional folderId and pagination options
2705
- * @returns Promise resolving to either an array of processes NonPaginatedResponse<ProcessGetResponse> or a PaginatedResponse<ProcessGetResponse> when pagination options are used.
2706
- * {@link ProcessGetResponse}
2707
- * @example
2708
- * ```typescript
2709
- * // Standard array return
2710
- * const processes = await sdk.processes.getAll();
2711
- *
2712
- * // Get processes within a specific folder
2713
- * const processes = await sdk.processes.getAll({
2714
- * folderId: <folderId>
2715
- * });
2716
- *
2717
- * // Get processes with filtering
2718
- * const processes = await sdk.processes.getAll({
2719
- * filter: "name eq 'MyProcess'"
2720
- * });
2721
- *
2722
- * // First page with pagination
2723
- * const page1 = await sdk.processes.getAll({ pageSize: 10 });
2724
- *
2725
- * // Navigate using cursor
2726
- * if (page1.hasNextPage) {
2727
- * const page2 = await sdk.processes.getAll({ cursor: page1.nextCursor });
2728
- * }
2729
- *
2730
- * // Jump to specific page
2731
- * const page5 = await sdk.processes.getAll({
2732
- * jumpToPage: 5,
2733
- * pageSize: 10
2734
- * });
2735
- * ```
2736
- */
2737
- getAll<T extends ProcessGetAllOptions = ProcessGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessGetResponse> : NonPaginatedResponse<ProcessGetResponse>>;
2738
- /**
2739
- * Gets a single process by ID
2740
- *
2741
- * @param id - Process ID
2742
- * @param folderId - Required folder ID
2743
- * @param options - Optional query parameters
2744
- * @returns Promise resolving to a single process
2745
- * {@link ProcessGetResponse}
2746
- * @example
2747
- * ```typescript
2748
- * // Get process by ID
2749
- * const process = await sdk.processes.getById(<processId>, <folderId>);
2750
- * ```
2751
- */
2752
- getById(id: number, folderId: number, options?: ProcessGetByIdOptions): Promise<ProcessGetResponse>;
2753
- /**
2754
- * Starts a process with the specified configuration
2755
- *
2756
- * @param request - Process start configuration
2757
- * @param folderId - Required folder ID
2758
- * @param options - Optional request options
2759
- * @returns Promise resolving to array of started process instances
2760
- * {@link ProcessStartResponse}
2761
- * @example
2762
- * ```typescript
2763
- * // Start a process by process key
2764
- * const process = await sdk.processes.start({
2765
- * processKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
2766
- * }, <folderId>); // folderId is required
2767
- *
2768
- * // Start a process by name with specific robots
2769
- * const process = await sdk.processes.start({
2770
- * processName: "MyProcess"
2771
- * }, <folderId>); // folderId is required
2772
- * ```
2773
- */
2774
- start(request: ProcessStartRequest, folderId: number, options?: RequestOptions): Promise<ProcessStartResponse[]>;
2775
- }
2776
-
2777
- /**
2778
- * Service for interacting with UiPath Orchestrator Processes API
2779
- */
2780
- declare class ProcessService extends BaseService implements ProcessServiceModel {
2781
- /**
2782
- * @hideconstructor
2783
- */
2784
- constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
2785
- /**
2786
- * Gets all processes across folders with optional filtering and folder scoping
2787
- *
2788
- * The method returns either:
2789
- * - An array of processes (when no pagination parameters are provided)
2790
- * - A paginated result with navigation cursors (when any pagination parameter is provided)
2791
- *
2792
- * @param options - Query options including optional folderId
2793
- * @returns Promise resolving to an array of processes or paginated result
2794
- *
2795
- * @example
2796
- * ```typescript
2797
- * // Standard array return
2798
- * const processes = await sdk.processes.getAll();
2799
- *
2800
- * // Get processes within a specific folder
2801
- * const processes = await sdk.processes.getAll({
2802
- * folderId: 123
2803
- * });
2804
- *
2805
- * // Get processes with filtering
2806
- * const processes = await sdk.processes.getAll({
2807
- * filter: "name eq 'MyProcess'"
2808
- * });
2809
- *
2810
- * // First page with pagination
2811
- * const page1 = await sdk.processes.getAll({ pageSize: 10 });
2812
- *
2813
- * // Navigate using cursor
2814
- * if (page1.hasNextPage) {
2815
- * const page2 = await sdk.processes.getAll({ cursor: page1.nextCursor });
2816
- * }
2817
- *
2818
- * // Jump to specific page
2819
- * const page5 = await sdk.processes.getAll({
2820
- * jumpToPage: 5,
2821
- * pageSize: 10
2822
- * });
2823
- * ```
2824
- */
2825
- getAll<T extends ProcessGetAllOptions = ProcessGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessGetResponse> : NonPaginatedResponse<ProcessGetResponse>>;
2826
- /**
2827
- * Starts a process execution (job)
2828
- *
2829
- * @param request - Process start request body
2830
- * @param folderId - Required folder ID
2831
- * @param options - Optional query parameters
2832
- * @returns Promise resolving to the created jobs
2833
- *
2834
- * @example
2835
- * ```typescript
2836
- * // Start a process by process key
2837
- * const jobs = await sdk.processes.start({
2838
- * processKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
2839
- * }, 123); // folderId is required
2840
- *
2841
- * // Start a process by name with specific robots
2842
- * const jobs = await sdk.processes.start({
2843
- * processName: "MyProcess"
2844
- * }, 123); // folderId is required
2845
- * ```
2846
- */
2847
- start(request: ProcessStartRequest, folderId: number, options?: RequestOptions): Promise<ProcessStartResponse[]>;
2848
- /**
2849
- * Gets a single process by ID
2850
- *
2851
- * @param id - Process ID
2852
- * @param folderId - Required folder ID
2853
- * @param options - Optional query parameters
2854
- * @returns Promise resolving to a single process
2855
- *
2856
- * @example
2857
- * ```typescript
2858
- * // Get process by ID
2859
- * const process = await sdk.processes.getById(123, 456);
2860
- * ```
2861
- */
2862
- getById(id: number, folderId: number, options?: ProcessGetByIdOptions): Promise<ProcessGetResponse>;
2863
- }
2864
-
2865
- /**
2866
- * Interface for queue response
2867
- */
2868
- interface QueueGetResponse {
2869
- key: string;
2870
- name: string;
2871
- id: number;
2872
- description: string;
2873
- maxNumberOfRetries: number;
2874
- acceptAutomaticallyRetry: boolean;
2875
- retryAbandonedItems: boolean;
2876
- enforceUniqueReference: boolean;
2877
- encrypted: boolean;
2878
- specificDataJsonSchema: string | null;
2879
- outputDataJsonSchema: string | null;
2880
- analyticsDataJsonSchema: string | null;
2881
- createdTime: string;
2882
- processScheduleId: number | null;
2883
- slaInMinutes: number;
2884
- riskSlaInMinutes: number;
2885
- releaseId: number | null;
2886
- isProcessInCurrentFolder: boolean | null;
2887
- foldersCount: number;
2888
- folderId: number;
2889
- folderName: string;
2890
- }
2891
- /**
2892
- * Options for getting queues across folders
2893
- */
2894
- type QueueGetAllOptions = RequestOptions & PaginationOptions & {
2895
- /**
2896
- * Optional folder ID to filter queues by folder
4094
+ * Optional folder ID to filter processes by folder
2897
4095
  */
2898
4096
  folderId?: number;
2899
4097
  };
2900
- type QueueGetByIdOptions = BaseOptions;
4098
+ /**
4099
+ * Options for getting a single process by ID
4100
+ */
4101
+ type ProcessGetByIdOptions = BaseOptions;
2901
4102
 
2902
4103
  /**
2903
- * Service for managing UiPath Queues
4104
+ * Service for managing and executing UiPath Automation Processes.
2904
4105
  *
2905
- * Queues are a fundamental component of UiPath automation that enable distributed and scalable processing of work items. [UiPath Queues Guide](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-queues-and-transactions)
4106
+ * Processes (also known as automations or workflows) are the core units of automation in UiPath, representing sequences of activities that perform specific business tasks. [UiPath Processes Guide](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-processes)
2906
4107
  */
2907
- interface QueueServiceModel {
4108
+ interface ProcessServiceModel {
2908
4109
  /**
2909
- * Gets all queues across folders with optional filtering and folder scoping
4110
+ * Gets all processes across folders with optional filtering
4111
+ * Returns a NonPaginatedResponse with data and totalCount when no pagination parameters are provided,
4112
+ * or a PaginatedResponse when any pagination parameter is provided
2910
4113
  *
2911
- * @signature getAll(options?) Promise&lt;QueueGetResponse[]&gt;
2912
- * @param options Query options including optional folderId and pagination options
2913
- * @returns Promise resolving to either an array of queues NonPaginatedResponse<QueueGetResponse> or a PaginatedResponse<QueueGetResponse> when pagination options are used.
2914
- * {@link QueueGetResponse}
4114
+ * @param options - Query options including optional folderId and pagination options
4115
+ * @returns Promise resolving to either an array of processes NonPaginatedResponse<ProcessGetResponse> or a PaginatedResponse<ProcessGetResponse> when pagination options are used.
4116
+ * {@link ProcessGetResponse}
2915
4117
  * @example
2916
4118
  * ```typescript
2917
4119
  * // Standard array return
2918
- * const queues = await sdk.queues.getAll();
4120
+ * const processes = await sdk.processes.getAll();
2919
4121
  *
2920
- * // Get queues within a specific folder
2921
- * const queues = await sdk.queues.getAll({
4122
+ * // Get processes within a specific folder
4123
+ * const processes = await sdk.processes.getAll({
2922
4124
  * folderId: <folderId>
2923
4125
  * });
2924
4126
  *
2925
- * // Get queues with filtering
2926
- * const queues = await sdk.queues.getAll({
2927
- * filter: "name eq 'MyQueue'"
4127
+ * // Get processes with filtering
4128
+ * const processes = await sdk.processes.getAll({
4129
+ * filter: "name eq 'MyProcess'"
2928
4130
  * });
2929
4131
  *
2930
4132
  * // First page with pagination
2931
- * const page1 = await sdk.queues.getAll({ pageSize: 10 });
4133
+ * const page1 = await sdk.processes.getAll({ pageSize: 10 });
2932
4134
  *
2933
4135
  * // Navigate using cursor
2934
4136
  * if (page1.hasNextPage) {
2935
- * const page2 = await sdk.queues.getAll({ cursor: page1.nextCursor });
4137
+ * const page2 = await sdk.processes.getAll({ cursor: page1.nextCursor });
2936
4138
  * }
2937
4139
  *
2938
4140
  * // Jump to specific page
2939
- * const page5 = await sdk.queues.getAll({
4141
+ * const page5 = await sdk.processes.getAll({
2940
4142
  * jumpToPage: 5,
2941
4143
  * pageSize: 10
2942
4144
  * });
2943
4145
  * ```
2944
4146
  */
2945
- getAll<T extends QueueGetAllOptions = QueueGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<QueueGetResponse> : NonPaginatedResponse<QueueGetResponse>>;
4147
+ getAll<T extends ProcessGetAllOptions = ProcessGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessGetResponse> : NonPaginatedResponse<ProcessGetResponse>>;
2946
4148
  /**
2947
- * Gets a single queue by ID
4149
+ * Gets a single process by ID
2948
4150
  *
2949
- * @param id - Queue ID
4151
+ * @param id - Process ID
2950
4152
  * @param folderId - Required folder ID
2951
- * @returns Promise resolving to a queue definition
4153
+ * @param options - Optional query parameters
4154
+ * @returns Promise resolving to a single process
4155
+ * {@link ProcessGetResponse}
2952
4156
  * @example
2953
4157
  * ```typescript
2954
- * // Get queue by ID
2955
- * const queue = await sdk.queues.getById(<queueId>, <folderId>);
4158
+ * // Get process by ID
4159
+ * const process = await sdk.processes.getById(<processId>, <folderId>);
2956
4160
  * ```
2957
4161
  */
2958
- getById(id: number, folderId: number, options?: QueueGetByIdOptions): Promise<QueueGetResponse>;
4162
+ getById(id: number, folderId: number, options?: ProcessGetByIdOptions): Promise<ProcessGetResponse>;
4163
+ /**
4164
+ * Starts a process with the specified configuration
4165
+ *
4166
+ * @param request - Process start configuration
4167
+ * @param folderId - Required folder ID
4168
+ * @param options - Optional request options
4169
+ * @returns Promise resolving to array of started process instances
4170
+ * {@link ProcessStartResponse}
4171
+ * @example
4172
+ * ```typescript
4173
+ * // Start a process by process key
4174
+ * const process = await sdk.processes.start({
4175
+ * processKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
4176
+ * }, <folderId>); // folderId is required
4177
+ *
4178
+ * // Start a process by name with specific robots
4179
+ * const process = await sdk.processes.start({
4180
+ * processName: "MyProcess"
4181
+ * }, <folderId>); // folderId is required
4182
+ * ```
4183
+ */
4184
+ start(request: ProcessStartRequest, folderId: number, options?: RequestOptions): Promise<ProcessStartResponse[]>;
2959
4185
  }
2960
4186
 
2961
4187
  /**
2962
- * Service for interacting with UiPath Orchestrator Queues API
4188
+ * Service for interacting with UiPath Orchestrator Processes API
2963
4189
  */
2964
- declare class QueueService extends FolderScopedService implements QueueServiceModel {
4190
+ declare class ProcessService extends BaseService implements ProcessServiceModel {
2965
4191
  /**
2966
4192
  * @hideconstructor
2967
4193
  */
2968
4194
  constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
2969
4195
  /**
2970
- * Gets all queues across folders with optional filtering and folder scoping
4196
+ * Gets all processes across folders with optional filtering and folder scoping
2971
4197
  *
2972
4198
  * The method returns either:
2973
- * - An array of queues (when no pagination parameters are provided)
4199
+ * - An array of processes (when no pagination parameters are provided)
2974
4200
  * - A paginated result with navigation cursors (when any pagination parameter is provided)
2975
4201
  *
2976
4202
  * @param options - Query options including optional folderId
2977
- * @returns Promise resolving to an array of queues or paginated result
4203
+ * @returns Promise resolving to an array of processes or paginated result
2978
4204
  *
2979
4205
  * @example
2980
4206
  * ```typescript
2981
4207
  * // Standard array return
2982
- * const queues = await sdk.queues.getAll();
4208
+ * const processes = await sdk.processes.getAll();
2983
4209
  *
2984
- * // Get queues within a specific folder
2985
- * const queues = await sdk.queues.getAll({
4210
+ * // Get processes within a specific folder
4211
+ * const processes = await sdk.processes.getAll({
2986
4212
  * folderId: 123
2987
4213
  * });
2988
4214
  *
2989
- * // Get queues with filtering
2990
- * const queues = await sdk.queues.getAll({
2991
- * filter: "name eq 'MyQueue'"
4215
+ * // Get processes with filtering
4216
+ * const processes = await sdk.processes.getAll({
4217
+ * filter: "name eq 'MyProcess'"
2992
4218
  * });
2993
4219
  *
2994
4220
  * // First page with pagination
2995
- * const page1 = await sdk.queues.getAll({ pageSize: 10 });
4221
+ * const page1 = await sdk.processes.getAll({ pageSize: 10 });
2996
4222
  *
2997
4223
  * // Navigate using cursor
2998
4224
  * if (page1.hasNextPage) {
2999
- * const page2 = await sdk.queues.getAll({ cursor: page1.nextCursor });
4225
+ * const page2 = await sdk.processes.getAll({ cursor: page1.nextCursor });
3000
4226
  * }
3001
4227
  *
3002
4228
  * // Jump to specific page
3003
- * const page5 = await sdk.queues.getAll({
4229
+ * const page5 = await sdk.processes.getAll({
3004
4230
  * jumpToPage: 5,
3005
4231
  * pageSize: 10
3006
4232
  * });
3007
4233
  * ```
3008
4234
  */
3009
- getAll<T extends QueueGetAllOptions = QueueGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<QueueGetResponse> : NonPaginatedResponse<QueueGetResponse>>;
4235
+ getAll<T extends ProcessGetAllOptions = ProcessGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessGetResponse> : NonPaginatedResponse<ProcessGetResponse>>;
3010
4236
  /**
3011
- * Gets a single queue by ID
4237
+ * Starts a process execution (job)
3012
4238
  *
3013
- * @param id - Queue ID
4239
+ * @param request - Process start request body
3014
4240
  * @param folderId - Required folder ID
3015
- * @returns Promise resolving to a queue definition
4241
+ * @param options - Optional query parameters
4242
+ * @returns Promise resolving to the created jobs
3016
4243
  *
3017
4244
  * @example
3018
4245
  * ```typescript
3019
- * // Get queue by ID
3020
- * const queue = await sdk.queues.getById(123, 456);
3021
- * ```
3022
- */
3023
- getById(id: number, folderId: number, options?: QueueGetByIdOptions): Promise<QueueGetResponse>;
3024
- }
3025
-
3026
- interface UserLoginInfo {
3027
- name: string;
3028
- surname: string;
3029
- userName: string;
3030
- emailAddress: string;
3031
- displayName: string;
3032
- id: number;
3033
- }
3034
- declare enum TaskType {
3035
- Form = "FormTask",
3036
- External = "ExternalTask",
3037
- App = "AppTask"
3038
- }
3039
- declare enum TaskPriority {
3040
- Low = "Low",
3041
- Medium = "Medium",
3042
- High = "High",
3043
- Critical = "Critical"
3044
- }
3045
- declare enum TaskStatus {
3046
- Unassigned = "Unassigned",
3047
- Pending = "Pending",
3048
- Completed = "Completed"
3049
- }
3050
- declare enum TaskSlaCriteria {
3051
- TaskCreated = "TaskCreated",
3052
- TaskAssigned = "TaskAssigned",
3053
- TaskCompleted = "TaskCompleted"
3054
- }
3055
- declare enum TaskSlaStatus {
3056
- OverdueLater = "OverdueLater",
3057
- OverdueSoon = "OverdueSoon",
3058
- Overdue = "Overdue",
3059
- CompletedInTime = "CompletedInTime"
3060
- }
3061
- declare enum TaskSourceName {
3062
- Agent = "Agent",
3063
- Workflow = "Workflow",
3064
- Maestro = "Maestro",
3065
- Default = "Default"
3066
- }
3067
- interface TaskSource {
3068
- sourceName: TaskSourceName;
3069
- sourceId: string;
3070
- taskSourceMetadata: Record<string, unknown>;
3071
- }
3072
- interface TaskSlaDetail {
3073
- expiryTime?: string;
3074
- startCriteria?: TaskSlaCriteria;
3075
- endCriteria?: TaskSlaCriteria;
3076
- status?: TaskSlaStatus;
3077
- }
3078
- interface TaskAssignment {
3079
- assignee?: UserLoginInfo;
3080
- task?: RawTaskGetResponse;
3081
- id?: number;
3082
- }
3083
- /**
3084
- * Base interface containing common fields shared across all task response types
3085
- */
3086
- interface TaskBaseResponse {
3087
- status: TaskStatus;
3088
- title: string;
3089
- type: TaskType;
3090
- priority: TaskPriority;
3091
- organizationUnitId: number;
3092
- key: string;
3093
- isDeleted: boolean;
3094
- creationTime: string;
3095
- creatorUserId: number;
3096
- id: number;
3097
- action: string | null;
3098
- assignedToUserId: number | null;
3099
- externalTag: string | null;
3100
- lastAssignedTime: string | null;
3101
- completionTime: string | null;
3102
- parentOperationId: string | null;
3103
- deleterUserId: number | null;
3104
- deletionTime: string | null;
3105
- lastModificationTime: string | null;
3106
- }
3107
- interface TaskCreateOptions {
3108
- title: string;
3109
- priority?: TaskPriority;
3110
- }
3111
- interface RawTaskCreateResponse extends TaskBaseResponse {
3112
- waitJobState: JobState | null;
3113
- assignedToUser: UserLoginInfo | null;
3114
- taskSlaDetails: TaskSlaDetail[] | null;
3115
- completedByUser: UserLoginInfo | null;
3116
- taskAssignees: UserLoginInfo[] | null;
3117
- processingTime: number | null;
3118
- data: Record<string, unknown> | null;
3119
- }
3120
- interface RawTaskGetResponse extends TaskBaseResponse {
3121
- isCompleted: boolean;
3122
- encrypted: boolean;
3123
- bulkFormLayoutId: number | null;
3124
- formLayoutId: number | null;
3125
- taskSlaDetail: TaskSlaDetail | null;
3126
- taskAssigneeName: string | null;
3127
- lastModifierUserId: number | null;
3128
- assignedToUser?: UserLoginInfo;
3129
- creatorUser?: UserLoginInfo;
3130
- lastModifierUser?: UserLoginInfo;
3131
- taskAssignments?: TaskAssignment[];
3132
- formLayout?: Record<string, unknown>;
3133
- actionLabel?: string | null;
3134
- taskSlaDetails?: TaskSlaDetail[] | null;
3135
- completedByUser?: UserLoginInfo | null;
3136
- taskAssignmentCriteria?: string;
3137
- taskAssignees?: UserLoginInfo[] | null;
3138
- taskSource?: TaskSource | null;
3139
- processingTime?: number | null;
3140
- data?: Record<string, unknown> | null;
3141
- }
3142
- interface TaskAssignmentOptions {
3143
- taskId: number;
3144
- userId: number;
3145
- userNameOrEmail?: string;
3146
- }
3147
- interface TasksUnassignOptions {
3148
- taskIds: number[];
3149
- }
3150
- interface TaskAssignmentResponse {
3151
- taskId?: number;
3152
- userId?: number;
3153
- errorCode?: number;
3154
- errorMessage?: string;
3155
- userNameOrEmail?: string;
3156
- }
3157
- interface TaskCompletionOptions {
3158
- taskId: number;
3159
- data?: any;
3160
- action?: string;
4246
+ * // Start a process by process key
4247
+ * const jobs = await sdk.processes.start({
4248
+ * processKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
4249
+ * }, 123); // folderId is required
4250
+ *
4251
+ * // Start a process by name with specific robots
4252
+ * const jobs = await sdk.processes.start({
4253
+ * processName: "MyProcess"
4254
+ * }, 123); // folderId is required
4255
+ * ```
4256
+ */
4257
+ start(request: ProcessStartRequest, folderId: number, options?: RequestOptions): Promise<ProcessStartResponse[]>;
4258
+ /**
4259
+ * Gets a single process by ID
4260
+ *
4261
+ * @param id - Process ID
4262
+ * @param folderId - Required folder ID
4263
+ * @param options - Optional query parameters
4264
+ * @returns Promise resolving to a single process
4265
+ *
4266
+ * @example
4267
+ * ```typescript
4268
+ * // Get process by ID
4269
+ * const process = await sdk.processes.getById(123, 456);
4270
+ * ```
4271
+ */
4272
+ getById(id: number, folderId: number, options?: ProcessGetByIdOptions): Promise<ProcessGetResponse>;
3161
4273
  }
4274
+
3162
4275
  /**
3163
- * Options for task assignment operations in the Task class
3164
- * At least one identification parameter is required
3165
- */
3166
- type TaskAssignOptions = {
3167
- userId: number;
3168
- userNameOrEmail?: string;
3169
- } | {
3170
- userId?: number;
3171
- userNameOrEmail: string;
3172
- };
3173
- /**
3174
- * Options for completing a task
4276
+ * Interface for queue response
3175
4277
  */
3176
- type TaskCompleteOptions = {
3177
- type: TaskType.External;
3178
- data?: any;
3179
- action?: string;
3180
- } | {
3181
- type: Exclude<TaskType, TaskType.External>;
3182
- data: any;
3183
- action: string;
3184
- };
4278
+ interface QueueGetResponse {
4279
+ key: string;
4280
+ name: string;
4281
+ id: number;
4282
+ description: string;
4283
+ maxNumberOfRetries: number;
4284
+ acceptAutomaticallyRetry: boolean;
4285
+ retryAbandonedItems: boolean;
4286
+ enforceUniqueReference: boolean;
4287
+ encrypted: boolean;
4288
+ specificDataJsonSchema: string | null;
4289
+ outputDataJsonSchema: string | null;
4290
+ analyticsDataJsonSchema: string | null;
4291
+ createdTime: string;
4292
+ processScheduleId: number | null;
4293
+ slaInMinutes: number;
4294
+ riskSlaInMinutes: number;
4295
+ releaseId: number | null;
4296
+ isProcessInCurrentFolder: boolean | null;
4297
+ foldersCount: number;
4298
+ folderId: number;
4299
+ folderName: string;
4300
+ }
3185
4301
  /**
3186
- * Options for getting tasks across folders
4302
+ * Options for getting queues across folders
3187
4303
  */
3188
- type TaskGetAllOptions = RequestOptions & PaginationOptions & {
4304
+ type QueueGetAllOptions = RequestOptions & PaginationOptions & {
3189
4305
  /**
3190
- * Optional folder ID to filter tasks by folder
4306
+ * Optional folder ID to filter queues by folder
3191
4307
  */
3192
4308
  folderId?: number;
3193
4309
  };
3194
- /**
3195
- * Query options for getting a task by ID
3196
- */
3197
- type TaskGetByIdOptions = BaseOptions;
3198
- /**
3199
- * Options for getting users with task permissions
3200
- */
3201
- type TaskGetUsersOptions = RequestOptions & PaginationOptions;
4310
+ type QueueGetByIdOptions = BaseOptions;
3202
4311
 
3203
4312
  /**
3204
- * Service for managing UiPath Action Center
3205
- *
3206
- * Tasks are task-based automation components that can be integrated into applications and processes. They represent discrete units of work that can be triggered and monitored through the UiPath API. [UiPath Action Center Guide](https://docs.uipath.com/automation-cloud/docs/actions)
4313
+ * Service for managing UiPath Queues
3207
4314
  *
3208
- */
3209
- interface TaskServiceModel {
4315
+ * Queues are a fundamental component of UiPath automation that enable distributed and scalable processing of work items. [UiPath Queues Guide](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-queues-and-transactions)
4316
+ */
4317
+ interface QueueServiceModel {
3210
4318
  /**
3211
- * Gets all tasks across folders with optional filtering
4319
+ * Gets all queues across folders with optional filtering and folder scoping
3212
4320
  *
3213
- * @param options - Query options including optional folderId and pagination options
3214
- * @returns Promise resolving to either an array of tasks NonPaginatedResponse<TaskGetResponse> or a PaginatedResponse<TaskGetResponse> when pagination options are used.
3215
- * {@link TaskGetResponse}
4321
+ * @signature getAll(options?) Promise&lt;QueueGetResponse[]&gt;
4322
+ * @param options Query options including optional folderId and pagination options
4323
+ * @returns Promise resolving to either an array of queues NonPaginatedResponse<QueueGetResponse> or a PaginatedResponse<QueueGetResponse> when pagination options are used.
4324
+ * {@link QueueGetResponse}
4325
+ * @example
4326
+ * ```typescript
4327
+ * // Standard array return
4328
+ * const queues = await sdk.queues.getAll();
4329
+ *
4330
+ * // Get queues within a specific folder
4331
+ * const queues = await sdk.queues.getAll({
4332
+ * folderId: <folderId>
4333
+ * });
4334
+ *
4335
+ * // Get queues with filtering
4336
+ * const queues = await sdk.queues.getAll({
4337
+ * filter: "name eq 'MyQueue'"
4338
+ * });
4339
+ *
4340
+ * // First page with pagination
4341
+ * const page1 = await sdk.queues.getAll({ pageSize: 10 });
4342
+ *
4343
+ * // Navigate using cursor
4344
+ * if (page1.hasNextPage) {
4345
+ * const page2 = await sdk.queues.getAll({ cursor: page1.nextCursor });
4346
+ * }
4347
+ *
4348
+ * // Jump to specific page
4349
+ * const page5 = await sdk.queues.getAll({
4350
+ * jumpToPage: 5,
4351
+ * pageSize: 10
4352
+ * });
4353
+ * ```
3216
4354
  */
3217
- getAll<T extends TaskGetAllOptions = TaskGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<TaskGetResponse> : NonPaginatedResponse<TaskGetResponse>>;
3218
- getById(id: number, options?: TaskGetByIdOptions, folderId?: number): Promise<TaskGetResponse>;
3219
- create(options: TaskCreateOptions, folderId: number): Promise<TaskCreateResponse>;
3220
- assign(options: TaskAssignmentOptions | TaskAssignmentOptions[], folderId?: number): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
3221
- reassign(options: TaskAssignmentOptions | TaskAssignmentOptions[], folderId?: number): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
3222
- unassign(taskId: number | number[], folderId?: number): Promise<OperationResponse<{
3223
- taskId: number;
3224
- }[] | TaskAssignmentResponse[]>>;
3225
- complete(taskType: TaskType, options: TaskCompletionOptions, folderId: number): Promise<OperationResponse<TaskCompletionOptions>>;
4355
+ getAll<T extends QueueGetAllOptions = QueueGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<QueueGetResponse> : NonPaginatedResponse<QueueGetResponse>>;
3226
4356
  /**
3227
- * Gets users in the given folder who have Tasks.View and Tasks.Edit permissions
3228
- * Returns a NonPaginatedResponse with data and totalCount when no pagination parameters are provided,
3229
- * or a PaginatedResponse when any pagination parameter is provided
4357
+ * Gets a single queue by ID
3230
4358
  *
3231
- * @param folderId - The folder ID to get users from
3232
- * @param options - Optional query and pagination parameters
3233
- * @returns Promise resolving to NonPaginatedResponse or a paginated result
4359
+ * @param id - Queue ID
4360
+ * @param folderId - Required folder ID
4361
+ * @returns Promise resolving to a queue definition
4362
+ * @example
4363
+ * ```typescript
4364
+ * // Get queue by ID
4365
+ * const queue = await sdk.queues.getById(<queueId>, <folderId>);
4366
+ * ```
3234
4367
  */
3235
- getUsers<T extends TaskGetUsersOptions = TaskGetUsersOptions>(folderId: number, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<UserLoginInfo> : NonPaginatedResponse<UserLoginInfo>>;
4368
+ getById(id: number, folderId: number, options?: QueueGetByIdOptions): Promise<QueueGetResponse>;
3236
4369
  }
3237
- interface TaskMethods {
4370
+
4371
+ /**
4372
+ * Service for interacting with UiPath Orchestrator Queues API
4373
+ */
4374
+ declare class QueueService extends FolderScopedService implements QueueServiceModel {
3238
4375
  /**
3239
- * Assigns this task to a user or users
3240
- *
3241
- * @param options - Assignment options (requires at least one of: userId, userNameOrEmail)
3242
- * @returns Promise resolving to task assignment results
4376
+ * @hideconstructor
3243
4377
  */
3244
- assign(options: TaskAssignOptions): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
4378
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
3245
4379
  /**
3246
- * Reassigns this task to a new user
4380
+ * Gets all queues across folders with optional filtering and folder scoping
3247
4381
  *
3248
- * @param options - Assignment options (requires at least one of: userId, userNameOrEmail)
3249
- * @returns Promise resolving to task assignment results
3250
- */
3251
- reassign(options: TaskAssignOptions): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
3252
- /**
3253
- * Unassigns this task (removes current assignee)
4382
+ * The method returns either:
4383
+ * - An array of queues (when no pagination parameters are provided)
4384
+ * - A paginated result with navigation cursors (when any pagination parameter is provided)
3254
4385
  *
3255
- * @returns Promise resolving to task assignment results
4386
+ * @param options - Query options including optional folderId
4387
+ * @returns Promise resolving to an array of queues or paginated result
4388
+ *
4389
+ * @example
4390
+ * ```typescript
4391
+ * // Standard array return
4392
+ * const queues = await sdk.queues.getAll();
4393
+ *
4394
+ * // Get queues within a specific folder
4395
+ * const queues = await sdk.queues.getAll({
4396
+ * folderId: 123
4397
+ * });
4398
+ *
4399
+ * // Get queues with filtering
4400
+ * const queues = await sdk.queues.getAll({
4401
+ * filter: "name eq 'MyQueue'"
4402
+ * });
4403
+ *
4404
+ * // First page with pagination
4405
+ * const page1 = await sdk.queues.getAll({ pageSize: 10 });
4406
+ *
4407
+ * // Navigate using cursor
4408
+ * if (page1.hasNextPage) {
4409
+ * const page2 = await sdk.queues.getAll({ cursor: page1.nextCursor });
4410
+ * }
4411
+ *
4412
+ * // Jump to specific page
4413
+ * const page5 = await sdk.queues.getAll({
4414
+ * jumpToPage: 5,
4415
+ * pageSize: 10
4416
+ * });
4417
+ * ```
3256
4418
  */
3257
- unassign(): Promise<OperationResponse<{
3258
- taskId: number;
3259
- }[] | TaskAssignmentResponse[]>>;
4419
+ getAll<T extends QueueGetAllOptions = QueueGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<QueueGetResponse> : NonPaginatedResponse<QueueGetResponse>>;
3260
4420
  /**
3261
- * Completes this task with optional data and action
4421
+ * Gets a single queue by ID
3262
4422
  *
3263
- * @param options - Completion options
3264
- * @returns Promise resolving to completion result
4423
+ * @param id - Queue ID
4424
+ * @param folderId - Required folder ID
4425
+ * @returns Promise resolving to a queue definition
4426
+ *
4427
+ * @example
4428
+ * ```typescript
4429
+ * // Get queue by ID
4430
+ * const queue = await sdk.queues.getById(123, 456);
4431
+ * ```
3265
4432
  */
3266
- complete(options: TaskCompleteOptions): Promise<OperationResponse<TaskCompletionOptions>>;
4433
+ getById(id: number, folderId: number, options?: QueueGetByIdOptions): Promise<QueueGetResponse>;
3267
4434
  }
3268
- type TaskGetResponse = RawTaskGetResponse & TaskMethods;
3269
- type TaskCreateResponse = RawTaskCreateResponse & TaskMethods;
3270
- /**
3271
- * Creates an actionable task by combining API task data with operational methods.
3272
- *
3273
- * @param taskData - The task data from API
3274
- * @param service - The task service instance
3275
- * @returns A task object with added methods
3276
- */
3277
- declare function createTaskWithMethods(taskData: RawTaskGetResponse | RawTaskCreateResponse, service: TaskServiceModel): TaskGetResponse | TaskCreateResponse;
3278
4435
 
3279
4436
  /**
3280
4437
  * Service for interacting with UiPath Tasks API
@@ -3375,10 +4532,11 @@ declare class TaskService extends BaseService implements TaskServiceModel {
3375
4532
  getAll<T extends TaskGetAllOptions = TaskGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<TaskGetResponse> : NonPaginatedResponse<TaskGetResponse>>;
3376
4533
  /**
3377
4534
  * Gets a task by ID
4535
+ * IMPORTANT: For form tasks, folderId must be provided.
3378
4536
  *
3379
4537
  * @param id - The ID of the task to retrieve
3380
4538
  * @param options - Optional query parameters
3381
- * @param folderId - Optional folder ID
4539
+ * @param folderId - Optional folder ID (REQUIRED for form tasks)
3382
4540
  * @returns Promise resolving to the task (form tasks will return form-specific data)
3383
4541
  *
3384
4542
  * @example
@@ -3394,7 +4552,6 @@ declare class TaskService extends BaseService implements TaskServiceModel {
3394
4552
  * Assigns tasks to users
3395
4553
  *
3396
4554
  * @param taskAssignments - Single task assignment or array of task assignments
3397
- * @param folderId - Optional folder ID
3398
4555
  * @returns Promise resolving to array of task assignment results
3399
4556
  *
3400
4557
  * @example
@@ -3424,12 +4581,11 @@ declare class TaskService extends BaseService implements TaskServiceModel {
3424
4581
  * ]);
3425
4582
  * ```
3426
4583
  */
3427
- assign(taskAssignments: TaskAssignmentOptions | TaskAssignmentOptions[], folderId?: number): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
4584
+ assign(taskAssignments: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
3428
4585
  /**
3429
4586
  * Reassigns tasks to new users
3430
4587
  *
3431
4588
  * @param taskAssignments - Single task assignment or array of task assignments
3432
- * @param folderId - Optional folder ID
3433
4589
  * @returns Promise resolving to array of task assignment results
3434
4590
  *
3435
4591
  * @example
@@ -3459,12 +4615,11 @@ declare class TaskService extends BaseService implements TaskServiceModel {
3459
4615
  * ]);
3460
4616
  * ```
3461
4617
  */
3462
- reassign(taskAssignments: TaskAssignmentOptions | TaskAssignmentOptions[], folderId?: number): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
4618
+ reassign(taskAssignments: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
3463
4619
  /**
3464
4620
  * Unassigns tasks (removes current assignees)
3465
4621
  *
3466
4622
  * @param taskIds - Single task ID or array of task IDs to unassign
3467
- * @param folderId - Optional folder ID
3468
4623
  * @returns Promise resolving to array of task assignment results
3469
4624
  *
3470
4625
  * @example
@@ -3476,33 +4631,34 @@ declare class TaskService extends BaseService implements TaskServiceModel {
3476
4631
  * const result = await sdk.tasks.unassign([123, 456, 789]);
3477
4632
  * ```
3478
4633
  */
3479
- unassign(taskIds: number | number[], folderId?: number): Promise<OperationResponse<{
4634
+ unassign(taskIds: number | number[]): Promise<OperationResponse<{
3480
4635
  taskId: number;
3481
4636
  }[] | TaskAssignmentResponse[]>>;
3482
4637
  /**
3483
4638
  * Completes a task with the specified type and data
3484
4639
  *
3485
- * @param completionType - The type of task (Form, App, or Generic)
3486
- * @param options - The completion options
4640
+ * @param options - The completion options including task type, taskId, data, and action
3487
4641
  * @param folderId - Required folder ID
3488
- * @returns Promise resolving to void
4642
+ * @returns Promise resolving to completion result
3489
4643
  *
3490
4644
  * @example
3491
4645
  * ```typescript
3492
4646
  * // Complete an app task
3493
- * await sdk.tasks.complete(TaskType.App, {
4647
+ * await sdk.tasks.complete({
4648
+ * type: TaskType.App,
3494
4649
  * taskId: 456,
3495
4650
  * data: {},
3496
4651
  * action: "submit"
3497
4652
  * }, 123); // folderId is required
3498
4653
  *
3499
4654
  * // Complete an external task
3500
- * await sdk.tasks.complete(TaskType.ExternalTask, {
4655
+ * await sdk.tasks.complete({
4656
+ * type: TaskType.External,
3501
4657
  * taskId: 789
3502
4658
  * }, 123); // folderId is required
3503
4659
  * ```
3504
4660
  */
3505
- complete(completionType: TaskType, options: TaskCompletionOptions, folderId: number): Promise<OperationResponse<TaskCompletionOptions>>;
4661
+ complete(options: TaskCompletionOptions, folderId: number): Promise<OperationResponse<TaskCompletionOptions>>;
3506
4662
  /**
3507
4663
  * Gets a form task by ID (private method)
3508
4664
  *
@@ -3520,6 +4676,13 @@ declare class TaskService extends BaseService implements TaskServiceModel {
3520
4676
  * @private
3521
4677
  */
3522
4678
  private processTaskParameters;
4679
+ /**
4680
+ * Adds default expand parameters to options
4681
+ * @param options - The options object to add default expand to
4682
+ * @returns Options with default expand parameters added
4683
+ * @private
4684
+ */
4685
+ private addDefaultExpand;
3523
4686
  }
3524
4687
 
3525
4688
  interface BaseConfig {
@@ -3550,7 +4713,7 @@ declare class UiPath {
3550
4713
  constructor(config: UiPathSDKConfig);
3551
4714
  /**
3552
4715
  * Initialize the SDK based on the provided configuration.
3553
- * This method is only required for OAuth-based authentication.
4716
+ * This method handles both OAuth flow initiation and completion automatically.
3554
4717
  * For secret-based authentication, initialization is automatic.
3555
4718
  */
3556
4719
  initialize(): Promise<void>;
@@ -3558,6 +4721,18 @@ declare class UiPath {
3558
4721
  * Check if the SDK has been initialized
3559
4722
  */
3560
4723
  isInitialized(): boolean;
4724
+ /**
4725
+ * Check if we're in an OAuth callback state
4726
+ */
4727
+ isInOAuthCallback(): boolean;
4728
+ /**
4729
+ * Complete OAuth authentication flow (only call if isInOAuthCallback() is true)
4730
+ */
4731
+ completeOAuth(): Promise<boolean>;
4732
+ /**
4733
+ * Check if the user is authenticated (has valid token)
4734
+ */
4735
+ isAuthenticated(): boolean;
3561
4736
  /**
3562
4737
  * Get the current authentication token
3563
4738
  */
@@ -3575,6 +4750,19 @@ declare class UiPath {
3575
4750
  * Access to Process Instances service
3576
4751
  */
3577
4752
  instances: ProcessInstancesService;
4753
+ /**
4754
+ * Access to Process Incidents service
4755
+ */
4756
+ incidents: ProcessIncidentsService;
4757
+ };
4758
+ /**
4759
+ * Access to Maestro Cases service
4760
+ */
4761
+ cases: CasesService & {
4762
+ /**
4763
+ * Access to Case Instances service
4764
+ */
4765
+ instances: CaseInstancesService;
3578
4766
  };
3579
4767
  };
3580
4768
  /**
@@ -3884,7 +5072,7 @@ declare const telemetryClient: TelemetryClient;
3884
5072
  * SDK Telemetry constants
3885
5073
  */
3886
5074
  declare 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";
3887
- declare const SDK_VERSION = "1.0.0-beta.13";
5075
+ declare const SDK_VERSION = "1.0.0-beta.15";
3888
5076
  declare const VERSION = "Version";
3889
5077
  declare const SERVICE = "Service";
3890
5078
  declare const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -3899,5 +5087,5 @@ declare const SDK_LOGGER_NAME = "uipath-ts-sdk-telemetry";
3899
5087
  declare const SDK_RUN_EVENT = "Sdk.Run";
3900
5088
  declare const UNKNOWN = "";
3901
5089
 
3902
- export { APP_NAME, AssetValueScope, AssetValueType, AuthenticationError, AuthorizationError, BucketOptions, CLOUD_CLIENT_ID, CLOUD_ORGANIZATION_NAME, CLOUD_REDIRECT_URI, CLOUD_ROLE_NAME, CLOUD_TENANT_NAME, CLOUD_URL, CONNECTION_STRING, DEFAULT_ITEMS_FIELD, DEFAULT_PAGE_SIZE, DEFAULT_TOTAL_COUNT_FIELD, DataDirectionType, EntityFieldDataType, EntityType, ErrorType, FieldDisplayType, HttpStatus, JobPriority, JobState, JobType, JoinType, MAX_PAGE_SIZE, NetworkError, NotFoundError, PackageSourceType, PackageType, RateLimitError, ReferenceType, RemoteControlAccess, RobotSize, SDK_LOGGER_NAME, SDK_RUN_EVENT, SDK_SERVICE_NAME, SDK_VERSION, SERVICE, ServerError, StartStrategy, StopStrategy, TargetFramework, TaskPriority, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, UNKNOWN, UiPath, UiPathError, VERSION, ValidationError, createEntityWithMethods, createProcessInstanceWithMethods, createTaskWithMethods, getErrorDetails, getLimitedPageSize, isAuthenticationError, isAuthorizationError, isNetworkError, isNotFoundError, isRateLimitError, isServerError, isUiPathError, isValidationError, telemetryClient, track, trackEvent };
3903
- export type { ArgumentMetadata, AssetGetAllOptions, AssetGetByIdOptions, AssetGetResponse, AssetServiceModel, BaseOptions, BlobItem, BodyOptions, BpmnXmlString, BucketGetAllOptions, BucketGetByIdOptions, BucketGetFileMetaDataOptions, BucketGetFileMetaDataResponse, BucketGetFileMetaDataWithPaginationOptions, BucketGetReadUriOptions, BucketGetResponse, BucketGetUriOptions, BucketGetUriResponse, BucketGetWriteUriOptions, BucketServiceModel, BucketUploadFileOptions, BucketUploadResponse, CollectionResponse, Config, CustomKeyValuePair, ElementMetaData, EntityDeleteOptions, EntityDeleteResponse, EntityGetRecordsByIdOptions, EntityGetResponse, EntityInsertOptions, EntityInsertResponse, EntityMethods, EntityOperationOptions, EntityOperationResponse, EntityRecord, EntityServiceModel, EntityUpdateOptions, EntityUpdateResponse, ExternalConnection, ExternalField, ExternalFieldMapping, ExternalObject, ExternalSourceFields, FailureRecord, Field, FieldDataType, FieldMetaData, FolderProperties, GlobalVariableMetaData, HasPaginationOptions, Headers, HttpMethod, JobAttachment, JobError, Machine, MaestroProcessGetAllResponse, MaestroProcessesServiceModel, NonPaginatedResponse, OperationResponse, PaginatedResponse, PaginationCursor, PaginationMetadata, PaginationMethodUnion, PaginationOptions, ProcessGetAllOptions, ProcessGetByIdOptions, ProcessGetResponse, ProcessInstanceExecutionHistoryResponse, ProcessInstanceGetAllOptions, ProcessInstanceGetAllWithPaginationOptions, ProcessInstanceGetResponse, ProcessInstanceGetVariablesOptions, ProcessInstanceGetVariablesResponse, ProcessInstanceMethods, ProcessInstanceOperationOptions, ProcessInstanceOperationResponse, ProcessInstanceRun, ProcessInstancesServiceModel, ProcessProperties, ProcessServiceModel, ProcessStartRequest, ProcessStartResponse, QueryParams, QueueGetAllOptions, QueueGetByIdOptions, QueueGetResponse, QueueServiceModel, RawEntityGetResponse, RawProcessInstanceGetResponse, RawTaskCreateResponse, RawTaskGetResponse, RequestOptions, RequestSpec, ResponseDictionary, ResponseType, RetryOptions, RobotMetadata, SourceJoinCriteria, TaskAssignOptions, TaskAssignment, TaskAssignmentOptions, TaskAssignmentResponse, TaskBaseResponse, TaskCompleteOptions, TaskCompletionOptions, TaskCreateOptions, TaskCreateResponse, TaskGetAllOptions, TaskGetByIdOptions, TaskGetResponse, TaskGetUsersOptions, TaskMethods, TaskServiceModel, TaskSlaDetail, TaskSource, TasksUnassignOptions, TimeoutOptions, UserLoginInfo };
5090
+ export { APP_NAME, AssetValueScope, AssetValueType, AuthenticationError, AuthorizationError, BucketOptions, CLOUD_CLIENT_ID, CLOUD_ORGANIZATION_NAME, CLOUD_REDIRECT_URI, CLOUD_ROLE_NAME, CLOUD_TENANT_NAME, CLOUD_URL, CONNECTION_STRING, DEFAULT_ITEMS_FIELD, DEFAULT_PAGE_SIZE, DEFAULT_TOTAL_COUNT_FIELD, DataDirectionType, DebugMode, EntityFieldDataType, EntityType, ErrorType, EscalationActionType, EscalationRecipientScope, EscalationTriggerType, FieldDisplayType, HttpStatus, JobPriority, JobState, JobType, JoinType, MAX_PAGE_SIZE, NetworkError, NotFoundError, PackageSourceType, PackageType, ProcessIncidentSeverity, ProcessIncidentStatus, ProcessIncidentType, RateLimitError, ReferenceType, RemoteControlAccess, RobotSize, SDK_LOGGER_NAME, SDK_RUN_EVENT, SDK_SERVICE_NAME, SDK_VERSION, SERVICE, SLADurationUnit, ServerError, StageTaskType, StartStrategy, StopStrategy, TargetFramework, TaskActivityType, TaskPriority, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, UNKNOWN, UiPath, UiPathError, VERSION, ValidationError, createCaseInstanceWithMethods, createEntityWithMethods, createProcessInstanceWithMethods, createProcessWithMethods, createTaskWithMethods, getErrorDetails, getLimitedPageSize, isAuthenticationError, isAuthorizationError, isNetworkError, isNotFoundError, isRateLimitError, isServerError, isUiPathError, isValidationError, telemetryClient, track, trackEvent };
5091
+ export type { ArgumentMetadata, AssetGetAllOptions, AssetGetByIdOptions, AssetGetResponse, AssetServiceModel, BaseConfig, BaseOptions, BlobItem, BodyOptions, BpmnXmlString, BucketGetAllOptions, BucketGetByIdOptions, BucketGetFileMetaDataOptions, BucketGetFileMetaDataResponse, BucketGetFileMetaDataWithPaginationOptions, BucketGetReadUriOptions, BucketGetResponse, BucketGetUriOptions, BucketGetUriResponse, BucketServiceModel, BucketUploadFileOptions, BucketUploadResponse, CaseAppConfig, CaseAppOverview, CaseGetAllResponse, CaseGetStageResponse, CaseInstanceExecutionHistoryResponse, CaseInstanceGetAllOptions, CaseInstanceGetAllWithPaginationOptions, CaseInstanceGetResponse, CaseInstanceMethods, CaseInstanceOperationOptions, CaseInstanceOperationResponse, CaseInstanceRun, CaseInstancesServiceModel, CasesServiceModel, CollectionResponse, CustomKeyValuePair, ElementExecutionMetadata, ElementMetaData, ElementRunMetadata, EntityDeleteOptions, EntityDeleteResponse, EntityGetRecordsByIdOptions, EntityGetResponse, EntityInsertOptions, EntityInsertResponse, EntityMethods, EntityOperationOptions, EntityOperationResponse, EntityRecord, EntityServiceModel, EntityUpdateOptions, EntityUpdateResponse, EscalationAction, EscalationRecipient, EscalationRule, EscalationTriggerMetadata, ExternalConnection, ExternalField, ExternalFieldMapping, ExternalObject, ExternalSourceFields, FailureRecord, Field, FieldDataType, FieldMetaData, FolderProperties, GlobalVariableMetaData, HasPaginationOptions, Headers, HttpMethod, JobAttachment, JobError, Machine, MaestroProcessGetAllResponse, MaestroProcessesServiceModel, NonPaginatedResponse, OAuthFields, OperationResponse, PaginatedResponse, PaginationCursor, PaginationMetadata, PaginationMethodUnion, PaginationOptions, ProcessGetAllOptions, ProcessGetByIdOptions, ProcessGetResponse, ProcessIncidentGetAllResponse, ProcessIncidentGetResponse, ProcessIncidentsServiceModel, ProcessInstanceExecutionHistoryResponse, ProcessInstanceGetAllOptions, ProcessInstanceGetAllWithPaginationOptions, ProcessInstanceGetResponse, ProcessInstanceGetVariablesOptions, ProcessInstanceGetVariablesResponse, ProcessInstanceMethods, ProcessInstanceOperationOptions, ProcessInstanceOperationResponse, ProcessInstanceRun, ProcessInstancesServiceModel, ProcessMethods, ProcessProperties, ProcessServiceModel, ProcessStartRequest, ProcessStartResponse, QueryParams, QueueGetAllOptions, QueueGetByIdOptions, QueueGetResponse, QueueServiceModel, RawCaseInstanceGetResponse, RawEntityGetResponse, RawMaestroProcessGetAllResponse, RawProcessInstanceGetResponse, RawTaskCreateResponse, RawTaskGetResponse, RequestOptions, RequestSpec, ResponseDictionary, ResponseType, RetryOptions, RobotMetadata, SourceJoinCriteria, StageSLA, StageTask, Tag, TaskActivity, TaskAssignOptions, TaskAssignment, TaskAssignmentOptions, TaskAssignmentResponse, TaskBaseResponse, TaskCompleteOptions, TaskCompletionOptions, TaskCreateOptions, TaskCreateResponse, TaskGetAllOptions, TaskGetByIdOptions, TaskGetResponse, TaskGetUsersOptions, TaskMethods, TaskServiceModel, TaskSlaDetail, TaskSource, TasksUnassignOptions, TimeoutOptions, UiPathSDKConfig, UserLoginInfo };