@adonis-agora/durable 0.49.0 → 0.50.0
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 +261 -0
- package/README.md +53 -22
- package/dist/assets/spa/assets/index-DupjrK7N.js +16 -0
- package/dist/assets/spa/assets/index-DupjrK7N.js.map +1 -0
- package/dist/assets/spa/index.html +1 -1
- package/dist/commands/durable_worker.d.ts.map +1 -1
- package/dist/commands/durable_worker.js +9 -8
- package/dist/commands/durable_worker.js.map +1 -1
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +1 -0
- package/dist/configure.js.map +1 -1
- package/dist/providers/dashboard_provider.d.ts +2 -0
- package/dist/providers/dashboard_provider.d.ts.map +1 -1
- package/dist/providers/dashboard_provider.js +50 -6
- 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 +143 -34
- package/dist/providers/durable_provider.js.map +1 -1
- package/dist/src/admission-redis/redis-admission-backend.d.ts.map +1 -1
- package/dist/src/admission-redis/redis-admission-backend.js +3 -1
- package/dist/src/admission-redis/redis-admission-backend.js.map +1 -1
- package/dist/src/ambient-step.d.ts +24 -0
- package/dist/src/ambient-step.d.ts.map +1 -0
- package/dist/src/ambient-step.js +42 -0
- package/dist/src/ambient-step.js.map +1 -0
- package/dist/src/base-workflow.d.ts +10 -1
- package/dist/src/base-workflow.d.ts.map +1 -1
- package/dist/src/base-workflow.js.map +1 -1
- package/dist/src/codec-state-store.d.ts +28 -2
- package/dist/src/codec-state-store.d.ts.map +1 -1
- package/dist/src/codec-state-store.js +61 -3
- package/dist/src/codec-state-store.js.map +1 -1
- package/dist/src/commands/worker.d.ts +4 -1
- package/dist/src/commands/worker.d.ts.map +1 -1
- package/dist/src/commands/worker.js +27 -3
- package/dist/src/commands/worker.js.map +1 -1
- package/dist/src/config_types.d.ts +6 -0
- package/dist/src/config_types.d.ts.map +1 -1
- package/dist/src/control-plane-redis/redis-control-plane.d.ts.map +1 -1
- package/dist/src/control-plane-redis/redis-control-plane.js +22 -6
- package/dist/src/control-plane-redis/redis-control-plane.js.map +1 -1
- package/dist/src/control-planes/factory.d.ts +6 -0
- package/dist/src/control-planes/factory.d.ts.map +1 -1
- package/dist/src/control-planes/factory.js +1 -0
- package/dist/src/control-planes/factory.js.map +1 -1
- package/dist/src/dashboard/gateway-adapter.d.ts +15 -5
- package/dist/src/dashboard/gateway-adapter.d.ts.map +1 -1
- package/dist/src/dashboard/gateway-adapter.js +71 -7
- package/dist/src/dashboard/gateway-adapter.js.map +1 -1
- package/dist/src/dashboard/handlers.d.ts +53 -1
- package/dist/src/dashboard/handlers.d.ts.map +1 -1
- package/dist/src/dashboard/handlers.js +200 -20
- package/dist/src/dashboard/handlers.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +2 -2
- package/dist/src/dashboard/index.d.ts.map +1 -1
- package/dist/src/dashboard/index.js +2 -2
- package/dist/src/dashboard/index.js.map +1 -1
- package/dist/src/dashboard/openapi.d.ts.map +1 -1
- package/dist/src/dashboard/openapi.js +71 -1
- package/dist/src/dashboard/openapi.js.map +1 -1
- package/dist/src/define_config.d.ts +122 -8
- package/dist/src/define_config.d.ts.map +1 -1
- package/dist/src/define_config.js.map +1 -1
- package/dist/src/diagnostics-bridge.d.ts +16 -3
- package/dist/src/diagnostics-bridge.d.ts.map +1 -1
- package/dist/src/diagnostics-bridge.js +9 -3
- package/dist/src/diagnostics-bridge.js.map +1 -1
- package/dist/src/discovery-roots.d.ts +92 -0
- package/dist/src/discovery-roots.d.ts.map +1 -0
- package/dist/src/discovery-roots.js +150 -0
- package/dist/src/discovery-roots.js.map +1 -0
- package/dist/src/engine.d.ts +418 -20
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/engine.js +1523 -159
- package/dist/src/engine.js.map +1 -1
- package/dist/src/entities.d.ts +36 -1
- package/dist/src/entities.d.ts.map +1 -1
- package/dist/src/entities.js +65 -4
- package/dist/src/entities.js.map +1 -1
- package/dist/src/errors.d.ts +36 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +44 -0
- package/dist/src/errors.js.map +1 -1
- package/dist/src/event-trigger-bridge.d.ts +8 -0
- package/dist/src/event-trigger-bridge.d.ts.map +1 -1
- package/dist/src/event-trigger-bridge.js +24 -3
- package/dist/src/event-trigger-bridge.js.map +1 -1
- package/dist/src/handshake/announced.d.ts +27 -0
- package/dist/src/handshake/announced.d.ts.map +1 -1
- package/dist/src/handshake/announced.js +62 -0
- package/dist/src/handshake/announced.js.map +1 -1
- package/dist/src/handshake/directory.d.ts +92 -0
- package/dist/src/handshake/directory.d.ts.map +1 -0
- package/dist/src/handshake/directory.js +139 -0
- package/dist/src/handshake/directory.js.map +1 -0
- package/dist/src/hooks/barrel-sources.d.ts +28 -0
- package/dist/src/hooks/barrel-sources.d.ts.map +1 -0
- package/dist/src/hooks/barrel-sources.js +92 -0
- package/dist/src/hooks/barrel-sources.js.map +1 -0
- package/dist/src/hooks/steps.d.ts +12 -3
- package/dist/src/hooks/steps.d.ts.map +1 -1
- package/dist/src/hooks/steps.js +7 -11
- package/dist/src/hooks/steps.js.map +1 -1
- package/dist/src/hooks/workflows.d.ts +12 -3
- package/dist/src/hooks/workflows.d.ts.map +1 -1
- package/dist/src/hooks/workflows.js +7 -13
- package/dist/src/hooks/workflows.js.map +1 -1
- package/dist/src/index.d.ts +12 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/interfaces.d.ts +309 -21
- package/dist/src/interfaces.d.ts.map +1 -1
- package/dist/src/interfaces.js +10 -0
- package/dist/src/interfaces.js.map +1 -1
- package/dist/src/metrics.d.ts.map +1 -1
- package/dist/src/metrics.js +5 -0
- package/dist/src/metrics.js.map +1 -1
- package/dist/src/namespaces.d.ts +17 -0
- package/dist/src/namespaces.d.ts.map +1 -0
- package/dist/src/namespaces.js +24 -0
- package/dist/src/namespaces.js.map +1 -0
- package/dist/src/otel/durable-metrics.d.ts.map +1 -1
- package/dist/src/otel/durable-metrics.js +5 -0
- package/dist/src/otel/durable-metrics.js.map +1 -1
- package/dist/src/otel/durable-otel.d.ts.map +1 -1
- package/dist/src/otel/durable-otel.js +5 -0
- package/dist/src/otel/durable-otel.js.map +1 -1
- package/dist/src/pollers.d.ts +10 -1
- package/dist/src/pollers.d.ts.map +1 -1
- package/dist/src/pollers.js +15 -5
- package/dist/src/pollers.js.map +1 -1
- package/dist/src/protocol.d.ts +12 -0
- package/dist/src/protocol.d.ts.map +1 -1
- package/dist/src/protocol.js +27 -1
- package/dist/src/protocol.js.map +1 -1
- package/dist/src/remote-event.d.ts +6 -0
- package/dist/src/remote-event.d.ts.map +1 -0
- package/dist/src/remote-event.js +19 -0
- package/dist/src/remote-event.js.map +1 -0
- package/dist/src/remote-workflow-executor.d.ts +34 -12
- package/dist/src/remote-workflow-executor.d.ts.map +1 -1
- package/dist/src/remote-workflow-executor.js +42 -40
- package/dist/src/remote-workflow-executor.js.map +1 -1
- package/dist/src/run-detail-summary.d.ts +90 -3
- package/dist/src/run-detail-summary.d.ts.map +1 -1
- package/dist/src/run-detail-summary.js +360 -2
- package/dist/src/run-detail-summary.js.map +1 -1
- package/dist/src/run-facets.d.ts +48 -0
- package/dist/src/run-facets.d.ts.map +1 -0
- package/dist/src/run-facets.js +100 -0
- package/dist/src/run-facets.js.map +1 -0
- package/dist/src/run-gateway/interface.d.ts +27 -1
- package/dist/src/run-gateway/interface.d.ts.map +1 -1
- package/dist/src/run-gateway/proxy-run-gateway.d.ts +32 -4
- package/dist/src/run-gateway/proxy-run-gateway.d.ts.map +1 -1
- package/dist/src/run-gateway/proxy-run-gateway.js +101 -5
- package/dist/src/run-gateway/proxy-run-gateway.js.map +1 -1
- package/dist/src/run-gateway/run-request-responder.d.ts +18 -5
- package/dist/src/run-gateway/run-request-responder.d.ts.map +1 -1
- package/dist/src/run-gateway/run-request-responder.js +155 -32
- package/dist/src/run-gateway/run-request-responder.js.map +1 -1
- package/dist/src/run-gateway/store-run-gateway.d.ts +23 -1
- package/dist/src/run-gateway/store-run-gateway.d.ts.map +1 -1
- package/dist/src/run-gateway/store-run-gateway.js +38 -0
- package/dist/src/run-gateway/store-run-gateway.js.map +1 -1
- package/dist/src/search-attributes-schema.d.ts +44 -0
- package/dist/src/search-attributes-schema.d.ts.map +1 -0
- package/dist/src/search-attributes-schema.js +51 -0
- package/dist/src/search-attributes-schema.js.map +1 -0
- package/dist/src/singleton-admission.d.ts +75 -0
- package/dist/src/singleton-admission.d.ts.map +1 -0
- package/dist/src/singleton-admission.js +156 -0
- package/dist/src/singleton-admission.js.map +1 -0
- package/dist/src/singleton-gate.d.ts +23 -8
- package/dist/src/singleton-gate.d.ts.map +1 -1
- package/dist/src/singleton-gate.js +59 -12
- package/dist/src/singleton-gate.js.map +1 -1
- package/dist/src/standard-schema.d.ts +83 -0
- package/dist/src/standard-schema.d.ts.map +1 -0
- package/dist/src/standard-schema.js +31 -0
- package/dist/src/standard-schema.js.map +1 -0
- package/dist/src/step-discovery.d.ts +21 -11
- package/dist/src/step-discovery.d.ts.map +1 -1
- package/dist/src/step-discovery.js +86 -45
- package/dist/src/step-discovery.js.map +1 -1
- package/dist/src/step-ref.d.ts +38 -12
- package/dist/src/step-ref.d.ts.map +1 -1
- package/dist/src/step-ref.js +5 -13
- package/dist/src/step-ref.js.map +1 -1
- 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 +4 -1
- package/dist/src/stores/factory.js.map +1 -1
- package/dist/src/stores/lucid-helpers.d.ts +2 -0
- package/dist/src/stores/lucid-helpers.d.ts.map +1 -1
- package/dist/src/stores/lucid-helpers.js +7 -0
- package/dist/src/stores/lucid-helpers.js.map +1 -1
- package/dist/src/stores/lucid-mappers.d.ts +25 -0
- package/dist/src/stores/lucid-mappers.d.ts.map +1 -1
- package/dist/src/stores/lucid-mappers.js +81 -18
- package/dist/src/stores/lucid-mappers.js.map +1 -1
- package/dist/src/stores/lucid-schema.d.ts +59 -1
- package/dist/src/stores/lucid-schema.d.ts.map +1 -1
- package/dist/src/stores/lucid-schema.js +271 -25
- package/dist/src/stores/lucid-schema.js.map +1 -1
- package/dist/src/stores/lucid.d.ts +61 -2
- package/dist/src/stores/lucid.d.ts.map +1 -1
- package/dist/src/stores/lucid.js +346 -41
- package/dist/src/stores/lucid.js.map +1 -1
- package/dist/src/telescope/dashboard.d.ts.map +1 -1
- package/dist/src/telescope/dashboard.js +30 -1
- package/dist/src/telescope/dashboard.js.map +1 -1
- package/dist/src/telescope/data-providers.d.ts +19 -1
- package/dist/src/telescope/data-providers.d.ts.map +1 -1
- package/dist/src/telescope/data-providers.js +119 -3
- package/dist/src/telescope/data-providers.js.map +1 -1
- package/dist/src/telescope/extension.d.ts.map +1 -1
- package/dist/src/telescope/extension.js +2 -1
- package/dist/src/telescope/extension.js.map +1 -1
- package/dist/src/telescope/index.d.ts +1 -1
- package/dist/src/telescope/index.d.ts.map +1 -1
- package/dist/src/telescope/index.js +1 -1
- package/dist/src/telescope/index.js.map +1 -1
- package/dist/src/testing/in-memory-state-store.d.ts +44 -15
- package/dist/src/testing/in-memory-state-store.d.ts.map +1 -1
- package/dist/src/testing/in-memory-state-store.js +204 -41
- package/dist/src/testing/in-memory-state-store.js.map +1 -1
- package/dist/src/testing-kit/checkpoint-aggregation-contract.d.ts +16 -0
- package/dist/src/testing-kit/checkpoint-aggregation-contract.d.ts.map +1 -0
- package/dist/src/testing-kit/checkpoint-aggregation-contract.js +228 -0
- package/dist/src/testing-kit/checkpoint-aggregation-contract.js.map +1 -0
- package/dist/src/testing-kit/state-store-conformance.d.ts.map +1 -1
- package/dist/src/testing-kit/state-store-conformance.js +355 -3
- package/dist/src/testing-kit/state-store-conformance.js.map +1 -1
- package/dist/src/transport-pool.d.ts +15 -1
- package/dist/src/transport-pool.d.ts.map +1 -1
- package/dist/src/transport-pool.js +50 -4
- package/dist/src/transport-pool.js.map +1 -1
- package/dist/src/transports/adaptive-concurrency.d.ts +168 -0
- package/dist/src/transports/adaptive-concurrency.d.ts.map +1 -0
- package/dist/src/transports/adaptive-concurrency.js +353 -0
- package/dist/src/transports/adaptive-concurrency.js.map +1 -0
- package/dist/src/transports/bullmq/adaptive-concurrency.d.ts +1 -143
- package/dist/src/transports/bullmq/adaptive-concurrency.d.ts.map +1 -1
- package/dist/src/transports/bullmq/adaptive-concurrency.js +3 -311
- package/dist/src/transports/bullmq/adaptive-concurrency.js.map +1 -1
- package/dist/src/transports/bullmq/bullmq-transport.d.ts +49 -1
- package/dist/src/transports/bullmq/bullmq-transport.d.ts.map +1 -1
- package/dist/src/transports/bullmq/bullmq-transport.js +330 -38
- package/dist/src/transports/bullmq/bullmq-transport.js.map +1 -1
- package/dist/src/transports/bullmq/deps.d.ts +18 -2
- package/dist/src/transports/bullmq/deps.d.ts.map +1 -1
- package/dist/src/transports/bullmq/deps.js +44 -2
- package/dist/src/transports/bullmq/deps.js.map +1 -1
- package/dist/src/transports/db-helpers.d.ts +39 -0
- package/dist/src/transports/db-helpers.d.ts.map +1 -1
- package/dist/src/transports/db-helpers.js +73 -0
- package/dist/src/transports/db-helpers.js.map +1 -1
- package/dist/src/transports/db-remote.d.ts +53 -0
- package/dist/src/transports/db-remote.d.ts.map +1 -0
- package/dist/src/transports/db-remote.js +147 -0
- package/dist/src/transports/db-remote.js.map +1 -0
- package/dist/src/transports/db-schema.d.ts +44 -1
- package/dist/src/transports/db-schema.d.ts.map +1 -1
- package/dist/src/transports/db-schema.js +227 -88
- package/dist/src/transports/db-schema.js.map +1 -1
- package/dist/src/transports/db.d.ts +189 -6
- package/dist/src/transports/db.d.ts.map +1 -1
- package/dist/src/transports/db.js +1291 -137
- package/dist/src/transports/db.js.map +1 -1
- package/dist/src/transports/event-emitter.d.ts +8 -0
- package/dist/src/transports/event-emitter.d.ts.map +1 -1
- package/dist/src/transports/event-emitter.js +36 -3
- package/dist/src/transports/event-emitter.js.map +1 -1
- package/dist/src/transports/factory.d.ts +110 -5
- package/dist/src/transports/factory.d.ts.map +1 -1
- package/dist/src/transports/factory.js +56 -9
- package/dist/src/transports/factory.js.map +1 -1
- package/dist/src/transports/queue-mock-adapter.d.ts +7 -2
- package/dist/src/transports/queue-mock-adapter.d.ts.map +1 -1
- package/dist/src/transports/queue-mock-adapter.js +18 -2
- package/dist/src/transports/queue-mock-adapter.js.map +1 -1
- package/dist/src/transports/queue-remote.d.ts +146 -0
- package/dist/src/transports/queue-remote.d.ts.map +1 -0
- package/dist/src/transports/queue-remote.js +398 -0
- package/dist/src/transports/queue-remote.js.map +1 -0
- package/dist/src/transports/queue.d.ts +159 -6
- package/dist/src/transports/queue.d.ts.map +1 -1
- package/dist/src/transports/queue.js +747 -37
- package/dist/src/transports/queue.js.map +1 -1
- package/dist/src/transports/task-failure.d.ts +31 -0
- package/dist/src/transports/task-failure.d.ts.map +1 -0
- package/dist/src/transports/task-failure.js +50 -0
- package/dist/src/transports/task-failure.js.map +1 -0
- package/dist/src/workflow-als.d.ts +1 -1
- package/dist/src/workflow-als.d.ts.map +1 -1
- package/dist/src/workflow-ctx.d.ts +10 -0
- package/dist/src/workflow-ctx.d.ts.map +1 -1
- package/dist/src/workflow-ctx.js +97 -15
- package/dist/src/workflow-ctx.js.map +1 -1
- package/dist/src/workflow-discovery.d.ts +32 -41
- package/dist/src/workflow-discovery.d.ts.map +1 -1
- package/dist/src/workflow-discovery.js +65 -88
- package/dist/src/workflow-discovery.js.map +1 -1
- package/dist/src/workflow-ref.d.ts +24 -0
- package/dist/src/workflow-ref.d.ts.map +1 -1
- package/dist/src/workflow-ref.js.map +1 -1
- package/dist/stubs/config/durable.stub +6 -0
- package/dist/stubs/config/durable_dashboard.stub +7 -3
- package/dist/stubs/database/migrations/create_durable_tables.stub +2 -1
- package/dist/stubs/database/migrations/create_durable_transport_messages.stub +43 -0
- package/dist/stubs/database/migrations/create_durable_transport_tables.stub +12 -9
- package/dist/stubs/database/migrations/create_durable_transport_worker_keys.stub +1 -1
- package/dist/stubs/make/workflow/main.stub +1 -1
- package/package.json +6 -4
- package/skills/durable-cluster/SKILL.md +80 -11
- package/skills/durable-determinism/SKILL.md +11 -5
- package/skills/durable-reliability/SKILL.md +77 -37
- package/skills/durable-setup/SKILL.md +51 -22
- package/skills/durable-transports-stores/SKILL.md +130 -19
- package/skills/durable-workflows/SKILL.md +71 -18
- package/dist/assets/spa/assets/index-DdB9zxuX.js +0 -16
- package/dist/assets/spa/assets/index-DdB9zxuX.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-ref.d.ts","sourceRoot":"","sources":["../../src/step-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"step-ref.d.ts","sourceRoot":"","sources":["../../src/step-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAIL,KAAK,OAAO,EACb,MAAM,uBAAuB,CAAC;AAE/B;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAO,MAA+C,CAAC;AAEvF,oGAAoG;AACpG,MAAM,WAAW,eAAe;IAC9B,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;IACb,qGAAqG;IACrG,KAAK,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACrC,0FAA0F;IAC1F,MAAM,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACvC;AAED,6EAA6E;AAC7E,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;yGACqG;IACrG,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB;yDACqD;IACrD,MAAM,CAAC,EAAE,gBAAgB,CAAC;IA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NAME, } from './step-name-symbol.js';
|
|
2
2
|
/**
|
|
3
3
|
* The full metadata a `@Step` / {@link defineStep} stamps on a step handler for discovery: its
|
|
4
|
-
* resolved routing `name` plus the opt-in runtime
|
|
4
|
+
* resolved routing `name` plus the opt-in runtime Standard Schemas (zod, valibot, arktype, …) an
|
|
5
|
+
* authoring layer attached. Stamped
|
|
5
6
|
* under {@link DURABLE_STEP_META} on the handler function so step discovery can wrap it with
|
|
6
7
|
* validation at the serve boundary. A global-registry symbol so it survives duplicate copies.
|
|
7
8
|
*/
|
|
@@ -48,8 +49,9 @@ function stamp(fn, meta, config) {
|
|
|
48
49
|
* - `@Step()` — bare: the routing name is DERIVED as `` `${ClassName}.${method}` `` — refactor-safe.
|
|
49
50
|
* - `@Step('custom:name')` — explicit name override (a stable cross-runtime contract).
|
|
50
51
|
* - `@Step({ name?, input?, output?, retries?, backoff?, backoffMs?, backoffMaxMs?, jitter?,
|
|
51
|
-
* timeoutMs? })` — optional name override, opt-in RUNTIME
|
|
52
|
-
* boundary by step discovery
|
|
52
|
+
* timeoutMs? })` — optional name override, opt-in RUNTIME Standard Schemas (zod, valibot,
|
|
53
|
+
* arktype, … — validated at the serve boundary by step discovery; a failure is a non-retryable
|
|
54
|
+
* `SchemaValidationError`), and a def-level durable-retry/liveness policy `ctx.step` reads via
|
|
53
55
|
* `stepConfigOf` (a per-call `opts` overrides it field-by-field).
|
|
54
56
|
*/
|
|
55
57
|
export function Step(nameOrOptions) {
|
|
@@ -69,16 +71,6 @@ export function Step(nameOrOptions) {
|
|
|
69
71
|
stamp(value, meta, stepConfigFrom(options));
|
|
70
72
|
});
|
|
71
73
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Build a durable step handler WITHOUT a class/decorator: stamps `fn` with the routing `name` (and
|
|
74
|
-
* optional zod schemas + dispatch policy) so it works as a typed {@link StepRef} for
|
|
75
|
-
* `ctx.step(fn, input)` AND is discoverable/registerable by name. The cross-runtime baseline — pass
|
|
76
|
-
* the returned ref to `ctx.step`, or register it on a transport via `registerStep`.
|
|
77
|
-
*
|
|
78
|
-
* ```ts
|
|
79
|
-
* export const charge = defineStep('billing:charge', async (input: ChargeInput) => { ... })
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
74
|
export function defineStep(name, fn, config) {
|
|
83
75
|
const meta = {
|
|
84
76
|
name,
|
package/dist/src/step-ref.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-ref.js","sourceRoot":"","sources":["../../src/step-ref.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAGlB,MAAM,uBAAuB,CAAC;AAE/B
|
|
1
|
+
{"version":3,"file":"step-ref.js","sourceRoot":"","sources":["../../src/step-ref.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAGlB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAkB,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AA8CvF;;uCAEuC;AACvC,SAAS,cAAc,CAAC,OAA6B;IACnD,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;QAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACpE,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;QAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACpE,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;QAAE,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAC1E,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS;QAAE,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IACnF,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS;QAAE,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IACj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AAS,CAAC;IAC3E,OAAQ,GAAwD,EAAE,CAAC,iBAAiB,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -16,6 +16,12 @@ export type StoreFactory = (ctx: StoreContext) => Promise<StateStore>;
|
|
|
16
16
|
export interface LucidStoreConfig {
|
|
17
17
|
/** Lucid connection name to use. Defaults to the `Database` default connection. */
|
|
18
18
|
connection?: string;
|
|
19
|
+
/**
|
|
20
|
+
* MySQL/MariaDB only: the collation the durable tables use — new tables are created with it and
|
|
21
|
+
* existing ones are converted to it at boot. Set it to your own tables' collation (e.g.
|
|
22
|
+
* `'utf8mb4_unicode_ci'`) so a JOIN against them doesn't fail with `Illegal mix of collations`.
|
|
23
|
+
*/
|
|
24
|
+
collation?: string;
|
|
19
25
|
}
|
|
20
26
|
/**
|
|
21
27
|
* The store factory namespace used in `config/durable.ts`:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/stores/factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtE,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/stores/factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtE,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,MAAM;IACjB,4EAA4E;IAC5E,KAAK,UAAS,gBAAgB,GAAQ,YAAY;CAUnD,CAAC"}
|
|
@@ -23,7 +23,10 @@ export const stores = {
|
|
|
23
23
|
return async (ctx) => {
|
|
24
24
|
const db = (await resolveLucidDatabase(ctx));
|
|
25
25
|
const { LucidStateStore } = await import('./lucid.js');
|
|
26
|
-
return new LucidStateStore(db,
|
|
26
|
+
return new LucidStateStore(db, {
|
|
27
|
+
...(config.connection !== undefined ? { connectionName: config.connection } : {}),
|
|
28
|
+
...(config.collation !== undefined ? { collation: config.collation } : {}),
|
|
29
|
+
});
|
|
27
30
|
};
|
|
28
31
|
},
|
|
29
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../src/stores/factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../src/stores/factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AA6B9D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,4EAA4E;IAC5E,KAAK,CAAC,MAAM,GAAqB,EAAE;QACjC,OAAO,KAAK,EAAE,GAAG,EAAE,EAAE;YACnB,MAAM,EAAE,GAAG,CAAC,MAAM,oBAAoB,CAAC,GAAG,CAAC,CAAa,CAAC;YACzD,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;YACvD,OAAO,IAAI,eAAe,CAAC,EAAE,EAAE;gBAC7B,GAAG,CAAC,MAAM,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACjF,GAAG,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC3E,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -8,4 +8,6 @@ import { Database } from '@adonisjs/lucid/database';
|
|
|
8
8
|
export declare function makeMemoryDb(): Database;
|
|
9
9
|
/** A fresh in-memory db with the durable tables already created. */
|
|
10
10
|
export declare function makeStoreDb(): Promise<Database>;
|
|
11
|
+
/** A fresh isolated Postgres schema (see `makeIsolatedPostgresDb`) with the durable tables created. */
|
|
12
|
+
export declare function makePostgresStoreDb(url: string): Promise<Database>;
|
|
11
13
|
//# sourceMappingURL=lucid-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucid-helpers.d.ts","sourceRoot":"","sources":["../../../src/stores/lucid-helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"lucid-helpers.d.ts","sourceRoot":"","sources":["../../../src/stores/lucid-helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIpD;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,QAAQ,CAwBvC;AAED,oEAAoE;AACpE,wBAAsB,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC,CAIrD;AAED,uGAAuG;AACvG,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAIxE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Emitter } from '@adonisjs/core/events';
|
|
2
2
|
import { Logger } from '@adonisjs/core/logger';
|
|
3
3
|
import { Database } from '@adonisjs/lucid/database';
|
|
4
|
+
import { makeIsolatedPostgresDb } from '../transports/db-helpers.js';
|
|
4
5
|
import { createDurableTables } from './lucid-schema.js';
|
|
5
6
|
/**
|
|
6
7
|
* Build a standalone Lucid `Database` pointed at an in-memory SQLite (`better-sqlite3`) — the
|
|
@@ -35,4 +36,10 @@ export async function makeStoreDb() {
|
|
|
35
36
|
await createDurableTables(db);
|
|
36
37
|
return db;
|
|
37
38
|
}
|
|
39
|
+
/** A fresh isolated Postgres schema (see `makeIsolatedPostgresDb`) with the durable tables created. */
|
|
40
|
+
export async function makePostgresStoreDb(url) {
|
|
41
|
+
const db = await makeIsolatedPostgresDb(url);
|
|
42
|
+
await createDurableTables(db);
|
|
43
|
+
return db;
|
|
44
|
+
}
|
|
38
45
|
//# sourceMappingURL=lucid-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucid-helpers.js","sourceRoot":"","sources":["../../../src/stores/lucid-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9C,kGAAkG;IAClG,iEAAiE;I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E,GAAG,IAAI,QAAQ,CACrB;QACE,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE;YACX,MAAM,EAAE;gBACN,MAAM,EAAE,gBAAgB;gBACxB,UAAU,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE;gBACpC,gBAAgB,EAAE,IAAI;gBACtB,uFAAuF;gBACvF,2FAA2F;gBAC3F,8BAA8B;gBAC9B,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;aACzB;SACF;KACF,EACD,MAAM,EACN,OAAO,CACR,CAAC;IACF,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,oEAAoE;AACpE,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,MAAM,EAAE,GAAG,YAAY,EAAE,CAAC;IAC1B,MAAM,mBAAmB,CAAC,EAAE,CAAC,CAAC;IAC9B,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,uGAAuG;AACvG,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,GAAW;IACnD,MAAM,EAAE,GAAG,MAAM,sBAAsB,CAAC,GAAG,CAAC,CAAC;IAC7C,MAAM,mBAAmB,CAAC,EAAE,CAAC,CAAC;IAC9B,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -26,6 +26,8 @@ export interface RunRow {
|
|
|
26
26
|
tags: string | null;
|
|
27
27
|
search_attributes: string | null;
|
|
28
28
|
priority: number | string | null;
|
|
29
|
+
/** Nullable + optional: the column arrived in a later schema wave (multi-instance remote decisions). */
|
|
30
|
+
awaiting_decision_task_id?: string | null;
|
|
29
31
|
created_at: number | string;
|
|
30
32
|
updated_at: number | string;
|
|
31
33
|
}
|
|
@@ -55,6 +57,29 @@ export interface CheckpointRow {
|
|
|
55
57
|
last_heartbeat_at?: number | string | null;
|
|
56
58
|
heartbeat_progress?: string | null;
|
|
57
59
|
}
|
|
60
|
+
/** Where a column held text that is not JSON — see {@link parseJsonColumn}. */
|
|
61
|
+
export interface CorruptJsonColumn {
|
|
62
|
+
/** `<table>.<column>`, e.g. `durable_step_checkpoints.events`. */
|
|
63
|
+
column: string;
|
|
64
|
+
/** The row's key: a run id, `runId#seq`, a schedule id, a buffered row id. */
|
|
65
|
+
row: string;
|
|
66
|
+
/** The parse error's message. */
|
|
67
|
+
message: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Route the corrupt-column report of the Lucid store (default: one `console.warn` per row and
|
|
71
|
+
* column) — to a logger or an error tracker; the store keeps reading either way. Returns the
|
|
72
|
+
* previous reporter. Installing one resets the once-per-row memory.
|
|
73
|
+
*/
|
|
74
|
+
export declare function onCorruptJsonColumn(reporter: (info: CorruptJsonColumn) => void): (info: CorruptJsonColumn) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Parse a TEXT JSON column back to its value, treating NULL as "absent". A value that is not JSON — a
|
|
77
|
+
* MySQL `text` column cut off at 64KB before the schema used `longtext`, or a row edited by hand —
|
|
78
|
+
* reads back as `undefined` and is reported once (see {@link onCorruptJsonColumn}) instead of
|
|
79
|
+
* throwing: a throw here fails every read that touches the row, so one broken checkpoint used to take
|
|
80
|
+
* down `listRuns`, the dashboard and the run detail, not just its own field.
|
|
81
|
+
*/
|
|
82
|
+
export declare function parseJsonColumn<T>(value: string | null | undefined, column: string, row: string): T | undefined;
|
|
58
83
|
export declare function runToRow(run: WorkflowRun): RunRow;
|
|
59
84
|
/**
|
|
60
85
|
* Map a run patch to a column patch using presence (`'x' in patch`) semantics for nullable fields, so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucid-mappers.d.ts","sourceRoot":"","sources":["../../../src/stores/lucid-mappers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EAGd,WAAW,EACZ,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"lucid-mappers.d.ts","sourceRoot":"","sources":["../../../src/stores/lucid-mappers.ts"],"names":[],"mappings":"AAAA,OAAO,K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G;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAuB1E;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAqCjD;AAID,wBAAgB,eAAe,CAAC,EAAE,EAAE,cAAc,GAAG,aAAa,CAqBjE;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAmClE;AAID,oGAAoG;AACpG,wBAAgB,iBAAiB,CAAC,GAAG,EAAE;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,YAAY,CAIf"}
|
|
@@ -1,15 +1,66 @@
|
|
|
1
|
+
import { normalizeNamespace } from '../namespaces.js';
|
|
1
2
|
/** Serialize an arbitrary payload to a TEXT column, preserving the "absent" distinction as NULL. */
|
|
2
3
|
function toJson(value) {
|
|
3
4
|
if (value === undefined)
|
|
4
5
|
return null;
|
|
5
6
|
return JSON.stringify(value);
|
|
6
7
|
}
|
|
7
|
-
/**
|
|
8
|
-
|
|
8
|
+
/** Rows already reported, so a dashboard polling a broken run logs it once, not every 2 seconds. */
|
|
9
|
+
const reportedCorruptRows = new Set();
|
|
10
|
+
const REPORTED_CORRUPT_ROWS_MAX = 1_000;
|
|
11
|
+
let corruptJsonReporter = (info) => {
|
|
12
|
+
console.warn(`@adonis-agora/durable: ${info.column} of row ${info.row} is not valid JSON (${info.message}); it reads back as undefined. A MySQL \`text\` column cut off at 64KB does this: the schema check widens the column to longtext, but a value cut off before that is lost.`);
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Route the corrupt-column report of the Lucid store (default: one `console.warn` per row and
|
|
16
|
+
* column) — to a logger or an error tracker; the store keeps reading either way. Returns the
|
|
17
|
+
* previous reporter. Installing one resets the once-per-row memory.
|
|
18
|
+
*/
|
|
19
|
+
export function onCorruptJsonColumn(reporter) {
|
|
20
|
+
const previous = corruptJsonReporter;
|
|
21
|
+
corruptJsonReporter = reporter;
|
|
22
|
+
// A new sink hears about every damaged row, including ones the previous sink was told about.
|
|
23
|
+
reportedCorruptRows.clear();
|
|
24
|
+
return previous;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parse a TEXT JSON column back to its value, treating NULL as "absent". A value that is not JSON — a
|
|
28
|
+
* MySQL `text` column cut off at 64KB before the schema used `longtext`, or a row edited by hand —
|
|
29
|
+
* reads back as `undefined` and is reported once (see {@link onCorruptJsonColumn}) instead of
|
|
30
|
+
* throwing: a throw here fails every read that touches the row, so one broken checkpoint used to take
|
|
31
|
+
* down `listRuns`, the dashboard and the run detail, not just its own field.
|
|
32
|
+
*/
|
|
33
|
+
export function parseJsonColumn(value, column, row) {
|
|
9
34
|
if (value == null)
|
|
10
35
|
return undefined;
|
|
11
|
-
|
|
36
|
+
// A driver may already hand back a parsed value (a native JSON column).
|
|
37
|
+
if (typeof value !== 'string')
|
|
38
|
+
return value;
|
|
39
|
+
try {
|
|
40
|
+
return JSON.parse(value);
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
const key = `${column}\u0000${row}`;
|
|
44
|
+
if (!reportedCorruptRows.has(key)) {
|
|
45
|
+
if (reportedCorruptRows.size >= REPORTED_CORRUPT_ROWS_MAX)
|
|
46
|
+
reportedCorruptRows.clear();
|
|
47
|
+
reportedCorruptRows.add(key);
|
|
48
|
+
try {
|
|
49
|
+
corruptJsonReporter({
|
|
50
|
+
column,
|
|
51
|
+
row,
|
|
52
|
+
message: err instanceof Error ? err.message : String(err),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
/* a reporter must not break the read it reports on */
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
12
61
|
}
|
|
62
|
+
const RUNS = 'durable_workflow_runs';
|
|
63
|
+
const CHECKPOINTS = 'durable_step_checkpoints';
|
|
13
64
|
/** Coerce a possibly-stringified numeric column (some drivers return bigints as strings) to a number. */
|
|
14
65
|
function toNum(value) {
|
|
15
66
|
if (value == null)
|
|
@@ -28,9 +79,9 @@ export function runToRow(run) {
|
|
|
28
79
|
workflow: run.workflow,
|
|
29
80
|
workflow_version: run.workflowVersion,
|
|
30
81
|
status: run.status,
|
|
31
|
-
// Persist the partition, defaulting an absent one to 'default' (matches the column
|
|
32
|
-
// every row is reachable by a namespace='default' filter.
|
|
33
|
-
namespace: run.namespace
|
|
82
|
+
// Persist the partition, defaulting an absent (or '') one to 'default' (matches the column
|
|
83
|
+
// DEFAULT) so every default-pool row is reachable by a namespace='default' filter.
|
|
84
|
+
namespace: normalizeNamespace(run.namespace),
|
|
34
85
|
origin: run.origin ?? null,
|
|
35
86
|
input: toJson(run.input),
|
|
36
87
|
output: toJson(run.output),
|
|
@@ -42,6 +93,11 @@ export function runToRow(run) {
|
|
|
42
93
|
tags: toJson(run.tags),
|
|
43
94
|
search_attributes: toJson(run.searchAttributes),
|
|
44
95
|
priority: run.priority ?? null,
|
|
96
|
+
// Only when set: a fresh run never awaits a turn, and leaving the column out of the INSERT keeps
|
|
97
|
+
// run creation working on a schema that predates it (`autoSchema: false`, migrations not re-run).
|
|
98
|
+
...(run.awaitingDecisionTaskId !== undefined
|
|
99
|
+
? { awaiting_decision_task_id: run.awaitingDecisionTaskId }
|
|
100
|
+
: {}),
|
|
45
101
|
created_at: run.createdAt.getTime(),
|
|
46
102
|
updated_at: run.updatedAt.getTime(),
|
|
47
103
|
};
|
|
@@ -61,7 +117,7 @@ export function runPatchToRow(patch) {
|
|
|
61
117
|
if ('status' in patch)
|
|
62
118
|
row.status = patch.status;
|
|
63
119
|
if ('namespace' in patch)
|
|
64
|
-
row.namespace = patch.namespace
|
|
120
|
+
row.namespace = normalizeNamespace(patch.namespace);
|
|
65
121
|
if ('origin' in patch)
|
|
66
122
|
row.origin = patch.origin ?? null;
|
|
67
123
|
if ('input' in patch)
|
|
@@ -84,6 +140,9 @@ export function runPatchToRow(patch) {
|
|
|
84
140
|
row.search_attributes = toJson(patch.searchAttributes);
|
|
85
141
|
if ('priority' in patch)
|
|
86
142
|
row.priority = patch.priority ?? null;
|
|
143
|
+
if ('awaitingDecisionTaskId' in patch) {
|
|
144
|
+
row.awaiting_decision_task_id = patch.awaitingDecisionTaskId ?? null;
|
|
145
|
+
}
|
|
87
146
|
if (patch.createdAt != null)
|
|
88
147
|
row.created_at = patch.createdAt.getTime();
|
|
89
148
|
if (patch.updatedAt != null)
|
|
@@ -96,15 +155,15 @@ export function rowToRun(row) {
|
|
|
96
155
|
workflow: row.workflow,
|
|
97
156
|
workflowVersion: row.workflow_version,
|
|
98
157
|
status: row.status,
|
|
99
|
-
input:
|
|
100
|
-
namespace: row.namespace
|
|
158
|
+
input: parseJsonColumn(row.input, `${RUNS}.input`, row.id),
|
|
159
|
+
namespace: normalizeNamespace(row.namespace),
|
|
101
160
|
createdAt: new Date(toNumOr0(row.created_at)),
|
|
102
161
|
updatedAt: new Date(toNumOr0(row.updated_at)),
|
|
103
162
|
};
|
|
104
|
-
const output =
|
|
163
|
+
const output = parseJsonColumn(row.output, `${RUNS}.output`, row.id);
|
|
105
164
|
if (output !== undefined)
|
|
106
165
|
run.output = output;
|
|
107
|
-
const error =
|
|
166
|
+
const error = parseJsonColumn(row.error, `${RUNS}.error`, row.id);
|
|
108
167
|
if (error !== undefined)
|
|
109
168
|
run.error = error;
|
|
110
169
|
const wakeAt = toNum(row.wake_at);
|
|
@@ -120,15 +179,18 @@ export function rowToRun(row) {
|
|
|
120
179
|
const recoveryAttempts = toNum(row.recovery_attempts);
|
|
121
180
|
if (recoveryAttempts !== undefined)
|
|
122
181
|
run.recoveryAttempts = recoveryAttempts;
|
|
123
|
-
const tags =
|
|
182
|
+
const tags = parseJsonColumn(row.tags, `${RUNS}.tags`, row.id);
|
|
124
183
|
if (tags !== undefined)
|
|
125
184
|
run.tags = tags;
|
|
126
|
-
const searchAttributes =
|
|
185
|
+
const searchAttributes = parseJsonColumn(row.search_attributes, `${RUNS}.search_attributes`, row.id);
|
|
127
186
|
if (searchAttributes !== undefined)
|
|
128
187
|
run.searchAttributes = searchAttributes;
|
|
129
188
|
const priority = toNum(row.priority);
|
|
130
189
|
if (priority !== undefined)
|
|
131
190
|
run.priority = priority;
|
|
191
|
+
if (row.awaiting_decision_task_id != null) {
|
|
192
|
+
run.awaitingDecisionTaskId = row.awaiting_decision_task_id;
|
|
193
|
+
}
|
|
132
194
|
return run;
|
|
133
195
|
}
|
|
134
196
|
// --- checkpoints ----------------------------------------------------------
|
|
@@ -155,6 +217,7 @@ export function checkpointToRow(cp) {
|
|
|
155
217
|
};
|
|
156
218
|
}
|
|
157
219
|
export function rowToCheckpoint(row) {
|
|
220
|
+
const key = `${row.run_id}#${row.seq}`;
|
|
158
221
|
const cp = {
|
|
159
222
|
runId: row.run_id,
|
|
160
223
|
seq: toNumOr0(row.seq),
|
|
@@ -162,19 +225,19 @@ export function rowToCheckpoint(row) {
|
|
|
162
225
|
kind: row.kind,
|
|
163
226
|
stepId: row.step_id,
|
|
164
227
|
status: row.status,
|
|
165
|
-
input:
|
|
228
|
+
input: parseJsonColumn(row.input, `${CHECKPOINTS}.input`, key),
|
|
166
229
|
attempts: toNumOr0(row.attempts),
|
|
167
230
|
enqueuedAt: new Date(toNum(row.enqueued_at) ?? toNumOr0(row.started_at)),
|
|
168
231
|
startedAt: new Date(toNumOr0(row.started_at)),
|
|
169
232
|
finishedAt: new Date(toNumOr0(row.finished_at)),
|
|
170
233
|
};
|
|
171
|
-
const output =
|
|
234
|
+
const output = parseJsonColumn(row.output, `${CHECKPOINTS}.output`, key);
|
|
172
235
|
if (output !== undefined)
|
|
173
236
|
cp.output = output;
|
|
174
|
-
const error =
|
|
237
|
+
const error = parseJsonColumn(row.error, `${CHECKPOINTS}.error`, key);
|
|
175
238
|
if (error !== undefined)
|
|
176
239
|
cp.error = error;
|
|
177
|
-
const events =
|
|
240
|
+
const events = parseJsonColumn(row.events, `${CHECKPOINTS}.events`, key);
|
|
178
241
|
if (events !== undefined)
|
|
179
242
|
cp.events = events;
|
|
180
243
|
if (row.worker_group != null)
|
|
@@ -189,7 +252,7 @@ export function rowToCheckpoint(row) {
|
|
|
189
252
|
const lastHeartbeatAt = toNum(row.last_heartbeat_at);
|
|
190
253
|
if (lastHeartbeatAt !== undefined)
|
|
191
254
|
cp.lastHeartbeatAt = new Date(lastHeartbeatAt);
|
|
192
|
-
const heartbeatProgress =
|
|
255
|
+
const heartbeatProgress = parseJsonColumn(row.heartbeat_progress, `${CHECKPOINTS}.heartbeat_progress`, key);
|
|
193
256
|
if (heartbeatProgress !== undefined)
|
|
194
257
|
cp.heartbeatProgress = heartbeatProgress;
|
|
195
258
|
return cp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucid-mappers.js","sourceRoot":"","sources":["../../../src/stores/lucid-mappers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lucid-mappers.js","sourceRoot":"","sources":["../../../src/stores/lucid-mappers.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA8DtD,oGAAoG;AACpG,SAAS,MAAM,CAAC,KAAc;IAC5B,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAYD,oGAAoG;AACpG,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAU,CAAC;AAC9C,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAExC,IAAI,mBAAmB,GAAsC,CAAC,IAAI,EAAE,EAAE;IACpE,OAAO,CAAC,IAAI,CACV,0BAA0B,IAAI,CAAC,MAAM,WAAW,IAAI,CAAC,GAAG,uBAAuB,IAAI,CAAC,OAAO,4K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iBAAiB,CAAC,CAAC;IACrD,IAAI,eAAe,KAAK,SAAS;QAAE,EAAE,CAAC,eAAe,GAAG,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC;IAClF,MAAM,iBAAiB,GAAG,eAAe,CACvC,GAAG,CAAC,kBAAkB,EACtB,GAAG,WAAW,qBAAqB,EACnC,GAAG,CACJ,CAAC;IACF,IAAI,iBAAiB,KAAK,SAAS;QAAE,EAAE,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC9E,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,6EAA6E;AAE7E,oGAAoG;AACpG,MAAM,UAAU,iBAAiB,CAAC,GAKjC;IACC,MAAM,MAAM,GAAiB,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;IAC7F,IAAI,GAAG,CAAC,cAAc,IAAI,IAAI;QAAE,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAClF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Database } from '@adonisjs/lucid/database';
|
|
2
|
+
import type { QueryClientContract } from '@adonisjs/lucid/types/database';
|
|
2
3
|
/**
|
|
3
4
|
* The canonical durable table names. They match the cross-adapter snake_case contract the other
|
|
4
5
|
* Agora/aviary stores use (Drizzle is the reference), so a dashboard or migration can be pointed at
|
|
@@ -24,13 +25,61 @@ export interface DurableSchemaLogger {
|
|
|
24
25
|
export interface CreateDurableTablesOptions {
|
|
25
26
|
/** Sink for the applied-repair warning. Defaults to `console`. */
|
|
26
27
|
logger?: DurableSchemaLogger;
|
|
28
|
+
/**
|
|
29
|
+
* MySQL/MariaDB only: the collation the durable tables must use (e.g. `'utf8mb4_unicode_ci'`).
|
|
30
|
+
* New tables are created with it, and an existing durable table whose collation differs is
|
|
31
|
+
* `CONVERT`ed to it. Set it to the collation your own tables use: a JOIN between a durable table and
|
|
32
|
+
* an app table with a different collation fails with `Illegal mix of collations`. Defaults to the
|
|
33
|
+
* Knex connection's `collate` setting when it has one; with neither, the server default is left
|
|
34
|
+
* alone. Ignored on Postgres and SQLite.
|
|
35
|
+
*/
|
|
36
|
+
collation?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Run the full check even when the stored schema fingerprint says the tables are current (see
|
|
39
|
+
* {@link DURABLE_SCHEMA_META_TABLE}). For a database whose durable tables were changed by hand.
|
|
40
|
+
*/
|
|
41
|
+
force?: boolean;
|
|
27
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* The table where {@link createDurableTables} records which schema it last applied: one row
|
|
45
|
+
* (`id = 'durable'`) holding a fingerprint of {@link DURABLE_SCHEMA_REVISION} and the options that
|
|
46
|
+
* shape the DDL. When the row matches, a boot reads that row and returns without probing a single
|
|
47
|
+
* table, column or index. A missing or different row runs the full, additive check under a
|
|
48
|
+
* cross-process lock, then rewrites the row. Dropped by {@link dropDurableTables}.
|
|
49
|
+
*/
|
|
50
|
+
export declare const DURABLE_SCHEMA_META_TABLE = "durable_schema_meta";
|
|
51
|
+
/**
|
|
52
|
+
* The revision of the DDL in this file. Bump it with every change to what {@link createDurableTables}
|
|
53
|
+
* creates or repairs: the new value changes the fingerprint, so every database runs the full check
|
|
54
|
+
* once on its next boot and then goes back to the one-row read. A test pins the SQLite DDL to this
|
|
55
|
+
* number, so a schema change without a bump fails CI.
|
|
56
|
+
*/
|
|
57
|
+
export declare const DURABLE_SCHEMA_REVISION = 3;
|
|
58
|
+
/**
|
|
59
|
+
* The columns that hold free-form JSON payloads. They are `longtext` on MySQL, where `text` stops at
|
|
60
|
+
* 64KB and a longer value is cut off (strict mode rejects the write; non-strict silently truncates
|
|
61
|
+
* it, and the row then fails to parse on read). Postgres and SQLite `text` has no such limit.
|
|
62
|
+
* `notNull` lists the ones declared `NOT NULL`, which a MySQL `MODIFY` must restate.
|
|
63
|
+
*/
|
|
64
|
+
export declare const DURABLE_JSON_COLUMNS: Record<string, {
|
|
65
|
+
columns: string[];
|
|
66
|
+
notNull?: string[];
|
|
67
|
+
}>;
|
|
28
68
|
/**
|
|
29
69
|
* Idempotent DDL for the durable tables, expressed via Lucid's schema builder (Knex). Works across
|
|
30
70
|
* SQLite / Postgres / MySQL. Timestamps and `wake_at` are stored as epoch-ms `bigInteger` columns so
|
|
31
71
|
* the store never depends on a native date type and replay is exact across engines. JSON payloads
|
|
32
|
-
* (`input`/`output`/`error`/`events`/`tags`/`search_attributes`) are stored as
|
|
72
|
+
* (`input`/`output`/`error`/`events`/`tags`/`search_attributes`) are stored as text and (de)serialized
|
|
33
73
|
* by the store, so the schema is portable (SQLite has no JSON column type; Postgres/MySQL accept text).
|
|
74
|
+
* On MySQL those columns are `longtext` (see {@link DURABLE_JSON_COLUMNS}); an existing `text` one is
|
|
75
|
+
* widened in place.
|
|
76
|
+
*
|
|
77
|
+
* Boots are cheap once the schema is current: the call reads one row of
|
|
78
|
+
* {@link DURABLE_SCHEMA_META_TABLE} and returns when its fingerprint matches. Otherwise it checks
|
|
79
|
+
* every table, column and index under a cross-process lock (Postgres advisory lock, MySQL
|
|
80
|
+
* `GET_LOCK`), so pods booting together against a fresh database don't race the same `CREATE TABLE`,
|
|
81
|
+
* and records the fingerprint. A schema changed by hand behind the marker is not re-checked; pass
|
|
82
|
+
* `{ force: true }` for that.
|
|
34
83
|
*
|
|
35
84
|
* Call this on boot (e.g. from a `StateStore.ensureSchema`) or once at deploy time. For an AdonisJS app
|
|
36
85
|
* prefer the published migration (`node ace configure @adonis-agora/durable`); this helper is for standalone
|
|
@@ -46,6 +95,15 @@ export interface CreateDurableTablesOptions {
|
|
|
46
95
|
* repair. Pass `options.logger` to route it; it defaults to `console`.
|
|
47
96
|
*/
|
|
48
97
|
export declare function createDurableTables(db: Database, connectionName?: string, options?: CreateDurableTablesOptions): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* MySQL: `MODIFY` to `longtext` every column of `spec` that exists and isn't `longtext` yet, one
|
|
100
|
+
* `ALTER` per table. Shared by the store schema and the db transport's (`createDurableTransportTables`).
|
|
101
|
+
* Returns the columns it changed.
|
|
102
|
+
*/
|
|
103
|
+
export declare function widenMysqlLongtextColumns(client: QueryClientContract, spec: Record<string, {
|
|
104
|
+
columns: string[];
|
|
105
|
+
notNull?: string[];
|
|
106
|
+
}>): Promise<string[]>;
|
|
49
107
|
/** Drop every durable table (reverse FK order). Used by tests and migration `down`. */
|
|
50
108
|
export declare function dropDurableTables(db: Database, connectionName?: string): Promise<void>;
|
|
51
109
|
//# sourceMappingURL=lucid-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucid-schema.d.ts","sourceRoot":"","sources":["../../../src/stores/lucid-schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lucid-schema.d.ts","sourceRoot":"","sources":["../../../src/stores/lucid-schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,cAAc;aACzB,IAAI,EAAE,uBAAuB;aAC7B,WAAW,EAAE,0BAA0B;aACvC,UAAU,EAAE,wBAAwB;aACpC,aAAa,EAAE,wBAAwB;aACvC,eAAe,EAAE,0BAA0B;aAC3C,cAAc,EAAE,yBAAyB;aACzC,SAAS,EAAE,mBAAmB;CACtB,CAAC;AAEX;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,0BAA0B;IACzC,kEAAkE;IAClE,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACn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