sendwend 0.0.0-stage → 12.7.3
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/LICENSE +21 -0
- package/README.md +2082 -2
- package/dist/_virtual/_rolldown/runtime.cjs +22 -0
- package/dist/apns-relay.cjs +91 -0
- package/dist/apns-relay.cjs.map +1 -0
- package/dist/apns-relay.d.cts +26 -0
- package/dist/apns-relay.d.cts.map +1 -0
- package/dist/apns-relay.d.mts +26 -0
- package/dist/apns-relay.d.mts.map +1 -0
- package/dist/apns-relay.mjs +90 -0
- package/dist/apns-relay.mjs.map +1 -0
- package/dist/apns.cjs +215 -0
- package/dist/apns.cjs.map +1 -0
- package/dist/apns.d.cts +110 -0
- package/dist/apns.d.cts.map +1 -0
- package/dist/apns.d.mts +110 -0
- package/dist/apns.d.mts.map +1 -0
- package/dist/apns.mjs +207 -0
- package/dist/apns.mjs.map +1 -0
- package/dist/aws/engine-step.cjs +105 -0
- package/dist/aws/engine-step.cjs.map +1 -0
- package/dist/aws/engine-step.d.cts +42 -0
- package/dist/aws/engine-step.d.cts.map +1 -0
- package/dist/aws/engine-step.d.mts +42 -0
- package/dist/aws/engine-step.d.mts.map +1 -0
- package/dist/aws/engine-step.mjs +103 -0
- package/dist/aws/engine-step.mjs.map +1 -0
- package/dist/aws/function-url.cjs +53 -0
- package/dist/aws/function-url.cjs.map +1 -0
- package/dist/aws/function-url.d.cts +36 -0
- package/dist/aws/function-url.d.cts.map +1 -0
- package/dist/aws/function-url.d.mts +36 -0
- package/dist/aws/function-url.d.mts.map +1 -0
- package/dist/aws/function-url.mjs +50 -0
- package/dist/aws/function-url.mjs.map +1 -0
- package/dist/aws/index.cjs +232 -0
- package/dist/aws/index.cjs.map +1 -0
- package/dist/aws/index.d.cts +73 -0
- package/dist/aws/index.d.cts.map +1 -0
- package/dist/aws/index.d.mts +73 -0
- package/dist/aws/index.d.mts.map +1 -0
- package/dist/aws/index.mjs +218 -0
- package/dist/aws/index.mjs.map +1 -0
- package/dist/aws/instances.cjs +218 -0
- package/dist/aws/instances.cjs.map +1 -0
- package/dist/aws/instances.d.cts +102 -0
- package/dist/aws/instances.d.cts.map +1 -0
- package/dist/aws/instances.d.mts +102 -0
- package/dist/aws/instances.d.mts.map +1 -0
- package/dist/aws/instances.mjs +214 -0
- package/dist/aws/instances.mjs.map +1 -0
- package/dist/aws/lambda-api.cjs +86 -0
- package/dist/aws/lambda-api.cjs.map +1 -0
- package/dist/aws/lambda-api.d.cts +41 -0
- package/dist/aws/lambda-api.d.cts.map +1 -0
- package/dist/aws/lambda-api.d.mts +41 -0
- package/dist/aws/lambda-api.d.mts.map +1 -0
- package/dist/aws/lambda-api.mjs +85 -0
- package/dist/aws/lambda-api.mjs.map +1 -0
- package/dist/client.cjs +216 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +193 -0
- package/dist/client.d.cts.map +1 -0
- package/dist/client.d.mts +193 -0
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +212 -0
- package/dist/client.mjs.map +1 -0
- package/dist/cloudflare/bindings.cjs +49 -0
- package/dist/cloudflare/bindings.cjs.map +1 -0
- package/dist/cloudflare/bindings.d.cts +31 -0
- package/dist/cloudflare/bindings.d.cts.map +1 -0
- package/dist/cloudflare/bindings.d.mts +31 -0
- package/dist/cloudflare/bindings.d.mts.map +1 -0
- package/dist/cloudflare/bindings.mjs +46 -0
- package/dist/cloudflare/bindings.mjs.map +1 -0
- package/dist/cloudflare/index.cjs +73 -0
- package/dist/cloudflare/index.d.cts +25 -0
- package/dist/cloudflare/index.d.mts +25 -0
- package/dist/cloudflare/index.mjs +20 -0
- package/dist/cloudflare/runner.cjs +200 -0
- package/dist/cloudflare/runner.cjs.map +1 -0
- package/dist/cloudflare/runner.d.cts +83 -0
- package/dist/cloudflare/runner.d.cts.map +1 -0
- package/dist/cloudflare/runner.d.mts +83 -0
- package/dist/cloudflare/runner.d.mts.map +1 -0
- package/dist/cloudflare/runner.mjs +199 -0
- package/dist/cloudflare/runner.mjs.map +1 -0
- package/dist/cloudflare/worker.cjs +106 -0
- package/dist/cloudflare/worker.cjs.map +1 -0
- package/dist/cloudflare/worker.d.cts +52 -0
- package/dist/cloudflare/worker.d.cts.map +1 -0
- package/dist/cloudflare/worker.d.mts +52 -0
- package/dist/cloudflare/worker.d.mts.map +1 -0
- package/dist/cloudflare/worker.mjs +104 -0
- package/dist/cloudflare/worker.mjs.map +1 -0
- package/dist/cloudflare/workers.d.cjs +0 -0
- package/dist/cloudflare/workers.d.cts +42 -0
- package/dist/cloudflare/workers.d.cts.map +1 -0
- package/dist/cloudflare/workers.d.mts +42 -0
- package/dist/cloudflare/workers.d.mts.map +1 -0
- package/dist/config.cjs +257 -0
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +184 -0
- package/dist/config.d.cts.map +1 -0
- package/dist/config.d.mts +184 -0
- package/dist/config.d.mts.map +1 -0
- package/dist/config.mjs +246 -0
- package/dist/config.mjs.map +1 -0
- package/dist/contract.cjs +222 -0
- package/dist/contract.cjs.map +1 -0
- package/dist/contract.d.cts +110 -0
- package/dist/contract.d.cts.map +1 -0
- package/dist/contract.d.mts +110 -0
- package/dist/contract.d.mts.map +1 -0
- package/dist/contract.mjs +216 -0
- package/dist/contract.mjs.map +1 -0
- package/dist/date-time.cjs +22 -0
- package/dist/date-time.cjs.map +1 -0
- package/dist/date-time.d.cts +10 -0
- package/dist/date-time.d.cts.map +1 -0
- package/dist/date-time.d.mts +10 -0
- package/dist/date-time.d.mts.map +1 -0
- package/dist/date-time.mjs +21 -0
- package/dist/date-time.mjs.map +1 -0
- package/dist/dsl/action.cjs +25 -0
- package/dist/dsl/action.cjs.map +1 -0
- package/dist/dsl/action.d.cts +63 -0
- package/dist/dsl/action.d.cts.map +1 -0
- package/dist/dsl/action.d.mts +63 -0
- package/dist/dsl/action.d.mts.map +1 -0
- package/dist/dsl/action.mjs +24 -0
- package/dist/dsl/action.mjs.map +1 -0
- package/dist/dsl/base.cjs +33 -0
- package/dist/dsl/base.cjs.map +1 -0
- package/dist/dsl/base.d.cts +43 -0
- package/dist/dsl/base.d.cts.map +1 -0
- package/dist/dsl/base.d.mts +43 -0
- package/dist/dsl/base.d.mts.map +1 -0
- package/dist/dsl/base.mjs +29 -0
- package/dist/dsl/base.mjs.map +1 -0
- package/dist/dsl/bundle.cjs +287 -0
- package/dist/dsl/bundle.cjs.map +1 -0
- package/dist/dsl/bundle.d.cts +33 -0
- package/dist/dsl/bundle.d.cts.map +1 -0
- package/dist/dsl/bundle.d.mts +33 -0
- package/dist/dsl/bundle.d.mts.map +1 -0
- package/dist/dsl/bundle.mjs +284 -0
- package/dist/dsl/bundle.mjs.map +1 -0
- package/dist/dsl/condition.cjs +200 -0
- package/dist/dsl/condition.cjs.map +1 -0
- package/dist/dsl/condition.d.cts +151 -0
- package/dist/dsl/condition.d.cts.map +1 -0
- package/dist/dsl/condition.d.mts +151 -0
- package/dist/dsl/condition.d.mts.map +1 -0
- package/dist/dsl/condition.mjs +178 -0
- package/dist/dsl/condition.mjs.map +1 -0
- package/dist/dsl/flow.cjs +335 -0
- package/dist/dsl/flow.cjs.map +1 -0
- package/dist/dsl/flow.d.cts +278 -0
- package/dist/dsl/flow.d.cts.map +1 -0
- package/dist/dsl/flow.d.mts +278 -0
- package/dist/dsl/flow.d.mts.map +1 -0
- package/dist/dsl/flow.mjs +331 -0
- package/dist/dsl/flow.mjs.map +1 -0
- package/dist/dsl/index.cjs +37 -0
- package/dist/dsl/index.d.cts +34 -0
- package/dist/dsl/index.d.mts +34 -0
- package/dist/dsl/index.mjs +9 -0
- package/dist/dsl/refs.cjs +101 -0
- package/dist/dsl/refs.cjs.map +1 -0
- package/dist/dsl/refs.d.cts +127 -0
- package/dist/dsl/refs.d.cts.map +1 -0
- package/dist/dsl/refs.d.mts +127 -0
- package/dist/dsl/refs.d.mts.map +1 -0
- package/dist/dsl/refs.mjs +93 -0
- package/dist/dsl/refs.mjs.map +1 -0
- package/dist/dsl/template.cjs +19 -0
- package/dist/dsl/template.cjs.map +1 -0
- package/dist/dsl/template.d.cts +30 -0
- package/dist/dsl/template.d.cts.map +1 -0
- package/dist/dsl/template.d.mts +30 -0
- package/dist/dsl/template.d.mts.map +1 -0
- package/dist/dsl/template.mjs +18 -0
- package/dist/dsl/template.mjs.map +1 -0
- package/dist/dsl/trigger.cjs +53 -0
- package/dist/dsl/trigger.cjs.map +1 -0
- package/dist/dsl/trigger.d.cts +112 -0
- package/dist/dsl/trigger.d.cts.map +1 -0
- package/dist/dsl/trigger.d.mts +112 -0
- package/dist/dsl/trigger.d.mts.map +1 -0
- package/dist/dsl/trigger.mjs +52 -0
- package/dist/dsl/trigger.mjs.map +1 -0
- package/dist/dsl/workflow.cjs +143 -0
- package/dist/dsl/workflow.cjs.map +1 -0
- package/dist/dsl/workflow.d.cts +88 -0
- package/dist/dsl/workflow.d.cts.map +1 -0
- package/dist/dsl/workflow.d.mts +88 -0
- package/dist/dsl/workflow.d.mts.map +1 -0
- package/dist/dsl/workflow.mjs +142 -0
- package/dist/dsl/workflow.mjs.map +1 -0
- package/dist/email-context.cjs +28 -0
- package/dist/email-context.cjs.map +1 -0
- package/dist/email-context.d.cts +9 -0
- package/dist/email-context.d.cts.map +1 -0
- package/dist/email-context.d.mts +9 -0
- package/dist/email-context.d.mts.map +1 -0
- package/dist/email-context.mjs +26 -0
- package/dist/email-context.mjs.map +1 -0
- package/dist/email-sender.cjs +93 -0
- package/dist/email-sender.cjs.map +1 -0
- package/dist/email-sender.d.cts +88 -0
- package/dist/email-sender.d.cts.map +1 -0
- package/dist/email-sender.d.mts +88 -0
- package/dist/email-sender.d.mts.map +1 -0
- package/dist/email-sender.mjs +90 -0
- package/dist/email-sender.mjs.map +1 -0
- package/dist/email.cjs +73 -0
- package/dist/email.cjs.map +1 -0
- package/dist/email.d.cts +59 -0
- package/dist/email.d.cts.map +1 -0
- package/dist/email.d.mts +59 -0
- package/dist/email.d.mts.map +1 -0
- package/dist/email.mjs +68 -0
- package/dist/email.mjs.map +1 -0
- package/dist/engine/actions.cjs +19 -0
- package/dist/engine/actions.cjs.map +1 -0
- package/dist/engine/actions.d.cts +27 -0
- package/dist/engine/actions.d.cts.map +1 -0
- package/dist/engine/actions.d.mts +27 -0
- package/dist/engine/actions.d.mts.map +1 -0
- package/dist/engine/actions.mjs +18 -0
- package/dist/engine/actions.mjs.map +1 -0
- package/dist/engine/bucket.cjs +71 -0
- package/dist/engine/bucket.cjs.map +1 -0
- package/dist/engine/bucket.d.cts +30 -0
- package/dist/engine/bucket.d.cts.map +1 -0
- package/dist/engine/bucket.d.mts +30 -0
- package/dist/engine/bucket.d.mts.map +1 -0
- package/dist/engine/bucket.mjs +68 -0
- package/dist/engine/bucket.mjs.map +1 -0
- package/dist/engine/condition.cjs +199 -0
- package/dist/engine/condition.cjs.map +1 -0
- package/dist/engine/condition.d.cts +76 -0
- package/dist/engine/condition.d.cts.map +1 -0
- package/dist/engine/condition.d.mts +76 -0
- package/dist/engine/condition.d.mts.map +1 -0
- package/dist/engine/condition.mjs +192 -0
- package/dist/engine/condition.mjs.map +1 -0
- package/dist/engine/duration.cjs +33 -0
- package/dist/engine/duration.cjs.map +1 -0
- package/dist/engine/duration.d.cts +3 -0
- package/dist/engine/duration.d.cts.map +1 -0
- package/dist/engine/duration.d.mts +3 -0
- package/dist/engine/duration.d.mts.map +1 -0
- package/dist/engine/duration.mjs +32 -0
- package/dist/engine/duration.mjs.map +1 -0
- package/dist/engine/index.cjs +33 -0
- package/dist/engine/index.d.cts +10 -0
- package/dist/engine/index.d.mts +10 -0
- package/dist/engine/index.mjs +9 -0
- package/dist/engine/interpreter.cjs +613 -0
- package/dist/engine/interpreter.cjs.map +1 -0
- package/dist/engine/interpreter.d.cts +4 -0
- package/dist/engine/interpreter.d.cts.map +1 -0
- package/dist/engine/interpreter.d.mts +4 -0
- package/dist/engine/interpreter.d.mts.map +1 -0
- package/dist/engine/interpreter.mjs +612 -0
- package/dist/engine/interpreter.mjs.map +1 -0
- package/dist/engine/ports.cjs +0 -0
- package/dist/engine/ports.d.cts +373 -0
- package/dist/engine/ports.d.cts.map +1 -0
- package/dist/engine/ports.d.mts +373 -0
- package/dist/engine/ports.d.mts.map +1 -0
- package/dist/engine/ports.mjs +1 -0
- package/dist/engine/recipient.cjs +22 -0
- package/dist/engine/recipient.cjs.map +1 -0
- package/dist/engine/recipient.d.cts +11 -0
- package/dist/engine/recipient.d.cts.map +1 -0
- package/dist/engine/recipient.d.mts +11 -0
- package/dist/engine/recipient.d.mts.map +1 -0
- package/dist/engine/recipient.mjs +21 -0
- package/dist/engine/recipient.mjs.map +1 -0
- package/dist/engine/retry.cjs +106 -0
- package/dist/engine/retry.cjs.map +1 -0
- package/dist/engine/retry.d.cts +73 -0
- package/dist/engine/retry.d.cts.map +1 -0
- package/dist/engine/retry.d.mts +73 -0
- package/dist/engine/retry.d.mts.map +1 -0
- package/dist/engine/retry.mjs +98 -0
- package/dist/engine/retry.mjs.map +1 -0
- package/dist/engine/time-scale.cjs +153 -0
- package/dist/engine/time-scale.cjs.map +1 -0
- package/dist/engine/time-scale.d.cts +41 -0
- package/dist/engine/time-scale.d.cts.map +1 -0
- package/dist/engine/time-scale.d.mts +41 -0
- package/dist/engine/time-scale.d.mts.map +1 -0
- package/dist/engine/time-scale.mjs +150 -0
- package/dist/engine/time-scale.mjs.map +1 -0
- package/dist/engine/time-window.cjs +148 -0
- package/dist/engine/time-window.cjs.map +1 -0
- package/dist/engine/time-window.d.cts +20 -0
- package/dist/engine/time-window.d.cts.map +1 -0
- package/dist/engine/time-window.d.mts +20 -0
- package/dist/engine/time-window.d.mts.map +1 -0
- package/dist/engine/time-window.mjs +146 -0
- package/dist/engine/time-window.mjs.map +1 -0
- package/dist/fcm.cjs +208 -0
- package/dist/fcm.cjs.map +1 -0
- package/dist/fcm.d.cts +89 -0
- package/dist/fcm.d.cts.map +1 -0
- package/dist/fcm.d.mts +89 -0
- package/dist/fcm.d.mts.map +1 -0
- package/dist/fcm.mjs +202 -0
- package/dist/fcm.mjs.map +1 -0
- package/dist/hash.cjs +244 -0
- package/dist/hash.cjs.map +1 -0
- package/dist/hash.d.cts +28 -0
- package/dist/hash.d.cts.map +1 -0
- package/dist/hash.d.mts +28 -0
- package/dist/hash.d.mts.map +1 -0
- package/dist/hash.mjs +238 -0
- package/dist/hash.mjs.map +1 -0
- package/dist/host/auth.cjs +48 -0
- package/dist/host/auth.cjs.map +1 -0
- package/dist/host/auth.d.cts +33 -0
- package/dist/host/auth.d.cts.map +1 -0
- package/dist/host/auth.d.mts +33 -0
- package/dist/host/auth.d.mts.map +1 -0
- package/dist/host/auth.mjs +45 -0
- package/dist/host/auth.mjs.map +1 -0
- package/dist/host/batch.cjs +178 -0
- package/dist/host/batch.cjs.map +1 -0
- package/dist/host/batch.d.cts +92 -0
- package/dist/host/batch.d.cts.map +1 -0
- package/dist/host/batch.d.mts +92 -0
- package/dist/host/batch.d.mts.map +1 -0
- package/dist/host/batch.mjs +169 -0
- package/dist/host/batch.mjs.map +1 -0
- package/dist/host/channels.cjs +256 -0
- package/dist/host/channels.cjs.map +1 -0
- package/dist/host/channels.d.cts +66 -0
- package/dist/host/channels.d.cts.map +1 -0
- package/dist/host/channels.d.mts +66 -0
- package/dist/host/channels.d.mts.map +1 -0
- package/dist/host/channels.mjs +252 -0
- package/dist/host/channels.mjs.map +1 -0
- package/dist/host/execute.cjs +102 -0
- package/dist/host/execute.cjs.map +1 -0
- package/dist/host/execute.d.cts +38 -0
- package/dist/host/execute.d.cts.map +1 -0
- package/dist/host/execute.d.mts +38 -0
- package/dist/host/execute.d.mts.map +1 -0
- package/dist/host/execute.mjs +101 -0
- package/dist/host/execute.mjs.map +1 -0
- package/dist/host/fresh-read.cjs +29 -0
- package/dist/host/fresh-read.cjs.map +1 -0
- package/dist/host/fresh-read.d.cts +16 -0
- package/dist/host/fresh-read.d.cts.map +1 -0
- package/dist/host/fresh-read.d.mts +16 -0
- package/dist/host/fresh-read.d.mts.map +1 -0
- package/dist/host/fresh-read.mjs +28 -0
- package/dist/host/fresh-read.mjs.map +1 -0
- package/dist/host/http.cjs +393 -0
- package/dist/host/http.cjs.map +1 -0
- package/dist/host/http.d.cts +61 -0
- package/dist/host/http.d.cts.map +1 -0
- package/dist/host/http.d.mts +61 -0
- package/dist/host/http.d.mts.map +1 -0
- package/dist/host/http.mjs +389 -0
- package/dist/host/http.mjs.map +1 -0
- package/dist/host/ingest.cjs +1210 -0
- package/dist/host/ingest.cjs.map +1 -0
- package/dist/host/ingest.d.cts +497 -0
- package/dist/host/ingest.d.cts.map +1 -0
- package/dist/host/ingest.d.mts +497 -0
- package/dist/host/ingest.d.mts.map +1 -0
- package/dist/host/ingest.mjs +1172 -0
- package/dist/host/ingest.mjs.map +1 -0
- package/dist/host/journey-host.cjs +223 -0
- package/dist/host/journey-host.cjs.map +1 -0
- package/dist/host/journey-host.d.cts +118 -0
- package/dist/host/journey-host.d.cts.map +1 -0
- package/dist/host/journey-host.d.mts +118 -0
- package/dist/host/journey-host.d.mts.map +1 -0
- package/dist/host/journey-host.mjs +219 -0
- package/dist/host/journey-host.mjs.map +1 -0
- package/dist/host/platform.cjs +20 -0
- package/dist/host/platform.cjs.map +1 -0
- package/dist/host/platform.d.cts +120 -0
- package/dist/host/platform.d.cts.map +1 -0
- package/dist/host/platform.d.mts +120 -0
- package/dist/host/platform.d.mts.map +1 -0
- package/dist/host/platform.mjs +18 -0
- package/dist/host/platform.mjs.map +1 -0
- package/dist/host/senders.cjs +71 -0
- package/dist/host/senders.cjs.map +1 -0
- package/dist/host/senders.d.cts +34 -0
- package/dist/host/senders.d.cts.map +1 -0
- package/dist/host/senders.d.mts +34 -0
- package/dist/host/senders.d.mts.map +1 -0
- package/dist/host/senders.mjs +67 -0
- package/dist/host/senders.mjs.map +1 -0
- package/dist/host/workflow-cache.cjs +47 -0
- package/dist/host/workflow-cache.cjs.map +1 -0
- package/dist/host/workflow-cache.d.cts +21 -0
- package/dist/host/workflow-cache.d.cts.map +1 -0
- package/dist/host/workflow-cache.d.mts +21 -0
- package/dist/host/workflow-cache.d.mts.map +1 -0
- package/dist/host/workflow-cache.mjs +46 -0
- package/dist/host/workflow-cache.mjs.map +1 -0
- package/dist/http2-client.cjs +89 -0
- package/dist/http2-client.cjs.map +1 -0
- package/dist/http2-client.d.cts +45 -0
- package/dist/http2-client.d.cts.map +1 -0
- package/dist/http2-client.d.mts +45 -0
- package/dist/http2-client.d.mts.map +1 -0
- package/dist/http2-client.mjs +87 -0
- package/dist/http2-client.mjs.map +1 -0
- package/dist/index.cjs +130 -0
- package/dist/index.d.cts +21 -0
- package/dist/index.d.mts +21 -0
- package/dist/index.mjs +20 -0
- package/dist/inflight.cjs +116 -0
- package/dist/inflight.cjs.map +1 -0
- package/dist/inflight.d.cts +49 -0
- package/dist/inflight.d.cts.map +1 -0
- package/dist/inflight.d.mts +49 -0
- package/dist/inflight.d.mts.map +1 -0
- package/dist/inflight.mjs +113 -0
- package/dist/inflight.mjs.map +1 -0
- package/dist/ir.cjs +429 -0
- package/dist/ir.cjs.map +1 -0
- package/dist/ir.d.cts +593 -0
- package/dist/ir.d.cts.map +1 -0
- package/dist/ir.d.mts +593 -0
- package/dist/ir.d.mts.map +1 -0
- package/dist/ir.mjs +404 -0
- package/dist/ir.mjs.map +1 -0
- package/dist/jwt.cjs +17 -0
- package/dist/jwt.cjs.map +1 -0
- package/dist/jwt.d.cts +7 -0
- package/dist/jwt.d.cts.map +1 -0
- package/dist/jwt.d.mts +7 -0
- package/dist/jwt.d.mts.map +1 -0
- package/dist/jwt.mjs +15 -0
- package/dist/jwt.mjs.map +1 -0
- package/dist/node/index.cjs +231 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.d.cts +59 -0
- package/dist/node/index.d.cts.map +1 -0
- package/dist/node/index.d.mts +59 -0
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/index.mjs +225 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node/runs.cjs +222 -0
- package/dist/node/runs.cjs.map +1 -0
- package/dist/node/runs.d.cts +93 -0
- package/dist/node/runs.d.cts.map +1 -0
- package/dist/node/runs.d.mts +93 -0
- package/dist/node/runs.d.mts.map +1 -0
- package/dist/node/runs.mjs +221 -0
- package/dist/node/runs.mjs.map +1 -0
- package/dist/node/runtime.cjs +351 -0
- package/dist/node/runtime.cjs.map +1 -0
- package/dist/node/runtime.d.cts +96 -0
- package/dist/node/runtime.d.cts.map +1 -0
- package/dist/node/runtime.d.mts +96 -0
- package/dist/node/runtime.d.mts.map +1 -0
- package/dist/node/runtime.mjs +348 -0
- package/dist/node/runtime.mjs.map +1 -0
- package/dist/plan.cjs +221 -0
- package/dist/plan.cjs.map +1 -0
- package/dist/plan.d.cts +68 -0
- package/dist/plan.d.cts.map +1 -0
- package/dist/plan.d.mts +68 -0
- package/dist/plan.d.mts.map +1 -0
- package/dist/plan.mjs +218 -0
- package/dist/plan.mjs.map +1 -0
- package/dist/postgres-js.cjs +51 -0
- package/dist/postgres-js.cjs.map +1 -0
- package/dist/postgres-js.d.cts +32 -0
- package/dist/postgres-js.d.cts.map +1 -0
- package/dist/postgres-js.d.mts +32 -0
- package/dist/postgres-js.d.mts.map +1 -0
- package/dist/postgres-js.mjs +46 -0
- package/dist/postgres-js.mjs.map +1 -0
- package/dist/provenance.cjs +66 -0
- package/dist/provenance.cjs.map +1 -0
- package/dist/provenance.d.cts +40 -0
- package/dist/provenance.d.cts.map +1 -0
- package/dist/provenance.d.mts +40 -0
- package/dist/provenance.d.mts.map +1 -0
- package/dist/provenance.mjs +64 -0
- package/dist/provenance.mjs.map +1 -0
- package/dist/push.cjs +11 -0
- package/dist/push.cjs.map +1 -0
- package/dist/push.d.cts +14 -0
- package/dist/push.d.cts.map +1 -0
- package/dist/push.d.mts +14 -0
- package/dist/push.d.mts.map +1 -0
- package/dist/push.mjs +10 -0
- package/dist/push.mjs.map +1 -0
- package/dist/react-email.cjs +56 -0
- package/dist/react-email.cjs.map +1 -0
- package/dist/react-email.d.cts +5 -0
- package/dist/react-email.d.cts.map +1 -0
- package/dist/react-email.d.mts +5 -0
- package/dist/react-email.d.mts.map +1 -0
- package/dist/react-email.mjs +55 -0
- package/dist/react-email.mjs.map +1 -0
- package/dist/reporting/classify.cjs +46 -0
- package/dist/reporting/classify.cjs.map +1 -0
- package/dist/reporting/classify.d.cts +65 -0
- package/dist/reporting/classify.d.cts.map +1 -0
- package/dist/reporting/classify.d.mts +65 -0
- package/dist/reporting/classify.d.mts.map +1 -0
- package/dist/reporting/classify.mjs +42 -0
- package/dist/reporting/classify.mjs.map +1 -0
- package/dist/reporting/observer.cjs +137 -0
- package/dist/reporting/observer.cjs.map +1 -0
- package/dist/reporting/observer.d.cts +31 -0
- package/dist/reporting/observer.d.cts.map +1 -0
- package/dist/reporting/observer.d.mts +31 -0
- package/dist/reporting/observer.d.mts.map +1 -0
- package/dist/reporting/observer.mjs +134 -0
- package/dist/reporting/observer.mjs.map +1 -0
- package/dist/reporting/tracking.cjs +185 -0
- package/dist/reporting/tracking.cjs.map +1 -0
- package/dist/reporting/tracking.d.cts +63 -0
- package/dist/reporting/tracking.d.cts.map +1 -0
- package/dist/reporting/tracking.d.mts +63 -0
- package/dist/reporting/tracking.d.mts.map +1 -0
- package/dist/reporting/tracking.mjs +182 -0
- package/dist/reporting/tracking.mjs.map +1 -0
- package/dist/runtime.cjs +18 -0
- package/dist/runtime.cjs.map +1 -0
- package/dist/runtime.d.cts +44 -0
- package/dist/runtime.d.cts.map +1 -0
- package/dist/runtime.d.mts +44 -0
- package/dist/runtime.d.mts.map +1 -0
- package/dist/runtime.mjs +17 -0
- package/dist/runtime.mjs.map +1 -0
- package/dist/store/condition-sql.cjs +145 -0
- package/dist/store/condition-sql.cjs.map +1 -0
- package/dist/store/condition-sql.d.cts +38 -0
- package/dist/store/condition-sql.d.cts.map +1 -0
- package/dist/store/condition-sql.d.mts +38 -0
- package/dist/store/condition-sql.d.mts.map +1 -0
- package/dist/store/condition-sql.mjs +144 -0
- package/dist/store/condition-sql.mjs.map +1 -0
- package/dist/store/erasure.cjs +21 -0
- package/dist/store/erasure.cjs.map +1 -0
- package/dist/store/erasure.d.cts +16 -0
- package/dist/store/erasure.d.cts.map +1 -0
- package/dist/store/erasure.d.mts +16 -0
- package/dist/store/erasure.d.mts.map +1 -0
- package/dist/store/erasure.mjs +20 -0
- package/dist/store/erasure.mjs.map +1 -0
- package/dist/store/facts.cjs +79 -0
- package/dist/store/facts.cjs.map +1 -0
- package/dist/store/facts.d.cts +41 -0
- package/dist/store/facts.d.cts.map +1 -0
- package/dist/store/facts.d.mts +41 -0
- package/dist/store/facts.d.mts.map +1 -0
- package/dist/store/facts.mjs +77 -0
- package/dist/store/facts.mjs.map +1 -0
- package/dist/store/identity.cjs +34 -0
- package/dist/store/identity.cjs.map +1 -0
- package/dist/store/identity.d.cts +13 -0
- package/dist/store/identity.d.cts.map +1 -0
- package/dist/store/identity.d.mts +13 -0
- package/dist/store/identity.d.mts.map +1 -0
- package/dist/store/identity.mjs +30 -0
- package/dist/store/identity.mjs.map +1 -0
- package/dist/store/index.cjs +35 -0
- package/dist/store/index.cjs.map +1 -0
- package/dist/store/index.d.cts +766 -0
- package/dist/store/index.d.cts.map +1 -0
- package/dist/store/index.d.mts +766 -0
- package/dist/store/index.d.mts.map +1 -0
- package/dist/store/index.mjs +22 -0
- package/dist/store/index.mjs.map +1 -0
- package/dist/store/postgres-reporting.cjs +327 -0
- package/dist/store/postgres-reporting.cjs.map +1 -0
- package/dist/store/postgres-reporting.d.cts +95 -0
- package/dist/store/postgres-reporting.d.cts.map +1 -0
- package/dist/store/postgres-reporting.d.mts +95 -0
- package/dist/store/postgres-reporting.d.mts.map +1 -0
- package/dist/store/postgres-reporting.mjs +326 -0
- package/dist/store/postgres-reporting.mjs.map +1 -0
- package/dist/store/postgres.cjs +1173 -0
- package/dist/store/postgres.cjs.map +1 -0
- package/dist/store/postgres.d.cts +199 -0
- package/dist/store/postgres.d.cts.map +1 -0
- package/dist/store/postgres.d.mts +199 -0
- package/dist/store/postgres.d.mts.map +1 -0
- package/dist/store/postgres.mjs +1170 -0
- package/dist/store/postgres.mjs.map +1 -0
- package/dist/store/sql.cjs +24 -0
- package/dist/store/sql.cjs.map +1 -0
- package/dist/store/sql.d.cts +26 -0
- package/dist/store/sql.d.cts.map +1 -0
- package/dist/store/sql.d.mts +26 -0
- package/dist/store/sql.d.mts.map +1 -0
- package/dist/store/sql.mjs +23 -0
- package/dist/store/sql.mjs.map +1 -0
- package/dist/store/tables.cjs +660 -0
- package/dist/store/tables.cjs.map +1 -0
- package/dist/store/tables.d.cts +103 -0
- package/dist/store/tables.d.cts.map +1 -0
- package/dist/store/tables.d.mts +103 -0
- package/dist/store/tables.d.mts.map +1 -0
- package/dist/store/tables.mjs +653 -0
- package/dist/store/tables.mjs.map +1 -0
- package/dist/store/user-lock.cjs +42 -0
- package/dist/store/user-lock.cjs.map +1 -0
- package/dist/store/user-lock.d.cts +30 -0
- package/dist/store/user-lock.d.cts.map +1 -0
- package/dist/store/user-lock.d.mts +30 -0
- package/dist/store/user-lock.d.mts.map +1 -0
- package/dist/store/user-lock.mjs +39 -0
- package/dist/store/user-lock.mjs.map +1 -0
- package/dist/template-rules.cjs +94 -0
- package/dist/template-rules.cjs.map +1 -0
- package/dist/template-rules.d.cts +80 -0
- package/dist/template-rules.d.cts.map +1 -0
- package/dist/template-rules.d.mts +80 -0
- package/dist/template-rules.d.mts.map +1 -0
- package/dist/template-rules.mjs +86 -0
- package/dist/template-rules.mjs.map +1 -0
- package/dist/templates.cjs +375 -0
- package/dist/templates.cjs.map +1 -0
- package/dist/templates.d.cts +358 -0
- package/dist/templates.d.cts.map +1 -0
- package/dist/templates.d.mts +358 -0
- package/dist/templates.d.mts.map +1 -0
- package/dist/templates.mjs +353 -0
- package/dist/templates.mjs.map +1 -0
- package/dist/transports/cloudflare-email.cjs +69 -0
- package/dist/transports/cloudflare-email.cjs.map +1 -0
- package/dist/transports/cloudflare-email.d.cts +63 -0
- package/dist/transports/cloudflare-email.d.cts.map +1 -0
- package/dist/transports/cloudflare-email.d.mts +63 -0
- package/dist/transports/cloudflare-email.d.mts.map +1 -0
- package/dist/transports/cloudflare-email.mjs +67 -0
- package/dist/transports/cloudflare-email.mjs.map +1 -0
- package/dist/transports/ses.cjs +142 -0
- package/dist/transports/ses.cjs.map +1 -0
- package/dist/transports/ses.d.cts +49 -0
- package/dist/transports/ses.d.cts.map +1 -0
- package/dist/transports/ses.d.mts +49 -0
- package/dist/transports/ses.d.mts.map +1 -0
- package/dist/transports/ses.mjs +139 -0
- package/dist/transports/ses.mjs.map +1 -0
- package/dist/transports/sigv4.cjs +86 -0
- package/dist/transports/sigv4.cjs.map +1 -0
- package/dist/transports/sigv4.d.cts +25 -0
- package/dist/transports/sigv4.d.cts.map +1 -0
- package/dist/transports/sigv4.d.mts +25 -0
- package/dist/transports/sigv4.d.mts.map +1 -0
- package/dist/transports/sigv4.mjs +85 -0
- package/dist/transports/sigv4.mjs.map +1 -0
- package/dist/webhooks.cjs +97 -0
- package/dist/webhooks.cjs.map +1 -0
- package/dist/webhooks.d.cts +23 -0
- package/dist/webhooks.d.cts.map +1 -0
- package/dist/webhooks.d.mts +23 -0
- package/dist/webhooks.d.mts.map +1 -0
- package/dist/webhooks.mjs +95 -0
- package/dist/webhooks.mjs.map +1 -0
- package/dist/webpush.cjs +361 -0
- package/dist/webpush.cjs.map +1 -0
- package/dist/webpush.d.cts +135 -0
- package/dist/webpush.d.cts.map +1 -0
- package/dist/webpush.d.mts +135 -0
- package/dist/webpush.d.mts.map +1 -0
- package/dist/webpush.mjs +350 -0
- package/dist/webpush.mjs.map +1 -0
- package/package.json +279 -3
- package/src/cloudflare/workers.d.ts +44 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http2-client.cjs","names":["connect"],"sources":["../src/http2-client.ts"],"sourcesContent":["import { type ClientHttp2Session, connect } from 'node:http2';\n\n/**\n * A Node HTTP/2 client: one session per origin, reused while it lives. APNs speaks HTTP/2 only\n * and Node's `fetch` does not negotiate it, so a Node host (a Lambda, the development relay)\n * pushes through this instead. Node-only — a Worker's own `fetch` already speaks HTTP/2.\n *\n * Why it exists, and when the Lambda side can go (as of 2026-10):\n * - Node 24 (Lambda's `nodejs24.x`, the newest GA runtime) bundles undici 7, whose `fetch`\n * leaves HTTP/2 off (`allowH2: false`). A POST to APNs fails there with \"Response does not\n * match the HTTP/1.1 protocol\". The only switch is an undici `Agent({ allowH2: true })`\n * dispatcher, which needs the npm `undici` package (and, set globally, would change every\n * `fetch` in the host's process) — this client needs no dependency and touches nothing global.\n * - undici 8 negotiates HTTP/2 by default (nodejs/undici#4828), and Node 26 bundles it. Lambda's\n * `nodejs26.x` is in public preview only, outside the SLA; it goes GA once Node 26 reaches\n * Active LTS.\n * - Once the function runs on a GA runtime whose built-in `fetch` speaks HTTP/2 (check that\n * durable functions support it, and that a POST to api.push.apple.com answers JSON rather\n * than a protocol error), drop `apnsFetch: http2Fetch()` from `journeyLambda` (aws/index.ts):\n * APNs then uses the platform `fetch` like the other channels. The development relay\n * (`apns-relay.ts`, for workerd, which cannot make HTTP/2 subrequests) keeps using this pool.\n */\n\nexport interface Http2Sessions {\n session(origin: string): ClientHttp2Session;\n /**\n * Drop a session that stopped answering, so the next request reconnects. Only that session:\n * the pool may already hold a newer one for the origin (after a GOAWAY), which stays.\n */\n discard(origin: string, session: ClientHttp2Session): void;\n close(): void;\n}\n\nexport function http2Sessions(): Http2Sessions {\n const sessions = new Map<string, ClientHttp2Session>();\n return {\n session(origin) {\n const existing = sessions.get(origin);\n if (existing !== undefined && !existing.closed && !existing.destroyed) return existing;\n const created = connect(origin);\n const forget = () => {\n if (sessions.get(origin) === created) sessions.delete(origin);\n };\n created.on('error', forget);\n created.on('close', forget);\n created.on('goaway', forget);\n sessions.set(origin, created);\n return created;\n },\n discard(origin, session) {\n session.destroy();\n if (sessions.get(origin) === session) sessions.delete(origin);\n },\n close() {\n for (const open of sessions.values()) open.close();\n sessions.clear();\n },\n };\n}\n\n/**\n * `fetch` over HTTP/2, for the senders that take one (`ApnsPushSender({ fetch })`). Only what a\n * JSON API call needs: a method, string headers, a string or byte body, the status, headers and\n * body back.\n */\nexport function http2Fetch(\n pool: Http2Sessions = http2Sessions(),\n options: {\n /**\n * How long a request may go without activity: a session a frozen Lambda left half-dead\n * answers nothing and closes nothing, so without a limit the request hangs until the\n * function's timeout. 10 seconds by default.\n */\n timeoutMs?: number;\n } = {}\n): typeof fetch {\n const timeoutMs = options.timeoutMs ?? 10_000;\n return async (input: string | URL | Request, init?: RequestInit) => {\n const request = new Request(input, init);\n const url = new URL(request.url);\n const body = request.body === null ? undefined : Buffer.from(await request.arrayBuffer());\n const headers: Record<string, string> = {\n ':method': request.method,\n ':path': `${url.pathname}${url.search}`,\n };\n request.headers.forEach((value, name) => {\n headers[name] = value;\n });\n return new Promise<Response>((resolve, reject) => {\n let session: ClientHttp2Session;\n let stream;\n try {\n session = pool.session(url.origin);\n stream = session.request(headers);\n } catch (error) {\n reject(error instanceof Error ? error : new Error(String(error)));\n return;\n }\n let status = 502;\n const responseHeaders = new Headers();\n const chunks: Buffer[] = [];\n stream.on('response', (received) => {\n status = received[':status'] ?? 502;\n for (const [name, value] of Object.entries(received)) {\n if (name.startsWith(':') || value === undefined) continue;\n responseHeaders.set(name, Array.isArray(value) ? value.join(', ') : value);\n }\n });\n stream.on('data', (chunk: Buffer) => chunks.push(chunk));\n stream.on('end', () => {\n const bytes = Buffer.concat(chunks);\n resolve(\n new Response(status === 204 || status === 304 || bytes.length === 0 ? null : bytes, {\n status,\n headers: responseHeaders,\n })\n );\n });\n stream.on('error', reject);\n stream.setTimeout(timeoutMs, () => {\n stream.close();\n pool.discard(url.origin, session);\n reject(new Error(`HTTP/2 request to ${url.origin} timed out after ${timeoutMs} ms`));\n });\n stream.end(body);\n });\n };\n}\n"],"mappings":";;;AAiCA,SAAgB,gBAA+B;CAC7C,MAAM,2BAAW,IAAI,IAAgC;CACrD,OAAO;EACL,QAAQ,QAAQ;GACd,MAAM,WAAW,SAAS,IAAI,MAAM;GACpC,IAAI,aAAa,KAAA,KAAa,CAAC,SAAS,UAAU,CAAC,SAAS,WAAW,OAAO;GAC9E,MAAM,WAAA,GAAUA,WAAAA,QAAAA,CAAQ,MAAM;GAC9B,MAAM,eAAe;IACnB,IAAI,SAAS,IAAI,MAAM,MAAM,SAAS,SAAS,OAAO,MAAM;GAC9D;GACA,QAAQ,GAAG,SAAS,MAAM;GAC1B,QAAQ,GAAG,SAAS,MAAM;GAC1B,QAAQ,GAAG,UAAU,MAAM;GAC3B,SAAS,IAAI,QAAQ,OAAO;GAC5B,OAAO;EACT;EACA,QAAQ,QAAQ,SAAS;GACvB,QAAQ,QAAQ;GAChB,IAAI,SAAS,IAAI,MAAM,MAAM,SAAS,SAAS,OAAO,MAAM;EAC9D;EACA,QAAQ;GACN,KAAK,MAAM,QAAQ,SAAS,OAAO,GAAG,KAAK,MAAM;GACjD,SAAS,MAAM;EACjB;CACF;AACF;;;;;;AAOA,SAAgB,WACd,OAAsB,cAAc,GACpC,UAOI,CAAC,GACS;CACd,MAAM,YAAY,QAAQ,aAAa;CACvC,OAAO,OAAO,OAA+B,SAAuB;EAClE,MAAM,UAAU,IAAI,QAAQ,OAAO,IAAI;EACvC,MAAM,MAAM,IAAI,IAAI,QAAQ,GAAG;EAC/B,MAAM,OAAO,QAAQ,SAAS,OAAO,KAAA,IAAY,OAAO,KAAK,MAAM,QAAQ,YAAY,CAAC;EACxF,MAAM,UAAkC;GACtC,WAAW,QAAQ;GACnB,SAAS,GAAG,IAAI,WAAW,IAAI;EACjC;EACA,QAAQ,QAAQ,SAAS,OAAO,SAAS;GACvC,QAAQ,QAAQ;EAClB,CAAC;EACD,OAAO,IAAI,SAAmB,SAAS,WAAW;GAChD,IAAI;GACJ,IAAI;GACJ,IAAI;IACF,UAAU,KAAK,QAAQ,IAAI,MAAM;IACjC,SAAS,QAAQ,QAAQ,OAAO;GAClC,SAAS,OAAO;IACd,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC,CAAC;IAChE;GACF;GACA,IAAI,SAAS;GACb,MAAM,kBAAkB,IAAI,QAAQ;GACpC,MAAM,SAAmB,CAAC;GAC1B,OAAO,GAAG,aAAa,aAAa;IAClC,SAAS,SAAS,cAAc;IAChC,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,QAAQ,GAAG;KACpD,IAAI,KAAK,WAAW,GAAG,KAAK,UAAU,KAAA,GAAW;KACjD,gBAAgB,IAAI,MAAM,MAAM,QAAQ,KAAK,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK;IAC3E;GACF,CAAC;GACD,OAAO,GAAG,SAAS,UAAkB,OAAO,KAAK,KAAK,CAAC;GACvD,OAAO,GAAG,aAAa;IACrB,MAAM,QAAQ,OAAO,OAAO,MAAM;IAClC,QACE,IAAI,SAAS,WAAW,OAAO,WAAW,OAAO,MAAM,WAAW,IAAI,OAAO,OAAO;KAClF;KACA,SAAS;IACX,CAAC,CACH;GACF,CAAC;GACD,OAAO,GAAG,SAAS,MAAM;GACzB,OAAO,WAAW,iBAAiB;IACjC,OAAO,MAAM;IACb,KAAK,QAAQ,IAAI,QAAQ,OAAO;IAChC,uBAAO,IAAI,MAAM,qBAAqB,IAAI,OAAO,mBAAmB,UAAU,IAAI,CAAC;GACrF,CAAC;GACD,OAAO,IAAI,IAAI;EACjB,CAAC;CACH;AACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ClientHttp2Session } from "node:http2";
|
|
2
|
+
/**
|
|
3
|
+
* A Node HTTP/2 client: one session per origin, reused while it lives. APNs speaks HTTP/2 only
|
|
4
|
+
* and Node's `fetch` does not negotiate it, so a Node host (a Lambda, the development relay)
|
|
5
|
+
* pushes through this instead. Node-only — a Worker's own `fetch` already speaks HTTP/2.
|
|
6
|
+
*
|
|
7
|
+
* Why it exists, and when the Lambda side can go (as of 2026-10):
|
|
8
|
+
* - Node 24 (Lambda's `nodejs24.x`, the newest GA runtime) bundles undici 7, whose `fetch`
|
|
9
|
+
* leaves HTTP/2 off (`allowH2: false`). A POST to APNs fails there with "Response does not
|
|
10
|
+
* match the HTTP/1.1 protocol". The only switch is an undici `Agent({ allowH2: true })`
|
|
11
|
+
* dispatcher, which needs the npm `undici` package (and, set globally, would change every
|
|
12
|
+
* `fetch` in the host's process) — this client needs no dependency and touches nothing global.
|
|
13
|
+
* - undici 8 negotiates HTTP/2 by default (nodejs/undici#4828), and Node 26 bundles it. Lambda's
|
|
14
|
+
* `nodejs26.x` is in public preview only, outside the SLA; it goes GA once Node 26 reaches
|
|
15
|
+
* Active LTS.
|
|
16
|
+
* - Once the function runs on a GA runtime whose built-in `fetch` speaks HTTP/2 (check that
|
|
17
|
+
* durable functions support it, and that a POST to api.push.apple.com answers JSON rather
|
|
18
|
+
* than a protocol error), drop `apnsFetch: http2Fetch()` from `journeyLambda` (aws/index.ts):
|
|
19
|
+
* APNs then uses the platform `fetch` like the other channels. The development relay
|
|
20
|
+
* (`apns-relay.ts`, for workerd, which cannot make HTTP/2 subrequests) keeps using this pool.
|
|
21
|
+
*/
|
|
22
|
+
export interface Http2Sessions {
|
|
23
|
+
session(origin: string): ClientHttp2Session;
|
|
24
|
+
/**
|
|
25
|
+
* Drop a session that stopped answering, so the next request reconnects. Only that session:
|
|
26
|
+
* the pool may already hold a newer one for the origin (after a GOAWAY), which stays.
|
|
27
|
+
*/
|
|
28
|
+
discard(origin: string, session: ClientHttp2Session): void;
|
|
29
|
+
close(): void;
|
|
30
|
+
}
|
|
31
|
+
export declare function http2Sessions(): Http2Sessions;
|
|
32
|
+
/**
|
|
33
|
+
* `fetch` over HTTP/2, for the senders that take one (`ApnsPushSender({ fetch })`). Only what a
|
|
34
|
+
* JSON API call needs: a method, string headers, a string or byte body, the status, headers and
|
|
35
|
+
* body back.
|
|
36
|
+
*/
|
|
37
|
+
export declare function http2Fetch(pool?: Http2Sessions, options?: {
|
|
38
|
+
/**
|
|
39
|
+
* How long a request may go without activity: a session a frozen Lambda left half-dead
|
|
40
|
+
* answers nothing and closes nothing, so without a limit the request hangs until the
|
|
41
|
+
* function's timeout. 10 seconds by default.
|
|
42
|
+
*/
|
|
43
|
+
timeoutMs?: number;
|
|
44
|
+
}): typeof fetch;
|
|
45
|
+
//# sourceMappingURL=http2-client.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ClientHttp2Session } from "node:http2";
|
|
2
|
+
/**
|
|
3
|
+
* A Node HTTP/2 client: one session per origin, reused while it lives. APNs speaks HTTP/2 only
|
|
4
|
+
* and Node's `fetch` does not negotiate it, so a Node host (a Lambda, the development relay)
|
|
5
|
+
* pushes through this instead. Node-only — a Worker's own `fetch` already speaks HTTP/2.
|
|
6
|
+
*
|
|
7
|
+
* Why it exists, and when the Lambda side can go (as of 2026-10):
|
|
8
|
+
* - Node 24 (Lambda's `nodejs24.x`, the newest GA runtime) bundles undici 7, whose `fetch`
|
|
9
|
+
* leaves HTTP/2 off (`allowH2: false`). A POST to APNs fails there with "Response does not
|
|
10
|
+
* match the HTTP/1.1 protocol". The only switch is an undici `Agent({ allowH2: true })`
|
|
11
|
+
* dispatcher, which needs the npm `undici` package (and, set globally, would change every
|
|
12
|
+
* `fetch` in the host's process) — this client needs no dependency and touches nothing global.
|
|
13
|
+
* - undici 8 negotiates HTTP/2 by default (nodejs/undici#4828), and Node 26 bundles it. Lambda's
|
|
14
|
+
* `nodejs26.x` is in public preview only, outside the SLA; it goes GA once Node 26 reaches
|
|
15
|
+
* Active LTS.
|
|
16
|
+
* - Once the function runs on a GA runtime whose built-in `fetch` speaks HTTP/2 (check that
|
|
17
|
+
* durable functions support it, and that a POST to api.push.apple.com answers JSON rather
|
|
18
|
+
* than a protocol error), drop `apnsFetch: http2Fetch()` from `journeyLambda` (aws/index.ts):
|
|
19
|
+
* APNs then uses the platform `fetch` like the other channels. The development relay
|
|
20
|
+
* (`apns-relay.ts`, for workerd, which cannot make HTTP/2 subrequests) keeps using this pool.
|
|
21
|
+
*/
|
|
22
|
+
export interface Http2Sessions {
|
|
23
|
+
session(origin: string): ClientHttp2Session;
|
|
24
|
+
/**
|
|
25
|
+
* Drop a session that stopped answering, so the next request reconnects. Only that session:
|
|
26
|
+
* the pool may already hold a newer one for the origin (after a GOAWAY), which stays.
|
|
27
|
+
*/
|
|
28
|
+
discard(origin: string, session: ClientHttp2Session): void;
|
|
29
|
+
close(): void;
|
|
30
|
+
}
|
|
31
|
+
export declare function http2Sessions(): Http2Sessions;
|
|
32
|
+
/**
|
|
33
|
+
* `fetch` over HTTP/2, for the senders that take one (`ApnsPushSender({ fetch })`). Only what a
|
|
34
|
+
* JSON API call needs: a method, string headers, a string or byte body, the status, headers and
|
|
35
|
+
* body back.
|
|
36
|
+
*/
|
|
37
|
+
export declare function http2Fetch(pool?: Http2Sessions, options?: {
|
|
38
|
+
/**
|
|
39
|
+
* How long a request may go without activity: a session a frozen Lambda left half-dead
|
|
40
|
+
* answers nothing and closes nothing, so without a limit the request hangs until the
|
|
41
|
+
* function's timeout. 10 seconds by default.
|
|
42
|
+
*/
|
|
43
|
+
timeoutMs?: number;
|
|
44
|
+
}): typeof fetch;
|
|
45
|
+
//# sourceMappingURL=http2-client.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { connect } from "node:http2";
|
|
2
|
+
// src/http2-client.ts
|
|
3
|
+
function http2Sessions() {
|
|
4
|
+
const sessions = /* @__PURE__ */ new Map();
|
|
5
|
+
return {
|
|
6
|
+
session(origin) {
|
|
7
|
+
const existing = sessions.get(origin);
|
|
8
|
+
if (existing !== void 0 && !existing.closed && !existing.destroyed) return existing;
|
|
9
|
+
const created = connect(origin);
|
|
10
|
+
const forget = () => {
|
|
11
|
+
if (sessions.get(origin) === created) sessions.delete(origin);
|
|
12
|
+
};
|
|
13
|
+
created.on("error", forget);
|
|
14
|
+
created.on("close", forget);
|
|
15
|
+
created.on("goaway", forget);
|
|
16
|
+
sessions.set(origin, created);
|
|
17
|
+
return created;
|
|
18
|
+
},
|
|
19
|
+
discard(origin, session) {
|
|
20
|
+
session.destroy();
|
|
21
|
+
if (sessions.get(origin) === session) sessions.delete(origin);
|
|
22
|
+
},
|
|
23
|
+
close() {
|
|
24
|
+
for (const open of sessions.values()) open.close();
|
|
25
|
+
sessions.clear();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* `fetch` over HTTP/2, for the senders that take one (`ApnsPushSender({ fetch })`). Only what a
|
|
31
|
+
* JSON API call needs: a method, string headers, a string or byte body, the status, headers and
|
|
32
|
+
* body back.
|
|
33
|
+
*/
|
|
34
|
+
function http2Fetch(pool = http2Sessions(), options = {}) {
|
|
35
|
+
const timeoutMs = options.timeoutMs ?? 1e4;
|
|
36
|
+
return async (input, init) => {
|
|
37
|
+
const request = new Request(input, init);
|
|
38
|
+
const url = new URL(request.url);
|
|
39
|
+
const body = request.body === null ? void 0 : Buffer.from(await request.arrayBuffer());
|
|
40
|
+
const headers = {
|
|
41
|
+
":method": request.method,
|
|
42
|
+
":path": `${url.pathname}${url.search}`
|
|
43
|
+
};
|
|
44
|
+
request.headers.forEach((value, name) => {
|
|
45
|
+
headers[name] = value;
|
|
46
|
+
});
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
let session;
|
|
49
|
+
let stream;
|
|
50
|
+
try {
|
|
51
|
+
session = pool.session(url.origin);
|
|
52
|
+
stream = session.request(headers);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
reject(error instanceof Error ? error : new Error(String(error)));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
let status = 502;
|
|
58
|
+
const responseHeaders = new Headers();
|
|
59
|
+
const chunks = [];
|
|
60
|
+
stream.on("response", (received) => {
|
|
61
|
+
status = received[":status"] ?? 502;
|
|
62
|
+
for (const [name, value] of Object.entries(received)) {
|
|
63
|
+
if (name.startsWith(":") || value === void 0) continue;
|
|
64
|
+
responseHeaders.set(name, Array.isArray(value) ? value.join(", ") : value);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
stream.on("data", (chunk) => chunks.push(chunk));
|
|
68
|
+
stream.on("end", () => {
|
|
69
|
+
const bytes = Buffer.concat(chunks);
|
|
70
|
+
resolve(new Response(status === 204 || status === 304 || bytes.length === 0 ? null : bytes, {
|
|
71
|
+
status,
|
|
72
|
+
headers: responseHeaders
|
|
73
|
+
}));
|
|
74
|
+
});
|
|
75
|
+
stream.on("error", reject);
|
|
76
|
+
stream.setTimeout(timeoutMs, () => {
|
|
77
|
+
stream.close();
|
|
78
|
+
pool.discard(url.origin, session);
|
|
79
|
+
reject(/* @__PURE__ */ new Error(`HTTP/2 request to ${url.origin} timed out after ${timeoutMs} ms`));
|
|
80
|
+
});
|
|
81
|
+
stream.end(body);
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export { http2Fetch, http2Sessions };
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=http2-client.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http2-client.mjs","names":[],"sources":["../src/http2-client.ts"],"sourcesContent":["import { type ClientHttp2Session, connect } from 'node:http2';\n\n/**\n * A Node HTTP/2 client: one session per origin, reused while it lives. APNs speaks HTTP/2 only\n * and Node's `fetch` does not negotiate it, so a Node host (a Lambda, the development relay)\n * pushes through this instead. Node-only — a Worker's own `fetch` already speaks HTTP/2.\n *\n * Why it exists, and when the Lambda side can go (as of 2026-10):\n * - Node 24 (Lambda's `nodejs24.x`, the newest GA runtime) bundles undici 7, whose `fetch`\n * leaves HTTP/2 off (`allowH2: false`). A POST to APNs fails there with \"Response does not\n * match the HTTP/1.1 protocol\". The only switch is an undici `Agent({ allowH2: true })`\n * dispatcher, which needs the npm `undici` package (and, set globally, would change every\n * `fetch` in the host's process) — this client needs no dependency and touches nothing global.\n * - undici 8 negotiates HTTP/2 by default (nodejs/undici#4828), and Node 26 bundles it. Lambda's\n * `nodejs26.x` is in public preview only, outside the SLA; it goes GA once Node 26 reaches\n * Active LTS.\n * - Once the function runs on a GA runtime whose built-in `fetch` speaks HTTP/2 (check that\n * durable functions support it, and that a POST to api.push.apple.com answers JSON rather\n * than a protocol error), drop `apnsFetch: http2Fetch()` from `journeyLambda` (aws/index.ts):\n * APNs then uses the platform `fetch` like the other channels. The development relay\n * (`apns-relay.ts`, for workerd, which cannot make HTTP/2 subrequests) keeps using this pool.\n */\n\nexport interface Http2Sessions {\n session(origin: string): ClientHttp2Session;\n /**\n * Drop a session that stopped answering, so the next request reconnects. Only that session:\n * the pool may already hold a newer one for the origin (after a GOAWAY), which stays.\n */\n discard(origin: string, session: ClientHttp2Session): void;\n close(): void;\n}\n\nexport function http2Sessions(): Http2Sessions {\n const sessions = new Map<string, ClientHttp2Session>();\n return {\n session(origin) {\n const existing = sessions.get(origin);\n if (existing !== undefined && !existing.closed && !existing.destroyed) return existing;\n const created = connect(origin);\n const forget = () => {\n if (sessions.get(origin) === created) sessions.delete(origin);\n };\n created.on('error', forget);\n created.on('close', forget);\n created.on('goaway', forget);\n sessions.set(origin, created);\n return created;\n },\n discard(origin, session) {\n session.destroy();\n if (sessions.get(origin) === session) sessions.delete(origin);\n },\n close() {\n for (const open of sessions.values()) open.close();\n sessions.clear();\n },\n };\n}\n\n/**\n * `fetch` over HTTP/2, for the senders that take one (`ApnsPushSender({ fetch })`). Only what a\n * JSON API call needs: a method, string headers, a string or byte body, the status, headers and\n * body back.\n */\nexport function http2Fetch(\n pool: Http2Sessions = http2Sessions(),\n options: {\n /**\n * How long a request may go without activity: a session a frozen Lambda left half-dead\n * answers nothing and closes nothing, so without a limit the request hangs until the\n * function's timeout. 10 seconds by default.\n */\n timeoutMs?: number;\n } = {}\n): typeof fetch {\n const timeoutMs = options.timeoutMs ?? 10_000;\n return async (input: string | URL | Request, init?: RequestInit) => {\n const request = new Request(input, init);\n const url = new URL(request.url);\n const body = request.body === null ? undefined : Buffer.from(await request.arrayBuffer());\n const headers: Record<string, string> = {\n ':method': request.method,\n ':path': `${url.pathname}${url.search}`,\n };\n request.headers.forEach((value, name) => {\n headers[name] = value;\n });\n return new Promise<Response>((resolve, reject) => {\n let session: ClientHttp2Session;\n let stream;\n try {\n session = pool.session(url.origin);\n stream = session.request(headers);\n } catch (error) {\n reject(error instanceof Error ? error : new Error(String(error)));\n return;\n }\n let status = 502;\n const responseHeaders = new Headers();\n const chunks: Buffer[] = [];\n stream.on('response', (received) => {\n status = received[':status'] ?? 502;\n for (const [name, value] of Object.entries(received)) {\n if (name.startsWith(':') || value === undefined) continue;\n responseHeaders.set(name, Array.isArray(value) ? value.join(', ') : value);\n }\n });\n stream.on('data', (chunk: Buffer) => chunks.push(chunk));\n stream.on('end', () => {\n const bytes = Buffer.concat(chunks);\n resolve(\n new Response(status === 204 || status === 304 || bytes.length === 0 ? null : bytes, {\n status,\n headers: responseHeaders,\n })\n );\n });\n stream.on('error', reject);\n stream.setTimeout(timeoutMs, () => {\n stream.close();\n pool.discard(url.origin, session);\n reject(new Error(`HTTP/2 request to ${url.origin} timed out after ${timeoutMs} ms`));\n });\n stream.end(body);\n });\n };\n}\n"],"mappings":";;AAiCA,SAAgB,gBAA+B;CAC7C,MAAM,2BAAW,IAAI,IAAgC;CACrD,OAAO;EACL,QAAQ,QAAQ;GACd,MAAM,WAAW,SAAS,IAAI,MAAM;GACpC,IAAI,aAAa,KAAA,KAAa,CAAC,SAAS,UAAU,CAAC,SAAS,WAAW,OAAO;GAC9E,MAAM,UAAU,QAAQ,MAAM;GAC9B,MAAM,eAAe;IACnB,IAAI,SAAS,IAAI,MAAM,MAAM,SAAS,SAAS,OAAO,MAAM;GAC9D;GACA,QAAQ,GAAG,SAAS,MAAM;GAC1B,QAAQ,GAAG,SAAS,MAAM;GAC1B,QAAQ,GAAG,UAAU,MAAM;GAC3B,SAAS,IAAI,QAAQ,OAAO;GAC5B,OAAO;EACT;EACA,QAAQ,QAAQ,SAAS;GACvB,QAAQ,QAAQ;GAChB,IAAI,SAAS,IAAI,MAAM,MAAM,SAAS,SAAS,OAAO,MAAM;EAC9D;EACA,QAAQ;GACN,KAAK,MAAM,QAAQ,SAAS,OAAO,GAAG,KAAK,MAAM;GACjD,SAAS,MAAM;EACjB;CACF;AACF;;;;;;AAOA,SAAgB,WACd,OAAsB,cAAc,GACpC,UAOI,CAAC,GACS;CACd,MAAM,YAAY,QAAQ,aAAa;CACvC,OAAO,OAAO,OAA+B,SAAuB;EAClE,MAAM,UAAU,IAAI,QAAQ,OAAO,IAAI;EACvC,MAAM,MAAM,IAAI,IAAI,QAAQ,GAAG;EAC/B,MAAM,OAAO,QAAQ,SAAS,OAAO,KAAA,IAAY,OAAO,KAAK,MAAM,QAAQ,YAAY,CAAC;EACxF,MAAM,UAAkC;GACtC,WAAW,QAAQ;GACnB,SAAS,GAAG,IAAI,WAAW,IAAI;EACjC;EACA,QAAQ,QAAQ,SAAS,OAAO,SAAS;GACvC,QAAQ,QAAQ;EAClB,CAAC;EACD,OAAO,IAAI,SAAmB,SAAS,WAAW;GAChD,IAAI;GACJ,IAAI;GACJ,IAAI;IACF,UAAU,KAAK,QAAQ,IAAI,MAAM;IACjC,SAAS,QAAQ,QAAQ,OAAO;GAClC,SAAS,OAAO;IACd,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC,CAAC;IAChE;GACF;GACA,IAAI,SAAS;GACb,MAAM,kBAAkB,IAAI,QAAQ;GACpC,MAAM,SAAmB,CAAC;GAC1B,OAAO,GAAG,aAAa,aAAa;IAClC,SAAS,SAAS,cAAc;IAChC,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,QAAQ,GAAG;KACpD,IAAI,KAAK,WAAW,GAAG,KAAK,UAAU,KAAA,GAAW;KACjD,gBAAgB,IAAI,MAAM,MAAM,QAAQ,KAAK,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK;IAC3E;GACF,CAAC;GACD,OAAO,GAAG,SAAS,UAAkB,OAAO,KAAK,KAAK,CAAC;GACvD,OAAO,GAAG,aAAa;IACrB,MAAM,QAAQ,OAAO,OAAO,MAAM;IAClC,QACE,IAAI,SAAS,WAAW,OAAO,WAAW,OAAO,MAAM,WAAW,IAAI,OAAO,OAAO;KAClF;KACA,SAAS;IACX,CAAC,CACH;GACF,CAAC;GACD,OAAO,GAAG,SAAS,MAAM;GACzB,OAAO,WAAW,iBAAiB;IACjC,OAAO,MAAM;IACb,KAAK,QAAQ,IAAI,QAAQ,OAAO;IAChC,uBAAO,IAAI,MAAM,qBAAqB,IAAI,OAAO,mBAAmB,UAAU,IAAI,CAAC;GACrF,CAAC;GACD,OAAO,IAAI,IAAI;EACjB,CAAC;CACH;AACF"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./dsl/index.cjs");
|
|
3
|
+
const require_dsl_action = require("./dsl/action.cjs");
|
|
4
|
+
const require_dsl_refs = require("./dsl/refs.cjs");
|
|
5
|
+
const require_dsl_template = require("./dsl/template.cjs");
|
|
6
|
+
const require_dsl_condition = require("./dsl/condition.cjs");
|
|
7
|
+
const require_hash = require("./hash.cjs");
|
|
8
|
+
const require_ir = require("./ir.cjs");
|
|
9
|
+
const require_dsl_flow = require("./dsl/flow.cjs");
|
|
10
|
+
const require_dsl_trigger = require("./dsl/trigger.cjs");
|
|
11
|
+
const require_plan = require("./plan.cjs");
|
|
12
|
+
const require_dsl_workflow = require("./dsl/workflow.cjs");
|
|
13
|
+
const require_inflight = require("./inflight.cjs");
|
|
14
|
+
const require_dsl_bundle = require("./dsl/bundle.cjs");
|
|
15
|
+
const require_runtime = require("./runtime.cjs");
|
|
16
|
+
const require_config = require("./config.cjs");
|
|
17
|
+
const require_email = require("./email.cjs");
|
|
18
|
+
const require_template_rules = require("./template-rules.cjs");
|
|
19
|
+
const require_templates = require("./templates.cjs");
|
|
20
|
+
const require_contract = require("./contract.cjs");
|
|
21
|
+
exports.ActionIR = require_ir.ActionIR;
|
|
22
|
+
exports.BundleIR = require_ir.BundleIR;
|
|
23
|
+
exports.CHANNEL_OF = require_templates.CHANNEL_OF;
|
|
24
|
+
exports.ChannelIR = require_ir.ChannelIR;
|
|
25
|
+
exports.ConditionIR = require_ir.ConditionIR;
|
|
26
|
+
exports.ConfigCompileError = require_config.ConfigCompileError;
|
|
27
|
+
exports.ContractValidationError = require_contract.ContractValidationError;
|
|
28
|
+
exports.DurationIR = require_ir.DurationIR;
|
|
29
|
+
exports.GoalIR = require_ir.GoalIR;
|
|
30
|
+
exports.IR_VERSION = require_ir.IR_VERSION;
|
|
31
|
+
exports.MetaIR = require_ir.MetaIR;
|
|
32
|
+
exports.NodeIR = require_ir.NodeIR;
|
|
33
|
+
exports.NodeMetaIR = require_ir.NodeMetaIR;
|
|
34
|
+
exports.PREVIEW_MESSAGE_ID = require_email.PREVIEW_MESSAGE_ID;
|
|
35
|
+
exports.PropValueIR = require_ir.PropValueIR;
|
|
36
|
+
exports.PropertyOperatorIR = require_ir.PropertyOperatorIR;
|
|
37
|
+
exports.ReentryIR = require_ir.ReentryIR;
|
|
38
|
+
exports.ScalarIR = require_ir.ScalarIR;
|
|
39
|
+
exports.SegmentIR = require_ir.SegmentIR;
|
|
40
|
+
exports.SourceLocIR = require_ir.SourceLocIR;
|
|
41
|
+
exports.SubscriptionsIR = require_ir.SubscriptionsIR;
|
|
42
|
+
exports.TemplateIR = require_ir.TemplateIR;
|
|
43
|
+
exports.TemplateValidationError = require_templates.TemplateValidationError;
|
|
44
|
+
exports.TriggerIR = require_ir.TriggerIR;
|
|
45
|
+
exports.TriggerPayloadRefIR = require_ir.TriggerPayloadRefIR;
|
|
46
|
+
exports.UserPropertyRefIR = require_ir.UserPropertyRefIR;
|
|
47
|
+
exports.WeekdayIR = require_ir.WeekdayIR;
|
|
48
|
+
exports.WorkflowIR = require_ir.WorkflowIR;
|
|
49
|
+
exports.action = require_dsl_action.action;
|
|
50
|
+
exports.and = require_dsl_condition.and;
|
|
51
|
+
exports.apnsEnvironment = require_config.apnsEnvironment;
|
|
52
|
+
exports.assertEmailAddress = require_template_rules.assertEmailAddress;
|
|
53
|
+
exports.assertEmailConfig = require_template_rules.assertEmailConfig;
|
|
54
|
+
exports.assertEmailMetadata = require_template_rules.assertEmailMetadata;
|
|
55
|
+
exports.assertHttpUrl = require_template_rules.assertHttpUrl;
|
|
56
|
+
exports.assertSupportedSchema = require_templates.assertSupportedSchema;
|
|
57
|
+
exports.assertTemplateTopic = require_template_rules.assertTemplateTopic;
|
|
58
|
+
exports.assertUnsubscribeUrl = require_template_rules.assertUnsubscribeUrl;
|
|
59
|
+
exports.between = require_dsl_condition.between;
|
|
60
|
+
exports.canonicalJSON = require_hash.canonicalJSON;
|
|
61
|
+
exports.checkEmit = require_config.checkEmit;
|
|
62
|
+
exports.checkEvent = require_contract.checkEvent;
|
|
63
|
+
exports.checkInFlight = require_inflight.checkInFlight;
|
|
64
|
+
exports.checkMessage = require_config.checkMessage;
|
|
65
|
+
exports.checkTriggerRefs = require_config.checkTriggerRefs;
|
|
66
|
+
exports.compileBundle = require_dsl_bundle.compileBundle;
|
|
67
|
+
exports.compileConfig = require_config.compileConfig;
|
|
68
|
+
exports.contains = require_dsl_condition.contains;
|
|
69
|
+
exports.defineConfig = require_config.defineConfig;
|
|
70
|
+
exports.defineContract = require_contract.defineContract;
|
|
71
|
+
exports.describeInFlight = require_inflight.describeInFlight;
|
|
72
|
+
exports.discordTemplate = require_templates.discordTemplate;
|
|
73
|
+
exports.emailTemplate = require_templates.emailTemplate;
|
|
74
|
+
exports.eq = require_dsl_condition.eq;
|
|
75
|
+
exports.event = require_dsl_refs.event;
|
|
76
|
+
exports.exists = require_dsl_condition.exists;
|
|
77
|
+
exports.flow = require_dsl_flow.flow;
|
|
78
|
+
exports.formatEmailAddress = require_email.formatEmailAddress;
|
|
79
|
+
exports.fullHash = require_hash.fullHash;
|
|
80
|
+
exports.gt = require_dsl_condition.gt;
|
|
81
|
+
exports.gte = require_dsl_condition.gte;
|
|
82
|
+
exports.inArray = require_dsl_condition.inArray;
|
|
83
|
+
exports.indexTemplates = require_templates.indexTemplates;
|
|
84
|
+
exports.isConfig = require_config.isConfig;
|
|
85
|
+
exports.isContract = require_contract.isContract;
|
|
86
|
+
exports.isDiscordTemplate = require_templates.isDiscordTemplate;
|
|
87
|
+
exports.isEmailAddress = require_template_rules.isEmailAddress;
|
|
88
|
+
exports.isEmailTemplate = require_templates.isEmailTemplate;
|
|
89
|
+
exports.isPushTemplate = require_templates.isPushTemplate;
|
|
90
|
+
exports.isSemanticChange = require_plan.isSemanticChange;
|
|
91
|
+
exports.isSlackTemplate = require_templates.isSlackTemplate;
|
|
92
|
+
exports.isTemplate = require_templates.isTemplate;
|
|
93
|
+
exports.isUnsubscribeLink = require_template_rules.isUnsubscribeLink;
|
|
94
|
+
exports.lookupTemplate = require_templates.lookupTemplate;
|
|
95
|
+
exports.lt = require_dsl_condition.lt;
|
|
96
|
+
exports.lte = require_dsl_condition.lte;
|
|
97
|
+
exports.mimeAddress = require_email.mimeAddress;
|
|
98
|
+
exports.ne = require_dsl_condition.ne;
|
|
99
|
+
exports.nodesOf = require_plan.nodesOf;
|
|
100
|
+
exports.not = require_dsl_condition.not;
|
|
101
|
+
exports.notBetween = require_dsl_condition.notBetween;
|
|
102
|
+
exports.notContains = require_dsl_condition.notContains;
|
|
103
|
+
exports.notExists = require_dsl_condition.notExists;
|
|
104
|
+
exports.notInArray = require_dsl_condition.notInArray;
|
|
105
|
+
exports.or = require_dsl_condition.or;
|
|
106
|
+
exports.parseTemplateProps = require_templates.parseTemplateProps;
|
|
107
|
+
exports.performed = require_dsl_condition.performed;
|
|
108
|
+
exports.pinnedWorkflows = require_inflight.pinnedWorkflows;
|
|
109
|
+
exports.plan = require_plan.plan;
|
|
110
|
+
exports.preferencesLink = require_email.preferencesLink;
|
|
111
|
+
exports.pushTemplate = require_templates.pushTemplate;
|
|
112
|
+
exports.reachable = require_dsl_condition.reachable;
|
|
113
|
+
exports.registryIndex = require_config.registryIndex;
|
|
114
|
+
exports.registryValidator = require_templates.registryValidator;
|
|
115
|
+
exports.renderDiscordContent = require_templates.renderDiscordContent;
|
|
116
|
+
exports.renderPushContent = require_templates.renderPushContent;
|
|
117
|
+
exports.renderSlackContent = require_templates.renderSlackContent;
|
|
118
|
+
exports.resolveEmail = require_email.resolveEmail;
|
|
119
|
+
exports.resolveRuntime = require_runtime.resolveRuntime;
|
|
120
|
+
exports.segment = require_dsl_condition.segment;
|
|
121
|
+
exports.semanticHash = require_hash.semanticHash;
|
|
122
|
+
exports.sha256Hex = require_hash.sha256Hex;
|
|
123
|
+
exports.slackTemplate = require_templates.slackTemplate;
|
|
124
|
+
exports.stripMeta = require_hash.stripMeta;
|
|
125
|
+
exports.stripProvenance = require_hash.stripProvenance;
|
|
126
|
+
exports.template = require_dsl_template.template;
|
|
127
|
+
exports.templatesFor = require_templates.templatesFor;
|
|
128
|
+
exports.trigger = require_dsl_trigger.trigger;
|
|
129
|
+
exports.user = require_dsl_refs.user;
|
|
130
|
+
exports.workflow = require_dsl_workflow.workflow;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "./dsl/index.cjs";
|
|
2
|
+
import { ActionContext, ActionHandler, ActionRef, action } from "./dsl/action.cjs";
|
|
3
|
+
import { Duration, EventMap, TimeOfDay, UserPropertyBase, Weekday } from "./dsl/base.cjs";
|
|
4
|
+
import { EventRef, EventRefs, MessageArgs, PayloadRef, PayloadRefNode, PayloadRefs, PropInput, PropsInput, TriggerPayloadRef, TriggerPayloadRefNode, TriggerPayloadRefs, UserPropertyRef, UserRefs, event, user } from "./dsl/refs.cjs";
|
|
5
|
+
import { Channel, EmptyProps, PropsOf, TemplateFactory, TemplateRef, template } from "./dsl/template.cjs";
|
|
6
|
+
import { Condition, PayloadWhere, PerformedOptions, SegmentDefinition, SegmentRef, and, between, contains, eq, exists, gt, gte, inArray, lt, lte, ne, not, notBetween, notContains, notExists, notInArray, or, performed, reachable, segment } from "./dsl/condition.cjs";
|
|
7
|
+
import { BranchArm, BranchCase, EmitArgs, EmitPayload, Flow, FlowBuilder, PreferOptions, PushOptions, SubFlow, flow } from "./dsl/flow.cjs";
|
|
8
|
+
import { DateTime, DateTriggerOptions, EventTriggerOptions, EventTriggerRef, TriggerFactory, TriggerRef, trigger } from "./dsl/trigger.cjs";
|
|
9
|
+
import { GoalOptions, Reentry, WorkflowBuilder, WorkflowDefinition, workflow } from "./dsl/workflow.cjs";
|
|
10
|
+
import { compileBundle } from "./dsl/bundle.cjs";
|
|
11
|
+
import { canonicalJSON, fullHash, semanticHash, sha256Hex, stripMeta, stripProvenance } from "./hash.cjs";
|
|
12
|
+
import { ActionIR, BundleIR, ChannelIR, ConditionIR, DurationIR, GoalIR, IR_VERSION, MetaIR, NodeIR, NodeMetaIR, PropValueIR, PropertyOperatorIR, ReentryIR, ScalarIR, SegmentIR, SourceLocIR, SubscriptionsIR, TemplateIR, TriggerIR, TriggerPayloadRefIR, UserPropertyRefIR, WeekdayIR, WorkflowIR } from "./ir.cjs";
|
|
13
|
+
import { BundlePlan, ChangeStatus, NodeChange, ResourceChange, WorkflowChange, isSemanticChange, nodesOf, plan } from "./plan.cjs";
|
|
14
|
+
import { InFlightProblem, PinnedWorkflow, checkInFlight, describeInFlight, pinnedWorkflows } from "./inflight.cjs";
|
|
15
|
+
import { JourneyMode, JourneyRuntimeConfig, JourneyRuntimeOptions, ProductionRuntimeOptions, resolveRuntime } from "./runtime.cjs";
|
|
16
|
+
import { ApnsConfig, ConfigCompileError, DatabaseConfig, FcmConfig, JourneyConfig, JourneyConfigDefinition, RegistryIndex, WebPushConfig, apnsEnvironment, checkEmit, checkMessage, checkTriggerRefs, compileConfig, defineConfig, isConfig, registryIndex } from "./config.cjs";
|
|
17
|
+
import { EmailRenderOptions, PREVIEW_MESSAGE_ID, ResolvedEmail, formatEmailAddress, mimeAddress, preferencesLink, resolveEmail } from "./email.cjs";
|
|
18
|
+
import { EmailAddress, EmailConfig, assertEmailAddress, assertEmailConfig, assertEmailMetadata, assertHttpUrl, assertTemplateTopic, assertUnsubscribeUrl, isEmailAddress, isUnsubscribeLink } from "./template-rules.cjs";
|
|
19
|
+
import { AnyTemplate, CHANNEL_OF, ChannelTemplate, DiscordContent, DiscordTemplate, EmailMetadata, EmailTemplate, EmailTemplateBase, EmailTemplateDefinition, EmailTemplateTopic, PropsSchema, PushContent, PushTemplate, PushTemplateBase, PushTemplateDefinition, ResolvedProps, SlackContent, SlackTemplate, TemplateChannel, TemplateIssue, TemplateRegistry, TemplateTopic, TemplateValidationError, WebhookTemplateDefinition, assertSupportedSchema, discordTemplate, emailTemplate, indexTemplates, isDiscordTemplate, isEmailTemplate, isPushTemplate, isSlackTemplate, isTemplate, lookupTemplate, parseTemplateProps, pushTemplate, registryValidator, renderDiscordContent, renderPushContent, renderSlackContent, slackTemplate, templatesFor } from "./templates.cjs";
|
|
20
|
+
import { Contract, ContractDefinition, ContractIssue, ContractResult, ContractValidationError, DeclaredOutput, EventPayload, ProfilePatch, SubscriptionsDefinition, Topic, checkEvent, defineContract, isContract } from "./contract.cjs";
|
|
21
|
+
export { type ActionContext, type ActionHandler, ActionIR, type ActionRef, AnyTemplate, ApnsConfig, type BranchArm, type BranchCase, BundleIR, BundlePlan, CHANNEL_OF, ChangeStatus, type Channel, ChannelIR, ChannelTemplate, type Condition, ConditionIR, ConfigCompileError, Contract, ContractDefinition, ContractIssue, ContractResult, ContractValidationError, DatabaseConfig, type DateTime, type DateTriggerOptions, DeclaredOutput, DiscordContent, DiscordTemplate, type Duration, DurationIR, EmailAddress, EmailConfig, EmailMetadata, EmailRenderOptions, EmailTemplate, EmailTemplateBase, EmailTemplateDefinition, EmailTemplateTopic, type EmitArgs, type EmitPayload, type EmptyProps, type EventMap, EventPayload, type EventRef, type EventRefs, type EventTriggerOptions, type EventTriggerRef, FcmConfig, type Flow, type FlowBuilder, GoalIR, type GoalOptions, IR_VERSION, InFlightProblem, JourneyConfig, JourneyConfigDefinition, JourneyMode, JourneyRuntimeConfig, JourneyRuntimeOptions, type MessageArgs, MetaIR, NodeChange, NodeIR, NodeMetaIR, PREVIEW_MESSAGE_ID, type PayloadRef, type PayloadRefNode, type PayloadRefs, type PayloadWhere, type PerformedOptions, PinnedWorkflow, type PreferOptions, ProductionRuntimeOptions, ProfilePatch, type PropInput, PropValueIR, PropertyOperatorIR, type PropsInput, type PropsOf, PropsSchema, PushContent, type PushOptions, PushTemplate, PushTemplateBase, PushTemplateDefinition, type Reentry, ReentryIR, RegistryIndex, ResolvedEmail, ResolvedProps, ResourceChange, ScalarIR, type SegmentDefinition, SegmentIR, type SegmentRef, SlackContent, SlackTemplate, SourceLocIR, type SubFlow, SubscriptionsDefinition, SubscriptionsIR, TemplateChannel, type TemplateFactory, TemplateIR, TemplateIssue, type TemplateRef, TemplateRegistry, TemplateTopic, TemplateValidationError, type TimeOfDay, Topic, type TriggerFactory, TriggerIR, type TriggerPayloadRef, TriggerPayloadRefIR, type TriggerPayloadRefNode, type TriggerPayloadRefs, type TriggerRef, type UserPropertyBase, type UserPropertyRef, UserPropertyRefIR, type UserRefs, WebPushConfig, WebhookTemplateDefinition, type Weekday, WeekdayIR, type WorkflowBuilder, WorkflowChange, type WorkflowDefinition, WorkflowIR, action, and, apnsEnvironment, assertEmailAddress, assertEmailConfig, assertEmailMetadata, assertHttpUrl, assertSupportedSchema, assertTemplateTopic, assertUnsubscribeUrl, between, canonicalJSON, checkEmit, checkEvent, checkInFlight, checkMessage, checkTriggerRefs, compileBundle, compileConfig, contains, defineConfig, defineContract, describeInFlight, discordTemplate, emailTemplate, eq, event, exists, flow, formatEmailAddress, fullHash, gt, gte, inArray, indexTemplates, isConfig, isContract, isDiscordTemplate, isEmailAddress, isEmailTemplate, isPushTemplate, isSemanticChange, isSlackTemplate, isTemplate, isUnsubscribeLink, lookupTemplate, lt, lte, mimeAddress, ne, nodesOf, not, notBetween, notContains, notExists, notInArray, or, parseTemplateProps, performed, pinnedWorkflows, plan, preferencesLink, pushTemplate, reachable, registryIndex, registryValidator, renderDiscordContent, renderPushContent, renderSlackContent, resolveEmail, resolveRuntime, segment, semanticHash, sha256Hex, slackTemplate, stripMeta, stripProvenance, template, templatesFor, trigger, user, workflow };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "./dsl/index.mjs";
|
|
2
|
+
import { ActionContext, ActionHandler, ActionRef, action } from "./dsl/action.mjs";
|
|
3
|
+
import { Duration, EventMap, TimeOfDay, UserPropertyBase, Weekday } from "./dsl/base.mjs";
|
|
4
|
+
import { EventRef, EventRefs, MessageArgs, PayloadRef, PayloadRefNode, PayloadRefs, PropInput, PropsInput, TriggerPayloadRef, TriggerPayloadRefNode, TriggerPayloadRefs, UserPropertyRef, UserRefs, event, user } from "./dsl/refs.mjs";
|
|
5
|
+
import { Channel, EmptyProps, PropsOf, TemplateFactory, TemplateRef, template } from "./dsl/template.mjs";
|
|
6
|
+
import { Condition, PayloadWhere, PerformedOptions, SegmentDefinition, SegmentRef, and, between, contains, eq, exists, gt, gte, inArray, lt, lte, ne, not, notBetween, notContains, notExists, notInArray, or, performed, reachable, segment } from "./dsl/condition.mjs";
|
|
7
|
+
import { BranchArm, BranchCase, EmitArgs, EmitPayload, Flow, FlowBuilder, PreferOptions, PushOptions, SubFlow, flow } from "./dsl/flow.mjs";
|
|
8
|
+
import { DateTime, DateTriggerOptions, EventTriggerOptions, EventTriggerRef, TriggerFactory, TriggerRef, trigger } from "./dsl/trigger.mjs";
|
|
9
|
+
import { GoalOptions, Reentry, WorkflowBuilder, WorkflowDefinition, workflow } from "./dsl/workflow.mjs";
|
|
10
|
+
import { compileBundle } from "./dsl/bundle.mjs";
|
|
11
|
+
import { canonicalJSON, fullHash, semanticHash, sha256Hex, stripMeta, stripProvenance } from "./hash.mjs";
|
|
12
|
+
import { ActionIR, BundleIR, ChannelIR, ConditionIR, DurationIR, GoalIR, IR_VERSION, MetaIR, NodeIR, NodeMetaIR, PropValueIR, PropertyOperatorIR, ReentryIR, ScalarIR, SegmentIR, SourceLocIR, SubscriptionsIR, TemplateIR, TriggerIR, TriggerPayloadRefIR, UserPropertyRefIR, WeekdayIR, WorkflowIR } from "./ir.mjs";
|
|
13
|
+
import { BundlePlan, ChangeStatus, NodeChange, ResourceChange, WorkflowChange, isSemanticChange, nodesOf, plan } from "./plan.mjs";
|
|
14
|
+
import { InFlightProblem, PinnedWorkflow, checkInFlight, describeInFlight, pinnedWorkflows } from "./inflight.mjs";
|
|
15
|
+
import { JourneyMode, JourneyRuntimeConfig, JourneyRuntimeOptions, ProductionRuntimeOptions, resolveRuntime } from "./runtime.mjs";
|
|
16
|
+
import { ApnsConfig, ConfigCompileError, DatabaseConfig, FcmConfig, JourneyConfig, JourneyConfigDefinition, RegistryIndex, WebPushConfig, apnsEnvironment, checkEmit, checkMessage, checkTriggerRefs, compileConfig, defineConfig, isConfig, registryIndex } from "./config.mjs";
|
|
17
|
+
import { EmailRenderOptions, PREVIEW_MESSAGE_ID, ResolvedEmail, formatEmailAddress, mimeAddress, preferencesLink, resolveEmail } from "./email.mjs";
|
|
18
|
+
import { EmailAddress, EmailConfig, assertEmailAddress, assertEmailConfig, assertEmailMetadata, assertHttpUrl, assertTemplateTopic, assertUnsubscribeUrl, isEmailAddress, isUnsubscribeLink } from "./template-rules.mjs";
|
|
19
|
+
import { AnyTemplate, CHANNEL_OF, ChannelTemplate, DiscordContent, DiscordTemplate, EmailMetadata, EmailTemplate, EmailTemplateBase, EmailTemplateDefinition, EmailTemplateTopic, PropsSchema, PushContent, PushTemplate, PushTemplateBase, PushTemplateDefinition, ResolvedProps, SlackContent, SlackTemplate, TemplateChannel, TemplateIssue, TemplateRegistry, TemplateTopic, TemplateValidationError, WebhookTemplateDefinition, assertSupportedSchema, discordTemplate, emailTemplate, indexTemplates, isDiscordTemplate, isEmailTemplate, isPushTemplate, isSlackTemplate, isTemplate, lookupTemplate, parseTemplateProps, pushTemplate, registryValidator, renderDiscordContent, renderPushContent, renderSlackContent, slackTemplate, templatesFor } from "./templates.mjs";
|
|
20
|
+
import { Contract, ContractDefinition, ContractIssue, ContractResult, ContractValidationError, DeclaredOutput, EventPayload, ProfilePatch, SubscriptionsDefinition, Topic, checkEvent, defineContract, isContract } from "./contract.mjs";
|
|
21
|
+
export { type ActionContext, type ActionHandler, ActionIR, type ActionRef, AnyTemplate, ApnsConfig, type BranchArm, type BranchCase, BundleIR, BundlePlan, CHANNEL_OF, ChangeStatus, type Channel, ChannelIR, ChannelTemplate, type Condition, ConditionIR, ConfigCompileError, Contract, ContractDefinition, ContractIssue, ContractResult, ContractValidationError, DatabaseConfig, type DateTime, type DateTriggerOptions, DeclaredOutput, DiscordContent, DiscordTemplate, type Duration, DurationIR, EmailAddress, EmailConfig, EmailMetadata, EmailRenderOptions, EmailTemplate, EmailTemplateBase, EmailTemplateDefinition, EmailTemplateTopic, type EmitArgs, type EmitPayload, type EmptyProps, type EventMap, EventPayload, type EventRef, type EventRefs, type EventTriggerOptions, type EventTriggerRef, FcmConfig, type Flow, type FlowBuilder, GoalIR, type GoalOptions, IR_VERSION, InFlightProblem, JourneyConfig, JourneyConfigDefinition, JourneyMode, JourneyRuntimeConfig, JourneyRuntimeOptions, type MessageArgs, MetaIR, NodeChange, NodeIR, NodeMetaIR, PREVIEW_MESSAGE_ID, type PayloadRef, type PayloadRefNode, type PayloadRefs, type PayloadWhere, type PerformedOptions, PinnedWorkflow, type PreferOptions, ProductionRuntimeOptions, ProfilePatch, type PropInput, PropValueIR, PropertyOperatorIR, type PropsInput, type PropsOf, PropsSchema, PushContent, type PushOptions, PushTemplate, PushTemplateBase, PushTemplateDefinition, type Reentry, ReentryIR, RegistryIndex, ResolvedEmail, ResolvedProps, ResourceChange, ScalarIR, type SegmentDefinition, SegmentIR, type SegmentRef, SlackContent, SlackTemplate, SourceLocIR, type SubFlow, SubscriptionsDefinition, SubscriptionsIR, TemplateChannel, type TemplateFactory, TemplateIR, TemplateIssue, type TemplateRef, TemplateRegistry, TemplateTopic, TemplateValidationError, type TimeOfDay, Topic, type TriggerFactory, TriggerIR, type TriggerPayloadRef, TriggerPayloadRefIR, type TriggerPayloadRefNode, type TriggerPayloadRefs, type TriggerRef, type UserPropertyBase, type UserPropertyRef, UserPropertyRefIR, type UserRefs, WebPushConfig, WebhookTemplateDefinition, type Weekday, WeekdayIR, type WorkflowBuilder, WorkflowChange, type WorkflowDefinition, WorkflowIR, action, and, apnsEnvironment, assertEmailAddress, assertEmailConfig, assertEmailMetadata, assertHttpUrl, assertSupportedSchema, assertTemplateTopic, assertUnsubscribeUrl, between, canonicalJSON, checkEmit, checkEvent, checkInFlight, checkMessage, checkTriggerRefs, compileBundle, compileConfig, contains, defineConfig, defineContract, describeInFlight, discordTemplate, emailTemplate, eq, event, exists, flow, formatEmailAddress, fullHash, gt, gte, inArray, indexTemplates, isConfig, isContract, isDiscordTemplate, isEmailAddress, isEmailTemplate, isPushTemplate, isSemanticChange, isSlackTemplate, isTemplate, isUnsubscribeLink, lookupTemplate, lt, lte, mimeAddress, ne, nodesOf, not, notBetween, notContains, notExists, notInArray, or, parseTemplateProps, performed, pinnedWorkflows, plan, preferencesLink, pushTemplate, reachable, registryIndex, registryValidator, renderDiscordContent, renderPushContent, renderSlackContent, resolveEmail, resolveRuntime, segment, semanticHash, sha256Hex, slackTemplate, stripMeta, stripProvenance, template, templatesFor, trigger, user, workflow };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "./dsl/index.mjs";
|
|
2
|
+
import { action } from "./dsl/action.mjs";
|
|
3
|
+
import { event, user } from "./dsl/refs.mjs";
|
|
4
|
+
import { template } from "./dsl/template.mjs";
|
|
5
|
+
import { and, between, contains, eq, exists, gt, gte, inArray, lt, lte, ne, not, notBetween, notContains, notExists, notInArray, or, performed, reachable, segment } from "./dsl/condition.mjs";
|
|
6
|
+
import { canonicalJSON, fullHash, semanticHash, sha256Hex, stripMeta, stripProvenance } from "./hash.mjs";
|
|
7
|
+
import { ActionIR, BundleIR, ChannelIR, ConditionIR, DurationIR, GoalIR, IR_VERSION, MetaIR, NodeIR, NodeMetaIR, PropValueIR, PropertyOperatorIR, ReentryIR, ScalarIR, SegmentIR, SourceLocIR, SubscriptionsIR, TemplateIR, TriggerIR, TriggerPayloadRefIR, UserPropertyRefIR, WeekdayIR, WorkflowIR } from "./ir.mjs";
|
|
8
|
+
import { flow } from "./dsl/flow.mjs";
|
|
9
|
+
import { trigger } from "./dsl/trigger.mjs";
|
|
10
|
+
import { isSemanticChange, nodesOf, plan } from "./plan.mjs";
|
|
11
|
+
import { workflow } from "./dsl/workflow.mjs";
|
|
12
|
+
import { checkInFlight, describeInFlight, pinnedWorkflows } from "./inflight.mjs";
|
|
13
|
+
import { compileBundle } from "./dsl/bundle.mjs";
|
|
14
|
+
import { resolveRuntime } from "./runtime.mjs";
|
|
15
|
+
import { ConfigCompileError, apnsEnvironment, checkEmit, checkMessage, checkTriggerRefs, compileConfig, defineConfig, isConfig, registryIndex } from "./config.mjs";
|
|
16
|
+
import { PREVIEW_MESSAGE_ID, formatEmailAddress, mimeAddress, preferencesLink, resolveEmail } from "./email.mjs";
|
|
17
|
+
import { assertEmailAddress, assertEmailConfig, assertEmailMetadata, assertHttpUrl, assertTemplateTopic, assertUnsubscribeUrl, isEmailAddress, isUnsubscribeLink } from "./template-rules.mjs";
|
|
18
|
+
import { CHANNEL_OF, TemplateValidationError, assertSupportedSchema, discordTemplate, emailTemplate, indexTemplates, isDiscordTemplate, isEmailTemplate, isPushTemplate, isSlackTemplate, isTemplate, lookupTemplate, parseTemplateProps, pushTemplate, registryValidator, renderDiscordContent, renderPushContent, renderSlackContent, slackTemplate, templatesFor } from "./templates.mjs";
|
|
19
|
+
import { ContractValidationError, checkEvent, defineContract, isContract } from "./contract.mjs";
|
|
20
|
+
export { ActionIR, BundleIR, CHANNEL_OF, ChannelIR, ConditionIR, ConfigCompileError, ContractValidationError, DurationIR, GoalIR, IR_VERSION, MetaIR, NodeIR, NodeMetaIR, PREVIEW_MESSAGE_ID, PropValueIR, PropertyOperatorIR, ReentryIR, ScalarIR, SegmentIR, SourceLocIR, SubscriptionsIR, TemplateIR, TemplateValidationError, TriggerIR, TriggerPayloadRefIR, UserPropertyRefIR, WeekdayIR, WorkflowIR, action, and, apnsEnvironment, assertEmailAddress, assertEmailConfig, assertEmailMetadata, assertHttpUrl, assertSupportedSchema, assertTemplateTopic, assertUnsubscribeUrl, between, canonicalJSON, checkEmit, checkEvent, checkInFlight, checkMessage, checkTriggerRefs, compileBundle, compileConfig, contains, defineConfig, defineContract, describeInFlight, discordTemplate, emailTemplate, eq, event, exists, flow, formatEmailAddress, fullHash, gt, gte, inArray, indexTemplates, isConfig, isContract, isDiscordTemplate, isEmailAddress, isEmailTemplate, isPushTemplate, isSemanticChange, isSlackTemplate, isTemplate, isUnsubscribeLink, lookupTemplate, lt, lte, mimeAddress, ne, nodesOf, not, notBetween, notContains, notExists, notInArray, or, parseTemplateProps, performed, pinnedWorkflows, plan, preferencesLink, pushTemplate, reachable, registryIndex, registryValidator, renderDiscordContent, renderPushContent, renderSlackContent, resolveEmail, resolveRuntime, segment, semanticHash, sha256Hex, slackTemplate, stripMeta, stripProvenance, template, templatesFor, trigger, user, workflow };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_config = require("./config.cjs");
|
|
3
|
+
const require_dsl_bundle = require("./dsl/bundle.cjs");
|
|
4
|
+
const require_plan = require("./plan.cjs");
|
|
5
|
+
// src/inflight.ts
|
|
6
|
+
/** The pinned versions with running journeys, each with its stored IR. */
|
|
7
|
+
async function pinnedWorkflows(store) {
|
|
8
|
+
const pins = await store.runningPins();
|
|
9
|
+
return Promise.all(pins.map(async ({ workflow, contentHash, running }) => ({
|
|
10
|
+
workflow,
|
|
11
|
+
contentHash,
|
|
12
|
+
running,
|
|
13
|
+
ir: await store.getWorkflowIR(contentHash)
|
|
14
|
+
})));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Every way `bundle` (and `config`'s registry, when given — the templates the code would then
|
|
18
|
+
* serve) fails a pinned IR. Without a config only the bundle is checked: segments, actions, and
|
|
19
|
+
* the template manifest when the bundle carries one. Empty when the deploy is safe.
|
|
20
|
+
*/
|
|
21
|
+
function checkInFlight(pinned, bundle, config) {
|
|
22
|
+
const segments = new Set(bundle.segments.map((s) => s.id));
|
|
23
|
+
const actions = new Set(bundle.actions.map((a) => a.name));
|
|
24
|
+
const templates = new Set(bundle.templates.map((t) => `${t.channel}:${t.key}`));
|
|
25
|
+
const index = config === void 0 ? void 0 : require_config.registryIndex(config);
|
|
26
|
+
const problems = [];
|
|
27
|
+
for (const pin of pinned) {
|
|
28
|
+
const report = (problem) => {
|
|
29
|
+
const { workflow, contentHash, running } = pin;
|
|
30
|
+
problems.push({
|
|
31
|
+
workflow,
|
|
32
|
+
contentHash,
|
|
33
|
+
running,
|
|
34
|
+
problem
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
if (pin.ir === void 0) {
|
|
38
|
+
report("its workflow body is not in the store");
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
for (const segment of require_dsl_bundle.referencedSegments(pin.ir)) if (!segments.has(segment)) report(`segment '${segment}' is not in the bundle`);
|
|
42
|
+
const contract = config?.contract;
|
|
43
|
+
if (contract !== void 0) {
|
|
44
|
+
for (const [event, where] of awaitedEvents(pin.ir)) if (!contract.isEvent(event)) report(`${where} waits for '${String(event)}', which is not in the contract`);
|
|
45
|
+
}
|
|
46
|
+
if (config !== void 0) try {
|
|
47
|
+
require_config.checkTriggerRefs(pin.ir, config);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (!(error instanceof require_config.ConfigCompileError)) throw error;
|
|
50
|
+
report(error.message);
|
|
51
|
+
}
|
|
52
|
+
for (const node of require_plan.nodesOf(pin.ir.flow)) {
|
|
53
|
+
if (node.type === "action" && !actions.has(node.action)) report(`node ${node.id}: action '${node.action}' is not in the bundle`);
|
|
54
|
+
if (node.type === "send_event" && config !== void 0) try {
|
|
55
|
+
require_config.checkEmit(pin.ir, node, config);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
if (!(error instanceof require_config.ConfigCompileError)) throw error;
|
|
58
|
+
report(error.message);
|
|
59
|
+
}
|
|
60
|
+
if (node.type !== "message") continue;
|
|
61
|
+
if (index !== void 0 && config !== void 0) try {
|
|
62
|
+
require_config.checkMessage(pin.ir, node, index, config);
|
|
63
|
+
} catch (error) {
|
|
64
|
+
if (!(error instanceof require_config.ConfigCompileError)) throw error;
|
|
65
|
+
report(error.message);
|
|
66
|
+
}
|
|
67
|
+
else if (bundle.templates.length > 0) {
|
|
68
|
+
const key = `${node.channel}:${node.template}`;
|
|
69
|
+
if (!templates.has(key)) report(`node ${node.id}: ${node.channel} template '${node.template}' is not in the bundle`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return problems;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The events a running journey still waits for, each with where it waits: a `waitUntil`, the
|
|
77
|
+
* exit condition, the goal. Conditions that only look back (a branch, a filter, the trigger) are
|
|
78
|
+
* left out — the occurrences they count are in the log whatever the contract says now.
|
|
79
|
+
*/
|
|
80
|
+
function awaitedEvents(workflow) {
|
|
81
|
+
const awaited = [];
|
|
82
|
+
const collect = (condition, where) => {
|
|
83
|
+
switch (condition.type) {
|
|
84
|
+
case "and":
|
|
85
|
+
case "or":
|
|
86
|
+
for (const child of condition.conditions) collect(child, where);
|
|
87
|
+
break;
|
|
88
|
+
case "not":
|
|
89
|
+
collect(condition.condition, where);
|
|
90
|
+
break;
|
|
91
|
+
case "performed": awaited.push([condition.event, where]);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
if (workflow.exitWhen !== void 0) collect(workflow.exitWhen, "exitWhen");
|
|
95
|
+
if (workflow.goal !== void 0) collect(workflow.goal.condition, "the goal");
|
|
96
|
+
for (const node of require_plan.nodesOf(workflow.flow)) if (node.type === "wait_until") collect(node.condition, `node ${node.id}`);
|
|
97
|
+
return awaited;
|
|
98
|
+
}
|
|
99
|
+
/** The problems as lines, one per pinned version, with the journeys it carries. */
|
|
100
|
+
function describeInFlight(problems) {
|
|
101
|
+
const byPin = /* @__PURE__ */ new Map();
|
|
102
|
+
for (const problem of problems) {
|
|
103
|
+
const key = `${problem.workflow}@${problem.contentHash}`;
|
|
104
|
+
byPin.set(key, [...byPin.get(key) ?? [], problem]);
|
|
105
|
+
}
|
|
106
|
+
return [...byPin.values()].map((group) => {
|
|
107
|
+
const [{ workflow, contentHash, running }] = group;
|
|
108
|
+
const journeys = `${running} running ${running === 1 ? "journey" : "journeys"}`;
|
|
109
|
+
return `${workflow}@${contentHash.slice(0, 8)} (${journeys}): ${group.map((p) => p.problem).join("; ")}`;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
exports.checkInFlight = checkInFlight;
|
|
113
|
+
exports.describeInFlight = describeInFlight;
|
|
114
|
+
exports.pinnedWorkflows = pinnedWorkflows;
|
|
115
|
+
|
|
116
|
+
//# sourceMappingURL=inflight.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inflight.cjs","names":["registryIndex","referencedSegments","checkTriggerRefs","ConfigCompileError","nodesOf","checkEmit","checkMessage"],"sources":["../src/inflight.ts"],"sourcesContent":["import {\n ConfigCompileError,\n type JourneyConfig,\n checkEmit,\n checkMessage,\n checkTriggerRefs,\n registryIndex,\n} from './config';\nimport { referencedSegments } from './dsl/bundle';\nimport type { BundleIR, ConditionIR, WorkflowIR } from './ir';\nimport { nodesOf } from './plan';\nimport type { JourneyStore } from './store/index';\n\n/**\n * In-flight compatibility: what a deploy would take away from the journeys still running.\n *\n * A journey is pinned to the workflow IR it entered on and runs it to completion, but the IR only\n * *names* what it uses — a template by channel and key, a segment or an action by id — and those\n * are resolved at the moment of use against the deployed bundle and the code serving it. That is\n * the design (README \"Versioning\"): the latest content goes out, a segment is a live audience. It\n * leaves one way to break a running journey — a deploy that removes or reshapes something a\n * pinned IR still names — and these checks find it before the deploy, on the pinned IRs\n * themselves, against the bundle and registry that would serve them. A compatible change (a\n * reworded template, a new optional prop, a segment's condition) passes; an incompatible one (a\n * template gone or moved to another channel, a new required prop, a segment or action removed,\n * an event a journey emits or waits for gone from the contract, a trigger payload field a\n * journey reads gone from the event's schema) is reported with the journeys it\n * would break.\n *\n * Not checked: a profile field whose type changed under a template prop that reads it. The\n * field's name is (`checkMessage`); its value is parsed by the template at each send.\n */\n\n/** One pinned version of a workflow: the IR and how many journeys are running on it. */\nexport interface PinnedWorkflow {\n workflow: string;\n contentHash: string;\n /** Journeys with a `running` entry on this hash. */\n running: number;\n /** The stored IR; undefined when the store has no body for the hash (those journeys cannot run). */\n ir: WorkflowIR | undefined;\n}\n\nexport interface InFlightProblem {\n workflow: string;\n contentHash: string;\n running: number;\n /** What the bundle would take away, as a sentence naming the node where there is one. */\n problem: string;\n}\n\n/** The pinned versions with running journeys, each with its stored IR. */\nexport async function pinnedWorkflows(\n store: Pick<JourneyStore, 'runningPins' | 'getWorkflowIR'>\n): Promise<PinnedWorkflow[]> {\n const pins = await store.runningPins();\n return Promise.all(\n pins.map(async ({ workflow, contentHash, running }) => ({\n workflow,\n contentHash,\n running,\n ir: await store.getWorkflowIR(contentHash),\n }))\n );\n}\n\n/**\n * Every way `bundle` (and `config`'s registry, when given — the templates the code would then\n * serve) fails a pinned IR. Without a config only the bundle is checked: segments, actions, and\n * the template manifest when the bundle carries one. Empty when the deploy is safe.\n */\nexport function checkInFlight(\n pinned: readonly PinnedWorkflow[],\n bundle: BundleIR,\n config?: JourneyConfig\n): InFlightProblem[] {\n const segments = new Set(bundle.segments.map((s) => s.id));\n const actions = new Set(bundle.actions.map((a) => a.name));\n const templates = new Set(bundle.templates.map((t) => `${t.channel}:${t.key}`));\n const index = config === undefined ? undefined : registryIndex(config);\n const problems: InFlightProblem[] = [];\n for (const pin of pinned) {\n const report = (problem: string) => {\n const { workflow, contentHash, running } = pin;\n problems.push({ workflow, contentHash, running, problem });\n };\n if (pin.ir === undefined) {\n report('its workflow body is not in the store');\n continue;\n }\n for (const segment of referencedSegments(pin.ir)) {\n if (!segments.has(segment)) report(`segment '${segment}' is not in the bundle`);\n }\n const contract = config?.contract;\n if (contract !== undefined) {\n // An event the contract no longer declares is refused at ingest, so it never arrives\n // again: the journey would sit out its wait to the timeout, or never exit or convert\n for (const [event, where] of awaitedEvents(pin.ir)) {\n if (!contract.isEvent(event)) {\n report(`${where} waits for '${String(event)}', which is not in the contract`);\n }\n }\n }\n if (config !== undefined) {\n // A field gone from the contract reads as missing from then on, and nothing fails\n try {\n checkTriggerRefs(pin.ir, config);\n } catch (error) {\n if (!(error instanceof ConfigCompileError)) throw error;\n report(error.message);\n }\n }\n for (const node of nodesOf(pin.ir.flow)) {\n if (node.type === 'action' && !actions.has(node.action)) {\n report(`node ${node.id}: action '${node.action}' is not in the bundle`);\n }\n if (node.type === 'send_event' && config !== undefined) {\n // The emit is refused when it happens, and that failure is not retried\n try {\n checkEmit(pin.ir, node, config);\n } catch (error) {\n if (!(error instanceof ConfigCompileError)) throw error;\n report(error.message);\n }\n }\n if (node.type !== 'message') continue;\n if (index !== undefined && config !== undefined) {\n try {\n checkMessage(pin.ir, node, index, config);\n } catch (error) {\n if (!(error instanceof ConfigCompileError)) throw error;\n report(error.message);\n }\n } else if (bundle.templates.length > 0) {\n const key = `${node.channel}:${node.template}`;\n if (!templates.has(key)) {\n report(\n `node ${node.id}: ${node.channel} template '${node.template}' is not in the bundle`\n );\n }\n }\n }\n }\n return problems;\n}\n\n/**\n * The events a running journey still waits for, each with where it waits: a `waitUntil`, the\n * exit condition, the goal. Conditions that only look back (a branch, a filter, the trigger) are\n * left out — the occurrences they count are in the log whatever the contract says now.\n */\nfunction awaitedEvents(workflow: WorkflowIR): [event: string, where: string][] {\n const awaited: [string, string][] = [];\n const collect = (condition: ConditionIR, where: string): void => {\n switch (condition.type) {\n case 'and':\n case 'or':\n for (const child of condition.conditions) collect(child, where);\n break;\n case 'not':\n collect(condition.condition, where);\n break;\n case 'performed':\n awaited.push([condition.event, where]);\n break;\n default:\n break;\n }\n };\n if (workflow.exitWhen !== undefined) collect(workflow.exitWhen, 'exitWhen');\n if (workflow.goal !== undefined) collect(workflow.goal.condition, 'the goal');\n for (const node of nodesOf(workflow.flow)) {\n if (node.type === 'wait_until') collect(node.condition, `node ${node.id}`);\n }\n return awaited;\n}\n\n/** The problems as lines, one per pinned version, with the journeys it carries. */\nexport function describeInFlight(problems: readonly InFlightProblem[]): string[] {\n const byPin = new Map<string, InFlightProblem[]>();\n for (const problem of problems) {\n const key = `${problem.workflow}@${problem.contentHash}`;\n byPin.set(key, [...(byPin.get(key) ?? []), problem]);\n }\n return [...byPin.values()].map((group) => {\n const [{ workflow, contentHash, running }] = group as [InFlightProblem, ...InFlightProblem[]];\n const journeys = `${running} running ${running === 1 ? 'journey' : 'journeys'}`;\n return `${workflow}@${contentHash.slice(0, 8)} (${journeys}): ${group.map((p) => p.problem).join('; ')}`;\n });\n}\n"],"mappings":";;;;;;AAoDA,eAAsB,gBACpB,OAC2B;CAC3B,MAAM,OAAO,MAAM,MAAM,YAAY;CACrC,OAAO,QAAQ,IACb,KAAK,IAAI,OAAO,EAAE,UAAU,aAAa,eAAe;EACtD;EACA;EACA;EACA,IAAI,MAAM,MAAM,cAAc,WAAW;CAC3C,EAAE,CACJ;AACF;;;;;;AAOA,SAAgB,cACd,QACA,QACA,QACmB;CACnB,MAAM,WAAW,IAAI,IAAI,OAAO,SAAS,KAAK,MAAM,EAAE,EAAE,CAAC;CACzD,MAAM,UAAU,IAAI,IAAI,OAAO,QAAQ,KAAK,MAAM,EAAE,IAAI,CAAC;CACzD,MAAM,YAAY,IAAI,IAAI,OAAO,UAAU,KAAK,MAAM,GAAG,EAAE,QAAQ,GAAG,EAAE,KAAK,CAAC;CAC9E,MAAM,QAAQ,WAAW,KAAA,IAAY,KAAA,IAAYA,eAAAA,cAAc,MAAM;CACrE,MAAM,WAA8B,CAAC;CACrC,KAAK,MAAM,OAAO,QAAQ;EACxB,MAAM,UAAU,YAAoB;GAClC,MAAM,EAAE,UAAU,aAAa,YAAY;GAC3C,SAAS,KAAK;IAAE;IAAU;IAAa;IAAS;GAAQ,CAAC;EAC3D;EACA,IAAI,IAAI,OAAO,KAAA,GAAW;GACxB,OAAO,uCAAuC;GAC9C;EACF;EACA,KAAK,MAAM,WAAWC,mBAAAA,mBAAmB,IAAI,EAAE,GAC7C,IAAI,CAAC,SAAS,IAAI,OAAO,GAAG,OAAO,YAAY,QAAQ,uBAAuB;EAEhF,MAAM,WAAW,QAAQ;EACzB,IAAI,aAAa,KAAA,GAGV;QAAA,MAAM,CAAC,OAAO,UAAU,cAAc,IAAI,EAAE,GAC/C,IAAI,CAAC,SAAS,QAAQ,KAAK,GACzB,OAAO,GAAG,MAAM,cAAc,OAAO,KAAK,EAAE,gCAAgC;EAAA;EAIlF,IAAI,WAAW,KAAA,GAEb,IAAI;GACFC,eAAAA,iBAAiB,IAAI,IAAI,MAAM;EACjC,SAAS,OAAO;GACd,IAAI,EAAE,iBAAiBC,eAAAA,qBAAqB,MAAM;GAClD,OAAO,MAAM,OAAO;EACtB;EAEF,KAAK,MAAM,QAAQC,aAAAA,QAAQ,IAAI,GAAG,IAAI,GAAG;GACvC,IAAI,KAAK,SAAS,YAAY,CAAC,QAAQ,IAAI,KAAK,MAAM,GACpD,OAAO,QAAQ,KAAK,GAAG,YAAY,KAAK,OAAO,uBAAuB;GAExE,IAAI,KAAK,SAAS,gBAAgB,WAAW,KAAA,GAE3C,IAAI;IACFC,eAAAA,UAAU,IAAI,IAAI,MAAM,MAAM;GAChC,SAAS,OAAO;IACd,IAAI,EAAE,iBAAiBF,eAAAA,qBAAqB,MAAM;IAClD,OAAO,MAAM,OAAO;GACtB;GAEF,IAAI,KAAK,SAAS,WAAW;GAC7B,IAAI,UAAU,KAAA,KAAa,WAAW,KAAA,GACpC,IAAI;IACFG,eAAAA,aAAa,IAAI,IAAI,MAAM,OAAO,MAAM;GAC1C,SAAS,OAAO;IACd,IAAI,EAAE,iBAAiBH,eAAAA,qBAAqB,MAAM;IAClD,OAAO,MAAM,OAAO;GACtB;QACK,IAAI,OAAO,UAAU,SAAS,GAAG;IACtC,MAAM,MAAM,GAAG,KAAK,QAAQ,GAAG,KAAK;IACpC,IAAI,CAAC,UAAU,IAAI,GAAG,GACpB,OACE,QAAQ,KAAK,GAAG,IAAI,KAAK,QAAQ,aAAa,KAAK,SAAS,uBAC9D;GAEJ;EACF;CACF;CACA,OAAO;AACT;;;;;;AAOA,SAAS,cAAc,UAAwD;CAC7E,MAAM,UAA8B,CAAC;CACrC,MAAM,WAAW,WAAwB,UAAwB;EAC/D,QAAQ,UAAU,MAAlB;GACE,KAAK;GACL,KAAK;IACH,KAAK,MAAM,SAAS,UAAU,YAAY,QAAQ,OAAO,KAAK;IAC9D;GACF,KAAK;IACH,QAAQ,UAAU,WAAW,KAAK;IAClC;GACF,KAAK,aACH,QAAQ,KAAK,CAAC,UAAU,OAAO,KAAK,CAAC;EAIzC;CACF;CACA,IAAI,SAAS,aAAa,KAAA,GAAW,QAAQ,SAAS,UAAU,UAAU;CAC1E,IAAI,SAAS,SAAS,KAAA,GAAW,QAAQ,SAAS,KAAK,WAAW,UAAU;CAC5E,KAAK,MAAM,QAAQC,aAAAA,QAAQ,SAAS,IAAI,GACtC,IAAI,KAAK,SAAS,cAAc,QAAQ,KAAK,WAAW,QAAQ,KAAK,IAAI;CAE3E,OAAO;AACT;;AAGA,SAAgB,iBAAiB,UAAgD;CAC/E,MAAM,wBAAQ,IAAI,IAA+B;CACjD,KAAK,MAAM,WAAW,UAAU;EAC9B,MAAM,MAAM,GAAG,QAAQ,SAAS,GAAG,QAAQ;EAC3C,MAAM,IAAI,KAAK,CAAC,GAAI,MAAM,IAAI,GAAG,KAAK,CAAC,GAAI,OAAO,CAAC;CACrD;CACA,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,UAAU;EACxC,MAAM,CAAC,EAAE,UAAU,aAAa,aAAa;EAC7C,MAAM,WAAW,GAAG,QAAQ,WAAW,YAAY,IAAI,YAAY;EACnE,OAAO,GAAG,SAAS,GAAG,YAAY,MAAM,GAAG,CAAC,EAAE,IAAI,SAAS,KAAK,MAAM,KAAK,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI;CACvG,CAAC;AACH"}
|