@shware/workflow 4.1.1 → 5.0.1
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/README.md +16 -38
- package/dist/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/apns-relay.cjs +1 -2
- package/dist/apns-relay.d.cts +0 -2
- package/dist/apns-relay.d.cts.map +1 -1
- package/dist/apns-relay.d.mts +0 -2
- package/dist/apns-relay.d.mts.map +1 -1
- package/dist/apns-relay.mjs +1 -2
- package/dist/apns.cjs +1 -2
- package/dist/apns.d.cts +0 -2
- package/dist/apns.d.cts.map +1 -1
- package/dist/apns.d.mts +0 -2
- package/dist/apns.d.mts.map +1 -1
- package/dist/apns.mjs +1 -2
- package/dist/aws/engine-step.cjs +1 -2
- package/dist/aws/engine-step.d.cts +0 -2
- package/dist/aws/engine-step.d.cts.map +1 -1
- package/dist/aws/engine-step.d.mts +0 -2
- package/dist/aws/engine-step.d.mts.map +1 -1
- package/dist/aws/engine-step.mjs +1 -2
- package/dist/aws/function-url.cjs +1 -2
- package/dist/aws/function-url.d.cts +0 -2
- package/dist/aws/function-url.d.cts.map +1 -1
- package/dist/aws/function-url.d.mts +0 -2
- package/dist/aws/function-url.d.mts.map +1 -1
- package/dist/aws/function-url.mjs +1 -2
- package/dist/aws/index.cjs +3 -5
- package/dist/aws/index.cjs.map +1 -1
- package/dist/aws/index.d.cts +1 -3
- package/dist/aws/index.d.cts.map +1 -1
- package/dist/aws/index.d.mts +1 -3
- package/dist/aws/index.d.mts.map +1 -1
- package/dist/aws/index.mjs +3 -5
- package/dist/aws/index.mjs.map +1 -1
- package/dist/aws/instances.cjs +2 -3
- package/dist/aws/instances.cjs.map +1 -1
- package/dist/aws/instances.d.cts +1 -3
- package/dist/aws/instances.d.cts.map +1 -1
- package/dist/aws/instances.d.mts +1 -3
- package/dist/aws/instances.d.mts.map +1 -1
- package/dist/aws/instances.mjs +2 -3
- package/dist/aws/instances.mjs.map +1 -1
- package/dist/aws/lambda-api.cjs +1 -2
- package/dist/aws/lambda-api.d.cts +0 -2
- package/dist/aws/lambda-api.d.cts.map +1 -1
- package/dist/aws/lambda-api.d.mts +0 -2
- package/dist/aws/lambda-api.d.mts.map +1 -1
- package/dist/aws/lambda-api.mjs +1 -2
- package/dist/client.cjs +1 -2
- package/dist/client.d.cts +0 -2
- package/dist/client.d.cts.map +1 -1
- package/dist/client.d.mts +0 -2
- package/dist/client.d.mts.map +1 -1
- package/dist/client.mjs +1 -2
- package/dist/cloudflare/bindings.cjs +1 -2
- package/dist/cloudflare/bindings.cjs.map +1 -1
- package/dist/cloudflare/bindings.d.cts +0 -21
- package/dist/cloudflare/bindings.d.cts.map +1 -1
- package/dist/cloudflare/bindings.d.mts +0 -21
- package/dist/cloudflare/bindings.d.mts.map +1 -1
- package/dist/cloudflare/bindings.mjs +1 -2
- package/dist/cloudflare/bindings.mjs.map +1 -1
- package/dist/cloudflare/index.cjs +0 -5
- package/dist/cloudflare/index.d.cts +4 -6
- package/dist/cloudflare/index.d.mts +4 -6
- package/dist/cloudflare/index.mjs +2 -4
- package/dist/cloudflare/runner.cjs +4 -6
- package/dist/cloudflare/runner.cjs.map +1 -1
- package/dist/cloudflare/runner.d.cts +3 -5
- package/dist/cloudflare/runner.d.cts.map +1 -1
- package/dist/cloudflare/runner.d.mts +3 -5
- package/dist/cloudflare/runner.d.mts.map +1 -1
- package/dist/cloudflare/runner.mjs +4 -6
- package/dist/cloudflare/runner.mjs.map +1 -1
- package/dist/cloudflare/worker.cjs +1 -2
- package/dist/cloudflare/worker.d.cts +0 -2
- package/dist/cloudflare/worker.d.cts.map +1 -1
- package/dist/cloudflare/worker.d.mts +0 -2
- package/dist/cloudflare/worker.d.mts.map +1 -1
- package/dist/cloudflare/worker.mjs +1 -2
- package/dist/cloudflare/workers.d.cts +0 -2
- package/dist/cloudflare/workers.d.cts.map +1 -1
- package/dist/cloudflare/workers.d.mts +0 -2
- package/dist/cloudflare/workers.d.mts.map +1 -1
- package/dist/config.cjs +1 -2
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +1 -3
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +1 -3
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +1 -2
- package/dist/config.mjs.map +1 -1
- package/dist/contract.cjs +1 -2
- package/dist/contract.d.cts +0 -2
- package/dist/contract.d.cts.map +1 -1
- package/dist/contract.d.mts +0 -2
- package/dist/contract.d.mts.map +1 -1
- package/dist/contract.mjs +1 -2
- package/dist/dsl/action.cjs +1 -2
- package/dist/dsl/action.d.cts +0 -2
- package/dist/dsl/action.d.cts.map +1 -1
- package/dist/dsl/action.d.mts +0 -2
- package/dist/dsl/action.d.mts.map +1 -1
- package/dist/dsl/action.mjs +1 -2
- package/dist/dsl/base.cjs +1 -2
- package/dist/dsl/base.d.cts +0 -2
- package/dist/dsl/base.d.cts.map +1 -1
- package/dist/dsl/base.d.mts +0 -2
- package/dist/dsl/base.d.mts.map +1 -1
- package/dist/dsl/base.mjs +1 -2
- package/dist/dsl/bundle.cjs +1 -2
- package/dist/dsl/bundle.d.cts +0 -2
- package/dist/dsl/bundle.d.cts.map +1 -1
- package/dist/dsl/bundle.d.mts +0 -2
- package/dist/dsl/bundle.d.mts.map +1 -1
- package/dist/dsl/bundle.mjs +1 -2
- package/dist/dsl/condition.cjs +1 -2
- package/dist/dsl/condition.d.cts +0 -2
- package/dist/dsl/condition.d.cts.map +1 -1
- package/dist/dsl/condition.d.mts +0 -2
- package/dist/dsl/condition.d.mts.map +1 -1
- package/dist/dsl/condition.mjs +1 -2
- package/dist/dsl/flow.cjs +1 -2
- package/dist/dsl/flow.d.cts +0 -2
- package/dist/dsl/flow.d.cts.map +1 -1
- package/dist/dsl/flow.d.mts +0 -2
- package/dist/dsl/flow.d.mts.map +1 -1
- package/dist/dsl/flow.mjs +1 -2
- package/dist/dsl/refs.cjs +1 -2
- package/dist/dsl/refs.d.cts +0 -2
- package/dist/dsl/refs.d.cts.map +1 -1
- package/dist/dsl/refs.d.mts +0 -2
- package/dist/dsl/refs.d.mts.map +1 -1
- package/dist/dsl/refs.mjs +1 -2
- package/dist/dsl/template.cjs +1 -2
- package/dist/dsl/template.d.cts +0 -2
- package/dist/dsl/template.d.cts.map +1 -1
- package/dist/dsl/template.d.mts +0 -2
- package/dist/dsl/template.d.mts.map +1 -1
- package/dist/dsl/template.mjs +1 -2
- package/dist/dsl/trigger.cjs +1 -2
- package/dist/dsl/trigger.d.cts +0 -2
- package/dist/dsl/trigger.d.cts.map +1 -1
- package/dist/dsl/trigger.d.mts +0 -2
- package/dist/dsl/trigger.d.mts.map +1 -1
- package/dist/dsl/trigger.mjs +1 -2
- package/dist/dsl/workflow.cjs +1 -2
- package/dist/dsl/workflow.d.cts +0 -2
- package/dist/dsl/workflow.d.cts.map +1 -1
- package/dist/dsl/workflow.d.mts +0 -2
- package/dist/dsl/workflow.d.mts.map +1 -1
- package/dist/dsl/workflow.mjs +1 -2
- package/dist/email-context.cjs +1 -2
- package/dist/email-context.d.cts +0 -2
- package/dist/email-context.d.cts.map +1 -1
- package/dist/email-context.d.mts +0 -2
- package/dist/email-context.d.mts.map +1 -1
- package/dist/email-context.mjs +1 -2
- package/dist/email-sender.cjs +1 -2
- package/dist/email-sender.d.cts +0 -2
- package/dist/email-sender.d.cts.map +1 -1
- package/dist/email-sender.d.mts +0 -2
- package/dist/email-sender.d.mts.map +1 -1
- package/dist/email-sender.mjs +1 -2
- package/dist/email.cjs +1 -2
- package/dist/email.d.cts +0 -2
- package/dist/email.d.cts.map +1 -1
- package/dist/email.d.mts +0 -2
- package/dist/email.d.mts.map +1 -1
- package/dist/email.mjs +1 -2
- package/dist/engine/actions.cjs +1 -2
- package/dist/engine/actions.d.cts +0 -2
- package/dist/engine/actions.d.cts.map +1 -1
- package/dist/engine/actions.d.mts +0 -2
- package/dist/engine/actions.d.mts.map +1 -1
- package/dist/engine/actions.mjs +1 -2
- package/dist/engine/bucket.cjs +1 -2
- package/dist/engine/bucket.d.cts +0 -2
- package/dist/engine/bucket.d.cts.map +1 -1
- package/dist/engine/bucket.d.mts +0 -2
- package/dist/engine/bucket.d.mts.map +1 -1
- package/dist/engine/bucket.mjs +1 -2
- package/dist/engine/condition.cjs +3 -4
- package/dist/engine/condition.cjs.map +1 -1
- package/dist/engine/condition.d.cts +1 -3
- package/dist/engine/condition.d.cts.map +1 -1
- package/dist/engine/condition.d.mts +1 -3
- package/dist/engine/condition.d.mts.map +1 -1
- package/dist/engine/condition.mjs +3 -4
- package/dist/engine/condition.mjs.map +1 -1
- package/dist/engine/duration.cjs +1 -2
- package/dist/engine/duration.d.cts +0 -2
- package/dist/engine/duration.d.cts.map +1 -1
- package/dist/engine/duration.d.mts +0 -2
- package/dist/engine/duration.d.mts.map +1 -1
- package/dist/engine/duration.mjs +1 -2
- package/dist/engine/interpreter.cjs +1 -2
- package/dist/engine/interpreter.d.cts +0 -2
- package/dist/engine/interpreter.d.cts.map +1 -1
- package/dist/engine/interpreter.d.mts +0 -2
- package/dist/engine/interpreter.d.mts.map +1 -1
- package/dist/engine/interpreter.mjs +1 -2
- package/dist/engine/ports.d.cts +1 -3
- package/dist/engine/ports.d.cts.map +1 -1
- package/dist/engine/ports.d.mts +1 -3
- package/dist/engine/ports.d.mts.map +1 -1
- package/dist/engine/recipient.cjs +1 -2
- package/dist/engine/recipient.d.cts +0 -2
- package/dist/engine/recipient.d.cts.map +1 -1
- package/dist/engine/recipient.d.mts +0 -2
- package/dist/engine/recipient.d.mts.map +1 -1
- package/dist/engine/recipient.mjs +1 -2
- package/dist/engine/retry.cjs +1 -2
- package/dist/engine/retry.d.cts +0 -2
- package/dist/engine/retry.d.cts.map +1 -1
- package/dist/engine/retry.d.mts +0 -2
- package/dist/engine/retry.d.mts.map +1 -1
- package/dist/engine/retry.mjs +1 -2
- package/dist/engine/time-scale.cjs +1 -2
- package/dist/engine/time-scale.d.cts +0 -2
- package/dist/engine/time-scale.d.cts.map +1 -1
- package/dist/engine/time-scale.d.mts +0 -2
- package/dist/engine/time-scale.d.mts.map +1 -1
- package/dist/engine/time-scale.mjs +1 -2
- package/dist/engine/time-window.cjs +1 -2
- package/dist/engine/time-window.d.cts +0 -2
- package/dist/engine/time-window.d.cts.map +1 -1
- package/dist/engine/time-window.d.mts +0 -2
- package/dist/engine/time-window.d.mts.map +1 -1
- package/dist/engine/time-window.mjs +1 -2
- package/dist/fcm.cjs +1 -2
- package/dist/fcm.d.cts +0 -2
- package/dist/fcm.d.cts.map +1 -1
- package/dist/fcm.d.mts +0 -2
- package/dist/fcm.d.mts.map +1 -1
- package/dist/fcm.mjs +1 -2
- package/dist/hash.cjs +1 -2
- package/dist/hash.d.cts +0 -2
- package/dist/hash.d.cts.map +1 -1
- package/dist/hash.d.mts +0 -2
- package/dist/hash.d.mts.map +1 -1
- package/dist/hash.mjs +1 -2
- package/dist/host/auth.cjs +1 -2
- package/dist/host/auth.d.cts +0 -2
- package/dist/host/auth.d.cts.map +1 -1
- package/dist/host/auth.d.mts +0 -2
- package/dist/host/auth.d.mts.map +1 -1
- package/dist/host/auth.mjs +1 -2
- package/dist/host/channels.cjs +1 -2
- package/dist/host/channels.d.cts +1 -3
- package/dist/host/channels.d.cts.map +1 -1
- package/dist/host/channels.d.mts +1 -3
- package/dist/host/channels.d.mts.map +1 -1
- package/dist/host/channels.mjs +1 -2
- package/dist/host/execute.cjs +1 -2
- package/dist/host/execute.d.cts +1 -3
- package/dist/host/execute.d.cts.map +1 -1
- package/dist/host/execute.d.mts +1 -3
- package/dist/host/execute.d.mts.map +1 -1
- package/dist/host/execute.mjs +1 -2
- package/dist/host/fresh-read.cjs +1 -2
- package/dist/host/fresh-read.d.cts +0 -2
- package/dist/host/fresh-read.d.cts.map +1 -1
- package/dist/host/fresh-read.d.mts +0 -2
- package/dist/host/fresh-read.d.mts.map +1 -1
- package/dist/host/fresh-read.mjs +1 -2
- package/dist/host/http.cjs +4 -6
- package/dist/host/http.cjs.map +1 -1
- package/dist/host/http.d.cts +2 -4
- package/dist/host/http.d.cts.map +1 -1
- package/dist/host/http.d.mts +2 -4
- package/dist/host/http.d.mts.map +1 -1
- package/dist/host/http.mjs +4 -6
- package/dist/host/http.mjs.map +1 -1
- package/dist/host/ingest.cjs +12 -24
- package/dist/host/ingest.cjs.map +1 -1
- package/dist/host/ingest.d.cts +8 -15
- package/dist/host/ingest.d.cts.map +1 -1
- package/dist/host/ingest.d.mts +8 -15
- package/dist/host/ingest.d.mts.map +1 -1
- package/dist/host/ingest.mjs +13 -24
- package/dist/host/ingest.mjs.map +1 -1
- package/dist/host/journey-host.cjs +3 -6
- package/dist/host/journey-host.cjs.map +1 -1
- package/dist/host/journey-host.d.cts +6 -8
- package/dist/host/journey-host.d.cts.map +1 -1
- package/dist/host/journey-host.d.mts +6 -8
- package/dist/host/journey-host.d.mts.map +1 -1
- package/dist/host/journey-host.mjs +3 -6
- package/dist/host/journey-host.mjs.map +1 -1
- package/dist/host/platform.cjs +1 -2
- package/dist/host/platform.cjs.map +1 -1
- package/dist/host/platform.d.cts +1 -9
- package/dist/host/platform.d.cts.map +1 -1
- package/dist/host/platform.d.mts +1 -9
- package/dist/host/platform.d.mts.map +1 -1
- package/dist/host/platform.mjs +1 -2
- package/dist/host/platform.mjs.map +1 -1
- package/dist/host/senders.cjs +1 -2
- package/dist/host/senders.d.cts +0 -2
- package/dist/host/senders.d.cts.map +1 -1
- package/dist/host/senders.d.mts +0 -2
- package/dist/host/senders.d.mts.map +1 -1
- package/dist/host/senders.mjs +1 -2
- package/dist/http2-client.cjs +1 -2
- package/dist/http2-client.d.cts +0 -2
- package/dist/http2-client.d.cts.map +1 -1
- package/dist/http2-client.d.mts +0 -2
- package/dist/http2-client.d.mts.map +1 -1
- package/dist/http2-client.mjs +1 -2
- package/dist/ir.cjs +1 -2
- package/dist/ir.d.cts +0 -2
- package/dist/ir.d.cts.map +1 -1
- package/dist/ir.d.mts +0 -2
- package/dist/ir.d.mts.map +1 -1
- package/dist/ir.mjs +1 -2
- package/dist/jwt.cjs +1 -2
- package/dist/jwt.d.cts +0 -2
- package/dist/jwt.d.cts.map +1 -1
- package/dist/jwt.d.mts +0 -2
- package/dist/jwt.d.mts.map +1 -1
- package/dist/jwt.mjs +1 -2
- package/dist/plan.cjs +1 -2
- package/dist/plan.d.cts +0 -2
- package/dist/plan.d.cts.map +1 -1
- package/dist/plan.d.mts +0 -2
- package/dist/plan.d.mts.map +1 -1
- package/dist/plan.mjs +1 -2
- package/dist/postgres-js.cjs +1 -2
- package/dist/postgres-js.d.cts +0 -2
- package/dist/postgres-js.d.cts.map +1 -1
- package/dist/postgres-js.d.mts +0 -2
- package/dist/postgres-js.d.mts.map +1 -1
- package/dist/postgres-js.mjs +1 -2
- package/dist/provenance.cjs +1 -2
- package/dist/provenance.d.cts +0 -2
- package/dist/provenance.d.cts.map +1 -1
- package/dist/provenance.d.mts +0 -2
- package/dist/provenance.d.mts.map +1 -1
- package/dist/provenance.mjs +1 -2
- package/dist/push.cjs +1 -2
- package/dist/push.d.cts +0 -2
- package/dist/push.d.cts.map +1 -1
- package/dist/push.d.mts +0 -2
- package/dist/push.d.mts.map +1 -1
- package/dist/push.mjs +1 -2
- package/dist/react-email.cjs +1 -2
- package/dist/react-email.d.cts +0 -2
- package/dist/react-email.d.cts.map +1 -1
- package/dist/react-email.d.mts +0 -2
- package/dist/react-email.d.mts.map +1 -1
- package/dist/react-email.mjs +1 -2
- package/dist/reporting/classify.cjs +1 -2
- package/dist/reporting/classify.d.cts +0 -2
- package/dist/reporting/classify.d.cts.map +1 -1
- package/dist/reporting/classify.d.mts +0 -2
- package/dist/reporting/classify.d.mts.map +1 -1
- package/dist/reporting/classify.mjs +1 -2
- package/dist/reporting/observer.cjs +1 -2
- package/dist/reporting/observer.d.cts +0 -2
- package/dist/reporting/observer.d.cts.map +1 -1
- package/dist/reporting/observer.d.mts +0 -2
- package/dist/reporting/observer.d.mts.map +1 -1
- package/dist/reporting/observer.mjs +1 -2
- package/dist/reporting/tracking.cjs +1 -2
- package/dist/reporting/tracking.d.cts +0 -2
- package/dist/reporting/tracking.d.cts.map +1 -1
- package/dist/reporting/tracking.d.mts +0 -2
- package/dist/reporting/tracking.d.mts.map +1 -1
- package/dist/reporting/tracking.mjs +1 -2
- package/dist/runtime.cjs +1 -2
- package/dist/runtime.d.cts +0 -2
- package/dist/runtime.d.cts.map +1 -1
- package/dist/runtime.d.mts +0 -2
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +1 -2
- package/dist/store/erasure.cjs +1 -2
- package/dist/store/erasure.d.cts +0 -2
- package/dist/store/erasure.d.cts.map +1 -1
- package/dist/store/erasure.d.mts +0 -2
- package/dist/store/erasure.d.mts.map +1 -1
- package/dist/store/erasure.mjs +1 -2
- package/dist/store/facts.cjs +2 -3
- package/dist/store/facts.cjs.map +1 -1
- package/dist/store/facts.d.cts +0 -2
- package/dist/store/facts.d.cts.map +1 -1
- package/dist/store/facts.d.mts +0 -2
- package/dist/store/facts.d.mts.map +1 -1
- package/dist/store/facts.mjs +2 -3
- package/dist/store/facts.mjs.map +1 -1
- package/dist/store/index.cjs +1 -4
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.cts +21 -28
- package/dist/store/index.d.cts.map +1 -1
- package/dist/store/index.d.mts +21 -28
- package/dist/store/index.d.mts.map +1 -1
- package/dist/store/index.mjs +2 -4
- package/dist/store/index.mjs.map +1 -1
- package/dist/store/postgres-reporting.cjs +1 -2
- package/dist/store/postgres-reporting.d.cts +0 -2
- package/dist/store/postgres-reporting.d.cts.map +1 -1
- package/dist/store/postgres-reporting.d.mts +0 -2
- package/dist/store/postgres-reporting.d.mts.map +1 -1
- package/dist/store/postgres-reporting.mjs +1 -2
- package/dist/store/postgres.cjs +3 -5
- package/dist/store/postgres.cjs.map +1 -1
- package/dist/store/postgres.d.cts +2 -5
- package/dist/store/postgres.d.cts.map +1 -1
- package/dist/store/postgres.d.mts +2 -5
- package/dist/store/postgres.d.mts.map +1 -1
- package/dist/store/postgres.mjs +3 -5
- package/dist/store/postgres.mjs.map +1 -1
- package/dist/store/sql.cjs +1 -2
- package/dist/store/sql.d.cts +0 -2
- package/dist/store/sql.d.cts.map +1 -1
- package/dist/store/sql.d.mts +0 -2
- package/dist/store/sql.d.mts.map +1 -1
- package/dist/store/sql.mjs +1 -2
- package/dist/store/tables.cjs +1 -2
- package/dist/store/tables.d.cts +0 -2
- package/dist/store/tables.d.cts.map +1 -1
- package/dist/store/tables.d.mts +0 -2
- package/dist/store/tables.d.mts.map +1 -1
- package/dist/store/tables.mjs +1 -2
- package/dist/store/user-lock.cjs +1 -2
- package/dist/store/user-lock.d.cts +0 -2
- package/dist/store/user-lock.d.cts.map +1 -1
- package/dist/store/user-lock.d.mts +0 -2
- package/dist/store/user-lock.d.mts.map +1 -1
- package/dist/store/user-lock.mjs +1 -2
- package/dist/templates.cjs +1 -2
- package/dist/templates.d.cts +0 -2
- package/dist/templates.d.cts.map +1 -1
- package/dist/templates.d.mts +0 -2
- package/dist/templates.d.mts.map +1 -1
- package/dist/templates.mjs +1 -2
- package/dist/transports/cloudflare-email.cjs +1 -2
- package/dist/transports/cloudflare-email.d.cts +1 -3
- package/dist/transports/cloudflare-email.d.cts.map +1 -1
- package/dist/transports/cloudflare-email.d.mts +1 -3
- package/dist/transports/cloudflare-email.d.mts.map +1 -1
- package/dist/transports/cloudflare-email.mjs +1 -2
- package/dist/transports/ses.cjs +1 -2
- package/dist/transports/ses.d.cts +0 -2
- package/dist/transports/ses.d.cts.map +1 -1
- package/dist/transports/ses.d.mts +0 -2
- package/dist/transports/ses.d.mts.map +1 -1
- package/dist/transports/ses.mjs +1 -2
- package/dist/transports/sigv4.cjs +1 -2
- package/dist/transports/sigv4.d.cts +0 -2
- package/dist/transports/sigv4.d.cts.map +1 -1
- package/dist/transports/sigv4.d.mts +0 -2
- package/dist/transports/sigv4.d.mts.map +1 -1
- package/dist/transports/sigv4.mjs +1 -2
- package/dist/webhooks.cjs +1 -2
- package/dist/webhooks.d.cts +0 -2
- package/dist/webhooks.d.cts.map +1 -1
- package/dist/webhooks.d.mts +0 -2
- package/dist/webhooks.d.mts.map +1 -1
- package/dist/webhooks.mjs +1 -2
- package/dist/webpush.cjs +1 -2
- package/dist/webpush.d.cts +0 -2
- package/dist/webpush.d.cts.map +1 -1
- package/dist/webpush.d.mts +0 -2
- package/dist/webpush.d.mts.map +1 -1
- package/dist/webpush.mjs +1 -2
- package/package.json +5 -7
- package/dist/cloudflare/d1-env.cjs +0 -17
- package/dist/cloudflare/d1-env.cjs.map +0 -1
- package/dist/cloudflare/d1-env.d.cts +0 -12
- package/dist/cloudflare/d1-env.d.cts.map +0 -1
- package/dist/cloudflare/d1-env.d.mts +0 -12
- package/dist/cloudflare/d1-env.d.mts.map +0 -1
- package/dist/cloudflare/d1-env.mjs +0 -16
- package/dist/cloudflare/d1-env.mjs.map +0 -1
- package/dist/cloudflare/schema.sql +0 -148
- package/dist/store/d1.cjs +0 -245
- package/dist/store/d1.cjs.map +0 -1
- package/dist/store/d1.d.cts +0 -73
- package/dist/store/d1.d.cts.map +0 -1
- package/dist/store/d1.d.mts +0 -73
- package/dist/store/d1.d.mts.map +0 -1
- package/dist/store/d1.mjs +0 -244
- package/dist/store/d1.mjs.map +0 -1
- package/src/cloudflare/schema.sql +0 -148
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-host.mjs","names":[],"sources":["../../src/host/journey-host.ts"],"sourcesContent":["import * as z from 'zod/mini';\nimport type * as core from 'zod/v4/core';\nimport { d1Store } from '../cloudflare/d1-env';\nimport { type JourneyConfig, compileConfig } from '../config';\nimport { type Contract, ContractValidationError, checkEvent } from '../contract';\nimport { assertEmailConfig } from '../email';\nimport type { EmailTransport } from '../email-sender';\nimport { RegistryActionInvoker } from '../engine/actions';\nimport { profileUpdatedEvent } from '../engine/condition';\nimport type { JourneyObserver, MessageSender } from '../engine/ports';\nimport { RECIPIENT_PROPERTY } from '../engine/recipient';\nimport { scaleSegmentWindows } from '../engine/time-scale';\nimport type { BundleIR, NodeIR } from '../ir';\nimport { registryRenderer } from '../react-email';\nimport { reportingObserver } from '../reporting/observer';\nimport type { TrackingOptions } from '../reporting/tracking';\nimport type { JourneyRuntimeOptions } from '../runtime';\nimport type { BundleVersion, JourneyStore, StoreLease } from '../store/index';\nimport { DEFAULT_SCHEMA } from '../store/tables';\nimport { indexTemplates, registryValidator } from '../templates';\nimport type { Authorize } from './auth';\nimport { channelsFromConfig, createProviderCache, runtimeFromConfig } from './channels';\nimport type { JourneyRunParts } from './execute';\nimport { serve } from './http';\nimport {\n type SweepResult,\n deployBundle,\n ingestEvent,\n sweepSegments,\n wakeSubscribers,\n} from './ingest';\nimport type { JourneyEnv, JourneyParams } from './platform';\n\n/**\n * What a journey host is, apart from the runtime it runs on: the validated environment, the\n * store lease, the outlets a run is wired to, the HTTP API (`http.ts`, with the host's parts\n * plugged in) and the bundle that goes live with the code. `journeyWorker` (Cloudflare) and\n * `journeyLambda` (AWS) are this plus how their platform starts, wakes and stops instances.\n */\n\nexport interface JourneyHostOptions<Env extends JourneyEnv> {\n /**\n * The project's `workflow.config.ts` (`defineConfig`): what the host deploys (`GET /bundle`,\n * `POST /bundle/deploy` serve `compileConfig`), the template registries the senders, the\n * validator and `/preview` render from, the contract every `/events` and `/identify` is\n * checked against, the email defaults, actions, and the runtime / APNs / FCM settings.\n * Secrets come from the env under the names `JourneyEnv` documents.\n */\n config: JourneyConfig;\n /**\n * The data plane, opened per request and per workflow run. Return a `StoreLease` when the\n * client must be released afterwards (a Postgres connection); defaults to D1 from the env's\n * binding. `database` is the config's (`schema` defaulting to `workflow`), for Postgres:\n *\n * store: (env, database) => postgresJsStore(env.DATABASE_URL, database)\n */\n store?: (env: Env, database: { schema: string }) => JourneyStore | StoreLease;\n /**\n * Where journey emails go: a transport built from the validated env — `sesEmailTransport(...)`,\n * `cloudflareEmailTransport(...)`, or your own. Which one is independent of where the workflow\n * runs. Without it the email channel fails its sends, saying so.\n */\n email?: (env: Env) => EmailTransport;\n /**\n * Reporting hooks: node arrivals, every copy sent (with the tracking it should carry — click\n * links and an open pixel for email, payload data for a push), and how each instance ended.\n * By default a store that keeps reporting (Postgres) records them itself, and the host serves\n * the email tracking routes (`/t/...`, on `WORKFLOW_ORIGIN`); override to report elsewhere.\n */\n observer?: (env: Env, store: JourneyStore) => JourneyObserver;\n /** Message outlet override (tests, a custom gateway): replaces every channel, `email` included. */\n messages?: (env: Env, store: JourneyStore) => MessageSender;\n /** Per-instance runtime options override (a tester in fast-forward); by default `config.runtime` for `ENVIRONMENT`. */\n runtime?: (env: Env, params: JourneyParams) => JourneyRuntimeOptions;\n /**\n * The host's environment, as a zod schema over its vars and secrets (bindings pass through\n * untouched): checked the first time the host runs, so a missing or malformed variable fails\n * there — every problem listed — not at the send that needs it. Webhook templates read their\n * URL from the parsed values: `webhook: (env: Env) => env.WEBHOOK_DISCORD_ALERTS`.\n */\n env?: core.$ZodType<object>;\n /** 'enforce' (default) answers an event or patch the contract refuses with a 400; 'report' only logs it. */\n contractMode?: 'enforce' | 'report';\n /**\n * Who may call the API routes, in whatever form the host chooses: an HMAC over the body, a\n * JWT, a header its proxy adds. Receives a copy of the request and the env; true lets it\n * through, false answers 401, a throw answers 500. The tracking routes and `/health` stay\n * public. Without it, the env's `API_TOKEN` as a bearer (`bearerMatches`), which production\n * then requires.\n *\n * authorize: async (request, env) =>\n * timingSafeEqual(request.headers.get('x-signature') ?? '', await hmac(env.SECRET, await request.text()))\n */\n authorize?: Authorize<Env>;\n}\n\n/** The host's environment failed its schema (`env` option). */\nexport class EnvValidationError extends Error {\n override readonly name = 'EnvValidationError';\n constructor(readonly issues: readonly string[]) {\n super(`the host's environment is invalid:\\n ${issues.join('\\n ')}`);\n }\n}\n\nexport interface JourneyHost<Env extends JourneyEnv> {\n config: JourneyConfig;\n /** The env, parsed by the schema once per env object (throws EnvValidationError). */\n checkEnv(env: Env): Env;\n /** A store for one request or run, its segment windows scaled with the runtime. */\n lease(env: Env): Required<StoreLease>;\n /** The bundle compiled into this code. */\n bundle(): BundleIR;\n /** The outlets one run is wired to (the store is the run's). */\n runParts(env: Env, store: JourneyStore, params: JourneyParams): JourneyRunParts;\n /** The HTTP API over one store: the ingest API plus tracking, the sweep, the bundle and previews. */\n handle(request: Request, env: Env, store: JourneyStore): Promise<Response>;\n /** The scheduled sweep (`sweepSegments`) on a store of its own. */\n sweep(env: Env): Promise<SweepResult>;\n /**\n * Make the bundle compiled into `version` live, once per process, only over an older live\n * version (the store records it). Undefined when there is nothing to do; a failure is logged\n * and retried a minute later.\n */\n applyOwnBundle(env: Env, version: BundleVersion | undefined): Promise<void> | undefined;\n}\n\n/** What the platform adapter itself contributes. */\nexport interface JourneyPlatform {\n /** An HTTP/2 fetch for APNs, where the runtime's own fetch is HTTP/1.1 (Node). */\n apnsFetch?: typeof fetch;\n}\n\nfunction sendsEmail(nodes: readonly NodeIR[]): boolean {\n return nodes.some((node) => {\n switch (node.type) {\n case 'message':\n return node.channel === 'email';\n case 'wait_until':\n return Array.isArray(node.onTimeout) && sendsEmail(node.onTimeout);\n case 'branch':\n return (\n node.cases.some((branch) => sendsEmail(branch.flow)) || sendsEmail(node.otherwise ?? [])\n );\n case 'cohort':\n return node.arms.some((arm) => sendsEmail(arm.flow));\n default:\n return false;\n }\n });\n}\n\nconst describeIssue = (issue: { path: PropertyKey[]; message: string }): string =>\n `${issue.path.join('.') || '(root)'}: ${issue.message}`;\n\n/** An event the host emits itself, checked against the contract like any ingest. */\nfunction checkedPayload(\n contract: Contract | undefined,\n event: string,\n payload: Record<string, unknown>\n): Record<string, unknown> {\n if (contract === undefined) return payload;\n const verdict = checkEvent(contract, event, payload);\n if (!verdict.ok) throw new ContractValidationError(event, verdict.issues);\n return verdict.data;\n}\n\nexport function createJourneyHost<Env extends JourneyEnv>(\n options: JourneyHostOptions<Env>,\n platform: JourneyPlatform = {}\n): JourneyHost<Env> {\n const { config } = options;\n const emailIds = indexTemplates('email', config.templates?.email);\n // A config still on `emails` (its sender would be silently dropped) fails here, not at a send\n assertEmailConfig(config, emailIds.values());\n let compiled: BundleIR | undefined;\n const bundle = () => (compiled ??= compileConfig(config));\n // A journey that emails with nowhere to send fails here too, not at its first email\n const emailing = bundle().workflows.filter((workflow) => sendsEmail(workflow.flow));\n if (options.email === undefined && options.messages === undefined && emailing.length > 0) {\n throw new TypeError(\n `workflows ${emailing.map((w) => `'${w.id}'`).join(', ')} send email, but the host has no ` +\n '`email` transport: pass `email: (env) => cloudflareEmailTransport(...)` or `sesEmailTransport(...)`'\n );\n }\n // Parsed once per env object: the runtime hands the same one to every request of an isolate\n const checked = new WeakMap<object, Env>();\n const checkEnv = (env: Env): Env => {\n if (options.env === undefined) return env;\n const cached = checked.get(env);\n if (cached !== undefined) return cached;\n const result = z.safeParse(options.env, env);\n // Names and reasons only: the values are secrets\n if (!result.success) throw new EnvValidationError(result.error.issues.map(describeIssue));\n const merged: Env = { ...env, ...result.data };\n checked.set(env, merged);\n return merged;\n };\n const emails = config.templates?.email;\n const database = { schema: config.database?.schema ?? DEFAULT_SCHEMA };\n // In fast-forward, segment windows scale with the journeys reading them (time-scale.ts)\n const lease = (env: Env): Required<StoreLease> => {\n const opened = options.store === undefined ? d1Store(env) : options.store(env, database);\n const noop = async () => {};\n const factor = runtimeFromConfig(config, env).timeScale;\n return 'store' in opened\n ? { store: scaleSegmentWindows(opened.store, factor), close: opened.close ?? noop }\n : { store: scaleSegmentWindows(opened, factor), close: noop };\n };\n\n // The provider clients (APNs JWT, FCM access token) live with the host, not with a run: a\n // run's env is a fresh object on every Lambda invocation, so nothing keyed on it would be reused\n const providers = createProviderCache();\n const messages = (env: Env, store: JourneyStore): MessageSender => {\n if (options.messages !== undefined) return options.messages(env, store);\n return channelsFromConfig(config, env, {\n store,\n email: options.email?.(env),\n apnsFetch: platform.apnsFetch,\n providers,\n });\n };\n\n const observer = (env: Env, store: JourneyStore): JourneyObserver | undefined => {\n if (options.observer !== undefined) return options.observer(env, store);\n return store.reporting === undefined\n ? undefined\n : reportingObserver(store.reporting, env.WORKFLOW_ORIGIN);\n };\n\n const runParts = (env: Env, store: JourneyStore, params: JourneyParams): JourneyRunParts => ({\n store,\n env,\n runtime:\n options.runtime === undefined ? runtimeFromConfig(config, env) : options.runtime(env, params),\n messages: messages(env, store),\n // An action ref is a registered action structurally: the same object carries name, code and hash\n actions: new RegistryActionInvoker(config.actions ?? []),\n contract: config.contract,\n validator: registryValidator(config.templates ?? {}),\n observer: observer(env, store),\n });\n\n const preview = emails === undefined ? undefined : registryRenderer(emails, config.email);\n\n /**\n * The recipients' routes (`/t/*`): a push tapped open is recorded as the config's\n * `webPush.openedEvent` — keyed by the copy, so a second tap of the same notification is the\n * same event — and an unsubscribe wakes the waits reading email reachability (`reachable\n * ('email')` subscribes to the email property's channel), so an `exitWhen:\n * not(reachable('email'))` takes effect without waiting for a timeout.\n */\n const tracking = (env: Env, store: JourneyStore): TrackingOptions => {\n const opened = config.webPush?.openedEvent;\n return {\n product: config.title,\n quickMs: config.email?.tracking?.quickClickMs,\n pushOpened:\n opened === undefined\n ? undefined\n : async ({ messageId, userId, at }) => {\n const payload = checkedPayload(config.contract, opened, { message_id: messageId });\n const input = {\n id: `${opened}:${messageId}`,\n userId,\n event: opened,\n payload,\n ts: at,\n };\n await ingestEvent(env, input, store);\n },\n onUnsubscribed: async ({ userId }) => {\n const email = profileUpdatedEvent(RECIPIENT_PROPERTY.email ?? 'email');\n await wakeSubscribers(env, store, userId, [email]);\n },\n };\n };\n\n const handle = (request: Request, env: Env, store: JourneyStore): Promise<Response> =>\n serve(request, {\n env,\n store,\n validation: { contract: config.contract, mode: options.contractMode },\n authorize: options.authorize as Authorize<JourneyEnv> | undefined,\n host: {\n bundle,\n preview:\n preview === undefined ? undefined : { has: (id) => emailIds.has(id), render: preview },\n tracking: tracking(env, store),\n sweep: () => sweepSegments(env, store),\n },\n });\n\n const sweep = async (env: Env) => {\n const { store, close } = lease(env);\n try {\n return await sweepSegments(env, store);\n } finally {\n await close();\n }\n };\n\n // The bundle compiled into this version goes live on its own, once per process: the first\n // request or scheduled run reads which version's bundle is live (one row) and applies this one\n // only over an older version, so one still serving during a rollout can never put its routes\n // back. A failure (say the migrations have not run) is logged and retried a minute later. Only\n // the request that starts the check gets its promise back: a request context cannot wait on\n // another's I/O.\n let applying: Promise<void> | undefined;\n let retryAt = 0;\n const applyOwnBundle = (env: Env, version: BundleVersion | undefined) => {\n if (version === undefined || version.id === '' || Number.isNaN(version.createdAt)) {\n return undefined;\n }\n if (applying !== undefined || Date.now() < retryAt) return undefined;\n applying = (async () => {\n const { store, close } = lease(env);\n try {\n if (store.liveBundleVersion === undefined) return; // D1: POST /bundle/deploy\n const live = await store.liveBundleVersion();\n if (live !== undefined && (live.id === version.id || live.createdAt >= version.createdAt))\n return;\n const result = await deployBundle(env, bundle(), store, version);\n if (result.applied) console.log(`[workflow] version ${version.id} is live`);\n } finally {\n await close();\n }\n })().catch((error: unknown) => {\n applying = undefined;\n retryAt = Date.now() + 60_000;\n console.error(`[workflow] could not make version ${version.id} live`, error);\n });\n return applying;\n };\n\n return { config, checkEnv, lease, bundle, runParts, handle, sweep, applyOwnBundle };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiGA,IAAa,qBAAb,cAAwC,MAAM;CAEvB;CADrB,OAAyB;CACzB,YAAY,QAAoC;EAC9C,MAAM,yCAAyC,OAAO,KAAK,MAAM,GAAG;EADjD,KAAA,SAAA;CAErB;AACF;AA8BA,SAAS,WAAW,OAAmC;CACrD,OAAO,MAAM,MAAM,SAAS;EAC1B,QAAQ,KAAK,MAAb;GACE,KAAK,WACH,OAAO,KAAK,YAAY;GAC1B,KAAK,cACH,OAAO,MAAM,QAAQ,KAAK,SAAS,KAAK,WAAW,KAAK,SAAS;GACnE,KAAK,UACH,OACE,KAAK,MAAM,MAAM,WAAW,WAAW,OAAO,IAAI,CAAC,KAAK,WAAW,KAAK,aAAa,CAAC,CAAC;GAE3F,KAAK,UACH,OAAO,KAAK,KAAK,MAAM,QA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aAAa,KAAA,KAAa,KAAK,IAAI,IAAI,SAAS,OAAO,KAAA;EAC3D,YAAY,YAAY;GACtB,MAAM,EAAE,OAAO,UAAU,MAAM,GAAG;GAClC,IAAI;IACF,IAAI,MAAM,sBAAsB,KAAA,GAAW;IAC3C,MAAM,OAAO,MAAM,MAAM,kBAAkB;IAC3C,IAAI,SAAS,KAAA,MAAc,KAAK,OAAO,QAAQ,MAAM,KAAK,aAAa,QAAQ,YAC7E;IAEF,KAAI,MADiB,aAAa,KAAK,OAAO,GAAG,OAAO,OAAO,EAAA,CACpD,SAAS,QAAQ,IAAI,sBAAsB,QAAQ,GAAG,SAAS;GAC5E,UAAU;IACR,MAAM,MAAM;GACd;EACF,EAAA,CAAG,CAAC,CAAC,OAAO,UAAmB;GAC7B,WAAW,KAAA;GACX,UAAU,KAAK,IAAI,IAAI;GACvB,QAAQ,MAAM,qCAAqC,QAAQ,GAAG,QAAQ,KAAK;EAC7E,CAAC;EACD,OAAO;CACT;CAEA,OAAO;EAAE;EAAQ;EAAU;EAAO;EAAQ;EAAU;EAAQ;EAAO;CAAe;AACpF"}
|
|
1
|
+
{"version":3,"file":"journey-host.mjs","names":[],"sources":["../../src/host/journey-host.ts"],"sourcesContent":["import * as z from 'zod/mini';\nimport type * as core from 'zod/v4/core';\nimport { type JourneyConfig, compileConfig } from '../config';\nimport { type Contract, ContractValidationError, checkEvent } from '../contract';\nimport { assertEmailConfig } from '../email';\nimport type { EmailTransport } from '../email-sender';\nimport { RegistryActionInvoker } from '../engine/actions';\nimport { profileUpdatedEvent } from '../engine/condition';\nimport type { JourneyObserver, MessageSender } from '../engine/ports';\nimport { RECIPIENT_PROPERTY } from '../engine/recipient';\nimport { scaleSegmentWindows } from '../engine/time-scale';\nimport type { BundleIR, NodeIR } from '../ir';\nimport { registryRenderer } from '../react-email';\nimport { reportingObserver } from '../reporting/observer';\nimport type { TrackingOptions } from '../reporting/tracking';\nimport type { JourneyRuntimeOptions } from '../runtime';\nimport type { BundleVersion, JourneyStore, StoreLease } from '../store/index';\nimport { DEFAULT_SCHEMA } from '../store/tables';\nimport { indexTemplates, registryValidator } from '../templates';\nimport type { Authorize } from './auth';\nimport { channelsFromConfig, createProviderCache, runtimeFromConfig } from './channels';\nimport type { JourneyRunParts } from './execute';\nimport { serve } from './http';\nimport {\n type SweepResult,\n deployBundle,\n ingestEvent,\n sweepSegments,\n wakeSubscribers,\n} from './ingest';\nimport type { JourneyEnv, JourneyParams } from './platform';\n\n/**\n * What a journey host is, apart from the runtime it runs on: the validated environment, the\n * store lease, the outlets a run is wired to, the HTTP API (`http.ts`, with the host's parts\n * plugged in) and the bundle that goes live with the code. `journeyWorker` (Cloudflare) and\n * `journeyLambda` (AWS) are this plus how their platform starts, wakes and stops instances.\n */\n\nexport interface JourneyHostOptions<Env extends JourneyEnv> {\n /**\n * The project's `workflow.config.ts` (`defineConfig`): what the host deploys (`GET /bundle`,\n * `POST /bundle/deploy` serve `compileConfig`), the template registries the senders, the\n * validator and `/preview` render from, the contract every `/events` and `/identify` is\n * checked against, the email defaults, actions, and the runtime / APNs / FCM settings.\n * Secrets come from the env under the names `JourneyEnv` documents.\n */\n config: JourneyConfig;\n /**\n * The data plane, opened per request and per workflow run. Return a `StoreLease` when the\n * client must be released afterwards (a Postgres connection). `database` is the config's\n * (`schema` defaulting to `workflow`):\n *\n * store: (env, database) => postgresJsStore(env.DATABASE_URL, database)\n */\n store: (env: Env, database: { schema: string }) => JourneyStore | StoreLease;\n /**\n * Where journey emails go: a transport built from the validated env — `sesEmailTransport(...)`,\n * `cloudflareEmailTransport(...)`, or your own. Which one is independent of where the workflow\n * runs. Without it the email channel fails its sends, saying so.\n */\n email?: (env: Env) => EmailTransport;\n /**\n * Reporting hooks: node arrivals, every copy sent (with the tracking it should carry — click\n * links and an open pixel for email, payload data for a push), and how each instance ended.\n * By default the store records them itself, and the host serves the email tracking routes\n * (`/t/...`, on `WORKFLOW_ORIGIN`); override to report elsewhere.\n */\n observer?: (env: Env, store: JourneyStore) => JourneyObserver;\n /** Message outlet override (tests, a custom gateway): replaces every channel, `email` included. */\n messages?: (env: Env, store: JourneyStore) => MessageSender;\n /** Per-instance runtime options override (a tester in fast-forward); by default `config.runtime` for `ENVIRONMENT`. */\n runtime?: (env: Env, params: JourneyParams) => JourneyRuntimeOptions;\n /**\n * The host's environment, as a zod schema over its vars and secrets (bindings pass through\n * untouched): checked the first time the host runs, so a missing or malformed variable fails\n * there — every problem listed — not at the send that needs it. Webhook templates read their\n * URL from the parsed values: `webhook: (env: Env) => env.WEBHOOK_DISCORD_ALERTS`.\n */\n env?: core.$ZodType<object>;\n /** 'enforce' (default) answers an event or patch the contract refuses with a 400; 'report' only logs it. */\n contractMode?: 'enforce' | 'report';\n /**\n * Who may call the API routes, in whatever form the host chooses: an HMAC over the body, a\n * JWT, a header its proxy adds. Receives a copy of the request and the env; true lets it\n * through, false answers 401, a throw answers 500. The tracking routes and `/health` stay\n * public. Without it, the env's `API_TOKEN` as a bearer (`bearerMatches`), which production\n * then requires.\n *\n * authorize: async (request, env) =>\n * timingSafeEqual(request.headers.get('x-signature') ?? '', await hmac(env.SECRET, await request.text()))\n */\n authorize?: Authorize<Env>;\n}\n\n/** The host's environment failed its schema (`env` option). */\nexport class EnvValidationError extends Error {\n override readonly name = 'EnvValidationError';\n constructor(readonly issues: readonly string[]) {\n super(`the host's environment is invalid:\\n ${issues.join('\\n ')}`);\n }\n}\n\nexport interface JourneyHost<Env extends JourneyEnv> {\n config: JourneyConfig;\n /** The env, parsed by the schema once per env object (throws EnvValidationError). */\n checkEnv(env: Env): Env;\n /** A store for one request or run, its segment windows scaled with the runtime. */\n lease(env: Env): Required<StoreLease>;\n /** The bundle compiled into this code. */\n bundle(): BundleIR;\n /** The outlets one run is wired to (the store is the run's). */\n runParts(env: Env, store: JourneyStore, params: JourneyParams): JourneyRunParts;\n /** The HTTP API over one store: the ingest API plus tracking, the sweep, the bundle and previews. */\n handle(request: Request, env: Env, store: JourneyStore): Promise<Response>;\n /** The scheduled sweep (`sweepSegments`) on a store of its own. */\n sweep(env: Env): Promise<SweepResult>;\n /**\n * Make the bundle compiled into `version` live, once per process, only over an older live\n * version (the store records it). Undefined when there is nothing to do; a failure is logged\n * and retried a minute later.\n */\n applyOwnBundle(env: Env, version: BundleVersion | undefined): Promise<void> | undefined;\n}\n\n/** What the platform adapter itself contributes. */\nexport interface JourneyPlatform {\n /** An HTTP/2 fetch for APNs, where the runtime's own fetch is HTTP/1.1 (Node). */\n apnsFetch?: typeof fetch;\n}\n\nfunction sendsEmail(nodes: readonly NodeIR[]): boolean {\n return nodes.some((node) => {\n switch (node.type) {\n case 'message':\n return node.channel === 'email';\n case 'wait_until':\n return Array.isArray(node.onTimeout) && sendsEmail(node.onTimeout);\n case 'branch':\n return (\n node.cases.some((branch) => sendsEmail(branch.flow)) || sendsEmail(node.otherwise ?? [])\n );\n case 'cohort':\n return node.arms.some((arm) => sendsEmail(arm.flow));\n default:\n return false;\n }\n });\n}\n\nconst describeIssue = (issue: { path: PropertyKey[]; message: string }): string =>\n `${issue.path.join('.') || '(root)'}: ${issue.message}`;\n\n/** An event the host emits itself, checked against the contract like any ingest. */\nfunction checkedPayload(\n contract: Contract | undefined,\n event: string,\n payload: Record<string, unknown>\n): Record<string, unknown> {\n if (contract === undefined) return payload;\n const verdict = checkEvent(contract, event, payload);\n if (!verdict.ok) throw new ContractValidationError(event, verdict.issues);\n return verdict.data;\n}\n\nexport function createJourneyHost<Env extends JourneyEnv>(\n options: JourneyHostOptions<Env>,\n platform: JourneyPlatform = {}\n): JourneyHost<Env> {\n const { config } = options;\n const emailIds = indexTemplates('email', config.templates?.email);\n // A config still on `emails` (its sender would be silently dropped) fails here, not at a send\n assertEmailConfig(config, emailIds.values());\n let compiled: BundleIR | undefined;\n const bundle = () => (compiled ??= compileConfig(config));\n // A journey that emails with nowhere to send fails here too, not at its first email\n const emailing = bundle().workflows.filter((workflow) => sendsEmail(workflow.flow));\n if (options.email === undefined && options.messages === undefined && emailing.length > 0) {\n throw new TypeError(\n `workflows ${emailing.map((w) => `'${w.id}'`).join(', ')} send email, but the host has no ` +\n '`email` transport: pass `email: (env) => cloudflareEmailTransport(...)` or `sesEmailTransport(...)`'\n );\n }\n // Parsed once per env object: the runtime hands the same one to every request of an isolate\n const checked = new WeakMap<object, Env>();\n const checkEnv = (env: Env): Env => {\n if (options.env === undefined) return env;\n const cached = checked.get(env);\n if (cached !== undefined) return cached;\n const result = z.safeParse(options.env, env);\n // Names and reasons only: the values are secrets\n if (!result.success) throw new EnvValidationError(result.error.issues.map(describeIssue));\n const merged: Env = { ...env, ...result.data };\n checked.set(env, merged);\n return merged;\n };\n const emails = config.templates?.email;\n const database = { schema: config.database?.schema ?? DEFAULT_SCHEMA };\n // In fast-forward, segment windows scale with the journeys reading them (time-scale.ts)\n const lease = (env: Env): Required<StoreLease> => {\n const opened = options.store(env, database);\n const noop = async () => {};\n const factor = runtimeFromConfig(config, env).timeScale;\n return 'store' in opened\n ? { store: scaleSegmentWindows(opened.store, factor), close: opened.close ?? noop }\n : { store: scaleSegmentWindows(opened, factor), close: noop };\n };\n\n // The provider clients (APNs JWT, FCM access token) live with the host, not with a run: a\n // run's env is a fresh object on every Lambda invocation, so nothing keyed on it would be reused\n const providers = createProviderCache();\n const messages = (env: Env, store: JourneyStore): MessageSender => {\n if (options.messages !== undefined) return options.messages(env, store);\n return channelsFromConfig(config, env, {\n store,\n email: options.email?.(env),\n apnsFetch: platform.apnsFetch,\n providers,\n });\n };\n\n const observer = (env: Env, store: JourneyStore): JourneyObserver => {\n if (options.observer !== undefined) return options.observer(env, store);\n return reportingObserver(store.reporting, env.WORKFLOW_ORIGIN);\n };\n\n const runParts = (env: Env, store: JourneyStore, params: JourneyParams): JourneyRunParts => ({\n store,\n env,\n runtime:\n options.runtime === undefined ? runtimeFromConfig(config, env) : options.runtime(env, params),\n messages: messages(env, store),\n // An action ref is a registered action structurally: the same object carries name, code and hash\n actions: new RegistryActionInvoker(config.actions ?? []),\n contract: config.contract,\n validator: registryValidator(config.templates ?? {}),\n observer: observer(env, store),\n });\n\n const preview = emails === undefined ? undefined : registryRenderer(emails, config.email);\n\n /**\n * The recipients' routes (`/t/*`): a push tapped open is recorded as the config's\n * `webPush.openedEvent` — keyed by the copy, so a second tap of the same notification is the\n * same event — and an unsubscribe wakes the waits reading email reachability (`reachable\n * ('email')` subscribes to the email property's channel), so an `exitWhen:\n * not(reachable('email'))` takes effect without waiting for a timeout.\n */\n const tracking = (env: Env, store: JourneyStore): TrackingOptions => {\n const opened = config.webPush?.openedEvent;\n return {\n product: config.title,\n quickMs: config.email?.tracking?.quickClickMs,\n pushOpened:\n opened === undefined\n ? undefined\n : async ({ messageId, userId, at }) => {\n const payload = checkedPayload(config.contract, opened, { message_id: messageId });\n const input = {\n id: `${opened}:${messageId}`,\n userId,\n event: opened,\n payload,\n ts: at,\n };\n await ingestEvent(env, input, store);\n },\n onUnsubscribed: async ({ userId }) => {\n const email = profileUpdatedEvent(RECIPIENT_PROPERTY.email ?? 'email');\n await wakeSubscribers(env, store, userId, [email]);\n },\n };\n };\n\n const handle = (request: Request, env: Env, store: JourneyStore): Promise<Response> =>\n serve(request, {\n env,\n store,\n validation: { contract: config.contract, mode: options.contractMode },\n authorize: options.authorize as Authorize<JourneyEnv> | undefined,\n host: {\n bundle,\n preview:\n preview === undefined ? undefined : { has: (id) => emailIds.has(id), render: preview },\n tracking: tracking(env, store),\n sweep: () => sweepSegments(env, store),\n },\n });\n\n const sweep = async (env: Env) => {\n const { store, close } = lease(env);\n try {\n return await sweepSegments(env, store);\n } finally {\n await close();\n }\n };\n\n // The bundle compiled into this version goes live on its own, once per process: the first\n // request or scheduled run reads which version's bundle is live (one row) and applies this one\n // only over an older version, so one still serving during a rollout can never put its routes\n // back. A failure (say the migrations have not run) is logged and retried a minute later. Only\n // the request that starts the check gets its promise back: a request context cannot wait on\n // another's I/O.\n let applying: Promise<void> | undefined;\n let retryAt = 0;\n const applyOwnBundle = (env: Env, version: BundleVersion | undefined) => {\n if (version === undefined || version.id === '' || Number.isNaN(version.createdAt)) {\n return undefined;\n }\n if (applying !== undefined || Date.now() < retryAt) return undefined;\n applying = (async () => {\n const { store, close } = lease(env);\n try {\n const live = await store.liveBundleVersion();\n if (live !== undefined && (live.id === version.id || live.createdAt >= version.createdAt))\n return;\n const result = await deployBundle(env, bundle(), store, version);\n if (result.applied) console.log(`[workflow] version ${version.id} is live`);\n } finally {\n await close();\n }\n })().catch((error: unknown) => {\n applying = undefined;\n retryAt = Date.now() + 60_000;\n console.error(`[workflow] could not make version ${version.id} live`, error);\n });\n return applying;\n };\n\n return { config, checkEnv, lease, bundle, runParts, handle, sweep, applyOwnBundle };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgGA,IAAa,qBAAb,cAAwC,MAAM;CAEvB;CADrB,OAAyB;CACzB,YAAY,QAAoC;EAC9C,MAAM,yCAAyC,OAAO,KAAK,MAAM,GAAG;EADjD,KAAA,SAAA;CAErB;AACF;AA8BA,SAAS,WAAW,OAAmC;CACrD,OAAO,MAAM,MAAM,SAAS;EAC1B,QAAQ,KAAK,MAAb;GACE,KAAK,WACH,OAAO,KAAK,YAAY;GAC1B,KAAK,cACH,OAAO,MAAM,QAAQ,KAAK,SAAS,KAAK,WAAW,KAAK,SAAS;GACnE,KAAK,UACH,OACE,KAAK,MAAM,MAAM,WAAW,WAAW,OAAO,IAAI,CAAC,KAAK,WAAW,KAAK,aAAa,CAAC,CAAC;GAE3F,KAAK,UACH,OAAO,KAAK,KAAK,MAAM,QAAQ,WAAW,IAAI,IAAI,CAAC;GACrD,SACE,OAAO;EACX;CACF,CAAC;AACH;AAEA,MAAM,iBAAiB,UACrB,GAAG,MAAM,KAAK,KAAK,GAAG,KAAK,SAAS,IAAI,MAAM;;AAGhD,SAAS,eACP,UACA,OACA,SACyB;CACzB,IAAI,aAAa,KAAA,GAAW,OAAO;CACnC,MAAM,UAAU,WAAW,UAAU,OAAO,OAAO;CACnD,IAAI,CAAC,QAAQ,IA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,UAAU;IACR,MAAM,MAAM;GACd;EACF,EAAA,CAAG,CAAC,CAAC,OAAO,UAAmB;GAC7B,WAAW,KAAA;GACX,UAAU,KAAK,IAAI,IAAI;GACvB,QAAQ,MAAM,qCAAqC,QAAQ,GAAG,QAAQ,KAAK;EAC7E,CAAC;EACD,OAAO;CACT;CAEA,OAAO;EAAE;EAAQ;EAAU;EAAO;EAAQ;EAAU;EAAQ;EAAO;CAAe;AACpF"}
|
package/dist/host/platform.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/host/platform.ts
|
|
3
3
|
/**
|
|
4
4
|
* The runtime does not know the instance: the only lookup failure that lets the host drop the
|
|
5
5
|
* instance's wakes, or count it as stopped. Every `WorkflowBindingLike.get` answers it this way.
|
|
@@ -14,7 +14,6 @@ var InstanceNotFoundError = class extends Error {
|
|
|
14
14
|
};
|
|
15
15
|
/** The event type the host uses to wake waiting instances (sendEvent's `type`). */
|
|
16
16
|
const WAKE_EVENT_TYPE = "wake";
|
|
17
|
-
//#endregion
|
|
18
17
|
exports.InstanceNotFoundError = InstanceNotFoundError;
|
|
19
18
|
exports.WAKE_EVENT_TYPE = WAKE_EVENT_TYPE;
|
|
20
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.cjs","names":[],"sources":["../../src/host/platform.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"platform.cjs","names":[],"sources":["../../src/host/platform.ts"],"sourcesContent":["import type { EmailBindingLike } from '../cloudflare/bindings';\nimport type { ExecutionStart } from '../store/index';\n\n/**\n * The runtime port: what the host needs from the platform it runs on, whichever one that is.\n * Cloudflare's Workflow binding satisfies it (`cloudflareJourneyBinding`), the AWS adapter's\n * `AwsInstances` implements it over durable executions.\n */\n\nexport interface WorkflowInstanceLike {\n id: string;\n sendEvent(event: { type: string; payload?: unknown }): Promise<void>;\n /** Stop the instance for good (Cloudflare Workflows' `terminate`). */\n terminate?(): Promise<void>;\n /** Where it stands (`complete`, `errored`, `terminated`, `running`, …). */\n status?(): Promise<{ status: string }>;\n}\n\n/** How the host starts, wakes and stops instances. */\nexport interface WorkflowBindingLike {\n create(options: { id: string; params: unknown }): Promise<WorkflowInstanceLike>;\n /** The instance, or an `InstanceNotFoundError` when the runtime does not know the id. */\n get(id: string): Promise<WorkflowInstanceLike>;\n /**\n * For a runtime whose start is a submit that can be lost in flight (AWS): the start to record\n * with the entry, in one transaction. A failed `create` then keeps the entry — its recorded\n * start is retried by the next ingest for the pair (`resume`) or by maintenance, never rolled\n * back and re-entered as a second execution.\n */\n plan?(options: {\n id: string;\n params: JourneyParams;\n ts: number;\n /** The code version whose routes named `params.contentHash` (absent after a forced deploy). */\n version?: string | undefined;\n }): Promise<ExecutionStart>;\n /** Retry the recorded, unconfirmed start of the (workflow, user) entry still running, if any. */\n resume?(entry: { workflow: string; userId: string }): Promise<void>;\n /**\n * Maintenance the sweep runs first: old unconfirmed starts retried (or given up on), and\n * executions the platform ended on its own (timeout, stop, crash) reconciled into the ledger.\n */\n maintain?(): Promise<void>;\n}\n\n/**\n * The runtime does not know the instance: the only lookup failure that lets the host drop the\n * instance's wakes, or count it as stopped. Every `WorkflowBindingLike.get` answers it this way.\n */\nexport class InstanceNotFoundError extends Error {\n override readonly name = 'InstanceNotFoundError';\n constructor(\n readonly instanceId: string,\n options?: ErrorOptions\n ) {\n super(`no such instance: ${instanceId}`, options);\n }\n}\n\n/** The event type the host uses to wake waiting instances (sendEvent's `type`). */\nexport const WAKE_EVENT_TYPE = 'wake';\n\n/** Journey instance parameters, passed by the host when it creates one. */\nexport interface JourneyParams {\n workflowId: string;\n /** The IR version pinned at entry. */\n contentHash: string;\n userId: string;\n trigger: { event: string; payload: Record<string, unknown> };\n [key: string]: unknown;\n}\n\n/** Every binding, variable and secret the journey host reads (names match the wrangler config). */\nexport interface JourneyEnv {\n /** The runtime port: creating instances, waking and stopping them. */\n JOURNEY: WorkflowBindingLike;\n /** Optional message-delivery webhook (defaults to the console logging sender). */\n MESSAGE_WEBHOOK_URL?: string;\n /**\n * Bearer token required on every mutating HTTP endpoint (`Authorization:\n * Bearer <token>`). Unset = open — acceptable only for local dev; /deploy in\n * particular rewrites the whole routing table, so production must set this.\n */\n API_TOKEN?: string;\n /**\n * The host's public origin. With a store that keeps reporting (Postgres), journey emails'\n * links and open pixel point at its `/t/...` routes; without it emails go out untracked.\n */\n WORKFLOW_ORIGIN?: string;\n /** Which `workflow.config.ts` entry applies (`development`, `production`, …); production when unset. */\n ENVIRONMENT?: string;\n /** Cloudflare Email Sending, when the config has `emails`. */\n EMAIL?: EmailBindingLike;\n /** The APNs auth key (`.p8`, base64) named by the config's `apns.keyId`. */\n APNS_PRIVATE_KEY_BASE64?: string;\n /** The Firebase service account (base64 JSON) the config's `fcm` sends with. */\n GOOGLE_APPLICATION_CREDENTIALS_BASE64?: string;\n /** The VAPID key pair web pushes are signed with (`generateVapidKeys`); the config's `webPush` turns the channel on. */\n VAPID_PUBLIC_KEY?: string;\n VAPID_PRIVATE_KEY?: string;\n /**\n * Cloudflare's version metadata binding (wrangler `\"version_metadata\": { \"binding\":\n * \"CF_VERSION_METADATA\" }`). With it, and a store that records the live version (Postgres),\n * journeyWorker makes the bundle compiled into each new version live by itself: `wrangler\n * deploy` is the whole deploy.\n */\n CF_VERSION_METADATA?: { id: string; tag?: string; timestamp: string };\n /** Development only: the HTTP/2 relay `wrangler dev` sends APNs requests through (see `@shware/workflow/apns-relay`). */\n APNS_RELAY_ORIGIN?: string;\n}\n"],"mappings":";;;;;;AAiDA,IAAa,wBAAb,cAA2C,MAAM;CAGpC;CAFX,OAAyB;CACzB,YACE,YACA,SACA;EACA,MAAM,qBAAqB,cAAc,OAAO;EAHvC,KAAA,aAAA;CAIX;AACF;;AAGA,MAAa,kBAAkB"}
|
package/dist/host/platform.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { D1DatabaseLike, EmailBindingLike } from "../cloudflare/bindings.cjs";
|
|
2
1
|
import { ExecutionStart } from "../store/index.cjs";
|
|
3
|
-
|
|
2
|
+
import { EmailBindingLike } from "../cloudflare/bindings.cjs";
|
|
4
3
|
/**
|
|
5
4
|
* The runtime port: what the host needs from the platform it runs on, whichever one that is.
|
|
6
5
|
* Cloudflare's Workflow binding satisfies it (`cloudflareJourneyBinding`), the AWS adapter's
|
|
@@ -76,12 +75,6 @@ export interface JourneyParams {
|
|
|
76
75
|
}
|
|
77
76
|
/** Every binding, variable and secret the journey host reads (names match the wrangler config). */
|
|
78
77
|
export interface JourneyEnv {
|
|
79
|
-
/**
|
|
80
|
-
* The default D1 store's database (events / profiles / segments / triggers / entries /
|
|
81
|
-
* subscriptions / workflow IR). Optional: a host on another JourneyStore (Postgres, say)
|
|
82
|
-
* does not declare it.
|
|
83
|
-
*/
|
|
84
|
-
DB?: D1DatabaseLike;
|
|
85
78
|
/** The runtime port: creating instances, waking and stopping them. */
|
|
86
79
|
JOURNEY: WorkflowBindingLike;
|
|
87
80
|
/** Optional message-delivery webhook (defaults to the console logging sender). */
|
|
@@ -122,5 +115,4 @@ export interface JourneyEnv {
|
|
|
122
115
|
/** Development only: the HTTP/2 relay `wrangler dev` sends APNs requests through (see `@shware/workflow/apns-relay`). */
|
|
123
116
|
APNS_RELAY_ORIGIN?: string;
|
|
124
117
|
}
|
|
125
|
-
//#endregion
|
|
126
118
|
//# sourceMappingURL=platform.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.cts","names":[],"sources":["../../src/host/platform.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform.d.cts","names":[],"sources":["../../src/host/platform.ts"],"mappings":";;;;;;;iBASiB;EACf;EACA,UAAU;IAAS;IAAc;MAAsB;;EAEvD,cAAc;;EAEd,WAAW;IAAU;;;;iBAIN;EACf,OAAO;IAAW;IAAY;MAAoB,QAAQ;;EAE1D,IAAI,aAAa,QAAQ;;;;;;;EAOzB,MAAM;IACJ;IACA,QAAQ;IACR;;IAEA;MACE,QAAQ;;EAEZ,QAAQ;IAAS;IAAkB;MAAmB;;;;;EAKtD,aAAa;;;;;;qBAOF,8BAA8B;WAG9B;WAFO;EAClB,YACW,oBACT,UAAU;;;qBAOD;;iBAGI;EACf;;EAEA;EACA;EACA;IAAW;IAAe,SAAS;;GAClC;;;iBAIc;;EAEf,SAAS;;EAET;;;;;;EAMA;;;;;EAKA;;EAEA;;EAEA,QAAQ;;EAER;;EAEA;;EAEA;EACA;;;;;;;EAOA;IAAwB;IAAY;IAAc;;;EAElD"}
|
package/dist/host/platform.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { D1DatabaseLike, EmailBindingLike } from "../cloudflare/bindings.mjs";
|
|
2
1
|
import { ExecutionStart } from "../store/index.mjs";
|
|
3
|
-
|
|
2
|
+
import { EmailBindingLike } from "../cloudflare/bindings.mjs";
|
|
4
3
|
/**
|
|
5
4
|
* The runtime port: what the host needs from the platform it runs on, whichever one that is.
|
|
6
5
|
* Cloudflare's Workflow binding satisfies it (`cloudflareJourneyBinding`), the AWS adapter's
|
|
@@ -76,12 +75,6 @@ export interface JourneyParams {
|
|
|
76
75
|
}
|
|
77
76
|
/** Every binding, variable and secret the journey host reads (names match the wrangler config). */
|
|
78
77
|
export interface JourneyEnv {
|
|
79
|
-
/**
|
|
80
|
-
* The default D1 store's database (events / profiles / segments / triggers / entries /
|
|
81
|
-
* subscriptions / workflow IR). Optional: a host on another JourneyStore (Postgres, say)
|
|
82
|
-
* does not declare it.
|
|
83
|
-
*/
|
|
84
|
-
DB?: D1DatabaseLike;
|
|
85
78
|
/** The runtime port: creating instances, waking and stopping them. */
|
|
86
79
|
JOURNEY: WorkflowBindingLike;
|
|
87
80
|
/** Optional message-delivery webhook (defaults to the console logging sender). */
|
|
@@ -122,5 +115,4 @@ export interface JourneyEnv {
|
|
|
122
115
|
/** Development only: the HTTP/2 relay `wrangler dev` sends APNs requests through (see `@shware/workflow/apns-relay`). */
|
|
123
116
|
APNS_RELAY_ORIGIN?: string;
|
|
124
117
|
}
|
|
125
|
-
//#endregion
|
|
126
118
|
//# sourceMappingURL=platform.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.mts","names":[],"sources":["../../src/host/platform.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform.d.mts","names":[],"sources":["../../src/host/platform.ts"],"mappings":";;;;;;;iBASiB;EACf;EACA,UAAU;IAAS;IAAc;MAAsB;;EAEvD,cAAc;;EAEd,WAAW;IAAU;;;;iBAIN;EACf,OAAO;IAAW;IAAY;MAAoB,QAAQ;;EAE1D,IAAI,aAAa,QAAQ;;;;;;;EAOzB,MAAM;IACJ;IACA,QAAQ;IACR;;IAEA;MACE,QAAQ;;EAEZ,QAAQ;IAAS;IAAkB;MAAmB;;;;;EAKtD,aAAa;;;;;;qBAOF,8BAA8B;WAG9B;WAFO;EAClB,YACW,oBACT,UAAU;;;qBAOD;;iBAGI;EACf;;EAEA;EACA;EACA;IAAW;IAAe,SAAS;;GAClC;;;iBAIc;;EAEf,SAAS;;EAET;;;;;;EAMA;;;;;EAKA;;EAEA;;EAEA,QAAQ;;EAER;;EAEA;;EAEA;EACA;;;;;;;EAOA;IAAwB;IAAY;IAAc;;;EAElD"}
|
package/dist/host/platform.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/host/platform.ts
|
|
2
2
|
/**
|
|
3
3
|
* The runtime does not know the instance: the only lookup failure that lets the host drop the
|
|
4
4
|
* instance's wakes, or count it as stopped. Every `WorkflowBindingLike.get` answers it this way.
|
|
@@ -13,7 +13,6 @@ var InstanceNotFoundError = class extends Error {
|
|
|
13
13
|
};
|
|
14
14
|
/** The event type the host uses to wake waiting instances (sendEvent's `type`). */
|
|
15
15
|
const WAKE_EVENT_TYPE = "wake";
|
|
16
|
-
//#endregion
|
|
17
16
|
export { InstanceNotFoundError, WAKE_EVENT_TYPE };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=platform.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.mjs","names":[],"sources":["../../src/host/platform.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"platform.mjs","names":[],"sources":["../../src/host/platform.ts"],"sourcesContent":["import type { EmailBindingLike } from '../cloudflare/bindings';\nimport type { ExecutionStart } from '../store/index';\n\n/**\n * The runtime port: what the host needs from the platform it runs on, whichever one that is.\n * Cloudflare's Workflow binding satisfies it (`cloudflareJourneyBinding`), the AWS adapter's\n * `AwsInstances` implements it over durable executions.\n */\n\nexport interface WorkflowInstanceLike {\n id: string;\n sendEvent(event: { type: string; payload?: unknown }): Promise<void>;\n /** Stop the instance for good (Cloudflare Workflows' `terminate`). */\n terminate?(): Promise<void>;\n /** Where it stands (`complete`, `errored`, `terminated`, `running`, …). */\n status?(): Promise<{ status: string }>;\n}\n\n/** How the host starts, wakes and stops instances. */\nexport interface WorkflowBindingLike {\n create(options: { id: string; params: unknown }): Promise<WorkflowInstanceLike>;\n /** The instance, or an `InstanceNotFoundError` when the runtime does not know the id. */\n get(id: string): Promise<WorkflowInstanceLike>;\n /**\n * For a runtime whose start is a submit that can be lost in flight (AWS): the start to record\n * with the entry, in one transaction. A failed `create` then keeps the entry — its recorded\n * start is retried by the next ingest for the pair (`resume`) or by maintenance, never rolled\n * back and re-entered as a second execution.\n */\n plan?(options: {\n id: string;\n params: JourneyParams;\n ts: number;\n /** The code version whose routes named `params.contentHash` (absent after a forced deploy). */\n version?: string | undefined;\n }): Promise<ExecutionStart>;\n /** Retry the recorded, unconfirmed start of the (workflow, user) entry still running, if any. */\n resume?(entry: { workflow: string; userId: string }): Promise<void>;\n /**\n * Maintenance the sweep runs first: old unconfirmed starts retried (or given up on), and\n * executions the platform ended on its own (timeout, stop, crash) reconciled into the ledger.\n */\n maintain?(): Promise<void>;\n}\n\n/**\n * The runtime does not know the instance: the only lookup failure that lets the host drop the\n * instance's wakes, or count it as stopped. Every `WorkflowBindingLike.get` answers it this way.\n */\nexport class InstanceNotFoundError extends Error {\n override readonly name = 'InstanceNotFoundError';\n constructor(\n readonly instanceId: string,\n options?: ErrorOptions\n ) {\n super(`no such instance: ${instanceId}`, options);\n }\n}\n\n/** The event type the host uses to wake waiting instances (sendEvent's `type`). */\nexport const WAKE_EVENT_TYPE = 'wake';\n\n/** Journey instance parameters, passed by the host when it creates one. */\nexport interface JourneyParams {\n workflowId: string;\n /** The IR version pinned at entry. */\n contentHash: string;\n userId: string;\n trigger: { event: string; payload: Record<string, unknown> };\n [key: string]: unknown;\n}\n\n/** Every binding, variable and secret the journey host reads (names match the wrangler config). */\nexport interface JourneyEnv {\n /** The runtime port: creating instances, waking and stopping them. */\n JOURNEY: WorkflowBindingLike;\n /** Optional message-delivery webhook (defaults to the console logging sender). */\n MESSAGE_WEBHOOK_URL?: string;\n /**\n * Bearer token required on every mutating HTTP endpoint (`Authorization:\n * Bearer <token>`). Unset = open — acceptable only for local dev; /deploy in\n * particular rewrites the whole routing table, so production must set this.\n */\n API_TOKEN?: string;\n /**\n * The host's public origin. With a store that keeps reporting (Postgres), journey emails'\n * links and open pixel point at its `/t/...` routes; without it emails go out untracked.\n */\n WORKFLOW_ORIGIN?: string;\n /** Which `workflow.config.ts` entry applies (`development`, `production`, …); production when unset. */\n ENVIRONMENT?: string;\n /** Cloudflare Email Sending, when the config has `emails`. */\n EMAIL?: EmailBindingLike;\n /** The APNs auth key (`.p8`, base64) named by the config's `apns.keyId`. */\n APNS_PRIVATE_KEY_BASE64?: string;\n /** The Firebase service account (base64 JSON) the config's `fcm` sends with. */\n GOOGLE_APPLICATION_CREDENTIALS_BASE64?: string;\n /** The VAPID key pair web pushes are signed with (`generateVapidKeys`); the config's `webPush` turns the channel on. */\n VAPID_PUBLIC_KEY?: string;\n VAPID_PRIVATE_KEY?: string;\n /**\n * Cloudflare's version metadata binding (wrangler `\"version_metadata\": { \"binding\":\n * \"CF_VERSION_METADATA\" }`). With it, and a store that records the live version (Postgres),\n * journeyWorker makes the bundle compiled into each new version live by itself: `wrangler\n * deploy` is the whole deploy.\n */\n CF_VERSION_METADATA?: { id: string; tag?: string; timestamp: string };\n /** Development only: the HTTP/2 relay `wrangler dev` sends APNs requests through (see `@shware/workflow/apns-relay`). */\n APNS_RELAY_ORIGIN?: string;\n}\n"],"mappings":";;;;;AAiDA,IAAa,wBAAb,cAA2C,MAAM;CAGpC;CAFX,OAAyB;CACzB,YACE,YACA,SACA;EACA,MAAM,qBAAqB,cAAc,OAAO;EAHvC,KAAA,aAAA;CAIX;AACF;;AAGA,MAAa,kBAAkB"}
|
package/dist/host/senders.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_engine_retry = require("../engine/retry.cjs");
|
|
3
|
-
|
|
3
|
+
// src/host/senders.ts
|
|
4
4
|
/** Development sender: structured logs, for eyeballing the pipeline. */
|
|
5
5
|
var LogMessageSender = class {
|
|
6
6
|
async send(message) {
|
|
@@ -63,7 +63,6 @@ function routeByPlatform(senders) {
|
|
|
63
63
|
return senders[platform].send(message);
|
|
64
64
|
} };
|
|
65
65
|
}
|
|
66
|
-
//#endregion
|
|
67
66
|
exports.LogMessageSender = LogMessageSender;
|
|
68
67
|
exports.WebhookMessageSender = WebhookMessageSender;
|
|
69
68
|
exports.routeByChannel = routeByChannel;
|
package/dist/host/senders.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { MessageSender, OutboundMessage } from "../engine/ports.cjs";
|
|
2
2
|
import "../engine/index.cjs";
|
|
3
|
-
//#region src/host/senders.d.ts
|
|
4
3
|
/** Development sender: structured logs, for eyeballing the pipeline. */
|
|
5
4
|
export declare class LogMessageSender implements MessageSender {
|
|
6
5
|
send(message: OutboundMessage): Promise<void>;
|
|
@@ -32,5 +31,4 @@ export declare function routeByChannel(senders: Partial<Record<OutboundMessage['
|
|
|
32
31
|
* rather than guessing or retrying the same configuration.
|
|
33
32
|
*/
|
|
34
33
|
export declare function routeByPlatform(senders: Record<string, MessageSender>): MessageSender;
|
|
35
|
-
//#endregion
|
|
36
34
|
//# sourceMappingURL=senders.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"senders.d.cts","names":[],"sources":["../../src/host/senders.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"senders.d.cts","names":[],"sources":["../../src/host/senders.ts"],"mappings":";;;qBAIa,4BAA4B;EACjC,KAAK,SAAS,kBAAkB;;;;;;;;;qBAa3B,gCAAgC;mBAExB;mBACA;EAFnB,YACmB,aACA,mBAAkB;EAG/B,KAAK,SAAS,kBAAkB;;;;;;;wBAsBxB,eACd,SAAS,QAAQ,OAAO,4BAA4B,kBACnD;;;;;;;;wBAmBa,gBAAgB,SAAS,eAAe,iBAAiB"}
|
package/dist/host/senders.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { MessageSender, OutboundMessage } from "../engine/ports.mjs";
|
|
2
2
|
import "../engine/index.mjs";
|
|
3
|
-
//#region src/host/senders.d.ts
|
|
4
3
|
/** Development sender: structured logs, for eyeballing the pipeline. */
|
|
5
4
|
export declare class LogMessageSender implements MessageSender {
|
|
6
5
|
send(message: OutboundMessage): Promise<void>;
|
|
@@ -32,5 +31,4 @@ export declare function routeByChannel(senders: Partial<Record<OutboundMessage['
|
|
|
32
31
|
* rather than guessing or retrying the same configuration.
|
|
33
32
|
*/
|
|
34
33
|
export declare function routeByPlatform(senders: Record<string, MessageSender>): MessageSender;
|
|
35
|
-
//#endregion
|
|
36
34
|
//# sourceMappingURL=senders.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"senders.d.mts","names":[],"sources":["../../src/host/senders.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"senders.d.mts","names":[],"sources":["../../src/host/senders.ts"],"mappings":";;;qBAIa,4BAA4B;EACjC,KAAK,SAAS,kBAAkB;;;;;;;;;qBAa3B,gCAAgC;mBAExB;mBACA;EAFnB,YACmB,aACA,mBAAkB;EAG/B,KAAK,SAAS,kBAAkB;;;;;;;wBAsBxB,eACd,SAAS,QAAQ,OAAO,4BAA4B,kBACnD;;;;;;;;wBAmBa,gBAAgB,SAAS,eAAe,iBAAiB"}
|
package/dist/host/senders.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PermanentError, isRetryableStatus } from "../engine/retry.mjs";
|
|
2
|
-
|
|
2
|
+
// src/host/senders.ts
|
|
3
3
|
/** Development sender: structured logs, for eyeballing the pipeline. */
|
|
4
4
|
var LogMessageSender = class {
|
|
5
5
|
async send(message) {
|
|
@@ -62,7 +62,6 @@ function routeByPlatform(senders) {
|
|
|
62
62
|
return senders[platform].send(message);
|
|
63
63
|
} };
|
|
64
64
|
}
|
|
65
|
-
//#endregion
|
|
66
65
|
export { LogMessageSender, WebhookMessageSender, routeByChannel, routeByPlatform };
|
|
67
66
|
|
|
68
67
|
//# sourceMappingURL=senders.mjs.map
|
package/dist/http2-client.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let node_http2 = require("node:http2");
|
|
3
|
-
|
|
3
|
+
// src/http2-client.ts
|
|
4
4
|
function http2Sessions() {
|
|
5
5
|
const sessions = /* @__PURE__ */ new Map();
|
|
6
6
|
return {
|
|
@@ -83,7 +83,6 @@ function http2Fetch(pool = http2Sessions(), options = {}) {
|
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
//#endregion
|
|
87
86
|
exports.http2Fetch = http2Fetch;
|
|
88
87
|
exports.http2Sessions = http2Sessions;
|
|
89
88
|
|
package/dist/http2-client.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ClientHttp2Session } from "node:http2";
|
|
2
|
-
//#region src/http2-client.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* A Node HTTP/2 client: one session per origin, reused while it lives. APNs speaks HTTP/2 only
|
|
5
4
|
* and Node's `fetch` does not negotiate it, so a Node host (a Lambda, the development relay)
|
|
@@ -43,5 +42,4 @@ export declare function http2Fetch(pool?: Http2Sessions, options?: {
|
|
|
43
42
|
*/
|
|
44
43
|
timeoutMs?: number;
|
|
45
44
|
}): typeof fetch;
|
|
46
|
-
//#endregion
|
|
47
45
|
//# sourceMappingURL=http2-client.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http2-client.d.cts","names":[],"sources":["../src/http2-client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"http2-client.d.cts","names":[],"sources":["../src/http2-client.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAuBiB;EACf,QAAQ,iBAAiB;;;;;EAKzB,QAAQ,gBAAgB,SAAS;EACjC;;wBAGc,iBAAiB;;;;;;wBAgCjB,WACd,OAAM,eACN;;;;;;EAME;WAEM"}
|
package/dist/http2-client.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ClientHttp2Session } from "node:http2";
|
|
2
|
-
//#region src/http2-client.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* A Node HTTP/2 client: one session per origin, reused while it lives. APNs speaks HTTP/2 only
|
|
5
4
|
* and Node's `fetch` does not negotiate it, so a Node host (a Lambda, the development relay)
|
|
@@ -43,5 +42,4 @@ export declare function http2Fetch(pool?: Http2Sessions, options?: {
|
|
|
43
42
|
*/
|
|
44
43
|
timeoutMs?: number;
|
|
45
44
|
}): typeof fetch;
|
|
46
|
-
//#endregion
|
|
47
45
|
//# sourceMappingURL=http2-client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http2-client.d.mts","names":[],"sources":["../src/http2-client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"http2-client.d.mts","names":[],"sources":["../src/http2-client.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAuBiB;EACf,QAAQ,iBAAiB;;;;;EAKzB,QAAQ,gBAAgB,SAAS;EACjC;;wBAGc,iBAAiB;;;;;;wBAgCjB,WACd,OAAM,eACN;;;;;;EAME;WAEM"}
|
package/dist/http2-client.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { connect } from "node:http2";
|
|
2
|
-
|
|
2
|
+
// src/http2-client.ts
|
|
3
3
|
function http2Sessions() {
|
|
4
4
|
const sessions = /* @__PURE__ */ new Map();
|
|
5
5
|
return {
|
|
@@ -82,7 +82,6 @@ function http2Fetch(pool = http2Sessions(), options = {}) {
|
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
//#endregion
|
|
86
85
|
export { http2Fetch, http2Sessions };
|
|
87
86
|
|
|
88
87
|
//# sourceMappingURL=http2-client.mjs.map
|
package/dist/ir.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
3
3
|
let zod_mini = require("zod/mini");
|
|
4
4
|
zod_mini = require_runtime.__toESM(zod_mini, 1);
|
|
5
|
-
|
|
5
|
+
// src/ir.ts
|
|
6
6
|
/**
|
|
7
7
|
* IR (Intermediate Representation) — what the DSL compiles to: serializable
|
|
8
8
|
* JSON. It is the three-way contract between the engine that interprets it,
|
|
@@ -339,7 +339,6 @@ const BundleIR = zod_mini.object({
|
|
|
339
339
|
templates: zod_mini.array(TemplateIR),
|
|
340
340
|
actions: zod_mini.array(ActionIR)
|
|
341
341
|
});
|
|
342
|
-
//#endregion
|
|
343
342
|
exports.ActionIR = ActionIR;
|
|
344
343
|
exports.BundleIR = BundleIR;
|
|
345
344
|
exports.ChannelIR = ChannelIR;
|
package/dist/ir.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as z from "zod/mini";
|
|
2
|
-
//#region src/ir.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* IR (Intermediate Representation) — what the DSL compiles to: serializable
|
|
5
4
|
* JSON. It is the three-way contract between the engine that interprets it,
|
|
@@ -473,6 +472,5 @@ export declare const BundleIR: z.ZodMiniObject<{
|
|
|
473
472
|
}, z.core.$strip>>;
|
|
474
473
|
}, z.core.$strip>;
|
|
475
474
|
export type BundleIR = z.infer<typeof BundleIR>;
|
|
476
|
-
//#endregion
|
|
477
475
|
export {};
|
|
478
476
|
//# sourceMappingURL=ir.d.cts.map
|
package/dist/ir.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ir.d.cts","names":[],"sources":["../src/ir.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ir.d.cts","names":[],"sources":["../src/ir.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA6Ca;qBAIA,UAAQ,EAAA,uBAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA;YACT,WAAW,EAAE,aAAa;;qBAUzB,YAAU,EAAA;;;GAAkD,EAAA,KAAA;YAC7D,aAAa,EAAE,aAAa;;qBAG3B,mBAAiB,EAAA;;;GAG5B,EAAA,KAAA;YACU,oBAAoB,EAAE,aAAa;;qBAGlC,aAAW,EAAA,uBAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA,2BAAA,EAAA;;;GAAyC,EAAA,KAAA;YACrD,cAAc,EAAE,aAAa;qBAE5B,WAAS,EAAA;;;;;;;;;YACV,YAAY,EAAE,aAAa;qBAE1B,WAAS,EAAA;;;;;;;;;YACV,YAAY,EAAE,aAAa;;;;;;;qBAU1B,aAAW,EAAA;;;;GAItB,EAAA,KAAA;YACU,cAAc,EAAE,aAAa;;qBAG5B,YAAU,EAAA;;;;;;GAErB,EAAA,KAAA;YACU,aAAa,EAAE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;;;;;;;;;;;;;;;;;;;GAUrB,EAAA,KAAA;YACU,aAAa,EAAE,aAAa;qBAE3B,WAAS,EAAA;;;;;;;;;;;;;;GAQpB,EAAA,KAAA;YACU,YAAY,EAAE,aAAa;;qBAG1B,YAAU,EAAA;;;;;;;;;;;;GAIrB,EAAA,KAAA;YACU,aAAa,EAAE,aAAa;;;;;;qBAO3B,UAAQ,EAAA;;;GAGnB,EAAA,KAAA;YACU,WAAW,EAAE,aAAa;;;;;;qBAOzB,UAAQ,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAMnB,EAAA,KAAA;YACU,WAAW,EAAE,aAAa"}
|
package/dist/ir.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as z from "zod/mini";
|
|
2
|
-
//#region src/ir.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* IR (Intermediate Representation) — what the DSL compiles to: serializable
|
|
5
4
|
* JSON. It is the three-way contract between the engine that interprets it,
|
|
@@ -473,6 +472,5 @@ export declare const BundleIR: z.ZodMiniObject<{
|
|
|
473
472
|
}, z.core.$strip>>;
|
|
474
473
|
}, z.core.$strip>;
|
|
475
474
|
export type BundleIR = z.infer<typeof BundleIR>;
|
|
476
|
-
//#endregion
|
|
477
475
|
export {};
|
|
478
476
|
//# sourceMappingURL=ir.d.mts.map
|
package/dist/ir.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ir.d.mts","names":[],"sources":["../src/ir.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ir.d.mts","names":[],"sources":["../src/ir.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA6Ca;qBAIA,UAAQ,EAAA,uBAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA;YACT,WAAW,EAAE,aAAa;;qBAUzB,YAAU,EAAA;;;GAAkD,EA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T,iCAAiC;MAElC;EACC;EACA;IAAS;IAA4B,WAAW;IAAa,MAAM;;;EAEnE,YAAY;MAEb;EACC;;EAEA;EACA,WAAW;MAEZ;EACC;;;;;;;EAOA;;;;;;;EAOA;IAAQ;IAAc;IAAgB,MAAM;;MAE7C;;EAEC;EACA;MAED;EAAe;EAAoB;EAAe,SAAS,eAAe;MAC1E;EACC;;EAEA;;EAEA,MAAM,eAAe;;qBAKd,QAAQ,EAAE,YAAY;qBAoEtB,QAAM,EAAA;;;;;;;GAIjB,EAAA,KAAA;YACU,SAAS,EAAE,aAAa;;;;;;qBAOvB,QAAM,EAAA;;;;;;;;GAUjB,EAAA,KAAA;YACU,SAAS,EAAE,aAAa;qBAEvB,YAAU,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAUrB,EAAA,KAAA;YACU,aAAa,EAAE,aAAa;qBAE3B,WAAS,EAAA;;;;;;;;;;;;;;GAQpB,EAAA,KAAA;YACU,YAAY,EAAE,aAAa;;qBAG1B,YAAU,EAAA;;;;;;;;;;;;GAIrB,EAAA,KAAA;YACU,aAAa,EAAE,aAAa;;;;;;qBAO3B,UAAQ,EAAA;;;GAGnB,EAAA,KAAA;YACU,WAAW,EAAE,aAAa;;;;;;qBAOzB,UAAQ,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAMnB,EAAA,KAAA;YACU,WAAW,EAAE,aAAa"}
|
package/dist/ir.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/mini";
|
|
2
|
-
|
|
2
|
+
// src/ir.ts
|
|
3
3
|
/**
|
|
4
4
|
* IR (Intermediate Representation) — what the DSL compiles to: serializable
|
|
5
5
|
* JSON. It is the three-way contract between the engine that interprets it,
|
|
@@ -336,7 +336,6 @@ const BundleIR = z.object({
|
|
|
336
336
|
templates: z.array(TemplateIR),
|
|
337
337
|
actions: z.array(ActionIR)
|
|
338
338
|
});
|
|
339
|
-
//#endregion
|
|
340
339
|
export { ActionIR, BundleIR, ChannelIR, ConditionIR, DurationIR, GoalIR, IR_VERSION, MetaIR, NodeIR, NodeMetaIR, PropValueIR, PropertyOperatorIR, ScalarIR, SegmentIR, SourceLocIR, TemplateIR, TriggerIR, UserPropertyRefIR, WeekdayIR, WorkflowIR };
|
|
341
340
|
|
|
342
341
|
//# sourceMappingURL=ir.mjs.map
|
package/dist/jwt.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let node_buffer = require("node:buffer");
|
|
3
|
-
|
|
3
|
+
// src/jwt.ts
|
|
4
4
|
/**
|
|
5
5
|
* The byte-level helpers the token signers share (`fcm.ts`, `apns.ts`, `webpush.ts`): JWT
|
|
6
6
|
* base64url and PEM → DER for WebCrypto's `importKey('pkcs8', …)`.
|
|
@@ -11,7 +11,6 @@ function pemToDer(pem) {
|
|
|
11
11
|
const der = node_buffer.Buffer.from(body, "base64");
|
|
12
12
|
return der.buffer.slice(der.byteOffset, der.byteOffset + der.byteLength);
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
exports.base64url = base64url;
|
|
16
15
|
exports.pemToDer = pemToDer;
|
|
17
16
|
|
package/dist/jwt.d.cts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
//#region src/jwt.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The byte-level helpers the token signers share (`fcm.ts`, `apns.ts`, `webpush.ts`): JWT
|
|
4
3
|
* base64url and PEM → DER for WebCrypto's `importKey('pkcs8', …)`.
|
|
5
4
|
*/
|
|
6
5
|
export declare const base64url: (bytes: Uint8Array | string) => string;
|
|
7
6
|
export declare function pemToDer(pem: string): ArrayBuffer;
|
|
8
|
-
//#endregion
|
|
9
7
|
//# sourceMappingURL=jwt.d.cts.map
|
package/dist/jwt.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.d.cts","names":[],"sources":["../src/jwt.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"jwt.d.cts","names":[],"sources":["../src/jwt.ts"],"mappings":";;;;qBAOa,YAAS,OAAW;wBAGjB,SAAS,cAAc"}
|
package/dist/jwt.d.mts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
//#region src/jwt.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The byte-level helpers the token signers share (`fcm.ts`, `apns.ts`, `webpush.ts`): JWT
|
|
4
3
|
* base64url and PEM → DER for WebCrypto's `importKey('pkcs8', …)`.
|
|
5
4
|
*/
|
|
6
5
|
export declare const base64url: (bytes: Uint8Array | string) => string;
|
|
7
6
|
export declare function pemToDer(pem: string): ArrayBuffer;
|
|
8
|
-
//#endregion
|
|
9
7
|
//# sourceMappingURL=jwt.d.mts.map
|
package/dist/jwt.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.d.mts","names":[],"sources":["../src/jwt.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"jwt.d.mts","names":[],"sources":["../src/jwt.ts"],"mappings":";;;;qBAOa,YAAS,OAAW;wBAGjB,SAAS,cAAc"}
|
package/dist/jwt.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
|
-
|
|
2
|
+
// src/jwt.ts
|
|
3
3
|
/**
|
|
4
4
|
* The byte-level helpers the token signers share (`fcm.ts`, `apns.ts`, `webpush.ts`): JWT
|
|
5
5
|
* base64url and PEM → DER for WebCrypto's `importKey('pkcs8', …)`.
|
|
@@ -10,7 +10,6 @@ function pemToDer(pem) {
|
|
|
10
10
|
const der = Buffer.from(body, "base64");
|
|
11
11
|
return der.buffer.slice(der.byteOffset, der.byteOffset + der.byteLength);
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
export { base64url, pemToDer };
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=jwt.mjs.map
|
package/dist/plan.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_hash = require("./hash.cjs");
|
|
3
|
-
|
|
3
|
+
// src/plan.ts
|
|
4
4
|
/** Whether a status warrants human attention (metadata-only edits do not). */
|
|
5
5
|
function isSemanticChange(status) {
|
|
6
6
|
return status === "added" || status === "removed" || status === "changed";
|
|
@@ -210,7 +210,6 @@ function plan(local, deployed) {
|
|
|
210
210
|
].some((change) => isSemanticChange(change.status))
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
//#endregion
|
|
214
213
|
exports.isSemanticChange = isSemanticChange;
|
|
215
214
|
exports.plan = plan;
|
|
216
215
|
|
package/dist/plan.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BundleIR, NodeIR } from "./ir.cjs";
|
|
2
|
-
//#region src/plan.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Plan — the diff between local definitions and what is deployed (terraform
|
|
5
4
|
* plan, same mental model).
|
|
@@ -64,5 +63,4 @@ export interface BundlePlan {
|
|
|
64
63
|
* if (changes.hasChanges) { ... }
|
|
65
64
|
*/
|
|
66
65
|
export declare function plan(local: BundleIR, deployed?: BundleIR): BundlePlan;
|
|
67
|
-
//#endregion
|
|
68
66
|
//# sourceMappingURL=plan.d.cts.map
|
package/dist/plan.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.cts","names":[],"sources":["../src/plan.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plan.d.cts","names":[],"sources":["../src/plan.ts"],"mappings":";;;;;;;;;;;;;;;;YAmBY;;wBAGI,iBAAiB,QAAQ;iBAIxB;EACf;EACA;;EAEA,MAAM;;iBAGS;;EAEf;EACA,QAAQ;;EAER;;EAEA;;EAEA;;;;;;;EAOA,OAAO;;iBAGQ;;EAEf;EACA,QAAQ;EACR;EACA;;iBAGe;EACf,WAAW;EACX,UAAU;EACV,WAAW;EACX,SAAS;;EAET;;;;;;;;wBA2Nc,KAAK,OAAO,UAAU,WAAW,WAAW"}
|
package/dist/plan.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BundleIR, NodeIR } from "./ir.mjs";
|
|
2
|
-
//#region src/plan.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Plan — the diff between local definitions and what is deployed (terraform
|
|
5
4
|
* plan, same mental model).
|
|
@@ -64,5 +63,4 @@ export interface BundlePlan {
|
|
|
64
63
|
* if (changes.hasChanges) { ... }
|
|
65
64
|
*/
|
|
66
65
|
export declare function plan(local: BundleIR, deployed?: BundleIR): BundlePlan;
|
|
67
|
-
//#endregion
|
|
68
66
|
//# sourceMappingURL=plan.d.mts.map
|
package/dist/plan.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.mts","names":[],"sources":["../src/plan.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plan.d.mts","names":[],"sources":["../src/plan.ts"],"mappings":";;;;;;;;;;;;;;;;YAmBY;;wBAGI,iBAAiB,QAAQ;iBAIxB;EACf;EACA;;EAEA,MAAM;;iBAGS;;EAEf;EACA,QAAQ;;EAER;;EAEA;;EAEA;;;;;;;EAOA,OAAO;;iBAGQ;;EAEf;EACA,QAAQ;EACR;EACA;;iBAGe;EACf,WAAW;EACX,UAAU;EACV,WAAW;EACX,SAAS;;EAET;;;;;;;;wBA2Nc,KAAK,OAAO,UAAU,WAAW,WAAW"}
|