hatchet-sdk 1.16.4__py3-none-any.whl → 1.17.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.

Potentially problematic release.


This version of hatchet-sdk might be problematic. Click here for more details.

Files changed (38) hide show
  1. hatchet_sdk/__init__.py +2 -1
  2. hatchet_sdk/clients/events.py +5 -2
  3. hatchet_sdk/clients/rest/__init__.py +32 -0
  4. hatchet_sdk/clients/rest/api/__init__.py +1 -0
  5. hatchet_sdk/clients/rest/api/webhook_api.py +1551 -0
  6. hatchet_sdk/clients/rest/models/__init__.py +31 -0
  7. hatchet_sdk/clients/rest/models/v1_create_webhook_request.py +215 -0
  8. hatchet_sdk/clients/rest/models/v1_create_webhook_request_api_key.py +126 -0
  9. hatchet_sdk/clients/rest/models/v1_create_webhook_request_api_key_all_of_auth_type.py +82 -0
  10. hatchet_sdk/clients/rest/models/v1_create_webhook_request_base.py +98 -0
  11. hatchet_sdk/clients/rest/models/v1_create_webhook_request_basic_auth.py +126 -0
  12. hatchet_sdk/clients/rest/models/v1_create_webhook_request_basic_auth_all_of_auth_type.py +82 -0
  13. hatchet_sdk/clients/rest/models/v1_create_webhook_request_hmac.py +126 -0
  14. hatchet_sdk/clients/rest/models/v1_create_webhook_request_hmac_all_of_auth_type.py +82 -0
  15. hatchet_sdk/clients/rest/models/v1_event.py +7 -0
  16. hatchet_sdk/clients/rest/models/v1_webhook.py +126 -0
  17. hatchet_sdk/clients/rest/models/v1_webhook_api_key_auth.py +90 -0
  18. hatchet_sdk/clients/rest/models/v1_webhook_auth_type.py +38 -0
  19. hatchet_sdk/clients/rest/models/v1_webhook_basic_auth.py +86 -0
  20. hatchet_sdk/clients/rest/models/v1_webhook_hmac_algorithm.py +39 -0
  21. hatchet_sdk/clients/rest/models/v1_webhook_hmac_auth.py +115 -0
  22. hatchet_sdk/clients/rest/models/v1_webhook_hmac_encoding.py +38 -0
  23. hatchet_sdk/clients/rest/models/v1_webhook_list.py +110 -0
  24. hatchet_sdk/clients/rest/models/v1_webhook_receive200_response.py +83 -0
  25. hatchet_sdk/clients/rest/models/v1_webhook_source_name.py +38 -0
  26. hatchet_sdk/context/context.py +31 -2
  27. hatchet_sdk/exceptions.py +70 -5
  28. hatchet_sdk/hatchet.py +29 -11
  29. hatchet_sdk/rate_limit.py +1 -21
  30. hatchet_sdk/runnables/task.py +109 -19
  31. hatchet_sdk/runnables/workflow.py +23 -8
  32. hatchet_sdk/utils/typing.py +27 -0
  33. hatchet_sdk/worker/runner/runner.py +27 -19
  34. hatchet_sdk/worker/runner/utils/capture_logs.py +24 -11
  35. {hatchet_sdk-1.16.4.dist-info → hatchet_sdk-1.17.0.dist-info}/METADATA +2 -3
  36. {hatchet_sdk-1.16.4.dist-info → hatchet_sdk-1.17.0.dist-info}/RECORD +38 -19
  37. {hatchet_sdk-1.16.4.dist-info → hatchet_sdk-1.17.0.dist-info}/WHEEL +0 -0
  38. {hatchet_sdk-1.16.4.dist-info → hatchet_sdk-1.17.0.dist-info}/entry_points.txt +0 -0
