@adonis-agora/durable 1.0.0-rc.2 → 1.0.0-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +198 -0
- package/dist/assets/spa/assets/index-BgoNV3TR.css +1 -0
- package/dist/assets/spa/assets/index-DzXygyDm.js +57 -0
- package/dist/assets/spa/assets/index-DzXygyDm.js.map +1 -0
- package/dist/assets/spa/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/dist/assets/spa/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/assets/spa/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/assets/spa/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/dist/assets/spa/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
- package/dist/assets/spa/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- package/dist/assets/spa/assets/sora-latin-400-normal-CRt88UEn.woff2 +0 -0
- package/dist/assets/spa/assets/sora-latin-400-normal-OW7qkl5a.woff +0 -0
- package/dist/assets/spa/assets/sora-latin-500-normal-01eiPEn0.woff2 +0 -0
- package/dist/assets/spa/assets/sora-latin-500-normal-w58xtEt9.woff +0 -0
- package/dist/assets/spa/assets/sora-latin-600-normal-1_7fyUAY.woff +0 -0
- package/dist/assets/spa/assets/sora-latin-600-normal-Cdg4DaK0.woff2 +0 -0
- package/dist/assets/spa/assets/sora-latin-700-normal-9waGdLWo.woff2 +0 -0
- package/dist/assets/spa/assets/sora-latin-700-normal-BKPfQAnC.woff +0 -0
- package/dist/assets/spa/index.html +2 -8
- package/dist/commands/agora_doctor.d.ts +23 -0
- package/dist/commands/agora_doctor.d.ts.map +1 -0
- package/dist/commands/agora_doctor.js +110 -0
- package/dist/commands/agora_doctor.js.map +1 -0
- package/dist/commands/durable_doctor.d.ts +8 -0
- package/dist/commands/durable_doctor.d.ts.map +1 -0
- package/dist/commands/durable_doctor.js +8 -0
- package/dist/commands/durable_doctor.js.map +1 -0
- package/dist/commands/durable_worker.d.ts +3 -3
- package/dist/commands/durable_worker.js +7 -7
- package/dist/commands/durable_worker.js.map +1 -1
- package/dist/commands/health.d.ts +12 -0
- package/dist/commands/health.d.ts.map +1 -0
- package/dist/commands/health.js +34 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/lifecycle_republish.d.ts +8 -9
- package/dist/commands/lifecycle_republish.d.ts.map +1 -1
- package/dist/commands/lifecycle_republish.js +29 -16
- package/dist/commands/lifecycle_republish.js.map +1 -1
- package/dist/commands/main.d.ts +25 -5
- package/dist/commands/main.d.ts.map +1 -1
- package/dist/commands/main.js +54 -7
- package/dist/commands/main.js.map +1 -1
- package/dist/commands/runs.d.ts +9 -16
- package/dist/commands/runs.d.ts.map +1 -1
- package/dist/commands/runs.js +60 -47
- package/dist/commands/runs.js.map +1 -1
- package/dist/commands/runs_bulk.d.ts +17 -0
- package/dist/commands/runs_bulk.d.ts.map +1 -0
- package/dist/commands/runs_bulk.js +74 -0
- package/dist/commands/runs_bulk.js.map +1 -0
- package/dist/commands/runs_cancel.d.ts +15 -0
- package/dist/commands/runs_cancel.d.ts.map +1 -0
- package/dist/commands/runs_cancel.js +39 -0
- package/dist/commands/runs_cancel.js.map +1 -0
- package/dist/commands/runs_continue.d.ts +12 -0
- package/dist/commands/runs_continue.d.ts.map +1 -0
- package/dist/commands/runs_continue.js +28 -0
- package/dist/commands/runs_continue.js.map +1 -0
- package/dist/commands/runs_event.d.ts +13 -0
- package/dist/commands/runs_event.d.ts.map +1 -0
- package/dist/commands/runs_event.js +28 -0
- package/dist/commands/runs_event.js.map +1 -0
- package/dist/commands/runs_fan.d.ts +16 -0
- package/dist/commands/runs_fan.d.ts.map +1 -0
- package/dist/commands/runs_fan.js +58 -0
- package/dist/commands/runs_fan.js.map +1 -0
- package/dist/commands/runs_redispatch.d.ts +14 -0
- package/dist/commands/runs_redispatch.d.ts.map +1 -0
- package/dist/commands/runs_redispatch.js +35 -0
- package/dist/commands/runs_redispatch.js.map +1 -0
- package/dist/commands/runs_replay.d.ts +14 -0
- package/dist/commands/runs_replay.d.ts.map +1 -0
- package/dist/commands/runs_replay.js +38 -0
- package/dist/commands/runs_replay.js.map +1 -0
- package/dist/commands/runs_retry.d.ts +13 -0
- package/dist/commands/runs_retry.d.ts.map +1 -0
- package/dist/commands/runs_retry.js +29 -0
- package/dist/commands/runs_retry.js.map +1 -0
- package/dist/commands/runs_show.d.ts +14 -0
- package/dist/commands/runs_show.d.ts.map +1 -0
- package/dist/commands/runs_show.js +96 -0
- package/dist/commands/runs_show.js.map +1 -0
- package/dist/commands/runs_signal.d.ts +17 -0
- package/dist/commands/runs_signal.d.ts.map +1 -0
- package/dist/commands/runs_signal.js +49 -0
- package/dist/commands/runs_signal.js.map +1 -0
- package/dist/commands/runs_update.d.ts +15 -0
- package/dist/commands/runs_update.d.ts.map +1 -0
- package/dist/commands/runs_update.js +39 -0
- package/dist/commands/runs_update.js.map +1 -0
- package/dist/commands/runs_values.d.ts +15 -0
- package/dist/commands/runs_values.d.ts.map +1 -0
- package/dist/commands/runs_values.js +45 -0
- package/dist/commands/runs_values.js.map +1 -0
- package/dist/commands/schedules.d.ts +18 -0
- package/dist/commands/schedules.d.ts.map +1 -0
- package/dist/commands/schedules.js +70 -0
- package/dist/commands/schedules.js.map +1 -0
- package/dist/commands/schedules_pause.d.ts +16 -0
- package/dist/commands/schedules_pause.d.ts.map +1 -0
- package/dist/commands/schedules_pause.js +40 -0
- package/dist/commands/schedules_pause.js.map +1 -0
- package/dist/commands/schedules_resume.d.ts +8 -0
- package/dist/commands/schedules_resume.d.ts.map +1 -0
- package/dist/commands/schedules_resume.js +8 -0
- package/dist/commands/schedules_resume.js.map +1 -0
- package/dist/commands/schedules_trigger.d.ts +13 -0
- package/dist/commands/schedules_trigger.d.ts.map +1 -0
- package/dist/commands/schedules_trigger.js +32 -0
- package/dist/commands/schedules_trigger.js.map +1 -0
- package/dist/commands/tasks_complete.d.ts +15 -0
- package/dist/commands/tasks_complete.d.ts.map +1 -0
- package/dist/commands/tasks_complete.js +41 -0
- package/dist/commands/tasks_complete.js.map +1 -0
- package/dist/commands/tasks_fail.d.ts +16 -0
- package/dist/commands/tasks_fail.d.ts.map +1 -0
- package/dist/commands/tasks_fail.js +47 -0
- package/dist/commands/tasks_fail.js.map +1 -0
- package/dist/commands/workers.d.ts +11 -0
- package/dist/commands/workers.d.ts.map +1 -0
- package/dist/commands/workers.js +35 -0
- package/dist/commands/workers.js.map +1 -0
- package/dist/commands/workflows_lifecycle.d.ts +12 -0
- package/dist/commands/workflows_lifecycle.d.ts.map +1 -0
- package/dist/commands/workflows_lifecycle.js +37 -0
- package/dist/commands/workflows_lifecycle.js.map +1 -0
- package/dist/configure.d.ts +1 -1
- package/dist/configure.js +1 -1
- package/dist/providers/dashboard_provider.d.ts +57 -54
- package/dist/providers/dashboard_provider.d.ts.map +1 -1
- package/dist/providers/dashboard_provider.js +399 -288
- package/dist/providers/dashboard_provider.js.map +1 -1
- package/dist/providers/durable_provider.d.ts.map +1 -1
- package/dist/providers/durable_provider.js +67 -37
- package/dist/providers/durable_provider.js.map +1 -1
- package/dist/src/commands/console_command.d.ts +82 -0
- package/dist/src/commands/console_command.d.ts.map +1 -0
- package/dist/src/commands/console_command.js +238 -0
- package/dist/src/commands/console_command.js.map +1 -0
- package/dist/src/commands/runs.js +2 -2
- package/dist/src/commands/runs.js.map +1 -1
- package/dist/src/concurrency.d.ts.map +1 -1
- package/dist/src/concurrency.js +1 -0
- package/dist/src/concurrency.js.map +1 -1
- package/dist/src/config_types.d.ts +79 -26
- package/dist/src/config_types.d.ts.map +1 -1
- package/dist/src/dashboard/access_denied_page.d.ts +5 -7
- package/dist/src/dashboard/access_denied_page.d.ts.map +1 -1
- package/dist/src/dashboard/access_denied_page.js +2 -6
- package/dist/src/dashboard/access_denied_page.js.map +1 -1
- package/dist/src/dashboard/audit.d.ts +14 -0
- package/dist/src/dashboard/audit.d.ts.map +1 -0
- package/dist/src/dashboard/audit.js +36 -0
- package/dist/src/dashboard/audit.js.map +1 -0
- package/dist/src/dashboard/console_authorize.d.ts +98 -0
- package/dist/src/dashboard/console_authorize.d.ts.map +1 -0
- package/dist/src/dashboard/console_authorize.js +163 -0
- package/dist/src/dashboard/console_authorize.js.map +1 -0
- package/dist/src/dashboard/console_shell.d.ts +45 -0
- package/dist/src/dashboard/console_shell.d.ts.map +1 -0
- package/dist/src/dashboard/console_shell.js +125 -0
- package/dist/src/dashboard/console_shell.js.map +1 -0
- package/dist/src/dashboard/console_switcher.d.ts +132 -0
- package/dist/src/dashboard/console_switcher.d.ts.map +1 -0
- package/dist/src/dashboard/console_switcher.js +201 -0
- package/dist/src/dashboard/console_switcher.js.map +1 -0
- package/dist/src/dashboard/define_config.d.ts +68 -81
- package/dist/src/dashboard/define_config.d.ts.map +1 -1
- package/dist/src/dashboard/define_config.js +18 -112
- package/dist/src/dashboard/define_config.js.map +1 -1
- package/dist/src/dashboard/dev_tools.d.ts +102 -0
- package/dist/src/dashboard/dev_tools.d.ts.map +1 -0
- package/dist/src/dashboard/dev_tools.js +502 -0
- package/dist/src/dashboard/dev_tools.js.map +1 -0
- package/dist/src/dashboard/diagnostics-recorder.d.ts +1 -1
- package/dist/src/dashboard/diagnostics-recorder.js +1 -1
- package/dist/src/dashboard/gateway-adapter.d.ts +6 -6
- package/dist/src/dashboard/gateway-adapter.d.ts.map +1 -1
- package/dist/src/dashboard/gateway-adapter.js +5 -5
- package/dist/src/dashboard/gateway-adapter.js.map +1 -1
- package/dist/src/dashboard/handlers.d.ts +48 -39
- package/dist/src/dashboard/handlers.d.ts.map +1 -1
- package/dist/src/dashboard/handlers.js +181 -83
- package/dist/src/dashboard/handlers.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +12 -9
- package/dist/src/dashboard/index.d.ts.map +1 -1
- package/dist/src/dashboard/index.js +10 -7
- package/dist/src/dashboard/index.js.map +1 -1
- package/dist/src/dashboard/list-filters.d.ts +27 -0
- package/dist/src/dashboard/list-filters.d.ts.map +1 -0
- package/dist/src/dashboard/list-filters.js +69 -0
- package/dist/src/dashboard/list-filters.js.map +1 -0
- package/dist/src/dashboard/openapi.d.ts.map +1 -1
- package/dist/src/dashboard/openapi.js +127 -52
- package/dist/src/dashboard/openapi.js.map +1 -1
- package/dist/src/dashboard/run-filter.d.ts +18 -15
- package/dist/src/dashboard/run-filter.d.ts.map +1 -1
- package/dist/src/dashboard/run-filter.js +30 -22
- package/dist/src/dashboard/run-filter.js.map +1 -1
- package/dist/src/dashboard/spa.d.ts +26 -1
- package/dist/src/dashboard/spa.d.ts.map +1 -1
- package/dist/src/dashboard/spa.js +9 -2
- package/dist/src/dashboard/spa.js.map +1 -1
- package/dist/src/dashboard/tenant_scope.d.ts +38 -0
- package/dist/src/dashboard/tenant_scope.d.ts.map +1 -0
- package/dist/src/dashboard/tenant_scope.js +166 -0
- package/dist/src/dashboard/tenant_scope.js.map +1 -0
- package/dist/src/define_config.d.ts +27 -12
- package/dist/src/define_config.d.ts.map +1 -1
- package/dist/src/define_config.js +9 -4
- package/dist/src/define_config.js.map +1 -1
- package/dist/src/diagnostics/index.d.ts +11 -0
- package/dist/src/diagnostics/index.d.ts.map +1 -0
- package/dist/src/diagnostics/index.js +6 -0
- package/dist/src/diagnostics/index.js.map +1 -0
- package/dist/src/diagnostics/transport.d.ts +71 -0
- package/dist/src/diagnostics/transport.d.ts.map +1 -0
- package/dist/src/diagnostics/transport.js +188 -0
- package/dist/src/diagnostics/transport.js.map +1 -0
- package/dist/src/diagnostics-bridge.d.ts +2 -1
- package/dist/src/diagnostics-bridge.d.ts.map +1 -1
- package/dist/src/diagnostics-bridge.js +7 -1
- package/dist/src/diagnostics-bridge.js.map +1 -1
- package/dist/src/doctor/agora_doctor.d.ts +116 -0
- package/dist/src/doctor/agora_doctor.d.ts.map +1 -0
- package/dist/src/doctor/agora_doctor.js +685 -0
- package/dist/src/doctor/agora_doctor.js.map +1 -0
- package/dist/src/doctor/checks.d.ts +28 -0
- package/dist/src/doctor/checks.d.ts.map +1 -0
- package/dist/src/doctor/checks.js +288 -0
- package/dist/src/doctor/checks.js.map +1 -0
- package/dist/src/doctor/index.d.ts +9 -0
- package/dist/src/doctor/index.d.ts.map +1 -0
- package/dist/src/doctor/index.js +16 -0
- package/dist/src/doctor/index.js.map +1 -0
- package/dist/src/engine.d.ts +55 -9
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/engine.js +333 -84
- package/dist/src/engine.js.map +1 -1
- package/dist/src/errors.d.ts +9 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +13 -0
- package/dist/src/errors.js.map +1 -1
- package/dist/src/event-trigger-bridge.d.ts +5 -14
- package/dist/src/event-trigger-bridge.d.ts.map +1 -1
- package/dist/src/event-trigger-bridge.js +11 -99
- package/dist/src/event-trigger-bridge.js.map +1 -1
- package/dist/src/index.d.ts +8 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/interfaces.d.ts +53 -9
- package/dist/src/interfaces.d.ts.map +1 -1
- package/dist/src/interfaces.js +8 -0
- package/dist/src/interfaces.js.map +1 -1
- package/dist/src/origin.js +3 -3
- package/dist/src/role_bindings.d.ts +8 -8
- package/dist/src/role_bindings.js +8 -8
- package/dist/src/run-gateway/interface.d.ts +4 -3
- package/dist/src/run-gateway/interface.d.ts.map +1 -1
- package/dist/src/run-gateway/proxy-run-gateway.d.ts +4 -2
- package/dist/src/run-gateway/proxy-run-gateway.d.ts.map +1 -1
- package/dist/src/run-gateway/proxy-run-gateway.js +21 -6
- package/dist/src/run-gateway/proxy-run-gateway.js.map +1 -1
- package/dist/src/run-gateway/run-request-responder.d.ts +6 -1
- package/dist/src/run-gateway/run-request-responder.d.ts.map +1 -1
- package/dist/src/run-gateway/run-request-responder.js +30 -3
- package/dist/src/run-gateway/run-request-responder.js.map +1 -1
- package/dist/src/run-gateway/store-run-gateway.d.ts +4 -4
- package/dist/src/run-gateway/store-run-gateway.d.ts.map +1 -1
- package/dist/src/run-gateway/store-run-gateway.js +4 -4
- package/dist/src/run-gateway/store-run-gateway.js.map +1 -1
- package/dist/src/run-gateway/tenant-auth.d.ts +19 -1
- package/dist/src/run-gateway/tenant-auth.d.ts.map +1 -1
- package/dist/src/run-gateway/tenant-auth.js +133 -0
- package/dist/src/run-gateway/tenant-auth.js.map +1 -1
- package/dist/src/run-gateway/tenant-scoped-gateway.d.ts +10 -0
- package/dist/src/run-gateway/tenant-scoped-gateway.d.ts.map +1 -0
- package/dist/src/run-gateway/tenant-scoped-gateway.js +107 -0
- package/dist/src/run-gateway/tenant-scoped-gateway.js.map +1 -0
- package/dist/src/run-value-facets.d.ts +1 -1
- package/dist/src/run-value-facets.d.ts.map +1 -1
- package/dist/src/run-value-facets.js +5 -1
- package/dist/src/run-value-facets.js.map +1 -1
- package/dist/src/scheduler.d.ts.map +1 -1
- package/dist/src/scheduler.js +2 -1
- package/dist/src/scheduler.js.map +1 -1
- package/dist/src/schedules.d.ts +16 -1
- package/dist/src/schedules.d.ts.map +1 -1
- package/dist/src/schedules.js +29 -4
- package/dist/src/schedules.js.map +1 -1
- package/dist/src/services/main.d.ts +3 -3
- package/dist/src/services/main.js +6 -6
- package/dist/src/services/main.js.map +1 -1
- package/dist/src/singleton-admission.d.ts.map +1 -1
- package/dist/src/singleton-admission.js +2 -0
- package/dist/src/singleton-admission.js.map +1 -1
- package/dist/src/singleton-gate.d.ts +1 -1
- package/dist/src/singleton-gate.d.ts.map +1 -1
- package/dist/src/singleton-gate.js +4 -3
- package/dist/src/singleton-gate.js.map +1 -1
- package/dist/src/sql-schema.d.ts +54 -0
- package/dist/src/sql-schema.d.ts.map +1 -0
- package/dist/src/sql-schema.js +145 -0
- package/dist/src/sql-schema.js.map +1 -0
- package/dist/src/stores/factory.d.ts +6 -0
- package/dist/src/stores/factory.d.ts.map +1 -1
- package/dist/src/stores/factory.js +3 -0
- package/dist/src/stores/factory.js.map +1 -1
- package/dist/src/stores/lucid-mappers.d.ts +3 -0
- package/dist/src/stores/lucid-mappers.d.ts.map +1 -1
- package/dist/src/stores/lucid-mappers.js +12 -0
- package/dist/src/stores/lucid-mappers.js.map +1 -1
- package/dist/src/stores/lucid-pg-hot-path.d.ts +6 -2
- package/dist/src/stores/lucid-pg-hot-path.d.ts.map +1 -1
- package/dist/src/stores/lucid-pg-hot-path.js +7 -3
- package/dist/src/stores/lucid-pg-hot-path.js.map +1 -1
- package/dist/src/stores/lucid-schema.d.ts +18 -4
- package/dist/src/stores/lucid-schema.d.ts.map +1 -1
- package/dist/src/stores/lucid-schema.js +106 -61
- package/dist/src/stores/lucid-schema.js.map +1 -1
- package/dist/src/stores/lucid.d.ts +42 -2
- package/dist/src/stores/lucid.d.ts.map +1 -1
- package/dist/src/stores/lucid.js +450 -231
- package/dist/src/stores/lucid.js.map +1 -1
- package/dist/src/tenancy.d.ts +104 -0
- package/dist/src/tenancy.d.ts.map +1 -0
- package/dist/src/tenancy.js +91 -0
- package/dist/src/tenancy.js.map +1 -0
- package/dist/src/testing/in-memory-state-store.d.ts.map +1 -1
- package/dist/src/testing/in-memory-state-store.js +9 -3
- package/dist/src/testing/in-memory-state-store.js.map +1 -1
- package/dist/src/testing-kit/state-store-conformance.d.ts.map +1 -1
- package/dist/src/testing-kit/state-store-conformance.js +59 -0
- package/dist/src/testing-kit/state-store-conformance.js.map +1 -1
- package/dist/src/testing-kit/transport-conformance.d.ts.map +1 -1
- package/dist/src/testing-kit/transport-conformance.js +5 -1
- package/dist/src/testing-kit/transport-conformance.js.map +1 -1
- package/dist/src/transports/bullmq/bullmq-transport.d.ts +1 -1
- package/dist/src/transports/bullmq/bullmq-transport.d.ts.map +1 -1
- package/dist/src/transports/bullmq/bullmq-transport.js +14 -3
- package/dist/src/transports/bullmq/bullmq-transport.js.map +1 -1
- package/dist/src/transports/db-schema.d.ts +13 -5
- package/dist/src/transports/db-schema.d.ts.map +1 -1
- package/dist/src/transports/db-schema.js +52 -27
- package/dist/src/transports/db-schema.js.map +1 -1
- package/dist/src/transports/db.d.ts +6 -0
- package/dist/src/transports/db.d.ts.map +1 -1
- package/dist/src/transports/db.js +91 -42
- package/dist/src/transports/db.js.map +1 -1
- package/dist/src/transports/factory.d.ts +16 -0
- package/dist/src/transports/factory.d.ts.map +1 -1
- package/dist/src/transports/factory.js +6 -1
- package/dist/src/transports/factory.js.map +1 -1
- package/dist/src/transports/queue.d.ts +2 -2
- package/dist/src/transports/queue.d.ts.map +1 -1
- package/dist/src/transports/queue.js +49 -8
- package/dist/src/transports/queue.js.map +1 -1
- package/dist/src/transports/worker-keys-db.d.ts +5 -0
- package/dist/src/transports/worker-keys-db.d.ts.map +1 -1
- package/dist/src/transports/worker-keys-db.js +10 -8
- package/dist/src/transports/worker-keys-db.js.map +1 -1
- package/dist/src/workflow-discovery.d.ts +1 -1
- package/dist/src/workflow-discovery.d.ts.map +1 -1
- package/dist/src/workflow-discovery.js +4 -7
- package/dist/src/workflow-discovery.js.map +1 -1
- package/dist/src/workflow-events.d.ts +20 -51
- package/dist/src/workflow-events.d.ts.map +1 -1
- package/dist/src/workflow-events.js +12 -30
- package/dist/src/workflow-events.js.map +1 -1
- package/dist/src/workflow-ref.d.ts +1 -1
- package/dist/stubs/config/durable_dashboard.stub +9 -29
- package/dist/stubs/database/migrations/create_durable_tables.stub +12 -2
- package/dist/stubs/database/migrations/create_durable_transport_messages.stub +34 -5
- package/dist/stubs/database/migrations/create_durable_transport_tables.stub +30 -8
- package/dist/stubs/database/migrations/create_durable_transport_worker_keys.stub +24 -2
- package/package.json +25 -7
- package/skills/durable-cluster/SKILL.md +43 -23
- package/skills/durable-reliability/SKILL.md +13 -7
- package/dist/assets/spa/assets/index-70hGzOnT.css +0 -1
- package/dist/assets/spa/assets/index-CJjMAUau.js +0 -16
- package/dist/assets/spa/assets/index-CJjMAUau.js.map +0 -1
- package/dist/commands/retry.d.ts +0 -16
- package/dist/commands/retry.d.ts.map +0 -1
- package/dist/commands/retry.js +0 -34
- package/dist/commands/retry.js.map +0 -1
- package/dist/src/dashboard/auth.d.ts +0 -134
- package/dist/src/dashboard/auth.d.ts.map +0 -1
- package/dist/src/dashboard/auth.js +0 -156
- package/dist/src/dashboard/auth.js.map +0 -1
- package/dist/src/dashboard/login_page.d.ts +0 -36
- package/dist/src/dashboard/login_page.d.ts.map +0 -1
- package/dist/src/dashboard/login_page.js +0 -158
- package/dist/src/dashboard/login_page.js.map +0 -1
- package/dist/src/dashboard/session_cookie.d.ts +0 -45
- package/dist/src/dashboard/session_cookie.d.ts.map +0 -1
- package/dist/src/dashboard/session_cookie.js +0 -97
- package/dist/src/dashboard/session_cookie.js.map +0 -1
|
@@ -2,41 +2,21 @@
|
|
|
2
2
|
exports({ to: app.configPath('durable_dashboard.ts') })
|
|
3
3
|
}}}
|
|
4
4
|
import { defineConfig } from '@adonis-agora/durable/dashboard'
|
|
5
|
-
// Used by the commented-out dashboardAuth example below.
|
|
6
|
-
// import env from '#start/env'
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
|
-
* Configuration for the @adonis-agora/durable
|
|
7
|
+
* Configuration for the @adonis-agora/durable console.
|
|
10
8
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* \`dashboardAuth\` is an ADDITIVE, optional session gate on top of \`authorize\` —
|
|
20
|
-
* a signed cookie minted via a built-in login page (Mode B: \`login\`) and/or a
|
|
21
|
-
* "open the console from your app" endpoint (Mode A: \`session\`). At least one
|
|
22
|
-
* of the two is required when \`dashboardAuth\` is set; either or both may be
|
|
23
|
-
* configured. See \`docs/observability/dashboard-auth.mdx\`.
|
|
9
|
+
* Without \`authorize\` the console is open outside production and answers 403
|
|
10
|
+
* to every request in production. Set \`authorize\` to choose who may open it:
|
|
11
|
+
* a function, an authorizer class, or a lazy import of one
|
|
12
|
+
* (\`() => import('#policies/console_access')\`). It returns a boolean,
|
|
13
|
+
* \`{ allowed, reason?: 'unauthenticated' | 'forbidden' }\` (\`'unauthenticated'\`
|
|
14
|
+
* answers 401, any other denial 403) or \`{ redirectTo }\`. For scripts, use
|
|
15
|
+
* \`authorizeByToken({ token: env.get('CONSOLE_TOKEN') })\`.
|
|
24
16
|
*/
|
|
25
17
|
export default defineConfig({
|
|
26
18
|
// enabled: true,
|
|
27
19
|
// path: '/durable',
|
|
28
20
|
// authorize: (ctx) => ctx.auth.user?.isAdmin === true,
|
|
29
|
-
//
|
|
30
|
-
// secret: env.get('DURABLE_DASHBOARD_SECRET'),
|
|
31
|
-
// ttl: '8h',
|
|
32
|
-
// // Mode B — standalone login page.
|
|
33
|
-
// login: async (username, password) => {
|
|
34
|
-
// if (username === 'admin' && password === env.get('DURABLE_DASHBOARD_PASSWORD')) {
|
|
35
|
-
// return { id: 'admin', name: 'Admin' }
|
|
36
|
-
// }
|
|
37
|
-
// return null
|
|
38
|
-
// },
|
|
39
|
-
// // Mode A — mint a session for an already-authenticated host request.
|
|
40
|
-
// // session: async (request) => (request.user?.isAdmin ? { id: request.user.id } : null),
|
|
41
|
-
// },
|
|
21
|
+
// authorize: () => import('#policies/console_access'),
|
|
42
22
|
})
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
{{{
|
|
2
2
|
exports({ to: app.migrationsPath(`${new Date().getTime()}_create_durable_tables.ts`) })
|
|
3
3
|
}}}
|
|
4
|
+
import app from '@adonisjs/core/services/app'
|
|
4
5
|
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
5
6
|
import db from '@adonisjs/lucid/services/db'
|
|
6
7
|
import { createDurableTables, dropDurableTables } from '@adonis-agora/durable'
|
|
7
8
|
|
|
9
|
+
/**
|
|
10
|
+
* The database schema the durable tables live in (a database on MySQL): the top-level
|
|
11
|
+
* \`schema\` of config/durable.ts, read when the migration runs (\`undefined\` uses the
|
|
12
|
+
* connection's current schema). If you set it on \`stores.lucid({ schema })\` instead,
|
|
13
|
+
* put that value here.
|
|
14
|
+
*/
|
|
15
|
+
const configured = app.config.get('durable.schema', undefined)
|
|
16
|
+
const schema = typeof configured === 'string' ? configured : undefined
|
|
17
|
+
|
|
8
18
|
/**
|
|
9
19
|
* Durable workflow tables for the @adonis-agora/durable \`lucid\` state store: runs, step checkpoints,
|
|
10
20
|
* the search-attribute side-table, signal waiters, buffered signals, buffered events and persisted
|
|
@@ -39,10 +49,10 @@ export default class extends BaseSchema {
|
|
|
39
49
|
static disableTransactions = true
|
|
40
50
|
|
|
41
51
|
async up() {
|
|
42
|
-
await createDurableTables(db, this.db.connectionName)
|
|
52
|
+
await createDurableTables(db, this.db.connectionName, { schema })
|
|
43
53
|
}
|
|
44
54
|
|
|
45
55
|
async down() {
|
|
46
|
-
await dropDurableTables(db, this.db.connectionName)
|
|
56
|
+
await dropDurableTables(db, this.db.connectionName, { schema })
|
|
47
57
|
}
|
|
48
58
|
}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{{{
|
|
2
2
|
exports({ to: app.migrationsPath(`${new Date().getTime()}_create_durable_transport_messages.ts`) })
|
|
3
3
|
}}}
|
|
4
|
+
import app from '@adonisjs/core/services/app'
|
|
4
5
|
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* The database schema the tables live in (a database on MySQL): the top-level
|
|
9
|
+
* \`schema\` of config/durable.ts, read when the migration runs (\`undefined\` uses the
|
|
10
|
+
* connection's current schema). If you set it on \`transports.db({ schema })\` (or on the queue
|
|
11
|
+
* transport's \`workerKeysSchema\`) instead, put that value here.
|
|
12
|
+
*/
|
|
13
|
+
const configured = app.config.get('durable.schema', undefined)
|
|
14
|
+
const schema = typeof configured === 'string' ? configured : undefined
|
|
15
|
+
|
|
16
|
+
/** \`name\` in {@link schema}: Knex quotes \`schema.table\` part by part. */
|
|
17
|
+
const inSchema = (name: string) => (schema ? \`\${schema}.\${name}\` : name)
|
|
18
|
+
|
|
6
19
|
/**
|
|
7
20
|
* The message channel of the @adonis-agora/durable \`db\` transport: remote-workflow decisions and step
|
|
8
21
|
* events, and the store-less (tenant pod) protocol's start-run, run-request, run-reply and tenant-event
|
|
@@ -12,7 +25,16 @@ import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
12
25
|
*/
|
|
13
26
|
export default class extends BaseSchema {
|
|
14
27
|
async up() {
|
|
15
|
-
|
|
28
|
+
if (schema) {
|
|
29
|
+
// Runs before the tables below (calls run in order); \`??\` quotes the name as an identifier.
|
|
30
|
+
this.defer(async (db) => {
|
|
31
|
+
await db.rawQuery(
|
|
32
|
+
db.dialect.name === 'mysql' ? 'create database if not exists ??' : 'create schema if not exists ??',
|
|
33
|
+
[schema]
|
|
34
|
+
)
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
this.schema.createTable(inSchema('durable_transport_messages'), (table) => {
|
|
16
38
|
table.increments('id').primary()
|
|
17
39
|
table.string('kind', 32).notNullable()
|
|
18
40
|
table.string('namespace').notNullable().defaultTo('default')
|
|
@@ -29,15 +51,22 @@ export default class extends BaseSchema {
|
|
|
29
51
|
// it with one, whichever of the two migrations runs first.)
|
|
30
52
|
// Each check takes a fresh schema builder: a Knex schema builder is stateful.
|
|
31
53
|
this.defer(async (db) => {
|
|
32
|
-
if (!(await db.schema.hasTable('durable_transport_tasks'))) return
|
|
33
|
-
|
|
34
|
-
|
|
54
|
+
if (!(await (schema ? db.schema.withSchema(schema) : db.schema).hasTable('durable_transport_tasks'))) return
|
|
55
|
+
// With a schema, the catalog is asked directly: Knex's MySQL hasColumn ignores withSchema.
|
|
56
|
+
const hasKind = schema
|
|
57
|
+
? (await db
|
|
58
|
+
.from('information_schema.columns')
|
|
59
|
+
.where({ table_schema: schema, table_name: 'durable_transport_tasks', column_name: 'kind' })
|
|
60
|
+
.first()) !== null
|
|
61
|
+
: await db.schema.hasColumn('durable_transport_tasks', 'kind')
|
|
62
|
+
if (hasKind) return
|
|
63
|
+
await db.schema.alterTable(inSchema('durable_transport_tasks'), (table) => {
|
|
35
64
|
table.string('kind', 16).notNullable().defaultTo('step')
|
|
36
65
|
})
|
|
37
66
|
})
|
|
38
67
|
}
|
|
39
68
|
|
|
40
69
|
async down() {
|
|
41
|
-
this.schema.dropTableIfExists('durable_transport_messages')
|
|
70
|
+
this.schema.dropTableIfExists(inSchema('durable_transport_messages'))
|
|
42
71
|
}
|
|
43
72
|
}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{{{
|
|
2
2
|
exports({ to: app.migrationsPath(`${new Date().getTime()}_create_durable_transport_tables.ts`) })
|
|
3
3
|
}}}
|
|
4
|
+
import app from '@adonisjs/core/services/app'
|
|
4
5
|
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* The database schema the tables live in (a database on MySQL): the top-level
|
|
9
|
+
* \`schema\` of config/durable.ts, read when the migration runs (\`undefined\` uses the
|
|
10
|
+
* connection's current schema). If you set it on \`transports.db({ schema })\` (or on the queue
|
|
11
|
+
* transport's \`workerKeysSchema\`) instead, put that value here.
|
|
12
|
+
*/
|
|
13
|
+
const configured = app.config.get('durable.schema', undefined)
|
|
14
|
+
const schema = typeof configured === 'string' ? configured : undefined
|
|
15
|
+
|
|
16
|
+
/** \`name\` in {@link schema}: Knex quotes \`schema.table\` part by part. */
|
|
17
|
+
const inSchema = (name: string) => (schema ? \`\${schema}.\${name}\` : name)
|
|
18
|
+
|
|
6
19
|
/**
|
|
7
20
|
* Transport tables for the @adonis-agora/durable \`db\` transport: the point-to-point work channels (tasks /
|
|
8
21
|
* results / heartbeats / control) that let durable remote steps run cross-process over the database
|
|
@@ -12,7 +25,16 @@ import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
12
25
|
*/
|
|
13
26
|
export default class extends BaseSchema {
|
|
14
27
|
async up() {
|
|
15
|
-
|
|
28
|
+
if (schema) {
|
|
29
|
+
// Runs before the tables below (calls run in order); \`??\` quotes the name as an identifier.
|
|
30
|
+
this.defer(async (db) => {
|
|
31
|
+
await db.rawQuery(
|
|
32
|
+
db.dialect.name === 'mysql' ? 'create database if not exists ??' : 'create schema if not exists ??',
|
|
33
|
+
[schema]
|
|
34
|
+
)
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
this.schema.createTable(inSchema('durable_transport_tasks'), (table) => {
|
|
16
38
|
table.string('step_id').primary()
|
|
17
39
|
table.string('run_id').notNullable()
|
|
18
40
|
table.integer('seq').notNullable()
|
|
@@ -33,7 +55,7 @@ export default class extends BaseSchema {
|
|
|
33
55
|
table.index(['namespace', 'grp', 'claimed_at', 'created_at'], 'durable_transport_tasks_grp_idx')
|
|
34
56
|
})
|
|
35
57
|
|
|
36
|
-
this.schema.createTable('durable_transport_results', (table) => {
|
|
58
|
+
this.schema.createTable(inSchema('durable_transport_results'), (table) => {
|
|
37
59
|
table.string('step_id').primary()
|
|
38
60
|
table.string('run_id').notNullable()
|
|
39
61
|
table.integer('seq').notNullable()
|
|
@@ -49,7 +71,7 @@ export default class extends BaseSchema {
|
|
|
49
71
|
table.index(['namespace', 'claimed_at', 'created_at'], 'durable_transport_results_idx')
|
|
50
72
|
})
|
|
51
73
|
|
|
52
|
-
this.schema.createTable('durable_transport_heartbeats', (table) => {
|
|
74
|
+
this.schema.createTable(inSchema('durable_transport_heartbeats'), (table) => {
|
|
53
75
|
table.increments('id').primary()
|
|
54
76
|
table.string('run_id').notNullable()
|
|
55
77
|
table.integer('seq').notNullable()
|
|
@@ -62,7 +84,7 @@ export default class extends BaseSchema {
|
|
|
62
84
|
table.index(['namespace', 'claimed_at', 'created_at'], 'durable_transport_heartbeats_idx')
|
|
63
85
|
})
|
|
64
86
|
|
|
65
|
-
this.schema.createTable('durable_transport_control', (table) => {
|
|
87
|
+
this.schema.createTable(inSchema('durable_transport_control'), (table) => {
|
|
66
88
|
table.increments('id').primary()
|
|
67
89
|
table.text('payload', 'longtext').notNullable()
|
|
68
90
|
table.string('namespace').notNullable().defaultTo('default')
|
|
@@ -74,9 +96,9 @@ export default class extends BaseSchema {
|
|
|
74
96
|
}
|
|
75
97
|
|
|
76
98
|
async down() {
|
|
77
|
-
this.schema.dropTableIfExists('durable_transport_control')
|
|
78
|
-
this.schema.dropTableIfExists('durable_transport_heartbeats')
|
|
79
|
-
this.schema.dropTableIfExists('durable_transport_results')
|
|
80
|
-
this.schema.dropTableIfExists('durable_transport_tasks')
|
|
99
|
+
this.schema.dropTableIfExists(inSchema('durable_transport_control'))
|
|
100
|
+
this.schema.dropTableIfExists(inSchema('durable_transport_heartbeats'))
|
|
101
|
+
this.schema.dropTableIfExists(inSchema('durable_transport_results'))
|
|
102
|
+
this.schema.dropTableIfExists(inSchema('durable_transport_tasks'))
|
|
81
103
|
}
|
|
82
104
|
}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{{{
|
|
2
2
|
exports({ to: app.migrationsPath(`${new Date().getTime()}_create_durable_transport_worker_keys.ts`) })
|
|
3
3
|
}}}
|
|
4
|
+
import app from '@adonisjs/core/services/app'
|
|
4
5
|
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* The database schema the tables live in (a database on MySQL): the top-level
|
|
9
|
+
* \`schema\` of config/durable.ts, read when the migration runs (\`undefined\` uses the
|
|
10
|
+
* connection's current schema). If you set it on \`transports.db({ schema })\` (or on the queue
|
|
11
|
+
* transport's \`workerKeysSchema\`) instead, put that value here.
|
|
12
|
+
*/
|
|
13
|
+
const configured = app.config.get('durable.schema', undefined)
|
|
14
|
+
const schema = typeof configured === 'string' ? configured : undefined
|
|
15
|
+
|
|
16
|
+
/** \`name\` in {@link schema}: Knex quotes \`schema.table\` part by part. */
|
|
17
|
+
const inSchema = (name: string) => (schema ? \`\${schema}.\${name}\` : name)
|
|
18
|
+
|
|
6
19
|
/**
|
|
7
20
|
* The worker advertisement keys for the @adonis-agora/durable \`db\` transport: the descriptor and
|
|
8
21
|
* heartbeat a worker runtime publishes (what it serves, and that it is alive), each with an expiry so a
|
|
@@ -10,7 +23,16 @@ import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
10
23
|
*/
|
|
11
24
|
export default class extends BaseSchema {
|
|
12
25
|
async up() {
|
|
13
|
-
|
|
26
|
+
if (schema) {
|
|
27
|
+
// Runs before the tables below (calls run in order); \`??\` quotes the name as an identifier.
|
|
28
|
+
this.defer(async (db) => {
|
|
29
|
+
await db.rawQuery(
|
|
30
|
+
db.dialect.name === 'mysql' ? 'create database if not exists ??' : 'create schema if not exists ??',
|
|
31
|
+
[schema]
|
|
32
|
+
)
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
this.schema.createTable(inSchema('durable_transport_worker_keys'), (table) => {
|
|
14
36
|
table.string('key', 512).primary()
|
|
15
37
|
table.text('value', 'longtext').notNullable()
|
|
16
38
|
table.bigInteger('expires_at').notNullable()
|
|
@@ -19,6 +41,6 @@ export default class extends BaseSchema {
|
|
|
19
41
|
}
|
|
20
42
|
|
|
21
43
|
async down() {
|
|
22
|
-
this.schema.dropTableIfExists('durable_transport_worker_keys')
|
|
44
|
+
this.schema.dropTableIfExists(inSchema('durable_transport_worker_keys'))
|
|
23
45
|
}
|
|
24
46
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonis-agora/durable",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.20",
|
|
4
4
|
"description": "Durable cross-app workflows for AdonisJS — deterministic replay engine, AdonisJS binding, ace commands, dashboard, OpenTelemetry, Telescope, testing harness and Redis admission, all in one package. Part of the Agora ecosystem.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -106,6 +106,16 @@
|
|
|
106
106
|
"import": "./dist/src/control-plane-redis/index.js",
|
|
107
107
|
"default": "./dist/src/control-plane-redis/index.js"
|
|
108
108
|
},
|
|
109
|
+
"./diagnostics": {
|
|
110
|
+
"types": "./dist/src/diagnostics/index.d.ts",
|
|
111
|
+
"import": "./dist/src/diagnostics/index.js",
|
|
112
|
+
"default": "./dist/src/diagnostics/index.js"
|
|
113
|
+
},
|
|
114
|
+
"./doctor": {
|
|
115
|
+
"types": "./dist/src/doctor/index.d.ts",
|
|
116
|
+
"import": "./dist/src/doctor/index.js",
|
|
117
|
+
"default": "./dist/src/doctor/index.js"
|
|
118
|
+
},
|
|
109
119
|
"./commands": {
|
|
110
120
|
"types": "./dist/commands/main.d.ts",
|
|
111
121
|
"import": "./dist/commands/main.js",
|
|
@@ -125,9 +135,10 @@
|
|
|
125
135
|
],
|
|
126
136
|
"sideEffects": false,
|
|
127
137
|
"dependencies": {
|
|
128
|
-
"@adonis-agora/filter": ">=
|
|
138
|
+
"@adonis-agora/filter": ">=1.0.0-rc.5 <2.0.0"
|
|
129
139
|
},
|
|
130
140
|
"peerDependencies": {
|
|
141
|
+
"@adonis-agora/diagnostics": ">=1.0.0 <2.0.0 || >=1.0.0-rc.1 <2.0.0",
|
|
131
142
|
"@adonisjs/assembler": "^8.4.0",
|
|
132
143
|
"@adonisjs/core": "^7.3.0",
|
|
133
144
|
"@adonisjs/lucid": "^22.4.0",
|
|
@@ -166,27 +177,33 @@
|
|
|
166
177
|
},
|
|
167
178
|
"vitest": {
|
|
168
179
|
"optional": true
|
|
180
|
+
},
|
|
181
|
+
"@adonis-agora/diagnostics": {
|
|
182
|
+
"optional": true
|
|
169
183
|
}
|
|
170
184
|
},
|
|
171
185
|
"devDependencies": {
|
|
172
|
-
"@adonis-agora/
|
|
186
|
+
"@adonis-agora/diagnostics": "1.0.0-rc.1",
|
|
187
|
+
"@adonis-agora/durable-dashboard": "1.0.0-rc.8",
|
|
173
188
|
"@adonisjs/assembler": "8.6.0",
|
|
189
|
+
"@adonisjs/auth": "10.1.0",
|
|
174
190
|
"@adonisjs/core": "7.6.0",
|
|
175
191
|
"@adonisjs/lucid": "22.4.2",
|
|
176
192
|
"@adonisjs/queue": "0.7.0",
|
|
177
193
|
"@adonisjs/redis": "11.0.0",
|
|
178
194
|
"@opentelemetry/api": "1.10.0",
|
|
179
|
-
"@opentelemetry/context-async-hooks": "3.1.
|
|
195
|
+
"@opentelemetry/context-async-hooks": "3.1.1",
|
|
180
196
|
"@opentelemetry/sdk-trace-base": "2.12.0",
|
|
181
197
|
"@poppinss/hooks": "7.3.1",
|
|
182
198
|
"@tanstack/intent": "0.5.6",
|
|
183
199
|
"@types/better-sqlite3": "9.6.0",
|
|
184
|
-
"@types/node": "26.6.
|
|
200
|
+
"@types/node": "26.6.6",
|
|
185
201
|
"arktype": "2.2.9",
|
|
186
202
|
"better-sqlite3": "13.0.3",
|
|
187
|
-
"bullmq": "6.7.
|
|
203
|
+
"bullmq": "6.7.3",
|
|
188
204
|
"cron-parser": "5.10.4",
|
|
189
205
|
"ioredis": "6.0.0",
|
|
206
|
+
"jose": "6.2.17",
|
|
190
207
|
"mysql2": "3.24.6",
|
|
191
208
|
"pg": "8.23.1",
|
|
192
209
|
"typescript": "7.0.2",
|
|
@@ -204,6 +221,7 @@
|
|
|
204
221
|
"copy:stubs": "mkdir -p dist/stubs/config dist/stubs/database/migrations dist/stubs/make/workflow dist/assets && cp stubs/config/durable.stub dist/stubs/config/durable.stub && cp stubs/config/durable_dashboard.stub dist/stubs/config/durable_dashboard.stub && cp -r stubs/database/migrations/. dist/stubs/database/migrations/ && cp stubs/make/workflow/main.stub dist/stubs/make/workflow/main.stub && rm -rf dist/assets/spa && cp -r ../dashboard/dist/spa dist/assets/spa",
|
|
205
222
|
"test": "vitest run --passWithNoTests",
|
|
206
223
|
"test:watch": "vitest",
|
|
207
|
-
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.tests.json"
|
|
224
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.tests.json",
|
|
225
|
+
"check:agora-doctor": "node ../../scripts/check-agora-doctor.mjs ."
|
|
208
226
|
}
|
|
209
227
|
}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
name: durable-cluster
|
|
3
3
|
description: >-
|
|
4
4
|
Scale @adonis-agora/durable across processes and runtimes: the
|
|
5
|
-
|
|
5
|
+
topology-discriminated config (standalone, control-plane, store-less tenant with
|
|
6
6
|
compile-time store exclusion), durable:work vs durable:worker entrypoints,
|
|
7
7
|
WorkerRuntime + RedisWorkerRegistry descriptors, handshake negotiation
|
|
8
8
|
(compatible/degraded/incompatible) and capability routing (requires → blocked
|
|
9
9
|
runs), layered tenant auth (signTenantToken/hmacTenantVerifier/verifyTenant),
|
|
10
|
-
runGateway as the
|
|
10
|
+
runGateway as the topology-portable read/control surface, namespace vs partition,
|
|
11
11
|
tenant pods over bullmq, the @adonisjs/queue transport or the db transport, and Python
|
|
12
12
|
(durable-worker) / NestJS interop over the bullmq wire. Use when
|
|
13
13
|
splitting web from workers, isolating tenants, or adding polyglot workers.
|
|
@@ -19,7 +19,7 @@ metadata:
|
|
|
19
19
|
framework: adonisjs
|
|
20
20
|
sources:
|
|
21
21
|
- 'DavideCarvalho/adonis-durable:docs/cluster/index.mdx'
|
|
22
|
-
- 'DavideCarvalho/adonis-durable:docs/cluster/
|
|
22
|
+
- 'DavideCarvalho/adonis-durable:docs/cluster/topology-and-config.mdx'
|
|
23
23
|
- 'DavideCarvalho/adonis-durable:docs/cluster/thin-workers.mdx'
|
|
24
24
|
- 'DavideCarvalho/adonis-durable:docs/cluster/handshake.mdx'
|
|
25
25
|
- 'DavideCarvalho/adonis-durable:docs/cluster/interop.mdx'
|
|
@@ -29,14 +29,23 @@ sources:
|
|
|
29
29
|
|
|
30
30
|
# Cluster topologies & interop
|
|
31
31
|
|
|
32
|
-
`config/durable.ts` is a **
|
|
32
|
+
`config/durable.ts` is a **topology-discriminated union**: one `topology` field picks
|
|
33
33
|
the topology and TypeScript narrows the rest. Workflows (`app/workflows`) and
|
|
34
|
-
steps (`app/steps`) are byte-identical across every
|
|
34
|
+
steps (`app/steps`) are byte-identical across every topology — only where bodies
|
|
35
35
|
execute changes.
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
`topology` is Agora-wide vocabulary (the cluster shape), not durable-only: a
|
|
38
|
+
`tenant` is any process with no state of its own (API/dashboard pods included),
|
|
39
|
+
not a customer — customer isolation is the separate `tenancy` / `tenantId`
|
|
40
|
+
(organizations), which shares one pool by default. It is independent of the separate `role` axis (`all`/`api`/
|
|
41
|
+
`worker`); durable has no `role` field and covers that axis with `drive`,
|
|
42
|
+
`consumers` and `worker.embedded`. Durable connects tenants over a broker
|
|
43
|
+
transport (`bullmq`/`queue`/`db`) with `partition`, `tenant.token`,
|
|
44
|
+
`verifyTenant` and `capabilities`.
|
|
45
|
+
|
|
46
|
+
| Topology | Owns the store | Executes bodies | Serves HTTP |
|
|
38
47
|
|------|:---:|:---:|:---:|
|
|
39
|
-
| `standalone` (default — omit `
|
|
48
|
+
| `standalone` (default — omit `topology`) | ✅ | ✅ embedded | optional |
|
|
40
49
|
| `control-plane` | ✅ required | ❌ | optional |
|
|
41
50
|
| `tenant` | ❌ typed `never` | worker pods ✅ | api/dashboard pod |
|
|
42
51
|
|
|
@@ -48,7 +57,7 @@ Split fleet: a pure coordinator plus store-less tenant workers.
|
|
|
48
57
|
import { defineConfig, hmacTenantVerifier, stores, transports } from '@adonis-agora/durable'
|
|
49
58
|
|
|
50
59
|
export default defineConfig({
|
|
51
|
-
|
|
60
|
+
topology: 'control-plane',
|
|
52
61
|
transport: 'bullmq', // or 'queue' / 'db' for Adonis-only fleets
|
|
53
62
|
transports: { bullmq: transports.bullmq({ connection: { host: '127.0.0.1', port: 6379 } }) },
|
|
54
63
|
store: 'lucid',
|
|
@@ -61,11 +70,11 @@ export default defineConfig({
|
|
|
61
70
|
import { defineConfig, transports } from '@adonis-agora/durable'
|
|
62
71
|
|
|
63
72
|
export default defineConfig({
|
|
64
|
-
|
|
73
|
+
topology: 'tenant',
|
|
65
74
|
transport: 'bullmq',
|
|
66
75
|
transports: { bullmq: transports.bullmq({ connection: process.env.REDIS_URL }) },
|
|
67
76
|
partition: 'acme-corp', // which pool this pod serves (required)
|
|
68
|
-
tenant: { token: process.env.DURABLE_TENANT_TOKEN }, //
|
|
77
|
+
tenant: { token: process.env.DURABLE_TENANT_TOKEN }, // or a function/credentials class
|
|
69
78
|
requestTimeoutMs: 10_000,
|
|
70
79
|
// store: 'lucid' // ❌ COMPILE ERROR — a tenant config cannot name a store
|
|
71
80
|
})
|
|
@@ -76,6 +85,13 @@ node ace durable:work # store-backed loop: pending, recovery, timers, sweeps,
|
|
|
76
85
|
node ace durable:worker # store-less tenant loop: serves app/steps, heartbeats, drains
|
|
77
86
|
```
|
|
78
87
|
|
|
88
|
+
`verifyTenant` takes a function (`hmacTenantVerifier(secret)`), a class implementing
|
|
89
|
+
`TenantVerifierContract` (`verify({ token })` → `{ tenant, capabilities? } | null`; built
|
|
90
|
+
through the container), a lazy import of one, or an object with `verify`. `tenant.token`
|
|
91
|
+
takes a string, a function called before every request, or the same forms of a
|
|
92
|
+
`TenantCredentialsContract` (`token()`). Ready-made pieces for `@adonisjs/auth` access
|
|
93
|
+
tokens, authkit and any OIDC provider are in the "Authenticate tenants" docs page.
|
|
94
|
+
|
|
79
95
|
Isolation is three-layered: type (`store` is `never` on tenant), container (no
|
|
80
96
|
store binding registered), object (`WorkerRuntime`/`ProxyRunGateway` have no
|
|
81
97
|
store field).
|
|
@@ -91,7 +107,7 @@ database:
|
|
|
91
107
|
|
|
92
108
|
```ts title="config/durable.ts (tenant pod, queue transport)"
|
|
93
109
|
export default defineConfig({
|
|
94
|
-
|
|
110
|
+
topology: 'tenant',
|
|
95
111
|
transport: 'queue',
|
|
96
112
|
transports: { queue: transports.queue({ connection: 'redis', workerKeys: false }) },
|
|
97
113
|
partition: 'acme-corp',
|
|
@@ -117,9 +133,9 @@ applies a decision by run id). Needs the
|
|
|
117
133
|
|
|
118
134
|
## Core patterns
|
|
119
135
|
|
|
120
|
-
### Pattern 1 —
|
|
136
|
+
### Pattern 1 — topology-portable code via `runGateway`
|
|
121
137
|
|
|
122
|
-
Every
|
|
138
|
+
Every topology exposes the same read/control surface; identical controller code runs
|
|
123
139
|
on a store pod (direct reads) or a store-less pod (wire requests answered by the
|
|
124
140
|
control plane's `RunRequestResponder`):
|
|
125
141
|
|
|
@@ -146,7 +162,7 @@ Verbs: `getRun`, `listRuns`, `getCheckpoints`, `getRunChildren`,
|
|
|
146
162
|
`workerHealth`, `subscribe`, `topology()`, and the NestJS gateway's `retry`
|
|
147
163
|
(in-place requeue), `continue` (breakpoint), `retryWithInput`, `runFacets`,
|
|
148
164
|
`runValueFacets`, `waitingFor` (optional on the interface; both built-in
|
|
149
|
-
gateways implement them, tenant-scoped by the responder). Never branch on `
|
|
165
|
+
gateways implement them, tenant-scoped by the responder). Never branch on `topology`.
|
|
150
166
|
|
|
151
167
|
```ts
|
|
152
168
|
// Each fan of more than 50 members — or declared wider than 50 — comes back as one FanSummary in `fans`.
|
|
@@ -162,7 +178,7 @@ tenant console degrades `retry` to a re-dispatch; it remembers the old control
|
|
|
162
178
|
plane for a minute. `republishLifecycle` and `workflowLifecycle` have no fallback —
|
|
163
179
|
the proxy rejects with `RunGatewayError` (`unsupported-request`), which the dashboard
|
|
164
180
|
answers as `501`. Every request gets a reply, even when the gateway throws.
|
|
165
|
-
Source: `docs/cluster/
|
|
181
|
+
Source: `docs/cluster/topology-and-config.mdx`.
|
|
166
182
|
|
|
167
183
|
### Pattern 2 — capability-aware routing and blocked runs
|
|
168
184
|
|
|
@@ -256,7 +272,7 @@ fails fast rather than hanging. Source: `docs/python.mdx`,
|
|
|
256
272
|
|
|
257
273
|
## Common mistakes
|
|
258
274
|
|
|
259
|
-
### HIGH launching `durable:worker` on a store-backed
|
|
275
|
+
### HIGH launching `durable:worker` on a store-backed topology
|
|
260
276
|
|
|
261
277
|
Wrong:
|
|
262
278
|
|
|
@@ -270,7 +286,7 @@ Correct:
|
|
|
270
286
|
node ace durable:work # the store-backed dispatch/recovery/timers/schedules loop
|
|
271
287
|
```
|
|
272
288
|
|
|
273
|
-
Mechanism: `durable:worker` boots the store-less `WorkerRuntime`; on a
|
|
289
|
+
Mechanism: `durable:worker` boots the store-less `WorkerRuntime`; on a topology that
|
|
274
290
|
owns a store it logs a warning and refuses — the two commands are different
|
|
275
291
|
topologies, not aliases. Source: `docs/cli.mdx`.
|
|
276
292
|
|
|
@@ -335,10 +351,14 @@ Correct:
|
|
|
335
351
|
transports.bullmq({ connection: REDIS_URL, partition: 'david-dev' })
|
|
336
352
|
```
|
|
337
353
|
|
|
338
|
-
Mechanism: a worker on no partition
|
|
339
|
-
the queues the deployed fleet consumes — so the
|
|
340
|
-
tasks; docs call this out under Tenancy pitfalls
|
|
341
|
-
deployed fleet's tasks").
|
|
354
|
+
Mechanism: a worker on no partition and no non-`default` namespace serves the
|
|
355
|
+
bare `<name>` tokens — exactly the queues the deployed fleet consumes — so the
|
|
356
|
+
local process steals production tasks; docs call this out under Tenancy pitfalls
|
|
357
|
+
("competes for, and steals, the deployed fleet's tasks"). With a non-`default`
|
|
358
|
+
namespace and no `partition`, the `db`/`queue`/`bullmq` transports serve
|
|
359
|
+
`<name>@<namespace>` instead, matching what that engine dispatches to (an
|
|
360
|
+
explicit `partition`, including `'default'` for the bare tokens, still wins).
|
|
361
|
+
Source: `docs/concepts/tenancy.mdx`.
|
|
342
362
|
|
|
343
363
|
### HIGH a db-transport tenant pod on a database of its own
|
|
344
364
|
|
|
@@ -346,14 +366,14 @@ Wrong:
|
|
|
346
366
|
|
|
347
367
|
```ts
|
|
348
368
|
// the pod's default Lucid connection is its own app database
|
|
349
|
-
defineConfig({
|
|
369
|
+
defineConfig({ topology: 'tenant', transport: 'db', transports: { db: transports.db() }, partition: 'acme' })
|
|
350
370
|
```
|
|
351
371
|
|
|
352
372
|
Correct:
|
|
353
373
|
|
|
354
374
|
```ts
|
|
355
375
|
// a connection to the CONTROL PLANE's database (config/database.ts), used only for the transport tables
|
|
356
|
-
defineConfig({
|
|
376
|
+
defineConfig({ topology: 'tenant', transport: 'db', transports: { db: transports.db({ connection: 'durable' }) }, partition: 'acme' })
|
|
357
377
|
```
|
|
358
378
|
|
|
359
379
|
Mechanism: on `db` the wire IS the transport tables, so a pod writing its
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
the dead-letter queue (maxRecoveryAttempts, deadLetterWorkflow, deadLetter()
|
|
11
11
|
method, onDead, retryWithInput), retention (maxAge/maxCount policies), the
|
|
12
12
|
stuck-run playbook (stranded signature, redispatchPending,
|
|
13
|
-
remoteRedispatchMs, remoteAdvanceSilenceMs for remote workflow turns), ace ops commands (durable:work
|
|
13
|
+
remoteRedispatchMs, remoteAdvanceSilenceMs for remote workflow turns), ace ops commands (durable:work, durable:runs, durable:runs:retry --stale), and
|
|
14
14
|
the testing harness (createTestEngine, tick, failOnce, conformance kits).
|
|
15
15
|
license: MIT
|
|
16
16
|
metadata:
|
|
@@ -94,8 +94,8 @@ envelope (`{ input, output }`). Engine-level `compensationRetries` (default 1)
|
|
|
94
94
|
bounds transient undo failures; failing compensations are skipped so they can't
|
|
95
95
|
mask the original error. Trigger deliberately with
|
|
96
96
|
`await engine.cancel(runId, { compensate: true })` or
|
|
97
|
-
`engine.cancelWhere(filter, { compensate: true })`. The cancel is durable (
|
|
98
|
-
`
|
|
97
|
+
`engine.cancelWhere(filter, { compensate: true })`. The cancel is durable (the
|
|
98
|
+
persisted `cancelling` status) and honored on every exit of the turn running when it
|
|
99
99
|
lands: return, throw, continue-as-new or suspend all compensate and settle
|
|
100
100
|
`cancelled`. Every undo surfaces as a visible `compensate:<step>` event.
|
|
101
101
|
Source: `docs/reliability/sagas.mdx`.
|
|
@@ -142,7 +142,7 @@ status into a handler workflow — the engine starts it as `dlq:<runId>`
|
|
|
142
142
|
(idempotent) with a `DeadLetter` input `{ deadRunId, workflow, input, error }`
|
|
143
143
|
in the dead run's namespace. A run
|
|
144
144
|
whose remote step is still in flight is parked `suspended`, never counted, and a
|
|
145
|
-
retry (`requeue` / `durable:retry`) of a `dead`/`failed` run resets
|
|
145
|
+
retry (`requeue` / `durable:runs:retry`) of a `dead`/`failed` run resets
|
|
146
146
|
`recoveryAttempts` to 0:
|
|
147
147
|
|
|
148
148
|
```ts title="config/durable.ts"
|
|
@@ -168,7 +168,7 @@ throws. A `dlq:` handler run that dies is not routed again; a failed start
|
|
|
168
168
|
(handler not registered) is `console.warn`-ed. `engine.onDead(run => …)` still
|
|
169
169
|
fires first and is the manual escape hatch (keep the `dlq:<runId>` id).
|
|
170
170
|
|
|
171
|
-
A dead run stays inspectable and retriable (`durable:retry <runId>`, dashboard
|
|
171
|
+
A dead run stays inspectable and retriable (`durable:runs:retry <runId>`, dashboard
|
|
172
172
|
retry, or `engine.retryWithInput(runId, fixedInput)` for bad data).
|
|
173
173
|
Source: `docs/reliability/dead-letter.mdx`.
|
|
174
174
|
|
|
@@ -194,10 +194,16 @@ signature: status `suspended`, stale `updatedAt`, newest checkpoint
|
|
|
194
194
|
`kind: 'remote' / status: 'pending'`, old `enqueuedAt`. Find it, then heal it:
|
|
195
195
|
|
|
196
196
|
```bash
|
|
197
|
-
node ace durable:runs --stale=1h
|
|
198
|
-
node ace durable:
|
|
197
|
+
node ace durable:runs --stale=1h # threshold above your longest legitimate step
|
|
198
|
+
node ace durable:runs:redispatch checkout:1234 --force # re-send the lost step
|
|
199
|
+
node ace durable:runs:retry checkout:1234 # or re-run from its checkpoints
|
|
199
200
|
```
|
|
200
201
|
|
|
202
|
+
Every console action has an ace twin that runs the console's own handler
|
|
203
|
+
(`durable:runs:show`, `durable:runs:cancel`, `durable:runs:signal`,
|
|
204
|
+
`durable:runs:bulk`, `durable:schedules:pause`, `durable:health`, …; `--json` on
|
|
205
|
+
reads, `--force` to skip a confirmation). See `docs/cli.mdx`.
|
|
206
|
+
|
|
201
207
|
```ts title="app/controllers/ops_controller.ts"
|
|
202
208
|
import type { HttpContext } from '@adonisjs/core/http'
|
|
203
209
|
import { DEFAULT_STALE_MS, attachLiveness, filterStale, listRuns } from '@adonis-agora/durable'
|