@uipath/uipath-typescript 1.0.0-beta.12 → 1.0.0-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/{Readme.md → README.md} +53 -10
  2. package/dist/index.d.ts +4709 -15
  3. package/dist/index.esm.js +6077 -0
  4. package/dist/index.js +6143 -19
  5. package/package.json +11 -4
  6. package/dist/core/auth/service.d.ts +0 -72
  7. package/dist/core/auth/service.d.ts.map +0 -1
  8. package/dist/core/auth/service.js +0 -244
  9. package/dist/core/auth/service.js.map +0 -1
  10. package/dist/core/auth/token-manager.d.ts +0 -82
  11. package/dist/core/auth/token-manager.d.ts.map +0 -1
  12. package/dist/core/auth/token-manager.js +0 -248
  13. package/dist/core/auth/token-manager.js.map +0 -1
  14. package/dist/core/auth/types.d.ts +0 -20
  15. package/dist/core/auth/types.d.ts.map +0 -1
  16. package/dist/core/auth/types.js +0 -2
  17. package/dist/core/auth/types.js.map +0 -1
  18. package/dist/core/config/config-utils.d.ts +0 -4
  19. package/dist/core/config/config-utils.d.ts.map +0 -1
  20. package/dist/core/config/config-utils.js +0 -13
  21. package/dist/core/config/config-utils.js.map +0 -1
  22. package/dist/core/config/config.d.ts +0 -48
  23. package/dist/core/config/config.d.ts.map +0 -1
  24. package/dist/core/config/config.js +0 -22
  25. package/dist/core/config/config.js.map +0 -1
  26. package/dist/core/config/sdk-config.d.ts +0 -33
  27. package/dist/core/config/sdk-config.d.ts.map +0 -1
  28. package/dist/core/config/sdk-config.js +0 -9
  29. package/dist/core/config/sdk-config.js.map +0 -1
  30. package/dist/core/context/execution.d.ts +0 -35
  31. package/dist/core/context/execution.d.ts.map +0 -1
  32. package/dist/core/context/execution.js +0 -55
  33. package/dist/core/context/execution.js.map +0 -1
  34. package/dist/core/errors/authentication.d.ts +0 -13
  35. package/dist/core/errors/authentication.d.ts.map +0 -1
  36. package/dist/core/errors/authentication.js +0 -19
  37. package/dist/core/errors/authentication.js.map +0 -1
  38. package/dist/core/errors/authorization.d.ts +0 -13
  39. package/dist/core/errors/authorization.d.ts.map +0 -1
  40. package/dist/core/errors/authorization.js +0 -19
  41. package/dist/core/errors/authorization.js.map +0 -1
  42. package/dist/core/errors/base.d.ts +0 -41
  43. package/dist/core/errors/base.d.ts.map +0 -1
  44. package/dist/core/errors/base.js +0 -37
  45. package/dist/core/errors/base.js.map +0 -1
  46. package/dist/core/errors/constants.d.ts +0 -57
  47. package/dist/core/errors/constants.d.ts.map +0 -1
  48. package/dist/core/errors/constants.js +0 -66
  49. package/dist/core/errors/constants.js.map +0 -1
  50. package/dist/core/errors/error-factory.d.ts +0 -17
  51. package/dist/core/errors/error-factory.d.ts.map +0 -1
  52. package/dist/core/errors/error-factory.js +0 -57
  53. package/dist/core/errors/error-factory.js.map +0 -1
  54. package/dist/core/errors/guards.d.ts +0 -48
  55. package/dist/core/errors/guards.d.ts.map +0 -1
  56. package/dist/core/errors/guards.js +0 -76
  57. package/dist/core/errors/guards.js.map +0 -1
  58. package/dist/core/errors/index.d.ts +0 -11
  59. package/dist/core/errors/index.d.ts.map +0 -1
  60. package/dist/core/errors/index.js +0 -15
  61. package/dist/core/errors/index.js.map +0 -1
  62. package/dist/core/errors/network.d.ts +0 -14
  63. package/dist/core/errors/network.d.ts.map +0 -1
  64. package/dist/core/errors/network.js +0 -20
  65. package/dist/core/errors/network.js.map +0 -1
  66. package/dist/core/errors/not-found.d.ts +0 -13
  67. package/dist/core/errors/not-found.d.ts.map +0 -1
  68. package/dist/core/errors/not-found.js +0 -19
  69. package/dist/core/errors/not-found.js.map +0 -1
  70. package/dist/core/errors/parser.d.ts +0 -29
  71. package/dist/core/errors/parser.d.ts.map +0 -1
  72. package/dist/core/errors/parser.js +0 -152
  73. package/dist/core/errors/parser.js.map +0 -1
  74. package/dist/core/errors/rate-limit.d.ts +0 -12
  75. package/dist/core/errors/rate-limit.d.ts.map +0 -1
  76. package/dist/core/errors/rate-limit.js +0 -18
  77. package/dist/core/errors/rate-limit.js.map +0 -1
  78. package/dist/core/errors/server.d.ts +0 -17
  79. package/dist/core/errors/server.d.ts.map +0 -1
  80. package/dist/core/errors/server.js +0 -27
  81. package/dist/core/errors/server.js.map +0 -1
  82. package/dist/core/errors/types.d.ts +0 -94
  83. package/dist/core/errors/types.d.ts.map +0 -1
  84. package/dist/core/errors/types.js +0 -28
  85. package/dist/core/errors/types.js.map +0 -1
  86. package/dist/core/errors/validation.d.ts +0 -13
  87. package/dist/core/errors/validation.d.ts.map +0 -1
  88. package/dist/core/errors/validation.js +0 -19
  89. package/dist/core/errors/validation.js.map +0 -1
  90. package/dist/core/http/api-client.d.ts +0 -30
  91. package/dist/core/http/api-client.d.ts.map +0 -1
  92. package/dist/core/http/api-client.js +0 -131
  93. package/dist/core/http/api-client.js.map +0 -1
  94. package/dist/core/telemetry/client.d.ts +0 -34
  95. package/dist/core/telemetry/client.d.ts.map +0 -1
  96. package/dist/core/telemetry/client.js +0 -193
  97. package/dist/core/telemetry/client.js.map +0 -1
  98. package/dist/core/telemetry/constants.d.ts +0 -19
  99. package/dist/core/telemetry/constants.d.ts.map +0 -1
  100. package/dist/core/telemetry/constants.js +0 -24
  101. package/dist/core/telemetry/constants.js.map +0 -1
  102. package/dist/core/telemetry/index.d.ts +0 -7
  103. package/dist/core/telemetry/index.d.ts.map +0 -1
  104. package/dist/core/telemetry/index.js +0 -7
  105. package/dist/core/telemetry/index.js.map +0 -1
  106. package/dist/core/telemetry/track.d.ts +0 -26
  107. package/dist/core/telemetry/track.d.ts.map +0 -1
  108. package/dist/core/telemetry/track.js +0 -67
  109. package/dist/core/telemetry/track.js.map +0 -1
  110. package/dist/core/telemetry/types.d.ts +0 -18
  111. package/dist/core/telemetry/types.d.ts.map +0 -1
  112. package/dist/core/telemetry/types.js +0 -5
  113. package/dist/core/telemetry/types.js.map +0 -1
  114. package/dist/index.d.ts.map +0 -1
  115. package/dist/index.js.map +0 -1
  116. package/dist/models/action-center/index.d.ts +0 -3
  117. package/dist/models/action-center/index.d.ts.map +0 -1
  118. package/dist/models/action-center/index.js +0 -3
  119. package/dist/models/action-center/index.js.map +0 -1
  120. package/dist/models/action-center/tasks.constants.d.ts +0 -12
  121. package/dist/models/action-center/tasks.constants.d.ts.map +0 -1
  122. package/dist/models/action-center/tasks.constants.js +0 -18
  123. package/dist/models/action-center/tasks.constants.js.map +0 -1
  124. package/dist/models/action-center/tasks.internal-types.d.ts +0 -13
  125. package/dist/models/action-center/tasks.internal-types.d.ts.map +0 -1
  126. package/dist/models/action-center/tasks.internal-types.js +0 -2
  127. package/dist/models/action-center/tasks.internal-types.js.map +0 -1
  128. package/dist/models/action-center/tasks.models.d.ts +0 -79
  129. package/dist/models/action-center/tasks.models.d.ts.map +0 -1
  130. package/dist/models/action-center/tasks.models.js +0 -60
  131. package/dist/models/action-center/tasks.models.js.map +0 -1
  132. package/dist/models/action-center/tasks.types.d.ts +0 -180
  133. package/dist/models/action-center/tasks.types.d.ts.map +0 -1
  134. package/dist/models/action-center/tasks.types.js +0 -40
  135. package/dist/models/action-center/tasks.types.js.map +0 -1
  136. package/dist/models/common/index.d.ts +0 -3
  137. package/dist/models/common/index.d.ts.map +0 -1
  138. package/dist/models/common/index.js +0 -3
  139. package/dist/models/common/index.js.map +0 -1
  140. package/dist/models/common/request-spec.d.ts +0 -89
  141. package/dist/models/common/request-spec.d.ts.map +0 -1
  142. package/dist/models/common/request-spec.js +0 -2
  143. package/dist/models/common/request-spec.js.map +0 -1
  144. package/dist/models/common/types.d.ts +0 -43
  145. package/dist/models/common/types.d.ts.map +0 -1
  146. package/dist/models/common/types.js +0 -16
  147. package/dist/models/common/types.js.map +0 -1
  148. package/dist/models/data-fabric/entities.constants.d.ts +0 -32
  149. package/dist/models/data-fabric/entities.constants.d.ts.map +0 -1
  150. package/dist/models/data-fabric/entities.constants.js +0 -46
  151. package/dist/models/data-fabric/entities.constants.js.map +0 -1
  152. package/dist/models/data-fabric/entities.internal-types.d.ts +0 -12
  153. package/dist/models/data-fabric/entities.internal-types.d.ts.map +0 -1
  154. package/dist/models/data-fabric/entities.internal-types.js +0 -2
  155. package/dist/models/data-fabric/entities.internal-types.js.map +0 -1
  156. package/dist/models/data-fabric/entities.models.d.ts +0 -213
  157. package/dist/models/data-fabric/entities.models.d.ts.map +0 -1
  158. package/dist/models/data-fabric/entities.models.js +0 -43
  159. package/dist/models/data-fabric/entities.models.js.map +0 -1
  160. package/dist/models/data-fabric/entities.types.d.ts +0 -264
  161. package/dist/models/data-fabric/entities.types.d.ts.map +0 -1
  162. package/dist/models/data-fabric/entities.types.js +0 -63
  163. package/dist/models/data-fabric/entities.types.js.map +0 -1
  164. package/dist/models/data-fabric/index.d.ts +0 -3
  165. package/dist/models/data-fabric/index.d.ts.map +0 -1
  166. package/dist/models/data-fabric/index.js +0 -3
  167. package/dist/models/data-fabric/index.js.map +0 -1
  168. package/dist/models/index.d.ts +0 -6
  169. package/dist/models/index.d.ts.map +0 -1
  170. package/dist/models/index.js +0 -11
  171. package/dist/models/index.js.map +0 -1
  172. package/dist/models/maestro/index.d.ts +0 -5
  173. package/dist/models/maestro/index.d.ts.map +0 -1
  174. package/dist/models/maestro/index.js +0 -8
  175. package/dist/models/maestro/index.js.map +0 -1
  176. package/dist/models/maestro/process-instances.constants.d.ts +0 -13
  177. package/dist/models/maestro/process-instances.constants.d.ts.map +0 -1
  178. package/dist/models/maestro/process-instances.constants.js +0 -17
  179. package/dist/models/maestro/process-instances.constants.js.map +0 -1
  180. package/dist/models/maestro/process-instances.models.d.ts +0 -210
  181. package/dist/models/maestro/process-instances.models.d.ts.map +0 -1
  182. package/dist/models/maestro/process-instances.models.js +0 -38
  183. package/dist/models/maestro/process-instances.models.js.map +0 -1
  184. package/dist/models/maestro/process-instances.types.d.ts +0 -78
  185. package/dist/models/maestro/process-instances.types.d.ts.map +0 -1
  186. package/dist/models/maestro/process-instances.types.js +0 -6
  187. package/dist/models/maestro/process-instances.types.js.map +0 -1
  188. package/dist/models/maestro/processes.models.d.ts +0 -31
  189. package/dist/models/maestro/processes.models.d.ts.map +0 -1
  190. package/dist/models/maestro/processes.models.js +0 -6
  191. package/dist/models/maestro/processes.models.js.map +0 -1
  192. package/dist/models/maestro/processes.types.d.ts +0 -42
  193. package/dist/models/maestro/processes.types.d.ts.map +0 -1
  194. package/dist/models/maestro/processes.types.js +0 -6
  195. package/dist/models/maestro/processes.types.js.map +0 -1
  196. package/dist/models/orchestrator/assets.constants.d.ts +0 -7
  197. package/dist/models/orchestrator/assets.constants.d.ts.map +0 -1
  198. package/dist/models/orchestrator/assets.constants.js +0 -8
  199. package/dist/models/orchestrator/assets.constants.js.map +0 -1
  200. package/dist/models/orchestrator/assets.models.d.ts +0 -55
  201. package/dist/models/orchestrator/assets.models.d.ts.map +0 -1
  202. package/dist/models/orchestrator/assets.models.js +0 -2
  203. package/dist/models/orchestrator/assets.models.js.map +0 -1
  204. package/dist/models/orchestrator/assets.types.d.ts +0 -65
  205. package/dist/models/orchestrator/assets.types.d.ts.map +0 -1
  206. package/dist/models/orchestrator/assets.types.js +0 -24
  207. package/dist/models/orchestrator/assets.types.js.map +0 -1
  208. package/dist/models/orchestrator/buckets.constants.d.ts +0 -7
  209. package/dist/models/orchestrator/buckets.constants.d.ts.map +0 -1
  210. package/dist/models/orchestrator/buckets.constants.js +0 -9
  211. package/dist/models/orchestrator/buckets.constants.js.map +0 -1
  212. package/dist/models/orchestrator/buckets.models.d.ts +0 -144
  213. package/dist/models/orchestrator/buckets.models.d.ts.map +0 -1
  214. package/dist/models/orchestrator/buckets.models.js +0 -2
  215. package/dist/models/orchestrator/buckets.models.js.map +0 -1
  216. package/dist/models/orchestrator/buckets.types.d.ts +0 -176
  217. package/dist/models/orchestrator/buckets.types.d.ts.map +0 -1
  218. package/dist/models/orchestrator/buckets.types.js +0 -8
  219. package/dist/models/orchestrator/buckets.types.js.map +0 -1
  220. package/dist/models/orchestrator/index.d.ts +0 -9
  221. package/dist/models/orchestrator/index.d.ts.map +0 -1
  222. package/dist/models/orchestrator/index.js +0 -13
  223. package/dist/models/orchestrator/index.js.map +0 -1
  224. package/dist/models/orchestrator/processes.constants.d.ts +0 -7
  225. package/dist/models/orchestrator/processes.constants.d.ts.map +0 -1
  226. package/dist/models/orchestrator/processes.constants.js +0 -17
  227. package/dist/models/orchestrator/processes.constants.js.map +0 -1
  228. package/dist/models/orchestrator/processes.models.d.ts +0 -87
  229. package/dist/models/orchestrator/processes.models.d.ts.map +0 -1
  230. package/dist/models/orchestrator/processes.models.js +0 -2
  231. package/dist/models/orchestrator/processes.models.js.map +0 -1
  232. package/dist/models/orchestrator/processes.types.d.ts +0 -293
  233. package/dist/models/orchestrator/processes.types.d.ts.map +0 -1
  234. package/dist/models/orchestrator/processes.types.js +0 -110
  235. package/dist/models/orchestrator/processes.types.js.map +0 -1
  236. package/dist/models/orchestrator/queues.constants.d.ts +0 -7
  237. package/dist/models/orchestrator/queues.constants.d.ts.map +0 -1
  238. package/dist/models/orchestrator/queues.constants.js +0 -9
  239. package/dist/models/orchestrator/queues.constants.js.map +0 -1
  240. package/dist/models/orchestrator/queues.models.d.ts +0 -61
  241. package/dist/models/orchestrator/queues.models.d.ts.map +0 -1
  242. package/dist/models/orchestrator/queues.models.js +0 -2
  243. package/dist/models/orchestrator/queues.models.js.map +0 -1
  244. package/dist/models/orchestrator/queues.types.d.ts +0 -39
  245. package/dist/models/orchestrator/queues.types.d.ts.map +0 -1
  246. package/dist/models/orchestrator/queues.types.js +0 -2
  247. package/dist/models/orchestrator/queues.types.js.map +0 -1
  248. package/dist/services/action-center/index.d.ts +0 -2
  249. package/dist/services/action-center/index.d.ts.map +0 -1
  250. package/dist/services/action-center/index.js +0 -2
  251. package/dist/services/action-center/index.js.map +0 -1
  252. package/dist/services/action-center/tasks.d.ts +0 -254
  253. package/dist/services/action-center/tasks.d.ts.map +0 -1
  254. package/dist/services/action-center/tasks.js +0 -446
  255. package/dist/services/action-center/tasks.js.map +0 -1
  256. package/dist/services/base.d.ts +0 -49
  257. package/dist/services/base.d.ts.map +0 -1
  258. package/dist/services/base.js +0 -183
  259. package/dist/services/base.js.map +0 -1
  260. package/dist/services/data-fabric/entities.d.ts +0 -180
  261. package/dist/services/data-fabric/entities.d.ts.map +0 -1
  262. package/dist/services/data-fabric/entities.js +0 -326
  263. package/dist/services/data-fabric/entities.js.map +0 -1
  264. package/dist/services/data-fabric/index.d.ts +0 -2
  265. package/dist/services/data-fabric/index.d.ts.map +0 -1
  266. package/dist/services/data-fabric/index.js +0 -2
  267. package/dist/services/data-fabric/index.js.map +0 -1
  268. package/dist/services/folder-scoped.d.ts +0 -21
  269. package/dist/services/folder-scoped.d.ts.map +0 -1
  270. package/dist/services/folder-scoped.js +0 -36
  271. package/dist/services/folder-scoped.js.map +0 -1
  272. package/dist/services/index.d.ts +0 -6
  273. package/dist/services/index.d.ts.map +0 -1
  274. package/dist/services/index.js +0 -6
  275. package/dist/services/index.js.map +0 -1
  276. package/dist/services/maestro/index.d.ts +0 -3
  277. package/dist/services/maestro/index.d.ts.map +0 -1
  278. package/dist/services/maestro/index.js +0 -3
  279. package/dist/services/maestro/index.js.map +0 -1
  280. package/dist/services/maestro/maestro-processes.d.ts +0 -35
  281. package/dist/services/maestro/maestro-processes.d.ts.map +0 -1
  282. package/dist/services/maestro/maestro-processes.js +0 -47
  283. package/dist/services/maestro/maestro-processes.js.map +0 -1
  284. package/dist/services/maestro/process-instances.d.ts +0 -96
  285. package/dist/services/maestro/process-instances.d.ts.map +0 -1
  286. package/dist/services/maestro/process-instances.js +0 -190
  287. package/dist/services/maestro/process-instances.js.map +0 -1
  288. package/dist/services/orchestrator/assets.d.ts +0 -63
  289. package/dist/services/orchestrator/assets.d.ts.map +0 -1
  290. package/dist/services/orchestrator/assets.js +0 -110
  291. package/dist/services/orchestrator/assets.js.map +0 -1
  292. package/dist/services/orchestrator/buckets.d.ts +0 -186
  293. package/dist/services/orchestrator/buckets.d.ts.map +0 -1
  294. package/dist/services/orchestrator/buckets.js +0 -436
  295. package/dist/services/orchestrator/buckets.js.map +0 -1
  296. package/dist/services/orchestrator/index.d.ts +0 -5
  297. package/dist/services/orchestrator/index.d.ts.map +0 -1
  298. package/dist/services/orchestrator/index.js +0 -5
  299. package/dist/services/orchestrator/index.js.map +0 -1
  300. package/dist/services/orchestrator/processes.d.ts +0 -96
  301. package/dist/services/orchestrator/processes.d.ts.map +0 -1
  302. package/dist/services/orchestrator/processes.js +0 -172
  303. package/dist/services/orchestrator/processes.js.map +0 -1
  304. package/dist/services/orchestrator/queues.d.ts +0 -72
  305. package/dist/services/orchestrator/queues.d.ts.map +0 -1
  306. package/dist/services/orchestrator/queues.js +0 -117
  307. package/dist/services/orchestrator/queues.js.map +0 -1
  308. package/dist/uipath.d.ts +0 -65
  309. package/dist/uipath.d.ts.map +0 -1
  310. package/dist/uipath.js +0 -146
  311. package/dist/uipath.js.map +0 -1
  312. package/dist/utils/constants/common.d.ts +0 -84
  313. package/dist/utils/constants/common.d.ts.map +0 -1
  314. package/dist/utils/constants/common.js +0 -84
  315. package/dist/utils/constants/common.js.map +0 -1
  316. package/dist/utils/constants/endpoints.d.ts +0 -96
  317. package/dist/utils/constants/endpoints.d.ts.map +0 -1
  318. package/dist/utils/constants/endpoints.js +0 -96
  319. package/dist/utils/constants/endpoints.js.map +0 -1
  320. package/dist/utils/constants/headers.d.ts +0 -27
  321. package/dist/utils/constants/headers.d.ts.map +0 -1
  322. package/dist/utils/constants/headers.js +0 -27
  323. package/dist/utils/constants/headers.js.map +0 -1
  324. package/dist/utils/encoding/base64.d.ts +0 -13
  325. package/dist/utils/encoding/base64.d.ts.map +0 -1
  326. package/dist/utils/encoding/base64.js +0 -49
  327. package/dist/utils/encoding/base64.js.map +0 -1
  328. package/dist/utils/encoding/index.d.ts +0 -2
  329. package/dist/utils/encoding/index.d.ts.map +0 -1
  330. package/dist/utils/encoding/index.js +0 -2
  331. package/dist/utils/encoding/index.js.map +0 -1
  332. package/dist/utils/http/headers.d.ts +0 -37
  333. package/dist/utils/http/headers.d.ts.map +0 -1
  334. package/dist/utils/http/headers.js +0 -51
  335. package/dist/utils/http/headers.js.map +0 -1
  336. package/dist/utils/http/params.d.ts +0 -27
  337. package/dist/utils/http/params.d.ts.map +0 -1
  338. package/dist/utils/http/params.js +0 -35
  339. package/dist/utils/http/params.js.map +0 -1
  340. package/dist/utils/object.d.ts +0 -32
  341. package/dist/utils/object.d.ts.map +0 -1
  342. package/dist/utils/object.js +0 -50
  343. package/dist/utils/object.js.map +0 -1
  344. package/dist/utils/pagination/constants.d.ts +0 -18
  345. package/dist/utils/pagination/constants.d.ts.map +0 -1
  346. package/dist/utils/pagination/constants.js +0 -23
  347. package/dist/utils/pagination/constants.js.map +0 -1
  348. package/dist/utils/pagination/helpers.d.ts +0 -62
  349. package/dist/utils/pagination/helpers.d.ts.map +0 -1
  350. package/dist/utils/pagination/helpers.js +0 -255
  351. package/dist/utils/pagination/helpers.js.map +0 -1
  352. package/dist/utils/pagination/index.d.ts +0 -3
  353. package/dist/utils/pagination/index.d.ts.map +0 -1
  354. package/dist/utils/pagination/index.js +0 -3
  355. package/dist/utils/pagination/index.js.map +0 -1
  356. package/dist/utils/pagination/internal-types.d.ts +0 -184
  357. package/dist/utils/pagination/internal-types.d.ts.map +0 -1
  358. package/dist/utils/pagination/internal-types.js +0 -9
  359. package/dist/utils/pagination/internal-types.js.map +0 -1
  360. package/dist/utils/pagination/pagination-manager.d.ts +0 -17
  361. package/dist/utils/pagination/pagination-manager.d.ts.map +0 -1
  362. package/dist/utils/pagination/pagination-manager.js +0 -77
  363. package/dist/utils/pagination/pagination-manager.js.map +0 -1
  364. package/dist/utils/pagination/types.d.ts +0 -68
  365. package/dist/utils/pagination/types.d.ts.map +0 -1
  366. package/dist/utils/pagination/types.js +0 -2
  367. package/dist/utils/pagination/types.js.map +0 -1
  368. package/dist/utils/platform.d.ts +0 -8
  369. package/dist/utils/platform.d.ts.map +0 -1
  370. package/dist/utils/platform.js +0 -8
  371. package/dist/utils/platform.js.map +0 -1
  372. package/dist/utils/transform.d.ts +0 -240
  373. package/dist/utils/transform.d.ts.map +0 -1
  374. package/dist/utils/transform.js +0 -334
  375. package/dist/utils/transform.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,16 +1,4710 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const ConfigSchema: z.ZodObject<{
4
+ baseUrl: z.ZodDefault<z.ZodString>;
5
+ orgName: z.ZodString;
6
+ tenantName: z.ZodString;
7
+ secret: z.ZodOptional<z.ZodString>;
8
+ clientId: z.ZodOptional<z.ZodString>;
9
+ redirectUri: z.ZodOptional<z.ZodString>;
10
+ scope: z.ZodOptional<z.ZodString>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ baseUrl: string;
13
+ orgName: string;
14
+ tenantName: string;
15
+ secret?: string | undefined;
16
+ clientId?: string | undefined;
17
+ redirectUri?: string | undefined;
18
+ scope?: string | undefined;
19
+ }, {
20
+ orgName: string;
21
+ tenantName: string;
22
+ baseUrl?: string | undefined;
23
+ secret?: string | undefined;
24
+ clientId?: string | undefined;
25
+ redirectUri?: string | undefined;
26
+ scope?: string | undefined;
27
+ }>;
28
+ type Config = z.infer<typeof ConfigSchema>;
29
+
1
30
  /**
2
- * UiPath TypeScript SDK
3
- *
4
- * A TypeScript SDK that enables programmatic interaction with UiPath Platform services.
5
- */
6
- export { UiPath } from './uipath';
7
- export type { Config } from './core/config/config';
8
- export * from './models/common';
9
- export * from './models/data-fabric';
10
- export * from './models/maestro';
11
- export * from './models/orchestrator';
12
- export * from './models/action-center';
13
- export * from './core/errors';
14
- export * from './utils/pagination';
15
- export * from './core/telemetry';
16
- //# sourceMappingURL=index.d.ts.map
31
+ * Simplified universal pagination cursor
32
+ * Used to fetch next/previous pages
33
+ */
34
+ interface PaginationCursor {
35
+ /** Opaque string containing all information needed to fetch next page */
36
+ value: string;
37
+ }
38
+ /**
39
+ * Discriminated union for pagination methods - ensures cursor and jumpToPage are mutually exclusive
40
+ */
41
+ type PaginationMethodUnion = {
42
+ cursor?: PaginationCursor;
43
+ jumpToPage?: never;
44
+ } | {
45
+ cursor?: never;
46
+ jumpToPage?: number;
47
+ } | {
48
+ cursor?: never;
49
+ jumpToPage?: never;
50
+ };
51
+ /**
52
+ * Pagination options. Users cannot specify both cursor and jumpToPage.
53
+ */
54
+ type PaginationOptions = {
55
+ /** Size of the page to fetch (items per page) */
56
+ pageSize?: number;
57
+ } & PaginationMethodUnion;
58
+ /**
59
+ * Paginated response containing items and navigation information
60
+ */
61
+ interface PaginatedResponse<T> {
62
+ /** The items in the current page */
63
+ items: T[];
64
+ /** Total count of items across all pages (if available) */
65
+ totalCount?: number;
66
+ /** Whether more pages are available */
67
+ hasNextPage: boolean;
68
+ /** Cursor to fetch the next page (if available) */
69
+ nextCursor?: PaginationCursor;
70
+ /** Cursor to fetch the previous page (if available) */
71
+ previousCursor?: PaginationCursor;
72
+ /** Current page number (1-based, if available) */
73
+ currentPage?: number;
74
+ /** Total number of pages (if available) */
75
+ totalPages?: number;
76
+ /** Whether this pagination type supports jumping to arbitrary pages */
77
+ supportsPageJump: boolean;
78
+ }
79
+ /**
80
+ * Response for non-paginated calls that includes both data and total count
81
+ */
82
+ interface NonPaginatedResponse<T> {
83
+ items: T[];
84
+ totalCount?: number;
85
+ }
86
+ /**
87
+ * Helper type for defining paginated method overloads
88
+ * Creates a union type of all ways pagination can be triggered
89
+ */
90
+ type HasPaginationOptions<T> = (T & {
91
+ pageSize: number;
92
+ }) | (T & {
93
+ cursor: PaginationCursor;
94
+ }) | (T & {
95
+ jumpToPage: number;
96
+ });
97
+
98
+ /**
99
+ * Pagination types supported by the SDK
100
+ */
101
+ declare enum PaginationType {
102
+ OFFSET = "offset",
103
+ TOKEN = "token"
104
+ }
105
+ /**
106
+ * Interface for service access methods needed by pagination helpers
107
+ */
108
+ interface PaginationServiceAccess {
109
+ get<T>(path: string, options?: any): Promise<{
110
+ data: T;
111
+ }>;
112
+ requestWithPagination<T>(method: string, path: string, paginationOptions: PaginationOptions, options: RequestWithPaginationOptions): Promise<PaginatedResponse<T>>;
113
+ }
114
+ /**
115
+ * Field names for extracting data from paginated responses.
116
+ */
117
+ interface PaginationFieldNames {
118
+ itemsField?: string;
119
+ totalCountField?: string;
120
+ continuationTokenField?: string;
121
+ }
122
+ /**
123
+ * Options for the requestWithPagination method in BaseService.
124
+ */
125
+ interface RequestWithPaginationOptions extends RequestSpec {
126
+ pagination: PaginationFieldNames & {
127
+ paginationType: PaginationType;
128
+ paginationParams?: {
129
+ pageSizeParam?: string;
130
+ offsetParam?: string;
131
+ tokenParam?: string;
132
+ countParam?: string;
133
+ };
134
+ };
135
+ }
136
+
137
+ /**
138
+ * HTTP methods supported by the API client
139
+ */
140
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
141
+ /**
142
+ * Supported response types for API requests
143
+ */
144
+ type ResponseType = 'json' | 'text' | 'blob' | 'arraybuffer' | 'stream';
145
+ /**
146
+ * Query parameters type with support for arrays and nested objects
147
+ */
148
+ type QueryParams = Record<string, string | number | boolean | Array<string | number | boolean> | null | undefined>;
149
+ /**
150
+ * Standard HTTP headers type
151
+ */
152
+ type Headers = Record<string, string>;
153
+ /**
154
+ * Options for request retries
155
+ */
156
+ interface RetryOptions {
157
+ /** Maximum number of retry attempts */
158
+ maxRetries?: number;
159
+ /** Base delay between retries in milliseconds */
160
+ retryDelay?: number;
161
+ /** Whether to use exponential backoff */
162
+ useExponentialBackoff?: boolean;
163
+ /** Status codes that should trigger a retry */
164
+ retryableStatusCodes?: number[];
165
+ }
166
+ /**
167
+ * Options for request timeouts
168
+ */
169
+ interface TimeoutOptions {
170
+ /** Request timeout in milliseconds */
171
+ timeout?: number;
172
+ /** Whether to abort the request on timeout */
173
+ abortOnTimeout?: boolean;
174
+ }
175
+ /**
176
+ * Options for request body transformation
177
+ */
178
+ interface BodyOptions {
179
+ /** Whether to stringify the body */
180
+ stringify?: boolean;
181
+ /** Content type override */
182
+ contentType?: string;
183
+ }
184
+ /**
185
+ * Pagination metadata for API requests
186
+ */
187
+ interface PaginationMetadata {
188
+ /** Type of pagination used by the API endpoint */
189
+ paginationType: PaginationType;
190
+ /** Response field containing items array (defaults to 'value') */
191
+ itemsField?: string;
192
+ /** Response field containing total count (defaults to '@odata.count') */
193
+ totalCountField?: string;
194
+ /** Response field containing continuation token (defaults to 'continuationToken') */
195
+ continuationTokenField?: string;
196
+ }
197
+ /**
198
+ * Base interface for all API requests
199
+ */
200
+ interface RequestSpec {
201
+ /** HTTP method for the request */
202
+ method?: HttpMethod;
203
+ /** URL endpoint for the request */
204
+ url?: string;
205
+ /** Query parameters to be appended to the URL */
206
+ params?: QueryParams;
207
+ /** HTTP headers to include with the request */
208
+ headers?: Headers;
209
+ /** Raw body content (takes precedence over data) */
210
+ body?: unknown;
211
+ /** Expected response type */
212
+ responseType?: ResponseType;
213
+ /** Request timeout options */
214
+ timeoutOptions?: TimeoutOptions;
215
+ /** Retry behavior options */
216
+ retryOptions?: RetryOptions;
217
+ /** Body transformation options */
218
+ bodyOptions?: BodyOptions;
219
+ /** AbortSignal for cancelling the request */
220
+ signal?: AbortSignal;
221
+ /** Pagination metadata for the request */
222
+ pagination?: PaginationMetadata;
223
+ }
224
+
225
+ /**
226
+ * ExecutionContext manages the state and context of API operations.
227
+ * It provides a way to share context across service calls and maintain
228
+ * execution state throughout the lifecycle of operations.
229
+ */
230
+ declare class ExecutionContext {
231
+ private context;
232
+ private headers;
233
+ /**
234
+ * Set a context value that will be available throughout the execution
235
+ */
236
+ set<T>(key: string, value: T): void;
237
+ /**
238
+ * Get a previously set context value
239
+ */
240
+ get<T>(key: string): T | undefined;
241
+ /**
242
+ * Set custom headers that will be included in all API requests
243
+ */
244
+ setHeaders(headers: Record<string, string>): void;
245
+ /**
246
+ * Get all custom headers
247
+ */
248
+ getHeaders(): Record<string, string>;
249
+ /**
250
+ * Clear all context and headers
251
+ */
252
+ clear(): void;
253
+ /**
254
+ * Create a request spec for an API call
255
+ */
256
+ createRequestSpec(spec?: Partial<RequestSpec>): RequestSpec;
257
+ }
258
+
259
+ /**
260
+ * Authentication token information
261
+ */
262
+ interface TokenInfo {
263
+ token: string;
264
+ type: 'secret' | 'oauth';
265
+ expiresAt?: Date;
266
+ refreshToken?: string;
267
+ }
268
+ /**
269
+ * OAuth token response
270
+ */
271
+ interface AuthToken {
272
+ access_token: string;
273
+ token_type: string;
274
+ expires_in: number;
275
+ scope: string;
276
+ refresh_token?: string;
277
+ }
278
+
279
+ /**
280
+ * TokenManager is responsible for managing authentication tokens.
281
+ * It provides token operations for a specific client ID.
282
+ * - For OAuth tokens: Uses session storage with client ID-based keys
283
+ * - For Secret tokens: Stores only in memory, allowing multiple instances
284
+ */
285
+ declare class TokenManager {
286
+ private executionContext;
287
+ private config;
288
+ private isOAuth;
289
+ private currentToken?;
290
+ private readonly STORAGE_KEY_PREFIX;
291
+ private refreshPromise;
292
+ /**
293
+ * Creates a new TokenManager instance
294
+ * @param executionContext The execution context
295
+ * @param config The SDK configuration
296
+ * @param isOAuth Whether this is an OAuth-based authentication
297
+ */
298
+ constructor(executionContext: ExecutionContext, config: Config, isOAuth?: boolean);
299
+ /**
300
+ * Checks if a token is expired
301
+ * @param tokenInfo The token info to check
302
+ * @returns true if the token is expired, false otherwise
303
+ */
304
+ isTokenExpired(tokenInfo?: TokenInfo): boolean;
305
+ /**
306
+ * Gets the storage key for this TokenManager instance
307
+ */
308
+ private _getStorageKey;
309
+ /**
310
+ * Loads token from session storage if available
311
+ * @returns true if a valid token was loaded, false otherwise
312
+ */
313
+ loadFromStorage(): boolean;
314
+ /**
315
+ * Parse and validate token info from storage
316
+ * @param storedToken JSON string from storage
317
+ * @returns Valid TokenInfo or undefined if invalid
318
+ */
319
+ private _parseTokenInfo;
320
+ /**
321
+ * Sets a new token and updates all necessary contexts
322
+ */
323
+ setToken(tokenInfo: TokenInfo): void;
324
+ /**
325
+ * Gets the current token information
326
+ */
327
+ getTokenInfo(): TokenInfo | undefined;
328
+ /**
329
+ * Gets just the token string
330
+ */
331
+ getToken(): string | undefined;
332
+ /**
333
+ * Checks if we have a valid token
334
+ */
335
+ hasValidToken(): boolean;
336
+ /**
337
+ * Clears the current token
338
+ */
339
+ clearToken(): void;
340
+ /**
341
+ * Updates execution context with token information
342
+ */
343
+ private _updateExecutionContext;
344
+ /**
345
+ * Refreshes the access token using the stored refresh token.
346
+ * This method only works for OAuth flow.
347
+ * Uses a lock mechanism to prevent multiple simultaneous refreshes.
348
+ * @returns A promise that resolves to the new AuthToken
349
+ * @throws Error if not in OAuth flow, refresh token is missing, or the request fails
350
+ */
351
+ refreshAccessToken(): Promise<AuthToken>;
352
+ /**
353
+ * Internal method to perform the actual token refresh
354
+ */
355
+ private _doRefreshToken;
356
+ }
357
+
358
+ interface ApiClientConfig {
359
+ headers?: Record<string, string>;
360
+ }
361
+ declare class ApiClient {
362
+ private readonly config;
363
+ private readonly executionContext;
364
+ private readonly clientConfig;
365
+ private defaultHeaders;
366
+ private tokenManager;
367
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager, clientConfig?: ApiClientConfig);
368
+ setDefaultHeaders(headers: Record<string, string>): void;
369
+ /**
370
+ * Checks if the current token needs refresh and refreshes it if necessary
371
+ * @returns The valid token
372
+ * @throws Error if token refresh fails
373
+ */
374
+ private ensureValidToken;
375
+ private getDefaultHeaders;
376
+ private request;
377
+ get<T>(path: string, options?: RequestSpec): Promise<T>;
378
+ post<T>(path: string, data?: unknown, options?: RequestSpec): Promise<T>;
379
+ put<T>(path: string, data?: unknown, options?: RequestSpec): Promise<T>;
380
+ patch<T>(path: string, data?: unknown, options?: RequestSpec): Promise<T>;
381
+ delete<T>(path: string, options?: RequestSpec): Promise<T>;
382
+ }
383
+
384
+ interface ApiResponse<T> {
385
+ data: T;
386
+ }
387
+ declare class BaseService {
388
+ protected readonly config: Config;
389
+ protected readonly executionContext: ExecutionContext;
390
+ protected readonly apiClient: ApiClient;
391
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
392
+ /**
393
+ * Creates a service accessor for pagination helpers
394
+ * This allows pagination helpers to access protected methods without making them public
395
+ */
396
+ protected createPaginationServiceAccess(): PaginationServiceAccess;
397
+ protected request<T>(method: string, path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
398
+ protected requestWithSpec<T>(spec: RequestSpec): Promise<ApiResponse<T>>;
399
+ protected get<T>(path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
400
+ protected post<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
401
+ protected put<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
402
+ protected patch<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
403
+ protected delete<T>(path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
404
+ /**
405
+ * Execute a request with cursor-based pagination
406
+ */
407
+ protected requestWithPagination<T>(method: string, path: string, paginationOptions: PaginationOptions, options: RequestWithPaginationOptions): Promise<PaginatedResponse<T>>;
408
+ /**
409
+ * Validates and prepares pagination parameters from options
410
+ */
411
+ private validateAndPreparePaginationParams;
412
+ /**
413
+ * Prepares request parameters for pagination based on pagination type
414
+ */
415
+ private preparePaginationRequestParams;
416
+ /**
417
+ * Creates a paginated response from API response
418
+ */
419
+ private createPaginatedResponseFromResponse;
420
+ /**
421
+ * Determines if there are more pages based on pagination type and metadata
422
+ */
423
+ private determineHasMorePages;
424
+ }
425
+
426
+ /**
427
+ * Entity field type names
428
+ */
429
+ declare enum EntityFieldDataType {
430
+ UUID = "UUID",
431
+ STRING = "STRING",
432
+ INTEGER = "INTEGER",
433
+ DATETIME = "DATETIME",
434
+ DATETIME_WITH_TZ = "DATETIME_WITH_TZ",
435
+ DECIMAL = "DECIMAL",
436
+ FLOAT = "FLOAT",
437
+ DOUBLE = "DOUBLE",
438
+ DATE = "DATE",
439
+ BOOLEAN = "BOOLEAN",
440
+ BIG_INTEGER = "BIG_INTEGER",
441
+ MULTILINE_TEXT = "MULTILINE_TEXT"
442
+ }
443
+ /**
444
+ * Represents a single entity record
445
+ */
446
+ interface EntityRecord {
447
+ /**
448
+ * Unique identifier for the record
449
+ */
450
+ id: string;
451
+ /**
452
+ * Additional dynamic fields for the entity
453
+ */
454
+ [key: string]: any;
455
+ }
456
+ /**
457
+ * Options for getting an entity by Id
458
+ */
459
+ type EntityGetRecordsByIdOptions = {
460
+ /** Level of entity expansion (default: 0) */
461
+ expansionLevel?: number;
462
+ } & PaginationOptions;
463
+ /**
464
+ * Common options for entity operations that modify multiple records
465
+ */
466
+ interface EntityOperationOptions {
467
+ /** Level of entity expansion (default: 0) */
468
+ expansionLevel?: number;
469
+ /** Whether to fail on first error (default: false) */
470
+ failOnFirst?: boolean;
471
+ }
472
+ /**
473
+ * Options for inserting data into an entity
474
+ */
475
+ type EntityInsertOptions = EntityOperationOptions;
476
+ /**
477
+ * Options for updating data in an entity
478
+ */
479
+ type EntityUpdateOptions = EntityOperationOptions;
480
+ /**
481
+ * Options for deleting data from an entity
482
+ */
483
+ interface EntityDeleteOptions {
484
+ /** Whether to fail on first error (default: false) */
485
+ failOnFirst?: boolean;
486
+ }
487
+ /**
488
+ * Represents a failure record in an entity operation
489
+ */
490
+ interface FailureRecord {
491
+ /** Error message */
492
+ error?: string;
493
+ /** Original record that failed */
494
+ record?: Record<string, any>;
495
+ }
496
+ /**
497
+ * Response from an entity operation that modifies multiple records
498
+ */
499
+ interface EntityOperationResponse {
500
+ /** Records that were successfully processed */
501
+ successRecords: Record<string, any>[];
502
+ /** Records that failed processing */
503
+ failureRecords: FailureRecord[];
504
+ }
505
+ /**
506
+ * Response from inserting data into an entity
507
+ */
508
+ type EntityInsertResponse = EntityOperationResponse;
509
+ /**
510
+ * Response from updating data in an entity
511
+ */
512
+ type EntityUpdateResponse = EntityOperationResponse;
513
+ /**
514
+ * Response from deleting data from an entity
515
+ */
516
+ type EntityDeleteResponse = EntityOperationResponse;
517
+ /**
518
+ * Entity type enum
519
+ */
520
+ declare enum EntityType {
521
+ Entity = "Entity",
522
+ ChoiceSet = "ChoiceSet",
523
+ InternalEntity = "InternalEntity",
524
+ SystemEntity = "SystemEntity"
525
+ }
526
+ /**
527
+ * Field type metadata
528
+ */
529
+ interface FieldDataType {
530
+ name: EntityFieldDataType;
531
+ lengthLimit?: number;
532
+ maxValue?: number;
533
+ minValue?: number;
534
+ decimalPrecision?: number;
535
+ }
536
+ /**
537
+ * Reference types for fields
538
+ */
539
+ declare enum ReferenceType {
540
+ ManyToOne = "ManyToOne"
541
+ }
542
+ /**
543
+ * Field display types
544
+ */
545
+ declare enum FieldDisplayType {
546
+ Basic = "Basic",
547
+ Relationship = "Relationship",
548
+ File = "File",
549
+ ChoiceSetSingle = "ChoiceSetSingle",
550
+ ChoiceSetMultiple = "ChoiceSetMultiple",
551
+ AutoNumber = "AutoNumber"
552
+ }
553
+ /**
554
+ * Data direction type for external fields
555
+ */
556
+ declare enum DataDirectionType {
557
+ ReadOnly = "ReadOnly",
558
+ ReadAndWrite = "ReadAndWrite"
559
+ }
560
+ /**
561
+ * Join type for source join criteria
562
+ */
563
+ declare enum JoinType {
564
+ LeftJoin = "LeftJoin"
565
+ }
566
+ /**
567
+ * Field reference with ID
568
+ */
569
+ interface Field {
570
+ id: string;
571
+ definition?: FieldMetaData;
572
+ }
573
+ /**
574
+ * Detailed field definition
575
+ */
576
+ interface FieldMetaData {
577
+ id: string;
578
+ name: string;
579
+ isPrimaryKey: boolean;
580
+ isForeignKey: boolean;
581
+ isExternalField: boolean;
582
+ isHiddenField: boolean;
583
+ isUnique: boolean;
584
+ referenceName?: string;
585
+ referenceEntity?: RawEntityGetResponse;
586
+ referenceChoiceSet?: RawEntityGetResponse;
587
+ referenceField?: Field;
588
+ referenceType: ReferenceType;
589
+ fieldDataType: FieldDataType;
590
+ isRequired: boolean;
591
+ displayName: string;
592
+ description: string;
593
+ createdTime: string;
594
+ createdBy: string;
595
+ updatedTime: string;
596
+ updatedBy?: string;
597
+ isSystemField: boolean;
598
+ fieldDisplayType?: FieldDisplayType;
599
+ choiceSetId?: string;
600
+ defaultValue?: string;
601
+ isAttachment: boolean;
602
+ isRbacEnabled: boolean;
603
+ }
604
+ /**
605
+ * External object details
606
+ */
607
+ interface ExternalObject {
608
+ id: string;
609
+ externalObjectName?: string;
610
+ externalObjectDisplayName?: string;
611
+ primaryKey?: string;
612
+ externalConnectionId: string;
613
+ entityId?: string;
614
+ isPrimarySource: boolean;
615
+ }
616
+ /**
617
+ * External connection details
618
+ */
619
+ interface ExternalConnection {
620
+ id: string;
621
+ connectionId: string;
622
+ elementInstanceId: number;
623
+ folderKey: string;
624
+ connectorKey?: string;
625
+ connectorName?: string;
626
+ connectionName?: string;
627
+ }
628
+ /**
629
+ * External field mapping
630
+ */
631
+ interface ExternalFieldMapping {
632
+ id: string;
633
+ externalFieldName?: string;
634
+ externalFieldDisplayName?: string;
635
+ externalObjectId: string;
636
+ externalFieldType?: string;
637
+ internalFieldId: string;
638
+ directionType: DataDirectionType;
639
+ }
640
+ /**
641
+ * External field
642
+ */
643
+ interface ExternalField {
644
+ fieldMetaData: FieldMetaData;
645
+ externalFieldMappingDetail: ExternalFieldMapping;
646
+ }
647
+ /**
648
+ * External source fields
649
+ */
650
+ interface ExternalSourceFields {
651
+ fields?: ExternalField[];
652
+ externalObjectDetail?: ExternalObject;
653
+ externalConnectionDetail?: ExternalConnection;
654
+ }
655
+ /**
656
+ * Source join criteria
657
+ */
658
+ interface SourceJoinCriteria {
659
+ id: string;
660
+ entityId: string;
661
+ joinFieldName?: string;
662
+ joinType: JoinType;
663
+ relatedSourceObjectId?: string;
664
+ relatedSourceFieldName?: string;
665
+ }
666
+ /**
667
+ * Entity metadata returned by getById
668
+ */
669
+ interface RawEntityGetResponse {
670
+ name: string;
671
+ displayName: string;
672
+ entityType: EntityType;
673
+ description: string;
674
+ fields: FieldMetaData[];
675
+ externalFields?: ExternalSourceFields[];
676
+ sourceJoinCriterias?: SourceJoinCriteria[];
677
+ recordCount?: number;
678
+ storageSizeInMB?: number;
679
+ usedStorageSizeInMB?: number;
680
+ attachmentSizeInByte?: number;
681
+ isRbacEnabled: boolean;
682
+ id: string;
683
+ createdBy: string;
684
+ createdTime: string;
685
+ updatedTime?: string;
686
+ updatedBy?: string;
687
+ }
688
+
689
+ /**
690
+ * Service for managing UiPath Data Fabric Entities.
691
+ *
692
+ * Entities are collections of records that can be used to store and manage data in the Data Fabric. [UiPath Data Fabric Guide](https://docs.uipath.com/data-service/automation-cloud/latest/user-guide/introduction)
693
+ *
694
+ */
695
+ interface EntityServiceModel {
696
+ /**
697
+ * Gets all entities in the system
698
+ *
699
+ * @returns Promise resolving to either an array of entities NonPaginatedResponse<EntityGetResponse> or a PaginatedResponse<EntityGetResponse> when pagination options are used.
700
+ * {@link EntityGetResponse}
701
+ * @example
702
+ * ```typescript
703
+ * // Get all entities
704
+ * const entities = await sdk.entities.getAll();
705
+ *
706
+ * // Iterate through entities
707
+ * entities.forEach(entity => {
708
+ * console.log(`Entity: ${entity.displayName} (${entity.name})`);
709
+ * console.log(`Type: ${entity.entityType}`);
710
+ * });
711
+ *
712
+ * // Find a specific entity by name
713
+ * const customerEntity = entities.find(e => e.name === 'Customer');
714
+ *
715
+ * // Use entity methods directly
716
+ * if (customerEntity) {
717
+ * const records = await customerEntity.getRecords();
718
+ * console.log(`Customer records: ${records.items.length}`);
719
+ *
720
+ * const insertResult = await customerEntity.insert([
721
+ * { name: "John", age: 30 }
722
+ * ]);
723
+ * }
724
+ * ```
725
+ */
726
+ getAll(): Promise<EntityGetResponse[]>;
727
+ /**
728
+ * Gets entity metadata by entity ID with attached operation methods
729
+ *
730
+ * @param id - UUID of the entity
731
+ * @returns Promise resolving to entity metadata with operation methods
732
+ * {@link EntityGetResponse}
733
+ * @example
734
+ * ```typescript
735
+ * // Get entity metadata with methods
736
+ * const entity = await sdk.entities.getById(<entityId>);
737
+ *
738
+ * // Call operations directly on the entity
739
+ * const records = await entity.getRecords();
740
+ *
741
+ * const insertResult = await entity.insert([
742
+ * { name: "John", age: 30 }
743
+ * ]);
744
+ * ```
745
+ */
746
+ getById(id: string): Promise<EntityGetResponse>;
747
+ /**
748
+ * Gets entity records by entity ID
749
+ *
750
+ * @param entityId - UUID of the entity
751
+ * @param options - Query options
752
+ * @returns Promise resolving to either an array of entity records NonPaginatedResponse<EntityRecord> or a PaginatedResponse<EntityRecord> when pagination options are used.
753
+ * {@link EntityRecord}
754
+ * @example
755
+ * ```typescript
756
+ * // Basic usage (non-paginated)
757
+ * const records = await sdk.entities.getRecordsById(<entityId>);
758
+ *
759
+ * // With expansion level
760
+ * const records = await sdk.entities.getRecordsById(<entityId>, {
761
+ * expansionLevel: 1
762
+ * });
763
+ *
764
+ * // With pagination
765
+ * const paginatedResponse = await sdk.entities.getRecordsById(<entityId>, {
766
+ * pageSize: 50,
767
+ * expansionLevel: 1
768
+ * });
769
+ *
770
+ * // Navigate to next page
771
+ * const nextPage = await sdk.entities.getRecordsById(<entityId>, {
772
+ * cursor: paginatedResponse.nextCursor,
773
+ * expansionLevel: 1
774
+ * });
775
+ * ```
776
+ */
777
+ getRecordsById<T extends EntityGetRecordsByIdOptions = EntityGetRecordsByIdOptions>(entityId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
778
+ /**
779
+ * Inserts data into an entity by entity ID
780
+ *
781
+ * @param id - UUID of the entity
782
+ * @param data - Array of records to insert
783
+ * @param options - Insert options
784
+ * @returns Promise resolving to insert response
785
+ * {@link EntityInsertResponse}
786
+ * @example
787
+ * ```typescript
788
+ * // Basic usage
789
+ * const result = await sdk.entities.insertById(<entityId>, [
790
+ * { name: "John", age: 30 },
791
+ * { name: "Jane", age: 25 }
792
+ * ]);
793
+ *
794
+ * // With options
795
+ * const result = await sdk.entities.insertById(<entityId>, [
796
+ * { name: "John", age: 30 },
797
+ * { name: "Jane", age: 25 }
798
+ * ], {
799
+ * expansionLevel: 1,
800
+ * failOnFirst: true
801
+ * });
802
+ * ```
803
+ */
804
+ insertById(id: string, data: Record<string, any>[], options?: EntityInsertOptions): Promise<EntityInsertResponse>;
805
+ /**
806
+ * Updates data in an entity by entity ID
807
+ *
808
+ * @param id - UUID of the entity
809
+ * @param data - Array of records to update. Each record MUST contain the record Id.
810
+ * @param options - Update options
811
+ * @returns Promise resolving to update response
812
+ * {@link EntityUpdateResponse}
813
+ * @example
814
+ * ```typescript
815
+ * // Basic usage
816
+ * const result = await sdk.entities.updateById(<entityId>, [
817
+ * { Id: "123", name: "John Updated", age: 31 },
818
+ * { Id: "456", name: "Jane Updated", age: 26 }
819
+ * ]);
820
+ *
821
+ * // With options
822
+ * const result = await sdk.entities.updateById(<entityId>, [
823
+ * { Id: "123", name: "John Updated", age: 31 },
824
+ * { Id: "456", name: "Jane Updated", age: 26 }
825
+ * ], {
826
+ * expansionLevel: 1,
827
+ * failOnFirst: true
828
+ * });
829
+ * ```
830
+ */
831
+ updateById(id: string, data: EntityRecord[], options?: EntityUpdateOptions): Promise<EntityUpdateResponse>;
832
+ /**
833
+ * Deletes data from an entity by entity ID
834
+ *
835
+ * @param id - UUID of the entity
836
+ * @param recordIds - Array of record UUIDs to delete
837
+ * @param options - Delete options
838
+ * @returns Promise resolving to delete response
839
+ * {@link EntityDeleteResponse}
840
+ * @example
841
+ * ```typescript
842
+ * // Basic usage
843
+ * const result = await sdk.entities.deleteById(<entityId>, [
844
+ * <recordId-1>, <recordId-2>
845
+ * ]);
846
+ * ```
847
+ */
848
+ deleteById(id: string, recordIds: string[], options?: EntityDeleteOptions): Promise<EntityDeleteResponse>;
849
+ }
850
+ /**
851
+ * Entity methods interface - defines operations that can be performed on an entity
852
+ */
853
+ interface EntityMethods {
854
+ /**
855
+ * Insert data into this entity
856
+ *
857
+ * @param data - Array of records to insert
858
+ * @param options - Insert options
859
+ * @returns Promise resolving to insert response
860
+ */
861
+ insert(data: Record<string, any>[], options?: EntityInsertOptions): Promise<EntityInsertResponse>;
862
+ /**
863
+ * Update data in this entity
864
+ *
865
+ * @param data - Array of records to update. Each record MUST contain the record Id,
866
+ * otherwise the update will fail.
867
+ * @param options - Update options
868
+ * @returns Promise resolving to update response
869
+ */
870
+ update(data: EntityRecord[], options?: EntityUpdateOptions): Promise<EntityUpdateResponse>;
871
+ /**
872
+ * Delete data from this entity
873
+ *
874
+ * @param recordIds - Array of record UUIDs to delete
875
+ * @param options - Delete options
876
+ * @returns Promise resolving to delete response
877
+ */
878
+ delete(recordIds: string[], options?: EntityDeleteOptions): Promise<EntityDeleteResponse>;
879
+ /**
880
+ * Get records from this entity
881
+ *
882
+ * @param options - Query options
883
+ * @returns Promise resolving to query response
884
+ */
885
+ getRecords<T extends EntityGetRecordsByIdOptions = EntityGetRecordsByIdOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
886
+ }
887
+ /**
888
+ * Entity with methods combining metadata with operation methods
889
+ */
890
+ type EntityGetResponse = RawEntityGetResponse & EntityMethods;
891
+ /**
892
+ * Creates an actionable entity metadata by combining entity with operational methods
893
+ *
894
+ * @param entityData - Entity metadata
895
+ * @param service - The entity service instance
896
+ * @returns Entity metadata with added methods
897
+ */
898
+ declare function createEntityWithMethods(entityData: RawEntityGetResponse, service: EntityServiceModel): EntityGetResponse;
899
+
900
+ /**
901
+ * Service for interacting with the Data Fabric Entity API
902
+ */
903
+ declare class EntityService extends BaseService implements EntityServiceModel {
904
+ /**
905
+ * @hideconstructor
906
+ */
907
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
908
+ /**
909
+ * Gets entity metadata by entity ID with attached operation methods
910
+ *
911
+ * @param id - UUID of the entity
912
+ * @returns Promise resolving to entity metadata with schema information and operation methods
913
+ *
914
+ * @example
915
+ * ```typescript
916
+ * // Get entity metadata with methods
917
+ * const entity = await sdk.entities.getById("<entityId>");
918
+ *
919
+ * // Call operations directly on the entity
920
+ * const records = await entity.getRecords();
921
+ *
922
+ * const insertResult = await entity.insert([
923
+ * { name: "John", age: 30 }
924
+ * ]);
925
+ * ```
926
+ */
927
+ getById(id: string): Promise<EntityGetResponse>;
928
+ /**
929
+ * Orchestrates all field mapping transformations
930
+ *
931
+ * @param metadata - Entity metadata to transform
932
+ * @private
933
+ */
934
+ private applyFieldMappings;
935
+ /**
936
+ * Maps SQL field types to friendly EntityFieldTypes
937
+ *
938
+ * @param metadata - Entity metadata with fields
939
+ * @private
940
+ */
941
+ private mapFieldTypes;
942
+ /**
943
+ * Transforms nested reference objects in field metadata
944
+ */
945
+ private transformNestedReferences;
946
+ /**
947
+ * Maps external field names to consistent naming
948
+ *
949
+ * @param metadata - Entity metadata with externalFields
950
+ * @private
951
+ */
952
+ private mapExternalFields;
953
+ /**
954
+ * Gets entity records by entity ID
955
+ *
956
+ * @param entityId - UUID of the entity
957
+ * @param options - Query options including expansionLevel and pagination options
958
+ * @returns Promise resolving to an array of entity records or paginated response
959
+ *
960
+ * @example
961
+ * ```typescript
962
+ * // Basic usage (non-paginated)
963
+ * const records = await sdk.entities.getRecordsById(<entityId>);
964
+ *
965
+ * // With expansion level
966
+ * const records = await sdk.entities.getRecordsById(<entityId>, {
967
+ * expansionLevel: 1
968
+ * });
969
+ *
970
+ * // With pagination
971
+ * const paginatedResponse = await sdk.entities.getRecordsById(<entityId>, {
972
+ * pageSize: 50,
973
+ * expansionLevel: 1
974
+ * });
975
+ *
976
+ * // Navigate to next page
977
+ * const nextPage = await sdk.entities.getRecordsById(<entityId>, {
978
+ * cursor: paginatedResponse.nextCursor,
979
+ * expansionLevel: 1
980
+ * });
981
+ * ```
982
+ */
983
+ getRecordsById<T extends EntityGetRecordsByIdOptions = EntityGetRecordsByIdOptions>(entityId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
984
+ /**
985
+ * Inserts data into an entity by entity ID
986
+ *
987
+ * @param entityId - UUID of the entity
988
+ * @param data - Array of records to insert
989
+ * @param options - Insert options
990
+ * @returns Promise resolving to insert response
991
+ *
992
+ * @example
993
+ * ```typescript
994
+ * // Basic usage
995
+ * const result = await sdk.entities.insertById(<entityId>, [
996
+ * { name: "John", age: 30 },
997
+ * { name: "Jane", age: 25 }
998
+ * ]);
999
+ *
1000
+ * // With options
1001
+ * const result = await sdk.entities.insertById(<entityId>, [
1002
+ * { name: "John", age: 30 },
1003
+ * { name: "Jane", age: 25 }
1004
+ * ], {
1005
+ * expansionLevel: 1,
1006
+ * failOnFirst: true
1007
+ * });
1008
+ * ```
1009
+ */
1010
+ insertById(id: string, data: Record<string, any>[], options?: EntityInsertOptions): Promise<EntityInsertResponse>;
1011
+ /**
1012
+ * Updates data in an entity by entity ID
1013
+ *
1014
+ * @param entityId - UUID of the entity
1015
+ * @param data - Array of records to update. Each record MUST contain the record Id,
1016
+ * otherwise the update will fail.
1017
+ * @param options - Update options
1018
+ * @returns Promise resolving to update response
1019
+ *
1020
+ * @example
1021
+ * ```typescript
1022
+ * // Basic usage
1023
+ * const result = await sdk.entities.updateById(<entityId>, [
1024
+ * { Id: "123", name: "John Updated", age: 31 },
1025
+ * { Id: "456", name: "Jane Updated", age: 26 }
1026
+ * ]);
1027
+ *
1028
+ * // With options
1029
+ * const result = await sdk.entities.updateById(<entityId>, [
1030
+ * { Id: "123", name: "John Updated", age: 31 },
1031
+ * { Id: "456", name: "Jane Updated", age: 26 }
1032
+ * ], {
1033
+ * expansionLevel: 1,
1034
+ * failOnFirst: true
1035
+ * });
1036
+ * ```
1037
+ */
1038
+ updateById(id: string, data: EntityRecord[], options?: EntityUpdateOptions): Promise<EntityUpdateResponse>;
1039
+ /**
1040
+ * Deletes data from an entity by entity ID
1041
+ *
1042
+ * @param entityId - UUID of the entity
1043
+ * @param recordIds - Array of record UUIDs to delete
1044
+ * @param options - Delete options
1045
+ * @returns Promise resolving to delete response
1046
+ *
1047
+ * @example
1048
+ * ```typescript
1049
+ * // Basic usage
1050
+ * const result = await sdk.entities.deleteById(<entityId>, [
1051
+ * <recordId-1>, <recordId-2>
1052
+ * ]);
1053
+ * ```
1054
+ */
1055
+ deleteById(id: string, recordIds: string[], options?: EntityDeleteOptions): Promise<EntityDeleteResponse>;
1056
+ /**
1057
+ * Gets all entities in the system
1058
+ *
1059
+ * @returns Promise resolving to an array of entity metadata
1060
+ *
1061
+ * @example
1062
+ * ```typescript
1063
+ * // Get all entities
1064
+ * const entities = await sdk.entities.getAll();
1065
+ *
1066
+ * // Call operations on an entity
1067
+ * const records = await entities[0].getRecords();
1068
+ * ```
1069
+ */
1070
+ getAll(): Promise<EntityGetResponse[]>;
1071
+ }
1072
+
1073
+ /**
1074
+ * Maestro Process Types
1075
+ * Types and interfaces for Maestro process management
1076
+ */
1077
+ /**
1078
+ * Process information with instance statistics
1079
+ */
1080
+ interface MaestroProcessGetAllResponse {
1081
+ /** Unique key identifying the process */
1082
+ processKey: string;
1083
+ /** Package identifier */
1084
+ packageId: string;
1085
+ /** Process name */
1086
+ name: string;
1087
+ /** Folder key where process is located */
1088
+ folderKey: string;
1089
+ /** Folder name */
1090
+ folderName: string;
1091
+ /** Available package versions */
1092
+ packageVersions: string[];
1093
+ /** Total number of versions */
1094
+ versionCount: number;
1095
+ /** Process instance count - pending */
1096
+ pendingCount: number;
1097
+ /** Process instance count - running */
1098
+ runningCount: number;
1099
+ /** Process instance count - completed */
1100
+ completedCount: number;
1101
+ /** Process instance count - paused */
1102
+ pausedCount: number;
1103
+ /** Process instance count - cancelled */
1104
+ cancelledCount: number;
1105
+ /** Process instance count - faulted */
1106
+ faultedCount: number;
1107
+ /** Process instance count - retrying */
1108
+ retryingCount: number;
1109
+ /** Process instance count - resuming */
1110
+ resumingCount: number;
1111
+ /** Process instance count - pausing */
1112
+ pausingCount: number;
1113
+ /** Process instance count - canceling */
1114
+ cancelingCount: number;
1115
+ }
1116
+
1117
+ /**
1118
+ * Maestro Process Models
1119
+ * Model classes for Maestro processes
1120
+ */
1121
+
1122
+ /**
1123
+ * Service for managing UiPath Maestro Processes
1124
+ *
1125
+ * UiPath Maestro is a cloud-native orchestration layer that coordinates bots, AI agents, and humans for seamless, intelligent automation of complex workflows. [UiPath Maestro Guide](https://docs.uipath.com/maestro/automation-cloud/latest/user-guide/introduction-to-maestro)
1126
+ */
1127
+ interface MaestroProcessesServiceModel {
1128
+ /**
1129
+ * @returns Promise resolving to array of MaestroProcess objects
1130
+ * {@link MaestroProcessGetAllResponse}
1131
+ * @example
1132
+ * ```typescript
1133
+ * // Get all processes
1134
+ * const processes = await sdk.maestro.processes.getAll();
1135
+ *
1136
+ * // Access process information
1137
+ * for (const process of processes) {
1138
+ * console.log(`Process: ${process.processKey}`);
1139
+ * console.log(`Running instances: ${process.runningCount}`);
1140
+ * console.log(`Faulted instances: ${process.faultedCount}`);
1141
+ * }
1142
+ *
1143
+ * ```
1144
+ */
1145
+ getAll(): Promise<MaestroProcessGetAllResponse[]>;
1146
+ }
1147
+
1148
+ /**
1149
+ * Constants used throughout the pagination system
1150
+ */
1151
+ /** Maximum number of items that can be requested in a single page */
1152
+ declare const MAX_PAGE_SIZE = 1000;
1153
+ /** Default page size when jumpToPage is used without specifying pageSize */
1154
+ declare const DEFAULT_PAGE_SIZE = 50;
1155
+ /** Default field name for items in a paginated response */
1156
+ declare const DEFAULT_ITEMS_FIELD = "value";
1157
+ /** Default field name for total count in a paginated response */
1158
+ declare const DEFAULT_TOTAL_COUNT_FIELD = "@odata.count";
1159
+ /**
1160
+ * Limits the page size to the maximum allowed value
1161
+ * @param pageSize - Requested page size
1162
+ * @returns Limited page size value
1163
+ */
1164
+ declare function getLimitedPageSize(pageSize?: number): number;
1165
+
1166
+ /**
1167
+ * Process Instance Types
1168
+ * Types and interfaces for Maestro process instance management
1169
+ */
1170
+
1171
+ /**
1172
+ * Response for getting a single process instance
1173
+ */
1174
+ interface RawProcessInstanceGetResponse {
1175
+ instanceId: string;
1176
+ packageKey: string;
1177
+ packageId: string;
1178
+ packageVersion: string;
1179
+ latestRunId: string;
1180
+ latestRunStatus: string;
1181
+ processKey: string;
1182
+ folderKey: string;
1183
+ userId: number;
1184
+ instanceDisplayName: string;
1185
+ startedByUser: string;
1186
+ source: string;
1187
+ creatorUserKey: string;
1188
+ startedTime: string;
1189
+ completedTime: string | null;
1190
+ instanceRuns: ProcessInstanceRun[];
1191
+ }
1192
+ /**
1193
+ * Query options for getting process instances
1194
+ */
1195
+ interface ProcessInstanceGetAllOptions {
1196
+ packageId?: string;
1197
+ packageVersion?: string;
1198
+ processKey?: string;
1199
+ errorCode?: string;
1200
+ }
1201
+ /**
1202
+ * Query options for getting process instances with pagination support
1203
+ */
1204
+ type ProcessInstanceGetAllWithPaginationOptions = ProcessInstanceGetAllOptions & PaginationOptions;
1205
+ /**
1206
+ * Request for process instance operations (cancel, pause, resume)
1207
+ */
1208
+ interface ProcessInstanceOperationOptions {
1209
+ comment?: string;
1210
+ }
1211
+ /**
1212
+ * Response from PIMS operations (cancel, pause, resume)
1213
+ */
1214
+ interface ProcessInstanceOperationResponse {
1215
+ instanceId: string;
1216
+ status: string;
1217
+ }
1218
+ /**
1219
+ * Response for process instance execution history
1220
+ */
1221
+ interface ProcessInstanceExecutionHistoryResponse {
1222
+ id: string;
1223
+ traceId: string;
1224
+ parentId: string | null;
1225
+ name: string;
1226
+ startedTime: string;
1227
+ endTime: string | null;
1228
+ attributes: string | null;
1229
+ createdTime: string;
1230
+ updatedTime?: string;
1231
+ expiredTime: string | null;
1232
+ }
1233
+ /**
1234
+ * Process Instance run
1235
+ */
1236
+ interface ProcessInstanceRun {
1237
+ runId: string;
1238
+ status: string;
1239
+ startedTime: string;
1240
+ completedTime: string;
1241
+ }
1242
+ type BpmnXmlString = string;
1243
+ /**
1244
+ * Process Instance element metadata
1245
+ */
1246
+ interface ElementMetaData {
1247
+ elementId: string;
1248
+ elementRunId: string;
1249
+ isMarker: boolean;
1250
+ inputs: Record<string, any>;
1251
+ inputDefinitions: Record<string, any>;
1252
+ outputs: Record<string, any>;
1253
+ }
1254
+ /**
1255
+ * Process Instance global variable metadata
1256
+ */
1257
+ interface GlobalVariableMetaData {
1258
+ id: string;
1259
+ name: string;
1260
+ /**
1261
+ * Common values: "integer", "string", "boolean"
1262
+ * May also contain custom types or "any" when type cannot be determined
1263
+ */
1264
+ type: string;
1265
+ elementId: string;
1266
+ /** Name of the BPMN node/element */
1267
+ source: string;
1268
+ value: any;
1269
+ }
1270
+ /**
1271
+ * Response for getting global variables for process instance
1272
+ */
1273
+ interface ProcessInstanceGetVariablesResponse {
1274
+ elements: ElementMetaData[];
1275
+ globalVariables: GlobalVariableMetaData[];
1276
+ instanceId: string;
1277
+ parentElementId: string | null;
1278
+ }
1279
+ /**
1280
+ * Options for getting global variables
1281
+ */
1282
+ interface ProcessInstanceGetVariablesOptions {
1283
+ parentElementId?: string;
1284
+ }
1285
+
1286
+ interface CollectionResponse<T> {
1287
+ value: T[];
1288
+ }
1289
+ /**
1290
+ * Standardized result interface for all operation methods (pause, cancel, complete, update, upload, etc.)
1291
+ * Success responses include data from the request context or API response
1292
+ */
1293
+ interface OperationResponse<TData> {
1294
+ /**
1295
+ * Whether the operation was successful
1296
+ */
1297
+ success: boolean;
1298
+ /**
1299
+ * Response data (can contain error details in case of failure)
1300
+ */
1301
+ data: TData;
1302
+ }
1303
+ /**
1304
+ * Common enum for job state used across services
1305
+ */
1306
+ declare enum JobState {
1307
+ Pending = "Pending",
1308
+ Running = "Running",
1309
+ Stopping = "Stopping",
1310
+ Terminating = "Terminating",
1311
+ Faulted = "Faulted",
1312
+ Successful = "Successful",
1313
+ Stopped = "Stopped",
1314
+ Suspended = "Suspended",
1315
+ Resumed = "Resumed"
1316
+ }
1317
+ interface BaseOptions {
1318
+ expand?: string;
1319
+ select?: string;
1320
+ }
1321
+ /**
1322
+ * Common request options interface used across services for querying data
1323
+ */
1324
+ interface RequestOptions extends BaseOptions {
1325
+ filter?: string;
1326
+ orderby?: string;
1327
+ }
1328
+
1329
+ /**
1330
+ * Service for managing UiPath Maestro Process instances
1331
+ *
1332
+ * Maestro process instances are the running instances of Maestro processes. [UiPath Maestro Process Instances Guide](https://docs.uipath.com/maestro/automation-cloud/latest/user-guide/all-instances-view)
1333
+ */
1334
+ interface ProcessInstancesServiceModel {
1335
+ /**
1336
+ * Get all process instances with optional filtering and pagination
1337
+ *
1338
+ * The method returns either:
1339
+ * - A NonPaginatedResponse with items array (when no pagination parameters are provided)
1340
+ * - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
1341
+ *
1342
+ * @param options Query parameters for filtering instances and pagination
1343
+ * @returns Promise resolving to either an array of process instances NonPaginatedResponse<ProcessInstanceGetResponse> or a PaginatedResponse<ProcessInstanceGetResponse> when pagination options are used.
1344
+ * {@link ProcessInstanceGetResponse}
1345
+ * @example
1346
+ * ```typescript
1347
+ * // Get all instances (non-paginated)
1348
+ * const instances = await sdk.maestro.processes.instances.getAll();
1349
+ *
1350
+ * // Cancel faulted instances using methods directly on instances
1351
+ * for (const instance of instances.items) {
1352
+ * if (instance.latestRunStatus === 'Faulted') {
1353
+ * await instance.cancel({ comment: 'Cancelling faulted instance' });
1354
+ * }
1355
+ * }
1356
+ *
1357
+ * // With filtering
1358
+ * const instances = await sdk.maestro.processes.instances.getAll({
1359
+ * processKey: 'MyProcess'
1360
+ * });
1361
+ *
1362
+ * // First page with pagination
1363
+ * const page1 = await sdk.maestro.processes.instances.getAll({ pageSize: 10 });
1364
+ *
1365
+ * // Navigate using cursor
1366
+ * if (page1.hasNextPage) {
1367
+ * const page2 = await sdk.maestro.processes.instances.getAll({ cursor: page1.nextCursor });
1368
+ * }
1369
+ * ```
1370
+ */
1371
+ getAll<T extends ProcessInstanceGetAllWithPaginationOptions = ProcessInstanceGetAllWithPaginationOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessInstanceGetResponse> : NonPaginatedResponse<ProcessInstanceGetResponse>>;
1372
+ /**
1373
+ * Get a process instance by ID with operation methods (cancel, pause, resume)
1374
+ * @param id The ID of the instance to retrieve
1375
+ * @param folderKey The folder key for authorization
1376
+ * @returns Promise resolving to a process instance
1377
+ * {@link ProcessInstanceGetResponse}
1378
+ * @example
1379
+ * ```typescript
1380
+ * // Get a specific process instance
1381
+ * const instance = await sdk.maestro.processes.instances.getById(
1382
+ * <instanceId>,
1383
+ * <folderKey>
1384
+ * );
1385
+ *
1386
+ * // Access instance properties
1387
+ * console.log(`Status: ${instance.latestRunStatus}`);
1388
+ *
1389
+ * ```
1390
+ */
1391
+ getById(id: string, folderKey: string): Promise<ProcessInstanceGetResponse>;
1392
+ /**
1393
+ * Get execution history (spans) for a process instance
1394
+ * @param instanceId The ID of the instance to get history for
1395
+ * @returns Promise resolving to execution history
1396
+ * {@link ProcessInstanceExecutionHistoryResponse}
1397
+ * @example
1398
+ * ```typescript
1399
+ * // Get execution history for a process instance
1400
+ * const history = await sdk.maestro.processes.instances.getExecutionHistory(
1401
+ * <instanceId>
1402
+ * );
1403
+ *
1404
+ * // Analyze execution timeline
1405
+ * history.forEach(span => {
1406
+ * console.log(`Activity: ${span.name}`);
1407
+ * console.log(`Start: ${span.startTime}`);
1408
+ * console.log(`Duration: ${span.duration}ms`);
1409
+ * });
1410
+ *
1411
+ * ```
1412
+ */
1413
+ getExecutionHistory(instanceId: string): Promise<ProcessInstanceExecutionHistoryResponse[]>;
1414
+ /**
1415
+ * Get BPMN XML file for a process instance
1416
+ * @param instanceId The ID of the instance to get BPMN for
1417
+ * @param folderKey The folder key for authorization
1418
+ * @returns Promise resolving to BPMN XML file
1419
+ * {@link BpmnXmlString}
1420
+ * @example
1421
+ * ```typescript
1422
+ * // Get BPMN XML for a process instance
1423
+ * const bpmnXml = await sdk.maestro.processes.instances.getBpmn(
1424
+ * <instanceId>,
1425
+ * <folderKey>
1426
+ * );
1427
+ *
1428
+ * // Render BPMN diagram in frontend using bpmn-js
1429
+ * import BpmnViewer from 'bpmn-js/lib/Viewer';
1430
+ *
1431
+ * const viewer = new BpmnViewer({
1432
+ * container: '#bpmn-diagram'
1433
+ * });
1434
+ *
1435
+ * await viewer.importXML(bpmnXml);
1436
+ *
1437
+ * // Zoom to fit the diagram
1438
+ * viewer.get('canvas').zoom('fit-viewport');
1439
+ * ```
1440
+ */
1441
+ getBpmn(instanceId: string, folderKey: string): Promise<BpmnXmlString>;
1442
+ /**
1443
+ * Cancel a process instance
1444
+ * @param instanceId The ID of the instance to cancel
1445
+ * @param folderKey The folder key for authorization
1446
+ * @param options Optional cancellation options with comment
1447
+ * @returns Promise resolving to operation result with instance data
1448
+ * @example
1449
+ * ```typescript
1450
+ * // Cancel a process instance
1451
+ * const result = await sdk.maestro.processes.instances.cancel(
1452
+ * <instanceId>,
1453
+ * <folderKey>
1454
+ * );
1455
+ *
1456
+ * if (result.success) {
1457
+ * console.log(`Instance ${result.data.instanceId} now has status: ${result.data.status}`);
1458
+ * }
1459
+ *
1460
+ * // Cancel with a comment
1461
+ * const result = await sdk.maestro.processes.instances.cancel(
1462
+ * <instanceId>,
1463
+ * <folderKey>,
1464
+ * { comment: <comment> }
1465
+ * );
1466
+ *
1467
+ * // Cancel multiple faulted instances
1468
+ * const instances = await sdk.maestro.processes.instances.getAll({
1469
+ * latestRunStatus: "Faulted"
1470
+ * });
1471
+ *
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
+ * }
1482
+ * }
1483
+ * ```
1484
+ */
1485
+ cancel(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1486
+ /**
1487
+ * Pause a process instance
1488
+ * @param instanceId The ID of the instance to pause
1489
+ * @param folderKey The folder key for authorization
1490
+ * @param options Optional pause options with comment
1491
+ * @returns Promise resolving to operation result with instance data
1492
+ */
1493
+ pause(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1494
+ /**
1495
+ * Resume a process instance
1496
+ * @param instanceId The ID of the instance to resume
1497
+ * @param folderKey The folder key for authorization
1498
+ * @param options Optional resume options with comment
1499
+ * @returns Promise resolving to operation result with instance data
1500
+ */
1501
+ resume(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1502
+ /**
1503
+ * Get global variables for a process instance
1504
+ *
1505
+ * @param instanceId The ID of the instance to get variables for
1506
+ * @param folderKey The folder key for authorization
1507
+ * @param options Optional options including parentElementId to filter by parent element
1508
+ * @returns Promise resolving to variables response with elements and globals
1509
+ * {@link ProcessInstanceGetVariablesResponse}
1510
+ * @example
1511
+ * ```typescript
1512
+ * // Get all variables for a process instance
1513
+ * const variables = await sdk.maestro.processes.instances.getVariables(
1514
+ * <instanceId>,
1515
+ * <folderKey>
1516
+ * );
1517
+ *
1518
+ * // Access global variables
1519
+ * console.log('Global variables:', variables.globalVariables);
1520
+ *
1521
+ * // Iterate through global variables with metadata
1522
+ * variables.globalVariables?.forEach(variable => {
1523
+ * console.log(`Variable: ${variable.name} (${variable.id})`);
1524
+ * console.log(` Type: ${variable.type}`);
1525
+ * console.log(` Element: ${variable.elementId}`);
1526
+ * console.log(` Value: ${variable.value}`);
1527
+ * });
1528
+ *
1529
+ * // Get variables for a specific parent element
1530
+ * const variables = await sdk.maestro.processes.instances.getVariables(
1531
+ * <instanceId>,
1532
+ * <folderKey>,
1533
+ * { parentElementId: <parentElementId> }
1534
+ * );
1535
+ * ```
1536
+ */
1537
+ getVariables(instanceId: string, folderKey: string, options?: ProcessInstanceGetVariablesOptions): Promise<ProcessInstanceGetVariablesResponse>;
1538
+ }
1539
+ interface ProcessInstanceMethods {
1540
+ /**
1541
+ * Cancels this process instance
1542
+ *
1543
+ * @param options - Optional cancellation options with comment
1544
+ * @returns Promise resolving to operation result
1545
+ */
1546
+ cancel(options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1547
+ /**
1548
+ * Pauses this process instance
1549
+ *
1550
+ * @param options - Optional pause options with comment
1551
+ * @returns Promise resolving to operation result
1552
+ */
1553
+ pause(options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1554
+ /**
1555
+ * Resumes this process instance
1556
+ *
1557
+ * @param options - Optional resume options with comment
1558
+ * @returns Promise resolving to operation result
1559
+ */
1560
+ resume(options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1561
+ }
1562
+ type ProcessInstanceGetResponse = RawProcessInstanceGetResponse & ProcessInstanceMethods;
1563
+ /**
1564
+ * Creates an actionable process instance by combining API process instance data with operational methods.
1565
+ *
1566
+ * @param instanceData - The process instance data from API
1567
+ * @param service - The process instance service instance
1568
+ * @returns A process instance object with added methods
1569
+ */
1570
+ declare function createProcessInstanceWithMethods(instanceData: RawProcessInstanceGetResponse, service: ProcessInstancesServiceModel): ProcessInstanceGetResponse;
1571
+
1572
+ /**
1573
+ * Maestro Cases Types
1574
+ * Types and interfaces for Maestro case management
1575
+ */
1576
+ /**
1577
+ * Case information with instance statistics
1578
+ */
1579
+ interface CaseGetAllResponse {
1580
+ /** Unique key identifying the case process */
1581
+ processKey: string;
1582
+ /** Package identifier */
1583
+ packageId: string;
1584
+ /** Case name */
1585
+ name: string;
1586
+ /** Folder key of the folder where case process is located */
1587
+ folderKey: string;
1588
+ /** Name of the folder where case process is located */
1589
+ folderName: string;
1590
+ /** Available package versions */
1591
+ packageVersions: string[];
1592
+ /** Total number of versions */
1593
+ versionCount: number;
1594
+ /** Case instance count - pending */
1595
+ pendingCount: number;
1596
+ /** Case instance count - running */
1597
+ runningCount: number;
1598
+ /** Case instance count - completed */
1599
+ completedCount: number;
1600
+ /** Case instance count - paused */
1601
+ pausedCount: number;
1602
+ /** Case instance count - cancelled */
1603
+ cancelledCount: number;
1604
+ /** Case instance count - faulted */
1605
+ faultedCount: number;
1606
+ /** Case instance count - retrying */
1607
+ retryingCount: number;
1608
+ /** Case instance count - resuming */
1609
+ resumingCount: number;
1610
+ /** Case instance count - pausing */
1611
+ pausingCount: number;
1612
+ /** Case instance count - canceling */
1613
+ cancelingCount: number;
1614
+ }
1615
+
1616
+ /**
1617
+ * Maestro Cases Models
1618
+ * Model classes for Maestro cases
1619
+ */
1620
+
1621
+ /**
1622
+ * Service for managing UiPath Maestro Cases
1623
+ *
1624
+ * UiPath Maestro Case Management describes solutions that help manage and automate the full flow of complex E2E scenarios.
1625
+ */
1626
+ interface CasesServiceModel {
1627
+ /**
1628
+ * @returns Promise resolving to array of Case objects
1629
+ * {@link CaseGetAllResponse}
1630
+ * @example
1631
+ * ```typescript
1632
+ * // Get all case management processes
1633
+ * const cases = await sdk.maestro.cases.getAll();
1634
+ *
1635
+ * // Access case information
1636
+ * for (const caseProcess of cases) {
1637
+ * console.log(`Case Process: ${caseProcess.processKey}`);
1638
+ * console.log(`Running instances: ${caseProcess.runningCount}`);
1639
+ * console.log(`Completed instances: ${caseProcess.completedCount}`);
1640
+ * }
1641
+ *
1642
+ * ```
1643
+ */
1644
+ getAll(): Promise<CaseGetAllResponse[]>;
1645
+ }
1646
+
1647
+ /**
1648
+ * Case Instance Types
1649
+ * Types and interfaces for Maestro case instance management
1650
+ */
1651
+
1652
+ /**
1653
+ * Response for getting a single case instance
1654
+ */
1655
+ interface RawCaseInstanceGetResponse {
1656
+ instanceId: string;
1657
+ packageKey: string;
1658
+ packageId: string;
1659
+ packageVersion: string;
1660
+ latestRunId: string;
1661
+ latestRunStatus: string;
1662
+ processKey: string;
1663
+ folderKey: string;
1664
+ userId: number;
1665
+ instanceDisplayName: string;
1666
+ startedByUser: string;
1667
+ source: string;
1668
+ creatorUserKey: string;
1669
+ startedTime: string;
1670
+ completedTime: string;
1671
+ instanceRuns: CaseInstanceRun[];
1672
+ caseAppConfig?: CaseAppConfig;
1673
+ caseType?: string;
1674
+ caseTitle?: string;
1675
+ }
1676
+ /**
1677
+ * Case instance run information
1678
+ */
1679
+ interface CaseInstanceRun {
1680
+ runId: string;
1681
+ status: string;
1682
+ startedTime: string;
1683
+ completedTime: string;
1684
+ }
1685
+ /**
1686
+ * Query options for getting case instances
1687
+ */
1688
+ interface CaseInstanceGetAllOptions {
1689
+ packageId?: string;
1690
+ packageVersion?: string;
1691
+ processKey?: string;
1692
+ errorCode?: string;
1693
+ }
1694
+ /**
1695
+ * Query options for getting case instances with pagination support
1696
+ */
1697
+ type CaseInstanceGetAllWithPaginationOptions = CaseInstanceGetAllOptions & PaginationOptions;
1698
+ /**
1699
+ * Request for case instance operations (close, pause, resume)
1700
+ */
1701
+ interface CaseInstanceOperationOptions {
1702
+ comment?: string;
1703
+ }
1704
+ /**
1705
+ * Response for case instance operations (close, pause, resume)
1706
+ */
1707
+ interface CaseInstanceOperationResponse {
1708
+ instanceId: string;
1709
+ status: string;
1710
+ }
1711
+ /**
1712
+ * Case App Configuration Overview
1713
+ */
1714
+ interface CaseAppOverview {
1715
+ title: string;
1716
+ details: string;
1717
+ }
1718
+ /**
1719
+ * Case App Configuration from case JSON
1720
+ */
1721
+ interface CaseAppConfig {
1722
+ caseSummary?: string;
1723
+ overview?: CaseAppOverview[];
1724
+ }
1725
+ /**
1726
+ * Case stage task type
1727
+ */
1728
+ declare enum StageTaskType {
1729
+ EXTERNAL_AGENT = "external-agent",
1730
+ RPA = "rpa",
1731
+ AGENTIC_PROCESS = "process",
1732
+ AGENT = "agent",
1733
+ ACTION = "action",
1734
+ API_WORKFLOW = "api-workflow"
1735
+ }
1736
+ /**
1737
+ * Stage task information
1738
+ */
1739
+ interface StageTask {
1740
+ id: string;
1741
+ name: string;
1742
+ completedTime: string;
1743
+ startedTime: string;
1744
+ status: string;
1745
+ type: StageTaskType;
1746
+ }
1747
+ /**
1748
+ * Escalation recipient scope
1749
+ */
1750
+ declare enum EscalationRecipientScope {
1751
+ USER = "user",
1752
+ USER_GROUP = "usergroup"
1753
+ }
1754
+ /**
1755
+ * Escalation rule recipient information
1756
+ */
1757
+ interface EscalationRecipient {
1758
+ /** Type of recipient (user or usergroup) */
1759
+ scope: EscalationRecipientScope;
1760
+ /** Identifier for a user/usergroup */
1761
+ target: string;
1762
+ /** The email id of the user/usergroup */
1763
+ value: string;
1764
+ }
1765
+ /**
1766
+ * Escalation action type
1767
+ */
1768
+ declare enum EscalationActionType {
1769
+ NOTIFICATION = "notification"
1770
+ }
1771
+ /**
1772
+ * Escalation rule action configuration
1773
+ */
1774
+ interface EscalationAction {
1775
+ type: EscalationActionType;
1776
+ recipients: EscalationRecipient[];
1777
+ }
1778
+ /**
1779
+ * Escalation rule trigger type
1780
+ */
1781
+ declare enum EscalationTriggerType {
1782
+ SLA_BREACHED = "sla-breached",
1783
+ AT_RISK = "at-risk"
1784
+ }
1785
+ /**
1786
+ * Escalation rule trigger metadata
1787
+ */
1788
+ interface EscalationTriggerMetadata {
1789
+ type?: EscalationTriggerType;
1790
+ atRiskPercentage?: number;
1791
+ }
1792
+ /**
1793
+ * Escalation rule configuration
1794
+ */
1795
+ interface EscalationRule {
1796
+ triggerInfo: EscalationTriggerMetadata;
1797
+ action?: EscalationAction;
1798
+ }
1799
+ /**
1800
+ * SLA duration unit
1801
+ */
1802
+ declare enum SLADurationUnit {
1803
+ HOURS = "h",
1804
+ DAYS = "d",
1805
+ WEEKS = "w",
1806
+ MONTHS = "m"
1807
+ }
1808
+ /**
1809
+ * SLA configuration for stages
1810
+ */
1811
+ interface StageSLA {
1812
+ length?: number;
1813
+ duration?: SLADurationUnit;
1814
+ escalationRule?: EscalationRule[];
1815
+ }
1816
+ /**
1817
+ * Stage information from case instances
1818
+ */
1819
+ interface CaseGetStageResponse {
1820
+ id: string;
1821
+ name: string;
1822
+ sla?: StageSLA;
1823
+ status: string;
1824
+ tasks: StageTask[][];
1825
+ }
1826
+ /**
1827
+ * Case element execution metadata
1828
+ */
1829
+ interface ElementExecutionMetadata {
1830
+ completedTime: string | null;
1831
+ elementId: string;
1832
+ elementName: string;
1833
+ parentElementId: string | null;
1834
+ startedTime: string;
1835
+ /** Element status (e.g., "Completed", "Faulted", "Running") */
1836
+ status: string;
1837
+ processKey: string;
1838
+ /** External reference link, eg link to the HITL task in Action Center */
1839
+ externalLink: string;
1840
+ /** List of element runs for the element */
1841
+ elementRuns: ElementRunMetadata[];
1842
+ }
1843
+ /**
1844
+ * Response for getting case instance element executions
1845
+ */
1846
+ interface CaseInstanceExecutionHistoryResponse {
1847
+ creationUserKey: string | null;
1848
+ folderKey: string;
1849
+ instanceDisplayName: string;
1850
+ instanceId: string;
1851
+ packageId: string;
1852
+ packageKey: string;
1853
+ packageVersion: string;
1854
+ processKey: string;
1855
+ source: string;
1856
+ /** Element status (e.g., "Completed", "Faulted", "Running", "Pausing", "Canceling") */
1857
+ status: string;
1858
+ startedTime: string;
1859
+ completedTime: string | null;
1860
+ elementExecutions: ElementExecutionMetadata[];
1861
+ }
1862
+ /**
1863
+ * Element run metadata
1864
+ */
1865
+ interface ElementRunMetadata {
1866
+ status: string;
1867
+ startedTime: string;
1868
+ completedTime: string | null;
1869
+ elementRunId: string;
1870
+ parentElementRunId: string | null;
1871
+ }
1872
+
1873
+ interface UserLoginInfo {
1874
+ name: string;
1875
+ surname: string;
1876
+ userName: string;
1877
+ emailAddress: string;
1878
+ displayName: string;
1879
+ id: number;
1880
+ }
1881
+ declare enum TaskType {
1882
+ Form = "FormTask",
1883
+ External = "ExternalTask",
1884
+ App = "AppTask"
1885
+ }
1886
+ declare enum TaskPriority {
1887
+ Low = "Low",
1888
+ Medium = "Medium",
1889
+ High = "High",
1890
+ Critical = "Critical"
1891
+ }
1892
+ declare enum TaskStatus {
1893
+ Unassigned = "Unassigned",
1894
+ Pending = "Pending",
1895
+ Completed = "Completed"
1896
+ }
1897
+ declare enum TaskSlaCriteria {
1898
+ TaskCreated = "TaskCreated",
1899
+ TaskAssigned = "TaskAssigned",
1900
+ TaskCompleted = "TaskCompleted"
1901
+ }
1902
+ declare enum TaskSlaStatus {
1903
+ OverdueLater = "OverdueLater",
1904
+ OverdueSoon = "OverdueSoon",
1905
+ Overdue = "Overdue",
1906
+ CompletedInTime = "CompletedInTime"
1907
+ }
1908
+ declare enum TaskSourceName {
1909
+ Agent = "Agent",
1910
+ Workflow = "Workflow",
1911
+ Maestro = "Maestro",
1912
+ Default = "Default"
1913
+ }
1914
+ interface TaskSource {
1915
+ sourceName: TaskSourceName;
1916
+ sourceId: string;
1917
+ taskSourceMetadata: Record<string, unknown>;
1918
+ }
1919
+ /**
1920
+ * Task activity types
1921
+ */
1922
+ declare enum TaskActivityType {
1923
+ Created = "Created",
1924
+ Assigned = "Assigned",
1925
+ Reassigned = "Reassigned",
1926
+ Unassigned = "Unassigned",
1927
+ Saved = "Saved",
1928
+ Forwarded = "Forwarded",
1929
+ Completed = "Completed",
1930
+ Commented = "Commented",
1931
+ Deleted = "Deleted",
1932
+ BulkSaved = "BulkSaved",
1933
+ BulkCompleted = "BulkCompleted",
1934
+ FirstOpened = "FirstOpened"
1935
+ }
1936
+ /**
1937
+ * Tag information for tasks
1938
+ */
1939
+ interface Tag {
1940
+ name: string;
1941
+ displayName: string;
1942
+ displayValue: string;
1943
+ }
1944
+ /**
1945
+ * Task activity information
1946
+ */
1947
+ interface TaskActivity {
1948
+ task?: RawTaskGetResponse;
1949
+ organizationUnitId: number;
1950
+ taskId: number;
1951
+ taskKey: string;
1952
+ activityType: TaskActivityType;
1953
+ creatorUserId: number;
1954
+ targetUserId: number | null;
1955
+ creationTime: string;
1956
+ }
1957
+ interface TaskSlaDetail {
1958
+ expiryTime?: string;
1959
+ startCriteria?: TaskSlaCriteria;
1960
+ endCriteria?: TaskSlaCriteria;
1961
+ status?: TaskSlaStatus;
1962
+ }
1963
+ interface TaskAssignment {
1964
+ assignee?: UserLoginInfo;
1965
+ task?: RawTaskGetResponse;
1966
+ id?: number;
1967
+ }
1968
+ /**
1969
+ * Base interface containing common fields shared across all task response types
1970
+ */
1971
+ interface TaskBaseResponse {
1972
+ status: TaskStatus;
1973
+ title: string;
1974
+ type: TaskType;
1975
+ priority: TaskPriority;
1976
+ organizationUnitId: number;
1977
+ key: string;
1978
+ isDeleted: boolean;
1979
+ creationTime: string;
1980
+ creatorUserId: number;
1981
+ id: number;
1982
+ action: string | null;
1983
+ assignedToUserId: number | null;
1984
+ externalTag: string | null;
1985
+ lastAssignedTime: string | null;
1986
+ completionTime: string | null;
1987
+ parentOperationId: string | null;
1988
+ deleterUserId: number | null;
1989
+ deletionTime: string | null;
1990
+ lastModificationTime: string | null;
1991
+ }
1992
+ interface TaskCreateOptions {
1993
+ title: string;
1994
+ priority?: TaskPriority;
1995
+ }
1996
+ interface RawTaskCreateResponse extends TaskBaseResponse {
1997
+ waitJobState: JobState | null;
1998
+ assignedToUser: UserLoginInfo | null;
1999
+ taskSlaDetails: TaskSlaDetail[] | null;
2000
+ completedByUser: UserLoginInfo | null;
2001
+ taskAssignees: UserLoginInfo[] | null;
2002
+ processingTime: number | null;
2003
+ data: Record<string, unknown> | null;
2004
+ }
2005
+ interface RawTaskGetResponse extends TaskBaseResponse {
2006
+ isCompleted: boolean;
2007
+ encrypted: boolean;
2008
+ bulkFormLayoutId: number | null;
2009
+ formLayoutId: number | null;
2010
+ taskSlaDetail: TaskSlaDetail | null;
2011
+ taskAssigneeName: string | null;
2012
+ lastModifierUserId: number | null;
2013
+ assignedToUser?: UserLoginInfo;
2014
+ creatorUser?: UserLoginInfo;
2015
+ lastModifierUser?: UserLoginInfo;
2016
+ taskAssignments?: TaskAssignment[];
2017
+ activities?: TaskActivity[];
2018
+ tags?: Tag[];
2019
+ formLayout?: Record<string, unknown>;
2020
+ actionLabel?: string | null;
2021
+ taskSlaDetails?: TaskSlaDetail[] | null;
2022
+ completedByUser?: UserLoginInfo | null;
2023
+ taskAssignmentCriteria?: string;
2024
+ taskAssignees?: UserLoginInfo[] | null;
2025
+ taskSource?: TaskSource | null;
2026
+ processingTime?: number | null;
2027
+ data?: Record<string, unknown> | null;
2028
+ }
2029
+ interface TaskAssignmentOptions {
2030
+ taskId: number;
2031
+ userId: number;
2032
+ userNameOrEmail?: string;
2033
+ }
2034
+ interface TasksUnassignOptions {
2035
+ taskIds: number[];
2036
+ }
2037
+ interface TaskAssignmentResponse {
2038
+ taskId?: number;
2039
+ userId?: number;
2040
+ errorCode?: number;
2041
+ errorMessage?: string;
2042
+ userNameOrEmail?: string;
2043
+ }
2044
+ interface TaskCompletionOptions {
2045
+ taskId: number;
2046
+ data?: any;
2047
+ action?: string;
2048
+ }
2049
+ /**
2050
+ * Options for task assignment operations in the Task class
2051
+ * At least one identification parameter is required
2052
+ */
2053
+ type TaskAssignOptions = {
2054
+ userId: number;
2055
+ userNameOrEmail?: string;
2056
+ } | {
2057
+ userId?: number;
2058
+ userNameOrEmail: string;
2059
+ };
2060
+ /**
2061
+ * Options for completing a task
2062
+ */
2063
+ type TaskCompleteOptions = {
2064
+ type: TaskType.External;
2065
+ data?: any;
2066
+ action?: string;
2067
+ } | {
2068
+ type: Exclude<TaskType, TaskType.External>;
2069
+ data: any;
2070
+ action: string;
2071
+ };
2072
+ /**
2073
+ * Options for getting tasks across folders
2074
+ */
2075
+ type TaskGetAllOptions = RequestOptions & PaginationOptions & {
2076
+ /**
2077
+ * Optional folder ID to filter tasks by folder
2078
+ */
2079
+ folderId?: number;
2080
+ };
2081
+ /**
2082
+ * Query options for getting a task by ID
2083
+ */
2084
+ type TaskGetByIdOptions = BaseOptions;
2085
+ /**
2086
+ * Options for getting users with task permissions
2087
+ */
2088
+ type TaskGetUsersOptions = RequestOptions & PaginationOptions;
2089
+
2090
+ /**
2091
+ * Service for managing UiPath Action Center
2092
+ *
2093
+ * 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)
2094
+ *
2095
+ */
2096
+ interface TaskServiceModel {
2097
+ /**
2098
+ * Gets all tasks across folders with optional filtering
2099
+ *
2100
+ * @param options - Query options including optional folderId and pagination options
2101
+ * @returns Promise resolving to either an array of tasks NonPaginatedResponse<TaskGetResponse> or a PaginatedResponse<TaskGetResponse> when pagination options are used.
2102
+ * {@link TaskGetResponse}
2103
+ */
2104
+ getAll<T extends TaskGetAllOptions = TaskGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<TaskGetResponse> : NonPaginatedResponse<TaskGetResponse>>;
2105
+ getById(id: number, options?: TaskGetByIdOptions, folderId?: number): Promise<TaskGetResponse>;
2106
+ create(options: TaskCreateOptions, folderId: number): Promise<TaskCreateResponse>;
2107
+ assign(options: TaskAssignmentOptions | TaskAssignmentOptions[], folderId?: number): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
2108
+ reassign(options: TaskAssignmentOptions | TaskAssignmentOptions[], folderId?: number): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
2109
+ unassign(taskId: number | number[], folderId?: number): Promise<OperationResponse<{
2110
+ taskId: number;
2111
+ }[] | TaskAssignmentResponse[]>>;
2112
+ complete(taskType: TaskType, options: TaskCompletionOptions, folderId: number): Promise<OperationResponse<TaskCompletionOptions>>;
2113
+ /**
2114
+ * Gets users in the given folder who have Tasks.View and Tasks.Edit permissions
2115
+ * Returns a NonPaginatedResponse with data and totalCount when no pagination parameters are provided,
2116
+ * or a PaginatedResponse when any pagination parameter is provided
2117
+ *
2118
+ * @param folderId - The folder ID to get users from
2119
+ * @param options - Optional query and pagination parameters
2120
+ * @returns Promise resolving to NonPaginatedResponse or a paginated result
2121
+ */
2122
+ getUsers<T extends TaskGetUsersOptions = TaskGetUsersOptions>(folderId: number, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<UserLoginInfo> : NonPaginatedResponse<UserLoginInfo>>;
2123
+ }
2124
+ interface TaskMethods {
2125
+ /**
2126
+ * Assigns this task to a user or users
2127
+ *
2128
+ * @param options - Assignment options (requires at least one of: userId, userNameOrEmail)
2129
+ * @returns Promise resolving to task assignment results
2130
+ */
2131
+ assign(options: TaskAssignOptions): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
2132
+ /**
2133
+ * Reassigns this task to a new user
2134
+ *
2135
+ * @param options - Assignment options (requires at least one of: userId, userNameOrEmail)
2136
+ * @returns Promise resolving to task assignment results
2137
+ */
2138
+ reassign(options: TaskAssignOptions): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
2139
+ /**
2140
+ * Unassigns this task (removes current assignee)
2141
+ *
2142
+ * @returns Promise resolving to task assignment results
2143
+ */
2144
+ unassign(): Promise<OperationResponse<{
2145
+ taskId: number;
2146
+ }[] | TaskAssignmentResponse[]>>;
2147
+ /**
2148
+ * Completes this task with optional data and action
2149
+ *
2150
+ * @param options - Completion options
2151
+ * @returns Promise resolving to completion result
2152
+ */
2153
+ complete(options: TaskCompleteOptions): Promise<OperationResponse<TaskCompletionOptions>>;
2154
+ }
2155
+ type TaskGetResponse = RawTaskGetResponse & TaskMethods;
2156
+ type TaskCreateResponse = RawTaskCreateResponse & TaskMethods;
2157
+ /**
2158
+ * Creates an actionable task by combining API task data with operational methods.
2159
+ *
2160
+ * @param taskData - The task data from API
2161
+ * @param service - The task service instance
2162
+ * @returns A task object with added methods
2163
+ */
2164
+ declare function createTaskWithMethods(taskData: RawTaskGetResponse | RawTaskCreateResponse, service: TaskServiceModel): TaskGetResponse | TaskCreateResponse;
2165
+
2166
+ /**
2167
+ * Service model for managing Maestro Case Instances
2168
+ *
2169
+ * Maestro case instances are the running instances of Maestro cases.
2170
+ */
2171
+ interface CaseInstancesServiceModel {
2172
+ /**
2173
+ * Get all case instances with optional filtering and pagination
2174
+ *
2175
+ * @param options Query parameters for filtering instances and pagination
2176
+ * @returns Promise resolving to either an array of case instances NonPaginatedResponse<CaseInstanceGetResponse> or a PaginatedResponse<CaseInstanceGetResponse> when pagination options are used.
2177
+ * {@link CaseInstanceGetResponse}
2178
+ * @example
2179
+ * ```typescript
2180
+ * // Get all case instances (non-paginated)
2181
+ * const instances = await sdk.maestro.cases.instances.getAll();
2182
+ *
2183
+ * // Cancel/Close faulted instances using methods directly on instances
2184
+ * for (const instance of instances.items) {
2185
+ * if (instance.latestRunStatus === 'Faulted') {
2186
+ * await instance.close({ comment: 'Closing faulted case instance' });
2187
+ * }
2188
+ * }
2189
+ *
2190
+ * // With filtering
2191
+ * const instances = await sdk.maestro.cases.instances.getAll({
2192
+ * processKey: 'MyCaseProcess'
2193
+ * });
2194
+ *
2195
+ * // First page with pagination
2196
+ * const page1 = await sdk.maestro.cases.instances.getAll({ pageSize: 10 });
2197
+ *
2198
+ * // Navigate using cursor
2199
+ * if (page1.hasNextPage) {
2200
+ * const page2 = await sdk.maestro.cases.instances.getAll({ cursor: page1.nextCursor });
2201
+ * }
2202
+ * ```
2203
+ */
2204
+ getAll<T extends CaseInstanceGetAllWithPaginationOptions = CaseInstanceGetAllWithPaginationOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<CaseInstanceGetResponse> : NonPaginatedResponse<CaseInstanceGetResponse>>;
2205
+ /**
2206
+ * Get a specific case instance by ID
2207
+ * @param instanceId - The case instance ID
2208
+ * @param folderKey - Required folder key
2209
+ * @returns Promise resolving to case instance with methods
2210
+ * {@link CaseInstanceGetResponse}
2211
+ * @example
2212
+ * ```typescript
2213
+ * // Get a specific case instance
2214
+ * const instance = await sdk.maestro.cases.instances.getById(
2215
+ * <instanceId>,
2216
+ * <folderKey>
2217
+ * );
2218
+ *
2219
+ * // Access instance properties
2220
+ * console.log(`Status: ${instance.latestRunStatus}`);
2221
+ *
2222
+ * ```
2223
+ */
2224
+ getById(instanceId: string, folderKey: string): Promise<CaseInstanceGetResponse>;
2225
+ /**
2226
+ * Close/Cancel a case instance
2227
+ * @param instanceId - The ID of the instance to cancel
2228
+ * @param folderKey - Required folder key
2229
+ * @param options - Optional close options with comment
2230
+ * @returns Promise resolving to operation result with instance data
2231
+ * @example
2232
+ * ```typescript
2233
+ * // Close a case instance
2234
+ * const result = await sdk.maestro.cases.instances.close(
2235
+ * <instanceId>,
2236
+ * <folderKey>
2237
+ * );
2238
+ *
2239
+ * if (result.success) {
2240
+ * console.log(`Instance ${result.data.instanceId} now has status: ${result.data.status}`);
2241
+ * }
2242
+ *
2243
+ * // Close with a comment
2244
+ * const result = await sdk.maestro.cases.instances.close(
2245
+ * <instanceId>,
2246
+ * <folderKey>,
2247
+ * { comment: <comment> }
2248
+ * );
2249
+ *
2250
+ * // Close multiple faulted instances
2251
+ * const instances = await sdk.maestro.cases.instances.getAll({
2252
+ * latestRunStatus: "Faulted"
2253
+ * });
2254
+ *
2255
+ * for (const instance of instances.items) {
2256
+ * const result = await sdk.maestro.cases.instances.close(
2257
+ * instance.instanceId,
2258
+ * instance.folderKey,
2259
+ * { comment: <comment> }
2260
+ * );
2261
+ *
2262
+ * if (result.success) {
2263
+ * console.log(`Closed instance: ${result.data.instanceId}`);
2264
+ * }
2265
+ * }
2266
+ * ```
2267
+ */
2268
+ close(instanceId: string, folderKey: string, options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2269
+ /**
2270
+ * Pause a case instance
2271
+ * @param instanceId - The ID of the instance to pause
2272
+ * @param folderKey - Required folder key
2273
+ * @param options - Optional pause options with comment
2274
+ * @returns Promise resolving to operation result with instance data
2275
+ */
2276
+ pause(instanceId: string, folderKey: string, options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2277
+ /**
2278
+ * Resume a case instance
2279
+ * @param instanceId - The ID of the instance to resume
2280
+ * @param folderKey - Required folder key
2281
+ * @param options - Optional resume options with comment
2282
+ * @returns Promise resolving to operation result with instance data
2283
+ */
2284
+ resume(instanceId: string, folderKey: string, options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2285
+ /**
2286
+ * Get execution history for a case instance
2287
+ * @param instanceId - The ID of the case instance
2288
+ * @param folderKey - Required folder key
2289
+ * @returns Promise resolving to instance execution history
2290
+ * {@link CaseInstanceExecutionHistoryResponse}
2291
+ * @example
2292
+ * ```typescript
2293
+ * // Get execution history for a case instance
2294
+ * const history = await sdk.maestro.cases.instances.getExecutionHistory(
2295
+ * <instanceId>,
2296
+ * <folderKey>
2297
+ * );
2298
+ *
2299
+ * // Access element executions
2300
+ * if (history.elementExecutions) {
2301
+ * for (const execution of history.elementExecutions) {
2302
+ * console.log(`Element: ${execution.elementName} - Status: ${execution.status}`);
2303
+ * }
2304
+ * }
2305
+ * ```
2306
+ */
2307
+ getExecutionHistory(instanceId: string, folderKey: string): Promise<CaseInstanceExecutionHistoryResponse>;
2308
+ /**
2309
+ * Get stages and its associated tasks information for a case instance
2310
+ * @param caseInstanceId - The ID of the case instance
2311
+ * @param folderKey - Required folder key
2312
+ * @returns Promise resolving to an array of case stages with their tasks and status
2313
+ * @example
2314
+ * ```typescript
2315
+ * // Get stages for a case instance
2316
+ * const stages = await sdk.maestro.cases.instances.getStages(
2317
+ * <caseInstanceId>,
2318
+ * <folderKey>
2319
+ * );
2320
+ *
2321
+ * // Iterate through stages
2322
+ * for (const stage of stages) {
2323
+ * console.log(`Stage: ${stage.name} - Status: ${stage.status}`);
2324
+ *
2325
+ * // Check tasks in the stage
2326
+ * for (const taskGroup of stage.tasks) {
2327
+ * for (const task of taskGroup) {
2328
+ * console.log(` Task: ${task.name} - Status: ${task.status}`);
2329
+ * }
2330
+ * }
2331
+ * }
2332
+ * ```
2333
+ */
2334
+ getStages(caseInstanceId: string, folderKey: string): Promise<CaseGetStageResponse[]>;
2335
+ /**
2336
+ * Get human in the loop tasks associated with a case instance
2337
+ *
2338
+ * The method returns either:
2339
+ * - An array of tasks (when no pagination parameters are provided)
2340
+ * - A paginated result with navigation cursors (when any pagination parameter is provided)
2341
+ *
2342
+ * @param caseInstanceId - The ID of the case instance
2343
+ * @param options - Optional filtering and pagination options
2344
+ * @returns Promise resolving to human in the loop tasks associated with the case instance
2345
+ * @example
2346
+ * ```typescript
2347
+ * // Get all tasks for a case instance (non-paginated)
2348
+ * const tasks = await sdk.maestro.cases.instances.getActionTasks(
2349
+ * <caseInstanceId>,
2350
+ * );
2351
+ *
2352
+ * // First page with pagination
2353
+ * const page1 = await sdk.maestro.cases.instances.getActionTasks(
2354
+ * <caseInstanceId>,
2355
+ * { pageSize: 10 }
2356
+ * );
2357
+ * // Iterate through tasks
2358
+ * for (const task of page1.items) {
2359
+ * console.log(`Task: ${task.title}`);
2360
+ * console.log(`Task: ${task.status}`);
2361
+ * }
2362
+ *
2363
+ * // Jump to specific page
2364
+ * const page5 = await sdk.maestro.cases.instances.getActionTasks(
2365
+ * <caseInstanceId>,
2366
+ * {
2367
+ * jumpToPage: 5,
2368
+ * pageSize: 10
2369
+ * }
2370
+ * );
2371
+ * ```
2372
+ */
2373
+ getActionTasks<T extends TaskGetAllOptions = TaskGetAllOptions>(caseInstanceId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<TaskGetResponse> : NonPaginatedResponse<TaskGetResponse>>;
2374
+ }
2375
+ interface CaseInstanceMethods {
2376
+ /**
2377
+ * Closes/cancels this case instance
2378
+ *
2379
+ * @param options - Optional close options with comment
2380
+ * @returns Promise resolving to operation result
2381
+ */
2382
+ close(options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2383
+ /**
2384
+ * Pauses this case instance
2385
+ *
2386
+ * @param options - Optional pause options with comment
2387
+ * @returns Promise resolving to operation result
2388
+ */
2389
+ pause(options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2390
+ /**
2391
+ * Resumes this case instance
2392
+ *
2393
+ * @param options - Optional resume options with comment
2394
+ * @returns Promise resolving to operation result
2395
+ */
2396
+ resume(options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2397
+ }
2398
+ type CaseInstanceGetResponse = RawCaseInstanceGetResponse & CaseInstanceMethods;
2399
+ /**
2400
+ * Creates an actionable case instance by combining API case instance data with operational methods.
2401
+ *
2402
+ * @param instanceData - The case instance data from API
2403
+ * @param service - The case instance service instance
2404
+ * @returns A case instance object with added methods
2405
+ */
2406
+ declare function createCaseInstanceWithMethods(instanceData: RawCaseInstanceGetResponse, service: CaseInstancesServiceModel): CaseInstanceGetResponse;
2407
+
2408
+ /**
2409
+ * Service for interacting with Maestro Processes
2410
+ */
2411
+ declare class MaestroProcessesService extends BaseService implements MaestroProcessesServiceModel {
2412
+ /**
2413
+ * @hideconstructor
2414
+ */
2415
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
2416
+ /**
2417
+ * Get all processes with their instance statistics
2418
+ * @returns Promise resolving to array of MaestroProcess objects
2419
+ *
2420
+ * @example
2421
+ * ```typescript
2422
+ * // Get all processes
2423
+ * const processes = await sdk.maestro.processes.getAll();
2424
+ *
2425
+ * // Access process information
2426
+ * for (const process of processes) {
2427
+ * console.log(`Process: ${process.processKey}`);
2428
+ * console.log(`Running instances: ${process.runningCount}`);
2429
+ * console.log(`Faulted instances: ${process.faultedCount}`);
2430
+ * }
2431
+ *
2432
+ * ```
2433
+ */
2434
+ getAll(): Promise<MaestroProcessGetAllResponse[]>;
2435
+ }
2436
+
2437
+ declare class ProcessInstancesService extends BaseService implements ProcessInstancesServiceModel {
2438
+ /**
2439
+ * @hideconstructor
2440
+ */
2441
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
2442
+ /**
2443
+ * Get all process instances with optional filtering and pagination
2444
+ *
2445
+ * The method returns either:
2446
+ * - A NonPaginatedResponse with items array (when no pagination parameters are provided)
2447
+ * - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
2448
+ *
2449
+ * @param options Query parameters for filtering instances and pagination
2450
+ * @returns Promise resolving to process instances or paginated result
2451
+ *
2452
+ * @example
2453
+ * ```typescript
2454
+ * // Get all instances (non-paginated)
2455
+ * const instances = await sdk.maestro.processes.instances.getAll();
2456
+ *
2457
+ * // Cancel faulted instances using methods directly on instances
2458
+ * for (const instance of instances.items) {
2459
+ * if (instance.latestRunStatus === 'Faulted') {
2460
+ * await instance.cancel({ comment: 'Cancelling faulted instance' });
2461
+ * }
2462
+ * }
2463
+ *
2464
+ * // With filtering
2465
+ * const instances = await sdk.maestro.processes.instances.getAll({
2466
+ * processKey: 'MyProcess'
2467
+ * });
2468
+ *
2469
+ * // First page with pagination
2470
+ * const page1 = await sdk.maestro.processes.instances.getAll({ pageSize: 10 });
2471
+ *
2472
+ * // Navigate using cursor
2473
+ * if (page1.hasNextPage) {
2474
+ * const page2 = await sdk.maestro.processes.instances.getAll({ cursor: page1.nextCursor });
2475
+ * }
2476
+ * ```
2477
+ */
2478
+ getAll<T extends ProcessInstanceGetAllWithPaginationOptions = ProcessInstanceGetAllWithPaginationOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessInstanceGetResponse> : NonPaginatedResponse<ProcessInstanceGetResponse>>;
2479
+ /**
2480
+ * Get a process instance by ID with operation methods (cancel, pause, resume)
2481
+ * @param id The ID of the instance to retrieve
2482
+ * @param folderKey The folder key for authorization
2483
+ * @returns Promise<ProcessInstanceGetResponse>
2484
+ */
2485
+ getById(id: string, folderKey: string): Promise<ProcessInstanceGetResponse>;
2486
+ /**
2487
+ * Get execution history (spans) for a process instance
2488
+ * @param instanceId The ID of the instance to get history for
2489
+ * @returns Promise<ProcessInstanceExecutionHistoryResponse[]>
2490
+ */
2491
+ getExecutionHistory(instanceId: string): Promise<ProcessInstanceExecutionHistoryResponse[]>;
2492
+ /**
2493
+ * Get BPMN XML file for a process instance
2494
+ * @param instanceId The ID of the instance to get BPMN for
2495
+ * @param folderKey The folder key for authorization
2496
+ * @returns Promise<BpmnXmlString> The BPMN XML contents as a string
2497
+ */
2498
+ getBpmn(instanceId: string, folderKey: string): Promise<BpmnXmlString>;
2499
+ /**
2500
+ * Cancel a process instance
2501
+ * @param instanceId The ID of the instance to cancel
2502
+ * @param folderKey The folder key for authorization
2503
+ * @param options Optional cancellation options with comment
2504
+ * @returns Promise resolving to operation result with updated instance data
2505
+ */
2506
+ cancel(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
2507
+ /**
2508
+ * Pause a process instance
2509
+ * @param instanceId The ID of the instance to pause
2510
+ * @param folderKey The folder key for authorization
2511
+ * @param options Optional pause options with comment
2512
+ * @returns Promise resolving to operation result with updated instance data
2513
+ */
2514
+ pause(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
2515
+ /**
2516
+ * Resume a process instance
2517
+ * @param instanceId The ID of the instance to resume
2518
+ * @param folderKey The folder key for authorization
2519
+ * @param options Optional resume options with comment
2520
+ * @returns Promise resolving to operation result with updated instance data
2521
+ */
2522
+ resume(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
2523
+ /**
2524
+ * Parses BPMN XML to extract variable metadata from uipath:inputOutput elements
2525
+ * @private
2526
+ * @param bpmnXml The BPMN XML string
2527
+ * @returns Map of variable ID to metadata
2528
+ */
2529
+ private parseBpmnVariables;
2530
+ /**
2531
+ * Extracts element names from BPMN XML and maps them to their element IDs
2532
+ * @private
2533
+ * @param bpmnXml The BPMN XML string
2534
+ * @returns Map of elementId to element name
2535
+ */
2536
+ private getVariableSource;
2537
+ /**
2538
+ * Enriches global variables with metadata from BPMN
2539
+ * @private
2540
+ * @param globals The raw globals object from API response
2541
+ * @param variableMetadata The parsed BPMN variable metadata
2542
+ * @returns Array of global variables
2543
+ */
2544
+ private transformGlobalVariables;
2545
+ /**
2546
+ * Get global variables for a process instance
2547
+ * @param instanceId The ID of the instance to get variables for
2548
+ * @param folderKey The folder key for authorization
2549
+ * @param options Optional options including parentElementId to filter by parent element
2550
+ * @returns Promise<ProcessInstanceGetVariablesResponse>
2551
+ */
2552
+ getVariables(instanceId: string, folderKey: string, options?: ProcessInstanceGetVariablesOptions): Promise<ProcessInstanceGetVariablesResponse>;
2553
+ }
2554
+
2555
+ /**
2556
+ * Service for interacting with UiPath Maestro Cases
2557
+ */
2558
+ declare class CasesService extends BaseService implements CasesServiceModel {
2559
+ /**
2560
+ * @hideconstructor
2561
+ */
2562
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
2563
+ /**
2564
+ * Get all case management processes with their instance statistics
2565
+ * @returns Promise resolving to array of Case objects
2566
+ *
2567
+ * @example
2568
+ * ```typescript
2569
+ * // Get all case management processes
2570
+ * const cases = await sdk.maestro.cases.getAll();
2571
+ *
2572
+ * // Access case information
2573
+ * for (const caseProcess of cases) {
2574
+ * console.log(`Case Process: ${caseProcess.processKey}`);
2575
+ * console.log(`Running instances: ${caseProcess.runningCount}`);
2576
+ * console.log(`Completed instances: ${caseProcess.completedCount}`);
2577
+ * }
2578
+ *
2579
+ * ```
2580
+ */
2581
+ getAll(): Promise<CaseGetAllResponse[]>;
2582
+ /**
2583
+ * Extract a readable case name from the packageId
2584
+ * @param packageId - The full package identifier
2585
+ * @returns A human-readable case name
2586
+ * @private
2587
+ */
2588
+ private extractCaseName;
2589
+ }
2590
+
2591
+ declare class CaseInstancesService extends BaseService implements CaseInstancesServiceModel {
2592
+ private taskService;
2593
+ /**
2594
+ * @hideconstructor
2595
+ */
2596
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
2597
+ /**
2598
+ * Get all case instances with optional filtering and pagination
2599
+ *
2600
+ * The method returns either:
2601
+ * - A NonPaginatedResponse with items array (when no pagination parameters are provided)
2602
+ * - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
2603
+ *
2604
+ * @param options -Query parameters for filtering instances and pagination
2605
+ * @returns Promise resolving to case instances or paginated result
2606
+ *
2607
+ * @example
2608
+ * ```typescript
2609
+ * // Get all case instances (non-paginated)
2610
+ * const instances = await sdk.maestro.cases.instances.getAll();
2611
+ *
2612
+ * // Close faulted instances using methods directly on instances
2613
+ * for (const instance of instances.items) {
2614
+ * if (instance.latestRunStatus === 'Faulted') {
2615
+ * await instance.close({ comment: 'Closing faulted case instance' });
2616
+ * }
2617
+ * }
2618
+ *
2619
+ * // With filtering
2620
+ * const instances = await sdk.maestro.cases.instances.getAll({
2621
+ * processKey: 'MyCaseProcess'
2622
+ * });
2623
+ *
2624
+ * // First page with pagination
2625
+ * const page1 = await sdk.maestro.cases.instances.getAll({ pageSize: 10 });
2626
+ *
2627
+ * // Navigate using cursor
2628
+ * if (page1.hasNextPage) {
2629
+ * const page2 = await sdk.maestro.cases.instances.getAll({ cursor: page1.nextCursor });
2630
+ * }
2631
+ * ```
2632
+ */
2633
+ getAll<T extends CaseInstanceGetAllWithPaginationOptions = CaseInstanceGetAllWithPaginationOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<CaseInstanceGetResponse> : NonPaginatedResponse<CaseInstanceGetResponse>>;
2634
+ /**
2635
+ * Get a case instance by ID with operation methods (close, pause, resume)
2636
+ * @param instanceId - The ID of the instance to retrieve
2637
+ * @param folderKey - Required folder key
2638
+ * @returns Promise<CaseInstanceGetResponse>
2639
+ */
2640
+ getById(instanceId: string, folderKey: string): Promise<CaseInstanceGetResponse>;
2641
+ /**
2642
+ * Enhance a single case instance with case JSON data
2643
+ * @param instance - The case instance to enhance
2644
+ * @returns Promise resolving to enhanced instance
2645
+ * @private
2646
+ */
2647
+ private enhanceInstanceWithCaseJson;
2648
+ /**
2649
+ * Enhance multiple case instances with case JSON data
2650
+ * @param instances - Array of case instances to enhance
2651
+ * @returns Promise resolving to array of enhanced instances
2652
+ * @private
2653
+ */
2654
+ private enhanceInstancesWithCaseJson;
2655
+ /**
2656
+ * Get case JSON for a specific instance
2657
+ * @param instanceId - The case instance ID
2658
+ * @param folderKey - Required folder key
2659
+ * @returns Promise resolving to case JSON data
2660
+ * @private
2661
+ */
2662
+ private getCaseJson;
2663
+ /**
2664
+ * Close a case instance
2665
+ * @param instanceId - The ID of the instance to cancel
2666
+ * @param folderKey - Required folder key
2667
+ * @param options - Optional cancellation options with comment
2668
+ * @returns Promise resolving to operation result with updated instance data
2669
+ */
2670
+ close(instanceId: string, folderKey: string, options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2671
+ /**
2672
+ * Pause a case instance
2673
+ * @param instanceId - The ID of the instance to pause
2674
+ * @param folderKey - Required folder key
2675
+ * @param options - Optional pause options with comment
2676
+ * @returns Promise resolving to operation result with updated instance data
2677
+ */
2678
+ pause(instanceId: string, folderKey: string, options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2679
+ /**
2680
+ * Resume a case instance
2681
+ * @param instanceId - The ID of the instance to resume
2682
+ * @param folderKey - Required folder key
2683
+ * @param options - Optional resume options with comment
2684
+ * @returns Promise resolving to operation result with updated instance data
2685
+ */
2686
+ resume(instanceId: string, folderKey: string, options?: CaseInstanceOperationOptions): Promise<OperationResponse<CaseInstanceOperationResponse>>;
2687
+ /**
2688
+ * Get execution history for a case instance
2689
+ * @param instanceId - The ID of the case instance
2690
+ * @param folderKey - Required folder key
2691
+ * @returns Promise resolving to instance execution history
2692
+ * @example
2693
+ * ```typescript
2694
+ * // Get execution history for a case instance
2695
+ * const history = await sdk.maestro.cases.instances.getExecutionHistory(
2696
+ * 'instance-id',
2697
+ * 'folder-key'
2698
+ * );
2699
+ * ```
2700
+ */
2701
+ getExecutionHistory(instanceId: string, folderKey: string): Promise<CaseInstanceExecutionHistoryResponse>;
2702
+ /**
2703
+ * Get case stages with their associated tasks and execution status
2704
+ * @param caseInstanceId - The ID of the case instance
2705
+ * @param folderKey - Required folder key
2706
+ * @returns Promise resolving to an array of case stages, each containing their tasks with execution details
2707
+ */
2708
+ getStages(caseInstanceId: string, folderKey: string): Promise<CaseGetStageResponse[]>;
2709
+ /**
2710
+ * Create a map of element ID to execution data
2711
+ * @param executionHistory - The execution history response
2712
+ * @returns Map of elementId to execution metadata
2713
+ * @private
2714
+ */
2715
+ private createExecutionMap;
2716
+ /**
2717
+ * Create a map of binding IDs to their values
2718
+ * @param caseJsonResponse - The case JSON response
2719
+ * @returns Map of binding ID to binding object
2720
+ * @private
2721
+ */
2722
+ private createBindingsMap;
2723
+ /**
2724
+ * Resolve binding values from binding expressions
2725
+ * @param value - The value that may contain binding references
2726
+ * @param bindingsMap - Map of binding IDs to binding objects
2727
+ * @returns Resolved value
2728
+ * @private
2729
+ */
2730
+ private resolveBinding;
2731
+ /**
2732
+ * Process tasks for a stage node
2733
+ * @param node - The stage node containing tasks
2734
+ * @param executionMap - Map of element IDs to execution data
2735
+ * @param bindingsMap - Map of binding IDs to binding objects
2736
+ * @returns Processed tasks array
2737
+ * @private
2738
+ */
2739
+ private processTasks;
2740
+ /**
2741
+ * Create a stage from a case node
2742
+ * @param node - The case node to process
2743
+ * @param executionMap - Map of element IDs to execution data
2744
+ * @param bindingsMap - Map of binding IDs to binding objects
2745
+ * @returns CaseGetStageResponse object
2746
+ * @private
2747
+ */
2748
+ private createStageFromNode;
2749
+ /**
2750
+ * Get human in the loop tasks associated with a case instance
2751
+ * @param caseInstanceId - The ID of the case instance
2752
+ * @param options - Optional filtering and pagination options
2753
+ * @returns Promise resolving to human in the loop tasks associated with the case instance
2754
+ */
2755
+ getActionTasks<T extends TaskGetAllOptions = TaskGetAllOptions>(caseInstanceId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<TaskGetResponse> : NonPaginatedResponse<TaskGetResponse>>;
2756
+ }
2757
+
2758
+ /**
2759
+ * Base service for services that need folder-specific functionality
2760
+ */
2761
+ declare class FolderScopedService extends BaseService {
2762
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
2763
+ /**
2764
+ * Gets resources in a folder with optional query parameters
2765
+ *
2766
+ * @param endpoint - API endpoint to call
2767
+ * @param folderId - required folder ID
2768
+ * @param options - Query options
2769
+ * @param transformFn - Optional function to transform the response data
2770
+ * @returns Promise resolving to an array of resources
2771
+ */
2772
+ protected _getByFolder<T, R = T>(endpoint: string, folderId: number, options?: Record<string, any>, transformFn?: (item: T) => R): Promise<R[]>;
2773
+ }
2774
+
2775
+ /**
2776
+ * Enum for Asset Value Scope
2777
+ */
2778
+ declare enum AssetValueScope {
2779
+ Global = "Global",
2780
+ PerRobot = "PerRobot"
2781
+ }
2782
+ /**
2783
+ * Enum for Asset Value Type
2784
+ */
2785
+ declare enum AssetValueType {
2786
+ DBConnectionString = "DBConnectionString",
2787
+ HttpConnectionString = "HttpConnectionString",
2788
+ Text = "Text",
2789
+ Bool = "Bool",
2790
+ Integer = "Integer",
2791
+ Credential = "Credential",
2792
+ WindowsCredential = "WindowsCredential",
2793
+ KeyValueList = "KeyValueList",
2794
+ Secret = "Secret"
2795
+ }
2796
+ /**
2797
+ * Interface for key-value pair used in assets
2798
+ */
2799
+ interface CustomKeyValuePair {
2800
+ key?: string;
2801
+ value?: string;
2802
+ }
2803
+ /**
2804
+ * Interface for asset response
2805
+ */
2806
+ interface AssetGetResponse {
2807
+ key: string;
2808
+ name: string;
2809
+ id: number;
2810
+ canBeDeleted: boolean;
2811
+ valueScope: AssetValueScope;
2812
+ valueType: AssetValueType;
2813
+ value: string | null;
2814
+ credentialStoreId: number | null;
2815
+ keyValueList: CustomKeyValuePair[];
2816
+ hasDefaultValue: boolean;
2817
+ description: string | null;
2818
+ foldersCount: number;
2819
+ lastModifiedTime: string | null;
2820
+ lastModifierUserId: number | null;
2821
+ createdTime: string;
2822
+ creatorUserId: number;
2823
+ }
2824
+ /**
2825
+ * Options for getting assets across folders
2826
+ */
2827
+ type AssetGetAllOptions = RequestOptions & PaginationOptions & {
2828
+ /**
2829
+ * Optional folder ID to filter assets by folder
2830
+ */
2831
+ folderId?: number;
2832
+ };
2833
+ /**
2834
+ * Options for getting a single asset by ID
2835
+ */
2836
+ type AssetGetByIdOptions = BaseOptions;
2837
+
2838
+ /**
2839
+ * Service for managing UiPath Assets.
2840
+ *
2841
+ * Assets are key-value pairs that can be used to store configuration data, credentials, and other settings used by automation processes. [UiPath Assets Guide](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-assets)
2842
+ */
2843
+ interface AssetServiceModel {
2844
+ /**
2845
+ * Gets all assets across folders with optional filtering
2846
+ *
2847
+ * @param options Query options including optional folderId and pagination options
2848
+ * @returns Promise resolving to either an array of assets NonPaginatedResponse<AssetGetResponse> or a PaginatedResponse<AssetGetResponse> when pagination options are used.
2849
+ * {@link AssetGetResponse}
2850
+ * @example
2851
+ * ```typescript
2852
+ * // Standard array return
2853
+ * const assets = await sdk.assets.getAll();
2854
+ *
2855
+ * // With folder
2856
+ * const folderAssets = await sdk.assets.getAll({ folderId: <folderId> });
2857
+ *
2858
+ * // First page with pagination
2859
+ * const page1 = await sdk.assets.getAll({ pageSize: 10 });
2860
+ *
2861
+ * // Navigate using cursor
2862
+ * if (page1.hasNextPage) {
2863
+ * const page2 = await sdk.assets.getAll({ cursor: page1.nextCursor });
2864
+ * }
2865
+ *
2866
+ * // Jump to specific page
2867
+ * const page5 = await sdk.assets.getAll({
2868
+ * jumpToPage: 5,
2869
+ * pageSize: 10
2870
+ * });
2871
+ * ```
2872
+ */
2873
+ getAll<T extends AssetGetAllOptions = AssetGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AssetGetResponse> : NonPaginatedResponse<AssetGetResponse>>;
2874
+ /**
2875
+ * Gets a single asset by ID
2876
+ *
2877
+ * @param id - Asset ID
2878
+ * @param folderId - Required folder ID
2879
+ * @param options - Optional query parameters (expand, select)
2880
+ * @returns Promise resolving to a single asset
2881
+ * {@link AssetGetResponse}
2882
+ * @example
2883
+ * ```typescript
2884
+ * // Get asset by ID
2885
+ * const asset = await sdk.assets.getById(<assetId>, <folderId>);
2886
+ * ```
2887
+ */
2888
+ getById(id: number, folderId: number, options?: AssetGetByIdOptions): Promise<AssetGetResponse>;
2889
+ }
2890
+
2891
+ /**
2892
+ * Service for interacting with UiPath Orchestrator Assets API
2893
+ */
2894
+ declare class AssetService extends FolderScopedService implements AssetServiceModel {
2895
+ /**
2896
+ * @hideconstructor
2897
+ */
2898
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
2899
+ /**
2900
+ * Gets all assets across folders with optional filtering and folder scoping
2901
+ *
2902
+ * @signature getAll(options?) -> Promise<AssetGetResponse[]>
2903
+ * @param options Query options including optional folderId and pagination options
2904
+ * @returns Promise resolving to array of assets or paginated response
2905
+ *
2906
+ * @example
2907
+ * ```typescript
2908
+ * // Standard array return
2909
+ * const assets = await sdk.assets.getAll();
2910
+ *
2911
+ * // With folder
2912
+ * const folderAssets = await sdk.assets.getAll({ folderId: 123 });
2913
+ *
2914
+ * // First page with pagination
2915
+ * const page1 = await sdk.assets.getAll({ pageSize: 10 });
2916
+ *
2917
+ * // Navigate using cursor
2918
+ * if (page1.hasNextPage) {
2919
+ * const page2 = await sdk.assets.getAll({ cursor: page1.nextCursor });
2920
+ * }
2921
+ *
2922
+ * // Jump to specific page
2923
+ * const page5 = await sdk.assets.getAll({
2924
+ * jumpToPage: 5,
2925
+ * pageSize: 10
2926
+ * });
2927
+ * ```
2928
+ */
2929
+ getAll<T extends AssetGetAllOptions = AssetGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AssetGetResponse> : NonPaginatedResponse<AssetGetResponse>>;
2930
+ /**
2931
+ * Gets a single asset by ID
2932
+ *
2933
+ * @param id - Asset ID
2934
+ * @param folderId - Required folder ID
2935
+ * @param options - Optional query parameters (expand, select)
2936
+ * @returns Promise resolving to a single asset
2937
+ *
2938
+ * @example
2939
+ * ```typescript
2940
+ * // Get asset by ID
2941
+ * const asset = await sdk.assets.getById(123, 456);
2942
+ * ```
2943
+ */
2944
+ getById(id: number, folderId: number, options?: AssetGetByIdOptions): Promise<AssetGetResponse>;
2945
+ }
2946
+
2947
+ declare enum BucketOptions {
2948
+ None = "None",
2949
+ ReadOnly = "ReadOnly",
2950
+ AuditReadAccess = "AuditReadAccess",
2951
+ AccessDataThroughOrchestrator = "AccessDataThroughOrchestrator"
2952
+ }
2953
+ interface BucketGetResponse {
2954
+ id: number;
2955
+ name: string;
2956
+ description: string | null;
2957
+ identifier: string;
2958
+ storageProvider: string | null;
2959
+ storageParameters: string | null;
2960
+ storageContainer: string | null;
2961
+ options: BucketOptions;
2962
+ credentialStoreId: number | null;
2963
+ externalName: string | null;
2964
+ password: string | null;
2965
+ foldersCount: number;
2966
+ }
2967
+ type BucketGetAllOptions = RequestOptions & PaginationOptions & {
2968
+ folderId?: number;
2969
+ };
2970
+ type BucketGetByIdOptions = BaseOptions;
2971
+ /**
2972
+ * Maps header names to their values
2973
+ *
2974
+ * @example
2975
+ * ```typescript
2976
+ * {
2977
+ * "x-ms-blob-type": "BlockBlob"
2978
+ * }
2979
+ * ```
2980
+ */
2981
+ type ResponseDictionary = Record<string, string>;
2982
+ /**
2983
+ * Response from the GetReadUri API
2984
+ */
2985
+ interface BucketGetUriResponse {
2986
+ /**
2987
+ * The URI for accessing the blob file
2988
+ */
2989
+ uri: string;
2990
+ /**
2991
+ * HTTP method to use with the URI
2992
+ */
2993
+ httpMethod: string;
2994
+ /**
2995
+ * Whether authentication is required to access the URI
2996
+ */
2997
+ requiresAuth: boolean;
2998
+ /**
2999
+ * Headers to be included in the request
3000
+ */
3001
+ headers: ResponseDictionary;
3002
+ }
3003
+ interface BucketGetUriOptions extends BaseOptions {
3004
+ /**
3005
+ * The ID of the bucket
3006
+ */
3007
+ bucketId: number;
3008
+ /**
3009
+ * The ID of the folder
3010
+ */
3011
+ folderId: number;
3012
+ /**
3013
+ * The full path to the BlobFile
3014
+ */
3015
+ path: string;
3016
+ /**
3017
+ * URL expiration time in minutes (0 for default)
3018
+ */
3019
+ expiryInMinutes?: number;
3020
+ }
3021
+ /**
3022
+ * Request options for getting a read URI for a file in a bucket
3023
+ */
3024
+ type BucketGetReadUriOptions = BucketGetUriOptions;
3025
+ /**
3026
+ * Request options for getting a write URI for a file in a bucket
3027
+ */
3028
+ interface BucketGetWriteUriOptions extends BucketGetUriOptions {
3029
+ /**
3030
+ * ContentType for S3 access policy
3031
+ */
3032
+ contentType?: string;
3033
+ }
3034
+ /**
3035
+ * Request options for getting files in a bucket
3036
+ */
3037
+ interface BucketGetFileMetaDataOptions {
3038
+ /**
3039
+ * The path prefix to filter files by
3040
+ */
3041
+ prefix?: string;
3042
+ }
3043
+ /**
3044
+ * Request options for getting files in a bucket with pagination support
3045
+ */
3046
+ type BucketGetFileMetaDataWithPaginationOptions = BucketGetFileMetaDataOptions & PaginationOptions;
3047
+ /**
3048
+ * Response from the GetFiles API
3049
+ */
3050
+ interface BucketGetFileMetaDataResponse {
3051
+ /**
3052
+ * Array of blob items in the bucket
3053
+ */
3054
+ blobItems: BlobItem[];
3055
+ /**
3056
+ * Token for retrieving the next set of results
3057
+ */
3058
+ continuationToken: string | null;
3059
+ }
3060
+ /**
3061
+ * Represents a file or blob in a bucket
3062
+ */
3063
+ interface BlobItem {
3064
+ /**
3065
+ * Full path to the blob
3066
+ */
3067
+ path: string;
3068
+ /**
3069
+ * Content type of the blob
3070
+ */
3071
+ contentType: string;
3072
+ /**
3073
+ * Size of the blob in bytes
3074
+ */
3075
+ size: number;
3076
+ /**
3077
+ * Last modified timestamp
3078
+ */
3079
+ lastModified: string | null;
3080
+ }
3081
+ /**
3082
+ * Options for uploading files to a bucket
3083
+ */
3084
+ interface BucketUploadFileOptions {
3085
+ /**
3086
+ * The ID of the bucket to upload to
3087
+ */
3088
+ bucketId: number;
3089
+ /**
3090
+ * The folder/organization unit ID for context
3091
+ */
3092
+ folderId: number;
3093
+ /**
3094
+ * Path where the file should be stored in the bucket
3095
+ */
3096
+ path: string;
3097
+ /**
3098
+ * File content to upload
3099
+ */
3100
+ content: Blob | Buffer | File;
3101
+ /**
3102
+ * Optional MIME type of the file
3103
+ * If not provided, it will be auto-detected
3104
+ */
3105
+ contentType?: string;
3106
+ }
3107
+ /**
3108
+ * Response from file upload operations
3109
+ */
3110
+ interface BucketUploadResponse {
3111
+ /**
3112
+ * Whether the upload was successful
3113
+ */
3114
+ success: boolean;
3115
+ /**
3116
+ * HTTP status code from the upload operation
3117
+ */
3118
+ statusCode: number;
3119
+ }
3120
+
3121
+ /**
3122
+ * Service for managing UiPath storage Buckets.
3123
+ *
3124
+ * Buckets are cloud storage containers that can be used to store and manage files used by automation processes. [UiPath Buckets Guide](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-storage-buckets)
3125
+ */
3126
+ interface BucketServiceModel {
3127
+ /**
3128
+ * Gets all buckets across folders with optional filtering
3129
+ *
3130
+ * The method returns either:
3131
+ * - A NonPaginatedResponse with data and totalCount (when no pagination parameters are provided)
3132
+ * - A paginated result with navigation cursors (when any pagination parameter is provided)
3133
+ *
3134
+ * @param options - Query options including optional folderId and pagination options
3135
+ * @returns Promise resolving to either an array of buckets NonPaginatedResponse<BucketGetResponse> or a PaginatedResponse<BucketGetResponse> when pagination options are used.
3136
+ * {@link BucketGetResponse}
3137
+ * @example
3138
+ * ```typescript
3139
+ * // Get all buckets across folders
3140
+ * const buckets = await sdk.buckets.getAll();
3141
+ *
3142
+ * // Get buckets within a specific folder
3143
+ * const buckets = await sdk.buckets.getAll({
3144
+ * folderId: <folderId>
3145
+ * });
3146
+ *
3147
+ * // Get buckets with filtering
3148
+ * const buckets = await sdk.buckets.getAll({
3149
+ * filter: "name eq 'MyBucket'"
3150
+ * });
3151
+ *
3152
+ * // First page with pagination
3153
+ * const page1 = await sdk.buckets.getAll({ pageSize: 10 });
3154
+ *
3155
+ * // Navigate using cursor
3156
+ * if (page1.hasNextPage) {
3157
+ * const page2 = await sdk.buckets.getAll({ cursor: page1.nextCursor });
3158
+ * }
3159
+ *
3160
+ * // Jump to specific page
3161
+ * const page5 = await sdk.buckets.getAll({
3162
+ * jumpToPage: 5,
3163
+ * pageSize: 10
3164
+ * });
3165
+ * ```
3166
+ */
3167
+ getAll<T extends BucketGetAllOptions = BucketGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<BucketGetResponse> : NonPaginatedResponse<BucketGetResponse>>;
3168
+ /**
3169
+ * Gets a single bucket by ID
3170
+ *
3171
+ * @param bucketId - Bucket ID
3172
+ * @param folderId - Required folder ID
3173
+ * @param options - Optional query parameters
3174
+ * @returns Promise resolving to a bucket definition
3175
+ * {@link BucketGetResponse}
3176
+ * @example
3177
+ * ```typescript
3178
+ * // Get bucket by ID
3179
+ * const bucket = await sdk.buckets.getById(<bucketId>, <folderId>);
3180
+ * ```
3181
+ */
3182
+ getById(bucketId: number, folderId: number, options?: BucketGetByIdOptions): Promise<BucketGetResponse>;
3183
+ /**
3184
+ * Gets metadata for files in a bucket with optional filtering and pagination
3185
+ *
3186
+ * The method returns either:
3187
+ * - A NonPaginatedResponse with items array (when no pagination parameters are provided)
3188
+ * - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
3189
+ *
3190
+ * @param bucketId - The ID of the bucket to get file metadata from
3191
+ * @param folderId - Required folder ID for organization unit context
3192
+ * @param options - Optional parameters for filtering, pagination and access URL generation
3193
+ * @returns Promise resolving to either an array of files metadata NonPaginatedResponse<BlobItem> or a PaginatedResponse<BlobItem> when pagination options are used.
3194
+ * {@link BlobItem}
3195
+ * @example
3196
+ * ```typescript
3197
+ * // Get metadata for all files in a bucket
3198
+ * const fileMetadata = await sdk.buckets.getFileMetaData(<bucketId>, <folderId>);
3199
+ *
3200
+ * // Get file metadata with a specific prefix
3201
+ * const fileMetadata = await sdk.buckets.getFileMetaData(<bucketId>, <folderId>, {
3202
+ * prefix: '/folder1'
3203
+ * });
3204
+ *
3205
+ * // First page with pagination
3206
+ * const page1 = await sdk.buckets.getFileMetaData(<bucketId>, <folderId>, { pageSize: 10 });
3207
+ *
3208
+ * // Navigate using cursor
3209
+ * if (page1.hasNextPage) {
3210
+ * const page2 = await sdk.buckets.getFileMetaData(<bucketId>, <folderId>, { cursor: page1.nextCursor });
3211
+ * }
3212
+ * ```
3213
+ */
3214
+ getFileMetaData<T extends BucketGetFileMetaDataWithPaginationOptions = BucketGetFileMetaDataWithPaginationOptions>(bucketId: number, folderId: number, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<BlobItem> : NonPaginatedResponse<BlobItem>>;
3215
+ /**
3216
+ * Gets a direct download URL for a file in the bucket
3217
+ *
3218
+ * @param options - Contains bucketId, folderId, file path and optional expiry time
3219
+ * @returns Promise resolving to blob file access information
3220
+ * {@link BucketGetUriResponse}
3221
+ * @example
3222
+ * ```typescript
3223
+ * // Get download URL for a file
3224
+ * const fileAccess = await sdk.buckets.getReadUri({
3225
+ * bucketId: <bucketId>,
3226
+ * folderId: <folderId>,
3227
+ * path: '/folder/file.pdf'
3228
+ * });
3229
+ * ```
3230
+ */
3231
+ getReadUri(options: BucketGetReadUriOptions): Promise<BucketGetUriResponse>;
3232
+ /**
3233
+ * Uploads a file to a bucket
3234
+ *
3235
+ * @param options - Options for file upload including bucket ID, folder ID, path, content, and optional parameters
3236
+ * @returns Promise resolving bucket upload response
3237
+ * {@link BucketUploadResponse}
3238
+ * @example
3239
+ * ```typescript
3240
+ * // Upload a file from browser
3241
+ * const file = new File(['file content'], 'example.txt');
3242
+ * const result = await sdk.buckets.uploadFile({
3243
+ * bucketId: <bucketId>,
3244
+ * folderId: <folderId>,
3245
+ * path: '/folder/example.txt',
3246
+ * content: file
3247
+ * });
3248
+ *
3249
+ * // In Node env with explicit content type
3250
+ * const buffer = Buffer.from('file content');
3251
+ * const result = await sdk.buckets.uploadFile({
3252
+ * bucketId: <bucketId>,
3253
+ * folderId: <folderId>,
3254
+ * path: '/folder/example.txt',
3255
+ * content: buffer,
3256
+ * contentType: 'text/plain'
3257
+ * });
3258
+ * ```
3259
+ */
3260
+ uploadFile(options: BucketUploadFileOptions): Promise<BucketUploadResponse>;
3261
+ }
3262
+
3263
+ declare class BucketService extends FolderScopedService implements BucketServiceModel {
3264
+ protected readonly tokenManager: TokenManager;
3265
+ /**
3266
+ * @hideconstructor
3267
+ */
3268
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
3269
+ /**
3270
+ * Gets a bucket by ID
3271
+ * @param bucketId - The ID of the bucket to retrieve
3272
+ * @param folderId - Folder ID for organization unit context
3273
+ * @param options - Optional query parameters (expand, select)
3274
+ * @returns Promise resolving to the bucket
3275
+ *
3276
+ * @example
3277
+ * ```typescript
3278
+ * // Get bucket by ID
3279
+ * const bucket = await sdk.buckets.getById(123, 456);
3280
+ * ```
3281
+ */
3282
+ getById(id: number, folderId: number, options?: BucketGetByIdOptions): Promise<BucketGetResponse>;
3283
+ /**
3284
+ * Gets all buckets across folders with optional filtering and folder scoping
3285
+ *
3286
+ * The method returns either:
3287
+ * - An array of buckets (when no pagination parameters are provided)
3288
+ * - A paginated result with navigation cursors (when any pagination parameter is provided)
3289
+ *
3290
+ * @param options - Query options including optional folderId
3291
+ * @returns Promise resolving to an array of buckets or paginated result
3292
+ *
3293
+ * @example
3294
+ * ```typescript
3295
+ * // Get all buckets across folders
3296
+ * const buckets = await sdk.buckets.getAll();
3297
+ *
3298
+ * // Get buckets within a specific folder
3299
+ * const buckets = await sdk.buckets.getAll({
3300
+ * folderId: 123
3301
+ * });
3302
+ *
3303
+ * // Get buckets with filtering
3304
+ * const buckets = await sdk.buckets.getAll({
3305
+ * filter: "name eq 'MyBucket'"
3306
+ * });
3307
+ *
3308
+ * // First page with pagination
3309
+ * const page1 = await sdk.buckets.getAll({ pageSize: 10 });
3310
+ *
3311
+ * // Navigate using cursor
3312
+ * if (page1.hasNextPage) {
3313
+ * const page2 = await sdk.buckets.getAll({ cursor: page1.nextCursor });
3314
+ * }
3315
+ *
3316
+ * // Jump to specific page
3317
+ * const page5 = await sdk.buckets.getAll({
3318
+ * jumpToPage: 5,
3319
+ * pageSize: 10
3320
+ * });
3321
+ * ```
3322
+ */
3323
+ getAll<T extends BucketGetAllOptions = BucketGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<BucketGetResponse> : NonPaginatedResponse<BucketGetResponse>>;
3324
+ /**
3325
+ * Gets metadata for files in a bucket with optional filtering and pagination
3326
+ *
3327
+ * The method returns either:
3328
+ * - A NonPaginatedResponse with items array (when no pagination parameters are provided)
3329
+ * - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
3330
+ *
3331
+ * @param bucketId - The ID of the bucket to get file metadata from
3332
+ * @param folderId - Required folder ID for organization unit context
3333
+ * @param options - Optional parameters for filtering, pagination and access URL generation
3334
+ * @returns Promise resolving to the list of file metadata in the bucket or paginated result
3335
+ *
3336
+ * @example
3337
+ * ```typescript
3338
+ * // Get metadata for all files in a bucket
3339
+ * const fileMetadata = await sdk.buckets.getFileMetaData(123, 456);
3340
+ *
3341
+ * // Get file metadata with a specific prefix
3342
+ * const fileMetadata = await sdk.buckets.getFileMetaData(123, 456, {
3343
+ * prefix: '/folder1'
3344
+ * });
3345
+ *
3346
+ * // First page with pagination
3347
+ * const page1 = await sdk.buckets.getFileMetaData(123, 456, { pageSize: 10 });
3348
+ *
3349
+ * // Navigate using cursor
3350
+ * if (page1.hasNextPage) {
3351
+ * const page2 = await sdk.buckets.getFileMetaData(123, 456, { cursor: page1.nextCursor });
3352
+ * }
3353
+ * ```
3354
+ */
3355
+ getFileMetaData<T extends BucketGetFileMetaDataWithPaginationOptions = BucketGetFileMetaDataWithPaginationOptions>(bucketId: number, folderId: number, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<BlobItem> : NonPaginatedResponse<BlobItem>>;
3356
+ /**
3357
+ * Uploads a file to a bucket
3358
+ *
3359
+ * @param options - Options for file upload including bucket ID, folder ID, path, content, and optional parameters
3360
+ * @returns Promise resolving to a response with success status and HTTP status code
3361
+ *
3362
+ * @example
3363
+ * ```typescript
3364
+ * // Upload a file from browser
3365
+ * const file = new File(['file content'], 'example.txt');
3366
+ * const result = await sdk.buckets.uploadFile({
3367
+ * bucketId: 123,
3368
+ * folderId: 456,
3369
+ * path: '/folder/example.txt',
3370
+ * content: file
3371
+ * });
3372
+ *
3373
+ * // In Node env with explicit content type
3374
+ * const buffer = Buffer.from('file content');
3375
+ * const result = await sdk.buckets.uploadFile({
3376
+ * bucketId: 123,
3377
+ * folderId: 456,
3378
+ * path: '/folder/example.txt',
3379
+ * content: buffer,
3380
+ * contentType: 'text/plain'
3381
+ * });
3382
+ * ```
3383
+ */
3384
+ uploadFile(options: BucketUploadFileOptions): Promise<BucketUploadResponse>;
3385
+ /**
3386
+ * Determines the content type of the file based on the content and path
3387
+ * Uses a hybrid approach:
3388
+ * 1. Checks Blob/File type if available (browser)
3389
+ * 2. Uses content-based detection with file-type (primarily Node.js)
3390
+ * 3. Falls back to extension-based detection with mime-types
3391
+ * 4. Finally defaults to application/octet-stream
3392
+ *
3393
+ * @param content - The file content
3394
+ * @param path - The file path
3395
+ * @returns The determined content type or default
3396
+ */
3397
+ private _determineContentType;
3398
+ /**
3399
+ * Uploads content to the provided URI
3400
+ * @param uriResponse - Response from getWriteUri containing URL and headers
3401
+ * @param content - The content to upload
3402
+ * @param contentType - The content type of the file
3403
+ * @returns The response from the upload request with status info
3404
+ */
3405
+ private _uploadToUri;
3406
+ /**
3407
+ * Private method to handle common URI request logic
3408
+ * @param endpoint - The API endpoint to call
3409
+ * @param bucketId - The bucket ID
3410
+ * @param folderId - The folder ID
3411
+ * @param path - The file path
3412
+ * @param queryOptions - Additional query parameters
3413
+ * @returns Promise resolving to blob file access information
3414
+ */
3415
+ private _getUri;
3416
+ /**
3417
+ * Gets a direct download URL for a file in the bucket
3418
+ *
3419
+ * @param options - Contains bucketId, folderId, file path and optional expiry time
3420
+ * @returns Promise resolving to blob file access information
3421
+ *
3422
+ * @example
3423
+ * ```typescript
3424
+ * // Get download URL for a file
3425
+ * const fileAccess = await sdk.buckets.getReadUri({
3426
+ * bucketId: 123,
3427
+ * folderId: 456,
3428
+ * path: '/folder/file.pdf'
3429
+ * });
3430
+ * ```
3431
+ */
3432
+ getReadUri(options: BucketGetReadUriOptions): Promise<BucketGetUriResponse>;
3433
+ /**
3434
+ * Gets a direct upload URL for a file in the bucket
3435
+ *
3436
+ * @param options - Contains bucketId, folderId, file path, optional expiry time and content type
3437
+ * @returns Promise resolving to blob file access information
3438
+ */
3439
+ private _getWriteUri;
3440
+ }
3441
+
3442
+ /**
3443
+ * Enum for package types
3444
+ */
3445
+ declare enum PackageType {
3446
+ Undefined = "Undefined",
3447
+ Process = "Process",
3448
+ ProcessOrchestration = "ProcessOrchestration",
3449
+ WebApp = "WebApp",
3450
+ Agent = "Agent",
3451
+ TestAutomationProcess = "TestAutomationProcess",
3452
+ Api = "Api",
3453
+ MCPServer = "MCPServer",
3454
+ BusinessRules = "BusinessRules"
3455
+ }
3456
+ /**
3457
+ * Enum for job priority
3458
+ */
3459
+ declare enum JobPriority {
3460
+ Low = "Low",
3461
+ Normal = "Normal",
3462
+ High = "High"
3463
+ }
3464
+ /**
3465
+ * Enum for target framework
3466
+ */
3467
+ declare enum TargetFramework {
3468
+ Legacy = "Legacy",
3469
+ Windows = "Windows",
3470
+ Portable = "Portable"
3471
+ }
3472
+ /**
3473
+ * Enum for robot size
3474
+ */
3475
+ declare enum RobotSize {
3476
+ Small = "Small",
3477
+ Standard = "Standard",
3478
+ Medium = "Medium",
3479
+ Large = "Large"
3480
+ }
3481
+ /**
3482
+ * Enum for remote control access
3483
+ */
3484
+ declare enum RemoteControlAccess {
3485
+ None = "None",
3486
+ ReadOnly = "ReadOnly",
3487
+ Full = "Full"
3488
+ }
3489
+ /**
3490
+ * Enum for process start strategy
3491
+ */
3492
+ declare enum StartStrategy {
3493
+ All = "All",
3494
+ Specific = "Specific",
3495
+ RobotCount = "RobotCount",
3496
+ JobsCount = "JobsCount",
3497
+ ModernJobsCount = "ModernJobsCount"
3498
+ }
3499
+ /**
3500
+ * Enum for package source type
3501
+ */
3502
+ declare enum PackageSourceType {
3503
+ Manual = "Manual",
3504
+ Schedule = "Schedule",
3505
+ Queue = "Queue",
3506
+ StudioWeb = "StudioWeb",
3507
+ IntegrationTrigger = "IntegrationTrigger",
3508
+ StudioDesktop = "StudioDesktop",
3509
+ AutomationOpsPipelines = "AutomationOpsPipelines",
3510
+ Apps = "Apps",
3511
+ SAP = "SAP",
3512
+ HttpTrigger = "HttpTrigger",
3513
+ HttpTriggerWithCallback = "HttpTriggerWithCallback",
3514
+ RobotAPI = "RobotAPI",
3515
+ Assistant = "Assistant",
3516
+ CommandLine = "CommandLine",
3517
+ RobotNetAPI = "RobotNetAPI",
3518
+ Autopilot = "Autopilot",
3519
+ TestManager = "TestManager",
3520
+ AgentService = "AgentService",
3521
+ ProcessOrchestration = "ProcessOrchestration",
3522
+ PluginEcosystem = "PluginEcosystem",
3523
+ PerformanceTesting = "PerformanceTesting",
3524
+ AgentHub = "AgentHub",
3525
+ ApiWorkflow = "ApiWorkflow"
3526
+ }
3527
+ /**
3528
+ * Enum for stop strategy
3529
+ */
3530
+ declare enum StopStrategy {
3531
+ SoftStop = "SoftStop",
3532
+ Kill = "Kill"
3533
+ }
3534
+ /**
3535
+ * Interface for Job Attachment
3536
+ */
3537
+ interface JobAttachment {
3538
+ attachmentId: string;
3539
+ jobKey?: string;
3540
+ category?: string;
3541
+ attachmentName?: string;
3542
+ }
3543
+ /**
3544
+ * Interface for common process properties shared across multiple interfaces
3545
+ */
3546
+ interface ProcessProperties {
3547
+ jobPriority?: JobPriority;
3548
+ specificPriorityValue?: number;
3549
+ inputArguments?: string;
3550
+ environmentVariables?: string;
3551
+ entryPointPath?: string;
3552
+ remoteControlAccess?: RemoteControlAccess;
3553
+ requiresUserInteraction?: boolean;
3554
+ }
3555
+ /**
3556
+ * Interface for common folder properties
3557
+ */
3558
+ interface FolderProperties {
3559
+ folderId?: number;
3560
+ folderName?: string;
3561
+ }
3562
+ /**
3563
+ * Base interface for process start request
3564
+ */
3565
+ interface BaseProcessStartRequest extends ProcessProperties {
3566
+ strategy?: StartStrategy;
3567
+ robotIds?: number[];
3568
+ machineSessionIds?: number[];
3569
+ noOfRobots?: number;
3570
+ jobsCount?: number;
3571
+ source?: PackageSourceType;
3572
+ runtimeType?: string;
3573
+ inputFile?: string;
3574
+ reference?: string;
3575
+ attachments?: JobAttachment[];
3576
+ targetFramework?: TargetFramework;
3577
+ resumeOnSameContext?: boolean;
3578
+ batchExecutionKey?: string;
3579
+ stopProcessExpression?: string;
3580
+ stopStrategy?: StopStrategy;
3581
+ killProcessExpression?: string;
3582
+ alertPendingExpression?: string;
3583
+ alertRunningExpression?: string;
3584
+ runAsMe?: boolean;
3585
+ parentOperationId?: string;
3586
+ }
3587
+ /**
3588
+ * Interface for start process request with processKey
3589
+ */
3590
+ interface ProcessStartRequestWithKey extends BaseProcessStartRequest {
3591
+ processKey: string;
3592
+ processName?: string;
3593
+ }
3594
+ /**
3595
+ * Interface for start process request with processName
3596
+ */
3597
+ interface ProcessStartRequestWithName extends BaseProcessStartRequest {
3598
+ processKey?: string;
3599
+ processName: string;
3600
+ }
3601
+ /**
3602
+ * Interface for start process request
3603
+ * Either processKey or processName must be provided
3604
+ */
3605
+ type ProcessStartRequest = ProcessStartRequestWithKey | ProcessStartRequestWithName;
3606
+ /**
3607
+ * Interface for robot metadata
3608
+ */
3609
+ interface RobotMetadata {
3610
+ id: number;
3611
+ name?: string;
3612
+ username?: string;
3613
+ }
3614
+ /**
3615
+ * Interface for machine
3616
+ */
3617
+ interface Machine {
3618
+ id: number;
3619
+ name?: string;
3620
+ }
3621
+ /**
3622
+ * Interface for job error
3623
+ */
3624
+ interface JobError {
3625
+ code?: string;
3626
+ title?: string;
3627
+ detail?: string;
3628
+ category?: string;
3629
+ status?: number;
3630
+ timestamp?: string;
3631
+ }
3632
+ /**
3633
+ * Enum for job type
3634
+ */
3635
+ declare enum JobType {
3636
+ Unattended = "Unattended",
3637
+ Attended = "Attended",
3638
+ ServerlessGeneric = "ServerlessGeneric"
3639
+ }
3640
+ /**
3641
+ * Interface for argument metadata
3642
+ */
3643
+ interface ArgumentMetadata {
3644
+ input?: string;
3645
+ output?: string;
3646
+ }
3647
+ /**
3648
+ * Interface for job response
3649
+ */
3650
+ interface ProcessStartResponse extends ProcessProperties, FolderProperties {
3651
+ key: string;
3652
+ startTime: string | null;
3653
+ endTime: string | null;
3654
+ state: JobState;
3655
+ source: string;
3656
+ sourceType: string;
3657
+ batchExecutionKey: string;
3658
+ info: string | null;
3659
+ createdTime: string;
3660
+ startingScheduleId: number | null;
3661
+ processName: string;
3662
+ type: JobType;
3663
+ inputFile: string | null;
3664
+ outputArguments: string | null;
3665
+ outputFile: string | null;
3666
+ hostMachineName: string | null;
3667
+ persistenceId: string | null;
3668
+ resumeVersion: number | null;
3669
+ stopStrategy: StopStrategy | null;
3670
+ runtimeType: string;
3671
+ processVersionId: number | null;
3672
+ reference: string;
3673
+ packageType: PackageType;
3674
+ machine?: Machine;
3675
+ resumeOnSameContext: boolean;
3676
+ localSystemAccount: string;
3677
+ orchestratorUserIdentity: string | null;
3678
+ startingTriggerId: string | null;
3679
+ maxExpectedRunningTimeSeconds: number | null;
3680
+ parentJobKey: string | null;
3681
+ resumeTime: string | null;
3682
+ lastModifiedTime: string | null;
3683
+ jobError: JobError | null;
3684
+ errorCode: string | null;
3685
+ robot?: RobotMetadata;
3686
+ id: number;
3687
+ }
3688
+ /**
3689
+ * Interface for process response
3690
+ */
3691
+ interface ProcessGetResponse extends ProcessProperties, FolderProperties {
3692
+ key: string;
3693
+ packageKey: string;
3694
+ packageVersion: string;
3695
+ isLatestVersion: boolean;
3696
+ isPackageDeleted: boolean;
3697
+ description: string;
3698
+ name: string;
3699
+ entryPointId: number;
3700
+ packageType: PackageType;
3701
+ supportsMultipleEntryPoints: boolean;
3702
+ isConversational: boolean | null;
3703
+ minRequiredRobotVersion: string | null;
3704
+ isCompiled: boolean;
3705
+ arguments: ArgumentMetadata;
3706
+ autoUpdate: boolean;
3707
+ hiddenForAttendedUser: boolean;
3708
+ feedId: string;
3709
+ folderKey: string;
3710
+ targetFramework: TargetFramework;
3711
+ robotSize: RobotSize | null;
3712
+ lastModifiedTime: string | null;
3713
+ lastModifierUserId: number | null;
3714
+ createdTime: string;
3715
+ creatorUserId: number;
3716
+ id: number;
3717
+ }
3718
+ /**
3719
+ * Options for getting processes across folders
3720
+ */
3721
+ type ProcessGetAllOptions = RequestOptions & PaginationOptions & {
3722
+ /**
3723
+ * Optional folder ID to filter processes by folder
3724
+ */
3725
+ folderId?: number;
3726
+ };
3727
+ /**
3728
+ * Options for getting a single process by ID
3729
+ */
3730
+ type ProcessGetByIdOptions = BaseOptions;
3731
+
3732
+ /**
3733
+ * Service for managing and executing UiPath Automation Processes.
3734
+ *
3735
+ * 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)
3736
+ */
3737
+ interface ProcessServiceModel {
3738
+ /**
3739
+ * Gets all processes across folders with optional filtering
3740
+ * Returns a NonPaginatedResponse with data and totalCount when no pagination parameters are provided,
3741
+ * or a PaginatedResponse when any pagination parameter is provided
3742
+ *
3743
+ * @param options - Query options including optional folderId and pagination options
3744
+ * @returns Promise resolving to either an array of processes NonPaginatedResponse<ProcessGetResponse> or a PaginatedResponse<ProcessGetResponse> when pagination options are used.
3745
+ * {@link ProcessGetResponse}
3746
+ * @example
3747
+ * ```typescript
3748
+ * // Standard array return
3749
+ * const processes = await sdk.processes.getAll();
3750
+ *
3751
+ * // Get processes within a specific folder
3752
+ * const processes = await sdk.processes.getAll({
3753
+ * folderId: <folderId>
3754
+ * });
3755
+ *
3756
+ * // Get processes with filtering
3757
+ * const processes = await sdk.processes.getAll({
3758
+ * filter: "name eq 'MyProcess'"
3759
+ * });
3760
+ *
3761
+ * // First page with pagination
3762
+ * const page1 = await sdk.processes.getAll({ pageSize: 10 });
3763
+ *
3764
+ * // Navigate using cursor
3765
+ * if (page1.hasNextPage) {
3766
+ * const page2 = await sdk.processes.getAll({ cursor: page1.nextCursor });
3767
+ * }
3768
+ *
3769
+ * // Jump to specific page
3770
+ * const page5 = await sdk.processes.getAll({
3771
+ * jumpToPage: 5,
3772
+ * pageSize: 10
3773
+ * });
3774
+ * ```
3775
+ */
3776
+ getAll<T extends ProcessGetAllOptions = ProcessGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessGetResponse> : NonPaginatedResponse<ProcessGetResponse>>;
3777
+ /**
3778
+ * Gets a single process by ID
3779
+ *
3780
+ * @param id - Process ID
3781
+ * @param folderId - Required folder ID
3782
+ * @param options - Optional query parameters
3783
+ * @returns Promise resolving to a single process
3784
+ * {@link ProcessGetResponse}
3785
+ * @example
3786
+ * ```typescript
3787
+ * // Get process by ID
3788
+ * const process = await sdk.processes.getById(<processId>, <folderId>);
3789
+ * ```
3790
+ */
3791
+ getById(id: number, folderId: number, options?: ProcessGetByIdOptions): Promise<ProcessGetResponse>;
3792
+ /**
3793
+ * Starts a process with the specified configuration
3794
+ *
3795
+ * @param request - Process start configuration
3796
+ * @param folderId - Required folder ID
3797
+ * @param options - Optional request options
3798
+ * @returns Promise resolving to array of started process instances
3799
+ * {@link ProcessStartResponse}
3800
+ * @example
3801
+ * ```typescript
3802
+ * // Start a process by process key
3803
+ * const process = await sdk.processes.start({
3804
+ * processKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3805
+ * }, <folderId>); // folderId is required
3806
+ *
3807
+ * // Start a process by name with specific robots
3808
+ * const process = await sdk.processes.start({
3809
+ * processName: "MyProcess"
3810
+ * }, <folderId>); // folderId is required
3811
+ * ```
3812
+ */
3813
+ start(request: ProcessStartRequest, folderId: number, options?: RequestOptions): Promise<ProcessStartResponse[]>;
3814
+ }
3815
+
3816
+ /**
3817
+ * Service for interacting with UiPath Orchestrator Processes API
3818
+ */
3819
+ declare class ProcessService extends BaseService implements ProcessServiceModel {
3820
+ /**
3821
+ * @hideconstructor
3822
+ */
3823
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
3824
+ /**
3825
+ * Gets all processes across folders with optional filtering and folder scoping
3826
+ *
3827
+ * The method returns either:
3828
+ * - An array of processes (when no pagination parameters are provided)
3829
+ * - A paginated result with navigation cursors (when any pagination parameter is provided)
3830
+ *
3831
+ * @param options - Query options including optional folderId
3832
+ * @returns Promise resolving to an array of processes or paginated result
3833
+ *
3834
+ * @example
3835
+ * ```typescript
3836
+ * // Standard array return
3837
+ * const processes = await sdk.processes.getAll();
3838
+ *
3839
+ * // Get processes within a specific folder
3840
+ * const processes = await sdk.processes.getAll({
3841
+ * folderId: 123
3842
+ * });
3843
+ *
3844
+ * // Get processes with filtering
3845
+ * const processes = await sdk.processes.getAll({
3846
+ * filter: "name eq 'MyProcess'"
3847
+ * });
3848
+ *
3849
+ * // First page with pagination
3850
+ * const page1 = await sdk.processes.getAll({ pageSize: 10 });
3851
+ *
3852
+ * // Navigate using cursor
3853
+ * if (page1.hasNextPage) {
3854
+ * const page2 = await sdk.processes.getAll({ cursor: page1.nextCursor });
3855
+ * }
3856
+ *
3857
+ * // Jump to specific page
3858
+ * const page5 = await sdk.processes.getAll({
3859
+ * jumpToPage: 5,
3860
+ * pageSize: 10
3861
+ * });
3862
+ * ```
3863
+ */
3864
+ getAll<T extends ProcessGetAllOptions = ProcessGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessGetResponse> : NonPaginatedResponse<ProcessGetResponse>>;
3865
+ /**
3866
+ * Starts a process execution (job)
3867
+ *
3868
+ * @param request - Process start request body
3869
+ * @param folderId - Required folder ID
3870
+ * @param options - Optional query parameters
3871
+ * @returns Promise resolving to the created jobs
3872
+ *
3873
+ * @example
3874
+ * ```typescript
3875
+ * // Start a process by process key
3876
+ * const jobs = await sdk.processes.start({
3877
+ * processKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3878
+ * }, 123); // folderId is required
3879
+ *
3880
+ * // Start a process by name with specific robots
3881
+ * const jobs = await sdk.processes.start({
3882
+ * processName: "MyProcess"
3883
+ * }, 123); // folderId is required
3884
+ * ```
3885
+ */
3886
+ start(request: ProcessStartRequest, folderId: number, options?: RequestOptions): Promise<ProcessStartResponse[]>;
3887
+ /**
3888
+ * Gets a single process by ID
3889
+ *
3890
+ * @param id - Process ID
3891
+ * @param folderId - Required folder ID
3892
+ * @param options - Optional query parameters
3893
+ * @returns Promise resolving to a single process
3894
+ *
3895
+ * @example
3896
+ * ```typescript
3897
+ * // Get process by ID
3898
+ * const process = await sdk.processes.getById(123, 456);
3899
+ * ```
3900
+ */
3901
+ getById(id: number, folderId: number, options?: ProcessGetByIdOptions): Promise<ProcessGetResponse>;
3902
+ }
3903
+
3904
+ /**
3905
+ * Interface for queue response
3906
+ */
3907
+ interface QueueGetResponse {
3908
+ key: string;
3909
+ name: string;
3910
+ id: number;
3911
+ description: string;
3912
+ maxNumberOfRetries: number;
3913
+ acceptAutomaticallyRetry: boolean;
3914
+ retryAbandonedItems: boolean;
3915
+ enforceUniqueReference: boolean;
3916
+ encrypted: boolean;
3917
+ specificDataJsonSchema: string | null;
3918
+ outputDataJsonSchema: string | null;
3919
+ analyticsDataJsonSchema: string | null;
3920
+ createdTime: string;
3921
+ processScheduleId: number | null;
3922
+ slaInMinutes: number;
3923
+ riskSlaInMinutes: number;
3924
+ releaseId: number | null;
3925
+ isProcessInCurrentFolder: boolean | null;
3926
+ foldersCount: number;
3927
+ folderId: number;
3928
+ folderName: string;
3929
+ }
3930
+ /**
3931
+ * Options for getting queues across folders
3932
+ */
3933
+ type QueueGetAllOptions = RequestOptions & PaginationOptions & {
3934
+ /**
3935
+ * Optional folder ID to filter queues by folder
3936
+ */
3937
+ folderId?: number;
3938
+ };
3939
+ type QueueGetByIdOptions = BaseOptions;
3940
+
3941
+ /**
3942
+ * Service for managing UiPath Queues
3943
+ *
3944
+ * 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)
3945
+ */
3946
+ interface QueueServiceModel {
3947
+ /**
3948
+ * Gets all queues across folders with optional filtering and folder scoping
3949
+ *
3950
+ * @signature getAll(options?) → Promise&lt;QueueGetResponse[]&gt;
3951
+ * @param options Query options including optional folderId and pagination options
3952
+ * @returns Promise resolving to either an array of queues NonPaginatedResponse<QueueGetResponse> or a PaginatedResponse<QueueGetResponse> when pagination options are used.
3953
+ * {@link QueueGetResponse}
3954
+ * @example
3955
+ * ```typescript
3956
+ * // Standard array return
3957
+ * const queues = await sdk.queues.getAll();
3958
+ *
3959
+ * // Get queues within a specific folder
3960
+ * const queues = await sdk.queues.getAll({
3961
+ * folderId: <folderId>
3962
+ * });
3963
+ *
3964
+ * // Get queues with filtering
3965
+ * const queues = await sdk.queues.getAll({
3966
+ * filter: "name eq 'MyQueue'"
3967
+ * });
3968
+ *
3969
+ * // First page with pagination
3970
+ * const page1 = await sdk.queues.getAll({ pageSize: 10 });
3971
+ *
3972
+ * // Navigate using cursor
3973
+ * if (page1.hasNextPage) {
3974
+ * const page2 = await sdk.queues.getAll({ cursor: page1.nextCursor });
3975
+ * }
3976
+ *
3977
+ * // Jump to specific page
3978
+ * const page5 = await sdk.queues.getAll({
3979
+ * jumpToPage: 5,
3980
+ * pageSize: 10
3981
+ * });
3982
+ * ```
3983
+ */
3984
+ getAll<T extends QueueGetAllOptions = QueueGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<QueueGetResponse> : NonPaginatedResponse<QueueGetResponse>>;
3985
+ /**
3986
+ * Gets a single queue by ID
3987
+ *
3988
+ * @param id - Queue ID
3989
+ * @param folderId - Required folder ID
3990
+ * @returns Promise resolving to a queue definition
3991
+ * @example
3992
+ * ```typescript
3993
+ * // Get queue by ID
3994
+ * const queue = await sdk.queues.getById(<queueId>, <folderId>);
3995
+ * ```
3996
+ */
3997
+ getById(id: number, folderId: number, options?: QueueGetByIdOptions): Promise<QueueGetResponse>;
3998
+ }
3999
+
4000
+ /**
4001
+ * Service for interacting with UiPath Orchestrator Queues API
4002
+ */
4003
+ declare class QueueService extends FolderScopedService implements QueueServiceModel {
4004
+ /**
4005
+ * @hideconstructor
4006
+ */
4007
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
4008
+ /**
4009
+ * Gets all queues across folders with optional filtering and folder scoping
4010
+ *
4011
+ * The method returns either:
4012
+ * - An array of queues (when no pagination parameters are provided)
4013
+ * - A paginated result with navigation cursors (when any pagination parameter is provided)
4014
+ *
4015
+ * @param options - Query options including optional folderId
4016
+ * @returns Promise resolving to an array of queues or paginated result
4017
+ *
4018
+ * @example
4019
+ * ```typescript
4020
+ * // Standard array return
4021
+ * const queues = await sdk.queues.getAll();
4022
+ *
4023
+ * // Get queues within a specific folder
4024
+ * const queues = await sdk.queues.getAll({
4025
+ * folderId: 123
4026
+ * });
4027
+ *
4028
+ * // Get queues with filtering
4029
+ * const queues = await sdk.queues.getAll({
4030
+ * filter: "name eq 'MyQueue'"
4031
+ * });
4032
+ *
4033
+ * // First page with pagination
4034
+ * const page1 = await sdk.queues.getAll({ pageSize: 10 });
4035
+ *
4036
+ * // Navigate using cursor
4037
+ * if (page1.hasNextPage) {
4038
+ * const page2 = await sdk.queues.getAll({ cursor: page1.nextCursor });
4039
+ * }
4040
+ *
4041
+ * // Jump to specific page
4042
+ * const page5 = await sdk.queues.getAll({
4043
+ * jumpToPage: 5,
4044
+ * pageSize: 10
4045
+ * });
4046
+ * ```
4047
+ */
4048
+ getAll<T extends QueueGetAllOptions = QueueGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<QueueGetResponse> : NonPaginatedResponse<QueueGetResponse>>;
4049
+ /**
4050
+ * Gets a single queue by ID
4051
+ *
4052
+ * @param id - Queue ID
4053
+ * @param folderId - Required folder ID
4054
+ * @returns Promise resolving to a queue definition
4055
+ *
4056
+ * @example
4057
+ * ```typescript
4058
+ * // Get queue by ID
4059
+ * const queue = await sdk.queues.getById(123, 456);
4060
+ * ```
4061
+ */
4062
+ getById(id: number, folderId: number, options?: QueueGetByIdOptions): Promise<QueueGetResponse>;
4063
+ }
4064
+
4065
+ /**
4066
+ * Service for interacting with UiPath Tasks API
4067
+ */
4068
+ declare class TaskService extends BaseService implements TaskServiceModel {
4069
+ /**
4070
+ * @hideconstructor
4071
+ */
4072
+ constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
4073
+ /**
4074
+ * Creates a new task
4075
+ * @param task - The task to be created
4076
+ * @param folderId - Required folder ID
4077
+ * @returns Promise resolving to the created task
4078
+ *
4079
+ * @example
4080
+ * ```typescript
4081
+ * const task = await sdk.tasks.create({
4082
+ * title: "My Task",
4083
+ * priority: TaskPriority.Medium,
4084
+ * data: { key: "value" }
4085
+ * }, 123); // folderId is required
4086
+ * ```
4087
+ */
4088
+ create(task: TaskCreateOptions, folderId: number): Promise<TaskCreateResponse>;
4089
+ /**
4090
+ * Gets users in the given folder who have Tasks.View and Tasks.Edit permissions
4091
+ *
4092
+ * The method returns either:
4093
+ * - An array of users (when no pagination parameters are provided)
4094
+ * - A paginated result with navigation cursors (when any pagination parameter is provided)
4095
+ *
4096
+ * @param folderId - The folder ID to get users from
4097
+ * @param options - Optional query and pagination parameters
4098
+ * @returns Promise resolving to an array of users or paginated result
4099
+ *
4100
+ * @example
4101
+ * ```typescript
4102
+ * // Standard array return
4103
+ * const users = await sdk.tasks.getUsers(123);
4104
+ *
4105
+ * // Get users with filtering
4106
+ * const users = await sdk.tasks.getUsers(123, {
4107
+ * filter: "name eq 'abc'"
4108
+ * });
4109
+ *
4110
+ * // First page with pagination
4111
+ * const page1 = await sdk.tasks.getUsers(123, { pageSize: 10 });
4112
+ *
4113
+ * // Navigate using cursor
4114
+ * if (page1.hasNextPage) {
4115
+ * const page2 = await sdk.tasks.getUsers(123, { cursor: page1.nextCursor });
4116
+ * }
4117
+ *
4118
+ * // Jump to specific page
4119
+ * const page5 = await sdk.tasks.getUsers(123, {
4120
+ * jumpToPage: 5,
4121
+ * pageSize: 10
4122
+ * });
4123
+ * ```
4124
+ */
4125
+ getUsers<T extends TaskGetUsersOptions = TaskGetUsersOptions>(folderId: number, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<UserLoginInfo> : NonPaginatedResponse<UserLoginInfo>>;
4126
+ /**
4127
+ * Gets tasks across folders with optional filtering and folder scoping
4128
+ *
4129
+ * The method returns either:
4130
+ * - An array of tasks (when no pagination parameters are provided)
4131
+ * - A paginated result with navigation cursors (when any pagination parameter is provided)
4132
+ *
4133
+ * @param options - Query options including optional folderId and pagination options
4134
+ * @returns Promise resolving to an array of tasks or paginated result
4135
+ *
4136
+ * @example
4137
+ * ```typescript
4138
+ * // Standard array return
4139
+ * const tasks = await sdk.tasks.getAll();
4140
+ *
4141
+ * // Get tasks within a specific folder
4142
+ * const tasks = await sdk.tasks.getAll({
4143
+ * folderId: 123
4144
+ * });
4145
+ *
4146
+ * // First page with pagination
4147
+ * const page1 = await sdk.tasks.getAll({ pageSize: 10 });
4148
+ *
4149
+ * // Navigate using cursor
4150
+ * if (page1.hasNextPage) {
4151
+ * const page2 = await sdk.tasks.getAll({ cursor: page1.nextCursor });
4152
+ * }
4153
+ *
4154
+ * // Jump to specific page
4155
+ * const page5 = await sdk.tasks.getAll({
4156
+ * jumpToPage: 5,
4157
+ * pageSize: 10
4158
+ * });
4159
+ * ```
4160
+ */
4161
+ getAll<T extends TaskGetAllOptions = TaskGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<TaskGetResponse> : NonPaginatedResponse<TaskGetResponse>>;
4162
+ /**
4163
+ * Gets a task by ID
4164
+ *
4165
+ * @param id - The ID of the task to retrieve
4166
+ * @param options - Optional query parameters
4167
+ * @param folderId - Optional folder ID
4168
+ * @returns Promise resolving to the task (form tasks will return form-specific data)
4169
+ *
4170
+ * @example
4171
+ * ```typescript
4172
+ * // Get task by ID
4173
+ * const task = await sdk.tasks.getById(123);
4174
+ *
4175
+ * // If the task is a form task, it will automatically return form-specific data
4176
+ * ```
4177
+ */
4178
+ getById(id: number, options?: TaskGetByIdOptions, folderId?: number): Promise<TaskGetResponse>;
4179
+ /**
4180
+ * Assigns tasks to users
4181
+ *
4182
+ * @param taskAssignments - Single task assignment or array of task assignments
4183
+ * @param folderId - Optional folder ID
4184
+ * @returns Promise resolving to array of task assignment results
4185
+ *
4186
+ * @example
4187
+ * ```typescript
4188
+ * // Assign a single task to a user by ID
4189
+ * const result = await sdk.tasks.assign({
4190
+ * taskId: 123,
4191
+ * userId: 456
4192
+ * });
4193
+ *
4194
+ * // Assign a single task to a user by email
4195
+ * const result = await sdk.tasks.assign({
4196
+ * taskId: 123,
4197
+ * userNameOrEmail: "user@example.com"
4198
+ * });
4199
+ *
4200
+ * // Assign multiple tasks
4201
+ * const result = await sdk.tasks.assign([
4202
+ * {
4203
+ * taskId: 123,
4204
+ * userId: 456
4205
+ * },
4206
+ * {
4207
+ * taskId: 789,
4208
+ * userNameOrEmail: "user@example.com"
4209
+ * }
4210
+ * ]);
4211
+ * ```
4212
+ */
4213
+ assign(taskAssignments: TaskAssignmentOptions | TaskAssignmentOptions[], folderId?: number): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
4214
+ /**
4215
+ * Reassigns tasks to new users
4216
+ *
4217
+ * @param taskAssignments - Single task assignment or array of task assignments
4218
+ * @param folderId - Optional folder ID
4219
+ * @returns Promise resolving to array of task assignment results
4220
+ *
4221
+ * @example
4222
+ * ```typescript
4223
+ * // Reassign a single task to a user by ID
4224
+ * const result = await sdk.tasks.reassign({
4225
+ * taskId: 123,
4226
+ * userId: 456
4227
+ * });
4228
+ *
4229
+ * // Reassign a single task to a user by email
4230
+ * const result = await sdk.tasks.reassign({
4231
+ * taskId: 123,
4232
+ * userNameOrEmail: "user@example.com"
4233
+ * });
4234
+ *
4235
+ * // Reassign multiple tasks
4236
+ * const result = await sdk.tasks.reassign([
4237
+ * {
4238
+ * taskId: 123,
4239
+ * userId: 456
4240
+ * },
4241
+ * {
4242
+ * taskId: 789,
4243
+ * userNameOrEmail: "user@example.com"
4244
+ * }
4245
+ * ]);
4246
+ * ```
4247
+ */
4248
+ reassign(taskAssignments: TaskAssignmentOptions | TaskAssignmentOptions[], folderId?: number): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
4249
+ /**
4250
+ * Unassigns tasks (removes current assignees)
4251
+ *
4252
+ * @param taskIds - Single task ID or array of task IDs to unassign
4253
+ * @param folderId - Optional folder ID
4254
+ * @returns Promise resolving to array of task assignment results
4255
+ *
4256
+ * @example
4257
+ * ```typescript
4258
+ * // Unassign a single task
4259
+ * const result = await sdk.tasks.unassign(123);
4260
+ *
4261
+ * // Unassign multiple tasks
4262
+ * const result = await sdk.tasks.unassign([123, 456, 789]);
4263
+ * ```
4264
+ */
4265
+ unassign(taskIds: number | number[], folderId?: number): Promise<OperationResponse<{
4266
+ taskId: number;
4267
+ }[] | TaskAssignmentResponse[]>>;
4268
+ /**
4269
+ * Completes a task with the specified type and data
4270
+ *
4271
+ * @param completionType - The type of task (Form, App, or Generic)
4272
+ * @param options - The completion options
4273
+ * @param folderId - Required folder ID
4274
+ * @returns Promise resolving to void
4275
+ *
4276
+ * @example
4277
+ * ```typescript
4278
+ * // Complete an app task
4279
+ * await sdk.tasks.complete(TaskType.App, {
4280
+ * taskId: 456,
4281
+ * data: {},
4282
+ * action: "submit"
4283
+ * }, 123); // folderId is required
4284
+ *
4285
+ * // Complete an external task
4286
+ * await sdk.tasks.complete(TaskType.ExternalTask, {
4287
+ * taskId: 789
4288
+ * }, 123); // folderId is required
4289
+ * ```
4290
+ */
4291
+ complete(completionType: TaskType, options: TaskCompletionOptions, folderId: number): Promise<OperationResponse<TaskCompletionOptions>>;
4292
+ /**
4293
+ * Gets a form task by ID (private method)
4294
+ *
4295
+ * @param id - The ID of the form task to retrieve
4296
+ * @param folderId - Required folder ID
4297
+ * @param options - Optional query parameters
4298
+ * @returns Promise resolving to the form task
4299
+ */
4300
+ private getFormTaskById;
4301
+ /**
4302
+ * Process parameters for task queries with folder filtering
4303
+ * @param options - The REST API options to process
4304
+ * @param folderId - Optional folder ID to filter by
4305
+ * @returns Processed options with folder filtering applied if needed
4306
+ * @private
4307
+ */
4308
+ private processTaskParameters;
4309
+ }
4310
+
4311
+ interface BaseConfig {
4312
+ baseUrl: string;
4313
+ orgName: string;
4314
+ tenantName: string;
4315
+ }
4316
+ interface OAuthFields {
4317
+ clientId: string;
4318
+ redirectUri: string;
4319
+ scope: string;
4320
+ }
4321
+ type UiPathSDKConfig = BaseConfig & ({
4322
+ secret: string;
4323
+ clientId?: never;
4324
+ redirectUri?: never;
4325
+ scope?: never;
4326
+ } | ({
4327
+ secret?: never;
4328
+ } & OAuthFields));
4329
+
4330
+ declare class UiPath {
4331
+ private config;
4332
+ private executionContext;
4333
+ private authService;
4334
+ private initialized;
4335
+ private readonly _services;
4336
+ constructor(config: UiPathSDKConfig);
4337
+ /**
4338
+ * Initialize the SDK based on the provided configuration.
4339
+ * This method handles both OAuth flow initiation and completion automatically.
4340
+ * For secret-based authentication, initialization is automatic.
4341
+ */
4342
+ initialize(): Promise<void>;
4343
+ /**
4344
+ * Check if the SDK has been initialized
4345
+ */
4346
+ isInitialized(): boolean;
4347
+ /**
4348
+ * Check if we're in an OAuth callback state
4349
+ */
4350
+ isInOAuthCallback(): boolean;
4351
+ /**
4352
+ * Complete OAuth authentication flow (only call if isInOAuthCallback() is true)
4353
+ */
4354
+ completeOAuth(): Promise<boolean>;
4355
+ /**
4356
+ * Check if the user is authenticated (has valid token)
4357
+ */
4358
+ isAuthenticated(): boolean;
4359
+ /**
4360
+ * Get the current authentication token
4361
+ */
4362
+ getToken(): string | undefined;
4363
+ private getService;
4364
+ /**
4365
+ * Access to Maestro services
4366
+ */
4367
+ get maestro(): {
4368
+ /**
4369
+ * Access to Maestro Processes service
4370
+ */
4371
+ processes: MaestroProcessesService & {
4372
+ /**
4373
+ * Access to Process Instances service
4374
+ */
4375
+ instances: ProcessInstancesService;
4376
+ };
4377
+ /**
4378
+ * Access to Maestro Cases service
4379
+ */
4380
+ cases: CasesService & {
4381
+ /**
4382
+ * Access to Case Instances service
4383
+ */
4384
+ instances: CaseInstancesService;
4385
+ };
4386
+ };
4387
+ /**
4388
+ * Access to Entity service
4389
+ */
4390
+ get entities(): EntityService;
4391
+ /**
4392
+ * Access to Tasks service
4393
+ */
4394
+ get tasks(): TaskService;
4395
+ /**
4396
+ * Access to Orchestrator Processes service
4397
+ */
4398
+ get processes(): ProcessService;
4399
+ /**
4400
+ * Access to Orchestrator Buckets service
4401
+ */
4402
+ get buckets(): BucketService;
4403
+ /**
4404
+ * Access to Orchestrator Queues service
4405
+ */
4406
+ get queues(): QueueService;
4407
+ /**
4408
+ * Access to Orchestrator Assets service
4409
+ */
4410
+ get assets(): AssetService;
4411
+ }
4412
+
4413
+ /**
4414
+ * Error thrown when authorization fails (403 errors)
4415
+ * Common scenarios:
4416
+ * - Insufficient permissions
4417
+ * - Access denied to resource
4418
+ * - Invalid scope
4419
+ */
4420
+ declare class AuthorizationError extends UiPathError {
4421
+ constructor(params?: Partial<ErrorParams>);
4422
+ }
4423
+
4424
+ /**
4425
+ * Error thrown when validation fails (400 errors or client-side validation)
4426
+ * Common scenarios:
4427
+ * - Invalid input parameters
4428
+ * - Missing required fields
4429
+ * - Invalid data format
4430
+ */
4431
+ declare class ValidationError extends UiPathError {
4432
+ constructor(params?: Partial<ErrorParams>);
4433
+ }
4434
+
4435
+ /**
4436
+ * Error thrown when a resource is not found (404 errors)
4437
+ * Common scenarios:
4438
+ * - Resource doesn't exist
4439
+ * - Invalid ID provided
4440
+ * - Resource deleted
4441
+ */
4442
+ declare class NotFoundError extends UiPathError {
4443
+ constructor(params?: Partial<ErrorParams>);
4444
+ }
4445
+
4446
+ /**
4447
+ * Error thrown when rate limit is exceeded (429 errors)
4448
+ * Common scenarios:
4449
+ * - Too many requests in a time window
4450
+ * - API throttling
4451
+ */
4452
+ declare class RateLimitError extends UiPathError {
4453
+ constructor(params?: Partial<ErrorParams>);
4454
+ }
4455
+
4456
+ /**
4457
+ * Error thrown when server encounters an error (5xx errors)
4458
+ * Common scenarios:
4459
+ * - Internal server error
4460
+ * - Service unavailable
4461
+ * - Gateway timeout
4462
+ */
4463
+ declare class ServerError extends UiPathError {
4464
+ constructor(params?: Partial<ErrorParams>);
4465
+ /**
4466
+ * Checks if this is a temporary error that might succeed on retry
4467
+ */
4468
+ get isRetryable(): boolean;
4469
+ }
4470
+
4471
+ /**
4472
+ * Base error creation parameters - only what's needed
4473
+ */
4474
+ interface ErrorParams {
4475
+ message: string;
4476
+ statusCode?: number;
4477
+ requestId?: string;
4478
+ }
4479
+
4480
+ /**
4481
+ * Base error class for all UiPath SDK errors
4482
+ * Pure TypeScript class with clean interface
4483
+ */
4484
+ declare abstract class UiPathError {
4485
+ /**
4486
+ * Error type identifier (e.g., "AuthenticationError", "ValidationError")
4487
+ */
4488
+ readonly type: string;
4489
+ /**
4490
+ * Error message describing what went wrong
4491
+ */
4492
+ readonly message: string;
4493
+ /**
4494
+ * HTTP status code (400, 401, 403, 404, 500, etc.)
4495
+ */
4496
+ readonly statusCode?: number;
4497
+ /**
4498
+ * Request ID for tracking with UiPath support
4499
+ */
4500
+ readonly requestId?: string;
4501
+ /**
4502
+ * Timestamp when the error occurred
4503
+ */
4504
+ readonly timestamp: Date;
4505
+ /**
4506
+ * Stack trace for debugging
4507
+ */
4508
+ readonly stack?: string;
4509
+ protected constructor(type: string, params: ErrorParams);
4510
+ /**
4511
+ * Returns a clean JSON representation of the error
4512
+ */
4513
+ private toJSON;
4514
+ /**
4515
+ * Returns detailed debug information including stack trace
4516
+ */
4517
+ getDebugInfo(): Record<string, unknown>;
4518
+ }
4519
+
4520
+ /**
4521
+ * Error thrown when authentication fails (401 errors)
4522
+ * Common scenarios:
4523
+ * - Invalid credentials
4524
+ * - Expired token
4525
+ * - Missing authentication
4526
+ */
4527
+ declare class AuthenticationError extends UiPathError {
4528
+ constructor(params?: Partial<ErrorParams>);
4529
+ }
4530
+
4531
+ /**
4532
+ * Error thrown when network/connection issues occur
4533
+ * Common scenarios:
4534
+ * - Connection timeout
4535
+ * - DNS resolution failure
4536
+ * - Network unreachable
4537
+ * - Request aborted
4538
+ */
4539
+ declare class NetworkError extends UiPathError {
4540
+ constructor(params?: Partial<ErrorParams>);
4541
+ }
4542
+
4543
+ /**
4544
+ * Type guard to check if an error is a UiPathError
4545
+ */
4546
+ declare function isUiPathError(error: unknown): error is UiPathError;
4547
+ /**
4548
+ * Type guard to check if an error is an AuthenticationError
4549
+ */
4550
+ declare function isAuthenticationError(error: unknown): error is AuthenticationError;
4551
+ /**
4552
+ * Type guard to check if an error is an AuthorizationError
4553
+ */
4554
+ declare function isAuthorizationError(error: unknown): error is AuthorizationError;
4555
+ /**
4556
+ * Type guard to check if an error is a ValidationError
4557
+ */
4558
+ declare function isValidationError(error: unknown): error is ValidationError;
4559
+ /**
4560
+ * Type guard to check if an error is a NotFoundError
4561
+ */
4562
+ declare function isNotFoundError(error: unknown): error is NotFoundError;
4563
+ /**
4564
+ * Type guard to check if an error is a RateLimitError
4565
+ */
4566
+ declare function isRateLimitError(error: unknown): error is RateLimitError;
4567
+ /**
4568
+ * Type guard to check if an error is a ServerError
4569
+ */
4570
+ declare function isServerError(error: unknown): error is ServerError;
4571
+ /**
4572
+ * Type guard to check if an error is a NetworkError
4573
+ */
4574
+ declare function isNetworkError(error: unknown): error is NetworkError;
4575
+ /**
4576
+ * Helper to get error details in a safe way
4577
+ */
4578
+ declare function getErrorDetails(error: unknown): {
4579
+ message: string;
4580
+ statusCode?: number;
4581
+ };
4582
+
4583
+ /**
4584
+ * HTTP status code constants for error handling
4585
+ */
4586
+ declare const HttpStatus: {
4587
+ readonly BAD_REQUEST: 400;
4588
+ readonly UNAUTHORIZED: 401;
4589
+ readonly FORBIDDEN: 403;
4590
+ readonly NOT_FOUND: 404;
4591
+ readonly TOO_MANY_REQUESTS: 429;
4592
+ readonly INTERNAL_SERVER_ERROR: 500;
4593
+ readonly NOT_IMPLEMENTED: 501;
4594
+ readonly BAD_GATEWAY: 502;
4595
+ readonly SERVICE_UNAVAILABLE: 503;
4596
+ readonly GATEWAY_TIMEOUT: 504;
4597
+ };
4598
+ /**
4599
+ * Error type constants for consistent error identification
4600
+ */
4601
+ declare const ErrorType: {
4602
+ readonly AUTHENTICATION: "AuthenticationError";
4603
+ readonly AUTHORIZATION: "AuthorizationError";
4604
+ readonly VALIDATION: "ValidationError";
4605
+ readonly NOT_FOUND: "NotFoundError";
4606
+ readonly RATE_LIMIT: "RateLimitError";
4607
+ readonly SERVER: "ServerError";
4608
+ readonly NETWORK: "NetworkError";
4609
+ };
4610
+
4611
+ /**
4612
+ * Telemetry type definitions
4613
+ */
4614
+ interface TelemetryAttributes {
4615
+ [key: string]: string | number | boolean;
4616
+ }
4617
+ interface TelemetryConfig {
4618
+ baseUrl?: string;
4619
+ orgName?: string;
4620
+ tenantName?: string;
4621
+ clientId?: string;
4622
+ redirectUri?: string;
4623
+ }
4624
+ interface TrackOptions {
4625
+ condition?: boolean | ((...args: any[]) => boolean);
4626
+ attributes?: TelemetryAttributes;
4627
+ }
4628
+
4629
+ /**
4630
+ * SDK Track decorator and function for telemetry
4631
+ */
4632
+
4633
+ /**
4634
+ * Track decorator that can be used to automatically track function calls
4635
+ *
4636
+ * Usage:
4637
+ * @track("Service.Method")
4638
+ * function myFunction() { ... }
4639
+ *
4640
+ * @track("Queue.GetAll")
4641
+ * async getAll() { ... }
4642
+ *
4643
+ * @track("Tasks.Create")
4644
+ * async create() { ... }
4645
+ *
4646
+ * @track("Assets.Update", { condition: false })
4647
+ * function myFunction() { ... }
4648
+ *
4649
+ * @track("Processes.Start", { attributes: { customProp: "value" } })
4650
+ * function myFunction() { ... }
4651
+ */
4652
+ declare function track(nameOrOptions?: string | TrackOptions, options?: TrackOptions): MethodDecorator | ((target: any) => any);
4653
+ /**
4654
+ * Direct tracking function
4655
+ */
4656
+ declare function trackEvent(eventName: string, name?: string, attributes?: TelemetryAttributes): void;
4657
+
4658
+ /**
4659
+ * Singleton telemetry client
4660
+ */
4661
+ declare class TelemetryClient {
4662
+ private static instance;
4663
+ private isInitialized;
4664
+ private logProvider?;
4665
+ private logger?;
4666
+ private telemetryContext?;
4667
+ private constructor();
4668
+ static getInstance(): TelemetryClient;
4669
+ /**
4670
+ * Initialize telemetry
4671
+ */
4672
+ initialize(config?: TelemetryConfig): void;
4673
+ private getConnectionString;
4674
+ private setupTelemetryProvider;
4675
+ /**
4676
+ * Track a telemetry event
4677
+ */
4678
+ track(eventName: string, name?: string, extraAttributes?: TelemetryAttributes): void;
4679
+ /**
4680
+ * Get enriched attributes for telemetry events
4681
+ */
4682
+ private getEnrichedAttributes;
4683
+ /**
4684
+ * Create cloud URL from base URL, organization ID, and tenant ID
4685
+ */
4686
+ private createCloudUrl;
4687
+ }
4688
+ declare const telemetryClient: TelemetryClient;
4689
+
4690
+ /**
4691
+ * SDK Telemetry constants
4692
+ */
4693
+ 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";
4694
+ declare const SDK_VERSION = "1.0.0-beta.14";
4695
+ declare const VERSION = "Version";
4696
+ declare const SERVICE = "Service";
4697
+ declare const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
4698
+ declare const CLOUD_TENANT_NAME = "CloudTenantName";
4699
+ declare const CLOUD_URL = "CloudUrl";
4700
+ declare const CLOUD_CLIENT_ID = "CloudClientId";
4701
+ declare const CLOUD_REDIRECT_URI = "CloudRedirectUri";
4702
+ declare const APP_NAME = "ApplicationName";
4703
+ declare const CLOUD_ROLE_NAME = "uipath-ts-sdk";
4704
+ declare const SDK_SERVICE_NAME = "UiPath.TypeScript.Sdk";
4705
+ declare const SDK_LOGGER_NAME = "uipath-ts-sdk-telemetry";
4706
+ declare const SDK_RUN_EVENT = "Sdk.Run";
4707
+ declare const UNKNOWN = "";
4708
+
4709
+ 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, EscalationActionType, EscalationRecipientScope, EscalationTriggerType, 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, SLADurationUnit, ServerError, StageTaskType, StartStrategy, StopStrategy, TargetFramework, TaskActivityType, TaskPriority, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, UNKNOWN, UiPath, UiPathError, VERSION, ValidationError, createCaseInstanceWithMethods, createEntityWithMethods, createProcessInstanceWithMethods, createTaskWithMethods, getErrorDetails, getLimitedPageSize, isAuthenticationError, isAuthorizationError, isNetworkError, isNotFoundError, isRateLimitError, isServerError, isUiPathError, isValidationError, telemetryClient, track, trackEvent };
4710
+ export type { ArgumentMetadata, AssetGetAllOptions, AssetGetByIdOptions, AssetGetResponse, AssetServiceModel, BaseConfig, BaseOptions, BlobItem, BodyOptions, BpmnXmlString, BucketGetAllOptions, BucketGetByIdOptions, BucketGetFileMetaDataOptions, BucketGetFileMetaDataResponse, BucketGetFileMetaDataWithPaginationOptions, BucketGetReadUriOptions, BucketGetResponse, BucketGetUriOptions, BucketGetUriResponse, BucketGetWriteUriOptions, 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, ProcessInstanceExecutionHistoryResponse, ProcessInstanceGetAllOptions, ProcessInstanceGetAllWithPaginationOptions, ProcessInstanceGetResponse, ProcessInstanceGetVariablesOptions, ProcessInstanceGetVariablesResponse, ProcessInstanceMethods, ProcessInstanceOperationOptions, ProcessInstanceOperationResponse, ProcessInstanceRun, ProcessInstancesServiceModel, ProcessProperties, ProcessServiceModel, ProcessStartRequest, ProcessStartResponse, QueryParams, QueueGetAllOptions, QueueGetByIdOptions, QueueGetResponse, QueueServiceModel, RawCaseInstanceGetResponse, RawEntityGetResponse, 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 };