hatchet_sdk/__init__.py CHANGED
@@ -155,7 +155,7 @@ from hatchet_sdk.exceptions import (
155
155
  from hatchet_sdk.features.cel import CELEvaluationResult, CELFailure, CELSuccess
156
156
  from hatchet_sdk.features.runs import BulkCancelReplayOpts, RunFilter
157
157
  from hatchet_sdk.hatchet import Hatchet
158
- from hatchet_sdk.runnables.task import Task
158
+ from hatchet_sdk.runnables.task import Depends, Task
159
159
  from hatchet_sdk.runnables.types import (
160
160
  ConcurrencyExpression,
161
161
  ConcurrencyLimitStrategy,
@@ -198,6 +198,7 @@ __all__ = [
198
198
  "CreateWorkflowVersionOpts",
199
199
  "DedupeViolationError",
200
200
  "DefaultFilter",
201
+ "Depends",
201
202
  "DurableContext",
202
203
  "EmptyModel",
203
204
  "Event",
@@ -28,7 +28,7 @@ from hatchet_sdk.contracts.events_pb2 import (
28
28
  )
29
29
  from hatchet_sdk.contracts.events_pb2_grpc import EventsServiceStub
30
30
  from hatchet_sdk.metadata import get_metadata
31
- from hatchet_sdk.utils.typing import JSONSerializableMapping
31
+ from hatchet_sdk.utils.typing import JSONSerializableMapping, LogLevel
32
32
 
33
33
 
34
34
  def proto_timestamp_now() -> timestamp_pb2.Timestamp:
@@ -180,11 +180,14 @@ class EventClient(BaseRestClient):
180
180
  )
181
181
 
182
182
  @tenacity_retry
183
- def log(self, message: str, step_run_id: str) -> None:
183
+ def log(
184
+ self, message: str, step_run_id: str, level: LogLevel | None = None
185
+ ) -> None:
184
186
  request = PutLogRequest(
185
187
  stepRunId=step_run_id,
186
188
  createdAt=proto_timestamp_now(),
187
189
  message=message,
190
+ level=level.value if level else None,
188
191
  )
189
192
 
190
193
  self.events_service_client.PutLog(request, metadata=get_metadata(self.token))
@@ -33,6 +33,7 @@ from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi
33
33
  from hatchet_sdk.clients.rest.api.task_api import TaskApi
34
34
  from hatchet_sdk.clients.rest.api.tenant_api import TenantApi
35
35
  from hatchet_sdk.clients.rest.api.user_api import UserApi
36
+ from hatchet_sdk.clients.rest.api.webhook_api import WebhookApi
36
37
  from hatchet_sdk.clients.rest.api.worker_api import WorkerApi
37
38
  from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi
38
39
  from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi
@@ -241,6 +242,21 @@ from hatchet_sdk.clients.rest.models.v1_cel_debug_response_status import (
241
242
  from hatchet_sdk.clients.rest.models.v1_create_filter_request import (
242
243
  V1CreateFilterRequest,
243
244
  )
245
+ from hatchet_sdk.clients.rest.models.v1_create_webhook_request import (
246
+ V1CreateWebhookRequest,
247
+ )
248
+ from hatchet_sdk.clients.rest.models.v1_create_webhook_request_api_key import (
249
+ V1CreateWebhookRequestAPIKey,
250
+ )
251
+ from hatchet_sdk.clients.rest.models.v1_create_webhook_request_base import (
252
+ V1CreateWebhookRequestBase,
253
+ )
254
+ from hatchet_sdk.clients.rest.models.v1_create_webhook_request_basic_auth import (
255
+ V1CreateWebhookRequestBasicAuth,
256
+ )
257
+ from hatchet_sdk.clients.rest.models.v1_create_webhook_request_hmac import (
258
+ V1CreateWebhookRequestHMAC,
259
+ )
244
260
  from hatchet_sdk.clients.rest.models.v1_dag_children import V1DagChildren
245
261
  from hatchet_sdk.clients.rest.models.v1_event import V1Event
246
262
  from hatchet_sdk.clients.rest.models.v1_event_list import V1EventList
@@ -274,6 +290,22 @@ from hatchet_sdk.clients.rest.models.v1_trigger_workflow_run_request import (
274
290
  from hatchet_sdk.clients.rest.models.v1_update_filter_request import (
275
291
  V1UpdateFilterRequest,
276
292
  )
293
+ from hatchet_sdk.clients.rest.models.v1_webhook import V1Webhook
294
+ from hatchet_sdk.clients.rest.models.v1_webhook_api_key_auth import V1WebhookAPIKeyAuth
295
+ from hatchet_sdk.clients.rest.models.v1_webhook_auth_type import V1WebhookAuthType
296
+ from hatchet_sdk.clients.rest.models.v1_webhook_basic_auth import V1WebhookBasicAuth
297
+ from hatchet_sdk.clients.rest.models.v1_webhook_hmac_algorithm import (
298
+ V1WebhookHMACAlgorithm,
299
+ )
300
+ from hatchet_sdk.clients.rest.models.v1_webhook_hmac_auth import V1WebhookHMACAuth
301
+ from hatchet_sdk.clients.rest.models.v1_webhook_hmac_encoding import (
302
+ V1WebhookHMACEncoding,
303
+ )
304
+ from hatchet_sdk.clients.rest.models.v1_webhook_list import V1WebhookList
305
+ from hatchet_sdk.clients.rest.models.v1_webhook_receive200_response import (
306
+ V1WebhookReceive200Response,
307
+ )
308
+ from hatchet_sdk.clients.rest.models.v1_webhook_source_name import V1WebhookSourceName
277
309
  from hatchet_sdk.clients.rest.models.v1_workflow_run import V1WorkflowRun
278
310
  from hatchet_sdk.clients.rest.models.v1_workflow_run_details import V1WorkflowRunDetails
279
311
  from hatchet_sdk.clients.rest.models.v1_workflow_run_display_name import (
@@ -17,6 +17,7 @@ from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi
17
17
  from hatchet_sdk.clients.rest.api.task_api import TaskApi
18
18
  from hatchet_sdk.clients.rest.api.tenant_api import TenantApi
19
19
  from hatchet_sdk.clients.rest.api.user_api import UserApi
20
+ from hatchet_sdk.clients.rest.api.webhook_api import WebhookApi
20
21
  from hatchet_sdk.clients.rest.api.worker_api import WorkerApi
21
22
  from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi
22
23
  from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi