From 495fb756b5df5da73bf5d2f7e71b71a7760c9a48 Mon Sep 17 00:00:00 2001 From: Matt Kaye Date: Tue, 20 May 2025 16:28:50 -0400 Subject: [PATCH] Feat: UI Upgrade Flow (#1750) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: hook * feat: add ui version to the tenant * feat: add ui version to the tenant * chore: bunch of generated stuff * feat: return ui ver from db * revert: flags change * feat: wire up tenant update * fix: type * feat: upgrade / downgrade UI * chore: tons more generated stuff 😬 * fix: some redirect logic * fix: copy * fix: non-required * chore: gen * fix: transformers * fix: rm from v0 tenants * fix: redirect --- .../openapi/components/schemas/tenant.yaml | 12 + api/v1/server/handlers/tenants/update.go | 7 + api/v1/server/oas/gen/openapi.gen.go | 404 +++++++++--------- api/v1/server/oas/transformers/tenant.go | 3 + api/v1/server/oas/transformers/user.go | 2 + .../migrations/20250519145912_v1_0_21.sql | 18 + .../components/molecules/nav-bar/nav-bar.tsx | 31 -- .../src/lib/api/generated/data-contracts.ts | 9 + frontend/app/src/next/hooks/use-tenant.tsx | 3 + .../go/migration-guides/hatchet-client.ts | 4 +- .../snips/go/migration-guides/mergent.ts | 4 +- .../snips/go/quickstart/cmd/run/main.ts | 4 +- .../snips/go/quickstart/cmd/worker/main.ts | 4 +- .../hatchet_client/hatchet_client.ts | 4 +- .../go/quickstart/workflows/first_task.ts | 4 +- .../lib/docs/generated/snips/go/run/all.ts | 4 +- .../lib/docs/generated/snips/go/run/bulk.ts | 4 +- .../lib/docs/generated/snips/go/run/cron.ts | 4 +- .../lib/docs/generated/snips/go/run/event.ts | 12 +- .../docs/generated/snips/go/run/priority.ts | 4 +- .../lib/docs/generated/snips/go/run/simple.ts | 4 +- .../docs/generated/snips/go/worker/start.ts | 4 +- .../snips/go/workflows/cancellations.ts | 4 +- .../snips/go/workflows/child-workflows.ts | 4 +- .../snips/go/workflows/complex-conditions.ts | 4 +- .../snips/go/workflows/concurrency-rr.ts | 4 +- .../snips/go/workflows/dag-with-conditions.ts | 4 +- .../docs/generated/snips/go/workflows/dag.ts | 4 +- .../snips/go/workflows/durable-event.ts | 4 +- .../snips/go/workflows/durable-sleep.ts | 4 +- .../snips/go/workflows/non-retryable-error.ts | 4 +- .../generated/snips/go/workflows/on-cron.ts | 4 +- .../generated/snips/go/workflows/on-event.ts | 4 +- .../snips/go/workflows/on-failure.ts | 4 +- .../generated/snips/go/workflows/priority.ts | 4 +- .../generated/snips/go/workflows/ratelimit.ts | 4 +- .../generated/snips/go/workflows/retries.ts | 4 +- .../generated/snips/go/workflows/simple.ts | 4 +- .../generated/snips/go/workflows/sticky.ts | 4 +- .../generated/snips/go/workflows/timeouts.ts | 4 +- .../snips/go/z_v0/assignment-affinity/main.ts | 4 +- .../snips/go/z_v0/assignment-affinity/run.ts | 4 +- .../snips/go/z_v0/assignment-sticky/main.ts | 4 +- .../snips/go/z_v0/assignment-sticky/run.ts | 4 +- .../snips/go/z_v0/bulk_imports/main.ts | 4 +- .../snips/go/z_v0/bulk_workflows/main.ts | 4 +- .../snips/go/z_v0/bulk_workflows/run.ts | 4 +- .../snips/go/z_v0/cancellation/main.ts | 4 +- .../snips/go/z_v0/cancellation/run.ts | 4 +- .../generated/snips/go/z_v0/compute/main.ts | 4 +- .../snips/go/z_v0/concurrency/main.ts | 4 +- .../snips/go/z_v0/cron-programmatic/main.ts | 4 +- .../docs/generated/snips/go/z_v0/cron/main.ts | 4 +- .../docs/generated/snips/go/z_v0/dag/main.ts | 4 +- .../requeue/.hatchet/job-requeue-workflow.ts | 4 +- .../snips/go/z_v0/deprecated/requeue/main.ts | 4 +- .../.hatchet/schedule-timeout-workflow.ts | 4 +- .../z_v0/deprecated/schedule-timeout/main.ts | 4 +- .../timeout/.hatchet/job-timeout-workflow.ts | 4 +- .../timeout/.hatchet/step-timeout-workflow.ts | 4 +- .../snips/go/z_v0/deprecated/timeout/main.ts | 4 +- .../yaml/.hatchet/sample-workflow.ts | 4 +- .../snips/go/z_v0/deprecated/yaml/README.ts | 2 +- .../snips/go/z_v0/deprecated/yaml/main.ts | 4 +- .../snips/go/z_v0/errors-test/main.ts | 4 +- .../cancel-in-progress/main.ts | 4 +- .../group-round-robin-advanced/main.ts | 4 +- .../group-round-robin/main.ts | 4 +- .../generated/snips/go/z_v0/logging/main.ts | 4 +- .../go/z_v0/manual-trigger/trigger/main.ts | 4 +- .../go/z_v0/manual-trigger/worker/main.ts | 4 +- .../snips/go/z_v0/middleware/main.ts | 4 +- .../generated/snips/go/z_v0/middleware/run.ts | 4 +- .../snips/go/z_v0/namespaced/main.ts | 4 +- .../generated/snips/go/z_v0/no-tls/main.ts | 4 +- .../snips/go/z_v0/on-failure/main.ts | 4 +- .../snips/go/z_v0/procedural/main.ts | 4 +- .../snips/go/z_v0/rate-limit/main.ts | 4 +- .../snips/go/z_v0/register-action/main.ts | 4 +- .../go/z_v0/retries-with-backoff/main.ts | 4 +- .../generated/snips/go/z_v0/retries/main.ts | 4 +- .../generated/snips/go/z_v0/scheduled/main.ts | 4 +- .../generated/snips/go/z_v0/simple/main.ts | 4 +- .../go/z_v0/stream-event-by-meta/main.ts | 4 +- .../snips/go/z_v0/stream-event/main.ts | 4 +- .../generated/snips/go/z_v0/timeout/main.ts | 4 +- .../generated/snips/go/z_v0/timeout/run.ts | 4 +- .../generated/snips/go/z_v0/webhook/main.ts | 4 +- .../generated/snips/go/z_v0/webhook/run.ts | 4 +- .../docs/generated/snips/python/__init__.ts | 2 +- .../snips/python/affinity_workers/trigger.ts | 4 +- .../snips/python/affinity_workers/worker.ts | 4 +- .../docs/generated/snips/python/api/api.ts | 4 +- .../generated/snips/python/api/async_api.ts | 4 +- .../snips/python/blocked_async/trigger.ts | 4 +- .../snips/python/blocked_async/worker.ts | 4 +- .../snips/python/bulk_fanout/bulk_trigger.ts | 4 +- .../snips/python/bulk_fanout/stream.ts | 4 +- .../python/bulk_fanout/test_bulk_fanout.ts | 4 +- .../snips/python/bulk_fanout/trigger.ts | 4 +- .../snips/python/bulk_fanout/worker.ts | 4 +- .../snips/python/bulk_operations/cancel.ts | 4 +- .../snips/python/bulk_operations/replay.ts | 4 +- .../python/cancellation/test_cancellation.ts | 4 +- .../snips/python/cancellation/trigger.ts | 2 +- .../snips/python/cancellation/worker.ts | 4 +- .../docs/generated/snips/python/child/bulk.ts | 4 +- .../snips/python/child/simple-fanout.ts | 4 +- .../generated/snips/python/child/trigger.ts | 4 +- .../generated/snips/python/child/worker.ts | 4 +- .../test_concurrency_limit.ts | 4 +- .../snips/python/concurrency_limit/trigger.ts | 4 +- .../snips/python/concurrency_limit/worker.ts | 4 +- .../test_concurrency_limit_rr.ts | 4 +- .../python/concurrency_limit_rr/trigger.ts | 4 +- .../python/concurrency_limit_rr/worker.ts | 4 +- .../python/concurrency_limit_rr_load/event.ts | 4 +- .../concurrency_limit_rr_load/worker.ts | 4 +- .../test_multiple_concurrency_keys.ts | 4 +- .../concurrency_multiple_keys/worker.ts | 4 +- .../test_workflow_level_concurrency.ts | 4 +- .../concurrency_workflow_level/worker.ts | 4 +- .../snips/python/cron/programatic-async.ts | 4 +- .../snips/python/cron/programatic-sync.ts | 4 +- .../snips/python/cron/workflow-definition.ts | 4 +- .../generated/snips/python/dag/test_dag.ts | 4 +- .../generated/snips/python/dag/trigger.ts | 2 +- .../docs/generated/snips/python/dag/worker.ts | 4 +- .../generated/snips/python/dedupe/worker.ts | 4 +- .../snips/python/delayed/test_delayed.ts | 4 +- .../generated/snips/python/delayed/trigger.ts | 4 +- .../generated/snips/python/delayed/worker.ts | 4 +- .../snips/python/durable/test_durable.ts | 4 +- .../generated/snips/python/durable/trigger.ts | 4 +- .../generated/snips/python/durable/worker.ts | 4 +- .../snips/python/durable_event/trigger.ts | 4 +- .../snips/python/durable_event/worker.ts | 4 +- .../snips/python/durable_sleep/trigger.ts | 2 +- .../snips/python/durable_sleep/worker.ts | 4 +- .../generated/snips/python/events/event.ts | 4 +- .../generated/snips/python/events/filter.ts | 4 +- .../snips/python/events/test_event.ts | 4 +- .../generated/snips/python/events/worker.ts | 4 +- .../generated/snips/python/fanout/stream.ts | 4 +- .../snips/python/fanout/sync_stream.ts | 4 +- .../snips/python/fanout/test_fanout.ts | 4 +- .../generated/snips/python/fanout/trigger.ts | 4 +- .../generated/snips/python/fanout/worker.ts | 4 +- .../python/fanout_sync/test_fanout_sync.ts | 4 +- .../snips/python/fanout_sync/trigger.ts | 4 +- .../snips/python/fanout_sync/worker.ts | 4 +- .../generated/snips/python/hatchet_client.ts | 2 +- .../snips/python/lifespans/simple.ts | 4 +- .../snips/python/lifespans/test_lifespans.ts | 4 +- .../snips/python/lifespans/trigger.ts | 2 +- .../snips/python/lifespans/worker.ts | 4 +- .../generated/snips/python/logger/client.ts | 2 +- .../snips/python/logger/test_logger.ts | 4 +- .../generated/snips/python/logger/trigger.ts | 2 +- .../generated/snips/python/logger/worker.ts | 4 +- .../generated/snips/python/logger/workflow.ts | 4 +- .../python/manual_slot_release/worker.ts | 4 +- .../snips/python/migration_guides/__init__.ts | 2 +- .../python/migration_guides/hatchet_client.ts | 2 +- .../snips/python/migration_guides/mergent.ts | 4 +- .../python/non_retryable/test_no_retry.ts | 4 +- .../snips/python/non_retryable/trigger.ts | 2 +- .../snips/python/non_retryable/worker.ts | 4 +- .../python/on_failure/test_on_failure.ts | 4 +- .../snips/python/on_failure/trigger.ts | 2 +- .../snips/python/on_failure/worker.ts | 4 +- .../snips/python/on_success/trigger.ts | 2 +- .../snips/python/on_success/worker.ts | 4 +- .../opentelemetry_instrumentation/client.ts | 2 +- .../opentelemetry_instrumentation/tracer.ts | 4 +- .../opentelemetry_instrumentation/triggers.ts | 4 +- .../opentelemetry_instrumentation/worker.ts | 4 +- .../snips/python/priority/test_priority.ts | 4 +- .../snips/python/priority/trigger.ts | 4 +- .../generated/snips/python/priority/worker.ts | 4 +- .../snips/python/quickstart/README.ts | 2 +- .../snips/python/quickstart/__init__.ts | 2 +- .../snips/python/quickstart/gitignore.ts | 2 +- .../snips/python/quickstart/hatchet_client.ts | 2 +- .../snips/python/quickstart/poetry.ts | 4 +- .../snips/python/quickstart/pyproject.ts | 4 +- .../generated/snips/python/quickstart/run.ts | 4 +- .../snips/python/quickstart/worker.ts | 4 +- .../python/quickstart/workflows/__init__.ts | 2 +- .../python/quickstart/workflows/first_task.ts | 4 +- .../snips/python/rate_limit/dynamic.ts | 4 +- .../python/rate_limit/test_rate_limit.ts | 4 +- .../snips/python/rate_limit/trigger.ts | 2 +- .../snips/python/rate_limit/worker.ts | 4 +- .../generated/snips/python/retries/worker.ts | 4 +- .../python/scheduled/programatic-async.ts | 4 +- .../python/scheduled/programatic-sync.ts | 4 +- .../python/simple/test_simple_workflow.ts | 4 +- .../generated/snips/python/simple/trigger.ts | 5 +- .../generated/snips/python/simple/worker.ts | 11 +- .../snips/python/sticky_workers/event.ts | 4 +- .../snips/python/sticky_workers/worker.ts | 4 +- .../snips/python/streaming/async_stream.ts | 4 +- .../snips/python/streaming/sync_stream.ts | 4 +- .../snips/python/streaming/worker.ts | 4 +- .../snips/python/timeout/test_timeout.ts | 4 +- .../generated/snips/python/timeout/trigger.ts | 2 +- .../generated/snips/python/timeout/worker.ts | 4 +- .../snips/python/waits/test_waits.ts | 4 +- .../generated/snips/python/waits/trigger.ts | 4 +- .../generated/snips/python/waits/worker.ts | 4 +- .../lib/docs/generated/snips/python/worker.ts | 4 +- .../python/worker_existing_loop/worker.ts | 4 +- .../python/workflow_registration/worker.ts | 4 +- .../snips/typescript/cancellations/run.ts | 2 +- .../snips/typescript/cancellations/worker.ts | 2 +- .../typescript/cancellations/workflow.ts | 2 +- .../snips/typescript/child_workflows/run.ts | 2 +- .../typescript/child_workflows/worker.ts | 2 +- .../typescript/child_workflows/workflow.ts | 2 +- .../snips/typescript/concurrency-rr/load.ts | 2 +- .../snips/typescript/concurrency-rr/run.ts | 2 +- .../snips/typescript/concurrency-rr/worker.ts | 2 +- .../typescript/concurrency-rr/workflow.ts | 2 +- .../typescript/dag/interface-workflow.ts | 2 +- .../generated/snips/typescript/dag/run.ts | 2 +- .../generated/snips/typescript/dag/worker.ts | 2 +- .../snips/typescript/dag/workflow.ts | 2 +- .../dag_match_condition/complex-workflow.ts | 2 +- .../typescript/dag_match_condition/event.ts | 2 +- .../typescript/dag_match_condition/run.ts | 2 +- .../typescript/dag_match_condition/worker.ts | 2 +- .../dag_match_condition/workflow.ts | 2 +- .../generated/snips/typescript/deep/run.ts | 2 +- .../generated/snips/typescript/deep/worker.ts | 2 +- .../snips/typescript/deep/workflow.ts | 2 +- .../snips/typescript/durable-event/event.ts | 2 +- .../snips/typescript/durable-event/run.ts | 2 +- .../snips/typescript/durable-event/worker.ts | 2 +- .../typescript/durable-event/workflow.ts | 4 +- .../snips/typescript/durable-sleep/event.ts | 2 +- .../snips/typescript/durable-sleep/run.ts | 2 +- .../snips/typescript/durable-sleep/worker.ts | 2 +- .../typescript/durable-sleep/workflow.ts | 2 +- .../snips/typescript/hatchet-client.ts | 2 +- .../typescript/high-memory/child-worker.ts | 2 +- .../typescript/high-memory/parent-worker.ts | 2 +- .../snips/typescript/high-memory/run.ts | 2 +- .../high-memory/workflow-with-child.ts | 2 +- .../snips/typescript/inferred-typing/run.ts | 2 +- .../typescript/inferred-typing/worker.ts | 2 +- .../typescript/inferred-typing/workflow.ts | 2 +- .../landing_page/durable-excution.ts | 4 +- .../landing_page/event-signaling.ts | 2 +- .../typescript/landing_page/flow-control.ts | 2 +- .../snips/typescript/landing_page/queues.ts | 2 +- .../typescript/landing_page/scheduling.ts | 2 +- .../typescript/landing_page/task-routing.ts | 2 +- .../generated/snips/typescript/legacy/run.ts | 2 +- .../snips/typescript/legacy/worker.ts | 2 +- .../snips/typescript/legacy/workflow.ts | 2 +- .../migration-guides/hatchet-client.ts | 2 +- .../typescript/migration-guides/mergent.ts | 2 +- .../typescript/multiple_wf_concurrency/run.ts | 2 +- .../multiple_wf_concurrency/worker.ts | 2 +- .../multiple_wf_concurrency/workflow.ts | 2 +- .../snips/typescript/non_retryable/run.ts | 2 +- .../snips/typescript/non_retryable/worker.ts | 2 +- .../typescript/non_retryable/workflow.ts | 2 +- .../snips/typescript/on_cron/worker.ts | 2 +- .../snips/typescript/on_cron/workflow.ts | 2 +- .../snips/typescript/on_event/event.e2e.ts | 4 +- .../snips/typescript/on_event/event.ts | 2 +- .../snips/typescript/on_event/filter.ts | 4 +- .../snips/typescript/on_event/worker.ts | 2 +- .../snips/typescript/on_event/workflow.ts | 2 +- .../snips/typescript/on_failure/run.ts | 2 +- .../snips/typescript/on_failure/worker.ts | 2 +- .../snips/typescript/on_failure/workflow.ts | 2 +- .../snips/typescript/on_success/run.ts | 2 +- .../snips/typescript/on_success/worker.ts | 2 +- .../snips/typescript/on_success/workflow.ts | 2 +- .../snips/typescript/priority/run.ts | 2 +- .../snips/typescript/priority/worker.ts | 2 +- .../snips/typescript/priority/workflow.ts | 2 +- .../snips/typescript/quickstart/gitignore.ts | 2 +- .../typescript/quickstart/hatchet-client.ts | 2 +- .../snips/typescript/quickstart/run.ts | 2 +- .../snips/typescript/quickstart/worker.ts | 2 +- .../quickstart/workflows/first-task.ts | 2 +- .../snips/typescript/rate_limit/workflow.ts | 2 +- .../generated/snips/typescript/retries/run.ts | 2 +- .../snips/typescript/retries/worker.ts | 2 +- .../snips/typescript/retries/workflow.ts | 2 +- .../generated/snips/typescript/simple/bulk.ts | 2 +- .../snips/typescript/simple/client-run.ts | 2 +- .../generated/snips/typescript/simple/cron.ts | 2 +- .../snips/typescript/simple/delay.ts | 2 +- .../snips/typescript/simple/enqueue.ts | 2 +- .../generated/snips/typescript/simple/run.ts | 2 +- .../snips/typescript/simple/schedule.ts | 2 +- .../snips/typescript/simple/stub-workflow.ts | 2 +- .../snips/typescript/simple/worker.ts | 2 +- .../typescript/simple/workflow-with-child.ts | 2 +- .../snips/typescript/simple/workflow.ts | 2 +- .../generated/snips/typescript/sticky/run.ts | 2 +- .../snips/typescript/sticky/worker.ts | 2 +- .../snips/typescript/sticky/workflow.ts | 2 +- .../snips/typescript/timeouts/run.ts | 2 +- .../snips/typescript/timeouts/worker.ts | 2 +- .../snips/typescript/timeouts/workflow.ts | 2 +- .../typescript/with_timeouts/workflow.ts | 2 +- .../dashboard/dashboard.layout.tsx | 10 - .../settings/overview/overview.page.tsx | 107 ++++- .../main/tenant-settings/overview/index.tsx | 17 +- .../v1/tenant-settings/overview/index.tsx | 122 +++++- frontend/app/src/pages/root.tsx | 7 - pkg/client/rest/gen.go | 23 +- pkg/repository/postgres/dbsqlc/models.go | 43 ++ pkg/repository/postgres/dbsqlc/tenants.sql | 6 +- pkg/repository/postgres/dbsqlc/tenants.sql.go | 39 +- pkg/repository/postgres/tenant.go | 4 + pkg/repository/tenant.go | 2 + pkg/repository/v1/sqlcv1/models.go | 43 ++ sql/schema/v0.sql | 6 + 325 files changed, 1135 insertions(+), 779 deletions(-) create mode 100644 cmd/hatchet-migrate/migrate/migrations/20250519145912_v1_0_21.sql diff --git a/api-contracts/openapi/components/schemas/tenant.yaml b/api-contracts/openapi/components/schemas/tenant.yaml index 4714bb38e..c2e4e0578 100644 --- a/api-contracts/openapi/components/schemas/tenant.yaml +++ b/api-contracts/openapi/components/schemas/tenant.yaml @@ -17,6 +17,9 @@ Tenant: version: $ref: "#/TenantVersion" description: The version of the tenant. + uiVersion: + $ref: "#/TenantUIVersion" + description: The UI of the tenant. required: - metadata - name @@ -30,6 +33,12 @@ TenantVersion: - "V1" type: string +TenantUIVersion: + enum: + - "V0" + - "V1" + type: string + TenantAlertingSettings: properties: metadata: @@ -103,6 +112,9 @@ UpdateTenantRequest: version: $ref: "#/TenantVersion" description: The version of the tenant. + uiVersion: + $ref: "#/TenantUIVersion" + description: The UI of the tenant. type: object TenantResource: diff --git a/api/v1/server/handlers/tenants/update.go b/api/v1/server/handlers/tenants/update.go index 65bfd86a4..e73ddc3ef 100644 --- a/api/v1/server/handlers/tenants/update.go +++ b/api/v1/server/handlers/tenants/update.go @@ -59,6 +59,13 @@ func (t *TenantService) TenantUpdate(ctx echo.Context, request gen.TenantUpdateR } } + if request.Body.UiVersion != nil { + updateOpts.UIVersion = &dbsqlc.NullTenantMajorUIVersion{ + Valid: true, + TenantMajorUIVersion: dbsqlc.TenantMajorUIVersion(*request.Body.UiVersion), + } + } + // update the tenant tenant, err := t.config.APIRepository.Tenant().UpdateTenant(ctx.Request().Context(), tenantId, updateOpts) diff --git a/api/v1/server/oas/gen/openapi.gen.go b/api/v1/server/oas/gen/openapi.gen.go index 899424714..55c5c9863 100644 --- a/api/v1/server/oas/gen/openapi.gen.go +++ b/api/v1/server/oas/gen/openapi.gen.go @@ -182,10 +182,16 @@ const ( WORKFLOWRUN TenantResource = "WORKFLOW_RUN" ) +// Defines values for TenantUIVersion. +const ( + TenantUIVersionV0 TenantUIVersion = "V0" + TenantUIVersionV1 TenantUIVersion = "V1" +) + // Defines values for TenantVersion. const ( - V0 TenantVersion = "V0" - V1 TenantVersion = "V1" + TenantVersionV0 TenantVersion = "V0" + TenantVersionV1 TenantVersion = "V1" ) // Defines values for V1LogLineLevel. @@ -955,8 +961,9 @@ type Tenant struct { Name string `json:"name"` // Slug The slug of the tenant. - Slug string `json:"slug"` - Version TenantVersion `json:"version"` + Slug string `json:"slug"` + UiVersion *TenantUIVersion `json:"uiVersion,omitempty"` + Version TenantVersion `json:"version"` } // TenantAlertEmailGroup defines model for TenantAlertEmailGroup. @@ -1075,6 +1082,9 @@ type TenantStepRunQueueMetrics struct { Queues *map[string]interface{} `json:"queues,omitempty"` } +// TenantUIVersion defines model for TenantUIVersion. +type TenantUIVersion string + // TenantVersion defines model for TenantVersion. type TenantVersion string @@ -1116,8 +1126,9 @@ type UpdateTenantRequest struct { MaxAlertingFrequency *string `json:"maxAlertingFrequency,omitempty" validate:"omitnil,duration"` // Name The name of the tenant. - Name *string `json:"name,omitempty"` - Version *TenantVersion `json:"version,omitempty"` + Name *string `json:"name,omitempty"` + UiVersion *TenantUIVersion `json:"uiVersion,omitempty"` + Version *TenantVersion `json:"version,omitempty"` } // UpdateWorkerRequest defines model for UpdateWorkerRequest. @@ -13641,196 +13652,197 @@ var swaggerSpec = []string{ "5ee7yfDr4Pzu6ob6scbj4edL5qWf9EcT+lf/7Mvl1feLwfln5twfXg7Hf+T9/KPBZPQvdg+guvzJ0Fc3", "k7vR4NNowPuMBsok6tzjiyvS8mLQH8sxh4Pzu4//ursZ06WQNX26uPp+N7q5vGPJhr4M/nWn3jwYmnBA", "te40HccoSFUCS/kCR8PJ8Kx/UTVa1ZUJ/+uOoeHr4LKA+AZXKvxv1roqkj7LaFrMtQoTngliYMjX8V3k", - "bIwc2lr4Cxa0FzrQJmgEIQiese+iqxhfpbhi1MwBMQfIiWIMPYcfMuUg+jk2nufNlCVi5TQT2Tsnu5fR", - "3E9vkU2OwpWNrpN52iwu203fsqEXeuYsLto174DA1++FLtvNLOoxou2M6BXGS35VfjgbQ0z+g7bH5Cx1", - "xOBH7JNdpg9WKDDV47NebBrkPNGEj/TtjQMS6IA4TiLgzv1wxjI/UgRXzS+y0DAioWF4S0LBlixSbJbh", - "oXF7lbhQvDufgB+kCbQAhYaEqIColwKIvnLWzxkAxJZqvrDJInxByHeWXtoU02pVx/KBH4LIPlG/R+g+", - "G4N2nXvRxAFYBKJyqlqvr94sCbQAm+XCUEbYbSah04vM8ll52SRyvPL83tvMe7pc1qi6KwfOUKYLE/HZ", - "jDXWourKhI6QS75o1Lk1ikOku8r2Sk3iUUM7O6NKOCk30yBsT8vwvxpB2eeLIaxX1/oGwYT1uE6nge9W", - "kQIdryLxmQrzzmw6379lNn3E90mcUq6+X9KTVv/86/Cy0+18HXz9OBhVHCmq3wNRHzkyR1npPCglnNOH", - "TXWYyMGhOBmq5m4yXjFKVCJAUL6KRXn2Zn/ckZNtp9sZfGNnPfWMSs7A/fEX/ufZ6OpSCZCrwHvO3tGZ", - "fCBZVLyuod8d+iBBL5zZOyAcOU8gofkqSoYQ661/rdLs4ZH+zdF6nhGxsc1L1MO/Wi4ESQ/1rCupx+4R", - "Ud2GNX87tIAYJuIFkdChbCznb/4BPHCOHQ88d51j5wnCB/LfRRTi+d+XvPqX6NG+KDKLXIGo6yjwXU0+", - "ImabVx1XZep81lRjMDQQuXn2q4tQ58CZV8e9RrbC1CiMvmVeBSGLvh11up1vx3pRwmLOthACbYyqv6E1", - "BN5iZll15TVPgNaS1NVo06iAmPd/jx2FrZ/idf0UG/QfbCSdfwM/8NJuXAMXfqfBC+ZHS+gapEj3Il5l", - "ExYB4fjIiWlrB4Se44IwjLADaEERWqlMZHMrbpgWOqQ7INY6SIDnJRAh1VGSM+3EybvsLyEf/gBorpPy", - "c4Dm6pD/gQrTcbnPrCNW6GvMamY5Z3OAjRN+g4l/79ehl7p7iAx65M15sbkcDHpOmANkLmmnnQPIGnYO", - "gniLFyGej+IAPOcYQexfY89KHru3BgLL1/wz5xWHT2YkUt6FTxnWhJmnh30JdS9rCr7Q2LEqQCQQlfhb", - "DYZS3iFZ8VDFkwnlF9HMD5fPaL8cf6+U4H7nMC7WGNfhegRnPsIV0n0X0W2nIQ2CYQd3S1Tdst001axG", - "cz9G++r1K3lBt6jNN6Fl2GS6bft2zAp2TQB6qKguhWESgoC/xDceJHkzZ3iOutwadUHoJPCe2+c+09kA", - "PThRkn/Po3ZWT6BrTU7Q7bBqNnVE8+2Y4OMTa6u18b4ds+eXrE1VXS6lSJOGVuR3qXs5hFr58BxEwCge", - "6EfjMErwdF3tH63LjI134NwQG5lMgtIpYrfoZJM9KlZ4K0ROI/ARBCl7FGP3GLbiwRfd+ZUowZAGgQUs", - "U4R01c3Ss8o5mJ0pj2OKj8E0z2bqiUwmyS/TqgdmtplWNMC2hRP2pnAC36yVSido573NKGEHVLGgSW2w", - "phkHv0g6/TbpfUWcfSKTAP4lUgNms8s9UZ5ocNL+JNX50nq3StutWU4ZFbgicIUep0K3DNt+KPZ1CNiK", - "LWhgN9SNvU6jojp/hMnUyMhCJemdENfCALZJAfHt2JifGWAMF7Eh6I5/VKRJMT2z5i3XVhI+ByJ7cjWS", - "ipmOXy9PdPGdlu7pM06eHfrEwwbTzRNPF9CxQurpbKRd4ITKJNHfjlmKt/YM3fQMTVqYzinNhQbBiV5g", - "0CeYXytem1FrfvIcQ7tVDWTzJV+3Wb+1rDTpIE58iOqXT76cM+eRMesSaWN12mTvyRAGi7jZMzbxzrhZ", - "UgzWhAGnTq3uWYbr22oy2wlZkhG9QZrkKWzzT9YavlETY+XephXfo+kfsxXfqI0Hl5O7iboYuYY7phpK", - "D+rORoP+pJAi78vw+trwYC0nhSydIfYPc5AfsuC1JtmcYFNiyTINFOdPQ8y80E2Tz+VBqOf4qoAthgQz", - "511HfohZoFZ5BzjBaQVo9qJPH/vqL+CSuR15I82TQatlaOLNWLKKpjurosbSyqZGRhqa8OlWPtK3yG6R", - "J7nSc3iertn8SrgAYVOMZEvTkHsONkUuSkmQvQY9u/p6fTGYlB6BVrxtzftjl8sUpxxt89o4m2ZVByy1", - "/JI01B4A1mo1qR5tXbAws1hFKzoQso0MrXV+15zxpCGQ4eQJIIf3sj/keXmzyO7STbMFyohplvRYMxz/", - "Whyq6/ihs/CDwEfQjUIP2RmyGs8WaSHOmMVZnL/JqGWAIcLkt7/XZ7G3Qj8ZXnSzx7+MgS3PQT9VoJxT", - "Pb/DFT/GMASxf3AZhZdpEIBpAP8xpu8EZKuev4ijBGdV9zvlxjEgp6HOzMfzdHrgRotDXrq+58FH8fch", - "iP3Dx+NDBJNHmBxGgOroH72Qj9U5vQcBgisGHaWLcQyeQuidVbKj4o1lzcuMWZXypTwg+9aQgvZoTzZw", - "zrJICKphmg0lBS3ajlnmKUNC0LLuWtVvQM4x0u1hcsRLl8UGZrfwQFcemochgklzLeTzbvZb2sxhnq8y", - "tM0qD3UkJ67vhG8k76mvPWc0SX+9BGWpzjKbvLfaHNLlmXhcs2aiVVKAqt5W1UrpMpeISE+v0Q9Sriv1", - "VQq8qLpU8nSezz3KvCu5Kwz9FtwWDejNulrM5ug6rdClylSyMSf+gl/KbtCt6cEYz00FtGM8zylvUTcL", - "YJjcgyDQD7k1w2/lrLCT5bQL67wuJcNuqxsii6gI1tEeXW/NWtG4rNdwNmstkl/IIrHIGF9jA6yUopsJ", - "34KKPc8p6mWU7m1BhbymHiXURLMkNVKnXPWtTZtu7d1tvmiMJsSWfzWRkj69rmrPVj8MEK3r47kL9Uey", - "F8KZBa7N+71R32Nzj51Qhq3XrvXa/Vpeu7fsWDOZ5yuq+902V/fGWmroialxfWjsKu4NWcm28r2cYZU5", - "JPKOkJxfQvo8DNrwHGKRiqFwdVtfciGvVgmVzEG9O0yNZSftP0WJBh5xLHkUdRVqbDIa9pJlZCn4tFaP", - "QWHgoHU9YykHendyCxa4FNOW9y2v6/N759VENW0gX6I6ZRWwr2W4q6ZPA8vdgPF1WfE5x7AaFtr/zLN6", - "ae/keektlulhrUn37N7q8hJSPEuE1nJMTUVsRd80CRrlAeCvbsm4OlzmUMIeIZpf/69rkQi6CTRoXvZN", - "vvLiT4yJCnCG904YYSdOokffg17XAU4CQi9aiE60VtwUOjMYwkScAVRVdrIxjDdHs7ebBLjc3myblCWc", - "tcgmgtNcIXurwZp58WMVoZXrYmRMfuK9A4Z9oy8XQOhlef8SNtRy52W7cro60LOCuswcO4s8A9X+MZlc", - "O6yR40aepOCEI9/+gcEdUGqn5ia+tUR4NQlxVNboUUHzorV10jstBSxNO+VCqp8Hk063c301pv+5mVAr", - "xKQhWVwaqgpaQ+xNFE+E5ILQiWFC6OqgUZJ68Ah8ehIU1dpqXiOWp4U/oJti6LhRyHM4Bs+Giy8fxfRY", - "mugOJoTqstp+ACF/FkLPyTpRt83NzfDc4eyz/eNYAKYwQNUJLGkbylI5FyFTA3akyAQqGUe3ZQFA+A8I", - "EjyFwKK6K98qmo8UEQCBMxe980fak6OTk97xSe/43eT4w+nRb6fvfz/4/fff3334vXf04fToyP4NFmDM", - "TMyDAcJgGlBP1Q5CugA/zITP642vjwE2b3eY7Y0EulBm4USmh2akjSw0nD+uNiDgUX4uXW3BNCRbMgzv", - "IztuGCkdaHGSyKQJkKgdzeoaM0ZcciGFOtS6twTS8aSLz6JqtbQ3QiX0zybDbwP6uk7+ed2/GRsinW1i", - "eRiyZBwP00zGB7dcVzKJWgCy3tfEet/UWZ83owvN8E2NUdpea0gowrKkRyuTW4inlKTrut+MVyQ6ZgmO", - "ayavTiBRgYfXfyplNLslkKM88xeyHINwlvIbF2uxMD7/gpjiYZ2VJMHlR3x6w4hLpMEPnABtA+Q9mIct", - "LY5CpJp/Vxd9VhrrX5M/qP9+8q/rwfhsNLye6H0oGScrw4wHF5/+uBqzFxJf+5d99rzq++DjH1dXX4wD", - "iTTxBTecSpv6cCT5i8VtZ7dB7k72zl9k79TnfPwzmhoEK/miA8iKPv8RTddaramJbjZiTmR605hHYLb8", - "WqX/DmiNf9vaJjYr4BcIzeSEclchswJV+S01eqGqfomY4kxYZrq06jOIle+yVFjhej0Ub4XY4+4ZxIji", - "xM26OjPSV+o6xTV7YEzrP8YJwHBWm2tIgfAi16+5DZuZqfnsxsUEMO9O6o/+YuriarparFZt0fBc975e", - "Ajg81+JQ9P7ih7nD9qeby7PJkIrZ85tR/+MFMa3O+58rBSQZROjPRhRMZ9ewl/iuV8orhVJuWZ9T/WHn", - "DOGtjU8uKZN8gVVRkbQaio5iJY89wGdD0IYYnpClXeClOOcAB8XQ9e99N5vE+VsMEIKe8+gDnn7m73qu", - "MCKiQUSPvogLTlKoGb/uDk0NjZEH5+Ojo6PuxuvpyziTRgtiRcnt6TIrqL9GVc6iIJhG3LZzic09VqsY", - "bxuE5SqCW0ReqJfq2vCLskXEAgih9/G5weATpVc5HqKhSWKMqFgloVQ2kBoroYB9Wy1MduSEp0RV2CuF", - "URpeJR5MPj6f+wl0caGOS398RtT0YHxWqaezUT75MMjpffX1TUbLOSmmSMaaScYiWqSV3a3sbmX3a8lu", - "wxy/oGivCDdbQjTT0YYYLswBbIbzSn1nYxrlMX2uXJ2nZsU8ZtmL6LU/dF7DgAaZXsxkU3xiwhfVLSFS", - "GbWOeirq8Teoty+zslTV2i9Nu9S5OS9QzMQ4yYuTYkxGFF4rkr8EK2kwdufQS4OKLHKGziuro+/F506W", - "AqZmsxHL/2+MVMm9stogOxpeuPBp6xZhdBLQREVN6EgMdcY61lmhheal+TOG0OZkqkp/JZhO+5Ezl/ab", - "4NHmSbWqFjsBMx16A2Yyru7yD9f8Roq7dRmEVfTDhcJZQg4y93q5oGVpxpd3voEb6yakAdDaGakcueNX", - "juueFulX2NwyKOBNI3mhjGlfZmCJn/Ua98zc0qMvs8Du+C1EczSz2nRrqEpXf7NVBYZizRZZNneFYbMh", - "6q0HTTtwD9IAX1c+luSNjI8mrS4Jsqu7V7qQixKPRdVZgIq4aTDxFzAyJHdF2Hcfnk1BHuSbg/jVh91t", - "n8LTDVgLFcoxmnOa2AChlg+39f9XnsnMZyUBs9iZ3EC39exA93WdFyhNCORNIZxFHWQ3J3mM3yeQRkKd", - "mdNVLsCPmhZPzSxiU85KFkKfEiFFrPsFg3AKQQKTfsoSrFCMUtlLf842ZY5xTM8GUfTgQ9HcJ7vKfhIX", - "zKcd/pAy6wti/wvk8Sw+D2HRxFWzbk7/ekgTIGPqCcr/Kimrc3xwdHBECZO9De2cdt4dHB8c8WeedGn0", - "KWfgP0J+aV2e97O4lCatQoiQI70QZBeByITZueDfP9N1iVBvOsvJ0VF54D8gCPCcSuUPuu+XEZZz5nam", - "c/rv224HieScBMKsoYh6+Dcf351D96FzS/rTtSYQeM/1iyXN/KrVjkSDdS6XAker9rJqszgB9/e+W7t6", - "CW3t8h+PDwEvKdyjleB69FoSHf6kP6u/vTAYA4g1tvg5/R05QNbtoJWrWb072r2EsUKVcjYCpcUE0Gr6", - "BOyKkJHSDA5PftU5Zc+WJXeVltJRuZ95m5lcXPno+nJb2vv3ZWyNU9eFCN2nQfDsMJR6uaInJeS9dDvv", - "GZW4UYh5VnwQx4HvUowe/omY9sjWUaOtBkkSJbymYTEiYgECggXoOVHiTIEnHjowMN6tHQwdFJ+iZOp7", - "HmS2bEbfjE6qyExQPC/qddvt/OjJIt/UMcY+dDWEcUsPUdjVpM5ixvsqJM5G+DVInNLDx4jJzrUQg1o+", - "v4A4+VKmTCaV2MKRkwqc57HxohfRa1mIdgk62HNigAHaigFLMcCoZXNiQFWQsd/D0QMMiVYUf1NtGEdI", - "YzSM4GP0AB0QEgvMoa157I+csSAmYn9CWgn3AOluIyXk8AaZIGDdKXWX0OVxOqfQ/dpEjZpQNScdsrET", - "vnOCjLPfqihZbnmOgt0gSr1D9ShrtnZLiZ3EcYIO4vghwiB0YYmIz8hnEaxgNoI3j1sKiJOG8tHhzhBY", - "jdXOEKze/vKt/6rc1/zoiSF6UcxCJ7hGU/abOVcPf9L/vlTtN5FSslxpfkOpj5VtZK0kokMYjRP6datC", - "aH2bzTOh1ChvlljzkYs1hg26Y61sy5G4gpmMvBmKK6Qao59bM4Uf1ok1ui1SqtXQ/LkUYG+d7s8pCbe0", - "v1u0v4BL63Cj9t6e4uY5lJrQlFSJe6LI16HCyRiH1KHNdgkZd/zCR+QAFDi51qYNJq2H+YYb220yF99x", - "ZcqGmy9ybuRWt0uEILeebkRhE8r7n9vkKPRxRKT54U/G8S+HcRJNoflwKW7pHJBdBOPIoX5diq/8e3Az", - "w8upryOER2l4Tee1902ZlJ6UXFvWehUExXMnMHqi+D3Yqla4jLADUjyPEv//CBSRyKLCsjywN38lNydm", - "ZeSZ396h2+N84vJ8mG2rXnHkyAwFwH04/En/Y+HFd8akoXhaX6Ic+pWno7F32ufGNBIPBXEnvfN5nOyS", - "aXO8HTBuwoyE2cQftjMxy3JEk8WBIIieyPS6G4Ei1QrRS3+vMrEY0eU5JkSHP1GIrLjlcqxK/TK/hKgB", - "m+QHMzMK19w7xyYFZLSMsoOMUiJYySqX40pGCZGGTYThonib9KYLmVcciUss0vhu7NXsj67ZEfAAn5f1", - "BCgwnHz4kAPieB02UJxE5B/Qa3XYDrGm6RBJ0607II4FtZfVGmtT4EcMpgE89MAMHcpMzcZDI6KnRtrO", - "wXOAnSkMonCmvlGXiYPBrHyk/HZ8DmgNkgmvq1XvLhM1V7J0HyzJL2WZv1KYPGc844HZne9Vq7lNvTew", - "kjsFeF/r4GNNvWsrjHYOZrKgnDYDU4UcIlOK2z8669v2EnY7H7Yl/Mgp1F/EAVzAEJdsA+q8kNVgxdU5", - "QA9aCUMbHv4k/6m5XmKJ6afPjG+KAoRMYOlqZ4XqTEqfALpllZ+vyGcQCqKmnwpL6WXNJv34hRT8jVxv", - "FKtvnT/fs7PP5medqEXZiKVwH6Us5c+OiIiMn0siwnxmwDYi5DCIZnW2ShDNnMAPocijw+EoSpSLaHbh", - "h6zCwo5Llc2yvYqIBkqZv8tq7+7ymlFSn0L6F9Fsdcon/9/LHsOZb3iU2i5G4pelW/aB/LsVKbNw5KAH", - "PzYo1ej+HsG8TlWf2Pz2Xps9q3o6mlrOmT4bpqSfG864ebWe7fUSl/St6d2q9pyM00mY1dU8baG4CS1k", - "HXNM5MGRxdGKMq+ZvNtF3+GvJPO65fSawsnwAJ8RmZVlODRPS9p1tE6e2ngl+mSu5JDYrBy2l8GtlVVn", - "ZUFR980yPMpK4DB6s5E4vGWtyPlE27UyZ1dlziSXJcGzkjrZ02WD8KmcwgEIRa5PH/A8+XjOAjvYnOuo", - "Dm/hnkZuFEO6VJROEcSOC0LPp49kBF0bF8/62q6btq5csXODoEfZiMGC/XCmgQcQjgdByq66jdXmtynN", - "FdZuIM6FiGnleV6eC7xkAp3ht0qidw23x6zOngOcED7xgY2imbXdm2C29b+l/HbMUMDQUfN8kpXlxpFC", - "yqyMHK/cubWHk2L7almPZ2BlufGTKHT+jKZKOCQLkWyPt9s63l5mJ9qcDJAsK9nVXgzYG3aHPx+Pe+xv", - "m3AtUCc8Gici2C3LjjOwT+NMPbEWDXgSa3vr4m6lxf5LC1uJ0FXolRgJFTfO0tR3fIz0985sNtub551m", - "8zfO3LMIK3ZLa4EXr2sbq948o1moYXqDtciSrFZwJgdOhBw5SRo6vGd1hgR23UHOFCyXr8jpuq/cS9Oo", - "86KkkTNjb8YEGkyHdJ89+LAAtCIfuyF8VZaTtoUmDbEfdNYzu+pIoa6a0JMVc2rcNTxC8HUiAlm2VUrK", - "/4HU4EYD0Dw7K2l/J1rf0dYbJbYs2JJFKdNYT5kxPov0MYQ1soZ+OLtjuWc3A/nmL0tHaSjERvMwKFVU", - "tSGLuxOPRPdmIbWB3XWlvVqLIz/Elspt4YcphsTsFH8lEDx40VMo9V0DXfcZ4msy+b5rOqpVwD3myYvl", - "LTg/lBULbh/3jsj/JkdHp/R//2OQSqIGzz0zbtahhSikU3gfJbAAakTgWwFYUSLnIx28Obibl405UltC", - "OlI+aeXjjsrH/O6sXUqiQ5fWiTC//GJ1JGR4uU7esSZv22VPUUBNlZp8h+zJTuS4AmlWPvoqFxkdKGgf", - "ZrTRYRpBUmDftYuPBMYBeK5KqEi+V4oP1uRNiw+GgibiIxFIW1V8sIFa6dFKD430KHDvGqWHcAL1kjSs", - "i+/KVSGvjfAqlkJtw7x2OrSU5TyCVoFeom3zEFP+lM5QTM7gWAVJ4ENE875BK/A26OUNAG4CyrpcvH1Z", - "5DVLTPfQe3Ri4CdWW5ZVib1TUqtpdm8pL245UnBP3M9PtIyKdJrXxzfCZMPeZlmmKnL80A1Sj77vR0Qp", - "R2HwrP4un5zrBFIYPN+JBmZGKJe8qnHS5/IPWODslfz1miwJRse9qtZ+dQc+f8TcNDiztUd37aFRzhZT", - "TEJhdTm0zPcabcNDXgu9R1iizlLkbcmwtLwkzaVoNh+rrcfzrAg72mtLUhFKqFiIjCGFXx1z9HHUmVWo", - "IoVeJcfLZuWVngRa0dWKrqaiS8Qn1mWE5ZHxBYOgQjS1QfLHHHUKUmpcZyp2qQNe4HCbQfK6OvsNQmBz", - "FNLGyxWj1QsMtAYGz/Pzz8fjnvpLXf6kHMmB0KNBrfIcjSOpcKOQbu//djxKFP/bcWIwg9UywDICNgcD", - "OzvNaE995Km6vL2NP12Cy1rNvUe5zSwZulsi6CVY3D7LS5aRkZ0x7NW5zAdifc54O2+AM7Glde79mgKs", - "WYKYVna1sqtCdmF/4YczVFtjibdrLL0+QzzhU+ytPaKVQR6M8ZxdtrOoOccVqVMNaW9Jh53LNMU2p5Uk", - "ey9Jqvhz3eIFxlymiD9fDkHizv1HWGcF8VYcTNJdK0LGGMb8ir4vBrYQH2I8c3UFDm97Xb+b2e/4vvM9", - "bxPg7UWQkuS6QqBSWUjl2F9hflmmgvw0Sisr4UoWrpdJjbNv2sijgUhl1UqjNyKN2mScv6IsUhh/85Jo", - "iTTYAqhyFGPDTNitGHrdGMYAPsLAKhyOtczNXFmFk9MB6fXJh4FnfJQOieJ16GwKHBUv0mmHpoCMWS9t", - "+BigeaiixKtaP/388ZmtpeHkV2pfAx7Y9J6fQJenwKqA4lxptgwkWf/NKqk2Hfwrp4PXqwF++V/xdI7e", - "SiJ+u28IOZrQn8/Uy+h1X5azwdlEde9LWLjA61yPMwgbXYhzpP7aNL7ETbiS3Js/2eB33EUi11G0DGeh", - "pA2wOy/TNqv5R8vx//ARTRJaSeD7UyNwQxErDAFNmDBOCCKxz95GpAKBLT/uEz9yPrHmR20wSinMDASE", - "MMJZDy6AH/RmSZTGlRc8RAnJinGMvOgYDh3A4QMUWbdPmgxIi8+kwb4Ewd5unCd0iGmYesG4CS3v5G89", - "KqjVnpm6DUy08lx1jPHmwzFVC7OAGztdV0J5IxP0eLPsvYQG1NBQy9daG1XLbevVkoc8jX2NhiS7J7o4", - "okv1exGFXPxwNuZ99iQ36ZbUpIKYFXSkuictK+XzBJnQtDY+iv0ejh5gzUN9p389dFi7aq7px/6ENGvt", - "SXRI4x+uhxQfaMRnacgnIo6j9fUVjUdCkQy1CjPIH1cpZRFm1G5H7K2NSBEgaF0xCzfpwihO2vLXmp/c", - "ZMzUkMGqFM566wy2VQbbKoPVVQYrYJJhlsPzRrXIlgBQhG4Oz5cEMUnD1dPp2EA4SkOWSoc7vl7lSpru", - "5+tcSNOpd+A6WoVDvYyuIJYsiw98dh5BkEJ9Lh+ZLPffhN2OT2nT406X/OuE/euEiPfqnD9f15vyJ1sG", - "S6piWR+QNh5uJ9vPJs8KbbnS1yxXaudCpuMabJD2CEARQHFR4xbmSZNeJQyBUUITny9kPd56FOjJf21n", - "1hHnT26ewh8uhB40VLBje7NcWWLDweRwmgYP5rCfj2nwwMkDZTIBVQoF0ucNCway/IbCAb2mdEDNxUMb", - "Jb5j8oGyqSok0JqlhF1mfebIUFKT5Uxck9RgYSVvPvE+Q4C9QcEPDM2SZ1tDmgVskX89ZYdlcvbYYIJR", - "8UM0/RO6FpYLRRrMcim0QmpnhRRPwL0R+UTdaJY+Vuabs/CzfoHP7bVe5mxc6rROkd2e2HUndof7ftfJ", - "B3YlLFAz1fzmi1owBOyKal6PWy1XK6NVmG9GYfrho49h0wBr0UsfNDakX1tdKWLFFHwsFSUmsN3GhunC", - "pzNa3FDMNJugktZb97cSJc1QYhcczXD7qhHRDNxlAqE5YbRsqY9+lnyznlBNzufihx779wtj4gBiWGbn", - "c/o7kgc7G1Zmffa3sG2Or6ph60l07LtureVeRiG7zL05RmJEmJGr6fV2fh+pXqt609qME/bnXeu+cMJm", - "n94up3df7fGtJecy+PaGc/mj2MacW6X5FnAxpczX6IwmeulZ/Cv92p7RBDUq+FjqjCaw3RqDujNaRovr", - "sQX5eIc/2R8WRqADOBDOfRIt6p69MWr4NUxBvmwTbOzzVnn3/UZ4dxkb8G1w7Q5lubs0JLWTTJrbmLXJ", - "i79SmMLegghutz5bOG3t8NbyFrlSYHyG+J+k11c+xT7KjL16GbBPwd6bt15ytLfcCzDnESbIj0JB961M", - "fG2ZSMSR3J2FFCzFdOjLysQEYNijF042oRKkNbueqouVGAEML0jD9l3aLlehWccbJovKy5t7qSTpbAde", - "KxVh2Vb6zDyvNQjGUdi5jcYpnFlV3GTilqDauWC/LitxeY9eHAW++1yfskV0cFgHm4QtIpTgmvZo07Uc", - "6tCynIunsButq2frWY9QANyH6kQtY9LEeYLTeRQ9lJ2f9PN39rV1frIcLSpOmpweCqjeJXbYUmWjmxCk", - "eB4l/v9Bj038YTsTf4V4Hnm0RAAIguhJX1WJbRC1AxkLqPqMflyJEQ8RBgk2suOYfGV67Kqf4rlDDytF", - "hrxBMGF3JhSgK4JQ2nMfOfPd0YkGDyr3UJRxtZLDyhwCj9/xBBEjmDytFOemVIGgmyY+fqb4caPowYdk", - "UJr8+FalB4rS/IyCEMgOLE0HdXmzxpfjIgEWBHKIWjnM5fDleKiiqoEkLmK5lcU7J4vLjCAl8eV4hXRd", - "hYF1DNZGJ1IE5PmrMkvX+mg2P6l1lGFxV1uG3iGGNnKeJUdXalRej6O3jSsrXiJs326uNu8u0CGmmc9A", - "1q3K7Ux7qbILlypyb8qXKiv6JzTV0ypZNyuU5kyfGUNpSzfuiR+vu6sV3LZQZ3FJ+dBKhJ0rsKiKiLUU", - "VbSSE7U5NfoYw0XMk8PQthY1X/ctmUYrQaoC2HxEw/u5CGFEEOzeAeGVL/HqGGVbDJ1A0rHi7T1NUmLL", - "w7R5y8K7mA0gSUO+VTWPL/wwTmk8BLvc1S33ZScslTYXQIV8oRv+GgIlW1OlL4A1sywK/xniMRu2FS2v", - "Zx00y3Jl8DTw4doDxS4fKMQubURq8Lv43lOUPFQ9GMvCOo2BEm2MRBaizlDxnSKVIKSq1gZBhgyjZx0d", - "sR2tE3/XbuUU8l8+VQgfxMRCb/72Lcc/DBtbKpGjmdlrlOhDbG3Lubt3/aYy3jLOeiaVq93zREMy4V0d", - "e5vphjevLDNMtJWoVj5qiidA+bfTDMfLXlIJRLPjZfMMkWpNHk2iSKWQTpsuUkkXqeAF1biJclWPXi95", - "pA5u6yJzigcpRzDt8XQnk0rm96j8yLD6gNpE4PxU/1l3O57jhFoNzMl0ny/LC6yvB03F4B6bCXy7ln2v", - "3F6em18L5/3S9S+Fu3maWp6fD+kVR62Lml2EMIZWgT6o4eshHb1l7tdn7iw3wrVSGoLBuIo3O48jut2t", - "Q3tLDu3vKu5Dm6wE2SY1NRnWJ3HQHMRwQ3bEmI7dypu9MSbYhrUWxS9kUciIeIvS2bmq2UEgb92Qxtao", - "Yn36HItdkA9Euv1WBqwdwAuAsDM8p0kr59AJgNhBU/ITgPDQM2Y/eXeiy36yhci9JmU2VMnTxtbs6I39", - "ErLE/jrfThYiq5sJ2tLOonmT6Zg8eA/SAHdOj7o5UbGNxExy7g/LTM7KvzvTZ4dOoJ+UfzK/Et+G2dVe", - "9qzf3lpnojc5pmXZTgc4U4Ddeemyp8pievP1OtV7EoYM22BgHqNevip500U8g/b2qCbpEiObbdzcoEM3", - "icJ6i4S0cv6MphlQOPFns9rwibMkCt+0mbI3WSPlxvoemXYGsTSJD2qSA5sObhs465KZm4J3WWdKaaek", - "FN9kOtKh+VT7mfe4IhPn9Nm559k+15YQVJUiyD4p6PR5c3lBFaNgy5lBc8hYwUJv1a7GSi/puQ2Z60Tp", - "Hv4k/+mJX+1KXZQVsfXFByGcPS98IVdvAiuH0e2XvrCsUaHdxDbraLFmhB5Nze4q8gRx+9Ktukxckbn2", - "OTxphzlrQ6qzVZv74NhvpKzXIB/s9DelAVsvvnq1UB+b0J6Sd/mULMr+2x4Kafstno938fAeg4QgzXBf", - "XQCLNf6uejC3BJ/mtbkWNn4zvFm4+tpHGQ7CAKcIWpVuEm2XOdKOaV9+uLQB7sEPPSuoaMPGIH3xQ68e", - "mr33oGB/AR1wTwAtRUw+ASQeMKpL6JwcnRz3jsj/JkdHp/R//2P0UNHufTKBnng9gGGPQNGxrURIIJ7C", - "+yiBmwT5I51hnTBXYPneD300Xx5m0X+reF4X0GvF9OY8gmX325v1BxZtx/ZYs5EYyc04AmlYpE0qYOBw", - "0Iiiy7O/mhvYMvp5n4tZtmZ4a4Zv3wxvbcvWtnyVdw9oxeKvVAC1Scrr9fsGCrFmep6A6qUBUY81XkPZ", - "chn/4Vh0br2Iu+xF3Ny5SBLAXoVLtMZUa0ztjTGVLSMT1WvxzVpV1ZcMLr20Wy5LX5YwrddhvVaJwQLY", - "rF1y+FP+2SvlcamNStKD3NBm2fPYJA0OjHmLtaje2XAl/e628UrFeCUDnpoFJBhooyZyaS0MuNe1iPaK", - "+zapjltVvO9xTZuVI3aGgUzV8JK9EKqsVgqcED6Z3wnZPxOasA77k1y5/sVKdW6GStC2WkdVsw1N6p4Y", - "N3+ryS2bBXmqOaHN8LdicfvFHXcuoSYXdFVUvpknmooszvmR9fJYWARcItvbgyVTYpSGrRTephQWO6Bs", - "QBP5a7QbtliIqrk5qkrgN3nSbMWvlfjlBkmdTbx2kcuytPfcKA1xTYgObSNyXonyAuAR+AGYBpBKX0Xc", - "6E/jnyFmWeDRGZ1x70VvXWqyPU9NmNusJY/ejFQY+bTecMMdfQ5JyyUszLN/imCCDt00SWA1ZyN2OmAN", - "HdKtxL03CCafIT7jg22Q7shMDemMQtwWunn9QjfQTRMfP1Mx7kbRgw/7KZFd/74loqrwuC1PboLc6fZr", - "yHjm43k6PXRBEEyB+2Ak57NoEQcQQ0bTV2R+R6uPyESszMdnOvQVweWZGL5A4O+OTmruE1w+r1eedw6B", - "x2vaBRHbDG0NRSnWXwrIzOFOLDA/hyX6EAaJWRSMydflEEe7NscahWfzOKPQNURYFM0CuBl6o0P/4vTG", - "0LdmessQ98vRmx8++hjaFL4U1jDrQI1uK/VNRpjQvkM+1wa1uDqRVfxE4COxMfkFtvaitVqluV8L2Mso", - "b6I5IeZo7xC4Loyx2fPWp9+R9LDxSUrUpm4+69PZjD+JDc4mqi/MWEF9bOU6+mujACR5MWyX9t6evhJI", - "syhWVGwj35vRF+vT2VT9MzL4GuiLrbylr5rq9ARJS9BXEM380ExWF9EMOX7oAKobDyoMjAs60GZoiapg", - "Mv6WKshanaODaDaDnuOH7fF5p47PebVOqMb2nBxEsyjFNcwQpdiOG6L09X09nEajHaun1BJpjTFKqceW", - "bBdwMYUJmvtxgyOQ0snuGMRUyNesG39GtFEC10/a/Dykoqg9Ey1zJlIxWE+SMUDoKUoqIhGYmOSS1BHt", - "q0TqtRhzczbG2RyEMznRLhkbLoXMk4hqxfkeiXNGVnlKt2CiBM6IIEuqDn2sBaq0SGSczqbYRoCxSwwj", - "kNdec+2FnS5IyNbmQQFwHzZywzAmI+/wBUONqGl44/AIE8RBqCzdy9uJ+BUEk0eNjTgM76PPEH/jg661", - "cIkCaZbR4fjg6OBIlzNCCRv5t+x6a1GTZFKx2EKoXAU5f4dOAnGahDnkFexsIqXSMPTDWTbFj54YshfF", - "7IlqNpvYtCc4nUfRQ49HER3+5D9YvMcjmoK3LkcZsd/tn9rxgcxRPHKiLQfxWL5dE/C1euH19ULxvZxK", - "psbQHd7i1oo5DjmebQ7Joqko+lfNMdzuQbaJNXaWb9YT/MagZ7FvHDUEMyM+oUnqyryhHDtyu1r23CH2", - "pD6B0hY15VHJm/SPF4s63hprg1GY5cNUHiFYFXCq0fH7E27aOPCPr7j1hpUiSkuvdYjRXB1ASs1qQoXY", - "nVf4uioJmbXaG1regCuBIiCnN0y6gmMgFSjb3iMWS15jkLWcpuc0zhCrMFtBmxRfZlhlJpHh41apEBqc", - "i3byeUOTrB4SwPZ11fZfV+mOQwrFLPm4oVtnYdlzQgOT6y288lnyZU/LW6/NW+oTolUYy8bss+euZnbg", - "TjDY5upqM2TYPnRmVleey7ZtHFpJhKJ52MoDo4G4GnPWmIlW6fXJJuXz6EvGe5Q3HUZN2SCd/i7wsyal", - "JUtIuYZ6Q8tXG9IDNkuiNKZ5QjMQxEYZQaGdvsDnTm0Ohw0LiRVzd4tLpTZ99w5aE0vlC28kuEReGWNs", - "iEiJ0DTTy1IJXnZSck007HLgDO+pdxulhDqg16VcFQAMEZY85SPnHmJ3Dj1TNulM8O+4IcXJYMmsMa+W", - "K0aBt1GSmDY1TJsaZgOpYRqJZi4bkMWtVk6TW4llHluzRy6YX0Eub1jKiYCp1UzBVt7tlAmYkeKyJmAx", - "8G8KQQITGfjX1YYC0kgyJg/SJOicdjovty//LwAA//+yZDXAbJwCAA==", + "bIwc2lr4Cxa0FzrQJmgEIQiese+iqxhfpbhi1MwBMQfIiWIMPYcfMuUg+jk2nufNlCVi5TQTL91O6nPn", + "u93b6JuhaJ69kbLrKfvVZqKja8pG18lLbQaY7aZ+2dDrPnMGGO2ad0BZ6PdClylnFvUYwXdG9PrjJb8q", + "P5yNISb/QdsTECztxOBH7JNdpo9dKDDV47NebBrkPNFkkfTdjgMS6IA4TiLgzv1wxrJGUgRXzS8y2DAi", + "oSF8S0LBlizSc5bhoTF/lbhQPEOfgB+kCbQAhYaTqICoFwqIvpDWzxkAxJZqvuzJooNByHeWXvgUU3JV", + "xwGCH4LIPlGfSeg+GwN+nXvRxAFYBLFyqlqvn98sCbQAm+XCUEbnbSYZ1IvMEFp5USXyw/Lc4NvMmbpc", + "xqm66wrOUKbLFvHZjDXWouq6hY6QS9xo1Nc1ikOkysr2Sk0AUkM7O6NKOCk30yBsT8vwvxpB2eeaIaxX", + "1/oGwYT1uE6nge9WkQIdryJpmgrzzmw6379lNn3E90mccK6+X9JTWv/86/Cy0+18HXz9OBhVHEeq3xJR", + "/zoyR2jpvC8lnNNHUXWYyMGhOCiq5m4yXjHCVCJAUL6KRXluZ3/ckVNxp9sZfGPnRPV8S87P/fEX/ufZ", + "6OpSCa6rwHvO3tGZfCBZVLzMod8d+phBL5zZGyIcOU8gobkuSoYQ661/6dLs0ZL+vdJ6niCxsc1L1MO/", + "Wh4FSQ/1rCupx+4BUt2GNX93tIAYJuL1kdChbCznb/4BPHCOHQ88d51j5wnCB/LfRRTi+d+XDBuQ6NG+", + "RjKLXIGo6yjwXU0uI2abVx1XZdp91lRjMDQQuXn2q4tu58CZV8c9TrbC1CiMMheDIo2+HXW6nW/HFcKk", + "aScW5raFqGtjIP8NLVvwFpPZqiuveXW0ljyyRlNIBcS8/3vsm2zdG6/r3tig22EjFQQauJ5fxXNs4ODv", + "NNbC/MYKXYMU6R7wqyzGAjYcHzkxbe2A0HNcEIYRdgCtf0ILq4nkc8XN1kKHdGfSWp8M8LwEIqT6ZnLW", + "pDjsl1005MMfAM11GmIO0Fwd8j9QYTquM5hBxuqSjVmJL+dsDrBxwm8w8e/9OvRSDxORX4+8Oa+Nl4NB", + "z0VzgMwV+LRzAFlyz0EQb/HexvNRHIDnHBOJ/WvszMlj99ZAYPkSheY06PDJjETK9/Apw5qwLPWwL2Eq", + "yBKILzTUrQoQCUQl/laDoZQmSRZoVPFkQvlFNPPD5RPwL8ffK+Xj3zmMizXGdbgewZmPcIV030V022lX", + "g2DYwd0SRcJsN001ydHcj9G+OhpLjtctavNNaBk2mW7bvh2z+mITgB4qimFhmIQg4IkDjIdQ3swZnqMu", + "t2RdEDoJvOe2vc90NkAPTpTknx+pndXT61pzKXQ7rPhOHdF8Oyb4+MTaam28b8fstShrU1VGTKkppaEV", + "+V3qXg6hVj48BxEwigf60TiMEutdV6pI66Vj4x04N8RGJpOgdIrYxT3ZZI+KFd4KkZMMfARByt7w2L3d", + "rXifRnd+JUowZG1g8dUUIV11s/Sscg5mZ8pbnuLbNc0rn3oikzn9y7TqgZltYhgNsG2dh72p88A3a6VK", + "D9p5bzNK2AFVLGhSG1tqxsEvkv2/zdFf8SwgkTkL/xKZDLPZ5Z4oL0o4aX+S6nxpvVul7dYsp4wKXBG4", + "Qo9ToVuGbT8U+zoEbMUWNLAb6sZep1FRne7CZGpkZKGS9E6Ia2EA22Ss+HZsTCcNMIaL2BDnxz8q0qSY", + "TVrz9Gwr+akDkey5GknFxMyvl9a6+KxM91IbJ88OfZFig+nmebIL6FghU3Y20i5wQmVO62/HLCNde4Zu", + "eoYmLUznlOZCg+BELzDoi9GvFY/jqDU/eY6h3aoGsvmSj/Gsn4ZWmnQQJz5E9csnX86Z88iYJIq0sTpt", + "sudvCINF3OzVnXgW3SyHB2vCgFOnVvcsw/VtNZnthCzJiN4gTfIUtvkXdg2f1Imxck/pis/n9G/vik/q", + "xoPLyd1EXYxcwx1TDaX3f2ejQX9SyOj3ZXh9bXhfl5NCls4Q+7dAyA9ZvFyT5FOwKbFkiRGK86chZl7o", + "prny8iDUc3xVjBhDgpnzriM/xCw2rLwDnOC0AjR7gKgPt/UXcMlUlLyR5oWj1TI0IW4st0bTnVVRY2ll", + "UyMjDU34dCtzClgk48iTXOn1Ps8ubX7UXICwKUaypWnIPQebIhelJMger55dfb2+GExKb1YrnuLm/bHL", + "JbZTjrZ5bZxNs6oDllp+SRpqDwBrtZpUj7YuPplZrKIVHQjZBqPWOr9rznjSEMhw8gSQw3vZH/K8vFlk", + "d+mm2QJlxDTL0awZjn8tDtV1/NBZ+EHgI+hGoYfsDFmNZ4u0EGfM4izO32SgNMAQYfLb3+uT7luhnwwv", + "utnjX8bPluegnypQzqme3+GKH2MYgtg/uIzCyzQIwDSA/xjTpwmyVc9fxFFCJ+UXv+XGMSCnoc7Mx/N0", + "euBGi0Neab/nwUfx9yGI/cPH40MEk0eYHEaA6ugfvZCP1Tm9BwGCKwYdpYtxDJ5C6J1VsqPijWXNy4xZ", + "laGmPCD71pCC9mhPNnDOsshfqmGaDeUwLdqOWaIsQ/7Ssu5a1W9AzjHS7WFyxEuXxQZmt/BAVx6ahyGC", + "SXMt5PNu9lvazGGeL4q0zaIUdSQnru+EbyTvqa89ZzTJ1r0EZanOMps0vdqU1+WZeFyzZqJVMpaq3lbV", + "Sukyl4jIpq/RD1KuK+VgCryoulTydJ5Plcq8K7krDP0W3BYN6M26Wszm6Dqt0KWqarIxJ/6CX8pu0K3p", + "wRjPTfW+YzzPKW9R5gtgmNyDINAPuTXDb+UktpPltAvrvC4lw26rGyKLqAjW0R5db81a0bis13A2ay2S", + "X8gisUhwX2MDrJRRnAnfgoo9zynqZZTubUGFvKYeJdREEzM1Uqdc9a1Nm27tzW6+xo0mxJZ/NZGSPhuw", + "as9WPwwQrevjuQvlUrLXxZkFrk1TvlHfY3OPnVCGrdeu9dr9Wl67t+xYM5nnK6r73TZX98ZaauiJqXF9", + "aOwq7g1ZybbyvZxhlTkk8o6QnF9C+jwM2vAcYpHGoXB1W18hIq9WCZXMQb07TI1lJ+0/RYkGHnEseRRl", + "IGpsMhr2kiWBKfi0Vo9BYeCgdT1jKQd6d3ILFrgU05b3La/r83vn1UQ1bSBFozplFbCvZbirpk8Dy92A", + "8XVZ8TnHsBoW2v/ME4lp7+R5pTCW6WGtef7s3uryilc8S4Q+I4ap5q7omyZBozwA/NUtGVeHyxxK2CNE", + "8+v/dS0SQTeBBs3LvslXXvyJMVEBzvDeCSPsxEn06HvQ6zrASUDoRQvRiZa2m0JnBkOYiDOAqspONobx", + "5mj2dpMAl9ubbZOyhLMW2URwmgt6bzVYMy9+rCK0cl2MjMlPvHfAsG/05QIIvSzVYMKGWu68bFf9Vwd6", + "Vv+XmWNnkWeg2j8mk2uHNXLcyJMUnHDk2z8wuANKqdfcxLeWCK8mIY7KGj0qaF60ts6zp6WApWmnXPf1", + "82DS6Xaur8b0PzcTaoWYNCSLS0NVQWuIvYniiZBcEDoxTAhdHTTKiw8egU9PgqK4XM1rxPK08Ad0Uwwd", + "Nwp52sjg2XDx5aOYHksT3cGEUF1WihAg5M9C6DlZJ+q2ubkZnjucfbZ/HAvAFAaoOmcmbUNZKuciZGrA", + "jhSZQCXj6LYsAAj/AUGCpxBYFKPlW0VToCICIHDmonf+SHtydHLSOz7pHb+bHH84Pfrt9P3vB7///vu7", + "D7/3jj6cHh3Zv8ECjJmJeTBAGEwD6qnaQUgX4IeZ8Hl59PUxwObtDrO9kUAXysSfyPTQjLSRdZHzx9UG", + "BDzKz6UrhZiGZEuG4X1kxw0jpQOtpRKZNAESpa5ZGWbGiEsupFA2W/eWQDqedPFZVK2W9kaohP7ZZPht", + "QF/XyT+v+zdjQ6SzTSwPQ5aM42GayfjglutKJlELQNb7mljvmzrr82Z0oRm+qTFK22sNCUVYlvRoZXIL", + "8ZSSdF33m/GK3Mosp3LN5NUJJCrw8PpPpYxmtwRylGf+QmJlEM5SfuNiLRbG518QUzyss5LtsvyIT28Y", + "cYk0+IEToG2AvAfzsKXFUYhU8+/qos8qef1r8gf130/+dT0Yn42G1xO9DyXjZGWY8eDi0x9XY/ZC4mv/", + "ss+eV30ffPzj6uqLcSCRmb7ghlNpUx+OJH+xuO3sNsjdyd75i+yd+pyPf0ZTg2AlX3QAWdHnP6LpWgtE", + "NdHNRsyJTG8a8wjMll+r9N8BrfFvW07FZgX8AqGZnFDuKmRWoCq/pUYvVJVMEVOcCctMl8l9BrHyXVYn", + "K1yvh+KtEHvcPYMYUZy4WVdnRvpKXae4Zg+MlQTGOAEYzmpzDSkQXuT6NbdhMzM1nxm5mADm3Un90V9M", + "XVxNV4vVqi0anuve10sAh+daHIreX/wwd9j+dHN5NhlSMXt+M+p/vCCm1Xn/c6WAJIMI/dmIgunsGvYS", + "3/VKeaVQyi3rc6o/7JwhvLXxySVlki+wKiqSFmDRUazksQf4bAjaEMMTsrQLvBTnHOCgGLr+ve9mkzh/", + "iwFC0HMefcDTz/xdzxVGRDSI6NHXjcFJCjXj192hqaEx8uB8fHR01N14+X8ZZ9JoQayGuj1dZvX/16jK", + "WRQE04jbdi6xucdq0eVtg7BcAXOLyAv1Ul0bflG2iFgAIfQ+PjcYfKL0KsdDNDRJjBEVqySUygZSYyUU", + "sG+rhcmOnPCUqAp7pTBKw6vEg8nH53M/gS4u1IDpj8+Imh6Mzyr1dDbKJx8GOb2vvr7JaDknxRTJWDPJ", + "WESLtLK7ld2t7H4t2W2Y4xcU7RXhZkuIZjraEMOFOYDNcF6p72xMozymz5Wr89SsmMcsexG99ofOaxjQ", + "INOLmWyKT0z4orolRCqj1lFPKcHK9eDynOVVyTKsaJLn5FOtyKwsH/tnX64+farVknTapc7NeYFiJsZJ", + "XpwUYzKi8FqR/CVYSYOxO4deGlRkkTN0XlkdfS8+d7IUMDWbjVj+f2OkSu6V1QbZ0fDChU9btwijk4Am", + "KmpCR2KoM9axzgotNC/NnzGENidTVforwXTaj5y5tN8EjzZPqlW12AmY6dAbMJNxdZd/uOY3UtytyyCs", + "oh8uFM4ScpC518sFLUszvrzzDdxYNyENgNbOSOXIHb9yXPe0SL/C5pZBAW8ayQtlTPsyA0v8rNe4Z+aW", + "Hn2ZBXbHbyGao5nVpltDVbr6m60qMBRrtsiyuSsMmw1Rbz1o2oF7kAb4uvKxJG9kfDRpdUmQXd290oVc", + "lHgsqs4CVMRNg4m/gJEhuSvCvvvwbAryIN8cxK8+7G77FJ5uwFqoUI7RnNPEBgi1Yrmt/7/yTGY+KwmY", + "xc7kBrqtZwe6r+u8QGlCIG8K4SzqILs5yWP8PoE0EurMnK5yAX7UtHhqZhGbclayEPqUCCli3S8YhFMI", + "Epj0U5ZghWKUyl76c7Ypc4xjejaIogcfiuY+2VX2k7hgPu3wh5RZXxD7XyCPZ/F5CIsmrpp1c/rXQ5oA", + "GVNPUP5XSVmd44OjgyNKmOxtaOe08+7g+OCIP/OkS6NPOQP/EfJL6/K8n8WlNGkVQoQc6YUguwhEJszO", + "Bf/+ma5LhHrTWU6OjsoD/wFBgOdUKn/Qfb+MsJwztzOd03/fdjtIJOckEGYNRdTDv/n47hy6D51b0p+u", + "NYHAe65fLGnmV612JBqsc7kUOFrxl1WbxQm4v/fd2tVLaGuX/3h8CHg54h6tBNej15Lo8Cf9Wf3thcEY", + "QKyxxc/p78gBsm4HrXrN6t3R7iWMFSqcsxEoLSaAFvAnYFeEjJRmcHjyq84pe7Ysuau0lI7K/czbzOTi", + "ykfXl9vS3r8vY2ucui5E6D4NgmeHodTLFT0pIe+l23nPqMSNQsyz4oM4DnyXYvTwT8S0R7aOGm01SJIo", + "4TUNixERCxAQLEDPiRJnCjzx0IGB8W7tYOig+BQlU9/zILNlM/pmdFJFZoLieVGv227nR08WCKeOMfah", + "qyGMW3qIwq4mdRYz3lchcTbCr0HilB4+Rkx2roUY1NL7BcTJlzJlMqnEFo6cVOA8j40XvYhey0K0S9DB", + "nhMDDNBWDFiKAUYtmxMDqoKM/R6OHmBItKL4m2rDOEIao2EEH6MH6ICQWGAObc1jf+SMBTER+xPSSrgH", + "SHcbKSGHN8gEAetOqbuELo/TOYXu1yZq1ISqOemQjZ3wnRNknP1WRclyy3MU7AZR6h2qR1mztVtK7CSO", + "E3QQxw8RBqELS0R8Rj6LYAWzEbx53FJAnDSUjw53hsBqrHaGYPX2l2/9V+W+5kdPDNGLYhY6wTWast/M", + "uXr4k/73pWq/iZSS5UrzG0p9rGwjayURHcJonNCvWxVC69tsngmlRnmzxJqPXKwxbNAda2VbjsQVzGTk", + "zVBcIdUY/dyaKfywTqzRbZFSrYbmz6UAe+t0f05JuKX93aL9BVxahxu19/YUN8+h1ISmpErcE0W+DhVO", + "xjikDm22S8i44xc+IgegwMm1Nm0waT3MN9zYbpO5+I4rUzbcfJFzI7e6XSIEufV0IwqbUN7/3CZHoY8j", + "Is0PfzKOfzmMk2gKzYdLcUvngOwiGEcO9etSfOXfg5sZXk59HSE8SsNrOq+9b8qk9KTk2rLWqyAonjuB", + "0RPF78FWtcJlhB2Q4nmU+P9HoIhEFhWW5YG9+Su5OTErI8/89g7dHucTl+fDbFv1iiNHZigA7sPhT/of", + "Cy++MyYNxdP6EuXQrzwdjb3TPjemkXgoiDvpnc/jZJdMm+PtgHETZiTMJv6wnYlZliOaLA4EQfREptfd", + "CBSpVohe+nuVicWILs8xITr8iUJkxS2XY1Xql/klRA3YJD+YmVG45t45Nikgo2WUHWSUEsFKVrkcVzJK", + "iDRsIgwXxdukN13IvOJIXGKRxndjr2Z/dM2OgAf4vKwnQIHh5MOHHBDH67CB4iQi/4Beq8N2iDVNh0ia", + "bt0BcSyovazWWJsCP2IwDeChB2boUGZqNh4aET010nYOngPsTGEQhTP1jbpMHAxm5SPlt+NzQGuQTHhd", + "rXp3mai5kqX7YEl+Kcv8lcLkOeMZD8zufK9azW3qvYGV3CnA+1oHH2vqXVthtHMwkwXltBmYKuQQmVLc", + "/tFZ37aXsNv5sC3hR06h/iIO4AKGuGQbUOeFrAYrrs4BetBKGNrw8Cf5T831EktMP31mfFMUIGQCS1c7", + "K1RnUvoE0C2r/HxFPoNQEDX9VFhKL2s26ccvpOBv5HqjWH3r/PmenX02P+tELcpGLIX7KGUpf3ZERGT8", + "XBIR5jMDthEhh0E0q7NVgmjmBH4IRR4dDkdRolxEsws/ZBUWdlyqbJbtVUQ0UMr8XVZ7d5fXjJL6FNK/", + "iGarUz75/172GM58w6PUdjESvyzdsg/k361ImYUjBz34sUGpRvf3COZ1qvrE5rf32uxZ1dPR1HLO9Nkw", + "Jf3ccMbNq/Vsr5e4pG9N71a152ScTsKsruZpC8VNaCHrmGMiD44sjlaUec3k3S76Dn8lmdctp9cUToYH", + "+IzIrCzDoXla0q6jdfLUxivRJ3Mlh8Rm5bC9DG6trDorC4q6b5bhUVYCh9GbjcThLWtFzifarpU5uypz", + "JrksCZ6V1MmeLhuET+UUDkAocn36gOfJx3MW2MHmXEd1eAv3NHKjGNKlonSKIHZcEHo+fSQj6Nq4eNbX", + "dt20deWKnRsEPcpGDBbshzMNPIBwPAhSdtVtrDa/TWmusHYDcS5ETCvP8/Jc4CUT6Ay/VRK9a7g9ZnX2", + "HOCE8IkPbBTNrO3eBLOt/y3lt2OGAoaOmueTrCw3jhRSZmXkeOXOrT2cFNtXy3o8AyvLjZ9EofNnNFXC", + "IVmIZHu83dbx9jI70eZkgGRZya72YsDesDv8+XjcY3/bhGuBOuHROBHBbll2nIF9GmfqibVowJNY21sX", + "dyst9l9a2EqErkKvxEiouHGWpr7jY6S/d2az2d487zSbv3HmnkVYsVtaC7x4XdtY9eYZzUIN0xusRZZk", + "tYIzOXAi5MhJ0tDhPaszJLDrDnKmYLl8RU7XfeVemkadFyWNnBl7MybQYDqk++zBhwWgFfnYDeGrspy0", + "LTRpiP2gs57ZVUcKddWEnqyYU+Ou4RGCrxMRyLKtUlL+D6QGNxqA5tlZSfs70fqOtt4osWXBlixKmcZ6", + "yozxWaSPIayRNfTD2R3LPbsZyDd/WTpKQyE2modBqaKqDVncnXgkujcLqQ3srivt1Voc+SG2VG4LP0wx", + "JGan+CuB4MGLnkKp7xrous8QX5PJ913TUa0C7jFPXixvwfmhrFhw+7h3RP43OTo6pf/7H4NUEjV47plx", + "sw4tRCGdwvsogQVQIwLfCsCKEjkf6eDNwd28bMyR2hLSkfJJKx93VD7md2ftUhIdurROhPnlF6sjIcPL", + "dfKONXnbLnuKAmqq1OQ7ZE92IscVSLPy0Ve5yOhAQfswo40O0wiSAvuuXXwkMA7Ac1VCRfK9UnywJm9a", + "fDAUNBEfiUDaquKDDdRKj1Z6aKRHgXvXKD2EE6iXpGFdfFeuCnlthFexFGob5rXToaUs5xG0CvQSbZuH", + "mPKndIZicgbHKkgCHyKa9w1agbdBL28AcBNQ1uXi7csir1liuofeoxMDP7HasqxK7J2SWk2ze0t5ccuR", + "gnvifn6iZVSk07w+vhEmG/Y2yzJVkeOHbpB69H0/Iko5CoNn9Xf55FwnkMLg+U40MDNCueRVjZM+l3/A", + "Amev5K/XZEkwOu5VtfarO/D5I+amwZmtPbprD41ytphiEgqry6FlvtdoGx7yWug9whJ1liJvS4al5SVp", + "LkWz+VhtPZ5nRdjRXluSilBCxUJkDCn86pijj6POrEIVKfQqOV42K6/0JNCKrlZ0NRVdIj6xLiMsj4wv", + "GAQVoqkNkj/mqFOQUuM6U7FLHfACh9sMktfV2W8QApujkDZerhitXmCgNTB4np9/Ph731F/q8iflSA6E", + "Hg1qledoHEmFG4V0e/+341Gi+N+OE4MZrJYBlhGwORjY2WlGe+ojT9Xl7W386RJc1mruPcptZsnQ3RJB", + "L8Hi9llesoyM7Ixhr85lPhDrc8bbeQOciS2tc+/XFGDNEsS0squVXRWyC/sLP5yh2hpLvF1j6fUZ4gmf", + "Ym/tEa0M8mCM5+yynUXNOa5InWpIe0s67FymKbY5rSTZe0lSxZ/rFi8w5jJF/PlyCBJ37j/COiuIt+Jg", + "ku5aETLGMOZX9H0xsIX4EOOZqytweNvr+t3Mfsf3ne95mwBvL4KUJNcVApXKQirH/grzyzIV5KdRWlkJ", + "V7JwvUxqnH3TRh4NRCqrVhq9EWnUJuP8FWWRwvibl0RLpMEWQJWjGBtmwm7F0OvGMAbwEQZW4XCsZW7m", + "yiqcnA5Ir08+DDzjo3RIFK9DZ1PgqHiRTjs0BWTMemnDxwDNQxUlXtX66eePz2wtDSe/Uvsa8MCm9/wE", + "ujwFVgUU50qzZSDJ+m9WSbXp4F85HbxeDfDL/4qnc/RWEvHbfUPI0YT+fKZeRq/7spwNziaqe1/CwgVe", + "53qcQdjoQpwj9dem8SVuwpXk3vzJBr/jLhK5jqJlOAslbYDdeZm2Wc0/Wo7/h49oktBKAt+fGoEbilhh", + "CGjChHFCEIl99jYiFQhs+XGf+JHziTU/aoNRSmFmICCEEc56cAH8oDdLojSuvOAhSkhWjGPkRcdw6AAO", + "H6DIun3SZEBafCYN9iUI9nbjPKFDTMPUC8ZNaHknf+tRQa32zNRtYKKV56pjjDcfjqlamAXc2Om6Esob", + "maDHm2XvJTSghoZavtbaqFpuW6+WPORp7Gs0JNk90cURXarfiyjk4oezMe+zJ7lJt6QmFcSsoCPVPWlZ", + "KZ8nyISmtfFR7Pdw9ABrHuo7/euhw9pVc00/9iekWWtPokMa/3A9pPhAIz5LQz4RcRytr69oPBKKZKhV", + "mEH+uEopizCjdjtib21EigBB64pZuEkXRnHSlr/W/OQmY6aGDFalcNZbZ7CtMthWGayuMlgBkwyzHJ43", + "qkW2BIAidHN4viSISRqunk7HBsJRGrJUOtzx9SpX0nQ/X+dCmk69A9fRKhzqZXQFsWRZfOCz8wiCFOpz", + "+chkuf8m7HZ8Spsed7rkXyfsXydEvFfn/Pm63pQ/2TJYUhXL+oC08XA72X42eVZoy5W+ZrlSOxcyHddg", + "g7RHAIoAiosatzBPmvQqYQiMEpr4fCHr8dajQE/+azuzjjh/cvMU/nAh9KChgh3bm+XKEhsOJofTNHgw", + "h/18TIMHTh4okwmoUiiQPm9YMJDlNxQO6DWlA2ouHtoo8R2TD5RNVSGB1iwl7DLrM0eGkposZ+KapAYL", + "K3nzifcZAuwNCn5gaJY82xrSLGCL/OspOyyTs8cGE4yKH6Lpn9C1sFwo0mCWS6EVUjsrpHgC7o3IJ+pG", + "s/SxMt+chZ/1C3xur/UyZ+NSp3WK7PbErjuxO9z3u04+sCthgZqp5jdf1IIhYFdU83rcarlaGa3CfDMK", + "0w8ffQybBliLXvqgsSH92upKESum4GOpKDGB7TY2TBc+ndHihmKm2QSVtN66v5UoaYYSu+BohttXjYhm", + "4C4TCM0Jo2VLffSz5Jv1hGpyPhc/9Ni/XxgTBxDDMjuf09+RPNjZsDLrs7+FbXN8VQ1bT6Jj33VrLfcy", + "Ctll7s0xEiPCjFxNr7fz+0j1WtWb1macsD/vWveFEzb79HY5vftqj28tOZfBtzecyx/FNubcKs23gIsp", + "Zb5GZzTRS8/iX+nX9owmqFHBx1JnNIHt1hjUndEyWlyPLcjHO/zJ/rAwAh3AgXDuk2hR9+yNUcOvYQry", + "ZZtgY5+3yrvvN8K7y9iAb4NrdyjL3aUhqZ1k0tzGrE1e/JXCFPYWRHC79dnCaWuHt5a3yJUC4zPE/yS9", + "vvIp9lFm7NXLgH0K9t689ZKjveVegDmPMEF+FAq6b2Xia8tEIo7k7iykYCmmQ19WJiYAwx69cLIJlSCt", + "2fVUXazECGB4QRq279J2uQrNOt4wWVRe3txLJUlnO/BaqQjLttJn5nmtQTCOws5tNE7hzKriJhO3BNXO", + "Bft1WYnLe/TiKPDd5/qULaKDwzrYJGwRoQTXtEebruVQh5blXDyF3WhdPVvPeoQC4D5UJ2oZkybOE5zO", + "o+ih7Pykn7+zr63zk+VoUXHS5PRQQPUuscOWKhvdhCDF8yjx/w96bOIP25n4K8TzyKMlAkAQRE/6qkps", + "g6gdyFhA1Wf040qMeIgwSLCRHcfkK9NjV/0Uzx16WCky5A2CCbszoQBdEYTSnvvIme+OTjR4ULmHooyr", + "lRxW5hB4/I4niBjB5GmlODelCgTdNPHxM8WPG0UPPiSD0uTHtyo9UJTmZxSEQHZgaTqoy5s1vhwXCbAg", + "kEPUymEuhy/HQxVVDSRxEcutLN45WVxmBCmJL8crpOsqDKxjsDY6kSIgz1+VWbrWR7P5Sa2jDIu72jL0", + "DjG0kfMsObpSo/J6HL1tXFnxEmH7dnO1eXeBDjHNfAayblVuZ9pLlV24VJF7U75UWdE/oameVsm6WaE0", + "Z/rMGEpbunFP/HjdXa3gtoU6i0vKh1Yi7FyBRVVErKWoopWcqM2p0ccYLmKeHIa2taj5um/JNFoJUhXA", + "5iMa3s9FCCOCYPcOCK98iVfHKNti6ASSjhVv72mSElseps1bFt7FbABJGvKtqnl84YdxSuMh2OWubrkv", + "O2GptLkAKuQL3fDXECjZmip9AayZZVH4zxCP2bCtaHk966BZliuDp4EP1x4odvlAIXZpI1KD38X3nqLk", + "oerBWBbWaQyUaGMkshB1horvFKkEIVW1NggyZBg96+iI7Wid+Lt2K6eQ//KpQvggJhZ687dvOf5h2NhS", + "iRzNzF6jRB9ia1vO3b3rN5XxlnHWM6lc7Z4nGpIJ7+rY20w3vHllmWGirUS18lFTPAHKv51mOF72kkog", + "mh0vm2eIVGvyaBJFKoV02nSRSrpIBS+oxk2Uq3r0eskjdXBbF5lTPEg5gmmPpzuZVDK/R+VHhtUH1CYC", + "56f6z7rb8Rwn1GpgTqb7fFleYH09aCoG99hM4Nu17Hvl9vLc/Fo475eufynczdPU8vx8SK84al3U7CKE", + "MbQK9EENXw/p6C1zvz5zZ7kRrpXSEAzGVbzZeRzR7W4d2ltyaH9XcR/aZCXINqmpybA+iYPmIIYbsiPG", + "dOxW3uyNMcE2rLUofiGLQkbEW5TOzlXNDgJ564Y0tkYV69PnWOyCfCDS7bcyYO0AXgCEneE5TVo5h04A", + "xA6akp8AhIeeMfvJuxNd9pMtRO41KbOhSp42tmZHb+yXkCX21/l2shBZ3UzQlnYWzZtMx+TBe5AGuHN6", + "1M2Jim0kZpJzf1hmclb+3Zk+O3QC/aT8k/mV+DbMrvayZ/321joTvckxLct2OsCZAuzOS5c9VRbTm6/X", + "qd6TMGTYBgPzGPXyVcmbLuIZtLdHNUmXGNls4+YGHbpJFNZbJKSV82c0zYDCiT+b1YZPnCVR+KbNlL3J", + "Gik31vfItDOIpUl8UJMc2HRw28BZl8zcFLzLOlNKOyWl+CbTkQ7Np9rPvMcVmTinz849z/a5toSgqhRB", + "9klBp8+bywuqGAVbzgyaQ8YKFnqrdjVWeknPbchcJ0r38Cf5T0/8alfqoqyIrS8+COHseeELuXoTWDmM", + "br/0hWWNCu0mtllHizUj9GhqdleRJ4jbl27VZeKKzLXP4Uk7zFkbUp2t2twHx34jZb0G+WCnvykN2Hrx", + "1auF+tiE9pS8y6dkUfbf9lBI22/xfLyLh/cYJARphvvqAlis8XfVg7kl+DSvzbWw8ZvhzcLV1z7KcBAG", + "OEXQqnSTaLvMkXZM+/LDpQ1wD37oWUFFGzYG6YsfevXQ7L0HBfsL6IB7AmgpYvIJIPGAUV1C5+To5Lh3", + "RP43OTo6pf/7H6OHinbvkwn0xOsBDHsEio5tJUIC8RTeRwncJMgf6QzrhLkCy/d+6KP58jCL/lvF87qA", + "XiumN+cRLLvf3qw/sGg7tseajcRIbsYRSMMibVIBA4eDRhRdnv3V3MCW0c/7XMyyNcNbM3z7ZnhrW7a2", + "5au8e0ArFn+lAqhNUl6v3zdQiDXT8wRULw2IeqzxGsqWy/gPx6Jz60XcZS/i5s5FkgD2KlyiNaZaY2pv", + "jKlsGZmoXotv1qqqvmRw6aXdcln6soRpvQ7rtUoMFsBm7ZLDn/LPXimPS21Ukh7khjbLnscmaXBgzFus", + "RfXOhivpd7eNVyrGKxnw1CwgwUAbNZFLa2HAva5FtFfct0l13KrifY9r2qwcsTMMZKqGl+yFUGW1UuCE", + "8Mn8Tsj+mdCEddif5Mr1L1aqczNUgrbVOqqabWhS98S4+VtNbtksyFPNCW2GvxWL2y/uuHMJNbmgq6Ly", + "zTzRVGRxzo+sl8fCIuAS2d4eLJkSozRspfA2pbDYAWUDmshfo92wxUJUzc1RVQK/yZNmK36txC83SOps", + "4rWLXJalvedGaYhrQnRoG5HzSpQXAI/AD8A0gFT6KuJGfxr/DDHLAo/O6Ix7L3rrUpPteWrC3GYtefRm", + "pMLIp/WGG+7oc0haLmFhnv1TBBN06KZJAqs5G7HTAWvokG4l7r1BMPkM8RkfbIN0R2ZqSGcU4rbQzesX", + "uoFumvj4mYpxN4oefNhPiez69y0RVYXHbXlyE+ROt19DxjMfz9PpoQuCYArcByM5n0WLOIAYMpq+IvM7", + "Wn1EJmJlPj7Toa8ILs/E8AUCf3d0UnOf4PJ5vfK8cwg8XtMuiNhmaGsoSrH+UkBmDndigfk5LNGHMEjM", + "omBMvi6HONq1OdYoPJvHGYWuIcKiaBbAzdAbHfoXpzeGvjXTW4a4X47e/PDRx9Cm8KWwhlkHanRbqW8y", + "woT2HfK5NqjF1Yms4icCH4mNyS+wtRet1SrN/VrAXkZ5E80JMUd7h8B1YYzNnrc+/Y6kh41PUqI2dfNZ", + "n85m/ElscDZRfWHGCupjK9fRXxsFIMmLYbu09/b0lUCaRbGiYhv53oy+WJ/OpuqfkcHXQF9s5S191VSn", + "J0hagr6CaOaHZrK6iGbI8UMHUN14UGFgXNCBNkNLVAWT8bdUQdbqHB1Esxn0HD9sj887dXzOq3VCNbbn", + "5CCaRSmuYYYoxXbcEKWv7+vhNBrtWD2llkhrjFFKPbZku4CLKUzQ3I8bHIGUTnbHIKZCvmbd+DOijRK4", + "ftLm5yEVRe2ZaJkzkYrBepKMAUJPUVIRicDEJJekjmhfJVKvxZibszHO5iCcyYl2ydhwKWSeRFQrzvdI", + "nDOyylO6BRMlcEYEWVJ16GMtUKVFIuN0NsU2AoxdYhiBvPaaay/sdEFCtjYPCoD7sJEbhjEZeYcvGGpE", + "TcMbh0eYIA5CZele3k7EryCYPGpsxGF4H32G+BsfdK2FSxRIs4wOxwdHB0e6nBFK2Mi/Zddbi5okk4rF", + "FkLlKsj5O3QSiNMkzCGvYGcTKZWGoR/Osil+9MSQvShmT1Sz2cSmPcHpPIoeejyK6PAn/8HiPR7RFLx1", + "OcqI/W7/1I4PZI7ikRNtOYjH8u2agK/VC6+vF4rv5VQyNYbu8Ba3VsxxyPFsc0gWTUXRv2qO4XYPsk2s", + "sbN8s57gNwY9i33jqCGYGfEJTVJX5g3l2JHb1bLnDrEn9QmUtqgpj0repH+8WNTx1lgbjMIsH6byCMGq", + "gFONjt+fcNPGgX98xa03rBRRWnqtQ4zm6gBSalYTKsTuvMLXVUnIrNXe0PIGXAkUATm9YdIVHAOpQNn2", + "HrFY8hqDrOU0PadxhliF2QrapPgywyoziQwft0qF0OBctJPPG5pk9ZAAtq+rtv+6SnccUihmyccN3ToL", + "y54TGphcb+GVz5Ive1reem3eUp8QrcJYNmafPXc1swN3gsE2V1ebIcP2oTOzuvJctm3j0EoiFM3DVh4Y", + "DcTVmLPGTLRKr082KZ9HXzLeo7zpMGrKBun0d4GfNSktWULKNdQbWr7akB6wWRKlMc0TmoEgNsoICu30", + "BT53anM4bFhIrJi7W1wqtem7d9CaWCpfeCPBJfLKGGNDREqEpplelkrwspOSa6JhlwNneE+92ygl1AG9", + "LuWqAGCIsOQpHzn3ELtz6JmySWeCf8cNKU4GS2aNebVcMQq8jZLEtKlh2tQwG0gN00g0c9mALG61cprc", + "Sizz2Jo9csH8CnJ5w1JOBEytZgq28m6nTMCMFJc1AYuBf1MIEpjIwL+uNhSQRpIxeZAmQee003m5ffl/", + "AQAA//9HGAe4G50CAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/v1/server/oas/transformers/tenant.go b/api/v1/server/oas/transformers/tenant.go index 7a4c31daa..dcd331f20 100644 --- a/api/v1/server/oas/transformers/tenant.go +++ b/api/v1/server/oas/transformers/tenant.go @@ -9,12 +9,15 @@ import ( ) func ToTenant(tenant *dbsqlc.Tenant) *gen.Tenant { + uiVersion := gen.TenantUIVersion(tenant.UiVersion) return &gen.Tenant{ Metadata: *toAPIMetadata(sqlchelpers.UUIDToStr(tenant.ID), tenant.CreatedAt.Time, tenant.UpdatedAt.Time), Name: tenant.Name, Slug: tenant.Slug, AnalyticsOptOut: &tenant.AnalyticsOptOut, AlertMemberEmails: &tenant.AlertMemberEmails, + Version: gen.TenantVersion(tenant.Version), + UiVersion: &uiVersion, } } diff --git a/api/v1/server/oas/transformers/user.go b/api/v1/server/oas/transformers/user.go index 8e7e7bca6..2684b5379 100644 --- a/api/v1/server/oas/transformers/user.go +++ b/api/v1/server/oas/transformers/user.go @@ -27,6 +27,7 @@ func ToUser(user *dbsqlc.User, hasPassword bool, hashedEmail *string) *gen.User } func ToTenantMember(tenantMember *dbsqlc.PopulateTenantMembersRow) *gen.TenantMember { + uiVersion := gen.TenantUIVersion(tenantMember.TenantUiVersion) res := &gen.TenantMember{ Metadata: *toAPIMetadata(sqlchelpers.UUIDToStr(tenantMember.ID), tenantMember.CreatedAt.Time, tenantMember.UpdatedAt.Time), User: gen.UserTenantPublic{ @@ -40,6 +41,7 @@ func ToTenantMember(tenantMember *dbsqlc.PopulateTenantMembersRow) *gen.TenantMe AnalyticsOptOut: &tenantMember.AnalyticsOptOut, AlertMemberEmails: &tenantMember.AlertMemberEmails, Version: gen.TenantVersion(tenantMember.TenantVersion), + UiVersion: &uiVersion, }, Role: gen.TenantMemberRole(tenantMember.Role), } diff --git a/cmd/hatchet-migrate/migrate/migrations/20250519145912_v1_0_21.sql b/cmd/hatchet-migrate/migrate/migrations/20250519145912_v1_0_21.sql new file mode 100644 index 000000000..0af4580e7 --- /dev/null +++ b/cmd/hatchet-migrate/migrate/migrations/20250519145912_v1_0_21.sql @@ -0,0 +1,18 @@ +-- +goose Up +-- +goose StatementBegin +CREATE TYPE "TenantMajorUIVersion" AS ENUM ( + 'V0', + 'V1' +); + +ALTER TABLE "Tenant" +ADD COLUMN "uiVersion" "TenantMajorUIVersion" NOT NULL DEFAULT 'V0' +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin +ALTER TABLE "Tenant" +DROP COLUMN "uiVersion"; + +DROP TYPE "TenantMajorUIVersion" +-- +goose StatementEnd diff --git a/frontend/app/src/components/molecules/nav-bar/nav-bar.tsx b/frontend/app/src/components/molecules/nav-bar/nav-bar.tsx index 9b13e5f3f..d99d360de 100644 --- a/frontend/app/src/components/molecules/nav-bar/nav-bar.tsx +++ b/frontend/app/src/components/molecules/nav-bar/nav-bar.tsx @@ -32,7 +32,6 @@ import { VersionInfo } from '@/pages/main/info/components/version-info'; import { useTenant } from '@/lib/atoms'; import { routes } from '@/router'; import { Banner, BannerProps } from './banner'; -import { GrUpgrade } from 'react-icons/gr'; function HelpDropdown() { const meta = useApiMeta(); @@ -115,25 +114,6 @@ function AccountDropdown({ user }: MainNavProps) { onError: handleApiError, }); - useEffect(() => { - // FIXME remove this once we have a proper upgrade path - const upgrade = () => { - localStorage.setItem('next-ui', 'true'); - window.location.href = '/next'; - }; - - // Attach upgrade function to window object - (window as any).upgrade = upgrade; - - return () => { - delete (window as any).upgrade; - }; - }, []); - - const canUpgrade = useMemo(() => { - return localStorage.getItem('next-ui') != undefined; - }, []); - return ( @@ -168,17 +148,6 @@ function AccountDropdown({ user }: MainNavProps) { View Legacy V0 Data )} - {canUpgrade && ( - { - localStorage.setItem('next-ui', 'true'); - window.location.href = '/next'; - }} - > - - Switch to Next UI - - )} toggleTheme()}> Toggle Theme diff --git a/frontend/app/src/lib/api/generated/data-contracts.ts b/frontend/app/src/lib/api/generated/data-contracts.ts index 56d632e0e..7cc302480 100644 --- a/frontend/app/src/lib/api/generated/data-contracts.ts +++ b/frontend/app/src/lib/api/generated/data-contracts.ts @@ -205,6 +205,11 @@ export enum TenantResource { SCHEDULE = "SCHEDULE", } +export enum TenantUIVersion { + V0 = "V0", + V1 = "V1", +} + export enum TenantVersion { V0 = "V0", V1 = "V1", @@ -694,6 +699,8 @@ export interface Tenant { alertMemberEmails?: boolean; /** The version of the tenant. */ version: TenantVersion; + /** The UI of the tenant. */ + uiVersion?: TenantUIVersion; } export interface V1EventWorkflowRunSummary { @@ -1071,6 +1078,8 @@ export interface UpdateTenantRequest { maxAlertingFrequency?: string; /** The version of the tenant. */ version?: TenantVersion; + /** The UI of the tenant. */ + uiVersion?: TenantUIVersion; } export interface TenantAlertingSettings { diff --git a/frontend/app/src/next/hooks/use-tenant.tsx b/frontend/app/src/next/hooks/use-tenant.tsx index 37de303bc..67609aa89 100644 --- a/frontend/app/src/next/hooks/use-tenant.tsx +++ b/frontend/app/src/next/hooks/use-tenant.tsx @@ -34,6 +34,7 @@ interface TenantState { create: UseMutationResult; update: { mutate: (data: UpdateTenantRequest) => void; + mutateAsync: (data: UpdateTenantRequest) => Promise; isPending: boolean; }; } @@ -200,6 +201,8 @@ export function TenantProvider({ children }: TenantProviderProps) { create: createTenantMutation, update: { mutate: (data: UpdateTenantRequest) => updateTenantMutation.mutate(data), + mutateAsync: (data: UpdateTenantRequest) => + updateTenantMutation.mutateAsync(data), isPending: updateTenantMutation.isPending, }, limit: resourcePolicyQuery, diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/migration-guides/hatchet-client.ts b/frontend/app/src/next/lib/docs/generated/snips/go/migration-guides/hatchet-client.ts index 1cb285a66..3ef8aca10 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/migration-guides/hatchet-client.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/migration-guides/hatchet-client.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package migration_guides\n\nimport (\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n)\n\nfunc HatchetClient() (v1.HatchetClient, error) {\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn hatchet, nil\n}\n", + 'package migration_guides\n\nimport (\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n)\n\nfunc HatchetClient() (v1.HatchetClient, error) {\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn hatchet, nil\n}\n', source: 'out/go/migration-guides/hatchet-client.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/migration-guides/mergent.ts b/frontend/app/src/next/lib/docs/generated/snips/go/migration-guides/mergent.ts index 8ffbf974b..7c0081847 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/migration-guides/mergent.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/migration-guides/mergent.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package migration_guides\n\nimport (\n\t'bytes'\n\t'context'\n\t'encoding/json'\n\t'fmt'\n\t'net/http'\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\tv1worker 'github.com/hatchet-dev/hatchet/pkg/v1/worker'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\n// ProcessImage simulates image processing\nfunc ProcessImage(imageURL string, filters []string) (map[string]interface{}, error) {\n\t// Do some image processing\n\treturn map[string]interface{}{\n\t\t'url': imageURL,\n\t\t'size': 100,\n\t\t'format': 'png',\n\t}, nil\n}\n\n// > Before (Mergent)\ntype MergentRequest struct {\n\tImageURL string `json:'image_url'`\n\tFilters []string `json:'filters'`\n}\n\ntype MergentResponse struct {\n\tSuccess bool `json:'success'`\n\tProcessedURL string `json:'processed_url'`\n}\n\nfunc ProcessImageMergent(req MergentRequest) (*MergentResponse, error) {\n\tresult, err := ProcessImage(req.ImageURL, req.Filters)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &MergentResponse{\n\t\tSuccess: true,\n\t\tProcessedURL: result['url'].(string),\n\t}, nil\n}\n\n\n// > After (Hatchet)\ntype ImageProcessInput struct {\n\tImageURL string `json:'image_url'`\n\tFilters []string `json:'filters'`\n}\n\ntype ImageProcessOutput struct {\n\tProcessedURL string `json:'processed_url'`\n\tMetadata struct {\n\t\tSize int `json:'size'`\n\t\tFormat string `json:'format'`\n\t\tAppliedFilters []string `json:'applied_filters'`\n\t} `json:'metadata'`\n}\n\nfunc ImageProcessor(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[ImageProcessInput, ImageProcessOutput] {\n\tprocessor := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'image-processor',\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input ImageProcessInput) (*ImageProcessOutput, error) {\n\t\t\tresult, err := ProcessImage(input.ImageURL, input.Filters)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf('processing image: %w', err)\n\t\t\t}\n\n\t\t\tif result['url'] == '' {\n\t\t\t\treturn nil, fmt.Errorf('processing failed to generate URL')\n\t\t\t}\n\n\t\t\toutput := &ImageProcessOutput{\n\t\t\t\tProcessedURL: result['url'].(string),\n\t\t\t\tMetadata: struct {\n\t\t\t\t\tSize int `json:'size'`\n\t\t\t\t\tFormat string `json:'format'`\n\t\t\t\t\tAppliedFilters []string `json:'applied_filters'`\n\t\t\t\t}{\n\t\t\t\t\tSize: result['size'].(int),\n\t\t\t\t\tFormat: result['format'].(string),\n\t\t\t\t\tAppliedFilters: input.Filters,\n\t\t\t\t},\n\t\t\t}\n\n\t\t\treturn output, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\t// Example of running a task\n\t_ = func() error {\n\t\t// > Running a task\n\t\tresult, err := processor.Run(context.Background(), ImageProcessInput{\n\t\t\tImageURL: 'https://example.com/image.png',\n\t\t\tFilters: []string{'blur'},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Printf('Result: %+v\\n', result)\n\t\treturn nil\n\t}\n\n\t// Example of registering a task on a worker\n\t_ = func() error {\n\t\t// > Declaring a Worker\n\t\tw, err := hatchet.Worker(v1worker.WorkerOpts{\n\t\t\tName: 'image-processor-worker',\n\t\t\tWorkflows: []workflow.WorkflowBase{\n\t\t\t\tprocessor,\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = w.StartBlocking(context.Background())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\treturn processor\n}\n\nfunc RunMergentTask() error {\n\n\treturn nil\n}\n\nfunc RunningTasks(hatchet v1.HatchetClient) error {\n\t// > Running a task (Mergent)\n\ttask := struct {\n\t\tRequest struct {\n\t\t\tURL string `json:'url'`\n\t\t\tBody string `json:'body'`\n\t\t\tHeaders map[string]string `json:'headers'`\n\t\t} `json:'request'`\n\t\tName string `json:'name'`\n\t\tQueue string `json:'queue'`\n\t}{\n\t\tRequest: struct {\n\t\t\tURL string `json:'url'`\n\t\t\tBody string `json:'body'`\n\t\t\tHeaders map[string]string `json:'headers'`\n\t\t}{\n\t\t\tURL: 'https://example.com',\n\t\t\tHeaders: map[string]string{\n\t\t\t\t'Authorization': 'fake-secret-token',\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t},\n\t\t\tBody: 'Hello, world!',\n\t\t},\n\t\tName: '4cf95241-fa19-47ef-8a67-71e483747649',\n\t\tQueue: 'default',\n\t}\n\n\ttaskJSON, err := json.Marshal(task)\n\tif err != nil {\n\t\treturn fmt.Errorf('marshaling task: %w', err)\n\t}\n\n\treq, err := http.NewRequest(http.MethodPost, 'https://api.mergent.co/v2/tasks', bytes.NewBuffer(taskJSON))\n\tif err != nil {\n\t\treturn fmt.Errorf('creating request: %w', err)\n\t}\n\n\treq.Header.Add('Authorization', 'Bearer ')\n\treq.Header.Add('Content-Type', 'application/json')\n\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf('sending request: %w', err)\n\t}\n\tdefer res.Body.Close()\n\n\tfmt.Printf('Mergent task created with status: %d\\n', res.StatusCode)\n\n\t// > Running a task (Hatchet)\n\tprocessor := ImageProcessor(hatchet)\n\n\tresult, err := processor.Run(context.Background(), ImageProcessInput{\n\t\tImageURL: 'https://example.com/image.png',\n\t\tFilters: []string{'blur'},\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf('Result: %+v\\n', result)\n\n\t// > Scheduling tasks (Hatchet)\n\t// Schedule the task to run at a specific time\n\tscheduleRef, err := processor.Schedule(\n\t\tcontext.Background(),\n\t\ttime.Now().Add(time.Second*10),\n\t\tImageProcessInput{\n\t\t\tImageURL: 'https://example.com/image.png',\n\t\t\tFilters: []string{'blur'},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// or schedule to run every hour\n\tcronRef, err := processor.Cron(\n\t\tcontext.Background(),\n\t\t'run-hourly',\n\t\t'0 * * * *',\n\t\tImageProcessInput{\n\t\t\tImageURL: 'https://example.com/image.png',\n\t\t\tFilters: []string{'blur'},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Printf('Scheduled tasks with refs: %+v, %+v\\n', scheduleRef, cronRef)\n\treturn nil\n}\n", + 'package migration_guides\n\nimport (\n\t"bytes"\n\t"context"\n\t"encoding/json"\n\t"fmt"\n\t"net/http"\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\tv1worker "github.com/hatchet-dev/hatchet/pkg/v1/worker"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\n// ProcessImage simulates image processing\nfunc ProcessImage(imageURL string, filters []string) (map[string]interface{}, error) {\n\t// Do some image processing\n\treturn map[string]interface{}{\n\t\t"url": imageURL,\n\t\t"size": 100,\n\t\t"format": "png",\n\t}, nil\n}\n\n// > Before (Mergent)\ntype MergentRequest struct {\n\tImageURL string `json:"image_url"`\n\tFilters []string `json:"filters"`\n}\n\ntype MergentResponse struct {\n\tSuccess bool `json:"success"`\n\tProcessedURL string `json:"processed_url"`\n}\n\nfunc ProcessImageMergent(req MergentRequest) (*MergentResponse, error) {\n\tresult, err := ProcessImage(req.ImageURL, req.Filters)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &MergentResponse{\n\t\tSuccess: true,\n\t\tProcessedURL: result["url"].(string),\n\t}, nil\n}\n\n\n// > After (Hatchet)\ntype ImageProcessInput struct {\n\tImageURL string `json:"image_url"`\n\tFilters []string `json:"filters"`\n}\n\ntype ImageProcessOutput struct {\n\tProcessedURL string `json:"processed_url"`\n\tMetadata struct {\n\t\tSize int `json:"size"`\n\t\tFormat string `json:"format"`\n\t\tAppliedFilters []string `json:"applied_filters"`\n\t} `json:"metadata"`\n}\n\nfunc ImageProcessor(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[ImageProcessInput, ImageProcessOutput] {\n\tprocessor := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "image-processor",\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input ImageProcessInput) (*ImageProcessOutput, error) {\n\t\t\tresult, err := ProcessImage(input.ImageURL, input.Filters)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf("processing image: %w", err)\n\t\t\t}\n\n\t\t\tif result["url"] == "" {\n\t\t\t\treturn nil, fmt.Errorf("processing failed to generate URL")\n\t\t\t}\n\n\t\t\toutput := &ImageProcessOutput{\n\t\t\t\tProcessedURL: result["url"].(string),\n\t\t\t\tMetadata: struct {\n\t\t\t\t\tSize int `json:"size"`\n\t\t\t\t\tFormat string `json:"format"`\n\t\t\t\t\tAppliedFilters []string `json:"applied_filters"`\n\t\t\t\t}{\n\t\t\t\t\tSize: result["size"].(int),\n\t\t\t\t\tFormat: result["format"].(string),\n\t\t\t\t\tAppliedFilters: input.Filters,\n\t\t\t\t},\n\t\t\t}\n\n\t\t\treturn output, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\t// Example of running a task\n\t_ = func() error {\n\t\t// > Running a task\n\t\tresult, err := processor.Run(context.Background(), ImageProcessInput{\n\t\t\tImageURL: "https://example.com/image.png",\n\t\t\tFilters: []string{"blur"},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Printf("Result: %+v\\n", result)\n\t\treturn nil\n\t}\n\n\t// Example of registering a task on a worker\n\t_ = func() error {\n\t\t// > Declaring a Worker\n\t\tw, err := hatchet.Worker(v1worker.WorkerOpts{\n\t\t\tName: "image-processor-worker",\n\t\t\tWorkflows: []workflow.WorkflowBase{\n\t\t\t\tprocessor,\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = w.StartBlocking(context.Background())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\treturn processor\n}\n\nfunc RunMergentTask() error {\n\n\treturn nil\n}\n\nfunc RunningTasks(hatchet v1.HatchetClient) error {\n\t// > Running a task (Mergent)\n\ttask := struct {\n\t\tRequest struct {\n\t\t\tURL string `json:"url"`\n\t\t\tBody string `json:"body"`\n\t\t\tHeaders map[string]string `json:"headers"`\n\t\t} `json:"request"`\n\t\tName string `json:"name"`\n\t\tQueue string `json:"queue"`\n\t}{\n\t\tRequest: struct {\n\t\t\tURL string `json:"url"`\n\t\t\tBody string `json:"body"`\n\t\t\tHeaders map[string]string `json:"headers"`\n\t\t}{\n\t\t\tURL: "https://example.com",\n\t\t\tHeaders: map[string]string{\n\t\t\t\t"Authorization": "fake-secret-token",\n\t\t\t\t"Content-Type": "application/json",\n\t\t\t},\n\t\t\tBody: "Hello, world!",\n\t\t},\n\t\tName: "4cf95241-fa19-47ef-8a67-71e483747649",\n\t\tQueue: "default",\n\t}\n\n\ttaskJSON, err := json.Marshal(task)\n\tif err != nil {\n\t\treturn fmt.Errorf("marshaling task: %w", err)\n\t}\n\n\treq, err := http.NewRequest(http.MethodPost, "https://api.mergent.co/v2/tasks", bytes.NewBuffer(taskJSON))\n\tif err != nil {\n\t\treturn fmt.Errorf("creating request: %w", err)\n\t}\n\n\treq.Header.Add("Authorization", "Bearer ")\n\treq.Header.Add("Content-Type", "application/json")\n\n\tclient := &http.Client{}\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf("sending request: %w", err)\n\t}\n\tdefer res.Body.Close()\n\n\tfmt.Printf("Mergent task created with status: %d\\n", res.StatusCode)\n\n\t// > Running a task (Hatchet)\n\tprocessor := ImageProcessor(hatchet)\n\n\tresult, err := processor.Run(context.Background(), ImageProcessInput{\n\t\tImageURL: "https://example.com/image.png",\n\t\tFilters: []string{"blur"},\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf("Result: %+v\\n", result)\n\n\t// > Scheduling tasks (Hatchet)\n\t// Schedule the task to run at a specific time\n\tscheduleRef, err := processor.Schedule(\n\t\tcontext.Background(),\n\t\ttime.Now().Add(time.Second*10),\n\t\tImageProcessInput{\n\t\t\tImageURL: "https://example.com/image.png",\n\t\t\tFilters: []string{"blur"},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// or schedule to run every hour\n\tcronRef, err := processor.Cron(\n\t\tcontext.Background(),\n\t\t"run-hourly",\n\t\t"0 * * * *",\n\t\tImageProcessInput{\n\t\t\tImageURL: "https://example.com/image.png",\n\t\t\tFilters: []string{"blur"},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Printf("Scheduled tasks with refs: %+v, %+v\\n", scheduleRef, cronRef)\n\treturn nil\n}\n', source: 'out/go/migration-guides/mergent.go', blocks: { before_mergent: { @@ -36,6 +36,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/cmd/run/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/cmd/run/main.ts index 75ce57ddf..7fcf6885c 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/cmd/run/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/cmd/run/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\n\thatchet_client 'github.com/hatchet-dev/hatchet/pkg/examples/quickstart/hatchet_client'\n\tworkflows 'github.com/hatchet-dev/hatchet/pkg/examples/quickstart/workflows'\n)\n\nfunc main() {\n\thatchet, err := hatchet_client.HatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsimple := workflows.FirstTask(hatchet)\n\n\tresult, err := simple.Run(context.Background(), workflows.SimpleInput{\n\t\tMessage: 'Hello, World!',\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(\n\t\t'Finished running task, and got the transformed message! The transformed message is:',\n\t\tresult.ToLower.TransformedMessage,\n\t)\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\thatchet_client "github.com/hatchet-dev/hatchet/pkg/examples/quickstart/hatchet_client"\n\tworkflows "github.com/hatchet-dev/hatchet/pkg/examples/quickstart/workflows"\n)\n\nfunc main() {\n\thatchet, err := hatchet_client.HatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsimple := workflows.FirstTask(hatchet)\n\n\tresult, err := simple.Run(context.Background(), workflows.SimpleInput{\n\t\tMessage: "Hello, World!",\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(\n\t\t"Finished running task, and got the transformed message! The transformed message is:",\n\t\tresult.ToLower.TransformedMessage,\n\t)\n}\n', source: 'out/go/quickstart/cmd/run/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/cmd/worker/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/cmd/worker/main.ts index 14fade753..0ac762665 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/cmd/worker/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/cmd/worker/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\thatchet_client 'github.com/hatchet-dev/hatchet/pkg/examples/quickstart/hatchet_client'\n\tworkflows 'github.com/hatchet-dev/hatchet/pkg/examples/quickstart/workflows'\n\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/worker'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n)\n\nfunc main() {\n\n\thatchet, err := hatchet_client.HatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tworker, err := hatchet.Worker(\n\t\tworker.WorkerOpts{\n\t\t\tName: 'first-worker',\n\t\t\tWorkflows: []workflow.WorkflowBase{\n\t\t\t\tworkflows.FirstTask(hatchet),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// we construct an interrupt context to handle Ctrl+C\n\t// you can pass in your own context.Context here to the worker\n\tinterruptCtx, cancel := cmdutils.NewInterruptContext()\n\n\tdefer cancel()\n\n\terr = worker.StartBlocking(interruptCtx)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", + 'package main\n\nimport (\n\thatchet_client "github.com/hatchet-dev/hatchet/pkg/examples/quickstart/hatchet_client"\n\tworkflows "github.com/hatchet-dev/hatchet/pkg/examples/quickstart/workflows"\n\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/worker"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n)\n\nfunc main() {\n\n\thatchet, err := hatchet_client.HatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tworker, err := hatchet.Worker(\n\t\tworker.WorkerOpts{\n\t\t\tName: "first-worker",\n\t\t\tWorkflows: []workflow.WorkflowBase{\n\t\t\t\tworkflows.FirstTask(hatchet),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// we construct an interrupt context to handle Ctrl+C\n\t// you can pass in your own context.Context here to the worker\n\tinterruptCtx, cancel := cmdutils.NewInterruptContext()\n\n\tdefer cancel()\n\n\terr = worker.StartBlocking(interruptCtx)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n', source: 'out/go/quickstart/cmd/worker/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/hatchet_client/hatchet_client.ts b/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/hatchet_client/hatchet_client.ts index 983541313..3b809d41d 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/hatchet_client/hatchet_client.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/hatchet_client/hatchet_client.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package hatchet_client\n\nimport (\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/joho/godotenv'\n)\n\nfunc HatchetClient() (v1.HatchetClient, error) {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn v1.NewHatchetClient()\n}\n", + 'package hatchet_client\n\nimport (\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/joho/godotenv"\n)\n\nfunc HatchetClient() (v1.HatchetClient, error) {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn v1.NewHatchetClient()\n}\n', source: 'out/go/quickstart/hatchet_client/hatchet_client.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/workflows/first_task.ts b/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/workflows/first_task.ts index e93dbbd4b..3c3b614d1 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/workflows/first_task.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/quickstart/workflows/first_task.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package workflows\n\nimport (\n\t'fmt'\n\t'strings'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype SimpleInput struct {\n\tMessage string `json:'message'`\n}\n\ntype LowerOutput struct {\n\tTransformedMessage string `json:'transformed_message'`\n}\n\ntype SimpleResult struct {\n\tToLower LowerOutput\n}\n\nfunc FirstTask(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[SimpleInput, SimpleResult] {\n\tsimple := factory.NewWorkflow[SimpleInput, SimpleResult](\n\t\tcreate.WorkflowCreateOpts[SimpleInput]{\n\t\t\tName: 'first-task',\n\t\t},\n\t\thatchet,\n\t)\n\n\tsimple.Task(\n\t\tcreate.WorkflowTask[SimpleInput, SimpleResult]{\n\t\t\tName: 'first-task',\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input SimpleInput) (any, error) {\n\t\t\tfmt.Println('first-task task called')\n\t\t\treturn &LowerOutput{\n\t\t\t\tTransformedMessage: strings.ToLower(input.Message),\n\t\t\t}, nil\n\t\t},\n\t)\n\n\treturn simple\n}\n", + 'package workflows\n\nimport (\n\t"fmt"\n\t"strings"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype SimpleInput struct {\n\tMessage string `json:"message"`\n}\n\ntype LowerOutput struct {\n\tTransformedMessage string `json:"transformed_message"`\n}\n\ntype SimpleResult struct {\n\tToLower LowerOutput\n}\n\nfunc FirstTask(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[SimpleInput, SimpleResult] {\n\tsimple := factory.NewWorkflow[SimpleInput, SimpleResult](\n\t\tcreate.WorkflowCreateOpts[SimpleInput]{\n\t\t\tName: "first-task",\n\t\t},\n\t\thatchet,\n\t)\n\n\tsimple.Task(\n\t\tcreate.WorkflowTask[SimpleInput, SimpleResult]{\n\t\t\tName: "first-task",\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input SimpleInput) (any, error) {\n\t\t\tfmt.Println("first-task task called")\n\t\t\treturn &LowerOutput{\n\t\t\t\tTransformedMessage: strings.ToLower(input.Message),\n\t\t\t}, nil\n\t\t},\n\t)\n\n\treturn simple\n}\n', source: 'out/go/quickstart/workflows/first_task.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/run/all.ts b/frontend/app/src/next/lib/docs/generated/snips/go/run/all.ts index 00c048df7..e63e0be08 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/run/all.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/run/all.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'math/rand'\n\t'os'\n\t'time'\n\n\t'github.com/google/uuid'\n\tv1_workflows 'github.com/hatchet-dev/hatchet/examples/go/workflows'\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/client/rest'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/joho/godotenv'\n\t'github.com/oapi-codegen/runtime/types'\n)\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Get workflow name from command line arguments\n\tvar workflowName string\n\tif len(os.Args) > 1 {\n\t\tworkflowName = os.Args[1]\n\t\tfmt.Println('workflow name provided:', workflowName)\n\t} else {\n\t\tfmt.Println('No workflow name provided. Defaulting to 'simple'')\n\t\tworkflowName = 'simple'\n\t}\n\n\tctx := context.Background()\n\n\t// Define workflow runners map\n\trunnerMap := map[string]func() error{\n\t\t'simple': func() error {\n\t\t\tsimple := v1_workflows.Simple(hatchet)\n\t\t\tresult, err := simple.Run(ctx, v1_workflows.SimpleInput{\n\t\t\t\tMessage: 'Hello, World!',\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println(result.TransformedMessage)\n\t\t\treturn nil\n\t\t},\n\t\t'child': func() error {\n\t\t\tparent := v1_workflows.Parent(hatchet)\n\n\t\t\tresult, err := parent.Run(ctx, v1_workflows.ParentInput{\n\t\t\t\tN: 50,\n\t\t\t})\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println('Parent result:', result.Result)\n\t\t\treturn nil\n\t\t},\n\t\t'dag': func() error {\n\t\t\tdag := v1_workflows.DagWorkflow(hatchet)\n\t\t\tresult, err := dag.Run(ctx, v1_workflows.DagInput{\n\t\t\t\tMessage: 'Hello, DAG!',\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println(result.Step1.Step)\n\t\t\tfmt.Println(result.Step2.Step)\n\t\t\treturn nil\n\t\t},\n\t\t'sleep': func() error {\n\t\t\tsleep := v1_workflows.DurableSleep(hatchet)\n\t\t\t_, err := sleep.Run(ctx, v1_workflows.DurableSleepInput{\n\t\t\t\tMessage: 'Hello, Sleep!',\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println('Sleep workflow completed')\n\t\t\treturn nil\n\t\t},\n\t\t'durable-event': func() error {\n\t\t\tdurableEventWorkflow := v1_workflows.DurableEvent(hatchet)\n\t\t\trun, err := durableEventWorkflow.RunNoWait(ctx, v1_workflows.DurableEventInput{\n\t\t\t\tMessage: 'Hello, World!',\n\t\t\t})\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t_, err = hatchet.Runs().Cancel(ctx, rest.V1CancelTaskRequest{\n\t\t\t\tExternalIds: &[]types.UUID{uuid.MustParse(run.WorkflowRunId())},\n\t\t\t})\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil // We expect an error here\n\t\t\t}\n\n\t\t\t_, err = run.Result()\n\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println('Received expected error:', err)\n\t\t\t\treturn nil // We expect an error here\n\t\t\t}\n\t\t\tfmt.Println('Cancellation workflow completed unexpectedly')\n\t\t\treturn nil\n\t\t},\n\t\t'timeout': func() error {\n\t\t\ttimeout := v1_workflows.Timeout(hatchet)\n\t\t\t_, err := timeout.Run(ctx, v1_workflows.TimeoutInput{})\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println('Received expected error:', err)\n\t\t\t\treturn nil // We expect an error here\n\t\t\t}\n\t\t\tfmt.Println('Timeout workflow completed unexpectedly')\n\t\t\treturn nil\n\t\t},\n\t\t'sticky': func() error {\n\t\t\tsticky := v1_workflows.Sticky(hatchet)\n\t\t\tresult, err := sticky.Run(ctx, v1_workflows.StickyInput{})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println('Value from child workflow:', result.Result)\n\t\t\treturn nil\n\t\t},\n\t\t'sticky-dag': func() error {\n\t\t\tstickyDag := v1_workflows.StickyDag(hatchet)\n\t\t\tresult, err := stickyDag.Run(ctx, v1_workflows.StickyInput{})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println('Value from task 1:', result.StickyTask1.Result)\n\t\t\tfmt.Println('Value from task 2:', result.StickyTask2.Result)\n\t\t\treturn nil\n\t\t},\n\t\t'retries': func() error {\n\t\t\tretries := v1_workflows.Retries(hatchet)\n\t\t\t_, err := retries.Run(ctx, v1_workflows.RetriesInput{})\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println('Received expected error:', err)\n\t\t\t\treturn nil // We expect an error here\n\t\t\t}\n\t\t\tfmt.Println('Retries workflow completed unexpectedly')\n\t\t\treturn nil\n\t\t},\n\t\t'retries-count': func() error {\n\t\t\tretriesCount := v1_workflows.RetriesWithCount(hatchet)\n\t\t\tresult, err := retriesCount.Run(ctx, v1_workflows.RetriesWithCountInput{})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println('Result message:', result.Message)\n\t\t\treturn nil\n\t\t},\n\t\t'with-backoff': func() error {\n\t\t\twithBackoff := v1_workflows.WithBackoff(hatchet)\n\t\t\t_, err := withBackoff.Run(ctx, v1_workflows.BackoffInput{})\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println('Received expected error:', err)\n\t\t\t\treturn nil // We expect an error here\n\t\t\t}\n\t\t\tfmt.Println('WithBackoff workflow completed unexpectedly')\n\t\t\treturn nil\n\t\t},\n\t\t'non-retryable': func() error {\n\t\t\tnonRetryable := v1_workflows.NonRetryableError(hatchet)\n\t\t\t_, err := nonRetryable.Run(ctx, v1_workflows.NonRetryableInput{})\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println('Received expected error:', err)\n\t\t\t\treturn nil // We expect an error here\n\t\t\t}\n\t\t\tfmt.Println('NonRetryable workflow completed unexpectedly')\n\t\t\treturn nil\n\t\t},\n\t\t'on-cron': func() error {\n\t\t\tcronTask := v1_workflows.OnCron(hatchet)\n\t\t\tresult, err := cronTask.Run(ctx, v1_workflows.OnCronInput{\n\t\t\t\tMessage: 'Hello, Cron!',\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println('Cron task result:', result.Job.TransformedMessage)\n\t\t\treturn nil\n\t\t},\n\t\t'priority': func() error {\n\n\t\t\tnRuns := 10\n\t\t\tpriorityWorkflow := v1_workflows.Priority(hatchet)\n\n\t\t\tfor i := 0; i < nRuns; i++ {\n\t\t\t\trandomPrio := int32(rand.Intn(3) + 1)\n\n\t\t\t\tfmt.Println('Random priority:', randomPrio)\n\n\t\t\t\tpriorityWorkflow.RunNoWait(ctx, v1_workflows.PriorityInput{\n\t\t\t\t\tUserId: '1234',\n\t\t\t\t}, client.WithRunMetadata(map[string]int32{'priority': randomPrio}), client.WithPriority(randomPrio))\n\t\t\t}\n\n\t\t\ttriggerAt := time.Now().Add(time.Second + 5)\n\n\t\t\tfor i := 0; i < nRuns; i++ {\n\t\t\t\trandomPrio := int32(rand.Intn(3) + 1)\n\n\t\t\t\tfmt.Println('Random priority:', randomPrio)\n\n\t\t\t\tpriorityWorkflow.Schedule(ctx, triggerAt, v1_workflows.PriorityInput{\n\t\t\t\t\tUserId: '1234',\n\t\t\t\t}, client.WithRunMetadata(map[string]int32{'priority': randomPrio}), client.WithPriority(randomPrio))\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\t// Lookup workflow runner from map\n\trunner, ok := runnerMap[workflowName]\n\tif !ok {\n\t\tfmt.Println('Invalid workflow name provided. Usage: go run examples/v1/run/simple.go [workflow-name]')\n\t\tfmt.Println('Available workflows:', getAvailableWorkflows(runnerMap))\n\t\tos.Exit(1)\n\t}\n\n\t// Run the selected workflow\n\terr = runner()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// Helper function to get available workflows as a formatted string\nfunc getAvailableWorkflows(runnerMap map[string]func() error) string {\n\tvar workflows string\n\tcount := 0\n\tfor name := range runnerMap {\n\t\tif count > 0 {\n\t\t\tworkflows += ', '\n\t\t}\n\t\tworkflows += fmt.Sprintf(''%s'', name)\n\t\tcount++\n\t}\n\treturn workflows\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"math/rand"\n\t"os"\n\t"time"\n\n\t"github.com/google/uuid"\n\tv1_workflows "github.com/hatchet-dev/hatchet/examples/go/workflows"\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/client/rest"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/joho/godotenv"\n\t"github.com/oapi-codegen/runtime/types"\n)\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Get workflow name from command line arguments\n\tvar workflowName string\n\tif len(os.Args) > 1 {\n\t\tworkflowName = os.Args[1]\n\t\tfmt.Println("workflow name provided:", workflowName)\n\t} else {\n\t\tfmt.Println("No workflow name provided. Defaulting to \'simple\'")\n\t\tworkflowName = "simple"\n\t}\n\n\tctx := context.Background()\n\n\t// Define workflow runners map\n\trunnerMap := map[string]func() error{\n\t\t"simple": func() error {\n\t\t\tsimple := v1_workflows.Simple(hatchet)\n\t\t\tresult, err := simple.Run(ctx, v1_workflows.SimpleInput{\n\t\t\t\tMessage: "Hello, World!",\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println(result.TransformedMessage)\n\t\t\treturn nil\n\t\t},\n\t\t"child": func() error {\n\t\t\tparent := v1_workflows.Parent(hatchet)\n\n\t\t\tresult, err := parent.Run(ctx, v1_workflows.ParentInput{\n\t\t\t\tN: 50,\n\t\t\t})\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println("Parent result:", result.Result)\n\t\t\treturn nil\n\t\t},\n\t\t"dag": func() error {\n\t\t\tdag := v1_workflows.DagWorkflow(hatchet)\n\t\t\tresult, err := dag.Run(ctx, v1_workflows.DagInput{\n\t\t\t\tMessage: "Hello, DAG!",\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println(result.Step1.Step)\n\t\t\tfmt.Println(result.Step2.Step)\n\t\t\treturn nil\n\t\t},\n\t\t"sleep": func() error {\n\t\t\tsleep := v1_workflows.DurableSleep(hatchet)\n\t\t\t_, err := sleep.Run(ctx, v1_workflows.DurableSleepInput{\n\t\t\t\tMessage: "Hello, Sleep!",\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println("Sleep workflow completed")\n\t\t\treturn nil\n\t\t},\n\t\t"durable-event": func() error {\n\t\t\tdurableEventWorkflow := v1_workflows.DurableEvent(hatchet)\n\t\t\trun, err := durableEventWorkflow.RunNoWait(ctx, v1_workflows.DurableEventInput{\n\t\t\t\tMessage: "Hello, World!",\n\t\t\t})\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t_, err = hatchet.Runs().Cancel(ctx, rest.V1CancelTaskRequest{\n\t\t\t\tExternalIds: &[]types.UUID{uuid.MustParse(run.WorkflowRunId())},\n\t\t\t})\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil // We expect an error here\n\t\t\t}\n\n\t\t\t_, err = run.Result()\n\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println("Received expected error:", err)\n\t\t\t\treturn nil // We expect an error here\n\t\t\t}\n\t\t\tfmt.Println("Cancellation workflow completed unexpectedly")\n\t\t\treturn nil\n\t\t},\n\t\t"timeout": func() error {\n\t\t\ttimeout := v1_workflows.Timeout(hatchet)\n\t\t\t_, err := timeout.Run(ctx, v1_workflows.TimeoutInput{})\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println("Received expected error:", err)\n\t\t\t\treturn nil // We expect an error here\n\t\t\t}\n\t\t\tfmt.Println("Timeout workflow completed unexpectedly")\n\t\t\treturn nil\n\t\t},\n\t\t"sticky": func() error {\n\t\t\tsticky := v1_workflows.Sticky(hatchet)\n\t\t\tresult, err := sticky.Run(ctx, v1_workflows.StickyInput{})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println("Value from child workflow:", result.Result)\n\t\t\treturn nil\n\t\t},\n\t\t"sticky-dag": func() error {\n\t\t\tstickyDag := v1_workflows.StickyDag(hatchet)\n\t\t\tresult, err := stickyDag.Run(ctx, v1_workflows.StickyInput{})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println("Value from task 1:", result.StickyTask1.Result)\n\t\t\tfmt.Println("Value from task 2:", result.StickyTask2.Result)\n\t\t\treturn nil\n\t\t},\n\t\t"retries": func() error {\n\t\t\tretries := v1_workflows.Retries(hatchet)\n\t\t\t_, err := retries.Run(ctx, v1_workflows.RetriesInput{})\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println("Received expected error:", err)\n\t\t\t\treturn nil // We expect an error here\n\t\t\t}\n\t\t\tfmt.Println("Retries workflow completed unexpectedly")\n\t\t\treturn nil\n\t\t},\n\t\t"retries-count": func() error {\n\t\t\tretriesCount := v1_workflows.RetriesWithCount(hatchet)\n\t\t\tresult, err := retriesCount.Run(ctx, v1_workflows.RetriesWithCountInput{})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println("Result message:", result.Message)\n\t\t\treturn nil\n\t\t},\n\t\t"with-backoff": func() error {\n\t\t\twithBackoff := v1_workflows.WithBackoff(hatchet)\n\t\t\t_, err := withBackoff.Run(ctx, v1_workflows.BackoffInput{})\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println("Received expected error:", err)\n\t\t\t\treturn nil // We expect an error here\n\t\t\t}\n\t\t\tfmt.Println("WithBackoff workflow completed unexpectedly")\n\t\t\treturn nil\n\t\t},\n\t\t"non-retryable": func() error {\n\t\t\tnonRetryable := v1_workflows.NonRetryableError(hatchet)\n\t\t\t_, err := nonRetryable.Run(ctx, v1_workflows.NonRetryableInput{})\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println("Received expected error:", err)\n\t\t\t\treturn nil // We expect an error here\n\t\t\t}\n\t\t\tfmt.Println("NonRetryable workflow completed unexpectedly")\n\t\t\treturn nil\n\t\t},\n\t\t"on-cron": func() error {\n\t\t\tcronTask := v1_workflows.OnCron(hatchet)\n\t\t\tresult, err := cronTask.Run(ctx, v1_workflows.OnCronInput{\n\t\t\t\tMessage: "Hello, Cron!",\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Println("Cron task result:", result.Job.TransformedMessage)\n\t\t\treturn nil\n\t\t},\n\t\t"priority": func() error {\n\n\t\t\tnRuns := 10\n\t\t\tpriorityWorkflow := v1_workflows.Priority(hatchet)\n\n\t\t\tfor i := 0; i < nRuns; i++ {\n\t\t\t\trandomPrio := int32(rand.Intn(3) + 1)\n\n\t\t\t\tfmt.Println("Random priority:", randomPrio)\n\n\t\t\t\tpriorityWorkflow.RunNoWait(ctx, v1_workflows.PriorityInput{\n\t\t\t\t\tUserId: "1234",\n\t\t\t\t}, client.WithRunMetadata(map[string]int32{"priority": randomPrio}), client.WithPriority(randomPrio))\n\t\t\t}\n\n\t\t\ttriggerAt := time.Now().Add(time.Second + 5)\n\n\t\t\tfor i := 0; i < nRuns; i++ {\n\t\t\t\trandomPrio := int32(rand.Intn(3) + 1)\n\n\t\t\t\tfmt.Println("Random priority:", randomPrio)\n\n\t\t\t\tpriorityWorkflow.Schedule(ctx, triggerAt, v1_workflows.PriorityInput{\n\t\t\t\t\tUserId: "1234",\n\t\t\t\t}, client.WithRunMetadata(map[string]int32{"priority": randomPrio}), client.WithPriority(randomPrio))\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\t// Lookup workflow runner from map\n\trunner, ok := runnerMap[workflowName]\n\tif !ok {\n\t\tfmt.Println("Invalid workflow name provided. Usage: go run examples/v1/run/simple.go [workflow-name]")\n\t\tfmt.Println("Available workflows:", getAvailableWorkflows(runnerMap))\n\t\tos.Exit(1)\n\t}\n\n\t// Run the selected workflow\n\terr = runner()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// Helper function to get available workflows as a formatted string\nfunc getAvailableWorkflows(runnerMap map[string]func() error) string {\n\tvar workflows string\n\tcount := 0\n\tfor name := range runnerMap {\n\t\tif count > 0 {\n\t\t\tworkflows += ", "\n\t\t}\n\t\tworkflows += fmt.Sprintf("\'%s\'", name)\n\t\tcount++\n\t}\n\treturn workflows\n}\n', source: 'out/go/run/all.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/run/bulk.ts b/frontend/app/src/next/lib/docs/generated/snips/go/run/bulk.ts index 4665cbe15..bc091ce53 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/run/bulk.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/run/bulk.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\n\tv1_workflows 'github.com/hatchet-dev/hatchet/examples/go/workflows'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/joho/godotenv'\n)\n\nfunc bulk() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\t// > Bulk Run Tasks\n\tsimple := v1_workflows.Simple(hatchet)\n\tbulkRunIds, err := simple.RunBulkNoWait(ctx, []v1_workflows.SimpleInput{\n\t\t{\n\t\t\tMessage: 'Hello, World!',\n\t\t},\n\t\t{\n\t\t\tMessage: 'Hello, Moon!',\n\t\t},\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(bulkRunIds)\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\tv1_workflows "github.com/hatchet-dev/hatchet/examples/go/workflows"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/joho/godotenv"\n)\n\nfunc bulk() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\t// > Bulk Run Tasks\n\tsimple := v1_workflows.Simple(hatchet)\n\tbulkRunIds, err := simple.RunBulkNoWait(ctx, []v1_workflows.SimpleInput{\n\t\t{\n\t\t\tMessage: "Hello, World!",\n\t\t},\n\t\t{\n\t\t\tMessage: "Hello, Moon!",\n\t\t},\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(bulkRunIds)\n}\n', source: 'out/go/run/bulk.go', blocks: { bulk_run_tasks: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/run/cron.ts b/frontend/app/src/next/lib/docs/generated/snips/go/run/cron.ts index 5bac8bf2d..58f2e363c 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/run/cron.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/run/cron.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\n\tv1_workflows 'github.com/hatchet-dev/hatchet/examples/go/workflows'\n\t'github.com/hatchet-dev/hatchet/pkg/client/rest'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/joho/godotenv'\n)\n\nfunc cron() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t// > Create\n\tsimple := v1_workflows.Simple(hatchet)\n\n\tctx := context.Background()\n\n\tresult, err := simple.Cron(\n\t\tctx,\n\t\t'daily-run',\n\t\t'0 0 * * *',\n\t\tv1_workflows.SimpleInput{\n\t\t\tMessage: 'Hello, World!',\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// it may be useful to save the cron id for later\n\tfmt.Println(result.Metadata.Id)\n\n\t// > Delete\n\thatchet.Crons().Delete(ctx, result.Metadata.Id)\n\n\t// > List\n\tcrons, err := hatchet.Crons().List(ctx, rest.CronWorkflowListParams{\n\t\tAdditionalMetadata: &[]string{'user:daily-run'},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(crons)\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\tv1_workflows "github.com/hatchet-dev/hatchet/examples/go/workflows"\n\t"github.com/hatchet-dev/hatchet/pkg/client/rest"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/joho/godotenv"\n)\n\nfunc cron() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t// > Create\n\tsimple := v1_workflows.Simple(hatchet)\n\n\tctx := context.Background()\n\n\tresult, err := simple.Cron(\n\t\tctx,\n\t\t"daily-run",\n\t\t"0 0 * * *",\n\t\tv1_workflows.SimpleInput{\n\t\t\tMessage: "Hello, World!",\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// it may be useful to save the cron id for later\n\tfmt.Println(result.Metadata.Id)\n\n\t// > Delete\n\thatchet.Crons().Delete(ctx, result.Metadata.Id)\n\n\t// > List\n\tcrons, err := hatchet.Crons().List(ctx, rest.CronWorkflowListParams{\n\t\tAdditionalMetadata: &[]string{"user:daily-run"},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(crons)\n}\n', source: 'out/go/run/cron.go', blocks: { create: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/run/event.ts b/frontend/app/src/next/lib/docs/generated/snips/go/run/event.ts index 1880d9503..a1086dab4 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/run/event.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/run/event.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\n\t'github.com/google/uuid'\n\t'github.com/joho/godotenv'\n\n\tv1_workflows 'github.com/hatchet-dev/hatchet/examples/go/workflows'\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/client/rest'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n)\n\nfunc event() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t// > Pushing an Event\n\terr = hatchet.Events().Push(\n\t\tcontext.Background(),\n\t\t'simple-event:create',\n\t\tv1_workflows.SimpleInput{\n\t\t\tMessage: 'Hello, World!',\n\t\t},\n\t)\n\n\t// > Create a filter\n\tpayload := map[string]interface{}{\n\t\t'main_character': 'Anna',\n\t\t'supporting_character': 'Stiva',\n\t\t'location': 'Moscow',\n\t}\n\n\t_, err = hatchet.Filters().Create(\n\t\tcontext.Background(),\n\t\trest.V1CreateFilterRequest{\n\t\t\tWorkflowId: uuid.New(),\n\t\t\tExpression: 'input.shouldSkip == false',\n\t\t\tScope: 'foobarbaz',\n\t\t\tPayload: &payload,\n\t\t},\n\t)\n\n\t// > Skip a run\n\tskipPayload := map[string]interface{}{\n\t\t'shouldSkip': true,\n\t}\n\tskipScope := 'foobarbaz'\n\thatchet.Events().Push(\n\t\tcontext.Background(),\n\t\t'simple-event:create',\n\t\tskipPayload,\n\t\tclient.WithFilterScope(&skipScope),\n\t)\n\n\t// > Trigger a run\n\ttriggerPayload := map[string]interface{}{\n\t\t'shouldSkip': true,\n\t}\n\ttriggerScope := 'foobarbaz'\n\thatchet.Events().Push(\n\t\tcontext.Background(),\n\t\t'simple-event:create',\n\t\ttriggerPayload,\n\t\tclient.WithFilterScope(&triggerScope),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/google/uuid"\n\t"github.com/joho/godotenv"\n\n\tv1_workflows "github.com/hatchet-dev/hatchet/examples/go/workflows"\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/client/rest"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n)\n\nfunc event() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t// > Pushing an Event\n\terr = hatchet.Events().Push(\n\t\tcontext.Background(),\n\t\t"simple-event:create",\n\t\tv1_workflows.SimpleInput{\n\t\t\tMessage: "Hello, World!",\n\t\t},\n\t)\n\n\t// > Create a filter\n\tpayload := map[string]interface{}{\n\t\t"main_character": "Anna",\n\t\t"supporting_character": "Stiva",\n\t\t"location": "Moscow",\n\t}\n\n\t_, err = hatchet.Filters().Create(\n\t\tcontext.Background(),\n\t\trest.V1CreateFilterRequest{\n\t\t\tWorkflowId: uuid.New(),\n\t\t\tExpression: "input.shouldSkip == false",\n\t\t\tScope: "foobarbaz",\n\t\t\tPayload: &payload,\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// > Skip a run\n\tskipPayload := map[string]interface{}{\n\t\t"shouldSkip": true,\n\t}\n\tskipScope := "foobarbaz"\n\terr = hatchet.Events().Push(\n\t\tcontext.Background(),\n\t\t"simple-event:create",\n\t\tskipPayload,\n\t\tclient.WithFilterScope(&skipScope),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// > Trigger a run\n\ttriggerPayload := map[string]interface{}{\n\t\t"shouldSkip": false,\n\t}\n\ttriggerScope := "foobarbaz"\n\terr = hatchet.Events().Push(\n\t\tcontext.Background(),\n\t\t"simple-event:create",\n\t\ttriggerPayload,\n\t\tclient.WithFilterScope(&triggerScope),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n', source: 'out/go/run/event.go', blocks: { pushing_an_event: { @@ -15,15 +15,15 @@ const snippet: Snippet = { stop: 50, }, skip_a_run: { - start: 53, - stop: 62, + start: 57, + stop: 66, }, trigger_a_run: { - start: 65, - stop: 74, + start: 73, + stop: 82, }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/run/priority.ts b/frontend/app/src/next/lib/docs/generated/snips/go/run/priority.ts index bb5c4f0a6..d8e65985f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/run/priority.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/run/priority.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'time'\n\n\tv1_workflows 'github.com/hatchet-dev/hatchet/examples/go/workflows'\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/joho/godotenv'\n)\n\nfunc priority() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\n\tpriorityWorkflow := v1_workflows.Priority(hatchet)\n\n\t// > Running a Task with Priority\n\tpriority := int32(3)\n\n\trunId, err := priorityWorkflow.RunNoWait(ctx, v1_workflows.PriorityInput{\n\t\tUserId: '1234',\n\t}, client.WithPriority(priority))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(runId)\n\n\t// > Schedule and cron\n\tschedulePriority := int32(3)\n\trunAt := time.Now().Add(time.Minute)\n\n\tscheduledRunId, _ := priorityWorkflow.Schedule(ctx, runAt, v1_workflows.PriorityInput{\n\t\tUserId: '1234',\n\t}, client.WithPriority(schedulePriority))\n\n\tcronId, _ := priorityWorkflow.Cron(ctx, 'my-cron', '* * * * *', v1_workflows.PriorityInput{\n\t\tUserId: '1234',\n\t}, client.WithPriority(schedulePriority))\n\n\tfmt.Println(scheduledRunId)\n\tfmt.Println(cronId)\n\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\tv1_workflows "github.com/hatchet-dev/hatchet/examples/go/workflows"\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/joho/godotenv"\n)\n\nfunc priority() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\n\tpriorityWorkflow := v1_workflows.Priority(hatchet)\n\n\t// > Running a Task with Priority\n\tpriority := int32(3)\n\n\trunId, err := priorityWorkflow.RunNoWait(ctx, v1_workflows.PriorityInput{\n\t\tUserId: "1234",\n\t}, client.WithPriority(priority))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(runId)\n\n\t// > Schedule and cron\n\tschedulePriority := int32(3)\n\trunAt := time.Now().Add(time.Minute)\n\n\tscheduledRunId, _ := priorityWorkflow.Schedule(ctx, runAt, v1_workflows.PriorityInput{\n\t\tUserId: "1234",\n\t}, client.WithPriority(schedulePriority))\n\n\tcronId, _ := priorityWorkflow.Cron(ctx, "my-cron", "* * * * *", v1_workflows.PriorityInput{\n\t\tUserId: "1234",\n\t}, client.WithPriority(schedulePriority))\n\n\tfmt.Println(scheduledRunId)\n\tfmt.Println(cronId)\n\n}\n', source: 'out/go/run/priority.go', blocks: { running_a_task_with_priority: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/run/simple.ts b/frontend/app/src/next/lib/docs/generated/snips/go/run/simple.ts index 76903cd59..42fcaf516 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/run/simple.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/run/simple.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'sync'\n\n\tv1_workflows 'github.com/hatchet-dev/hatchet/examples/go/workflows'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/joho/godotenv'\n)\n\nfunc simple() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\t// > Running a Task\n\tsimple := v1_workflows.Simple(hatchet)\n\tresult, err := simple.Run(ctx, v1_workflows.SimpleInput{\n\t\tMessage: 'Hello, World!',\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(result.TransformedMessage)\n\n\t// > Running Multiple Tasks\n\tvar results []string\n\tvar resultsMutex sync.Mutex\n\tvar errs []error\n\tvar errsMutex sync.Mutex\n\n\twg := sync.WaitGroup{}\n\twg.Add(2)\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tresult, err := simple.Run(ctx, v1_workflows.SimpleInput{\n\t\t\tMessage: 'Hello, World!',\n\t\t})\n\n\t\tif err != nil {\n\t\t\terrsMutex.Lock()\n\t\t\terrs = append(errs, err)\n\t\t\terrsMutex.Unlock()\n\t\t\treturn\n\t\t}\n\n\t\tresultsMutex.Lock()\n\t\tresults = append(results, result.TransformedMessage)\n\t\tresultsMutex.Unlock()\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tresult, err := simple.Run(ctx, v1_workflows.SimpleInput{\n\t\t\tMessage: 'Hello, Moon!',\n\t\t})\n\n\t\tif err != nil {\n\t\t\terrsMutex.Lock()\n\t\t\terrs = append(errs, err)\n\t\t\terrsMutex.Unlock()\n\t\t\treturn\n\t\t}\n\n\t\tresultsMutex.Lock()\n\t\tresults = append(results, result.TransformedMessage)\n\t\tresultsMutex.Unlock()\n\t}()\n\n\twg.Wait()\n\n\t// > Running a Task Without Waiting\n\tsimple = v1_workflows.Simple(hatchet)\n\trunRef, err := simple.RunNoWait(ctx, v1_workflows.SimpleInput{\n\t\tMessage: 'Hello, World!',\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// The Run Ref Exposes an ID that can be used to wait for the task to complete\n\t// or check on the status of the task\n\trunId := runRef.RunId()\n\tfmt.Println(runId)\n\n\t// > Subscribing to results\n\t// finally, we can wait for the task to complete and get the result\n\tfinalResult, err := runRef.Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(finalResult)\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"sync"\n\n\tv1_workflows "github.com/hatchet-dev/hatchet/examples/go/workflows"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/joho/godotenv"\n)\n\nfunc simple() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\t// > Running a Task\n\tsimple := v1_workflows.Simple(hatchet)\n\tresult, err := simple.Run(ctx, v1_workflows.SimpleInput{\n\t\tMessage: "Hello, World!",\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(result.TransformedMessage)\n\n\t// > Running Multiple Tasks\n\tvar results []string\n\tvar resultsMutex sync.Mutex\n\tvar errs []error\n\tvar errsMutex sync.Mutex\n\n\twg := sync.WaitGroup{}\n\twg.Add(2)\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tresult, err := simple.Run(ctx, v1_workflows.SimpleInput{\n\t\t\tMessage: "Hello, World!",\n\t\t})\n\n\t\tif err != nil {\n\t\t\terrsMutex.Lock()\n\t\t\terrs = append(errs, err)\n\t\t\terrsMutex.Unlock()\n\t\t\treturn\n\t\t}\n\n\t\tresultsMutex.Lock()\n\t\tresults = append(results, result.TransformedMessage)\n\t\tresultsMutex.Unlock()\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tresult, err := simple.Run(ctx, v1_workflows.SimpleInput{\n\t\t\tMessage: "Hello, Moon!",\n\t\t})\n\n\t\tif err != nil {\n\t\t\terrsMutex.Lock()\n\t\t\terrs = append(errs, err)\n\t\t\terrsMutex.Unlock()\n\t\t\treturn\n\t\t}\n\n\t\tresultsMutex.Lock()\n\t\tresults = append(results, result.TransformedMessage)\n\t\tresultsMutex.Unlock()\n\t}()\n\n\twg.Wait()\n\n\t// > Running a Task Without Waiting\n\tsimple = v1_workflows.Simple(hatchet)\n\trunRef, err := simple.RunNoWait(ctx, v1_workflows.SimpleInput{\n\t\tMessage: "Hello, World!",\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// The Run Ref Exposes an ID that can be used to wait for the task to complete\n\t// or check on the status of the task\n\trunId := runRef.RunId()\n\tfmt.Println(runId)\n\n\t// > Subscribing to results\n\t// finally, we can wait for the task to complete and get the result\n\tfinalResult, err := runRef.Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(finalResult)\n}\n', source: 'out/go/run/simple.go', blocks: { running_a_task: { @@ -24,6 +24,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/worker/start.ts b/frontend/app/src/next/lib/docs/generated/snips/go/worker/start.ts index a421c7416..16afb10a4 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/worker/start.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/worker/start.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'os'\n\t'time'\n\n\tv1_workflows 'github.com/hatchet-dev/hatchet/examples/go/workflows'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/worker'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/joho/godotenv'\n)\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Get workflow name from command line arguments\n\tvar workflowName string\n\tif len(os.Args) > 1 {\n\t\tworkflowName = os.Args[1]\n\t\tfmt.Println('workflow name provided:', workflowName)\n\t}\n\n\t// Define workflows map\n\tworkflowMap := map[string][]workflow.WorkflowBase{\n\t\t'dag': {v1_workflows.DagWorkflow(hatchet)},\n\t\t'on-failure': {v1_workflows.OnFailure(hatchet)},\n\t\t'simple': {v1_workflows.Simple(hatchet)},\n\t\t'sleep': {v1_workflows.DurableSleep(hatchet)},\n\t\t'child': {v1_workflows.Parent(hatchet), v1_workflows.Child(hatchet)},\n\t\t'cancellation': {v1_workflows.Cancellation(hatchet)},\n\t\t'timeout': {v1_workflows.Timeout(hatchet)},\n\t\t'sticky': {v1_workflows.Sticky(hatchet), v1_workflows.StickyDag(hatchet), v1_workflows.Child(hatchet)},\n\t\t'retries': {v1_workflows.Retries(hatchet), v1_workflows.RetriesWithCount(hatchet), v1_workflows.WithBackoff(hatchet)},\n\t\t'on-cron': {v1_workflows.OnCron(hatchet)},\n\t\t'non-retryable': {v1_workflows.NonRetryableError(hatchet)},\n\t\t'priority': {v1_workflows.Priority(hatchet)},\n\t}\n\n\t// Add an 'all' option that registers all workflows\n\tallWorkflows := []workflow.WorkflowBase{}\n\tfor _, wfs := range workflowMap {\n\t\tallWorkflows = append(allWorkflows, wfs...)\n\t}\n\tworkflowMap['all'] = allWorkflows\n\n\t// Lookup workflow from map\n\tworkflow, ok := workflowMap[workflowName]\n\tif !ok {\n\t\tfmt.Println('Invalid workflow name provided. Usage: go run examples/v1/worker/start.go [workflow-name]')\n\t\tfmt.Println('Available workflows:', getAvailableWorkflows(workflowMap))\n\t\tos.Exit(1)\n\t}\n\n\tvar slots int\n\tif workflowName == 'priority' {\n\t\tslots = 1\n\t} else {\n\t\tslots = 100\n\t}\n\n\tworker, err := hatchet.Worker(\n\t\tworker.WorkerOpts{\n\t\t\tName: fmt.Sprintf('%s-worker', workflowName),\n\t\t\tWorkflows: workflow,\n\t\t\tSlots: slots,\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.NewInterruptContext()\n\n\terr = worker.StartBlocking(interruptCtx)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgo func() {\n\t\ttime.Sleep(10 * time.Second)\n\t\tcancel()\n\t}()\n}\n\n// Helper function to get available workflows as a formatted string\nfunc getAvailableWorkflows(workflowMap map[string][]workflow.WorkflowBase) string {\n\tvar workflows string\n\tcount := 0\n\tfor name := range workflowMap {\n\t\tif count > 0 {\n\t\t\tworkflows += ', '\n\t\t}\n\t\tworkflows += fmt.Sprintf(''%s'', name)\n\t\tcount++\n\t}\n\treturn workflows\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\t"os"\n\t"time"\n\n\tv1_workflows "github.com/hatchet-dev/hatchet/examples/go/workflows"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/worker"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/joho/godotenv"\n)\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\thatchet, err := v1.NewHatchetClient()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Get workflow name from command line arguments\n\tvar workflowName string\n\tif len(os.Args) > 1 {\n\t\tworkflowName = os.Args[1]\n\t\tfmt.Println("workflow name provided:", workflowName)\n\t}\n\n\t// Define workflows map\n\tworkflowMap := map[string][]workflow.WorkflowBase{\n\t\t"dag": {v1_workflows.DagWorkflow(hatchet)},\n\t\t"on-failure": {v1_workflows.OnFailure(hatchet)},\n\t\t"simple": {v1_workflows.Simple(hatchet)},\n\t\t"sleep": {v1_workflows.DurableSleep(hatchet)},\n\t\t"child": {v1_workflows.Parent(hatchet), v1_workflows.Child(hatchet)},\n\t\t"cancellation": {v1_workflows.Cancellation(hatchet)},\n\t\t"timeout": {v1_workflows.Timeout(hatchet)},\n\t\t"sticky": {v1_workflows.Sticky(hatchet), v1_workflows.StickyDag(hatchet), v1_workflows.Child(hatchet)},\n\t\t"retries": {v1_workflows.Retries(hatchet), v1_workflows.RetriesWithCount(hatchet), v1_workflows.WithBackoff(hatchet)},\n\t\t"on-cron": {v1_workflows.OnCron(hatchet)},\n\t\t"non-retryable": {v1_workflows.NonRetryableError(hatchet)},\n\t\t"priority": {v1_workflows.Priority(hatchet)},\n\t}\n\n\t// Add an "all" option that registers all workflows\n\tallWorkflows := []workflow.WorkflowBase{}\n\tfor _, wfs := range workflowMap {\n\t\tallWorkflows = append(allWorkflows, wfs...)\n\t}\n\tworkflowMap["all"] = allWorkflows\n\n\t// Lookup workflow from map\n\tworkflow, ok := workflowMap[workflowName]\n\tif !ok {\n\t\tfmt.Println("Invalid workflow name provided. Usage: go run examples/v1/worker/start.go [workflow-name]")\n\t\tfmt.Println("Available workflows:", getAvailableWorkflows(workflowMap))\n\t\tos.Exit(1)\n\t}\n\n\tvar slots int\n\tif workflowName == "priority" {\n\t\tslots = 1\n\t} else {\n\t\tslots = 100\n\t}\n\n\tworker, err := hatchet.Worker(\n\t\tworker.WorkerOpts{\n\t\t\tName: fmt.Sprintf("%s-worker", workflowName),\n\t\t\tWorkflows: workflow,\n\t\t\tSlots: slots,\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.NewInterruptContext()\n\n\terr = worker.StartBlocking(interruptCtx)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgo func() {\n\t\ttime.Sleep(10 * time.Second)\n\t\tcancel()\n\t}()\n}\n\n// Helper function to get available workflows as a formatted string\nfunc getAvailableWorkflows(workflowMap map[string][]workflow.WorkflowBase) string {\n\tvar workflows string\n\tcount := 0\n\tfor name := range workflowMap {\n\t\tif count > 0 {\n\t\t\tworkflows += ", "\n\t\t}\n\t\tworkflows += fmt.Sprintf("\'%s\'", name)\n\t\tcount++\n\t}\n\treturn workflows\n}\n', source: 'out/go/worker/start.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/cancellations.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/cancellations.ts index 80ed56228..b243a4c50 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/cancellations.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/cancellations.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'errors'\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype CancellationInput struct{}\ntype CancellationResult struct {\n\tCompleted bool\n}\n\nfunc Cancellation(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[CancellationInput, CancellationResult] {\n\n\t// > Cancelled task\n\t// Create a task that sleeps for 10 seconds and checks if it was cancelled\n\tcancellation := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'cancellation-task',\n\t\t}, func(ctx worker.HatchetContext, input CancellationInput) (*CancellationResult, error) {\n\t\t\t// Sleep for 10 seconds\n\t\t\ttime.Sleep(10 * time.Second)\n\n\t\t\t// Check if the context was cancelled\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn nil, errors.New('Task was cancelled')\n\t\t\tdefault:\n\t\t\t\t// Continue execution\n\t\t\t}\n\n\t\t\treturn &CancellationResult{\n\t\t\t\tCompleted: true,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn cancellation\n}\n", + 'package v1_workflows\n\nimport (\n\t"errors"\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype CancellationInput struct{}\ntype CancellationResult struct {\n\tCompleted bool\n}\n\nfunc Cancellation(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[CancellationInput, CancellationResult] {\n\n\t// > Cancelled task\n\t// Create a task that sleeps for 10 seconds and checks if it was cancelled\n\tcancellation := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "cancellation-task",\n\t\t}, func(ctx worker.HatchetContext, input CancellationInput) (*CancellationResult, error) {\n\t\t\t// Sleep for 10 seconds\n\t\t\ttime.Sleep(10 * time.Second)\n\n\t\t\t// Check if the context was cancelled\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn nil, errors.New("Task was cancelled")\n\t\t\tdefault:\n\t\t\t\t// Continue execution\n\t\t\t}\n\n\t\t\treturn &CancellationResult{\n\t\t\t\tCompleted: true,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn cancellation\n}\n', source: 'out/go/workflows/cancellations.go', blocks: { cancelled_task: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/child-workflows.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/child-workflows.ts index 26e44ebbf..d861235db 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/child-workflows.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/child-workflows.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype ChildInput struct {\n\tN int `json:'n'`\n}\n\ntype ValueOutput struct {\n\tValue int `json:'value'`\n}\n\ntype ParentInput struct {\n\tN int `json:'n'`\n}\n\ntype SumOutput struct {\n\tResult int `json:'result'`\n}\n\nfunc Child(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[ChildInput, ValueOutput] {\n\tchild := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'child',\n\t\t}, func(ctx worker.HatchetContext, input ChildInput) (*ValueOutput, error) {\n\t\t\treturn &ValueOutput{\n\t\t\t\tValue: input.N,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn child\n}\n\nfunc Parent(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[ParentInput, SumOutput] {\n\n\tchild := Child(hatchet)\n\tparent := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'parent',\n\t\t}, func(ctx worker.HatchetContext, input ParentInput) (*SumOutput, error) {\n\n\t\t\tsum := 0\n\n\t\t\t// Launch child workflows in parallel\n\t\t\tresults := make([]*ValueOutput, 0, input.N)\n\t\t\tfor j := 0; j < input.N; j++ {\n\t\t\t\tresult, err := child.RunAsChild(ctx, ChildInput{N: j}, workflow.RunAsChildOpts{})\n\n\t\t\t\tif err != nil {\n\t\t\t\t\t// firstErr = err\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\tresults = append(results, result)\n\n\t\t\t}\n\n\t\t\t// Sum results from all children\n\t\t\tfor _, result := range results {\n\t\t\t\tsum += result.Value\n\t\t\t}\n\n\t\t\treturn &SumOutput{\n\t\t\t\tResult: sum,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn parent\n}\n", + 'package v1_workflows\n\nimport (\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype ChildInput struct {\n\tN int `json:"n"`\n}\n\ntype ValueOutput struct {\n\tValue int `json:"value"`\n}\n\ntype ParentInput struct {\n\tN int `json:"n"`\n}\n\ntype SumOutput struct {\n\tResult int `json:"result"`\n}\n\nfunc Child(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[ChildInput, ValueOutput] {\n\tchild := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "child",\n\t\t}, func(ctx worker.HatchetContext, input ChildInput) (*ValueOutput, error) {\n\t\t\treturn &ValueOutput{\n\t\t\t\tValue: input.N,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn child\n}\n\nfunc Parent(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[ParentInput, SumOutput] {\n\n\tchild := Child(hatchet)\n\tparent := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "parent",\n\t\t}, func(ctx worker.HatchetContext, input ParentInput) (*SumOutput, error) {\n\n\t\t\tsum := 0\n\n\t\t\t// Launch child workflows in parallel\n\t\t\tresults := make([]*ValueOutput, 0, input.N)\n\t\t\tfor j := 0; j < input.N; j++ {\n\t\t\t\tresult, err := child.RunAsChild(ctx, ChildInput{N: j}, workflow.RunAsChildOpts{})\n\n\t\t\t\tif err != nil {\n\t\t\t\t\t// firstErr = err\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\tresults = append(results, result)\n\n\t\t\t}\n\n\t\t\t// Sum results from all children\n\t\t\tfor _, result := range results {\n\t\t\t\tsum += result.Value\n\t\t\t}\n\n\t\t\treturn &SumOutput{\n\t\t\t\tResult: sum,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn parent\n}\n', source: 'out/go/workflows/child-workflows.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/complex-conditions.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/complex-conditions.ts index d1f85622e..2c2ccd855 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/complex-conditions.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/complex-conditions.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'math/rand'\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n\t'github.com/hatchet-dev/hatchet/pkg/worker/condition'\n)\n\n// StepOutput represents the output of most tasks in this workflow\ntype StepOutput struct {\n\tRandomNumber int `json:'randomNumber'`\n}\n\n// RandomSum represents the output of the sum task\ntype RandomSum struct {\n\tSum int `json:'sum'`\n}\n\n// TaskConditionWorkflowResult represents the aggregate output of all tasks\ntype TaskConditionWorkflowResult struct {\n\tStart StepOutput `json:'start'`\n\tWaitForSleep StepOutput `json:'waitForSleep'`\n\tWaitForEvent StepOutput `json:'waitForEvent'`\n\tSkipOnEvent StepOutput `json:'skipOnEvent'`\n\tLeftBranch StepOutput `json:'leftBranch'`\n\tRightBranch StepOutput `json:'rightBranch'`\n\tSum RandomSum `json:'sum'`\n}\n\n// taskOpts is a type alias for workflow task options\ntype taskOpts = create.WorkflowTask[struct{}, TaskConditionWorkflowResult]\n\nfunc TaskConditionWorkflow(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[struct{}, TaskConditionWorkflowResult] {\n\t// > Create a workflow\n\twf := factory.NewWorkflow[struct{}, TaskConditionWorkflowResult](\n\t\tcreate.WorkflowCreateOpts[struct{}]{\n\t\t\tName: 'TaskConditionWorkflow',\n\t\t},\n\t\thatchet,\n\t)\n\n\t// > Add base task\n\tstart := wf.Task(\n\t\ttaskOpts{\n\t\t\tName: 'start',\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\treturn &StepOutput{\n\t\t\t\tRandomNumber: rand.Intn(100) + 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\t// > Add wait for sleep\n\twaitForSleep := wf.Task(\n\t\ttaskOpts{\n\t\t\tName: 'waitForSleep',\n\t\t\tParents: []create.NamedTask{start},\n\t\t\tWaitFor: condition.SleepCondition(time.Second * 10),\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\treturn &StepOutput{\n\t\t\t\tRandomNumber: rand.Intn(100) + 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\t// > Add skip on event\n\tskipOnEvent := wf.Task(\n\t\ttaskOpts{\n\t\t\tName: 'skipOnEvent',\n\t\t\tParents: []create.NamedTask{start},\n\t\t\tWaitFor: condition.SleepCondition(time.Second * 30),\n\t\t\tSkipIf: condition.UserEventCondition('skip_on_event:skip', 'true'),\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\treturn &StepOutput{\n\t\t\t\tRandomNumber: rand.Intn(100) + 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\t// > Add branching\n\tleftBranch := wf.Task(\n\t\ttaskOpts{\n\t\t\tName: 'leftBranch',\n\t\t\tParents: []create.NamedTask{waitForSleep},\n\t\t\tSkipIf: condition.ParentCondition(waitForSleep, 'output.randomNumber > 50'),\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\treturn &StepOutput{\n\t\t\t\tRandomNumber: rand.Intn(100) + 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\trightBranch := wf.Task(\n\t\ttaskOpts{\n\t\t\tName: 'rightBranch',\n\t\t\tParents: []create.NamedTask{waitForSleep},\n\t\t\tSkipIf: condition.ParentCondition(waitForSleep, 'output.randomNumber <= 50'),\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\treturn &StepOutput{\n\t\t\t\tRandomNumber: rand.Intn(100) + 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\t// > Add wait for event\n\twaitForEvent := wf.Task(\n\t\ttaskOpts{\n\t\t\tName: 'waitForEvent',\n\t\t\tParents: []create.NamedTask{start},\n\t\t\tWaitFor: condition.Or(\n\t\t\t\tcondition.SleepCondition(time.Minute),\n\t\t\t\tcondition.UserEventCondition('wait_for_event:start', 'true'),\n\t\t\t),\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\treturn &StepOutput{\n\t\t\t\tRandomNumber: rand.Intn(100) + 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\t// > Add sum\n\twf.Task(\n\t\ttaskOpts{\n\t\t\tName: 'sum',\n\t\t\tParents: []create.NamedTask{\n\t\t\t\tstart,\n\t\t\t\twaitForSleep,\n\t\t\t\twaitForEvent,\n\t\t\t\tskipOnEvent,\n\t\t\t\tleftBranch,\n\t\t\t\trightBranch,\n\t\t\t},\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\tvar startOutput StepOutput\n\t\t\tif err := ctx.ParentOutput(start, &startOutput); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tvar waitForSleepOutput StepOutput\n\t\t\tif err := ctx.ParentOutput(waitForSleep, &waitForSleepOutput); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tvar waitForEventOutput StepOutput\n\t\t\tctx.ParentOutput(waitForEvent, &waitForEventOutput)\n\n\t\t\t// Handle potentially skipped tasks\n\t\t\tvar skipOnEventOutput StepOutput\n\t\t\tvar four int\n\n\t\t\terr := ctx.ParentOutput(skipOnEvent, &skipOnEventOutput)\n\n\t\t\tif err != nil {\n\t\t\t\tfour = 0\n\t\t\t} else {\n\t\t\t\tfour = skipOnEventOutput.RandomNumber\n\t\t\t}\n\n\t\t\tvar leftBranchOutput StepOutput\n\t\t\tvar five int\n\n\t\t\terr = ctx.ParentOutput(leftBranch, leftBranchOutput)\n\t\t\tif err != nil {\n\t\t\t\tfive = 0\n\t\t\t} else {\n\t\t\t\tfive = leftBranchOutput.RandomNumber\n\t\t\t}\n\n\t\t\tvar rightBranchOutput StepOutput\n\t\t\tvar six int\n\n\t\t\terr = ctx.ParentOutput(rightBranch, rightBranchOutput)\n\t\t\tif err != nil {\n\t\t\t\tsix = 0\n\t\t\t} else {\n\t\t\t\tsix = rightBranchOutput.RandomNumber\n\t\t\t}\n\n\t\t\treturn &RandomSum{\n\t\t\t\tSum: startOutput.RandomNumber + waitForEventOutput.RandomNumber +\n\t\t\t\t\twaitForSleepOutput.RandomNumber + four + five + six,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\treturn wf\n}\n", + 'package v1_workflows\n\nimport (\n\t"math/rand"\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n\t"github.com/hatchet-dev/hatchet/pkg/worker/condition"\n)\n\n// StepOutput represents the output of most tasks in this workflow\ntype StepOutput struct {\n\tRandomNumber int `json:"randomNumber"`\n}\n\n// RandomSum represents the output of the sum task\ntype RandomSum struct {\n\tSum int `json:"sum"`\n}\n\n// TaskConditionWorkflowResult represents the aggregate output of all tasks\ntype TaskConditionWorkflowResult struct {\n\tStart StepOutput `json:"start"`\n\tWaitForSleep StepOutput `json:"waitForSleep"`\n\tWaitForEvent StepOutput `json:"waitForEvent"`\n\tSkipOnEvent StepOutput `json:"skipOnEvent"`\n\tLeftBranch StepOutput `json:"leftBranch"`\n\tRightBranch StepOutput `json:"rightBranch"`\n\tSum RandomSum `json:"sum"`\n}\n\n// taskOpts is a type alias for workflow task options\ntype taskOpts = create.WorkflowTask[struct{}, TaskConditionWorkflowResult]\n\nfunc TaskConditionWorkflow(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[struct{}, TaskConditionWorkflowResult] {\n\t// > Create a workflow\n\twf := factory.NewWorkflow[struct{}, TaskConditionWorkflowResult](\n\t\tcreate.WorkflowCreateOpts[struct{}]{\n\t\t\tName: "TaskConditionWorkflow",\n\t\t},\n\t\thatchet,\n\t)\n\n\t// > Add base task\n\tstart := wf.Task(\n\t\ttaskOpts{\n\t\t\tName: "start",\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\treturn &StepOutput{\n\t\t\t\tRandomNumber: rand.Intn(100) + 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\t// > Add wait for sleep\n\twaitForSleep := wf.Task(\n\t\ttaskOpts{\n\t\t\tName: "waitForSleep",\n\t\t\tParents: []create.NamedTask{start},\n\t\t\tWaitFor: condition.SleepCondition(time.Second * 10),\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\treturn &StepOutput{\n\t\t\t\tRandomNumber: rand.Intn(100) + 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\t// > Add skip on event\n\tskipOnEvent := wf.Task(\n\t\ttaskOpts{\n\t\t\tName: "skipOnEvent",\n\t\t\tParents: []create.NamedTask{start},\n\t\t\tWaitFor: condition.SleepCondition(time.Second * 30),\n\t\t\tSkipIf: condition.UserEventCondition("skip_on_event:skip", "true"),\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\treturn &StepOutput{\n\t\t\t\tRandomNumber: rand.Intn(100) + 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\t// > Add branching\n\tleftBranch := wf.Task(\n\t\ttaskOpts{\n\t\t\tName: "leftBranch",\n\t\t\tParents: []create.NamedTask{waitForSleep},\n\t\t\tSkipIf: condition.ParentCondition(waitForSleep, "output.randomNumber > 50"),\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\treturn &StepOutput{\n\t\t\t\tRandomNumber: rand.Intn(100) + 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\trightBranch := wf.Task(\n\t\ttaskOpts{\n\t\t\tName: "rightBranch",\n\t\t\tParents: []create.NamedTask{waitForSleep},\n\t\t\tSkipIf: condition.ParentCondition(waitForSleep, "output.randomNumber <= 50"),\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\treturn &StepOutput{\n\t\t\t\tRandomNumber: rand.Intn(100) + 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\t// > Add wait for event\n\twaitForEvent := wf.Task(\n\t\ttaskOpts{\n\t\t\tName: "waitForEvent",\n\t\t\tParents: []create.NamedTask{start},\n\t\t\tWaitFor: condition.Or(\n\t\t\t\tcondition.SleepCondition(time.Minute),\n\t\t\t\tcondition.UserEventCondition("wait_for_event:start", "true"),\n\t\t\t),\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\treturn &StepOutput{\n\t\t\t\tRandomNumber: rand.Intn(100) + 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\t// > Add sum\n\twf.Task(\n\t\ttaskOpts{\n\t\t\tName: "sum",\n\t\t\tParents: []create.NamedTask{\n\t\t\t\tstart,\n\t\t\t\twaitForSleep,\n\t\t\t\twaitForEvent,\n\t\t\t\tskipOnEvent,\n\t\t\t\tleftBranch,\n\t\t\t\trightBranch,\n\t\t\t},\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ struct{}) (interface{}, error) {\n\t\t\tvar startOutput StepOutput\n\t\t\tif err := ctx.ParentOutput(start, &startOutput); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tvar waitForSleepOutput StepOutput\n\t\t\tif err := ctx.ParentOutput(waitForSleep, &waitForSleepOutput); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tvar waitForEventOutput StepOutput\n\t\t\tctx.ParentOutput(waitForEvent, &waitForEventOutput)\n\n\t\t\t// Handle potentially skipped tasks\n\t\t\tvar skipOnEventOutput StepOutput\n\t\t\tvar four int\n\n\t\t\terr := ctx.ParentOutput(skipOnEvent, &skipOnEventOutput)\n\n\t\t\tif err != nil {\n\t\t\t\tfour = 0\n\t\t\t} else {\n\t\t\t\tfour = skipOnEventOutput.RandomNumber\n\t\t\t}\n\n\t\t\tvar leftBranchOutput StepOutput\n\t\t\tvar five int\n\n\t\t\terr = ctx.ParentOutput(leftBranch, leftBranchOutput)\n\t\t\tif err != nil {\n\t\t\t\tfive = 0\n\t\t\t} else {\n\t\t\t\tfive = leftBranchOutput.RandomNumber\n\t\t\t}\n\n\t\t\tvar rightBranchOutput StepOutput\n\t\t\tvar six int\n\n\t\t\terr = ctx.ParentOutput(rightBranch, rightBranchOutput)\n\t\t\tif err != nil {\n\t\t\t\tsix = 0\n\t\t\t} else {\n\t\t\t\tsix = rightBranchOutput.RandomNumber\n\t\t\t}\n\n\t\t\treturn &RandomSum{\n\t\t\t\tSum: startOutput.RandomNumber + waitForEventOutput.RandomNumber +\n\t\t\t\t\twaitForSleepOutput.RandomNumber + four + five + six,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\treturn wf\n}\n', source: 'out/go/workflows/complex-conditions.go', blocks: { create_a_workflow: { @@ -36,6 +36,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/concurrency-rr.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/concurrency-rr.ts index 4fe6b3e4f..506b1569b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/concurrency-rr.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/concurrency-rr.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'math/rand'\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\t'github.com/hatchet-dev/hatchet/pkg/client/types'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype ConcurrencyInput struct {\n\tMessage string\n\tTier string\n\tAccount string\n}\n\ntype TransformedOutput struct {\n\tTransformedMessage string\n}\n\nfunc ConcurrencyRoundRobin(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[ConcurrencyInput, TransformedOutput] {\n\t// > Concurrency Strategy With Key\n\tvar maxRuns int32 = 1\n\tstrategy := types.GroupRoundRobin\n\n\tconcurrency := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'simple-concurrency',\n\t\t\tConcurrency: []*types.Concurrency{\n\t\t\t\t{\n\t\t\t\t\tExpression: 'input.GroupKey',\n\t\t\t\t\tMaxRuns: &maxRuns,\n\t\t\t\t\tLimitStrategy: &strategy,\n\t\t\t\t},\n\t\t\t},\n\t\t}, func(ctx worker.HatchetContext, input ConcurrencyInput) (*TransformedOutput, error) {\n\t\t\t// Random sleep between 200ms and 1000ms\n\t\t\ttime.Sleep(time.Duration(200+rand.Intn(800)) * time.Millisecond)\n\n\t\t\treturn &TransformedOutput{\n\t\t\t\tTransformedMessage: input.Message,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn concurrency\n}\n\nfunc MultipleConcurrencyKeys(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[ConcurrencyInput, TransformedOutput] {\n\t// > Multiple Concurrency Keys\n\tstrategy := types.GroupRoundRobin\n\tvar maxRuns int32 = 20\n\n\tconcurrency := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'simple-concurrency',\n\t\t\tConcurrency: []*types.Concurrency{\n\t\t\t\t{\n\t\t\t\t\tExpression: 'input.Tier',\n\t\t\t\t\tMaxRuns: &maxRuns,\n\t\t\t\t\tLimitStrategy: &strategy,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tExpression: 'input.Account',\n\t\t\t\t\tMaxRuns: &maxRuns,\n\t\t\t\t\tLimitStrategy: &strategy,\n\t\t\t\t},\n\t\t\t},\n\t\t}, func(ctx worker.HatchetContext, input ConcurrencyInput) (*TransformedOutput, error) {\n\t\t\t// Random sleep between 200ms and 1000ms\n\t\t\ttime.Sleep(time.Duration(200+rand.Intn(800)) * time.Millisecond)\n\n\t\t\treturn &TransformedOutput{\n\t\t\t\tTransformedMessage: input.Message,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn concurrency\n}\n", + 'package v1_workflows\n\nimport (\n\t"math/rand"\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\t"github.com/hatchet-dev/hatchet/pkg/client/types"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype ConcurrencyInput struct {\n\tMessage string\n\tTier string\n\tAccount string\n}\n\ntype TransformedOutput struct {\n\tTransformedMessage string\n}\n\nfunc ConcurrencyRoundRobin(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[ConcurrencyInput, TransformedOutput] {\n\t// > Concurrency Strategy With Key\n\tvar maxRuns int32 = 1\n\tstrategy := types.GroupRoundRobin\n\n\tconcurrency := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "simple-concurrency",\n\t\t\tConcurrency: []*types.Concurrency{\n\t\t\t\t{\n\t\t\t\t\tExpression: "input.GroupKey",\n\t\t\t\t\tMaxRuns: &maxRuns,\n\t\t\t\t\tLimitStrategy: &strategy,\n\t\t\t\t},\n\t\t\t},\n\t\t}, func(ctx worker.HatchetContext, input ConcurrencyInput) (*TransformedOutput, error) {\n\t\t\t// Random sleep between 200ms and 1000ms\n\t\t\ttime.Sleep(time.Duration(200+rand.Intn(800)) * time.Millisecond)\n\n\t\t\treturn &TransformedOutput{\n\t\t\t\tTransformedMessage: input.Message,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn concurrency\n}\n\nfunc MultipleConcurrencyKeys(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[ConcurrencyInput, TransformedOutput] {\n\t// > Multiple Concurrency Keys\n\tstrategy := types.GroupRoundRobin\n\tvar maxRuns int32 = 20\n\n\tconcurrency := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "simple-concurrency",\n\t\t\tConcurrency: []*types.Concurrency{\n\t\t\t\t{\n\t\t\t\t\tExpression: "input.Tier",\n\t\t\t\t\tMaxRuns: &maxRuns,\n\t\t\t\t\tLimitStrategy: &strategy,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tExpression: "input.Account",\n\t\t\t\t\tMaxRuns: &maxRuns,\n\t\t\t\t\tLimitStrategy: &strategy,\n\t\t\t\t},\n\t\t\t},\n\t\t}, func(ctx worker.HatchetContext, input ConcurrencyInput) (*TransformedOutput, error) {\n\t\t\t// Random sleep between 200ms and 1000ms\n\t\t\ttime.Sleep(time.Duration(200+rand.Intn(800)) * time.Millisecond)\n\n\t\t\treturn &TransformedOutput{\n\t\t\t\tTransformedMessage: input.Message,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn concurrency\n}\n', source: 'out/go/workflows/concurrency-rr.go', blocks: { concurrency_strategy_with_key: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/dag-with-conditions.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/dag-with-conditions.ts index f33e23ba6..0e82baae1 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/dag-with-conditions.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/dag-with-conditions.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'fmt'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype DagWithConditionsInput struct {\n\tMessage string\n}\n\ntype DagWithConditionsResult struct {\n\tStep1 SimpleOutput\n\tStep2 SimpleOutput\n}\n\ntype conditionOpts = create.WorkflowTask[DagWithConditionsInput, DagWithConditionsResult]\n\nfunc DagWithConditionsWorkflow(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[DagWithConditionsInput, DagWithConditionsResult] {\n\n\tsimple := factory.NewWorkflow[DagWithConditionsInput, DagWithConditionsResult](\n\t\tcreate.WorkflowCreateOpts[DagWithConditionsInput]{\n\t\t\tName: 'simple-dag',\n\t\t},\n\t\thatchet,\n\t)\n\n\tstep1 := simple.Task(\n\t\tconditionOpts{\n\t\t\tName: 'Step1',\n\t\t}, func(ctx worker.HatchetContext, input DagWithConditionsInput) (interface{}, error) {\n\t\t\treturn &SimpleOutput{\n\t\t\t\tStep: 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\tsimple.Task(\n\t\tconditionOpts{\n\t\t\tName: 'Step2',\n\t\t\tParents: []create.NamedTask{\n\t\t\t\tstep1,\n\t\t\t},\n\t\t}, func(ctx worker.HatchetContext, input DagWithConditionsInput) (interface{}, error) {\n\n\t\t\tvar step1Output SimpleOutput\n\t\t\terr := ctx.ParentOutput(step1, &step1Output)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tfmt.Println(step1Output.Step)\n\n\t\t\treturn &SimpleOutput{\n\t\t\t\tStep: 2,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\treturn simple\n}\n", + 'package v1_workflows\n\nimport (\n\t"fmt"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype DagWithConditionsInput struct {\n\tMessage string\n}\n\ntype DagWithConditionsResult struct {\n\tStep1 SimpleOutput\n\tStep2 SimpleOutput\n}\n\ntype conditionOpts = create.WorkflowTask[DagWithConditionsInput, DagWithConditionsResult]\n\nfunc DagWithConditionsWorkflow(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[DagWithConditionsInput, DagWithConditionsResult] {\n\n\tsimple := factory.NewWorkflow[DagWithConditionsInput, DagWithConditionsResult](\n\t\tcreate.WorkflowCreateOpts[DagWithConditionsInput]{\n\t\t\tName: "simple-dag",\n\t\t},\n\t\thatchet,\n\t)\n\n\tstep1 := simple.Task(\n\t\tconditionOpts{\n\t\t\tName: "Step1",\n\t\t}, func(ctx worker.HatchetContext, input DagWithConditionsInput) (interface{}, error) {\n\t\t\treturn &SimpleOutput{\n\t\t\t\tStep: 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\tsimple.Task(\n\t\tconditionOpts{\n\t\t\tName: "Step2",\n\t\t\tParents: []create.NamedTask{\n\t\t\t\tstep1,\n\t\t\t},\n\t\t}, func(ctx worker.HatchetContext, input DagWithConditionsInput) (interface{}, error) {\n\n\t\t\tvar step1Output SimpleOutput\n\t\t\terr := ctx.ParentOutput(step1, &step1Output)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tfmt.Println(step1Output.Step)\n\n\t\t\treturn &SimpleOutput{\n\t\t\t\tStep: 2,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\treturn simple\n}\n', source: 'out/go/workflows/dag-with-conditions.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/dag.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/dag.ts index cfb4c8f16..e54cb6ccd 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/dag.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/dag.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype DagInput struct {\n\tMessage string\n}\n\ntype SimpleOutput struct {\n\tStep int\n}\n\ntype DagResult struct {\n\tStep1 SimpleOutput\n\tStep2 SimpleOutput\n}\n\nfunc DagWorkflow(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[DagInput, DagResult] {\n\t// > Declaring a Workflow\n\tsimple := factory.NewWorkflow[DagInput, DagResult](\n\t\tcreate.WorkflowCreateOpts[DagInput]{\n\t\t\tName: 'simple-dag',\n\t\t},\n\t\thatchet,\n\t)\n\n\t// > Defining a Task\n\tsimple.Task(\n\t\tcreate.WorkflowTask[DagInput, DagResult]{\n\t\t\tName: 'step',\n\t\t}, func(ctx worker.HatchetContext, input DagInput) (interface{}, error) {\n\t\t\treturn &SimpleOutput{\n\t\t\t\tStep: 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\t// > Adding a Task with a parent\n\tstep1 := simple.Task(\n\t\tcreate.WorkflowTask[DagInput, DagResult]{\n\t\t\tName: 'step-1',\n\t\t}, func(ctx worker.HatchetContext, input DagInput) (interface{}, error) {\n\t\t\treturn &SimpleOutput{\n\t\t\t\tStep: 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\tsimple.Task(\n\t\tcreate.WorkflowTask[DagInput, DagResult]{\n\t\t\tName: 'step-2',\n\t\t\tParents: []create.NamedTask{\n\t\t\t\tstep1,\n\t\t\t},\n\t\t}, func(ctx worker.HatchetContext, input DagInput) (interface{}, error) {\n\t\t\t// Get the output of the parent task\n\t\t\tvar step1Output SimpleOutput\n\t\t\terr := ctx.ParentOutput(step1, &step1Output)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn &SimpleOutput{\n\t\t\t\tStep: 2,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\treturn simple\n}\n", + 'package v1_workflows\n\nimport (\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype DagInput struct {\n\tMessage string\n}\n\ntype SimpleOutput struct {\n\tStep int\n}\n\ntype DagResult struct {\n\tStep1 SimpleOutput\n\tStep2 SimpleOutput\n}\n\nfunc DagWorkflow(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[DagInput, DagResult] {\n\t// > Declaring a Workflow\n\tsimple := factory.NewWorkflow[DagInput, DagResult](\n\t\tcreate.WorkflowCreateOpts[DagInput]{\n\t\t\tName: "simple-dag",\n\t\t},\n\t\thatchet,\n\t)\n\n\t// > Defining a Task\n\tsimple.Task(\n\t\tcreate.WorkflowTask[DagInput, DagResult]{\n\t\t\tName: "step",\n\t\t}, func(ctx worker.HatchetContext, input DagInput) (interface{}, error) {\n\t\t\treturn &SimpleOutput{\n\t\t\t\tStep: 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\t// > Adding a Task with a parent\n\tstep1 := simple.Task(\n\t\tcreate.WorkflowTask[DagInput, DagResult]{\n\t\t\tName: "step-1",\n\t\t}, func(ctx worker.HatchetContext, input DagInput) (interface{}, error) {\n\t\t\treturn &SimpleOutput{\n\t\t\t\tStep: 1,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\tsimple.Task(\n\t\tcreate.WorkflowTask[DagInput, DagResult]{\n\t\t\tName: "step-2",\n\t\t\tParents: []create.NamedTask{\n\t\t\t\tstep1,\n\t\t\t},\n\t\t}, func(ctx worker.HatchetContext, input DagInput) (interface{}, error) {\n\t\t\t// Get the output of the parent task\n\t\t\tvar step1Output SimpleOutput\n\t\t\terr := ctx.ParentOutput(step1, &step1Output)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn &SimpleOutput{\n\t\t\t\tStep: 2,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\treturn simple\n}\n', source: 'out/go/workflows/dag.go', blocks: { declaring_a_workflow: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/durable-event.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/durable-event.ts index 9128bd4be..83c66bb5a 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/durable-event.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/durable-event.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype DurableEventInput struct {\n\tMessage string\n}\n\ntype EventData struct {\n\tMessage string\n}\n\ntype DurableEventOutput struct {\n\tData EventData\n}\n\nfunc DurableEvent(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[DurableEventInput, DurableEventOutput] {\n\t// > Durable Event\n\tdurableEventTask := factory.NewDurableTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'durable-event',\n\t\t},\n\t\tfunc(ctx worker.DurableHatchetContext, input DurableEventInput) (*DurableEventOutput, error) {\n\t\t\teventData, err := ctx.WaitForEvent('user:update', '')\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tv := EventData{}\n\t\t\terr = eventData.Unmarshal(&v)\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn &DurableEventOutput{\n\t\t\t\tData: v,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\tfactory.NewDurableTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'durable-event',\n\t\t},\n\t\tfunc(ctx worker.DurableHatchetContext, input DurableEventInput) (*DurableEventOutput, error) {\n\t\t\t// > Durable Event With Filter\n\t\t\teventData, err := ctx.WaitForEvent('user:update', 'input.user_id == '1234'')\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tv := EventData{}\n\t\t\terr = eventData.Unmarshal(&v)\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn &DurableEventOutput{\n\t\t\t\tData: v,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn durableEventTask\n}\n", + 'package v1_workflows\n\nimport (\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype DurableEventInput struct {\n\tMessage string\n}\n\ntype EventData struct {\n\tMessage string\n}\n\ntype DurableEventOutput struct {\n\tData EventData\n}\n\nfunc DurableEvent(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[DurableEventInput, DurableEventOutput] {\n\t// > Durable Event\n\tdurableEventTask := factory.NewDurableTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "durable-event",\n\t\t},\n\t\tfunc(ctx worker.DurableHatchetContext, input DurableEventInput) (*DurableEventOutput, error) {\n\t\t\teventData, err := ctx.WaitForEvent("user:update", "")\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tv := EventData{}\n\t\t\terr = eventData.Unmarshal(&v)\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn &DurableEventOutput{\n\t\t\t\tData: v,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\tfactory.NewDurableTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "durable-event",\n\t\t},\n\t\tfunc(ctx worker.DurableHatchetContext, input DurableEventInput) (*DurableEventOutput, error) {\n\t\t\t// > Durable Event With Filter\n\t\t\teventData, err := ctx.WaitForEvent("user:update", "input.user_id == \'1234\'")\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tv := EventData{}\n\t\t\terr = eventData.Unmarshal(&v)\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn &DurableEventOutput{\n\t\t\t\tData: v,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn durableEventTask\n}\n', source: 'out/go/workflows/durable-event.go', blocks: { durable_event: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/durable-sleep.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/durable-sleep.ts index 904c86c97..6f075a3b2 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/durable-sleep.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/durable-sleep.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'strings'\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype DurableSleepInput struct {\n\tMessage string\n}\n\ntype DurableSleepOutput struct {\n\tTransformedMessage string\n}\n\nfunc DurableSleep(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[DurableSleepInput, DurableSleepOutput] {\n\t// > Durable Sleep\n\tsimple := factory.NewDurableTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'durable-sleep',\n\t\t},\n\t\tfunc(ctx worker.DurableHatchetContext, input DurableSleepInput) (*DurableSleepOutput, error) {\n\t\t\t_, err := ctx.SleepFor(10 * time.Second)\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn &DurableSleepOutput{\n\t\t\t\tTransformedMessage: strings.ToLower(input.Message),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn simple\n}\n", + 'package v1_workflows\n\nimport (\n\t"strings"\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype DurableSleepInput struct {\n\tMessage string\n}\n\ntype DurableSleepOutput struct {\n\tTransformedMessage string\n}\n\nfunc DurableSleep(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[DurableSleepInput, DurableSleepOutput] {\n\t// > Durable Sleep\n\tsimple := factory.NewDurableTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "durable-sleep",\n\t\t},\n\t\tfunc(ctx worker.DurableHatchetContext, input DurableSleepInput) (*DurableSleepOutput, error) {\n\t\t\t_, err := ctx.SleepFor(10 * time.Second)\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn &DurableSleepOutput{\n\t\t\t\tTransformedMessage: strings.ToLower(input.Message),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn simple\n}\n', source: 'out/go/workflows/durable-sleep.go', blocks: { durable_sleep: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/non-retryable-error.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/non-retryable-error.ts index 0a23eef1e..fc5b1b59f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/non-retryable-error.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/non-retryable-error.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'errors'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype NonRetryableInput struct{}\ntype NonRetryableResult struct{}\n\n// NonRetryableError returns a workflow which throws a non-retryable error\nfunc NonRetryableError(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[NonRetryableInput, NonRetryableResult] {\n\t// > Non Retryable Error\n\tretries := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'non-retryable-task',\n\t\t\tRetries: 3,\n\t\t}, func(ctx worker.HatchetContext, input NonRetryableInput) (*NonRetryableResult, error) {\n\t\t\treturn nil, worker.NewNonRetryableError(errors.New('intentional failure'))\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn retries\n}\n", + 'package v1_workflows\n\nimport (\n\t"errors"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype NonRetryableInput struct{}\ntype NonRetryableResult struct{}\n\n// NonRetryableError returns a workflow which throws a non-retryable error\nfunc NonRetryableError(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[NonRetryableInput, NonRetryableResult] {\n\t// > Non Retryable Error\n\tretries := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "non-retryable-task",\n\t\t\tRetries: 3,\n\t\t}, func(ctx worker.HatchetContext, input NonRetryableInput) (*NonRetryableResult, error) {\n\t\t\treturn nil, worker.NewNonRetryableError(errors.New("intentional failure"))\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn retries\n}\n', source: 'out/go/workflows/non-retryable-error.go', blocks: { non_retryable_error: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/on-cron.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/on-cron.ts index cbb9d37f1..1c39a5b0b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/on-cron.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/on-cron.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'strings'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype OnCronInput struct {\n\tMessage string `json:'Message'`\n}\n\ntype JobResult struct {\n\tTransformedMessage string `json:'TransformedMessage'`\n}\n\ntype OnCronOutput struct {\n\tJob JobResult `json:'job'`\n}\n\n// > Workflow Definition Cron Trigger\nfunc OnCron(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[OnCronInput, OnCronOutput] {\n\t// Create a standalone task that transforms a message\n\tcronTask := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'on-cron-task',\n\t\t\t// 👀 add a cron expression\n\t\t\tOnCron: []string{'0 0 * * *'}, // Run every day at midnight\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input OnCronInput) (*OnCronOutput, error) {\n\t\t\treturn &OnCronOutput{\n\t\t\t\tJob: JobResult{\n\t\t\t\t\tTransformedMessage: strings.ToLower(input.Message),\n\t\t\t\t},\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn cronTask\n}\n\n", + 'package v1_workflows\n\nimport (\n\t"strings"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype OnCronInput struct {\n\tMessage string `json:"Message"`\n}\n\ntype JobResult struct {\n\tTransformedMessage string `json:"TransformedMessage"`\n}\n\ntype OnCronOutput struct {\n\tJob JobResult `json:"job"`\n}\n\n// > Workflow Definition Cron Trigger\nfunc OnCron(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[OnCronInput, OnCronOutput] {\n\t// Create a standalone task that transforms a message\n\tcronTask := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "on-cron-task",\n\t\t\t// 👀 add a cron expression\n\t\t\tOnCron: []string{"0 0 * * *"}, // Run every day at midnight\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input OnCronInput) (*OnCronOutput, error) {\n\t\t\treturn &OnCronOutput{\n\t\t\t\tJob: JobResult{\n\t\t\t\t\tTransformedMessage: strings.ToLower(input.Message),\n\t\t\t\t},\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn cronTask\n}\n\n', source: 'out/go/workflows/on-cron.go', blocks: { workflow_definition_cron_trigger: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/on-event.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/on-event.ts index 0403a4278..4fc84a1f1 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/on-event.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/on-event.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'strings'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype EventInput struct {\n\tMessage string\n}\n\ntype LowerTaskOutput struct {\n\tTransformedMessage string\n}\n\ntype UpperTaskOutput struct {\n\tTransformedMessage string\n}\n\n// > Run workflow on event\nconst SimpleEvent = 'simple-event:create'\n\nfunc Lower(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[EventInput, LowerTaskOutput] {\n\treturn factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'lower',\n\t\t\t// 👀 Declare the event that will trigger the workflow\n\t\t\tOnEvents: []string{SimpleEvent},\n\t\t}, func(ctx worker.HatchetContext, input EventInput) (*LowerTaskOutput, error) {\n\t\t\t// Transform the input message to lowercase\n\t\t\treturn &LowerTaskOutput{\n\t\t\t\tTransformedMessage: strings.ToLower(input.Message),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n}\n\n\nfunc Upper(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[EventInput, UpperTaskOutput] {\n\treturn factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'upper',\n\t\t\tOnEvents: []string{SimpleEvent},\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input EventInput) (*UpperTaskOutput, error) {\n\t\t\treturn &UpperTaskOutput{\n\t\t\t\tTransformedMessage: strings.ToUpper(input.Message),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n}\n", + 'package v1_workflows\n\nimport (\n\t"strings"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype EventInput struct {\n\tMessage string\n}\n\ntype LowerTaskOutput struct {\n\tTransformedMessage string\n}\n\ntype UpperTaskOutput struct {\n\tTransformedMessage string\n}\n\n// > Run workflow on event\nconst SimpleEvent = "simple-event:create"\n\nfunc Lower(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[EventInput, LowerTaskOutput] {\n\treturn factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "lower",\n\t\t\t// 👀 Declare the event that will trigger the workflow\n\t\t\tOnEvents: []string{SimpleEvent},\n\t\t}, func(ctx worker.HatchetContext, input EventInput) (*LowerTaskOutput, error) {\n\t\t\t// Transform the input message to lowercase\n\t\t\treturn &LowerTaskOutput{\n\t\t\t\tTransformedMessage: strings.ToLower(input.Message),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n}\n\n\nfunc Upper(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[EventInput, UpperTaskOutput] {\n\treturn factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "upper",\n\t\t\tOnEvents: []string{SimpleEvent},\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input EventInput) (*UpperTaskOutput, error) {\n\t\t\treturn &UpperTaskOutput{\n\t\t\t\tTransformedMessage: strings.ToUpper(input.Message),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n}\n', source: 'out/go/workflows/on-event.go', blocks: { run_workflow_on_event: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/on-failure.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/on-failure.ts index 5ceaf42bf..521c707ce 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/on-failure.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/on-failure.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'errors'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype AlwaysFailsOutput struct {\n\tTransformedMessage string\n}\n\ntype OnFailureOutput struct {\n\tFailureRan bool\n}\n\ntype OnFailureSuccessResult struct {\n\tAlwaysFails AlwaysFailsOutput\n}\n\nfunc OnFailure(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[any, OnFailureSuccessResult] {\n\n\tsimple := factory.NewWorkflow[any, OnFailureSuccessResult](\n\t\tcreate.WorkflowCreateOpts[any]{\n\t\t\tName: 'on-failure',\n\t\t},\n\t\thatchet,\n\t)\n\n\tsimple.Task(\n\t\tcreate.WorkflowTask[any, OnFailureSuccessResult]{\n\t\t\tName: 'AlwaysFails',\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ any) (interface{}, error) {\n\t\t\treturn &AlwaysFailsOutput{\n\t\t\t\tTransformedMessage: 'always fails',\n\t\t\t}, errors.New('always fails')\n\t\t},\n\t)\n\n\tsimple.OnFailure(\n\t\tcreate.WorkflowOnFailureTask[any, OnFailureSuccessResult]{},\n\t\tfunc(ctx worker.HatchetContext, _ any) (interface{}, error) {\n\t\t\treturn &OnFailureOutput{\n\t\t\t\tFailureRan: true,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\treturn simple\n}\n", + 'package v1_workflows\n\nimport (\n\t"errors"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype AlwaysFailsOutput struct {\n\tTransformedMessage string\n}\n\ntype OnFailureOutput struct {\n\tFailureRan bool\n}\n\ntype OnFailureSuccessResult struct {\n\tAlwaysFails AlwaysFailsOutput\n}\n\nfunc OnFailure(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[any, OnFailureSuccessResult] {\n\n\tsimple := factory.NewWorkflow[any, OnFailureSuccessResult](\n\t\tcreate.WorkflowCreateOpts[any]{\n\t\t\tName: "on-failure",\n\t\t},\n\t\thatchet,\n\t)\n\n\tsimple.Task(\n\t\tcreate.WorkflowTask[any, OnFailureSuccessResult]{\n\t\t\tName: "AlwaysFails",\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, _ any) (interface{}, error) {\n\t\t\treturn &AlwaysFailsOutput{\n\t\t\t\tTransformedMessage: "always fails",\n\t\t\t}, errors.New("always fails")\n\t\t},\n\t)\n\n\tsimple.OnFailure(\n\t\tcreate.WorkflowOnFailureTask[any, OnFailureSuccessResult]{},\n\t\tfunc(ctx worker.HatchetContext, _ any) (interface{}, error) {\n\t\t\treturn &OnFailureOutput{\n\t\t\t\tFailureRan: true,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\treturn simple\n}\n', source: 'out/go/workflows/on-failure.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/priority.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/priority.ts index dd0cfe1eb..3f1c80a79 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/priority.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/priority.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype PriorityInput struct {\n\tUserId string `json:'userId'`\n}\n\ntype PriorityOutput struct {\n\tTransformedMessage string `json:'TransformedMessage'`\n}\n\ntype Result struct {\n\tStep PriorityOutput\n}\n\nfunc Priority(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[PriorityInput, Result] {\n\t// Create a standalone task that transforms a message\n\n\t// > Default priority\n\tdefaultPriority := int32(1)\n\n\tworkflow := factory.NewWorkflow[PriorityInput, Result](\n\t\tcreate.WorkflowCreateOpts[PriorityInput]{\n\t\t\tName: 'priority',\n\t\t\tDefaultPriority: &defaultPriority,\n\t\t},\n\t\thatchet,\n\t)\n\n\t// > Defining a Task\n\tworkflow.Task(\n\t\tcreate.WorkflowTask[PriorityInput, Result]{\n\t\t\tName: 'step',\n\t\t}, func(ctx worker.HatchetContext, input PriorityInput) (interface{}, error) {\n\t\t\ttime.Sleep(time.Second * 5)\n\t\t\treturn &PriorityOutput{\n\t\t\t\tTransformedMessage: input.UserId,\n\t\t\t}, nil\n\t\t},\n\t)\n\treturn workflow\n}\n\n", + 'package v1_workflows\n\nimport (\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype PriorityInput struct {\n\tUserId string `json:"userId"`\n}\n\ntype PriorityOutput struct {\n\tTransformedMessage string `json:"TransformedMessage"`\n}\n\ntype Result struct {\n\tStep PriorityOutput\n}\n\nfunc Priority(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[PriorityInput, Result] {\n\t// Create a standalone task that transforms a message\n\n\t// > Default priority\n\tdefaultPriority := int32(1)\n\n\tworkflow := factory.NewWorkflow[PriorityInput, Result](\n\t\tcreate.WorkflowCreateOpts[PriorityInput]{\n\t\t\tName: "priority",\n\t\t\tDefaultPriority: &defaultPriority,\n\t\t},\n\t\thatchet,\n\t)\n\n\t// > Defining a Task\n\tworkflow.Task(\n\t\tcreate.WorkflowTask[PriorityInput, Result]{\n\t\t\tName: "step",\n\t\t}, func(ctx worker.HatchetContext, input PriorityInput) (interface{}, error) {\n\t\t\ttime.Sleep(time.Second * 5)\n\t\t\treturn &PriorityOutput{\n\t\t\t\tTransformedMessage: input.UserId,\n\t\t\t}, nil\n\t\t},\n\t)\n\treturn workflow\n}\n\n', source: 'out/go/workflows/priority.go', blocks: { default_priority: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/ratelimit.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/ratelimit.ts index 3ac29751b..6fb02c7ad 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/ratelimit.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/ratelimit.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'strings'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\t'github.com/hatchet-dev/hatchet/pkg/client/types'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/features'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype RateLimitInput struct {\n\tUserId string `json:'userId'`\n}\n\ntype RateLimitOutput struct {\n\tTransformedMessage string `json:'TransformedMessage'`\n}\n\nfunc upsertRateLimit(hatchet v1.HatchetClient) {\n\t// > Upsert Rate Limit\n\thatchet.RateLimits().Upsert(\n\t\tfeatures.CreateRatelimitOpts{\n\t\t\tKey: 'api-service-rate-limit',\n\t\t\tLimit: 10,\n\t\t\tDuration: types.Second,\n\t\t},\n\t)\n}\n\n// > Static Rate Limit\nfunc StaticRateLimit(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[RateLimitInput, RateLimitOutput] {\n\t// Create a standalone task that transforms a message\n\n\t// define the parameters for the rate limit\n\trateLimitKey := 'api-service-rate-limit'\n\tunits := 1\n\n\trateLimitTask := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'rate-limit-task',\n\t\t\t// 👀 add a static rate limit\n\t\t\tRateLimits: []*types.RateLimit{\n\t\t\t\t{\n\t\t\t\t\tKey: rateLimitKey,\n\t\t\t\t\tUnits: &units,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input RateLimitInput) (*RateLimitOutput, error) {\n\t\t\treturn &RateLimitOutput{\n\t\t\t\tTransformedMessage: strings.ToLower(input.UserId),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn rateLimitTask\n}\n\n\n// > Dynamic Rate Limit\nfunc RateLimit(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[RateLimitInput, RateLimitOutput] {\n\t// Create a standalone task that transforms a message\n\n\t// define the parameters for the rate limit\n\texpression := 'input.userId'\n\tunits := 1\n\tduration := types.Second\n\n\trateLimitTask := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'rate-limit-task',\n\t\t\t// 👀 add a dynamic rate limit\n\t\t\tRateLimits: []*types.RateLimit{\n\t\t\t\t{\n\t\t\t\t\tKeyExpr: &expression,\n\t\t\t\t\tUnits: &units,\n\t\t\t\t\tDuration: &duration,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input RateLimitInput) (*RateLimitOutput, error) {\n\t\t\treturn &RateLimitOutput{\n\t\t\t\tTransformedMessage: strings.ToLower(input.UserId),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn rateLimitTask\n}\n\n", + 'package v1_workflows\n\nimport (\n\t"strings"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\t"github.com/hatchet-dev/hatchet/pkg/client/types"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/features"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype RateLimitInput struct {\n\tUserId string `json:"userId"`\n}\n\ntype RateLimitOutput struct {\n\tTransformedMessage string `json:"TransformedMessage"`\n}\n\nfunc upsertRateLimit(hatchet v1.HatchetClient) {\n\t// > Upsert Rate Limit\n\thatchet.RateLimits().Upsert(\n\t\tfeatures.CreateRatelimitOpts{\n\t\t\tKey: "api-service-rate-limit",\n\t\t\tLimit: 10,\n\t\t\tDuration: types.Second,\n\t\t},\n\t)\n}\n\n// > Static Rate Limit\nfunc StaticRateLimit(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[RateLimitInput, RateLimitOutput] {\n\t// Create a standalone task that transforms a message\n\n\t// define the parameters for the rate limit\n\trateLimitKey := "api-service-rate-limit"\n\tunits := 1\n\n\trateLimitTask := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "rate-limit-task",\n\t\t\t// 👀 add a static rate limit\n\t\t\tRateLimits: []*types.RateLimit{\n\t\t\t\t{\n\t\t\t\t\tKey: rateLimitKey,\n\t\t\t\t\tUnits: &units,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input RateLimitInput) (*RateLimitOutput, error) {\n\t\t\treturn &RateLimitOutput{\n\t\t\t\tTransformedMessage: strings.ToLower(input.UserId),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn rateLimitTask\n}\n\n\n// > Dynamic Rate Limit\nfunc RateLimit(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[RateLimitInput, RateLimitOutput] {\n\t// Create a standalone task that transforms a message\n\n\t// define the parameters for the rate limit\n\texpression := "input.userId"\n\tunits := 1\n\tduration := types.Second\n\n\trateLimitTask := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "rate-limit-task",\n\t\t\t// 👀 add a dynamic rate limit\n\t\t\tRateLimits: []*types.RateLimit{\n\t\t\t\t{\n\t\t\t\t\tKeyExpr: &expression,\n\t\t\t\t\tUnits: &units,\n\t\t\t\t\tDuration: &duration,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input RateLimitInput) (*RateLimitOutput, error) {\n\t\t\treturn &RateLimitOutput{\n\t\t\t\tTransformedMessage: strings.ToLower(input.UserId),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn rateLimitTask\n}\n\n', source: 'out/go/workflows/ratelimit.go', blocks: { upsert_rate_limit: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/retries.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/retries.ts index f92cd6835..79a6fd388 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/retries.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/retries.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'errors'\n\t'fmt'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype RetriesInput struct{}\ntype RetriesResult struct{}\n\n// Simple retries example that always fails\nfunc Retries(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[RetriesInput, RetriesResult] {\n\t// > Simple Step Retries\n\tretries := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'retries-task',\n\t\t\tRetries: 3,\n\t\t}, func(ctx worker.HatchetContext, input RetriesInput) (*RetriesResult, error) {\n\t\t\treturn nil, errors.New('intentional failure')\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn retries\n}\n\ntype RetriesWithCountInput struct{}\ntype RetriesWithCountResult struct {\n\tMessage string `json:'message'`\n}\n\n// Retries example that succeeds after a certain number of retries\nfunc RetriesWithCount(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[RetriesWithCountInput, RetriesWithCountResult] {\n\t// > Retries with Count\n\tretriesWithCount := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'fail-twice-task',\n\t\t\tRetries: 3,\n\t\t}, func(ctx worker.HatchetContext, input RetriesWithCountInput) (*RetriesWithCountResult, error) {\n\t\t\t// Get the current retry count\n\t\t\tretryCount := ctx.RetryCount()\n\n\t\t\tfmt.Printf('Retry count: %d\\n', retryCount)\n\n\t\t\tif retryCount < 2 {\n\t\t\t\treturn nil, errors.New('intentional failure')\n\t\t\t}\n\n\t\t\treturn &RetriesWithCountResult{\n\t\t\t\tMessage: 'success',\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn retriesWithCount\n}\n\ntype BackoffInput struct{}\ntype BackoffResult struct{}\n\n// Retries example with simple backoff (no configuration in this API version)\nfunc WithBackoff(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[BackoffInput, BackoffResult] {\n\t// > Retries with Backoff\n\twithBackoff := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'with-backoff-task',\n\t\t\t// 👀 Maximum number of seconds to wait between retries\n\t\t\tRetries: 3,\n\t\t\t// 👀 Factor to increase the wait time between retries.\n\t\t\tRetryBackoffFactor: 2,\n\t\t\t// 👀 Maximum number of seconds to wait between retries\n\t\t\t// This sequence will be 2s, 4s, 8s, 10s, 10s, 10s... due to the maxSeconds limit\n\t\t\tRetryMaxBackoffSeconds: 10,\n\t\t}, func(ctx worker.HatchetContext, input BackoffInput) (*BackoffResult, error) {\n\t\t\treturn nil, errors.New('intentional failure')\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn withBackoff\n}\n", + 'package v1_workflows\n\nimport (\n\t"errors"\n\t"fmt"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype RetriesInput struct{}\ntype RetriesResult struct{}\n\n// Simple retries example that always fails\nfunc Retries(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[RetriesInput, RetriesResult] {\n\t// > Simple Step Retries\n\tretries := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "retries-task",\n\t\t\tRetries: 3,\n\t\t}, func(ctx worker.HatchetContext, input RetriesInput) (*RetriesResult, error) {\n\t\t\treturn nil, errors.New("intentional failure")\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn retries\n}\n\ntype RetriesWithCountInput struct{}\ntype RetriesWithCountResult struct {\n\tMessage string `json:"message"`\n}\n\n// Retries example that succeeds after a certain number of retries\nfunc RetriesWithCount(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[RetriesWithCountInput, RetriesWithCountResult] {\n\t// > Retries with Count\n\tretriesWithCount := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "fail-twice-task",\n\t\t\tRetries: 3,\n\t\t}, func(ctx worker.HatchetContext, input RetriesWithCountInput) (*RetriesWithCountResult, error) {\n\t\t\t// Get the current retry count\n\t\t\tretryCount := ctx.RetryCount()\n\n\t\t\tfmt.Printf("Retry count: %d\\n", retryCount)\n\n\t\t\tif retryCount < 2 {\n\t\t\t\treturn nil, errors.New("intentional failure")\n\t\t\t}\n\n\t\t\treturn &RetriesWithCountResult{\n\t\t\t\tMessage: "success",\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn retriesWithCount\n}\n\ntype BackoffInput struct{}\ntype BackoffResult struct{}\n\n// Retries example with simple backoff (no configuration in this API version)\nfunc WithBackoff(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[BackoffInput, BackoffResult] {\n\t// > Retries with Backoff\n\twithBackoff := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "with-backoff-task",\n\t\t\t// 👀 Maximum number of seconds to wait between retries\n\t\t\tRetries: 3,\n\t\t\t// 👀 Factor to increase the wait time between retries.\n\t\t\tRetryBackoffFactor: 2,\n\t\t\t// 👀 Maximum number of seconds to wait between retries\n\t\t\t// This sequence will be 2s, 4s, 8s, 10s, 10s, 10s... due to the maxSeconds limit\n\t\t\tRetryMaxBackoffSeconds: 10,\n\t\t}, func(ctx worker.HatchetContext, input BackoffInput) (*BackoffResult, error) {\n\t\t\treturn nil, errors.New("intentional failure")\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn withBackoff\n}\n', source: 'out/go/workflows/retries.go', blocks: { simple_step_retries: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/simple.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/simple.ts index de51c4399..a7a25aa5f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/simple.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/simple.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'context'\n\t'fmt'\n\t'strings'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\tv1worker 'github.com/hatchet-dev/hatchet/pkg/v1/worker'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype SimpleInput struct {\n\tMessage string\n}\ntype SimpleResult struct {\n\tTransformedMessage string\n}\n\nfunc Simple(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[SimpleInput, SimpleResult] {\n\n\t// Create a simple standalone task using the task factory\n\t// Note the use of typed generics for both input and output\n\n\t// > Declaring a Task\n\tsimple := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'simple-task',\n\t\t}, func(ctx worker.HatchetContext, input SimpleInput) (*SimpleResult, error) {\n\t\t\t// Transform the input message to lowercase\n\t\t\treturn &SimpleResult{\n\t\t\t\tTransformedMessage: strings.ToLower(input.Message),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\t// Example of running a task\n\t_ = func() error {\n\t\t// > Running a Task\n\t\tresult, err := simple.Run(context.Background(), SimpleInput{Message: 'Hello, World!'})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Println(result.TransformedMessage)\n\t\treturn nil\n\t}\n\n\t// Example of registering a task on a worker\n\t_ = func() error {\n\t\t// > Declaring a Worker\n\t\tw, err := hatchet.Worker(v1worker.WorkerOpts{\n\t\t\tName: 'simple-worker',\n\t\t\tWorkflows: []workflow.WorkflowBase{\n\t\t\t\tsimple,\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = w.StartBlocking(context.Background())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\treturn simple\n}\n\nfunc ParentTask(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[SimpleInput, SimpleResult] {\n\n\t// > Spawning Tasks from within a Task\n\tsimple := Simple(hatchet)\n\n\tparent := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'parent-task',\n\t\t}, func(ctx worker.HatchetContext, input SimpleInput) (*SimpleResult, error) {\n\n\t\t\t// Run the child task\n\t\t\tchild, err := workflow.RunChildWorkflow(ctx, simple, SimpleInput{Message: input.Message})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\t// Transform the input message to lowercase\n\t\t\treturn &SimpleResult{\n\t\t\t\tTransformedMessage: child.TransformedMessage,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn parent\n}\n", + 'package v1_workflows\n\nimport (\n\t"context"\n\t"fmt"\n\t"strings"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\tv1worker "github.com/hatchet-dev/hatchet/pkg/v1/worker"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype SimpleInput struct {\n\tMessage string\n}\ntype SimpleResult struct {\n\tTransformedMessage string\n}\n\nfunc Simple(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[SimpleInput, SimpleResult] {\n\n\t// Create a simple standalone task using the task factory\n\t// Note the use of typed generics for both input and output\n\n\t// > Declaring a Task\n\tsimple := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "simple-task",\n\t\t}, func(ctx worker.HatchetContext, input SimpleInput) (*SimpleResult, error) {\n\t\t\t// Transform the input message to lowercase\n\t\t\treturn &SimpleResult{\n\t\t\t\tTransformedMessage: strings.ToLower(input.Message),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\t// Example of running a task\n\t_ = func() error {\n\t\t// > Running a Task\n\t\tresult, err := simple.Run(context.Background(), SimpleInput{Message: "Hello, World!"})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Println(result.TransformedMessage)\n\t\treturn nil\n\t}\n\n\t// Example of registering a task on a worker\n\t_ = func() error {\n\t\t// > Declaring a Worker\n\t\tw, err := hatchet.Worker(v1worker.WorkerOpts{\n\t\t\tName: "simple-worker",\n\t\t\tWorkflows: []workflow.WorkflowBase{\n\t\t\t\tsimple,\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = w.StartBlocking(context.Background())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\treturn simple\n}\n\nfunc ParentTask(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[SimpleInput, SimpleResult] {\n\n\t// > Spawning Tasks from within a Task\n\tsimple := Simple(hatchet)\n\n\tparent := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "parent-task",\n\t\t}, func(ctx worker.HatchetContext, input SimpleInput) (*SimpleResult, error) {\n\n\t\t\t// Run the child task\n\t\t\tchild, err := workflow.RunChildWorkflow(ctx, simple, SimpleInput{Message: input.Message})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\t// Transform the input message to lowercase\n\t\t\treturn &SimpleResult{\n\t\t\t\tTransformedMessage: child.TransformedMessage,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn parent\n}\n', source: 'out/go/workflows/simple.go', blocks: { declaring_a_task: { @@ -24,6 +24,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/sticky.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/sticky.ts index 8cb630780..2aa162f6e 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/sticky.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/sticky.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'fmt'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype StickyInput struct{}\n\ntype StickyResult struct {\n\tResult string `json:'result'`\n}\n\ntype StickyDagResult struct {\n\tStickyTask1 StickyResult `json:'sticky-task-1'`\n\tStickyTask2 StickyResult `json:'sticky-task-2'`\n}\n\nfunc StickyDag(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[StickyInput, StickyDagResult] {\n\tstickyDag := factory.NewWorkflow[StickyInput, StickyDagResult](\n\t\tcreate.WorkflowCreateOpts[StickyInput]{\n\t\t\tName: 'sticky-dag',\n\t\t},\n\t\thatchet,\n\t)\n\n\tstickyDag.Task(\n\t\tcreate.WorkflowTask[StickyInput, StickyDagResult]{\n\t\t\tName: 'sticky-task',\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input StickyInput) (interface{}, error) {\n\t\t\tworkerId := ctx.Worker().ID()\n\n\t\t\treturn &StickyResult{\n\t\t\t\tResult: workerId,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\tstickyDag.Task(\n\t\tcreate.WorkflowTask[StickyInput, StickyDagResult]{\n\t\t\tName: 'sticky-task-2',\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input StickyInput) (interface{}, error) {\n\t\t\tworkerId := ctx.Worker().ID()\n\n\t\t\treturn &StickyResult{\n\t\t\t\tResult: workerId,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\treturn stickyDag\n}\n\nfunc Sticky(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[StickyInput, StickyResult] {\n\tsticky := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'sticky-task',\n\t\t\tRetries: 3,\n\t\t}, func(ctx worker.HatchetContext, input StickyInput) (*StickyResult, error) {\n\t\t\t// Run a child workflow on the same worker\n\t\t\tchildWorkflow := Child(hatchet)\n\t\t\tsticky := true\n\t\t\tchildResult, err := childWorkflow.RunAsChild(ctx, ChildInput{N: 1}, workflow.RunAsChildOpts{\n\t\t\t\tSticky: &sticky,\n\t\t\t})\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn &StickyResult{\n\t\t\t\tResult: fmt.Sprintf('child-result-%d', childResult.Value),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn sticky\n}\n", + 'package v1_workflows\n\nimport (\n\t"fmt"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype StickyInput struct{}\n\ntype StickyResult struct {\n\tResult string `json:"result"`\n}\n\ntype StickyDagResult struct {\n\tStickyTask1 StickyResult `json:"sticky-task-1"`\n\tStickyTask2 StickyResult `json:"sticky-task-2"`\n}\n\nfunc StickyDag(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[StickyInput, StickyDagResult] {\n\tstickyDag := factory.NewWorkflow[StickyInput, StickyDagResult](\n\t\tcreate.WorkflowCreateOpts[StickyInput]{\n\t\t\tName: "sticky-dag",\n\t\t},\n\t\thatchet,\n\t)\n\n\tstickyDag.Task(\n\t\tcreate.WorkflowTask[StickyInput, StickyDagResult]{\n\t\t\tName: "sticky-task",\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input StickyInput) (interface{}, error) {\n\t\t\tworkerId := ctx.Worker().ID()\n\n\t\t\treturn &StickyResult{\n\t\t\t\tResult: workerId,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\tstickyDag.Task(\n\t\tcreate.WorkflowTask[StickyInput, StickyDagResult]{\n\t\t\tName: "sticky-task-2",\n\t\t},\n\t\tfunc(ctx worker.HatchetContext, input StickyInput) (interface{}, error) {\n\t\t\tworkerId := ctx.Worker().ID()\n\n\t\t\treturn &StickyResult{\n\t\t\t\tResult: workerId,\n\t\t\t}, nil\n\t\t},\n\t)\n\n\treturn stickyDag\n}\n\nfunc Sticky(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[StickyInput, StickyResult] {\n\tsticky := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "sticky-task",\n\t\t\tRetries: 3,\n\t\t}, func(ctx worker.HatchetContext, input StickyInput) (*StickyResult, error) {\n\t\t\t// Run a child workflow on the same worker\n\t\t\tchildWorkflow := Child(hatchet)\n\t\t\tsticky := true\n\t\t\tchildResult, err := childWorkflow.RunAsChild(ctx, ChildInput{N: 1}, workflow.RunAsChildOpts{\n\t\t\t\tSticky: &sticky,\n\t\t\t})\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn &StickyResult{\n\t\t\t\tResult: fmt.Sprintf("child-result-%d", childResult.Value),\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn sticky\n}\n', source: 'out/go/workflows/sticky.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/timeouts.ts b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/timeouts.ts index a13c72d63..ff2d4a2b9 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/workflows/timeouts.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/workflows/timeouts.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package v1_workflows\n\nimport (\n\t'errors'\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client/create'\n\tv1 'github.com/hatchet-dev/hatchet/pkg/v1'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/factory'\n\t'github.com/hatchet-dev/hatchet/pkg/v1/workflow'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype TimeoutInput struct{}\ntype TimeoutResult struct {\n\tCompleted bool\n}\n\nfunc Timeout(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[TimeoutInput, TimeoutResult] {\n\n\t// > Execution Timeout\n\t// Create a task with a timeout of 3 seconds that tries to sleep for 10 seconds\n\ttimeout := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'timeout-task',\n\t\t\tExecutionTimeout: 3 * time.Second, // Task will timeout after 3 seconds\n\t\t}, func(ctx worker.HatchetContext, input TimeoutInput) (*TimeoutResult, error) {\n\t\t\t// Sleep for 10 seconds\n\t\t\ttime.Sleep(10 * time.Second)\n\n\t\t\t// Check if the context was cancelled due to timeout\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn nil, errors.New('TASK TIMED OUT')\n\t\t\tdefault:\n\t\t\t\t// Continue execution\n\t\t\t}\n\n\t\t\treturn &TimeoutResult{\n\t\t\t\tCompleted: true,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn timeout\n}\n\nfunc RefreshTimeout(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[TimeoutInput, TimeoutResult] {\n\n\t// > Refresh Timeout\n\ttimeout := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: 'timeout-task',\n\t\t\tExecutionTimeout: 3 * time.Second, // Task will timeout after 3 seconds\n\t\t}, func(ctx worker.HatchetContext, input TimeoutInput) (*TimeoutResult, error) {\n\n\t\t\t// Refresh the timeout by 10 seconds (new timeout will be 13 seconds)\n\t\t\tctx.RefreshTimeout('10s')\n\n\t\t\t// Sleep for 10 seconds\n\t\t\ttime.Sleep(10 * time.Second)\n\n\t\t\t// Check if the context was cancelled due to timeout\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn nil, errors.New('TASK TIMED OUT')\n\t\t\tdefault:\n\t\t\t\t// Continue execution\n\t\t\t}\n\n\t\t\treturn &TimeoutResult{\n\t\t\t\tCompleted: true,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn timeout\n}\n", + 'package v1_workflows\n\nimport (\n\t"errors"\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client/create"\n\tv1 "github.com/hatchet-dev/hatchet/pkg/v1"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/factory"\n\t"github.com/hatchet-dev/hatchet/pkg/v1/workflow"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype TimeoutInput struct{}\ntype TimeoutResult struct {\n\tCompleted bool\n}\n\nfunc Timeout(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[TimeoutInput, TimeoutResult] {\n\n\t// > Execution Timeout\n\t// Create a task with a timeout of 3 seconds that tries to sleep for 10 seconds\n\ttimeout := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "timeout-task",\n\t\t\tExecutionTimeout: 3 * time.Second, // Task will timeout after 3 seconds\n\t\t}, func(ctx worker.HatchetContext, input TimeoutInput) (*TimeoutResult, error) {\n\t\t\t// Sleep for 10 seconds\n\t\t\ttime.Sleep(10 * time.Second)\n\n\t\t\t// Check if the context was cancelled due to timeout\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn nil, errors.New("TASK TIMED OUT")\n\t\t\tdefault:\n\t\t\t\t// Continue execution\n\t\t\t}\n\n\t\t\treturn &TimeoutResult{\n\t\t\t\tCompleted: true,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn timeout\n}\n\nfunc RefreshTimeout(hatchet v1.HatchetClient) workflow.WorkflowDeclaration[TimeoutInput, TimeoutResult] {\n\n\t// > Refresh Timeout\n\ttimeout := factory.NewTask(\n\t\tcreate.StandaloneTask{\n\t\t\tName: "timeout-task",\n\t\t\tExecutionTimeout: 3 * time.Second, // Task will timeout after 3 seconds\n\t\t}, func(ctx worker.HatchetContext, input TimeoutInput) (*TimeoutResult, error) {\n\n\t\t\t// Refresh the timeout by 10 seconds (new timeout will be 13 seconds)\n\t\t\tctx.RefreshTimeout("10s")\n\n\t\t\t// Sleep for 10 seconds\n\t\t\ttime.Sleep(10 * time.Second)\n\n\t\t\t// Check if the context was cancelled due to timeout\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn nil, errors.New("TASK TIMED OUT")\n\t\t\tdefault:\n\t\t\t\t// Continue execution\n\t\t\t}\n\n\t\t\treturn &TimeoutResult{\n\t\t\t\tCompleted: true,\n\t\t\t}, nil\n\t\t},\n\t\thatchet,\n\t)\n\n\treturn timeout\n}\n', source: 'out/go/workflows/timeouts.go', blocks: { execution_timeout: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-affinity/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-affinity/main.ts index f9cec4546..f80457dfd 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-affinity/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-affinity/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tch := cmdutils.InterruptChan()\n\tcleanup, err := run()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('cleanup() error = %v', err))\n\t}\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tch := cmdutils.InterruptChan()\n\tcleanup, err := run()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("cleanup() error = %v", err))\n\t}\n}\n', source: 'out/go/z_v0/assignment-affinity/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-affinity/run.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-affinity/run.ts index 1019392b5..48f2045ef 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-affinity/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-affinity/run.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'log'\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/client/types'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\nfunc run() (func() error, error) {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t\tworker.WithLabels(map[string]interface{}{\n\t\t\t'model': 'fancy-ai-model-v2',\n\t\t\t'memory': 1024,\n\t\t}),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events('user:create:affinity'),\n\t\t\tName: 'affinity',\n\t\t\tDescription: 'affinity',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\n\t\t\t\t\tmodel := ctx.Worker().GetLabels()['model']\n\n\t\t\t\t\tif model != 'fancy-ai-model-v3' {\n\t\t\t\t\t\tctx.Worker().UpsertLabels(map[string]interface{}{\n\t\t\t\t\t\t\t'model': nil,\n\t\t\t\t\t\t})\n\t\t\t\t\t\t// Do something to load the model\n\t\t\t\t\t\tctx.Worker().UpsertLabels(map[string]interface{}{\n\t\t\t\t\t\t\t'model': 'fancy-ai-model-v3',\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: ctx.Worker().ID(),\n\t\t\t\t\t}, nil\n\t\t\t\t}).\n\t\t\t\t\tSetName('step-one').\n\t\t\t\t\tSetDesiredLabels(map[string]*types.DesiredWorkerLabel{\n\t\t\t\t\t\t'model': {\n\t\t\t\t\t\t\tValue: 'fancy-ai-model-v3',\n\t\t\t\t\t\t\tWeight: 10,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'memory': {\n\t\t\t\t\t\t\tValue: 512,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\tComparator: types.ComparatorPtr(types.WorkerLabelComparator_GREATER_THAN),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tgo func() {\n\t\tlog.Printf('pushing event')\n\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: 'echo-test',\n\t\t\tUserID: '1234',\n\t\t\tData: map[string]string{\n\t\t\t\t'test': 'test',\n\t\t\t},\n\t\t}\n\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t'user:create:affinity',\n\t\t\ttestEvent,\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error pushing event: %w', err))\n\t\t}\n\n\t\ttime.Sleep(10 * time.Second)\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error starting worker: %w', err)\n\t}\n\n\treturn cleanup, nil\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/client/types"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\nfunc run() (func() error, error) {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t\tworker.WithLabels(map[string]interface{}{\n\t\t\t"model": "fancy-ai-model-v2",\n\t\t\t"memory": 1024,\n\t\t}),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events("user:create:affinity"),\n\t\t\tName: "affinity",\n\t\t\tDescription: "affinity",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\n\t\t\t\t\tmodel := ctx.Worker().GetLabels()["model"]\n\n\t\t\t\t\tif model != "fancy-ai-model-v3" {\n\t\t\t\t\t\tctx.Worker().UpsertLabels(map[string]interface{}{\n\t\t\t\t\t\t\t"model": nil,\n\t\t\t\t\t\t})\n\t\t\t\t\t\t// Do something to load the model\n\t\t\t\t\t\tctx.Worker().UpsertLabels(map[string]interface{}{\n\t\t\t\t\t\t\t"model": "fancy-ai-model-v3",\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: ctx.Worker().ID(),\n\t\t\t\t\t}, nil\n\t\t\t\t}).\n\t\t\t\t\tSetName("step-one").\n\t\t\t\t\tSetDesiredLabels(map[string]*types.DesiredWorkerLabel{\n\t\t\t\t\t\t"model": {\n\t\t\t\t\t\t\tValue: "fancy-ai-model-v3",\n\t\t\t\t\t\t\tWeight: 10,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t"memory": {\n\t\t\t\t\t\t\tValue: 512,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\tComparator: types.ComparatorPtr(types.WorkerLabelComparator_GREATER_THAN),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tgo func() {\n\t\tlog.Printf("pushing event")\n\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: "echo-test",\n\t\t\tUserID: "1234",\n\t\t\tData: map[string]string{\n\t\t\t\t"test": "test",\n\t\t\t},\n\t\t}\n\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t"user:create:affinity",\n\t\t\ttestEvent,\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error pushing event: %w", err))\n\t\t}\n\n\t\ttime.Sleep(10 * time.Second)\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error starting worker: %w", err)\n\t}\n\n\treturn cleanup, nil\n}\n', source: 'out/go/z_v0/assignment-affinity/run.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-sticky/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-sticky/main.ts index a8feeca2b..9c6bfd497 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-sticky/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-sticky/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tch := cmdutils.InterruptChan()\n\tcleanup, err := run()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('cleanup() error = %v', err))\n\t}\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tch := cmdutils.InterruptChan()\n\tcleanup, err := run()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("cleanup() error = %v", err))\n\t}\n}\n', source: 'out/go/z_v0/assignment-sticky/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-sticky/run.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-sticky/run.ts index 84cdab5d2..03845af88 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-sticky/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/assignment-sticky/run.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'log'\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/client/types'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\nfunc run() (func() error, error) {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\t// > StickyWorker\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events('user:create:sticky'),\n\t\t\tName: 'sticky',\n\t\t\tDescription: 'sticky',\n\t\t\t// 👀 Specify a sticky strategy when declaring the workflow\n\t\t\tStickyStrategy: types.StickyStrategyPtr(types.StickyStrategy_HARD),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\n\t\t\t\t\tsticky := true\n\n\t\t\t\t\t_, err = ctx.SpawnWorkflow('sticky-child', nil, &worker.SpawnWorkflowOpts{\n\t\t\t\t\t\tSticky: &sticky,\n\t\t\t\t\t})\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf('error spawning workflow: %w', err)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: ctx.Worker().ID(),\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-one'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: ctx.Worker().ID(),\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-two').AddParents('step-one'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: ctx.Worker().ID(),\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-three').AddParents('step-two'),\n\t\t\t},\n\t\t},\n\t)\n\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\t// > StickyChild\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.NoTrigger(),\n\t\t\tName: 'sticky-child',\n\t\t\tDescription: 'sticky',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: ctx.Worker().ID(),\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tgo func() {\n\t\tlog.Printf('pushing event')\n\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: 'echo-test',\n\t\t\tUserID: '1234',\n\t\t\tData: map[string]string{\n\t\t\t\t'test': 'test',\n\t\t\t},\n\t\t}\n\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t'user:create:sticky',\n\t\t\ttestEvent,\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error pushing event: %w', err))\n\t\t}\n\n\t\ttime.Sleep(10 * time.Second)\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error starting worker: %w', err)\n\t}\n\n\treturn cleanup, nil\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/client/types"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\nfunc run() (func() error, error) {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\t// > StickyWorker\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events("user:create:sticky"),\n\t\t\tName: "sticky",\n\t\t\tDescription: "sticky",\n\t\t\t// 👀 Specify a sticky strategy when declaring the workflow\n\t\t\tStickyStrategy: types.StickyStrategyPtr(types.StickyStrategy_HARD),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\n\t\t\t\t\tsticky := true\n\n\t\t\t\t\t_, err = ctx.SpawnWorkflow("sticky-child", nil, &worker.SpawnWorkflowOpts{\n\t\t\t\t\t\tSticky: &sticky,\n\t\t\t\t\t})\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf("error spawning workflow: %w", err)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: ctx.Worker().ID(),\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-one"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: ctx.Worker().ID(),\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-two").AddParents("step-one"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: ctx.Worker().ID(),\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-three").AddParents("step-two"),\n\t\t\t},\n\t\t},\n\t)\n\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\t// > StickyChild\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.NoTrigger(),\n\t\t\tName: "sticky-child",\n\t\t\tDescription: "sticky",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: ctx.Worker().ID(),\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tgo func() {\n\t\tlog.Printf("pushing event")\n\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: "echo-test",\n\t\t\tUserID: "1234",\n\t\t\tData: map[string]string{\n\t\t\t\t"test": "test",\n\t\t\t},\n\t\t}\n\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t"user:create:sticky",\n\t\t\ttestEvent,\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error pushing event: %w", err))\n\t\t}\n\n\t\ttime.Sleep(10 * time.Second)\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error starting worker: %w", err)\n\t}\n\n\treturn cleanup, nil\n}\n', source: 'out/go/z_v0/assignment-sticky/run.go', blocks: { stickyworker: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/bulk_imports/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/bulk_imports/main.ts index 3dda994df..926cabf6e 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/bulk_imports/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/bulk_imports/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'log'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = run()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n}\n\nfunc run() (func() error, error) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\ttestSvc := w.NewService('test')\n\n\terr = testSvc.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events('user:create:bulk'),\n\t\t\tName: 'bulk',\n\t\t\tDescription: 'This runs after an update to the user model.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-one')\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Username is: ' + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tvar events []client.EventWithAdditionalMetadata\n\n\t// 20000 times to test the bulk push\n\n\tfor i := 0; i < 20000; i++ {\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: 'echo-test',\n\t\t\tUserID: '1234 ' + fmt.Sprint(i),\n\t\t\tData: map[string]string{\n\t\t\t\t'test': 'test ' + fmt.Sprint(i),\n\t\t\t},\n\t\t}\n\t\tevents = append(events, client.EventWithAdditionalMetadata{\n\t\t\tEvent: testEvent,\n\t\t\tAdditionalMetadata: map[string]string{'hello': 'world ' + fmt.Sprint(i)},\n\t\t\tKey: 'user:create:bulk',\n\t\t})\n\t}\n\n\tlog.Printf('pushing event user:create:bulk')\n\n\terr = c.Event().BulkPush(\n\t\tcontext.Background(),\n\t\tevents,\n\t)\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error pushing event: %w', err))\n\t}\n\n\treturn nil, nil\n\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = run()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n}\n\nfunc run() (func() error, error) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\ttestSvc := w.NewService("test")\n\n\terr = testSvc.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events("user:create:bulk"),\n\t\t\tName: "bulk",\n\t\t\tDescription: "This runs after an update to the user model.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-one")\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Username is: " + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tvar events []client.EventWithAdditionalMetadata\n\n\t// 20000 times to test the bulk push\n\n\tfor i := 0; i < 20000; i++ {\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: "echo-test",\n\t\t\tUserID: "1234 " + fmt.Sprint(i),\n\t\t\tData: map[string]string{\n\t\t\t\t"test": "test " + fmt.Sprint(i),\n\t\t\t},\n\t\t}\n\t\tevents = append(events, client.EventWithAdditionalMetadata{\n\t\t\tEvent: testEvent,\n\t\t\tAdditionalMetadata: map[string]string{"hello": "world " + fmt.Sprint(i)},\n\t\t\tKey: "user:create:bulk",\n\t\t})\n\t}\n\n\tlog.Printf("pushing event user:create:bulk")\n\n\terr = c.Event().BulkPush(\n\t\tcontext.Background(),\n\t\tevents,\n\t)\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error pushing event: %w", err))\n\t}\n\n\treturn nil, nil\n\n}\n', source: 'out/go/z_v0/bulk_imports/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/bulk_workflows/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/bulk_workflows/main.ts index e53f16a5d..30bd433c9 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/bulk_workflows/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/bulk_workflows/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'log'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/client/types'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tch := cmdutils.InterruptChan()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tworkflowName := 'simple-bulk-workflow'\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error creating client: %w', err))\n\t}\n\n\t_, err = registerWorkflow(c, workflowName)\n\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error registering workflow: %w', err))\n\t}\n\n\tquantity := 999\n\n\toverallStart := time.Now()\n\titerations := 10\n\tfor i := 0; i < iterations; i++ {\n\t\tstartTime := time.Now()\n\n\t\tfmt.Printf('Running the %dth bulk workflow \\n', i)\n\n\t\terr = runBulk(workflowName, quantity)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfmt.Printf('Time taken to queue %dth bulk workflow: %v\\n', i, time.Since(startTime))\n\t}\n\tfmt.Println('Overall time taken: ', time.Since(overallStart))\n\tfmt.Printf('That is %d workflows per second\\n', int(float64(quantity*iterations)/time.Since(overallStart).Seconds()))\n\tfmt.Println('Starting the worker')\n\n\t// err = runSingles(workflowName, quantity)\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error creating client: %w', err))\n\t}\n\n\t// I want to start the wofklow worker here\n\n\tw, err := registerWorkflow(c, workflowName)\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error creating worker: %w', err))\n\t}\n\n\tcleanup, err := w.Start()\n\tfmt.Println('Starting the worker')\n\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error starting worker: %w', err))\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n\n}\n\nfunc getConcurrencyKey(ctx worker.HatchetContext) (string, error) {\n\treturn 'my-key', nil\n}\n\nfunc registerWorkflow(c client.Client, workflowName string) (w *worker.Worker, err error) {\n\n\tw, err = worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events('user:create:bulk-simple'),\n\t\t\tName: workflowName,\n\t\t\tConcurrency: worker.Concurrency(getConcurrencyKey).MaxRuns(200).LimitStrategy(types.GroupRoundRobin),\n\t\t\tDescription: 'This runs after an update to the user model.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-one')\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Username is: ' + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &stepOneOutput{}\n\t\t\t\t\terr = ctx.StepOutput('step-one', input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-two')\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Above message is: ' + input.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-two').AddParents('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\treturn w, nil\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\t"log"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/client/types"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tch := cmdutils.InterruptChan()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tworkflowName := "simple-bulk-workflow"\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error creating client: %w", err))\n\t}\n\n\t_, err = registerWorkflow(c, workflowName)\n\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error registering workflow: %w", err))\n\t}\n\n\tquantity := 999\n\n\toverallStart := time.Now()\n\titerations := 10\n\tfor i := 0; i < iterations; i++ {\n\t\tstartTime := time.Now()\n\n\t\tfmt.Printf("Running the %dth bulk workflow \\n", i)\n\n\t\terr = runBulk(workflowName, quantity)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfmt.Printf("Time taken to queue %dth bulk workflow: %v\\n", i, time.Since(startTime))\n\t}\n\tfmt.Println("Overall time taken: ", time.Since(overallStart))\n\tfmt.Printf("That is %d workflows per second\\n", int(float64(quantity*iterations)/time.Since(overallStart).Seconds()))\n\tfmt.Println("Starting the worker")\n\n\t// err = runSingles(workflowName, quantity)\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error creating client: %w", err))\n\t}\n\n\t// I want to start the wofklow worker here\n\n\tw, err := registerWorkflow(c, workflowName)\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error creating worker: %w", err))\n\t}\n\n\tcleanup, err := w.Start()\n\tfmt.Println("Starting the worker")\n\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error starting worker: %w", err))\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n\n}\n\nfunc getConcurrencyKey(ctx worker.HatchetContext) (string, error) {\n\treturn "my-key", nil\n}\n\nfunc registerWorkflow(c client.Client, workflowName string) (w *worker.Worker, err error) {\n\n\tw, err = worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events("user:create:bulk-simple"),\n\t\t\tName: workflowName,\n\t\t\tConcurrency: worker.Concurrency(getConcurrencyKey).MaxRuns(200).LimitStrategy(types.GroupRoundRobin),\n\t\t\tDescription: "This runs after an update to the user model.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-one")\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Username is: " + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &stepOneOutput{}\n\t\t\t\t\terr = ctx.StepOutput("step-one", input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-two")\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Above message is: " + input.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-two").AddParents("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\treturn w, nil\n}\n', source: 'out/go/z_v0/bulk_workflows/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/bulk_workflows/run.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/bulk_workflows/run.ts index 2db7effdc..e8709b32d 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/bulk_workflows/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/bulk_workflows/run.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'log'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n)\n\nfunc runBulk(workflowName string, quantity int) error {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tlog.Printf('pushing %d workflows in bulk', quantity)\n\n\tvar workflows []*client.WorkflowRun\n\tfor i := 0; i < quantity; i++ {\n\t\tdata := map[string]interface{}{\n\t\t\t'username': fmt.Sprintf('echo-test-%d', i),\n\t\t\t'user_id': fmt.Sprintf('1234-%d', i),\n\t\t}\n\t\tworkflows = append(workflows, &client.WorkflowRun{\n\t\t\tName: workflowName,\n\t\t\tInput: data,\n\t\t\tOptions: []client.RunOptFunc{\n\t\t\t\t// setting a dedupe key so these shouldn't all run\n\t\t\t\tclient.WithRunMetadata(map[string]interface{}{\n\t\t\t\t\t// 'dedupe': 'dedupe1',\n\t\t\t\t}),\n\t\t\t},\n\t\t})\n\n\t}\n\n\touts, err := c.Admin().BulkRunWorkflow(workflows)\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error pushing event: %w', err))\n\t}\n\n\tfor _, out := range outs {\n\t\tlog.Printf('workflow run id: %v', out)\n\t}\n\n\treturn nil\n\n}\n\nfunc runSingles(workflowName string, quantity int) error {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tlog.Printf('pushing %d single workflows', quantity)\n\n\tvar workflows []*client.WorkflowRun\n\tfor i := 0; i < quantity; i++ {\n\t\tdata := map[string]interface{}{\n\t\t\t'username': fmt.Sprintf('echo-test-%d', i),\n\t\t\t'user_id': fmt.Sprintf('1234-%d', i),\n\t\t}\n\t\tworkflows = append(workflows, &client.WorkflowRun{\n\t\t\tName: workflowName,\n\t\t\tInput: data,\n\t\t\tOptions: []client.RunOptFunc{\n\t\t\t\tclient.WithRunMetadata(map[string]interface{}{\n\t\t\t\t\t// 'dedupe': 'dedupe1',\n\t\t\t\t}),\n\t\t\t},\n\t\t})\n\t}\n\n\tfor _, wf := range workflows {\n\n\t\tgo func() {\n\t\t\tout, err := c.Admin().RunWorkflow(wf.Name, wf.Input, wf.Options...)\n\t\t\tif err != nil {\n\t\t\t\tpanic(fmt.Errorf('error pushing event: %w', err))\n\t\t\t}\n\n\t\t\tlog.Printf('workflow run id: %v', out)\n\t\t}()\n\n\t}\n\n\treturn nil\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\t"log"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n)\n\nfunc runBulk(workflowName string, quantity int) error {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tlog.Printf("pushing %d workflows in bulk", quantity)\n\n\tvar workflows []*client.WorkflowRun\n\tfor i := 0; i < quantity; i++ {\n\t\tdata := map[string]interface{}{\n\t\t\t"username": fmt.Sprintf("echo-test-%d", i),\n\t\t\t"user_id": fmt.Sprintf("1234-%d", i),\n\t\t}\n\t\tworkflows = append(workflows, &client.WorkflowRun{\n\t\t\tName: workflowName,\n\t\t\tInput: data,\n\t\t\tOptions: []client.RunOptFunc{\n\t\t\t\t// setting a dedupe key so these shouldn\'t all run\n\t\t\t\tclient.WithRunMetadata(map[string]interface{}{\n\t\t\t\t\t// "dedupe": "dedupe1",\n\t\t\t\t}),\n\t\t\t},\n\t\t})\n\n\t}\n\n\touts, err := c.Admin().BulkRunWorkflow(workflows)\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error pushing event: %w", err))\n\t}\n\n\tfor _, out := range outs {\n\t\tlog.Printf("workflow run id: %v", out)\n\t}\n\n\treturn nil\n\n}\n\nfunc runSingles(workflowName string, quantity int) error {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tlog.Printf("pushing %d single workflows", quantity)\n\n\tvar workflows []*client.WorkflowRun\n\tfor i := 0; i < quantity; i++ {\n\t\tdata := map[string]interface{}{\n\t\t\t"username": fmt.Sprintf("echo-test-%d", i),\n\t\t\t"user_id": fmt.Sprintf("1234-%d", i),\n\t\t}\n\t\tworkflows = append(workflows, &client.WorkflowRun{\n\t\t\tName: workflowName,\n\t\t\tInput: data,\n\t\t\tOptions: []client.RunOptFunc{\n\t\t\t\tclient.WithRunMetadata(map[string]interface{}{\n\t\t\t\t\t// "dedupe": "dedupe1",\n\t\t\t\t}),\n\t\t\t},\n\t\t})\n\t}\n\n\tfor _, wf := range workflows {\n\n\t\tgo func() {\n\t\t\tout, err := c.Admin().RunWorkflow(wf.Name, wf.Input, wf.Options...)\n\t\t\tif err != nil {\n\t\t\t\tpanic(fmt.Errorf("error pushing event: %w", err))\n\t\t\t}\n\n\t\t\tlog.Printf("workflow run id: %v", out)\n\t\t}()\n\n\t}\n\n\treturn nil\n}\n', source: 'out/go/z_v0/bulk_workflows/run.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cancellation/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cancellation/main.ts index e88a77e8a..5724e9f31 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cancellation/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cancellation/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tch := cmdutils.InterruptChan()\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('cleanup() error = %v', err))\n\t}\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tch := cmdutils.InterruptChan()\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("cleanup() error = %v", err))\n\t}\n}\n', source: 'out/go/z_v0/cancellation/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cancellation/run.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cancellation/run.ts index 1326acbe9..97b9f7b84 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cancellation/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cancellation/run.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'log'\n\t'time'\n\n\t'github.com/google/uuid'\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/client/rest'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events('user:create:cancellation'),\n\t\t\tName: 'cancellation',\n\t\t\tDescription: 'cancellation',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\t\tevents <- 'done'\n\t\t\t\t\t\tlog.Printf('context cancelled')\n\t\t\t\t\t\treturn nil, nil\n\t\t\t\t\tcase <-time.After(30 * time.Second):\n\t\t\t\t\t\tlog.Printf('workflow never cancelled')\n\t\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\t\tMessage: 'done',\n\t\t\t\t\t\t}, nil\n\t\t\t\t\t}\n\t\t\t\t}).SetName('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tgo func() {\n\t\tlog.Printf('pushing event')\n\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: 'echo-test',\n\t\t\tUserID: '1234',\n\t\t\tData: map[string]string{\n\t\t\t\t'test': 'test',\n\t\t\t},\n\t\t}\n\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t'user:create:cancellation',\n\t\t\ttestEvent,\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error pushing event: %w', err))\n\t\t}\n\n\t\ttime.Sleep(10 * time.Second)\n\n\t\tworkflowName := 'cancellation'\n\n\t\tworkflows, err := c.API().WorkflowListWithResponse(context.Background(), uuid.MustParse(c.TenantId()), &rest.WorkflowListParams{\n\t\t\tName: &workflowName,\n\t\t})\n\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error listing workflows: %w', err))\n\t\t}\n\n\t\tif workflows.JSON200 == nil {\n\t\t\tpanic(fmt.Errorf('no workflows found'))\n\t\t}\n\n\t\trows := *workflows.JSON200.Rows\n\n\t\tif len(rows) == 0 {\n\t\t\tpanic(fmt.Errorf('no workflows found'))\n\t\t}\n\n\t\tworkflowId := uuid.MustParse(rows[0].Metadata.Id)\n\n\t\tworkflowRuns, err := c.API().WorkflowRunListWithResponse(context.Background(), uuid.MustParse(c.TenantId()), &rest.WorkflowRunListParams{\n\t\t\tWorkflowId: &workflowId,\n\t\t})\n\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error listing workflow runs: %w', err))\n\t\t}\n\n\t\tif workflowRuns.JSON200 == nil {\n\t\t\tpanic(fmt.Errorf('no workflow runs found'))\n\t\t}\n\n\t\tworkflowRunsRows := *workflowRuns.JSON200.Rows\n\n\t\t_, err = c.API().WorkflowRunCancelWithResponse(context.Background(), uuid.MustParse(c.TenantId()), rest.WorkflowRunsCancelRequest{\n\t\t\tWorkflowRunIds: []uuid.UUID{uuid.MustParse(workflowRunsRows[0].Metadata.Id)},\n\t\t})\n\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error cancelling workflow run: %w', err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error starting worker: %w', err)\n\t}\n\n\treturn cleanup, nil\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\t"time"\n\n\t"github.com/google/uuid"\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/client/rest"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events("user:create:cancellation"),\n\t\t\tName: "cancellation",\n\t\t\tDescription: "cancellation",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\t\tevents <- "done"\n\t\t\t\t\t\tlog.Printf("context cancelled")\n\t\t\t\t\t\treturn nil, nil\n\t\t\t\t\tcase <-time.After(30 * time.Second):\n\t\t\t\t\t\tlog.Printf("workflow never cancelled")\n\t\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\t\tMessage: "done",\n\t\t\t\t\t\t}, nil\n\t\t\t\t\t}\n\t\t\t\t}).SetName("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tgo func() {\n\t\tlog.Printf("pushing event")\n\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: "echo-test",\n\t\t\tUserID: "1234",\n\t\t\tData: map[string]string{\n\t\t\t\t"test": "test",\n\t\t\t},\n\t\t}\n\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t"user:create:cancellation",\n\t\t\ttestEvent,\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error pushing event: %w", err))\n\t\t}\n\n\t\ttime.Sleep(10 * time.Second)\n\n\t\tworkflowName := "cancellation"\n\n\t\tworkflows, err := c.API().WorkflowListWithResponse(context.Background(), uuid.MustParse(c.TenantId()), &rest.WorkflowListParams{\n\t\t\tName: &workflowName,\n\t\t})\n\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error listing workflows: %w", err))\n\t\t}\n\n\t\tif workflows.JSON200 == nil {\n\t\t\tpanic(fmt.Errorf("no workflows found"))\n\t\t}\n\n\t\trows := *workflows.JSON200.Rows\n\n\t\tif len(rows) == 0 {\n\t\t\tpanic(fmt.Errorf("no workflows found"))\n\t\t}\n\n\t\tworkflowId := uuid.MustParse(rows[0].Metadata.Id)\n\n\t\tworkflowRuns, err := c.API().WorkflowRunListWithResponse(context.Background(), uuid.MustParse(c.TenantId()), &rest.WorkflowRunListParams{\n\t\t\tWorkflowId: &workflowId,\n\t\t})\n\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error listing workflow runs: %w", err))\n\t\t}\n\n\t\tif workflowRuns.JSON200 == nil {\n\t\t\tpanic(fmt.Errorf("no workflow runs found"))\n\t\t}\n\n\t\tworkflowRunsRows := *workflowRuns.JSON200.Rows\n\n\t\t_, err = c.API().WorkflowRunCancelWithResponse(context.Background(), uuid.MustParse(c.TenantId()), rest.WorkflowRunsCancelRequest{\n\t\t\tWorkflowRunIds: []uuid.UUID{uuid.MustParse(workflowRunsRows[0].Metadata.Id)},\n\t\t})\n\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error cancelling workflow run: %w", err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error starting worker: %w", err)\n\t}\n\n\treturn cleanup, nil\n}\n', source: 'out/go/z_v0/cancellation/run.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/compute/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/compute/main.ts index ccadee28b..6133266e3 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/compute/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/compute/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'log'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/client/compute'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n}\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\tpool := 'test-pool'\n\tbasicCompute := compute.Compute{\n\t\tPool: &pool,\n\t\tNumReplicas: 1,\n\t\tCPUs: 1,\n\t\tMemoryMB: 1024,\n\t\tCPUKind: compute.ComputeKindSharedCPU,\n\t\tRegions: []compute.Region{compute.Region('ewr')},\n\t}\n\n\tperformancePool := 'performance-pool'\n\tperformanceCompute := compute.Compute{\n\t\tPool: &performancePool,\n\t\tNumReplicas: 1,\n\t\tCPUs: 2,\n\t\tMemoryMB: 1024,\n\t\tCPUKind: compute.ComputeKindPerformanceCPU,\n\t\tRegions: []compute.Region{compute.Region('ewr')},\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events('user:create:simple'),\n\t\t\tName: 'simple',\n\t\t\tDescription: 'This runs after an update to the user model.',\n\t\t\tConcurrency: worker.Expression('input.user_id'),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-one')\n\t\t\t\t\tevents <- 'step-one'\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Username is: ' + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one').SetCompute(&basicCompute),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &stepOneOutput{}\n\t\t\t\t\terr = ctx.StepOutput('step-one', input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-two')\n\t\t\t\t\tevents <- 'step-two'\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Above message is: ' + input.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-two').AddParents('step-one').SetCompute(&performanceCompute),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tgo func() {\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: 'echo-test',\n\t\t\tUserID: '1234',\n\t\t\tData: map[string]string{\n\t\t\t\t'test': 'test',\n\t\t\t},\n\t\t}\n\n\t\tlog.Printf('pushing event user:create:simple')\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t'user:create:simple',\n\t\t\ttestEvent,\n\t\t\tclient.WithEventMetadata(map[string]string{\n\t\t\t\t'hello': 'world',\n\t\t\t}),\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error pushing event: %w', err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn cleanup, nil\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/client/compute"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n}\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\tpool := "test-pool"\n\tbasicCompute := compute.Compute{\n\t\tPool: &pool,\n\t\tNumReplicas: 1,\n\t\tCPUs: 1,\n\t\tMemoryMB: 1024,\n\t\tCPUKind: compute.ComputeKindSharedCPU,\n\t\tRegions: []compute.Region{compute.Region("ewr")},\n\t}\n\n\tperformancePool := "performance-pool"\n\tperformanceCompute := compute.Compute{\n\t\tPool: &performancePool,\n\t\tNumReplicas: 1,\n\t\tCPUs: 2,\n\t\tMemoryMB: 1024,\n\t\tCPUKind: compute.ComputeKindPerformanceCPU,\n\t\tRegions: []compute.Region{compute.Region("ewr")},\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events("user:create:simple"),\n\t\t\tName: "simple",\n\t\t\tDescription: "This runs after an update to the user model.",\n\t\t\tConcurrency: worker.Expression("input.user_id"),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-one")\n\t\t\t\t\tevents <- "step-one"\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Username is: " + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one").SetCompute(&basicCompute),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &stepOneOutput{}\n\t\t\t\t\terr = ctx.StepOutput("step-one", input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-two")\n\t\t\t\t\tevents <- "step-two"\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Above message is: " + input.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-two").AddParents("step-one").SetCompute(&performanceCompute),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tgo func() {\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: "echo-test",\n\t\t\tUserID: "1234",\n\t\t\tData: map[string]string{\n\t\t\t\t"test": "test",\n\t\t\t},\n\t\t}\n\n\t\tlog.Printf("pushing event user:create:simple")\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t"user:create:simple",\n\t\t\ttestEvent,\n\t\t\tclient.WithEventMetadata(map[string]string{\n\t\t\t\t"hello": "world",\n\t\t\t}),\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error pushing event: %w", err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn cleanup, nil\n}\n', source: 'out/go/z_v0/compute/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/concurrency/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/concurrency/main.ts index 6221f0ffa..422789887 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/concurrency/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/concurrency/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'log'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/client/types'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n}\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events('user:create:concurrency'),\n\t\t\tName: 'simple-concurrency',\n\t\t\tDescription: 'This runs to test concurrency.',\n\t\t\tConcurrency: worker.Expression(''concurrency'').MaxRuns(1).LimitStrategy(types.GroupRoundRobin),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\t// we sleep to simulate a long running task\n\t\t\t\t\ttime.Sleep(10 * time.Second)\n\n\t\t\t\t\tif err != nil {\n\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tif ctx.Err() != nil {\n\t\t\t\t\t\treturn nil, ctx.Err()\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-one')\n\t\t\t\t\tevents <- 'step-one'\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Username is: ' + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &stepOneOutput{}\n\t\t\t\t\terr = ctx.StepOutput('step-one', input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tif ctx.Err() != nil {\n\t\t\t\t\t\treturn nil, ctx.Err()\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-two')\n\t\t\t\t\tevents <- 'step-two'\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Above message is: ' + input.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-two').AddParents('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\ttestEvent := userCreateEvent{\n\t\tUsername: 'echo-test',\n\t\tUserID: '1234',\n\t\tData: map[string]string{\n\t\t\t'test': 'test',\n\t\t},\n\t}\n\tgo func() {\n\t\t// do this 10 times to test concurrency\n\t\tfor i := 0; i < 10; i++ {\n\n\t\t\twfr_id, err := c.Admin().RunWorkflow('simple-concurrency', testEvent)\n\n\t\t\tlog.Println('Starting workflow run id: ', wfr_id)\n\n\t\t\tif err != nil {\n\t\t\t\tpanic(fmt.Errorf('error running workflow: %w', err))\n\t\t\t}\n\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn cleanup, nil\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\t"log"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/client/types"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n}\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events("user:create:concurrency"),\n\t\t\tName: "simple-concurrency",\n\t\t\tDescription: "This runs to test concurrency.",\n\t\t\tConcurrency: worker.Expression("\'concurrency\'").MaxRuns(1).LimitStrategy(types.GroupRoundRobin),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\t// we sleep to simulate a long running task\n\t\t\t\t\ttime.Sleep(10 * time.Second)\n\n\t\t\t\t\tif err != nil {\n\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tif ctx.Err() != nil {\n\t\t\t\t\t\treturn nil, ctx.Err()\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-one")\n\t\t\t\t\tevents <- "step-one"\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Username is: " + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &stepOneOutput{}\n\t\t\t\t\terr = ctx.StepOutput("step-one", input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tif ctx.Err() != nil {\n\t\t\t\t\t\treturn nil, ctx.Err()\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-two")\n\t\t\t\t\tevents <- "step-two"\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Above message is: " + input.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-two").AddParents("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\ttestEvent := userCreateEvent{\n\t\tUsername: "echo-test",\n\t\tUserID: "1234",\n\t\tData: map[string]string{\n\t\t\t"test": "test",\n\t\t},\n\t}\n\tgo func() {\n\t\t// do this 10 times to test concurrency\n\t\tfor i := 0; i < 10; i++ {\n\n\t\t\twfr_id, err := c.Admin().RunWorkflow("simple-concurrency", testEvent)\n\n\t\t\tlog.Println("Starting workflow run id: ", wfr_id)\n\n\t\t\tif err != nil {\n\t\t\t\tpanic(fmt.Errorf("error running workflow: %w", err))\n\t\t\t}\n\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn cleanup, nil\n}\n', source: 'out/go/z_v0/concurrency/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cron-programmatic/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cron-programmatic/main.ts index 58e39a9ba..920212d99 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cron-programmatic/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cron-programmatic/main.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\n// > Create\n// ... normal workflow definition\ntype printOutput struct{}\n\nfunc print(ctx context.Context) (result *printOutput, err error) {\n\tfmt.Println('called print:print')\n\n\treturn &printOutput{}, nil\n}\n\n// ,\nfunc main() {\n\t// ... initialize client, worker and workflow\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.NoTrigger(),\n\t\t\tName: 'cron-workflow',\n\t\t\tDescription: 'Demonstrates a simple cron workflow',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(print),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := w.Start()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// ,\n\n\tgo func() {\n\t\t// 👀 define the cron expression to run every minute\n\t\tcron, err := c.Cron().Create(\n\t\t\tcontext.Background(),\n\t\t\t'cron-workflow',\n\t\t\t&client.CronOpts{\n\t\t\t\tName: 'every-minute',\n\t\t\t\tExpression: '* * * * *',\n\t\t\t\tInput: map[string]interface{}{\n\t\t\t\t\t'message': 'Hello, world!',\n\t\t\t\t},\n\t\t\t\tAdditionalMetadata: map[string]string{},\n\t\t\t},\n\t\t)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tfmt.Println(*cron.Name, cron.Cron)\n\t}()\n\n\t// ... wait for interrupt signal\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n\n\t// ,\n}\n\n\nfunc ListCrons() {\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// > List\n\tcrons, err := c.Cron().List(context.Background())\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, cron := range *crons.Rows {\n\t\tfmt.Println(cron.Cron, *cron.Name)\n\t}\n}\n\nfunc DeleteCron(id string) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// > Delete\n\t// 👀 id is the cron's metadata id, can get it via cron.Metadata.Id\n\terr = c.Cron().Delete(context.Background(), id)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\n// > Create\n// ... normal workflow definition\ntype printOutput struct{}\n\nfunc print(ctx context.Context) (result *printOutput, err error) {\n\tfmt.Println("called print:print")\n\n\treturn &printOutput{}, nil\n}\n\n// ,\nfunc main() {\n\t// ... initialize client, worker and workflow\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.NoTrigger(),\n\t\t\tName: "cron-workflow",\n\t\t\tDescription: "Demonstrates a simple cron workflow",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(print),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := w.Start()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// ,\n\n\tgo func() {\n\t\t// 👀 define the cron expression to run every minute\n\t\tcron, err := c.Cron().Create(\n\t\t\tcontext.Background(),\n\t\t\t"cron-workflow",\n\t\t\t&client.CronOpts{\n\t\t\t\tName: "every-minute",\n\t\t\t\tExpression: "* * * * *",\n\t\t\t\tInput: map[string]interface{}{\n\t\t\t\t\t"message": "Hello, world!",\n\t\t\t\t},\n\t\t\t\tAdditionalMetadata: map[string]string{},\n\t\t\t},\n\t\t)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tfmt.Println(*cron.Name, cron.Cron)\n\t}()\n\n\t// ... wait for interrupt signal\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n\n\t// ,\n}\n\n\nfunc ListCrons() {\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// > List\n\tcrons, err := c.Cron().List(context.Background())\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, cron := range *crons.Rows {\n\t\tfmt.Println(cron.Cron, *cron.Name)\n\t}\n}\n\nfunc DeleteCron(id string) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// > Delete\n\t// 👀 id is the cron\'s metadata id, can get it via cron.Metadata.Id\n\terr = c.Cron().Delete(context.Background(), id)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n}\n', source: 'out/go/z_v0/cron-programmatic/main.go', blocks: { create: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cron/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cron/main.ts index f6d19dd88..37a0985ee 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cron/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/cron/main.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\n// > Workflow Definition Cron Trigger\n// ... normal workflow definition\ntype printOutput struct{}\n\nfunc print(ctx context.Context) (result *printOutput, err error) {\n\tfmt.Println('called print:print')\n\n\treturn &printOutput{}, nil\n}\n\n// ,\nfunc main() {\n\t// ... initialize client and worker\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tclient,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// ,\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\t// 👀 define the cron expression to run every minute\n\t\t\tOn: worker.Cron('* * * * *'),\n\t\t\tName: 'cron-workflow',\n\t\t\tDescription: 'Demonstrates a simple cron workflow',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(print),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// ... start worker\n\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := w.Start()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n\n\t// ,\n}\n\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\n// > Workflow Definition Cron Trigger\n// ... normal workflow definition\ntype printOutput struct{}\n\nfunc print(ctx context.Context) (result *printOutput, err error) {\n\tfmt.Println("called print:print")\n\n\treturn &printOutput{}, nil\n}\n\n// ,\nfunc main() {\n\t// ... initialize client and worker\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tclient,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// ,\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\t// 👀 define the cron expression to run every minute\n\t\t\tOn: worker.Cron("* * * * *"),\n\t\t\tName: "cron-workflow",\n\t\t\tDescription: "Demonstrates a simple cron workflow",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(print),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// ... start worker\n\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := w.Start()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n\n\t// ,\n}\n\n', source: 'out/go/z_v0/cron/main.go', blocks: { workflow_definition_cron_trigger: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/dag/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/dag/main.ts index 565fe761b..59dcb588c 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/dag/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/dag/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'log'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tif err := run(cmdutils.InterruptChan(), events); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc run(ch <-chan interface{}, events chan<- string) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t\tworker.WithMaxRuns(1),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\ttestSvc := w.NewService('test')\n\n\terr = testSvc.On(\n\t\tworker.Events('user:create:simple'),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'post-user-update',\n\t\t\tDescription: 'This runs after an update to the user model.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\t\t\t\t\tctx.WorkflowInput(input)\n\n\t\t\t\t\ttime.Sleep(1 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: 'Step 1 got username: ' + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\t\t\t\t\tctx.WorkflowInput(input)\n\n\t\t\t\t\ttime.Sleep(2 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: 'Step 2 got username: ' + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-two'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\t\t\t\t\tctx.WorkflowInput(input)\n\n\t\t\t\t\tstep1Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput('step-one', step1Out)\n\n\t\t\t\t\tstep2Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput('step-two', step2Out)\n\n\t\t\t\t\ttime.Sleep(3 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: 'Username was: ' + input.Username + ', Step 3: has parents 1 and 2' + step1Out.Message + ', ' + step2Out.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-three').AddParents('step-one', 'step-two'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tstep1Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput('step-one', step1Out)\n\n\t\t\t\t\tstep3Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput('step-three', step3Out)\n\n\t\t\t\t\ttime.Sleep(4 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: 'Step 4: has parents 1 and 3' + step1Out.Message + ', ' + step3Out.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-four').AddParents('step-one', 'step-three'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tstep4Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput('step-four', step4Out)\n\n\t\t\t\t\ttime.Sleep(5 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: 'Step 5: has parent 4' + step4Out.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-five').AddParents('step-four'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(ch)\n\tdefer cancel()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf('error starting worker: %w', err)\n\t}\n\n\ttestEvent := userCreateEvent{\n\t\tUsername: 'echo-test',\n\t\tUserID: '1234',\n\t\tData: map[string]string{\n\t\t\t'test': 'test',\n\t\t},\n\t}\n\n\tlog.Printf('pushing event user:create:simple')\n\n\t// push an event\n\terr = c.Event().Push(\n\t\tcontext.Background(),\n\t\t'user:create:simple',\n\t\ttestEvent,\n\t)\n\n\tif err != nil {\n\t\treturn fmt.Errorf('error pushing event: %w', err)\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-interruptCtx.Done():\n\t\t\treturn cleanup()\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tif err := run(cmdutils.InterruptChan(), events); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc run(ch <-chan interface{}, events chan<- string) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t\tworker.WithMaxRuns(1),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\ttestSvc := w.NewService("test")\n\n\terr = testSvc.On(\n\t\tworker.Events("user:create:simple"),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "post-user-update",\n\t\t\tDescription: "This runs after an update to the user model.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\t\t\t\t\tctx.WorkflowInput(input)\n\n\t\t\t\t\ttime.Sleep(1 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: "Step 1 got username: " + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\t\t\t\t\tctx.WorkflowInput(input)\n\n\t\t\t\t\ttime.Sleep(2 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: "Step 2 got username: " + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-two"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\t\t\t\t\tctx.WorkflowInput(input)\n\n\t\t\t\t\tstep1Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput("step-one", step1Out)\n\n\t\t\t\t\tstep2Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput("step-two", step2Out)\n\n\t\t\t\t\ttime.Sleep(3 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: "Username was: " + input.Username + ", Step 3: has parents 1 and 2" + step1Out.Message + ", " + step2Out.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-three").AddParents("step-one", "step-two"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tstep1Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput("step-one", step1Out)\n\n\t\t\t\t\tstep3Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput("step-three", step3Out)\n\n\t\t\t\t\ttime.Sleep(4 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: "Step 4: has parents 1 and 3" + step1Out.Message + ", " + step3Out.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-four").AddParents("step-one", "step-three"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tstep4Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput("step-four", step4Out)\n\n\t\t\t\t\ttime.Sleep(5 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: "Step 5: has parent 4" + step4Out.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-five").AddParents("step-four"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(ch)\n\tdefer cancel()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf("error starting worker: %w", err)\n\t}\n\n\ttestEvent := userCreateEvent{\n\t\tUsername: "echo-test",\n\t\tUserID: "1234",\n\t\tData: map[string]string{\n\t\t\t"test": "test",\n\t\t},\n\t}\n\n\tlog.Printf("pushing event user:create:simple")\n\n\t// push an event\n\terr = c.Event().Push(\n\t\tcontext.Background(),\n\t\t"user:create:simple",\n\t\ttestEvent,\n\t)\n\n\tif err != nil {\n\t\treturn fmt.Errorf("error pushing event: %w", err)\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-interruptCtx.Done():\n\t\t\treturn cleanup()\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n}\n', source: 'out/go/z_v0/dag/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/requeue/.hatchet/job-requeue-workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/requeue/.hatchet/job-requeue-workflow.ts index 929ddc961..439354d89 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/requeue/.hatchet/job-requeue-workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/requeue/.hatchet/job-requeue-workflow.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'unknown', content: - "name: 'test-step-requeue'\nversion: v0.2.0\ntriggers:\n events:\n - example:event\njobs:\n requeue-job:\n steps:\n - id: requeue\n action: requeue:requeue\n timeout: 10s\n", + 'name: "test-step-requeue"\nversion: v0.2.0\ntriggers:\n events:\n - example:event\njobs:\n requeue-job:\n steps:\n - id: requeue\n action: requeue:requeue\n timeout: 10s\n', source: 'out/go/z_v0/deprecated/requeue/.hatchet/job-requeue-workflow.yaml', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/requeue/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/requeue/main.ts index 3575ca6fe..442e791f1 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/requeue/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/requeue/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype sampleEvent struct{}\n\ntype requeueInput struct{}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New(\n\t\tclient.InitWorkflows(),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tworker, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tclient,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = worker.RegisterAction('requeue:requeue', func(ctx context.Context, input *requeueInput) (result any, err error) {\n\t\treturn map[string]interface{}{}, nil\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\tevent := sampleEvent{}\n\n\t// push an event\n\terr = client.Event().Push(\n\t\tcontext.Background(),\n\t\t'example:event',\n\t\tevent,\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// wait to register the worker for 10 seconds, to let the requeuer kick in\n\ttime.Sleep(10 * time.Second)\n\tcleanup, err := worker.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-interruptCtx.Done():\n\t\t\tif err := cleanup(); err != nil {\n\t\t\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t\t\t}\n\t\t\treturn\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype sampleEvent struct{}\n\ntype requeueInput struct{}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New(\n\t\tclient.InitWorkflows(),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tworker, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tclient,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = worker.RegisterAction("requeue:requeue", func(ctx context.Context, input *requeueInput) (result any, err error) {\n\t\treturn map[string]interface{}{}, nil\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\tevent := sampleEvent{}\n\n\t// push an event\n\terr = client.Event().Push(\n\t\tcontext.Background(),\n\t\t"example:event",\n\t\tevent,\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// wait to register the worker for 10 seconds, to let the requeuer kick in\n\ttime.Sleep(10 * time.Second)\n\tcleanup, err := worker.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-interruptCtx.Done():\n\t\t\tif err := cleanup(); err != nil {\n\t\t\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t\t\t}\n\t\t\treturn\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n}\n', source: 'out/go/z_v0/deprecated/requeue/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/schedule-timeout/.hatchet/schedule-timeout-workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/schedule-timeout/.hatchet/schedule-timeout-workflow.ts index 198a85743..eaae1c0a3 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/schedule-timeout/.hatchet/schedule-timeout-workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/schedule-timeout/.hatchet/schedule-timeout-workflow.ts @@ -3,11 +3,11 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'unknown', content: - "name: 'test-schedule-timeout'\nversion: v0.1.0\ntriggers:\n events:\n - user:create\njobs:\n timeout-job:\n steps:\n - id: timeout\n action: timeout:timeout\n", + 'name: "test-schedule-timeout"\nversion: v0.1.0\ntriggers:\n events:\n - user:create\njobs:\n timeout-job:\n steps:\n - id: timeout\n action: timeout:timeout\n', source: 'out/go/z_v0/deprecated/schedule-timeout/.hatchet/schedule-timeout-workflow.yaml', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/schedule-timeout/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/schedule-timeout/main.ts index 42f1450ca..92751531c 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/schedule-timeout/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/schedule-timeout/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/joho/godotenv'\n)\n\ntype sampleEvent struct{}\n\ntype timeoutInput struct{}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New(\n\t\tclient.InitWorkflows(),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevent := sampleEvent{}\n\n\t// push an event\n\terr = client.Event().Push(\n\t\tcontext.Background(),\n\t\t'user:create',\n\t\tevent,\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ttime.Sleep(35 * time.Second)\n\n\tfmt.Println('step should have timed out')\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/joho/godotenv"\n)\n\ntype sampleEvent struct{}\n\ntype timeoutInput struct{}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New(\n\t\tclient.InitWorkflows(),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevent := sampleEvent{}\n\n\t// push an event\n\terr = client.Event().Push(\n\t\tcontext.Background(),\n\t\t"user:create",\n\t\tevent,\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ttime.Sleep(35 * time.Second)\n\n\tfmt.Println("step should have timed out")\n}\n', source: 'out/go/z_v0/deprecated/schedule-timeout/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/timeout/.hatchet/job-timeout-workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/timeout/.hatchet/job-timeout-workflow.ts index 88394fa7a..d5f8076f6 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/timeout/.hatchet/job-timeout-workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/timeout/.hatchet/job-timeout-workflow.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'unknown', content: - "name: 'test-job-timeout'\nversion: v0.1.0\ntriggers:\n events:\n - user:create\njobs:\n timeout-job:\n timeout: 3s\n steps:\n - id: timeout\n action: timeout:timeout\n timeout: 10s\n", + 'name: "test-job-timeout"\nversion: v0.1.0\ntriggers:\n events:\n - user:create\njobs:\n timeout-job:\n timeout: 3s\n steps:\n - id: timeout\n action: timeout:timeout\n timeout: 10s\n', source: 'out/go/z_v0/deprecated/timeout/.hatchet/job-timeout-workflow.yaml', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/timeout/.hatchet/step-timeout-workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/timeout/.hatchet/step-timeout-workflow.ts index 45ceaf014..26802aff7 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/timeout/.hatchet/step-timeout-workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/timeout/.hatchet/step-timeout-workflow.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'unknown', content: - "name: 'test-step-timeout'\nversion: v0.1.0\ntriggers:\n events:\n - user:create\njobs:\n timeout-job:\n steps:\n - id: timeout\n action: timeout:timeout\n timeout: 5s\n # This step should not be reached\n - id: later-step\n action: timeout:timeout\n timeout: 5s\n", + 'name: "test-step-timeout"\nversion: v0.1.0\ntriggers:\n events:\n - user:create\njobs:\n timeout-job:\n steps:\n - id: timeout\n action: timeout:timeout\n timeout: 5s\n # This step should not be reached\n - id: later-step\n action: timeout:timeout\n timeout: 5s\n', source: 'out/go/z_v0/deprecated/timeout/.hatchet/step-timeout-workflow.yaml', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/timeout/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/timeout/main.ts index 652bca398..1ea9f839a 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/timeout/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/timeout/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype sampleEvent struct{}\n\ntype timeoutInput struct{}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New(\n\t\tclient.InitWorkflows(),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tworker, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tclient,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = worker.RegisterAction('timeout:timeout', func(ctx context.Context, input *timeoutInput) (result any, err error) {\n\t\t// wait for context done signal\n\t\ttimeStart := time.Now().UTC()\n\t\t<-ctx.Done()\n\t\tfmt.Println('context cancelled in ', time.Since(timeStart).Seconds(), ' seconds')\n\n\t\treturn map[string]interface{}{}, nil\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\tcleanup, err := worker.Start()\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error starting worker: %w', err))\n\t}\n\n\tevent := sampleEvent{}\n\n\t// push an event\n\terr = client.Event().Push(\n\t\tcontext.Background(),\n\t\t'user:create',\n\t\tevent,\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-interruptCtx.Done():\n\t\t\tif err := cleanup(); err != nil {\n\t\t\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t\t\t}\n\t\t\treturn\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype sampleEvent struct{}\n\ntype timeoutInput struct{}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New(\n\t\tclient.InitWorkflows(),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tworker, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tclient,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = worker.RegisterAction("timeout:timeout", func(ctx context.Context, input *timeoutInput) (result any, err error) {\n\t\t// wait for context done signal\n\t\ttimeStart := time.Now().UTC()\n\t\t<-ctx.Done()\n\t\tfmt.Println("context cancelled in ", time.Since(timeStart).Seconds(), " seconds")\n\n\t\treturn map[string]interface{}{}, nil\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\tcleanup, err := worker.Start()\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error starting worker: %w", err))\n\t}\n\n\tevent := sampleEvent{}\n\n\t// push an event\n\terr = client.Event().Push(\n\t\tcontext.Background(),\n\t\t"user:create",\n\t\tevent,\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-interruptCtx.Done():\n\t\t\tif err := cleanup(); err != nil {\n\t\t\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t\t\t}\n\t\t\treturn\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n}\n', source: 'out/go/z_v0/deprecated/timeout/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/yaml/.hatchet/sample-workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/yaml/.hatchet/sample-workflow.ts index 1fdd7ebf9..7b30c8e68 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/yaml/.hatchet/sample-workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/yaml/.hatchet/sample-workflow.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'unknown', content: - "name: 'post-user-sign-up'\nversion: v0.2.0\ntriggers:\n events:\n - user:create\njobs:\n print-user:\n steps:\n - id: echo1\n action: echo:echo\n timeout: 60s\n with:\n message: 'Username is {{ .input.username }}'\n - id: echo2\n action: echo:echo\n timeout: 60s\n with:\n message: 'Above message is: {{ .steps.echo1.message }}'\n - id: echo3\n action: echo:echo\n timeout: 60s\n with:\n message: 'Above message is: {{ .steps.echo2.message }}'\n - id: testObject\n action: echo:object\n timeout: 60s\n with:\n object: '{{ .steps.echo3.json }}'\n", + 'name: "post-user-sign-up"\nversion: v0.2.0\ntriggers:\n events:\n - user:create\njobs:\n print-user:\n steps:\n - id: echo1\n action: echo:echo\n timeout: 60s\n with:\n message: "Username is {{ .input.username }}"\n - id: echo2\n action: echo:echo\n timeout: 60s\n with:\n message: "Above message is: {{ .steps.echo1.message }}"\n - id: echo3\n action: echo:echo\n timeout: 60s\n with:\n message: "Above message is: {{ .steps.echo2.message }}"\n - id: testObject\n action: echo:object\n timeout: 60s\n with:\n object: "{{ .steps.echo3.json }}"\n', source: 'out/go/z_v0/deprecated/yaml/.hatchet/sample-workflow.yaml', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/yaml/README.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/yaml/README.ts index 96ee01957..105472637 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/yaml/README.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/yaml/README.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/go/z_v0/deprecated/yaml/README.md', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/yaml/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/yaml/main.ts index 86a65e1d4..10fa54291 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/yaml/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/deprecated/yaml/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserId string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype actionInput struct {\n\tMessage string `json:'message'`\n}\n\ntype actionOut struct {\n\tMessage string `json:'message'`\n}\n\nfunc echo(ctx context.Context, input *actionInput) (result *actionOut, err error) {\n\treturn &actionOut{\n\t\tMessage: input.Message,\n\t}, nil\n}\n\nfunc object(ctx context.Context, input *userCreateEvent) error {\n\treturn nil\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New(\n\t\tclient.InitWorkflows(),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tworker, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tclient,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\techoSvc := worker.NewService('echo')\n\n\terr = echoSvc.RegisterAction(echo)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = echoSvc.RegisterAction(object)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tch := cmdutils.InterruptChan()\n\n\tcleanup, err := worker.Start()\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error starting worker: %w', err))\n\t}\n\n\ttestEvent := userCreateEvent{\n\t\tUsername: 'echo-test',\n\t\tUserId: '1234',\n\t\tData: map[string]string{\n\t\t\t'test': 'test',\n\t\t},\n\t}\n\n\ttime.Sleep(1 * time.Second)\n\n\t// push an event\n\terr = client.Event().Push(\n\t\tcontext.Background(),\n\t\t'user:create',\n\t\ttestEvent,\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up worker: %w', err))\n\t}\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserId string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype actionInput struct {\n\tMessage string `json:"message"`\n}\n\ntype actionOut struct {\n\tMessage string `json:"message"`\n}\n\nfunc echo(ctx context.Context, input *actionInput) (result *actionOut, err error) {\n\treturn &actionOut{\n\t\tMessage: input.Message,\n\t}, nil\n}\n\nfunc object(ctx context.Context, input *userCreateEvent) error {\n\treturn nil\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New(\n\t\tclient.InitWorkflows(),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tworker, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tclient,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\techoSvc := worker.NewService("echo")\n\n\terr = echoSvc.RegisterAction(echo)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = echoSvc.RegisterAction(object)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tch := cmdutils.InterruptChan()\n\n\tcleanup, err := worker.Start()\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error starting worker: %w", err))\n\t}\n\n\ttestEvent := userCreateEvent{\n\t\tUsername: "echo-test",\n\t\tUserId: "1234",\n\t\tData: map[string]string{\n\t\t\t"test": "test",\n\t\t},\n\t}\n\n\ttime.Sleep(1 * time.Second)\n\n\t// push an event\n\terr = client.Event().Push(\n\t\tcontext.Background(),\n\t\t"user:create",\n\t\ttestEvent,\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up worker: %w", err))\n\t}\n}\n', source: 'out/go/z_v0/deprecated/yaml/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/errors-test/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/errors-test/main.ts index 9bff5a47f..86ad59a9f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/errors-test/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/errors-test/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'os'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/errors/sentry'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserId string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc StepOne(ctx context.Context) (result *stepOneOutput, err error) {\n\treturn nil, fmt.Errorf('this is an error')\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsentryAlerter, err := sentry.NewSentryAlerter(&sentry.SentryAlerterOpts{\n\t\tDSN: os.Getenv('SENTRY_DSN'),\n\t\tEnvironment: os.Getenv('SENTRY_ENVIRONMENT'),\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tclient,\n\t\t),\n\t\tworker.WithErrorAlerter(sentryAlerter),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = w.On(worker.Event('user:create'), &worker.WorkflowJob{\n\t\tName: 'failing-workflow',\n\t\tDescription: 'This is a failing workflow.',\n\t\tSteps: []*worker.WorkflowStep{\n\t\t\t{\n\t\t\t\tFunction: StepOne,\n\t\t\t},\n\t\t},\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// err = worker.RegisterAction('echo:echo', func(ctx context.Context, input *actionInput) (result any, err error) {\n\t// \treturn map[string]interface{}{\n\t// \t\t'message': input.Message,\n\t// \t}, nil\n\t// })\n\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\n\t// err = worker.RegisterAction('echo:object', func(ctx context.Context, input *actionInput) (result any, err error) {\n\t// \treturn nil, nil\n\t// })\n\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\n\tch := cmdutils.InterruptChan()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error starting worker: %w', err))\n\t}\n\n\ttestEvent := userCreateEvent{\n\t\tUsername: 'echo-test',\n\t\tUserId: '1234',\n\t\tData: map[string]string{\n\t\t\t'test': 'test',\n\t\t},\n\t}\n\n\t// push an event\n\terr = client.Event().Push(\n\t\tcontext.Background(),\n\t\t'user:create',\n\t\ttestEvent,\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"os"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/errors/sentry"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserId string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc StepOne(ctx context.Context) (result *stepOneOutput, err error) {\n\treturn nil, fmt.Errorf("this is an error")\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsentryAlerter, err := sentry.NewSentryAlerter(&sentry.SentryAlerterOpts{\n\t\tDSN: os.Getenv("SENTRY_DSN"),\n\t\tEnvironment: os.Getenv("SENTRY_ENVIRONMENT"),\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tclient,\n\t\t),\n\t\tworker.WithErrorAlerter(sentryAlerter),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = w.On(worker.Event("user:create"), &worker.WorkflowJob{\n\t\tName: "failing-workflow",\n\t\tDescription: "This is a failing workflow.",\n\t\tSteps: []*worker.WorkflowStep{\n\t\t\t{\n\t\t\t\tFunction: StepOne,\n\t\t\t},\n\t\t},\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// err = worker.RegisterAction("echo:echo", func(ctx context.Context, input *actionInput) (result any, err error) {\n\t// \treturn map[string]interface{}{\n\t// \t\t"message": input.Message,\n\t// \t}, nil\n\t// })\n\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\n\t// err = worker.RegisterAction("echo:object", func(ctx context.Context, input *actionInput) (result any, err error) {\n\t// \treturn nil, nil\n\t// })\n\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\n\tch := cmdutils.InterruptChan()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error starting worker: %w", err))\n\t}\n\n\ttestEvent := userCreateEvent{\n\t\tUsername: "echo-test",\n\t\tUserId: "1234",\n\t\tData: map[string]string{\n\t\t\t"test": "test",\n\t\t},\n\t}\n\n\t// push an event\n\terr = client.Event().Push(\n\t\tcontext.Background(),\n\t\t"user:create",\n\t\ttestEvent,\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n}\n', source: 'out/go/z_v0/errors-test/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/limit-concurrency/cancel-in-progress/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/limit-concurrency/cancel-in-progress/main.ts index 4db5d75f5..8625ba930 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/limit-concurrency/cancel-in-progress/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/limit-concurrency/cancel-in-progress/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype concurrencyLimitEvent struct {\n\tIndex int `json:'index'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tif err := run(cmdutils.InterruptChan(), events); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc getConcurrencyKey(ctx worker.HatchetContext) (string, error) {\n\treturn 'user-create', nil\n}\n\nfunc run(ch <-chan interface{}, events chan<- string) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\ttestSvc := w.NewService('test')\n\n\terr = testSvc.On(\n\t\tworker.Events('concurrency-test-event'),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'concurrency-limit',\n\t\t\tDescription: 'This limits concurrency to 1 run at a time.',\n\t\t\tConcurrency: worker.Concurrency(getConcurrencyKey).MaxRuns(1),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\t<-ctx.Done()\n\t\t\t\t\tfmt.Println('context done, returning')\n\t\t\t\t\treturn nil, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(ch)\n\tdefer cancel()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf('error starting worker: %w', err)\n\t}\n\n\tgo func() {\n\t\t// sleep with interrupt context\n\t\tselect {\n\t\tcase <-interruptCtx.Done(): // context cancelled\n\t\t\tfmt.Println('interrupted')\n\t\t\tif err := cleanup(); err != nil {\n\t\t\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t\t\t}\n\t\t\treturn\n\t\tcase <-time.After(2 * time.Second): // timeout\n\t\t}\n\n\t\tfirstEvent := concurrencyLimitEvent{\n\t\t\tIndex: 0,\n\t\t}\n\n\t\t// push an event\n\t\terr = c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t'concurrency-test-event',\n\t\t\tfirstEvent,\n\t\t)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tselect {\n\t\tcase <-interruptCtx.Done(): // context cancelled\n\t\t\tfmt.Println('interrupted')\n\t\t\treturn\n\t\tcase <-time.After(10 * time.Second): // timeout\n\t\t}\n\n\t\t// push a second event\n\t\terr = c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t'concurrency-test-event',\n\t\t\tconcurrencyLimitEvent{\n\t\t\t\tIndex: 1,\n\t\t\t},\n\t\t)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\n\tfor {\n\t\tselect {\n\t\tcase <-interruptCtx.Done():\n\t\t\treturn nil\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype concurrencyLimitEvent struct {\n\tIndex int `json:"index"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tif err := run(cmdutils.InterruptChan(), events); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc getConcurrencyKey(ctx worker.HatchetContext) (string, error) {\n\treturn "user-create", nil\n}\n\nfunc run(ch <-chan interface{}, events chan<- string) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\ttestSvc := w.NewService("test")\n\n\terr = testSvc.On(\n\t\tworker.Events("concurrency-test-event"),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "concurrency-limit",\n\t\t\tDescription: "This limits concurrency to 1 run at a time.",\n\t\t\tConcurrency: worker.Concurrency(getConcurrencyKey).MaxRuns(1),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\t<-ctx.Done()\n\t\t\t\t\tfmt.Println("context done, returning")\n\t\t\t\t\treturn nil, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(ch)\n\tdefer cancel()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf("error starting worker: %w", err)\n\t}\n\n\tgo func() {\n\t\t// sleep with interrupt context\n\t\tselect {\n\t\tcase <-interruptCtx.Done(): // context cancelled\n\t\t\tfmt.Println("interrupted")\n\t\t\tif err := cleanup(); err != nil {\n\t\t\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t\t\t}\n\t\t\treturn\n\t\tcase <-time.After(2 * time.Second): // timeout\n\t\t}\n\n\t\tfirstEvent := concurrencyLimitEvent{\n\t\t\tIndex: 0,\n\t\t}\n\n\t\t// push an event\n\t\terr = c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t"concurrency-test-event",\n\t\t\tfirstEvent,\n\t\t)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tselect {\n\t\tcase <-interruptCtx.Done(): // context cancelled\n\t\t\tfmt.Println("interrupted")\n\t\t\treturn\n\t\tcase <-time.After(10 * time.Second): // timeout\n\t\t}\n\n\t\t// push a second event\n\t\terr = c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t"concurrency-test-event",\n\t\t\tconcurrencyLimitEvent{\n\t\t\t\tIndex: 1,\n\t\t\t},\n\t\t)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\n\tfor {\n\t\tselect {\n\t\tcase <-interruptCtx.Done():\n\t\t\treturn nil\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n}\n', source: 'out/go/z_v0/limit-concurrency/cancel-in-progress/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/limit-concurrency/group-round-robin-advanced/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/limit-concurrency/group-round-robin-advanced/main.ts index f41c48fc9..2c8844367 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/limit-concurrency/group-round-robin-advanced/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/limit-concurrency/group-round-robin-advanced/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'sync'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/client/types'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype concurrencyLimitEvent struct {\n\tConcurrencyKey string `json:'concurrency_key'`\n\tUserId int `json:'user_id'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n\tConcurrencyWhenFinished int `json:'concurrency_when_finished'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx, cancel := cmdutils.NewInterruptContext()\n\tdefer cancel()\n\n\tif err := run(ctx); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc getConcurrencyKey(ctx worker.HatchetContext) (string, error) {\n\treturn 'concurrency', nil\n}\n\nvar done = make(chan struct{})\nvar errChan = make(chan error)\n\nvar workflowCount int\nvar countMux sync.Mutex\n\nfunc run(ctx context.Context) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\t// runningCount := 0\n\n\tcountMux := sync.Mutex{}\n\n\tvar countMap = make(map[string]int)\n\tmaxConcurrent := 2\n\n\terr = w.RegisterWorkflow(\n\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'concurrency-limit-round-robin-existing-workflows',\n\t\t\tDescription: 'This limits concurrency to maxConcurrent runs at a time.',\n\t\t\tOn: worker.Events('test:concurrency-limit-round-robin-existing-workflows'),\n\t\t\tConcurrency: worker.Expression('input.concurrency_key').MaxRuns(int32(maxConcurrent)).LimitStrategy(types.GroupRoundRobin),\n\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &concurrencyLimitEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf('error getting input: %w', err)\n\t\t\t\t\t}\n\t\t\t\t\tconcurrencyKey := input.ConcurrencyKey\n\t\t\t\t\tcountMux.Lock()\n\n\t\t\t\t\tif countMap[concurrencyKey]+1 > maxConcurrent {\n\t\t\t\t\t\tcountMux.Unlock()\n\t\t\t\t\t\te := fmt.Errorf('concurrency limit exceeded for %d we have %d workers running', input.UserId, countMap[concurrencyKey])\n\t\t\t\t\t\terrChan <- e\n\t\t\t\t\t\treturn nil, e\n\t\t\t\t\t}\n\t\t\t\t\tcountMap[concurrencyKey]++\n\n\t\t\t\t\tcountMux.Unlock()\n\n\t\t\t\t\tfmt.Println('received event', input.UserId)\n\n\t\t\t\t\ttime.Sleep(10 * time.Second)\n\n\t\t\t\t\tfmt.Println('processed event', input.UserId)\n\n\t\t\t\t\tcountMux.Lock()\n\t\t\t\t\tcountMap[concurrencyKey]--\n\t\t\t\t\tcountMux.Unlock()\n\n\t\t\t\t\tdone <- struct{}{}\n\n\t\t\t\t\treturn &stepOneOutput{}, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tgo func() {\n\t\tvar workflowRuns []*client.WorkflowRun\n\n\t\tfor i := 0; i < 1; i++ {\n\t\t\tworkflowCount++\n\t\t\tevent := concurrencyLimitEvent{\n\t\t\t\tConcurrencyKey: 'key',\n\t\t\t\tUserId: i,\n\t\t\t}\n\t\t\tworkflowRuns = append(workflowRuns, &client.WorkflowRun{\n\t\t\t\tName: 'concurrency-limit-round-robin-existing-workflows',\n\t\t\t\tInput: event,\n\t\t\t})\n\n\t\t}\n\n\t\t// create a second one with a different key\n\n\t\t// so the bug we are testing here is that total concurrency for any one group should be 2\n\t\t// but if we have more than one group we end up with 4 running when only 2 + 1 are eligible to run\n\n\t\tfor i := 0; i < 3; i++ {\n\t\t\tworkflowCount++\n\n\t\t\tevent := concurrencyLimitEvent{\n\t\t\t\tConcurrencyKey: 'secondKey',\n\t\t\t\tUserId: i,\n\t\t\t}\n\t\t\tworkflowRuns = append(workflowRuns, &client.WorkflowRun{\n\t\t\t\tName: 'concurrency-limit-round-robin-existing-workflows',\n\t\t\t\tInput: event,\n\t\t\t})\n\n\t\t}\n\n\t\t_, err := c.Admin().BulkRunWorkflow(workflowRuns)\n\t\tif err != nil {\n\t\t\tfmt.Println('error running workflow', err)\n\t\t}\n\n\t\tfmt.Println('ran workflows')\n\n\t}()\n\n\ttime.Sleep(2 * time.Second)\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf('error starting worker: %w', err)\n\t}\n\tdefer cleanup()\n\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn nil\n\t\tcase <-time.After(20 * time.Second):\n\t\t\treturn fmt.Errorf('timeout')\n\t\tcase err := <-errChan:\n\t\t\treturn err\n\t\tcase <-done:\n\t\t\tcountMux.Lock()\n\t\t\tworkflowCount--\n\t\t\tcountMux.Unlock()\n\t\t\tif workflowCount == 0 {\n\t\t\t\ttime.Sleep(1 * time.Second)\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t}\n\t}\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"sync"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/client/types"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype concurrencyLimitEvent struct {\n\tConcurrencyKey string `json:"concurrency_key"`\n\tUserId int `json:"user_id"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n\tConcurrencyWhenFinished int `json:"concurrency_when_finished"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx, cancel := cmdutils.NewInterruptContext()\n\tdefer cancel()\n\n\tif err := run(ctx); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc getConcurrencyKey(ctx worker.HatchetContext) (string, error) {\n\treturn "concurrency", nil\n}\n\nvar done = make(chan struct{})\nvar errChan = make(chan error)\n\nvar workflowCount int\nvar countMux sync.Mutex\n\nfunc run(ctx context.Context) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\t// runningCount := 0\n\n\tcountMux := sync.Mutex{}\n\n\tvar countMap = make(map[string]int)\n\tmaxConcurrent := 2\n\n\terr = w.RegisterWorkflow(\n\n\t\t&worker.WorkflowJob{\n\t\t\tName: "concurrency-limit-round-robin-existing-workflows",\n\t\t\tDescription: "This limits concurrency to maxConcurrent runs at a time.",\n\t\t\tOn: worker.Events("test:concurrency-limit-round-robin-existing-workflows"),\n\t\t\tConcurrency: worker.Expression("input.concurrency_key").MaxRuns(int32(maxConcurrent)).LimitStrategy(types.GroupRoundRobin),\n\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &concurrencyLimitEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf("error getting input: %w", err)\n\t\t\t\t\t}\n\t\t\t\t\tconcurrencyKey := input.ConcurrencyKey\n\t\t\t\t\tcountMux.Lock()\n\n\t\t\t\t\tif countMap[concurrencyKey]+1 > maxConcurrent {\n\t\t\t\t\t\tcountMux.Unlock()\n\t\t\t\t\t\te := fmt.Errorf("concurrency limit exceeded for %d we have %d workers running", input.UserId, countMap[concurrencyKey])\n\t\t\t\t\t\terrChan <- e\n\t\t\t\t\t\treturn nil, e\n\t\t\t\t\t}\n\t\t\t\t\tcountMap[concurrencyKey]++\n\n\t\t\t\t\tcountMux.Unlock()\n\n\t\t\t\t\tfmt.Println("received event", input.UserId)\n\n\t\t\t\t\ttime.Sleep(10 * time.Second)\n\n\t\t\t\t\tfmt.Println("processed event", input.UserId)\n\n\t\t\t\t\tcountMux.Lock()\n\t\t\t\t\tcountMap[concurrencyKey]--\n\t\t\t\t\tcountMux.Unlock()\n\n\t\t\t\t\tdone <- struct{}{}\n\n\t\t\t\t\treturn &stepOneOutput{}, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tgo func() {\n\t\tvar workflowRuns []*client.WorkflowRun\n\n\t\tfor i := 0; i < 1; i++ {\n\t\t\tworkflowCount++\n\t\t\tevent := concurrencyLimitEvent{\n\t\t\t\tConcurrencyKey: "key",\n\t\t\t\tUserId: i,\n\t\t\t}\n\t\t\tworkflowRuns = append(workflowRuns, &client.WorkflowRun{\n\t\t\t\tName: "concurrency-limit-round-robin-existing-workflows",\n\t\t\t\tInput: event,\n\t\t\t})\n\n\t\t}\n\n\t\t// create a second one with a different key\n\n\t\t// so the bug we are testing here is that total concurrency for any one group should be 2\n\t\t// but if we have more than one group we end up with 4 running when only 2 + 1 are eligible to run\n\n\t\tfor i := 0; i < 3; i++ {\n\t\t\tworkflowCount++\n\n\t\t\tevent := concurrencyLimitEvent{\n\t\t\t\tConcurrencyKey: "secondKey",\n\t\t\t\tUserId: i,\n\t\t\t}\n\t\t\tworkflowRuns = append(workflowRuns, &client.WorkflowRun{\n\t\t\t\tName: "concurrency-limit-round-robin-existing-workflows",\n\t\t\t\tInput: event,\n\t\t\t})\n\n\t\t}\n\n\t\t_, err := c.Admin().BulkRunWorkflow(workflowRuns)\n\t\tif err != nil {\n\t\t\tfmt.Println("error running workflow", err)\n\t\t}\n\n\t\tfmt.Println("ran workflows")\n\n\t}()\n\n\ttime.Sleep(2 * time.Second)\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf("error starting worker: %w", err)\n\t}\n\tdefer cleanup()\n\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn nil\n\t\tcase <-time.After(20 * time.Second):\n\t\t\treturn fmt.Errorf("timeout")\n\t\tcase err := <-errChan:\n\t\t\treturn err\n\t\tcase <-done:\n\t\t\tcountMux.Lock()\n\t\t\tworkflowCount--\n\t\t\tcountMux.Unlock()\n\t\t\tif workflowCount == 0 {\n\t\t\t\ttime.Sleep(1 * time.Second)\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t}\n\t}\n}\n', source: 'out/go/z_v0/limit-concurrency/group-round-robin-advanced/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/limit-concurrency/group-round-robin/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/limit-concurrency/group-round-robin/main.ts index e24a32c98..987217bbc 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/limit-concurrency/group-round-robin/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/limit-concurrency/group-round-robin/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/client/types'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype concurrencyLimitEvent struct {\n\tUserId int `json:'user_id'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tif err := run(cmdutils.InterruptChan(), events); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc getConcurrencyKey(ctx worker.HatchetContext) (string, error) {\n\tinput := &concurrencyLimitEvent{}\n\terr := ctx.WorkflowInput(input)\n\n\tif err != nil {\n\t\treturn '', fmt.Errorf('error getting input: %w', err)\n\t}\n\n\treturn fmt.Sprintf('%d', input.UserId), nil\n}\n\nfunc run(ch <-chan interface{}, events chan<- string) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\ttestSvc := w.NewService('test')\n\n\terr = testSvc.On(\n\t\tworker.Events('concurrency-test-event-rr'),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'concurrency-limit-round-robin',\n\t\t\tDescription: 'This limits concurrency to 2 runs at a time.',\n\t\t\tConcurrency: worker.Concurrency(getConcurrencyKey).MaxRuns(2).LimitStrategy(types.GroupRoundRobin),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &concurrencyLimitEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf('error getting input: %w', err)\n\t\t\t\t\t}\n\n\t\t\t\t\tfmt.Println('received event', input.UserId)\n\n\t\t\t\t\ttime.Sleep(5 * time.Second)\n\n\t\t\t\t\tfmt.Println('processed event', input.UserId)\n\n\t\t\t\t\treturn nil, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(ch)\n\tdefer cancel()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf('error starting worker: %w', err)\n\t}\n\n\tgo func() {\n\t\t// sleep with interrupt context\n\t\tselect {\n\t\tcase <-interruptCtx.Done(): // context cancelled\n\t\t\tfmt.Println('interrupted')\n\t\t\treturn\n\t\tcase <-time.After(2 * time.Second): // timeout\n\t\t}\n\n\t\tfor i := 0; i < 20; i++ {\n\t\t\tvar event concurrencyLimitEvent\n\n\t\t\tif i < 10 {\n\t\t\t\tevent = concurrencyLimitEvent{0}\n\t\t\t} else {\n\t\t\t\tevent = concurrencyLimitEvent{1}\n\t\t\t}\n\n\t\t\tc.Event().Push(context.Background(), 'concurrency-test-event-rr', event)\n\t\t}\n\n\t\tselect {\n\t\tcase <-interruptCtx.Done(): // context cancelled\n\t\t\tfmt.Println('interrupted')\n\t\t\treturn\n\t\tcase <-time.After(10 * time.Second): //timeout\n\t\t}\n\t}()\n\n\tfor {\n\t\tselect {\n\t\tcase <-interruptCtx.Done():\n\t\t\tif err := cleanup(); err != nil {\n\t\t\t\treturn fmt.Errorf('error cleaning up: %w', err)\n\t\t\t}\n\t\t\treturn nil\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/client/types"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype concurrencyLimitEvent struct {\n\tUserId int `json:"user_id"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tif err := run(cmdutils.InterruptChan(), events); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc getConcurrencyKey(ctx worker.HatchetContext) (string, error) {\n\tinput := &concurrencyLimitEvent{}\n\terr := ctx.WorkflowInput(input)\n\n\tif err != nil {\n\t\treturn "", fmt.Errorf("error getting input: %w", err)\n\t}\n\n\treturn fmt.Sprintf("%d", input.UserId), nil\n}\n\nfunc run(ch <-chan interface{}, events chan<- string) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\ttestSvc := w.NewService("test")\n\n\terr = testSvc.On(\n\t\tworker.Events("concurrency-test-event-rr"),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "concurrency-limit-round-robin",\n\t\t\tDescription: "This limits concurrency to 2 runs at a time.",\n\t\t\tConcurrency: worker.Concurrency(getConcurrencyKey).MaxRuns(2).LimitStrategy(types.GroupRoundRobin),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &concurrencyLimitEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf("error getting input: %w", err)\n\t\t\t\t\t}\n\n\t\t\t\t\tfmt.Println("received event", input.UserId)\n\n\t\t\t\t\ttime.Sleep(5 * time.Second)\n\n\t\t\t\t\tfmt.Println("processed event", input.UserId)\n\n\t\t\t\t\treturn nil, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(ch)\n\tdefer cancel()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf("error starting worker: %w", err)\n\t}\n\n\tgo func() {\n\t\t// sleep with interrupt context\n\t\tselect {\n\t\tcase <-interruptCtx.Done(): // context cancelled\n\t\t\tfmt.Println("interrupted")\n\t\t\treturn\n\t\tcase <-time.After(2 * time.Second): // timeout\n\t\t}\n\n\t\tfor i := 0; i < 20; i++ {\n\t\t\tvar event concurrencyLimitEvent\n\n\t\t\tif i < 10 {\n\t\t\t\tevent = concurrencyLimitEvent{0}\n\t\t\t} else {\n\t\t\t\tevent = concurrencyLimitEvent{1}\n\t\t\t}\n\n\t\t\tc.Event().Push(context.Background(), "concurrency-test-event-rr", event)\n\t\t}\n\n\t\tselect {\n\t\tcase <-interruptCtx.Done(): // context cancelled\n\t\t\tfmt.Println("interrupted")\n\t\t\treturn\n\t\tcase <-time.After(10 * time.Second): //timeout\n\t\t}\n\t}()\n\n\tfor {\n\t\tselect {\n\t\tcase <-interruptCtx.Done():\n\t\t\tif err := cleanup(); err != nil {\n\t\t\t\treturn fmt.Errorf("error cleaning up: %w", err)\n\t\t\t}\n\t\t\treturn nil\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n}\n', source: 'out/go/z_v0/limit-concurrency/group-round-robin/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/logging/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/logging/main.ts index 7b6403519..836e447a0 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/logging/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/logging/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'log'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n}\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events('user:log:simple'),\n\t\t\tName: 'simple',\n\t\t\tDescription: 'This runs after an update to the user model.',\n\t\t\tConcurrency: worker.Expression('input.user_id'),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-one')\n\t\t\t\t\tevents <- 'step-one'\n\n\t\t\t\t\tfor i := 0; i < 1000; i++ {\n\t\t\t\t\t\tctx.Log(fmt.Sprintf('step-one: %d', i))\n\t\t\t\t\t}\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Username is: ' + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tgo func() {\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: 'echo-test',\n\t\t\tUserID: '1234',\n\t\t\tData: map[string]string{\n\t\t\t\t'test': 'test',\n\t\t\t},\n\t\t}\n\n\t\tlog.Printf('pushing event user:create:simple')\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t'user:log:simple',\n\t\t\ttestEvent,\n\t\t\tclient.WithEventMetadata(map[string]string{\n\t\t\t\t'hello': 'world',\n\t\t\t}),\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error pushing event: %w', err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn cleanup, nil\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n}\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events("user:log:simple"),\n\t\t\tName: "simple",\n\t\t\tDescription: "This runs after an update to the user model.",\n\t\t\tConcurrency: worker.Expression("input.user_id"),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-one")\n\t\t\t\t\tevents <- "step-one"\n\n\t\t\t\t\tfor i := 0; i < 1000; i++ {\n\t\t\t\t\t\tctx.Log(fmt.Sprintf("step-one: %d", i))\n\t\t\t\t\t}\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Username is: " + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tgo func() {\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: "echo-test",\n\t\t\tUserID: "1234",\n\t\t\tData: map[string]string{\n\t\t\t\t"test": "test",\n\t\t\t},\n\t\t}\n\n\t\tlog.Printf("pushing event user:create:simple")\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t"user:log:simple",\n\t\t\ttestEvent,\n\t\t\tclient.WithEventMetadata(map[string]string{\n\t\t\t\t"hello": "world",\n\t\t\t}),\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error pushing event: %w", err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn cleanup, nil\n}\n', source: 'out/go/z_v0/logging/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/manual-trigger/trigger/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/manual-trigger/trigger/main.ts index ac11aaf5d..729545a95 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/manual-trigger/trigger/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/manual-trigger/trigger/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tif err := run(cmdutils.InterruptChan(), events); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc run(ch <-chan interface{}, events chan<- string) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating client: %w', err)\n\t}\n\n\ttime.Sleep(1 * time.Second)\n\n\t// trigger workflow\n\tworkflow, err := c.Admin().RunWorkflow(\n\t\t'post-user-update',\n\t\t&userCreateEvent{\n\t\t\tUsername: 'echo-test',\n\t\t\tUserID: '1234',\n\t\t\tData: map[string]string{\n\t\t\t\t'test': 'test',\n\t\t\t},\n\t\t},\n\t\tclient.WithRunMetadata(map[string]interface{}{\n\t\t\t'hello': 'world',\n\t\t}),\n\t)\n\n\tif err != nil {\n\t\treturn fmt.Errorf('error running workflow: %w', err)\n\t}\n\n\tfmt.Println('workflow run id:', workflow.WorkflowRunId())\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(ch)\n\tdefer cancel()\n\n\terr = c.Subscribe().On(interruptCtx, workflow.WorkflowRunId(), func(event client.WorkflowEvent) error {\n\t\tfmt.Println(event.EventPayload)\n\n\t\treturn nil\n\t})\n\n\treturn err\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tif err := run(cmdutils.InterruptChan(), events); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc run(ch <-chan interface{}, events chan<- string) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating client: %w", err)\n\t}\n\n\ttime.Sleep(1 * time.Second)\n\n\t// trigger workflow\n\tworkflow, err := c.Admin().RunWorkflow(\n\t\t"post-user-update",\n\t\t&userCreateEvent{\n\t\t\tUsername: "echo-test",\n\t\t\tUserID: "1234",\n\t\t\tData: map[string]string{\n\t\t\t\t"test": "test",\n\t\t\t},\n\t\t},\n\t\tclient.WithRunMetadata(map[string]interface{}{\n\t\t\t"hello": "world",\n\t\t}),\n\t)\n\n\tif err != nil {\n\t\treturn fmt.Errorf("error running workflow: %w", err)\n\t}\n\n\tfmt.Println("workflow run id:", workflow.WorkflowRunId())\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(ch)\n\tdefer cancel()\n\n\terr = c.Subscribe().On(interruptCtx, workflow.WorkflowRunId(), func(event client.WorkflowEvent) error {\n\t\tfmt.Println(event.EventPayload)\n\n\t\treturn nil\n\t})\n\n\treturn err\n}\n', source: 'out/go/z_v0/manual-trigger/trigger/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/manual-trigger/worker/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/manual-trigger/worker/main.ts index cc3c59dde..5c7357f99 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/manual-trigger/worker/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/manual-trigger/worker/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tif err := run(cmdutils.InterruptChan(), events); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc run(ch <-chan interface{}, events chan<- string) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\ttestSvc := w.NewService('test')\n\n\terr = testSvc.On(\n\t\tworker.Events('user:create:simple'),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'post-user-update',\n\t\t\tDescription: 'This runs after an update to the user model.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\t\t\t\t\tctx.WorkflowInput(input)\n\n\t\t\t\t\ttime.Sleep(1 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: 'Step 1 got username: ' + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\t\t\t\t\tctx.WorkflowInput(input)\n\n\t\t\t\t\ttime.Sleep(2 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: 'Step 2 got username: ' + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-two'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tstep1Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput('step-one', step1Out)\n\n\t\t\t\t\tstep2Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput('step-two', step2Out)\n\n\t\t\t\t\ttime.Sleep(3 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: 'Step 3: has parents 1 and 2:' + step1Out.Message + ', ' + step2Out.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-three').AddParents('step-one', 'step-two'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tstep1Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput('step-one', step1Out)\n\n\t\t\t\t\tstep3Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput('step-three', step3Out)\n\n\t\t\t\t\ttime.Sleep(4 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: 'Step 4: has parents 1 and 3' + step1Out.Message + ', ' + step3Out.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-four').AddParents('step-one', 'step-three'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tstep4Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput('step-four', step4Out)\n\n\t\t\t\t\ttime.Sleep(5 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: 'Step 5: has parent 4' + step4Out.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-five').AddParents('step-four'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf('error starting worker: %w', err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\treturn fmt.Errorf('error cleaning up: %w', err)\n\t}\n\n\treturn nil\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tif err := run(cmdutils.InterruptChan(), events); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc run(ch <-chan interface{}, events chan<- string) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\ttestSvc := w.NewService("test")\n\n\terr = testSvc.On(\n\t\tworker.Events("user:create:simple"),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "post-user-update",\n\t\t\tDescription: "This runs after an update to the user model.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\t\t\t\t\tctx.WorkflowInput(input)\n\n\t\t\t\t\ttime.Sleep(1 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: "Step 1 got username: " + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\t\t\t\t\tctx.WorkflowInput(input)\n\n\t\t\t\t\ttime.Sleep(2 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: "Step 2 got username: " + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-two"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tstep1Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput("step-one", step1Out)\n\n\t\t\t\t\tstep2Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput("step-two", step2Out)\n\n\t\t\t\t\ttime.Sleep(3 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: "Step 3: has parents 1 and 2:" + step1Out.Message + ", " + step2Out.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-three").AddParents("step-one", "step-two"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tstep1Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput("step-one", step1Out)\n\n\t\t\t\t\tstep3Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput("step-three", step3Out)\n\n\t\t\t\t\ttime.Sleep(4 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: "Step 4: has parents 1 and 3" + step1Out.Message + ", " + step3Out.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-four").AddParents("step-one", "step-three"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tstep4Out := &stepOutput{}\n\t\t\t\t\tctx.StepOutput("step-four", step4Out)\n\n\t\t\t\t\ttime.Sleep(5 * time.Second)\n\n\t\t\t\t\treturn &stepOutput{\n\t\t\t\t\t\tMessage: "Step 5: has parent 4" + step4Out.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-five").AddParents("step-four"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf("error starting worker: %w", err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\treturn fmt.Errorf("error cleaning up: %w", err)\n\t}\n\n\treturn nil\n}\n', source: 'out/go/z_v0/manual-trigger/worker/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/middleware/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/middleware/main.ts index a3c6da604..ce6384183 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/middleware/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/middleware/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tch := cmdutils.InterruptChan()\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('cleanup() error = %v', err))\n\t}\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tch := cmdutils.InterruptChan()\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("cleanup() error = %v", err))\n\t}\n}\n', source: 'out/go/z_v0/middleware/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/middleware/run.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/middleware/run.ts index 5cdfd8280..1d2a3e3ee 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/middleware/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/middleware/run.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'log'\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\tw.Use(func(ctx worker.HatchetContext, next func(worker.HatchetContext) error) error {\n\t\tlog.Printf('1st-middleware')\n\t\tevents <- '1st-middleware'\n\t\tctx.SetContext(context.WithValue(ctx.GetContext(), 'testkey', 'testvalue'))\n\t\treturn next(ctx)\n\t})\n\n\tw.Use(func(ctx worker.HatchetContext, next func(worker.HatchetContext) error) error {\n\t\tlog.Printf('2nd-middleware')\n\t\tevents <- '2nd-middleware'\n\n\t\t// time the function duration\n\t\tstart := time.Now()\n\t\terr := next(ctx)\n\t\tduration := time.Since(start)\n\t\tfmt.Printf('step function took %s\\n', duration)\n\t\treturn err\n\t})\n\n\ttestSvc := w.NewService('test')\n\n\ttestSvc.Use(func(ctx worker.HatchetContext, next func(worker.HatchetContext) error) error {\n\t\tevents <- 'svc-middleware'\n\t\tctx.SetContext(context.WithValue(ctx.GetContext(), 'svckey', 'svcvalue'))\n\t\treturn next(ctx)\n\t})\n\n\terr = testSvc.On(\n\t\tworker.Events('user:create:middleware'),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'middleware',\n\t\t\tDescription: 'This runs after an update to the user model.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-one')\n\t\t\t\t\tevents <- 'step-one'\n\n\t\t\t\t\ttestVal := ctx.Value('testkey').(string)\n\t\t\t\t\tevents <- testVal\n\t\t\t\t\tsvcVal := ctx.Value('svckey').(string)\n\t\t\t\t\tevents <- svcVal\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Username is: ' + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &stepOneOutput{}\n\t\t\t\t\terr = ctx.StepOutput('step-one', input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-two')\n\t\t\t\t\tevents <- 'step-two'\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Above message is: ' + input.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-two').AddParents('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tgo func() {\n\t\tlog.Printf('pushing event user:create:middleware')\n\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: 'echo-test',\n\t\t\tUserID: '1234',\n\t\t\tData: map[string]string{\n\t\t\t\t'test': 'test',\n\t\t\t},\n\t\t}\n\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t'user:create:middleware',\n\t\t\ttestEvent,\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error pushing event: %w', err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error starting worker: %w', err)\n\t}\n\n\treturn cleanup, nil\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\tw.Use(func(ctx worker.HatchetContext, next func(worker.HatchetContext) error) error {\n\t\tlog.Printf("1st-middleware")\n\t\tevents <- "1st-middleware"\n\t\tctx.SetContext(context.WithValue(ctx.GetContext(), "testkey", "testvalue"))\n\t\treturn next(ctx)\n\t})\n\n\tw.Use(func(ctx worker.HatchetContext, next func(worker.HatchetContext) error) error {\n\t\tlog.Printf("2nd-middleware")\n\t\tevents <- "2nd-middleware"\n\n\t\t// time the function duration\n\t\tstart := time.Now()\n\t\terr := next(ctx)\n\t\tduration := time.Since(start)\n\t\tfmt.Printf("step function took %s\\n", duration)\n\t\treturn err\n\t})\n\n\ttestSvc := w.NewService("test")\n\n\ttestSvc.Use(func(ctx worker.HatchetContext, next func(worker.HatchetContext) error) error {\n\t\tevents <- "svc-middleware"\n\t\tctx.SetContext(context.WithValue(ctx.GetContext(), "svckey", "svcvalue"))\n\t\treturn next(ctx)\n\t})\n\n\terr = testSvc.On(\n\t\tworker.Events("user:create:middleware"),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "middleware",\n\t\t\tDescription: "This runs after an update to the user model.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-one")\n\t\t\t\t\tevents <- "step-one"\n\n\t\t\t\t\ttestVal := ctx.Value("testkey").(string)\n\t\t\t\t\tevents <- testVal\n\t\t\t\t\tsvcVal := ctx.Value("svckey").(string)\n\t\t\t\t\tevents <- svcVal\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Username is: " + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &stepOneOutput{}\n\t\t\t\t\terr = ctx.StepOutput("step-one", input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-two")\n\t\t\t\t\tevents <- "step-two"\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Above message is: " + input.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-two").AddParents("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tgo func() {\n\t\tlog.Printf("pushing event user:create:middleware")\n\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: "echo-test",\n\t\t\tUserID: "1234",\n\t\t\tData: map[string]string{\n\t\t\t\t"test": "test",\n\t\t\t},\n\t\t}\n\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t"user:create:middleware",\n\t\t\ttestEvent,\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error pushing event: %w", err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error starting worker: %w", err)\n\t}\n\n\treturn cleanup, nil\n}\n', source: 'out/go/z_v0/middleware/run.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/namespaced/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/namespaced/main.ts index f362877f4..f4f5d9c99 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/namespaced/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/namespaced/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'log'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n}\n\nfunc getConcurrencyKey(ctx worker.HatchetContext) (string, error) {\n\treturn 'user-create', nil\n}\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New(\n\t\tclient.WithNamespace('sample'),\n\t)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\ttestSvc := w.NewService('test')\n\n\terr = testSvc.On(\n\t\tworker.Events('user:create:simple'),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'simple',\n\t\t\tDescription: 'This runs after an update to the user model.',\n\t\t\tConcurrency: worker.Concurrency(getConcurrencyKey),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-one')\n\t\t\t\t\tevents <- 'step-one'\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Username is: ' + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &stepOneOutput{}\n\t\t\t\t\terr = ctx.StepOutput('step-one', input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-two')\n\t\t\t\t\tevents <- 'step-two'\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Above message is: ' + input.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-two').AddParents('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tgo func() {\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: 'echo-test',\n\t\t\tUserID: '1234',\n\t\t\tData: map[string]string{\n\t\t\t\t'test': 'test',\n\t\t\t},\n\t\t}\n\n\t\tlog.Printf('pushing event user:create:simple')\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t'user:create:simple',\n\t\t\ttestEvent,\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error pushing event: %w', err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn cleanup, nil\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n}\n\nfunc getConcurrencyKey(ctx worker.HatchetContext) (string, error) {\n\treturn "user-create", nil\n}\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New(\n\t\tclient.WithNamespace("sample"),\n\t)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\ttestSvc := w.NewService("test")\n\n\terr = testSvc.On(\n\t\tworker.Events("user:create:simple"),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "simple",\n\t\t\tDescription: "This runs after an update to the user model.",\n\t\t\tConcurrency: worker.Concurrency(getConcurrencyKey),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-one")\n\t\t\t\t\tevents <- "step-one"\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Username is: " + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &stepOneOutput{}\n\t\t\t\t\terr = ctx.StepOutput("step-one", input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-two")\n\t\t\t\t\tevents <- "step-two"\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Above message is: " + input.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-two").AddParents("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tgo func() {\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: "echo-test",\n\t\t\tUserID: "1234",\n\t\t\tData: map[string]string{\n\t\t\t\t"test": "test",\n\t\t\t},\n\t\t}\n\n\t\tlog.Printf("pushing event user:create:simple")\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t"user:create:simple",\n\t\t\ttestEvent,\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error pushing event: %w", err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn cleanup, nil\n}\n', source: 'out/go/z_v0/namespaced/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/no-tls/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/no-tls/main.ts index e9eea5f3b..63b01be28 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/no-tls/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/no-tls/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype stepOutput struct{}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(fmt.Sprintf('error creating client: %v', err))\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t\tworker.WithMaxRuns(1),\n\t)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf('error creating worker: %v', err))\n\t}\n\n\ttestSvc := w.NewService('test')\n\n\terr = testSvc.On(\n\t\tworker.Events('simple'),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'simple-workflow',\n\t\t\tDescription: 'Simple one-step workflow.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tfmt.Println('executed step 1')\n\n\t\t\t\t\treturn &stepOutput{}, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf('error registering workflow: %v', err))\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(fmt.Sprintf('error starting worker: %v', err))\n\t}\n\n\t<-interruptCtx.Done()\n\tif err := cleanup(); err != nil {\n\t\tpanic(err)\n\t}\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype stepOutput struct{}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(fmt.Sprintf("error creating client: %v", err))\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t\tworker.WithMaxRuns(1),\n\t)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf("error creating worker: %v", err))\n\t}\n\n\ttestSvc := w.NewService("test")\n\n\terr = testSvc.On(\n\t\tworker.Events("simple"),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "simple-workflow",\n\t\t\tDescription: "Simple one-step workflow.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOutput, err error) {\n\t\t\t\t\tfmt.Println("executed step 1")\n\n\t\t\t\t\treturn &stepOutput{}, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf("error registering workflow: %v", err))\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(fmt.Sprintf("error starting worker: %v", err))\n\t}\n\n\t<-interruptCtx.Done()\n\tif err := cleanup(); err != nil {\n\t\tpanic(err)\n\t}\n}\n', source: 'out/go/z_v0/no-tls/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/on-failure/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/on-failure/main.ts index 091645ee8..433b0bef4 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/on-failure/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/on-failure/main.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\n// > OnFailure Step\n// This workflow will fail because the step will throw an error\n// we define an onFailure step to handle this case\n\nfunc StepOne(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t// 👀 this step will always raise an exception\n\treturn nil, fmt.Errorf('test on failure')\n}\n\nfunc OnFailure(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t// run cleanup code or notifications here\n\n\t// 👀 you can access the error from the failed step(s) like this\n\tfmt.Println(ctx.StepRunErrors())\n\n\treturn &stepOneOutput{\n\t\tMessage: 'Failure!',\n\t}, nil\n}\n\nfunc main() {\n\t// ...\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// 👀 we define an onFailure step to handle this case\n\terr = w.On(\n\t\tworker.NoTrigger(),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'on-failure-workflow',\n\t\t\tDescription: 'This runs at a scheduled time.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(StepOne).SetName('step-one'),\n\t\t\t},\n\t\t\tOnFailure: &worker.WorkflowJob{\n\t\t\t\tName: 'scheduled-workflow-failure',\n\t\t\t\tDescription: 'This runs when the scheduled workflow fails.',\n\t\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\t\tworker.Fn(OnFailure).SetName('on-failure'),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\n\t// ...\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-interruptCtx.Done():\n\t\t\tif err := cleanup(); err != nil {\n\t\t\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t\t\t}\n\t\t\treturn\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n\t// ,\n}\n\n", + 'package main\n\nimport (\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\n// > OnFailure Step\n// This workflow will fail because the step will throw an error\n// we define an onFailure step to handle this case\n\nfunc StepOne(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t// 👀 this step will always raise an exception\n\treturn nil, fmt.Errorf("test on failure")\n}\n\nfunc OnFailure(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t// run cleanup code or notifications here\n\n\t// 👀 you can access the error from the failed step(s) like this\n\tfmt.Println(ctx.StepRunErrors())\n\n\treturn &stepOneOutput{\n\t\tMessage: "Failure!",\n\t}, nil\n}\n\nfunc main() {\n\t// ...\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// 👀 we define an onFailure step to handle this case\n\terr = w.On(\n\t\tworker.NoTrigger(),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "on-failure-workflow",\n\t\t\tDescription: "This runs at a scheduled time.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(StepOne).SetName("step-one"),\n\t\t\t},\n\t\t\tOnFailure: &worker.WorkflowJob{\n\t\t\t\tName: "scheduled-workflow-failure",\n\t\t\t\tDescription: "This runs when the scheduled workflow fails.",\n\t\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\t\tworker.Fn(OnFailure).SetName("on-failure"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\n\t// ...\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-interruptCtx.Done():\n\t\t\tif err := cleanup(); err != nil {\n\t\t\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t\t\t}\n\t\t\treturn\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n\t// ,\n}\n\n', source: 'out/go/z_v0/on-failure/main.go', blocks: { onfailure_step: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/procedural/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/procedural/main.ts index 8fb16fa30..ba62114c8 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/procedural/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/procedural/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'sync'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\t'golang.org/x/sync/errgroup'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\nconst NUM_CHILDREN = 50\n\ntype proceduralChildInput struct {\n\tIndex int `json:'index'`\n}\n\ntype proceduralChildOutput struct {\n\tIndex int `json:'index'`\n}\n\ntype proceduralParentOutput struct {\n\tChildSum int `json:'child_sum'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 5*NUM_CHILDREN)\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n}\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\ttestSvc := w.NewService('test')\n\n\terr = testSvc.On(\n\t\tworker.NoTrigger(),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'procedural-parent-workflow',\n\t\t\tDescription: 'This is a test of procedural workflows.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(\n\t\t\t\t\tfunc(ctx worker.HatchetContext) (result *proceduralParentOutput, err error) {\n\t\t\t\t\t\tchildWorkflows := make([]*client.Workflow, NUM_CHILDREN)\n\n\t\t\t\t\t\tfor i := 0; i < NUM_CHILDREN; i++ {\n\t\t\t\t\t\t\tchildInput := proceduralChildInput{\n\t\t\t\t\t\t\t\tIndex: i,\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tchildWorkflow, err := ctx.SpawnWorkflow('procedural-child-workflow', childInput, &worker.SpawnWorkflowOpts{\n\t\t\t\t\t\t\t\tAdditionalMetadata: &map[string]string{\n\t\t\t\t\t\t\t\t\t'childKey': 'childValue',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tchildWorkflows[i] = childWorkflow\n\n\t\t\t\t\t\t\tevents <- fmt.Sprintf('child-%d-started', i)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\teg := errgroup.Group{}\n\n\t\t\t\t\t\teg.SetLimit(NUM_CHILDREN)\n\n\t\t\t\t\t\tchildOutputs := make([]int, 0)\n\t\t\t\t\t\tchildOutputsMu := sync.Mutex{}\n\n\t\t\t\t\t\tfor i, childWorkflow := range childWorkflows {\n\t\t\t\t\t\t\teg.Go(func(i int, childWorkflow *client.Workflow) func() error {\n\t\t\t\t\t\t\t\treturn func() error {\n\t\t\t\t\t\t\t\t\tchildResult, err := childWorkflow.Result()\n\n\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tchildOutput := proceduralChildOutput{}\n\n\t\t\t\t\t\t\t\t\terr = childResult.StepOutput('step-one', &childOutput)\n\n\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tchildOutputsMu.Lock()\n\t\t\t\t\t\t\t\t\tchildOutputs = append(childOutputs, childOutput.Index)\n\t\t\t\t\t\t\t\t\tchildOutputsMu.Unlock()\n\n\t\t\t\t\t\t\t\t\tevents <- fmt.Sprintf('child-%d-completed', childOutput.Index)\n\n\t\t\t\t\t\t\t\t\treturn nil\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}(i, childWorkflow))\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfinishedCh := make(chan struct{})\n\n\t\t\t\t\t\tgo func() {\n\t\t\t\t\t\t\tdefer close(finishedCh)\n\t\t\t\t\t\t\terr = eg.Wait()\n\t\t\t\t\t\t}()\n\n\t\t\t\t\t\ttimer := time.NewTimer(60 * time.Second)\n\n\t\t\t\t\t\tselect {\n\t\t\t\t\t\tcase <-finishedCh:\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tcase <-timer.C:\n\t\t\t\t\t\t\tincomplete := make([]int, 0)\n\t\t\t\t\t\t\t// print non-complete children\n\t\t\t\t\t\t\tfor i := range childWorkflows {\n\t\t\t\t\t\t\t\tcompleted := false\n\t\t\t\t\t\t\t\tfor _, childOutput := range childOutputs {\n\t\t\t\t\t\t\t\t\tif childOutput == i {\n\t\t\t\t\t\t\t\t\t\tcompleted = true\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif !completed {\n\t\t\t\t\t\t\t\t\tincomplete = append(incomplete, i)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn nil, fmt.Errorf('timed out waiting for the following child workflows to complete: %v', incomplete)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsum := 0\n\n\t\t\t\t\t\tfor _, childOutput := range childOutputs {\n\t\t\t\t\t\t\tsum += childOutput\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn &proceduralParentOutput{\n\t\t\t\t\t\t\tChildSum: sum,\n\t\t\t\t\t\t}, nil\n\t\t\t\t\t},\n\t\t\t\t).SetTimeout('10m'),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\terr = testSvc.On(\n\t\tworker.NoTrigger(),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'procedural-child-workflow',\n\t\t\tDescription: 'This is a test of procedural workflows.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(\n\t\t\t\t\tfunc(ctx worker.HatchetContext) (result *proceduralChildOutput, err error) {\n\t\t\t\t\t\tinput := proceduralChildInput{}\n\n\t\t\t\t\t\terr = ctx.WorkflowInput(&input)\n\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn &proceduralChildOutput{\n\t\t\t\t\t\t\tIndex: input.Index,\n\t\t\t\t\t\t}, nil\n\t\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tgo func() {\n\t\ttime.Sleep(1 * time.Second)\n\n\t\t_, err := c.Admin().RunWorkflow('procedural-parent-workflow', nil)\n\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error running workflow: %w', err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn cleanup, nil\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\t"sync"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\t"golang.org/x/sync/errgroup"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\nconst NUM_CHILDREN = 50\n\ntype proceduralChildInput struct {\n\tIndex int `json:"index"`\n}\n\ntype proceduralChildOutput struct {\n\tIndex int `json:"index"`\n}\n\ntype proceduralParentOutput struct {\n\tChildSum int `json:"child_sum"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 5*NUM_CHILDREN)\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n}\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\ttestSvc := w.NewService("test")\n\n\terr = testSvc.On(\n\t\tworker.NoTrigger(),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "procedural-parent-workflow",\n\t\t\tDescription: "This is a test of procedural workflows.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(\n\t\t\t\t\tfunc(ctx worker.HatchetContext) (result *proceduralParentOutput, err error) {\n\t\t\t\t\t\tchildWorkflows := make([]*client.Workflow, NUM_CHILDREN)\n\n\t\t\t\t\t\tfor i := 0; i < NUM_CHILDREN; i++ {\n\t\t\t\t\t\t\tchildInput := proceduralChildInput{\n\t\t\t\t\t\t\t\tIndex: i,\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tchildWorkflow, err := ctx.SpawnWorkflow("procedural-child-workflow", childInput, &worker.SpawnWorkflowOpts{\n\t\t\t\t\t\t\t\tAdditionalMetadata: &map[string]string{\n\t\t\t\t\t\t\t\t\t"childKey": "childValue",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tchildWorkflows[i] = childWorkflow\n\n\t\t\t\t\t\t\tevents <- fmt.Sprintf("child-%d-started", i)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\teg := errgroup.Group{}\n\n\t\t\t\t\t\teg.SetLimit(NUM_CHILDREN)\n\n\t\t\t\t\t\tchildOutputs := make([]int, 0)\n\t\t\t\t\t\tchildOutputsMu := sync.Mutex{}\n\n\t\t\t\t\t\tfor i, childWorkflow := range childWorkflows {\n\t\t\t\t\t\t\teg.Go(func(i int, childWorkflow *client.Workflow) func() error {\n\t\t\t\t\t\t\t\treturn func() error {\n\t\t\t\t\t\t\t\t\tchildResult, err := childWorkflow.Result()\n\n\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tchildOutput := proceduralChildOutput{}\n\n\t\t\t\t\t\t\t\t\terr = childResult.StepOutput("step-one", &childOutput)\n\n\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tchildOutputsMu.Lock()\n\t\t\t\t\t\t\t\t\tchildOutputs = append(childOutputs, childOutput.Index)\n\t\t\t\t\t\t\t\t\tchildOutputsMu.Unlock()\n\n\t\t\t\t\t\t\t\t\tevents <- fmt.Sprintf("child-%d-completed", childOutput.Index)\n\n\t\t\t\t\t\t\t\t\treturn nil\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}(i, childWorkflow))\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfinishedCh := make(chan struct{})\n\n\t\t\t\t\t\tgo func() {\n\t\t\t\t\t\t\tdefer close(finishedCh)\n\t\t\t\t\t\t\terr = eg.Wait()\n\t\t\t\t\t\t}()\n\n\t\t\t\t\t\ttimer := time.NewTimer(60 * time.Second)\n\n\t\t\t\t\t\tselect {\n\t\t\t\t\t\tcase <-finishedCh:\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tcase <-timer.C:\n\t\t\t\t\t\t\tincomplete := make([]int, 0)\n\t\t\t\t\t\t\t// print non-complete children\n\t\t\t\t\t\t\tfor i := range childWorkflows {\n\t\t\t\t\t\t\t\tcompleted := false\n\t\t\t\t\t\t\t\tfor _, childOutput := range childOutputs {\n\t\t\t\t\t\t\t\t\tif childOutput == i {\n\t\t\t\t\t\t\t\t\t\tcompleted = true\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif !completed {\n\t\t\t\t\t\t\t\t\tincomplete = append(incomplete, i)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn nil, fmt.Errorf("timed out waiting for the following child workflows to complete: %v", incomplete)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsum := 0\n\n\t\t\t\t\t\tfor _, childOutput := range childOutputs {\n\t\t\t\t\t\t\tsum += childOutput\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn &proceduralParentOutput{\n\t\t\t\t\t\t\tChildSum: sum,\n\t\t\t\t\t\t}, nil\n\t\t\t\t\t},\n\t\t\t\t).SetTimeout("10m"),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\terr = testSvc.On(\n\t\tworker.NoTrigger(),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "procedural-child-workflow",\n\t\t\tDescription: "This is a test of procedural workflows.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(\n\t\t\t\t\tfunc(ctx worker.HatchetContext) (result *proceduralChildOutput, err error) {\n\t\t\t\t\t\tinput := proceduralChildInput{}\n\n\t\t\t\t\t\terr = ctx.WorkflowInput(&input)\n\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn &proceduralChildOutput{\n\t\t\t\t\t\t\tIndex: input.Index,\n\t\t\t\t\t\t}, nil\n\t\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tgo func() {\n\t\ttime.Sleep(1 * time.Second)\n\n\t\t_, err := c.Admin().RunWorkflow("procedural-parent-workflow", nil)\n\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error running workflow: %w", err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn cleanup, nil\n}\n', source: 'out/go/z_v0/procedural/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/rate-limit/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/rate-limit/main.ts index 9e9a8734e..3fe95b4eb 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/rate-limit/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/rate-limit/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/client/types'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype rateLimitInput struct {\n\tIndex int `json:'index'`\n\tUserId string `json:'user_id'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc StepOne(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\tinput := &rateLimitInput{}\n\n\terr = ctx.WorkflowInput(input)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tctx.StreamEvent([]byte(fmt.Sprintf('This is a stream event %d', input.Index)))\n\n\treturn &stepOneOutput{\n\t\tMessage: fmt.Sprintf('This ran at %s', time.Now().String()),\n\t}, nil\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = c.Admin().PutRateLimit('api1', &types.RateLimitOpts{\n\t\tMax: 12,\n\t\tDuration: types.Minute,\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tunitExpr := 'int(input.index) + 1'\n\tkeyExpr := 'input.user_id'\n\tlimitValueExpr := '3'\n\n\terr = w.On(\n\t\tworker.NoTrigger(),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'rate-limit-workflow',\n\t\t\tDescription: 'This illustrates rate limiting.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(StepOne).SetName('step-one').SetRateLimit(\n\t\t\t\t\tworker.RateLimit{\n\t\t\t\t\t\tKey: 'per-user-rate-limit',\n\t\t\t\t\t\tKeyExpr: &keyExpr,\n\t\t\t\t\t\tUnitsExpr: &unitExpr,\n\t\t\t\t\t\tLimitValueExpr: &limitValueExpr,\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor i := 0; i < 12; i++ {\n\t\tfor j := 0; j < 3; j++ {\n\t\t\t_, err = c.Admin().RunWorkflow('rate-limit-workflow', &rateLimitInput{\n\t\t\t\tIndex: j,\n\t\t\t\tUserId: fmt.Sprintf('user-%d', i),\n\t\t\t})\n\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t}\n\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/client/types"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype rateLimitInput struct {\n\tIndex int `json:"index"`\n\tUserId string `json:"user_id"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc StepOne(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\tinput := &rateLimitInput{}\n\n\terr = ctx.WorkflowInput(input)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tctx.StreamEvent([]byte(fmt.Sprintf("This is a stream event %d", input.Index)))\n\n\treturn &stepOneOutput{\n\t\tMessage: fmt.Sprintf("This ran at %s", time.Now().String()),\n\t}, nil\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = c.Admin().PutRateLimit("api1", &types.RateLimitOpts{\n\t\tMax: 12,\n\t\tDuration: types.Minute,\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tunitExpr := "int(input.index) + 1"\n\tkeyExpr := "input.user_id"\n\tlimitValueExpr := "3"\n\n\terr = w.On(\n\t\tworker.NoTrigger(),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "rate-limit-workflow",\n\t\t\tDescription: "This illustrates rate limiting.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(StepOne).SetName("step-one").SetRateLimit(\n\t\t\t\t\tworker.RateLimit{\n\t\t\t\t\t\tKey: "per-user-rate-limit",\n\t\t\t\t\t\tKeyExpr: &keyExpr,\n\t\t\t\t\t\tUnitsExpr: &unitExpr,\n\t\t\t\t\t\tLimitValueExpr: &limitValueExpr,\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor i := 0; i < 12; i++ {\n\t\tfor j := 0; j < 3; j++ {\n\t\t\t_, err = c.Admin().RunWorkflow("rate-limit-workflow", &rateLimitInput{\n\t\t\t\tIndex: j,\n\t\t\t\tUserId: fmt.Sprintf("user-%d", i),\n\t\t\t})\n\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t}\n\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n}\n', source: 'out/go/z_v0/rate-limit/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/register-action/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/register-action/main.ts index 5dbc49ee0..814c37c38 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/register-action/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/register-action/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserId string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc StepOne(ctx context.Context, input *userCreateEvent) (result *stepOneOutput, err error) {\n\t// could get from context\n\t// testVal := ctx.Value('testkey').(string)\n\t// svcVal := ctx.Value('svckey').(string)\n\n\treturn &stepOneOutput{\n\t\tMessage: 'Username is: ' + input.Username,\n\t}, nil\n}\n\nfunc StepTwo(ctx context.Context, input *stepOneOutput) (result *stepOneOutput, err error) {\n\treturn &stepOneOutput{\n\t\tMessage: 'Above message is: ' + input.Message,\n\t}, nil\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tclient,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ttestSvc := w.NewService('test')\n\n\ttestSvc.Use(func(ctx worker.HatchetContext, next func(worker.HatchetContext) error) error {\n\t\tctx.SetContext(context.WithValue(ctx.GetContext(), 'testkey', 'testvalue'))\n\t\treturn next(ctx)\n\t})\n\n\terr = testSvc.RegisterAction(StepOne, worker.WithActionName('step-one'))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = testSvc.RegisterAction(StepTwo, worker.WithActionName('step-two'))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = testSvc.On(\n\t\tworker.Events('user:create', 'user:update'),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'post-user-update',\n\t\t\tDescription: 'This runs after an update to the user model.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\t// example of calling a registered action from the worker (includes service name)\n\t\t\t\tw.Call('test:step-one'),\n\t\t\t\t// example of calling a registered action from a service\n\t\t\t\ttestSvc.Call('step-two'),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// err = worker.RegisterAction('echo:echo', func(ctx context.Context, input *actionInput) (result any, err error) {\n\t// \treturn map[string]interface{}{\n\t// \t\t'message': input.Message,\n\t// \t}, nil\n\t// })\n\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\n\t// err = worker.RegisterAction('echo:object', func(ctx context.Context, input *actionInput) (result any, err error) {\n\t// \treturn nil, nil\n\t// })\n\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ttestEvent := userCreateEvent{\n\t\tUsername: 'echo-test',\n\t\tUserId: '1234',\n\t\tData: map[string]string{\n\t\t\t'test': 'test',\n\t\t},\n\t}\n\n\t// push an event\n\terr = client.Event().Push(\n\t\tcontext.Background(),\n\t\t'user:create',\n\t\ttestEvent,\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-interrupt:\n\t\t\tif err := cleanup(); err != nil {\n\t\t\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t\t\t}\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserId string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc StepOne(ctx context.Context, input *userCreateEvent) (result *stepOneOutput, err error) {\n\t// could get from context\n\t// testVal := ctx.Value("testkey").(string)\n\t// svcVal := ctx.Value("svckey").(string)\n\n\treturn &stepOneOutput{\n\t\tMessage: "Username is: " + input.Username,\n\t}, nil\n}\n\nfunc StepTwo(ctx context.Context, input *stepOneOutput) (result *stepOneOutput, err error) {\n\treturn &stepOneOutput{\n\t\tMessage: "Above message is: " + input.Message,\n\t}, nil\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tclient,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ttestSvc := w.NewService("test")\n\n\ttestSvc.Use(func(ctx worker.HatchetContext, next func(worker.HatchetContext) error) error {\n\t\tctx.SetContext(context.WithValue(ctx.GetContext(), "testkey", "testvalue"))\n\t\treturn next(ctx)\n\t})\n\n\terr = testSvc.RegisterAction(StepOne, worker.WithActionName("step-one"))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = testSvc.RegisterAction(StepTwo, worker.WithActionName("step-two"))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = testSvc.On(\n\t\tworker.Events("user:create", "user:update"),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "post-user-update",\n\t\t\tDescription: "This runs after an update to the user model.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\t// example of calling a registered action from the worker (includes service name)\n\t\t\t\tw.Call("test:step-one"),\n\t\t\t\t// example of calling a registered action from a service\n\t\t\t\ttestSvc.Call("step-two"),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// err = worker.RegisterAction("echo:echo", func(ctx context.Context, input *actionInput) (result any, err error) {\n\t// \treturn map[string]interface{}{\n\t// \t\t"message": input.Message,\n\t// \t}, nil\n\t// })\n\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\n\t// err = worker.RegisterAction("echo:object", func(ctx context.Context, input *actionInput) (result any, err error) {\n\t// \treturn nil, nil\n\t// })\n\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ttestEvent := userCreateEvent{\n\t\tUsername: "echo-test",\n\t\tUserId: "1234",\n\t\tData: map[string]string{\n\t\t\t"test": "test",\n\t\t},\n\t}\n\n\t// push an event\n\terr = client.Event().Push(\n\t\tcontext.Background(),\n\t\t"user:create",\n\t\ttestEvent,\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-interrupt:\n\t\t\tif err := cleanup(); err != nil {\n\t\t\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t\t\t}\n\t\tdefault:\n\t\t\ttime.Sleep(time.Second)\n\t\t}\n\t}\n}\n', source: 'out/go/z_v0/register-action/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/retries-with-backoff/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/retries-with-backoff/main.ts index a4db48331..3ed000368 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/retries-with-backoff/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/retries-with-backoff/main.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\n// > Backoff\n\n// ... normal function definition\nfunc StepOne(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\tif ctx.RetryCount() < 3 {\n\t\treturn nil, fmt.Errorf('failure')\n\t}\n\n\treturn &stepOneOutput{\n\t\tMessage: 'Success!',\n\t}, nil\n}\n\n// ,\n\nfunc main() {\n\t// ...\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// ,\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'retry-with-backoff-workflow',\n\t\t\tOn: worker.NoTrigger(),\n\t\t\tDescription: 'Demonstrates retry with exponential backoff.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(StepOne).SetName('with-backoff').\n\t\t\t\t\tSetRetries(10).\n\t\t\t\t\t// 👀 Backoff configuration\n\t\t\t\t\t// 👀 Maximum number of seconds to wait between retries\n\t\t\t\t\tSetRetryBackoffFactor(2.0).\n\t\t\t\t\t// 👀 Factor to increase the wait time between retries.\n\t\t\t\t\t// This sequence will be 2s, 4s, 8s, 16s, 32s, 60s... due to the maxSeconds limit\n\t\t\t\t\tSetRetryMaxBackoffSeconds(60),\n\t\t\t},\n\t\t},\n\t)\n\n\t// ...\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n\n\t<-interruptCtx.Done()\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n\n\t// ,\n}\n\n", + 'package main\n\nimport (\n\t"fmt"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\n// > Backoff\n\n// ... normal function definition\nfunc StepOne(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\tif ctx.RetryCount() < 3 {\n\t\treturn nil, fmt.Errorf("failure")\n\t}\n\n\treturn &stepOneOutput{\n\t\tMessage: "Success!",\n\t}, nil\n}\n\n// ,\n\nfunc main() {\n\t// ...\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// ,\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tName: "retry-with-backoff-workflow",\n\t\t\tOn: worker.NoTrigger(),\n\t\t\tDescription: "Demonstrates retry with exponential backoff.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(StepOne).SetName("with-backoff").\n\t\t\t\t\tSetRetries(10).\n\t\t\t\t\t// 👀 Backoff configuration\n\t\t\t\t\t// 👀 Maximum number of seconds to wait between retries\n\t\t\t\t\tSetRetryBackoffFactor(2.0).\n\t\t\t\t\t// 👀 Factor to increase the wait time between retries.\n\t\t\t\t\t// This sequence will be 2s, 4s, 8s, 16s, 32s, 60s... due to the maxSeconds limit\n\t\t\t\t\tSetRetryMaxBackoffSeconds(60),\n\t\t\t},\n\t\t},\n\t)\n\n\t// ...\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n\n\t<-interruptCtx.Done()\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n\n\t// ,\n}\n\n', source: 'out/go/z_v0/retries-with-backoff/main.go', blocks: { backoff: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/retries/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/retries/main.ts index 1f97e94ee..313486dda 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/retries/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/retries/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'log'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tif err := run(cmdutils.InterruptChan(), events); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc getConcurrencyKey(ctx worker.HatchetContext) (string, error) {\n\treturn 'user-create', nil\n}\n\ntype retryWorkflow struct {\n\tretries int\n}\n\nfunc (r *retryWorkflow) StepOne(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\tinput := &userCreateEvent{}\n\n\terr = ctx.WorkflowInput(input)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif r.retries < 2 {\n\t\tr.retries++\n\t\treturn nil, fmt.Errorf('error')\n\t}\n\n\tlog.Printf('finished step-one')\n\treturn &stepOneOutput{\n\t\tMessage: 'Username is: ' + input.Username,\n\t}, nil\n}\n\nfunc run(ch <-chan interface{}, events chan<- string) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t\tworker.WithMaxRuns(1),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\ttestSvc := w.NewService('test')\n\n\twk := &retryWorkflow{}\n\n\terr = testSvc.On(\n\t\tworker.Events('user:create:simple'),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'simple',\n\t\t\tDescription: 'This runs after an update to the user model.',\n\t\t\tConcurrency: worker.Concurrency(getConcurrencyKey),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(wk.StepOne).SetName('step-one').SetRetries(4),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf('error starting worker: %w', err)\n\t}\n\n\ttestEvent := userCreateEvent{\n\t\tUsername: 'echo-test',\n\t\tUserID: '1234',\n\t\tData: map[string]string{\n\t\t\t'test': 'test',\n\t\t},\n\t}\n\n\tlog.Printf('pushing event user:create:simple')\n\n\t// push an event\n\terr = c.Event().Push(\n\t\tcontext.Background(),\n\t\t'user:create:simple',\n\t\ttestEvent,\n\t)\n\n\tif err != nil {\n\t\treturn fmt.Errorf('error pushing event: %w', err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\treturn fmt.Errorf('error cleaning up worker: %w', err)\n\t}\n\n\treturn nil\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tif err := run(cmdutils.InterruptChan(), events); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc getConcurrencyKey(ctx worker.HatchetContext) (string, error) {\n\treturn "user-create", nil\n}\n\ntype retryWorkflow struct {\n\tretries int\n}\n\nfunc (r *retryWorkflow) StepOne(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\tinput := &userCreateEvent{}\n\n\terr = ctx.WorkflowInput(input)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif r.retries < 2 {\n\t\tr.retries++\n\t\treturn nil, fmt.Errorf("error")\n\t}\n\n\tlog.Printf("finished step-one")\n\treturn &stepOneOutput{\n\t\tMessage: "Username is: " + input.Username,\n\t}, nil\n}\n\nfunc run(ch <-chan interface{}, events chan<- string) error {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t\tworker.WithMaxRuns(1),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\ttestSvc := w.NewService("test")\n\n\twk := &retryWorkflow{}\n\n\terr = testSvc.On(\n\t\tworker.Events("user:create:simple"),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "simple",\n\t\t\tDescription: "This runs after an update to the user model.",\n\t\t\tConcurrency: worker.Concurrency(getConcurrencyKey),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(wk.StepOne).SetName("step-one").SetRetries(4),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf("error starting worker: %w", err)\n\t}\n\n\ttestEvent := userCreateEvent{\n\t\tUsername: "echo-test",\n\t\tUserID: "1234",\n\t\tData: map[string]string{\n\t\t\t"test": "test",\n\t\t},\n\t}\n\n\tlog.Printf("pushing event user:create:simple")\n\n\t// push an event\n\terr = c.Event().Push(\n\t\tcontext.Background(),\n\t\t"user:create:simple",\n\t\ttestEvent,\n\t)\n\n\tif err != nil {\n\t\treturn fmt.Errorf("error pushing event: %w", err)\n\t}\n\n\t<-ch\n\n\tif err := cleanup(); err != nil {\n\t\treturn fmt.Errorf("error cleaning up worker: %w", err)\n\t}\n\n\treturn nil\n}\n', source: 'out/go/z_v0/retries/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/scheduled/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/scheduled/main.ts index 0736ddff6..66f701fe3 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/scheduled/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/scheduled/main.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\n// > Create\n// ... normal workflow definition\ntype printOutput struct{}\n\nfunc print(ctx context.Context) (result *printOutput, err error) {\n\tfmt.Println('called print:print')\n\n\treturn &printOutput{}, nil\n}\n\n// ,\nfunc main() {\n\t// ... initialize client, worker and workflow\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.NoTrigger(),\n\t\t\tName: 'schedule-workflow',\n\t\t\tDescription: 'Demonstrates a simple scheduled workflow',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(print),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := w.Start()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// ,\n\n\tgo func() {\n\t\t// 👀 define the scheduled workflow to run in a minute\n\t\tschedule, err := c.Schedule().Create(\n\t\t\tcontext.Background(),\n\t\t\t'schedule-workflow',\n\t\t\t&client.ScheduleOpts{\n\t\t\t\t// 👀 define the time to run the scheduled workflow, in UTC\n\t\t\t\tTriggerAt: time.Now().UTC().Add(time.Minute),\n\t\t\t\tInput: map[string]interface{}{\n\t\t\t\t\t'message': 'Hello, world!',\n\t\t\t\t},\n\t\t\t\tAdditionalMetadata: map[string]string{},\n\t\t\t},\n\t\t)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tfmt.Println(schedule.TriggerAt, schedule.WorkflowName)\n\t}()\n\n\t// ... wait for interrupt signal\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n\n\t// ,\n}\n\n\nfunc ListScheduledWorkflows() {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// > List\n\tschedules, err := c.Schedule().List(context.Background())\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, schedule := range *schedules.Rows {\n\t\tfmt.Println(schedule.TriggerAt, schedule.WorkflowName)\n\t}\n}\n\nfunc DeleteScheduledWorkflow(id string) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// > Delete\n\t// 👀 id is the schedule's metadata id, can get it via schedule.Metadata.Id\n\terr = c.Schedule().Delete(context.Background(), id)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\n// > Create\n// ... normal workflow definition\ntype printOutput struct{}\n\nfunc print(ctx context.Context) (result *printOutput, err error) {\n\tfmt.Println("called print:print")\n\n\treturn &printOutput{}, nil\n}\n\n// ,\nfunc main() {\n\t// ... initialize client, worker and workflow\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.NoTrigger(),\n\t\t\tName: "schedule-workflow",\n\t\t\tDescription: "Demonstrates a simple scheduled workflow",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(print),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := w.Start()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// ,\n\n\tgo func() {\n\t\t// 👀 define the scheduled workflow to run in a minute\n\t\tschedule, err := c.Schedule().Create(\n\t\t\tcontext.Background(),\n\t\t\t"schedule-workflow",\n\t\t\t&client.ScheduleOpts{\n\t\t\t\t// 👀 define the time to run the scheduled workflow, in UTC\n\t\t\t\tTriggerAt: time.Now().UTC().Add(time.Minute),\n\t\t\t\tInput: map[string]interface{}{\n\t\t\t\t\t"message": "Hello, world!",\n\t\t\t\t},\n\t\t\t\tAdditionalMetadata: map[string]string{},\n\t\t\t},\n\t\t)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tfmt.Println(schedule.TriggerAt, schedule.WorkflowName)\n\t}()\n\n\t// ... wait for interrupt signal\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n\n\t// ,\n}\n\n\nfunc ListScheduledWorkflows() {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// > List\n\tschedules, err := c.Schedule().List(context.Background())\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, schedule := range *schedules.Rows {\n\t\tfmt.Println(schedule.TriggerAt, schedule.WorkflowName)\n\t}\n}\n\nfunc DeleteScheduledWorkflow(id string) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// > Delete\n\t// 👀 id is the schedule\'s metadata id, can get it via schedule.Metadata.Id\n\terr = c.Schedule().Delete(context.Background(), id)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n', source: 'out/go/z_v0/scheduled/main.go', blocks: { create: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/simple/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/simple/main.ts index 4656fa2a0..fbbcb21b0 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/simple/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/simple/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'log'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n}\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events('user:create:simple'),\n\t\t\tName: 'simple',\n\t\t\tDescription: 'This runs after an update to the user model.',\n\t\t\tConcurrency: worker.Expression('input.user_id'),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-one')\n\t\t\t\t\tevents <- 'step-one'\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Username is: ' + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName('step-one'),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &stepOneOutput{}\n\t\t\t\t\terr = ctx.StepOutput('step-one', input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf('step-two')\n\t\t\t\t\tevents <- 'step-two'\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: 'Above message is: ' + input.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName('step-two').AddParents('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tgo func() {\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: 'echo-test',\n\t\t\tUserID: '1234',\n\t\t\tData: map[string]string{\n\t\t\t\t'test': 'test',\n\t\t\t},\n\t\t}\n\n\t\tlog.Printf('pushing event user:create:simple')\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t'user:create:simple',\n\t\t\ttestEvent,\n\t\t\tclient.WithEventMetadata(map[string]string{\n\t\t\t\t'hello': 'world',\n\t\t\t}),\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error pushing event: %w', err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn cleanup, nil\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\tinterrupt := cmdutils.InterruptChan()\n\n\tcleanup, err := run(events)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-interrupt\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n}\n\nfunc run(events chan<- string) (func() error, error) {\n\tc, err := client.New()\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\terr = w.RegisterWorkflow(\n\t\t&worker.WorkflowJob{\n\t\t\tOn: worker.Events("user:create:simple"),\n\t\t\tName: "simple",\n\t\t\tDescription: "This runs after an update to the user model.",\n\t\t\tConcurrency: worker.Expression("input.user_id"),\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &userCreateEvent{}\n\n\t\t\t\t\terr = ctx.WorkflowInput(input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-one")\n\t\t\t\t\tevents <- "step-one"\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Username is: " + input.Username,\n\t\t\t\t\t}, nil\n\t\t\t\t},\n\t\t\t\t).SetName("step-one"),\n\t\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\t\tinput := &stepOneOutput{}\n\t\t\t\t\terr = ctx.StepOutput("step-one", input)\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf("step-two")\n\t\t\t\t\tevents <- "step-two"\n\n\t\t\t\t\treturn &stepOneOutput{\n\t\t\t\t\t\tMessage: "Above message is: " + input.Message,\n\t\t\t\t\t}, nil\n\t\t\t\t}).SetName("step-two").AddParents("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tgo func() {\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: "echo-test",\n\t\t\tUserID: "1234",\n\t\t\tData: map[string]string{\n\t\t\t\t"test": "test",\n\t\t\t},\n\t\t}\n\n\t\tlog.Printf("pushing event user:create:simple")\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t"user:create:simple",\n\t\t\ttestEvent,\n\t\t\tclient.WithEventMetadata(map[string]string{\n\t\t\t\t"hello": "world",\n\t\t\t}),\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error pushing event: %w", err))\n\t\t}\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn cleanup, nil\n}\n', source: 'out/go/z_v0/simple/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/stream-event-by-meta/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/stream-event-by-meta/main.ts index bb36fdd16..99bff8c9d 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/stream-event-by-meta/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/stream-event-by-meta/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'math/rand/v2'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype streamEventInput struct {\n\tIndex int `json:'index'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc StepOne(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\tinput := &streamEventInput{}\n\n\terr = ctx.WorkflowInput(input)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tctx.StreamEvent([]byte(fmt.Sprintf('This is a stream event %d', input.Index)))\n\n\treturn &stepOneOutput{\n\t\tMessage: fmt.Sprintf('This ran at %s', time.Now().String()),\n\t}, nil\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = w.On(\n\t\tworker.NoTrigger(),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'stream-event-workflow',\n\t\t\tDescription: 'This sends a stream event.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(StepOne).SetName('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\t_, err = w.Start()\n\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n\n\t// Generate a random number between 1 and 100\n\tstreamKey := 'streamKey'\n\tstreamValue := fmt.Sprintf('stream-event-%d', rand.IntN(100)+1)\n\n\t_, err = c.Admin().RunWorkflow('stream-event-workflow', &streamEventInput{\n\t\tIndex: 0,\n\t},\n\t\tclient.WithRunMetadata(map[string]interface{}{\n\t\t\tstreamKey: streamValue,\n\t\t}),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = c.Subscribe().StreamByAdditionalMetadata(interruptCtx, streamKey, streamValue, func(event client.StreamEvent) error {\n\t\tfmt.Println(string(event.Message))\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\t"math/rand/v2"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype streamEventInput struct {\n\tIndex int `json:"index"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc StepOne(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\tinput := &streamEventInput{}\n\n\terr = ctx.WorkflowInput(input)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tctx.StreamEvent([]byte(fmt.Sprintf("This is a stream event %d", input.Index)))\n\n\treturn &stepOneOutput{\n\t\tMessage: fmt.Sprintf("This ran at %s", time.Now().String()),\n\t}, nil\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = w.On(\n\t\tworker.NoTrigger(),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "stream-event-workflow",\n\t\t\tDescription: "This sends a stream event.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(StepOne).SetName("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\t_, err = w.Start()\n\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n\n\t// Generate a random number between 1 and 100\n\tstreamKey := "streamKey"\n\tstreamValue := fmt.Sprintf("stream-event-%d", rand.IntN(100)+1)\n\n\t_, err = c.Admin().RunWorkflow("stream-event-workflow", &streamEventInput{\n\t\tIndex: 0,\n\t},\n\t\tclient.WithRunMetadata(map[string]interface{}{\n\t\t\tstreamKey: streamValue,\n\t\t}),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = c.Subscribe().StreamByAdditionalMetadata(interruptCtx, streamKey, streamValue, func(event client.StreamEvent) error {\n\t\tfmt.Println(string(event.Message))\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n', source: 'out/go/z_v0/stream-event-by-meta/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/stream-event/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/stream-event/main.ts index ebd63547b..74bd996be 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/stream-event/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/stream-event/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/cmdutils'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype streamEventInput struct {\n\tIndex int `json:'index'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc StepOne(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\tinput := &streamEventInput{}\n\n\terr = ctx.WorkflowInput(input)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tctx.StreamEvent([]byte(fmt.Sprintf('This is a stream event %d', input.Index)))\n\n\treturn &stepOneOutput{\n\t\tMessage: fmt.Sprintf('This ran at %s', time.Now().String()),\n\t}, nil\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = w.On(\n\t\tworker.NoTrigger(),\n\t\t&worker.WorkflowJob{\n\t\t\tName: 'stream-event-workflow',\n\t\t\tDescription: 'This sends a stream event.',\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(StepOne).SetName('step-one'),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\t_, err = w.Start()\n\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error cleaning up: %w', err))\n\t}\n\n\tworkflow, err := c.Admin().RunWorkflow('stream-event-workflow', &streamEventInput{\n\t\tIndex: 0,\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = c.Subscribe().Stream(interruptCtx, workflow.WorkflowRunId(), func(event client.StreamEvent) error {\n\t\tfmt.Println(string(event.Message))\n\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/cmdutils"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype streamEventInput struct {\n\tIndex int `json:"index"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc StepOne(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\tinput := &streamEventInput{}\n\n\terr = ctx.WorkflowInput(input)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tctx.StreamEvent([]byte(fmt.Sprintf("This is a stream event %d", input.Index)))\n\n\treturn &stepOneOutput{\n\t\tMessage: fmt.Sprintf("This ran at %s", time.Now().String()),\n\t}, nil\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = w.On(\n\t\tworker.NoTrigger(),\n\t\t&worker.WorkflowJob{\n\t\t\tName: "stream-event-workflow",\n\t\t\tDescription: "This sends a stream event.",\n\t\t\tSteps: []*worker.WorkflowStep{\n\t\t\t\tworker.Fn(StepOne).SetName("step-one"),\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinterruptCtx, cancel := cmdutils.InterruptContextFromChan(cmdutils.InterruptChan())\n\tdefer cancel()\n\n\t_, err = w.Start()\n\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error cleaning up: %w", err))\n\t}\n\n\tworkflow, err := c.Admin().RunWorkflow("stream-event-workflow", &streamEventInput{\n\t\tIndex: 0,\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = c.Subscribe().Stream(interruptCtx, workflow.WorkflowRunId(), func(event client.StreamEvent) error {\n\t\tfmt.Println(string(event.Message))\n\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n', source: 'out/go/z_v0/stream-event/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/timeout/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/timeout/main.ts index 7beb2246d..d0c46441d 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/timeout/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/timeout/main.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'time'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\n\t// > TimeoutStep\n\tcleanup, err := run(events, worker.WorkflowJob{\n\t\tName: 'timeout',\n\t\tDescription: 'timeout',\n\t\tSteps: []*worker.WorkflowStep{\n\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\ttime.Sleep(time.Second * 60)\n\t\t\t\treturn nil, nil\n\t\t\t}).SetName('step-one').SetTimeout('10s'),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-events\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf('cleanup() error = %v', err))\n\t}\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\t"time"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype stepOneOutput struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tevents := make(chan string, 50)\n\n\t// > TimeoutStep\n\tcleanup, err := run(events, worker.WorkflowJob{\n\t\tName: "timeout",\n\t\tDescription: "timeout",\n\t\tSteps: []*worker.WorkflowStep{\n\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *stepOneOutput, err error) {\n\t\t\t\ttime.Sleep(time.Second * 60)\n\t\t\t\treturn nil, nil\n\t\t\t}).SetName("step-one").SetTimeout("10s"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t<-events\n\n\tif err := cleanup(); err != nil {\n\t\tpanic(fmt.Errorf("cleanup() error = %v", err))\n\t}\n}\n', source: 'out/go/z_v0/timeout/main.go', blocks: { timeoutstep: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/timeout/run.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/timeout/run.ts index 1c58a3cca..f5605065f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/timeout/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/timeout/run.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'fmt'\n\t'log'\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\nfunc run(done chan<- string, job worker.WorkflowJob) (func() error, error) {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating client: %w', err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error creating worker: %w', err)\n\t}\n\n\terr = w.On(\n\t\tworker.Events('user:create:timeout'),\n\t\t&job,\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error registering workflow: %w', err)\n\t}\n\n\tgo func() {\n\t\tlog.Printf('pushing event')\n\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: 'echo-test',\n\t\t\tUserID: '1234',\n\t\t\tData: map[string]string{\n\t\t\t\t'test': 'test',\n\t\t\t},\n\t\t}\n\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t'user:create:timeout',\n\t\t\ttestEvent,\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf('error pushing event: %w', err))\n\t\t}\n\n\t\ttime.Sleep(20 * time.Second)\n\n\t\tdone <- 'done'\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf('error starting worker: %w', err)\n\t}\n\n\treturn cleanup, nil\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\nfunc run(done chan<- string, job worker.WorkflowJob) (func() error, error) {\n\tc, err := client.New()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating client: %w", err)\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error creating worker: %w", err)\n\t}\n\n\terr = w.On(\n\t\tworker.Events("user:create:timeout"),\n\t\t&job,\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error registering workflow: %w", err)\n\t}\n\n\tgo func() {\n\t\tlog.Printf("pushing event")\n\n\t\ttestEvent := userCreateEvent{\n\t\t\tUsername: "echo-test",\n\t\t\tUserID: "1234",\n\t\t\tData: map[string]string{\n\t\t\t\t"test": "test",\n\t\t\t},\n\t\t}\n\n\t\t// push an event\n\t\terr := c.Event().Push(\n\t\t\tcontext.Background(),\n\t\t\t"user:create:timeout",\n\t\t\ttestEvent,\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf("error pushing event: %w", err))\n\t\t}\n\n\t\ttime.Sleep(20 * time.Second)\n\n\t\tdone <- "done"\n\t}()\n\n\tcleanup, err := w.Start()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf("error starting worker: %w", err)\n\t}\n\n\treturn cleanup, nil\n}\n', source: 'out/go/z_v0/timeout/run.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/webhook/main.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/webhook/main.ts index f785e1349..3a9798e76 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/webhook/main.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/webhook/main.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'fmt'\n\t'log'\n\n\t'github.com/joho/godotenv'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:'username'`\n\tUserID string `json:'user_id'`\n\tData map[string]string `json:'data'`\n}\n\ntype output struct {\n\tMessage string `json:'message'`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error creating client: %w', err))\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\tpanic(fmt.Errorf('error creating worker: %w', err))\n\t}\n\n\tworkflow := 'webhook'\n\tevent := 'user:create:webhook'\n\twf := &worker.WorkflowJob{\n\t\tName: workflow,\n\t\tDescription: workflow,\n\t\tSteps: []*worker.WorkflowStep{\n\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *output, err error) {\n\t\t\t\tlog.Printf('step name: %s', ctx.StepName())\n\t\t\t\treturn &output{\n\t\t\t\t\tMessage: 'hi from ' + ctx.StepName(),\n\t\t\t\t}, nil\n\t\t\t}).SetName('webhook-step-one').SetTimeout('10s'),\n\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *output, err error) {\n\t\t\t\tlog.Printf('step name: %s', ctx.StepName())\n\t\t\t\treturn &output{\n\t\t\t\t\tMessage: 'hi from ' + ctx.StepName(),\n\t\t\t\t}, nil\n\t\t\t}).SetName('webhook-step-one').SetTimeout('10s'),\n\t\t},\n\t}\n\n\thandler := w.WebhookHttpHandler(worker.WebhookHandlerOptions{\n\t\tSecret: 'secret',\n\t}, wf)\n\tport := '8741'\n\terr = run('webhook-demo', w, port, handler, c, workflow, event)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", + 'package main\n\nimport (\n\t"fmt"\n\t"log"\n\n\t"github.com/joho/godotenv"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\ntype userCreateEvent struct {\n\tUsername string `json:"username"`\n\tUserID string `json:"user_id"`\n\tData map[string]string `json:"data"`\n}\n\ntype output struct {\n\tMessage string `json:"message"`\n}\n\nfunc main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc, err := client.New()\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error creating client: %w", err))\n\t}\n\n\tw, err := worker.NewWorker(\n\t\tworker.WithClient(\n\t\t\tc,\n\t\t),\n\t)\n\tif err != nil {\n\t\tpanic(fmt.Errorf("error creating worker: %w", err))\n\t}\n\n\tworkflow := "webhook"\n\tevent := "user:create:webhook"\n\twf := &worker.WorkflowJob{\n\t\tName: workflow,\n\t\tDescription: workflow,\n\t\tSteps: []*worker.WorkflowStep{\n\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *output, err error) {\n\t\t\t\tlog.Printf("step name: %s", ctx.StepName())\n\t\t\t\treturn &output{\n\t\t\t\t\tMessage: "hi from " + ctx.StepName(),\n\t\t\t\t}, nil\n\t\t\t}).SetName("webhook-step-one").SetTimeout("10s"),\n\t\t\tworker.Fn(func(ctx worker.HatchetContext) (result *output, err error) {\n\t\t\t\tlog.Printf("step name: %s", ctx.StepName())\n\t\t\t\treturn &output{\n\t\t\t\t\tMessage: "hi from " + ctx.StepName(),\n\t\t\t\t}, nil\n\t\t\t}).SetName("webhook-step-one").SetTimeout("10s"),\n\t\t},\n\t}\n\n\thandler := w.WebhookHttpHandler(worker.WebhookHandlerOptions{\n\t\tSecret: "secret",\n\t}, wf)\n\tport := "8741"\n\terr = run("webhook-demo", w, port, handler, c, workflow, event)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n', source: 'out/go/z_v0/webhook/main.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/webhook/run.ts b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/webhook/run.ts index 1c16f57a3..eeb86ad56 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/webhook/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/go/z_v0/webhook/run.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'go', content: - "package main\n\nimport (\n\t'context'\n\t'errors'\n\t'fmt'\n\t'log'\n\t'net/http'\n\t'time'\n\n\t'github.com/hatchet-dev/hatchet/pkg/client'\n\t'github.com/hatchet-dev/hatchet/pkg/worker'\n)\n\nfunc run(\n\tname string,\n\tw *worker.Worker,\n\tport string,\n\thandler func(w http.ResponseWriter, r *http.Request), c client.Client, workflow string, event string,\n) error {\n\t// create webserver to handle webhook requests\n\tmux := http.NewServeMux()\n\n\t// Register the HelloHandler to the /hello route\n\tmux.HandleFunc('/webhook', handler)\n\n\t// Create a custom server\n\tserver := &http.Server{\n\t\tAddr: ':' + port,\n\t\tHandler: mux,\n\t\tReadTimeout: 10 * time.Second,\n\t\tWriteTimeout: 10 * time.Second,\n\t\tIdleTimeout: 15 * time.Second,\n\t}\n\n\tdefer func(server *http.Server, ctx context.Context) {\n\t\terr := server.Shutdown(ctx)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}(server, context.Background())\n\n\tgo func() {\n\t\tif err := server.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\n\tsecret := 'secret'\n\tif err := w.RegisterWebhook(worker.RegisterWebhookWorkerOpts{\n\t\tName: 'test-' + name,\n\t\tURL: fmt.Sprintf('http://localhost:%s/webhook', port),\n\t\tSecret: &secret,\n\t}); err != nil {\n\t\treturn fmt.Errorf('error setting up webhook: %w', err)\n\t}\n\n\ttime.Sleep(30 * time.Second)\n\n\tlog.Printf('pushing event')\n\n\ttestEvent := userCreateEvent{\n\t\tUsername: 'echo-test',\n\t\tUserID: '1234',\n\t\tData: map[string]string{\n\t\t\t'test': 'test',\n\t\t},\n\t}\n\n\t// push an event\n\terr := c.Event().Push(\n\t\tcontext.Background(),\n\t\tevent,\n\t\ttestEvent,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf('error pushing event: %w', err)\n\t}\n\n\ttime.Sleep(5 * time.Second)\n\n\treturn nil\n}\n", + 'package main\n\nimport (\n\t"context"\n\t"errors"\n\t"fmt"\n\t"log"\n\t"net/http"\n\t"time"\n\n\t"github.com/hatchet-dev/hatchet/pkg/client"\n\t"github.com/hatchet-dev/hatchet/pkg/worker"\n)\n\nfunc run(\n\tname string,\n\tw *worker.Worker,\n\tport string,\n\thandler func(w http.ResponseWriter, r *http.Request), c client.Client, workflow string, event string,\n) error {\n\t// create webserver to handle webhook requests\n\tmux := http.NewServeMux()\n\n\t// Register the HelloHandler to the /hello route\n\tmux.HandleFunc("/webhook", handler)\n\n\t// Create a custom server\n\tserver := &http.Server{\n\t\tAddr: ":" + port,\n\t\tHandler: mux,\n\t\tReadTimeout: 10 * time.Second,\n\t\tWriteTimeout: 10 * time.Second,\n\t\tIdleTimeout: 15 * time.Second,\n\t}\n\n\tdefer func(server *http.Server, ctx context.Context) {\n\t\terr := server.Shutdown(ctx)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}(server, context.Background())\n\n\tgo func() {\n\t\tif err := server.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\n\tsecret := "secret"\n\tif err := w.RegisterWebhook(worker.RegisterWebhookWorkerOpts{\n\t\tName: "test-" + name,\n\t\tURL: fmt.Sprintf("http://localhost:%s/webhook", port),\n\t\tSecret: &secret,\n\t}); err != nil {\n\t\treturn fmt.Errorf("error setting up webhook: %w", err)\n\t}\n\n\ttime.Sleep(30 * time.Second)\n\n\tlog.Printf("pushing event")\n\n\ttestEvent := userCreateEvent{\n\t\tUsername: "echo-test",\n\t\tUserID: "1234",\n\t\tData: map[string]string{\n\t\t\t"test": "test",\n\t\t},\n\t}\n\n\t// push an event\n\terr := c.Event().Push(\n\t\tcontext.Background(),\n\t\tevent,\n\t\ttestEvent,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf("error pushing event: %w", err)\n\t}\n\n\ttime.Sleep(5 * time.Second)\n\n\treturn nil\n}\n', source: 'out/go/z_v0/webhook/run.go', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/__init__.ts b/frontend/app/src/next/lib/docs/generated/snips/python/__init__.ts index aa4732d2a..285f78fcb 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/__init__.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/__init__.ts @@ -6,6 +6,6 @@ const snippet: Snippet = { source: 'out/python/__init__.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/affinity_workers/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/affinity_workers/trigger.ts index 72e6ede40..0f5cc2dca 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/affinity_workers/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/affinity_workers/trigger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from examples.affinity_workers.worker import affinity_worker_workflow\nfrom hatchet_sdk import TriggerWorkflowOptions\n\naffinity_worker_workflow.run(\n options=TriggerWorkflowOptions(additional_metadata={'hello': 'moon'}),\n)\n", + 'from examples.affinity_workers.worker import affinity_worker_workflow\nfrom hatchet_sdk import TriggerWorkflowOptions\n\naffinity_worker_workflow.run(\n options=TriggerWorkflowOptions(additional_metadata={"hello": "moon"}),\n)\n', source: 'out/python/affinity_workers/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/affinity_workers/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/affinity_workers/worker.ts index fbc206e94..9e0877d86 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/affinity_workers/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/affinity_workers/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from hatchet_sdk import Context, EmptyModel, Hatchet, WorkerLabelComparator\nfrom hatchet_sdk.labels import DesiredWorkerLabel\n\nhatchet = Hatchet(debug=True)\n\n\n# > AffinityWorkflow\n\naffinity_worker_workflow = hatchet.workflow(name='AffinityWorkflow')\n\n\n@affinity_worker_workflow.task(\n desired_worker_labels={\n 'model': DesiredWorkerLabel(value='fancy-ai-model-v2', weight=10),\n 'memory': DesiredWorkerLabel(\n value=256,\n required=True,\n comparator=WorkerLabelComparator.LESS_THAN,\n ),\n },\n)\n\n\n\n# > AffinityTask\nasync def step(input: EmptyModel, ctx: Context) -> dict[str, str | None]:\n if ctx.worker.labels().get('model') != 'fancy-ai-model-v2':\n ctx.worker.upsert_labels({'model': 'unset'})\n # DO WORK TO EVICT OLD MODEL / LOAD NEW MODEL\n ctx.worker.upsert_labels({'model': 'fancy-ai-model-v2'})\n\n return {'worker': ctx.worker.id()}\n\n\n\n\ndef main() -> None:\n\n # > AffinityWorker\n worker = hatchet.worker(\n 'affinity-worker',\n slots=10,\n labels={\n 'model': 'fancy-ai-model-v2',\n 'memory': 512,\n },\n workflows=[affinity_worker_workflow],\n )\n worker.start()\n\n\n\nif __name__ == '__main__':\n main()\n", + 'from hatchet_sdk import Context, EmptyModel, Hatchet, WorkerLabelComparator\nfrom hatchet_sdk.labels import DesiredWorkerLabel\n\nhatchet = Hatchet(debug=True)\n\n\n# > AffinityWorkflow\n\naffinity_worker_workflow = hatchet.workflow(name="AffinityWorkflow")\n\n\n@affinity_worker_workflow.task(\n desired_worker_labels={\n "model": DesiredWorkerLabel(value="fancy-ai-model-v2", weight=10),\n "memory": DesiredWorkerLabel(\n value=256,\n required=True,\n comparator=WorkerLabelComparator.LESS_THAN,\n ),\n },\n)\n\n\n\n# > AffinityTask\nasync def step(input: EmptyModel, ctx: Context) -> dict[str, str | None]:\n if ctx.worker.labels().get("model") != "fancy-ai-model-v2":\n ctx.worker.upsert_labels({"model": "unset"})\n # DO WORK TO EVICT OLD MODEL / LOAD NEW MODEL\n ctx.worker.upsert_labels({"model": "fancy-ai-model-v2"})\n\n return {"worker": ctx.worker.id()}\n\n\n\n\ndef main() -> None:\n\n # > AffinityWorker\n worker = hatchet.worker(\n "affinity-worker",\n slots=10,\n labels={\n "model": "fancy-ai-model-v2",\n "memory": 512,\n },\n workflows=[affinity_worker_workflow],\n )\n worker.start()\n\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/affinity_workers/worker.py', blocks: { affinityworkflow: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/api/api.ts b/frontend/app/src/next/lib/docs/generated/snips/python/api/api.ts index d246990fd..da2c053a8 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/api/api.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/api/api.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from hatchet_sdk import Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\ndef main() -> None:\n workflow_list = hatchet.workflows.list()\n rows = workflow_list.rows or []\n\n for workflow in rows:\n print(workflow.name)\n print(workflow.metadata.id)\n print(workflow.metadata.created_at)\n print(workflow.metadata.updated_at)\n\n\nif __name__ == '__main__':\n main()\n", + 'from hatchet_sdk import Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\ndef main() -> None:\n workflow_list = hatchet.workflows.list()\n rows = workflow_list.rows or []\n\n for workflow in rows:\n print(workflow.name)\n print(workflow.metadata.id)\n print(workflow.metadata.created_at)\n print(workflow.metadata.updated_at)\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/api/api.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/api/async_api.ts b/frontend/app/src/next/lib/docs/generated/snips/python/api/async_api.ts index 4bb47e936..8d95f7122 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/api/async_api.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/api/async_api.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\nasync def main() -> None:\n workflow_list = await hatchet.workflows.aio_list()\n rows = workflow_list.rows or []\n\n for workflow in rows:\n print(workflow.name)\n print(workflow.metadata.id)\n print(workflow.metadata.created_at)\n print(workflow.metadata.updated_at)\n\n\nif __name__ == '__main__':\n asyncio.run(main())\n", + 'import asyncio\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\nasync def main() -> None:\n workflow_list = await hatchet.workflows.aio_list()\n rows = workflow_list.rows or []\n\n for workflow in rows:\n print(workflow.name)\n print(workflow.metadata.id)\n print(workflow.metadata.created_at)\n print(workflow.metadata.updated_at)\n\n\nif __name__ == "__main__":\n asyncio.run(main())\n', source: 'out/python/api/async_api.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/blocked_async/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/blocked_async/trigger.ts index b75f635b3..893031422 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/blocked_async/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/blocked_async/trigger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from examples.blocked_async.worker import blocked_worker_workflow\nfrom hatchet_sdk import TriggerWorkflowOptions\n\nblocked_worker_workflow.run(\n options=TriggerWorkflowOptions(additional_metadata={'hello': 'moon'}),\n)\n", + 'from examples.blocked_async.worker import blocked_worker_workflow\nfrom hatchet_sdk import TriggerWorkflowOptions\n\nblocked_worker_workflow.run(\n options=TriggerWorkflowOptions(additional_metadata={"hello": "moon"}),\n)\n', source: 'out/python/blocked_async/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/blocked_async/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/blocked_async/worker.ts index 2201af046..a16d3006a 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/blocked_async/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/blocked_async/worker.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import hashlib\nimport time\nfrom datetime import timedelta\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n# WARNING: this is an example of what NOT to do\n# This workflow is intentionally blocking the main thread\n# and will block the worker from processing other workflows\n#\n# You do not want to run long sync functions in an async def function\n\nblocked_worker_workflow = hatchet.workflow(name='Blocked')\n\n\n@blocked_worker_workflow.task(execution_timeout=timedelta(seconds=11), retries=3)\nasync def step1(input: EmptyModel, ctx: Context) -> dict[str, str | int | float]:\n print('Executing step1')\n\n # CPU-bound task: Calculate a large number of SHA-256 hashes\n start_time = time.time()\n iterations = 10_000_000\n for i in range(iterations):\n hashlib.sha256(f'data{i}'.encode()).hexdigest()\n\n end_time = time.time()\n execution_time = end_time - start_time\n\n print(f'Completed {iterations} hash calculations in {execution_time:.2f} seconds')\n\n return {\n 'step1': 'step1',\n 'iterations': iterations,\n 'execution_time': execution_time,\n }\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'blocked-worker', slots=3, workflows=[blocked_worker_workflow]\n )\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'import hashlib\nimport time\nfrom datetime import timedelta\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n# WARNING: this is an example of what NOT to do\n# This workflow is intentionally blocking the main thread\n# and will block the worker from processing other workflows\n#\n# You do not want to run long sync functions in an async def function\n\nblocked_worker_workflow = hatchet.workflow(name="Blocked")\n\n\n@blocked_worker_workflow.task(execution_timeout=timedelta(seconds=11), retries=3)\nasync def step1(input: EmptyModel, ctx: Context) -> dict[str, str | int | float]:\n print("Executing step1")\n\n # CPU-bound task: Calculate a large number of SHA-256 hashes\n start_time = time.time()\n iterations = 10_000_000\n for i in range(iterations):\n hashlib.sha256(f"data{i}".encode()).hexdigest()\n\n end_time = time.time()\n execution_time = end_time - start_time\n\n print(f"Completed {iterations} hash calculations in {execution_time:.2f} seconds")\n\n return {\n "step1": "step1",\n "iterations": iterations,\n "execution_time": execution_time,\n }\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "blocked-worker", slots=3, workflows=[blocked_worker_workflow]\n )\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/blocked_async/worker.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/bulk_trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/bulk_trigger.ts index fbddc8b78..15ec8acb0 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/bulk_trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/bulk_trigger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\nfrom examples.bulk_fanout.worker import ParentInput, bulk_parent_wf\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\n\nhatchet = Hatchet()\n\n\nasync def main() -> None:\n results = bulk_parent_wf.run_many(\n workflows=[\n bulk_parent_wf.create_bulk_run_item(\n input=ParentInput(n=i),\n options=TriggerWorkflowOptions(\n additional_metadata={\n 'bulk-trigger': i,\n 'hello-{i}': 'earth-{i}',\n }\n ),\n )\n for i in range(20)\n ],\n )\n\n for result in results:\n print(result)\n\n\nif __name__ == '__main__':\n asyncio.run(main())\n", + 'import asyncio\n\nfrom examples.bulk_fanout.worker import ParentInput, bulk_parent_wf\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\n\nhatchet = Hatchet()\n\n\nasync def main() -> None:\n results = bulk_parent_wf.run_many(\n workflows=[\n bulk_parent_wf.create_bulk_run_item(\n input=ParentInput(n=i),\n options=TriggerWorkflowOptions(\n additional_metadata={\n "bulk-trigger": i,\n "hello-{i}": "earth-{i}",\n }\n ),\n )\n for i in range(20)\n ],\n )\n\n for result in results:\n print(result)\n\n\nif __name__ == "__main__":\n asyncio.run(main())\n', source: 'out/python/bulk_fanout/bulk_trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/stream.ts b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/stream.ts index bd8e216b9..28979aa2d 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/stream.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/stream.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\nimport random\n\nfrom examples.bulk_fanout.worker import ParentInput, bulk_parent_wf\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\n\n\nasync def main() -> None:\n hatchet = Hatchet()\n\n # Generate a random stream key to use to track all\n # stream events for this workflow run.\n\n streamKey = 'streamKey'\n streamVal = f'sk-{random.randint(1, 100)}'\n\n # Specify the stream key as additional metadata\n # when running the workflow.\n\n # This key gets propagated to all child workflows\n # and can have an arbitrary property name.\n bulk_parent_wf.run(\n input=ParentInput(n=2),\n options=TriggerWorkflowOptions(additional_metadata={streamKey: streamVal}),\n )\n\n # Stream all events for the additional meta key value\n listener = hatchet.listener.stream_by_additional_metadata(streamKey, streamVal)\n\n async for event in listener:\n print(event.type, event.payload)\n\n\nif __name__ == '__main__':\n asyncio.run(main())\n", + 'import asyncio\nimport random\n\nfrom examples.bulk_fanout.worker import ParentInput, bulk_parent_wf\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\n\n\nasync def main() -> None:\n hatchet = Hatchet()\n\n # Generate a random stream key to use to track all\n # stream events for this workflow run.\n\n streamKey = "streamKey"\n streamVal = f"sk-{random.randint(1, 100)}"\n\n # Specify the stream key as additional metadata\n # when running the workflow.\n\n # This key gets propagated to all child workflows\n # and can have an arbitrary property name.\n bulk_parent_wf.run(\n input=ParentInput(n=2),\n options=TriggerWorkflowOptions(additional_metadata={streamKey: streamVal}),\n )\n\n # Stream all events for the additional meta key value\n listener = hatchet.listener.stream_by_additional_metadata(streamKey, streamVal)\n\n async for event in listener:\n print(event.type, event.payload)\n\n\nif __name__ == "__main__":\n asyncio.run(main())\n', source: 'out/python/bulk_fanout/stream.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/test_bulk_fanout.ts b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/test_bulk_fanout.ts index b12c1f77d..10d5b7cbe 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/test_bulk_fanout.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/test_bulk_fanout.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import pytest\n\nfrom examples.bulk_fanout.worker import ParentInput, bulk_parent_wf\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_run() -> None:\n result = await bulk_parent_wf.aio_run(input=ParentInput(n=12))\n\n assert len(result['spawn']['results']) == 12\n", + 'import pytest\n\nfrom examples.bulk_fanout.worker import ParentInput, bulk_parent_wf\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_run() -> None:\n result = await bulk_parent_wf.aio_run(input=ParentInput(n=12))\n\n assert len(result["spawn"]["results"]) == 12\n', source: 'out/python/bulk_fanout/test_bulk_fanout.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/trigger.ts index 8e9bfb8ed..583502b17 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/trigger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from examples.bulk_fanout.worker import ParentInput, bulk_parent_wf\nfrom hatchet_sdk import TriggerWorkflowOptions\n\nbulk_parent_wf.run(\n ParentInput(n=999),\n TriggerWorkflowOptions(additional_metadata={'no-dedupe': 'world'}),\n)\n", + 'from examples.bulk_fanout.worker import ParentInput, bulk_parent_wf\nfrom hatchet_sdk import TriggerWorkflowOptions\n\nbulk_parent_wf.run(\n ParentInput(n=999),\n TriggerWorkflowOptions(additional_metadata={"no-dedupe": "world"}),\n)\n', source: 'out/python/bulk_fanout/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/worker.ts index bce477ca5..3fcafec82 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_fanout/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from datetime import timedelta\nfrom typing import Any\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\n\nhatchet = Hatchet(debug=True)\n\n\nclass ParentInput(BaseModel):\n n: int = 100\n\n\nclass ChildInput(BaseModel):\n a: str\n\n\nbulk_parent_wf = hatchet.workflow(name='BulkFanoutParent', input_validator=ParentInput)\nbulk_child_wf = hatchet.workflow(name='BulkFanoutChild', input_validator=ChildInput)\n\n\n# > BulkFanoutParent\n@bulk_parent_wf.task(execution_timeout=timedelta(minutes=5))\nasync def spawn(input: ParentInput, ctx: Context) -> dict[str, list[dict[str, Any]]]:\n # 👀 Create each workflow run to spawn\n child_workflow_runs = [\n bulk_child_wf.create_bulk_run_item(\n input=ChildInput(a=str(i)),\n key=f'child{i}',\n options=TriggerWorkflowOptions(additional_metadata={'hello': 'earth'}),\n )\n for i in range(input.n)\n ]\n\n # 👀 Run workflows in bulk to improve performance\n spawn_results = await bulk_child_wf.aio_run_many(child_workflow_runs)\n\n return {'results': spawn_results}\n\n\n\n\n@bulk_child_wf.task()\ndef process(input: ChildInput, ctx: Context) -> dict[str, str]:\n print(f'child process {input.a}')\n return {'status': 'success ' + input.a}\n\n\n@bulk_child_wf.task()\ndef process2(input: ChildInput, ctx: Context) -> dict[str, str]:\n print('child process2')\n return {'status2': 'success'}\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'fanout-worker', slots=40, workflows=[bulk_parent_wf, bulk_child_wf]\n )\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from datetime import timedelta\nfrom typing import Any\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\n\nhatchet = Hatchet(debug=True)\n\n\nclass ParentInput(BaseModel):\n n: int = 100\n\n\nclass ChildInput(BaseModel):\n a: str\n\n\nbulk_parent_wf = hatchet.workflow(name="BulkFanoutParent", input_validator=ParentInput)\nbulk_child_wf = hatchet.workflow(name="BulkFanoutChild", input_validator=ChildInput)\n\n\n# > BulkFanoutParent\n@bulk_parent_wf.task(execution_timeout=timedelta(minutes=5))\nasync def spawn(input: ParentInput, ctx: Context) -> dict[str, list[dict[str, Any]]]:\n # 👀 Create each workflow run to spawn\n child_workflow_runs = [\n bulk_child_wf.create_bulk_run_item(\n input=ChildInput(a=str(i)),\n key=f"child{i}",\n options=TriggerWorkflowOptions(additional_metadata={"hello": "earth"}),\n )\n for i in range(input.n)\n ]\n\n # 👀 Run workflows in bulk to improve performance\n spawn_results = await bulk_child_wf.aio_run_many(child_workflow_runs)\n\n return {"results": spawn_results}\n\n\n\n\n@bulk_child_wf.task()\ndef process(input: ChildInput, ctx: Context) -> dict[str, str]:\n print(f"child process {input.a}")\n return {"status": "success " + input.a}\n\n\n@bulk_child_wf.task()\ndef process2(input: ChildInput, ctx: Context) -> dict[str, str]:\n print("child process2")\n return {"status2": "success"}\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "fanout-worker", slots=40, workflows=[bulk_parent_wf, bulk_child_wf]\n )\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/bulk_fanout/worker.py', blocks: { bulkfanoutparent: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_operations/cancel.ts b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_operations/cancel.ts index 3ac9c1265..c8584847c 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_operations/cancel.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_operations/cancel.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "# > Setup\n\nfrom datetime import datetime, timedelta\n\nfrom hatchet_sdk import BulkCancelReplayOpts, Hatchet, RunFilter, V1TaskStatus\n\nhatchet = Hatchet()\n\nworkflows = hatchet.workflows.list()\n\nassert workflows.rows\n\nworkflow = workflows.rows[0]\n\n\n# > List runs\nworkflow_runs = hatchet.runs.list(workflow_ids=[workflow.metadata.id])\n\n# > Cancel by run ids\nworkflow_run_ids = [workflow_run.metadata.id for workflow_run in workflow_runs.rows]\n\nbulk_cancel_by_ids = BulkCancelReplayOpts(ids=workflow_run_ids)\n\nhatchet.runs.bulk_cancel(bulk_cancel_by_ids)\n\n# > Cancel by filters\n\nbulk_cancel_by_filters = BulkCancelReplayOpts(\n filters=RunFilter(\n since=datetime.today() - timedelta(days=1),\n until=datetime.now(),\n statuses=[V1TaskStatus.RUNNING],\n workflow_ids=[workflow.metadata.id],\n additional_metadata={'key': 'value'},\n )\n)\n\nhatchet.runs.bulk_cancel(bulk_cancel_by_filters)\n", + '# > Setup\n\nfrom datetime import datetime, timedelta\n\nfrom hatchet_sdk import BulkCancelReplayOpts, Hatchet, RunFilter, V1TaskStatus\n\nhatchet = Hatchet()\n\nworkflows = hatchet.workflows.list()\n\nassert workflows.rows\n\nworkflow = workflows.rows[0]\n\n\n# > List runs\nworkflow_runs = hatchet.runs.list(workflow_ids=[workflow.metadata.id])\n\n# > Cancel by run ids\nworkflow_run_ids = [workflow_run.metadata.id for workflow_run in workflow_runs.rows]\n\nbulk_cancel_by_ids = BulkCancelReplayOpts(ids=workflow_run_ids)\n\nhatchet.runs.bulk_cancel(bulk_cancel_by_ids)\n\n# > Cancel by filters\n\nbulk_cancel_by_filters = BulkCancelReplayOpts(\n filters=RunFilter(\n since=datetime.today() - timedelta(days=1),\n until=datetime.now(),\n statuses=[V1TaskStatus.RUNNING],\n workflow_ids=[workflow.metadata.id],\n additional_metadata={"key": "value"},\n )\n)\n\nhatchet.runs.bulk_cancel(bulk_cancel_by_filters)\n', source: 'out/python/bulk_operations/cancel.py', blocks: { setup: { @@ -24,6 +24,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_operations/replay.ts b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_operations/replay.ts index af4d1a9a3..3104384eb 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/bulk_operations/replay.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/bulk_operations/replay.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "# > Setup\n\nfrom datetime import datetime, timedelta\n\nfrom hatchet_sdk import BulkCancelReplayOpts, Hatchet, RunFilter, V1TaskStatus\n\nhatchet = Hatchet()\n\nworkflows = hatchet.workflows.list()\n\nassert workflows.rows\n\nworkflow = workflows.rows[0]\n\n\n# > List runs\nworkflow_runs = hatchet.runs.list(workflow_ids=[workflow.metadata.id])\n\n# > Replay by run ids\nworkflow_run_ids = [workflow_run.metadata.id for workflow_run in workflow_runs.rows]\n\nbulk_replay_by_ids = BulkCancelReplayOpts(ids=workflow_run_ids)\n\nhatchet.runs.bulk_replay(bulk_replay_by_ids)\n\n# > Replay by filters\nbulk_replay_by_filters = BulkCancelReplayOpts(\n filters=RunFilter(\n since=datetime.today() - timedelta(days=1),\n until=datetime.now(),\n statuses=[V1TaskStatus.RUNNING],\n workflow_ids=[workflow.metadata.id],\n additional_metadata={'key': 'value'},\n )\n)\n\nhatchet.runs.bulk_replay(bulk_replay_by_filters)\n", + '# > Setup\n\nfrom datetime import datetime, timedelta\n\nfrom hatchet_sdk import BulkCancelReplayOpts, Hatchet, RunFilter, V1TaskStatus\n\nhatchet = Hatchet()\n\nworkflows = hatchet.workflows.list()\n\nassert workflows.rows\n\nworkflow = workflows.rows[0]\n\n\n# > List runs\nworkflow_runs = hatchet.runs.list(workflow_ids=[workflow.metadata.id])\n\n# > Replay by run ids\nworkflow_run_ids = [workflow_run.metadata.id for workflow_run in workflow_runs.rows]\n\nbulk_replay_by_ids = BulkCancelReplayOpts(ids=workflow_run_ids)\n\nhatchet.runs.bulk_replay(bulk_replay_by_ids)\n\n# > Replay by filters\nbulk_replay_by_filters = BulkCancelReplayOpts(\n filters=RunFilter(\n since=datetime.today() - timedelta(days=1),\n until=datetime.now(),\n statuses=[V1TaskStatus.RUNNING],\n workflow_ids=[workflow.metadata.id],\n additional_metadata={"key": "value"},\n )\n)\n\nhatchet.runs.bulk_replay(bulk_replay_by_filters)\n', source: 'out/python/bulk_operations/replay.py', blocks: { setup: { @@ -24,6 +24,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/cancellation/test_cancellation.ts b/frontend/app/src/next/lib/docs/generated/snips/python/cancellation/test_cancellation.ts index 7c1b2e359..6f6148c66 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/cancellation/test_cancellation.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/cancellation/test_cancellation.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\nimport pytest\n\nfrom examples.cancellation.worker import cancellation_workflow\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.rest.models.v1_task_status import V1TaskStatus\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_cancellation(hatchet: Hatchet) -> None:\n ref = await cancellation_workflow.aio_run_no_wait()\n\n '''Sleep for a long time since we only need cancellation to happen _eventually_'''\n await asyncio.sleep(10)\n\n for i in range(30):\n run = await hatchet.runs.aio_get(ref.workflow_run_id)\n\n if run.run.status == V1TaskStatus.RUNNING:\n await asyncio.sleep(1)\n continue\n\n assert run.run.status == V1TaskStatus.CANCELLED\n assert not run.run.output\n\n break\n else:\n assert False, 'Workflow run did not cancel in time'\n", + 'import asyncio\n\nimport pytest\n\nfrom examples.cancellation.worker import cancellation_workflow\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.rest.models.v1_task_status import V1TaskStatus\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_cancellation(hatchet: Hatchet) -> None:\n ref = await cancellation_workflow.aio_run_no_wait()\n\n """Sleep for a long time since we only need cancellation to happen _eventually_"""\n await asyncio.sleep(10)\n\n for i in range(30):\n run = await hatchet.runs.aio_get(ref.workflow_run_id)\n\n if run.run.status == V1TaskStatus.RUNNING:\n await asyncio.sleep(1)\n continue\n\n assert run.run.status == V1TaskStatus.CANCELLED\n assert not run.run.output\n\n break\n else:\n assert False, "Workflow run did not cancel in time"\n', source: 'out/python/cancellation/test_cancellation.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/cancellation/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/cancellation/trigger.ts index b3f1daed4..bc04923e9 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/cancellation/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/cancellation/trigger.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/cancellation/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/cancellation/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/cancellation/worker.ts index 992e4f736..7b7d73ee8 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/cancellation/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/cancellation/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\nimport time\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\ncancellation_workflow = hatchet.workflow(name='CancelWorkflow')\n\n\n# > Self-cancelling task\n@cancellation_workflow.task()\nasync def self_cancel(input: EmptyModel, ctx: Context) -> dict[str, str]:\n await asyncio.sleep(2)\n\n ## Cancel the task\n await ctx.aio_cancel()\n\n await asyncio.sleep(10)\n\n return {'error': 'Task should have been cancelled'}\n\n\n\n\n# > Checking exit flag\n@cancellation_workflow.task()\ndef check_flag(input: EmptyModel, ctx: Context) -> dict[str, str]:\n for i in range(3):\n time.sleep(1)\n\n # Note: Checking the status of the exit flag is mostly useful for cancelling\n # sync tasks without needing to forcibly kill the thread they're running on.\n if ctx.exit_flag:\n print('Task has been cancelled')\n raise ValueError('Task has been cancelled')\n\n return {'error': 'Task should have been cancelled'}\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker('cancellation-worker', workflows=[cancellation_workflow])\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'import asyncio\nimport time\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\ncancellation_workflow = hatchet.workflow(name="CancelWorkflow")\n\n\n# > Self-cancelling task\n@cancellation_workflow.task()\nasync def self_cancel(input: EmptyModel, ctx: Context) -> dict[str, str]:\n await asyncio.sleep(2)\n\n ## Cancel the task\n await ctx.aio_cancel()\n\n await asyncio.sleep(10)\n\n return {"error": "Task should have been cancelled"}\n\n\n\n\n# > Checking exit flag\n@cancellation_workflow.task()\ndef check_flag(input: EmptyModel, ctx: Context) -> dict[str, str]:\n for i in range(3):\n time.sleep(1)\n\n # Note: Checking the status of the exit flag is mostly useful for cancelling\n # sync tasks without needing to forcibly kill the thread they\'re running on.\n if ctx.exit_flag:\n print("Task has been cancelled")\n raise ValueError("Task has been cancelled")\n\n return {"error": "Task should have been cancelled"}\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker("cancellation-worker", workflows=[cancellation_workflow])\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/cancellation/worker.py', blocks: { self_cancelling_task: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/child/bulk.ts b/frontend/app/src/next/lib/docs/generated/snips/python/child/bulk.ts index 0ed28e7eb..a9684e7e3 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/child/bulk.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/child/bulk.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\n# > Running a Task\nfrom examples.child.worker import SimpleInput, child_task\n\nchild_task.run(SimpleInput(message='Hello, World!'))\n\n\nasync def main() -> None:\n # > Bulk Run a Task\n greetings = ['Hello, World!', 'Hello, Moon!', 'Hello, Mars!']\n\n results = await child_task.aio_run_many(\n [\n # run each greeting as a task in parallel\n child_task.create_bulk_run_item(\n input=SimpleInput(message=greeting),\n )\n for greeting in greetings\n ]\n )\n\n # this will await all results and return a list of results\n print(results)\n\n # > Running Multiple Tasks\n result1 = child_task.aio_run(SimpleInput(message='Hello, World!'))\n result2 = child_task.aio_run(SimpleInput(message='Hello, Moon!'))\n\n # gather the results of the two tasks\n gather_results = await asyncio.gather(result1, result2)\n\n # print the results of the two tasks\n print(gather_results[0]['transformed_message'])\n print(gather_results[1]['transformed_message'])\n", + 'import asyncio\n\n# > Running a Task\nfrom examples.child.worker import SimpleInput, child_task\n\nchild_task.run(SimpleInput(message="Hello, World!"))\n\n\nasync def main() -> None:\n # > Bulk Run a Task\n greetings = ["Hello, World!", "Hello, Moon!", "Hello, Mars!"]\n\n results = await child_task.aio_run_many(\n [\n # run each greeting as a task in parallel\n child_task.create_bulk_run_item(\n input=SimpleInput(message=greeting),\n )\n for greeting in greetings\n ]\n )\n\n # this will await all results and return a list of results\n print(results)\n\n # > Running Multiple Tasks\n result1 = child_task.aio_run(SimpleInput(message="Hello, World!"))\n result2 = child_task.aio_run(SimpleInput(message="Hello, Moon!"))\n\n # gather the results of the two tasks\n gather_results = await asyncio.gather(result1, result2)\n\n # print the results of the two tasks\n print(gather_results[0]["transformed_message"])\n print(gather_results[1]["transformed_message"])\n', source: 'out/python/child/bulk.py', blocks: { running_a_task: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/child/simple-fanout.ts b/frontend/app/src/next/lib/docs/generated/snips/python/child/simple-fanout.ts index 876837dc0..9c152c172 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/child/simple-fanout.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/child/simple-fanout.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from typing import Any\n\nfrom examples.child.worker import SimpleInput, child_task\nfrom hatchet_sdk.context.context import Context\nfrom hatchet_sdk.hatchet import Hatchet\nfrom hatchet_sdk.runnables.types import EmptyModel\n\nhatchet = Hatchet(debug=True)\n\n\n# > Running a Task from within a Task\n@hatchet.task(name='SpawnTask')\nasync def spawn(input: EmptyModel, ctx: Context) -> dict[str, Any]:\n # Simply run the task with the input we received\n result = await child_task.aio_run(\n input=SimpleInput(message='Hello, World!'),\n )\n\n return {'results': result}\n\n\n", + 'from typing import Any\n\nfrom examples.child.worker import SimpleInput, child_task\nfrom hatchet_sdk.context.context import Context\nfrom hatchet_sdk.hatchet import Hatchet\nfrom hatchet_sdk.runnables.types import EmptyModel\n\nhatchet = Hatchet(debug=True)\n\n\n# > Running a Task from within a Task\n@hatchet.task(name="SpawnTask")\nasync def spawn(input: EmptyModel, ctx: Context) -> dict[str, Any]:\n # Simply run the task with the input we received\n result = await child_task.aio_run(\n input=SimpleInput(message="Hello, World!"),\n )\n\n return {"results": result}\n\n\n', source: 'out/python/child/simple-fanout.py', blocks: { running_a_task_from_within_a_task: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/child/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/child/trigger.ts index 8b3524f6f..1a04070af 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/child/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/child/trigger.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "# ruff: noqa: E402\n\nimport asyncio\n\n# > Running a Task\nfrom examples.child.worker import SimpleInput, child_task\n\nchild_task.run(SimpleInput(message='Hello, World!'))\n\n# > Schedule a Task\nfrom datetime import datetime, timedelta\n\nchild_task.schedule(\n datetime.now() + timedelta(minutes=5), SimpleInput(message='Hello, World!')\n)\n\n\nasync def main() -> None:\n # > Running a Task AIO\n result = await child_task.aio_run(SimpleInput(message='Hello, World!'))\n\n print(result)\n\n # > Running Multiple Tasks\n result1 = child_task.aio_run(SimpleInput(message='Hello, World!'))\n result2 = child_task.aio_run(SimpleInput(message='Hello, Moon!'))\n\n # gather the results of the two tasks\n results = await asyncio.gather(result1, result2)\n\n # print the results of the two tasks\n print(results[0]['transformed_message'])\n print(results[1]['transformed_message'])\n", + '# ruff: noqa: E402\n\nimport asyncio\n\n# > Running a Task\nfrom examples.child.worker import SimpleInput, child_task\n\nchild_task.run(SimpleInput(message="Hello, World!"))\n\n# > Schedule a Task\nfrom datetime import datetime, timedelta\n\nchild_task.schedule(\n datetime.now() + timedelta(minutes=5), SimpleInput(message="Hello, World!")\n)\n\n\nasync def main() -> None:\n # > Running a Task AIO\n result = await child_task.aio_run(SimpleInput(message="Hello, World!"))\n\n print(result)\n\n # > Running Multiple Tasks\n result1 = child_task.aio_run(SimpleInput(message="Hello, World!"))\n result2 = child_task.aio_run(SimpleInput(message="Hello, Moon!"))\n\n # gather the results of the two tasks\n results = await asyncio.gather(result1, result2)\n\n # print the results of the two tasks\n print(results[0]["transformed_message"])\n print(results[1]["transformed_message"])\n', source: 'out/python/child/trigger.py', blocks: { running_a_task: { @@ -24,6 +24,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/child/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/child/worker.ts index e71d59f42..0e233310b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/child/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/child/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "# > Simple\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\nclass SimpleInput(BaseModel):\n message: str\n\n\nclass SimpleOutput(BaseModel):\n transformed_message: str\n\n\nchild_task = hatchet.workflow(name='SimpleWorkflow', input_validator=SimpleInput)\n\n\n@child_task.task(name='step1')\ndef step1(input: SimpleInput, ctx: Context) -> SimpleOutput:\n print('executed step1: ', input.message)\n return SimpleOutput(transformed_message=input.message.upper())\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker('test-worker', slots=1, workflows=[child_task])\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + '# > Simple\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\nclass SimpleInput(BaseModel):\n message: str\n\n\nclass SimpleOutput(BaseModel):\n transformed_message: str\n\n\nchild_task = hatchet.workflow(name="SimpleWorkflow", input_validator=SimpleInput)\n\n\n@child_task.task(name="step1")\ndef step1(input: SimpleInput, ctx: Context) -> SimpleOutput:\n print("executed step1: ", input.message)\n return SimpleOutput(transformed_message=input.message.upper())\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker("test-worker", slots=1, workflows=[child_task])\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/child/worker.py', blocks: { simple: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit/test_concurrency_limit.ts b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit/test_concurrency_limit.ts index d3f2b939e..0314912fa 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit/test_concurrency_limit.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit/test_concurrency_limit.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import pytest\n\nfrom examples.concurrency_limit.worker import WorkflowInput, concurrency_limit_workflow\nfrom hatchet_sdk.workflow_run import WorkflowRunRef\n\n\n@pytest.mark.asyncio(loop_scope='session')\n@pytest.mark.skip(reason='The timing for this test is not reliable')\nasync def test_run() -> None:\n num_runs = 6\n runs: list[WorkflowRunRef] = []\n\n # Start all runs\n for i in range(1, num_runs + 1):\n run = concurrency_limit_workflow.run_no_wait(\n WorkflowInput(run=i, group_key=str(i))\n )\n runs.append(run)\n\n # Wait for all results\n successful_runs = []\n cancelled_runs = []\n\n # Process each run individually\n for i, run in enumerate(runs, start=1):\n try:\n result = await run.aio_result()\n successful_runs.append((i, result))\n except Exception as e:\n if 'CANCELLED_BY_CONCURRENCY_LIMIT' in str(e):\n cancelled_runs.append((i, str(e)))\n else:\n raise # Re-raise if it's an unexpected error\n\n # Check that we have the correct number of successful and cancelled runs\n assert (\n len(successful_runs) == 5\n ), f'Expected 5 successful runs, got {len(successful_runs)}'\n assert (\n len(cancelled_runs) == 1\n ), f'Expected 1 cancelled run, got {len(cancelled_runs)}'\n", + 'import pytest\n\nfrom examples.concurrency_limit.worker import WorkflowInput, concurrency_limit_workflow\nfrom hatchet_sdk.workflow_run import WorkflowRunRef\n\n\n@pytest.mark.asyncio(loop_scope="session")\n@pytest.mark.skip(reason="The timing for this test is not reliable")\nasync def test_run() -> None:\n num_runs = 6\n runs: list[WorkflowRunRef] = []\n\n # Start all runs\n for i in range(1, num_runs + 1):\n run = concurrency_limit_workflow.run_no_wait(\n WorkflowInput(run=i, group_key=str(i))\n )\n runs.append(run)\n\n # Wait for all results\n successful_runs = []\n cancelled_runs = []\n\n # Process each run individually\n for i, run in enumerate(runs, start=1):\n try:\n result = await run.aio_result()\n successful_runs.append((i, result))\n except Exception as e:\n if "CANCELLED_BY_CONCURRENCY_LIMIT" in str(e):\n cancelled_runs.append((i, str(e)))\n else:\n raise # Re-raise if it\'s an unexpected error\n\n # Check that we have the correct number of successful and cancelled runs\n assert (\n len(successful_runs) == 5\n ), f"Expected 5 successful runs, got {len(successful_runs)}"\n assert (\n len(cancelled_runs) == 1\n ), f"Expected 1 cancelled run, got {len(cancelled_runs)}"\n', source: 'out/python/concurrency_limit/test_concurrency_limit.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit/trigger.ts index 2dd9a4418..79e5a1084 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit/trigger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from examples.concurrency_limit.worker import WorkflowInput, concurrency_limit_workflow\n\nconcurrency_limit_workflow.run(WorkflowInput(group_key='test', run=1))\n", + 'from examples.concurrency_limit.worker import WorkflowInput, concurrency_limit_workflow\n\nconcurrency_limit_workflow.run(WorkflowInput(group_key="test", run=1))\n', source: 'out/python/concurrency_limit/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit/worker.ts index 5ed95dc51..1869d1e62 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import time\nfrom typing import Any\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import (\n ConcurrencyExpression,\n ConcurrencyLimitStrategy,\n Context,\n Hatchet,\n)\n\nhatchet = Hatchet(debug=True)\n\n\n# > Workflow\nclass WorkflowInput(BaseModel):\n run: int\n group_key: str\n\n\nconcurrency_limit_workflow = hatchet.workflow(\n name='ConcurrencyDemoWorkflow',\n concurrency=ConcurrencyExpression(\n expression='input.group_key',\n max_runs=5,\n limit_strategy=ConcurrencyLimitStrategy.CANCEL_IN_PROGRESS,\n ),\n input_validator=WorkflowInput,\n)\n\n\n\n@concurrency_limit_workflow.task()\ndef step1(input: WorkflowInput, ctx: Context) -> dict[str, Any]:\n time.sleep(3)\n print('executed step1')\n return {'run': input.run}\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'concurrency-demo-worker', slots=10, workflows=[concurrency_limit_workflow]\n )\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'import time\nfrom typing import Any\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import (\n ConcurrencyExpression,\n ConcurrencyLimitStrategy,\n Context,\n Hatchet,\n)\n\nhatchet = Hatchet(debug=True)\n\n\n# > Workflow\nclass WorkflowInput(BaseModel):\n run: int\n group_key: str\n\n\nconcurrency_limit_workflow = hatchet.workflow(\n name="ConcurrencyDemoWorkflow",\n concurrency=ConcurrencyExpression(\n expression="input.group_key",\n max_runs=5,\n limit_strategy=ConcurrencyLimitStrategy.CANCEL_IN_PROGRESS,\n ),\n input_validator=WorkflowInput,\n)\n\n\n\n@concurrency_limit_workflow.task()\ndef step1(input: WorkflowInput, ctx: Context) -> dict[str, Any]:\n time.sleep(3)\n print("executed step1")\n return {"run": input.run}\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "concurrency-demo-worker", slots=10, workflows=[concurrency_limit_workflow]\n )\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/concurrency_limit/worker.py', blocks: { workflow: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr/test_concurrency_limit_rr.ts b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr/test_concurrency_limit_rr.ts index 946eeec72..a58ee18bd 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr/test_concurrency_limit_rr.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr/test_concurrency_limit_rr.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import time\n\nimport pytest\n\nfrom examples.concurrency_limit_rr.worker import concurrency_limit_rr_workflow\nfrom hatchet_sdk.workflow_run import WorkflowRunRef\n\n\n@pytest.mark.skip(reason='The timing for this test is not reliable')\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_run() -> None:\n num_groups = 2\n runs: list[WorkflowRunRef] = []\n\n # Start all runs\n for i in range(1, num_groups + 1):\n run = concurrency_limit_rr_workflow.run_no_wait()\n runs.append(run)\n run = concurrency_limit_rr_workflow.run_no_wait()\n runs.append(run)\n\n # Wait for all results\n successful_runs = []\n cancelled_runs = []\n\n start_time = time.time()\n\n # Process each run individually\n for i, run in enumerate(runs, start=1):\n try:\n result = await run.aio_result()\n successful_runs.append((i, result))\n except Exception as e:\n if 'CANCELLED_BY_CONCURRENCY_LIMIT' in str(e):\n cancelled_runs.append((i, str(e)))\n else:\n raise # Re-raise if it's an unexpected error\n\n end_time = time.time()\n total_time = end_time - start_time\n\n # Check that we have the correct number of successful and cancelled runs\n assert (\n len(successful_runs) == 4\n ), f'Expected 4 successful runs, got {len(successful_runs)}'\n assert (\n len(cancelled_runs) == 0\n ), f'Expected 0 cancelled run, got {len(cancelled_runs)}'\n\n # Check that the total time is close to 2 seconds\n assert (\n 3.8 <= total_time <= 7\n ), f'Expected runtime to be about 4 seconds, but it took {total_time:.2f} seconds'\n\n print(f'Total execution time: {total_time:.2f} seconds')\n", + 'import time\n\nimport pytest\n\nfrom examples.concurrency_limit_rr.worker import concurrency_limit_rr_workflow\nfrom hatchet_sdk.workflow_run import WorkflowRunRef\n\n\n@pytest.mark.skip(reason="The timing for this test is not reliable")\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_run() -> None:\n num_groups = 2\n runs: list[WorkflowRunRef] = []\n\n # Start all runs\n for i in range(1, num_groups + 1):\n run = concurrency_limit_rr_workflow.run_no_wait()\n runs.append(run)\n run = concurrency_limit_rr_workflow.run_no_wait()\n runs.append(run)\n\n # Wait for all results\n successful_runs = []\n cancelled_runs = []\n\n start_time = time.time()\n\n # Process each run individually\n for i, run in enumerate(runs, start=1):\n try:\n result = await run.aio_result()\n successful_runs.append((i, result))\n except Exception as e:\n if "CANCELLED_BY_CONCURRENCY_LIMIT" in str(e):\n cancelled_runs.append((i, str(e)))\n else:\n raise # Re-raise if it\'s an unexpected error\n\n end_time = time.time()\n total_time = end_time - start_time\n\n # Check that we have the correct number of successful and cancelled runs\n assert (\n len(successful_runs) == 4\n ), f"Expected 4 successful runs, got {len(successful_runs)}"\n assert (\n len(cancelled_runs) == 0\n ), f"Expected 0 cancelled run, got {len(cancelled_runs)}"\n\n # Check that the total time is close to 2 seconds\n assert (\n 3.8 <= total_time <= 7\n ), f"Expected runtime to be about 4 seconds, but it took {total_time:.2f} seconds"\n\n print(f"Total execution time: {total_time:.2f} seconds")\n', source: 'out/python/concurrency_limit_rr/test_concurrency_limit_rr.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr/trigger.ts index 77ac76aee..a26807efc 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr/trigger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from examples.concurrency_limit_rr.worker import (\n WorkflowInput,\n concurrency_limit_rr_workflow,\n)\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet()\n\nfor i in range(200):\n group = '0'\n\n if i % 2 == 0:\n group = '1'\n\n concurrency_limit_rr_workflow.run(WorkflowInput(group=group))\n", + 'from examples.concurrency_limit_rr.worker import (\n WorkflowInput,\n concurrency_limit_rr_workflow,\n)\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet()\n\nfor i in range(200):\n group = "0"\n\n if i % 2 == 0:\n group = "1"\n\n concurrency_limit_rr_workflow.run(WorkflowInput(group=group))\n', source: 'out/python/concurrency_limit_rr/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr/worker.ts index 502695cc2..6d3a39b53 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import time\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import (\n ConcurrencyExpression,\n ConcurrencyLimitStrategy,\n Context,\n Hatchet,\n)\n\nhatchet = Hatchet(debug=True)\n\n\n# > Concurrency Strategy With Key\nclass WorkflowInput(BaseModel):\n group: str\n\n\nconcurrency_limit_rr_workflow = hatchet.workflow(\n name='ConcurrencyDemoWorkflowRR',\n concurrency=ConcurrencyExpression(\n expression='input.group',\n max_runs=1,\n limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,\n ),\n input_validator=WorkflowInput,\n)\n\n\n@concurrency_limit_rr_workflow.task()\ndef step1(input: WorkflowInput, ctx: Context) -> None:\n print('starting step1')\n time.sleep(2)\n print('finished step1')\n pass\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'concurrency-demo-worker-rr',\n slots=10,\n workflows=[concurrency_limit_rr_workflow],\n )\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'import time\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import (\n ConcurrencyExpression,\n ConcurrencyLimitStrategy,\n Context,\n Hatchet,\n)\n\nhatchet = Hatchet(debug=True)\n\n\n# > Concurrency Strategy With Key\nclass WorkflowInput(BaseModel):\n group: str\n\n\nconcurrency_limit_rr_workflow = hatchet.workflow(\n name="ConcurrencyDemoWorkflowRR",\n concurrency=ConcurrencyExpression(\n expression="input.group",\n max_runs=1,\n limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,\n ),\n input_validator=WorkflowInput,\n)\n\n\n@concurrency_limit_rr_workflow.task()\ndef step1(input: WorkflowInput, ctx: Context) -> None:\n print("starting step1")\n time.sleep(2)\n print("finished step1")\n pass\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "concurrency-demo-worker-rr",\n slots=10,\n workflows=[concurrency_limit_rr_workflow],\n )\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/concurrency_limit_rr/worker.py', blocks: { concurrency_strategy_with_key: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr_load/event.ts b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr_load/event.ts index 3e3c73fb6..d75df487e 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr_load/event.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr_load/event.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import random\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet(debug=True)\n\n# Create a list of events with desired distribution\nevents = ['1'] * 10000 + ['0'] * 100\nrandom.shuffle(events)\n\n# Send the shuffled events\nfor group in events:\n hatchet.event.push('concurrency-test', {'group': group})\n", + 'import random\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet(debug=True)\n\n# Create a list of events with desired distribution\nevents = ["1"] * 10000 + ["0"] * 100\nrandom.shuffle(events)\n\n# Send the shuffled events\nfor group in events:\n hatchet.event.push("concurrency-test", {"group": group})\n', source: 'out/python/concurrency_limit_rr_load/event.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr_load/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr_load/worker.ts index c2882b236..b1205bdaa 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr_load/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_limit_rr_load/worker.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import random\nimport time\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import (\n ConcurrencyExpression,\n ConcurrencyLimitStrategy,\n Context,\n Hatchet,\n)\n\nhatchet = Hatchet(debug=True)\n\n\nclass LoadRRInput(BaseModel):\n group: str\n\n\nload_rr_workflow = hatchet.workflow(\n name='LoadRoundRobin',\n on_events=['concurrency-test'],\n concurrency=ConcurrencyExpression(\n expression='input.group',\n max_runs=1,\n limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,\n ),\n input_validator=LoadRRInput,\n)\n\n\n@load_rr_workflow.on_failure_task()\ndef on_failure(input: LoadRRInput, context: Context) -> dict[str, str]:\n print('on_failure')\n return {'on_failure': 'on_failure'}\n\n\n@load_rr_workflow.task()\ndef step1(input: LoadRRInput, context: Context) -> dict[str, str]:\n print('starting step1')\n time.sleep(random.randint(2, 20))\n print('finished step1')\n return {'step1': 'step1'}\n\n\n@load_rr_workflow.task(\n retries=3,\n backoff_factor=5,\n backoff_max_seconds=60,\n)\ndef step2(sinput: LoadRRInput, context: Context) -> dict[str, str]:\n print('starting step2')\n if random.random() < 0.5: # 1% chance of failure\n raise Exception('Random failure in step2')\n time.sleep(2)\n print('finished step2')\n return {'step2': 'step2'}\n\n\n@load_rr_workflow.task()\ndef step3(input: LoadRRInput, context: Context) -> dict[str, str]:\n print('starting step3')\n time.sleep(0.2)\n print('finished step3')\n return {'step3': 'step3'}\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'concurrency-demo-worker-rr', slots=50, workflows=[load_rr_workflow]\n )\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'import random\nimport time\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import (\n ConcurrencyExpression,\n ConcurrencyLimitStrategy,\n Context,\n Hatchet,\n)\n\nhatchet = Hatchet(debug=True)\n\n\nclass LoadRRInput(BaseModel):\n group: str\n\n\nload_rr_workflow = hatchet.workflow(\n name="LoadRoundRobin",\n on_events=["concurrency-test"],\n concurrency=ConcurrencyExpression(\n expression="input.group",\n max_runs=1,\n limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,\n ),\n input_validator=LoadRRInput,\n)\n\n\n@load_rr_workflow.on_failure_task()\ndef on_failure(input: LoadRRInput, context: Context) -> dict[str, str]:\n print("on_failure")\n return {"on_failure": "on_failure"}\n\n\n@load_rr_workflow.task()\ndef step1(input: LoadRRInput, context: Context) -> dict[str, str]:\n print("starting step1")\n time.sleep(random.randint(2, 20))\n print("finished step1")\n return {"step1": "step1"}\n\n\n@load_rr_workflow.task(\n retries=3,\n backoff_factor=5,\n backoff_max_seconds=60,\n)\ndef step2(sinput: LoadRRInput, context: Context) -> dict[str, str]:\n print("starting step2")\n if random.random() < 0.5: # 1% chance of failure\n raise Exception("Random failure in step2")\n time.sleep(2)\n print("finished step2")\n return {"step2": "step2"}\n\n\n@load_rr_workflow.task()\ndef step3(input: LoadRRInput, context: Context) -> dict[str, str]:\n print("starting step3")\n time.sleep(0.2)\n print("finished step3")\n return {"step3": "step3"}\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "concurrency-demo-worker-rr", slots=50, workflows=[load_rr_workflow]\n )\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/concurrency_limit_rr_load/worker.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_multiple_keys/test_multiple_concurrency_keys.ts b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_multiple_keys/test_multiple_concurrency_keys.ts index b9c847573..37e498273 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_multiple_keys/test_multiple_concurrency_keys.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_multiple_keys/test_multiple_concurrency_keys.ts @@ -3,11 +3,11 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\nfrom collections import Counter\nfrom datetime import datetime\nfrom random import choice\nfrom typing import Literal\nfrom uuid import uuid4\n\nimport pytest\nfrom pydantic import BaseModel\n\nfrom examples.concurrency_multiple_keys.worker import (\n DIGIT_MAX_RUNS,\n NAME_MAX_RUNS,\n WorkflowInput,\n concurrency_multiple_keys_workflow,\n)\nfrom hatchet_sdk import Hatchet, TriggerWorkflowOptions\nfrom hatchet_sdk.clients.rest.models.v1_task_summary import V1TaskSummary\n\nCharacter = Literal['Anna', 'Vronsky', 'Stiva', 'Dolly', 'Levin', 'Karenin']\ncharacters: list[Character] = [\n 'Anna',\n 'Vronsky',\n 'Stiva',\n 'Dolly',\n 'Levin',\n 'Karenin',\n]\n\n\nclass RunMetadata(BaseModel):\n test_run_id: str\n key: str\n name: Character\n digit: str\n started_at: datetime\n finished_at: datetime\n\n @staticmethod\n def parse(task: V1TaskSummary) -> 'RunMetadata':\n return RunMetadata(\n test_run_id=task.additional_metadata['test_run_id'], # type: ignore\n key=task.additional_metadata['key'], # type: ignore\n name=task.additional_metadata['name'], # type: ignore\n digit=task.additional_metadata['digit'], # type: ignore\n started_at=task.started_at or datetime.max,\n finished_at=task.finished_at or datetime.min,\n )\n\n def __str__(self) -> str:\n return self.key\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_multi_concurrency_key(hatchet: Hatchet) -> None:\n test_run_id = str(uuid4())\n\n run_refs = await concurrency_multiple_keys_workflow.aio_run_many_no_wait(\n [\n concurrency_multiple_keys_workflow.create_bulk_run_item(\n WorkflowInput(\n name=(name := choice(characters)),\n digit=(digit := choice([str(i) for i in range(6)])),\n ),\n options=TriggerWorkflowOptions(\n additional_metadata={\n 'test_run_id': test_run_id,\n 'key': f'{name}-{digit}',\n 'name': name,\n 'digit': digit,\n },\n ),\n )\n for _ in range(100)\n ]\n )\n\n await asyncio.gather(*[r.aio_result() for r in run_refs])\n\n workflows = (\n await hatchet.workflows.aio_list(\n workflow_name=concurrency_multiple_keys_workflow.name,\n limit=1_000,\n )\n ).rows\n\n assert workflows\n\n workflow = next(\n (w for w in workflows if w.name == concurrency_multiple_keys_workflow.name),\n None,\n )\n\n assert workflow\n\n assert workflow.name == concurrency_multiple_keys_workflow.name\n\n runs = await hatchet.runs.aio_list(\n workflow_ids=[workflow.metadata.id],\n additional_metadata={\n 'test_run_id': test_run_id,\n },\n limit=1_000,\n )\n\n sorted_runs = sorted(\n [RunMetadata.parse(r) for r in runs.rows], key=lambda r: r.started_at\n )\n\n overlapping_groups: dict[int, list[RunMetadata]] = {}\n\n for run in sorted_runs:\n has_group_membership = False\n\n if not overlapping_groups:\n overlapping_groups[1] = [run]\n continue\n\n if has_group_membership:\n continue\n\n for id, group in overlapping_groups.items():\n if all(are_overlapping(run, task) for task in group):\n overlapping_groups[id].append(run)\n has_group_membership = True\n break\n\n if not has_group_membership:\n overlapping_groups[len(overlapping_groups) + 1] = [run]\n\n assert {s.key for s in sorted_runs} == {\n k.key for v in overlapping_groups.values() for k in v\n }\n\n for id, group in overlapping_groups.items():\n assert is_valid_group(group), f'Group {id} is not valid'\n\n\ndef are_overlapping(x: RunMetadata, y: RunMetadata) -> bool:\n return (x.started_at < y.finished_at and x.finished_at > y.started_at) or (\n x.finished_at > y.started_at and x.started_at < y.finished_at\n )\n\n\ndef is_valid_group(group: list[RunMetadata]) -> bool:\n digits = Counter[str]()\n names = Counter[str]()\n\n for task in group:\n digits[task.digit] += 1\n names[task.name] += 1\n\n if any(v > DIGIT_MAX_RUNS for v in digits.values()):\n return False\n\n if any(v > NAME_MAX_RUNS for v in names.values()):\n return False\n\n return True\n", + 'import asyncio\nfrom collections import Counter\nfrom datetime import datetime\nfrom random import choice\nfrom typing import Literal\nfrom uuid import uuid4\n\nimport pytest\nfrom pydantic import BaseModel\n\nfrom examples.concurrency_multiple_keys.worker import (\n DIGIT_MAX_RUNS,\n NAME_MAX_RUNS,\n WorkflowInput,\n concurrency_multiple_keys_workflow,\n)\nfrom hatchet_sdk import Hatchet, TriggerWorkflowOptions\nfrom hatchet_sdk.clients.rest.models.v1_task_summary import V1TaskSummary\n\nCharacter = Literal["Anna", "Vronsky", "Stiva", "Dolly", "Levin", "Karenin"]\ncharacters: list[Character] = [\n "Anna",\n "Vronsky",\n "Stiva",\n "Dolly",\n "Levin",\n "Karenin",\n]\n\n\nclass RunMetadata(BaseModel):\n test_run_id: str\n key: str\n name: Character\n digit: str\n started_at: datetime\n finished_at: datetime\n\n @staticmethod\n def parse(task: V1TaskSummary) -> "RunMetadata":\n return RunMetadata(\n test_run_id=task.additional_metadata["test_run_id"], # type: ignore\n key=task.additional_metadata["key"], # type: ignore\n name=task.additional_metadata["name"], # type: ignore\n digit=task.additional_metadata["digit"], # type: ignore\n started_at=task.started_at or datetime.max,\n finished_at=task.finished_at or datetime.min,\n )\n\n def __str__(self) -> str:\n return self.key\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_multi_concurrency_key(hatchet: Hatchet) -> None:\n test_run_id = str(uuid4())\n\n run_refs = await concurrency_multiple_keys_workflow.aio_run_many_no_wait(\n [\n concurrency_multiple_keys_workflow.create_bulk_run_item(\n WorkflowInput(\n name=(name := choice(characters)),\n digit=(digit := choice([str(i) for i in range(6)])),\n ),\n options=TriggerWorkflowOptions(\n additional_metadata={\n "test_run_id": test_run_id,\n "key": f"{name}-{digit}",\n "name": name,\n "digit": digit,\n },\n ),\n )\n for _ in range(100)\n ]\n )\n\n await asyncio.gather(*[r.aio_result() for r in run_refs])\n\n workflows = (\n await hatchet.workflows.aio_list(\n workflow_name=concurrency_multiple_keys_workflow.name,\n limit=1_000,\n )\n ).rows\n\n assert workflows\n\n workflow = next(\n (w for w in workflows if w.name == concurrency_multiple_keys_workflow.name),\n None,\n )\n\n assert workflow\n\n assert workflow.name == concurrency_multiple_keys_workflow.name\n\n runs = await hatchet.runs.aio_list(\n workflow_ids=[workflow.metadata.id],\n additional_metadata={\n "test_run_id": test_run_id,\n },\n limit=1_000,\n )\n\n sorted_runs = sorted(\n [RunMetadata.parse(r) for r in runs.rows], key=lambda r: r.started_at\n )\n\n overlapping_groups: dict[int, list[RunMetadata]] = {}\n\n for run in sorted_runs:\n has_group_membership = False\n\n if not overlapping_groups:\n overlapping_groups[1] = [run]\n continue\n\n if has_group_membership:\n continue\n\n for id, group in overlapping_groups.items():\n if all(are_overlapping(run, task) for task in group):\n overlapping_groups[id].append(run)\n has_group_membership = True\n break\n\n if not has_group_membership:\n overlapping_groups[len(overlapping_groups) + 1] = [run]\n\n assert {s.key for s in sorted_runs} == {\n k.key for v in overlapping_groups.values() for k in v\n }\n\n for id, group in overlapping_groups.items():\n assert is_valid_group(group), f"Group {id} is not valid"\n\n\ndef are_overlapping(x: RunMetadata, y: RunMetadata) -> bool:\n return (x.started_at < y.finished_at and x.finished_at > y.started_at) or (\n x.finished_at > y.started_at and x.started_at < y.finished_at\n )\n\n\ndef is_valid_group(group: list[RunMetadata]) -> bool:\n digits = Counter[str]()\n names = Counter[str]()\n\n for task in group:\n digits[task.digit] += 1\n names[task.name] += 1\n\n if any(v > DIGIT_MAX_RUNS for v in digits.values()):\n return False\n\n if any(v > NAME_MAX_RUNS for v in names.values()):\n return False\n\n return True\n', source: 'out/python/concurrency_multiple_keys/test_multiple_concurrency_keys.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_multiple_keys/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_multiple_keys/worker.ts index a5a181801..c4ec956b4 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_multiple_keys/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_multiple_keys/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import (\n ConcurrencyExpression,\n ConcurrencyLimitStrategy,\n Context,\n Hatchet,\n)\n\nhatchet = Hatchet(debug=True)\n\nSLEEP_TIME = 2\nDIGIT_MAX_RUNS = 8\nNAME_MAX_RUNS = 3\n\n\n# > Concurrency Strategy With Key\nclass WorkflowInput(BaseModel):\n name: str\n digit: str\n\n\nconcurrency_multiple_keys_workflow = hatchet.workflow(\n name='ConcurrencyWorkflowManyKeys',\n input_validator=WorkflowInput,\n)\n\n\n@concurrency_multiple_keys_workflow.task(\n concurrency=[\n ConcurrencyExpression(\n expression='input.digit',\n max_runs=DIGIT_MAX_RUNS,\n limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,\n ),\n ConcurrencyExpression(\n expression='input.name',\n max_runs=NAME_MAX_RUNS,\n limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,\n ),\n ]\n)\nasync def concurrency_task(input: WorkflowInput, ctx: Context) -> None:\n await asyncio.sleep(SLEEP_TIME)\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'concurrency-worker-multiple-keys',\n slots=10,\n workflows=[concurrency_multiple_keys_workflow],\n )\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'import asyncio\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import (\n ConcurrencyExpression,\n ConcurrencyLimitStrategy,\n Context,\n Hatchet,\n)\n\nhatchet = Hatchet(debug=True)\n\nSLEEP_TIME = 2\nDIGIT_MAX_RUNS = 8\nNAME_MAX_RUNS = 3\n\n\n# > Concurrency Strategy With Key\nclass WorkflowInput(BaseModel):\n name: str\n digit: str\n\n\nconcurrency_multiple_keys_workflow = hatchet.workflow(\n name="ConcurrencyWorkflowManyKeys",\n input_validator=WorkflowInput,\n)\n\n\n@concurrency_multiple_keys_workflow.task(\n concurrency=[\n ConcurrencyExpression(\n expression="input.digit",\n max_runs=DIGIT_MAX_RUNS,\n limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,\n ),\n ConcurrencyExpression(\n expression="input.name",\n max_runs=NAME_MAX_RUNS,\n limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,\n ),\n ]\n)\nasync def concurrency_task(input: WorkflowInput, ctx: Context) -> None:\n await asyncio.sleep(SLEEP_TIME)\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "concurrency-worker-multiple-keys",\n slots=10,\n workflows=[concurrency_multiple_keys_workflow],\n )\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/concurrency_multiple_keys/worker.py', blocks: { concurrency_strategy_with_key: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_workflow_level/test_workflow_level_concurrency.ts b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_workflow_level/test_workflow_level_concurrency.ts index b3a083a83..66c8121d0 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_workflow_level/test_workflow_level_concurrency.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_workflow_level/test_workflow_level_concurrency.ts @@ -3,11 +3,11 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\nfrom collections import Counter\nfrom datetime import datetime\nfrom random import choice\nfrom typing import Literal\nfrom uuid import uuid4\n\nimport pytest\nfrom pydantic import BaseModel\n\nfrom examples.concurrency_workflow_level.worker import (\n DIGIT_MAX_RUNS,\n NAME_MAX_RUNS,\n WorkflowInput,\n concurrency_workflow_level_workflow,\n)\nfrom hatchet_sdk import Hatchet, TriggerWorkflowOptions\nfrom hatchet_sdk.clients.rest.models.v1_task_summary import V1TaskSummary\n\nCharacter = Literal['Anna', 'Vronsky', 'Stiva', 'Dolly', 'Levin', 'Karenin']\ncharacters: list[Character] = [\n 'Anna',\n 'Vronsky',\n 'Stiva',\n 'Dolly',\n 'Levin',\n 'Karenin',\n]\n\n\nclass RunMetadata(BaseModel):\n test_run_id: str\n key: str\n name: Character\n digit: str\n started_at: datetime\n finished_at: datetime\n\n @staticmethod\n def parse(task: V1TaskSummary) -> 'RunMetadata':\n return RunMetadata(\n test_run_id=task.additional_metadata['test_run_id'], # type: ignore\n key=task.additional_metadata['key'], # type: ignore\n name=task.additional_metadata['name'], # type: ignore\n digit=task.additional_metadata['digit'], # type: ignore\n started_at=task.started_at or datetime.max,\n finished_at=task.finished_at or datetime.min,\n )\n\n def __str__(self) -> str:\n return self.key\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_workflow_level_concurrency(hatchet: Hatchet) -> None:\n test_run_id = str(uuid4())\n\n run_refs = await concurrency_workflow_level_workflow.aio_run_many_no_wait(\n [\n concurrency_workflow_level_workflow.create_bulk_run_item(\n WorkflowInput(\n name=(name := choice(characters)),\n digit=(digit := choice([str(i) for i in range(6)])),\n ),\n options=TriggerWorkflowOptions(\n additional_metadata={\n 'test_run_id': test_run_id,\n 'key': f'{name}-{digit}',\n 'name': name,\n 'digit': digit,\n },\n ),\n )\n for _ in range(100)\n ]\n )\n\n await asyncio.gather(*[r.aio_result() for r in run_refs])\n\n workflows = (\n await hatchet.workflows.aio_list(\n workflow_name=concurrency_workflow_level_workflow.name,\n limit=1_000,\n )\n ).rows\n\n assert workflows\n\n workflow = next(\n (w for w in workflows if w.name == concurrency_workflow_level_workflow.name),\n None,\n )\n\n assert workflow\n\n assert workflow.name == concurrency_workflow_level_workflow.name\n\n runs = await hatchet.runs.aio_list(\n workflow_ids=[workflow.metadata.id],\n additional_metadata={\n 'test_run_id': test_run_id,\n },\n limit=1_000,\n )\n\n sorted_runs = sorted(\n [RunMetadata.parse(r) for r in runs.rows], key=lambda r: r.started_at\n )\n\n overlapping_groups: dict[int, list[RunMetadata]] = {}\n\n for run in sorted_runs:\n has_group_membership = False\n\n if not overlapping_groups:\n overlapping_groups[1] = [run]\n continue\n\n if has_group_membership:\n continue\n\n for id, group in overlapping_groups.items():\n if all(are_overlapping(run, task) for task in group):\n overlapping_groups[id].append(run)\n has_group_membership = True\n break\n\n if not has_group_membership:\n overlapping_groups[len(overlapping_groups) + 1] = [run]\n\n for id, group in overlapping_groups.items():\n assert is_valid_group(group), f'Group {id} is not valid'\n\n\ndef are_overlapping(x: RunMetadata, y: RunMetadata) -> bool:\n return (x.started_at < y.finished_at and x.finished_at > y.started_at) or (\n x.finished_at > y.started_at and x.started_at < y.finished_at\n )\n\n\ndef is_valid_group(group: list[RunMetadata]) -> bool:\n digits = Counter[str]()\n names = Counter[str]()\n\n for task in group:\n digits[task.digit] += 1\n names[task.name] += 1\n\n if any(v > DIGIT_MAX_RUNS for v in digits.values()):\n return False\n\n if any(v > NAME_MAX_RUNS for v in names.values()):\n return False\n\n return True\n", + 'import asyncio\nfrom collections import Counter\nfrom datetime import datetime\nfrom random import choice\nfrom typing import Literal\nfrom uuid import uuid4\n\nimport pytest\nfrom pydantic import BaseModel\n\nfrom examples.concurrency_workflow_level.worker import (\n DIGIT_MAX_RUNS,\n NAME_MAX_RUNS,\n WorkflowInput,\n concurrency_workflow_level_workflow,\n)\nfrom hatchet_sdk import Hatchet, TriggerWorkflowOptions\nfrom hatchet_sdk.clients.rest.models.v1_task_summary import V1TaskSummary\n\nCharacter = Literal["Anna", "Vronsky", "Stiva", "Dolly", "Levin", "Karenin"]\ncharacters: list[Character] = [\n "Anna",\n "Vronsky",\n "Stiva",\n "Dolly",\n "Levin",\n "Karenin",\n]\n\n\nclass RunMetadata(BaseModel):\n test_run_id: str\n key: str\n name: Character\n digit: str\n started_at: datetime\n finished_at: datetime\n\n @staticmethod\n def parse(task: V1TaskSummary) -> "RunMetadata":\n return RunMetadata(\n test_run_id=task.additional_metadata["test_run_id"], # type: ignore\n key=task.additional_metadata["key"], # type: ignore\n name=task.additional_metadata["name"], # type: ignore\n digit=task.additional_metadata["digit"], # type: ignore\n started_at=task.started_at or datetime.max,\n finished_at=task.finished_at or datetime.min,\n )\n\n def __str__(self) -> str:\n return self.key\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_workflow_level_concurrency(hatchet: Hatchet) -> None:\n test_run_id = str(uuid4())\n\n run_refs = await concurrency_workflow_level_workflow.aio_run_many_no_wait(\n [\n concurrency_workflow_level_workflow.create_bulk_run_item(\n WorkflowInput(\n name=(name := choice(characters)),\n digit=(digit := choice([str(i) for i in range(6)])),\n ),\n options=TriggerWorkflowOptions(\n additional_metadata={\n "test_run_id": test_run_id,\n "key": f"{name}-{digit}",\n "name": name,\n "digit": digit,\n },\n ),\n )\n for _ in range(100)\n ]\n )\n\n await asyncio.gather(*[r.aio_result() for r in run_refs])\n\n workflows = (\n await hatchet.workflows.aio_list(\n workflow_name=concurrency_workflow_level_workflow.name,\n limit=1_000,\n )\n ).rows\n\n assert workflows\n\n workflow = next(\n (w for w in workflows if w.name == concurrency_workflow_level_workflow.name),\n None,\n )\n\n assert workflow\n\n assert workflow.name == concurrency_workflow_level_workflow.name\n\n runs = await hatchet.runs.aio_list(\n workflow_ids=[workflow.metadata.id],\n additional_metadata={\n "test_run_id": test_run_id,\n },\n limit=1_000,\n )\n\n sorted_runs = sorted(\n [RunMetadata.parse(r) for r in runs.rows], key=lambda r: r.started_at\n )\n\n overlapping_groups: dict[int, list[RunMetadata]] = {}\n\n for run in sorted_runs:\n has_group_membership = False\n\n if not overlapping_groups:\n overlapping_groups[1] = [run]\n continue\n\n if has_group_membership:\n continue\n\n for id, group in overlapping_groups.items():\n if all(are_overlapping(run, task) for task in group):\n overlapping_groups[id].append(run)\n has_group_membership = True\n break\n\n if not has_group_membership:\n overlapping_groups[len(overlapping_groups) + 1] = [run]\n\n for id, group in overlapping_groups.items():\n assert is_valid_group(group), f"Group {id} is not valid"\n\n\ndef are_overlapping(x: RunMetadata, y: RunMetadata) -> bool:\n return (x.started_at < y.finished_at and x.finished_at > y.started_at) or (\n x.finished_at > y.started_at and x.started_at < y.finished_at\n )\n\n\ndef is_valid_group(group: list[RunMetadata]) -> bool:\n digits = Counter[str]()\n names = Counter[str]()\n\n for task in group:\n digits[task.digit] += 1\n names[task.name] += 1\n\n if any(v > DIGIT_MAX_RUNS for v in digits.values()):\n return False\n\n if any(v > NAME_MAX_RUNS for v in names.values()):\n return False\n\n return True\n', source: 'out/python/concurrency_workflow_level/test_workflow_level_concurrency.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_workflow_level/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_workflow_level/worker.ts index 79a94dcb1..b0726b64f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_workflow_level/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/concurrency_workflow_level/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import (\n ConcurrencyExpression,\n ConcurrencyLimitStrategy,\n Context,\n Hatchet,\n)\n\nhatchet = Hatchet(debug=True)\n\nSLEEP_TIME = 2\nDIGIT_MAX_RUNS = 8\nNAME_MAX_RUNS = 3\n\n\n# > Multiple Concurrency Keys\nclass WorkflowInput(BaseModel):\n name: str\n digit: str\n\n\nconcurrency_workflow_level_workflow = hatchet.workflow(\n name='ConcurrencyWorkflowManyKeys',\n input_validator=WorkflowInput,\n concurrency=[\n ConcurrencyExpression(\n expression='input.digit',\n max_runs=DIGIT_MAX_RUNS,\n limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,\n ),\n ConcurrencyExpression(\n expression='input.name',\n max_runs=NAME_MAX_RUNS,\n limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,\n ),\n ],\n)\n\n\n@concurrency_workflow_level_workflow.task()\nasync def task_1(input: WorkflowInput, ctx: Context) -> None:\n await asyncio.sleep(SLEEP_TIME)\n\n\n@concurrency_workflow_level_workflow.task()\nasync def task_2(input: WorkflowInput, ctx: Context) -> None:\n await asyncio.sleep(SLEEP_TIME)\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'concurrency-worker-workflow-level',\n slots=10,\n workflows=[concurrency_workflow_level_workflow],\n )\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'import asyncio\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import (\n ConcurrencyExpression,\n ConcurrencyLimitStrategy,\n Context,\n Hatchet,\n)\n\nhatchet = Hatchet(debug=True)\n\nSLEEP_TIME = 2\nDIGIT_MAX_RUNS = 8\nNAME_MAX_RUNS = 3\n\n\n# > Multiple Concurrency Keys\nclass WorkflowInput(BaseModel):\n name: str\n digit: str\n\n\nconcurrency_workflow_level_workflow = hatchet.workflow(\n name="ConcurrencyWorkflowManyKeys",\n input_validator=WorkflowInput,\n concurrency=[\n ConcurrencyExpression(\n expression="input.digit",\n max_runs=DIGIT_MAX_RUNS,\n limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,\n ),\n ConcurrencyExpression(\n expression="input.name",\n max_runs=NAME_MAX_RUNS,\n limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,\n ),\n ],\n)\n\n\n@concurrency_workflow_level_workflow.task()\nasync def task_1(input: WorkflowInput, ctx: Context) -> None:\n await asyncio.sleep(SLEEP_TIME)\n\n\n@concurrency_workflow_level_workflow.task()\nasync def task_2(input: WorkflowInput, ctx: Context) -> None:\n await asyncio.sleep(SLEEP_TIME)\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "concurrency-worker-workflow-level",\n slots=10,\n workflows=[concurrency_workflow_level_workflow],\n )\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/concurrency_workflow_level/worker.py', blocks: { multiple_concurrency_keys: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/cron/programatic-async.ts b/frontend/app/src/next/lib/docs/generated/snips/python/cron/programatic-async.ts index 1a0331903..db47d7f08 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/cron/programatic-async.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/cron/programatic-async.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from pydantic import BaseModel\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet()\n\n\nclass DynamicCronInput(BaseModel):\n name: str\n\n\nasync def create_cron() -> None:\n dynamic_cron_workflow = hatchet.workflow(\n name='CronWorkflow', input_validator=DynamicCronInput\n )\n\n # > Create\n cron_trigger = await dynamic_cron_workflow.aio_create_cron(\n cron_name='customer-a-daily-report',\n expression='0 12 * * *',\n input=DynamicCronInput(name='John Doe'),\n additional_metadata={\n 'customer_id': 'customer-a',\n },\n )\n\n cron_trigger.metadata.id # the id of the cron trigger\n\n # > List\n await hatchet.cron.aio_list()\n\n # > Get\n cron_trigger = await hatchet.cron.aio_get(cron_id=cron_trigger.metadata.id)\n\n # > Delete\n await hatchet.cron.aio_delete(cron_id=cron_trigger.metadata.id)\n", + 'from pydantic import BaseModel\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet()\n\n\nclass DynamicCronInput(BaseModel):\n name: str\n\n\nasync def create_cron() -> None:\n dynamic_cron_workflow = hatchet.workflow(\n name="CronWorkflow", input_validator=DynamicCronInput\n )\n\n # > Create\n cron_trigger = await dynamic_cron_workflow.aio_create_cron(\n cron_name="customer-a-daily-report",\n expression="0 12 * * *",\n input=DynamicCronInput(name="John Doe"),\n additional_metadata={\n "customer_id": "customer-a",\n },\n )\n\n cron_trigger.metadata.id # the id of the cron trigger\n\n # > List\n await hatchet.cron.aio_list()\n\n # > Get\n cron_trigger = await hatchet.cron.aio_get(cron_id=cron_trigger.metadata.id)\n\n # > Delete\n await hatchet.cron.aio_delete(cron_id=cron_trigger.metadata.id)\n', source: 'out/python/cron/programatic-async.py', blocks: { create: { @@ -24,6 +24,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/cron/programatic-sync.ts b/frontend/app/src/next/lib/docs/generated/snips/python/cron/programatic-sync.ts index 01abcf32f..7d95ad4f1 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/cron/programatic-sync.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/cron/programatic-sync.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from pydantic import BaseModel\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet()\n\n\nclass DynamicCronInput(BaseModel):\n name: str\n\n\ndynamic_cron_workflow = hatchet.workflow(\n name='CronWorkflow', input_validator=DynamicCronInput\n)\n\n# > Create\ncron_trigger = dynamic_cron_workflow.create_cron(\n cron_name='customer-a-daily-report',\n expression='0 12 * * *',\n input=DynamicCronInput(name='John Doe'),\n additional_metadata={\n 'customer_id': 'customer-a',\n },\n)\n\n\nid = cron_trigger.metadata.id # the id of the cron trigger\n\n# > List\ncron_triggers = hatchet.cron.list()\n\n# > Get\ncron_trigger = hatchet.cron.get(cron_id=cron_trigger.metadata.id)\n\n# > Delete\nhatchet.cron.delete(cron_id=cron_trigger.metadata.id)\n", + 'from pydantic import BaseModel\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet()\n\n\nclass DynamicCronInput(BaseModel):\n name: str\n\n\ndynamic_cron_workflow = hatchet.workflow(\n name="CronWorkflow", input_validator=DynamicCronInput\n)\n\n# > Create\ncron_trigger = dynamic_cron_workflow.create_cron(\n cron_name="customer-a-daily-report",\n expression="0 12 * * *",\n input=DynamicCronInput(name="John Doe"),\n additional_metadata={\n "customer_id": "customer-a",\n },\n)\n\n\nid = cron_trigger.metadata.id # the id of the cron trigger\n\n# > List\ncron_triggers = hatchet.cron.list()\n\n# > Get\ncron_trigger = hatchet.cron.get(cron_id=cron_trigger.metadata.id)\n\n# > Delete\nhatchet.cron.delete(cron_id=cron_trigger.metadata.id)\n', source: 'out/python/cron/programatic-sync.py', blocks: { create: { @@ -24,6 +24,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/cron/workflow-definition.ts b/frontend/app/src/next/lib/docs/generated/snips/python/cron/workflow-definition.ts index ac8eba527..3ac8e3422 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/cron/workflow-definition.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/cron/workflow-definition.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\n# > Workflow Definition Cron Trigger\n# Adding a cron trigger to a workflow is as simple\n# as adding a `cron expression` to the `on_cron`\n# prop of the workflow definition\n\ncron_workflow = hatchet.workflow(name='CronWorkflow', on_crons=['* * * * *'])\n\n\n@cron_workflow.task()\ndef step1(input: EmptyModel, ctx: Context) -> dict[str, str]:\n return {\n 'time': 'step1',\n }\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker('test-worker', slots=1, workflows=[cron_workflow])\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\n# > Workflow Definition Cron Trigger\n# Adding a cron trigger to a workflow is as simple\n# as adding a `cron expression` to the `on_cron`\n# prop of the workflow definition\n\ncron_workflow = hatchet.workflow(name="CronWorkflow", on_crons=["* * * * *"])\n\n\n@cron_workflow.task()\ndef step1(input: EmptyModel, ctx: Context) -> dict[str, str]:\n return {\n "time": "step1",\n }\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker("test-worker", slots=1, workflows=[cron_workflow])\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/cron/workflow-definition.py', blocks: { workflow_definition_cron_trigger: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/dag/test_dag.ts b/frontend/app/src/next/lib/docs/generated/snips/python/dag/test_dag.ts index 435cac0ba..4b690cdd8 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/dag/test_dag.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/dag/test_dag.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import pytest\n\nfrom examples.dag.worker import dag_workflow\nfrom hatchet_sdk import Hatchet\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_run(hatchet: Hatchet) -> None:\n result = await dag_workflow.aio_run()\n\n one = result['step1']['random_number']\n two = result['step2']['random_number']\n assert result['step3']['sum'] == one + two\n assert result['step4']['step4'] == 'step4'\n", + 'import pytest\n\nfrom examples.dag.worker import dag_workflow\nfrom hatchet_sdk import Hatchet\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_run(hatchet: Hatchet) -> None:\n result = await dag_workflow.aio_run()\n\n one = result["step1"]["random_number"]\n two = result["step2"]["random_number"]\n assert result["step3"]["sum"] == one + two\n assert result["step4"]["step4"] == "step4"\n', source: 'out/python/dag/test_dag.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/dag/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/dag/trigger.ts index dad36f335..080fb3393 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/dag/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/dag/trigger.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/dag/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/dag/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/dag/worker.ts index 9a9348bc9..f550543c6 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/dag/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/dag/worker.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import random\nimport time\nfrom datetime import timedelta\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\n\nclass StepOutput(BaseModel):\n random_number: int\n\n\nclass RandomSum(BaseModel):\n sum: int\n\n\nhatchet = Hatchet(debug=True)\n\ndag_workflow = hatchet.workflow(name='DAGWorkflow')\n\n\n@dag_workflow.task(execution_timeout=timedelta(seconds=5))\ndef step1(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n@dag_workflow.task(execution_timeout=timedelta(seconds=5))\nasync def step2(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n@dag_workflow.task(parents=[step1, step2])\nasync def step3(input: EmptyModel, ctx: Context) -> RandomSum:\n one = ctx.task_output(step1).random_number\n two = ctx.task_output(step2).random_number\n\n return RandomSum(sum=one + two)\n\n\n@dag_workflow.task(parents=[step1, step3])\nasync def step4(input: EmptyModel, ctx: Context) -> dict[str, str]:\n print(\n 'executed step4',\n time.strftime('%H:%M:%S', time.localtime()),\n input,\n ctx.task_output(step1),\n ctx.task_output(step3),\n )\n return {\n 'step4': 'step4',\n }\n\n\ndef main() -> None:\n worker = hatchet.worker('dag-worker', workflows=[dag_workflow])\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'import random\nimport time\nfrom datetime import timedelta\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\n\nclass StepOutput(BaseModel):\n random_number: int\n\n\nclass RandomSum(BaseModel):\n sum: int\n\n\nhatchet = Hatchet(debug=True)\n\ndag_workflow = hatchet.workflow(name="DAGWorkflow")\n\n\n@dag_workflow.task(execution_timeout=timedelta(seconds=5))\ndef step1(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n@dag_workflow.task(execution_timeout=timedelta(seconds=5))\nasync def step2(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n@dag_workflow.task(parents=[step1, step2])\nasync def step3(input: EmptyModel, ctx: Context) -> RandomSum:\n one = ctx.task_output(step1).random_number\n two = ctx.task_output(step2).random_number\n\n return RandomSum(sum=one + two)\n\n\n@dag_workflow.task(parents=[step1, step3])\nasync def step4(input: EmptyModel, ctx: Context) -> dict[str, str]:\n print(\n "executed step4",\n time.strftime("%H:%M:%S", time.localtime()),\n input,\n ctx.task_output(step1),\n ctx.task_output(step3),\n )\n return {\n "step4": "step4",\n }\n\n\ndef main() -> None:\n worker = hatchet.worker("dag-worker", workflows=[dag_workflow])\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/dag/worker.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/dedupe/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/dedupe/worker.ts index ce91e219b..b72817d17 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/dedupe/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/dedupe/worker.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\nfrom datetime import timedelta\nfrom typing import Any\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet, TriggerWorkflowOptions\nfrom hatchet_sdk.clients.admin import DedupeViolationErr\n\nhatchet = Hatchet(debug=True)\n\ndedupe_parent_wf = hatchet.workflow(name='DedupeParent')\ndedupe_child_wf = hatchet.workflow(name='DedupeChild')\n\n\n@dedupe_parent_wf.task(execution_timeout=timedelta(minutes=1))\nasync def spawn(input: EmptyModel, ctx: Context) -> dict[str, list[Any]]:\n print('spawning child')\n\n results = []\n\n for i in range(2):\n try:\n results.append(\n (\n dedupe_child_wf.aio_run(\n options=TriggerWorkflowOptions(\n additional_metadata={'dedupe': 'test'}, key=f'child{i}'\n ),\n )\n )\n )\n except DedupeViolationErr as e:\n print(f'dedupe violation {e}')\n continue\n\n result = await asyncio.gather(*results)\n print(f'results {result}')\n\n return {'results': result}\n\n\n@dedupe_child_wf.task()\nasync def process(input: EmptyModel, ctx: Context) -> dict[str, str]:\n await asyncio.sleep(3)\n\n print('child process')\n return {'status': 'success'}\n\n\n@dedupe_child_wf.task()\nasync def process2(input: EmptyModel, ctx: Context) -> dict[str, str]:\n print('child process2')\n return {'status2': 'success'}\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'fanout-worker', slots=100, workflows=[dedupe_parent_wf, dedupe_child_wf]\n )\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'import asyncio\nfrom datetime import timedelta\nfrom typing import Any\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet, TriggerWorkflowOptions\nfrom hatchet_sdk.clients.admin import DedupeViolationErr\n\nhatchet = Hatchet(debug=True)\n\ndedupe_parent_wf = hatchet.workflow(name="DedupeParent")\ndedupe_child_wf = hatchet.workflow(name="DedupeChild")\n\n\n@dedupe_parent_wf.task(execution_timeout=timedelta(minutes=1))\nasync def spawn(input: EmptyModel, ctx: Context) -> dict[str, list[Any]]:\n print("spawning child")\n\n results = []\n\n for i in range(2):\n try:\n results.append(\n (\n dedupe_child_wf.aio_run(\n options=TriggerWorkflowOptions(\n additional_metadata={"dedupe": "test"}, key=f"child{i}"\n ),\n )\n )\n )\n except DedupeViolationErr as e:\n print(f"dedupe violation {e}")\n continue\n\n result = await asyncio.gather(*results)\n print(f"results {result}")\n\n return {"results": result}\n\n\n@dedupe_child_wf.task()\nasync def process(input: EmptyModel, ctx: Context) -> dict[str, str]:\n await asyncio.sleep(3)\n\n print("child process")\n return {"status": "success"}\n\n\n@dedupe_child_wf.task()\nasync def process2(input: EmptyModel, ctx: Context) -> dict[str, str]:\n print("child process2")\n return {"status2": "success"}\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "fanout-worker", slots=100, workflows=[dedupe_parent_wf, dedupe_child_wf]\n )\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/dedupe/worker.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/delayed/test_delayed.ts b/frontend/app/src/next/lib/docs/generated/snips/python/delayed/test_delayed.ts index 9b04dfe9a..ad1767550 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/delayed/test_delayed.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/delayed/test_delayed.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "# from hatchet_sdk import Hatchet\n# import pytest\n\n# from tests.utils import fixture_bg_worker\n\n\n# worker = fixture_bg_worker(['poetry', 'run', 'manual_trigger'])\n\n# # @pytest.mark.asyncio(loop_scope='session')\n# async def test_run(hatchet: Hatchet):\n# # TODO\n", + '# from hatchet_sdk import Hatchet\n# import pytest\n\n# from tests.utils import fixture_bg_worker\n\n\n# worker = fixture_bg_worker(["poetry", "run", "manual_trigger"])\n\n# # @pytest.mark.asyncio(loop_scope="session")\n# async def test_run(hatchet: Hatchet):\n# # TODO\n', source: 'out/python/delayed/test_delayed.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/delayed/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/delayed/trigger.ts index 68be5e4e9..1410aa641 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/delayed/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/delayed/trigger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from examples.delayed.worker import PrinterInput, print_schedule_wf\n\nprint_schedule_wf.run(PrinterInput(message='test'))\n", + 'from examples.delayed.worker import PrinterInput, print_schedule_wf\n\nprint_schedule_wf.run(PrinterInput(message="test"))\n', source: 'out/python/delayed/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/delayed/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/delayed/worker.ts index 017cbcdb5..f30cc11de 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/delayed/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/delayed/worker.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from datetime import datetime, timedelta\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\nclass PrinterInput(BaseModel):\n message: str\n\n\nprint_schedule_wf = hatchet.workflow(\n name='PrintScheduleWorkflow',\n input_validator=PrinterInput,\n)\nprint_printer_wf = hatchet.workflow(\n name='PrintPrinterWorkflow', input_validator=PrinterInput\n)\n\n\n@print_schedule_wf.task()\ndef schedule(input: PrinterInput, ctx: Context) -> None:\n now = datetime.now()\n print(f'the time is \\t {now.strftime('%H:%M:%S')}')\n future_time = now + timedelta(seconds=15)\n print(f'scheduling for \\t {future_time.strftime('%H:%M:%S')}')\n\n print_printer_wf.schedule(future_time, input=input)\n\n\n@print_schedule_wf.task()\ndef step1(input: PrinterInput, ctx: Context) -> None:\n now = datetime.now()\n print(f'printed at \\t {now.strftime('%H:%M:%S')}')\n print(f'message \\t {input.message}')\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'delayed-worker', slots=4, workflows=[print_schedule_wf, print_printer_wf]\n )\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from datetime import datetime, timedelta\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\nclass PrinterInput(BaseModel):\n message: str\n\n\nprint_schedule_wf = hatchet.workflow(\n name="PrintScheduleWorkflow",\n input_validator=PrinterInput,\n)\nprint_printer_wf = hatchet.workflow(\n name="PrintPrinterWorkflow", input_validator=PrinterInput\n)\n\n\n@print_schedule_wf.task()\ndef schedule(input: PrinterInput, ctx: Context) -> None:\n now = datetime.now()\n print(f"the time is \\t {now.strftime(\'%H:%M:%S\')}")\n future_time = now + timedelta(seconds=15)\n print(f"scheduling for \\t {future_time.strftime(\'%H:%M:%S\')}")\n\n print_printer_wf.schedule(future_time, input=input)\n\n\n@print_schedule_wf.task()\ndef step1(input: PrinterInput, ctx: Context) -> None:\n now = datetime.now()\n print(f"printed at \\t {now.strftime(\'%H:%M:%S\')}")\n print(f"message \\t {input.message}")\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "delayed-worker", slots=4, workflows=[print_schedule_wf, print_printer_wf]\n )\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/delayed/worker.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/durable/test_durable.ts b/frontend/app/src/next/lib/docs/generated/snips/python/durable/test_durable.ts index 0639f84bb..442876dd2 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/durable/test_durable.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/durable/test_durable.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\nimport os\n\nimport pytest\n\nfrom examples.durable.worker import EVENT_KEY, SLEEP_TIME, durable_workflow\nfrom hatchet_sdk import Hatchet\n\n\n@pytest.mark.skipif(\n os.getenv('CI', 'false').lower() == 'true',\n reason='Skipped in CI because of unreliability',\n)\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_durable(hatchet: Hatchet) -> None:\n ref = durable_workflow.run_no_wait()\n\n await asyncio.sleep(SLEEP_TIME + 10)\n\n hatchet.event.push(EVENT_KEY, {})\n\n result = await ref.aio_result()\n\n workers = await hatchet.workers.aio_list()\n\n assert workers.rows\n\n active_workers = [w for w in workers.rows if w.status == 'ACTIVE']\n\n assert len(active_workers) == 2\n assert any(w.name == 'e2e-test-worker' for w in active_workers)\n assert any(w.name.endswith('e2e-test-worker_durable') for w in active_workers)\n assert result['durable_task']['status'] == 'success'\n", + 'import asyncio\nimport os\n\nimport pytest\n\nfrom examples.durable.worker import EVENT_KEY, SLEEP_TIME, durable_workflow\nfrom hatchet_sdk import Hatchet\n\n\n@pytest.mark.skipif(\n os.getenv("CI", "false").lower() == "true",\n reason="Skipped in CI because of unreliability",\n)\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_durable(hatchet: Hatchet) -> None:\n ref = durable_workflow.run_no_wait()\n\n await asyncio.sleep(SLEEP_TIME + 10)\n\n hatchet.event.push(EVENT_KEY, {})\n\n result = await ref.aio_result()\n\n workers = await hatchet.workers.aio_list()\n\n assert workers.rows\n\n active_workers = [w for w in workers.rows if w.status == "ACTIVE"]\n\n assert len(active_workers) == 2\n assert any(w.name == "e2e-test-worker" for w in active_workers)\n assert any(w.name.endswith("e2e-test-worker_durable") for w in active_workers)\n assert result["durable_task"]["status"] == "success"\n', source: 'out/python/durable/test_durable.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/durable/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/durable/trigger.ts index 99d2fe5ec..805ed58f8 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/durable/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/durable/trigger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import time\n\nfrom examples.durable.worker import (\n EVENT_KEY,\n SLEEP_TIME,\n durable_workflow,\n ephemeral_workflow,\n hatchet,\n)\n\ndurable_workflow.run_no_wait()\nephemeral_workflow.run_no_wait()\n\nprint('Sleeping')\ntime.sleep(SLEEP_TIME + 2)\n\nprint('Pushing event')\nhatchet.event.push(EVENT_KEY, {})\n", + 'import time\n\nfrom examples.durable.worker import (\n EVENT_KEY,\n SLEEP_TIME,\n durable_workflow,\n ephemeral_workflow,\n hatchet,\n)\n\ndurable_workflow.run_no_wait()\nephemeral_workflow.run_no_wait()\n\nprint("Sleeping")\ntime.sleep(SLEEP_TIME + 2)\n\nprint("Pushing event")\nhatchet.event.push(EVENT_KEY, {})\n', source: 'out/python/durable/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/durable/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/durable/worker.ts index 3ce6fa79e..8dafd4d30 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/durable/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/durable/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from datetime import timedelta\n\nfrom hatchet_sdk import Context, DurableContext, EmptyModel, Hatchet, UserEventCondition\n\nhatchet = Hatchet(debug=True)\n\n# > Create a durable workflow\ndurable_workflow = hatchet.workflow(name='DurableWorkflow')\n\n\nephemeral_workflow = hatchet.workflow(name='EphemeralWorkflow')\n\n\n# > Add durable task\nEVENT_KEY = 'durable-example:event'\nSLEEP_TIME = 5\n\n\n@durable_workflow.task()\nasync def ephemeral_task(input: EmptyModel, ctx: Context) -> None:\n print('Running non-durable task')\n\n\n@durable_workflow.durable_task()\nasync def durable_task(input: EmptyModel, ctx: DurableContext) -> dict[str, str]:\n print('Waiting for sleep')\n await ctx.aio_sleep_for(duration=timedelta(seconds=SLEEP_TIME))\n print('Sleep finished')\n\n print('Waiting for event')\n await ctx.aio_wait_for(\n 'event',\n UserEventCondition(event_key=EVENT_KEY, expression='true'),\n )\n print('Event received')\n\n return {\n 'status': 'success',\n }\n\n\n\n\n@ephemeral_workflow.task()\ndef ephemeral_task_2(input: EmptyModel, ctx: Context) -> None:\n print('Running non-durable task')\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'durable-worker', workflows=[durable_workflow, ephemeral_workflow]\n )\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from datetime import timedelta\n\nfrom hatchet_sdk import Context, DurableContext, EmptyModel, Hatchet, UserEventCondition\n\nhatchet = Hatchet(debug=True)\n\n# > Create a durable workflow\ndurable_workflow = hatchet.workflow(name="DurableWorkflow")\n\n\nephemeral_workflow = hatchet.workflow(name="EphemeralWorkflow")\n\n\n# > Add durable task\nEVENT_KEY = "durable-example:event"\nSLEEP_TIME = 5\n\n\n@durable_workflow.task()\nasync def ephemeral_task(input: EmptyModel, ctx: Context) -> None:\n print("Running non-durable task")\n\n\n@durable_workflow.durable_task()\nasync def durable_task(input: EmptyModel, ctx: DurableContext) -> dict[str, str]:\n print("Waiting for sleep")\n await ctx.aio_sleep_for(duration=timedelta(seconds=SLEEP_TIME))\n print("Sleep finished")\n\n print("Waiting for event")\n await ctx.aio_wait_for(\n "event",\n UserEventCondition(event_key=EVENT_KEY, expression="true"),\n )\n print("Event received")\n\n return {\n "status": "success",\n }\n\n\n\n\n@ephemeral_workflow.task()\ndef ephemeral_task_2(input: EmptyModel, ctx: Context) -> None:\n print("Running non-durable task")\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "durable-worker", workflows=[durable_workflow, ephemeral_workflow]\n )\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/durable/worker.py', blocks: { create_a_durable_workflow: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/durable_event/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/durable_event/trigger.ts index 338617143..8bb9178e9 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/durable_event/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/durable_event/trigger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import time\n\nfrom examples.durable_event.worker import (\n EVENT_KEY,\n durable_event_task,\n durable_event_task_with_filter,\n hatchet,\n)\n\ndurable_event_task.run_no_wait()\ndurable_event_task_with_filter.run_no_wait()\n\nprint('Sleeping')\ntime.sleep(2)\n\nprint('Pushing event')\nhatchet.event.push(\n EVENT_KEY,\n {\n 'user_id': '1234',\n },\n)\n", + 'import time\n\nfrom examples.durable_event.worker import (\n EVENT_KEY,\n durable_event_task,\n durable_event_task_with_filter,\n hatchet,\n)\n\ndurable_event_task.run_no_wait()\ndurable_event_task_with_filter.run_no_wait()\n\nprint("Sleeping")\ntime.sleep(2)\n\nprint("Pushing event")\nhatchet.event.push(\n EVENT_KEY,\n {\n "user_id": "1234",\n },\n)\n', source: 'out/python/durable_event/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/durable_event/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/durable_event/worker.ts index 3849472d9..45141f706 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/durable_event/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/durable_event/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from hatchet_sdk import DurableContext, EmptyModel, Hatchet, UserEventCondition\n\nhatchet = Hatchet(debug=True)\n\nEVENT_KEY = 'user:update'\n\n\n# > Durable Event\n@hatchet.durable_task(name='DurableEventTask')\nasync def durable_event_task(input: EmptyModel, ctx: DurableContext) -> None:\n res = await ctx.aio_wait_for(\n 'event',\n UserEventCondition(event_key='user:update'),\n )\n\n print('got event', res)\n\n\n\n\n@hatchet.durable_task(name='DurableEventWithFilterTask')\nasync def durable_event_task_with_filter(\n input: EmptyModel, ctx: DurableContext\n) -> None:\n # > Durable Event With Filter\n res = await ctx.aio_wait_for(\n 'event',\n UserEventCondition(\n event_key='user:update', expression='input.user_id == '1234''\n ),\n )\n\n print('got event', res)\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'durable-event-worker',\n workflows=[durable_event_task, durable_event_task_with_filter],\n )\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from hatchet_sdk import DurableContext, EmptyModel, Hatchet, UserEventCondition\n\nhatchet = Hatchet(debug=True)\n\nEVENT_KEY = "user:update"\n\n\n# > Durable Event\n@hatchet.durable_task(name="DurableEventTask")\nasync def durable_event_task(input: EmptyModel, ctx: DurableContext) -> None:\n res = await ctx.aio_wait_for(\n "event",\n UserEventCondition(event_key="user:update"),\n )\n\n print("got event", res)\n\n\n\n\n@hatchet.durable_task(name="DurableEventWithFilterTask")\nasync def durable_event_task_with_filter(\n input: EmptyModel, ctx: DurableContext\n) -> None:\n # > Durable Event With Filter\n res = await ctx.aio_wait_for(\n "event",\n UserEventCondition(\n event_key="user:update", expression="input.user_id == \'1234\'"\n ),\n )\n\n print("got event", res)\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "durable-event-worker",\n workflows=[durable_event_task, durable_event_task_with_filter],\n )\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/durable_event/worker.py', blocks: { durable_event: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/durable_sleep/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/durable_sleep/trigger.ts index adda7b6d7..5d91271f0 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/durable_sleep/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/durable_sleep/trigger.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/durable_sleep/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/durable_sleep/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/durable_sleep/worker.ts index 69d627af8..785ab7bc7 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/durable_sleep/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/durable_sleep/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from datetime import timedelta\n\nfrom hatchet_sdk import DurableContext, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\n# > Durable Sleep\n@hatchet.durable_task(name='DurableSleepTask')\nasync def durable_sleep_task(input: EmptyModel, ctx: DurableContext) -> None:\n res = await ctx.aio_sleep_for(timedelta(seconds=5))\n\n print('got result', res)\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker('durable-sleep-worker', workflows=[durable_sleep_task])\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from datetime import timedelta\n\nfrom hatchet_sdk import DurableContext, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\n# > Durable Sleep\n@hatchet.durable_task(name="DurableSleepTask")\nasync def durable_sleep_task(input: EmptyModel, ctx: DurableContext) -> None:\n res = await ctx.aio_sleep_for(timedelta(seconds=5))\n\n print("got result", res)\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker("durable-sleep-worker", workflows=[durable_sleep_task])\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/durable_sleep/worker.py', blocks: { durable_sleep: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/events/event.ts b/frontend/app/src/next/lib/docs/generated/snips/python/events/event.ts index 11fe80ecf..623cdd8a1 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/events/event.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/events/event.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from hatchet_sdk import Hatchet\n\nhatchet = Hatchet()\n\n# > Event trigger\nhatchet.event.push('user:create', {})\n", + 'from hatchet_sdk import Hatchet\n\nhatchet = Hatchet()\n\n# > Event trigger\nhatchet.event.push("user:create", {})\n', source: 'out/python/events/event.py', blocks: { event_trigger: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/events/filter.ts b/frontend/app/src/next/lib/docs/generated/snips/python/events/filter.ts index c2ad6bf54..45ac9f1c7 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/events/filter.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/events/filter.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from examples.events.worker import EVENT_KEY, event_workflow\nfrom hatchet_sdk import Hatchet, PushEventOptions\n\nhatchet = Hatchet()\n\n# > Create a filter\nhatchet.filters.create(\n workflow_id=event_workflow.id,\n expression='input.should_skip == false',\n scope='foobarbaz',\n payload={\n 'main_character': 'Anna',\n 'supporting_character': 'Stiva',\n 'location': 'Moscow',\n },\n)\n\n# > Skip a run\nhatchet.event.push(\n event_key=EVENT_KEY,\n payload={\n 'should_skip': True,\n },\n options=PushEventOptions(\n scope='foobarbaz',\n ),\n)\n\n# > Trigger a run\nhatchet.event.push(\n event_key=EVENT_KEY,\n payload={\n 'should_skip': True,\n },\n options=PushEventOptions(\n scope='foobarbaz',\n ),\n)\n", + 'from examples.events.worker import EVENT_KEY, event_workflow\nfrom hatchet_sdk import Hatchet, PushEventOptions\n\nhatchet = Hatchet()\n\n# > Create a filter\nhatchet.filters.create(\n workflow_id=event_workflow.id,\n expression="input.should_skip == false",\n scope="foobarbaz",\n payload={\n "main_character": "Anna",\n "supporting_character": "Stiva",\n "location": "Moscow",\n },\n)\n\n# > Skip a run\nhatchet.event.push(\n event_key=EVENT_KEY,\n payload={\n "should_skip": True,\n },\n options=PushEventOptions(\n scope="foobarbaz",\n ),\n)\n\n# > Trigger a run\nhatchet.event.push(\n event_key=EVENT_KEY,\n payload={\n "should_skip": True,\n },\n options=PushEventOptions(\n scope="foobarbaz",\n ),\n)\n', source: 'out/python/events/filter.py', blocks: { create_a_filter: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/events/test_event.ts b/frontend/app/src/next/lib/docs/generated/snips/python/events/test_event.ts index ebed67370..184d80fda 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/events/test_event.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/events/test_event.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\nimport json\nfrom contextlib import asynccontextmanager\nfrom typing import AsyncGenerator, cast\nfrom uuid import uuid4\n\nimport pytest\nfrom pydantic import BaseModel\n\nfrom examples.events.worker import (\n EVENT_KEY,\n SECONDARY_KEY,\n EventWorkflowInput,\n event_workflow,\n)\nfrom hatchet_sdk.clients.events import (\n BulkPushEventOptions,\n BulkPushEventWithMetadata,\n PushEventOptions,\n)\nfrom hatchet_sdk.clients.rest.models.v1_task_status import V1TaskStatus\nfrom hatchet_sdk.clients.rest.models.v1_task_summary import V1TaskSummary\nfrom hatchet_sdk.contracts.events_pb2 import Event\nfrom hatchet_sdk.hatchet import Hatchet\n\n\nclass ProcessedEvent(BaseModel):\n id: str\n payload: dict[str, str | bool]\n meta: dict[str, str | bool | int]\n should_have_runs: bool\n test_run_id: str\n\n def __hash__(self) -> int:\n return hash(self.model_dump_json())\n\n\n@asynccontextmanager\nasync def event_filter(\n hatchet: Hatchet,\n test_run_id: str,\n expression: str | None = None,\n payload: dict[str, str] = {},\n) -> AsyncGenerator[None, None]:\n expression = (\n expression\n or f'input.should_skip == false && payload.testRunId == '{test_run_id}''\n )\n\n f = await hatchet.filters.aio_create(\n workflow_id=event_workflow.id,\n expression=expression,\n scope=test_run_id,\n payload={'testRunId': test_run_id, **payload},\n )\n\n yield\n\n await hatchet.filters.aio_delete(f.metadata.id)\n\n\nasync def fetch_runs_for_event(\n hatchet: Hatchet, event: Event\n) -> tuple[ProcessedEvent, list[V1TaskSummary]]:\n runs = await hatchet.runs.aio_list(triggering_event_external_id=event.eventId)\n\n meta = (\n cast(dict[str, str | int | bool], json.loads(event.additionalMetadata))\n if event.additionalMetadata\n else {}\n )\n payload = (\n cast(dict[str, str | bool], json.loads(event.payload)) if event.payload else {}\n )\n\n return (\n ProcessedEvent(\n id=event.eventId,\n payload=payload,\n meta=meta,\n should_have_runs=meta.get('should_have_runs', False) is True,\n test_run_id=cast(str, meta['test_run_id']),\n ),\n runs.rows or [],\n )\n\n\nasync def wait_for_result(\n hatchet: Hatchet, events: list[Event]\n) -> dict[ProcessedEvent, list[V1TaskSummary]]:\n await asyncio.sleep(3)\n\n persisted = (await hatchet.event.aio_list(limit=100)).rows or []\n\n assert {e.eventId for e in events}.issubset({e.metadata.id for e in persisted})\n\n iters = 0\n while True:\n print('Waiting for event runs to complete...')\n if iters > 15:\n print('Timed out waiting for event runs to complete.')\n return {}\n\n iters += 1\n\n event_runs = await asyncio.gather(\n *[fetch_runs_for_event(hatchet, event) for event in events]\n )\n\n all_empty = all(not event_run for _, event_run in event_runs)\n\n if all_empty:\n await asyncio.sleep(1)\n continue\n\n event_id_to_runs = {event_id: runs for (event_id, runs) in event_runs}\n\n any_queued_or_running = any(\n run.status in [V1TaskStatus.QUEUED, V1TaskStatus.RUNNING]\n for runs in event_id_to_runs.values()\n for run in runs\n )\n\n if any_queued_or_running:\n await asyncio.sleep(1)\n continue\n\n break\n\n return event_id_to_runs\n\n\nasync def assert_event_runs_processed(\n event: ProcessedEvent,\n runs: list[V1TaskSummary],\n) -> None:\n if event.should_have_runs:\n assert len(runs) > 0\n else:\n assert len(runs) == 0\n\n\ndef bpi(\n index: int = 1,\n test_run_id: str = '',\n should_skip: bool = False,\n should_have_runs: bool = True,\n key: str = EVENT_KEY,\n payload: dict[str, str] = {},\n scope: str | None = None,\n) -> BulkPushEventWithMetadata:\n return BulkPushEventWithMetadata(\n key=key,\n payload={\n 'should_skip': should_skip,\n **payload,\n },\n additional_metadata={\n 'should_have_runs': should_have_runs,\n 'test_run_id': test_run_id,\n 'key': index,\n },\n scope=scope,\n )\n\n\ndef cp(should_skip: bool) -> dict[str, bool]:\n return EventWorkflowInput(should_skip=should_skip).model_dump()\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_event_push(hatchet: Hatchet) -> None:\n e = hatchet.event.push(EVENT_KEY, cp(False))\n\n assert e.eventId is not None\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_async_event_push(hatchet: Hatchet) -> None:\n e = await hatchet.event.aio_push(EVENT_KEY, cp(False))\n\n assert e.eventId is not None\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_async_event_bulk_push(hatchet: Hatchet) -> None:\n events = [\n BulkPushEventWithMetadata(\n key='event1',\n payload={'message': 'This is event 1', 'should_skip': False},\n additional_metadata={'source': 'test', 'user_id': 'user123'},\n ),\n BulkPushEventWithMetadata(\n key='event2',\n payload={'message': 'This is event 2', 'should_skip': False},\n additional_metadata={'source': 'test', 'user_id': 'user456'},\n ),\n BulkPushEventWithMetadata(\n key='event3',\n payload={'message': 'This is event 3', 'should_skip': False},\n additional_metadata={'source': 'test', 'user_id': 'user789'},\n ),\n ]\n opts = BulkPushEventOptions(namespace='bulk-test')\n\n e = await hatchet.event.aio_bulk_push(events, opts)\n\n assert len(e) == 3\n\n # Sort both lists of events by their key to ensure comparison order\n sorted_events = sorted(events, key=lambda x: x.key)\n sorted_returned_events = sorted(e, key=lambda x: x.key)\n namespace = 'bulk-test'\n\n # Check that the returned events match the original events\n for original_event, returned_event in zip(sorted_events, sorted_returned_events):\n assert returned_event.key == namespace + original_event.key\n\n\n@pytest.fixture(scope='function')\ndef test_run_id() -> str:\n return str(uuid4())\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_event_engine_behavior(hatchet: Hatchet) -> None:\n test_run_id = str(uuid4())\n events = [\n bpi(\n test_run_id=test_run_id,\n ),\n bpi(\n test_run_id=test_run_id,\n key='thisisafakeeventfoobarbaz',\n should_have_runs=False,\n ),\n ]\n\n print('Events:', events)\n\n result = await hatchet.event.aio_bulk_push(events)\n\n print('Result:', result)\n\n runs = await wait_for_result(hatchet, result)\n\n for event, r in runs.items():\n await assert_event_runs_processed(event, r)\n\n\ndef gen_bulk_events(test_run_id: str) -> list[BulkPushEventWithMetadata]:\n return [\n bpi(\n index=1,\n test_run_id=test_run_id,\n should_skip=False,\n should_have_runs=True,\n ),\n bpi(\n index=2,\n test_run_id=test_run_id,\n should_skip=True,\n should_have_runs=True,\n ),\n bpi(\n index=3,\n test_run_id=test_run_id,\n should_skip=False,\n should_have_runs=True,\n scope=test_run_id,\n ),\n bpi(\n index=4,\n test_run_id=test_run_id,\n should_skip=True,\n should_have_runs=False,\n scope=test_run_id,\n ),\n bpi(\n index=5,\n test_run_id=test_run_id,\n should_skip=True,\n should_have_runs=False,\n scope=test_run_id,\n key='thisisafakeeventfoobarbaz',\n ),\n bpi(\n index=6,\n test_run_id=test_run_id,\n should_skip=False,\n should_have_runs=False,\n scope=test_run_id,\n key='thisisafakeeventfoobarbaz',\n ),\n ]\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_event_skipping_filtering(hatchet: Hatchet, test_run_id: str) -> None:\n async with event_filter(hatchet, test_run_id):\n events = gen_bulk_events(test_run_id)\n\n result = await hatchet.event.aio_bulk_push(events)\n\n runs = await wait_for_result(hatchet, result)\n for e, r in runs.items():\n await assert_event_runs_processed(e, r)\n\n\nasync def bulk_to_single(hatchet: Hatchet, event: BulkPushEventWithMetadata) -> Event:\n return await hatchet.event.aio_push(\n event_key=event.key,\n payload=event.payload,\n options=PushEventOptions(\n scope=event.scope,\n additional_metadata=event.additional_metadata,\n priority=event.priority,\n ),\n )\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_event_skipping_filtering_no_bulk(\n hatchet: Hatchet, test_run_id: str\n) -> None:\n async with event_filter(hatchet, test_run_id):\n raw_events = gen_bulk_events(test_run_id)\n events = await asyncio.gather(\n *[bulk_to_single(hatchet, event) for event in raw_events]\n )\n\n result = await wait_for_result(hatchet, events)\n for event, runs in result.items():\n await assert_event_runs_processed(event, runs)\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_event_payload_filtering(hatchet: Hatchet, test_run_id: str) -> None:\n async with event_filter(\n hatchet,\n test_run_id,\n 'input.should_skip == false && payload.foobar == 'baz'',\n {'foobar': 'qux'},\n ):\n event = await hatchet.event.aio_push(\n event_key=EVENT_KEY,\n payload={'message': 'This is event 1', 'should_skip': False},\n options=PushEventOptions(\n scope=test_run_id,\n additional_metadata={\n 'should_have_runs': False,\n 'test_run_id': test_run_id,\n 'key': 1,\n },\n ),\n )\n\n runs = await wait_for_result(hatchet, [event])\n assert len(runs) == 0\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_event_payload_filtering_with_payload_match(\n hatchet: Hatchet, test_run_id: str\n) -> None:\n async with event_filter(\n hatchet,\n test_run_id,\n 'input.should_skip == false && payload.foobar == 'baz'',\n {'foobar': 'baz'},\n ):\n event = await hatchet.event.aio_push(\n event_key=EVENT_KEY,\n payload={'message': 'This is event 1', 'should_skip': False},\n options=PushEventOptions(\n scope=test_run_id,\n additional_metadata={\n 'should_have_runs': True,\n 'test_run_id': test_run_id,\n 'key': 1,\n },\n ),\n )\n runs = await wait_for_result(hatchet, [event])\n assert len(runs) == 1\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_filtering_by_event_key(hatchet: Hatchet, test_run_id: str) -> None:\n async with event_filter(\n hatchet,\n test_run_id,\n f'event_key == '{SECONDARY_KEY}'',\n ):\n event_1 = await hatchet.event.aio_push(\n event_key=SECONDARY_KEY,\n payload={\n 'message': 'Should run because filter matches',\n 'should_skip': False,\n },\n options=PushEventOptions(\n scope=test_run_id,\n additional_metadata={\n 'should_have_runs': True,\n 'test_run_id': test_run_id,\n },\n ),\n )\n event_2 = await hatchet.event.aio_push(\n event_key=EVENT_KEY,\n payload={\n 'message': 'Should skip because filter does not match',\n 'should_skip': False,\n },\n options=PushEventOptions(\n scope=test_run_id,\n additional_metadata={\n 'should_have_runs': False,\n 'test_run_id': test_run_id,\n },\n ),\n )\n\n event_to_runs = await wait_for_result(hatchet, [event_1, event_2])\n\n for event, runs in event_to_runs.items():\n await assert_event_runs_processed(event, runs)\n", + 'import asyncio\nimport json\nfrom contextlib import asynccontextmanager\nfrom typing import AsyncGenerator, cast\nfrom uuid import uuid4\n\nimport pytest\nfrom pydantic import BaseModel\n\nfrom examples.events.worker import (\n EVENT_KEY,\n SECONDARY_KEY,\n EventWorkflowInput,\n event_workflow,\n)\nfrom hatchet_sdk.clients.events import (\n BulkPushEventOptions,\n BulkPushEventWithMetadata,\n PushEventOptions,\n)\nfrom hatchet_sdk.clients.rest.models.v1_task_status import V1TaskStatus\nfrom hatchet_sdk.clients.rest.models.v1_task_summary import V1TaskSummary\nfrom hatchet_sdk.contracts.events_pb2 import Event\nfrom hatchet_sdk.hatchet import Hatchet\n\n\nclass ProcessedEvent(BaseModel):\n id: str\n payload: dict[str, str | bool]\n meta: dict[str, str | bool | int]\n should_have_runs: bool\n test_run_id: str\n\n def __hash__(self) -> int:\n return hash(self.model_dump_json())\n\n\n@asynccontextmanager\nasync def event_filter(\n hatchet: Hatchet,\n test_run_id: str,\n expression: str | None = None,\n payload: dict[str, str] = {},\n) -> AsyncGenerator[None, None]:\n expression = (\n expression\n or f"input.should_skip == false && payload.testRunId == \'{test_run_id}\'"\n )\n\n f = await hatchet.filters.aio_create(\n workflow_id=event_workflow.id,\n expression=expression,\n scope=test_run_id,\n payload={"testRunId": test_run_id, **payload},\n )\n\n yield\n\n await hatchet.filters.aio_delete(f.metadata.id)\n\n\nasync def fetch_runs_for_event(\n hatchet: Hatchet, event: Event\n) -> tuple[ProcessedEvent, list[V1TaskSummary]]:\n runs = await hatchet.runs.aio_list(triggering_event_external_id=event.eventId)\n\n meta = (\n cast(dict[str, str | int | bool], json.loads(event.additionalMetadata))\n if event.additionalMetadata\n else {}\n )\n payload = (\n cast(dict[str, str | bool], json.loads(event.payload)) if event.payload else {}\n )\n\n return (\n ProcessedEvent(\n id=event.eventId,\n payload=payload,\n meta=meta,\n should_have_runs=meta.get("should_have_runs", False) is True,\n test_run_id=cast(str, meta["test_run_id"]),\n ),\n runs.rows or [],\n )\n\n\nasync def wait_for_result(\n hatchet: Hatchet, events: list[Event]\n) -> dict[ProcessedEvent, list[V1TaskSummary]]:\n await asyncio.sleep(3)\n\n persisted = (await hatchet.event.aio_list(limit=100)).rows or []\n\n assert {e.eventId for e in events}.issubset({e.metadata.id for e in persisted})\n\n iters = 0\n while True:\n print("Waiting for event runs to complete...")\n if iters > 15:\n print("Timed out waiting for event runs to complete.")\n return {}\n\n iters += 1\n\n event_runs = await asyncio.gather(\n *[fetch_runs_for_event(hatchet, event) for event in events]\n )\n\n all_empty = all(not event_run for _, event_run in event_runs)\n\n if all_empty:\n await asyncio.sleep(1)\n continue\n\n event_id_to_runs = {event_id: runs for (event_id, runs) in event_runs}\n\n any_queued_or_running = any(\n run.status in [V1TaskStatus.QUEUED, V1TaskStatus.RUNNING]\n for runs in event_id_to_runs.values()\n for run in runs\n )\n\n if any_queued_or_running:\n await asyncio.sleep(1)\n continue\n\n break\n\n return event_id_to_runs\n\n\nasync def assert_event_runs_processed(\n event: ProcessedEvent,\n runs: list[V1TaskSummary],\n) -> None:\n if event.should_have_runs:\n assert len(runs) > 0\n else:\n assert len(runs) == 0\n\n\ndef bpi(\n index: int = 1,\n test_run_id: str = "",\n should_skip: bool = False,\n should_have_runs: bool = True,\n key: str = EVENT_KEY,\n payload: dict[str, str] = {},\n scope: str | None = None,\n) -> BulkPushEventWithMetadata:\n return BulkPushEventWithMetadata(\n key=key,\n payload={\n "should_skip": should_skip,\n **payload,\n },\n additional_metadata={\n "should_have_runs": should_have_runs,\n "test_run_id": test_run_id,\n "key": index,\n },\n scope=scope,\n )\n\n\ndef cp(should_skip: bool) -> dict[str, bool]:\n return EventWorkflowInput(should_skip=should_skip).model_dump()\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_event_push(hatchet: Hatchet) -> None:\n e = hatchet.event.push(EVENT_KEY, cp(False))\n\n assert e.eventId is not None\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_async_event_push(hatchet: Hatchet) -> None:\n e = await hatchet.event.aio_push(EVENT_KEY, cp(False))\n\n assert e.eventId is not None\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_async_event_bulk_push(hatchet: Hatchet) -> None:\n events = [\n BulkPushEventWithMetadata(\n key="event1",\n payload={"message": "This is event 1", "should_skip": False},\n additional_metadata={"source": "test", "user_id": "user123"},\n ),\n BulkPushEventWithMetadata(\n key="event2",\n payload={"message": "This is event 2", "should_skip": False},\n additional_metadata={"source": "test", "user_id": "user456"},\n ),\n BulkPushEventWithMetadata(\n key="event3",\n payload={"message": "This is event 3", "should_skip": False},\n additional_metadata={"source": "test", "user_id": "user789"},\n ),\n ]\n opts = BulkPushEventOptions(namespace="bulk-test")\n\n e = await hatchet.event.aio_bulk_push(events, opts)\n\n assert len(e) == 3\n\n # Sort both lists of events by their key to ensure comparison order\n sorted_events = sorted(events, key=lambda x: x.key)\n sorted_returned_events = sorted(e, key=lambda x: x.key)\n namespace = "bulk-test"\n\n # Check that the returned events match the original events\n for original_event, returned_event in zip(sorted_events, sorted_returned_events):\n assert returned_event.key == namespace + original_event.key\n\n\n@pytest.fixture(scope="function")\ndef test_run_id() -> str:\n return str(uuid4())\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_event_engine_behavior(hatchet: Hatchet) -> None:\n test_run_id = str(uuid4())\n events = [\n bpi(\n test_run_id=test_run_id,\n ),\n bpi(\n test_run_id=test_run_id,\n key="thisisafakeeventfoobarbaz",\n should_have_runs=False,\n ),\n ]\n\n print("Events:", events)\n\n result = await hatchet.event.aio_bulk_push(events)\n\n print("Result:", result)\n\n runs = await wait_for_result(hatchet, result)\n\n for event, r in runs.items():\n await assert_event_runs_processed(event, r)\n\n\ndef gen_bulk_events(test_run_id: str) -> list[BulkPushEventWithMetadata]:\n return [\n bpi(\n index=1,\n test_run_id=test_run_id,\n should_skip=False,\n should_have_runs=True,\n ),\n bpi(\n index=2,\n test_run_id=test_run_id,\n should_skip=True,\n should_have_runs=True,\n ),\n bpi(\n index=3,\n test_run_id=test_run_id,\n should_skip=False,\n should_have_runs=True,\n scope=test_run_id,\n ),\n bpi(\n index=4,\n test_run_id=test_run_id,\n should_skip=True,\n should_have_runs=False,\n scope=test_run_id,\n ),\n bpi(\n index=5,\n test_run_id=test_run_id,\n should_skip=True,\n should_have_runs=False,\n scope=test_run_id,\n key="thisisafakeeventfoobarbaz",\n ),\n bpi(\n index=6,\n test_run_id=test_run_id,\n should_skip=False,\n should_have_runs=False,\n scope=test_run_id,\n key="thisisafakeeventfoobarbaz",\n ),\n ]\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_event_skipping_filtering(hatchet: Hatchet, test_run_id: str) -> None:\n async with event_filter(hatchet, test_run_id):\n events = gen_bulk_events(test_run_id)\n\n result = await hatchet.event.aio_bulk_push(events)\n\n runs = await wait_for_result(hatchet, result)\n for e, r in runs.items():\n await assert_event_runs_processed(e, r)\n\n\nasync def bulk_to_single(hatchet: Hatchet, event: BulkPushEventWithMetadata) -> Event:\n return await hatchet.event.aio_push(\n event_key=event.key,\n payload=event.payload,\n options=PushEventOptions(\n scope=event.scope,\n additional_metadata=event.additional_metadata,\n priority=event.priority,\n ),\n )\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_event_skipping_filtering_no_bulk(\n hatchet: Hatchet, test_run_id: str\n) -> None:\n async with event_filter(hatchet, test_run_id):\n raw_events = gen_bulk_events(test_run_id)\n events = await asyncio.gather(\n *[bulk_to_single(hatchet, event) for event in raw_events]\n )\n\n result = await wait_for_result(hatchet, events)\n for event, runs in result.items():\n await assert_event_runs_processed(event, runs)\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_event_payload_filtering(hatchet: Hatchet, test_run_id: str) -> None:\n async with event_filter(\n hatchet,\n test_run_id,\n "input.should_skip == false && payload.foobar == \'baz\'",\n {"foobar": "qux"},\n ):\n event = await hatchet.event.aio_push(\n event_key=EVENT_KEY,\n payload={"message": "This is event 1", "should_skip": False},\n options=PushEventOptions(\n scope=test_run_id,\n additional_metadata={\n "should_have_runs": False,\n "test_run_id": test_run_id,\n "key": 1,\n },\n ),\n )\n\n runs = await wait_for_result(hatchet, [event])\n assert len(runs) == 0\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_event_payload_filtering_with_payload_match(\n hatchet: Hatchet, test_run_id: str\n) -> None:\n async with event_filter(\n hatchet,\n test_run_id,\n "input.should_skip == false && payload.foobar == \'baz\'",\n {"foobar": "baz"},\n ):\n event = await hatchet.event.aio_push(\n event_key=EVENT_KEY,\n payload={"message": "This is event 1", "should_skip": False},\n options=PushEventOptions(\n scope=test_run_id,\n additional_metadata={\n "should_have_runs": True,\n "test_run_id": test_run_id,\n "key": 1,\n },\n ),\n )\n runs = await wait_for_result(hatchet, [event])\n assert len(runs) == 1\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_filtering_by_event_key(hatchet: Hatchet, test_run_id: str) -> None:\n async with event_filter(\n hatchet,\n test_run_id,\n f"event_key == \'{SECONDARY_KEY}\'",\n ):\n event_1 = await hatchet.event.aio_push(\n event_key=SECONDARY_KEY,\n payload={\n "message": "Should run because filter matches",\n "should_skip": False,\n },\n options=PushEventOptions(\n scope=test_run_id,\n additional_metadata={\n "should_have_runs": True,\n "test_run_id": test_run_id,\n },\n ),\n )\n event_2 = await hatchet.event.aio_push(\n event_key=EVENT_KEY,\n payload={\n "message": "Should skip because filter does not match",\n "should_skip": False,\n },\n options=PushEventOptions(\n scope=test_run_id,\n additional_metadata={\n "should_have_runs": False,\n "test_run_id": test_run_id,\n },\n ),\n )\n\n event_to_runs = await wait_for_result(hatchet, [event_1, event_2])\n\n for event, runs in event_to_runs.items():\n await assert_event_runs_processed(event, runs)\n', source: 'out/python/events/test_event.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/events/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/events/worker.ts index 61bef4b05..7158efa79 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/events/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/events/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet\n\nhatchet = Hatchet()\nEVENT_KEY = 'user:create'\nSECONDARY_KEY = 'foobarbaz'\n\n\nclass EventWorkflowInput(BaseModel):\n should_skip: bool\n\n\n# > Event trigger\nevent_workflow = hatchet.workflow(\n name='EventWorkflow',\n on_events=[EVENT_KEY, SECONDARY_KEY],\n input_validator=EventWorkflowInput,\n)\n\n\n@event_workflow.task()\ndef task(input: EventWorkflowInput, ctx: Context) -> None:\n print('event received')\n\n\ndef main() -> None:\n worker = hatchet.worker(name='EventWorker', workflows=[event_workflow])\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet\n\nhatchet = Hatchet()\nEVENT_KEY = "user:create"\nSECONDARY_KEY = "foobarbaz"\n\n\nclass EventWorkflowInput(BaseModel):\n should_skip: bool\n\n\n# > Event trigger\nevent_workflow = hatchet.workflow(\n name="EventWorkflow",\n on_events=[EVENT_KEY, SECONDARY_KEY],\n input_validator=EventWorkflowInput,\n)\n\n\n@event_workflow.task()\ndef task(input: EventWorkflowInput, ctx: Context) -> None:\n print("event received")\n\n\ndef main() -> None:\n worker = hatchet.worker(name="EventWorker", workflows=[event_workflow])\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/events/worker.py', blocks: { event_trigger: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/fanout/stream.ts b/frontend/app/src/next/lib/docs/generated/snips/python/fanout/stream.ts index cf51c6712..da6e68ec7 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/fanout/stream.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/fanout/stream.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\nimport random\n\nfrom examples.fanout.worker import ParentInput, parent_wf\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\n\n\nasync def main() -> None:\n\n hatchet = Hatchet()\n\n # Generate a random stream key to use to track all\n # stream events for this workflow run.\n\n streamKey = 'streamKey'\n streamVal = f'sk-{random.randint(1, 100)}'\n\n # Specify the stream key as additional metadata\n # when running the workflow.\n\n # This key gets propagated to all child workflows\n # and can have an arbitrary property name.\n\n parent_wf.run(\n ParentInput(n=2),\n options=TriggerWorkflowOptions(additional_metadata={streamKey: streamVal}),\n )\n\n # Stream all events for the additional meta key value\n listener = hatchet.listener.stream_by_additional_metadata(streamKey, streamVal)\n\n async for event in listener:\n print(event.type, event.payload)\n\n\nif __name__ == '__main__':\n asyncio.run(main())\n", + 'import asyncio\nimport random\n\nfrom examples.fanout.worker import ParentInput, parent_wf\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\n\n\nasync def main() -> None:\n\n hatchet = Hatchet()\n\n # Generate a random stream key to use to track all\n # stream events for this workflow run.\n\n streamKey = "streamKey"\n streamVal = f"sk-{random.randint(1, 100)}"\n\n # Specify the stream key as additional metadata\n # when running the workflow.\n\n # This key gets propagated to all child workflows\n # and can have an arbitrary property name.\n\n parent_wf.run(\n ParentInput(n=2),\n options=TriggerWorkflowOptions(additional_metadata={streamKey: streamVal}),\n )\n\n # Stream all events for the additional meta key value\n listener = hatchet.listener.stream_by_additional_metadata(streamKey, streamVal)\n\n async for event in listener:\n print(event.type, event.payload)\n\n\nif __name__ == "__main__":\n asyncio.run(main())\n', source: 'out/python/fanout/stream.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/fanout/sync_stream.ts b/frontend/app/src/next/lib/docs/generated/snips/python/fanout/sync_stream.ts index 8f1adb30c..e15edf797 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/fanout/sync_stream.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/fanout/sync_stream.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import random\n\nfrom examples.fanout.worker import ParentInput, parent_wf\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\n\n\ndef main() -> None:\n\n hatchet = Hatchet()\n\n # Generate a random stream key to use to track all\n # stream events for this workflow run.\n\n streamKey = 'streamKey'\n streamVal = f'sk-{random.randint(1, 100)}'\n\n # Specify the stream key as additional metadata\n # when running the workflow.\n\n # This key gets propagated to all child workflows\n # and can have an arbitrary property name.\n\n parent_wf.run(\n ParentInput(n=2),\n options=TriggerWorkflowOptions(additional_metadata={streamKey: streamVal}),\n )\n\n # Stream all events for the additional meta key value\n listener = hatchet.listener.stream_by_additional_metadata(streamKey, streamVal)\n\n for event in listener:\n print(event.type, event.payload)\n\n print('DONE.')\n\n\nif __name__ == '__main__':\n main()\n", + 'import random\n\nfrom examples.fanout.worker import ParentInput, parent_wf\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\n\n\ndef main() -> None:\n\n hatchet = Hatchet()\n\n # Generate a random stream key to use to track all\n # stream events for this workflow run.\n\n streamKey = "streamKey"\n streamVal = f"sk-{random.randint(1, 100)}"\n\n # Specify the stream key as additional metadata\n # when running the workflow.\n\n # This key gets propagated to all child workflows\n # and can have an arbitrary property name.\n\n parent_wf.run(\n ParentInput(n=2),\n options=TriggerWorkflowOptions(additional_metadata={streamKey: streamVal}),\n )\n\n # Stream all events for the additional meta key value\n listener = hatchet.listener.stream_by_additional_metadata(streamKey, streamVal)\n\n for event in listener:\n print(event.type, event.payload)\n\n print("DONE.")\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/fanout/sync_stream.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/fanout/test_fanout.ts b/frontend/app/src/next/lib/docs/generated/snips/python/fanout/test_fanout.ts index cc7848cc7..ff2175aef 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/fanout/test_fanout.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/fanout/test_fanout.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import pytest\n\nfrom examples.fanout.worker import ParentInput, parent_wf\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_run() -> None:\n result = await parent_wf.aio_run(ParentInput(n=2))\n\n assert len(result['spawn']['results']) == 2\n", + 'import pytest\n\nfrom examples.fanout.worker import ParentInput, parent_wf\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_run() -> None:\n result = await parent_wf.aio_run(ParentInput(n=2))\n\n assert len(result["spawn"]["results"]) == 2\n', source: 'out/python/fanout/test_fanout.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/fanout/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/fanout/trigger.ts index b29bf67f2..c041a9520 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/fanout/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/fanout/trigger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\nfrom examples.fanout.worker import ParentInput, parent_wf\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\n\nhatchet = Hatchet()\n\n\nasync def main() -> None:\n await parent_wf.aio_run(\n ParentInput(n=2),\n options=TriggerWorkflowOptions(additional_metadata={'hello': 'moon'}),\n )\n\n\nif __name__ == '__main__':\n asyncio.run(main())\n", + 'import asyncio\n\nfrom examples.fanout.worker import ParentInput, parent_wf\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\n\nhatchet = Hatchet()\n\n\nasync def main() -> None:\n await parent_wf.aio_run(\n ParentInput(n=2),\n options=TriggerWorkflowOptions(additional_metadata={"hello": "moon"}),\n )\n\n\nif __name__ == "__main__":\n asyncio.run(main())\n', source: 'out/python/fanout/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/fanout/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/fanout/worker.ts index 35b1a5e94..c3f37caa3 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/fanout/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/fanout/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from datetime import timedelta\nfrom typing import Any\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet, TriggerWorkflowOptions\n\nhatchet = Hatchet(debug=True)\n\n\n# > FanoutParent\nclass ParentInput(BaseModel):\n n: int = 100\n\n\nclass ChildInput(BaseModel):\n a: str\n\n\nparent_wf = hatchet.workflow(name='FanoutParent', input_validator=ParentInput)\nchild_wf = hatchet.workflow(name='FanoutChild', input_validator=ChildInput)\n\n\n@parent_wf.task(execution_timeout=timedelta(minutes=5))\nasync def spawn(input: ParentInput, ctx: Context) -> dict[str, Any]:\n print('spawning child')\n\n result = await child_wf.aio_run_many(\n [\n child_wf.create_bulk_run_item(\n input=ChildInput(a=str(i)),\n options=TriggerWorkflowOptions(\n additional_metadata={'hello': 'earth'}, key=f'child{i}'\n ),\n )\n for i in range(input.n)\n ]\n )\n\n print(f'results {result}')\n\n return {'results': result}\n\n\n\n\n# > FanoutChild\n@child_wf.task()\ndef process(input: ChildInput, ctx: Context) -> dict[str, str]:\n print(f'child process {input.a}')\n return {'status': input.a}\n\n\n@child_wf.task(parents=[process])\ndef process2(input: ChildInput, ctx: Context) -> dict[str, str]:\n process_output = ctx.task_output(process)\n a = process_output['status']\n\n return {'status2': a + '2'}\n\n\n\nchild_wf.create_bulk_run_item()\n\n\ndef main() -> None:\n worker = hatchet.worker('fanout-worker', slots=40, workflows=[parent_wf, child_wf])\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from datetime import timedelta\nfrom typing import Any\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet, TriggerWorkflowOptions\n\nhatchet = Hatchet(debug=True)\n\n\n# > FanoutParent\nclass ParentInput(BaseModel):\n n: int = 100\n\n\nclass ChildInput(BaseModel):\n a: str\n\n\nparent_wf = hatchet.workflow(name="FanoutParent", input_validator=ParentInput)\nchild_wf = hatchet.workflow(name="FanoutChild", input_validator=ChildInput)\n\n\n@parent_wf.task(execution_timeout=timedelta(minutes=5))\nasync def spawn(input: ParentInput, ctx: Context) -> dict[str, Any]:\n print("spawning child")\n\n result = await child_wf.aio_run_many(\n [\n child_wf.create_bulk_run_item(\n input=ChildInput(a=str(i)),\n options=TriggerWorkflowOptions(\n additional_metadata={"hello": "earth"}, key=f"child{i}"\n ),\n )\n for i in range(input.n)\n ]\n )\n\n print(f"results {result}")\n\n return {"results": result}\n\n\n\n\n# > FanoutChild\n@child_wf.task()\ndef process(input: ChildInput, ctx: Context) -> dict[str, str]:\n print(f"child process {input.a}")\n return {"status": input.a}\n\n\n@child_wf.task(parents=[process])\ndef process2(input: ChildInput, ctx: Context) -> dict[str, str]:\n process_output = ctx.task_output(process)\n a = process_output["status"]\n\n return {"status2": a + "2"}\n\n\n\nchild_wf.create_bulk_run_item()\n\n\ndef main() -> None:\n worker = hatchet.worker("fanout-worker", slots=40, workflows=[parent_wf, child_wf])\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/fanout/worker.py', blocks: { fanoutparent: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/fanout_sync/test_fanout_sync.ts b/frontend/app/src/next/lib/docs/generated/snips/python/fanout_sync/test_fanout_sync.ts index cc967d1bc..fd585528d 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/fanout_sync/test_fanout_sync.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/fanout_sync/test_fanout_sync.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from examples.fanout_sync.worker import ParentInput, sync_fanout_parent\n\n\ndef test_run() -> None:\n N = 2\n\n result = sync_fanout_parent.run(ParentInput(n=N))\n\n assert len(result['spawn']['results']) == N\n", + 'from examples.fanout_sync.worker import ParentInput, sync_fanout_parent\n\n\ndef test_run() -> None:\n N = 2\n\n result = sync_fanout_parent.run(ParentInput(n=N))\n\n assert len(result["spawn"]["results"]) == N\n', source: 'out/python/fanout_sync/test_fanout_sync.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/fanout_sync/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/fanout_sync/trigger.ts index 861c99519..087c70fb5 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/fanout_sync/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/fanout_sync/trigger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\nfrom examples.fanout_sync.worker import ParentInput, sync_fanout_parent\nfrom hatchet_sdk import Hatchet, TriggerWorkflowOptions\n\nhatchet = Hatchet()\n\n\nasync def main() -> None:\n sync_fanout_parent.run(\n ParentInput(n=2),\n options=TriggerWorkflowOptions(additional_metadata={'hello': 'moon'}),\n )\n\n\nif __name__ == '__main__':\n asyncio.run(main())\n", + 'import asyncio\n\nfrom examples.fanout_sync.worker import ParentInput, sync_fanout_parent\nfrom hatchet_sdk import Hatchet, TriggerWorkflowOptions\n\nhatchet = Hatchet()\n\n\nasync def main() -> None:\n sync_fanout_parent.run(\n ParentInput(n=2),\n options=TriggerWorkflowOptions(additional_metadata={"hello": "moon"}),\n )\n\n\nif __name__ == "__main__":\n asyncio.run(main())\n', source: 'out/python/fanout_sync/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/fanout_sync/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/fanout_sync/worker.ts index 81733a06b..31bfe62c5 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/fanout_sync/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/fanout_sync/worker.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from datetime import timedelta\nfrom typing import Any\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet, TriggerWorkflowOptions\n\nhatchet = Hatchet(debug=True)\n\n\nclass ParentInput(BaseModel):\n n: int = 5\n\n\nclass ChildInput(BaseModel):\n a: str\n\n\nsync_fanout_parent = hatchet.workflow(\n name='SyncFanoutParent', input_validator=ParentInput\n)\nsync_fanout_child = hatchet.workflow(name='SyncFanoutChild', input_validator=ChildInput)\n\n\n@sync_fanout_parent.task(execution_timeout=timedelta(minutes=5))\ndef spawn(input: ParentInput, ctx: Context) -> dict[str, list[dict[str, Any]]]:\n print('spawning child')\n\n results = sync_fanout_child.run_many(\n [\n sync_fanout_child.create_bulk_run_item(\n input=ChildInput(a=str(i)),\n key=f'child{i}',\n options=TriggerWorkflowOptions(additional_metadata={'hello': 'earth'}),\n )\n for i in range(input.n)\n ],\n )\n\n print(f'results {results}')\n\n return {'results': results}\n\n\n@sync_fanout_child.task()\ndef process(input: ChildInput, ctx: Context) -> dict[str, str]:\n return {'status': 'success ' + input.a}\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'sync-fanout-worker',\n slots=40,\n workflows=[sync_fanout_parent, sync_fanout_child],\n )\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from datetime import timedelta\nfrom typing import Any\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet, TriggerWorkflowOptions\n\nhatchet = Hatchet(debug=True)\n\n\nclass ParentInput(BaseModel):\n n: int = 5\n\n\nclass ChildInput(BaseModel):\n a: str\n\n\nsync_fanout_parent = hatchet.workflow(\n name="SyncFanoutParent", input_validator=ParentInput\n)\nsync_fanout_child = hatchet.workflow(name="SyncFanoutChild", input_validator=ChildInput)\n\n\n@sync_fanout_parent.task(execution_timeout=timedelta(minutes=5))\ndef spawn(input: ParentInput, ctx: Context) -> dict[str, list[dict[str, Any]]]:\n print("spawning child")\n\n results = sync_fanout_child.run_many(\n [\n sync_fanout_child.create_bulk_run_item(\n input=ChildInput(a=str(i)),\n key=f"child{i}",\n options=TriggerWorkflowOptions(additional_metadata={"hello": "earth"}),\n )\n for i in range(input.n)\n ],\n )\n\n print(f"results {results}")\n\n return {"results": results}\n\n\n@sync_fanout_child.task()\ndef process(input: ChildInput, ctx: Context) -> dict[str, str]:\n return {"status": "success " + input.a}\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "sync-fanout-worker",\n slots=40,\n workflows=[sync_fanout_parent, sync_fanout_child],\n )\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/fanout_sync/worker.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/hatchet_client.ts b/frontend/app/src/next/lib/docs/generated/snips/python/hatchet_client.ts index ce67924d3..401a8c70e 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/hatchet_client.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/hatchet_client.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/hatchet_client.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/simple.ts b/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/simple.ts index 012142dfd..b64970a1e 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/simple.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/simple.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "# > Lifespan\n\nfrom typing import AsyncGenerator, cast\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\nclass Lifespan(BaseModel):\n foo: str\n pi: float\n\n\nasync def lifespan() -> AsyncGenerator[Lifespan, None]:\n yield Lifespan(foo='bar', pi=3.14)\n\n\n@hatchet.task(name='LifespanWorkflow')\ndef lifespan_task(input: EmptyModel, ctx: Context) -> Lifespan:\n return cast(Lifespan, ctx.lifespan)\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'test-worker', slots=1, workflows=[lifespan_task], lifespan=lifespan\n )\n worker.start()\n\n\n\nif __name__ == '__main__':\n main()\n", + '# > Lifespan\n\nfrom typing import AsyncGenerator, cast\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\nclass Lifespan(BaseModel):\n foo: str\n pi: float\n\n\nasync def lifespan() -> AsyncGenerator[Lifespan, None]:\n yield Lifespan(foo="bar", pi=3.14)\n\n\n@hatchet.task(name="LifespanWorkflow")\ndef lifespan_task(input: EmptyModel, ctx: Context) -> Lifespan:\n return cast(Lifespan, ctx.lifespan)\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "test-worker", slots=1, workflows=[lifespan_task], lifespan=lifespan\n )\n worker.start()\n\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/lifespans/simple.py', blocks: { lifespan: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/test_lifespans.ts b/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/test_lifespans.ts index 86116b486..7427fbf7c 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/test_lifespans.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/test_lifespans.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import pytest\n\nfrom examples.lifespans.simple import Lifespan, lifespan_task\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_lifespans() -> None:\n result = await lifespan_task.aio_run()\n\n assert isinstance(result, Lifespan)\n assert result.pi == 3.14\n assert result.foo == 'bar'\n", + 'import pytest\n\nfrom examples.lifespans.simple import Lifespan, lifespan_task\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_lifespans() -> None:\n result = await lifespan_task.aio_run()\n\n assert isinstance(result, Lifespan)\n assert result.pi == 3.14\n assert result.foo == "bar"\n', source: 'out/python/lifespans/test_lifespans.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/trigger.ts index debfe00fd..0ba39bee9 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/trigger.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/lifespans/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/worker.ts index abe19cd20..00ed3d1ce 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/lifespans/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from typing import AsyncGenerator, cast\nfrom uuid import UUID\n\nfrom psycopg_pool import ConnectionPool\nfrom pydantic import BaseModel, ConfigDict\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\n# > Use the lifespan in a task\nclass TaskOutput(BaseModel):\n num_rows: int\n external_ids: list[UUID]\n\n\nlifespan_workflow = hatchet.workflow(name='LifespanWorkflow')\n\n\n@lifespan_workflow.task()\ndef sync_lifespan_task(input: EmptyModel, ctx: Context) -> TaskOutput:\n pool = cast(Lifespan, ctx.lifespan).pool\n\n with pool.connection() as conn:\n query = conn.execute('SELECT * FROM v1_lookup_table_olap LIMIT 5;')\n rows = query.fetchall()\n\n for row in rows:\n print(row)\n\n print('executed sync task with lifespan', ctx.lifespan)\n\n return TaskOutput(\n num_rows=len(rows),\n external_ids=[cast(UUID, row[0]) for row in rows],\n )\n\n\n\n\n@lifespan_workflow.task()\nasync def async_lifespan_task(input: EmptyModel, ctx: Context) -> TaskOutput:\n pool = cast(Lifespan, ctx.lifespan).pool\n\n with pool.connection() as conn:\n query = conn.execute('SELECT * FROM v1_lookup_table_olap LIMIT 5;')\n rows = query.fetchall()\n\n for row in rows:\n print(row)\n\n print('executed async task with lifespan', ctx.lifespan)\n\n return TaskOutput(\n num_rows=len(rows),\n external_ids=[cast(UUID, row[0]) for row in rows],\n )\n\n\n# > Define a lifespan\nclass Lifespan(BaseModel):\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n foo: str\n pool: ConnectionPool\n\n\nasync def lifespan() -> AsyncGenerator[Lifespan, None]:\n print('Running lifespan!')\n with ConnectionPool('postgres://hatchet:hatchet@localhost:5431/hatchet') as pool:\n yield Lifespan(\n foo='bar',\n pool=pool,\n )\n\n print('Cleaning up lifespan!')\n\n\nworker = hatchet.worker(\n 'test-worker', slots=1, workflows=[lifespan_workflow], lifespan=lifespan\n)\n\n\ndef main() -> None:\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from typing import AsyncGenerator, cast\nfrom uuid import UUID\n\nfrom psycopg_pool import ConnectionPool\nfrom pydantic import BaseModel, ConfigDict\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\n# > Use the lifespan in a task\nclass TaskOutput(BaseModel):\n num_rows: int\n external_ids: list[UUID]\n\n\nlifespan_workflow = hatchet.workflow(name="LifespanWorkflow")\n\n\n@lifespan_workflow.task()\ndef sync_lifespan_task(input: EmptyModel, ctx: Context) -> TaskOutput:\n pool = cast(Lifespan, ctx.lifespan).pool\n\n with pool.connection() as conn:\n query = conn.execute("SELECT * FROM v1_lookup_table_olap LIMIT 5;")\n rows = query.fetchall()\n\n for row in rows:\n print(row)\n\n print("executed sync task with lifespan", ctx.lifespan)\n\n return TaskOutput(\n num_rows=len(rows),\n external_ids=[cast(UUID, row[0]) for row in rows],\n )\n\n\n\n\n@lifespan_workflow.task()\nasync def async_lifespan_task(input: EmptyModel, ctx: Context) -> TaskOutput:\n pool = cast(Lifespan, ctx.lifespan).pool\n\n with pool.connection() as conn:\n query = conn.execute("SELECT * FROM v1_lookup_table_olap LIMIT 5;")\n rows = query.fetchall()\n\n for row in rows:\n print(row)\n\n print("executed async task with lifespan", ctx.lifespan)\n\n return TaskOutput(\n num_rows=len(rows),\n external_ids=[cast(UUID, row[0]) for row in rows],\n )\n\n\n# > Define a lifespan\nclass Lifespan(BaseModel):\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n foo: str\n pool: ConnectionPool\n\n\nasync def lifespan() -> AsyncGenerator[Lifespan, None]:\n print("Running lifespan!")\n with ConnectionPool("postgres://hatchet:hatchet@localhost:5431/hatchet") as pool:\n yield Lifespan(\n foo="bar",\n pool=pool,\n )\n\n print("Cleaning up lifespan!")\n\n\nworker = hatchet.worker(\n "test-worker", slots=1, workflows=[lifespan_workflow], lifespan=lifespan\n)\n\n\ndef main() -> None:\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/lifespans/worker.py', blocks: { use_the_lifespan_in_a_task: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/logger/client.ts b/frontend/app/src/next/lib/docs/generated/snips/python/logger/client.ts index 1da6e3c57..592843548 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/logger/client.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/logger/client.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/logger/test_logger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/logger/test_logger.ts index 72e907012..b22ad2d96 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/logger/test_logger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/logger/test_logger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import pytest\n\nfrom examples.logger.workflow import logging_workflow\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_run() -> None:\n result = await logging_workflow.aio_run()\n\n assert result['root_logger']['status'] == 'success'\n", + 'import pytest\n\nfrom examples.logger.workflow import logging_workflow\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_run() -> None:\n result = await logging_workflow.aio_run()\n\n assert result["root_logger"]["status"] == "success"\n', source: 'out/python/logger/test_logger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/logger/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/logger/trigger.ts index 993fc50ce..2b990547f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/logger/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/logger/trigger.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/logger/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/logger/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/logger/worker.ts index 3c112d119..dd85e5ce8 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/logger/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/logger/worker.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from examples.logger.client import hatchet\nfrom examples.logger.workflow import logging_workflow\n\n\ndef main() -> None:\n worker = hatchet.worker('logger-worker', slots=5, workflows=[logging_workflow])\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from examples.logger.client import hatchet\nfrom examples.logger.workflow import logging_workflow\n\n\ndef main() -> None:\n worker = hatchet.worker("logger-worker", slots=5, workflows=[logging_workflow])\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/logger/worker.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/logger/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/python/logger/workflow.ts index 6265ea6b1..9606c00f9 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/logger/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/logger/workflow.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "# > LoggingWorkflow\n\nimport logging\nimport time\n\nfrom examples.logger.client import hatchet\nfrom hatchet_sdk import Context, EmptyModel\n\nlogger = logging.getLogger(__name__)\n\nlogging_workflow = hatchet.workflow(\n name='LoggingWorkflow',\n)\n\n\n@logging_workflow.task()\ndef root_logger(input: EmptyModel, ctx: Context) -> dict[str, str]:\n for i in range(12):\n logger.info('executed step1 - {}'.format(i))\n logger.info({'step1': 'step1'})\n\n time.sleep(0.1)\n\n return {'status': 'success'}\n\n\n\n# > ContextLogger\n\n\n@logging_workflow.task()\ndef context_logger(input: EmptyModel, ctx: Context) -> dict[str, str]:\n for i in range(12):\n ctx.log('executed step1 - {}'.format(i))\n ctx.log({'step1': 'step1'})\n\n time.sleep(0.1)\n\n return {'status': 'success'}\n\n\n", + '# > LoggingWorkflow\n\nimport logging\nimport time\n\nfrom examples.logger.client import hatchet\nfrom hatchet_sdk import Context, EmptyModel\n\nlogger = logging.getLogger(__name__)\n\nlogging_workflow = hatchet.workflow(\n name="LoggingWorkflow",\n)\n\n\n@logging_workflow.task()\ndef root_logger(input: EmptyModel, ctx: Context) -> dict[str, str]:\n for i in range(12):\n logger.info("executed step1 - {}".format(i))\n logger.info({"step1": "step1"})\n\n time.sleep(0.1)\n\n return {"status": "success"}\n\n\n\n# > ContextLogger\n\n\n@logging_workflow.task()\ndef context_logger(input: EmptyModel, ctx: Context) -> dict[str, str]:\n for i in range(12):\n ctx.log("executed step1 - {}".format(i))\n ctx.log({"step1": "step1"})\n\n time.sleep(0.1)\n\n return {"status": "success"}\n\n\n', source: 'out/python/logger/workflow.py', blocks: { loggingworkflow: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/manual_slot_release/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/manual_slot_release/worker.ts index 2f6ab0c9f..243742696 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/manual_slot_release/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/manual_slot_release/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import time\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet()\n\n# > SlotRelease\n\nslot_release_workflow = hatchet.workflow(name='SlotReleaseWorkflow')\n\n\n@slot_release_workflow.task()\ndef step1(input: EmptyModel, ctx: Context) -> dict[str, str]:\n print('RESOURCE INTENSIVE PROCESS')\n time.sleep(10)\n\n # 👀 Release the slot after the resource-intensive process, so that other steps can run\n ctx.release_slot()\n\n print('NON RESOURCE INTENSIVE PROCESS')\n return {'status': 'success'}\n\n\n", + 'import time\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet()\n\n# > SlotRelease\n\nslot_release_workflow = hatchet.workflow(name="SlotReleaseWorkflow")\n\n\n@slot_release_workflow.task()\ndef step1(input: EmptyModel, ctx: Context) -> dict[str, str]:\n print("RESOURCE INTENSIVE PROCESS")\n time.sleep(10)\n\n # 👀 Release the slot after the resource-intensive process, so that other steps can run\n ctx.release_slot()\n\n print("NON RESOURCE INTENSIVE PROCESS")\n return {"status": "success"}\n\n\n', source: 'out/python/manual_slot_release/worker.py', blocks: { slotrelease: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/migration_guides/__init__.ts b/frontend/app/src/next/lib/docs/generated/snips/python/migration_guides/__init__.ts index b1cb73818..95558e2dc 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/migration_guides/__init__.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/migration_guides/__init__.ts @@ -6,6 +6,6 @@ const snippet: Snippet = { source: 'out/python/migration_guides/__init__.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/migration_guides/hatchet_client.ts b/frontend/app/src/next/lib/docs/generated/snips/python/migration_guides/hatchet_client.ts index e094e9c5c..8d86d21a8 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/migration_guides/hatchet_client.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/migration_guides/hatchet_client.ts @@ -6,6 +6,6 @@ const snippet: Snippet = { source: 'out/python/migration_guides/hatchet_client.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/migration_guides/mergent.ts b/frontend/app/src/next/lib/docs/generated/snips/python/migration_guides/mergent.ts index 5e74c5ce3..644500f14 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/migration_guides/mergent.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/migration_guides/mergent.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from datetime import datetime, timedelta\nfrom typing import Any, Dict, List, Mapping\n\nimport requests\nfrom pydantic import BaseModel\nfrom requests import Response\n\nfrom hatchet_sdk.context.context import Context\n\nfrom .hatchet_client import hatchet\n\n\nasync def process_image(image_url: str, filters: List[str]) -> Dict[str, Any]:\n # Do some image processing\n return {'url': image_url, 'size': 100, 'format': 'png'}\n\n\n# > Before (Mergent)\nasync def process_image_task(request: Any) -> Dict[str, Any]:\n image_url = request.json['image_url']\n filters = request.json['filters']\n try:\n result = await process_image(image_url, filters)\n return {'success': True, 'processed_url': result['url']}\n except Exception as e:\n print(f'Image processing failed: {e}')\n raise\n\n\n\n\n# > After (Hatchet)\nclass ImageProcessInput(BaseModel):\n image_url: str\n filters: List[str]\n\n\nclass ImageProcessOutput(BaseModel):\n processed_url: str\n metadata: Dict[str, Any]\n\n\n@hatchet.task(\n name='image-processor',\n retries=3,\n execution_timeout='10m',\n input_validator=ImageProcessInput,\n)\nasync def image_processor(input: ImageProcessInput, ctx: Context) -> ImageProcessOutput:\n # Do some image processing\n result = await process_image(input.image_url, input.filters)\n\n if not result['url']:\n raise ValueError('Processing failed to generate URL')\n\n return ImageProcessOutput(\n processed_url=result['url'],\n metadata={\n 'size': result['size'],\n 'format': result['format'],\n 'applied_filters': input.filters,\n },\n )\n\n\n\n\nasync def run() -> None:\n # > Running a task (Mergent)\n headers: Mapping[str, str] = {\n 'Authorization': 'Bearer ',\n 'Content-Type': 'application/json',\n }\n\n task_data = {\n 'name': '4cf95241-fa19-47ef-8a67-71e483747649',\n 'queue': 'default',\n 'request': {\n 'url': 'https://example.com',\n 'headers': {\n 'Authorization': 'fake-secret-token',\n 'Content-Type': 'application/json',\n },\n 'body': 'Hello, world!',\n },\n }\n\n try:\n response: Response = requests.post(\n 'https://api.mergent.co/v2/tasks',\n headers=headers,\n json=task_data,\n )\n print(response.json())\n except Exception as e:\n print(f'Error: {e}')\n\n # > Running a task (Hatchet)\n result = await image_processor.aio_run(\n ImageProcessInput(image_url='https://example.com/image.png', filters=['blur'])\n )\n\n # you can await fully typed results\n print(result)\n\n\nasync def schedule() -> None:\n # > Scheduling tasks (Mergent)\n options = {\n # same options as before\n 'json': {\n # same body as before\n 'delay': '5m'\n }\n }\n\n print(options)\n\n # > Scheduling tasks (Hatchet)\n # Schedule the task to run at a specific time\n run_at = datetime.now() + timedelta(days=1)\n await image_processor.aio_schedule(\n run_at,\n ImageProcessInput(image_url='https://example.com/image.png', filters=['blur']),\n )\n\n # Schedule the task to run every hour\n await image_processor.aio_create_cron(\n 'run-hourly',\n '0 * * * *',\n ImageProcessInput(image_url='https://example.com/image.png', filters=['blur']),\n )\n", + 'from datetime import datetime, timedelta\nfrom typing import Any, Dict, List, Mapping\n\nimport requests\nfrom pydantic import BaseModel\nfrom requests import Response\n\nfrom hatchet_sdk.context.context import Context\n\nfrom .hatchet_client import hatchet\n\n\nasync def process_image(image_url: str, filters: List[str]) -> Dict[str, Any]:\n # Do some image processing\n return {"url": image_url, "size": 100, "format": "png"}\n\n\n# > Before (Mergent)\nasync def process_image_task(request: Any) -> Dict[str, Any]:\n image_url = request.json["image_url"]\n filters = request.json["filters"]\n try:\n result = await process_image(image_url, filters)\n return {"success": True, "processed_url": result["url"]}\n except Exception as e:\n print(f"Image processing failed: {e}")\n raise\n\n\n\n\n# > After (Hatchet)\nclass ImageProcessInput(BaseModel):\n image_url: str\n filters: List[str]\n\n\nclass ImageProcessOutput(BaseModel):\n processed_url: str\n metadata: Dict[str, Any]\n\n\n@hatchet.task(\n name="image-processor",\n retries=3,\n execution_timeout="10m",\n input_validator=ImageProcessInput,\n)\nasync def image_processor(input: ImageProcessInput, ctx: Context) -> ImageProcessOutput:\n # Do some image processing\n result = await process_image(input.image_url, input.filters)\n\n if not result["url"]:\n raise ValueError("Processing failed to generate URL")\n\n return ImageProcessOutput(\n processed_url=result["url"],\n metadata={\n "size": result["size"],\n "format": result["format"],\n "applied_filters": input.filters,\n },\n )\n\n\n\n\nasync def run() -> None:\n # > Running a task (Mergent)\n headers: Mapping[str, str] = {\n "Authorization": "Bearer ",\n "Content-Type": "application/json",\n }\n\n task_data = {\n "name": "4cf95241-fa19-47ef-8a67-71e483747649",\n "queue": "default",\n "request": {\n "url": "https://example.com",\n "headers": {\n "Authorization": "fake-secret-token",\n "Content-Type": "application/json",\n },\n "body": "Hello, world!",\n },\n }\n\n try:\n response: Response = requests.post(\n "https://api.mergent.co/v2/tasks",\n headers=headers,\n json=task_data,\n )\n print(response.json())\n except Exception as e:\n print(f"Error: {e}")\n\n # > Running a task (Hatchet)\n result = await image_processor.aio_run(\n ImageProcessInput(image_url="https://example.com/image.png", filters=["blur"])\n )\n\n # you can await fully typed results\n print(result)\n\n\nasync def schedule() -> None:\n # > Scheduling tasks (Mergent)\n options = {\n # same options as before\n "json": {\n # same body as before\n "delay": "5m"\n }\n }\n\n print(options)\n\n # > Scheduling tasks (Hatchet)\n # Schedule the task to run at a specific time\n run_at = datetime.now() + timedelta(days=1)\n await image_processor.aio_schedule(\n run_at,\n ImageProcessInput(image_url="https://example.com/image.png", filters=["blur"]),\n )\n\n # Schedule the task to run every hour\n await image_processor.aio_create_cron(\n "run-hourly",\n "0 * * * *",\n ImageProcessInput(image_url="https://example.com/image.png", filters=["blur"]),\n )\n', source: 'out/python/migration_guides/mergent.py', blocks: { before_mergent: { @@ -32,6 +32,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/non_retryable/test_no_retry.ts b/frontend/app/src/next/lib/docs/generated/snips/python/non_retryable/test_no_retry.ts index 116d43074..5c2fbaee8 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/non_retryable/test_no_retry.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/non_retryable/test_no_retry.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import pytest\n\nfrom examples.non_retryable.worker import (\n non_retryable_workflow,\n should_not_retry,\n should_not_retry_successful_task,\n should_retry_wrong_exception_type,\n)\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.rest.models.v1_task_event_type import V1TaskEventType\nfrom hatchet_sdk.clients.rest.models.v1_workflow_run_details import V1WorkflowRunDetails\n\n\ndef find_id(runs: V1WorkflowRunDetails, match: str) -> str:\n return next(t.metadata.id for t in runs.tasks if match in t.display_name)\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_no_retry(hatchet: Hatchet) -> None:\n ref = await non_retryable_workflow.aio_run_no_wait()\n\n with pytest.raises(Exception, match='retry'):\n await ref.aio_result()\n\n runs = await hatchet.runs.aio_get(ref.workflow_run_id)\n task_to_id = {\n task: find_id(runs, task.name)\n for task in [\n should_not_retry_successful_task,\n should_retry_wrong_exception_type,\n should_not_retry,\n ]\n }\n\n retrying_events = [\n e for e in runs.task_events if e.event_type == V1TaskEventType.RETRYING\n ]\n\n '''Only one task should be retried.'''\n assert len(retrying_events) == 1\n\n '''The task id of the retrying events should match the tasks that are retried'''\n assert {e.task_id for e in retrying_events} == {\n task_to_id[should_retry_wrong_exception_type],\n }\n\n '''Three failed events should emit, one each for the two failing initial runs and one for the retry.'''\n assert (\n len([e for e in runs.task_events if e.event_type == V1TaskEventType.FAILED])\n == 3\n )\n", + 'import pytest\n\nfrom examples.non_retryable.worker import (\n non_retryable_workflow,\n should_not_retry,\n should_not_retry_successful_task,\n should_retry_wrong_exception_type,\n)\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.rest.models.v1_task_event_type import V1TaskEventType\nfrom hatchet_sdk.clients.rest.models.v1_workflow_run_details import V1WorkflowRunDetails\n\n\ndef find_id(runs: V1WorkflowRunDetails, match: str) -> str:\n return next(t.metadata.id for t in runs.tasks if match in t.display_name)\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_no_retry(hatchet: Hatchet) -> None:\n ref = await non_retryable_workflow.aio_run_no_wait()\n\n with pytest.raises(Exception, match="retry"):\n await ref.aio_result()\n\n runs = await hatchet.runs.aio_get(ref.workflow_run_id)\n task_to_id = {\n task: find_id(runs, task.name)\n for task in [\n should_not_retry_successful_task,\n should_retry_wrong_exception_type,\n should_not_retry,\n ]\n }\n\n retrying_events = [\n e for e in runs.task_events if e.event_type == V1TaskEventType.RETRYING\n ]\n\n """Only one task should be retried."""\n assert len(retrying_events) == 1\n\n """The task id of the retrying events should match the tasks that are retried"""\n assert {e.task_id for e in retrying_events} == {\n task_to_id[should_retry_wrong_exception_type],\n }\n\n """Three failed events should emit, one each for the two failing initial runs and one for the retry."""\n assert (\n len([e for e in runs.task_events if e.event_type == V1TaskEventType.FAILED])\n == 3\n )\n', source: 'out/python/non_retryable/test_no_retry.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/non_retryable/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/non_retryable/trigger.ts index 2a04d60f7..cb7209c93 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/non_retryable/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/non_retryable/trigger.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/non_retryable/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/non_retryable/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/non_retryable/worker.ts index 3809c4b89..f4827500f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/non_retryable/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/non_retryable/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from hatchet_sdk import Context, EmptyModel, Hatchet\nfrom hatchet_sdk.exceptions import NonRetryableException\n\nhatchet = Hatchet(debug=True)\n\nnon_retryable_workflow = hatchet.workflow(name='NonRetryableWorkflow')\n\n\n# > Non-retryable task\n@non_retryable_workflow.task(retries=1)\ndef should_not_retry(input: EmptyModel, ctx: Context) -> None:\n raise NonRetryableException('This task should not retry')\n\n\n\n\n@non_retryable_workflow.task(retries=1)\ndef should_retry_wrong_exception_type(input: EmptyModel, ctx: Context) -> None:\n raise TypeError('This task should retry because it's not a NonRetryableException')\n\n\n@non_retryable_workflow.task(retries=1)\ndef should_not_retry_successful_task(input: EmptyModel, ctx: Context) -> None:\n pass\n\n\ndef main() -> None:\n worker = hatchet.worker('non-retry-worker', workflows=[non_retryable_workflow])\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from hatchet_sdk import Context, EmptyModel, Hatchet\nfrom hatchet_sdk.exceptions import NonRetryableException\n\nhatchet = Hatchet(debug=True)\n\nnon_retryable_workflow = hatchet.workflow(name="NonRetryableWorkflow")\n\n\n# > Non-retryable task\n@non_retryable_workflow.task(retries=1)\ndef should_not_retry(input: EmptyModel, ctx: Context) -> None:\n raise NonRetryableException("This task should not retry")\n\n\n\n\n@non_retryable_workflow.task(retries=1)\ndef should_retry_wrong_exception_type(input: EmptyModel, ctx: Context) -> None:\n raise TypeError("This task should retry because it\'s not a NonRetryableException")\n\n\n@non_retryable_workflow.task(retries=1)\ndef should_not_retry_successful_task(input: EmptyModel, ctx: Context) -> None:\n pass\n\n\ndef main() -> None:\n worker = hatchet.worker("non-retry-worker", workflows=[non_retryable_workflow])\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/non_retryable/worker.py', blocks: { non_retryable_task: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/on_failure/test_on_failure.ts b/frontend/app/src/next/lib/docs/generated/snips/python/on_failure/test_on_failure.ts index d2ffdcb8d..0e7816aff 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/on_failure/test_on_failure.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/on_failure/test_on_failure.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\nimport pytest\n\nfrom examples.on_failure.worker import on_failure_wf\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.rest.models.v1_task_status import V1TaskStatus\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_run_timeout(hatchet: Hatchet) -> None:\n run = on_failure_wf.run_no_wait()\n try:\n await run.aio_result()\n\n assert False, 'Expected workflow to timeout'\n except Exception as e:\n assert 'step1 failed' in str(e)\n\n await asyncio.sleep(5) # Wait for the on_failure job to finish\n\n details = await hatchet.runs.aio_get(run.workflow_run_id)\n\n assert len(details.tasks) == 2\n assert sum(t.status == V1TaskStatus.COMPLETED for t in details.tasks) == 1\n assert sum(t.status == V1TaskStatus.FAILED for t in details.tasks) == 1\n\n completed_task = next(\n t for t in details.tasks if t.status == V1TaskStatus.COMPLETED\n )\n failed_task = next(t for t in details.tasks if t.status == V1TaskStatus.FAILED)\n\n assert 'on_failure' in completed_task.display_name\n assert 'step1' in failed_task.display_name\n", + 'import asyncio\n\nimport pytest\n\nfrom examples.on_failure.worker import on_failure_wf\nfrom hatchet_sdk import Hatchet\nfrom hatchet_sdk.clients.rest.models.v1_task_status import V1TaskStatus\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_run_timeout(hatchet: Hatchet) -> None:\n run = on_failure_wf.run_no_wait()\n try:\n await run.aio_result()\n\n assert False, "Expected workflow to timeout"\n except Exception as e:\n assert "step1 failed" in str(e)\n\n await asyncio.sleep(5) # Wait for the on_failure job to finish\n\n details = await hatchet.runs.aio_get(run.workflow_run_id)\n\n assert len(details.tasks) == 2\n assert sum(t.status == V1TaskStatus.COMPLETED for t in details.tasks) == 1\n assert sum(t.status == V1TaskStatus.FAILED for t in details.tasks) == 1\n\n completed_task = next(\n t for t in details.tasks if t.status == V1TaskStatus.COMPLETED\n )\n failed_task = next(t for t in details.tasks if t.status == V1TaskStatus.FAILED)\n\n assert "on_failure" in completed_task.display_name\n assert "step1" in failed_task.display_name\n', source: 'out/python/on_failure/test_on_failure.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/on_failure/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/on_failure/trigger.ts index fdb081804..b80ee910e 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/on_failure/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/on_failure/trigger.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/on_failure/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/on_failure/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/on_failure/worker.ts index 6ccfdd438..3e96977f7 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/on_failure/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/on_failure/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import json\nfrom datetime import timedelta\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\nERROR_TEXT = 'step1 failed'\n\n# > OnFailure Step\n# This workflow will fail because the step will throw an error\n# we define an onFailure step to handle this case\n\non_failure_wf = hatchet.workflow(name='OnFailureWorkflow')\n\n\n@on_failure_wf.task(execution_timeout=timedelta(seconds=1))\ndef step1(input: EmptyModel, ctx: Context) -> None:\n # 👀 this step will always raise an exception\n raise Exception(ERROR_TEXT)\n\n\n# 👀 After the workflow fails, this special step will run\n@on_failure_wf.on_failure_task()\ndef on_failure(input: EmptyModel, ctx: Context) -> dict[str, str]:\n # 👀 we can do things like perform cleanup logic\n # or notify a user here\n\n # 👀 Fetch the errors from upstream step runs from the context\n print(ctx.task_run_errors)\n\n return {'status': 'success'}\n\n\n\n\n# > OnFailure With Details\n# We can access the failure details in the onFailure step\n# via the context method\n\non_failure_wf_with_details = hatchet.workflow(name='OnFailureWorkflowWithDetails')\n\n\n# ... defined as above\n@on_failure_wf_with_details.task(execution_timeout=timedelta(seconds=1))\ndef details_step1(input: EmptyModel, ctx: Context) -> None:\n raise Exception(ERROR_TEXT)\n\n\n# 👀 After the workflow fails, this special step will run\n@on_failure_wf_with_details.on_failure_task()\ndef details_on_failure(input: EmptyModel, ctx: Context) -> dict[str, str]:\n error = ctx.fetch_task_run_error(details_step1)\n\n # 👀 we can access the failure details here\n print(json.dumps(error, indent=2))\n\n if error and error.startswith(ERROR_TEXT):\n return {'status': 'success'}\n\n raise Exception('unexpected failure')\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'on-failure-worker',\n slots=4,\n workflows=[on_failure_wf, on_failure_wf_with_details],\n )\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'import json\nfrom datetime import timedelta\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\nERROR_TEXT = "step1 failed"\n\n# > OnFailure Step\n# This workflow will fail because the step will throw an error\n# we define an onFailure step to handle this case\n\non_failure_wf = hatchet.workflow(name="OnFailureWorkflow")\n\n\n@on_failure_wf.task(execution_timeout=timedelta(seconds=1))\ndef step1(input: EmptyModel, ctx: Context) -> None:\n # 👀 this step will always raise an exception\n raise Exception(ERROR_TEXT)\n\n\n# 👀 After the workflow fails, this special step will run\n@on_failure_wf.on_failure_task()\ndef on_failure(input: EmptyModel, ctx: Context) -> dict[str, str]:\n # 👀 we can do things like perform cleanup logic\n # or notify a user here\n\n # 👀 Fetch the errors from upstream step runs from the context\n print(ctx.task_run_errors)\n\n return {"status": "success"}\n\n\n\n\n# > OnFailure With Details\n# We can access the failure details in the onFailure step\n# via the context method\n\non_failure_wf_with_details = hatchet.workflow(name="OnFailureWorkflowWithDetails")\n\n\n# ... defined as above\n@on_failure_wf_with_details.task(execution_timeout=timedelta(seconds=1))\ndef details_step1(input: EmptyModel, ctx: Context) -> None:\n raise Exception(ERROR_TEXT)\n\n\n# 👀 After the workflow fails, this special step will run\n@on_failure_wf_with_details.on_failure_task()\ndef details_on_failure(input: EmptyModel, ctx: Context) -> dict[str, str]:\n error = ctx.fetch_task_run_error(details_step1)\n\n # 👀 we can access the failure details here\n print(json.dumps(error, indent=2))\n\n if error and error.startswith(ERROR_TEXT):\n return {"status": "success"}\n\n raise Exception("unexpected failure")\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "on-failure-worker",\n slots=4,\n workflows=[on_failure_wf, on_failure_wf_with_details],\n )\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/on_failure/worker.py', blocks: { onfailure_step: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/on_success/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/on_success/trigger.ts index f73271d32..fda3b93b3 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/on_success/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/on_success/trigger.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/on_success/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/on_success/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/on_success/worker.ts index 4a23dfa3d..bd7be3ac0 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/on_success/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/on_success/worker.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\non_success_workflow = hatchet.workflow(name='OnSuccessWorkflow')\n\n\n@on_success_workflow.task()\ndef first_task(input: EmptyModel, ctx: Context) -> None:\n print('First task completed successfully')\n\n\n@on_success_workflow.task(parents=[first_task])\ndef second_task(input: EmptyModel, ctx: Context) -> None:\n print('Second task completed successfully')\n\n\n@on_success_workflow.task(parents=[first_task, second_task])\ndef third_task(input: EmptyModel, ctx: Context) -> None:\n print('Third task completed successfully')\n\n\n@on_success_workflow.task()\ndef fourth_task(input: EmptyModel, ctx: Context) -> None:\n print('Fourth task completed successfully')\n\n\n@on_success_workflow.on_success_task()\ndef on_success_task(input: EmptyModel, ctx: Context) -> None:\n print('On success task completed successfully')\n\n\ndef main() -> None:\n worker = hatchet.worker('on-success-worker', workflows=[on_success_workflow])\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\non_success_workflow = hatchet.workflow(name="OnSuccessWorkflow")\n\n\n@on_success_workflow.task()\ndef first_task(input: EmptyModel, ctx: Context) -> None:\n print("First task completed successfully")\n\n\n@on_success_workflow.task(parents=[first_task])\ndef second_task(input: EmptyModel, ctx: Context) -> None:\n print("Second task completed successfully")\n\n\n@on_success_workflow.task(parents=[first_task, second_task])\ndef third_task(input: EmptyModel, ctx: Context) -> None:\n print("Third task completed successfully")\n\n\n@on_success_workflow.task()\ndef fourth_task(input: EmptyModel, ctx: Context) -> None:\n print("Fourth task completed successfully")\n\n\n@on_success_workflow.on_success_task()\ndef on_success_task(input: EmptyModel, ctx: Context) -> None:\n print("On success task completed successfully")\n\n\ndef main() -> None:\n worker = hatchet.worker("on-success-worker", workflows=[on_success_workflow])\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/on_success/worker.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/client.ts b/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/client.ts index 606398a5c..5d8350097 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/client.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/client.ts @@ -6,6 +6,6 @@ const snippet: Snippet = { source: 'out/python/opentelemetry_instrumentation/client.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/tracer.ts b/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/tracer.ts index 5184f0118..6ca5ae782 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/tracer.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/tracer.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import os\nfrom typing import cast\n\nfrom opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter\nfrom opentelemetry.sdk.resources import SERVICE_NAME, Resource\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import BatchSpanProcessor\nfrom opentelemetry.trace import NoOpTracerProvider\n\ntrace_provider: TracerProvider | NoOpTracerProvider\n\nif os.getenv('CI', 'false') == 'true':\n trace_provider = NoOpTracerProvider()\nelse:\n resource = Resource(\n attributes={\n SERVICE_NAME: os.getenv('HATCHET_CLIENT_OTEL_SERVICE_NAME', 'test-service')\n }\n )\n\n headers = dict(\n [\n cast(\n tuple[str, str],\n tuple(\n os.getenv(\n 'HATCHET_CLIENT_OTEL_EXPORTER_OTLP_HEADERS', 'foo=bar'\n ).split('=')\n ),\n )\n ]\n )\n\n processor = BatchSpanProcessor(\n OTLPSpanExporter(\n endpoint=os.getenv(\n 'HATCHET_CLIENT_OTEL_EXPORTER_OTLP_ENDPOINT', 'http://localhost:4317'\n ),\n headers=headers,\n ),\n )\n\n trace_provider = TracerProvider(resource=resource)\n\n trace_provider.add_span_processor(processor)\n", + 'import os\nfrom typing import cast\n\nfrom opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter\nfrom opentelemetry.sdk.resources import SERVICE_NAME, Resource\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import BatchSpanProcessor\nfrom opentelemetry.trace import NoOpTracerProvider\n\ntrace_provider: TracerProvider | NoOpTracerProvider\n\nif os.getenv("CI", "false") == "true":\n trace_provider = NoOpTracerProvider()\nelse:\n resource = Resource(\n attributes={\n SERVICE_NAME: os.getenv("HATCHET_CLIENT_OTEL_SERVICE_NAME", "test-service")\n }\n )\n\n headers = dict(\n [\n cast(\n tuple[str, str],\n tuple(\n os.getenv(\n "HATCHET_CLIENT_OTEL_EXPORTER_OTLP_HEADERS", "foo=bar"\n ).split("=")\n ),\n )\n ]\n )\n\n processor = BatchSpanProcessor(\n OTLPSpanExporter(\n endpoint=os.getenv(\n "HATCHET_CLIENT_OTEL_EXPORTER_OTLP_ENDPOINT", "http://localhost:4317"\n ),\n headers=headers,\n ),\n )\n\n trace_provider = TracerProvider(resource=resource)\n\n trace_provider.add_span_processor(processor)\n', source: 'out/python/opentelemetry_instrumentation/tracer.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/triggers.ts b/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/triggers.ts index 9fef18890..77fd3e772 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/triggers.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/triggers.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\nfrom examples.opentelemetry_instrumentation.client import hatchet\nfrom examples.opentelemetry_instrumentation.tracer import trace_provider\nfrom examples.opentelemetry_instrumentation.worker import otel_workflow\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\nfrom hatchet_sdk.clients.events import BulkPushEventWithMetadata, PushEventOptions\nfrom hatchet_sdk.opentelemetry.instrumentor import (\n HatchetInstrumentor,\n inject_traceparent_into_metadata,\n)\n\ninstrumentor = HatchetInstrumentor(tracer_provider=trace_provider)\ntracer = trace_provider.get_tracer(__name__)\n\n\ndef create_additional_metadata() -> dict[str, str]:\n return inject_traceparent_into_metadata({'hello': 'world'})\n\n\ndef create_push_options() -> PushEventOptions:\n return PushEventOptions(additional_metadata=create_additional_metadata())\n\n\ndef push_event() -> None:\n print('\\npush_event')\n with tracer.start_as_current_span('push_event'):\n hatchet.event.push(\n 'otel:event',\n {'test': 'test'},\n options=create_push_options(),\n )\n\n\nasync def async_push_event() -> None:\n print('\\nasync_push_event')\n with tracer.start_as_current_span('async_push_event'):\n await hatchet.event.aio_push(\n 'otel:event', {'test': 'test'}, options=create_push_options()\n )\n\n\ndef bulk_push_event() -> None:\n print('\\nbulk_push_event')\n with tracer.start_as_current_span('bulk_push_event'):\n hatchet.event.bulk_push(\n [\n BulkPushEventWithMetadata(\n key='otel:event',\n payload={'test': 'test 1'},\n additional_metadata=create_additional_metadata(),\n ),\n BulkPushEventWithMetadata(\n key='otel:event',\n payload={'test': 'test 2'},\n additional_metadata=create_additional_metadata(),\n ),\n ],\n )\n\n\nasync def async_bulk_push_event() -> None:\n print('\\nasync_bulk_push_event')\n with tracer.start_as_current_span('bulk_push_event'):\n await hatchet.event.aio_bulk_push(\n [\n BulkPushEventWithMetadata(\n key='otel:event',\n payload={'test': 'test 1'},\n additional_metadata=create_additional_metadata(),\n ),\n BulkPushEventWithMetadata(\n key='otel:event',\n payload={'test': 'test 2'},\n additional_metadata=create_additional_metadata(),\n ),\n ],\n )\n\n\ndef run_workflow() -> None:\n print('\\nrun_workflow')\n with tracer.start_as_current_span('run_workflow'):\n otel_workflow.run(\n options=TriggerWorkflowOptions(\n additional_metadata=create_additional_metadata()\n ),\n )\n\n\nasync def async_run_workflow() -> None:\n print('\\nasync_run_workflow')\n with tracer.start_as_current_span('async_run_workflow'):\n await otel_workflow.aio_run(\n options=TriggerWorkflowOptions(\n additional_metadata=create_additional_metadata()\n ),\n )\n\n\ndef run_workflows() -> None:\n print('\\nrun_workflows')\n with tracer.start_as_current_span('run_workflows'):\n otel_workflow.run_many(\n [\n otel_workflow.create_bulk_run_item(\n options=TriggerWorkflowOptions(\n additional_metadata=create_additional_metadata()\n )\n ),\n otel_workflow.create_bulk_run_item(\n options=TriggerWorkflowOptions(\n additional_metadata=create_additional_metadata()\n )\n ),\n ],\n )\n\n\nasync def async_run_workflows() -> None:\n print('\\nasync_run_workflows')\n with tracer.start_as_current_span('async_run_workflows'):\n await otel_workflow.aio_run_many(\n [\n otel_workflow.create_bulk_run_item(\n options=TriggerWorkflowOptions(\n additional_metadata=create_additional_metadata()\n )\n ),\n otel_workflow.create_bulk_run_item(\n options=TriggerWorkflowOptions(\n additional_metadata=create_additional_metadata()\n )\n ),\n ],\n )\n\n\nasync def main() -> None:\n push_event()\n await async_push_event()\n bulk_push_event()\n await async_bulk_push_event()\n run_workflow()\n # await async_run_workflow()\n run_workflows()\n # await async_run_workflows()\n\n\nif __name__ == '__main__':\n asyncio.run(main())\n", + 'import asyncio\n\nfrom examples.opentelemetry_instrumentation.client import hatchet\nfrom examples.opentelemetry_instrumentation.tracer import trace_provider\nfrom examples.opentelemetry_instrumentation.worker import otel_workflow\nfrom hatchet_sdk.clients.admin import TriggerWorkflowOptions\nfrom hatchet_sdk.clients.events import BulkPushEventWithMetadata, PushEventOptions\nfrom hatchet_sdk.opentelemetry.instrumentor import (\n HatchetInstrumentor,\n inject_traceparent_into_metadata,\n)\n\ninstrumentor = HatchetInstrumentor(tracer_provider=trace_provider)\ntracer = trace_provider.get_tracer(__name__)\n\n\ndef create_additional_metadata() -> dict[str, str]:\n return inject_traceparent_into_metadata({"hello": "world"})\n\n\ndef create_push_options() -> PushEventOptions:\n return PushEventOptions(additional_metadata=create_additional_metadata())\n\n\ndef push_event() -> None:\n print("\\npush_event")\n with tracer.start_as_current_span("push_event"):\n hatchet.event.push(\n "otel:event",\n {"test": "test"},\n options=create_push_options(),\n )\n\n\nasync def async_push_event() -> None:\n print("\\nasync_push_event")\n with tracer.start_as_current_span("async_push_event"):\n await hatchet.event.aio_push(\n "otel:event", {"test": "test"}, options=create_push_options()\n )\n\n\ndef bulk_push_event() -> None:\n print("\\nbulk_push_event")\n with tracer.start_as_current_span("bulk_push_event"):\n hatchet.event.bulk_push(\n [\n BulkPushEventWithMetadata(\n key="otel:event",\n payload={"test": "test 1"},\n additional_metadata=create_additional_metadata(),\n ),\n BulkPushEventWithMetadata(\n key="otel:event",\n payload={"test": "test 2"},\n additional_metadata=create_additional_metadata(),\n ),\n ],\n )\n\n\nasync def async_bulk_push_event() -> None:\n print("\\nasync_bulk_push_event")\n with tracer.start_as_current_span("bulk_push_event"):\n await hatchet.event.aio_bulk_push(\n [\n BulkPushEventWithMetadata(\n key="otel:event",\n payload={"test": "test 1"},\n additional_metadata=create_additional_metadata(),\n ),\n BulkPushEventWithMetadata(\n key="otel:event",\n payload={"test": "test 2"},\n additional_metadata=create_additional_metadata(),\n ),\n ],\n )\n\n\ndef run_workflow() -> None:\n print("\\nrun_workflow")\n with tracer.start_as_current_span("run_workflow"):\n otel_workflow.run(\n options=TriggerWorkflowOptions(\n additional_metadata=create_additional_metadata()\n ),\n )\n\n\nasync def async_run_workflow() -> None:\n print("\\nasync_run_workflow")\n with tracer.start_as_current_span("async_run_workflow"):\n await otel_workflow.aio_run(\n options=TriggerWorkflowOptions(\n additional_metadata=create_additional_metadata()\n ),\n )\n\n\ndef run_workflows() -> None:\n print("\\nrun_workflows")\n with tracer.start_as_current_span("run_workflows"):\n otel_workflow.run_many(\n [\n otel_workflow.create_bulk_run_item(\n options=TriggerWorkflowOptions(\n additional_metadata=create_additional_metadata()\n )\n ),\n otel_workflow.create_bulk_run_item(\n options=TriggerWorkflowOptions(\n additional_metadata=create_additional_metadata()\n )\n ),\n ],\n )\n\n\nasync def async_run_workflows() -> None:\n print("\\nasync_run_workflows")\n with tracer.start_as_current_span("async_run_workflows"):\n await otel_workflow.aio_run_many(\n [\n otel_workflow.create_bulk_run_item(\n options=TriggerWorkflowOptions(\n additional_metadata=create_additional_metadata()\n )\n ),\n otel_workflow.create_bulk_run_item(\n options=TriggerWorkflowOptions(\n additional_metadata=create_additional_metadata()\n )\n ),\n ],\n )\n\n\nasync def main() -> None:\n push_event()\n await async_push_event()\n bulk_push_event()\n await async_bulk_push_event()\n run_workflow()\n # await async_run_workflow()\n run_workflows()\n # await async_run_workflows()\n\n\nif __name__ == "__main__":\n asyncio.run(main())\n', source: 'out/python/opentelemetry_instrumentation/triggers.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/worker.ts index bf03c2aee..6718f4a5b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/opentelemetry_instrumentation/worker.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from examples.opentelemetry_instrumentation.client import hatchet\nfrom examples.opentelemetry_instrumentation.tracer import trace_provider\nfrom hatchet_sdk import Context, EmptyModel\nfrom hatchet_sdk.opentelemetry.instrumentor import HatchetInstrumentor\n\nHatchetInstrumentor(\n tracer_provider=trace_provider,\n).instrument()\n\notel_workflow = hatchet.workflow(\n name='OTelWorkflow',\n)\n\n\n@otel_workflow.task()\ndef your_spans_are_children_of_hatchet_span(\n input: EmptyModel, ctx: Context\n) -> dict[str, str]:\n with trace_provider.get_tracer(__name__).start_as_current_span('step1'):\n print('executed step')\n return {\n 'foo': 'bar',\n }\n\n\n@otel_workflow.task()\ndef your_spans_are_still_children_of_hatchet_span(\n input: EmptyModel, ctx: Context\n) -> None:\n with trace_provider.get_tracer(__name__).start_as_current_span('step2'):\n raise Exception('Manually instrumented step failed failed')\n\n\n@otel_workflow.task()\ndef this_step_is_still_instrumented(input: EmptyModel, ctx: Context) -> dict[str, str]:\n print('executed still-instrumented step')\n return {\n 'still': 'instrumented',\n }\n\n\n@otel_workflow.task()\ndef this_step_is_also_still_instrumented(input: EmptyModel, ctx: Context) -> None:\n raise Exception('Still-instrumented step failed')\n\n\ndef main() -> None:\n worker = hatchet.worker('otel-example-worker', slots=1, workflows=[otel_workflow])\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from examples.opentelemetry_instrumentation.client import hatchet\nfrom examples.opentelemetry_instrumentation.tracer import trace_provider\nfrom hatchet_sdk import Context, EmptyModel\nfrom hatchet_sdk.opentelemetry.instrumentor import HatchetInstrumentor\n\nHatchetInstrumentor(\n tracer_provider=trace_provider,\n).instrument()\n\notel_workflow = hatchet.workflow(\n name="OTelWorkflow",\n)\n\n\n@otel_workflow.task()\ndef your_spans_are_children_of_hatchet_span(\n input: EmptyModel, ctx: Context\n) -> dict[str, str]:\n with trace_provider.get_tracer(__name__).start_as_current_span("step1"):\n print("executed step")\n return {\n "foo": "bar",\n }\n\n\n@otel_workflow.task()\ndef your_spans_are_still_children_of_hatchet_span(\n input: EmptyModel, ctx: Context\n) -> None:\n with trace_provider.get_tracer(__name__).start_as_current_span("step2"):\n raise Exception("Manually instrumented step failed failed")\n\n\n@otel_workflow.task()\ndef this_step_is_still_instrumented(input: EmptyModel, ctx: Context) -> dict[str, str]:\n print("executed still-instrumented step")\n return {\n "still": "instrumented",\n }\n\n\n@otel_workflow.task()\ndef this_step_is_also_still_instrumented(input: EmptyModel, ctx: Context) -> None:\n raise Exception("Still-instrumented step failed")\n\n\ndef main() -> None:\n worker = hatchet.worker("otel-example-worker", slots=1, workflows=[otel_workflow])\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/opentelemetry_instrumentation/worker.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/priority/test_priority.ts b/frontend/app/src/next/lib/docs/generated/snips/python/priority/test_priority.ts index 579ff620f..9f2bbb47c 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/priority/test_priority.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/priority/test_priority.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\nfrom datetime import datetime, timedelta\nfrom random import choice\nfrom subprocess import Popen\nfrom typing import Any, AsyncGenerator, Literal\nfrom uuid import uuid4\n\nimport pytest\nimport pytest_asyncio\nfrom pydantic import BaseModel\n\nfrom examples.priority.worker import DEFAULT_PRIORITY, SLEEP_TIME, priority_workflow\nfrom hatchet_sdk import Hatchet, ScheduleTriggerWorkflowOptions, TriggerWorkflowOptions\nfrom hatchet_sdk.clients.rest.models.v1_task_status import V1TaskStatus\n\nPriority = Literal['low', 'medium', 'high', 'default']\n\n\nclass RunPriorityStartedAt(BaseModel):\n priority: Priority\n started_at: datetime\n finished_at: datetime\n\n\ndef priority_to_int(priority: Priority) -> int:\n match priority:\n case 'high':\n return 3\n case 'medium':\n return 2\n case 'low':\n return 1\n case 'default':\n return DEFAULT_PRIORITY\n case _:\n raise ValueError(f'Invalid priority: {priority}')\n\n\n@pytest_asyncio.fixture(loop_scope='session', scope='function')\nasync def dummy_runs() -> None:\n priority: Priority = 'high'\n\n await priority_workflow.aio_run_many_no_wait(\n [\n priority_workflow.create_bulk_run_item(\n options=TriggerWorkflowOptions(\n priority=(priority_to_int(priority)),\n additional_metadata={\n 'priority': priority,\n 'key': ix,\n 'type': 'dummy',\n },\n )\n )\n for ix in range(40)\n ]\n )\n\n await asyncio.sleep(3)\n\n return None\n\n\n@pytest.mark.parametrize(\n 'on_demand_worker',\n [\n (\n ['poetry', 'run', 'python', 'examples/priority/worker.py', '--slots', '1'],\n 8003,\n )\n ],\n indirect=True,\n)\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_priority(\n hatchet: Hatchet, dummy_runs: None, on_demand_worker: Popen[Any]\n) -> None:\n test_run_id = str(uuid4())\n choices: list[Priority] = ['low', 'medium', 'high', 'default']\n N = 30\n\n run_refs = await priority_workflow.aio_run_many_no_wait(\n [\n priority_workflow.create_bulk_run_item(\n options=TriggerWorkflowOptions(\n priority=(priority_to_int(priority := choice(choices))),\n additional_metadata={\n 'priority': priority,\n 'key': ix,\n 'test_run_id': test_run_id,\n },\n )\n )\n for ix in range(N)\n ]\n )\n\n await asyncio.gather(*[r.aio_result() for r in run_refs])\n\n workflows = (\n await hatchet.workflows.aio_list(workflow_name=priority_workflow.name)\n ).rows\n\n assert workflows\n\n workflow = next((w for w in workflows if w.name == priority_workflow.name), None)\n\n assert workflow\n\n assert workflow.name == priority_workflow.name\n\n runs = await hatchet.runs.aio_list(\n workflow_ids=[workflow.metadata.id],\n additional_metadata={\n 'test_run_id': test_run_id,\n },\n limit=1_000,\n )\n\n runs_ids_started_ats: list[RunPriorityStartedAt] = sorted(\n [\n RunPriorityStartedAt(\n priority=(r.additional_metadata or {}).get('priority') or 'low',\n started_at=r.started_at or datetime.min,\n finished_at=r.finished_at or datetime.min,\n )\n for r in runs.rows\n ],\n key=lambda x: x.started_at,\n )\n\n assert len(runs_ids_started_ats) == len(run_refs)\n assert len(runs_ids_started_ats) == N\n\n for i in range(len(runs_ids_started_ats) - 1):\n curr = runs_ids_started_ats[i]\n nxt = runs_ids_started_ats[i + 1]\n\n '''Run start times should be in order of priority'''\n assert priority_to_int(curr.priority) >= priority_to_int(nxt.priority)\n\n '''Runs should proceed one at a time'''\n assert curr.finished_at <= nxt.finished_at\n assert nxt.finished_at >= nxt.started_at\n\n '''Runs should finish after starting (this is mostly a test for engine datetime handling bugs)'''\n assert curr.finished_at >= curr.started_at\n\n\n@pytest.mark.parametrize(\n 'on_demand_worker',\n [\n (\n ['poetry', 'run', 'python', 'examples/priority/worker.py', '--slots', '1'],\n 8003,\n )\n ],\n indirect=True,\n)\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_priority_via_scheduling(\n hatchet: Hatchet, dummy_runs: None, on_demand_worker: Popen[Any]\n) -> None:\n test_run_id = str(uuid4())\n sleep_time = 3\n n = 30\n choices: list[Priority] = ['low', 'medium', 'high', 'default']\n run_at = datetime.now() + timedelta(seconds=sleep_time)\n\n versions = await asyncio.gather(\n *[\n priority_workflow.aio_schedule(\n run_at=run_at,\n options=ScheduleTriggerWorkflowOptions(\n priority=(priority_to_int(priority := choice(choices))),\n additional_metadata={\n 'priority': priority,\n 'key': ix,\n 'test_run_id': test_run_id,\n },\n ),\n )\n for ix in range(n)\n ]\n )\n\n await asyncio.sleep(sleep_time * 2)\n\n workflow_id = versions[0].workflow_id\n\n attempts = 0\n\n while True:\n if attempts >= SLEEP_TIME * n * 2:\n raise TimeoutError('Timed out waiting for runs to finish')\n\n attempts += 1\n await asyncio.sleep(1)\n runs = await hatchet.runs.aio_list(\n workflow_ids=[workflow_id],\n additional_metadata={\n 'test_run_id': test_run_id,\n },\n limit=1_000,\n )\n\n if not runs.rows:\n continue\n\n if any(\n r.status in [V1TaskStatus.FAILED, V1TaskStatus.CANCELLED] for r in runs.rows\n ):\n raise ValueError('One or more runs failed or were cancelled')\n\n if all(r.status == V1TaskStatus.COMPLETED for r in runs.rows):\n break\n\n runs_ids_started_ats: list[RunPriorityStartedAt] = sorted(\n [\n RunPriorityStartedAt(\n priority=(r.additional_metadata or {}).get('priority') or 'low',\n started_at=r.started_at or datetime.min,\n finished_at=r.finished_at or datetime.min,\n )\n for r in runs.rows\n ],\n key=lambda x: x.started_at,\n )\n\n assert len(runs_ids_started_ats) == len(versions)\n\n for i in range(len(runs_ids_started_ats) - 1):\n curr = runs_ids_started_ats[i]\n nxt = runs_ids_started_ats[i + 1]\n\n '''Run start times should be in order of priority'''\n assert priority_to_int(curr.priority) >= priority_to_int(nxt.priority)\n\n '''Runs should proceed one at a time'''\n assert curr.finished_at <= nxt.finished_at\n assert nxt.finished_at >= nxt.started_at\n\n '''Runs should finish after starting (this is mostly a test for engine datetime handling bugs)'''\n assert curr.finished_at >= curr.started_at\n\n\n@pytest_asyncio.fixture(loop_scope='session', scope='function')\nasync def crons(\n hatchet: Hatchet, dummy_runs: None\n) -> AsyncGenerator[tuple[str, str, int], None]:\n test_run_id = str(uuid4())\n choices: list[Priority] = ['low', 'medium', 'high']\n n = 30\n\n crons = await asyncio.gather(\n *[\n hatchet.cron.aio_create(\n workflow_name=priority_workflow.name,\n cron_name=f'{test_run_id}-cron-{i}',\n expression='* * * * *',\n input={},\n additional_metadata={\n 'trigger': 'cron',\n 'test_run_id': test_run_id,\n 'priority': (priority := choice(choices)),\n 'key': str(i),\n },\n priority=(priority_to_int(priority)),\n )\n for i in range(n)\n ]\n )\n\n yield crons[0].workflow_id, test_run_id, n\n\n await asyncio.gather(*[hatchet.cron.aio_delete(cron.metadata.id) for cron in crons])\n\n\ndef time_until_next_minute() -> float:\n now = datetime.now()\n next_minute = (now + timedelta(minutes=1)).replace(second=0, microsecond=0)\n\n return (next_minute - now).total_seconds()\n\n\n@pytest.mark.skip(\n reason='Test is flaky because the first jobs that are picked up don't necessarily go in priority order'\n)\n@pytest.mark.parametrize(\n 'on_demand_worker',\n [\n (\n ['poetry', 'run', 'python', 'examples/priority/worker.py', '--slots', '1'],\n 8003,\n )\n ],\n indirect=True,\n)\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_priority_via_cron(\n hatchet: Hatchet, crons: tuple[str, str, int], on_demand_worker: Popen[Any]\n) -> None:\n workflow_id, test_run_id, n = crons\n\n await asyncio.sleep(time_until_next_minute() + 10)\n\n attempts = 0\n\n while True:\n if attempts >= SLEEP_TIME * n * 2:\n raise TimeoutError('Timed out waiting for runs to finish')\n\n attempts += 1\n await asyncio.sleep(1)\n runs = await hatchet.runs.aio_list(\n workflow_ids=[workflow_id],\n additional_metadata={\n 'test_run_id': test_run_id,\n },\n limit=1_000,\n )\n\n if not runs.rows:\n continue\n\n if any(\n r.status in [V1TaskStatus.FAILED, V1TaskStatus.CANCELLED] for r in runs.rows\n ):\n raise ValueError('One or more runs failed or were cancelled')\n\n if all(r.status == V1TaskStatus.COMPLETED for r in runs.rows):\n break\n\n runs_ids_started_ats: list[RunPriorityStartedAt] = sorted(\n [\n RunPriorityStartedAt(\n priority=(r.additional_metadata or {}).get('priority') or 'low',\n started_at=r.started_at or datetime.min,\n finished_at=r.finished_at or datetime.min,\n )\n for r in runs.rows\n ],\n key=lambda x: x.started_at,\n )\n\n assert len(runs_ids_started_ats) == n\n\n for i in range(len(runs_ids_started_ats) - 1):\n curr = runs_ids_started_ats[i]\n nxt = runs_ids_started_ats[i + 1]\n\n '''Run start times should be in order of priority'''\n assert priority_to_int(curr.priority) >= priority_to_int(nxt.priority)\n\n '''Runs should proceed one at a time'''\n assert curr.finished_at <= nxt.finished_at\n assert nxt.finished_at >= nxt.started_at\n\n '''Runs should finish after starting (this is mostly a test for engine datetime handling bugs)'''\n assert curr.finished_at >= curr.started_at\n", + 'import asyncio\nfrom datetime import datetime, timedelta\nfrom random import choice\nfrom subprocess import Popen\nfrom typing import Any, AsyncGenerator, Literal\nfrom uuid import uuid4\n\nimport pytest\nimport pytest_asyncio\nfrom pydantic import BaseModel\n\nfrom examples.priority.worker import DEFAULT_PRIORITY, SLEEP_TIME, priority_workflow\nfrom hatchet_sdk import Hatchet, ScheduleTriggerWorkflowOptions, TriggerWorkflowOptions\nfrom hatchet_sdk.clients.rest.models.v1_task_status import V1TaskStatus\n\nPriority = Literal["low", "medium", "high", "default"]\n\n\nclass RunPriorityStartedAt(BaseModel):\n priority: Priority\n started_at: datetime\n finished_at: datetime\n\n\ndef priority_to_int(priority: Priority) -> int:\n match priority:\n case "high":\n return 3\n case "medium":\n return 2\n case "low":\n return 1\n case "default":\n return DEFAULT_PRIORITY\n case _:\n raise ValueError(f"Invalid priority: {priority}")\n\n\n@pytest_asyncio.fixture(loop_scope="session", scope="function")\nasync def dummy_runs() -> None:\n priority: Priority = "high"\n\n await priority_workflow.aio_run_many_no_wait(\n [\n priority_workflow.create_bulk_run_item(\n options=TriggerWorkflowOptions(\n priority=(priority_to_int(priority)),\n additional_metadata={\n "priority": priority,\n "key": ix,\n "type": "dummy",\n },\n )\n )\n for ix in range(40)\n ]\n )\n\n await asyncio.sleep(3)\n\n return None\n\n\n@pytest.mark.parametrize(\n "on_demand_worker",\n [\n (\n ["poetry", "run", "python", "examples/priority/worker.py", "--slots", "1"],\n 8003,\n )\n ],\n indirect=True,\n)\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_priority(\n hatchet: Hatchet, dummy_runs: None, on_demand_worker: Popen[Any]\n) -> None:\n test_run_id = str(uuid4())\n choices: list[Priority] = ["low", "medium", "high", "default"]\n N = 30\n\n run_refs = await priority_workflow.aio_run_many_no_wait(\n [\n priority_workflow.create_bulk_run_item(\n options=TriggerWorkflowOptions(\n priority=(priority_to_int(priority := choice(choices))),\n additional_metadata={\n "priority": priority,\n "key": ix,\n "test_run_id": test_run_id,\n },\n )\n )\n for ix in range(N)\n ]\n )\n\n await asyncio.gather(*[r.aio_result() for r in run_refs])\n\n workflows = (\n await hatchet.workflows.aio_list(workflow_name=priority_workflow.name)\n ).rows\n\n assert workflows\n\n workflow = next((w for w in workflows if w.name == priority_workflow.name), None)\n\n assert workflow\n\n assert workflow.name == priority_workflow.name\n\n runs = await hatchet.runs.aio_list(\n workflow_ids=[workflow.metadata.id],\n additional_metadata={\n "test_run_id": test_run_id,\n },\n limit=1_000,\n )\n\n runs_ids_started_ats: list[RunPriorityStartedAt] = sorted(\n [\n RunPriorityStartedAt(\n priority=(r.additional_metadata or {}).get("priority") or "low",\n started_at=r.started_at or datetime.min,\n finished_at=r.finished_at or datetime.min,\n )\n for r in runs.rows\n ],\n key=lambda x: x.started_at,\n )\n\n assert len(runs_ids_started_ats) == len(run_refs)\n assert len(runs_ids_started_ats) == N\n\n for i in range(len(runs_ids_started_ats) - 1):\n curr = runs_ids_started_ats[i]\n nxt = runs_ids_started_ats[i + 1]\n\n """Run start times should be in order of priority"""\n assert priority_to_int(curr.priority) >= priority_to_int(nxt.priority)\n\n """Runs should proceed one at a time"""\n assert curr.finished_at <= nxt.finished_at\n assert nxt.finished_at >= nxt.started_at\n\n """Runs should finish after starting (this is mostly a test for engine datetime handling bugs)"""\n assert curr.finished_at >= curr.started_at\n\n\n@pytest.mark.parametrize(\n "on_demand_worker",\n [\n (\n ["poetry", "run", "python", "examples/priority/worker.py", "--slots", "1"],\n 8003,\n )\n ],\n indirect=True,\n)\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_priority_via_scheduling(\n hatchet: Hatchet, dummy_runs: None, on_demand_worker: Popen[Any]\n) -> None:\n test_run_id = str(uuid4())\n sleep_time = 3\n n = 30\n choices: list[Priority] = ["low", "medium", "high", "default"]\n run_at = datetime.now() + timedelta(seconds=sleep_time)\n\n versions = await asyncio.gather(\n *[\n priority_workflow.aio_schedule(\n run_at=run_at,\n options=ScheduleTriggerWorkflowOptions(\n priority=(priority_to_int(priority := choice(choices))),\n additional_metadata={\n "priority": priority,\n "key": ix,\n "test_run_id": test_run_id,\n },\n ),\n )\n for ix in range(n)\n ]\n )\n\n await asyncio.sleep(sleep_time * 2)\n\n workflow_id = versions[0].workflow_id\n\n attempts = 0\n\n while True:\n if attempts >= SLEEP_TIME * n * 2:\n raise TimeoutError("Timed out waiting for runs to finish")\n\n attempts += 1\n await asyncio.sleep(1)\n runs = await hatchet.runs.aio_list(\n workflow_ids=[workflow_id],\n additional_metadata={\n "test_run_id": test_run_id,\n },\n limit=1_000,\n )\n\n if not runs.rows:\n continue\n\n if any(\n r.status in [V1TaskStatus.FAILED, V1TaskStatus.CANCELLED] for r in runs.rows\n ):\n raise ValueError("One or more runs failed or were cancelled")\n\n if all(r.status == V1TaskStatus.COMPLETED for r in runs.rows):\n break\n\n runs_ids_started_ats: list[RunPriorityStartedAt] = sorted(\n [\n RunPriorityStartedAt(\n priority=(r.additional_metadata or {}).get("priority") or "low",\n started_at=r.started_at or datetime.min,\n finished_at=r.finished_at or datetime.min,\n )\n for r in runs.rows\n ],\n key=lambda x: x.started_at,\n )\n\n assert len(runs_ids_started_ats) == len(versions)\n\n for i in range(len(runs_ids_started_ats) - 1):\n curr = runs_ids_started_ats[i]\n nxt = runs_ids_started_ats[i + 1]\n\n """Run start times should be in order of priority"""\n assert priority_to_int(curr.priority) >= priority_to_int(nxt.priority)\n\n """Runs should proceed one at a time"""\n assert curr.finished_at <= nxt.finished_at\n assert nxt.finished_at >= nxt.started_at\n\n """Runs should finish after starting (this is mostly a test for engine datetime handling bugs)"""\n assert curr.finished_at >= curr.started_at\n\n\n@pytest_asyncio.fixture(loop_scope="session", scope="function")\nasync def crons(\n hatchet: Hatchet, dummy_runs: None\n) -> AsyncGenerator[tuple[str, str, int], None]:\n test_run_id = str(uuid4())\n choices: list[Priority] = ["low", "medium", "high"]\n n = 30\n\n crons = await asyncio.gather(\n *[\n hatchet.cron.aio_create(\n workflow_name=priority_workflow.name,\n cron_name=f"{test_run_id}-cron-{i}",\n expression="* * * * *",\n input={},\n additional_metadata={\n "trigger": "cron",\n "test_run_id": test_run_id,\n "priority": (priority := choice(choices)),\n "key": str(i),\n },\n priority=(priority_to_int(priority)),\n )\n for i in range(n)\n ]\n )\n\n yield crons[0].workflow_id, test_run_id, n\n\n await asyncio.gather(*[hatchet.cron.aio_delete(cron.metadata.id) for cron in crons])\n\n\ndef time_until_next_minute() -> float:\n now = datetime.now()\n next_minute = (now + timedelta(minutes=1)).replace(second=0, microsecond=0)\n\n return (next_minute - now).total_seconds()\n\n\n@pytest.mark.skip(\n reason="Test is flaky because the first jobs that are picked up don\'t necessarily go in priority order"\n)\n@pytest.mark.parametrize(\n "on_demand_worker",\n [\n (\n ["poetry", "run", "python", "examples/priority/worker.py", "--slots", "1"],\n 8003,\n )\n ],\n indirect=True,\n)\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_priority_via_cron(\n hatchet: Hatchet, crons: tuple[str, str, int], on_demand_worker: Popen[Any]\n) -> None:\n workflow_id, test_run_id, n = crons\n\n await asyncio.sleep(time_until_next_minute() + 10)\n\n attempts = 0\n\n while True:\n if attempts >= SLEEP_TIME * n * 2:\n raise TimeoutError("Timed out waiting for runs to finish")\n\n attempts += 1\n await asyncio.sleep(1)\n runs = await hatchet.runs.aio_list(\n workflow_ids=[workflow_id],\n additional_metadata={\n "test_run_id": test_run_id,\n },\n limit=1_000,\n )\n\n if not runs.rows:\n continue\n\n if any(\n r.status in [V1TaskStatus.FAILED, V1TaskStatus.CANCELLED] for r in runs.rows\n ):\n raise ValueError("One or more runs failed or were cancelled")\n\n if all(r.status == V1TaskStatus.COMPLETED for r in runs.rows):\n break\n\n runs_ids_started_ats: list[RunPriorityStartedAt] = sorted(\n [\n RunPriorityStartedAt(\n priority=(r.additional_metadata or {}).get("priority") or "low",\n started_at=r.started_at or datetime.min,\n finished_at=r.finished_at or datetime.min,\n )\n for r in runs.rows\n ],\n key=lambda x: x.started_at,\n )\n\n assert len(runs_ids_started_ats) == n\n\n for i in range(len(runs_ids_started_ats) - 1):\n curr = runs_ids_started_ats[i]\n nxt = runs_ids_started_ats[i + 1]\n\n """Run start times should be in order of priority"""\n assert priority_to_int(curr.priority) >= priority_to_int(nxt.priority)\n\n """Runs should proceed one at a time"""\n assert curr.finished_at <= nxt.finished_at\n assert nxt.finished_at >= nxt.started_at\n\n """Runs should finish after starting (this is mostly a test for engine datetime handling bugs)"""\n assert curr.finished_at >= curr.started_at\n', source: 'out/python/priority/test_priority.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/priority/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/priority/trigger.ts index fe551177f..9f0d657fe 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/priority/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/priority/trigger.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from datetime import datetime, timedelta\n\nfrom examples.priority.worker import priority_workflow\nfrom hatchet_sdk import ScheduleTriggerWorkflowOptions, TriggerWorkflowOptions\n\npriority_workflow.run_no_wait()\n\n# > Runtime priority\nlow_prio = priority_workflow.run_no_wait(\n options=TriggerWorkflowOptions(\n ## 👀 Adding priority and key to metadata to show them in the dashboard\n priority=1,\n additional_metadata={'priority': 'low', 'key': 1},\n )\n)\n\nhigh_prio = priority_workflow.run_no_wait(\n options=TriggerWorkflowOptions(\n ## 👀 Adding priority and key to metadata to show them in the dashboard\n priority=3,\n additional_metadata={'priority': 'high', 'key': 1},\n )\n)\n\n# > Scheduled priority\nschedule = priority_workflow.schedule(\n run_at=datetime.now() + timedelta(minutes=1),\n options=ScheduleTriggerWorkflowOptions(priority=3),\n)\n\ncron = priority_workflow.create_cron(\n cron_name='my-scheduled-cron',\n expression='0 * * * *',\n priority=3,\n)\n\n# > Default priority\nlow_prio = priority_workflow.run_no_wait(\n options=TriggerWorkflowOptions(\n ## 👀 Adding priority and key to metadata to show them in the dashboard\n priority=1,\n additional_metadata={'priority': 'low', 'key': 2},\n )\n)\nhigh_prio = priority_workflow.run_no_wait(\n options=TriggerWorkflowOptions(\n ## 👀 Adding priority and key to metadata to show them in the dashboard\n priority=3,\n additional_metadata={'priority': 'high', 'key': 2},\n )\n)\n", + 'from datetime import datetime, timedelta\n\nfrom examples.priority.worker import priority_workflow\nfrom hatchet_sdk import ScheduleTriggerWorkflowOptions, TriggerWorkflowOptions\n\npriority_workflow.run_no_wait()\n\n# > Runtime priority\nlow_prio = priority_workflow.run_no_wait(\n options=TriggerWorkflowOptions(\n ## 👀 Adding priority and key to metadata to show them in the dashboard\n priority=1,\n additional_metadata={"priority": "low", "key": 1},\n )\n)\n\nhigh_prio = priority_workflow.run_no_wait(\n options=TriggerWorkflowOptions(\n ## 👀 Adding priority and key to metadata to show them in the dashboard\n priority=3,\n additional_metadata={"priority": "high", "key": 1},\n )\n)\n\n# > Scheduled priority\nschedule = priority_workflow.schedule(\n run_at=datetime.now() + timedelta(minutes=1),\n options=ScheduleTriggerWorkflowOptions(priority=3),\n)\n\ncron = priority_workflow.create_cron(\n cron_name="my-scheduled-cron",\n expression="0 * * * *",\n priority=3,\n)\n\n# > Default priority\nlow_prio = priority_workflow.run_no_wait(\n options=TriggerWorkflowOptions(\n ## 👀 Adding priority and key to metadata to show them in the dashboard\n priority=1,\n additional_metadata={"priority": "low", "key": 2},\n )\n)\nhigh_prio = priority_workflow.run_no_wait(\n options=TriggerWorkflowOptions(\n ## 👀 Adding priority and key to metadata to show them in the dashboard\n priority=3,\n additional_metadata={"priority": "high", "key": 2},\n )\n)\n', source: 'out/python/priority/trigger.py', blocks: { runtime_priority: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/priority/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/priority/worker.ts index 448c2dd03..473341f8f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/priority/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/priority/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import time\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n# > Default priority\nDEFAULT_PRIORITY = 1\nSLEEP_TIME = 0.25\n\npriority_workflow = hatchet.workflow(\n name='PriorityWorkflow',\n default_priority=DEFAULT_PRIORITY,\n)\n\n\n@priority_workflow.task()\ndef priority_task(input: EmptyModel, ctx: Context) -> None:\n print('Priority:', ctx.priority)\n time.sleep(SLEEP_TIME)\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'priority-worker',\n slots=1,\n workflows=[priority_workflow],\n )\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'import time\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n# > Default priority\nDEFAULT_PRIORITY = 1\nSLEEP_TIME = 0.25\n\npriority_workflow = hatchet.workflow(\n name="PriorityWorkflow",\n default_priority=DEFAULT_PRIORITY,\n)\n\n\n@priority_workflow.task()\ndef priority_task(input: EmptyModel, ctx: Context) -> None:\n print("Priority:", ctx.priority)\n time.sleep(SLEEP_TIME)\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "priority-worker",\n slots=1,\n workflows=[priority_workflow],\n )\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/priority/worker.py', blocks: { default_priority: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/README.ts b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/README.ts index 405ecefd7..cf6b9fdcb 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/README.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/README.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/quickstart/README.md', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/__init__.ts b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/__init__.ts index 9cbec55bd..83b75dee9 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/__init__.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/__init__.ts @@ -6,6 +6,6 @@ const snippet: Snippet = { source: 'out/python/quickstart/__init__.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/gitignore.ts b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/gitignore.ts index 10eac06ba..4738ba9cf 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/gitignore.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/gitignore.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/quickstart/.gitignore', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/hatchet_client.ts b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/hatchet_client.ts index b5ba0e955..9ffe884b2 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/hatchet_client.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/hatchet_client.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/quickstart/hatchet_client.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/poetry.ts b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/poetry.ts index 9b1fb9a18..6252bde2b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/poetry.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/poetry.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'unknown', content: - "# This file is automatically @generated by Poetry 2.0.0 and should not be changed by hand.\n\n[[package]]\nname = 'aiohappyeyeballs'\nversion = '2.6.1'\ndescription = 'Happy Eyeballs for asyncio'\noptional = false\npython-versions = '>=3.9'\ngroups = ['main']\nfiles = [\n {file = 'aiohappyeyeballs-2.6.1-py3-none-any.whl', hash = 'sha256:f349ba8f4b75cb25c99c5c2d84e997e485204d2902a9597802b0371f09331fb8'},\n {file = 'aiohappyeyeballs-2.6.1.tar.gz', hash = 'sha256:c3f9d0113123803ccadfdf3f0faa505bc78e6a72d1cc4806cbd719826e943558'},\n]\n\n[[package]]\nname = 'aiohttp'\nversion = '3.11.14'\ndescription = 'Async http client/server framework (asyncio)'\noptional = false\npython-versions = '>=3.9'\ngroups = ['main']\nfiles = [\n {file = 'aiohttp-3.11.14-cp310-cp310-macosx_10_9_universal2.whl', hash = 'sha256:e2bc827c01f75803de77b134afdbf74fa74b62970eafdf190f3244931d7a5c0d'},\n {file = 'aiohttp-3.11.14-cp310-cp310-macosx_10_9_x86_64.whl', hash = 'sha256:e365034c5cf6cf74f57420b57682ea79e19eb29033399dd3f40de4d0171998fa'},\n {file = 'aiohttp-3.11.14-cp310-cp310-macosx_11_0_arm64.whl', hash = 'sha256:c32593ead1a8c6aabd58f9d7ee706e48beac796bb0cb71d6b60f2c1056f0a65f'},\n {file = 'aiohttp-3.11.14-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:b4e7c7ec4146a94a307ca4f112802a8e26d969018fabed526efc340d21d3e7d0'},\n {file = 'aiohttp-3.11.14-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:c8b2df9feac55043759aa89f722a967d977d80f8b5865a4153fc41c93b957efc'},\n {file = 'aiohttp-3.11.14-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:c7571f99525c76a6280f5fe8e194eeb8cb4da55586c3c61c59c33a33f10cfce7'},\n {file = 'aiohttp-3.11.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:b59d096b5537ec7c85954cb97d821aae35cfccce3357a2cafe85660cc6295628'},\n {file = 'aiohttp-3.11.14-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:b42dbd097abb44b3f1156b4bf978ec5853840802d6eee2784857be11ee82c6a0'},\n {file = 'aiohttp-3.11.14-cp310-cp310-musllinux_1_2_aarch64.whl', hash = 'sha256:b05774864c87210c531b48dfeb2f7659407c2dda8643104fb4ae5e2c311d12d9'},\n {file = 'aiohttp-3.11.14-cp310-cp310-musllinux_1_2_armv7l.whl', hash = 'sha256:4e2e8ef37d4bc110917d038807ee3af82700a93ab2ba5687afae5271b8bc50ff'},\n {file = 'aiohttp-3.11.14-cp310-cp310-musllinux_1_2_i686.whl', hash = 'sha256:e9faafa74dbb906b2b6f3eb9942352e9e9db8d583ffed4be618a89bd71a4e914'},\n {file = 'aiohttp-3.11.14-cp310-cp310-musllinux_1_2_ppc64le.whl', hash = 'sha256:7e7abe865504f41b10777ac162c727af14e9f4db9262e3ed8254179053f63e6d'},\n {file = 'aiohttp-3.11.14-cp310-cp310-musllinux_1_2_s390x.whl', hash = 'sha256:4848ae31ad44330b30f16c71e4f586cd5402a846b11264c412de99fa768f00f3'},\n {file = 'aiohttp-3.11.14-cp310-cp310-musllinux_1_2_x86_64.whl', hash = 'sha256:2d0b46abee5b5737cb479cc9139b29f010a37b1875ee56d142aefc10686a390b'},\n {file = 'aiohttp-3.11.14-cp310-cp310-win32.whl', hash = 'sha256:a0d2c04a623ab83963576548ce098baf711a18e2c32c542b62322a0b4584b990'},\n {file = 'aiohttp-3.11.14-cp310-cp310-win_amd64.whl', hash = 'sha256:5409a59d5057f2386bb8b8f8bbcfb6e15505cedd8b2445db510563b5d7ea1186'},\n {file = 'aiohttp-3.11.14-cp311-cp311-macosx_10_9_universal2.whl', hash = 'sha256:f296d637a50bb15fb6a229fbb0eb053080e703b53dbfe55b1e4bb1c5ed25d325'},\n {file = 'aiohttp-3.11.14-cp311-cp311-macosx_10_9_x86_64.whl', hash = 'sha256:ec6cd1954ca2bbf0970f531a628da1b1338f594bf5da7e361e19ba163ecc4f3b'},\n {file = 'aiohttp-3.11.14-cp311-cp311-macosx_11_0_arm64.whl', hash = 'sha256:572def4aad0a4775af66d5a2b5923c7de0820ecaeeb7987dcbccda2a735a993f'},\n {file = 'aiohttp-3.11.14-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:1c68e41c4d576cd6aa6c6d2eddfb32b2acfb07ebfbb4f9da991da26633a3db1a'},\n {file = 'aiohttp-3.11.14-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:99b8bbfc8111826aa8363442c0fc1f5751456b008737ff053570f06a151650b3'},\n {file = 'aiohttp-3.11.14-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:4b0a200e85da5c966277a402736a96457b882360aa15416bf104ca81e6f5807b'},\n {file = 'aiohttp-3.11.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:d173c0ac508a2175f7c9a115a50db5fd3e35190d96fdd1a17f9cb10a6ab09aa1'},\n {file = 'aiohttp-3.11.14-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:413fe39fd929329f697f41ad67936f379cba06fcd4c462b62e5b0f8061ee4a77'},\n {file = 'aiohttp-3.11.14-cp311-cp311-musllinux_1_2_aarch64.whl', hash = 'sha256:65c75b14ee74e8eeff2886321e76188cbe938d18c85cff349d948430179ad02c'},\n {file = 'aiohttp-3.11.14-cp311-cp311-musllinux_1_2_armv7l.whl', hash = 'sha256:321238a42ed463848f06e291c4bbfb3d15ba5a79221a82c502da3e23d7525d06'},\n {file = 'aiohttp-3.11.14-cp311-cp311-musllinux_1_2_i686.whl', hash = 'sha256:59a05cdc636431f7ce843c7c2f04772437dd816a5289f16440b19441be6511f1'},\n {file = 'aiohttp-3.11.14-cp311-cp311-musllinux_1_2_ppc64le.whl', hash = 'sha256:daf20d9c3b12ae0fdf15ed92235e190f8284945563c4b8ad95b2d7a31f331cd3'},\n {file = 'aiohttp-3.11.14-cp311-cp311-musllinux_1_2_s390x.whl', hash = 'sha256:05582cb2d156ac7506e68b5eac83179faedad74522ed88f88e5861b78740dc0e'},\n {file = 'aiohttp-3.11.14-cp311-cp311-musllinux_1_2_x86_64.whl', hash = 'sha256:12c5869e7ddf6b4b1f2109702b3cd7515667b437da90a5a4a50ba1354fe41881'},\n {file = 'aiohttp-3.11.14-cp311-cp311-win32.whl', hash = 'sha256:92868f6512714efd4a6d6cb2bfc4903b997b36b97baea85f744229f18d12755e'},\n {file = 'aiohttp-3.11.14-cp311-cp311-win_amd64.whl', hash = 'sha256:bccd2cb7aa5a3bfada72681bdb91637094d81639e116eac368f8b3874620a654'},\n {file = 'aiohttp-3.11.14-cp312-cp312-macosx_10_13_universal2.whl', hash = 'sha256:70ab0f61c1a73d3e0342cedd9a7321425c27a7067bebeeacd509f96695b875fc'},\n {file = 'aiohttp-3.11.14-cp312-cp312-macosx_10_13_x86_64.whl', hash = 'sha256:602d4db80daf4497de93cb1ce00b8fc79969c0a7cf5b67bec96fa939268d806a'},\n {file = 'aiohttp-3.11.14-cp312-cp312-macosx_11_0_arm64.whl', hash = 'sha256:3a8a0d127c10b8d89e69bbd3430da0f73946d839e65fec00ae48ca7916a31948'},\n {file = 'aiohttp-3.11.14-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:ca9f835cdfedcb3f5947304e85b8ca3ace31eef6346d8027a97f4de5fb687534'},\n {file = 'aiohttp-3.11.14-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:8aa5c68e1e68fff7cd3142288101deb4316b51f03d50c92de6ea5ce646e6c71f'},\n {file = 'aiohttp-3.11.14-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:3b512f1de1c688f88dbe1b8bb1283f7fbeb7a2b2b26e743bb2193cbadfa6f307'},\n {file = 'aiohttp-3.11.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:cc9253069158d57e27d47a8453d8a2c5a370dc461374111b5184cf2f147a3cc3'},\n {file = 'aiohttp-3.11.14-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:0b2501f1b981e70932b4a552fc9b3c942991c7ae429ea117e8fba57718cdeed0'},\n {file = 'aiohttp-3.11.14-cp312-cp312-musllinux_1_2_aarch64.whl', hash = 'sha256:28a3d083819741592685762d51d789e6155411277050d08066537c5edc4066e6'},\n {file = 'aiohttp-3.11.14-cp312-cp312-musllinux_1_2_armv7l.whl', hash = 'sha256:0df3788187559c262922846087e36228b75987f3ae31dd0a1e5ee1034090d42f'},\n {file = 'aiohttp-3.11.14-cp312-cp312-musllinux_1_2_i686.whl', hash = 'sha256:9e73fa341d8b308bb799cf0ab6f55fc0461d27a9fa3e4582755a3d81a6af8c09'},\n {file = 'aiohttp-3.11.14-cp312-cp312-musllinux_1_2_ppc64le.whl', hash = 'sha256:51ba80d473eb780a329d73ac8afa44aa71dfb521693ccea1dea8b9b5c4df45ce'},\n {file = 'aiohttp-3.11.14-cp312-cp312-musllinux_1_2_s390x.whl', hash = 'sha256:8d1dd75aa4d855c7debaf1ef830ff2dfcc33f893c7db0af2423ee761ebffd22b'},\n {file = 'aiohttp-3.11.14-cp312-cp312-musllinux_1_2_x86_64.whl', hash = 'sha256:41cf0cefd9e7b5c646c2ef529c8335e7eafd326f444cc1cdb0c47b6bc836f9be'},\n {file = 'aiohttp-3.11.14-cp312-cp312-win32.whl', hash = 'sha256:948abc8952aff63de7b2c83bfe3f211c727da3a33c3a5866a0e2cf1ee1aa950f'},\n {file = 'aiohttp-3.11.14-cp312-cp312-win_amd64.whl', hash = 'sha256:3b420d076a46f41ea48e5fcccb996f517af0d406267e31e6716f480a3d50d65c'},\n {file = 'aiohttp-3.11.14-cp313-cp313-macosx_10_13_universal2.whl', hash = 'sha256:8d14e274828561db91e4178f0057a915f3af1757b94c2ca283cb34cbb6e00b50'},\n {file = 'aiohttp-3.11.14-cp313-cp313-macosx_10_13_x86_64.whl', hash = 'sha256:f30fc72daf85486cdcdfc3f5e0aea9255493ef499e31582b34abadbfaafb0965'},\n {file = 'aiohttp-3.11.14-cp313-cp313-macosx_11_0_arm64.whl', hash = 'sha256:4edcbe34e6dba0136e4cabf7568f5a434d89cc9de5d5155371acda275353d228'},\n {file = 'aiohttp-3.11.14-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:1a7169ded15505f55a87f8f0812c94c9412623c744227b9e51083a72a48b68a5'},\n {file = 'aiohttp-3.11.14-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:ad1f2fb9fe9b585ea4b436d6e998e71b50d2b087b694ab277b30e060c434e5db'},\n {file = 'aiohttp-3.11.14-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:20412c7cc3720e47a47e63c0005f78c0c2370020f9f4770d7fc0075f397a9fb0'},\n {file = 'aiohttp-3.11.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:6dd9766da617855f7e85f27d2bf9a565ace04ba7c387323cd3e651ac4329db91'},\n {file = 'aiohttp-3.11.14-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:599b66582f7276ebefbaa38adf37585e636b6a7a73382eb412f7bc0fc55fb73d'},\n {file = 'aiohttp-3.11.14-cp313-cp313-musllinux_1_2_aarch64.whl', hash = 'sha256:b41693b7388324b80f9acfabd479bd1c84f0bc7e8f17bab4ecd9675e9ff9c734'},\n {file = 'aiohttp-3.11.14-cp313-cp313-musllinux_1_2_armv7l.whl', hash = 'sha256:86135c32d06927339c8c5e64f96e4eee8825d928374b9b71a3c42379d7437058'},\n {file = 'aiohttp-3.11.14-cp313-cp313-musllinux_1_2_i686.whl', hash = 'sha256:04eb541ce1e03edc1e3be1917a0f45ac703e913c21a940111df73a2c2db11d73'},\n {file = 'aiohttp-3.11.14-cp313-cp313-musllinux_1_2_ppc64le.whl', hash = 'sha256:dc311634f6f28661a76cbc1c28ecf3b3a70a8edd67b69288ab7ca91058eb5a33'},\n {file = 'aiohttp-3.11.14-cp313-cp313-musllinux_1_2_s390x.whl', hash = 'sha256:69bb252bfdca385ccabfd55f4cd740d421dd8c8ad438ded9637d81c228d0da49'},\n {file = 'aiohttp-3.11.14-cp313-cp313-musllinux_1_2_x86_64.whl', hash = 'sha256:2b86efe23684b58a88e530c4ab5b20145f102916bbb2d82942cafec7bd36a647'},\n {file = 'aiohttp-3.11.14-cp313-cp313-win32.whl', hash = 'sha256:b9c60d1de973ca94af02053d9b5111c4fbf97158e139b14f1be68337be267be6'},\n {file = 'aiohttp-3.11.14-cp313-cp313-win_amd64.whl', hash = 'sha256:0a29be28e60e5610d2437b5b2fed61d6f3dcde898b57fb048aa5079271e7f6f3'},\n {file = 'aiohttp-3.11.14-cp39-cp39-macosx_10_9_universal2.whl', hash = 'sha256:14fc03508359334edc76d35b2821832f092c8f092e4b356e74e38419dfe7b6de'},\n {file = 'aiohttp-3.11.14-cp39-cp39-macosx_10_9_x86_64.whl', hash = 'sha256:92007c89a8cb7be35befa2732b0b32bf3a394c1b22ef2dff0ef12537d98a7bda'},\n {file = 'aiohttp-3.11.14-cp39-cp39-macosx_11_0_arm64.whl', hash = 'sha256:6d3986112e34eaa36e280dc8286b9dd4cc1a5bcf328a7f147453e188f6fe148f'},\n {file = 'aiohttp-3.11.14-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:749f1eb10e51dbbcdba9df2ef457ec060554842eea4d23874a3e26495f9e87b1'},\n {file = 'aiohttp-3.11.14-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:781c8bd423dcc4641298c8c5a2a125c8b1c31e11f828e8d35c1d3a722af4c15a'},\n {file = 'aiohttp-3.11.14-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:997b57e38aa7dc6caab843c5e042ab557bc83a2f91b7bd302e3c3aebbb9042a1'},\n {file = 'aiohttp-3.11.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:3a8b0321e40a833e381d127be993b7349d1564b756910b28b5f6588a159afef3'},\n {file = 'aiohttp-3.11.14-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:8778620396e554b758b59773ab29c03b55047841d8894c5e335f12bfc45ebd28'},\n {file = 'aiohttp-3.11.14-cp39-cp39-musllinux_1_2_aarch64.whl', hash = 'sha256:e906da0f2bcbf9b26cc2b144929e88cb3bf943dd1942b4e5af066056875c7618'},\n {file = 'aiohttp-3.11.14-cp39-cp39-musllinux_1_2_armv7l.whl', hash = 'sha256:87f0e003fb4dd5810c7fbf47a1239eaa34cd929ef160e0a54c570883125c4831'},\n {file = 'aiohttp-3.11.14-cp39-cp39-musllinux_1_2_i686.whl', hash = 'sha256:7f2dadece8b85596ac3ab1ec04b00694bdd62abc31e5618f524648d18d9dd7fa'},\n {file = 'aiohttp-3.11.14-cp39-cp39-musllinux_1_2_ppc64le.whl', hash = 'sha256:fe846f0a98aa9913c2852b630cd39b4098f296e0907dd05f6c7b30d911afa4c3'},\n {file = 'aiohttp-3.11.14-cp39-cp39-musllinux_1_2_s390x.whl', hash = 'sha256:ced66c5c6ad5bcaf9be54560398654779ec1c3695f1a9cf0ae5e3606694a000a'},\n {file = 'aiohttp-3.11.14-cp39-cp39-musllinux_1_2_x86_64.whl', hash = 'sha256:a40087b82f83bd671cbeb5f582c233d196e9653220404a798798bfc0ee189fff'},\n {file = 'aiohttp-3.11.14-cp39-cp39-win32.whl', hash = 'sha256:95d7787f2bcbf7cb46823036a8d64ccfbc2ffc7d52016b4044d901abceeba3db'},\n {file = 'aiohttp-3.11.14-cp39-cp39-win_amd64.whl', hash = 'sha256:22a8107896877212130c58f74e64b77f7007cb03cea8698be317272643602d45'},\n {file = 'aiohttp-3.11.14.tar.gz', hash = 'sha256:d6edc538c7480fa0a3b2bdd705f8010062d74700198da55d16498e1b49549b9c'},\n]\n\n[package.dependencies]\naiohappyeyeballs = '>=2.3.0'\naiosignal = '>=1.1.2'\nasync-timeout = {version = '>=4.0,<6.0', markers = 'python_version < \\'3.11\\''}\nattrs = '>=17.3.0'\nfrozenlist = '>=1.1.1'\nmultidict = '>=4.5,<7.0'\npropcache = '>=0.2.0'\nyarl = '>=1.17.0,<2.0'\n\n[package.extras]\nspeedups = ['Brotli', 'aiodns (>=3.2.0)', 'brotlicffi']\n\n[[package]]\nname = 'aiohttp-retry'\nversion = '2.9.1'\ndescription = 'Simple retry client for aiohttp'\noptional = false\npython-versions = '>=3.7'\ngroups = ['main']\nfiles = [\n {file = 'aiohttp_retry-2.9.1-py3-none-any.whl', hash = 'sha256:66d2759d1921838256a05a3f80ad7e724936f083e35be5abb5e16eed6be6dc54'},\n {file = 'aiohttp_retry-2.9.1.tar.gz', hash = 'sha256:8eb75e904ed4ee5c2ec242fefe85bf04240f685391c4879d8f541d6028ff01f1'},\n]\n\n[package.dependencies]\naiohttp = '*'\n\n[[package]]\nname = 'aiosignal'\nversion = '1.3.2'\ndescription = 'aiosignal: a list of registered asynchronous callbacks'\noptional = false\npython-versions = '>=3.9'\ngroups = ['main']\nfiles = [\n {file = 'aiosignal-1.3.2-py2.py3-none-any.whl', hash = 'sha256:45cde58e409a301715980c2b01d0c28bdde3770d8290b5eb2173759d9acb31a5'},\n {file = 'aiosignal-1.3.2.tar.gz', hash = 'sha256:a8c255c66fafb1e499c9351d0bf32ff2d8a0321595ebac3b93713656d2436f54'},\n]\n\n[package.dependencies]\nfrozenlist = '>=1.1.0'\n\n[[package]]\nname = 'aiostream'\nversion = '0.5.2'\ndescription = 'Generator-based operators for asynchronous iteration'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'aiostream-0.5.2-py3-none-any.whl', hash = 'sha256:054660370be9d37f6fe3ece3851009240416bd082e469fd90cc8673d3818cf71'},\n {file = 'aiostream-0.5.2.tar.gz', hash = 'sha256:b71b519a2d66c38f0872403ab86417955b77352f08d9ad02ad46fc3926b389f4'},\n]\n\n[package.dependencies]\ntyping-extensions = '*'\n\n[[package]]\nname = 'annotated-types'\nversion = '0.7.0'\ndescription = 'Reusable constraint types to use with typing.Annotated'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'annotated_types-0.7.0-py3-none-any.whl', hash = 'sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53'},\n {file = 'annotated_types-0.7.0.tar.gz', hash = 'sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89'},\n]\n\n[[package]]\nname = 'async-timeout'\nversion = '5.0.1'\ndescription = 'Timeout context manager for asyncio programs'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nmarkers = 'python_version < \\'3.11\\''\nfiles = [\n {file = 'async_timeout-5.0.1-py3-none-any.whl', hash = 'sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c'},\n {file = 'async_timeout-5.0.1.tar.gz', hash = 'sha256:d9321a7a3d5a6a5e187e824d2fa0793ce379a202935782d555d6e9d2735677d3'},\n]\n\n[[package]]\nname = 'attrs'\nversion = '25.3.0'\ndescription = 'Classes Without Boilerplate'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'attrs-25.3.0-py3-none-any.whl', hash = 'sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3'},\n {file = 'attrs-25.3.0.tar.gz', hash = 'sha256:75d7cefc7fb576747b2c81b4442d4d4a1ce0900973527c011d1030fd3bf4af1b'},\n]\n\n[package.extras]\nbenchmark = ['cloudpickle', 'hypothesis', 'mypy (>=1.11.1)', 'pympler', 'pytest (>=4.3.0)', 'pytest-codspeed', 'pytest-mypy-plugins', 'pytest-xdist[psutil]']\ncov = ['cloudpickle', 'coverage[toml] (>=5.3)', 'hypothesis', 'mypy (>=1.11.1)', 'pympler', 'pytest (>=4.3.0)', 'pytest-mypy-plugins', 'pytest-xdist[psutil]']\ndev = ['cloudpickle', 'hypothesis', 'mypy (>=1.11.1)', 'pre-commit-uv', 'pympler', 'pytest (>=4.3.0)', 'pytest-mypy-plugins', 'pytest-xdist[psutil]']\ndocs = ['cogapp', 'furo', 'myst-parser', 'sphinx', 'sphinx-notfound-page', 'sphinxcontrib-towncrier', 'towncrier']\ntests = ['cloudpickle', 'hypothesis', 'mypy (>=1.11.1)', 'pympler', 'pytest (>=4.3.0)', 'pytest-mypy-plugins', 'pytest-xdist[psutil]']\ntests-mypy = ['mypy (>=1.11.1)', 'pytest-mypy-plugins']\n\n[[package]]\nname = 'cel-python'\nversion = '0.2.0'\ndescription = 'Pure Python implementation of Google Common Expression Language'\noptional = false\npython-versions = '<4.0,>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'cel_python-0.2.0-py3-none-any.whl', hash = 'sha256:478ff73def7b39d51e6982f95d937a57c2b088c491c578fe5cecdbd79f476f60'},\n {file = 'cel_python-0.2.0.tar.gz', hash = 'sha256:75de72a5cf223ec690b236f0cc24da267219e667bd3e7f8f4f20595fcc1c0c0f'},\n]\n\n[package.dependencies]\njmespath = '>=1.0.1,<2.0.0'\nlark = '>=0.12.0,<0.13.0'\npython-dateutil = '>=2.9.0.post0,<3.0.0'\npyyaml = '>=6.0.1,<7.0.0'\ntypes-python-dateutil = '>=2.9.0.20240316,<3.0.0.0'\ntypes-pyyaml = '>=6.0.12.20240311,<7.0.0.0'\n\n[[package]]\nname = 'frozenlist'\nversion = '1.5.0'\ndescription = 'A list-like structure which implements collections.abc.MutableSequence'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'frozenlist-1.5.0-cp310-cp310-macosx_10_9_universal2.whl', hash = 'sha256:5b6a66c18b5b9dd261ca98dffcb826a525334b2f29e7caa54e182255c5f6a65a'},\n {file = 'frozenlist-1.5.0-cp310-cp310-macosx_10_9_x86_64.whl', hash = 'sha256:d1b3eb7b05ea246510b43a7e53ed1653e55c2121019a97e60cad7efb881a97bb'},\n {file = 'frozenlist-1.5.0-cp310-cp310-macosx_11_0_arm64.whl', hash = 'sha256:15538c0cbf0e4fa11d1e3a71f823524b0c46299aed6e10ebb4c2089abd8c3bec'},\n {file = 'frozenlist-1.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:e79225373c317ff1e35f210dd5f1344ff31066ba8067c307ab60254cd3a78ad5'},\n {file = 'frozenlist-1.5.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:9272fa73ca71266702c4c3e2d4a28553ea03418e591e377a03b8e3659d94fa76'},\n {file = 'frozenlist-1.5.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:498524025a5b8ba81695761d78c8dd7382ac0b052f34e66939c42df860b8ff17'},\n {file = 'frozenlist-1.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:92b5278ed9d50fe610185ecd23c55d8b307d75ca18e94c0e7de328089ac5dcba'},\n {file = 'frozenlist-1.5.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:7f3c8c1dacd037df16e85227bac13cca58c30da836c6f936ba1df0c05d046d8d'},\n {file = 'frozenlist-1.5.0-cp310-cp310-musllinux_1_2_aarch64.whl', hash = 'sha256:f2ac49a9bedb996086057b75bf93538240538c6d9b38e57c82d51f75a73409d2'},\n {file = 'frozenlist-1.5.0-cp310-cp310-musllinux_1_2_i686.whl', hash = 'sha256:e66cc454f97053b79c2ab09c17fbe3c825ea6b4de20baf1be28919460dd7877f'},\n {file = 'frozenlist-1.5.0-cp310-cp310-musllinux_1_2_ppc64le.whl', hash = 'sha256:5a3ba5f9a0dfed20337d3e966dc359784c9f96503674c2faf015f7fe8e96798c'},\n {file = 'frozenlist-1.5.0-cp310-cp310-musllinux_1_2_s390x.whl', hash = 'sha256:6321899477db90bdeb9299ac3627a6a53c7399c8cd58d25da094007402b039ab'},\n {file = 'frozenlist-1.5.0-cp310-cp310-musllinux_1_2_x86_64.whl', hash = 'sha256:76e4753701248476e6286f2ef492af900ea67d9706a0155335a40ea21bf3b2f5'},\n {file = 'frozenlist-1.5.0-cp310-cp310-win32.whl', hash = 'sha256:977701c081c0241d0955c9586ffdd9ce44f7a7795df39b9151cd9a6fd0ce4cfb'},\n {file = 'frozenlist-1.5.0-cp310-cp310-win_amd64.whl', hash = 'sha256:189f03b53e64144f90990d29a27ec4f7997d91ed3d01b51fa39d2dbe77540fd4'},\n {file = 'frozenlist-1.5.0-cp311-cp311-macosx_10_9_universal2.whl', hash = 'sha256:fd74520371c3c4175142d02a976aee0b4cb4a7cc912a60586ffd8d5929979b30'},\n {file = 'frozenlist-1.5.0-cp311-cp311-macosx_10_9_x86_64.whl', hash = 'sha256:2f3f7a0fbc219fb4455264cae4d9f01ad41ae6ee8524500f381de64ffaa077d5'},\n {file = 'frozenlist-1.5.0-cp311-cp311-macosx_11_0_arm64.whl', hash = 'sha256:f47c9c9028f55a04ac254346e92977bf0f166c483c74b4232bee19a6697e4778'},\n {file = 'frozenlist-1.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:0996c66760924da6e88922756d99b47512a71cfd45215f3570bf1e0b694c206a'},\n {file = 'frozenlist-1.5.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:a2fe128eb4edeabe11896cb6af88fca5346059f6c8d807e3b910069f39157869'},\n {file = 'frozenlist-1.5.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:1a8ea951bbb6cacd492e3948b8da8c502a3f814f5d20935aae74b5df2b19cf3d'},\n {file = 'frozenlist-1.5.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:de537c11e4aa01d37db0d403b57bd6f0546e71a82347a97c6a9f0dcc532b3a45'},\n {file = 'frozenlist-1.5.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:9c2623347b933fcb9095841f1cc5d4ff0b278addd743e0e966cb3d460278840d'},\n {file = 'frozenlist-1.5.0-cp311-cp311-musllinux_1_2_aarch64.whl', hash = 'sha256:cee6798eaf8b1416ef6909b06f7dc04b60755206bddc599f52232606e18179d3'},\n {file = 'frozenlist-1.5.0-cp311-cp311-musllinux_1_2_i686.whl', hash = 'sha256:f5f9da7f5dbc00a604fe74aa02ae7c98bcede8a3b8b9666f9f86fc13993bc71a'},\n {file = 'frozenlist-1.5.0-cp311-cp311-musllinux_1_2_ppc64le.whl', hash = 'sha256:90646abbc7a5d5c7c19461d2e3eeb76eb0b204919e6ece342feb6032c9325ae9'},\n {file = 'frozenlist-1.5.0-cp311-cp311-musllinux_1_2_s390x.whl', hash = 'sha256:bdac3c7d9b705d253b2ce370fde941836a5f8b3c5c2b8fd70940a3ea3af7f4f2'},\n {file = 'frozenlist-1.5.0-cp311-cp311-musllinux_1_2_x86_64.whl', hash = 'sha256:03d33c2ddbc1816237a67f66336616416e2bbb6beb306e5f890f2eb22b959cdf'},\n {file = 'frozenlist-1.5.0-cp311-cp311-win32.whl', hash = 'sha256:237f6b23ee0f44066219dae14c70ae38a63f0440ce6750f868ee08775073f942'},\n {file = 'frozenlist-1.5.0-cp311-cp311-win_amd64.whl', hash = 'sha256:0cc974cc93d32c42e7b0f6cf242a6bd941c57c61b618e78b6c0a96cb72788c1d'},\n {file = 'frozenlist-1.5.0-cp312-cp312-macosx_10_13_universal2.whl', hash = 'sha256:31115ba75889723431aa9a4e77d5f398f5cf976eea3bdf61749731f62d4a4a21'},\n {file = 'frozenlist-1.5.0-cp312-cp312-macosx_10_13_x86_64.whl', hash = 'sha256:7437601c4d89d070eac8323f121fcf25f88674627505334654fd027b091db09d'},\n {file = 'frozenlist-1.5.0-cp312-cp312-macosx_11_0_arm64.whl', hash = 'sha256:7948140d9f8ece1745be806f2bfdf390127cf1a763b925c4a805c603df5e697e'},\n {file = 'frozenlist-1.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:feeb64bc9bcc6b45c6311c9e9b99406660a9c05ca8a5b30d14a78555088b0b3a'},\n {file = 'frozenlist-1.5.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:683173d371daad49cffb8309779e886e59c2f369430ad28fe715f66d08d4ab1a'},\n {file = 'frozenlist-1.5.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:7d57d8f702221405a9d9b40f9da8ac2e4a1a8b5285aac6100f3393675f0a85ee'},\n {file = 'frozenlist-1.5.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:30c72000fbcc35b129cb09956836c7d7abf78ab5416595e4857d1cae8d6251a6'},\n {file = 'frozenlist-1.5.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:000a77d6034fbad9b6bb880f7ec073027908f1b40254b5d6f26210d2dab1240e'},\n {file = 'frozenlist-1.5.0-cp312-cp312-musllinux_1_2_aarch64.whl', hash = 'sha256:5d7f5a50342475962eb18b740f3beecc685a15b52c91f7d975257e13e029eca9'},\n {file = 'frozenlist-1.5.0-cp312-cp312-musllinux_1_2_i686.whl', hash = 'sha256:87f724d055eb4785d9be84e9ebf0f24e392ddfad00b3fe036e43f489fafc9039'},\n {file = 'frozenlist-1.5.0-cp312-cp312-musllinux_1_2_ppc64le.whl', hash = 'sha256:6e9080bb2fb195a046e5177f10d9d82b8a204c0736a97a153c2466127de87784'},\n {file = 'frozenlist-1.5.0-cp312-cp312-musllinux_1_2_s390x.whl', hash = 'sha256:9b93d7aaa36c966fa42efcaf716e6b3900438632a626fb09c049f6a2f09fc631'},\n {file = 'frozenlist-1.5.0-cp312-cp312-musllinux_1_2_x86_64.whl', hash = 'sha256:52ef692a4bc60a6dd57f507429636c2af8b6046db8b31b18dac02cbc8f507f7f'},\n {file = 'frozenlist-1.5.0-cp312-cp312-win32.whl', hash = 'sha256:29d94c256679247b33a3dc96cce0f93cbc69c23bf75ff715919332fdbb6a32b8'},\n {file = 'frozenlist-1.5.0-cp312-cp312-win_amd64.whl', hash = 'sha256:8969190d709e7c48ea386db202d708eb94bdb29207a1f269bab1196ce0dcca1f'},\n {file = 'frozenlist-1.5.0-cp313-cp313-macosx_10_13_universal2.whl', hash = 'sha256:7a1a048f9215c90973402e26c01d1cff8a209e1f1b53f72b95c13db61b00f953'},\n {file = 'frozenlist-1.5.0-cp313-cp313-macosx_10_13_x86_64.whl', hash = 'sha256:dd47a5181ce5fcb463b5d9e17ecfdb02b678cca31280639255ce9d0e5aa67af0'},\n {file = 'frozenlist-1.5.0-cp313-cp313-macosx_11_0_arm64.whl', hash = 'sha256:1431d60b36d15cda188ea222033eec8e0eab488f39a272461f2e6d9e1a8e63c2'},\n {file = 'frozenlist-1.5.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:6482a5851f5d72767fbd0e507e80737f9c8646ae7fd303def99bfe813f76cf7f'},\n {file = 'frozenlist-1.5.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:44c49271a937625619e862baacbd037a7ef86dd1ee215afc298a417ff3270608'},\n {file = 'frozenlist-1.5.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:12f78f98c2f1c2429d42e6a485f433722b0061d5c0b0139efa64f396efb5886b'},\n {file = 'frozenlist-1.5.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:ce3aa154c452d2467487765e3adc730a8c153af77ad84096bc19ce19a2400840'},\n {file = 'frozenlist-1.5.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:9b7dc0c4338e6b8b091e8faf0db3168a37101943e687f373dce00959583f7439'},\n {file = 'frozenlist-1.5.0-cp313-cp313-musllinux_1_2_aarch64.whl', hash = 'sha256:45e0896250900b5aa25180f9aec243e84e92ac84bd4a74d9ad4138ef3f5c97de'},\n {file = 'frozenlist-1.5.0-cp313-cp313-musllinux_1_2_i686.whl', hash = 'sha256:561eb1c9579d495fddb6da8959fd2a1fca2c6d060d4113f5844b433fc02f2641'},\n {file = 'frozenlist-1.5.0-cp313-cp313-musllinux_1_2_ppc64le.whl', hash = 'sha256:df6e2f325bfee1f49f81aaac97d2aa757c7646534a06f8f577ce184afe2f0a9e'},\n {file = 'frozenlist-1.5.0-cp313-cp313-musllinux_1_2_s390x.whl', hash = 'sha256:140228863501b44b809fb39ec56b5d4071f4d0aa6d216c19cbb08b8c5a7eadb9'},\n {file = 'frozenlist-1.5.0-cp313-cp313-musllinux_1_2_x86_64.whl', hash = 'sha256:7707a25d6a77f5d27ea7dc7d1fc608aa0a478193823f88511ef5e6b8a48f9d03'},\n {file = 'frozenlist-1.5.0-cp313-cp313-win32.whl', hash = 'sha256:31a9ac2b38ab9b5a8933b693db4939764ad3f299fcaa931a3e605bc3460e693c'},\n {file = 'frozenlist-1.5.0-cp313-cp313-win_amd64.whl', hash = 'sha256:11aabdd62b8b9c4b84081a3c246506d1cddd2dd93ff0ad53ede5defec7886b28'},\n {file = 'frozenlist-1.5.0-cp38-cp38-macosx_10_9_universal2.whl', hash = 'sha256:dd94994fc91a6177bfaafd7d9fd951bc8689b0a98168aa26b5f543868548d3ca'},\n {file = 'frozenlist-1.5.0-cp38-cp38-macosx_10_9_x86_64.whl', hash = 'sha256:2d0da8bbec082bf6bf18345b180958775363588678f64998c2b7609e34719b10'},\n {file = 'frozenlist-1.5.0-cp38-cp38-macosx_11_0_arm64.whl', hash = 'sha256:73f2e31ea8dd7df61a359b731716018c2be196e5bb3b74ddba107f694fbd7604'},\n {file = 'frozenlist-1.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:828afae9f17e6de596825cf4228ff28fbdf6065974e5ac1410cecc22f699d2b3'},\n {file = 'frozenlist-1.5.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:f1577515d35ed5649d52ab4319db757bb881ce3b2b796d7283e6634d99ace307'},\n {file = 'frozenlist-1.5.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:2150cc6305a2c2ab33299453e2968611dacb970d2283a14955923062c8d00b10'},\n {file = 'frozenlist-1.5.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:a72b7a6e3cd2725eff67cd64c8f13335ee18fc3c7befc05aed043d24c7b9ccb9'},\n {file = 'frozenlist-1.5.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:c16d2fa63e0800723139137d667e1056bee1a1cf7965153d2d104b62855e9b99'},\n {file = 'frozenlist-1.5.0-cp38-cp38-musllinux_1_2_aarch64.whl', hash = 'sha256:17dcc32fc7bda7ce5875435003220a457bcfa34ab7924a49a1c19f55b6ee185c'},\n {file = 'frozenlist-1.5.0-cp38-cp38-musllinux_1_2_i686.whl', hash = 'sha256:97160e245ea33d8609cd2b8fd997c850b56db147a304a262abc2b3be021a9171'},\n {file = 'frozenlist-1.5.0-cp38-cp38-musllinux_1_2_ppc64le.whl', hash = 'sha256:f1e6540b7fa044eee0bb5111ada694cf3dc15f2b0347ca125ee9ca984d5e9e6e'},\n {file = 'frozenlist-1.5.0-cp38-cp38-musllinux_1_2_s390x.whl', hash = 'sha256:91d6c171862df0a6c61479d9724f22efb6109111017c87567cfeb7b5d1449fdf'},\n {file = 'frozenlist-1.5.0-cp38-cp38-musllinux_1_2_x86_64.whl', hash = 'sha256:c1fac3e2ace2eb1052e9f7c7db480818371134410e1f5c55d65e8f3ac6d1407e'},\n {file = 'frozenlist-1.5.0-cp38-cp38-win32.whl', hash = 'sha256:b97f7b575ab4a8af9b7bc1d2ef7f29d3afee2226bd03ca3875c16451ad5a7723'},\n {file = 'frozenlist-1.5.0-cp38-cp38-win_amd64.whl', hash = 'sha256:374ca2dabdccad8e2a76d40b1d037f5bd16824933bf7bcea3e59c891fd4a0923'},\n {file = 'frozenlist-1.5.0-cp39-cp39-macosx_10_9_universal2.whl', hash = 'sha256:9bbcdfaf4af7ce002694a4e10a0159d5a8d20056a12b05b45cea944a4953f972'},\n {file = 'frozenlist-1.5.0-cp39-cp39-macosx_10_9_x86_64.whl', hash = 'sha256:1893f948bf6681733aaccf36c5232c231e3b5166d607c5fa77773611df6dc336'},\n {file = 'frozenlist-1.5.0-cp39-cp39-macosx_11_0_arm64.whl', hash = 'sha256:2b5e23253bb709ef57a8e95e6ae48daa9ac5f265637529e4ce6b003a37b2621f'},\n {file = 'frozenlist-1.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:0f253985bb515ecd89629db13cb58d702035ecd8cfbca7d7a7e29a0e6d39af5f'},\n {file = 'frozenlist-1.5.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:04a5c6babd5e8fb7d3c871dc8b321166b80e41b637c31a995ed844a6139942b6'},\n {file = 'frozenlist-1.5.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:a9fe0f1c29ba24ba6ff6abf688cb0b7cf1efab6b6aa6adc55441773c252f7411'},\n {file = 'frozenlist-1.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:226d72559fa19babe2ccd920273e767c96a49b9d3d38badd7c91a0fdeda8ea08'},\n {file = 'frozenlist-1.5.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:15b731db116ab3aedec558573c1a5eec78822b32292fe4f2f0345b7f697745c2'},\n {file = 'frozenlist-1.5.0-cp39-cp39-musllinux_1_2_aarch64.whl', hash = 'sha256:366d8f93e3edfe5a918c874702f78faac300209a4d5bf38352b2c1bdc07a766d'},\n {file = 'frozenlist-1.5.0-cp39-cp39-musllinux_1_2_i686.whl', hash = 'sha256:1b96af8c582b94d381a1c1f51ffaedeb77c821c690ea5f01da3d70a487dd0a9b'},\n {file = 'frozenlist-1.5.0-cp39-cp39-musllinux_1_2_ppc64le.whl', hash = 'sha256:c03eff4a41bd4e38415cbed054bbaff4a075b093e2394b6915dca34a40d1e38b'},\n {file = 'frozenlist-1.5.0-cp39-cp39-musllinux_1_2_s390x.whl', hash = 'sha256:50cf5e7ee9b98f22bdecbabf3800ae78ddcc26e4a435515fc72d97903e8488e0'},\n {file = 'frozenlist-1.5.0-cp39-cp39-musllinux_1_2_x86_64.whl', hash = 'sha256:1e76bfbc72353269c44e0bc2cfe171900fbf7f722ad74c9a7b638052afe6a00c'},\n {file = 'frozenlist-1.5.0-cp39-cp39-win32.whl', hash = 'sha256:666534d15ba8f0fda3f53969117383d5dc021266b3c1a42c9ec4855e4b58b9d3'},\n {file = 'frozenlist-1.5.0-cp39-cp39-win_amd64.whl', hash = 'sha256:5c28f4b5dbef8a0d8aad0d4de24d1e9e981728628afaf4ea0792f5d0939372f0'},\n {file = 'frozenlist-1.5.0-py3-none-any.whl', hash = 'sha256:d994863bba198a4a518b467bb971c56e1db3f180a25c6cf7bb1949c267f748c3'},\n {file = 'frozenlist-1.5.0.tar.gz', hash = 'sha256:81d5af29e61b9c8348e876d442253723928dce6433e0e76cd925cd83f1b4b817'},\n]\n\n[[package]]\nname = 'grpcio'\nversion = '1.71.0'\ndescription = 'HTTP/2-based RPC framework'\noptional = false\npython-versions = '>=3.9'\ngroups = ['main']\nfiles = [\n {file = 'grpcio-1.71.0-cp310-cp310-linux_armv7l.whl', hash = 'sha256:c200cb6f2393468142eb50ab19613229dcc7829b5ccee8b658a36005f6669fdd'},\n {file = 'grpcio-1.71.0-cp310-cp310-macosx_12_0_universal2.whl', hash = 'sha256:b2266862c5ad664a380fbbcdbdb8289d71464c42a8c29053820ee78ba0119e5d'},\n {file = 'grpcio-1.71.0-cp310-cp310-manylinux_2_17_aarch64.whl', hash = 'sha256:0ab8b2864396663a5b0b0d6d79495657ae85fa37dcb6498a2669d067c65c11ea'},\n {file = 'grpcio-1.71.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:c30f393f9d5ff00a71bb56de4aa75b8fe91b161aeb61d39528db6b768d7eac69'},\n {file = 'grpcio-1.71.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:f250ff44843d9a0615e350c77f890082102a0318d66a99540f54769c8766ab73'},\n {file = 'grpcio-1.71.0-cp310-cp310-musllinux_1_1_aarch64.whl', hash = 'sha256:e6d8de076528f7c43a2f576bc311799f89d795aa6c9b637377cc2b1616473804'},\n {file = 'grpcio-1.71.0-cp310-cp310-musllinux_1_1_i686.whl', hash = 'sha256:9b91879d6da1605811ebc60d21ab6a7e4bae6c35f6b63a061d61eb818c8168f6'},\n {file = 'grpcio-1.71.0-cp310-cp310-musllinux_1_1_x86_64.whl', hash = 'sha256:f71574afdf944e6652203cd1badcda195b2a27d9c83e6d88dc1ce3cfb73b31a5'},\n {file = 'grpcio-1.71.0-cp310-cp310-win32.whl', hash = 'sha256:8997d6785e93308f277884ee6899ba63baafa0dfb4729748200fcc537858a509'},\n {file = 'grpcio-1.71.0-cp310-cp310-win_amd64.whl', hash = 'sha256:7d6ac9481d9d0d129224f6d5934d5832c4b1cddb96b59e7eba8416868909786a'},\n {file = 'grpcio-1.71.0-cp311-cp311-linux_armv7l.whl', hash = 'sha256:d6aa986318c36508dc1d5001a3ff169a15b99b9f96ef5e98e13522c506b37eef'},\n {file = 'grpcio-1.71.0-cp311-cp311-macosx_10_14_universal2.whl', hash = 'sha256:d2c170247315f2d7e5798a22358e982ad6eeb68fa20cf7a820bb74c11f0736e7'},\n {file = 'grpcio-1.71.0-cp311-cp311-manylinux_2_17_aarch64.whl', hash = 'sha256:e6f83a583ed0a5b08c5bc7a3fe860bb3c2eac1f03f1f63e0bc2091325605d2b7'},\n {file = 'grpcio-1.71.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:4be74ddeeb92cc87190e0e376dbc8fc7736dbb6d3d454f2fa1f5be1dee26b9d7'},\n {file = 'grpcio-1.71.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:4dd0dfbe4d5eb1fcfec9490ca13f82b089a309dc3678e2edabc144051270a66e'},\n {file = 'grpcio-1.71.0-cp311-cp311-musllinux_1_1_aarch64.whl', hash = 'sha256:a2242d6950dc892afdf9e951ed7ff89473aaf744b7d5727ad56bdaace363722b'},\n {file = 'grpcio-1.71.0-cp311-cp311-musllinux_1_1_i686.whl', hash = 'sha256:0fa05ee31a20456b13ae49ad2e5d585265f71dd19fbd9ef983c28f926d45d0a7'},\n {file = 'grpcio-1.71.0-cp311-cp311-musllinux_1_1_x86_64.whl', hash = 'sha256:3d081e859fb1ebe176de33fc3adb26c7d46b8812f906042705346b314bde32c3'},\n {file = 'grpcio-1.71.0-cp311-cp311-win32.whl', hash = 'sha256:d6de81c9c00c8a23047136b11794b3584cdc1460ed7cbc10eada50614baa1444'},\n {file = 'grpcio-1.71.0-cp311-cp311-win_amd64.whl', hash = 'sha256:24e867651fc67717b6f896d5f0cac0ec863a8b5fb7d6441c2ab428f52c651c6b'},\n {file = 'grpcio-1.71.0-cp312-cp312-linux_armv7l.whl', hash = 'sha256:0ff35c8d807c1c7531d3002be03221ff9ae15712b53ab46e2a0b4bb271f38537'},\n {file = 'grpcio-1.71.0-cp312-cp312-macosx_10_14_universal2.whl', hash = 'sha256:b78a99cd1ece4be92ab7c07765a0b038194ded2e0a26fd654591ee136088d8d7'},\n {file = 'grpcio-1.71.0-cp312-cp312-manylinux_2_17_aarch64.whl', hash = 'sha256:dc1a1231ed23caac1de9f943d031f1bc38d0f69d2a3b243ea0d664fc1fbd7fec'},\n {file = 'grpcio-1.71.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:e6beeea5566092c5e3c4896c6d1d307fb46b1d4bdf3e70c8340b190a69198594'},\n {file = 'grpcio-1.71.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:d5170929109450a2c031cfe87d6716f2fae39695ad5335d9106ae88cc32dc84c'},\n {file = 'grpcio-1.71.0-cp312-cp312-musllinux_1_1_aarch64.whl', hash = 'sha256:5b08d03ace7aca7b2fadd4baf291139b4a5f058805a8327bfe9aece7253b6d67'},\n {file = 'grpcio-1.71.0-cp312-cp312-musllinux_1_1_i686.whl', hash = 'sha256:f903017db76bf9cc2b2d8bdd37bf04b505bbccad6be8a81e1542206875d0e9db'},\n {file = 'grpcio-1.71.0-cp312-cp312-musllinux_1_1_x86_64.whl', hash = 'sha256:469f42a0b410883185eab4689060a20488a1a0a00f8bbb3cbc1061197b4c5a79'},\n {file = 'grpcio-1.71.0-cp312-cp312-win32.whl', hash = 'sha256:ad9f30838550695b5eb302add33f21f7301b882937460dd24f24b3cc5a95067a'},\n {file = 'grpcio-1.71.0-cp312-cp312-win_amd64.whl', hash = 'sha256:652350609332de6dac4ece254e5d7e1ff834e203d6afb769601f286886f6f3a8'},\n {file = 'grpcio-1.71.0-cp313-cp313-linux_armv7l.whl', hash = 'sha256:cebc1b34ba40a312ab480ccdb396ff3c529377a2fce72c45a741f7215bfe8379'},\n {file = 'grpcio-1.71.0-cp313-cp313-macosx_10_14_universal2.whl', hash = 'sha256:85da336e3649a3d2171e82f696b5cad2c6231fdd5bad52616476235681bee5b3'},\n {file = 'grpcio-1.71.0-cp313-cp313-manylinux_2_17_aarch64.whl', hash = 'sha256:f9a412f55bb6e8f3bb000e020dbc1e709627dcb3a56f6431fa7076b4c1aab0db'},\n {file = 'grpcio-1.71.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:47be9584729534660416f6d2a3108aaeac1122f6b5bdbf9fd823e11fe6fbaa29'},\n {file = 'grpcio-1.71.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:7c9c80ac6091c916db81131d50926a93ab162a7e97e4428ffc186b6e80d6dda4'},\n {file = 'grpcio-1.71.0-cp313-cp313-musllinux_1_1_aarch64.whl', hash = 'sha256:789d5e2a3a15419374b7b45cd680b1e83bbc1e52b9086e49308e2c0b5bbae6e3'},\n {file = 'grpcio-1.71.0-cp313-cp313-musllinux_1_1_i686.whl', hash = 'sha256:1be857615e26a86d7363e8a163fade914595c81fec962b3d514a4b1e8760467b'},\n {file = 'grpcio-1.71.0-cp313-cp313-musllinux_1_1_x86_64.whl', hash = 'sha256:a76d39b5fafd79ed604c4be0a869ec3581a172a707e2a8d7a4858cb05a5a7637'},\n {file = 'grpcio-1.71.0-cp313-cp313-win32.whl', hash = 'sha256:74258dce215cb1995083daa17b379a1a5a87d275387b7ffe137f1d5131e2cfbb'},\n {file = 'grpcio-1.71.0-cp313-cp313-win_amd64.whl', hash = 'sha256:22c3bc8d488c039a199f7a003a38cb7635db6656fa96437a8accde8322ce2366'},\n {file = 'grpcio-1.71.0-cp39-cp39-linux_armv7l.whl', hash = 'sha256:c6a0a28450c16809f94e0b5bfe52cabff63e7e4b97b44123ebf77f448534d07d'},\n {file = 'grpcio-1.71.0-cp39-cp39-macosx_10_14_universal2.whl', hash = 'sha256:a371e6b6a5379d3692cc4ea1cb92754d2a47bdddeee755d3203d1f84ae08e03e'},\n {file = 'grpcio-1.71.0-cp39-cp39-manylinux_2_17_aarch64.whl', hash = 'sha256:39983a9245d37394fd59de71e88c4b295eb510a3555e0a847d9965088cdbd033'},\n {file = 'grpcio-1.71.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:9182e0063112e55e74ee7584769ec5a0b4f18252c35787f48738627e23a62b97'},\n {file = 'grpcio-1.71.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:693bc706c031aeb848849b9d1c6b63ae6bcc64057984bb91a542332b75aa4c3d'},\n {file = 'grpcio-1.71.0-cp39-cp39-musllinux_1_1_aarch64.whl', hash = 'sha256:20e8f653abd5ec606be69540f57289274c9ca503ed38388481e98fa396ed0b41'},\n {file = 'grpcio-1.71.0-cp39-cp39-musllinux_1_1_i686.whl', hash = 'sha256:8700a2a57771cc43ea295296330daaddc0d93c088f0a35cc969292b6db959bf3'},\n {file = 'grpcio-1.71.0-cp39-cp39-musllinux_1_1_x86_64.whl', hash = 'sha256:d35a95f05a8a2cbe8e02be137740138b3b2ea5f80bd004444e4f9a1ffc511e32'},\n {file = 'grpcio-1.71.0-cp39-cp39-win32.whl', hash = 'sha256:f9c30c464cb2ddfbc2ddf9400287701270fdc0f14be5f08a1e3939f1e749b455'},\n {file = 'grpcio-1.71.0-cp39-cp39-win_amd64.whl', hash = 'sha256:63e41b91032f298b3e973b3fa4093cbbc620c875e2da7b93e249d4728b54559a'},\n {file = 'grpcio-1.71.0.tar.gz', hash = 'sha256:2b85f7820475ad3edec209d3d89a7909ada16caab05d3f2e08a7e8ae3200a55c'},\n]\n\n[package.extras]\nprotobuf = ['grpcio-tools (>=1.71.0)']\n\n[[package]]\nname = 'grpcio-tools'\nversion = '1.71.0'\ndescription = 'Protobuf code generator for gRPC'\noptional = false\npython-versions = '>=3.9'\ngroups = ['main']\nfiles = [\n {file = 'grpcio_tools-1.71.0-cp310-cp310-linux_armv7l.whl', hash = 'sha256:f4ad7f0d756546902597053d70b3af2606fbd70d7972876cd75c1e241d22ae00'},\n {file = 'grpcio_tools-1.71.0-cp310-cp310-macosx_12_0_universal2.whl', hash = 'sha256:64bdb291df61cf570b5256777ad5fe2b1db6d67bc46e55dc56a0a862722ae329'},\n {file = 'grpcio_tools-1.71.0-cp310-cp310-manylinux_2_17_aarch64.whl', hash = 'sha256:8dd9795e982d77a4b496f7278b943c2563d9afde2069cdee78c111a40cc4d675'},\n {file = 'grpcio_tools-1.71.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:c1b5860c41a36b26fec4f52998f1a451d0525a5c9a4fb06b6ea3e9211abdb925'},\n {file = 'grpcio_tools-1.71.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:3059c14035e5dc03d462f261e5900b9a077fd1a36976c3865b8507474520bad4'},\n {file = 'grpcio_tools-1.71.0-cp310-cp310-musllinux_1_1_aarch64.whl', hash = 'sha256:f360981b215b1d5aff9235b37e7e1826246e35bbac32a53e41d4e990a37b8f4c'},\n {file = 'grpcio_tools-1.71.0-cp310-cp310-musllinux_1_1_i686.whl', hash = 'sha256:bfe3888c3bbe16a5aa39409bc38744a31c0c3d2daa2b0095978c56e106c85b42'},\n {file = 'grpcio_tools-1.71.0-cp310-cp310-musllinux_1_1_x86_64.whl', hash = 'sha256:145985c0bf12131f0a1503e65763e0f060473f7f3928ed1ff3fb0e8aad5bc8ac'},\n {file = 'grpcio_tools-1.71.0-cp310-cp310-win32.whl', hash = 'sha256:82c430edd939bb863550ee0fecf067d78feff828908a1b529bbe33cc57f2419c'},\n {file = 'grpcio_tools-1.71.0-cp310-cp310-win_amd64.whl', hash = 'sha256:83e90724e3f02415c628e4ead1d6ffe063820aaaa078d9a39176793df958cd5a'},\n {file = 'grpcio_tools-1.71.0-cp311-cp311-linux_armv7l.whl', hash = 'sha256:1f19b16b49afa5d21473f49c0966dd430c88d089cd52ac02404d8cef67134efb'},\n {file = 'grpcio_tools-1.71.0-cp311-cp311-macosx_10_14_universal2.whl', hash = 'sha256:459c8f5e00e390aecd5b89de67deb3ec7188a274bc6cb50e43cef35ab3a3f45d'},\n {file = 'grpcio_tools-1.71.0-cp311-cp311-manylinux_2_17_aarch64.whl', hash = 'sha256:edab7e6518de01196be37f96cb1e138c3819986bf5e2a6c9e1519b4d716b2f5a'},\n {file = 'grpcio_tools-1.71.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:8b93b9f6adc7491d4c10144c0643409db298e5e63c997106a804f6f0248dbaf4'},\n {file = 'grpcio_tools-1.71.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:6ae5f2efa9e644c10bf1021600bfc099dfbd8e02b184d2d25dc31fcd6c2bc59e'},\n {file = 'grpcio_tools-1.71.0-cp311-cp311-musllinux_1_1_aarch64.whl', hash = 'sha256:65aa082f4435571d65d5ce07fc444f23c3eff4f3e34abef599ef8c9e1f6f360f'},\n {file = 'grpcio_tools-1.71.0-cp311-cp311-musllinux_1_1_i686.whl', hash = 'sha256:1331e726e08b7bdcbf2075fcf4b47dff07842b04845e6e220a08a4663e232d7f'},\n {file = 'grpcio_tools-1.71.0-cp311-cp311-musllinux_1_1_x86_64.whl', hash = 'sha256:6693a7d3ba138b0e693b3d1f687cdd9db9e68976c3fa2b951c17a072fea8b583'},\n {file = 'grpcio_tools-1.71.0-cp311-cp311-win32.whl', hash = 'sha256:6d11ed3ff7b6023b5c72a8654975324bb98c1092426ba5b481af406ff559df00'},\n {file = 'grpcio_tools-1.71.0-cp311-cp311-win_amd64.whl', hash = 'sha256:072b2a5805ac97e4623b3aa8f7818275f3fb087f4aa131b0fce00471065f6eaa'},\n {file = 'grpcio_tools-1.71.0-cp312-cp312-linux_armv7l.whl', hash = 'sha256:61c0409d5bdac57a7bd0ce0ab01c1c916728fe4c8a03d77a25135ad481eb505c'},\n {file = 'grpcio_tools-1.71.0-cp312-cp312-macosx_10_14_universal2.whl', hash = 'sha256:28784f39921d061d2164a9dcda5164a69d07bf29f91f0ea50b505958292312c9'},\n {file = 'grpcio_tools-1.71.0-cp312-cp312-manylinux_2_17_aarch64.whl', hash = 'sha256:192808cf553cedca73f0479cc61d5684ad61f24db7a5f3c4dfe1500342425866'},\n {file = 'grpcio_tools-1.71.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:989ee9da61098230d3d4c8f8f8e27c2de796f1ff21b1c90110e636d9acd9432b'},\n {file = 'grpcio_tools-1.71.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:541a756276c8a55dec991f6c0106ae20c8c8f5ce8d0bdbfcb01e2338d1a8192b'},\n {file = 'grpcio_tools-1.71.0-cp312-cp312-musllinux_1_1_aarch64.whl', hash = 'sha256:870c0097700d13c403e5517cb7750ab5b4a791ce3e71791c411a38c5468b64bd'},\n {file = 'grpcio_tools-1.71.0-cp312-cp312-musllinux_1_1_i686.whl', hash = 'sha256:abd57f615e88bf93c3c6fd31f923106e3beb12f8cd2df95b0d256fa07a7a0a57'},\n {file = 'grpcio_tools-1.71.0-cp312-cp312-musllinux_1_1_x86_64.whl', hash = 'sha256:753270e2d06d37e6d7af8967d1d059ec635ad215882041a36294f4e2fd502b2e'},\n {file = 'grpcio_tools-1.71.0-cp312-cp312-win32.whl', hash = 'sha256:0e647794bd7138b8c215e86277a9711a95cf6a03ff6f9e555d54fdf7378b9f9d'},\n {file = 'grpcio_tools-1.71.0-cp312-cp312-win_amd64.whl', hash = 'sha256:48debc879570972d28bfe98e4970eff25bb26da3f383e0e49829b2d2cd35ad87'},\n {file = 'grpcio_tools-1.71.0-cp313-cp313-linux_armv7l.whl', hash = 'sha256:9a78d07d6c301a25ef5ede962920a522556a1dfee1ccc05795994ceb867f766c'},\n {file = 'grpcio_tools-1.71.0-cp313-cp313-macosx_10_14_universal2.whl', hash = 'sha256:580ac88141c9815557e63c9c04f5b1cdb19b4db8d0cb792b573354bde1ee8b12'},\n {file = 'grpcio_tools-1.71.0-cp313-cp313-manylinux_2_17_aarch64.whl', hash = 'sha256:f7c678e68ece0ae908ecae1c4314a0c2c7f83e26e281738b9609860cc2c82d96'},\n {file = 'grpcio_tools-1.71.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:56ecd6cc89b5e5eed1de5eb9cafce86c9c9043ee3840888cc464d16200290b53'},\n {file = 'grpcio_tools-1.71.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:e52a041afc20ab2431d756b6295d727bd7adee813b21b06a3483f4a7a15ea15f'},\n {file = 'grpcio_tools-1.71.0-cp313-cp313-musllinux_1_1_aarch64.whl', hash = 'sha256:2a1712f12102b60c8d92779b89d0504e0d6f3a59f2b933e5622b8583f5c02992'},\n {file = 'grpcio_tools-1.71.0-cp313-cp313-musllinux_1_1_i686.whl', hash = 'sha256:41878cb7a75477e62fdd45e7e9155b3af1b7a5332844021e2511deaf99ac9e6c'},\n {file = 'grpcio_tools-1.71.0-cp313-cp313-musllinux_1_1_x86_64.whl', hash = 'sha256:682e958b476049ccc14c71bedf3f979bced01f6e0c04852efc5887841a32ad6b'},\n {file = 'grpcio_tools-1.71.0-cp313-cp313-win32.whl', hash = 'sha256:0ccfb837152b7b858b9f26bb110b3ae8c46675d56130f6c2f03605c4f129be13'},\n {file = 'grpcio_tools-1.71.0-cp313-cp313-win_amd64.whl', hash = 'sha256:ffff9bc5eacb34dd26b487194f7d44a3e64e752fc2cf049d798021bf25053b87'},\n {file = 'grpcio_tools-1.71.0-cp39-cp39-linux_armv7l.whl', hash = 'sha256:834959b6eceb85de5217a411aba1643b5f782798680c122202d6a06177226644'},\n {file = 'grpcio_tools-1.71.0-cp39-cp39-macosx_10_14_universal2.whl', hash = 'sha256:e3ae9556e2a1cd70e7d7b0e0459c35af71d51a7dae4cf36075068011a69f13ec'},\n {file = 'grpcio_tools-1.71.0-cp39-cp39-manylinux_2_17_aarch64.whl', hash = 'sha256:77fe6db1334e0ce318b2cb4e70afa94e0c173ed1a533d37aea69ad9f61ae8ea9'},\n {file = 'grpcio_tools-1.71.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:57e3e2544c306b60ef2d76570bac4e977be1ad548641c9eec130c3bc47e80141'},\n {file = 'grpcio_tools-1.71.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:af39e245fa56f7f5c2fe86b7d6c1b78f395c07e54d5613cbdbb3c24769a92b6e'},\n {file = 'grpcio_tools-1.71.0-cp39-cp39-musllinux_1_1_aarch64.whl', hash = 'sha256:8f987d0053351217954543b174b0bddbf51d45b3cfcf8d6de97b0a43d264d753'},\n {file = 'grpcio_tools-1.71.0-cp39-cp39-musllinux_1_1_i686.whl', hash = 'sha256:8e6cdbba4dae7b37b0d25d074614be9936fb720144420f03d9f142a80be69ba2'},\n {file = 'grpcio_tools-1.71.0-cp39-cp39-musllinux_1_1_x86_64.whl', hash = 'sha256:d3adc8b229e60c77bab5a5d62b415667133bd5ced7d59b5f71d6317c9143631e'},\n {file = 'grpcio_tools-1.71.0-cp39-cp39-win32.whl', hash = 'sha256:f68334d28a267fabec6e70cb5986e9999cfbfd14db654094ddf9aedd804a293a'},\n {file = 'grpcio_tools-1.71.0-cp39-cp39-win_amd64.whl', hash = 'sha256:1291a6136c07a86c3bb09f6c33f5cf227cc14956edd1b85cb572327a36e0aef8'},\n {file = 'grpcio_tools-1.71.0.tar.gz', hash = 'sha256:38dba8e0d5e0fb23a034e09644fdc6ed862be2371887eee54901999e8f6792a8'},\n]\n\n[package.dependencies]\ngrpcio = '>=1.71.0'\nprotobuf = '>=5.26.1,<6.0dev'\nsetuptools = '*'\n\n[[package]]\nname = 'hatchet-sdk'\nversion = '1.0.0a1'\ndescription = ''\noptional = false\npython-versions = '<4.0,>=3.10'\ngroups = ['main']\nfiles = [\n {file = 'hatchet_sdk-1.0.0a1-py3-none-any.whl', hash = 'sha256:bfc84358c8842cecd0d95b30645109733b7292dff0db1a776ca862785ee93d7f'},\n {file = 'hatchet_sdk-1.0.0a1.tar.gz', hash = 'sha256:f0272bbaac6faed75ff727826e9f7b1ac42ae597f9b590e14d392aada9c9692f'},\n]\n\n[package.dependencies]\naiohttp = '>=3.10.5,<4.0.0'\naiohttp-retry = '>=2.8.3,<3.0.0'\naiostream = '>=0.5.2,<0.6.0'\ncel-python = '>=0.2.0,<0.3.0'\ngrpcio = [\n {version = '>=1.64.1,<1.68.dev0 || >=1.69.dev0', markers = 'python_version < \\'3.13\\''},\n {version = '>=1.69.0', markers = 'python_version >= \\'3.13\\''},\n]\ngrpcio-tools = [\n {version = '>=1.64.1,<1.68.dev0 || >=1.69.dev0', markers = 'python_version < \\'3.13\\''},\n {version = '>=1.69.0', markers = 'python_version >= \\'3.13\\''},\n]\nnest-asyncio = '>=1.6.0,<2.0.0'\nprometheus-client = '>=0.21.1,<0.22.0'\nprotobuf = '>=5.29.1,<6.0.0'\npydantic = '>=2.6.3,<3.0.0'\npydantic-settings = '>=2.7.1,<3.0.0'\npython-dateutil = '>=2.9.0.post0,<3.0.0'\npyyaml = '>=6.0.1,<7.0.0'\ntenacity = '>=8.4.1'\nurllib3 = '>=1.26.20'\n\n[package.extras]\notel = ['opentelemetry-api (>=1.28.0,<2.0.0)', 'opentelemetry-distro (>=0.49b0)', 'opentelemetry-exporter-otlp (>=1.28.0,<2.0.0)', 'opentelemetry-exporter-otlp-proto-http (>=1.28.0,<2.0.0)', 'opentelemetry-instrumentation (>=0.49b0)', 'opentelemetry-sdk (>=1.28.0,<2.0.0)']\n\n[[package]]\nname = 'idna'\nversion = '3.10'\ndescription = 'Internationalized Domain Names in Applications (IDNA)'\noptional = false\npython-versions = '>=3.6'\ngroups = ['main']\nfiles = [\n {file = 'idna-3.10-py3-none-any.whl', hash = 'sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3'},\n {file = 'idna-3.10.tar.gz', hash = 'sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9'},\n]\n\n[package.extras]\nall = ['flake8 (>=7.1.1)', 'mypy (>=1.11.2)', 'pytest (>=8.3.2)', 'ruff (>=0.6.2)']\n\n[[package]]\nname = 'jmespath'\nversion = '1.0.1'\ndescription = 'JSON Matching Expressions'\noptional = false\npython-versions = '>=3.7'\ngroups = ['main']\nfiles = [\n {file = 'jmespath-1.0.1-py3-none-any.whl', hash = 'sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980'},\n {file = 'jmespath-1.0.1.tar.gz', hash = 'sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe'},\n]\n\n[[package]]\nname = 'lark'\nversion = '0.12.0'\ndescription = 'a modern parsing library'\noptional = false\npython-versions = '*'\ngroups = ['main']\nfiles = [\n {file = 'lark-0.12.0-py2.py3-none-any.whl', hash = 'sha256:ed1d891cbcf5151ead1c1d14663bf542443e579e63a76ae175b01b899bd854ca'},\n {file = 'lark-0.12.0.tar.gz', hash = 'sha256:7da76fcfddadabbbbfd949bbae221efd33938451d90b1fefbbc423c3cccf48ef'},\n]\n\n[package.extras]\natomic-cache = ['atomicwrites']\nnearley = ['js2py']\nregex = ['regex']\n\n[[package]]\nname = 'multidict'\nversion = '6.2.0'\ndescription = 'multidict implementation'\noptional = false\npython-versions = '>=3.9'\ngroups = ['main']\nfiles = [\n {file = 'multidict-6.2.0-cp310-cp310-macosx_10_9_universal2.whl', hash = 'sha256:b9f6392d98c0bd70676ae41474e2eecf4c7150cb419237a41f8f96043fcb81d1'},\n {file = 'multidict-6.2.0-cp310-cp310-macosx_10_9_x86_64.whl', hash = 'sha256:3501621d5e86f1a88521ea65d5cad0a0834c77b26f193747615b7c911e5422d2'},\n {file = 'multidict-6.2.0-cp310-cp310-macosx_11_0_arm64.whl', hash = 'sha256:32ed748ff9ac682eae7859790d3044b50e3076c7d80e17a44239683769ff485e'},\n {file = 'multidict-6.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:cc826b9a8176e686b67aa60fd6c6a7047b0461cae5591ea1dc73d28f72332a8a'},\n {file = 'multidict-6.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:214207dcc7a6221d9942f23797fe89144128a71c03632bf713d918db99bd36de'},\n {file = 'multidict-6.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:05fefbc3cddc4e36da209a5e49f1094bbece9a581faa7f3589201fd95df40e5d'},\n {file = 'multidict-6.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:e851e6363d0dbe515d8de81fd544a2c956fdec6f8a049739562286727d4a00c3'},\n {file = 'multidict-6.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:32c9b4878f48be3e75808ea7e499d6223b1eea6d54c487a66bc10a1871e3dc6a'},\n {file = 'multidict-6.2.0-cp310-cp310-musllinux_1_2_aarch64.whl', hash = 'sha256:7243c5a6523c5cfeca76e063efa5f6a656d1d74c8b1fc64b2cd1e84e507f7e2a'},\n {file = 'multidict-6.2.0-cp310-cp310-musllinux_1_2_i686.whl', hash = 'sha256:0e5a644e50ef9fb87878d4d57907f03a12410d2aa3b93b3acdf90a741df52c49'},\n {file = 'multidict-6.2.0-cp310-cp310-musllinux_1_2_ppc64le.whl', hash = 'sha256:0dc25a3293c50744796e87048de5e68996104d86d940bb24bc3ec31df281b191'},\n {file = 'multidict-6.2.0-cp310-cp310-musllinux_1_2_s390x.whl', hash = 'sha256:a49994481b99cd7dedde07f2e7e93b1d86c01c0fca1c32aded18f10695ae17eb'},\n {file = 'multidict-6.2.0-cp310-cp310-musllinux_1_2_x86_64.whl', hash = 'sha256:641cf2e3447c9ecff2f7aa6e9eee9eaa286ea65d57b014543a4911ff2799d08a'},\n {file = 'multidict-6.2.0-cp310-cp310-win32.whl', hash = 'sha256:0c383d28857f66f5aebe3e91d6cf498da73af75fbd51cedbe1adfb85e90c0460'},\n {file = 'multidict-6.2.0-cp310-cp310-win_amd64.whl', hash = 'sha256:a33273a541f1e1a8219b2a4ed2de355848ecc0254264915b9290c8d2de1c74e1'},\n {file = 'multidict-6.2.0-cp311-cp311-macosx_10_9_universal2.whl', hash = 'sha256:84e87a7d75fa36839a3a432286d719975362d230c70ebfa0948549cc38bd5b46'},\n {file = 'multidict-6.2.0-cp311-cp311-macosx_10_9_x86_64.whl', hash = 'sha256:8de4d42dffd5ced9117af2ce66ba8722402541a3aa98ffdf78dde92badb68932'},\n {file = 'multidict-6.2.0-cp311-cp311-macosx_11_0_arm64.whl', hash = 'sha256:e7d91a230c7f8af86c904a5a992b8c064b66330544693fd6759c3d6162382ecf'},\n {file = 'multidict-6.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:9f6cad071960ba1914fa231677d21b1b4a3acdcce463cee41ea30bc82e6040cf'},\n {file = 'multidict-6.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:0f74f2fc51555f4b037ef278efc29a870d327053aba5cb7d86ae572426c7cccc'},\n {file = 'multidict-6.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:14ed9ed1bfedd72a877807c71113deac292bf485159a29025dfdc524c326f3e1'},\n {file = 'multidict-6.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:4ac3fcf9a2d369bd075b2c2965544036a27ccd277fc3c04f708338cc57533081'},\n {file = 'multidict-6.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:2fc6af8e39f7496047c7876314f4317736eac82bf85b54c7c76cf1a6f8e35d98'},\n {file = 'multidict-6.2.0-cp311-cp311-musllinux_1_2_aarch64.whl', hash = 'sha256:5f8cb1329f42fadfb40d6211e5ff568d71ab49be36e759345f91c69d1033d633'},\n {file = 'multidict-6.2.0-cp311-cp311-musllinux_1_2_i686.whl', hash = 'sha256:5389445f0173c197f4a3613713b5fb3f3879df1ded2a1a2e4bc4b5b9c5441b7e'},\n {file = 'multidict-6.2.0-cp311-cp311-musllinux_1_2_ppc64le.whl', hash = 'sha256:94a7bb972178a8bfc4055db80c51efd24baefaced5e51c59b0d598a004e8305d'},\n {file = 'multidict-6.2.0-cp311-cp311-musllinux_1_2_s390x.whl', hash = 'sha256:da51d8928ad8b4244926fe862ba1795f0b6e68ed8c42cd2f822d435db9c2a8f4'},\n {file = 'multidict-6.2.0-cp311-cp311-musllinux_1_2_x86_64.whl', hash = 'sha256:063be88bd684782a0715641de853e1e58a2f25b76388538bd62d974777ce9bc2'},\n {file = 'multidict-6.2.0-cp311-cp311-win32.whl', hash = 'sha256:52b05e21ff05729fbea9bc20b3a791c3c11da61649ff64cce8257c82a020466d'},\n {file = 'multidict-6.2.0-cp311-cp311-win_amd64.whl', hash = 'sha256:1e2a2193d3aa5cbf5758f6d5680a52aa848e0cf611da324f71e5e48a9695cc86'},\n {file = 'multidict-6.2.0-cp312-cp312-macosx_10_13_universal2.whl', hash = 'sha256:437c33561edb6eb504b5a30203daf81d4a9b727e167e78b0854d9a4e18e8950b'},\n {file = 'multidict-6.2.0-cp312-cp312-macosx_10_13_x86_64.whl', hash = 'sha256:9f49585f4abadd2283034fc605961f40c638635bc60f5162276fec075f2e37a4'},\n {file = 'multidict-6.2.0-cp312-cp312-macosx_11_0_arm64.whl', hash = 'sha256:5dd7106d064d05896ce28c97da3f46caa442fe5a43bc26dfb258e90853b39b44'},\n {file = 'multidict-6.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:e25b11a0417475f093d0f0809a149aff3943c2c56da50fdf2c3c88d57fe3dfbd'},\n {file = 'multidict-6.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:ac380cacdd3b183338ba63a144a34e9044520a6fb30c58aa14077157a033c13e'},\n {file = 'multidict-6.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:61d5541f27533f803a941d3a3f8a3d10ed48c12cf918f557efcbf3cd04ef265c'},\n {file = 'multidict-6.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:facaf11f21f3a4c51b62931feb13310e6fe3475f85e20d9c9fdce0d2ea561b87'},\n {file = 'multidict-6.2.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:095a2eabe8c43041d3e6c2cb8287a257b5f1801c2d6ebd1dd877424f1e89cf29'},\n {file = 'multidict-6.2.0-cp312-cp312-musllinux_1_2_aarch64.whl', hash = 'sha256:a0cc398350ef31167e03f3ca7c19313d4e40a662adcb98a88755e4e861170bdd'},\n {file = 'multidict-6.2.0-cp312-cp312-musllinux_1_2_i686.whl', hash = 'sha256:7c611345bbe7cb44aabb877cb94b63e86f2d0db03e382667dbd037866d44b4f8'},\n {file = 'multidict-6.2.0-cp312-cp312-musllinux_1_2_ppc64le.whl', hash = 'sha256:8cd1a0644ccaf27e9d2f6d9c9474faabee21f0578fe85225cc5af9a61e1653df'},\n {file = 'multidict-6.2.0-cp312-cp312-musllinux_1_2_s390x.whl', hash = 'sha256:89b3857652183b8206a891168af47bac10b970d275bba1f6ee46565a758c078d'},\n {file = 'multidict-6.2.0-cp312-cp312-musllinux_1_2_x86_64.whl', hash = 'sha256:125dd82b40f8c06d08d87b3510beaccb88afac94e9ed4a6f6c71362dc7dbb04b'},\n {file = 'multidict-6.2.0-cp312-cp312-win32.whl', hash = 'sha256:76b34c12b013d813e6cb325e6bd4f9c984db27758b16085926bbe7ceeaace626'},\n {file = 'multidict-6.2.0-cp312-cp312-win_amd64.whl', hash = 'sha256:0b183a959fb88ad1be201de2c4bdf52fa8e46e6c185d76201286a97b6f5ee65c'},\n {file = 'multidict-6.2.0-cp313-cp313-macosx_10_13_universal2.whl', hash = 'sha256:5c5e7d2e300d5cb3b2693b6d60d3e8c8e7dd4ebe27cd17c9cb57020cac0acb80'},\n {file = 'multidict-6.2.0-cp313-cp313-macosx_10_13_x86_64.whl', hash = 'sha256:256d431fe4583c5f1e0f2e9c4d9c22f3a04ae96009b8cfa096da3a8723db0a16'},\n {file = 'multidict-6.2.0-cp313-cp313-macosx_11_0_arm64.whl', hash = 'sha256:a3c0ff89fe40a152e77b191b83282c9664357dce3004032d42e68c514ceff27e'},\n {file = 'multidict-6.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:ef7d48207926edbf8b16b336f779c557dd8f5a33035a85db9c4b0febb0706817'},\n {file = 'multidict-6.2.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:1f3c099d3899b14e1ce52262eb82a5f5cb92157bb5106bf627b618c090a0eadc'},\n {file = 'multidict-6.2.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:e16e7297f29a544f49340012d6fc08cf14de0ab361c9eb7529f6a57a30cbfda1'},\n {file = 'multidict-6.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:042028348dc5a1f2be6c666437042a98a5d24cee50380f4c0902215e5ec41844'},\n {file = 'multidict-6.2.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:08549895e6a799bd551cf276f6e59820aa084f0f90665c0f03dd3a50db5d3c48'},\n {file = 'multidict-6.2.0-cp313-cp313-musllinux_1_2_aarch64.whl', hash = 'sha256:4ccfd74957ef53fa7380aaa1c961f523d582cd5e85a620880ffabd407f8202c0'},\n {file = 'multidict-6.2.0-cp313-cp313-musllinux_1_2_i686.whl', hash = 'sha256:83b78c680d4b15d33042d330c2fa31813ca3974197bddb3836a5c635a5fd013f'},\n {file = 'multidict-6.2.0-cp313-cp313-musllinux_1_2_ppc64le.whl', hash = 'sha256:b4c153863dd6569f6511845922c53e39c8d61f6e81f228ad5443e690fca403de'},\n {file = 'multidict-6.2.0-cp313-cp313-musllinux_1_2_s390x.whl', hash = 'sha256:98aa8325c7f47183b45588af9c434533196e241be0a4e4ae2190b06d17675c02'},\n {file = 'multidict-6.2.0-cp313-cp313-musllinux_1_2_x86_64.whl', hash = 'sha256:9e658d1373c424457ddf6d55ec1db93c280b8579276bebd1f72f113072df8a5d'},\n {file = 'multidict-6.2.0-cp313-cp313-win32.whl', hash = 'sha256:3157126b028c074951839233647bd0e30df77ef1fedd801b48bdcad242a60f4e'},\n {file = 'multidict-6.2.0-cp313-cp313-win_amd64.whl', hash = 'sha256:2e87f1926e91855ae61769ba3e3f7315120788c099677e0842e697b0bfb659f2'},\n {file = 'multidict-6.2.0-cp313-cp313t-macosx_10_13_universal2.whl', hash = 'sha256:2529ddbdaa424b2c6c2eb668ea684dd6b75b839d0ad4b21aad60c168269478d7'},\n {file = 'multidict-6.2.0-cp313-cp313t-macosx_10_13_x86_64.whl', hash = 'sha256:13551d0e2d7201f0959725a6a769b6f7b9019a168ed96006479c9ac33fe4096b'},\n {file = 'multidict-6.2.0-cp313-cp313t-macosx_11_0_arm64.whl', hash = 'sha256:d1996ee1330e245cd3aeda0887b4409e3930524c27642b046e4fae88ffa66c5e'},\n {file = 'multidict-6.2.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:c537da54ce4ff7c15e78ab1292e5799d0d43a2108e006578a57f531866f64025'},\n {file = 'multidict-6.2.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:0f249badb360b0b4d694307ad40f811f83df4da8cef7b68e429e4eea939e49dd'},\n {file = 'multidict-6.2.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:48d39b1824b8d6ea7de878ef6226efbe0773f9c64333e1125e0efcfdd18a24c7'},\n {file = 'multidict-6.2.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:b99aac6bb2c37db336fa03a39b40ed4ef2818bf2dfb9441458165ebe88b793af'},\n {file = 'multidict-6.2.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:07bfa8bc649783e703263f783f73e27fef8cd37baaad4389816cf6a133141331'},\n {file = 'multidict-6.2.0-cp313-cp313t-musllinux_1_2_aarch64.whl', hash = 'sha256:b2c00ad31fbc2cbac85d7d0fcf90853b2ca2e69d825a2d3f3edb842ef1544a2c'},\n {file = 'multidict-6.2.0-cp313-cp313t-musllinux_1_2_i686.whl', hash = 'sha256:0d57a01a2a9fa00234aace434d8c131f0ac6e0ac6ef131eda5962d7e79edfb5b'},\n {file = 'multidict-6.2.0-cp313-cp313t-musllinux_1_2_ppc64le.whl', hash = 'sha256:abf5b17bc0cf626a8a497d89ac691308dbd825d2ac372aa990b1ca114e470151'},\n {file = 'multidict-6.2.0-cp313-cp313t-musllinux_1_2_s390x.whl', hash = 'sha256:f7716f7e7138252d88607228ce40be22660d6608d20fd365d596e7ca0738e019'},\n {file = 'multidict-6.2.0-cp313-cp313t-musllinux_1_2_x86_64.whl', hash = 'sha256:d5a36953389f35f0a4e88dc796048829a2f467c9197265504593f0e420571547'},\n {file = 'multidict-6.2.0-cp313-cp313t-win32.whl', hash = 'sha256:e653d36b1bf48fa78c7fcebb5fa679342e025121ace8c87ab05c1cefd33b34fc'},\n {file = 'multidict-6.2.0-cp313-cp313t-win_amd64.whl', hash = 'sha256:ca23db5fb195b5ef4fd1f77ce26cadefdf13dba71dab14dadd29b34d457d7c44'},\n {file = 'multidict-6.2.0-cp39-cp39-macosx_10_9_universal2.whl', hash = 'sha256:b4f3d66dd0354b79761481fc15bdafaba0b9d9076f1f42cc9ce10d7fcbda205a'},\n {file = 'multidict-6.2.0-cp39-cp39-macosx_10_9_x86_64.whl', hash = 'sha256:6e2a2d6749e1ff2c9c76a72c6530d5baa601205b14e441e6d98011000f47a7ac'},\n {file = 'multidict-6.2.0-cp39-cp39-macosx_11_0_arm64.whl', hash = 'sha256:cca83a629f77402cfadd58352e394d79a61c8015f1694b83ab72237ec3941f88'},\n {file = 'multidict-6.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:781b5dd1db18c9e9eacc419027b0acb5073bdec9de1675c0be25ceb10e2ad133'},\n {file = 'multidict-6.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:cf8d370b2fea27fb300825ec3984334f7dd54a581bde6456799ba3776915a656'},\n {file = 'multidict-6.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:25bb96338512e2f46f615a2bb7c6012fe92a4a5ebd353e5020836a7e33120349'},\n {file = 'multidict-6.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:19e2819b0b468174de25c0ceed766606a07cedeab132383f1e83b9a4e96ccb4f'},\n {file = 'multidict-6.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:6aed763b6a1b28c46c055692836879328f0b334a6d61572ee4113a5d0c859872'},\n {file = 'multidict-6.2.0-cp39-cp39-musllinux_1_2_aarch64.whl', hash = 'sha256:a1133414b771619aa3c3000701c11b2e4624a7f492f12f256aedde97c28331a2'},\n {file = 'multidict-6.2.0-cp39-cp39-musllinux_1_2_i686.whl', hash = 'sha256:639556758c36093b35e2e368ca485dada6afc2bd6a1b1207d85ea6dfc3deab27'},\n {file = 'multidict-6.2.0-cp39-cp39-musllinux_1_2_ppc64le.whl', hash = 'sha256:163f4604e76639f728d127293d24c3e208b445b463168af3d031b92b0998bb90'},\n {file = 'multidict-6.2.0-cp39-cp39-musllinux_1_2_s390x.whl', hash = 'sha256:2325105e16d434749e1be8022f942876a936f9bece4ec41ae244e3d7fae42aaf'},\n {file = 'multidict-6.2.0-cp39-cp39-musllinux_1_2_x86_64.whl', hash = 'sha256:e4371591e621579cb6da8401e4ea405b33ff25a755874a3567c4075ca63d56e2'},\n {file = 'multidict-6.2.0-cp39-cp39-win32.whl', hash = 'sha256:d1175b0e0d6037fab207f05774a176d71210ebd40b1c51f480a04b65ec5c786d'},\n {file = 'multidict-6.2.0-cp39-cp39-win_amd64.whl', hash = 'sha256:ad81012b24b88aad4c70b2cbc2dad84018783221b7f923e926f4690ff8569da3'},\n {file = 'multidict-6.2.0-py3-none-any.whl', hash = 'sha256:5d26547423e5e71dcc562c4acdc134b900640a39abd9066d7326a7cc2324c530'},\n {file = 'multidict-6.2.0.tar.gz', hash = 'sha256:0085b0afb2446e57050140240a8595846ed64d1cbd26cef936bfab3192c673b8'},\n]\n\n[package.dependencies]\ntyping-extensions = {version = '>=4.1.0', markers = 'python_version < \\'3.11\\''}\n\n[[package]]\nname = 'nest-asyncio'\nversion = '1.6.0'\ndescription = 'Patch asyncio to allow nested event loops'\noptional = false\npython-versions = '>=3.5'\ngroups = ['main']\nfiles = [\n {file = 'nest_asyncio-1.6.0-py3-none-any.whl', hash = 'sha256:87af6efd6b5e897c81050477ef65c62e2b2f35d51703cae01aff2905b1852e1c'},\n {file = 'nest_asyncio-1.6.0.tar.gz', hash = 'sha256:6f172d5449aca15afd6c646851f4e31e02c598d553a667e38cafa997cfec55fe'},\n]\n\n[[package]]\nname = 'prometheus-client'\nversion = '0.21.1'\ndescription = 'Python client for the Prometheus monitoring system.'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'prometheus_client-0.21.1-py3-none-any.whl', hash = 'sha256:594b45c410d6f4f8888940fe80b5cc2521b305a1fafe1c58609ef715a001f301'},\n {file = 'prometheus_client-0.21.1.tar.gz', hash = 'sha256:252505a722ac04b0456be05c05f75f45d760c2911ffc45f2a06bcaed9f3ae3fb'},\n]\n\n[package.extras]\ntwisted = ['twisted']\n\n[[package]]\nname = 'propcache'\nversion = '0.3.0'\ndescription = 'Accelerated property cache'\noptional = false\npython-versions = '>=3.9'\ngroups = ['main']\nfiles = [\n {file = 'propcache-0.3.0-cp310-cp310-macosx_10_9_universal2.whl', hash = 'sha256:efa44f64c37cc30c9f05932c740a8b40ce359f51882c70883cc95feac842da4d'},\n {file = 'propcache-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl', hash = 'sha256:2383a17385d9800b6eb5855c2f05ee550f803878f344f58b6e194de08b96352c'},\n {file = 'propcache-0.3.0-cp310-cp310-macosx_11_0_arm64.whl', hash = 'sha256:d3e7420211f5a65a54675fd860ea04173cde60a7cc20ccfbafcccd155225f8bc'},\n {file = 'propcache-0.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:3302c5287e504d23bb0e64d2a921d1eb4a03fb93a0a0aa3b53de059f5a5d737d'},\n {file = 'propcache-0.3.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:7e2e068a83552ddf7a39a99488bcba05ac13454fb205c847674da0352602082f'},\n {file = 'propcache-0.3.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:2d913d36bdaf368637b4f88d554fb9cb9d53d6920b9c5563846555938d5450bf'},\n {file = 'propcache-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:8ee1983728964d6070ab443399c476de93d5d741f71e8f6e7880a065f878e0b9'},\n {file = 'propcache-0.3.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:36ca5e9a21822cc1746023e88f5c0af6fce3af3b85d4520efb1ce4221bed75cc'},\n {file = 'propcache-0.3.0-cp310-cp310-musllinux_1_2_aarch64.whl', hash = 'sha256:9ecde3671e62eeb99e977f5221abcf40c208f69b5eb986b061ccec317c82ebd0'},\n {file = 'propcache-0.3.0-cp310-cp310-musllinux_1_2_armv7l.whl', hash = 'sha256:d383bf5e045d7f9d239b38e6acadd7b7fdf6c0087259a84ae3475d18e9a2ae8b'},\n {file = 'propcache-0.3.0-cp310-cp310-musllinux_1_2_i686.whl', hash = 'sha256:8cb625bcb5add899cb8ba7bf716ec1d3e8f7cdea9b0713fa99eadf73b6d4986f'},\n {file = 'propcache-0.3.0-cp310-cp310-musllinux_1_2_ppc64le.whl', hash = 'sha256:5fa159dcee5dba00c1def3231c249cf261185189205073bde13797e57dd7540a'},\n {file = 'propcache-0.3.0-cp310-cp310-musllinux_1_2_s390x.whl', hash = 'sha256:a7080b0159ce05f179cfac592cda1a82898ca9cd097dacf8ea20ae33474fbb25'},\n {file = 'propcache-0.3.0-cp310-cp310-musllinux_1_2_x86_64.whl', hash = 'sha256:ed7161bccab7696a473fe7ddb619c1d75963732b37da4618ba12e60899fefe4f'},\n {file = 'propcache-0.3.0-cp310-cp310-win32.whl', hash = 'sha256:bf0d9a171908f32d54f651648c7290397b8792f4303821c42a74e7805bfb813c'},\n {file = 'propcache-0.3.0-cp310-cp310-win_amd64.whl', hash = 'sha256:42924dc0c9d73e49908e35bbdec87adedd651ea24c53c29cac103ede0ea1d340'},\n {file = 'propcache-0.3.0-cp311-cp311-macosx_10_9_universal2.whl', hash = 'sha256:9ddd49258610499aab83b4f5b61b32e11fce873586282a0e972e5ab3bcadee51'},\n {file = 'propcache-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl', hash = 'sha256:2578541776769b500bada3f8a4eeaf944530516b6e90c089aa368266ed70c49e'},\n {file = 'propcache-0.3.0-cp311-cp311-macosx_11_0_arm64.whl', hash = 'sha256:d8074c5dd61c8a3e915fa8fc04754fa55cfa5978200d2daa1e2d4294c1f136aa'},\n {file = 'propcache-0.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:b58229a844931bca61b3a20efd2be2a2acb4ad1622fc026504309a6883686fbf'},\n {file = 'propcache-0.3.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:e45377d5d6fefe1677da2a2c07b024a6dac782088e37c0b1efea4cfe2b1be19b'},\n {file = 'propcache-0.3.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:ec5060592d83454e8063e487696ac3783cc48c9a329498bafae0d972bc7816c9'},\n {file = 'propcache-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:15010f29fbed80e711db272909a074dc79858c6d28e2915704cfc487a8ac89c6'},\n {file = 'propcache-0.3.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:a254537b9b696ede293bfdbc0a65200e8e4507bc9f37831e2a0318a9b333c85c'},\n {file = 'propcache-0.3.0-cp311-cp311-musllinux_1_2_aarch64.whl', hash = 'sha256:2b975528998de037dfbc10144b8aed9b8dd5a99ec547f14d1cb7c5665a43f075'},\n {file = 'propcache-0.3.0-cp311-cp311-musllinux_1_2_armv7l.whl', hash = 'sha256:19d36bb351ad5554ff20f2ae75f88ce205b0748c38b146c75628577020351e3c'},\n {file = 'propcache-0.3.0-cp311-cp311-musllinux_1_2_i686.whl', hash = 'sha256:6032231d4a5abd67c7f71168fd64a47b6b451fbcb91c8397c2f7610e67683810'},\n {file = 'propcache-0.3.0-cp311-cp311-musllinux_1_2_ppc64le.whl', hash = 'sha256:6985a593417cdbc94c7f9c3403747335e450c1599da1647a5af76539672464d3'},\n {file = 'propcache-0.3.0-cp311-cp311-musllinux_1_2_s390x.whl', hash = 'sha256:6a1948df1bb1d56b5e7b0553c0fa04fd0e320997ae99689488201f19fa90d2e7'},\n {file = 'propcache-0.3.0-cp311-cp311-musllinux_1_2_x86_64.whl', hash = 'sha256:8319293e85feadbbfe2150a5659dbc2ebc4afdeaf7d98936fb9a2f2ba0d4c35c'},\n {file = 'propcache-0.3.0-cp311-cp311-win32.whl', hash = 'sha256:63f26258a163c34542c24808f03d734b338da66ba91f410a703e505c8485791d'},\n {file = 'propcache-0.3.0-cp311-cp311-win_amd64.whl', hash = 'sha256:cacea77ef7a2195f04f9279297684955e3d1ae4241092ff0cfcef532bb7a1c32'},\n {file = 'propcache-0.3.0-cp312-cp312-macosx_10_13_universal2.whl', hash = 'sha256:e53d19c2bf7d0d1e6998a7e693c7e87300dd971808e6618964621ccd0e01fe4e'},\n {file = 'propcache-0.3.0-cp312-cp312-macosx_10_13_x86_64.whl', hash = 'sha256:a61a68d630e812b67b5bf097ab84e2cd79b48c792857dc10ba8a223f5b06a2af'},\n {file = 'propcache-0.3.0-cp312-cp312-macosx_11_0_arm64.whl', hash = 'sha256:fb91d20fa2d3b13deea98a690534697742029f4fb83673a3501ae6e3746508b5'},\n {file = 'propcache-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:67054e47c01b7b349b94ed0840ccae075449503cf1fdd0a1fdd98ab5ddc2667b'},\n {file = 'propcache-0.3.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:997e7b8f173a391987df40f3b52c423e5850be6f6df0dcfb5376365440b56667'},\n {file = 'propcache-0.3.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:8d663fd71491dde7dfdfc899d13a067a94198e90695b4321084c6e450743b8c7'},\n {file = 'propcache-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:8884ba1a0fe7210b775106b25850f5e5a9dc3c840d1ae9924ee6ea2eb3acbfe7'},\n {file = 'propcache-0.3.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:aa806bbc13eac1ab6291ed21ecd2dd426063ca5417dd507e6be58de20e58dfcf'},\n {file = 'propcache-0.3.0-cp312-cp312-musllinux_1_2_aarch64.whl', hash = 'sha256:6f4d7a7c0aff92e8354cceca6fe223973ddf08401047920df0fcb24be2bd5138'},\n {file = 'propcache-0.3.0-cp312-cp312-musllinux_1_2_armv7l.whl', hash = 'sha256:9be90eebc9842a93ef8335291f57b3b7488ac24f70df96a6034a13cb58e6ff86'},\n {file = 'propcache-0.3.0-cp312-cp312-musllinux_1_2_i686.whl', hash = 'sha256:bf15fc0b45914d9d1b706f7c9c4f66f2b7b053e9517e40123e137e8ca8958b3d'},\n {file = 'propcache-0.3.0-cp312-cp312-musllinux_1_2_ppc64le.whl', hash = 'sha256:5a16167118677d94bb48bfcd91e420088854eb0737b76ec374b91498fb77a70e'},\n {file = 'propcache-0.3.0-cp312-cp312-musllinux_1_2_s390x.whl', hash = 'sha256:41de3da5458edd5678b0f6ff66691507f9885f5fe6a0fb99a5d10d10c0fd2d64'},\n {file = 'propcache-0.3.0-cp312-cp312-musllinux_1_2_x86_64.whl', hash = 'sha256:728af36011bb5d344c4fe4af79cfe186729efb649d2f8b395d1572fb088a996c'},\n {file = 'propcache-0.3.0-cp312-cp312-win32.whl', hash = 'sha256:6b5b7fd6ee7b54e01759f2044f936dcf7dea6e7585f35490f7ca0420fe723c0d'},\n {file = 'propcache-0.3.0-cp312-cp312-win_amd64.whl', hash = 'sha256:2d15bc27163cd4df433e75f546b9ac31c1ba7b0b128bfb1b90df19082466ff57'},\n {file = 'propcache-0.3.0-cp313-cp313-macosx_10_13_universal2.whl', hash = 'sha256:a2b9bf8c79b660d0ca1ad95e587818c30ccdb11f787657458d6f26a1ea18c568'},\n {file = 'propcache-0.3.0-cp313-cp313-macosx_10_13_x86_64.whl', hash = 'sha256:b0c1a133d42c6fc1f5fbcf5c91331657a1ff822e87989bf4a6e2e39b818d0ee9'},\n {file = 'propcache-0.3.0-cp313-cp313-macosx_11_0_arm64.whl', hash = 'sha256:bb2f144c6d98bb5cbc94adeb0447cfd4c0f991341baa68eee3f3b0c9c0e83767'},\n {file = 'propcache-0.3.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:d1323cd04d6e92150bcc79d0174ce347ed4b349d748b9358fd2e497b121e03c8'},\n {file = 'propcache-0.3.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:3b812b3cb6caacd072276ac0492d249f210006c57726b6484a1e1805b3cfeea0'},\n {file = 'propcache-0.3.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:742840d1d0438eb7ea4280f3347598f507a199a35a08294afdcc560c3739989d'},\n {file = 'propcache-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:7c6e7e4f9167fddc438cd653d826f2222222564daed4116a02a184b464d3ef05'},\n {file = 'propcache-0.3.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:a94ffc66738da99232ddffcf7910e0f69e2bbe3a0802e54426dbf0714e1c2ffe'},\n {file = 'propcache-0.3.0-cp313-cp313-musllinux_1_2_aarch64.whl', hash = 'sha256:3c6ec957025bf32b15cbc6b67afe233c65b30005e4c55fe5768e4bb518d712f1'},\n {file = 'propcache-0.3.0-cp313-cp313-musllinux_1_2_armv7l.whl', hash = 'sha256:549722908de62aa0b47a78b90531c022fa6e139f9166be634f667ff45632cc92'},\n {file = 'propcache-0.3.0-cp313-cp313-musllinux_1_2_i686.whl', hash = 'sha256:5d62c4f6706bff5d8a52fd51fec6069bef69e7202ed481486c0bc3874912c787'},\n {file = 'propcache-0.3.0-cp313-cp313-musllinux_1_2_ppc64le.whl', hash = 'sha256:24c04f8fbf60094c531667b8207acbae54146661657a1b1be6d3ca7773b7a545'},\n {file = 'propcache-0.3.0-cp313-cp313-musllinux_1_2_s390x.whl', hash = 'sha256:7c5f5290799a3f6539cc5e6f474c3e5c5fbeba74a5e1e5be75587746a940d51e'},\n {file = 'propcache-0.3.0-cp313-cp313-musllinux_1_2_x86_64.whl', hash = 'sha256:4fa0e7c9c3cf7c276d4f6ab9af8adddc127d04e0fcabede315904d2ff76db626'},\n {file = 'propcache-0.3.0-cp313-cp313-win32.whl', hash = 'sha256:ee0bd3a7b2e184e88d25c9baa6a9dc609ba25b76daae942edfb14499ac7ec374'},\n {file = 'propcache-0.3.0-cp313-cp313-win_amd64.whl', hash = 'sha256:1c8f7d896a16da9455f882870a507567d4f58c53504dc2d4b1e1d386dfe4588a'},\n {file = 'propcache-0.3.0-cp313-cp313t-macosx_10_13_universal2.whl', hash = 'sha256:e560fd75aaf3e5693b91bcaddd8b314f4d57e99aef8a6c6dc692f935cc1e6bbf'},\n {file = 'propcache-0.3.0-cp313-cp313t-macosx_10_13_x86_64.whl', hash = 'sha256:65a37714b8ad9aba5780325228598a5b16c47ba0f8aeb3dc0514701e4413d7c0'},\n {file = 'propcache-0.3.0-cp313-cp313t-macosx_11_0_arm64.whl', hash = 'sha256:07700939b2cbd67bfb3b76a12e1412405d71019df00ca5697ce75e5ef789d829'},\n {file = 'propcache-0.3.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:7c0fdbdf6983526e269e5a8d53b7ae3622dd6998468821d660d0daf72779aefa'},\n {file = 'propcache-0.3.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:794c3dd744fad478b6232289c866c25406ecdfc47e294618bdf1697e69bd64a6'},\n {file = 'propcache-0.3.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:4544699674faf66fb6b4473a1518ae4999c1b614f0b8297b1cef96bac25381db'},\n {file = 'propcache-0.3.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:fddb8870bdb83456a489ab67c6b3040a8d5a55069aa6f72f9d872235fbc52f54'},\n {file = 'propcache-0.3.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:f857034dc68d5ceb30fb60afb6ff2103087aea10a01b613985610e007053a121'},\n {file = 'propcache-0.3.0-cp313-cp313t-musllinux_1_2_aarch64.whl', hash = 'sha256:02df07041e0820cacc8f739510078f2aadcfd3fc57eaeeb16d5ded85c872c89e'},\n {file = 'propcache-0.3.0-cp313-cp313t-musllinux_1_2_armv7l.whl', hash = 'sha256:f47d52fd9b2ac418c4890aad2f6d21a6b96183c98021f0a48497a904199f006e'},\n {file = 'propcache-0.3.0-cp313-cp313t-musllinux_1_2_i686.whl', hash = 'sha256:9ff4e9ecb6e4b363430edf2c6e50173a63e0820e549918adef70515f87ced19a'},\n {file = 'propcache-0.3.0-cp313-cp313t-musllinux_1_2_ppc64le.whl', hash = 'sha256:ecc2920630283e0783c22e2ac94427f8cca29a04cfdf331467d4f661f4072dac'},\n {file = 'propcache-0.3.0-cp313-cp313t-musllinux_1_2_s390x.whl', hash = 'sha256:c441c841e82c5ba7a85ad25986014be8d7849c3cfbdb6004541873505929a74e'},\n {file = 'propcache-0.3.0-cp313-cp313t-musllinux_1_2_x86_64.whl', hash = 'sha256:6c929916cbdb540d3407c66f19f73387f43e7c12fa318a66f64ac99da601bcdf'},\n {file = 'propcache-0.3.0-cp313-cp313t-win32.whl', hash = 'sha256:0c3e893c4464ebd751b44ae76c12c5f5c1e4f6cbd6fbf67e3783cd93ad221863'},\n {file = 'propcache-0.3.0-cp313-cp313t-win_amd64.whl', hash = 'sha256:75e872573220d1ee2305b35c9813626e620768248425f58798413e9c39741f46'},\n {file = 'propcache-0.3.0-cp39-cp39-macosx_10_9_universal2.whl', hash = 'sha256:03c091bb752349402f23ee43bb2bff6bd80ccab7c9df6b88ad4322258d6960fc'},\n {file = 'propcache-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl', hash = 'sha256:46ed02532cb66612d42ae5c3929b5e98ae330ea0f3900bc66ec5f4862069519b'},\n {file = 'propcache-0.3.0-cp39-cp39-macosx_11_0_arm64.whl', hash = 'sha256:11ae6a8a01b8a4dc79093b5d3ca2c8a4436f5ee251a9840d7790dccbd96cb649'},\n {file = 'propcache-0.3.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:df03cd88f95b1b99052b52b1bb92173229d7a674df0ab06d2b25765ee8404bce'},\n {file = 'propcache-0.3.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:03acd9ff19021bd0567582ac88f821b66883e158274183b9e5586f678984f8fe'},\n {file = 'propcache-0.3.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:cd54895e4ae7d32f1e3dd91261df46ee7483a735017dc6f987904f194aa5fd14'},\n {file = 'propcache-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:26a67e5c04e3119594d8cfae517f4b9330c395df07ea65eab16f3d559b7068fe'},\n {file = 'propcache-0.3.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:ee25f1ac091def37c4b59d192bbe3a206298feeb89132a470325bf76ad122a1e'},\n {file = 'propcache-0.3.0-cp39-cp39-musllinux_1_2_aarch64.whl', hash = 'sha256:58e6d2a5a7cb3e5f166fd58e71e9a4ff504be9dc61b88167e75f835da5764d07'},\n {file = 'propcache-0.3.0-cp39-cp39-musllinux_1_2_armv7l.whl', hash = 'sha256:be90c94570840939fecedf99fa72839aed70b0ced449b415c85e01ae67422c90'},\n {file = 'propcache-0.3.0-cp39-cp39-musllinux_1_2_i686.whl', hash = 'sha256:49ea05212a529c2caffe411e25a59308b07d6e10bf2505d77da72891f9a05641'},\n {file = 'propcache-0.3.0-cp39-cp39-musllinux_1_2_ppc64le.whl', hash = 'sha256:119e244ab40f70a98c91906d4c1f4c5f2e68bd0b14e7ab0a06922038fae8a20f'},\n {file = 'propcache-0.3.0-cp39-cp39-musllinux_1_2_s390x.whl', hash = 'sha256:507c5357a8d8b4593b97fb669c50598f4e6cccbbf77e22fa9598aba78292b4d7'},\n {file = 'propcache-0.3.0-cp39-cp39-musllinux_1_2_x86_64.whl', hash = 'sha256:8526b0941ec5a40220fc4dfde76aed58808e2b309c03e9fa8e2260083ef7157f'},\n {file = 'propcache-0.3.0-cp39-cp39-win32.whl', hash = 'sha256:7cedd25e5f678f7738da38037435b340694ab34d424938041aa630d8bac42663'},\n {file = 'propcache-0.3.0-cp39-cp39-win_amd64.whl', hash = 'sha256:bf4298f366ca7e1ad1d21bbb58300a6985015909964077afd37559084590c929'},\n {file = 'propcache-0.3.0-py3-none-any.whl', hash = 'sha256:67dda3c7325691c2081510e92c561f465ba61b975f481735aefdfc845d2cd043'},\n {file = 'propcache-0.3.0.tar.gz', hash = 'sha256:a8fd93de4e1d278046345f49e2238cdb298589325849b2645d4a94c53faeffc5'},\n]\n\n[[package]]\nname = 'protobuf'\nversion = '5.29.4'\ndescription = ''\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'protobuf-5.29.4-cp310-abi3-win32.whl', hash = 'sha256:13eb236f8eb9ec34e63fc8b1d6efd2777d062fa6aaa68268fb67cf77f6839ad7'},\n {file = 'protobuf-5.29.4-cp310-abi3-win_amd64.whl', hash = 'sha256:bcefcdf3976233f8a502d265eb65ea740c989bacc6c30a58290ed0e519eb4b8d'},\n {file = 'protobuf-5.29.4-cp38-abi3-macosx_10_9_universal2.whl', hash = 'sha256:307ecba1d852ec237e9ba668e087326a67564ef83e45a0189a772ede9e854dd0'},\n {file = 'protobuf-5.29.4-cp38-abi3-manylinux2014_aarch64.whl', hash = 'sha256:aec4962f9ea93c431d5714ed1be1c93f13e1a8618e70035ba2b0564d9e633f2e'},\n {file = 'protobuf-5.29.4-cp38-abi3-manylinux2014_x86_64.whl', hash = 'sha256:d7d3f7d1d5a66ed4942d4fefb12ac4b14a29028b209d4bfb25c68ae172059922'},\n {file = 'protobuf-5.29.4-cp38-cp38-win32.whl', hash = 'sha256:1832f0515b62d12d8e6ffc078d7e9eb06969aa6dc13c13e1036e39d73bebc2de'},\n {file = 'protobuf-5.29.4-cp38-cp38-win_amd64.whl', hash = 'sha256:476cb7b14914c780605a8cf62e38c2a85f8caff2e28a6a0bad827ec7d6c85d68'},\n {file = 'protobuf-5.29.4-cp39-cp39-win32.whl', hash = 'sha256:fd32223020cb25a2cc100366f1dedc904e2d71d9322403224cdde5fdced0dabe'},\n {file = 'protobuf-5.29.4-cp39-cp39-win_amd64.whl', hash = 'sha256:678974e1e3a9b975b8bc2447fca458db5f93a2fb6b0c8db46b6675b5b5346812'},\n {file = 'protobuf-5.29.4-py3-none-any.whl', hash = 'sha256:3fde11b505e1597f71b875ef2fc52062b6a9740e5f7c8997ce878b6009145862'},\n {file = 'protobuf-5.29.4.tar.gz', hash = 'sha256:4f1dfcd7997b31ef8f53ec82781ff434a28bf71d9102ddde14d076adcfc78c99'},\n]\n\n[[package]]\nname = 'pydantic'\nversion = '2.10.6'\ndescription = 'Data validation using Python type hints'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'pydantic-2.10.6-py3-none-any.whl', hash = 'sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584'},\n {file = 'pydantic-2.10.6.tar.gz', hash = 'sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236'},\n]\n\n[package.dependencies]\nannotated-types = '>=0.6.0'\npydantic-core = '2.27.2'\ntyping-extensions = '>=4.12.2'\n\n[package.extras]\nemail = ['email-validator (>=2.0.0)']\ntimezone = ['tzdata']\n\n[[package]]\nname = 'pydantic-core'\nversion = '2.27.2'\ndescription = 'Core functionality for Pydantic validation and serialization'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl', hash = 'sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa'},\n {file = 'pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl', hash = 'sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c'},\n {file = 'pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a'},\n {file = 'pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl', hash = 'sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5'},\n {file = 'pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c'},\n {file = 'pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7'},\n {file = 'pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a'},\n {file = 'pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl', hash = 'sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236'},\n {file = 'pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl', hash = 'sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962'},\n {file = 'pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl', hash = 'sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9'},\n {file = 'pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl', hash = 'sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af'},\n {file = 'pydantic_core-2.27.2-cp310-cp310-win32.whl', hash = 'sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4'},\n {file = 'pydantic_core-2.27.2-cp310-cp310-win_amd64.whl', hash = 'sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl', hash = 'sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl', hash = 'sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl', hash = 'sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl', hash = 'sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl', hash = 'sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl', hash = 'sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl', hash = 'sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-win32.whl', hash = 'sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-win_amd64.whl', hash = 'sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc'},\n {file = 'pydantic_core-2.27.2-cp311-cp311-win_arm64.whl', hash = 'sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl', hash = 'sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl', hash = 'sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl', hash = 'sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl', hash = 'sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl', hash = 'sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl', hash = 'sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl', hash = 'sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-win32.whl', hash = 'sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-win_amd64.whl', hash = 'sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9'},\n {file = 'pydantic_core-2.27.2-cp312-cp312-win_arm64.whl', hash = 'sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl', hash = 'sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl', hash = 'sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl', hash = 'sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl', hash = 'sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl', hash = 'sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl', hash = 'sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl', hash = 'sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-win32.whl', hash = 'sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-win_amd64.whl', hash = 'sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee'},\n {file = 'pydantic_core-2.27.2-cp313-cp313-win_arm64.whl', hash = 'sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl', hash = 'sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl', hash = 'sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl', hash = 'sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl', hash = 'sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl', hash = 'sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl', hash = 'sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl', hash = 'sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-win32.whl', hash = 'sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b'},\n {file = 'pydantic_core-2.27.2-cp38-cp38-win_amd64.whl', hash = 'sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl', hash = 'sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl', hash = 'sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl', hash = 'sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl', hash = 'sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl', hash = 'sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl', hash = 'sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl', hash = 'sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-win32.whl', hash = 'sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e'},\n {file = 'pydantic_core-2.27.2-cp39-cp39-win_amd64.whl', hash = 'sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67'},\n {file = 'pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl', hash = 'sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e'},\n {file = 'pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl', hash = 'sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8'},\n {file = 'pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3'},\n {file = 'pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f'},\n {file = 'pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl', hash = 'sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133'},\n {file = 'pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl', hash = 'sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc'},\n {file = 'pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl', hash = 'sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50'},\n {file = 'pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl', hash = 'sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9'},\n {file = 'pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl', hash = 'sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151'},\n {file = 'pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl', hash = 'sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656'},\n {file = 'pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl', hash = 'sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278'},\n {file = 'pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb'},\n {file = 'pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd'},\n {file = 'pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl', hash = 'sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc'},\n {file = 'pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl', hash = 'sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b'},\n {file = 'pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl', hash = 'sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b'},\n {file = 'pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl', hash = 'sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2'},\n {file = 'pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl', hash = 'sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35'},\n {file = 'pydantic_core-2.27.2.tar.gz', hash = 'sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39'},\n]\n\n[package.dependencies]\ntyping-extensions = '>=4.6.0,<4.7.0 || >4.7.0'\n\n[[package]]\nname = 'pydantic-settings'\nversion = '2.8.1'\ndescription = 'Settings management using Pydantic'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'pydantic_settings-2.8.1-py3-none-any.whl', hash = 'sha256:81942d5ac3d905f7f3ee1a70df5dfb62d5569c12f51a5a647defc1c3d9ee2e9c'},\n {file = 'pydantic_settings-2.8.1.tar.gz', hash = 'sha256:d5c663dfbe9db9d5e1c646b2e161da12f0d734d422ee56f567d0ea2cee4e8585'},\n]\n\n[package.dependencies]\npydantic = '>=2.7.0'\npython-dotenv = '>=0.21.0'\n\n[package.extras]\nazure-key-vault = ['azure-identity (>=1.16.0)', 'azure-keyvault-secrets (>=4.8.0)']\ntoml = ['tomli (>=2.0.1)']\nyaml = ['pyyaml (>=6.0.1)']\n\n[[package]]\nname = 'python-dateutil'\nversion = '2.9.0.post0'\ndescription = 'Extensions to the standard Python datetime module'\noptional = false\npython-versions = '!=3.0.*,!=3.1.*,!=3.2.*,>=2.7'\ngroups = ['main']\nfiles = [\n {file = 'python-dateutil-2.9.0.post0.tar.gz', hash = 'sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3'},\n {file = 'python_dateutil-2.9.0.post0-py2.py3-none-any.whl', hash = 'sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427'},\n]\n\n[package.dependencies]\nsix = '>=1.5'\n\n[[package]]\nname = 'python-dotenv'\nversion = '1.0.1'\ndescription = 'Read key-value pairs from a .env file and set them as environment variables'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'python-dotenv-1.0.1.tar.gz', hash = 'sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca'},\n {file = 'python_dotenv-1.0.1-py3-none-any.whl', hash = 'sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a'},\n]\n\n[package.extras]\ncli = ['click (>=5.0)']\n\n[[package]]\nname = 'pyyaml'\nversion = '6.0.2'\ndescription = 'YAML parser and emitter for Python'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl', hash = 'sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086'},\n {file = 'PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl', hash = 'sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf'},\n {file = 'PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237'},\n {file = 'PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b'},\n {file = 'PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed'},\n {file = 'PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl', hash = 'sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180'},\n {file = 'PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl', hash = 'sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68'},\n {file = 'PyYAML-6.0.2-cp310-cp310-win32.whl', hash = 'sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99'},\n {file = 'PyYAML-6.0.2-cp310-cp310-win_amd64.whl', hash = 'sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e'},\n {file = 'PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl', hash = 'sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774'},\n {file = 'PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl', hash = 'sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee'},\n {file = 'PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c'},\n {file = 'PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317'},\n {file = 'PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85'},\n {file = 'PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl', hash = 'sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4'},\n {file = 'PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl', hash = 'sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e'},\n {file = 'PyYAML-6.0.2-cp311-cp311-win32.whl', hash = 'sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5'},\n {file = 'PyYAML-6.0.2-cp311-cp311-win_amd64.whl', hash = 'sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44'},\n {file = 'PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl', hash = 'sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab'},\n {file = 'PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl', hash = 'sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725'},\n {file = 'PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5'},\n {file = 'PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425'},\n {file = 'PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476'},\n {file = 'PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl', hash = 'sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48'},\n {file = 'PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl', hash = 'sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b'},\n {file = 'PyYAML-6.0.2-cp312-cp312-win32.whl', hash = 'sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4'},\n {file = 'PyYAML-6.0.2-cp312-cp312-win_amd64.whl', hash = 'sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8'},\n {file = 'PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl', hash = 'sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba'},\n {file = 'PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl', hash = 'sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1'},\n {file = 'PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133'},\n {file = 'PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484'},\n {file = 'PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5'},\n {file = 'PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl', hash = 'sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc'},\n {file = 'PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl', hash = 'sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652'},\n {file = 'PyYAML-6.0.2-cp313-cp313-win32.whl', hash = 'sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183'},\n {file = 'PyYAML-6.0.2-cp313-cp313-win_amd64.whl', hash = 'sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563'},\n {file = 'PyYAML-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl', hash = 'sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a'},\n {file = 'PyYAML-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5'},\n {file = 'PyYAML-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d'},\n {file = 'PyYAML-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083'},\n {file = 'PyYAML-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl', hash = 'sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706'},\n {file = 'PyYAML-6.0.2-cp38-cp38-win32.whl', hash = 'sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a'},\n {file = 'PyYAML-6.0.2-cp38-cp38-win_amd64.whl', hash = 'sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff'},\n {file = 'PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl', hash = 'sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d'},\n {file = 'PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl', hash = 'sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f'},\n {file = 'PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290'},\n {file = 'PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12'},\n {file = 'PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19'},\n {file = 'PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl', hash = 'sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e'},\n {file = 'PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl', hash = 'sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725'},\n {file = 'PyYAML-6.0.2-cp39-cp39-win32.whl', hash = 'sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631'},\n {file = 'PyYAML-6.0.2-cp39-cp39-win_amd64.whl', hash = 'sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8'},\n {file = 'pyyaml-6.0.2.tar.gz', hash = 'sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e'},\n]\n\n[[package]]\nname = 'setuptools'\nversion = '78.0.2'\ndescription = 'Easily download, build, install, upgrade, and uninstall Python packages'\noptional = false\npython-versions = '>=3.9'\ngroups = ['main']\nfiles = [\n {file = 'setuptools-78.0.2-py3-none-any.whl', hash = 'sha256:4a612c80e1f1d71b80e4906ce730152e8dec23df439f82731d9d0b608d7b700d'},\n {file = 'setuptools-78.0.2.tar.gz', hash = 'sha256:137525e6afb9022f019d6e884a319017f9bf879a0d8783985d32cbc8683cab93'},\n]\n\n[package.extras]\ncheck = ['pytest-checkdocs (>=2.4)', 'pytest-ruff (>=0.2.1)', 'ruff (>=0.8.0)']\ncore = ['importlib_metadata (>=6)', 'jaraco.functools (>=4)', 'jaraco.text (>=3.7)', 'more_itertools', 'more_itertools (>=8.8)', 'packaging (>=24.2)', 'platformdirs (>=4.2.2)', 'tomli (>=2.0.1)', 'wheel (>=0.43.0)']\ncover = ['pytest-cov']\ndoc = ['furo', 'jaraco.packaging (>=9.3)', 'jaraco.tidelift (>=1.4)', 'pygments-github-lexers (==0.0.5)', 'pyproject-hooks (!=1.1)', 'rst.linker (>=1.9)', 'sphinx (>=3.5)', 'sphinx-favicon', 'sphinx-inline-tabs', 'sphinx-lint', 'sphinx-notfound-page (>=1,<2)', 'sphinx-reredirects', 'sphinxcontrib-towncrier', 'towncrier (<24.7)']\nenabler = ['pytest-enabler (>=2.2)']\ntest = ['build[virtualenv] (>=1.0.3)', 'filelock (>=3.4.0)', 'ini2toml[lite] (>=0.14)', 'jaraco.develop (>=7.21)', 'jaraco.envs (>=2.2)', 'jaraco.path (>=3.7.2)', 'jaraco.test (>=5.5)', 'packaging (>=24.2)', 'pip (>=19.1)', 'pyproject-hooks (!=1.1)', 'pytest (>=6,!=8.1.*)', 'pytest-home (>=0.5)', 'pytest-perf', 'pytest-subprocess', 'pytest-timeout', 'pytest-xdist (>=3)', 'tomli-w (>=1.0.0)', 'virtualenv (>=13.0.0)', 'wheel (>=0.44.0)']\ntype = ['importlib_metadata (>=7.0.2)', 'jaraco.develop (>=7.21)', 'mypy (==1.14.*)', 'pytest-mypy']\n\n[[package]]\nname = 'six'\nversion = '1.17.0'\ndescription = 'Python 2 and 3 compatibility utilities'\noptional = false\npython-versions = '!=3.0.*,!=3.1.*,!=3.2.*,>=2.7'\ngroups = ['main']\nfiles = [\n {file = 'six-1.17.0-py2.py3-none-any.whl', hash = 'sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274'},\n {file = 'six-1.17.0.tar.gz', hash = 'sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81'},\n]\n\n[[package]]\nname = 'tenacity'\nversion = '9.0.0'\ndescription = 'Retry code until it succeeds'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'tenacity-9.0.0-py3-none-any.whl', hash = 'sha256:93de0c98785b27fcf659856aa9f54bfbd399e29969b0621bc7f762bd441b4539'},\n {file = 'tenacity-9.0.0.tar.gz', hash = 'sha256:807f37ca97d62aa361264d497b0e31e92b8027044942bfa756160d908320d73b'},\n]\n\n[package.extras]\ndoc = ['reno', 'sphinx']\ntest = ['pytest', 'tornado (>=4.5)', 'typeguard']\n\n[[package]]\nname = 'types-python-dateutil'\nversion = '2.9.0.20241206'\ndescription = 'Typing stubs for python-dateutil'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'types_python_dateutil-2.9.0.20241206-py3-none-any.whl', hash = 'sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53'},\n {file = 'types_python_dateutil-2.9.0.20241206.tar.gz', hash = 'sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb'},\n]\n\n[[package]]\nname = 'types-pyyaml'\nversion = '6.0.12.20241230'\ndescription = 'Typing stubs for PyYAML'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'types_PyYAML-6.0.12.20241230-py3-none-any.whl', hash = 'sha256:fa4d32565219b68e6dee5f67534c722e53c00d1cfc09c435ef04d7353e1e96e6'},\n {file = 'types_pyyaml-6.0.12.20241230.tar.gz', hash = 'sha256:7f07622dbd34bb9c8b264fe860a17e0efcad00d50b5f27e93984909d9363498c'},\n]\n\n[[package]]\nname = 'typing-extensions'\nversion = '4.12.2'\ndescription = 'Backported and Experimental Type Hints for Python 3.8+'\noptional = false\npython-versions = '>=3.8'\ngroups = ['main']\nfiles = [\n {file = 'typing_extensions-4.12.2-py3-none-any.whl', hash = 'sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d'},\n {file = 'typing_extensions-4.12.2.tar.gz', hash = 'sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8'},\n]\n\n[[package]]\nname = 'urllib3'\nversion = '2.3.0'\ndescription = 'HTTP library with thread-safe connection pooling, file post, and more.'\noptional = false\npython-versions = '>=3.9'\ngroups = ['main']\nfiles = [\n {file = 'urllib3-2.3.0-py3-none-any.whl', hash = 'sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df'},\n {file = 'urllib3-2.3.0.tar.gz', hash = 'sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d'},\n]\n\n[package.extras]\nbrotli = ['brotli (>=1.0.9)', 'brotlicffi (>=0.8.0)']\nh2 = ['h2 (>=4,<5)']\nsocks = ['pysocks (>=1.5.6,!=1.5.7,<2.0)']\nzstd = ['zstandard (>=0.18.0)']\n\n[[package]]\nname = 'yarl'\nversion = '1.18.3'\ndescription = 'Yet another URL library'\noptional = false\npython-versions = '>=3.9'\ngroups = ['main']\nfiles = [\n {file = 'yarl-1.18.3-cp310-cp310-macosx_10_9_universal2.whl', hash = 'sha256:7df647e8edd71f000a5208fe6ff8c382a1de8edfbccdbbfe649d263de07d8c34'},\n {file = 'yarl-1.18.3-cp310-cp310-macosx_10_9_x86_64.whl', hash = 'sha256:c69697d3adff5aa4f874b19c0e4ed65180ceed6318ec856ebc423aa5850d84f7'},\n {file = 'yarl-1.18.3-cp310-cp310-macosx_11_0_arm64.whl', hash = 'sha256:602d98f2c2d929f8e697ed274fbadc09902c4025c5a9963bf4e9edfc3ab6f7ed'},\n {file = 'yarl-1.18.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:c654d5207c78e0bd6d749f6dae1dcbbfde3403ad3a4b11f3c5544d9906969dde'},\n {file = 'yarl-1.18.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:5094d9206c64181d0f6e76ebd8fb2f8fe274950a63890ee9e0ebfd58bf9d787b'},\n {file = 'yarl-1.18.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:35098b24e0327fc4ebdc8ffe336cee0a87a700c24ffed13161af80124b7dc8e5'},\n {file = 'yarl-1.18.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:3236da9272872443f81fedc389bace88408f64f89f75d1bdb2256069a8730ccc'},\n {file = 'yarl-1.18.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:e2c08cc9b16f4f4bc522771d96734c7901e7ebef70c6c5c35dd0f10845270bcd'},\n {file = 'yarl-1.18.3-cp310-cp310-musllinux_1_2_aarch64.whl', hash = 'sha256:80316a8bd5109320d38eef8833ccf5f89608c9107d02d2a7f985f98ed6876990'},\n {file = 'yarl-1.18.3-cp310-cp310-musllinux_1_2_armv7l.whl', hash = 'sha256:c1e1cc06da1491e6734f0ea1e6294ce00792193c463350626571c287c9a704db'},\n {file = 'yarl-1.18.3-cp310-cp310-musllinux_1_2_i686.whl', hash = 'sha256:fea09ca13323376a2fdfb353a5fa2e59f90cd18d7ca4eaa1fd31f0a8b4f91e62'},\n {file = 'yarl-1.18.3-cp310-cp310-musllinux_1_2_ppc64le.whl', hash = 'sha256:e3b9fd71836999aad54084906f8663dffcd2a7fb5cdafd6c37713b2e72be1760'},\n {file = 'yarl-1.18.3-cp310-cp310-musllinux_1_2_s390x.whl', hash = 'sha256:757e81cae69244257d125ff31663249b3013b5dc0a8520d73694aed497fb195b'},\n {file = 'yarl-1.18.3-cp310-cp310-musllinux_1_2_x86_64.whl', hash = 'sha256:b1771de9944d875f1b98a745bc547e684b863abf8f8287da8466cf470ef52690'},\n {file = 'yarl-1.18.3-cp310-cp310-win32.whl', hash = 'sha256:8874027a53e3aea659a6d62751800cf6e63314c160fd607489ba5c2edd753cf6'},\n {file = 'yarl-1.18.3-cp310-cp310-win_amd64.whl', hash = 'sha256:93b2e109287f93db79210f86deb6b9bbb81ac32fc97236b16f7433db7fc437d8'},\n {file = 'yarl-1.18.3-cp311-cp311-macosx_10_9_universal2.whl', hash = 'sha256:8503ad47387b8ebd39cbbbdf0bf113e17330ffd339ba1144074da24c545f0069'},\n {file = 'yarl-1.18.3-cp311-cp311-macosx_10_9_x86_64.whl', hash = 'sha256:02ddb6756f8f4517a2d5e99d8b2f272488e18dd0bfbc802f31c16c6c20f22193'},\n {file = 'yarl-1.18.3-cp311-cp311-macosx_11_0_arm64.whl', hash = 'sha256:67a283dd2882ac98cc6318384f565bffc751ab564605959df4752d42483ad889'},\n {file = 'yarl-1.18.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:d980e0325b6eddc81331d3f4551e2a333999fb176fd153e075c6d1c2530aa8a8'},\n {file = 'yarl-1.18.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:b643562c12680b01e17239be267bc306bbc6aac1f34f6444d1bded0c5ce438ca'},\n {file = 'yarl-1.18.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:c017a3b6df3a1bd45b9fa49a0f54005e53fbcad16633870104b66fa1a30a29d8'},\n {file = 'yarl-1.18.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:75674776d96d7b851b6498f17824ba17849d790a44d282929c42dbb77d4f17ae'},\n {file = 'yarl-1.18.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:ccaa3a4b521b780a7e771cc336a2dba389a0861592bbce09a476190bb0c8b4b3'},\n {file = 'yarl-1.18.3-cp311-cp311-musllinux_1_2_aarch64.whl', hash = 'sha256:2d06d3005e668744e11ed80812e61efd77d70bb7f03e33c1598c301eea20efbb'},\n {file = 'yarl-1.18.3-cp311-cp311-musllinux_1_2_armv7l.whl', hash = 'sha256:9d41beda9dc97ca9ab0b9888cb71f7539124bc05df02c0cff6e5acc5a19dcc6e'},\n {file = 'yarl-1.18.3-cp311-cp311-musllinux_1_2_i686.whl', hash = 'sha256:ba23302c0c61a9999784e73809427c9dbedd79f66a13d84ad1b1943802eaaf59'},\n {file = 'yarl-1.18.3-cp311-cp311-musllinux_1_2_ppc64le.whl', hash = 'sha256:6748dbf9bfa5ba1afcc7556b71cda0d7ce5f24768043a02a58846e4a443d808d'},\n {file = 'yarl-1.18.3-cp311-cp311-musllinux_1_2_s390x.whl', hash = 'sha256:0b0cad37311123211dc91eadcb322ef4d4a66008d3e1bdc404808992260e1a0e'},\n {file = 'yarl-1.18.3-cp311-cp311-musllinux_1_2_x86_64.whl', hash = 'sha256:0fb2171a4486bb075316ee754c6d8382ea6eb8b399d4ec62fde2b591f879778a'},\n {file = 'yarl-1.18.3-cp311-cp311-win32.whl', hash = 'sha256:61b1a825a13bef4a5f10b1885245377d3cd0bf87cba068e1d9a88c2ae36880e1'},\n {file = 'yarl-1.18.3-cp311-cp311-win_amd64.whl', hash = 'sha256:b9d60031cf568c627d028239693fd718025719c02c9f55df0a53e587aab951b5'},\n {file = 'yarl-1.18.3-cp312-cp312-macosx_10_13_universal2.whl', hash = 'sha256:1dd4bdd05407ced96fed3d7f25dbbf88d2ffb045a0db60dbc247f5b3c5c25d50'},\n {file = 'yarl-1.18.3-cp312-cp312-macosx_10_13_x86_64.whl', hash = 'sha256:7c33dd1931a95e5d9a772d0ac5e44cac8957eaf58e3c8da8c1414de7dd27c576'},\n {file = 'yarl-1.18.3-cp312-cp312-macosx_11_0_arm64.whl', hash = 'sha256:25b411eddcfd56a2f0cd6a384e9f4f7aa3efee14b188de13048c25b5e91f1640'},\n {file = 'yarl-1.18.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:436c4fc0a4d66b2badc6c5fc5ef4e47bb10e4fd9bf0c79524ac719a01f3607c2'},\n {file = 'yarl-1.18.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:e35ef8683211db69ffe129a25d5634319a677570ab6b2eba4afa860f54eeaf75'},\n {file = 'yarl-1.18.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:84b2deecba4a3f1a398df819151eb72d29bfeb3b69abb145a00ddc8d30094512'},\n {file = 'yarl-1.18.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:00e5a1fea0fd4f5bfa7440a47eff01d9822a65b4488f7cff83155a0f31a2ecba'},\n {file = 'yarl-1.18.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:d0e883008013c0e4aef84dcfe2a0b172c4d23c2669412cf5b3371003941f72bb'},\n {file = 'yarl-1.18.3-cp312-cp312-musllinux_1_2_aarch64.whl', hash = 'sha256:5a3f356548e34a70b0172d8890006c37be92995f62d95a07b4a42e90fba54272'},\n {file = 'yarl-1.18.3-cp312-cp312-musllinux_1_2_armv7l.whl', hash = 'sha256:ccd17349166b1bee6e529b4add61727d3f55edb7babbe4069b5764c9587a8cc6'},\n {file = 'yarl-1.18.3-cp312-cp312-musllinux_1_2_i686.whl', hash = 'sha256:b958ddd075ddba5b09bb0be8a6d9906d2ce933aee81100db289badbeb966f54e'},\n {file = 'yarl-1.18.3-cp312-cp312-musllinux_1_2_ppc64le.whl', hash = 'sha256:c7d79f7d9aabd6011004e33b22bc13056a3e3fb54794d138af57f5ee9d9032cb'},\n {file = 'yarl-1.18.3-cp312-cp312-musllinux_1_2_s390x.whl', hash = 'sha256:4891ed92157e5430874dad17b15eb1fda57627710756c27422200c52d8a4e393'},\n {file = 'yarl-1.18.3-cp312-cp312-musllinux_1_2_x86_64.whl', hash = 'sha256:ce1af883b94304f493698b00d0f006d56aea98aeb49d75ec7d98cd4a777e9285'},\n {file = 'yarl-1.18.3-cp312-cp312-win32.whl', hash = 'sha256:f91c4803173928a25e1a55b943c81f55b8872f0018be83e3ad4938adffb77dd2'},\n {file = 'yarl-1.18.3-cp312-cp312-win_amd64.whl', hash = 'sha256:7e2ee16578af3b52ac2f334c3b1f92262f47e02cc6193c598502bd46f5cd1477'},\n {file = 'yarl-1.18.3-cp313-cp313-macosx_10_13_universal2.whl', hash = 'sha256:90adb47ad432332d4f0bc28f83a5963f426ce9a1a8809f5e584e704b82685dcb'},\n {file = 'yarl-1.18.3-cp313-cp313-macosx_10_13_x86_64.whl', hash = 'sha256:913829534200eb0f789d45349e55203a091f45c37a2674678744ae52fae23efa'},\n {file = 'yarl-1.18.3-cp313-cp313-macosx_11_0_arm64.whl', hash = 'sha256:ef9f7768395923c3039055c14334ba4d926f3baf7b776c923c93d80195624782'},\n {file = 'yarl-1.18.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:88a19f62ff30117e706ebc9090b8ecc79aeb77d0b1f5ec10d2d27a12bc9f66d0'},\n {file = 'yarl-1.18.3-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:e17c9361d46a4d5addf777c6dd5eab0715a7684c2f11b88c67ac37edfba6c482'},\n {file = 'yarl-1.18.3-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:1a74a13a4c857a84a845505fd2d68e54826a2cd01935a96efb1e9d86c728e186'},\n {file = 'yarl-1.18.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:41f7ce59d6ee7741af71d82020346af364949314ed3d87553763a2df1829cc58'},\n {file = 'yarl-1.18.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:f52a265001d830bc425f82ca9eabda94a64a4d753b07d623a9f2863fde532b53'},\n {file = 'yarl-1.18.3-cp313-cp313-musllinux_1_2_aarch64.whl', hash = 'sha256:82123d0c954dc58db301f5021a01854a85bf1f3bb7d12ae0c01afc414a882ca2'},\n {file = 'yarl-1.18.3-cp313-cp313-musllinux_1_2_armv7l.whl', hash = 'sha256:2ec9bbba33b2d00999af4631a3397d1fd78290c48e2a3e52d8dd72db3a067ac8'},\n {file = 'yarl-1.18.3-cp313-cp313-musllinux_1_2_i686.whl', hash = 'sha256:fbd6748e8ab9b41171bb95c6142faf068f5ef1511935a0aa07025438dd9a9bc1'},\n {file = 'yarl-1.18.3-cp313-cp313-musllinux_1_2_ppc64le.whl', hash = 'sha256:877d209b6aebeb5b16c42cbb377f5f94d9e556626b1bfff66d7b0d115be88d0a'},\n {file = 'yarl-1.18.3-cp313-cp313-musllinux_1_2_s390x.whl', hash = 'sha256:b464c4ab4bfcb41e3bfd3f1c26600d038376c2de3297760dfe064d2cb7ea8e10'},\n {file = 'yarl-1.18.3-cp313-cp313-musllinux_1_2_x86_64.whl', hash = 'sha256:8d39d351e7faf01483cc7ff7c0213c412e38e5a340238826be7e0e4da450fdc8'},\n {file = 'yarl-1.18.3-cp313-cp313-win32.whl', hash = 'sha256:61ee62ead9b68b9123ec24bc866cbef297dd266175d53296e2db5e7f797f902d'},\n {file = 'yarl-1.18.3-cp313-cp313-win_amd64.whl', hash = 'sha256:578e281c393af575879990861823ef19d66e2b1d0098414855dd367e234f5b3c'},\n {file = 'yarl-1.18.3-cp39-cp39-macosx_10_9_universal2.whl', hash = 'sha256:61e5e68cb65ac8f547f6b5ef933f510134a6bf31bb178be428994b0cb46c2a04'},\n {file = 'yarl-1.18.3-cp39-cp39-macosx_10_9_x86_64.whl', hash = 'sha256:fe57328fbc1bfd0bd0514470ac692630f3901c0ee39052ae47acd1d90a436719'},\n {file = 'yarl-1.18.3-cp39-cp39-macosx_11_0_arm64.whl', hash = 'sha256:a440a2a624683108a1b454705ecd7afc1c3438a08e890a1513d468671d90a04e'},\n {file = 'yarl-1.18.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl', hash = 'sha256:09c7907c8548bcd6ab860e5f513e727c53b4a714f459b084f6580b49fa1b9cee'},\n {file = 'yarl-1.18.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl', hash = 'sha256:b4f6450109834af88cb4cc5ecddfc5380ebb9c228695afc11915a0bf82116789'},\n {file = 'yarl-1.18.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl', hash = 'sha256:a9ca04806f3be0ac6d558fffc2fdf8fcef767e0489d2684a21912cc4ed0cd1b8'},\n {file = 'yarl-1.18.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl', hash = 'sha256:77a6e85b90a7641d2e07184df5557132a337f136250caafc9ccaa4a2a998ca2c'},\n {file = 'yarl-1.18.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl', hash = 'sha256:6333c5a377c8e2f5fae35e7b8f145c617b02c939d04110c76f29ee3676b5f9a5'},\n {file = 'yarl-1.18.3-cp39-cp39-musllinux_1_2_aarch64.whl', hash = 'sha256:0b3c92fa08759dbf12b3a59579a4096ba9af8dd344d9a813fc7f5070d86bbab1'},\n {file = 'yarl-1.18.3-cp39-cp39-musllinux_1_2_armv7l.whl', hash = 'sha256:4ac515b860c36becb81bb84b667466885096b5fc85596948548b667da3bf9f24'},\n {file = 'yarl-1.18.3-cp39-cp39-musllinux_1_2_i686.whl', hash = 'sha256:045b8482ce9483ada4f3f23b3774f4e1bf4f23a2d5c912ed5170f68efb053318'},\n {file = 'yarl-1.18.3-cp39-cp39-musllinux_1_2_ppc64le.whl', hash = 'sha256:a4bb030cf46a434ec0225bddbebd4b89e6471814ca851abb8696170adb163985'},\n {file = 'yarl-1.18.3-cp39-cp39-musllinux_1_2_s390x.whl', hash = 'sha256:54d6921f07555713b9300bee9c50fb46e57e2e639027089b1d795ecd9f7fa910'},\n {file = 'yarl-1.18.3-cp39-cp39-musllinux_1_2_x86_64.whl', hash = 'sha256:1d407181cfa6e70077df3377938c08012d18893f9f20e92f7d2f314a437c30b1'},\n {file = 'yarl-1.18.3-cp39-cp39-win32.whl', hash = 'sha256:ac36703a585e0929b032fbaab0707b75dc12703766d0b53486eabd5139ebadd5'},\n {file = 'yarl-1.18.3-cp39-cp39-win_amd64.whl', hash = 'sha256:ba87babd629f8af77f557b61e49e7c7cac36f22f871156b91e10a6e9d4f829e9'},\n {file = 'yarl-1.18.3-py3-none-any.whl', hash = 'sha256:b57f4f58099328dfb26c6a771d09fb20dbbae81d20cfb66141251ea063bd101b'},\n {file = 'yarl-1.18.3.tar.gz', hash = 'sha256:ac1801c45cbf77b6c99242eeff4fffb5e4e73a800b5c4ad4fc0be5def634d2e1'},\n]\n\n[package.dependencies]\nidna = '>=2.0'\nmultidict = '>=4.0'\npropcache = '>=0.2.0'\n\n[metadata]\nlock-version = '2.1'\npython-versions = '^3.10'\ncontent-hash = '74c12e499aa797ca5c8559af579f1212b0e4e3a77f068f9385db39d70ba304e0'\n", + '# This file is automatically @generated by Poetry 2.0.0 and should not be changed by hand.\n\n[[package]]\nname = "aiohappyeyeballs"\nversion = "2.6.1"\ndescription = "Happy Eyeballs for asyncio"\noptional = false\npython-versions = ">=3.9"\ngroups = ["main"]\nfiles = [\n {file = "aiohappyeyeballs-2.6.1-py3-none-any.whl", hash = "sha256:f349ba8f4b75cb25c99c5c2d84e997e485204d2902a9597802b0371f09331fb8"},\n {file = "aiohappyeyeballs-2.6.1.tar.gz", hash = "sha256:c3f9d0113123803ccadfdf3f0faa505bc78e6a72d1cc4806cbd719826e943558"},\n]\n\n[[package]]\nname = "aiohttp"\nversion = "3.11.14"\ndescription = "Async http client/server framework (asyncio)"\noptional = false\npython-versions = ">=3.9"\ngroups = ["main"]\nfiles = [\n {file = "aiohttp-3.11.14-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e2bc827c01f75803de77b134afdbf74fa74b62970eafdf190f3244931d7a5c0d"},\n {file = "aiohttp-3.11.14-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e365034c5cf6cf74f57420b57682ea79e19eb29033399dd3f40de4d0171998fa"},\n {file = "aiohttp-3.11.14-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c32593ead1a8c6aabd58f9d7ee706e48beac796bb0cb71d6b60f2c1056f0a65f"},\n {file = "aiohttp-3.11.14-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b4e7c7ec4146a94a307ca4f112802a8e26d969018fabed526efc340d21d3e7d0"},\n {file = "aiohttp-3.11.14-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c8b2df9feac55043759aa89f722a967d977d80f8b5865a4153fc41c93b957efc"},\n {file = "aiohttp-3.11.14-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c7571f99525c76a6280f5fe8e194eeb8cb4da55586c3c61c59c33a33f10cfce7"},\n {file = "aiohttp-3.11.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b59d096b5537ec7c85954cb97d821aae35cfccce3357a2cafe85660cc6295628"},\n {file = "aiohttp-3.11.14-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b42dbd097abb44b3f1156b4bf978ec5853840802d6eee2784857be11ee82c6a0"},\n {file = "aiohttp-3.11.14-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b05774864c87210c531b48dfeb2f7659407c2dda8643104fb4ae5e2c311d12d9"},\n {file = "aiohttp-3.11.14-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:4e2e8ef37d4bc110917d038807ee3af82700a93ab2ba5687afae5271b8bc50ff"},\n {file = "aiohttp-3.11.14-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e9faafa74dbb906b2b6f3eb9942352e9e9db8d583ffed4be618a89bd71a4e914"},\n {file = "aiohttp-3.11.14-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:7e7abe865504f41b10777ac162c727af14e9f4db9262e3ed8254179053f63e6d"},\n {file = "aiohttp-3.11.14-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:4848ae31ad44330b30f16c71e4f586cd5402a846b11264c412de99fa768f00f3"},\n {file = "aiohttp-3.11.14-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2d0b46abee5b5737cb479cc9139b29f010a37b1875ee56d142aefc10686a390b"},\n {file = "aiohttp-3.11.14-cp310-cp310-win32.whl", hash = "sha256:a0d2c04a623ab83963576548ce098baf711a18e2c32c542b62322a0b4584b990"},\n {file = "aiohttp-3.11.14-cp310-cp310-win_amd64.whl", hash = "sha256:5409a59d5057f2386bb8b8f8bbcfb6e15505cedd8b2445db510563b5d7ea1186"},\n {file = "aiohttp-3.11.14-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f296d637a50bb15fb6a229fbb0eb053080e703b53dbfe55b1e4bb1c5ed25d325"},\n {file = "aiohttp-3.11.14-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ec6cd1954ca2bbf0970f531a628da1b1338f594bf5da7e361e19ba163ecc4f3b"},\n {file = "aiohttp-3.11.14-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:572def4aad0a4775af66d5a2b5923c7de0820ecaeeb7987dcbccda2a735a993f"},\n {file = "aiohttp-3.11.14-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c68e41c4d576cd6aa6c6d2eddfb32b2acfb07ebfbb4f9da991da26633a3db1a"},\n {file = "aiohttp-3.11.14-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99b8bbfc8111826aa8363442c0fc1f5751456b008737ff053570f06a151650b3"},\n {file = "aiohttp-3.11.14-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b0a200e85da5c966277a402736a96457b882360aa15416bf104ca81e6f5807b"},\n {file = "aiohttp-3.11.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d173c0ac508a2175f7c9a115a50db5fd3e35190d96fdd1a17f9cb10a6ab09aa1"},\n {file = "aiohttp-3.11.14-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:413fe39fd929329f697f41ad67936f379cba06fcd4c462b62e5b0f8061ee4a77"},\n {file = "aiohttp-3.11.14-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:65c75b14ee74e8eeff2886321e76188cbe938d18c85cff349d948430179ad02c"},\n {file = "aiohttp-3.11.14-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:321238a42ed463848f06e291c4bbfb3d15ba5a79221a82c502da3e23d7525d06"},\n {file = "aiohttp-3.11.14-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:59a05cdc636431f7ce843c7c2f04772437dd816a5289f16440b19441be6511f1"},\n {file = "aiohttp-3.11.14-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:daf20d9c3b12ae0fdf15ed92235e190f8284945563c4b8ad95b2d7a31f331cd3"},\n {file = "aiohttp-3.11.14-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:05582cb2d156ac7506e68b5eac83179faedad74522ed88f88e5861b78740dc0e"},\n {file = "aiohttp-3.11.14-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:12c5869e7ddf6b4b1f2109702b3cd7515667b437da90a5a4a50ba1354fe41881"},\n {file = "aiohttp-3.11.14-cp311-cp311-win32.whl", hash = "sha256:92868f6512714efd4a6d6cb2bfc4903b997b36b97baea85f744229f18d12755e"},\n {file = "aiohttp-3.11.14-cp311-cp311-win_amd64.whl", hash = "sha256:bccd2cb7aa5a3bfada72681bdb91637094d81639e116eac368f8b3874620a654"},\n {file = "aiohttp-3.11.14-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:70ab0f61c1a73d3e0342cedd9a7321425c27a7067bebeeacd509f96695b875fc"},\n {file = "aiohttp-3.11.14-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:602d4db80daf4497de93cb1ce00b8fc79969c0a7cf5b67bec96fa939268d806a"},\n {file = "aiohttp-3.11.14-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3a8a0d127c10b8d89e69bbd3430da0f73946d839e65fec00ae48ca7916a31948"},\n {file = "aiohttp-3.11.14-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca9f835cdfedcb3f5947304e85b8ca3ace31eef6346d8027a97f4de5fb687534"},\n {file = "aiohttp-3.11.14-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8aa5c68e1e68fff7cd3142288101deb4316b51f03d50c92de6ea5ce646e6c71f"},\n {file = "aiohttp-3.11.14-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3b512f1de1c688f88dbe1b8bb1283f7fbeb7a2b2b26e743bb2193cbadfa6f307"},\n {file = "aiohttp-3.11.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cc9253069158d57e27d47a8453d8a2c5a370dc461374111b5184cf2f147a3cc3"},\n {file = "aiohttp-3.11.14-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0b2501f1b981e70932b4a552fc9b3c942991c7ae429ea117e8fba57718cdeed0"},\n {file = "aiohttp-3.11.14-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:28a3d083819741592685762d51d789e6155411277050d08066537c5edc4066e6"},\n {file = "aiohttp-3.11.14-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:0df3788187559c262922846087e36228b75987f3ae31dd0a1e5ee1034090d42f"},\n {file = "aiohttp-3.11.14-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:9e73fa341d8b308bb799cf0ab6f55fc0461d27a9fa3e4582755a3d81a6af8c09"},\n {file = "aiohttp-3.11.14-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:51ba80d473eb780a329d73ac8afa44aa71dfb521693ccea1dea8b9b5c4df45ce"},\n {file = "aiohttp-3.11.14-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:8d1dd75aa4d855c7debaf1ef830ff2dfcc33f893c7db0af2423ee761ebffd22b"},\n {file = "aiohttp-3.11.14-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41cf0cefd9e7b5c646c2ef529c8335e7eafd326f444cc1cdb0c47b6bc836f9be"},\n {file = "aiohttp-3.11.14-cp312-cp312-win32.whl", hash = "sha256:948abc8952aff63de7b2c83bfe3f211c727da3a33c3a5866a0e2cf1ee1aa950f"},\n {file = "aiohttp-3.11.14-cp312-cp312-win_amd64.whl", hash = "sha256:3b420d076a46f41ea48e5fcccb996f517af0d406267e31e6716f480a3d50d65c"},\n {file = "aiohttp-3.11.14-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8d14e274828561db91e4178f0057a915f3af1757b94c2ca283cb34cbb6e00b50"},\n {file = "aiohttp-3.11.14-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f30fc72daf85486cdcdfc3f5e0aea9255493ef499e31582b34abadbfaafb0965"},\n {file = "aiohttp-3.11.14-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:4edcbe34e6dba0136e4cabf7568f5a434d89cc9de5d5155371acda275353d228"},\n {file = "aiohttp-3.11.14-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a7169ded15505f55a87f8f0812c94c9412623c744227b9e51083a72a48b68a5"},\n {file = "aiohttp-3.11.14-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ad1f2fb9fe9b585ea4b436d6e998e71b50d2b087b694ab277b30e060c434e5db"},\n {file = "aiohttp-3.11.14-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:20412c7cc3720e47a47e63c0005f78c0c2370020f9f4770d7fc0075f397a9fb0"},\n {file = "aiohttp-3.11.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6dd9766da617855f7e85f27d2bf9a565ace04ba7c387323cd3e651ac4329db91"},\n {file = "aiohttp-3.11.14-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:599b66582f7276ebefbaa38adf37585e636b6a7a73382eb412f7bc0fc55fb73d"},\n {file = "aiohttp-3.11.14-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b41693b7388324b80f9acfabd479bd1c84f0bc7e8f17bab4ecd9675e9ff9c734"},\n {file = "aiohttp-3.11.14-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:86135c32d06927339c8c5e64f96e4eee8825d928374b9b71a3c42379d7437058"},\n {file = "aiohttp-3.11.14-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:04eb541ce1e03edc1e3be1917a0f45ac703e913c21a940111df73a2c2db11d73"},\n {file = "aiohttp-3.11.14-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:dc311634f6f28661a76cbc1c28ecf3b3a70a8edd67b69288ab7ca91058eb5a33"},\n {file = "aiohttp-3.11.14-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:69bb252bfdca385ccabfd55f4cd740d421dd8c8ad438ded9637d81c228d0da49"},\n {file = "aiohttp-3.11.14-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:2b86efe23684b58a88e530c4ab5b20145f102916bbb2d82942cafec7bd36a647"},\n {file = "aiohttp-3.11.14-cp313-cp313-win32.whl", hash = "sha256:b9c60d1de973ca94af02053d9b5111c4fbf97158e139b14f1be68337be267be6"},\n {file = "aiohttp-3.11.14-cp313-cp313-win_amd64.whl", hash = "sha256:0a29be28e60e5610d2437b5b2fed61d6f3dcde898b57fb048aa5079271e7f6f3"},\n {file = "aiohttp-3.11.14-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:14fc03508359334edc76d35b2821832f092c8f092e4b356e74e38419dfe7b6de"},\n {file = "aiohttp-3.11.14-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:92007c89a8cb7be35befa2732b0b32bf3a394c1b22ef2dff0ef12537d98a7bda"},\n {file = "aiohttp-3.11.14-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6d3986112e34eaa36e280dc8286b9dd4cc1a5bcf328a7f147453e188f6fe148f"},\n {file = "aiohttp-3.11.14-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:749f1eb10e51dbbcdba9df2ef457ec060554842eea4d23874a3e26495f9e87b1"},\n {file = "aiohttp-3.11.14-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:781c8bd423dcc4641298c8c5a2a125c8b1c31e11f828e8d35c1d3a722af4c15a"},\n {file = "aiohttp-3.11.14-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:997b57e38aa7dc6caab843c5e042ab557bc83a2f91b7bd302e3c3aebbb9042a1"},\n {file = "aiohttp-3.11.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a8b0321e40a833e381d127be993b7349d1564b756910b28b5f6588a159afef3"},\n {file = "aiohttp-3.11.14-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8778620396e554b758b59773ab29c03b55047841d8894c5e335f12bfc45ebd28"},\n {file = "aiohttp-3.11.14-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:e906da0f2bcbf9b26cc2b144929e88cb3bf943dd1942b4e5af066056875c7618"},\n {file = "aiohttp-3.11.14-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:87f0e003fb4dd5810c7fbf47a1239eaa34cd929ef160e0a54c570883125c4831"},\n {file = "aiohttp-3.11.14-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:7f2dadece8b85596ac3ab1ec04b00694bdd62abc31e5618f524648d18d9dd7fa"},\n {file = "aiohttp-3.11.14-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:fe846f0a98aa9913c2852b630cd39b4098f296e0907dd05f6c7b30d911afa4c3"},\n {file = "aiohttp-3.11.14-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ced66c5c6ad5bcaf9be54560398654779ec1c3695f1a9cf0ae5e3606694a000a"},\n {file = "aiohttp-3.11.14-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a40087b82f83bd671cbeb5f582c233d196e9653220404a798798bfc0ee189fff"},\n {file = "aiohttp-3.11.14-cp39-cp39-win32.whl", hash = "sha256:95d7787f2bcbf7cb46823036a8d64ccfbc2ffc7d52016b4044d901abceeba3db"},\n {file = "aiohttp-3.11.14-cp39-cp39-win_amd64.whl", hash = "sha256:22a8107896877212130c58f74e64b77f7007cb03cea8698be317272643602d45"},\n {file = "aiohttp-3.11.14.tar.gz", hash = "sha256:d6edc538c7480fa0a3b2bdd705f8010062d74700198da55d16498e1b49549b9c"},\n]\n\n[package.dependencies]\naiohappyeyeballs = ">=2.3.0"\naiosignal = ">=1.1.2"\nasync-timeout = {version = ">=4.0,<6.0", markers = "python_version < \\"3.11\\""}\nattrs = ">=17.3.0"\nfrozenlist = ">=1.1.1"\nmultidict = ">=4.5,<7.0"\npropcache = ">=0.2.0"\nyarl = ">=1.17.0,<2.0"\n\n[package.extras]\nspeedups = ["Brotli", "aiodns (>=3.2.0)", "brotlicffi"]\n\n[[package]]\nname = "aiohttp-retry"\nversion = "2.9.1"\ndescription = "Simple retry client for aiohttp"\noptional = false\npython-versions = ">=3.7"\ngroups = ["main"]\nfiles = [\n {file = "aiohttp_retry-2.9.1-py3-none-any.whl", hash = "sha256:66d2759d1921838256a05a3f80ad7e724936f083e35be5abb5e16eed6be6dc54"},\n {file = "aiohttp_retry-2.9.1.tar.gz", hash = "sha256:8eb75e904ed4ee5c2ec242fefe85bf04240f685391c4879d8f541d6028ff01f1"},\n]\n\n[package.dependencies]\naiohttp = "*"\n\n[[package]]\nname = "aiosignal"\nversion = "1.3.2"\ndescription = "aiosignal: a list of registered asynchronous callbacks"\noptional = false\npython-versions = ">=3.9"\ngroups = ["main"]\nfiles = [\n {file = "aiosignal-1.3.2-py2.py3-none-any.whl", hash = "sha256:45cde58e409a301715980c2b01d0c28bdde3770d8290b5eb2173759d9acb31a5"},\n {file = "aiosignal-1.3.2.tar.gz", hash = "sha256:a8c255c66fafb1e499c9351d0bf32ff2d8a0321595ebac3b93713656d2436f54"},\n]\n\n[package.dependencies]\nfrozenlist = ">=1.1.0"\n\n[[package]]\nname = "aiostream"\nversion = "0.5.2"\ndescription = "Generator-based operators for asynchronous iteration"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "aiostream-0.5.2-py3-none-any.whl", hash = "sha256:054660370be9d37f6fe3ece3851009240416bd082e469fd90cc8673d3818cf71"},\n {file = "aiostream-0.5.2.tar.gz", hash = "sha256:b71b519a2d66c38f0872403ab86417955b77352f08d9ad02ad46fc3926b389f4"},\n]\n\n[package.dependencies]\ntyping-extensions = "*"\n\n[[package]]\nname = "annotated-types"\nversion = "0.7.0"\ndescription = "Reusable constraint types to use with typing.Annotated"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"},\n {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"},\n]\n\n[[package]]\nname = "async-timeout"\nversion = "5.0.1"\ndescription = "Timeout context manager for asyncio programs"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nmarkers = "python_version < \\"3.11\\""\nfiles = [\n {file = "async_timeout-5.0.1-py3-none-any.whl", hash = "sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c"},\n {file = "async_timeout-5.0.1.tar.gz", hash = "sha256:d9321a7a3d5a6a5e187e824d2fa0793ce379a202935782d555d6e9d2735677d3"},\n]\n\n[[package]]\nname = "attrs"\nversion = "25.3.0"\ndescription = "Classes Without Boilerplate"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "attrs-25.3.0-py3-none-any.whl", hash = "sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3"},\n {file = "attrs-25.3.0.tar.gz", hash = "sha256:75d7cefc7fb576747b2c81b4442d4d4a1ce0900973527c011d1030fd3bf4af1b"},\n]\n\n[package.extras]\nbenchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"]\ncov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]\ndev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit-uv", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]\ndocs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier"]\ntests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]\ntests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"]\n\n[[package]]\nname = "cel-python"\nversion = "0.2.0"\ndescription = "Pure Python implementation of Google Common Expression Language"\noptional = false\npython-versions = "<4.0,>=3.8"\ngroups = ["main"]\nfiles = [\n {file = "cel_python-0.2.0-py3-none-any.whl", hash = "sha256:478ff73def7b39d51e6982f95d937a57c2b088c491c578fe5cecdbd79f476f60"},\n {file = "cel_python-0.2.0.tar.gz", hash = "sha256:75de72a5cf223ec690b236f0cc24da267219e667bd3e7f8f4f20595fcc1c0c0f"},\n]\n\n[package.dependencies]\njmespath = ">=1.0.1,<2.0.0"\nlark = ">=0.12.0,<0.13.0"\npython-dateutil = ">=2.9.0.post0,<3.0.0"\npyyaml = ">=6.0.1,<7.0.0"\ntypes-python-dateutil = ">=2.9.0.20240316,<3.0.0.0"\ntypes-pyyaml = ">=6.0.12.20240311,<7.0.0.0"\n\n[[package]]\nname = "frozenlist"\nversion = "1.5.0"\ndescription = "A list-like structure which implements collections.abc.MutableSequence"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "frozenlist-1.5.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:5b6a66c18b5b9dd261ca98dffcb826a525334b2f29e7caa54e182255c5f6a65a"},\n {file = "frozenlist-1.5.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d1b3eb7b05ea246510b43a7e53ed1653e55c2121019a97e60cad7efb881a97bb"},\n {file = "frozenlist-1.5.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:15538c0cbf0e4fa11d1e3a71f823524b0c46299aed6e10ebb4c2089abd8c3bec"},\n {file = "frozenlist-1.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e79225373c317ff1e35f210dd5f1344ff31066ba8067c307ab60254cd3a78ad5"},\n {file = "frozenlist-1.5.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9272fa73ca71266702c4c3e2d4a28553ea03418e591e377a03b8e3659d94fa76"},\n {file = "frozenlist-1.5.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:498524025a5b8ba81695761d78c8dd7382ac0b052f34e66939c42df860b8ff17"},\n {file = "frozenlist-1.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:92b5278ed9d50fe610185ecd23c55d8b307d75ca18e94c0e7de328089ac5dcba"},\n {file = "frozenlist-1.5.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f3c8c1dacd037df16e85227bac13cca58c30da836c6f936ba1df0c05d046d8d"},\n {file = "frozenlist-1.5.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f2ac49a9bedb996086057b75bf93538240538c6d9b38e57c82d51f75a73409d2"},\n {file = "frozenlist-1.5.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e66cc454f97053b79c2ab09c17fbe3c825ea6b4de20baf1be28919460dd7877f"},\n {file = "frozenlist-1.5.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:5a3ba5f9a0dfed20337d3e966dc359784c9f96503674c2faf015f7fe8e96798c"},\n {file = "frozenlist-1.5.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:6321899477db90bdeb9299ac3627a6a53c7399c8cd58d25da094007402b039ab"},\n {file = "frozenlist-1.5.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:76e4753701248476e6286f2ef492af900ea67d9706a0155335a40ea21bf3b2f5"},\n {file = "frozenlist-1.5.0-cp310-cp310-win32.whl", hash = "sha256:977701c081c0241d0955c9586ffdd9ce44f7a7795df39b9151cd9a6fd0ce4cfb"},\n {file = "frozenlist-1.5.0-cp310-cp310-win_amd64.whl", hash = "sha256:189f03b53e64144f90990d29a27ec4f7997d91ed3d01b51fa39d2dbe77540fd4"},\n {file = "frozenlist-1.5.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:fd74520371c3c4175142d02a976aee0b4cb4a7cc912a60586ffd8d5929979b30"},\n {file = "frozenlist-1.5.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2f3f7a0fbc219fb4455264cae4d9f01ad41ae6ee8524500f381de64ffaa077d5"},\n {file = "frozenlist-1.5.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f47c9c9028f55a04ac254346e92977bf0f166c483c74b4232bee19a6697e4778"},\n {file = "frozenlist-1.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0996c66760924da6e88922756d99b47512a71cfd45215f3570bf1e0b694c206a"},\n {file = "frozenlist-1.5.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a2fe128eb4edeabe11896cb6af88fca5346059f6c8d807e3b910069f39157869"},\n {file = "frozenlist-1.5.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1a8ea951bbb6cacd492e3948b8da8c502a3f814f5d20935aae74b5df2b19cf3d"},\n {file = "frozenlist-1.5.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:de537c11e4aa01d37db0d403b57bd6f0546e71a82347a97c6a9f0dcc532b3a45"},\n {file = "frozenlist-1.5.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c2623347b933fcb9095841f1cc5d4ff0b278addd743e0e966cb3d460278840d"},\n {file = "frozenlist-1.5.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:cee6798eaf8b1416ef6909b06f7dc04b60755206bddc599f52232606e18179d3"},\n {file = "frozenlist-1.5.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:f5f9da7f5dbc00a604fe74aa02ae7c98bcede8a3b8b9666f9f86fc13993bc71a"},\n {file = "frozenlist-1.5.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:90646abbc7a5d5c7c19461d2e3eeb76eb0b204919e6ece342feb6032c9325ae9"},\n {file = "frozenlist-1.5.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:bdac3c7d9b705d253b2ce370fde941836a5f8b3c5c2b8fd70940a3ea3af7f4f2"},\n {file = "frozenlist-1.5.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:03d33c2ddbc1816237a67f66336616416e2bbb6beb306e5f890f2eb22b959cdf"},\n {file = "frozenlist-1.5.0-cp311-cp311-win32.whl", hash = "sha256:237f6b23ee0f44066219dae14c70ae38a63f0440ce6750f868ee08775073f942"},\n {file = "frozenlist-1.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:0cc974cc93d32c42e7b0f6cf242a6bd941c57c61b618e78b6c0a96cb72788c1d"},\n {file = "frozenlist-1.5.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:31115ba75889723431aa9a4e77d5f398f5cf976eea3bdf61749731f62d4a4a21"},\n {file = "frozenlist-1.5.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7437601c4d89d070eac8323f121fcf25f88674627505334654fd027b091db09d"},\n {file = "frozenlist-1.5.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7948140d9f8ece1745be806f2bfdf390127cf1a763b925c4a805c603df5e697e"},\n {file = "frozenlist-1.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:feeb64bc9bcc6b45c6311c9e9b99406660a9c05ca8a5b30d14a78555088b0b3a"},\n {file = "frozenlist-1.5.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:683173d371daad49cffb8309779e886e59c2f369430ad28fe715f66d08d4ab1a"},\n {file = "frozenlist-1.5.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7d57d8f702221405a9d9b40f9da8ac2e4a1a8b5285aac6100f3393675f0a85ee"},\n {file = "frozenlist-1.5.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:30c72000fbcc35b129cb09956836c7d7abf78ab5416595e4857d1cae8d6251a6"},\n {file = "frozenlist-1.5.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:000a77d6034fbad9b6bb880f7ec073027908f1b40254b5d6f26210d2dab1240e"},\n {file = "frozenlist-1.5.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5d7f5a50342475962eb18b740f3beecc685a15b52c91f7d975257e13e029eca9"},\n {file = "frozenlist-1.5.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:87f724d055eb4785d9be84e9ebf0f24e392ddfad00b3fe036e43f489fafc9039"},\n {file = "frozenlist-1.5.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:6e9080bb2fb195a046e5177f10d9d82b8a204c0736a97a153c2466127de87784"},\n {file = "frozenlist-1.5.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:9b93d7aaa36c966fa42efcaf716e6b3900438632a626fb09c049f6a2f09fc631"},\n {file = "frozenlist-1.5.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:52ef692a4bc60a6dd57f507429636c2af8b6046db8b31b18dac02cbc8f507f7f"},\n {file = "frozenlist-1.5.0-cp312-cp312-win32.whl", hash = "sha256:29d94c256679247b33a3dc96cce0f93cbc69c23bf75ff715919332fdbb6a32b8"},\n {file = "frozenlist-1.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:8969190d709e7c48ea386db202d708eb94bdb29207a1f269bab1196ce0dcca1f"},\n {file = "frozenlist-1.5.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7a1a048f9215c90973402e26c01d1cff8a209e1f1b53f72b95c13db61b00f953"},\n {file = "frozenlist-1.5.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:dd47a5181ce5fcb463b5d9e17ecfdb02b678cca31280639255ce9d0e5aa67af0"},\n {file = "frozenlist-1.5.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1431d60b36d15cda188ea222033eec8e0eab488f39a272461f2e6d9e1a8e63c2"},\n {file = "frozenlist-1.5.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6482a5851f5d72767fbd0e507e80737f9c8646ae7fd303def99bfe813f76cf7f"},\n {file = "frozenlist-1.5.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:44c49271a937625619e862baacbd037a7ef86dd1ee215afc298a417ff3270608"},\n {file = "frozenlist-1.5.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:12f78f98c2f1c2429d42e6a485f433722b0061d5c0b0139efa64f396efb5886b"},\n {file = "frozenlist-1.5.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ce3aa154c452d2467487765e3adc730a8c153af77ad84096bc19ce19a2400840"},\n {file = "frozenlist-1.5.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9b7dc0c4338e6b8b091e8faf0db3168a37101943e687f373dce00959583f7439"},\n {file = "frozenlist-1.5.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:45e0896250900b5aa25180f9aec243e84e92ac84bd4a74d9ad4138ef3f5c97de"},\n {file = "frozenlist-1.5.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:561eb1c9579d495fddb6da8959fd2a1fca2c6d060d4113f5844b433fc02f2641"},\n {file = "frozenlist-1.5.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:df6e2f325bfee1f49f81aaac97d2aa757c7646534a06f8f577ce184afe2f0a9e"},\n {file = "frozenlist-1.5.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:140228863501b44b809fb39ec56b5d4071f4d0aa6d216c19cbb08b8c5a7eadb9"},\n {file = "frozenlist-1.5.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:7707a25d6a77f5d27ea7dc7d1fc608aa0a478193823f88511ef5e6b8a48f9d03"},\n {file = "frozenlist-1.5.0-cp313-cp313-win32.whl", hash = "sha256:31a9ac2b38ab9b5a8933b693db4939764ad3f299fcaa931a3e605bc3460e693c"},\n {file = "frozenlist-1.5.0-cp313-cp313-win_amd64.whl", hash = "sha256:11aabdd62b8b9c4b84081a3c246506d1cddd2dd93ff0ad53ede5defec7886b28"},\n {file = "frozenlist-1.5.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:dd94994fc91a6177bfaafd7d9fd951bc8689b0a98168aa26b5f543868548d3ca"},\n {file = "frozenlist-1.5.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2d0da8bbec082bf6bf18345b180958775363588678f64998c2b7609e34719b10"},\n {file = "frozenlist-1.5.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:73f2e31ea8dd7df61a359b731716018c2be196e5bb3b74ddba107f694fbd7604"},\n {file = "frozenlist-1.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:828afae9f17e6de596825cf4228ff28fbdf6065974e5ac1410cecc22f699d2b3"},\n {file = "frozenlist-1.5.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f1577515d35ed5649d52ab4319db757bb881ce3b2b796d7283e6634d99ace307"},\n {file = "frozenlist-1.5.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2150cc6305a2c2ab33299453e2968611dacb970d2283a14955923062c8d00b10"},\n {file = "frozenlist-1.5.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a72b7a6e3cd2725eff67cd64c8f13335ee18fc3c7befc05aed043d24c7b9ccb9"},\n {file = "frozenlist-1.5.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c16d2fa63e0800723139137d667e1056bee1a1cf7965153d2d104b62855e9b99"},\n {file = "frozenlist-1.5.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:17dcc32fc7bda7ce5875435003220a457bcfa34ab7924a49a1c19f55b6ee185c"},\n {file = "frozenlist-1.5.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:97160e245ea33d8609cd2b8fd997c850b56db147a304a262abc2b3be021a9171"},\n {file = "frozenlist-1.5.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:f1e6540b7fa044eee0bb5111ada694cf3dc15f2b0347ca125ee9ca984d5e9e6e"},\n {file = "frozenlist-1.5.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:91d6c171862df0a6c61479d9724f22efb6109111017c87567cfeb7b5d1449fdf"},\n {file = "frozenlist-1.5.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:c1fac3e2ace2eb1052e9f7c7db480818371134410e1f5c55d65e8f3ac6d1407e"},\n {file = "frozenlist-1.5.0-cp38-cp38-win32.whl", hash = "sha256:b97f7b575ab4a8af9b7bc1d2ef7f29d3afee2226bd03ca3875c16451ad5a7723"},\n {file = "frozenlist-1.5.0-cp38-cp38-win_amd64.whl", hash = "sha256:374ca2dabdccad8e2a76d40b1d037f5bd16824933bf7bcea3e59c891fd4a0923"},\n {file = "frozenlist-1.5.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:9bbcdfaf4af7ce002694a4e10a0159d5a8d20056a12b05b45cea944a4953f972"},\n {file = "frozenlist-1.5.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1893f948bf6681733aaccf36c5232c231e3b5166d607c5fa77773611df6dc336"},\n {file = "frozenlist-1.5.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2b5e23253bb709ef57a8e95e6ae48daa9ac5f265637529e4ce6b003a37b2621f"},\n {file = "frozenlist-1.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0f253985bb515ecd89629db13cb58d702035ecd8cfbca7d7a7e29a0e6d39af5f"},\n {file = "frozenlist-1.5.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04a5c6babd5e8fb7d3c871dc8b321166b80e41b637c31a995ed844a6139942b6"},\n {file = "frozenlist-1.5.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a9fe0f1c29ba24ba6ff6abf688cb0b7cf1efab6b6aa6adc55441773c252f7411"},\n {file = "frozenlist-1.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:226d72559fa19babe2ccd920273e767c96a49b9d3d38badd7c91a0fdeda8ea08"},\n {file = "frozenlist-1.5.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15b731db116ab3aedec558573c1a5eec78822b32292fe4f2f0345b7f697745c2"},\n {file = "frozenlist-1.5.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:366d8f93e3edfe5a918c874702f78faac300209a4d5bf38352b2c1bdc07a766d"},\n {file = "frozenlist-1.5.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:1b96af8c582b94d381a1c1f51ffaedeb77c821c690ea5f01da3d70a487dd0a9b"},\n {file = "frozenlist-1.5.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:c03eff4a41bd4e38415cbed054bbaff4a075b093e2394b6915dca34a40d1e38b"},\n {file = "frozenlist-1.5.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:50cf5e7ee9b98f22bdecbabf3800ae78ddcc26e4a435515fc72d97903e8488e0"},\n {file = "frozenlist-1.5.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1e76bfbc72353269c44e0bc2cfe171900fbf7f722ad74c9a7b638052afe6a00c"},\n {file = "frozenlist-1.5.0-cp39-cp39-win32.whl", hash = "sha256:666534d15ba8f0fda3f53969117383d5dc021266b3c1a42c9ec4855e4b58b9d3"},\n {file = "frozenlist-1.5.0-cp39-cp39-win_amd64.whl", hash = "sha256:5c28f4b5dbef8a0d8aad0d4de24d1e9e981728628afaf4ea0792f5d0939372f0"},\n {file = "frozenlist-1.5.0-py3-none-any.whl", hash = "sha256:d994863bba198a4a518b467bb971c56e1db3f180a25c6cf7bb1949c267f748c3"},\n {file = "frozenlist-1.5.0.tar.gz", hash = "sha256:81d5af29e61b9c8348e876d442253723928dce6433e0e76cd925cd83f1b4b817"},\n]\n\n[[package]]\nname = "grpcio"\nversion = "1.71.0"\ndescription = "HTTP/2-based RPC framework"\noptional = false\npython-versions = ">=3.9"\ngroups = ["main"]\nfiles = [\n {file = "grpcio-1.71.0-cp310-cp310-linux_armv7l.whl", hash = "sha256:c200cb6f2393468142eb50ab19613229dcc7829b5ccee8b658a36005f6669fdd"},\n {file = "grpcio-1.71.0-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:b2266862c5ad664a380fbbcdbdb8289d71464c42a8c29053820ee78ba0119e5d"},\n {file = "grpcio-1.71.0-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:0ab8b2864396663a5b0b0d6d79495657ae85fa37dcb6498a2669d067c65c11ea"},\n {file = "grpcio-1.71.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c30f393f9d5ff00a71bb56de4aa75b8fe91b161aeb61d39528db6b768d7eac69"},\n {file = "grpcio-1.71.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f250ff44843d9a0615e350c77f890082102a0318d66a99540f54769c8766ab73"},\n {file = "grpcio-1.71.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e6d8de076528f7c43a2f576bc311799f89d795aa6c9b637377cc2b1616473804"},\n {file = "grpcio-1.71.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:9b91879d6da1605811ebc60d21ab6a7e4bae6c35f6b63a061d61eb818c8168f6"},\n {file = "grpcio-1.71.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f71574afdf944e6652203cd1badcda195b2a27d9c83e6d88dc1ce3cfb73b31a5"},\n {file = "grpcio-1.71.0-cp310-cp310-win32.whl", hash = "sha256:8997d6785e93308f277884ee6899ba63baafa0dfb4729748200fcc537858a509"},\n {file = "grpcio-1.71.0-cp310-cp310-win_amd64.whl", hash = "sha256:7d6ac9481d9d0d129224f6d5934d5832c4b1cddb96b59e7eba8416868909786a"},\n {file = "grpcio-1.71.0-cp311-cp311-linux_armv7l.whl", hash = "sha256:d6aa986318c36508dc1d5001a3ff169a15b99b9f96ef5e98e13522c506b37eef"},\n {file = "grpcio-1.71.0-cp311-cp311-macosx_10_14_universal2.whl", hash = "sha256:d2c170247315f2d7e5798a22358e982ad6eeb68fa20cf7a820bb74c11f0736e7"},\n {file = "grpcio-1.71.0-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:e6f83a583ed0a5b08c5bc7a3fe860bb3c2eac1f03f1f63e0bc2091325605d2b7"},\n {file = "grpcio-1.71.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4be74ddeeb92cc87190e0e376dbc8fc7736dbb6d3d454f2fa1f5be1dee26b9d7"},\n {file = "grpcio-1.71.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4dd0dfbe4d5eb1fcfec9490ca13f82b089a309dc3678e2edabc144051270a66e"},\n {file = "grpcio-1.71.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a2242d6950dc892afdf9e951ed7ff89473aaf744b7d5727ad56bdaace363722b"},\n {file = "grpcio-1.71.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:0fa05ee31a20456b13ae49ad2e5d585265f71dd19fbd9ef983c28f926d45d0a7"},\n {file = "grpcio-1.71.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3d081e859fb1ebe176de33fc3adb26c7d46b8812f906042705346b314bde32c3"},\n {file = "grpcio-1.71.0-cp311-cp311-win32.whl", hash = "sha256:d6de81c9c00c8a23047136b11794b3584cdc1460ed7cbc10eada50614baa1444"},\n {file = "grpcio-1.71.0-cp311-cp311-win_amd64.whl", hash = "sha256:24e867651fc67717b6f896d5f0cac0ec863a8b5fb7d6441c2ab428f52c651c6b"},\n {file = "grpcio-1.71.0-cp312-cp312-linux_armv7l.whl", hash = "sha256:0ff35c8d807c1c7531d3002be03221ff9ae15712b53ab46e2a0b4bb271f38537"},\n {file = "grpcio-1.71.0-cp312-cp312-macosx_10_14_universal2.whl", hash = "sha256:b78a99cd1ece4be92ab7c07765a0b038194ded2e0a26fd654591ee136088d8d7"},\n {file = "grpcio-1.71.0-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:dc1a1231ed23caac1de9f943d031f1bc38d0f69d2a3b243ea0d664fc1fbd7fec"},\n {file = "grpcio-1.71.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e6beeea5566092c5e3c4896c6d1d307fb46b1d4bdf3e70c8340b190a69198594"},\n {file = "grpcio-1.71.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5170929109450a2c031cfe87d6716f2fae39695ad5335d9106ae88cc32dc84c"},\n {file = "grpcio-1.71.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:5b08d03ace7aca7b2fadd4baf291139b4a5f058805a8327bfe9aece7253b6d67"},\n {file = "grpcio-1.71.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:f903017db76bf9cc2b2d8bdd37bf04b505bbccad6be8a81e1542206875d0e9db"},\n {file = "grpcio-1.71.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:469f42a0b410883185eab4689060a20488a1a0a00f8bbb3cbc1061197b4c5a79"},\n {file = "grpcio-1.71.0-cp312-cp312-win32.whl", hash = "sha256:ad9f30838550695b5eb302add33f21f7301b882937460dd24f24b3cc5a95067a"},\n {file = "grpcio-1.71.0-cp312-cp312-win_amd64.whl", hash = "sha256:652350609332de6dac4ece254e5d7e1ff834e203d6afb769601f286886f6f3a8"},\n {file = "grpcio-1.71.0-cp313-cp313-linux_armv7l.whl", hash = "sha256:cebc1b34ba40a312ab480ccdb396ff3c529377a2fce72c45a741f7215bfe8379"},\n {file = "grpcio-1.71.0-cp313-cp313-macosx_10_14_universal2.whl", hash = "sha256:85da336e3649a3d2171e82f696b5cad2c6231fdd5bad52616476235681bee5b3"},\n {file = "grpcio-1.71.0-cp313-cp313-manylinux_2_17_aarch64.whl", hash = "sha256:f9a412f55bb6e8f3bb000e020dbc1e709627dcb3a56f6431fa7076b4c1aab0db"},\n {file = "grpcio-1.71.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:47be9584729534660416f6d2a3108aaeac1122f6b5bdbf9fd823e11fe6fbaa29"},\n {file = "grpcio-1.71.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7c9c80ac6091c916db81131d50926a93ab162a7e97e4428ffc186b6e80d6dda4"},\n {file = "grpcio-1.71.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:789d5e2a3a15419374b7b45cd680b1e83bbc1e52b9086e49308e2c0b5bbae6e3"},\n {file = "grpcio-1.71.0-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:1be857615e26a86d7363e8a163fade914595c81fec962b3d514a4b1e8760467b"},\n {file = "grpcio-1.71.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:a76d39b5fafd79ed604c4be0a869ec3581a172a707e2a8d7a4858cb05a5a7637"},\n {file = "grpcio-1.71.0-cp313-cp313-win32.whl", hash = "sha256:74258dce215cb1995083daa17b379a1a5a87d275387b7ffe137f1d5131e2cfbb"},\n {file = "grpcio-1.71.0-cp313-cp313-win_amd64.whl", hash = "sha256:22c3bc8d488c039a199f7a003a38cb7635db6656fa96437a8accde8322ce2366"},\n {file = "grpcio-1.71.0-cp39-cp39-linux_armv7l.whl", hash = "sha256:c6a0a28450c16809f94e0b5bfe52cabff63e7e4b97b44123ebf77f448534d07d"},\n {file = "grpcio-1.71.0-cp39-cp39-macosx_10_14_universal2.whl", hash = "sha256:a371e6b6a5379d3692cc4ea1cb92754d2a47bdddeee755d3203d1f84ae08e03e"},\n {file = "grpcio-1.71.0-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:39983a9245d37394fd59de71e88c4b295eb510a3555e0a847d9965088cdbd033"},\n {file = "grpcio-1.71.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9182e0063112e55e74ee7584769ec5a0b4f18252c35787f48738627e23a62b97"},\n {file = "grpcio-1.71.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:693bc706c031aeb848849b9d1c6b63ae6bcc64057984bb91a542332b75aa4c3d"},\n {file = "grpcio-1.71.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:20e8f653abd5ec606be69540f57289274c9ca503ed38388481e98fa396ed0b41"},\n {file = "grpcio-1.71.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:8700a2a57771cc43ea295296330daaddc0d93c088f0a35cc969292b6db959bf3"},\n {file = "grpcio-1.71.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d35a95f05a8a2cbe8e02be137740138b3b2ea5f80bd004444e4f9a1ffc511e32"},\n {file = "grpcio-1.71.0-cp39-cp39-win32.whl", hash = "sha256:f9c30c464cb2ddfbc2ddf9400287701270fdc0f14be5f08a1e3939f1e749b455"},\n {file = "grpcio-1.71.0-cp39-cp39-win_amd64.whl", hash = "sha256:63e41b91032f298b3e973b3fa4093cbbc620c875e2da7b93e249d4728b54559a"},\n {file = "grpcio-1.71.0.tar.gz", hash = "sha256:2b85f7820475ad3edec209d3d89a7909ada16caab05d3f2e08a7e8ae3200a55c"},\n]\n\n[package.extras]\nprotobuf = ["grpcio-tools (>=1.71.0)"]\n\n[[package]]\nname = "grpcio-tools"\nversion = "1.71.0"\ndescription = "Protobuf code generator for gRPC"\noptional = false\npython-versions = ">=3.9"\ngroups = ["main"]\nfiles = [\n {file = "grpcio_tools-1.71.0-cp310-cp310-linux_armv7l.whl", hash = "sha256:f4ad7f0d756546902597053d70b3af2606fbd70d7972876cd75c1e241d22ae00"},\n {file = "grpcio_tools-1.71.0-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:64bdb291df61cf570b5256777ad5fe2b1db6d67bc46e55dc56a0a862722ae329"},\n {file = "grpcio_tools-1.71.0-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:8dd9795e982d77a4b496f7278b943c2563d9afde2069cdee78c111a40cc4d675"},\n {file = "grpcio_tools-1.71.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c1b5860c41a36b26fec4f52998f1a451d0525a5c9a4fb06b6ea3e9211abdb925"},\n {file = "grpcio_tools-1.71.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3059c14035e5dc03d462f261e5900b9a077fd1a36976c3865b8507474520bad4"},\n {file = "grpcio_tools-1.71.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:f360981b215b1d5aff9235b37e7e1826246e35bbac32a53e41d4e990a37b8f4c"},\n {file = "grpcio_tools-1.71.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:bfe3888c3bbe16a5aa39409bc38744a31c0c3d2daa2b0095978c56e106c85b42"},\n {file = "grpcio_tools-1.71.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:145985c0bf12131f0a1503e65763e0f060473f7f3928ed1ff3fb0e8aad5bc8ac"},\n {file = "grpcio_tools-1.71.0-cp310-cp310-win32.whl", hash = "sha256:82c430edd939bb863550ee0fecf067d78feff828908a1b529bbe33cc57f2419c"},\n {file = "grpcio_tools-1.71.0-cp310-cp310-win_amd64.whl", hash = "sha256:83e90724e3f02415c628e4ead1d6ffe063820aaaa078d9a39176793df958cd5a"},\n {file = "grpcio_tools-1.71.0-cp311-cp311-linux_armv7l.whl", hash = "sha256:1f19b16b49afa5d21473f49c0966dd430c88d089cd52ac02404d8cef67134efb"},\n {file = "grpcio_tools-1.71.0-cp311-cp311-macosx_10_14_universal2.whl", hash = "sha256:459c8f5e00e390aecd5b89de67deb3ec7188a274bc6cb50e43cef35ab3a3f45d"},\n {file = "grpcio_tools-1.71.0-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:edab7e6518de01196be37f96cb1e138c3819986bf5e2a6c9e1519b4d716b2f5a"},\n {file = "grpcio_tools-1.71.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8b93b9f6adc7491d4c10144c0643409db298e5e63c997106a804f6f0248dbaf4"},\n {file = "grpcio_tools-1.71.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ae5f2efa9e644c10bf1021600bfc099dfbd8e02b184d2d25dc31fcd6c2bc59e"},\n {file = "grpcio_tools-1.71.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:65aa082f4435571d65d5ce07fc444f23c3eff4f3e34abef599ef8c9e1f6f360f"},\n {file = "grpcio_tools-1.71.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:1331e726e08b7bdcbf2075fcf4b47dff07842b04845e6e220a08a4663e232d7f"},\n {file = "grpcio_tools-1.71.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:6693a7d3ba138b0e693b3d1f687cdd9db9e68976c3fa2b951c17a072fea8b583"},\n {file = "grpcio_tools-1.71.0-cp311-cp311-win32.whl", hash = "sha256:6d11ed3ff7b6023b5c72a8654975324bb98c1092426ba5b481af406ff559df00"},\n {file = "grpcio_tools-1.71.0-cp311-cp311-win_amd64.whl", hash = "sha256:072b2a5805ac97e4623b3aa8f7818275f3fb087f4aa131b0fce00471065f6eaa"},\n {file = "grpcio_tools-1.71.0-cp312-cp312-linux_armv7l.whl", hash = "sha256:61c0409d5bdac57a7bd0ce0ab01c1c916728fe4c8a03d77a25135ad481eb505c"},\n {file = "grpcio_tools-1.71.0-cp312-cp312-macosx_10_14_universal2.whl", hash = "sha256:28784f39921d061d2164a9dcda5164a69d07bf29f91f0ea50b505958292312c9"},\n {file = "grpcio_tools-1.71.0-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:192808cf553cedca73f0479cc61d5684ad61f24db7a5f3c4dfe1500342425866"},\n {file = "grpcio_tools-1.71.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:989ee9da61098230d3d4c8f8f8e27c2de796f1ff21b1c90110e636d9acd9432b"},\n {file = "grpcio_tools-1.71.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:541a756276c8a55dec991f6c0106ae20c8c8f5ce8d0bdbfcb01e2338d1a8192b"},\n {file = "grpcio_tools-1.71.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:870c0097700d13c403e5517cb7750ab5b4a791ce3e71791c411a38c5468b64bd"},\n {file = "grpcio_tools-1.71.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:abd57f615e88bf93c3c6fd31f923106e3beb12f8cd2df95b0d256fa07a7a0a57"},\n {file = "grpcio_tools-1.71.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:753270e2d06d37e6d7af8967d1d059ec635ad215882041a36294f4e2fd502b2e"},\n {file = "grpcio_tools-1.71.0-cp312-cp312-win32.whl", hash = "sha256:0e647794bd7138b8c215e86277a9711a95cf6a03ff6f9e555d54fdf7378b9f9d"},\n {file = "grpcio_tools-1.71.0-cp312-cp312-win_amd64.whl", hash = "sha256:48debc879570972d28bfe98e4970eff25bb26da3f383e0e49829b2d2cd35ad87"},\n {file = "grpcio_tools-1.71.0-cp313-cp313-linux_armv7l.whl", hash = "sha256:9a78d07d6c301a25ef5ede962920a522556a1dfee1ccc05795994ceb867f766c"},\n {file = "grpcio_tools-1.71.0-cp313-cp313-macosx_10_14_universal2.whl", hash = "sha256:580ac88141c9815557e63c9c04f5b1cdb19b4db8d0cb792b573354bde1ee8b12"},\n {file = "grpcio_tools-1.71.0-cp313-cp313-manylinux_2_17_aarch64.whl", hash = "sha256:f7c678e68ece0ae908ecae1c4314a0c2c7f83e26e281738b9609860cc2c82d96"},\n {file = "grpcio_tools-1.71.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56ecd6cc89b5e5eed1de5eb9cafce86c9c9043ee3840888cc464d16200290b53"},\n {file = "grpcio_tools-1.71.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e52a041afc20ab2431d756b6295d727bd7adee813b21b06a3483f4a7a15ea15f"},\n {file = "grpcio_tools-1.71.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:2a1712f12102b60c8d92779b89d0504e0d6f3a59f2b933e5622b8583f5c02992"},\n {file = "grpcio_tools-1.71.0-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:41878cb7a75477e62fdd45e7e9155b3af1b7a5332844021e2511deaf99ac9e6c"},\n {file = "grpcio_tools-1.71.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:682e958b476049ccc14c71bedf3f979bced01f6e0c04852efc5887841a32ad6b"},\n {file = "grpcio_tools-1.71.0-cp313-cp313-win32.whl", hash = "sha256:0ccfb837152b7b858b9f26bb110b3ae8c46675d56130f6c2f03605c4f129be13"},\n {file = "grpcio_tools-1.71.0-cp313-cp313-win_amd64.whl", hash = "sha256:ffff9bc5eacb34dd26b487194f7d44a3e64e752fc2cf049d798021bf25053b87"},\n {file = "grpcio_tools-1.71.0-cp39-cp39-linux_armv7l.whl", hash = "sha256:834959b6eceb85de5217a411aba1643b5f782798680c122202d6a06177226644"},\n {file = "grpcio_tools-1.71.0-cp39-cp39-macosx_10_14_universal2.whl", hash = "sha256:e3ae9556e2a1cd70e7d7b0e0459c35af71d51a7dae4cf36075068011a69f13ec"},\n {file = "grpcio_tools-1.71.0-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:77fe6db1334e0ce318b2cb4e70afa94e0c173ed1a533d37aea69ad9f61ae8ea9"},\n {file = "grpcio_tools-1.71.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:57e3e2544c306b60ef2d76570bac4e977be1ad548641c9eec130c3bc47e80141"},\n {file = "grpcio_tools-1.71.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:af39e245fa56f7f5c2fe86b7d6c1b78f395c07e54d5613cbdbb3c24769a92b6e"},\n {file = "grpcio_tools-1.71.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:8f987d0053351217954543b174b0bddbf51d45b3cfcf8d6de97b0a43d264d753"},\n {file = "grpcio_tools-1.71.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:8e6cdbba4dae7b37b0d25d074614be9936fb720144420f03d9f142a80be69ba2"},\n {file = "grpcio_tools-1.71.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d3adc8b229e60c77bab5a5d62b415667133bd5ced7d59b5f71d6317c9143631e"},\n {file = "grpcio_tools-1.71.0-cp39-cp39-win32.whl", hash = "sha256:f68334d28a267fabec6e70cb5986e9999cfbfd14db654094ddf9aedd804a293a"},\n {file = "grpcio_tools-1.71.0-cp39-cp39-win_amd64.whl", hash = "sha256:1291a6136c07a86c3bb09f6c33f5cf227cc14956edd1b85cb572327a36e0aef8"},\n {file = "grpcio_tools-1.71.0.tar.gz", hash = "sha256:38dba8e0d5e0fb23a034e09644fdc6ed862be2371887eee54901999e8f6792a8"},\n]\n\n[package.dependencies]\ngrpcio = ">=1.71.0"\nprotobuf = ">=5.26.1,<6.0dev"\nsetuptools = "*"\n\n[[package]]\nname = "hatchet-sdk"\nversion = "1.0.0a1"\ndescription = ""\noptional = false\npython-versions = "<4.0,>=3.10"\ngroups = ["main"]\nfiles = [\n {file = "hatchet_sdk-1.0.0a1-py3-none-any.whl", hash = "sha256:bfc84358c8842cecd0d95b30645109733b7292dff0db1a776ca862785ee93d7f"},\n {file = "hatchet_sdk-1.0.0a1.tar.gz", hash = "sha256:f0272bbaac6faed75ff727826e9f7b1ac42ae597f9b590e14d392aada9c9692f"},\n]\n\n[package.dependencies]\naiohttp = ">=3.10.5,<4.0.0"\naiohttp-retry = ">=2.8.3,<3.0.0"\naiostream = ">=0.5.2,<0.6.0"\ncel-python = ">=0.2.0,<0.3.0"\ngrpcio = [\n {version = ">=1.64.1,<1.68.dev0 || >=1.69.dev0", markers = "python_version < \\"3.13\\""},\n {version = ">=1.69.0", markers = "python_version >= \\"3.13\\""},\n]\ngrpcio-tools = [\n {version = ">=1.64.1,<1.68.dev0 || >=1.69.dev0", markers = "python_version < \\"3.13\\""},\n {version = ">=1.69.0", markers = "python_version >= \\"3.13\\""},\n]\nnest-asyncio = ">=1.6.0,<2.0.0"\nprometheus-client = ">=0.21.1,<0.22.0"\nprotobuf = ">=5.29.1,<6.0.0"\npydantic = ">=2.6.3,<3.0.0"\npydantic-settings = ">=2.7.1,<3.0.0"\npython-dateutil = ">=2.9.0.post0,<3.0.0"\npyyaml = ">=6.0.1,<7.0.0"\ntenacity = ">=8.4.1"\nurllib3 = ">=1.26.20"\n\n[package.extras]\notel = ["opentelemetry-api (>=1.28.0,<2.0.0)", "opentelemetry-distro (>=0.49b0)", "opentelemetry-exporter-otlp (>=1.28.0,<2.0.0)", "opentelemetry-exporter-otlp-proto-http (>=1.28.0,<2.0.0)", "opentelemetry-instrumentation (>=0.49b0)", "opentelemetry-sdk (>=1.28.0,<2.0.0)"]\n\n[[package]]\nname = "idna"\nversion = "3.10"\ndescription = "Internationalized Domain Names in Applications (IDNA)"\noptional = false\npython-versions = ">=3.6"\ngroups = ["main"]\nfiles = [\n {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"},\n {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"},\n]\n\n[package.extras]\nall = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"]\n\n[[package]]\nname = "jmespath"\nversion = "1.0.1"\ndescription = "JSON Matching Expressions"\noptional = false\npython-versions = ">=3.7"\ngroups = ["main"]\nfiles = [\n {file = "jmespath-1.0.1-py3-none-any.whl", hash = "sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980"},\n {file = "jmespath-1.0.1.tar.gz", hash = "sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe"},\n]\n\n[[package]]\nname = "lark"\nversion = "0.12.0"\ndescription = "a modern parsing library"\noptional = false\npython-versions = "*"\ngroups = ["main"]\nfiles = [\n {file = "lark-0.12.0-py2.py3-none-any.whl", hash = "sha256:ed1d891cbcf5151ead1c1d14663bf542443e579e63a76ae175b01b899bd854ca"},\n {file = "lark-0.12.0.tar.gz", hash = "sha256:7da76fcfddadabbbbfd949bbae221efd33938451d90b1fefbbc423c3cccf48ef"},\n]\n\n[package.extras]\natomic-cache = ["atomicwrites"]\nnearley = ["js2py"]\nregex = ["regex"]\n\n[[package]]\nname = "multidict"\nversion = "6.2.0"\ndescription = "multidict implementation"\noptional = false\npython-versions = ">=3.9"\ngroups = ["main"]\nfiles = [\n {file = "multidict-6.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b9f6392d98c0bd70676ae41474e2eecf4c7150cb419237a41f8f96043fcb81d1"},\n {file = "multidict-6.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3501621d5e86f1a88521ea65d5cad0a0834c77b26f193747615b7c911e5422d2"},\n {file = "multidict-6.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:32ed748ff9ac682eae7859790d3044b50e3076c7d80e17a44239683769ff485e"},\n {file = "multidict-6.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc826b9a8176e686b67aa60fd6c6a7047b0461cae5591ea1dc73d28f72332a8a"},\n {file = "multidict-6.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:214207dcc7a6221d9942f23797fe89144128a71c03632bf713d918db99bd36de"},\n {file = "multidict-6.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:05fefbc3cddc4e36da209a5e49f1094bbece9a581faa7f3589201fd95df40e5d"},\n {file = "multidict-6.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e851e6363d0dbe515d8de81fd544a2c956fdec6f8a049739562286727d4a00c3"},\n {file = "multidict-6.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:32c9b4878f48be3e75808ea7e499d6223b1eea6d54c487a66bc10a1871e3dc6a"},\n {file = "multidict-6.2.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:7243c5a6523c5cfeca76e063efa5f6a656d1d74c8b1fc64b2cd1e84e507f7e2a"},\n {file = "multidict-6.2.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0e5a644e50ef9fb87878d4d57907f03a12410d2aa3b93b3acdf90a741df52c49"},\n {file = "multidict-6.2.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:0dc25a3293c50744796e87048de5e68996104d86d940bb24bc3ec31df281b191"},\n {file = "multidict-6.2.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:a49994481b99cd7dedde07f2e7e93b1d86c01c0fca1c32aded18f10695ae17eb"},\n {file = "multidict-6.2.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:641cf2e3447c9ecff2f7aa6e9eee9eaa286ea65d57b014543a4911ff2799d08a"},\n {file = "multidict-6.2.0-cp310-cp310-win32.whl", hash = "sha256:0c383d28857f66f5aebe3e91d6cf498da73af75fbd51cedbe1adfb85e90c0460"},\n {file = "multidict-6.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:a33273a541f1e1a8219b2a4ed2de355848ecc0254264915b9290c8d2de1c74e1"},\n {file = "multidict-6.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:84e87a7d75fa36839a3a432286d719975362d230c70ebfa0948549cc38bd5b46"},\n {file = "multidict-6.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8de4d42dffd5ced9117af2ce66ba8722402541a3aa98ffdf78dde92badb68932"},\n {file = "multidict-6.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e7d91a230c7f8af86c904a5a992b8c064b66330544693fd6759c3d6162382ecf"},\n {file = "multidict-6.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9f6cad071960ba1914fa231677d21b1b4a3acdcce463cee41ea30bc82e6040cf"},\n {file = "multidict-6.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0f74f2fc51555f4b037ef278efc29a870d327053aba5cb7d86ae572426c7cccc"},\n {file = "multidict-6.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:14ed9ed1bfedd72a877807c71113deac292bf485159a29025dfdc524c326f3e1"},\n {file = "multidict-6.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4ac3fcf9a2d369bd075b2c2965544036a27ccd277fc3c04f708338cc57533081"},\n {file = "multidict-6.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2fc6af8e39f7496047c7876314f4317736eac82bf85b54c7c76cf1a6f8e35d98"},\n {file = "multidict-6.2.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5f8cb1329f42fadfb40d6211e5ff568d71ab49be36e759345f91c69d1033d633"},\n {file = "multidict-6.2.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:5389445f0173c197f4a3613713b5fb3f3879df1ded2a1a2e4bc4b5b9c5441b7e"},\n {file = "multidict-6.2.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:94a7bb972178a8bfc4055db80c51efd24baefaced5e51c59b0d598a004e8305d"},\n {file = "multidict-6.2.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:da51d8928ad8b4244926fe862ba1795f0b6e68ed8c42cd2f822d435db9c2a8f4"},\n {file = "multidict-6.2.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:063be88bd684782a0715641de853e1e58a2f25b76388538bd62d974777ce9bc2"},\n {file = "multidict-6.2.0-cp311-cp311-win32.whl", hash = "sha256:52b05e21ff05729fbea9bc20b3a791c3c11da61649ff64cce8257c82a020466d"},\n {file = "multidict-6.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:1e2a2193d3aa5cbf5758f6d5680a52aa848e0cf611da324f71e5e48a9695cc86"},\n {file = "multidict-6.2.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:437c33561edb6eb504b5a30203daf81d4a9b727e167e78b0854d9a4e18e8950b"},\n {file = "multidict-6.2.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:9f49585f4abadd2283034fc605961f40c638635bc60f5162276fec075f2e37a4"},\n {file = "multidict-6.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5dd7106d064d05896ce28c97da3f46caa442fe5a43bc26dfb258e90853b39b44"},\n {file = "multidict-6.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e25b11a0417475f093d0f0809a149aff3943c2c56da50fdf2c3c88d57fe3dfbd"},\n {file = "multidict-6.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac380cacdd3b183338ba63a144a34e9044520a6fb30c58aa14077157a033c13e"},\n {file = "multidict-6.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:61d5541f27533f803a941d3a3f8a3d10ed48c12cf918f557efcbf3cd04ef265c"},\n {file = "multidict-6.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:facaf11f21f3a4c51b62931feb13310e6fe3475f85e20d9c9fdce0d2ea561b87"},\n {file = "multidict-6.2.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:095a2eabe8c43041d3e6c2cb8287a257b5f1801c2d6ebd1dd877424f1e89cf29"},\n {file = "multidict-6.2.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a0cc398350ef31167e03f3ca7c19313d4e40a662adcb98a88755e4e861170bdd"},\n {file = "multidict-6.2.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:7c611345bbe7cb44aabb877cb94b63e86f2d0db03e382667dbd037866d44b4f8"},\n {file = "multidict-6.2.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8cd1a0644ccaf27e9d2f6d9c9474faabee21f0578fe85225cc5af9a61e1653df"},\n {file = "multidict-6.2.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:89b3857652183b8206a891168af47bac10b970d275bba1f6ee46565a758c078d"},\n {file = "multidict-6.2.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:125dd82b40f8c06d08d87b3510beaccb88afac94e9ed4a6f6c71362dc7dbb04b"},\n {file = "multidict-6.2.0-cp312-cp312-win32.whl", hash = "sha256:76b34c12b013d813e6cb325e6bd4f9c984db27758b16085926bbe7ceeaace626"},\n {file = "multidict-6.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:0b183a959fb88ad1be201de2c4bdf52fa8e46e6c185d76201286a97b6f5ee65c"},\n {file = "multidict-6.2.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:5c5e7d2e300d5cb3b2693b6d60d3e8c8e7dd4ebe27cd17c9cb57020cac0acb80"},\n {file = "multidict-6.2.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:256d431fe4583c5f1e0f2e9c4d9c22f3a04ae96009b8cfa096da3a8723db0a16"},\n {file = "multidict-6.2.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a3c0ff89fe40a152e77b191b83282c9664357dce3004032d42e68c514ceff27e"},\n {file = "multidict-6.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef7d48207926edbf8b16b336f779c557dd8f5a33035a85db9c4b0febb0706817"},\n {file = "multidict-6.2.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1f3c099d3899b14e1ce52262eb82a5f5cb92157bb5106bf627b618c090a0eadc"},\n {file = "multidict-6.2.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e16e7297f29a544f49340012d6fc08cf14de0ab361c9eb7529f6a57a30cbfda1"},\n {file = "multidict-6.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:042028348dc5a1f2be6c666437042a98a5d24cee50380f4c0902215e5ec41844"},\n {file = "multidict-6.2.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:08549895e6a799bd551cf276f6e59820aa084f0f90665c0f03dd3a50db5d3c48"},\n {file = "multidict-6.2.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4ccfd74957ef53fa7380aaa1c961f523d582cd5e85a620880ffabd407f8202c0"},\n {file = "multidict-6.2.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:83b78c680d4b15d33042d330c2fa31813ca3974197bddb3836a5c635a5fd013f"},\n {file = "multidict-6.2.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:b4c153863dd6569f6511845922c53e39c8d61f6e81f228ad5443e690fca403de"},\n {file = "multidict-6.2.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:98aa8325c7f47183b45588af9c434533196e241be0a4e4ae2190b06d17675c02"},\n {file = "multidict-6.2.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9e658d1373c424457ddf6d55ec1db93c280b8579276bebd1f72f113072df8a5d"},\n {file = "multidict-6.2.0-cp313-cp313-win32.whl", hash = "sha256:3157126b028c074951839233647bd0e30df77ef1fedd801b48bdcad242a60f4e"},\n {file = "multidict-6.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:2e87f1926e91855ae61769ba3e3f7315120788c099677e0842e697b0bfb659f2"},\n {file = "multidict-6.2.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:2529ddbdaa424b2c6c2eb668ea684dd6b75b839d0ad4b21aad60c168269478d7"},\n {file = "multidict-6.2.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:13551d0e2d7201f0959725a6a769b6f7b9019a168ed96006479c9ac33fe4096b"},\n {file = "multidict-6.2.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:d1996ee1330e245cd3aeda0887b4409e3930524c27642b046e4fae88ffa66c5e"},\n {file = "multidict-6.2.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c537da54ce4ff7c15e78ab1292e5799d0d43a2108e006578a57f531866f64025"},\n {file = "multidict-6.2.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0f249badb360b0b4d694307ad40f811f83df4da8cef7b68e429e4eea939e49dd"},\n {file = "multidict-6.2.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48d39b1824b8d6ea7de878ef6226efbe0773f9c64333e1125e0efcfdd18a24c7"},\n {file = "multidict-6.2.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b99aac6bb2c37db336fa03a39b40ed4ef2818bf2dfb9441458165ebe88b793af"},\n {file = "multidict-6.2.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07bfa8bc649783e703263f783f73e27fef8cd37baaad4389816cf6a133141331"},\n {file = "multidict-6.2.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:b2c00ad31fbc2cbac85d7d0fcf90853b2ca2e69d825a2d3f3edb842ef1544a2c"},\n {file = "multidict-6.2.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:0d57a01a2a9fa00234aace434d8c131f0ac6e0ac6ef131eda5962d7e79edfb5b"},\n {file = "multidict-6.2.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:abf5b17bc0cf626a8a497d89ac691308dbd825d2ac372aa990b1ca114e470151"},\n {file = "multidict-6.2.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:f7716f7e7138252d88607228ce40be22660d6608d20fd365d596e7ca0738e019"},\n {file = "multidict-6.2.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:d5a36953389f35f0a4e88dc796048829a2f467c9197265504593f0e420571547"},\n {file = "multidict-6.2.0-cp313-cp313t-win32.whl", hash = "sha256:e653d36b1bf48fa78c7fcebb5fa679342e025121ace8c87ab05c1cefd33b34fc"},\n {file = "multidict-6.2.0-cp313-cp313t-win_amd64.whl", hash = "sha256:ca23db5fb195b5ef4fd1f77ce26cadefdf13dba71dab14dadd29b34d457d7c44"},\n {file = "multidict-6.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b4f3d66dd0354b79761481fc15bdafaba0b9d9076f1f42cc9ce10d7fcbda205a"},\n {file = "multidict-6.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6e2a2d6749e1ff2c9c76a72c6530d5baa601205b14e441e6d98011000f47a7ac"},\n {file = "multidict-6.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cca83a629f77402cfadd58352e394d79a61c8015f1694b83ab72237ec3941f88"},\n {file = "multidict-6.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:781b5dd1db18c9e9eacc419027b0acb5073bdec9de1675c0be25ceb10e2ad133"},\n {file = "multidict-6.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cf8d370b2fea27fb300825ec3984334f7dd54a581bde6456799ba3776915a656"},\n {file = "multidict-6.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:25bb96338512e2f46f615a2bb7c6012fe92a4a5ebd353e5020836a7e33120349"},\n {file = "multidict-6.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:19e2819b0b468174de25c0ceed766606a07cedeab132383f1e83b9a4e96ccb4f"},\n {file = "multidict-6.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6aed763b6a1b28c46c055692836879328f0b334a6d61572ee4113a5d0c859872"},\n {file = "multidict-6.2.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:a1133414b771619aa3c3000701c11b2e4624a7f492f12f256aedde97c28331a2"},\n {file = "multidict-6.2.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:639556758c36093b35e2e368ca485dada6afc2bd6a1b1207d85ea6dfc3deab27"},\n {file = "multidict-6.2.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:163f4604e76639f728d127293d24c3e208b445b463168af3d031b92b0998bb90"},\n {file = "multidict-6.2.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:2325105e16d434749e1be8022f942876a936f9bece4ec41ae244e3d7fae42aaf"},\n {file = "multidict-6.2.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:e4371591e621579cb6da8401e4ea405b33ff25a755874a3567c4075ca63d56e2"},\n {file = "multidict-6.2.0-cp39-cp39-win32.whl", hash = "sha256:d1175b0e0d6037fab207f05774a176d71210ebd40b1c51f480a04b65ec5c786d"},\n {file = "multidict-6.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:ad81012b24b88aad4c70b2cbc2dad84018783221b7f923e926f4690ff8569da3"},\n {file = "multidict-6.2.0-py3-none-any.whl", hash = "sha256:5d26547423e5e71dcc562c4acdc134b900640a39abd9066d7326a7cc2324c530"},\n {file = "multidict-6.2.0.tar.gz", hash = "sha256:0085b0afb2446e57050140240a8595846ed64d1cbd26cef936bfab3192c673b8"},\n]\n\n[package.dependencies]\ntyping-extensions = {version = ">=4.1.0", markers = "python_version < \\"3.11\\""}\n\n[[package]]\nname = "nest-asyncio"\nversion = "1.6.0"\ndescription = "Patch asyncio to allow nested event loops"\noptional = false\npython-versions = ">=3.5"\ngroups = ["main"]\nfiles = [\n {file = "nest_asyncio-1.6.0-py3-none-any.whl", hash = "sha256:87af6efd6b5e897c81050477ef65c62e2b2f35d51703cae01aff2905b1852e1c"},\n {file = "nest_asyncio-1.6.0.tar.gz", hash = "sha256:6f172d5449aca15afd6c646851f4e31e02c598d553a667e38cafa997cfec55fe"},\n]\n\n[[package]]\nname = "prometheus-client"\nversion = "0.21.1"\ndescription = "Python client for the Prometheus monitoring system."\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "prometheus_client-0.21.1-py3-none-any.whl", hash = "sha256:594b45c410d6f4f8888940fe80b5cc2521b305a1fafe1c58609ef715a001f301"},\n {file = "prometheus_client-0.21.1.tar.gz", hash = "sha256:252505a722ac04b0456be05c05f75f45d760c2911ffc45f2a06bcaed9f3ae3fb"},\n]\n\n[package.extras]\ntwisted = ["twisted"]\n\n[[package]]\nname = "propcache"\nversion = "0.3.0"\ndescription = "Accelerated property cache"\noptional = false\npython-versions = ">=3.9"\ngroups = ["main"]\nfiles = [\n {file = "propcache-0.3.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:efa44f64c37cc30c9f05932c740a8b40ce359f51882c70883cc95feac842da4d"},\n {file = "propcache-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2383a17385d9800b6eb5855c2f05ee550f803878f344f58b6e194de08b96352c"},\n {file = "propcache-0.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d3e7420211f5a65a54675fd860ea04173cde60a7cc20ccfbafcccd155225f8bc"},\n {file = "propcache-0.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3302c5287e504d23bb0e64d2a921d1eb4a03fb93a0a0aa3b53de059f5a5d737d"},\n {file = "propcache-0.3.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7e2e068a83552ddf7a39a99488bcba05ac13454fb205c847674da0352602082f"},\n {file = "propcache-0.3.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d913d36bdaf368637b4f88d554fb9cb9d53d6920b9c5563846555938d5450bf"},\n {file = "propcache-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8ee1983728964d6070ab443399c476de93d5d741f71e8f6e7880a065f878e0b9"},\n {file = "propcache-0.3.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:36ca5e9a21822cc1746023e88f5c0af6fce3af3b85d4520efb1ce4221bed75cc"},\n {file = "propcache-0.3.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:9ecde3671e62eeb99e977f5221abcf40c208f69b5eb986b061ccec317c82ebd0"},\n {file = "propcache-0.3.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:d383bf5e045d7f9d239b38e6acadd7b7fdf6c0087259a84ae3475d18e9a2ae8b"},\n {file = "propcache-0.3.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:8cb625bcb5add899cb8ba7bf716ec1d3e8f7cdea9b0713fa99eadf73b6d4986f"},\n {file = "propcache-0.3.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:5fa159dcee5dba00c1def3231c249cf261185189205073bde13797e57dd7540a"},\n {file = "propcache-0.3.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:a7080b0159ce05f179cfac592cda1a82898ca9cd097dacf8ea20ae33474fbb25"},\n {file = "propcache-0.3.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:ed7161bccab7696a473fe7ddb619c1d75963732b37da4618ba12e60899fefe4f"},\n {file = "propcache-0.3.0-cp310-cp310-win32.whl", hash = "sha256:bf0d9a171908f32d54f651648c7290397b8792f4303821c42a74e7805bfb813c"},\n {file = "propcache-0.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:42924dc0c9d73e49908e35bbdec87adedd651ea24c53c29cac103ede0ea1d340"},\n {file = "propcache-0.3.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9ddd49258610499aab83b4f5b61b32e11fce873586282a0e972e5ab3bcadee51"},\n {file = "propcache-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2578541776769b500bada3f8a4eeaf944530516b6e90c089aa368266ed70c49e"},\n {file = "propcache-0.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d8074c5dd61c8a3e915fa8fc04754fa55cfa5978200d2daa1e2d4294c1f136aa"},\n {file = "propcache-0.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b58229a844931bca61b3a20efd2be2a2acb4ad1622fc026504309a6883686fbf"},\n {file = "propcache-0.3.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e45377d5d6fefe1677da2a2c07b024a6dac782088e37c0b1efea4cfe2b1be19b"},\n {file = "propcache-0.3.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ec5060592d83454e8063e487696ac3783cc48c9a329498bafae0d972bc7816c9"},\n {file = "propcache-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15010f29fbed80e711db272909a074dc79858c6d28e2915704cfc487a8ac89c6"},\n {file = "propcache-0.3.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a254537b9b696ede293bfdbc0a65200e8e4507bc9f37831e2a0318a9b333c85c"},\n {file = "propcache-0.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2b975528998de037dfbc10144b8aed9b8dd5a99ec547f14d1cb7c5665a43f075"},\n {file = "propcache-0.3.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:19d36bb351ad5554ff20f2ae75f88ce205b0748c38b146c75628577020351e3c"},\n {file = "propcache-0.3.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:6032231d4a5abd67c7f71168fd64a47b6b451fbcb91c8397c2f7610e67683810"},\n {file = "propcache-0.3.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:6985a593417cdbc94c7f9c3403747335e450c1599da1647a5af76539672464d3"},\n {file = "propcache-0.3.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:6a1948df1bb1d56b5e7b0553c0fa04fd0e320997ae99689488201f19fa90d2e7"},\n {file = "propcache-0.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:8319293e85feadbbfe2150a5659dbc2ebc4afdeaf7d98936fb9a2f2ba0d4c35c"},\n {file = "propcache-0.3.0-cp311-cp311-win32.whl", hash = "sha256:63f26258a163c34542c24808f03d734b338da66ba91f410a703e505c8485791d"},\n {file = "propcache-0.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:cacea77ef7a2195f04f9279297684955e3d1ae4241092ff0cfcef532bb7a1c32"},\n {file = "propcache-0.3.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:e53d19c2bf7d0d1e6998a7e693c7e87300dd971808e6618964621ccd0e01fe4e"},\n {file = "propcache-0.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a61a68d630e812b67b5bf097ab84e2cd79b48c792857dc10ba8a223f5b06a2af"},\n {file = "propcache-0.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fb91d20fa2d3b13deea98a690534697742029f4fb83673a3501ae6e3746508b5"},\n {file = "propcache-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:67054e47c01b7b349b94ed0840ccae075449503cf1fdd0a1fdd98ab5ddc2667b"},\n {file = "propcache-0.3.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:997e7b8f173a391987df40f3b52c423e5850be6f6df0dcfb5376365440b56667"},\n {file = "propcache-0.3.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d663fd71491dde7dfdfc899d13a067a94198e90695b4321084c6e450743b8c7"},\n {file = "propcache-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8884ba1a0fe7210b775106b25850f5e5a9dc3c840d1ae9924ee6ea2eb3acbfe7"},\n {file = "propcache-0.3.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aa806bbc13eac1ab6291ed21ecd2dd426063ca5417dd507e6be58de20e58dfcf"},\n {file = "propcache-0.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6f4d7a7c0aff92e8354cceca6fe223973ddf08401047920df0fcb24be2bd5138"},\n {file = "propcache-0.3.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:9be90eebc9842a93ef8335291f57b3b7488ac24f70df96a6034a13cb58e6ff86"},\n {file = "propcache-0.3.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:bf15fc0b45914d9d1b706f7c9c4f66f2b7b053e9517e40123e137e8ca8958b3d"},\n {file = "propcache-0.3.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5a16167118677d94bb48bfcd91e420088854eb0737b76ec374b91498fb77a70e"},\n {file = "propcache-0.3.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:41de3da5458edd5678b0f6ff66691507f9885f5fe6a0fb99a5d10d10c0fd2d64"},\n {file = "propcache-0.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:728af36011bb5d344c4fe4af79cfe186729efb649d2f8b395d1572fb088a996c"},\n {file = "propcache-0.3.0-cp312-cp312-win32.whl", hash = "sha256:6b5b7fd6ee7b54e01759f2044f936dcf7dea6e7585f35490f7ca0420fe723c0d"},\n {file = "propcache-0.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:2d15bc27163cd4df433e75f546b9ac31c1ba7b0b128bfb1b90df19082466ff57"},\n {file = "propcache-0.3.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a2b9bf8c79b660d0ca1ad95e587818c30ccdb11f787657458d6f26a1ea18c568"},\n {file = "propcache-0.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b0c1a133d42c6fc1f5fbcf5c91331657a1ff822e87989bf4a6e2e39b818d0ee9"},\n {file = "propcache-0.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:bb2f144c6d98bb5cbc94adeb0447cfd4c0f991341baa68eee3f3b0c9c0e83767"},\n {file = "propcache-0.3.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d1323cd04d6e92150bcc79d0174ce347ed4b349d748b9358fd2e497b121e03c8"},\n {file = "propcache-0.3.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b812b3cb6caacd072276ac0492d249f210006c57726b6484a1e1805b3cfeea0"},\n {file = "propcache-0.3.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:742840d1d0438eb7ea4280f3347598f507a199a35a08294afdcc560c3739989d"},\n {file = "propcache-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7c6e7e4f9167fddc438cd653d826f2222222564daed4116a02a184b464d3ef05"},\n {file = "propcache-0.3.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a94ffc66738da99232ddffcf7910e0f69e2bbe3a0802e54426dbf0714e1c2ffe"},\n {file = "propcache-0.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3c6ec957025bf32b15cbc6b67afe233c65b30005e4c55fe5768e4bb518d712f1"},\n {file = "propcache-0.3.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:549722908de62aa0b47a78b90531c022fa6e139f9166be634f667ff45632cc92"},\n {file = "propcache-0.3.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:5d62c4f6706bff5d8a52fd51fec6069bef69e7202ed481486c0bc3874912c787"},\n {file = "propcache-0.3.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:24c04f8fbf60094c531667b8207acbae54146661657a1b1be6d3ca7773b7a545"},\n {file = "propcache-0.3.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:7c5f5290799a3f6539cc5e6f474c3e5c5fbeba74a5e1e5be75587746a940d51e"},\n {file = "propcache-0.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4fa0e7c9c3cf7c276d4f6ab9af8adddc127d04e0fcabede315904d2ff76db626"},\n {file = "propcache-0.3.0-cp313-cp313-win32.whl", hash = "sha256:ee0bd3a7b2e184e88d25c9baa6a9dc609ba25b76daae942edfb14499ac7ec374"},\n {file = "propcache-0.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:1c8f7d896a16da9455f882870a507567d4f58c53504dc2d4b1e1d386dfe4588a"},\n {file = "propcache-0.3.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:e560fd75aaf3e5693b91bcaddd8b314f4d57e99aef8a6c6dc692f935cc1e6bbf"},\n {file = "propcache-0.3.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:65a37714b8ad9aba5780325228598a5b16c47ba0f8aeb3dc0514701e4413d7c0"},\n {file = "propcache-0.3.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:07700939b2cbd67bfb3b76a12e1412405d71019df00ca5697ce75e5ef789d829"},\n {file = "propcache-0.3.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7c0fdbdf6983526e269e5a8d53b7ae3622dd6998468821d660d0daf72779aefa"},\n {file = "propcache-0.3.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:794c3dd744fad478b6232289c866c25406ecdfc47e294618bdf1697e69bd64a6"},\n {file = "propcache-0.3.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4544699674faf66fb6b4473a1518ae4999c1b614f0b8297b1cef96bac25381db"},\n {file = "propcache-0.3.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fddb8870bdb83456a489ab67c6b3040a8d5a55069aa6f72f9d872235fbc52f54"},\n {file = "propcache-0.3.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f857034dc68d5ceb30fb60afb6ff2103087aea10a01b613985610e007053a121"},\n {file = "propcache-0.3.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:02df07041e0820cacc8f739510078f2aadcfd3fc57eaeeb16d5ded85c872c89e"},\n {file = "propcache-0.3.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:f47d52fd9b2ac418c4890aad2f6d21a6b96183c98021f0a48497a904199f006e"},\n {file = "propcache-0.3.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:9ff4e9ecb6e4b363430edf2c6e50173a63e0820e549918adef70515f87ced19a"},\n {file = "propcache-0.3.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:ecc2920630283e0783c22e2ac94427f8cca29a04cfdf331467d4f661f4072dac"},\n {file = "propcache-0.3.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:c441c841e82c5ba7a85ad25986014be8d7849c3cfbdb6004541873505929a74e"},\n {file = "propcache-0.3.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6c929916cbdb540d3407c66f19f73387f43e7c12fa318a66f64ac99da601bcdf"},\n {file = "propcache-0.3.0-cp313-cp313t-win32.whl", hash = "sha256:0c3e893c4464ebd751b44ae76c12c5f5c1e4f6cbd6fbf67e3783cd93ad221863"},\n {file = "propcache-0.3.0-cp313-cp313t-win_amd64.whl", hash = "sha256:75e872573220d1ee2305b35c9813626e620768248425f58798413e9c39741f46"},\n {file = "propcache-0.3.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:03c091bb752349402f23ee43bb2bff6bd80ccab7c9df6b88ad4322258d6960fc"},\n {file = "propcache-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:46ed02532cb66612d42ae5c3929b5e98ae330ea0f3900bc66ec5f4862069519b"},\n {file = "propcache-0.3.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:11ae6a8a01b8a4dc79093b5d3ca2c8a4436f5ee251a9840d7790dccbd96cb649"},\n {file = "propcache-0.3.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df03cd88f95b1b99052b52b1bb92173229d7a674df0ab06d2b25765ee8404bce"},\n {file = "propcache-0.3.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:03acd9ff19021bd0567582ac88f821b66883e158274183b9e5586f678984f8fe"},\n {file = "propcache-0.3.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd54895e4ae7d32f1e3dd91261df46ee7483a735017dc6f987904f194aa5fd14"},\n {file = "propcache-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26a67e5c04e3119594d8cfae517f4b9330c395df07ea65eab16f3d559b7068fe"},\n {file = "propcache-0.3.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ee25f1ac091def37c4b59d192bbe3a206298feeb89132a470325bf76ad122a1e"},\n {file = "propcache-0.3.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:58e6d2a5a7cb3e5f166fd58e71e9a4ff504be9dc61b88167e75f835da5764d07"},\n {file = "propcache-0.3.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:be90c94570840939fecedf99fa72839aed70b0ced449b415c85e01ae67422c90"},\n {file = "propcache-0.3.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:49ea05212a529c2caffe411e25a59308b07d6e10bf2505d77da72891f9a05641"},\n {file = "propcache-0.3.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:119e244ab40f70a98c91906d4c1f4c5f2e68bd0b14e7ab0a06922038fae8a20f"},\n {file = "propcache-0.3.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:507c5357a8d8b4593b97fb669c50598f4e6cccbbf77e22fa9598aba78292b4d7"},\n {file = "propcache-0.3.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:8526b0941ec5a40220fc4dfde76aed58808e2b309c03e9fa8e2260083ef7157f"},\n {file = "propcache-0.3.0-cp39-cp39-win32.whl", hash = "sha256:7cedd25e5f678f7738da38037435b340694ab34d424938041aa630d8bac42663"},\n {file = "propcache-0.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:bf4298f366ca7e1ad1d21bbb58300a6985015909964077afd37559084590c929"},\n {file = "propcache-0.3.0-py3-none-any.whl", hash = "sha256:67dda3c7325691c2081510e92c561f465ba61b975f481735aefdfc845d2cd043"},\n {file = "propcache-0.3.0.tar.gz", hash = "sha256:a8fd93de4e1d278046345f49e2238cdb298589325849b2645d4a94c53faeffc5"},\n]\n\n[[package]]\nname = "protobuf"\nversion = "5.29.4"\ndescription = ""\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "protobuf-5.29.4-cp310-abi3-win32.whl", hash = "sha256:13eb236f8eb9ec34e63fc8b1d6efd2777d062fa6aaa68268fb67cf77f6839ad7"},\n {file = "protobuf-5.29.4-cp310-abi3-win_amd64.whl", hash = "sha256:bcefcdf3976233f8a502d265eb65ea740c989bacc6c30a58290ed0e519eb4b8d"},\n {file = "protobuf-5.29.4-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:307ecba1d852ec237e9ba668e087326a67564ef83e45a0189a772ede9e854dd0"},\n {file = "protobuf-5.29.4-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:aec4962f9ea93c431d5714ed1be1c93f13e1a8618e70035ba2b0564d9e633f2e"},\n {file = "protobuf-5.29.4-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:d7d3f7d1d5a66ed4942d4fefb12ac4b14a29028b209d4bfb25c68ae172059922"},\n {file = "protobuf-5.29.4-cp38-cp38-win32.whl", hash = "sha256:1832f0515b62d12d8e6ffc078d7e9eb06969aa6dc13c13e1036e39d73bebc2de"},\n {file = "protobuf-5.29.4-cp38-cp38-win_amd64.whl", hash = "sha256:476cb7b14914c780605a8cf62e38c2a85f8caff2e28a6a0bad827ec7d6c85d68"},\n {file = "protobuf-5.29.4-cp39-cp39-win32.whl", hash = "sha256:fd32223020cb25a2cc100366f1dedc904e2d71d9322403224cdde5fdced0dabe"},\n {file = "protobuf-5.29.4-cp39-cp39-win_amd64.whl", hash = "sha256:678974e1e3a9b975b8bc2447fca458db5f93a2fb6b0c8db46b6675b5b5346812"},\n {file = "protobuf-5.29.4-py3-none-any.whl", hash = "sha256:3fde11b505e1597f71b875ef2fc52062b6a9740e5f7c8997ce878b6009145862"},\n {file = "protobuf-5.29.4.tar.gz", hash = "sha256:4f1dfcd7997b31ef8f53ec82781ff434a28bf71d9102ddde14d076adcfc78c99"},\n]\n\n[[package]]\nname = "pydantic"\nversion = "2.10.6"\ndescription = "Data validation using Python type hints"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"},\n {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"},\n]\n\n[package.dependencies]\nannotated-types = ">=0.6.0"\npydantic-core = "2.27.2"\ntyping-extensions = ">=4.12.2"\n\n[package.extras]\nemail = ["email-validator (>=2.0.0)"]\ntimezone = ["tzdata"]\n\n[[package]]\nname = "pydantic-core"\nversion = "2.27.2"\ndescription = "Core functionality for Pydantic validation and serialization"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"},\n {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"},\n {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a"},\n {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5"},\n {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c"},\n {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7"},\n {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a"},\n {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236"},\n {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962"},\n {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9"},\n {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af"},\n {file = "pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4"},\n {file = "pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31"},\n {file = "pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc"},\n {file = "pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7"},\n {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15"},\n {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306"},\n {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99"},\n {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459"},\n {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048"},\n {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d"},\n {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b"},\n {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474"},\n {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6"},\n {file = "pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c"},\n {file = "pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc"},\n {file = "pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4"},\n {file = "pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0"},\n {file = "pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef"},\n {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7"},\n {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934"},\n {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6"},\n {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c"},\n {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2"},\n {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4"},\n {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3"},\n {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4"},\n {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57"},\n {file = "pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc"},\n {file = "pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9"},\n {file = "pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b"},\n {file = "pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b"},\n {file = "pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154"},\n {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9"},\n {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9"},\n {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1"},\n {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a"},\n {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e"},\n {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4"},\n {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27"},\n {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee"},\n {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1"},\n {file = "pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130"},\n {file = "pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee"},\n {file = "pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b"},\n {file = "pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506"},\n {file = "pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320"},\n {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145"},\n {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1"},\n {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228"},\n {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046"},\n {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5"},\n {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a"},\n {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d"},\n {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9"},\n {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da"},\n {file = "pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b"},\n {file = "pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad"},\n {file = "pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993"},\n {file = "pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308"},\n {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4"},\n {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf"},\n {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76"},\n {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118"},\n {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630"},\n {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54"},\n {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f"},\n {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362"},\n {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96"},\n {file = "pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e"},\n {file = "pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67"},\n {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e"},\n {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8"},\n {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3"},\n {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f"},\n {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133"},\n {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc"},\n {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50"},\n {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9"},\n {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151"},\n {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656"},\n {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278"},\n {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb"},\n {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd"},\n {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc"},\n {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b"},\n {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b"},\n {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2"},\n {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35"},\n {file = "pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39"},\n]\n\n[package.dependencies]\ntyping-extensions = ">=4.6.0,<4.7.0 || >4.7.0"\n\n[[package]]\nname = "pydantic-settings"\nversion = "2.8.1"\ndescription = "Settings management using Pydantic"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "pydantic_settings-2.8.1-py3-none-any.whl", hash = "sha256:81942d5ac3d905f7f3ee1a70df5dfb62d5569c12f51a5a647defc1c3d9ee2e9c"},\n {file = "pydantic_settings-2.8.1.tar.gz", hash = "sha256:d5c663dfbe9db9d5e1c646b2e161da12f0d734d422ee56f567d0ea2cee4e8585"},\n]\n\n[package.dependencies]\npydantic = ">=2.7.0"\npython-dotenv = ">=0.21.0"\n\n[package.extras]\nazure-key-vault = ["azure-identity (>=1.16.0)", "azure-keyvault-secrets (>=4.8.0)"]\ntoml = ["tomli (>=2.0.1)"]\nyaml = ["pyyaml (>=6.0.1)"]\n\n[[package]]\nname = "python-dateutil"\nversion = "2.9.0.post0"\ndescription = "Extensions to the standard Python datetime module"\noptional = false\npython-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"\ngroups = ["main"]\nfiles = [\n {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"},\n {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"},\n]\n\n[package.dependencies]\nsix = ">=1.5"\n\n[[package]]\nname = "python-dotenv"\nversion = "1.0.1"\ndescription = "Read key-value pairs from a .env file and set them as environment variables"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"},\n {file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"},\n]\n\n[package.extras]\ncli = ["click (>=5.0)"]\n\n[[package]]\nname = "pyyaml"\nversion = "6.0.2"\ndescription = "YAML parser and emitter for Python"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"},\n {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"},\n {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237"},\n {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b"},\n {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed"},\n {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180"},\n {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68"},\n {file = "PyYAML-6.0.2-cp310-cp310-win32.whl", hash = "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99"},\n {file = "PyYAML-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e"},\n {file = "PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774"},\n {file = "PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee"},\n {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c"},\n {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317"},\n {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85"},\n {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4"},\n {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e"},\n {file = "PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5"},\n {file = "PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44"},\n {file = "PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab"},\n {file = "PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725"},\n {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5"},\n {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425"},\n {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476"},\n {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48"},\n {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b"},\n {file = "PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4"},\n {file = "PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8"},\n {file = "PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba"},\n {file = "PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1"},\n {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133"},\n {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484"},\n {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5"},\n {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc"},\n {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652"},\n {file = "PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183"},\n {file = "PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563"},\n {file = "PyYAML-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a"},\n {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5"},\n {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d"},\n {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083"},\n {file = "PyYAML-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706"},\n {file = "PyYAML-6.0.2-cp38-cp38-win32.whl", hash = "sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a"},\n {file = "PyYAML-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff"},\n {file = "PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d"},\n {file = "PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f"},\n {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290"},\n {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12"},\n {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19"},\n {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e"},\n {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725"},\n {file = "PyYAML-6.0.2-cp39-cp39-win32.whl", hash = "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631"},\n {file = "PyYAML-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8"},\n {file = "pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"},\n]\n\n[[package]]\nname = "setuptools"\nversion = "78.0.2"\ndescription = "Easily download, build, install, upgrade, and uninstall Python packages"\noptional = false\npython-versions = ">=3.9"\ngroups = ["main"]\nfiles = [\n {file = "setuptools-78.0.2-py3-none-any.whl", hash = "sha256:4a612c80e1f1d71b80e4906ce730152e8dec23df439f82731d9d0b608d7b700d"},\n {file = "setuptools-78.0.2.tar.gz", hash = "sha256:137525e6afb9022f019d6e884a319017f9bf879a0d8783985d32cbc8683cab93"},\n]\n\n[package.extras]\ncheck = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.8.0)"]\ncore = ["importlib_metadata (>=6)", "jaraco.functools (>=4)", "jaraco.text (>=3.7)", "more_itertools", "more_itertools (>=8.8)", "packaging (>=24.2)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"]\ncover = ["pytest-cov"]\ndoc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"]\nenabler = ["pytest-enabler (>=2.2)"]\ntest = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.7.2)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"]\ntype = ["importlib_metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.14.*)", "pytest-mypy"]\n\n[[package]]\nname = "six"\nversion = "1.17.0"\ndescription = "Python 2 and 3 compatibility utilities"\noptional = false\npython-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"\ngroups = ["main"]\nfiles = [\n {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"},\n {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"},\n]\n\n[[package]]\nname = "tenacity"\nversion = "9.0.0"\ndescription = "Retry code until it succeeds"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "tenacity-9.0.0-py3-none-any.whl", hash = "sha256:93de0c98785b27fcf659856aa9f54bfbd399e29969b0621bc7f762bd441b4539"},\n {file = "tenacity-9.0.0.tar.gz", hash = "sha256:807f37ca97d62aa361264d497b0e31e92b8027044942bfa756160d908320d73b"},\n]\n\n[package.extras]\ndoc = ["reno", "sphinx"]\ntest = ["pytest", "tornado (>=4.5)", "typeguard"]\n\n[[package]]\nname = "types-python-dateutil"\nversion = "2.9.0.20241206"\ndescription = "Typing stubs for python-dateutil"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "types_python_dateutil-2.9.0.20241206-py3-none-any.whl", hash = "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53"},\n {file = "types_python_dateutil-2.9.0.20241206.tar.gz", hash = "sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb"},\n]\n\n[[package]]\nname = "types-pyyaml"\nversion = "6.0.12.20241230"\ndescription = "Typing stubs for PyYAML"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "types_PyYAML-6.0.12.20241230-py3-none-any.whl", hash = "sha256:fa4d32565219b68e6dee5f67534c722e53c00d1cfc09c435ef04d7353e1e96e6"},\n {file = "types_pyyaml-6.0.12.20241230.tar.gz", hash = "sha256:7f07622dbd34bb9c8b264fe860a17e0efcad00d50b5f27e93984909d9363498c"},\n]\n\n[[package]]\nname = "typing-extensions"\nversion = "4.12.2"\ndescription = "Backported and Experimental Type Hints for Python 3.8+"\noptional = false\npython-versions = ">=3.8"\ngroups = ["main"]\nfiles = [\n {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"},\n {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"},\n]\n\n[[package]]\nname = "urllib3"\nversion = "2.3.0"\ndescription = "HTTP library with thread-safe connection pooling, file post, and more."\noptional = false\npython-versions = ">=3.9"\ngroups = ["main"]\nfiles = [\n {file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"},\n {file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"},\n]\n\n[package.extras]\nbrotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"]\nh2 = ["h2 (>=4,<5)"]\nsocks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]\nzstd = ["zstandard (>=0.18.0)"]\n\n[[package]]\nname = "yarl"\nversion = "1.18.3"\ndescription = "Yet another URL library"\noptional = false\npython-versions = ">=3.9"\ngroups = ["main"]\nfiles = [\n {file = "yarl-1.18.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7df647e8edd71f000a5208fe6ff8c382a1de8edfbccdbbfe649d263de07d8c34"},\n {file = "yarl-1.18.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c69697d3adff5aa4f874b19c0e4ed65180ceed6318ec856ebc423aa5850d84f7"},\n {file = "yarl-1.18.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:602d98f2c2d929f8e697ed274fbadc09902c4025c5a9963bf4e9edfc3ab6f7ed"},\n {file = "yarl-1.18.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c654d5207c78e0bd6d749f6dae1dcbbfde3403ad3a4b11f3c5544d9906969dde"},\n {file = "yarl-1.18.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5094d9206c64181d0f6e76ebd8fb2f8fe274950a63890ee9e0ebfd58bf9d787b"},\n {file = "yarl-1.18.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:35098b24e0327fc4ebdc8ffe336cee0a87a700c24ffed13161af80124b7dc8e5"},\n {file = "yarl-1.18.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3236da9272872443f81fedc389bace88408f64f89f75d1bdb2256069a8730ccc"},\n {file = "yarl-1.18.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e2c08cc9b16f4f4bc522771d96734c7901e7ebef70c6c5c35dd0f10845270bcd"},\n {file = "yarl-1.18.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:80316a8bd5109320d38eef8833ccf5f89608c9107d02d2a7f985f98ed6876990"},\n {file = "yarl-1.18.3-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:c1e1cc06da1491e6734f0ea1e6294ce00792193c463350626571c287c9a704db"},\n {file = "yarl-1.18.3-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:fea09ca13323376a2fdfb353a5fa2e59f90cd18d7ca4eaa1fd31f0a8b4f91e62"},\n {file = "yarl-1.18.3-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:e3b9fd71836999aad54084906f8663dffcd2a7fb5cdafd6c37713b2e72be1760"},\n {file = "yarl-1.18.3-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:757e81cae69244257d125ff31663249b3013b5dc0a8520d73694aed497fb195b"},\n {file = "yarl-1.18.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:b1771de9944d875f1b98a745bc547e684b863abf8f8287da8466cf470ef52690"},\n {file = "yarl-1.18.3-cp310-cp310-win32.whl", hash = "sha256:8874027a53e3aea659a6d62751800cf6e63314c160fd607489ba5c2edd753cf6"},\n {file = "yarl-1.18.3-cp310-cp310-win_amd64.whl", hash = "sha256:93b2e109287f93db79210f86deb6b9bbb81ac32fc97236b16f7433db7fc437d8"},\n {file = "yarl-1.18.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8503ad47387b8ebd39cbbbdf0bf113e17330ffd339ba1144074da24c545f0069"},\n {file = "yarl-1.18.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:02ddb6756f8f4517a2d5e99d8b2f272488e18dd0bfbc802f31c16c6c20f22193"},\n {file = "yarl-1.18.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:67a283dd2882ac98cc6318384f565bffc751ab564605959df4752d42483ad889"},\n {file = "yarl-1.18.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d980e0325b6eddc81331d3f4551e2a333999fb176fd153e075c6d1c2530aa8a8"},\n {file = "yarl-1.18.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b643562c12680b01e17239be267bc306bbc6aac1f34f6444d1bded0c5ce438ca"},\n {file = "yarl-1.18.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c017a3b6df3a1bd45b9fa49a0f54005e53fbcad16633870104b66fa1a30a29d8"},\n {file = "yarl-1.18.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75674776d96d7b851b6498f17824ba17849d790a44d282929c42dbb77d4f17ae"},\n {file = "yarl-1.18.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ccaa3a4b521b780a7e771cc336a2dba389a0861592bbce09a476190bb0c8b4b3"},\n {file = "yarl-1.18.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2d06d3005e668744e11ed80812e61efd77d70bb7f03e33c1598c301eea20efbb"},\n {file = "yarl-1.18.3-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:9d41beda9dc97ca9ab0b9888cb71f7539124bc05df02c0cff6e5acc5a19dcc6e"},\n {file = "yarl-1.18.3-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:ba23302c0c61a9999784e73809427c9dbedd79f66a13d84ad1b1943802eaaf59"},\n {file = "yarl-1.18.3-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:6748dbf9bfa5ba1afcc7556b71cda0d7ce5f24768043a02a58846e4a443d808d"},\n {file = "yarl-1.18.3-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:0b0cad37311123211dc91eadcb322ef4d4a66008d3e1bdc404808992260e1a0e"},\n {file = "yarl-1.18.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0fb2171a4486bb075316ee754c6d8382ea6eb8b399d4ec62fde2b591f879778a"},\n {file = "yarl-1.18.3-cp311-cp311-win32.whl", hash = "sha256:61b1a825a13bef4a5f10b1885245377d3cd0bf87cba068e1d9a88c2ae36880e1"},\n {file = "yarl-1.18.3-cp311-cp311-win_amd64.whl", hash = "sha256:b9d60031cf568c627d028239693fd718025719c02c9f55df0a53e587aab951b5"},\n {file = "yarl-1.18.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:1dd4bdd05407ced96fed3d7f25dbbf88d2ffb045a0db60dbc247f5b3c5c25d50"},\n {file = "yarl-1.18.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7c33dd1931a95e5d9a772d0ac5e44cac8957eaf58e3c8da8c1414de7dd27c576"},\n {file = "yarl-1.18.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:25b411eddcfd56a2f0cd6a384e9f4f7aa3efee14b188de13048c25b5e91f1640"},\n {file = "yarl-1.18.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:436c4fc0a4d66b2badc6c5fc5ef4e47bb10e4fd9bf0c79524ac719a01f3607c2"},\n {file = "yarl-1.18.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e35ef8683211db69ffe129a25d5634319a677570ab6b2eba4afa860f54eeaf75"},\n {file = "yarl-1.18.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:84b2deecba4a3f1a398df819151eb72d29bfeb3b69abb145a00ddc8d30094512"},\n {file = "yarl-1.18.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:00e5a1fea0fd4f5bfa7440a47eff01d9822a65b4488f7cff83155a0f31a2ecba"},\n {file = "yarl-1.18.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d0e883008013c0e4aef84dcfe2a0b172c4d23c2669412cf5b3371003941f72bb"},\n {file = "yarl-1.18.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5a3f356548e34a70b0172d8890006c37be92995f62d95a07b4a42e90fba54272"},\n {file = "yarl-1.18.3-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:ccd17349166b1bee6e529b4add61727d3f55edb7babbe4069b5764c9587a8cc6"},\n {file = "yarl-1.18.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b958ddd075ddba5b09bb0be8a6d9906d2ce933aee81100db289badbeb966f54e"},\n {file = "yarl-1.18.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c7d79f7d9aabd6011004e33b22bc13056a3e3fb54794d138af57f5ee9d9032cb"},\n {file = "yarl-1.18.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:4891ed92157e5430874dad17b15eb1fda57627710756c27422200c52d8a4e393"},\n {file = "yarl-1.18.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ce1af883b94304f493698b00d0f006d56aea98aeb49d75ec7d98cd4a777e9285"},\n {file = "yarl-1.18.3-cp312-cp312-win32.whl", hash = "sha256:f91c4803173928a25e1a55b943c81f55b8872f0018be83e3ad4938adffb77dd2"},\n {file = "yarl-1.18.3-cp312-cp312-win_amd64.whl", hash = "sha256:7e2ee16578af3b52ac2f334c3b1f92262f47e02cc6193c598502bd46f5cd1477"},\n {file = "yarl-1.18.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:90adb47ad432332d4f0bc28f83a5963f426ce9a1a8809f5e584e704b82685dcb"},\n {file = "yarl-1.18.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:913829534200eb0f789d45349e55203a091f45c37a2674678744ae52fae23efa"},\n {file = "yarl-1.18.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:ef9f7768395923c3039055c14334ba4d926f3baf7b776c923c93d80195624782"},\n {file = "yarl-1.18.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88a19f62ff30117e706ebc9090b8ecc79aeb77d0b1f5ec10d2d27a12bc9f66d0"},\n {file = "yarl-1.18.3-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e17c9361d46a4d5addf777c6dd5eab0715a7684c2f11b88c67ac37edfba6c482"},\n {file = "yarl-1.18.3-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1a74a13a4c857a84a845505fd2d68e54826a2cd01935a96efb1e9d86c728e186"},\n {file = "yarl-1.18.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:41f7ce59d6ee7741af71d82020346af364949314ed3d87553763a2df1829cc58"},\n {file = "yarl-1.18.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f52a265001d830bc425f82ca9eabda94a64a4d753b07d623a9f2863fde532b53"},\n {file = "yarl-1.18.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:82123d0c954dc58db301f5021a01854a85bf1f3bb7d12ae0c01afc414a882ca2"},\n {file = "yarl-1.18.3-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:2ec9bbba33b2d00999af4631a3397d1fd78290c48e2a3e52d8dd72db3a067ac8"},\n {file = "yarl-1.18.3-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:fbd6748e8ab9b41171bb95c6142faf068f5ef1511935a0aa07025438dd9a9bc1"},\n {file = "yarl-1.18.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:877d209b6aebeb5b16c42cbb377f5f94d9e556626b1bfff66d7b0d115be88d0a"},\n {file = "yarl-1.18.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:b464c4ab4bfcb41e3bfd3f1c26600d038376c2de3297760dfe064d2cb7ea8e10"},\n {file = "yarl-1.18.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8d39d351e7faf01483cc7ff7c0213c412e38e5a340238826be7e0e4da450fdc8"},\n {file = "yarl-1.18.3-cp313-cp313-win32.whl", hash = "sha256:61ee62ead9b68b9123ec24bc866cbef297dd266175d53296e2db5e7f797f902d"},\n {file = "yarl-1.18.3-cp313-cp313-win_amd64.whl", hash = "sha256:578e281c393af575879990861823ef19d66e2b1d0098414855dd367e234f5b3c"},\n {file = "yarl-1.18.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:61e5e68cb65ac8f547f6b5ef933f510134a6bf31bb178be428994b0cb46c2a04"},\n {file = "yarl-1.18.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fe57328fbc1bfd0bd0514470ac692630f3901c0ee39052ae47acd1d90a436719"},\n {file = "yarl-1.18.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a440a2a624683108a1b454705ecd7afc1c3438a08e890a1513d468671d90a04e"},\n {file = "yarl-1.18.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09c7907c8548bcd6ab860e5f513e727c53b4a714f459b084f6580b49fa1b9cee"},\n {file = "yarl-1.18.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b4f6450109834af88cb4cc5ecddfc5380ebb9c228695afc11915a0bf82116789"},\n {file = "yarl-1.18.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a9ca04806f3be0ac6d558fffc2fdf8fcef767e0489d2684a21912cc4ed0cd1b8"},\n {file = "yarl-1.18.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:77a6e85b90a7641d2e07184df5557132a337f136250caafc9ccaa4a2a998ca2c"},\n {file = "yarl-1.18.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6333c5a377c8e2f5fae35e7b8f145c617b02c939d04110c76f29ee3676b5f9a5"},\n {file = "yarl-1.18.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0b3c92fa08759dbf12b3a59579a4096ba9af8dd344d9a813fc7f5070d86bbab1"},\n {file = "yarl-1.18.3-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:4ac515b860c36becb81bb84b667466885096b5fc85596948548b667da3bf9f24"},\n {file = "yarl-1.18.3-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:045b8482ce9483ada4f3f23b3774f4e1bf4f23a2d5c912ed5170f68efb053318"},\n {file = "yarl-1.18.3-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:a4bb030cf46a434ec0225bddbebd4b89e6471814ca851abb8696170adb163985"},\n {file = "yarl-1.18.3-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:54d6921f07555713b9300bee9c50fb46e57e2e639027089b1d795ecd9f7fa910"},\n {file = "yarl-1.18.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1d407181cfa6e70077df3377938c08012d18893f9f20e92f7d2f314a437c30b1"},\n {file = "yarl-1.18.3-cp39-cp39-win32.whl", hash = "sha256:ac36703a585e0929b032fbaab0707b75dc12703766d0b53486eabd5139ebadd5"},\n {file = "yarl-1.18.3-cp39-cp39-win_amd64.whl", hash = "sha256:ba87babd629f8af77f557b61e49e7c7cac36f22f871156b91e10a6e9d4f829e9"},\n {file = "yarl-1.18.3-py3-none-any.whl", hash = "sha256:b57f4f58099328dfb26c6a771d09fb20dbbae81d20cfb66141251ea063bd101b"},\n {file = "yarl-1.18.3.tar.gz", hash = "sha256:ac1801c45cbf77b6c99242eeff4fffb5e4e73a800b5c4ad4fc0be5def634d2e1"},\n]\n\n[package.dependencies]\nidna = ">=2.0"\nmultidict = ">=4.0"\npropcache = ">=0.2.0"\n\n[metadata]\nlock-version = "2.1"\npython-versions = "^3.10"\ncontent-hash = "74c12e499aa797ca5c8559af579f1212b0e4e3a77f068f9385db39d70ba304e0"\n', source: 'out/python/quickstart/poetry.lock', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/pyproject.ts b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/pyproject.ts index f6998e57f..413651e31 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/pyproject.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/pyproject.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'unknown', content: - "[tool.poetry]\nname = 'hatchet-python-quickstart'\nversion = '0.1.0'\ndescription = 'Simple Setup to Run Hatchet Workflows'\nauthors = ['gabriel ruttner ']\nreadme = 'README.md'\npackage-mode = false\n\n[tool.poetry.dependencies]\npython = '^3.10'\nhatchet-sdk = '1.0.0a1'\n\n\n[build-system]\nrequires = ['poetry-core']\nbuild-backend = 'poetry.core.masonry.api'\n\n[tool.poetry.scripts]\nsimple = 'src.run:main'\nworker = 'src.worker:main'\n", + '[tool.poetry]\nname = "hatchet-python-quickstart"\nversion = "0.1.0"\ndescription = "Simple Setup to Run Hatchet Workflows"\nauthors = ["gabriel ruttner "]\nreadme = "README.md"\npackage-mode = false\n\n[tool.poetry.dependencies]\npython = "^3.10"\nhatchet-sdk = "1.0.0a1"\n\n\n[build-system]\nrequires = ["poetry-core"]\nbuild-backend = "poetry.core.masonry.api"\n\n[tool.poetry.scripts]\nsimple = "src.run:main"\nworker = "src.worker:main"\n', source: 'out/python/quickstart/pyproject.toml', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/run.ts b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/run.ts index 8964a6a63..6266c9cf9 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/run.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\nfrom .workflows.first_task import SimpleInput, first_task\n\n\nasync def main() -> None:\n result = await first_task.aio_run(SimpleInput(message='Hello World!'))\n\n print(\n 'Finished running task, and got the transformed message! The transformed message is:',\n result.transformed_message,\n )\n\n\nif __name__ == '__main__':\n asyncio.run(main())\n", + 'import asyncio\n\nfrom .workflows.first_task import SimpleInput, first_task\n\n\nasync def main() -> None:\n result = await first_task.aio_run(SimpleInput(message="Hello World!"))\n\n print(\n "Finished running task, and got the transformed message! The transformed message is:",\n result.transformed_message,\n )\n\n\nif __name__ == "__main__":\n asyncio.run(main())\n', source: 'out/python/quickstart/run.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/worker.ts index 45514eeab..499b304ae 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/worker.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from .hatchet_client import hatchet\nfrom .workflows.first_task import first_task\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'first-worker',\n slots=10,\n workflows=[first_task],\n )\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from .hatchet_client import hatchet\nfrom .workflows.first_task import first_task\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "first-worker",\n slots=10,\n workflows=[first_task],\n )\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/quickstart/worker.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/workflows/__init__.ts b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/workflows/__init__.ts index 2a8e02a63..451d4f6f8 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/workflows/__init__.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/workflows/__init__.ts @@ -6,6 +6,6 @@ const snippet: Snippet = { source: 'out/python/quickstart/workflows/__init__.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/workflows/first_task.ts b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/workflows/first_task.ts index d903ee0f0..707468091 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/workflows/first_task.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/quickstart/workflows/first_task.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from pydantic import BaseModel\n\nfrom hatchet_sdk import Context\n\nfrom ..hatchet_client import hatchet\n\n\nclass SimpleInput(BaseModel):\n message: str\n\n\nclass SimpleOutput(BaseModel):\n transformed_message: str\n\n\n# Declare the task to run\n@hatchet.task(name='first-task', input_validator=SimpleInput)\ndef first_task(input: SimpleInput, ctx: Context) -> SimpleOutput:\n print('first-task task called')\n\n return SimpleOutput(transformed_message=input.message.lower())\n", + 'from pydantic import BaseModel\n\nfrom hatchet_sdk import Context\n\nfrom ..hatchet_client import hatchet\n\n\nclass SimpleInput(BaseModel):\n message: str\n\n\nclass SimpleOutput(BaseModel):\n transformed_message: str\n\n\n# Declare the task to run\n@hatchet.task(name="first-task", input_validator=SimpleInput)\ndef first_task(input: SimpleInput, ctx: Context) -> SimpleOutput:\n print("first-task task called")\n\n return SimpleOutput(transformed_message=input.message.lower())\n', source: 'out/python/quickstart/workflows/first_task.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/dynamic.ts b/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/dynamic.ts index 02efff6ec..a6599381d 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/dynamic.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/dynamic.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet\nfrom hatchet_sdk.rate_limit import RateLimit\n\nhatchet = Hatchet(debug=True)\n\n\nclass DynamicRateLimitInput(BaseModel):\n group: str\n units: int\n limit: int\n\n\ndynamic_rate_limit_workflow = hatchet.workflow(\n name='DynamicRateLimitWorkflow', input_validator=DynamicRateLimitInput\n)\n\n\n@dynamic_rate_limit_workflow.task(\n rate_limits=[\n RateLimit(\n dynamic_key=''LIMIT:'+input.group',\n units='input.units',\n limit='input.limit',\n )\n ]\n)\ndef step1(input: DynamicRateLimitInput, ctx: Context) -> None:\n print('executed step1')\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'rate-limit-worker', slots=10, workflows=[dynamic_rate_limit_workflow]\n )\n worker.start()\n", + 'from pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet\nfrom hatchet_sdk.rate_limit import RateLimit\n\nhatchet = Hatchet(debug=True)\n\n\nclass DynamicRateLimitInput(BaseModel):\n group: str\n units: int\n limit: int\n\n\ndynamic_rate_limit_workflow = hatchet.workflow(\n name="DynamicRateLimitWorkflow", input_validator=DynamicRateLimitInput\n)\n\n\n@dynamic_rate_limit_workflow.task(\n rate_limits=[\n RateLimit(\n dynamic_key=\'"LIMIT:"+input.group\',\n units="input.units",\n limit="input.limit",\n )\n ]\n)\ndef step1(input: DynamicRateLimitInput, ctx: Context) -> None:\n print("executed step1")\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "rate-limit-worker", slots=10, workflows=[dynamic_rate_limit_workflow]\n )\n worker.start()\n', source: 'out/python/rate_limit/dynamic.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/test_rate_limit.ts b/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/test_rate_limit.ts index d0e4d6dec..732493d40 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/test_rate_limit.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/test_rate_limit.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\nimport time\n\nimport pytest\n\nfrom examples.rate_limit.worker import rate_limit_workflow\n\n\n@pytest.mark.skip(reason='The timing for this test is not reliable')\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_run() -> None:\n\n run1 = rate_limit_workflow.run_no_wait()\n run2 = rate_limit_workflow.run_no_wait()\n run3 = rate_limit_workflow.run_no_wait()\n\n start_time = time.time()\n\n await asyncio.gather(run1.aio_result(), run2.aio_result(), run3.aio_result())\n\n end_time = time.time()\n\n total_time = end_time - start_time\n\n assert (\n 1 <= total_time <= 5\n ), f'Expected runtime to be a bit more than 1 seconds, but it took {total_time:.2f} seconds'\n", + 'import asyncio\nimport time\n\nimport pytest\n\nfrom examples.rate_limit.worker import rate_limit_workflow\n\n\n@pytest.mark.skip(reason="The timing for this test is not reliable")\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_run() -> None:\n\n run1 = rate_limit_workflow.run_no_wait()\n run2 = rate_limit_workflow.run_no_wait()\n run3 = rate_limit_workflow.run_no_wait()\n\n start_time = time.time()\n\n await asyncio.gather(run1.aio_result(), run2.aio_result(), run3.aio_result())\n\n end_time = time.time()\n\n total_time = end_time - start_time\n\n assert (\n 1 <= total_time <= 5\n ), f"Expected runtime to be a bit more than 1 seconds, but it took {total_time:.2f} seconds"\n', source: 'out/python/rate_limit/test_rate_limit.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/trigger.ts index 27962e9bf..b61c8a3a9 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/trigger.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/rate_limit/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/worker.ts index d563413ef..eaa24f481 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/rate_limit/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet\nfrom hatchet_sdk.rate_limit import RateLimit, RateLimitDuration\n\nhatchet = Hatchet(debug=True)\n\n\n# > Workflow\nclass RateLimitInput(BaseModel):\n user_id: str\n\n\nrate_limit_workflow = hatchet.workflow(\n name='RateLimitWorkflow', input_validator=RateLimitInput\n)\n\n\n\n# > Static\nRATE_LIMIT_KEY = 'test-limit'\n\n\n@rate_limit_workflow.task(rate_limits=[RateLimit(static_key=RATE_LIMIT_KEY, units=1)])\ndef step_1(input: RateLimitInput, ctx: Context) -> None:\n print('executed step_1')\n\n\n\n# > Dynamic\n\n\n@rate_limit_workflow.task(\n rate_limits=[\n RateLimit(\n dynamic_key='input.user_id',\n units=1,\n limit=10,\n duration=RateLimitDuration.MINUTE,\n )\n ]\n)\ndef step_2(input: RateLimitInput, ctx: Context) -> None:\n print('executed step_2')\n\n\n\n\ndef main() -> None:\n hatchet.rate_limits.put(RATE_LIMIT_KEY, 2, RateLimitDuration.SECOND)\n\n worker = hatchet.worker(\n 'rate-limit-worker', slots=10, workflows=[rate_limit_workflow]\n )\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from pydantic import BaseModel\n\nfrom hatchet_sdk import Context, Hatchet\nfrom hatchet_sdk.rate_limit import RateLimit, RateLimitDuration\n\nhatchet = Hatchet(debug=True)\n\n\n# > Workflow\nclass RateLimitInput(BaseModel):\n user_id: str\n\n\nrate_limit_workflow = hatchet.workflow(\n name="RateLimitWorkflow", input_validator=RateLimitInput\n)\n\n\n\n# > Static\nRATE_LIMIT_KEY = "test-limit"\n\n\n@rate_limit_workflow.task(rate_limits=[RateLimit(static_key=RATE_LIMIT_KEY, units=1)])\ndef step_1(input: RateLimitInput, ctx: Context) -> None:\n print("executed step_1")\n\n\n\n# > Dynamic\n\n\n@rate_limit_workflow.task(\n rate_limits=[\n RateLimit(\n dynamic_key="input.user_id",\n units=1,\n limit=10,\n duration=RateLimitDuration.MINUTE,\n )\n ]\n)\ndef step_2(input: RateLimitInput, ctx: Context) -> None:\n print("executed step_2")\n\n\n\n\ndef main() -> None:\n hatchet.rate_limits.put(RATE_LIMIT_KEY, 2, RateLimitDuration.SECOND)\n\n worker = hatchet.worker(\n "rate-limit-worker", slots=10, workflows=[rate_limit_workflow]\n )\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/rate_limit/worker.py', blocks: { workflow: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/retries/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/retries/worker.ts index 66642ff09..ba549e4b9 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/retries/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/retries/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\nsimple_workflow = hatchet.workflow(name='SimpleRetryWorkflow')\nbackoff_workflow = hatchet.workflow(name='BackoffWorkflow')\n\n\n# > Simple Step Retries\n@simple_workflow.task(retries=3)\ndef always_fail(input: EmptyModel, ctx: Context) -> dict[str, str]:\n raise Exception('simple task failed')\n\n\n\n\n# > Retries with Count\n@simple_workflow.task(retries=3)\ndef fail_twice(input: EmptyModel, ctx: Context) -> dict[str, str]:\n if ctx.retry_count < 2:\n raise Exception('simple task failed')\n\n return {'status': 'success'}\n\n\n\n\n# > Retries with Backoff\n@backoff_workflow.task(\n retries=10,\n # 👀 Maximum number of seconds to wait between retries\n backoff_max_seconds=10,\n # 👀 Factor to increase the wait time between retries.\n # This sequence will be 2s, 4s, 8s, 10s, 10s, 10s... due to the maxSeconds limit\n backoff_factor=2.0,\n)\ndef backoff_task(input: EmptyModel, ctx: Context) -> dict[str, str]:\n if ctx.retry_count < 3:\n raise Exception('backoff task failed')\n\n return {'status': 'success'}\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker('backoff-worker', slots=4, workflows=[backoff_workflow])\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\nsimple_workflow = hatchet.workflow(name="SimpleRetryWorkflow")\nbackoff_workflow = hatchet.workflow(name="BackoffWorkflow")\n\n\n# > Simple Step Retries\n@simple_workflow.task(retries=3)\ndef always_fail(input: EmptyModel, ctx: Context) -> dict[str, str]:\n raise Exception("simple task failed")\n\n\n\n\n# > Retries with Count\n@simple_workflow.task(retries=3)\ndef fail_twice(input: EmptyModel, ctx: Context) -> dict[str, str]:\n if ctx.retry_count < 2:\n raise Exception("simple task failed")\n\n return {"status": "success"}\n\n\n\n\n# > Retries with Backoff\n@backoff_workflow.task(\n retries=10,\n # 👀 Maximum number of seconds to wait between retries\n backoff_max_seconds=10,\n # 👀 Factor to increase the wait time between retries.\n # This sequence will be 2s, 4s, 8s, 10s, 10s, 10s... due to the maxSeconds limit\n backoff_factor=2.0,\n)\ndef backoff_task(input: EmptyModel, ctx: Context) -> dict[str, str]:\n if ctx.retry_count < 3:\n raise Exception("backoff task failed")\n\n return {"status": "success"}\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker("backoff-worker", slots=4, workflows=[backoff_workflow])\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/retries/worker.py', blocks: { simple_step_retries: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/scheduled/programatic-async.ts b/frontend/app/src/next/lib/docs/generated/snips/python/scheduled/programatic-async.ts index 4bd0d9e01..affecc499 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/scheduled/programatic-async.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/scheduled/programatic-async.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from datetime import datetime, timedelta\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet()\n\n\nasync def create_scheduled() -> None:\n # > Create\n scheduled_run = await hatchet.scheduled.aio_create(\n workflow_name='simple-workflow',\n trigger_at=datetime.now() + timedelta(seconds=10),\n input={\n 'data': 'simple-workflow-data',\n },\n additional_metadata={\n 'customer_id': 'customer-a',\n },\n )\n\n scheduled_run.metadata.id # the id of the scheduled run trigger\n\n # > Delete\n await hatchet.scheduled.aio_delete(scheduled_id=scheduled_run.metadata.id)\n\n # > List\n await hatchet.scheduled.aio_list()\n\n # > Get\n scheduled_run = await hatchet.scheduled.aio_get(\n scheduled_id=scheduled_run.metadata.id\n )\n", + 'from datetime import datetime, timedelta\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet()\n\n\nasync def create_scheduled() -> None:\n # > Create\n scheduled_run = await hatchet.scheduled.aio_create(\n workflow_name="simple-workflow",\n trigger_at=datetime.now() + timedelta(seconds=10),\n input={\n "data": "simple-workflow-data",\n },\n additional_metadata={\n "customer_id": "customer-a",\n },\n )\n\n scheduled_run.metadata.id # the id of the scheduled run trigger\n\n # > Delete\n await hatchet.scheduled.aio_delete(scheduled_id=scheduled_run.metadata.id)\n\n # > List\n await hatchet.scheduled.aio_list()\n\n # > Get\n scheduled_run = await hatchet.scheduled.aio_get(\n scheduled_id=scheduled_run.metadata.id\n )\n', source: 'out/python/scheduled/programatic-async.py', blocks: { create: { @@ -24,6 +24,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/scheduled/programatic-sync.ts b/frontend/app/src/next/lib/docs/generated/snips/python/scheduled/programatic-sync.ts index f88251e8e..f921262a1 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/scheduled/programatic-sync.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/scheduled/programatic-sync.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from datetime import datetime, timedelta\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet()\n\n# > Create\nscheduled_run = hatchet.scheduled.create(\n workflow_name='simple-workflow',\n trigger_at=datetime.now() + timedelta(seconds=10),\n input={\n 'data': 'simple-workflow-data',\n },\n additional_metadata={\n 'customer_id': 'customer-a',\n },\n)\n\nid = scheduled_run.metadata.id # the id of the scheduled run trigger\n\n# > Delete\nhatchet.scheduled.delete(scheduled_id=scheduled_run.metadata.id)\n\n# > List\nscheduled_runs = hatchet.scheduled.list()\n\n# > Get\nscheduled_run = hatchet.scheduled.get(scheduled_id=scheduled_run.metadata.id)\n", + 'from datetime import datetime, timedelta\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet()\n\n# > Create\nscheduled_run = hatchet.scheduled.create(\n workflow_name="simple-workflow",\n trigger_at=datetime.now() + timedelta(seconds=10),\n input={\n "data": "simple-workflow-data",\n },\n additional_metadata={\n "customer_id": "customer-a",\n },\n)\n\nid = scheduled_run.metadata.id # the id of the scheduled run trigger\n\n# > Delete\nhatchet.scheduled.delete(scheduled_id=scheduled_run.metadata.id)\n\n# > List\nscheduled_runs = hatchet.scheduled.list()\n\n# > Get\nscheduled_run = hatchet.scheduled.get(scheduled_id=scheduled_run.metadata.id)\n', source: 'out/python/scheduled/programatic-sync.py', blocks: { create: { @@ -24,6 +24,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/simple/test_simple_workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/python/simple/test_simple_workflow.ts index a8522ade3..4846e75f2 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/simple/test_simple_workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/simple/test_simple_workflow.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import pytest\n\nfrom examples.simple.worker import simple, simple_durable\nfrom hatchet_sdk import EmptyModel\nfrom hatchet_sdk.runnables.standalone import Standalone\n\n\n@pytest.mark.parametrize('task', [simple, simple_durable])\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_simple_workflow_running_options(\n task: Standalone[EmptyModel, dict[str, str]]\n) -> None:\n x1 = task.run()\n x2 = await task.aio_run()\n\n x3 = task.run_many([task.create_bulk_run_item()])[0]\n x4 = (await task.aio_run_many([task.create_bulk_run_item()]))[0]\n\n x5 = task.run_no_wait().result()\n x6 = (await task.aio_run_no_wait()).result()\n x7 = [x.result() for x in task.run_many_no_wait([task.create_bulk_run_item()])][0]\n x8 = [\n x.result()\n for x in await task.aio_run_many_no_wait([task.create_bulk_run_item()])\n ][0]\n\n x9 = await task.run_no_wait().aio_result()\n x10 = await (await task.aio_run_no_wait()).aio_result()\n x11 = [\n await x.aio_result()\n for x in task.run_many_no_wait([task.create_bulk_run_item()])\n ][0]\n x12 = [\n await x.aio_result()\n for x in await task.aio_run_many_no_wait([task.create_bulk_run_item()])\n ][0]\n\n assert all(\n x == {'result': 'Hello, world!'}\n for x in [x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12]\n )\n", + 'import pytest\n\nfrom examples.simple.worker import simple, simple_durable\nfrom hatchet_sdk import EmptyModel\nfrom hatchet_sdk.runnables.standalone import Standalone\n\n\n@pytest.mark.parametrize("task", [simple, simple_durable])\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_simple_workflow_running_options(\n task: Standalone[EmptyModel, dict[str, str]]\n) -> None:\n x1 = task.run()\n x2 = await task.aio_run()\n\n x3 = task.run_many([task.create_bulk_run_item()])[0]\n x4 = (await task.aio_run_many([task.create_bulk_run_item()]))[0]\n\n x5 = task.run_no_wait().result()\n x6 = (await task.aio_run_no_wait()).result()\n x7 = [x.result() for x in task.run_many_no_wait([task.create_bulk_run_item()])][0]\n x8 = [\n x.result()\n for x in await task.aio_run_many_no_wait([task.create_bulk_run_item()])\n ][0]\n\n x9 = await task.run_no_wait().aio_result()\n x10 = await (await task.aio_run_no_wait()).aio_result()\n x11 = [\n await x.aio_result()\n for x in task.run_many_no_wait([task.create_bulk_run_item()])\n ][0]\n x12 = [\n await x.aio_result()\n for x in await task.aio_run_many_no_wait([task.create_bulk_run_item()])\n ][0]\n\n assert all(\n x == {"result": "Hello, world!"}\n for x in [x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12]\n )\n', source: 'out/python/simple/test_simple_workflow.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/simple/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/simple/trigger.ts index feca08f04..40a1ee5e3 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/simple/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/simple/trigger.ts @@ -2,11 +2,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', - content: - 'from examples.simple.worker import simple, non_blocking\n\nsimple.run_no_wait()\nnon_blocking.run_no_wait()\n', + content: 'from examples.simple.worker import simple\n\nsimple.run()\n', source: 'out/python/simple/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/simple/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/simple/worker.ts index 108c5bd9a..94fc3d484 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/simple/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/simple/worker.ts @@ -3,10 +3,15 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from hatchet_sdk import Context, EmptyModel, Hatchet\nimport time\nimport asyncio\n\nhatchet = Hatchet(debug=True)\n\n\n@hatchet.task()\nasync def simple(input: EmptyModel, ctx: Context) -> dict[str, str]:\n for i in range(60):\n print(f'blocking task {i}')\n time.sleep(1)\n\n@hatchet.task()\nasync def non_blocking(input: EmptyModel, ctx: Context) -> dict[str, str]:\n for i in range(60):\n print(f'non-blocking task {i}')\n await asyncio.sleep(1)\n\n\ndef main() -> None:\n worker = hatchet.worker('test-worker', workflows=[simple, non_blocking])\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + '# > Simple\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\n@hatchet.task()\ndef simple(input: EmptyModel, ctx: Context) -> dict[str, str]:\n return {"result": "Hello, world!"}\n\n\n@hatchet.durable_task()\ndef simple_durable(input: EmptyModel, ctx: Context) -> dict[str, str]:\n return {"result": "Hello, world!"}\n\n\ndef main() -> None:\n worker = hatchet.worker("test-worker", workflows=[simple, simple_durable])\n worker.start()\n\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/simple/worker.py', - blocks: {}, + blocks: { + simple: { + start: 2, + stop: 22, + }, + }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/sticky_workers/event.ts b/frontend/app/src/next/lib/docs/generated/snips/python/sticky_workers/event.ts index 3456708c6..7ccec6c32 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/sticky_workers/event.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/sticky_workers/event.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from examples.sticky_workers.worker import sticky_workflow\nfrom hatchet_sdk import TriggerWorkflowOptions\n\nsticky_workflow.run(\n options=TriggerWorkflowOptions(additional_metadata={'hello': 'moon'}),\n)\n", + 'from examples.sticky_workers.worker import sticky_workflow\nfrom hatchet_sdk import TriggerWorkflowOptions\n\nsticky_workflow.run(\n options=TriggerWorkflowOptions(additional_metadata={"hello": "moon"}),\n)\n', source: 'out/python/sticky_workers/event.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/sticky_workers/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/sticky_workers/worker.ts index eb1f7f2bf..1489c2f3e 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/sticky_workers/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/sticky_workers/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from hatchet_sdk import (\n Context,\n EmptyModel,\n Hatchet,\n StickyStrategy,\n TriggerWorkflowOptions,\n)\n\nhatchet = Hatchet(debug=True)\n\n# > StickyWorker\n\n\nsticky_workflow = hatchet.workflow(\n name='StickyWorkflow',\n # 👀 Specify a sticky strategy when declaring the workflow\n sticky=StickyStrategy.SOFT,\n)\n\n\n@sticky_workflow.task()\ndef step1a(input: EmptyModel, ctx: Context) -> dict[str, str | None]:\n return {'worker': ctx.worker.id()}\n\n\n@sticky_workflow.task()\ndef step1b(input: EmptyModel, ctx: Context) -> dict[str, str | None]:\n return {'worker': ctx.worker.id()}\n\n\n\n# > StickyChild\n\nsticky_child_workflow = hatchet.workflow(\n name='StickyChildWorkflow', sticky=StickyStrategy.SOFT\n)\n\n\n@sticky_workflow.task(parents=[step1a, step1b])\nasync def step2(input: EmptyModel, ctx: Context) -> dict[str, str | None]:\n ref = await sticky_child_workflow.aio_run_no_wait(\n options=TriggerWorkflowOptions(sticky=True)\n )\n\n await ref.aio_result()\n\n return {'worker': ctx.worker.id()}\n\n\n@sticky_child_workflow.task()\ndef child(input: EmptyModel, ctx: Context) -> dict[str, str | None]:\n return {'worker': ctx.worker.id()}\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'sticky-worker', slots=10, workflows=[sticky_workflow, sticky_child_workflow]\n )\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from hatchet_sdk import (\n Context,\n EmptyModel,\n Hatchet,\n StickyStrategy,\n TriggerWorkflowOptions,\n)\n\nhatchet = Hatchet(debug=True)\n\n# > StickyWorker\n\n\nsticky_workflow = hatchet.workflow(\n name="StickyWorkflow",\n # 👀 Specify a sticky strategy when declaring the workflow\n sticky=StickyStrategy.SOFT,\n)\n\n\n@sticky_workflow.task()\ndef step1a(input: EmptyModel, ctx: Context) -> dict[str, str | None]:\n return {"worker": ctx.worker.id()}\n\n\n@sticky_workflow.task()\ndef step1b(input: EmptyModel, ctx: Context) -> dict[str, str | None]:\n return {"worker": ctx.worker.id()}\n\n\n\n# > StickyChild\n\nsticky_child_workflow = hatchet.workflow(\n name="StickyChildWorkflow", sticky=StickyStrategy.SOFT\n)\n\n\n@sticky_workflow.task(parents=[step1a, step1b])\nasync def step2(input: EmptyModel, ctx: Context) -> dict[str, str | None]:\n ref = await sticky_child_workflow.aio_run_no_wait(\n options=TriggerWorkflowOptions(sticky=True)\n )\n\n await ref.aio_result()\n\n return {"worker": ctx.worker.id()}\n\n\n@sticky_child_workflow.task()\ndef child(input: EmptyModel, ctx: Context) -> dict[str, str | None]:\n return {"worker": ctx.worker.id()}\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "sticky-worker", slots=10, workflows=[sticky_workflow, sticky_child_workflow]\n )\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/sticky_workers/worker.py', blocks: { stickyworker: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/streaming/async_stream.ts b/frontend/app/src/next/lib/docs/generated/snips/python/streaming/async_stream.ts index 0893eb2ef..3ad78e486 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/streaming/async_stream.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/streaming/async_stream.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\nfrom examples.streaming.worker import streaming_workflow\n\n\nasync def main() -> None:\n ref = await streaming_workflow.aio_run_no_wait()\n await asyncio.sleep(1)\n\n stream = ref.stream()\n\n async for chunk in stream:\n print(chunk)\n\n\nif __name__ == '__main__':\n import asyncio\n\n asyncio.run(main())\n", + 'import asyncio\n\nfrom examples.streaming.worker import streaming_workflow\n\n\nasync def main() -> None:\n ref = await streaming_workflow.aio_run_no_wait()\n await asyncio.sleep(1)\n\n stream = ref.stream()\n\n async for chunk in stream:\n print(chunk)\n\n\nif __name__ == "__main__":\n import asyncio\n\n asyncio.run(main())\n', source: 'out/python/streaming/async_stream.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/streaming/sync_stream.ts b/frontend/app/src/next/lib/docs/generated/snips/python/streaming/sync_stream.ts index 1bb1527a4..babbaade7 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/streaming/sync_stream.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/streaming/sync_stream.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import time\n\nfrom examples.streaming.worker import streaming_workflow\n\n\ndef main() -> None:\n ref = streaming_workflow.run_no_wait()\n time.sleep(1)\n\n stream = ref.stream()\n\n for chunk in stream:\n print(chunk)\n\n\nif __name__ == '__main__':\n main()\n", + 'import time\n\nfrom examples.streaming.worker import streaming_workflow\n\n\ndef main() -> None:\n ref = streaming_workflow.run_no_wait()\n time.sleep(1)\n\n stream = ref.stream()\n\n for chunk in stream:\n print(chunk)\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/streaming/sync_stream.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/streaming/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/streaming/worker.ts index 9f5d604b6..b1fdcd3d0 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/streaming/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/streaming/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n# > Streaming\n\nstreaming_workflow = hatchet.workflow(name='StreamingWorkflow')\n\n\n@streaming_workflow.task()\nasync def step1(input: EmptyModel, ctx: Context) -> None:\n for i in range(10):\n await asyncio.sleep(1)\n ctx.put_stream(f'Processing {i}')\n\n\ndef main() -> None:\n worker = hatchet.worker('test-worker', workflows=[streaming_workflow])\n worker.start()\n\n\n\nif __name__ == '__main__':\n main()\n", + 'import asyncio\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\n# > Streaming\n\nstreaming_workflow = hatchet.workflow(name="StreamingWorkflow")\n\n\n@streaming_workflow.task()\nasync def step1(input: EmptyModel, ctx: Context) -> None:\n for i in range(10):\n await asyncio.sleep(1)\n ctx.put_stream(f"Processing {i}")\n\n\ndef main() -> None:\n worker = hatchet.worker("test-worker", workflows=[streaming_workflow])\n worker.start()\n\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/streaming/worker.py', blocks: { streaming: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/timeout/test_timeout.ts b/frontend/app/src/next/lib/docs/generated/snips/python/timeout/test_timeout.ts index 1be20d46d..3a1ea55c2 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/timeout/test_timeout.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/timeout/test_timeout.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import pytest\n\nfrom examples.timeout.worker import refresh_timeout_wf, timeout_wf\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_execution_timeout() -> None:\n run = timeout_wf.run_no_wait()\n\n with pytest.raises(Exception, match='(Task exceeded timeout|TIMED_OUT)'):\n await run.aio_result()\n\n\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_run_refresh_timeout() -> None:\n result = await refresh_timeout_wf.aio_run()\n\n assert result['refresh_task']['status'] == 'success'\n", + 'import pytest\n\nfrom examples.timeout.worker import refresh_timeout_wf, timeout_wf\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_execution_timeout() -> None:\n run = timeout_wf.run_no_wait()\n\n with pytest.raises(Exception, match="(Task exceeded timeout|TIMED_OUT)"):\n await run.aio_result()\n\n\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_run_refresh_timeout() -> None:\n result = await refresh_timeout_wf.aio_run()\n\n assert result["refresh_task"]["status"] == "success"\n', source: 'out/python/timeout/test_timeout.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/timeout/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/timeout/trigger.ts index 7362e98b5..fe206314a 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/timeout/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/timeout/trigger.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/python/timeout/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/timeout/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/timeout/worker.ts index 5bb2271cf..0ae2aa116 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/timeout/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/timeout/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import time\nfrom datetime import timedelta\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet, TaskDefaults\n\nhatchet = Hatchet(debug=True)\n\n# > ScheduleTimeout\ntimeout_wf = hatchet.workflow(\n name='TimeoutWorkflow',\n task_defaults=TaskDefaults(execution_timeout=timedelta(minutes=2)),\n)\n\n\n# > ExecutionTimeout\n# 👀 Specify an execution timeout on a task\n@timeout_wf.task(\n execution_timeout=timedelta(seconds=4), schedule_timeout=timedelta(minutes=10)\n)\ndef timeout_task(input: EmptyModel, ctx: Context) -> dict[str, str]:\n time.sleep(5)\n return {'status': 'success'}\n\n\n\nrefresh_timeout_wf = hatchet.workflow(name='RefreshTimeoutWorkflow')\n\n\n# > RefreshTimeout\n@refresh_timeout_wf.task(execution_timeout=timedelta(seconds=4))\ndef refresh_task(input: EmptyModel, ctx: Context) -> dict[str, str]:\n\n ctx.refresh_timeout(timedelta(seconds=10))\n time.sleep(5)\n\n return {'status': 'success'}\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'timeout-worker', slots=4, workflows=[timeout_wf, refresh_timeout_wf]\n )\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'import time\nfrom datetime import timedelta\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet, TaskDefaults\n\nhatchet = Hatchet(debug=True)\n\n# > ScheduleTimeout\ntimeout_wf = hatchet.workflow(\n name="TimeoutWorkflow",\n task_defaults=TaskDefaults(execution_timeout=timedelta(minutes=2)),\n)\n\n\n# > ExecutionTimeout\n# 👀 Specify an execution timeout on a task\n@timeout_wf.task(\n execution_timeout=timedelta(seconds=4), schedule_timeout=timedelta(minutes=10)\n)\ndef timeout_task(input: EmptyModel, ctx: Context) -> dict[str, str]:\n time.sleep(5)\n return {"status": "success"}\n\n\n\nrefresh_timeout_wf = hatchet.workflow(name="RefreshTimeoutWorkflow")\n\n\n# > RefreshTimeout\n@refresh_timeout_wf.task(execution_timeout=timedelta(seconds=4))\ndef refresh_task(input: EmptyModel, ctx: Context) -> dict[str, str]:\n\n ctx.refresh_timeout(timedelta(seconds=10))\n time.sleep(5)\n\n return {"status": "success"}\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "timeout-worker", slots=4, workflows=[timeout_wf, refresh_timeout_wf]\n )\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/timeout/worker.py', blocks: { scheduletimeout: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/waits/test_waits.ts b/frontend/app/src/next/lib/docs/generated/snips/python/waits/test_waits.ts index 4139de8e5..c499c811e 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/waits/test_waits.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/waits/test_waits.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\nimport os\n\nimport pytest\n\nfrom examples.waits.worker import task_condition_workflow\nfrom hatchet_sdk import Hatchet\n\n\n@pytest.mark.skipif(\n os.getenv('CI', 'false').lower() == 'true',\n reason='Skipped in CI because of unreliability',\n)\n@pytest.mark.asyncio(loop_scope='session')\nasync def test_waits(hatchet: Hatchet) -> None:\n\n ref = task_condition_workflow.run_no_wait()\n\n await asyncio.sleep(15)\n\n hatchet.event.push('skip_on_event:skip', {})\n hatchet.event.push('wait_for_event:start', {})\n\n result = await ref.aio_result()\n\n assert result['skip_on_event'] == {'skipped': True}\n\n first_random_number = result['start']['random_number']\n wait_for_event_random_number = result['wait_for_event']['random_number']\n wait_for_sleep_random_number = result['wait_for_sleep']['random_number']\n\n left_branch = result['left_branch']\n right_branch = result['right_branch']\n\n assert left_branch.get('skipped') is True or right_branch.get('skipped') is True\n\n branch_random_number = left_branch.get('random_number') or right_branch.get(\n 'random_number'\n )\n\n result_sum = result['sum']['sum']\n\n assert (\n result_sum\n == first_random_number\n + wait_for_event_random_number\n + wait_for_sleep_random_number\n + branch_random_number\n )\n", + 'import asyncio\nimport os\n\nimport pytest\n\nfrom examples.waits.worker import task_condition_workflow\nfrom hatchet_sdk import Hatchet\n\n\n@pytest.mark.skipif(\n os.getenv("CI", "false").lower() == "true",\n reason="Skipped in CI because of unreliability",\n)\n@pytest.mark.asyncio(loop_scope="session")\nasync def test_waits(hatchet: Hatchet) -> None:\n\n ref = task_condition_workflow.run_no_wait()\n\n await asyncio.sleep(15)\n\n hatchet.event.push("skip_on_event:skip", {})\n hatchet.event.push("wait_for_event:start", {})\n\n result = await ref.aio_result()\n\n assert result["skip_on_event"] == {"skipped": True}\n\n first_random_number = result["start"]["random_number"]\n wait_for_event_random_number = result["wait_for_event"]["random_number"]\n wait_for_sleep_random_number = result["wait_for_sleep"]["random_number"]\n\n left_branch = result["left_branch"]\n right_branch = result["right_branch"]\n\n assert left_branch.get("skipped") is True or right_branch.get("skipped") is True\n\n branch_random_number = left_branch.get("random_number") or right_branch.get(\n "random_number"\n )\n\n result_sum = result["sum"]["sum"]\n\n assert (\n result_sum\n == first_random_number\n + wait_for_event_random_number\n + wait_for_sleep_random_number\n + branch_random_number\n )\n', source: 'out/python/waits/test_waits.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/waits/trigger.ts b/frontend/app/src/next/lib/docs/generated/snips/python/waits/trigger.ts index 7ad1d5b58..bba279223 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/waits/trigger.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/waits/trigger.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import time\n\nfrom examples.waits.worker import hatchet, task_condition_workflow\n\ntask_condition_workflow.run_no_wait()\n\ntime.sleep(5)\n\nhatchet.event.push('skip_on_event:skip', {})\nhatchet.event.push('wait_for_event:start', {})\n", + 'import time\n\nfrom examples.waits.worker import hatchet, task_condition_workflow\n\ntask_condition_workflow.run_no_wait()\n\ntime.sleep(5)\n\nhatchet.event.push("skip_on_event:skip", {})\nhatchet.event.push("wait_for_event:start", {})\n', source: 'out/python/waits/trigger.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/waits/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/waits/worker.ts index 0bd2fae60..74a892517 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/waits/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/waits/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "# > Create a workflow\n\nimport random\nfrom datetime import timedelta\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import (\n Context,\n EmptyModel,\n Hatchet,\n ParentCondition,\n SleepCondition,\n UserEventCondition,\n or_,\n)\n\nhatchet = Hatchet(debug=True)\n\n\nclass StepOutput(BaseModel):\n random_number: int\n\n\nclass RandomSum(BaseModel):\n sum: int\n\n\ntask_condition_workflow = hatchet.workflow(name='TaskConditionWorkflow')\n\n\n\n# > Add base task\n@task_condition_workflow.task()\ndef start(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n\n\n# > Add wait for sleep\n@task_condition_workflow.task(\n parents=[start], wait_for=[SleepCondition(timedelta(seconds=10))]\n)\ndef wait_for_sleep(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n\n\n# > Add skip on event\n@task_condition_workflow.task(\n parents=[start],\n wait_for=[SleepCondition(timedelta(seconds=30))],\n skip_if=[UserEventCondition(event_key='skip_on_event:skip')],\n)\ndef skip_on_event(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n\n\n# > Add branching\n@task_condition_workflow.task(\n parents=[wait_for_sleep],\n skip_if=[\n ParentCondition(\n parent=wait_for_sleep,\n expression='output.random_number > 50',\n )\n ],\n)\ndef left_branch(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n@task_condition_workflow.task(\n parents=[wait_for_sleep],\n skip_if=[\n ParentCondition(\n parent=wait_for_sleep,\n expression='output.random_number <= 50',\n )\n ],\n)\ndef right_branch(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n\n\n# > Add wait for event\n@task_condition_workflow.task(\n parents=[start],\n wait_for=[\n or_(\n SleepCondition(duration=timedelta(minutes=1)),\n UserEventCondition(event_key='wait_for_event:start'),\n )\n ],\n)\ndef wait_for_event(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n\n\n# > Add sum\n@task_condition_workflow.task(\n parents=[\n start,\n wait_for_sleep,\n wait_for_event,\n skip_on_event,\n left_branch,\n right_branch,\n ],\n)\ndef sum(input: EmptyModel, ctx: Context) -> RandomSum:\n one = ctx.task_output(start).random_number\n two = ctx.task_output(wait_for_event).random_number\n three = ctx.task_output(wait_for_sleep).random_number\n four = (\n ctx.task_output(skip_on_event).random_number\n if not ctx.was_skipped(skip_on_event)\n else 0\n )\n\n five = (\n ctx.task_output(left_branch).random_number\n if not ctx.was_skipped(left_branch)\n else 0\n )\n six = (\n ctx.task_output(right_branch).random_number\n if not ctx.was_skipped(right_branch)\n else 0\n )\n\n return RandomSum(sum=one + two + three + four + five + six)\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker('dag-worker', workflows=[task_condition_workflow])\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + '# > Create a workflow\n\nimport random\nfrom datetime import timedelta\n\nfrom pydantic import BaseModel\n\nfrom hatchet_sdk import (\n Context,\n EmptyModel,\n Hatchet,\n ParentCondition,\n SleepCondition,\n UserEventCondition,\n or_,\n)\n\nhatchet = Hatchet(debug=True)\n\n\nclass StepOutput(BaseModel):\n random_number: int\n\n\nclass RandomSum(BaseModel):\n sum: int\n\n\ntask_condition_workflow = hatchet.workflow(name="TaskConditionWorkflow")\n\n\n\n# > Add base task\n@task_condition_workflow.task()\ndef start(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n\n\n# > Add wait for sleep\n@task_condition_workflow.task(\n parents=[start], wait_for=[SleepCondition(timedelta(seconds=10))]\n)\ndef wait_for_sleep(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n\n\n# > Add skip on event\n@task_condition_workflow.task(\n parents=[start],\n wait_for=[SleepCondition(timedelta(seconds=30))],\n skip_if=[UserEventCondition(event_key="skip_on_event:skip")],\n)\ndef skip_on_event(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n\n\n# > Add branching\n@task_condition_workflow.task(\n parents=[wait_for_sleep],\n skip_if=[\n ParentCondition(\n parent=wait_for_sleep,\n expression="output.random_number > 50",\n )\n ],\n)\ndef left_branch(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n@task_condition_workflow.task(\n parents=[wait_for_sleep],\n skip_if=[\n ParentCondition(\n parent=wait_for_sleep,\n expression="output.random_number <= 50",\n )\n ],\n)\ndef right_branch(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n\n\n# > Add wait for event\n@task_condition_workflow.task(\n parents=[start],\n wait_for=[\n or_(\n SleepCondition(duration=timedelta(minutes=1)),\n UserEventCondition(event_key="wait_for_event:start"),\n )\n ],\n)\ndef wait_for_event(input: EmptyModel, ctx: Context) -> StepOutput:\n return StepOutput(random_number=random.randint(1, 100))\n\n\n\n\n# > Add sum\n@task_condition_workflow.task(\n parents=[\n start,\n wait_for_sleep,\n wait_for_event,\n skip_on_event,\n left_branch,\n right_branch,\n ],\n)\ndef sum(input: EmptyModel, ctx: Context) -> RandomSum:\n one = ctx.task_output(start).random_number\n two = ctx.task_output(wait_for_event).random_number\n three = ctx.task_output(wait_for_sleep).random_number\n four = (\n ctx.task_output(skip_on_event).random_number\n if not ctx.was_skipped(skip_on_event)\n else 0\n )\n\n five = (\n ctx.task_output(left_branch).random_number\n if not ctx.was_skipped(left_branch)\n else 0\n )\n six = (\n ctx.task_output(right_branch).random_number\n if not ctx.was_skipped(right_branch)\n else 0\n )\n\n return RandomSum(sum=one + two + three + four + five + six)\n\n\n\n\ndef main() -> None:\n worker = hatchet.worker("dag-worker", workflows=[task_condition_workflow])\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/waits/worker.py', blocks: { create_a_workflow: { @@ -36,6 +36,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/worker.ts index 66c931ba4..790e5f7af 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/worker.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "from examples.affinity_workers.worker import affinity_worker_workflow\nfrom examples.bulk_fanout.worker import bulk_child_wf, bulk_parent_wf\nfrom examples.cancellation.worker import cancellation_workflow\nfrom examples.concurrency_limit.worker import concurrency_limit_workflow\nfrom examples.concurrency_limit_rr.worker import concurrency_limit_rr_workflow\nfrom examples.concurrency_multiple_keys.worker import concurrency_multiple_keys_workflow\nfrom examples.concurrency_workflow_level.worker import (\n concurrency_workflow_level_workflow,\n)\nfrom examples.dag.worker import dag_workflow\nfrom examples.dedupe.worker import dedupe_child_wf, dedupe_parent_wf\nfrom examples.durable.worker import durable_workflow\nfrom examples.events.worker import event_workflow\nfrom examples.fanout.worker import child_wf, parent_wf\nfrom examples.fanout_sync.worker import sync_fanout_child, sync_fanout_parent\nfrom examples.lifespans.simple import lifespan, lifespan_task\nfrom examples.logger.workflow import logging_workflow\nfrom examples.non_retryable.worker import non_retryable_workflow\nfrom examples.on_failure.worker import on_failure_wf, on_failure_wf_with_details\nfrom examples.simple.worker import simple, simple_durable\nfrom examples.timeout.worker import refresh_timeout_wf, timeout_wf\nfrom examples.waits.worker import task_condition_workflow\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\ndef main() -> None:\n worker = hatchet.worker(\n 'e2e-test-worker',\n slots=100,\n workflows=[\n affinity_worker_workflow,\n bulk_child_wf,\n bulk_parent_wf,\n concurrency_limit_workflow,\n concurrency_limit_rr_workflow,\n concurrency_multiple_keys_workflow,\n dag_workflow,\n dedupe_child_wf,\n dedupe_parent_wf,\n durable_workflow,\n child_wf,\n event_workflow,\n parent_wf,\n on_failure_wf,\n on_failure_wf_with_details,\n logging_workflow,\n timeout_wf,\n refresh_timeout_wf,\n task_condition_workflow,\n cancellation_workflow,\n sync_fanout_parent,\n sync_fanout_child,\n non_retryable_workflow,\n concurrency_workflow_level_workflow,\n lifespan_task,\n simple,\n simple_durable,\n ],\n lifespan=lifespan,\n )\n\n worker.start()\n\n\nif __name__ == '__main__':\n main()\n", + 'from examples.affinity_workers.worker import affinity_worker_workflow\nfrom examples.bulk_fanout.worker import bulk_child_wf, bulk_parent_wf\nfrom examples.cancellation.worker import cancellation_workflow\nfrom examples.concurrency_limit.worker import concurrency_limit_workflow\nfrom examples.concurrency_limit_rr.worker import concurrency_limit_rr_workflow\nfrom examples.concurrency_multiple_keys.worker import concurrency_multiple_keys_workflow\nfrom examples.concurrency_workflow_level.worker import (\n concurrency_workflow_level_workflow,\n)\nfrom examples.dag.worker import dag_workflow\nfrom examples.dedupe.worker import dedupe_child_wf, dedupe_parent_wf\nfrom examples.durable.worker import durable_workflow\nfrom examples.events.worker import event_workflow\nfrom examples.fanout.worker import child_wf, parent_wf\nfrom examples.fanout_sync.worker import sync_fanout_child, sync_fanout_parent\nfrom examples.lifespans.simple import lifespan, lifespan_task\nfrom examples.logger.workflow import logging_workflow\nfrom examples.non_retryable.worker import non_retryable_workflow\nfrom examples.on_failure.worker import on_failure_wf, on_failure_wf_with_details\nfrom examples.simple.worker import simple, simple_durable\nfrom examples.timeout.worker import refresh_timeout_wf, timeout_wf\nfrom examples.waits.worker import task_condition_workflow\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet(debug=True)\n\n\ndef main() -> None:\n worker = hatchet.worker(\n "e2e-test-worker",\n slots=100,\n workflows=[\n affinity_worker_workflow,\n bulk_child_wf,\n bulk_parent_wf,\n concurrency_limit_workflow,\n concurrency_limit_rr_workflow,\n concurrency_multiple_keys_workflow,\n dag_workflow,\n dedupe_child_wf,\n dedupe_parent_wf,\n durable_workflow,\n child_wf,\n event_workflow,\n parent_wf,\n on_failure_wf,\n on_failure_wf_with_details,\n logging_workflow,\n timeout_wf,\n refresh_timeout_wf,\n task_condition_workflow,\n cancellation_workflow,\n sync_fanout_parent,\n sync_fanout_child,\n non_retryable_workflow,\n concurrency_workflow_level_workflow,\n lifespan_task,\n simple,\n simple_durable,\n ],\n lifespan=lifespan,\n )\n\n worker.start()\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/worker.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/worker_existing_loop/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/worker_existing_loop/worker.ts index c0d47a100..6de142995 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/worker_existing_loop/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/worker_existing_loop/worker.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "import asyncio\nfrom contextlib import suppress\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\nexisting_loop_worker = hatchet.workflow(name='WorkerExistingLoopWorkflow')\n\n\n@existing_loop_worker.task()\nasync def task(input: EmptyModel, ctx: Context) -> dict[str, str]:\n print('started')\n await asyncio.sleep(10)\n print('finished')\n return {'result': 'returned result'}\n\n\nasync def async_main() -> None:\n worker = None\n try:\n worker = hatchet.worker(\n 'test-worker', slots=1, workflows=[existing_loop_worker]\n )\n worker.start()\n\n ref = existing_loop_worker.run_no_wait()\n print(await ref.aio_result())\n while True:\n await asyncio.sleep(1)\n finally:\n if worker:\n await worker.exit_gracefully()\n\n\ndef main() -> None:\n with suppress(KeyboardInterrupt):\n asyncio.run(async_main())\n\n\nif __name__ == '__main__':\n main()\n", + 'import asyncio\nfrom contextlib import suppress\n\nfrom hatchet_sdk import Context, EmptyModel, Hatchet\n\nhatchet = Hatchet(debug=True)\n\nexisting_loop_worker = hatchet.workflow(name="WorkerExistingLoopWorkflow")\n\n\n@existing_loop_worker.task()\nasync def task(input: EmptyModel, ctx: Context) -> dict[str, str]:\n print("started")\n await asyncio.sleep(10)\n print("finished")\n return {"result": "returned result"}\n\n\nasync def async_main() -> None:\n worker = None\n try:\n worker = hatchet.worker(\n "test-worker", slots=1, workflows=[existing_loop_worker]\n )\n worker.start()\n\n ref = existing_loop_worker.run_no_wait()\n print(await ref.aio_result())\n while True:\n await asyncio.sleep(1)\n finally:\n if worker:\n await worker.exit_gracefully()\n\n\ndef main() -> None:\n with suppress(KeyboardInterrupt):\n asyncio.run(async_main())\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/worker_existing_loop/worker.py', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/python/workflow_registration/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/python/workflow_registration/worker.ts index ff6b485da..335376ae5 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/python/workflow_registration/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/python/workflow_registration/worker.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'python', content: - "# > WorkflowRegistration\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet(debug=True)\n\nwf_one = hatchet.workflow(name='wf_one')\nwf_two = hatchet.workflow(name='wf_two')\nwf_three = hatchet.workflow(name='wf_three')\nwf_four = hatchet.workflow(name='wf_four')\nwf_five = hatchet.workflow(name='wf_five')\n\n# define tasks here\n\n\ndef main() -> None:\n # 👀 Register workflows directly when instantiating the worker\n worker = hatchet.worker('test-worker', slots=1, workflows=[wf_one, wf_two])\n\n # 👀 Register a single workflow after instantiating the worker\n worker.register_workflow(wf_three)\n\n # 👀 Register multiple workflows in bulk after instantiating the worker\n worker.register_workflows([wf_four, wf_five])\n\n worker.start()\n\n\n\nif __name__ == '__main__':\n main()\n", + '# > WorkflowRegistration\n\nfrom hatchet_sdk import Hatchet\n\nhatchet = Hatchet(debug=True)\n\nwf_one = hatchet.workflow(name="wf_one")\nwf_two = hatchet.workflow(name="wf_two")\nwf_three = hatchet.workflow(name="wf_three")\nwf_four = hatchet.workflow(name="wf_four")\nwf_five = hatchet.workflow(name="wf_five")\n\n# define tasks here\n\n\ndef main() -> None:\n # 👀 Register workflows directly when instantiating the worker\n worker = hatchet.worker("test-worker", slots=1, workflows=[wf_one, wf_two])\n\n # 👀 Register a single workflow after instantiating the worker\n worker.register_workflow(wf_three)\n\n # 👀 Register multiple workflows in bulk after instantiating the worker\n worker.register_workflows([wf_four, wf_five])\n\n worker.start()\n\n\n\nif __name__ == "__main__":\n main()\n', source: 'out/python/workflow_registration/worker.py', blocks: { workflowregistration: { @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/cancellations/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/cancellations/run.ts index e6d0cc654..c5c5631ed 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/cancellations/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/cancellations/run.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/cancellations/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/cancellations/worker.ts index 97b4563da..0ef83304c 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/cancellations/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/cancellations/worker.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/cancellations/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/cancellations/workflow.ts index c8be348c6..ff781bd75 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/cancellations/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/cancellations/workflow.ts @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/child_workflows/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/child_workflows/run.ts index b14a0c425..18932b3bc 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/child_workflows/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/child_workflows/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/child_workflows/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/child_workflows/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/child_workflows/worker.ts index 64323aca1..ef8eb8884 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/child_workflows/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/child_workflows/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/child_workflows/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/child_workflows/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/child_workflows/workflow.ts index 941237bd9..45236041b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/child_workflows/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/child_workflows/workflow.ts @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/load.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/load.ts index 85918e1d9..56e8d1616 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/load.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/load.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/concurrency-rr/load.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/run.ts index a34c691f6..55601b078 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/concurrency-rr/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/worker.ts index 6fdc7c484..4ce0c02a5 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/concurrency-rr/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/workflow.ts index 0272c535a..73a3ef0b9 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/concurrency-rr/workflow.ts @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/interface-workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/interface-workflow.ts index 691ca4fe6..695e813ec 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/interface-workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/interface-workflow.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/dag/interface-workflow.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/run.ts index b8f5de235..5b1224cd5 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/dag/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/worker.ts index ebd67641c..38d226698 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/dag/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/workflow.ts index b1d9f04dc..014e56025 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag/workflow.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/complex-workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/complex-workflow.ts index 26fe99b15..4a9ea5760 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/complex-workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/complex-workflow.ts @@ -36,6 +36,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/event.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/event.ts index 7554dcb1f..bacf9cb28 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/event.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/event.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/dag_match_condition/event.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/run.ts index 9084e44f7..f0cd92bfe 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/dag_match_condition/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/worker.ts index d76c07a01..42fc4f351 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/dag_match_condition/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/workflow.ts index a0d057f8d..92637c86b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/dag_match_condition/workflow.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/dag_match_condition/workflow.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/deep/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/deep/run.ts index aae3f0cb3..7b3fb165f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/deep/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/deep/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/deep/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/deep/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/deep/worker.ts index 91080963d..dc4262c6f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/deep/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/deep/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/deep/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/deep/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/deep/workflow.ts index c3b538ec0..6f4203aea 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/deep/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/deep/workflow.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/deep/workflow.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/event.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/event.ts index 8be267343..d95774daa 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/event.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/event.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/durable-event/event.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/run.ts index b3cdabcb7..63d20a89b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/durable-event/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/worker.ts index c2b076303..ccd49ff08 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/durable-event/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/workflow.ts index e926cd337..21d19fc3b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-event/workflow.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'typescript ', content: - "// import sleep from '@hatchet-dev/typescript-sdk/util/sleep';\nimport { hatchet } from '../hatchet-client';\n\n// > Durable Event\nexport const durableEvent = hatchet.durableTask({\n name: 'durable-event',\n executionTimeout: '10m',\n fn: async (_, ctx) => {\n const res = ctx.waitFor({\n eventKey: 'user:update',\n });\n\n console.log('res', res);\n\n return {\n Value: 'done',\n };\n },\n});\n\nexport const durableEventWithFilter = hatchet.durableTask({\n name: 'durable-event-with-filter',\n executionTimeout: '10m',\n fn: async (_, ctx) => {\n // > Durable Event With Filter\n const res = ctx.waitFor({\n eventKey: 'user:update',\n expression: 'input.userId == '1234'',\n });\n\n console.log('res', res);\n\n return {\n Value: 'done',\n };\n },\n});\n", + "// import sleep from '@hatchet-dev/typescript-sdk/util/sleep';\nimport { hatchet } from '../hatchet-client';\n\n// > Durable Event\nexport const durableEvent = hatchet.durableTask({\n name: 'durable-event',\n executionTimeout: '10m',\n fn: async (_, ctx) => {\n const res = ctx.waitFor({\n eventKey: 'user:update',\n });\n\n console.log('res', res);\n\n return {\n Value: 'done',\n };\n },\n});\n\nexport const durableEventWithFilter = hatchet.durableTask({\n name: 'durable-event-with-filter',\n executionTimeout: '10m',\n fn: async (_, ctx) => {\n // > Durable Event With Filter\n const res = ctx.waitFor({\n eventKey: 'user:update',\n expression: \"input.userId == '1234'\",\n });\n\n console.log('res', res);\n\n return {\n Value: 'done',\n };\n },\n});\n", source: 'out/typescript/durable-event/workflow.ts', blocks: { durable_event: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/event.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/event.ts index 6f3b45e04..0a34662c1 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/event.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/event.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/durable-sleep/event.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/run.ts index dc03663d6..9f028b761 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/durable-sleep/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/worker.ts index 8aae3518f..6f69f36d4 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/durable-sleep/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/workflow.ts index 9694334f4..207d49a9c 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/durable-sleep/workflow.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/hatchet-client.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/hatchet-client.ts index bb42ff722..c6c2a4d4b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/hatchet-client.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/hatchet-client.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/hatchet-client.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/child-worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/child-worker.ts index ce90bc57c..fd039eae5 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/child-worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/child-worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/high-memory/child-worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/parent-worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/parent-worker.ts index 64ce4ceab..00994c13b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/parent-worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/parent-worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/high-memory/parent-worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/run.ts index 61bc28bc4..e773de952 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/high-memory/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/workflow-with-child.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/workflow-with-child.ts index 63bd9d462..54529b9b1 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/workflow-with-child.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/high-memory/workflow-with-child.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/high-memory/workflow-with-child.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/inferred-typing/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/inferred-typing/run.ts index 758a1579b..27bf35f0b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/inferred-typing/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/inferred-typing/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/inferred-typing/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/inferred-typing/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/inferred-typing/worker.ts index a303a8d9e..a9152eedf 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/inferred-typing/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/inferred-typing/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/inferred-typing/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/inferred-typing/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/inferred-typing/workflow.ts index eef4965f7..7101a8ea8 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/inferred-typing/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/inferred-typing/workflow.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/inferred-typing/workflow.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/durable-excution.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/durable-excution.ts index ad155385e..ea35ab142 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/durable-excution.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/durable-excution.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'typescript ', content: - "import { Or } from '@hatchet-dev/typescript-sdk/v1/conditions';\nimport { hatchet } from '../hatchet-client';\n\n// (optional) Define the input type for the workflow\nexport type SimpleInput = {\n Message: string;\n};\nasync function main() {\n // > Declaring a Durable Task\n const simple = hatchet.durableTask({\n name: 'simple',\n fn: async (input: SimpleInput, ctx) => {\n await ctx.waitFor(\n Or(\n {\n eventKey: 'user:pay',\n expression: 'input.Status == 'PAID'',\n },\n {\n sleepFor: '24h',\n }\n )\n );\n\n return {\n TransformedMessage: input.Message.toLowerCase(),\n };\n },\n });\n\n // > Running a Task\n const result = await simple.run({ Message: 'Hello, World!' });\n}\n\nif (require.main === module) {\n main();\n}\n", + "import { Or } from '@hatchet-dev/typescript-sdk/v1/conditions';\nimport { hatchet } from '../hatchet-client';\n\n// (optional) Define the input type for the workflow\nexport type SimpleInput = {\n Message: string;\n};\nasync function main() {\n // > Declaring a Durable Task\n const simple = hatchet.durableTask({\n name: 'simple',\n fn: async (input: SimpleInput, ctx) => {\n await ctx.waitFor(\n Or(\n {\n eventKey: 'user:pay',\n expression: 'input.Status == \"PAID\"',\n },\n {\n sleepFor: '24h',\n }\n )\n );\n\n return {\n TransformedMessage: input.Message.toLowerCase(),\n };\n },\n });\n\n // > Running a Task\n const result = await simple.run({ Message: 'Hello, World!' });\n}\n\nif (require.main === module) {\n main();\n}\n", source: 'out/typescript/landing_page/durable-excution.ts', blocks: { declaring_a_durable_task: { @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/event-signaling.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/event-signaling.ts index 8294165dd..b5791ab74 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/event-signaling.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/event-signaling.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/flow-control.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/flow-control.ts index 23168b60c..b6c3d36d2 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/flow-control.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/flow-control.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/queues.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/queues.ts index 805ecc47b..9971a884b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/queues.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/queues.ts @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/scheduling.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/scheduling.ts index 7af5808b3..6c262270b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/scheduling.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/scheduling.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/task-routing.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/task-routing.ts index 5f65119f5..535774f17 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/task-routing.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/landing_page/task-routing.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/legacy/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/legacy/run.ts index f4849d846..2842fc35f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/legacy/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/legacy/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/legacy/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/legacy/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/legacy/worker.ts index bb3530d48..769ff7ea2 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/legacy/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/legacy/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/legacy/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/legacy/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/legacy/workflow.ts index bfc164f67..217373618 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/legacy/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/legacy/workflow.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/legacy/workflow.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/migration-guides/hatchet-client.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/migration-guides/hatchet-client.ts index 753cb3c7d..25081a699 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/migration-guides/hatchet-client.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/migration-guides/hatchet-client.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/migration-guides/hatchet-client.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/migration-guides/mergent.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/migration-guides/mergent.ts index 9c5dc169e..2cd4989ce 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/migration-guides/mergent.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/migration-guides/mergent.ts @@ -32,6 +32,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/multiple_wf_concurrency/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/multiple_wf_concurrency/run.ts index 7982c982c..dc8698029 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/multiple_wf_concurrency/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/multiple_wf_concurrency/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/multiple_wf_concurrency/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/multiple_wf_concurrency/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/multiple_wf_concurrency/worker.ts index 0c52f825e..4c9ad60a3 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/multiple_wf_concurrency/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/multiple_wf_concurrency/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/multiple_wf_concurrency/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/multiple_wf_concurrency/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/multiple_wf_concurrency/workflow.ts index 7adf59efa..4ef745bb5 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/multiple_wf_concurrency/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/multiple_wf_concurrency/workflow.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/non_retryable/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/non_retryable/run.ts index 1dbab4ea1..44baf68ad 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/non_retryable/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/non_retryable/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/non_retryable/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/non_retryable/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/non_retryable/worker.ts index 52d703a75..68c8854b5 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/non_retryable/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/non_retryable/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/non_retryable/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/non_retryable/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/non_retryable/workflow.ts index e4b837867..2a3d309c3 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/non_retryable/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/non_retryable/workflow.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_cron/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_cron/worker.ts index d47404e26..d86b2762f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_cron/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_cron/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/on_cron/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_cron/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_cron/workflow.ts index bc99efae5..5b83050ac 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_cron/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_cron/workflow.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/event.e2e.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/event.e2e.ts index 40e5dfcb2..344207d5d 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/event.e2e.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/event.e2e.ts @@ -3,10 +3,10 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'typescript ', content: - "import sleep from '@hatchet-dev/typescript-sdk-dev/typescript-sdk/util/sleep';\nimport { randomUUID } from 'crypto';\nimport { Event } from '@hatchet-dev/typescript-sdk-dev/typescript-sdk/protoc/events';\nimport { SIMPLE_EVENT, lower, Input } from './workflow';\nimport { hatchet } from '../hatchet-client';\nimport { Worker } from '../../client/worker/worker';\n\nxdescribe('events-e2e', () => {\n let worker: Worker;\n let testRunId: string;\n\n beforeEach(async () => {\n testRunId = randomUUID();\n\n worker = await hatchet.worker('event-worker');\n await worker.registerWorkflow(lower);\n\n void worker.start();\n });\n\n afterAll(async () => {\n await worker.stop();\n await sleep(2000);\n });\n\n async function setupEventFilter(expression?: string, payload: Record = {}) {\n const finalExpression =\n expression || `input.ShouldSkip == false && payload.testRunId == '${testRunId}'`;\n\n const workflowId = (await hatchet.workflows.get(lower.name)).metadata.id;\n\n const filter = await hatchet.filters.create({\n workflowId,\n expression: finalExpression,\n scope: testRunId,\n payload: { testRunId, ...payload },\n });\n\n return async () => {\n await hatchet.filters.delete(filter.metadata.id);\n };\n }\n\n // Helper function to wait for events to process and fetch runs\n async function waitForEventsToProcess(events: Event[]): Promise> {\n await sleep(3000);\n\n const persisted = (await hatchet.events.list({ limit: 100 })).rows || [];\n\n // Ensure all our events are persisted\n const eventIds = new Set(events.map((e) => e.eventId));\n const persistedIds = new Set(persisted.map((e) => e.metadata.id));\n expect(Array.from(eventIds).every((id) => persistedIds.has(id))).toBeTruthy();\n\n let attempts = 0;\n const maxAttempts = 15;\n const eventToRuns: Record = {};\n\n while (true) {\n console.log('Waiting for event runs to complete...');\n if (attempts > maxAttempts) {\n console.log('Timed out waiting for event runs to complete.');\n return {};\n }\n\n attempts += 1;\n\n // For each event, fetch its runs\n const runsPromises = events.map(async (event) => {\n const runs = await hatchet.runs.list({\n triggeringEventExternalId: event.eventId,\n });\n\n // Extract metadata from event\n const meta = event.additionalMetadata ? JSON.parse(event.additionalMetadata) : {};\n\n const payload = event.payload ? JSON.parse(event.payload) : {};\n\n return {\n event: {\n id: event.eventId,\n payload,\n meta,\n shouldHaveRuns: Boolean(meta.should_have_runs),\n testRunId: meta.test_run_id,\n },\n runs: runs.rows || [],\n };\n });\n\n const eventRuns = await Promise.all(runsPromises);\n\n // If all events have no runs yet, wait and retry\n if (eventRuns.every(({ runs }) => runs.length === 0)) {\n await sleep(1000);\n\n continue;\n }\n\n // Store runs by event ID\n for (const { event, runs } of eventRuns) {\n eventToRuns[event.id] = runs;\n }\n\n // Check if any runs are still in progress\n const anyInProgress = Object.values(eventToRuns).some((runs) =>\n runs.some((run) => run.status === 'QUEUED' || run.status === 'RUNNING')\n );\n\n if (anyInProgress) {\n await sleep(1000);\n\n continue;\n }\n\n break;\n }\n\n return eventToRuns;\n }\n\n // Helper to verify runs match expectations\n function verifyEventRuns(eventData: any, runs: any[]) {\n if (eventData.shouldHaveRuns) {\n expect(runs.length).toBeGreaterThan(0);\n } else {\n expect(runs.length).toBe(0);\n }\n }\n\n // Helper to create bulk push event objects\n function createBulkPushEvent({\n index = 1,\n ShouldSkip = false,\n shouldHaveRuns = true,\n key = SIMPLE_EVENT,\n payload = {},\n scope = null,\n }: {\n index?: number;\n ShouldSkip?: boolean;\n shouldHaveRuns?: boolean;\n key?: string;\n payload?: Record;\n scope?: string | null;\n }) {\n return {\n key,\n payload: {\n ShouldSkip,\n Message: `This is event ${index}`,\n ...payload,\n },\n additionalMetadata: {\n should_have_runs: shouldHaveRuns,\n test_run_id: testRunId,\n key,\n index,\n },\n scope: scope || undefined,\n };\n }\n\n // Helper to create payload object\n function createEventPayload(ShouldSkip: boolean): Input {\n return { ShouldSkip, Message: 'This is event 1' };\n }\n\n it('should push an event', async () => {\n const event = await hatchet.events.push(SIMPLE_EVENT, createEventPayload(false));\n expect(event.eventId).toBeTruthy();\n }, 10000);\n\n it('should push an event asynchronously', async () => {\n const event = await hatchet.events.push(SIMPLE_EVENT, createEventPayload(false));\n expect(event.eventId).toBeTruthy();\n }, 10000);\n\n it('should bulk push events', async () => {\n const events = [\n {\n key: SIMPLE_EVENT,\n payload: { Message: 'This is event 1', ShouldSkip: false },\n additionalMetadata: { source: 'test', user_id: 'user123' },\n },\n {\n key: SIMPLE_EVENT,\n payload: { Message: 'This is event 2', ShouldSkip: false },\n additionalMetadata: { source: 'test', user_id: 'user456' },\n },\n {\n key: SIMPLE_EVENT,\n payload: { Message: 'This is event 3', ShouldSkip: false },\n additionalMetadata: { source: 'test', user_id: 'user789' },\n },\n ];\n\n const result = await hatchet.events.bulkPush(SIMPLE_EVENT, events);\n\n expect(result.events.length).toBe(3);\n\n // Sort and verify namespacing\n const sortedEvents = [...events].sort((a, b) => a.key.localeCompare(b.key));\n const sortedResults = [...result.events].sort((a, b) => a.key.localeCompare(b.key));\n\n sortedEvents.forEach((originalEvent, index) => {\n const returnedEvent = sortedResults[index];\n expect(returnedEvent.key).toBe(originalEvent.key);\n });\n }, 15000);\n\n it('should process events according to event engine behavior', async () => {\n const eventPromises = [\n createBulkPushEvent({}),\n createBulkPushEvent({\n key: 'thisisafakeeventfoobarbaz',\n shouldHaveRuns: false,\n }),\n ].map((event) => convertBulkToSingle(event));\n const events = await Promise.all(eventPromises);\n\n const eventToRuns = await waitForEventsToProcess(events);\n\n // Verify each event's runs\n Object.keys(eventToRuns).forEach((eventId) => {\n const runs = eventToRuns[eventId];\n const eventInfo = events.find((e) => e.eventId === eventId);\n\n if (eventInfo) {\n const meta = JSON.parse(eventInfo.additionalMetadata || '{}');\n verifyEventRuns(\n {\n shouldHaveRuns: Boolean(meta.should_have_runs),\n },\n runs\n );\n }\n });\n }, 30000);\n\n function generateBulkEvents() {\n return [\n createBulkPushEvent({\n index: 1,\n ShouldSkip: false,\n shouldHaveRuns: true,\n }),\n createBulkPushEvent({\n index: 2,\n ShouldSkip: true,\n shouldHaveRuns: true,\n }),\n createBulkPushEvent({\n index: 3,\n ShouldSkip: false,\n shouldHaveRuns: true,\n scope: testRunId,\n }),\n createBulkPushEvent({\n index: 4,\n ShouldSkip: true,\n shouldHaveRuns: false,\n scope: testRunId,\n }),\n createBulkPushEvent({\n index: 5,\n ShouldSkip: true,\n shouldHaveRuns: false,\n scope: testRunId,\n key: 'thisisafakeeventfoobarbaz',\n }),\n createBulkPushEvent({\n index: 6,\n ShouldSkip: false,\n shouldHaveRuns: false,\n scope: testRunId,\n key: 'thisisafakeeventfoobarbaz',\n }),\n ];\n }\n\n async function convertBulkToSingle(event: any) {\n return hatchet.events.push(event.key, event.payload, {\n scope: event.scope,\n additionalMetadata: event.additionalMetadata,\n priority: event.priority,\n });\n }\n\n it('should handle event skipping and filtering without bulk push', async () => {\n const cleanup = await setupEventFilter();\n\n try {\n const rawEvents = generateBulkEvents();\n const eventPromises = rawEvents.map((event) => convertBulkToSingle(event));\n const events = await Promise.all(eventPromises);\n\n const eventToRuns = await waitForEventsToProcess(events);\n\n // Verify each event's runs\n Object.keys(eventToRuns).forEach((eventId) => {\n const runs = eventToRuns[eventId];\n const eventInfo = events.find((e) => e.eventId === eventId);\n\n if (eventInfo) {\n const meta = JSON.parse(eventInfo.additionalMetadata || '{}');\n verifyEventRuns(\n {\n shouldHaveRuns: Boolean(meta.should_have_runs),\n },\n runs\n );\n }\n });\n } finally {\n await cleanup();\n }\n }, 30000);\n\n it('should filter events by payload expression not matching', async () => {\n const cleanup = await setupEventFilter('input.ShouldSkip == false && payload.foobar == 'baz'', {\n foobar: 'qux',\n });\n\n try {\n const event = await hatchet.events.push(\n SIMPLE_EVENT,\n { Message: 'This is event 1', ShouldSkip: false },\n {\n scope: testRunId,\n additionalMetadata: {\n should_have_runs: 'false',\n test_run_id: testRunId,\n key: '1',\n },\n }\n );\n\n const eventToRuns = await waitForEventsToProcess([event]);\n expect(Object.keys(eventToRuns).length).toBe(0);\n } finally {\n await cleanup();\n }\n }, 20000);\n\n it('should filter events by payload expression matching', async () => {\n const cleanup = await setupEventFilter('input.ShouldSkip == false && payload.foobar == 'baz'', {\n foobar: 'baz',\n });\n\n try {\n const event = await hatchet.events.push(\n SIMPLE_EVENT,\n { Message: 'This is event 1', ShouldSkip: false },\n {\n scope: testRunId,\n additionalMetadata: {\n should_have_runs: 'true',\n test_run_id: testRunId,\n key: '1',\n },\n }\n );\n\n const eventToRuns = await waitForEventsToProcess([event]);\n const runs = Object.values(eventToRuns)[0] || [];\n expect(runs.length).toBeGreaterThan(0);\n } finally {\n await cleanup();\n }\n }, 20000);\n});\n", + "import sleep from '@hatchet-dev/typescript-sdk-dev/typescript-sdk/util/sleep';\nimport { randomUUID } from 'crypto';\nimport { Event } from '@hatchet-dev/typescript-sdk-dev/typescript-sdk/protoc/events';\nimport { SIMPLE_EVENT, lower, Input } from './workflow';\nimport { hatchet } from '../hatchet-client';\nimport { Worker } from '../../client/worker/worker';\n\nxdescribe('events-e2e', () => {\n let worker: Worker;\n let testRunId: string;\n\n beforeEach(async () => {\n testRunId = randomUUID();\n\n worker = await hatchet.worker('event-worker');\n await worker.registerWorkflow(lower);\n\n void worker.start();\n });\n\n afterAll(async () => {\n await worker.stop();\n await sleep(2000);\n });\n\n async function setupEventFilter(expression?: string, payload: Record = {}) {\n const finalExpression =\n expression || `input.ShouldSkip == false && payload.testRunId == '${testRunId}'`;\n\n const workflowId = (await hatchet.workflows.get(lower.name)).metadata.id;\n\n const filter = await hatchet.filters.create({\n workflowId,\n expression: finalExpression,\n scope: testRunId,\n payload: { testRunId, ...payload },\n });\n\n return async () => {\n await hatchet.filters.delete(filter.metadata.id);\n };\n }\n\n // Helper function to wait for events to process and fetch runs\n async function waitForEventsToProcess(events: Event[]): Promise> {\n await sleep(3000);\n\n const persisted = (await hatchet.events.list({ limit: 100 })).rows || [];\n\n // Ensure all our events are persisted\n const eventIds = new Set(events.map((e) => e.eventId));\n const persistedIds = new Set(persisted.map((e) => e.metadata.id));\n expect(Array.from(eventIds).every((id) => persistedIds.has(id))).toBeTruthy();\n\n let attempts = 0;\n const maxAttempts = 15;\n const eventToRuns: Record = {};\n\n while (true) {\n console.log('Waiting for event runs to complete...');\n if (attempts > maxAttempts) {\n console.log('Timed out waiting for event runs to complete.');\n return {};\n }\n\n attempts += 1;\n\n // For each event, fetch its runs\n const runsPromises = events.map(async (event) => {\n const runs = await hatchet.runs.list({\n triggeringEventExternalId: event.eventId,\n });\n\n // Extract metadata from event\n const meta = event.additionalMetadata ? JSON.parse(event.additionalMetadata) : {};\n\n const payload = event.payload ? JSON.parse(event.payload) : {};\n\n return {\n event: {\n id: event.eventId,\n payload,\n meta,\n shouldHaveRuns: Boolean(meta.should_have_runs),\n testRunId: meta.test_run_id,\n },\n runs: runs.rows || [],\n };\n });\n\n const eventRuns = await Promise.all(runsPromises);\n\n // If all events have no runs yet, wait and retry\n if (eventRuns.every(({ runs }) => runs.length === 0)) {\n await sleep(1000);\n\n continue;\n }\n\n // Store runs by event ID\n for (const { event, runs } of eventRuns) {\n eventToRuns[event.id] = runs;\n }\n\n // Check if any runs are still in progress\n const anyInProgress = Object.values(eventToRuns).some((runs) =>\n runs.some((run) => run.status === 'QUEUED' || run.status === 'RUNNING')\n );\n\n if (anyInProgress) {\n await sleep(1000);\n\n continue;\n }\n\n break;\n }\n\n return eventToRuns;\n }\n\n // Helper to verify runs match expectations\n function verifyEventRuns(eventData: any, runs: any[]) {\n if (eventData.shouldHaveRuns) {\n expect(runs.length).toBeGreaterThan(0);\n } else {\n expect(runs.length).toBe(0);\n }\n }\n\n // Helper to create bulk push event objects\n function createBulkPushEvent({\n index = 1,\n ShouldSkip = false,\n shouldHaveRuns = true,\n key = SIMPLE_EVENT,\n payload = {},\n scope = null,\n }: {\n index?: number;\n ShouldSkip?: boolean;\n shouldHaveRuns?: boolean;\n key?: string;\n payload?: Record;\n scope?: string | null;\n }) {\n return {\n key,\n payload: {\n ShouldSkip,\n Message: `This is event ${index}`,\n ...payload,\n },\n additionalMetadata: {\n should_have_runs: shouldHaveRuns,\n test_run_id: testRunId,\n key,\n index,\n },\n scope: scope || undefined,\n };\n }\n\n // Helper to create payload object\n function createEventPayload(ShouldSkip: boolean): Input {\n return { ShouldSkip, Message: 'This is event 1' };\n }\n\n it('should push an event', async () => {\n const event = await hatchet.events.push(SIMPLE_EVENT, createEventPayload(false));\n expect(event.eventId).toBeTruthy();\n }, 10000);\n\n it('should push an event asynchronously', async () => {\n const event = await hatchet.events.push(SIMPLE_EVENT, createEventPayload(false));\n expect(event.eventId).toBeTruthy();\n }, 10000);\n\n it('should bulk push events', async () => {\n const events = [\n {\n key: SIMPLE_EVENT,\n payload: { Message: 'This is event 1', ShouldSkip: false },\n additionalMetadata: { source: 'test', user_id: 'user123' },\n },\n {\n key: SIMPLE_EVENT,\n payload: { Message: 'This is event 2', ShouldSkip: false },\n additionalMetadata: { source: 'test', user_id: 'user456' },\n },\n {\n key: SIMPLE_EVENT,\n payload: { Message: 'This is event 3', ShouldSkip: false },\n additionalMetadata: { source: 'test', user_id: 'user789' },\n },\n ];\n\n const result = await hatchet.events.bulkPush(SIMPLE_EVENT, events);\n\n expect(result.events.length).toBe(3);\n\n // Sort and verify namespacing\n const sortedEvents = [...events].sort((a, b) => a.key.localeCompare(b.key));\n const sortedResults = [...result.events].sort((a, b) => a.key.localeCompare(b.key));\n\n sortedEvents.forEach((originalEvent, index) => {\n const returnedEvent = sortedResults[index];\n expect(returnedEvent.key).toBe(originalEvent.key);\n });\n }, 15000);\n\n it('should process events according to event engine behavior', async () => {\n const eventPromises = [\n createBulkPushEvent({}),\n createBulkPushEvent({\n key: 'thisisafakeeventfoobarbaz',\n shouldHaveRuns: false,\n }),\n ].map((event) => convertBulkToSingle(event));\n const events = await Promise.all(eventPromises);\n\n const eventToRuns = await waitForEventsToProcess(events);\n\n // Verify each event's runs\n Object.keys(eventToRuns).forEach((eventId) => {\n const runs = eventToRuns[eventId];\n const eventInfo = events.find((e) => e.eventId === eventId);\n\n if (eventInfo) {\n const meta = JSON.parse(eventInfo.additionalMetadata || '{}');\n verifyEventRuns(\n {\n shouldHaveRuns: Boolean(meta.should_have_runs),\n },\n runs\n );\n }\n });\n }, 30000);\n\n function generateBulkEvents() {\n return [\n createBulkPushEvent({\n index: 1,\n ShouldSkip: false,\n shouldHaveRuns: true,\n }),\n createBulkPushEvent({\n index: 2,\n ShouldSkip: true,\n shouldHaveRuns: true,\n }),\n createBulkPushEvent({\n index: 3,\n ShouldSkip: false,\n shouldHaveRuns: true,\n scope: testRunId,\n }),\n createBulkPushEvent({\n index: 4,\n ShouldSkip: true,\n shouldHaveRuns: false,\n scope: testRunId,\n }),\n createBulkPushEvent({\n index: 5,\n ShouldSkip: true,\n shouldHaveRuns: false,\n scope: testRunId,\n key: 'thisisafakeeventfoobarbaz',\n }),\n createBulkPushEvent({\n index: 6,\n ShouldSkip: false,\n shouldHaveRuns: false,\n scope: testRunId,\n key: 'thisisafakeeventfoobarbaz',\n }),\n ];\n }\n\n async function convertBulkToSingle(event: any) {\n return hatchet.events.push(event.key, event.payload, {\n scope: event.scope,\n additionalMetadata: event.additionalMetadata,\n priority: event.priority,\n });\n }\n\n it('should handle event skipping and filtering without bulk push', async () => {\n const cleanup = await setupEventFilter();\n\n try {\n const rawEvents = generateBulkEvents();\n const eventPromises = rawEvents.map((event) => convertBulkToSingle(event));\n const events = await Promise.all(eventPromises);\n\n const eventToRuns = await waitForEventsToProcess(events);\n\n // Verify each event's runs\n Object.keys(eventToRuns).forEach((eventId) => {\n const runs = eventToRuns[eventId];\n const eventInfo = events.find((e) => e.eventId === eventId);\n\n if (eventInfo) {\n const meta = JSON.parse(eventInfo.additionalMetadata || '{}');\n verifyEventRuns(\n {\n shouldHaveRuns: Boolean(meta.should_have_runs),\n },\n runs\n );\n }\n });\n } finally {\n await cleanup();\n }\n }, 30000);\n\n it('should filter events by payload expression not matching', async () => {\n const cleanup = await setupEventFilter(\"input.ShouldSkip == false && payload.foobar == 'baz'\", {\n foobar: 'qux',\n });\n\n try {\n const event = await hatchet.events.push(\n SIMPLE_EVENT,\n { Message: 'This is event 1', ShouldSkip: false },\n {\n scope: testRunId,\n additionalMetadata: {\n should_have_runs: 'false',\n test_run_id: testRunId,\n key: '1',\n },\n }\n );\n\n const eventToRuns = await waitForEventsToProcess([event]);\n expect(Object.keys(eventToRuns).length).toBe(0);\n } finally {\n await cleanup();\n }\n }, 20000);\n\n it('should filter events by payload expression matching', async () => {\n const cleanup = await setupEventFilter(\"input.ShouldSkip == false && payload.foobar == 'baz'\", {\n foobar: 'baz',\n });\n\n try {\n const event = await hatchet.events.push(\n SIMPLE_EVENT,\n { Message: 'This is event 1', ShouldSkip: false },\n {\n scope: testRunId,\n additionalMetadata: {\n should_have_runs: 'true',\n test_run_id: testRunId,\n key: '1',\n },\n }\n );\n\n const eventToRuns = await waitForEventsToProcess([event]);\n const runs = Object.values(eventToRuns)[0] || [];\n expect(runs.length).toBeGreaterThan(0);\n } finally {\n await cleanup();\n }\n }, 20000);\n});\n", source: 'out/typescript/on_event/event.e2e.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/event.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/event.ts index 537993f6c..fd2bc4ddd 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/event.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/event.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/filter.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/filter.ts index 3c192eba5..5d50a839d 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/filter.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/filter.ts @@ -3,7 +3,7 @@ import { Snippet } from '@/next/lib/docs/generated/snips/types'; const snippet: Snippet = { language: 'typescript ', content: - "import { hatchet } from '../hatchet-client';\nimport { lower, SIMPLE_EVENT } from './workflow';\n\n// > Create a filter\nhatchet.filters.create({\n workflowId: lower.id,\n expression: 'input.ShouldSkip == false',\n scope: 'foobarbaz',\n payload: {\n main_character: 'Anna',\n supporting_character: 'Stiva',\n location: 'Moscow',\n },\n})\n\n// > Skip a run\nhatchet.events.push(\n SIMPLE_EVENT,\n {\n 'Message': 'hello',\n 'ShouldSkip': true,\n },\n {\n scope: 'foobarbaz',\n }\n)\n\n// > Trigger a run\nhatchet.events.push(\n SIMPLE_EVENT,\n {\n 'Message': 'hello',\n 'ShouldSkip': false,\n },\n {\n scope: 'foobarbaz',\n }\n)", + "import { hatchet } from '../hatchet-client';\nimport { lower, SIMPLE_EVENT } from './workflow';\n\n// > Create a filter\nhatchet.filters.create({\n workflowId: lower.id,\n expression: 'input.ShouldSkip == false',\n scope: 'foobarbaz',\n payload: {\n main_character: 'Anna',\n supporting_character: 'Stiva',\n location: 'Moscow',\n },\n});\n\n// > Skip a run\nhatchet.events.push(\n SIMPLE_EVENT,\n {\n Message: 'hello',\n ShouldSkip: true,\n },\n {\n scope: 'foobarbaz',\n }\n);\n\n// > Trigger a run\nhatchet.events.push(\n SIMPLE_EVENT,\n {\n Message: 'hello',\n ShouldSkip: false,\n },\n {\n scope: 'foobarbaz',\n }\n);\n", source: 'out/typescript/on_event/filter.ts', blocks: { create_a_filter: { @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/worker.ts index aede8f3b0..86dfe1001 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/on_event/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/workflow.ts index 0e53e3e77..15813d81d 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_event/workflow.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_failure/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_failure/run.ts index 2761ca8bc..3a67b160a 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_failure/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_failure/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/on_failure/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_failure/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_failure/worker.ts index 6e5d9b294..67f4b048a 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_failure/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_failure/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/on_failure/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_failure/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_failure/workflow.ts index 39517a6d9..f6306a97e 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_failure/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_failure/workflow.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_success/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_success/run.ts index 0fdb4f9b4..c97784d07 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_success/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_success/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/on_success/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_success/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_success/worker.ts index 77c017e22..8bc9e3bf5 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_success/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_success/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/on_success/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_success/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_success/workflow.ts index 16558aabe..7229e5fb0 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/on_success/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/on_success/workflow.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/priority/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/priority/run.ts index cb2227a4a..abe5518ad 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/priority/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/priority/run.ts @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/priority/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/priority/worker.ts index 96557b6e1..8b261bf97 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/priority/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/priority/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/priority/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/priority/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/priority/workflow.ts index cdd1de70b..a8446b81f 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/priority/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/priority/workflow.ts @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/gitignore.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/gitignore.ts index f24df0ef3..57004994b 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/gitignore.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/gitignore.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/quickstart/.gitignore', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/hatchet-client.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/hatchet-client.ts index 5d3cc3d03..09d8e57da 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/hatchet-client.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/hatchet-client.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { strings: ['Client'], }, }, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/run.ts index 5156cf663..57637cd03 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/quickstart/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/worker.ts index 14eb4762d..5f84c12f5 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/quickstart/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/workflows/first-task.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/workflows/first-task.ts index 59a8f49b9..d0466af01 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/workflows/first-task.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/quickstart/workflows/first-task.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/quickstart/workflows/first-task.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/rate_limit/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/rate_limit/workflow.ts index 5ff2233d4..345fa100d 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/rate_limit/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/rate_limit/workflow.ts @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/retries/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/retries/run.ts index 3e7d2b725..7e3914a40 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/retries/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/retries/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/retries/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/retries/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/retries/worker.ts index d4c4ef52b..283d7e007 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/retries/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/retries/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/retries/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/retries/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/retries/workflow.ts index caea1d49d..81708e350 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/retries/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/retries/workflow.ts @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/bulk.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/bulk.ts index ae303318c..97425c239 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/bulk.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/bulk.ts @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/client-run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/client-run.ts index adee3046e..459dcf3a4 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/client-run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/client-run.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/cron.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/cron.ts index 5ce76adfc..30e6a1dc8 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/cron.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/cron.ts @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/delay.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/delay.ts index 2bb49974f..40d6a3df2 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/delay.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/delay.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/simple/delay.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/enqueue.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/enqueue.ts index 98e8cf64f..e24958760 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/enqueue.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/enqueue.ts @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/run.ts index fd1b10927..29f450d65 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/run.ts @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/schedule.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/schedule.ts index 4a9d73543..3fb7690e3 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/schedule.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/schedule.ts @@ -20,6 +20,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/stub-workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/stub-workflow.ts index cc0f7a02b..470da1586 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/stub-workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/stub-workflow.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/worker.ts index fc5265a3d..f696637db 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/worker.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/workflow-with-child.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/workflow-with-child.ts index 200af191f..642d140dc 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/workflow-with-child.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/workflow-with-child.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/workflow.ts index dfef17d3c..13bec3c62 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/simple/workflow.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/sticky/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/sticky/run.ts index fc2a3d5ef..3e7ba7607 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/sticky/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/sticky/run.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/sticky/run.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/sticky/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/sticky/worker.ts index 1171d5218..f186a6082 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/sticky/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/sticky/worker.ts @@ -7,6 +7,6 @@ const snippet: Snippet = { source: 'out/typescript/sticky/worker.ts', blocks: {}, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/sticky/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/sticky/workflow.ts index 30f8469f9..fd483e363 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/sticky/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/sticky/workflow.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/timeouts/run.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/timeouts/run.ts index 2380943e1..e4f633728 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/timeouts/run.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/timeouts/run.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/timeouts/worker.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/timeouts/worker.ts index 5fcfb9e40..b5d9d5a68 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/timeouts/worker.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/timeouts/worker.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/timeouts/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/timeouts/workflow.ts index b1705a64e..f23cf6f34 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/timeouts/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/timeouts/workflow.ts @@ -12,6 +12,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/lib/docs/generated/snips/typescript/with_timeouts/workflow.ts b/frontend/app/src/next/lib/docs/generated/snips/typescript/with_timeouts/workflow.ts index df7690586..ae3262a70 100644 --- a/frontend/app/src/next/lib/docs/generated/snips/typescript/with_timeouts/workflow.ts +++ b/frontend/app/src/next/lib/docs/generated/snips/typescript/with_timeouts/workflow.ts @@ -16,6 +16,6 @@ const snippet: Snippet = { }, }, highlights: {}, -}; // Then replace double quotes with single quotes +}; export default snippet; diff --git a/frontend/app/src/next/pages/authenticated/dashboard/dashboard.layout.tsx b/frontend/app/src/next/pages/authenticated/dashboard/dashboard.layout.tsx index 6723864d1..ad6860f68 100644 --- a/frontend/app/src/next/pages/authenticated/dashboard/dashboard.layout.tsx +++ b/frontend/app/src/next/pages/authenticated/dashboard/dashboard.layout.tsx @@ -23,7 +23,6 @@ import { Button } from '@/next/components/ui/button'; import { useIsMobile } from '@/next/hooks/use-mobile'; import { Logo } from '@/next/components/ui/logo'; import { Alerter } from './components/sidebar/alerter'; -import { GrRevert } from 'react-icons/gr'; import { cn } from '@/next/lib/utils'; export default function DashboardLayout() { @@ -94,15 +93,6 @@ function DashboardLayoutContent() { - { - localStorage.setItem('next-ui', 'false'); - window.location.href = '/'; - }} - > - - Switch to Old UI - toggleTheme()}> {theme === 'dark' ? ( diff --git a/frontend/app/src/next/pages/authenticated/dashboard/settings/overview/overview.page.tsx b/frontend/app/src/next/pages/authenticated/dashboard/settings/overview/overview.page.tsx index e2d66aa26..63d649747 100644 --- a/frontend/app/src/next/pages/authenticated/dashboard/settings/overview/overview.page.tsx +++ b/frontend/app/src/next/pages/authenticated/dashboard/settings/overview/overview.page.tsx @@ -17,6 +17,7 @@ import { } from '@/next/components/ui/alert'; import useTenant from '@/next/hooks/use-tenant'; import { + TenantUIVersion, TenantVersion, UpdateTenantRequest, } from '@/lib/api/generated/data-contracts'; @@ -26,10 +27,14 @@ import BasicLayout from '@/next/components/layouts/basic.layout'; import { Headline, PageTitle } from '@/next/components/ui/page-header'; import { ROUTES } from '@/next/lib/routes'; import useApiMeta from '@/next/hooks/use-api-meta'; +import useCloudFeatureFlags from '@/pages/auth/hooks/use-cloud-feature-flags'; +import { createSearchParams, useNavigate } from 'react-router-dom'; export default function SettingsOverviewPage() { const { tenant } = useTenant(); const { isCloud } = useApiMeta(); + const featureFlags = useCloudFeatureFlags(tenant?.metadata.id || ''); + if (!tenant) { return (
@@ -38,6 +43,9 @@ export default function SettingsOverviewPage() { ); } + const hasUIVersionFlag = + featureFlags?.data['has-ui-version-upgrade-available'] === 'true'; + return ( @@ -55,6 +63,12 @@ export default function SettingsOverviewPage() { )} + {hasUIVersionFlag && ( + <> + + + + )} ); } @@ -144,7 +158,7 @@ function TenantVersionSwitcher() { if (!tenant || tenant.version === TenantVersion.V0) { return (
- This is a v0 tenant. Please upgrade to v1 or use v0 from the frontend. + This is a V0 tenant. Please upgrade to V1 or use V0 from the frontend.
); } @@ -155,7 +169,7 @@ function TenantVersionSwitcher() { Tenant Version

- You can downgrade your tenant to v0 if needed. Please help us improve v1 + You can downgrade your tenant to V0 if needed. Please help us improve V1 by reporting any bugs in our{' '} - Downgrade to v0 + Downgrade to V0

- Downgrade to v0 + Downgrade to V0
Warning - Downgrading to v0 will remove access to v1 features and may + Downgrading to V0 will remove access to V1 features and may affect your existing workflows. This action should only be taken if absolutely necessary. @@ -215,3 +229,86 @@ function TenantVersionSwitcher() {
); } + +function UIVersionSwitcher() { + const { tenant, update } = useTenant(); + const [showDowngradeModal, setShowDowngradeModal] = useState(false); + const navigate = useNavigate(); + + if (!tenant || !tenant.uiVersion || tenant.uiVersion === TenantUIVersion.V0) { + return ( +
+ This is a V0 tenant. Please upgrade to V1 or use V0 from the frontend. +
+ ); + } + + return ( +
+

+ UI Version +

+

+ You can downgrade your dashboard to V0 if needed. +

+ + + + + + Downgrade to V0 + +
+ Please confirm your downgrade to the V0 UI version. Note that this + will have no effect on any of your workflows, and is a UI-only + change. +
+ + + + +
+
+
+ ); +} diff --git a/frontend/app/src/pages/main/tenant-settings/overview/index.tsx b/frontend/app/src/pages/main/tenant-settings/overview/index.tsx index 5c8be09ab..01fb9b068 100644 --- a/frontend/app/src/pages/main/tenant-settings/overview/index.tsx +++ b/frontend/app/src/pages/main/tenant-settings/overview/index.tsx @@ -25,6 +25,7 @@ import { } from '@/components/ui/dialog'; import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'; import { AxiosError } from 'axios'; + export default function TenantSettings() { const { tenant } = useOutletContext(); @@ -88,7 +89,7 @@ const TenantVersionSwitcher = () => { Tenant Version

- Upgrade your tenant to v1 to access new features and improvements. + Upgrade your tenant to V1 to access new features and improvements.

- Upgrade to v1 + Upgrade to V1 {!upgradeRestrictedError && (
-

Upgrading your tenant to v1 will:

+

Upgrading your tenant to V1 will:

    -
  • Enable new v1 features and improvements
  • -
  • Redirect you to the v1 interface
  • +
  • Enable new V1 features and improvements
  • +
  • Redirect you to the V1 interface
Warning @@ -118,7 +119,7 @@ const TenantVersionSwitcher = () => { This upgrade will not automatically migrate your existing workflows or in-progress runs. To ensure zero downtime during the upgrade, please follow our migration guide which includes - steps for parallel operation of v0 and v1 environments. + steps for parallel operation of V0 and V1 environments. @@ -130,7 +131,7 @@ const TenantVersionSwitcher = () => { rel="noopener noreferrer" className="text-indigo-400 hover:underline" > - v1 preview announcement + V1 preview announcement
{' '} before proceeding.

diff --git a/frontend/app/src/pages/main/v1/tenant-settings/overview/index.tsx b/frontend/app/src/pages/main/v1/tenant-settings/overview/index.tsx index 13e1f0e6f..867bfcb40 100644 --- a/frontend/app/src/pages/main/v1/tenant-settings/overview/index.tsx +++ b/frontend/app/src/pages/main/v1/tenant-settings/overview/index.tsx @@ -2,12 +2,17 @@ import { Button } from '@/components/v1/ui/button'; import { Separator } from '@/components/v1/ui/separator'; import { TenantContextType } from '@/lib/outlet'; import { useState } from 'react'; -import { useOutletContext } from 'react-router-dom'; +import { + createSearchParams, + useNavigate, + useOutletContext, +} from 'react-router-dom'; import { useApiError } from '@/lib/hooks'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import api, { queries, Tenant, + TenantUIVersion, TenantVersion, UpdateTenantRequest, } from '@/lib/api'; @@ -24,9 +29,15 @@ import { DialogTitle, } from '@/components/v1/ui/dialog'; import { Alert, AlertDescription, AlertTitle } from '@/components/v1/ui/alert'; +import { AxiosError } from 'axios'; +import useCloudFeatureFlags from '@/pages/auth/hooks/use-cloud-feature-flags'; export default function TenantSettings() { const { tenant } = useOutletContext(); + const featureFlags = useCloudFeatureFlags(tenant?.metadata.id || ''); + + const hasUIVersionFlag = + featureFlags?.data['has-ui-version-upgrade-available'] === 'true'; return (
@@ -40,6 +51,13 @@ export default function TenantSettings() { + {hasUIVersionFlag && ( + <> + {' '} + + + + )}{' '}
); @@ -79,8 +97,8 @@ const TenantVersionSwitcher = () => { Tenant Version

- You can downgrade your tenant to v0 if needed. Please help us improve - v1 by reporting any bugs in our{' '} + You can downgrade your tenant to V0 if needed. Please help us improve + V1 by reporting any bugs in our{' '} { className="w-fit" > {isPending ? : null} - Downgrade to v0 + Downgrade to V0

- Downgrade to v0 + Downgrade to V0
Warning - Downgrading to v0 will remove access to v1 features and may + Downgrading to V0 will remove access to V1 features and may affect your existing workflows. This action should only be taken if absolutely necessary. @@ -143,6 +161,98 @@ const TenantVersionSwitcher = () => { ); }; +function UIVersionSwitcher() { + const { tenant } = useOutletContext(); + const navigate = useNavigate(); + const [showUpgradeModal, setShowUpgradeModal] = useState(false); + const { handleApiError } = useApiError({}); + + const { mutateAsync: updateTenant, isPending } = useMutation({ + mutationKey: ['tenant:update'], + mutationFn: async (data: UpdateTenantRequest) => { + return api.tenantUpdate(tenant.metadata.id, data); + }, + onError: (error: AxiosError) => { + setShowUpgradeModal(false); + handleApiError(error); + }, + }); + + // Only show for V0 tenants + if (!tenant.uiVersion || tenant?.uiVersion === TenantUIVersion.V1) { + return null; + } + + return ( +
+

+ UI Version +

+

+ You can downgrade your UI to V0 if needed. +

+ + + + + + Upgrade to the V1 UI + +
+ Please confirm your upgrade to the V1 UI version. Note that this + will have no effect on any of your workflows, and is a UI-only + change. +
+ + + + +
+
+
+ ); +} + const UpdateTenant: React.FC<{ tenant: Tenant }> = ({ tenant }) => { const [isLoading, setIsLoading] = useState(false); diff --git a/frontend/app/src/pages/root.tsx b/frontend/app/src/pages/root.tsx index fc21c3e92..82679dc73 100644 --- a/frontend/app/src/pages/root.tsx +++ b/frontend/app/src/pages/root.tsx @@ -5,13 +5,6 @@ import { PropsWithChildren } from 'react'; import { Outlet } from 'react-router-dom'; function Root({ children }: PropsWithChildren) { - if ( - localStorage.getItem('next-ui') === 'true' && - !window.location.pathname.startsWith('/next') - ) { - window.location.href = '/next'; - } - return ( diff --git a/pkg/client/rest/gen.go b/pkg/client/rest/gen.go index 0760f8c55..84ec367cc 100644 --- a/pkg/client/rest/gen.go +++ b/pkg/client/rest/gen.go @@ -179,10 +179,16 @@ const ( WORKFLOWRUN TenantResource = "WORKFLOW_RUN" ) +// Defines values for TenantUIVersion. +const ( + TenantUIVersionV0 TenantUIVersion = "V0" + TenantUIVersionV1 TenantUIVersion = "V1" +) + // Defines values for TenantVersion. const ( - V0 TenantVersion = "V0" - V1 TenantVersion = "V1" + TenantVersionV0 TenantVersion = "V0" + TenantVersionV1 TenantVersion = "V1" ) // Defines values for V1LogLineLevel. @@ -952,8 +958,9 @@ type Tenant struct { Name string `json:"name"` // Slug The slug of the tenant. - Slug string `json:"slug"` - Version TenantVersion `json:"version"` + Slug string `json:"slug"` + UiVersion *TenantUIVersion `json:"uiVersion,omitempty"` + Version TenantVersion `json:"version"` } // TenantAlertEmailGroup defines model for TenantAlertEmailGroup. @@ -1072,6 +1079,9 @@ type TenantStepRunQueueMetrics struct { Queues *map[string]interface{} `json:"queues,omitempty"` } +// TenantUIVersion defines model for TenantUIVersion. +type TenantUIVersion string + // TenantVersion defines model for TenantVersion. type TenantVersion string @@ -1113,8 +1123,9 @@ type UpdateTenantRequest struct { MaxAlertingFrequency *string `json:"maxAlertingFrequency,omitempty" validate:"omitnil,duration"` // Name The name of the tenant. - Name *string `json:"name,omitempty"` - Version *TenantVersion `json:"version,omitempty"` + Name *string `json:"name,omitempty"` + UiVersion *TenantUIVersion `json:"uiVersion,omitempty"` + Version *TenantVersion `json:"version,omitempty"` } // UpdateWorkerRequest defines model for UpdateWorkerRequest. diff --git a/pkg/repository/postgres/dbsqlc/models.go b/pkg/repository/postgres/dbsqlc/models.go index 084050b54..3a91f4916 100644 --- a/pkg/repository/postgres/dbsqlc/models.go +++ b/pkg/repository/postgres/dbsqlc/models.go @@ -729,6 +729,48 @@ func (ns NullTenantMajorEngineVersion) Value() (driver.Value, error) { return string(ns.TenantMajorEngineVersion), nil } +type TenantMajorUIVersion string + +const ( + TenantMajorUIVersionV0 TenantMajorUIVersion = "V0" + TenantMajorUIVersionV1 TenantMajorUIVersion = "V1" +) + +func (e *TenantMajorUIVersion) Scan(src interface{}) error { + switch s := src.(type) { + case []byte: + *e = TenantMajorUIVersion(s) + case string: + *e = TenantMajorUIVersion(s) + default: + return fmt.Errorf("unsupported scan type for TenantMajorUIVersion: %T", src) + } + return nil +} + +type NullTenantMajorUIVersion struct { + TenantMajorUIVersion TenantMajorUIVersion `json:"TenantMajorUIVersion"` + Valid bool `json:"valid"` // Valid is true if TenantMajorUIVersion is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullTenantMajorUIVersion) Scan(value interface{}) error { + if value == nil { + ns.TenantMajorUIVersion, ns.Valid = "", false + return nil + } + ns.Valid = true + return ns.TenantMajorUIVersion.Scan(value) +} + +// Value implements the driver Valuer interface. +func (ns NullTenantMajorUIVersion) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return string(ns.TenantMajorUIVersion), nil +} + type TenantMemberRole string const ( @@ -1613,6 +1655,7 @@ type Tenant struct { UpdatedAt pgtype.Timestamp `json:"updatedAt"` DeletedAt pgtype.Timestamp `json:"deletedAt"` Version TenantMajorEngineVersion `json:"version"` + UiVersion TenantMajorUIVersion `json:"uiVersion"` Name string `json:"name"` Slug string `json:"slug"` AnalyticsOptOut bool `json:"analyticsOptOut"` diff --git a/pkg/repository/postgres/dbsqlc/tenants.sql b/pkg/repository/postgres/dbsqlc/tenants.sql index 325fd2028..4b3d4923f 100644 --- a/pkg/repository/postgres/dbsqlc/tenants.sql +++ b/pkg/repository/postgres/dbsqlc/tenants.sql @@ -33,7 +33,8 @@ SET "name" = COALESCE(sqlc.narg('name')::text, "name"), "analyticsOptOut" = COALESCE(sqlc.narg('analyticsOptOut')::boolean, "analyticsOptOut"), "alertMemberEmails" = COALESCE(sqlc.narg('alertMemberEmails')::boolean, "alertMemberEmails"), - "version" = COALESCE(sqlc.narg('version')::"TenantMajorEngineVersion", "version") + "version" = COALESCE(sqlc.narg('version')::"TenantMajorEngineVersion", "version"), + "uiVersion" = COALESCE(sqlc.narg('uiVersion')::"TenantMajorUIVersion", "uiVersion") WHERE "id" = sqlc.arg('id')::uuid RETURNING *; @@ -601,7 +602,8 @@ SELECT t."slug" as "tenantSlug", t."alertMemberEmails" as "alertMemberEmails", t."analyticsOptOut" as "analyticsOptOut", - t."version" as "tenantVersion" + t."version" as "tenantVersion", + t."uiVersion" as "tenantUiVersion" FROM "TenantMember" tm JOIN diff --git a/pkg/repository/postgres/dbsqlc/tenants.sql.go b/pkg/repository/postgres/dbsqlc/tenants.sql.go index 6c0ebd37e..593a5b96e 100644 --- a/pkg/repository/postgres/dbsqlc/tenants.sql.go +++ b/pkg/repository/postgres/dbsqlc/tenants.sql.go @@ -100,7 +100,7 @@ VALUES ( COALESCE($4::text, '720h'), COALESCE($5::"TenantMajorEngineVersion", 'V0') ) -RETURNING id, "createdAt", "updatedAt", "deletedAt", version, name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" +RETURNING id, "createdAt", "updatedAt", "deletedAt", version, "uiVersion", name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" ` type CreateTenantParams struct { @@ -126,6 +126,7 @@ func (q *Queries) CreateTenant(ctx context.Context, db DBTX, arg CreateTenantPar &i.UpdatedAt, &i.DeletedAt, &i.Version, + &i.UiVersion, &i.Name, &i.Slug, &i.AnalyticsOptOut, @@ -374,7 +375,7 @@ func (q *Queries) GetEmailGroups(ctx context.Context, db DBTX, tenantid pgtype.U const getInternalTenantForController = `-- name: GetInternalTenantForController :one SELECT - id, "createdAt", "updatedAt", "deletedAt", version, name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" + id, "createdAt", "updatedAt", "deletedAt", version, "uiVersion", name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" FROM "Tenant" as tenants WHERE @@ -391,6 +392,7 @@ func (q *Queries) GetInternalTenantForController(ctx context.Context, db DBTX, c &i.UpdatedAt, &i.DeletedAt, &i.Version, + &i.UiVersion, &i.Name, &i.Slug, &i.AnalyticsOptOut, @@ -525,7 +527,7 @@ func (q *Queries) GetTenantAlertingSettings(ctx context.Context, db DBTX, tenant const getTenantByID = `-- name: GetTenantByID :one SELECT - id, "createdAt", "updatedAt", "deletedAt", version, name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" + id, "createdAt", "updatedAt", "deletedAt", version, "uiVersion", name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" FROM "Tenant" as tenants WHERE @@ -541,6 +543,7 @@ func (q *Queries) GetTenantByID(ctx context.Context, db DBTX, id pgtype.UUID) (* &i.UpdatedAt, &i.DeletedAt, &i.Version, + &i.UiVersion, &i.Name, &i.Slug, &i.AnalyticsOptOut, @@ -556,7 +559,7 @@ func (q *Queries) GetTenantByID(ctx context.Context, db DBTX, id pgtype.UUID) (* const getTenantBySlug = `-- name: GetTenantBySlug :one SELECT - id, "createdAt", "updatedAt", "deletedAt", version, name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" + id, "createdAt", "updatedAt", "deletedAt", version, "uiVersion", name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" FROM "Tenant" as tenants WHERE @@ -572,6 +575,7 @@ func (q *Queries) GetTenantBySlug(ctx context.Context, db DBTX, slug string) (*T &i.UpdatedAt, &i.DeletedAt, &i.Version, + &i.UiVersion, &i.Name, &i.Slug, &i.AnalyticsOptOut, @@ -878,7 +882,7 @@ func (q *Queries) ListTenantMembers(ctx context.Context, db DBTX, tenantid pgtyp const listTenants = `-- name: ListTenants :many SELECT - id, "createdAt", "updatedAt", "deletedAt", version, name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" + id, "createdAt", "updatedAt", "deletedAt", version, "uiVersion", name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" FROM "Tenant" as tenants ` @@ -898,6 +902,7 @@ func (q *Queries) ListTenants(ctx context.Context, db DBTX) ([]*Tenant, error) { &i.UpdatedAt, &i.DeletedAt, &i.Version, + &i.UiVersion, &i.Name, &i.Slug, &i.AnalyticsOptOut, @@ -920,7 +925,7 @@ func (q *Queries) ListTenants(ctx context.Context, db DBTX) ([]*Tenant, error) { const listTenantsByControllerPartitionId = `-- name: ListTenantsByControllerPartitionId :many SELECT - id, "createdAt", "updatedAt", "deletedAt", version, name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" + id, "createdAt", "updatedAt", "deletedAt", version, "uiVersion", name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" FROM "Tenant" as tenants WHERE @@ -948,6 +953,7 @@ func (q *Queries) ListTenantsByControllerPartitionId(ctx context.Context, db DBT &i.UpdatedAt, &i.DeletedAt, &i.Version, + &i.UiVersion, &i.Name, &i.Slug, &i.AnalyticsOptOut, @@ -970,7 +976,7 @@ func (q *Queries) ListTenantsByControllerPartitionId(ctx context.Context, db DBT const listTenantsBySchedulerPartitionId = `-- name: ListTenantsBySchedulerPartitionId :many SELECT - id, "createdAt", "updatedAt", "deletedAt", version, name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" + id, "createdAt", "updatedAt", "deletedAt", version, "uiVersion", name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" FROM "Tenant" as tenants WHERE @@ -998,6 +1004,7 @@ func (q *Queries) ListTenantsBySchedulerPartitionId(ctx context.Context, db DBTX &i.UpdatedAt, &i.DeletedAt, &i.Version, + &i.UiVersion, &i.Name, &i.Slug, &i.AnalyticsOptOut, @@ -1020,7 +1027,7 @@ func (q *Queries) ListTenantsBySchedulerPartitionId(ctx context.Context, db DBTX const listTenantsByTenantWorkerPartitionId = `-- name: ListTenantsByTenantWorkerPartitionId :many SELECT - id, "createdAt", "updatedAt", "deletedAt", version, name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" + id, "createdAt", "updatedAt", "deletedAt", version, "uiVersion", name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" FROM "Tenant" as tenants WHERE @@ -1048,6 +1055,7 @@ func (q *Queries) ListTenantsByTenantWorkerPartitionId(ctx context.Context, db D &i.UpdatedAt, &i.DeletedAt, &i.Version, + &i.UiVersion, &i.Name, &i.Slug, &i.AnalyticsOptOut, @@ -1080,7 +1088,8 @@ SELECT t."slug" as "tenantSlug", t."alertMemberEmails" as "alertMemberEmails", t."analyticsOptOut" as "analyticsOptOut", - t."version" as "tenantVersion" + t."version" as "tenantVersion", + t."uiVersion" as "tenantUiVersion" FROM "TenantMember" tm JOIN @@ -1108,6 +1117,7 @@ type PopulateTenantMembersRow struct { AlertMemberEmails bool `json:"alertMemberEmails"` AnalyticsOptOut bool `json:"analyticsOptOut"` TenantVersion TenantMajorEngineVersion `json:"tenantVersion"` + TenantUiVersion TenantMajorUIVersion `json:"tenantUiVersion"` } func (q *Queries) PopulateTenantMembers(ctx context.Context, db DBTX, ids []pgtype.UUID) ([]*PopulateTenantMembersRow, error) { @@ -1136,6 +1146,7 @@ func (q *Queries) PopulateTenantMembers(ctx context.Context, db DBTX, ids []pgty &i.AlertMemberEmails, &i.AnalyticsOptOut, &i.TenantVersion, + &i.TenantUiVersion, ); err != nil { return nil, err } @@ -1422,10 +1433,11 @@ SET "name" = COALESCE($1::text, "name"), "analyticsOptOut" = COALESCE($2::boolean, "analyticsOptOut"), "alertMemberEmails" = COALESCE($3::boolean, "alertMemberEmails"), - "version" = COALESCE($4::"TenantMajorEngineVersion", "version") + "version" = COALESCE($4::"TenantMajorEngineVersion", "version"), + "uiVersion" = COALESCE($5::"TenantMajorUIVersion", "uiVersion") WHERE - "id" = $5::uuid -RETURNING id, "createdAt", "updatedAt", "deletedAt", version, name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" + "id" = $6::uuid +RETURNING id, "createdAt", "updatedAt", "deletedAt", version, "uiVersion", name, slug, "analyticsOptOut", "alertMemberEmails", "controllerPartitionId", "workerPartitionId", "dataRetentionPeriod", "schedulerPartitionId", "canUpgradeV1" ` type UpdateTenantParams struct { @@ -1433,6 +1445,7 @@ type UpdateTenantParams struct { AnalyticsOptOut pgtype.Bool `json:"analyticsOptOut"` AlertMemberEmails pgtype.Bool `json:"alertMemberEmails"` Version NullTenantMajorEngineVersion `json:"version"` + UiVersion NullTenantMajorUIVersion `json:"uiVersion"` ID pgtype.UUID `json:"id"` } @@ -1442,6 +1455,7 @@ func (q *Queries) UpdateTenant(ctx context.Context, db DBTX, arg UpdateTenantPar arg.AnalyticsOptOut, arg.AlertMemberEmails, arg.Version, + arg.UiVersion, arg.ID, ) var i Tenant @@ -1451,6 +1465,7 @@ func (q *Queries) UpdateTenant(ctx context.Context, db DBTX, arg UpdateTenantPar &i.UpdatedAt, &i.DeletedAt, &i.Version, + &i.UiVersion, &i.Name, &i.Slug, &i.AnalyticsOptOut, diff --git a/pkg/repository/postgres/tenant.go b/pkg/repository/postgres/tenant.go index cff994009..2c23af299 100644 --- a/pkg/repository/postgres/tenant.go +++ b/pkg/repository/postgres/tenant.go @@ -113,6 +113,10 @@ func (r *tenantAPIRepository) UpdateTenant(ctx context.Context, id string, opts params.Version = *opts.Version } + if opts.UIVersion != nil && opts.UIVersion.Valid { + params.UiVersion = *opts.UIVersion + } + return r.queries.UpdateTenant( ctx, r.pool, diff --git a/pkg/repository/tenant.go b/pkg/repository/tenant.go index 4633137bb..ce40edcc8 100644 --- a/pkg/repository/tenant.go +++ b/pkg/repository/tenant.go @@ -28,6 +28,8 @@ type UpdateTenantOpts struct { AlertMemberEmails *bool `validate:"omitempty"` Version *dbsqlc.NullTenantMajorEngineVersion `validate:"omitempty"` + + UIVersion *dbsqlc.NullTenantMajorUIVersion `validate:"omitempty"` } type CreateTenantMemberOpts struct { diff --git a/pkg/repository/v1/sqlcv1/models.go b/pkg/repository/v1/sqlcv1/models.go index f3915ba20..0b8f72da4 100644 --- a/pkg/repository/v1/sqlcv1/models.go +++ b/pkg/repository/v1/sqlcv1/models.go @@ -729,6 +729,48 @@ func (ns NullTenantMajorEngineVersion) Value() (driver.Value, error) { return string(ns.TenantMajorEngineVersion), nil } +type TenantMajorUIVersion string + +const ( + TenantMajorUIVersionV0 TenantMajorUIVersion = "V0" + TenantMajorUIVersionV1 TenantMajorUIVersion = "V1" +) + +func (e *TenantMajorUIVersion) Scan(src interface{}) error { + switch s := src.(type) { + case []byte: + *e = TenantMajorUIVersion(s) + case string: + *e = TenantMajorUIVersion(s) + default: + return fmt.Errorf("unsupported scan type for TenantMajorUIVersion: %T", src) + } + return nil +} + +type NullTenantMajorUIVersion struct { + TenantMajorUIVersion TenantMajorUIVersion `json:"TenantMajorUIVersion"` + Valid bool `json:"valid"` // Valid is true if TenantMajorUIVersion is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullTenantMajorUIVersion) Scan(value interface{}) error { + if value == nil { + ns.TenantMajorUIVersion, ns.Valid = "", false + return nil + } + ns.Valid = true + return ns.TenantMajorUIVersion.Scan(value) +} + +// Value implements the driver Valuer interface. +func (ns NullTenantMajorUIVersion) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return string(ns.TenantMajorUIVersion), nil +} + type TenantMemberRole string const ( @@ -2237,6 +2279,7 @@ type Tenant struct { UpdatedAt pgtype.Timestamp `json:"updatedAt"` DeletedAt pgtype.Timestamp `json:"deletedAt"` Version TenantMajorEngineVersion `json:"version"` + UiVersion TenantMajorUIVersion `json:"uiVersion"` Name string `json:"name"` Slug string `json:"slug"` AnalyticsOptOut bool `json:"analyticsOptOut"` diff --git a/sql/schema/v0.sql b/sql/schema/v0.sql index 16dcd857e..f9b1c5489 100644 --- a/sql/schema/v0.sql +++ b/sql/schema/v0.sql @@ -591,6 +591,11 @@ CREATE TYPE "TenantMajorEngineVersion" AS ENUM ( 'V1' ); +CREATE TYPE "TenantMajorUIVersion" AS ENUM ( + 'V0', + 'V1' +); + -- CreateTable CREATE TABLE "Tenant" ( "id" UUID NOT NULL, @@ -598,6 +603,7 @@ CREATE TABLE "Tenant" ( "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "deletedAt" TIMESTAMP(3), "version" "TenantMajorEngineVersion" NOT NULL DEFAULT 'V0', + "uiVersion" "TenantMajorUIVersion" NOT NULL DEFAULT 'V0', "name" TEXT NOT NULL, "slug" TEXT NOT NULL, "analyticsOptOut" BOOLEAN NOT NULL DEFAULT false,