hatchet-sdk 0.46.1__py3-none-any.whl → 1.0.0__py3-none-any.whl

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 (303) hide show
  1. hatchet_sdk/__init__.py +25 -16
  2. hatchet_sdk/client.py +14 -39
  3. hatchet_sdk/clients/admin.py +203 -362
  4. hatchet_sdk/clients/dispatcher/action_listener.py +106 -84
  5. hatchet_sdk/clients/dispatcher/dispatcher.py +21 -21
  6. hatchet_sdk/clients/event_ts.py +23 -10
  7. hatchet_sdk/clients/events.py +96 -99
  8. hatchet_sdk/clients/rest/__init__.py +24 -0
  9. hatchet_sdk/clients/rest/api/__init__.py +2 -0
  10. hatchet_sdk/clients/rest/api/task_api.py +2174 -0
  11. hatchet_sdk/clients/rest/api/workflow_runs_api.py +638 -106
  12. hatchet_sdk/clients/rest/api_client.py +1 -1
  13. hatchet_sdk/clients/rest/configuration.py +8 -1
  14. hatchet_sdk/clients/rest/exceptions.py +21 -0
  15. hatchet_sdk/clients/rest/models/__init__.py +22 -0
  16. hatchet_sdk/clients/rest/models/tenant.py +4 -0
  17. hatchet_sdk/clients/rest/models/tenant_version.py +37 -0
  18. hatchet_sdk/clients/rest/models/update_tenant_request.py +7 -0
  19. hatchet_sdk/clients/rest/models/v1_cancel_task_request.py +104 -0
  20. hatchet_sdk/clients/rest/models/v1_dag_children.py +102 -0
  21. hatchet_sdk/clients/rest/models/v1_replay_task_request.py +104 -0
  22. hatchet_sdk/clients/rest/models/v1_task.py +174 -0
  23. hatchet_sdk/clients/rest/models/v1_task_event.py +118 -0
  24. hatchet_sdk/clients/rest/models/v1_task_event_list.py +110 -0
  25. hatchet_sdk/clients/rest/models/v1_task_event_type.py +55 -0
  26. hatchet_sdk/clients/rest/models/v1_task_filter.py +106 -0
  27. hatchet_sdk/clients/rest/models/v1_task_point_metric.py +92 -0
  28. hatchet_sdk/clients/rest/models/v1_task_point_metrics.py +100 -0
  29. hatchet_sdk/clients/rest/models/v1_task_run_metric.py +88 -0
  30. hatchet_sdk/clients/rest/models/v1_task_run_status.py +40 -0
  31. hatchet_sdk/clients/rest/models/v1_task_status.py +40 -0
  32. hatchet_sdk/clients/rest/models/v1_task_summary.py +212 -0
  33. hatchet_sdk/clients/rest/models/v1_task_summary_list.py +110 -0
  34. hatchet_sdk/clients/rest/models/v1_workflow_run.py +171 -0
  35. hatchet_sdk/clients/rest/models/v1_workflow_run_details.py +145 -0
  36. hatchet_sdk/clients/rest/models/v1_workflow_type.py +37 -0
  37. hatchet_sdk/clients/rest/models/workflow_run_shape_item_for_workflow_run_details.py +99 -0
  38. hatchet_sdk/clients/rest/rest.py +37 -26
  39. hatchet_sdk/clients/rest/tenacity_utils.py +1 -1
  40. hatchet_sdk/clients/rest_client.py +141 -116
  41. hatchet_sdk/clients/run_event_listener.py +66 -60
  42. hatchet_sdk/clients/workflow_listener.py +77 -64
  43. hatchet_sdk/config.py +117 -0
  44. hatchet_sdk/connection.py +27 -13
  45. hatchet_sdk/context/__init__.py +0 -1
  46. hatchet_sdk/context/context.py +143 -202
  47. hatchet_sdk/features/cron.py +43 -57
  48. hatchet_sdk/features/scheduled.py +60 -74
  49. hatchet_sdk/hatchet.py +192 -195
  50. hatchet_sdk/labels.py +4 -6
  51. hatchet_sdk/metadata.py +1 -1
  52. hatchet_sdk/opentelemetry/instrumentor.py +112 -35
  53. hatchet_sdk/rate_limit.py +9 -18
  54. hatchet_sdk/token.py +13 -9
  55. hatchet_sdk/utils/aio_utils.py +0 -40
  56. hatchet_sdk/utils/proto_enums.py +54 -0
  57. hatchet_sdk/utils/typing.py +9 -1
  58. hatchet_sdk/v0/__init__.py +251 -0
  59. hatchet_sdk/v0/client.py +119 -0
  60. hatchet_sdk/v0/clients/admin.py +541 -0
  61. hatchet_sdk/v0/clients/dispatcher/action_listener.py +422 -0
  62. hatchet_sdk/v0/clients/dispatcher/dispatcher.py +204 -0
  63. hatchet_sdk/v0/clients/event_ts.py +28 -0
  64. hatchet_sdk/v0/clients/events.py +182 -0
  65. hatchet_sdk/v0/clients/rest/__init__.py +307 -0
  66. hatchet_sdk/v0/clients/rest/api/__init__.py +19 -0
  67. hatchet_sdk/v0/clients/rest/api/api_token_api.py +858 -0
  68. hatchet_sdk/v0/clients/rest/api/default_api.py +2259 -0
  69. hatchet_sdk/v0/clients/rest/api/event_api.py +2548 -0
  70. hatchet_sdk/v0/clients/rest/api/github_api.py +331 -0
  71. hatchet_sdk/v0/clients/rest/api/healthcheck_api.py +483 -0
  72. hatchet_sdk/v0/clients/rest/api/log_api.py +449 -0
  73. hatchet_sdk/v0/clients/rest/api/metadata_api.py +728 -0
  74. hatchet_sdk/v0/clients/rest/api/rate_limits_api.py +423 -0
  75. hatchet_sdk/v0/clients/rest/api/slack_api.py +577 -0
  76. hatchet_sdk/v0/clients/rest/api/sns_api.py +872 -0
  77. hatchet_sdk/v0/clients/rest/api/step_run_api.py +2202 -0
  78. hatchet_sdk/v0/clients/rest/api/tenant_api.py +4430 -0
  79. hatchet_sdk/v0/clients/rest/api/user_api.py +2888 -0
  80. hatchet_sdk/v0/clients/rest/api/worker_api.py +858 -0
  81. hatchet_sdk/v0/clients/rest/api/workflow_api.py +6312 -0
  82. hatchet_sdk/v0/clients/rest/api/workflow_run_api.py +1932 -0
  83. hatchet_sdk/v0/clients/rest/api/workflow_runs_api.py +610 -0
  84. hatchet_sdk/v0/clients/rest/api_client.py +759 -0
  85. hatchet_sdk/v0/clients/rest/api_response.py +22 -0
  86. hatchet_sdk/v0/clients/rest/configuration.py +611 -0
  87. hatchet_sdk/v0/clients/rest/exceptions.py +200 -0
  88. hatchet_sdk/v0/clients/rest/models/__init__.py +274 -0
  89. hatchet_sdk/v0/clients/rest/models/accept_invite_request.py +83 -0
  90. hatchet_sdk/v0/clients/rest/models/api_error.py +102 -0
  91. hatchet_sdk/v0/clients/rest/models/api_errors.py +100 -0
  92. hatchet_sdk/v0/clients/rest/models/api_meta.py +144 -0
  93. hatchet_sdk/v0/clients/rest/models/api_meta_auth.py +85 -0
  94. hatchet_sdk/v0/clients/rest/models/api_meta_integration.py +88 -0
  95. hatchet_sdk/v0/clients/rest/models/api_meta_posthog.py +90 -0
  96. hatchet_sdk/v0/clients/rest/models/api_resource_meta.py +98 -0
  97. hatchet_sdk/v0/clients/rest/models/api_token.py +105 -0
  98. hatchet_sdk/v0/clients/rest/models/bulk_create_event_request.py +100 -0
  99. hatchet_sdk/v0/clients/rest/models/bulk_create_event_response.py +110 -0
  100. hatchet_sdk/v0/clients/rest/models/cancel_event_request.py +85 -0
  101. hatchet_sdk/v0/clients/rest/models/cancel_step_run_request.py +83 -0
  102. hatchet_sdk/v0/clients/rest/models/concurrency_limit_strategy.py +39 -0
  103. hatchet_sdk/v0/clients/rest/models/create_api_token_request.py +92 -0
  104. hatchet_sdk/v0/clients/rest/models/create_api_token_response.py +83 -0
  105. hatchet_sdk/v0/clients/rest/models/create_cron_workflow_trigger_request.py +98 -0
  106. hatchet_sdk/v0/clients/rest/models/create_event_request.py +95 -0
  107. hatchet_sdk/v0/clients/rest/models/create_pull_request_from_step_run.py +83 -0
  108. hatchet_sdk/v0/clients/rest/models/create_sns_integration_request.py +85 -0
  109. hatchet_sdk/v0/clients/rest/models/create_tenant_alert_email_group_request.py +83 -0
  110. hatchet_sdk/v0/clients/rest/models/create_tenant_invite_request.py +86 -0
  111. hatchet_sdk/v0/clients/rest/models/create_tenant_request.py +84 -0
  112. hatchet_sdk/v0/clients/rest/models/cron_workflows.py +131 -0
  113. hatchet_sdk/v0/clients/rest/models/cron_workflows_list.py +110 -0
  114. hatchet_sdk/v0/clients/rest/models/cron_workflows_method.py +37 -0
  115. hatchet_sdk/v0/clients/rest/models/cron_workflows_order_by_field.py +37 -0
  116. hatchet_sdk/v0/clients/rest/models/event.py +143 -0
  117. hatchet_sdk/v0/clients/rest/models/event_data.py +83 -0
  118. hatchet_sdk/v0/clients/rest/models/event_key_list.py +98 -0
  119. hatchet_sdk/v0/clients/rest/models/event_list.py +110 -0
  120. hatchet_sdk/v0/clients/rest/models/event_order_by_direction.py +37 -0
  121. hatchet_sdk/v0/clients/rest/models/event_order_by_field.py +36 -0
  122. hatchet_sdk/v0/clients/rest/models/event_update_cancel200_response.py +85 -0
  123. hatchet_sdk/v0/clients/rest/models/event_workflow_run_summary.py +116 -0
  124. hatchet_sdk/v0/clients/rest/models/events.py +110 -0
  125. hatchet_sdk/v0/clients/rest/models/get_step_run_diff_response.py +100 -0
  126. hatchet_sdk/v0/clients/rest/models/github_app_installation.py +107 -0
  127. hatchet_sdk/v0/clients/rest/models/github_branch.py +86 -0
  128. hatchet_sdk/v0/clients/rest/models/github_repo.py +86 -0
  129. hatchet_sdk/v0/clients/rest/models/info_get_version200_response.py +83 -0
  130. hatchet_sdk/v0/clients/rest/models/job.py +132 -0
  131. hatchet_sdk/v0/clients/rest/models/job_run.py +176 -0
  132. hatchet_sdk/v0/clients/rest/models/job_run_status.py +41 -0
  133. hatchet_sdk/v0/clients/rest/models/link_github_repository_request.py +106 -0
  134. hatchet_sdk/v0/clients/rest/models/list_api_tokens_response.py +110 -0
  135. hatchet_sdk/v0/clients/rest/models/list_github_app_installations_response.py +112 -0
  136. hatchet_sdk/v0/clients/rest/models/list_pull_requests_response.py +100 -0
  137. hatchet_sdk/v0/clients/rest/models/list_slack_webhooks.py +110 -0
  138. hatchet_sdk/v0/clients/rest/models/list_sns_integrations.py +110 -0
  139. hatchet_sdk/v0/clients/rest/models/log_line.py +94 -0
  140. hatchet_sdk/v0/clients/rest/models/log_line_level.py +39 -0
  141. hatchet_sdk/v0/clients/rest/models/log_line_list.py +110 -0
  142. hatchet_sdk/v0/clients/rest/models/log_line_order_by_direction.py +37 -0
  143. hatchet_sdk/v0/clients/rest/models/log_line_order_by_field.py +36 -0
  144. hatchet_sdk/v0/clients/rest/models/pagination_response.py +95 -0
  145. hatchet_sdk/v0/clients/rest/models/pull_request.py +112 -0
  146. hatchet_sdk/v0/clients/rest/models/pull_request_state.py +37 -0
  147. hatchet_sdk/v0/clients/rest/models/queue_metrics.py +97 -0
  148. hatchet_sdk/v0/clients/rest/models/rate_limit.py +117 -0
  149. hatchet_sdk/v0/clients/rest/models/rate_limit_list.py +110 -0
  150. hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_direction.py +37 -0
  151. hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_field.py +38 -0
  152. hatchet_sdk/v0/clients/rest/models/recent_step_runs.py +118 -0
  153. hatchet_sdk/v0/clients/rest/models/reject_invite_request.py +83 -0
  154. hatchet_sdk/v0/clients/rest/models/replay_event_request.py +85 -0
  155. hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_request.py +85 -0
  156. hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_response.py +100 -0
  157. hatchet_sdk/v0/clients/rest/models/rerun_step_run_request.py +83 -0
  158. hatchet_sdk/v0/clients/rest/models/schedule_workflow_run_request.py +92 -0
  159. hatchet_sdk/v0/clients/rest/models/scheduled_run_status.py +42 -0
  160. hatchet_sdk/v0/clients/rest/models/scheduled_workflows.py +149 -0
  161. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_list.py +110 -0
  162. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_method.py +37 -0
  163. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_order_by_field.py +37 -0
  164. hatchet_sdk/v0/clients/rest/models/semaphore_slots.py +113 -0
  165. hatchet_sdk/v0/clients/rest/models/slack_webhook.py +127 -0
  166. hatchet_sdk/v0/clients/rest/models/sns_integration.py +114 -0
  167. hatchet_sdk/v0/clients/rest/models/step.py +123 -0
  168. hatchet_sdk/v0/clients/rest/models/step_run.py +202 -0
  169. hatchet_sdk/v0/clients/rest/models/step_run_archive.py +142 -0
  170. hatchet_sdk/v0/clients/rest/models/step_run_archive_list.py +110 -0
  171. hatchet_sdk/v0/clients/rest/models/step_run_diff.py +91 -0
  172. hatchet_sdk/v0/clients/rest/models/step_run_event.py +122 -0
  173. hatchet_sdk/v0/clients/rest/models/step_run_event_list.py +110 -0
  174. hatchet_sdk/v0/clients/rest/models/step_run_event_reason.py +52 -0
  175. hatchet_sdk/v0/clients/rest/models/step_run_event_severity.py +38 -0
  176. hatchet_sdk/v0/clients/rest/models/step_run_status.py +44 -0
  177. hatchet_sdk/v0/clients/rest/models/tenant.py +118 -0
  178. hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group.py +98 -0
  179. hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group_list.py +112 -0
  180. hatchet_sdk/v0/clients/rest/models/tenant_alerting_settings.py +143 -0
  181. hatchet_sdk/v0/clients/rest/models/tenant_invite.py +120 -0
  182. hatchet_sdk/v0/clients/rest/models/tenant_invite_list.py +110 -0
  183. hatchet_sdk/v0/clients/rest/models/tenant_list.py +110 -0
  184. hatchet_sdk/v0/clients/rest/models/tenant_member.py +123 -0
  185. hatchet_sdk/v0/clients/rest/models/tenant_member_list.py +110 -0
  186. hatchet_sdk/v0/clients/rest/models/tenant_member_role.py +38 -0
  187. hatchet_sdk/v0/clients/rest/models/tenant_queue_metrics.py +116 -0
  188. hatchet_sdk/v0/clients/rest/models/tenant_resource.py +40 -0
  189. hatchet_sdk/v0/clients/rest/models/tenant_resource_limit.py +135 -0
  190. hatchet_sdk/v0/clients/rest/models/tenant_resource_policy.py +102 -0
  191. hatchet_sdk/v0/clients/rest/models/tenant_step_run_queue_metrics.py +83 -0
  192. hatchet_sdk/v0/clients/rest/models/trigger_workflow_run_request.py +91 -0
  193. hatchet_sdk/v0/clients/rest/models/update_tenant_alert_email_group_request.py +83 -0
  194. hatchet_sdk/v0/clients/rest/models/update_tenant_invite_request.py +85 -0
  195. hatchet_sdk/v0/clients/rest/models/update_tenant_request.py +137 -0
  196. hatchet_sdk/v0/clients/rest/models/update_worker_request.py +87 -0
  197. hatchet_sdk/v0/clients/rest/models/user.py +126 -0
  198. hatchet_sdk/v0/clients/rest/models/user_change_password_request.py +88 -0
  199. hatchet_sdk/v0/clients/rest/models/user_login_request.py +86 -0
  200. hatchet_sdk/v0/clients/rest/models/user_register_request.py +91 -0
  201. hatchet_sdk/v0/clients/rest/models/user_tenant_memberships_list.py +110 -0
  202. hatchet_sdk/v0/clients/rest/models/user_tenant_public.py +86 -0
  203. hatchet_sdk/v0/clients/rest/models/webhook_worker.py +100 -0
  204. hatchet_sdk/v0/clients/rest/models/webhook_worker_create_request.py +94 -0
  205. hatchet_sdk/v0/clients/rest/models/webhook_worker_create_response.py +98 -0
  206. hatchet_sdk/v0/clients/rest/models/webhook_worker_created.py +102 -0
  207. hatchet_sdk/v0/clients/rest/models/webhook_worker_list_response.py +110 -0
  208. hatchet_sdk/v0/clients/rest/models/webhook_worker_request.py +102 -0
  209. hatchet_sdk/v0/clients/rest/models/webhook_worker_request_list_response.py +104 -0
  210. hatchet_sdk/v0/clients/rest/models/webhook_worker_request_method.py +38 -0
  211. hatchet_sdk/v0/clients/rest/models/worker.py +239 -0
  212. hatchet_sdk/v0/clients/rest/models/worker_label.py +102 -0
  213. hatchet_sdk/v0/clients/rest/models/worker_list.py +110 -0
  214. hatchet_sdk/v0/clients/rest/models/worker_runtime_info.py +103 -0
  215. hatchet_sdk/v0/clients/rest/models/worker_runtime_sdks.py +38 -0
  216. hatchet_sdk/v0/clients/rest/models/worker_type.py +38 -0
  217. hatchet_sdk/v0/clients/rest/models/workflow.py +165 -0
  218. hatchet_sdk/v0/clients/rest/models/workflow_concurrency.py +107 -0
  219. hatchet_sdk/v0/clients/rest/models/workflow_deployment_config.py +136 -0
  220. hatchet_sdk/v0/clients/rest/models/workflow_kind.py +38 -0
  221. hatchet_sdk/v0/clients/rest/models/workflow_list.py +120 -0
  222. hatchet_sdk/v0/clients/rest/models/workflow_metrics.py +97 -0
  223. hatchet_sdk/v0/clients/rest/models/workflow_run.py +188 -0
  224. hatchet_sdk/v0/clients/rest/models/workflow_run_cancel200_response.py +85 -0
  225. hatchet_sdk/v0/clients/rest/models/workflow_run_list.py +110 -0
  226. hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_direction.py +37 -0
  227. hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_field.py +39 -0
  228. hatchet_sdk/v0/clients/rest/models/workflow_run_shape.py +186 -0
  229. hatchet_sdk/v0/clients/rest/models/workflow_run_status.py +42 -0
  230. hatchet_sdk/v0/clients/rest/models/workflow_run_triggered_by.py +112 -0
  231. hatchet_sdk/v0/clients/rest/models/workflow_runs_cancel_request.py +85 -0
  232. hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics.py +94 -0
  233. hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics_counts.py +104 -0
  234. hatchet_sdk/v0/clients/rest/models/workflow_tag.py +84 -0
  235. hatchet_sdk/v0/clients/rest/models/workflow_trigger_cron_ref.py +86 -0
  236. hatchet_sdk/v0/clients/rest/models/workflow_trigger_event_ref.py +86 -0
  237. hatchet_sdk/v0/clients/rest/models/workflow_triggers.py +141 -0
  238. hatchet_sdk/v0/clients/rest/models/workflow_update_request.py +85 -0
  239. hatchet_sdk/v0/clients/rest/models/workflow_version.py +170 -0
  240. hatchet_sdk/v0/clients/rest/models/workflow_version_concurrency.py +114 -0
  241. hatchet_sdk/v0/clients/rest/models/workflow_version_definition.py +85 -0
  242. hatchet_sdk/v0/clients/rest/models/workflow_version_meta.py +123 -0
  243. hatchet_sdk/v0/clients/rest/models/workflow_workers_count.py +95 -0
  244. hatchet_sdk/v0/clients/rest/rest.py +187 -0
  245. hatchet_sdk/v0/clients/rest/tenacity_utils.py +39 -0
  246. hatchet_sdk/v0/clients/rest_client.py +613 -0
  247. hatchet_sdk/v0/clients/run_event_listener.py +260 -0
  248. hatchet_sdk/v0/clients/workflow_listener.py +277 -0
  249. hatchet_sdk/v0/connection.py +63 -0
  250. hatchet_sdk/v0/context/__init__.py +1 -0
  251. hatchet_sdk/v0/context/context.py +446 -0
  252. hatchet_sdk/v0/context/worker_context.py +28 -0
  253. hatchet_sdk/v0/contracts/dispatcher_pb2.py +102 -0
  254. hatchet_sdk/v0/contracts/dispatcher_pb2.pyi +387 -0
  255. hatchet_sdk/v0/contracts/dispatcher_pb2_grpc.py +621 -0
  256. hatchet_sdk/v0/contracts/events_pb2.py +46 -0
  257. hatchet_sdk/v0/contracts/events_pb2.pyi +87 -0
  258. hatchet_sdk/v0/contracts/events_pb2_grpc.py +274 -0
  259. hatchet_sdk/v0/contracts/workflows_pb2.py +80 -0
  260. hatchet_sdk/v0/contracts/workflows_pb2.pyi +312 -0
  261. hatchet_sdk/v0/contracts/workflows_pb2_grpc.py +277 -0
  262. hatchet_sdk/v0/features/cron.py +286 -0
  263. hatchet_sdk/v0/features/scheduled.py +248 -0
  264. hatchet_sdk/v0/hatchet.py +310 -0
  265. hatchet_sdk/v0/labels.py +10 -0
  266. hatchet_sdk/{loader.py → v0/loader.py} +11 -0
  267. hatchet_sdk/v0/logger.py +13 -0
  268. hatchet_sdk/v0/metadata.py +2 -0
  269. hatchet_sdk/v0/opentelemetry/instrumentor.py +396 -0
  270. hatchet_sdk/v0/rate_limit.py +126 -0
  271. hatchet_sdk/v0/semver.py +30 -0
  272. hatchet_sdk/v0/token.py +27 -0
  273. hatchet_sdk/v0/utils/aio_utils.py +137 -0
  274. hatchet_sdk/v0/utils/backoff.py +9 -0
  275. hatchet_sdk/v0/utils/typing.py +12 -0
  276. hatchet_sdk/{v2 → v0/v2}/callable.py +8 -8
  277. hatchet_sdk/{v2 → v0/v2}/concurrency.py +2 -2
  278. hatchet_sdk/{v2 → v0/v2}/hatchet.py +10 -10
  279. hatchet_sdk/v0/worker/__init__.py +1 -0
  280. hatchet_sdk/v0/worker/action_listener_process.py +278 -0
  281. hatchet_sdk/v0/worker/runner/run_loop_manager.py +112 -0
  282. hatchet_sdk/v0/worker/runner/runner.py +460 -0
  283. hatchet_sdk/v0/worker/runner/utils/capture_logs.py +81 -0
  284. hatchet_sdk/v0/worker/runner/utils/error_with_traceback.py +6 -0
  285. hatchet_sdk/v0/worker/worker.py +391 -0
  286. hatchet_sdk/v0/workflow.py +261 -0
  287. hatchet_sdk/v0/workflow_run.py +59 -0
  288. hatchet_sdk/worker/__init__.py +0 -1
  289. hatchet_sdk/worker/action_listener_process.py +36 -33
  290. hatchet_sdk/worker/runner/run_loop_manager.py +18 -16
  291. hatchet_sdk/worker/runner/runner.py +37 -59
  292. hatchet_sdk/worker/runner/utils/capture_logs.py +25 -14
  293. hatchet_sdk/worker/runner/utils/error_with_traceback.py +1 -1
  294. hatchet_sdk/worker/worker.py +61 -75
  295. hatchet_sdk/workflow.py +473 -207
  296. hatchet_sdk/workflow_run.py +14 -25
  297. {hatchet_sdk-0.46.1.dist-info → hatchet_sdk-1.0.0.dist-info}/METADATA +3 -2
  298. hatchet_sdk-1.0.0.dist-info/RECORD +485 -0
  299. {hatchet_sdk-0.46.1.dist-info → hatchet_sdk-1.0.0.dist-info}/entry_points.txt +1 -0
  300. hatchet_sdk/utils/serialization.py +0 -18
  301. hatchet_sdk-0.46.1.dist-info/RECORD +0 -237
  302. /hatchet_sdk/{utils → v0/utils}/types.py +0 -0
  303. {hatchet_sdk-0.46.1.dist-info → hatchet_sdk-1.0.0.dist-info}/WHEEL +0 -0
@@ -2,7 +2,7 @@ import asyncio
2
2
  import atexit
3
3
  import datetime
4
4
  import threading
5
- from typing import Any, Coroutine, List
5
+ from typing import Coroutine, TypeVar
6
6
 
7
7
  from pydantic import StrictInt
8
8
 
@@ -11,14 +11,13 @@ from hatchet_sdk.clients.rest.api.log_api import LogApi
11
11
  from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi
12
12
  from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi
13
13
  from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi
14
- from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi
15
14
  from hatchet_sdk.clients.rest.api_client import ApiClient
16
15
  from hatchet_sdk.clients.rest.configuration import Configuration
17
- from hatchet_sdk.clients.rest.models import TriggerWorkflowRunRequest
18
16
  from hatchet_sdk.clients.rest.models.create_cron_workflow_trigger_request import (
19
17
  CreateCronWorkflowTriggerRequest,
20
18
  )
21
19
  from hatchet_sdk.clients.rest.models.cron_workflows import CronWorkflows
20
+ from hatchet_sdk.clients.rest.models.cron_workflows_list import CronWorkflowsList
22
21
  from hatchet_sdk.clients.rest.models.cron_workflows_order_by_field import (
23
22
  CronWorkflowsOrderByField,
24
23
  )
@@ -27,6 +26,9 @@ from hatchet_sdk.clients.rest.models.event_order_by_direction import (
27
26
  EventOrderByDirection,
28
27
  )
29
28
  from hatchet_sdk.clients.rest.models.event_order_by_field import EventOrderByField
29
+ from hatchet_sdk.clients.rest.models.event_update_cancel200_response import (
30
+ EventUpdateCancel200Response,
31
+ )
30
32
  from hatchet_sdk.clients.rest.models.log_line_level import LogLineLevel
31
33
  from hatchet_sdk.clients.rest.models.log_line_list import LogLineList
32
34
  from hatchet_sdk.clients.rest.models.log_line_order_by_direction import (
@@ -44,16 +46,19 @@ from hatchet_sdk.clients.rest.models.schedule_workflow_run_request import (
44
46
  ScheduleWorkflowRunRequest,
45
47
  )
46
48
  from hatchet_sdk.clients.rest.models.scheduled_workflows import ScheduledWorkflows
49
+ from hatchet_sdk.clients.rest.models.scheduled_workflows_list import (
50
+ ScheduledWorkflowsList,
51
+ )
47
52
  from hatchet_sdk.clients.rest.models.scheduled_workflows_order_by_field import (
48
53
  ScheduledWorkflowsOrderByField,
49
54
  )
55
+ from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import (
56
+ TriggerWorkflowRunRequest,
57
+ )
50
58
  from hatchet_sdk.clients.rest.models.workflow import Workflow
51
59
  from hatchet_sdk.clients.rest.models.workflow_kind import WorkflowKind
52
60
  from hatchet_sdk.clients.rest.models.workflow_list import WorkflowList
53
61
  from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun
54
- from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import (
55
- WorkflowRunCancel200Response,
56
- )
57
62
  from hatchet_sdk.clients.rest.models.workflow_run_list import WorkflowRunList
58
63
  from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import (
59
64
  WorkflowRunOrderByDirection,
@@ -66,9 +71,21 @@ from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import (
66
71
  WorkflowRunsCancelRequest,
67
72
  )
68
73
  from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion
74
+ from hatchet_sdk.utils.typing import JSONSerializableMapping
75
+
76
+ ## Type variables to use with coroutines.
77
+ ## See https://stackoverflow.com/questions/73240620/the-right-way-to-type-hint-a-coroutine-function
78
+ ## Return type
79
+ R = TypeVar("R")
69
80
 
81
+ ## Yield type
82
+ Y = TypeVar("Y")
70
83
 
71
- class AsyncRestApi:
84
+ ## Send type
85
+ S = TypeVar("S")
86
+
87
+
88
+ class RestApi:
72
89
  def __init__(self, host: str, api_key: str, tenant_id: str):
73
90
  self.tenant_id = tenant_id
74
91
 
@@ -77,65 +94,85 @@ class AsyncRestApi:
77
94
  access_token=api_key,
78
95
  )
79
96
 
80
- self._api_client = None
81
- self._workflow_api = None
82
- self._workflow_run_api = None
83
- self._step_run_api = None
84
- self._event_api = None
85
- self._log_api = None
97
+ self._loop = asyncio.new_event_loop()
98
+ self._thread = threading.Thread(target=self._run_event_loop, daemon=True)
99
+ self._thread.start()
100
+
101
+ # Register the cleanup method to be called on exit
102
+ atexit.register(self._cleanup)
103
+
104
+ ## IMPORTANT: These clients need to be instantiated lazily because they rely on
105
+ ## an event loop to be running, which may not be the case when the `Hatchet` client is instantiated.
106
+ self._api_client: ApiClient | None = None
107
+ self._workflow_api: WorkflowApi | None = None
108
+ self._workflow_run_api: WorkflowRunApi | None = None
109
+ self._step_run_api: StepRunApi | None = None
110
+ self._event_api: EventApi | None = None
111
+ self._log_api: LogApi | None = None
86
112
 
87
113
  @property
88
- def api_client(self):
114
+ def api_client(self) -> ApiClient:
115
+ ## IMPORTANT: This client needs to be instantiated lazily because it relies on an event
116
+ ## loop to be running, which may not be the case when the `Hatchet` client is instantiated.
89
117
  if self._api_client is None:
90
118
  self._api_client = ApiClient(configuration=self.config)
91
119
  return self._api_client
92
120
 
93
121
  @property
94
- def workflow_api(self):
122
+ def workflow_api(self) -> WorkflowApi:
123
+ ## IMPORTANT: This client needs to be instantiated lazily because it relies on an event
124
+ ## loop to be running, which may not be the case when the `Hatchet` client is instantiated.
95
125
  if self._workflow_api is None:
96
126
  self._workflow_api = WorkflowApi(self.api_client)
97
127
  return self._workflow_api
98
128
 
99
129
  @property
100
- def workflow_run_api(self):
130
+ def workflow_run_api(self) -> WorkflowRunApi:
131
+ ## IMPORTANT: This client needs to be instantiated lazily because it relies on an event
132
+ ## loop to be running, which may not be the case when the `Hatchet` client is instantiated.
101
133
  if self._workflow_run_api is None:
102
134
  self._workflow_run_api = WorkflowRunApi(self.api_client)
103
135
  return self._workflow_run_api
104
136
 
105
137
  @property
106
- def step_run_api(self):
138
+ def step_run_api(self) -> StepRunApi:
139
+ ## IMPORTANT: This client needs to be instantiated lazily because it relies on an event
140
+ ## loop to be running, which may not be the case when the `Hatchet` client is instantiated.
107
141
  if self._step_run_api is None:
108
142
  self._step_run_api = StepRunApi(self.api_client)
109
143
  return self._step_run_api
110
144
 
111
145
  @property
112
- def event_api(self):
146
+ def event_api(self) -> EventApi:
147
+ ## IMPORTANT: This client needs to be instantiated lazily because it relies on an event
148
+ ## loop to be running, which may not be the case when the `Hatchet` client is instantiated.
113
149
  if self._event_api is None:
114
150
  self._event_api = EventApi(self.api_client)
115
151
  return self._event_api
116
152
 
117
153
  @property
118
- def log_api(self):
154
+ def log_api(self) -> LogApi:
155
+ ## IMPORTANT: This client needs to be instantiated lazily because it relies on an event
156
+ ## loop to be running, which may not be the case when the `Hatchet` client is instantiated.
119
157
  if self._log_api is None:
120
158
  self._log_api = LogApi(self.api_client)
121
159
  return self._log_api
122
160
 
123
- async def close(self):
161
+ async def close(self) -> None:
124
162
  # Ensure the aiohttp client session is closed
125
- if self._api_client is not None:
126
- await self._api_client.close()
163
+ await self.api_client.close() # type: ignore[no-untyped-call]
127
164
 
128
- async def workflow_list(self) -> WorkflowList:
165
+ async def aio_list_workflows(self) -> WorkflowList:
129
166
  return await self.workflow_api.workflow_list(
130
167
  tenant=self.tenant_id,
131
168
  )
132
169
 
133
- async def workflow_get(self, workflow_id: str) -> Workflow:
170
+ async def aio_get_workflow(self, workflow_id: str) -> Workflow:
134
171
  return await self.workflow_api.workflow_get(
135
172
  workflow=workflow_id,
136
173
  )
137
174
 
138
- async def workflow_version_get(
175
+ async def aio_get_workflow_version(
139
176
  self, workflow_id: str, version: str | None = None
140
177
  ) -> WorkflowVersion:
141
178
  return await self.workflow_api.workflow_version_get(
@@ -143,7 +180,7 @@ class AsyncRestApi:
143
180
  version=version,
144
181
  )
145
182
 
146
- async def workflow_run_list(
183
+ async def aio_list_workflow_runs(
147
184
  self,
148
185
  workflow_id: str | None = None,
149
186
  offset: int | None = None,
@@ -172,25 +209,25 @@ class AsyncRestApi:
172
209
  order_by_direction=order_by_direction,
173
210
  )
174
211
 
175
- async def workflow_run_get(self, workflow_run_id: str) -> WorkflowRun:
212
+ async def aio_get_workflow_run(self, workflow_run_id: str) -> WorkflowRun:
176
213
  return await self.workflow_api.workflow_run_get(
177
214
  tenant=self.tenant_id,
178
215
  workflow_run=workflow_run_id,
179
216
  )
180
217
 
181
- async def workflow_run_replay(
218
+ async def aio_replay_workflow_run(
182
219
  self, workflow_run_ids: list[str]
183
220
  ) -> ReplayWorkflowRunsResponse:
184
221
  return await self.workflow_run_api.workflow_run_update_replay(
185
222
  tenant=self.tenant_id,
186
223
  replay_workflow_runs_request=ReplayWorkflowRunsRequest(
187
- workflow_run_ids=workflow_run_ids,
224
+ workflowRunIds=workflow_run_ids,
188
225
  ),
189
226
  )
190
227
 
191
- async def workflow_run_cancel(
228
+ async def aio_cancel_workflow_run(
192
229
  self, workflow_run_id: str
193
- ) -> WorkflowRunCancel200Response:
230
+ ) -> EventUpdateCancel200Response:
194
231
  return await self.workflow_run_api.workflow_run_cancel(
195
232
  tenant=self.tenant_id,
196
233
  workflow_runs_cancel_request=WorkflowRunsCancelRequest(
@@ -198,9 +235,9 @@ class AsyncRestApi:
198
235
  ),
199
236
  )
200
237
 
201
- async def workflow_run_bulk_cancel(
238
+ async def aio_bulk_cancel_workflow_runs(
202
239
  self, workflow_run_ids: list[str]
203
- ) -> WorkflowRunCancel200Response:
240
+ ) -> EventUpdateCancel200Response:
204
241
  return await self.workflow_run_api.workflow_run_cancel(
205
242
  tenant=self.tenant_id,
206
243
  workflow_runs_cancel_request=WorkflowRunsCancelRequest(
@@ -208,48 +245,48 @@ class AsyncRestApi:
208
245
  ),
209
246
  )
210
247
 
211
- async def workflow_run_create(
248
+ async def aio_create_workflow_run(
212
249
  self,
213
250
  workflow_id: str,
214
- input: dict[str, Any],
251
+ input: JSONSerializableMapping,
215
252
  version: str | None = None,
216
- additional_metadata: list[str] | None = None,
253
+ additional_metadata: JSONSerializableMapping = {},
217
254
  ) -> WorkflowRun:
218
255
  return await self.workflow_run_api.workflow_run_create(
219
256
  workflow=workflow_id,
220
257
  version=version,
221
258
  trigger_workflow_run_request=TriggerWorkflowRunRequest(
222
- input=input,
223
- additional_metadata=additional_metadata,
259
+ input=dict(input),
260
+ additionalMetadata=dict(additional_metadata),
224
261
  ),
225
262
  )
226
263
 
227
- async def cron_create(
264
+ async def aio_create_cron(
228
265
  self,
229
266
  workflow_name: str,
230
267
  cron_name: str,
231
268
  expression: str,
232
- input: dict[str, Any],
233
- additional_metadata: dict[str, str],
234
- ):
269
+ input: JSONSerializableMapping,
270
+ additional_metadata: JSONSerializableMapping,
271
+ ) -> CronWorkflows:
235
272
  return await self.workflow_run_api.cron_workflow_trigger_create(
236
273
  tenant=self.tenant_id,
237
274
  workflow=workflow_name,
238
275
  create_cron_workflow_trigger_request=CreateCronWorkflowTriggerRequest(
239
276
  cronName=cron_name,
240
277
  cronExpression=expression,
241
- input=input,
242
- additional_metadata=additional_metadata,
278
+ input=dict(input),
279
+ additionalMetadata=dict(additional_metadata),
243
280
  ),
244
281
  )
245
282
 
246
- async def cron_delete(self, cron_trigger_id: str):
247
- return await self.workflow_api.workflow_cron_delete(
283
+ async def aio_delete_cron(self, cron_trigger_id: str) -> None:
284
+ await self.workflow_api.workflow_cron_delete(
248
285
  tenant=self.tenant_id,
249
286
  cron_workflow=cron_trigger_id,
250
287
  )
251
288
 
252
- async def cron_list(
289
+ async def aio_list_crons(
253
290
  self,
254
291
  offset: StrictInt | None = None,
255
292
  limit: StrictInt | None = None,
@@ -257,7 +294,7 @@ class AsyncRestApi:
257
294
  additional_metadata: list[str] | None = None,
258
295
  order_by_field: CronWorkflowsOrderByField | None = None,
259
296
  order_by_direction: WorkflowRunOrderByDirection | None = None,
260
- ):
297
+ ) -> CronWorkflowsList:
261
298
  return await self.workflow_api.cron_workflow_list(
262
299
  tenant=self.tenant_id,
263
300
  offset=offset,
@@ -268,36 +305,36 @@ class AsyncRestApi:
268
305
  order_by_direction=order_by_direction,
269
306
  )
270
307
 
271
- async def cron_get(self, cron_trigger_id: str):
308
+ async def aio_get_cron(self, cron_trigger_id: str) -> CronWorkflows:
272
309
  return await self.workflow_api.workflow_cron_get(
273
310
  tenant=self.tenant_id,
274
311
  cron_workflow=cron_trigger_id,
275
312
  )
276
313
 
277
- async def schedule_create(
314
+ async def aio_create_schedule(
278
315
  self,
279
316
  name: str,
280
317
  trigger_at: datetime.datetime,
281
- input: dict[str, Any],
282
- additional_metadata: dict[str, str],
283
- ):
318
+ input: JSONSerializableMapping,
319
+ additional_metadata: JSONSerializableMapping,
320
+ ) -> ScheduledWorkflows:
284
321
  return await self.workflow_run_api.scheduled_workflow_run_create(
285
322
  tenant=self.tenant_id,
286
323
  workflow=name,
287
324
  schedule_workflow_run_request=ScheduleWorkflowRunRequest(
288
325
  triggerAt=trigger_at,
289
- input=input,
290
- additional_metadata=additional_metadata,
326
+ input=dict(input),
327
+ additionalMetadata=dict(additional_metadata),
291
328
  ),
292
329
  )
293
330
 
294
- async def schedule_delete(self, scheduled_trigger_id: str):
295
- return await self.workflow_api.workflow_scheduled_delete(
331
+ async def aio_delete_schedule(self, scheduled_trigger_id: str) -> None:
332
+ await self.workflow_api.workflow_scheduled_delete(
296
333
  tenant=self.tenant_id,
297
334
  scheduled_workflow_run=scheduled_trigger_id,
298
335
  )
299
336
 
300
- async def schedule_list(
337
+ async def aio_list_schedule(
301
338
  self,
302
339
  offset: StrictInt | None = None,
303
340
  limit: StrictInt | None = None,
@@ -307,7 +344,7 @@ class AsyncRestApi:
307
344
  parent_step_run_id: str | None = None,
308
345
  order_by_field: ScheduledWorkflowsOrderByField | None = None,
309
346
  order_by_direction: WorkflowRunOrderByDirection | None = None,
310
- ):
347
+ ) -> ScheduledWorkflowsList:
311
348
  return await self.workflow_api.workflow_scheduled_list(
312
349
  tenant=self.tenant_id,
313
350
  offset=offset,
@@ -320,13 +357,13 @@ class AsyncRestApi:
320
357
  order_by_direction=order_by_direction,
321
358
  )
322
359
 
323
- async def schedule_get(self, scheduled_trigger_id: str):
360
+ async def aio_get_schedule(self, scheduled_trigger_id: str) -> ScheduledWorkflows:
324
361
  return await self.workflow_api.workflow_scheduled_get(
325
362
  tenant=self.tenant_id,
326
363
  scheduled_workflow_run=scheduled_trigger_id,
327
364
  )
328
365
 
329
- async def list_logs(
366
+ async def aio_list_logs(
330
367
  self,
331
368
  step_run_id: str,
332
369
  offset: int | None = None,
@@ -346,7 +383,7 @@ class AsyncRestApi:
346
383
  order_by_direction=order_by_direction,
347
384
  )
348
385
 
349
- async def events_list(
386
+ async def aio_list_events(
350
387
  self,
351
388
  offset: int | None = None,
352
389
  limit: int | None = None,
@@ -371,44 +408,32 @@ class AsyncRestApi:
371
408
  additional_metadata=additional_metadata,
372
409
  )
373
410
 
374
- async def events_replay(self, event_ids: list[str] | EventList) -> EventList:
411
+ async def aio_replay_events(self, event_ids: list[str] | EventList) -> EventList:
375
412
  if isinstance(event_ids, EventList):
376
- event_ids = [r.metadata.id for r in event_ids.rows]
413
+ rows = event_ids.rows or []
414
+ event_ids = [r.metadata.id for r in rows]
377
415
 
378
- return self.event_api.event_update_replay(
416
+ return await self.event_api.event_update_replay(
379
417
  tenant=self.tenant_id,
380
418
  replay_event_request=ReplayEventRequest(eventIds=event_ids),
381
419
  )
382
420
 
383
-
384
- class RestApi:
385
- def __init__(self, host: str, api_key: str, tenant_id: str):
386
- self._loop = asyncio.new_event_loop()
387
- self._thread = threading.Thread(target=self._run_event_loop, daemon=True)
388
- self._thread.start()
389
-
390
- # Initialize AsyncRestApi inside the event loop to ensure an active loop
391
- self.aio = AsyncRestApi(host, api_key, tenant_id)
392
-
393
- # Register the cleanup method to be called on exit
394
- atexit.register(self._cleanup)
395
-
396
- def _cleanup(self):
421
+ def _cleanup(self) -> None:
397
422
  """
398
423
  Stop the running thread and clean up the event loop.
399
424
  """
400
- self._run_coroutine(self.aio.close())
425
+ self._run_coroutine(self.close())
401
426
  self._loop.call_soon_threadsafe(self._loop.stop)
402
427
  self._thread.join()
403
428
 
404
- def _run_event_loop(self):
429
+ def _run_event_loop(self) -> None:
405
430
  """
406
431
  Run the asyncio event loop in a separate thread.
407
432
  """
408
433
  asyncio.set_event_loop(self._loop)
409
434
  self._loop.run_forever()
410
435
 
411
- def _run_coroutine(self, coro) -> Any:
436
+ def _run_coroutine(self, coro: Coroutine[Y, S, R]) -> R:
412
437
  """
413
438
  Execute a coroutine in the event loop and return the result.
414
439
  """
@@ -416,15 +441,15 @@ class RestApi:
416
441
  return future.result()
417
442
 
418
443
  def workflow_list(self) -> WorkflowList:
419
- return self._run_coroutine(self.aio.workflow_list())
444
+ return self._run_coroutine(self.aio_list_workflows())
420
445
 
421
446
  def workflow_get(self, workflow_id: str) -> Workflow:
422
- return self._run_coroutine(self.aio.workflow_get(workflow_id))
447
+ return self._run_coroutine(self.aio_get_workflow(workflow_id))
423
448
 
424
449
  def workflow_version_get(
425
450
  self, workflow_id: str, version: str | None = None
426
451
  ) -> WorkflowVersion:
427
- return self._run_coroutine(self.aio.workflow_version_get(workflow_id, version))
452
+ return self._run_coroutine(self.aio_get_workflow_version(workflow_id, version))
428
453
 
429
454
  def workflow_run_list(
430
455
  self,
@@ -441,7 +466,7 @@ class RestApi:
441
466
  order_by_direction: WorkflowRunOrderByDirection | None = None,
442
467
  ) -> WorkflowRunList:
443
468
  return self._run_coroutine(
444
- self.aio.workflow_run_list(
469
+ self.aio_list_workflow_runs(
445
470
  workflow_id=workflow_id,
446
471
  offset=offset,
447
472
  limit=limit,
@@ -457,25 +482,25 @@ class RestApi:
457
482
  )
458
483
 
459
484
  def workflow_run_get(self, workflow_run_id: str) -> WorkflowRun:
460
- return self._run_coroutine(self.aio.workflow_run_get(workflow_run_id))
485
+ return self._run_coroutine(self.aio_get_workflow_run(workflow_run_id))
461
486
 
462
- def workflow_run_cancel(self, workflow_run_id: str) -> WorkflowRunCancel200Response:
463
- return self._run_coroutine(self.aio.workflow_run_cancel(workflow_run_id))
487
+ def workflow_run_cancel(self, workflow_run_id: str) -> EventUpdateCancel200Response:
488
+ return self._run_coroutine(self.aio_cancel_workflow_run(workflow_run_id))
464
489
 
465
490
  def workflow_run_bulk_cancel(
466
491
  self, workflow_run_ids: list[str]
467
- ) -> WorkflowRunCancel200Response:
468
- return self._run_coroutine(self.aio.workflow_run_bulk_cancel(workflow_run_ids))
492
+ ) -> EventUpdateCancel200Response:
493
+ return self._run_coroutine(self.aio_bulk_cancel_workflow_runs(workflow_run_ids))
469
494
 
470
495
  def workflow_run_create(
471
496
  self,
472
497
  workflow_id: str,
473
- input: dict[str, Any],
498
+ input: JSONSerializableMapping,
474
499
  version: str | None = None,
475
- additional_metadata: list[str] | None = None,
500
+ additional_metadata: JSONSerializableMapping = {},
476
501
  ) -> WorkflowRun:
477
502
  return self._run_coroutine(
478
- self.aio.workflow_run_create(
503
+ self.aio_create_workflow_run(
479
504
  workflow_id, input, version, additional_metadata
480
505
  )
481
506
  )
@@ -485,17 +510,17 @@ class RestApi:
485
510
  workflow_name: str,
486
511
  cron_name: str,
487
512
  expression: str,
488
- input: dict[str, Any],
489
- additional_metadata: dict[str, str],
513
+ input: JSONSerializableMapping,
514
+ additional_metadata: JSONSerializableMapping,
490
515
  ) -> CronWorkflows:
491
516
  return self._run_coroutine(
492
- self.aio.cron_create(
517
+ self.aio_create_cron(
493
518
  workflow_name, cron_name, expression, input, additional_metadata
494
519
  )
495
520
  )
496
521
 
497
- def cron_delete(self, cron_trigger_id: str):
498
- return self._run_coroutine(self.aio.cron_delete(cron_trigger_id))
522
+ def cron_delete(self, cron_trigger_id: str) -> None:
523
+ self._run_coroutine(self.aio_delete_cron(cron_trigger_id))
499
524
 
500
525
  def cron_list(
501
526
  self,
@@ -505,9 +530,9 @@ class RestApi:
505
530
  additional_metadata: list[str] | None = None,
506
531
  order_by_field: CronWorkflowsOrderByField | None = None,
507
532
  order_by_direction: WorkflowRunOrderByDirection | None = None,
508
- ):
533
+ ) -> CronWorkflowsList:
509
534
  return self._run_coroutine(
510
- self.aio.cron_list(
535
+ self.aio_list_crons(
511
536
  offset,
512
537
  limit,
513
538
  workflow_id,
@@ -517,24 +542,24 @@ class RestApi:
517
542
  )
518
543
  )
519
544
 
520
- def cron_get(self, cron_trigger_id: str):
521
- return self._run_coroutine(self.aio.cron_get(cron_trigger_id))
545
+ def cron_get(self, cron_trigger_id: str) -> CronWorkflows:
546
+ return self._run_coroutine(self.aio_get_cron(cron_trigger_id))
522
547
 
523
548
  def schedule_create(
524
549
  self,
525
550
  workflow_name: str,
526
551
  trigger_at: datetime.datetime,
527
- input: dict[str, Any],
528
- additional_metadata: dict[str, str],
529
- ):
552
+ input: JSONSerializableMapping,
553
+ additional_metadata: JSONSerializableMapping,
554
+ ) -> ScheduledWorkflows:
530
555
  return self._run_coroutine(
531
- self.aio.schedule_create(
556
+ self.aio_create_schedule(
532
557
  workflow_name, trigger_at, input, additional_metadata
533
558
  )
534
559
  )
535
560
 
536
- def schedule_delete(self, scheduled_trigger_id: str):
537
- return self._run_coroutine(self.aio.schedule_delete(scheduled_trigger_id))
561
+ def schedule_delete(self, scheduled_trigger_id: str) -> None:
562
+ self._run_coroutine(self.aio_delete_schedule(scheduled_trigger_id))
538
563
 
539
564
  def schedule_list(
540
565
  self,
@@ -544,9 +569,9 @@ class RestApi:
544
569
  additional_metadata: list[str] | None = None,
545
570
  order_by_field: CronWorkflowsOrderByField | None = None,
546
571
  order_by_direction: WorkflowRunOrderByDirection | None = None,
547
- ):
572
+ ) -> ScheduledWorkflowsList:
548
573
  return self._run_coroutine(
549
- self.aio.schedule_list(
574
+ self.aio_list_schedule(
550
575
  offset,
551
576
  limit,
552
577
  workflow_id,
@@ -556,8 +581,8 @@ class RestApi:
556
581
  )
557
582
  )
558
583
 
559
- def schedule_get(self, scheduled_trigger_id: str):
560
- return self._run_coroutine(self.aio.schedule_get(scheduled_trigger_id))
584
+ def schedule_get(self, scheduled_trigger_id: str) -> ScheduledWorkflows:
585
+ return self._run_coroutine(self.aio_get_schedule(scheduled_trigger_id))
561
586
 
562
587
  def list_logs(
563
588
  self,
@@ -570,7 +595,7 @@ class RestApi:
570
595
  order_by_direction: LogLineOrderByDirection | None = None,
571
596
  ) -> LogLineList:
572
597
  return self._run_coroutine(
573
- self.aio.list_logs(
598
+ self.aio_list_logs(
574
599
  step_run_id=step_run_id,
575
600
  offset=offset,
576
601
  limit=limit,
@@ -594,7 +619,7 @@ class RestApi:
594
619
  additional_metadata: list[str] | None = None,
595
620
  ) -> EventList:
596
621
  return self._run_coroutine(
597
- self.aio.events_list(
622
+ self.aio_list_events(
598
623
  offset=offset,
599
624
  limit=limit,
600
625
  keys=keys,
@@ -608,4 +633,4 @@ class RestApi:
608
633
  )
609
634
 
610
635
  def events_replay(self, event_ids: list[str] | EventList) -> EventList:
611
- return self._run_coroutine(self.aio.events_replay(event_ids))
636
+ return self._run_coroutine(self.aio_replay_events(event_ids))