@hogsend/engine 0.67.0 → 0.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/account-links/__fixtures__/fake-fetch.d.ts +38 -0
- package/dist/account-links/__fixtures__/fake-fetch.d.ts.map +1 -0
- package/dist/account-links/battlenet.d.ts +36 -0
- package/dist/account-links/battlenet.d.ts.map +1 -0
- package/dist/account-links/epic.d.ts +36 -0
- package/dist/account-links/epic.d.ts.map +1 -0
- package/dist/account-links/index.d.ts +7 -0
- package/dist/account-links/index.d.ts.map +1 -0
- package/dist/account-links/riot.d.ts +35 -0
- package/dist/account-links/riot.d.ts.map +1 -0
- package/dist/account-links/steam.d.ts +35 -0
- package/dist/account-links/steam.d.ts.map +1 -0
- package/dist/account-links/twitch.d.ts +38 -0
- package/dist/account-links/twitch.d.ts.map +1 -0
- package/dist/account-links/xbox.d.ts +39 -0
- package/dist/account-links/xbox.d.ts.map +1 -0
- package/dist/app.d.ts +50 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/buckets/bucket-access.d.ts +60 -0
- package/dist/buckets/bucket-access.d.ts.map +1 -0
- package/dist/buckets/bucket-reactions.d.ts +100 -0
- package/dist/buckets/bucket-reactions.d.ts.map +1 -0
- package/dist/buckets/check-membership.d.ts +105 -0
- package/dist/buckets/check-membership.d.ts.map +1 -0
- package/dist/buckets/define-bucket.d.ts +53 -0
- package/dist/buckets/define-bucket.d.ts.map +1 -0
- package/dist/buckets/membership-epoch.d.ts +74 -0
- package/dist/buckets/membership-epoch.d.ts.map +1 -0
- package/dist/buckets/registry-singleton.d.ts +6 -0
- package/dist/buckets/registry-singleton.d.ts.map +1 -0
- package/dist/buckets/registry.d.ts +59 -0
- package/dist/buckets/registry.d.ts.map +1 -0
- package/dist/campaigns/cohort-sql.d.ts +54 -0
- package/dist/campaigns/cohort-sql.d.ts.map +1 -0
- package/dist/campaigns/define-campaign.d.ts +105 -0
- package/dist/campaigns/define-campaign.d.ts.map +1 -0
- package/dist/campaigns/reconcile.d.ts +13 -0
- package/dist/campaigns/reconcile.d.ts.map +1 -0
- package/dist/campaigns/steps.d.ts +29 -0
- package/dist/campaigns/steps.d.ts.map +1 -0
- package/dist/cold-connect/index.d.ts +98 -0
- package/dist/cold-connect/index.d.ts.map +1 -0
- package/dist/cold-connect/page.d.ts +69 -0
- package/dist/cold-connect/page.d.ts.map +1 -0
- package/dist/cold-connect/throttle.d.ts +39 -0
- package/dist/cold-connect/throttle.d.ts.map +1 -0
- package/dist/cold-connect/token.d.ts +57 -0
- package/dist/cold-connect/token.d.ts.map +1 -0
- package/dist/connectors/action-registry-singleton.d.ts +21 -0
- package/dist/connectors/action-registry-singleton.d.ts.map +1 -0
- package/dist/connectors/define-action.d.ts +117 -0
- package/dist/connectors/define-action.d.ts.map +1 -0
- package/dist/connectors/define-connector.d.ts +172 -0
- package/dist/connectors/define-connector.d.ts.map +1 -0
- package/dist/connectors/presets/index.d.ts +17 -0
- package/dist/connectors/presets/index.d.ts.map +1 -0
- package/dist/connectors/registry-singleton.d.ts +34 -0
- package/dist/connectors/registry-singleton.d.ts.map +1 -0
- package/dist/connectors/runtime.d.ts +68 -0
- package/dist/connectors/runtime.d.ts.map +1 -0
- package/dist/container.d.ts +678 -0
- package/dist/container.d.ts.map +1 -0
- package/dist/destinations/define-destination.d.ts +96 -0
- package/dist/destinations/define-destination.d.ts.map +1 -0
- package/dist/destinations/presets/index.d.ts +42 -0
- package/dist/destinations/presets/index.d.ts.map +1 -0
- package/dist/destinations/presets/posthog.d.ts +12 -0
- package/dist/destinations/presets/posthog.d.ts.map +1 -0
- package/dist/destinations/presets/segment.d.ts +15 -0
- package/dist/destinations/presets/segment.d.ts.map +1 -0
- package/dist/destinations/presets/slack.d.ts +10 -0
- package/dist/destinations/presets/slack.d.ts.map +1 -0
- package/dist/destinations/presets/webhook.d.ts +14 -0
- package/dist/destinations/presets/webhook.d.ts.map +1 -0
- package/dist/destinations/registry-singleton.d.ts +44 -0
- package/dist/destinations/registry-singleton.d.ts.map +1 -0
- package/dist/env.d.ts +119 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/flags/reconcile.d.ts +36 -0
- package/dist/flags/reconcile.d.ts.map +1 -0
- package/dist/index.d.ts +210 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/journeys/authoring.d.ts +15 -0
- package/dist/journeys/authoring.d.ts.map +1 -0
- package/dist/journeys/client-defaults-singleton.d.ts +16 -0
- package/dist/journeys/client-defaults-singleton.d.ts.map +1 -0
- package/dist/journeys/constants.d.ts +32 -0
- package/dist/journeys/constants.d.ts.map +1 -0
- package/dist/journeys/define-journey.d.ts +33 -0
- package/dist/journeys/define-journey.d.ts.map +1 -0
- package/dist/journeys/durable-law-harness.d.ts +74 -0
- package/dist/journeys/durable-law-harness.d.ts.map +1 -0
- package/dist/journeys/errors.d.ts +13 -0
- package/dist/journeys/errors.d.ts.map +1 -0
- package/dist/journeys/execute-journey-run.d.ts +160 -0
- package/dist/journeys/execute-journey-run.d.ts.map +1 -0
- package/dist/journeys/graph/build-graph.d.ts +24 -0
- package/dist/journeys/graph/build-graph.d.ts.map +1 -0
- package/dist/journeys/group-scope.d.ts +56 -0
- package/dist/journeys/group-scope.d.ts.map +1 -0
- package/dist/journeys/journey-boundary.d.ts +264 -0
- package/dist/journeys/journey-boundary.d.ts.map +1 -0
- package/dist/journeys/journey-context.d.ts +60 -0
- package/dist/journeys/journey-context.d.ts.map +1 -0
- package/dist/journeys/journey-log.d.ts +42 -0
- package/dist/journeys/journey-log.d.ts.map +1 -0
- package/dist/journeys/journey-source-locations-singleton.d.ts +6 -0
- package/dist/journeys/journey-source-locations-singleton.d.ts.map +1 -0
- package/dist/journeys/journey-sources-singleton.d.ts +5 -0
- package/dist/journeys/journey-sources-singleton.d.ts.map +1 -0
- package/dist/journeys/journey-task-factory.d.ts +11 -0
- package/dist/journeys/journey-task-factory.d.ts.map +1 -0
- package/dist/journeys/journey-task-runtime.d.ts +2 -0
- package/dist/journeys/journey-task-runtime.d.ts.map +1 -0
- package/dist/journeys/journey-version.d.ts +71 -0
- package/dist/journeys/journey-version.d.ts.map +1 -0
- package/dist/journeys/record-once.d.ts +56 -0
- package/dist/journeys/record-once.d.ts.map +1 -0
- package/dist/journeys/registry-singleton.d.ts +6 -0
- package/dist/journeys/registry-singleton.d.ts.map +1 -0
- package/dist/journeys/registry.d.ts +59 -0
- package/dist/journeys/registry.d.ts.map +1 -0
- package/dist/journeys/with-durable-gate.d.ts +97 -0
- package/dist/journeys/with-durable-gate.d.ts.map +1 -0
- package/dist/lib/account-link-emit.d.ts +69 -0
- package/dist/lib/account-link-emit.d.ts.map +1 -0
- package/dist/lib/account-link-events.d.ts +128 -0
- package/dist/lib/account-link-events.d.ts.map +1 -0
- package/dist/lib/account-link-hooks.d.ts +32 -0
- package/dist/lib/account-link-hooks.d.ts.map +1 -0
- package/dist/lib/account-link-ingest.d.ts +78 -0
- package/dist/lib/account-link-ingest.d.ts.map +1 -0
- package/dist/lib/account-link-nonce.d.ts +29 -0
- package/dist/lib/account-link-nonce.d.ts.map +1 -0
- package/dist/lib/account-link-origins.d.ts +37 -0
- package/dist/lib/account-link-origins.d.ts.map +1 -0
- package/dist/lib/account-link-pkce.d.ts +48 -0
- package/dist/lib/account-link-pkce.d.ts.map +1 -0
- package/dist/lib/account-link-provider-registry.d.ts +35 -0
- package/dist/lib/account-link-provider-registry.d.ts.map +1 -0
- package/dist/lib/account-link-throttle.d.ts +76 -0
- package/dist/lib/account-link-throttle.d.ts.map +1 -0
- package/dist/lib/account-link-url.d.ts +41 -0
- package/dist/lib/account-link-url.d.ts.map +1 -0
- package/dist/lib/account-links-from-env.d.ts +62 -0
- package/dist/lib/account-links-from-env.d.ts.map +1 -0
- package/dist/lib/account-links.d.ts +353 -0
- package/dist/lib/account-links.d.ts.map +1 -0
- package/dist/lib/agent/config.d.ts +14 -0
- package/dist/lib/agent/config.d.ts.map +1 -0
- package/dist/lib/agent/proposals.d.ts +52 -0
- package/dist/lib/agent/proposals.d.ts.map +1 -0
- package/dist/lib/agent/provider.d.ts +9 -0
- package/dist/lib/agent/provider.d.ts.map +1 -0
- package/dist/lib/agent/risk.d.ts +24 -0
- package/dist/lib/agent/risk.d.ts.map +1 -0
- package/dist/lib/agent/system-prompt.d.ts +8 -0
- package/dist/lib/agent/system-prompt.d.ts.map +1 -0
- package/dist/lib/agent/tools.d.ts +258 -0
- package/dist/lib/agent/tools.d.ts.map +1 -0
- package/dist/lib/alerting.d.ts +7 -0
- package/dist/lib/alerting.d.ts.map +1 -0
- package/dist/lib/analytics-adapter.d.ts +24 -0
- package/dist/lib/analytics-adapter.d.ts.map +1 -0
- package/dist/lib/analytics-identity.d.ts +60 -0
- package/dist/lib/analytics-identity.d.ts.map +1 -0
- package/dist/lib/analytics-provider-registry.d.ts +20 -0
- package/dist/lib/analytics-provider-registry.d.ts.map +1 -0
- package/dist/lib/analytics-providers-from-env.d.ts +41 -0
- package/dist/lib/analytics-providers-from-env.d.ts.map +1 -0
- package/dist/lib/analytics-singleton.d.ts +10 -0
- package/dist/lib/analytics-singleton.d.ts.map +1 -0
- package/dist/lib/api-key-hash.d.ts +9 -0
- package/dist/lib/api-key-hash.d.ts.map +1 -0
- package/dist/lib/app-secret.d.ts +29 -0
- package/dist/lib/app-secret.d.ts.map +1 -0
- package/dist/lib/attachments.d.ts +53 -0
- package/dist/lib/attachments.d.ts.map +1 -0
- package/dist/lib/attribution-backfill.d.ts +48 -0
- package/dist/lib/attribution-backfill.d.ts.map +1 -0
- package/dist/lib/attribution.d.ts +44 -0
- package/dist/lib/attribution.d.ts.map +1 -0
- package/dist/lib/auth.d.ts +136 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/backfill.d.ts +41 -0
- package/dist/lib/backfill.d.ts.map +1 -0
- package/dist/lib/banner.d.ts +52 -0
- package/dist/lib/banner.d.ts.map +1 -0
- package/dist/lib/blueprint-lock.d.ts +19 -0
- package/dist/lib/blueprint-lock.d.ts.map +1 -0
- package/dist/lib/blueprints.d.ts +573 -0
- package/dist/lib/blueprints.d.ts.map +1 -0
- package/dist/lib/boot-api-key.d.ts +38 -0
- package/dist/lib/boot-api-key.d.ts.map +1 -0
- package/dist/lib/boot.d.ts +23 -0
- package/dist/lib/boot.d.ts.map +1 -0
- package/dist/lib/bootstrap-admin.d.ts +33 -0
- package/dist/lib/bootstrap-admin.d.ts.map +1 -0
- package/dist/lib/bot-prefetch.d.ts +21 -0
- package/dist/lib/bot-prefetch.d.ts.map +1 -0
- package/dist/lib/bucket-emit.d.ts +75 -0
- package/dist/lib/bucket-emit.d.ts.map +1 -0
- package/dist/lib/bucket-posthog-sync.d.ts +29 -0
- package/dist/lib/bucket-posthog-sync.d.ts.map +1 -0
- package/dist/lib/campaign-send-key.d.ts +31 -0
- package/dist/lib/campaign-send-key.d.ts.map +1 -0
- package/dist/lib/connector-actions.d.ts +83 -0
- package/dist/lib/connector-actions.d.ts.map +1 -0
- package/dist/lib/connector-heartbeat.d.ts +35 -0
- package/dist/lib/connector-heartbeat.d.ts.map +1 -0
- package/dist/lib/connector-link-codes.d.ts +105 -0
- package/dist/lib/connector-link-codes.d.ts.map +1 -0
- package/dist/lib/connector-state.d.ts +97 -0
- package/dist/lib/connector-state.d.ts.map +1 -0
- package/dist/lib/contacts.d.ts +622 -0
- package/dist/lib/contacts.d.ts.map +1 -0
- package/dist/lib/conversion-dispatch.d.ts +98 -0
- package/dist/lib/conversion-dispatch.d.ts.map +1 -0
- package/dist/lib/conversions.d.ts +75 -0
- package/dist/lib/conversions.d.ts.map +1 -0
- package/dist/lib/create-admin.d.ts +54 -0
- package/dist/lib/create-admin.d.ts.map +1 -0
- package/dist/lib/crm-deals.d.ts +66 -0
- package/dist/lib/crm-deals.d.ts.map +1 -0
- package/dist/lib/crm-ingest.d.ts +38 -0
- package/dist/lib/crm-ingest.d.ts.map +1 -0
- package/dist/lib/crm-provider-registry.d.ts +20 -0
- package/dist/lib/crm-provider-registry.d.ts.map +1 -0
- package/dist/lib/crm-registry-singleton.d.ts +18 -0
- package/dist/lib/crm-registry-singleton.d.ts.map +1 -0
- package/dist/lib/db.d.ts +3 -0
- package/dist/lib/db.d.ts.map +1 -0
- package/dist/lib/deal-money-events.d.ts +35 -0
- package/dist/lib/deal-money-events.d.ts.map +1 -0
- package/dist/lib/discord-gateway-heartbeat.d.ts +47 -0
- package/dist/lib/discord-gateway-heartbeat.d.ts.map +1 -0
- package/dist/lib/domain-status.d.ts +87 -0
- package/dist/lib/domain-status.d.ts.map +1 -0
- package/dist/lib/email-provider-registry.d.ts +30 -0
- package/dist/lib/email-provider-registry.d.ts.map +1 -0
- package/dist/lib/email-providers-from-env.d.ts +12 -0
- package/dist/lib/email-providers-from-env.d.ts.map +1 -0
- package/dist/lib/email-service-types.d.ts +189 -0
- package/dist/lib/email-service-types.d.ts.map +1 -0
- package/dist/lib/email-stats.d.ts +12 -0
- package/dist/lib/email-stats.d.ts.map +1 -0
- package/dist/lib/email.d.ts +73 -0
- package/dist/lib/email.d.ts.map +1 -0
- package/dist/lib/enrichment-ledger.d.ts +101 -0
- package/dist/lib/enrichment-ledger.d.ts.map +1 -0
- package/dist/lib/enrichment-provider-registry.d.ts +20 -0
- package/dist/lib/enrichment-provider-registry.d.ts.map +1 -0
- package/dist/lib/enrichment-providers-from-env.d.ts +13 -0
- package/dist/lib/enrichment-providers-from-env.d.ts.map +1 -0
- package/dist/lib/enrichment-registry-singleton.d.ts +9 -0
- package/dist/lib/enrichment-registry-singleton.d.ts.map +1 -0
- package/dist/lib/enrollment-guards.d.ts +28 -0
- package/dist/lib/enrollment-guards.d.ts.map +1 -0
- package/dist/lib/enrollment-policy.d.ts +25 -0
- package/dist/lib/enrollment-policy.d.ts.map +1 -0
- package/dist/lib/event-names.d.ts +27 -0
- package/dist/lib/event-names.d.ts.map +1 -0
- package/dist/lib/feed.d.ts +64 -0
- package/dist/lib/feed.d.ts.map +1 -0
- package/dist/lib/flags-registry.d.ts +23 -0
- package/dist/lib/flags-registry.d.ts.map +1 -0
- package/dist/lib/flags.d.ts +143 -0
- package/dist/lib/flags.d.ts.map +1 -0
- package/dist/lib/frequency-cap.d.ts +38 -0
- package/dist/lib/frequency-cap.d.ts.map +1 -0
- package/dist/lib/from-address.d.ts +15 -0
- package/dist/lib/from-address.d.ts.map +1 -0
- package/dist/lib/funnel-progress.d.ts +37 -0
- package/dist/lib/funnel-progress.d.ts.map +1 -0
- package/dist/lib/funnel-registry.d.ts +44 -0
- package/dist/lib/funnel-registry.d.ts.map +1 -0
- package/dist/lib/funnel-transitions.d.ts +63 -0
- package/dist/lib/funnel-transitions.d.ts.map +1 -0
- package/dist/lib/fx.d.ts +118 -0
- package/dist/lib/fx.d.ts.map +1 -0
- package/dist/lib/global-control-readout.d.ts +72 -0
- package/dist/lib/global-control-readout.d.ts.map +1 -0
- package/dist/lib/groups.d.ts +138 -0
- package/dist/lib/groups.d.ts.map +1 -0
- package/dist/lib/hatchet-duration.d.ts +14 -0
- package/dist/lib/hatchet-duration.d.ts.map +1 -0
- package/dist/lib/hatchet.d.ts +3 -0
- package/dist/lib/hatchet.d.ts.map +1 -0
- package/dist/lib/headers.d.ts +8 -0
- package/dist/lib/headers.d.ts.map +1 -0
- package/dist/lib/holdout.d.ts +36 -0
- package/dist/lib/holdout.d.ts.map +1 -0
- package/dist/lib/html.d.ts +5 -0
- package/dist/lib/html.d.ts.map +1 -0
- package/dist/lib/identity-service.d.ts +60 -0
- package/dist/lib/identity-service.d.ts.map +1 -0
- package/dist/lib/identity-token.d.ts +81 -0
- package/dist/lib/identity-token.d.ts.map +1 -0
- package/dist/lib/ingestion.d.ts +218 -0
- package/dist/lib/ingestion.d.ts.map +1 -0
- package/dist/lib/journey-lift.d.ts +56 -0
- package/dist/lib/journey-lift.d.ts.map +1 -0
- package/dist/lib/journey-suppress.d.ts +59 -0
- package/dist/lib/journey-suppress.d.ts.map +1 -0
- package/dist/lib/leader-lease.d.ts +36 -0
- package/dist/lib/leader-lease.d.ts.map +1 -0
- package/dist/lib/lift-stats.d.ts +46 -0
- package/dist/lib/lift-stats.d.ts.map +1 -0
- package/dist/lib/links.d.ts +186 -0
- package/dist/lib/links.d.ts.map +1 -0
- package/dist/lib/load-optional-plugin.d.ts +47 -0
- package/dist/lib/load-optional-plugin.d.ts.map +1 -0
- package/dist/lib/logger.d.ts +4 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/mailer.d.ts +43 -0
- package/dist/lib/mailer.d.ts.map +1 -0
- package/dist/lib/metrics-sql.d.ts +11 -0
- package/dist/lib/metrics-sql.d.ts.map +1 -0
- package/dist/lib/notifications.d.ts +17 -0
- package/dist/lib/notifications.d.ts.map +1 -0
- package/dist/lib/oauth-token-manager.d.ts +74 -0
- package/dist/lib/oauth-token-manager.d.ts.map +1 -0
- package/dist/lib/operator-settings.d.ts +33 -0
- package/dist/lib/operator-settings.d.ts.map +1 -0
- package/dist/lib/operator.d.ts +20 -0
- package/dist/lib/operator.d.ts.map +1 -0
- package/dist/lib/outbound-endpoint-cache.d.ts +25 -0
- package/dist/lib/outbound-endpoint-cache.d.ts.map +1 -0
- package/dist/lib/outbound.d.ts +687 -0
- package/dist/lib/outbound.d.ts.map +1 -0
- package/dist/lib/phone.d.ts +11 -0
- package/dist/lib/phone.d.ts.map +1 -0
- package/dist/lib/posthog-scopes.d.ts +30 -0
- package/dist/lib/posthog-scopes.d.ts.map +1 -0
- package/dist/lib/posthog.d.ts +16 -0
- package/dist/lib/posthog.d.ts.map +1 -0
- package/dist/lib/preferences.d.ts +72 -0
- package/dist/lib/preferences.d.ts.map +1 -0
- package/dist/lib/provider-credentials.d.ts +149 -0
- package/dist/lib/provider-credentials.d.ts.map +1 -0
- package/dist/lib/provision-posthog-loop.d.ts +100 -0
- package/dist/lib/provision-posthog-loop.d.ts.map +1 -0
- package/dist/lib/recipient-preferences.d.ts +29 -0
- package/dist/lib/recipient-preferences.d.ts.map +1 -0
- package/dist/lib/redis.d.ts +33 -0
- package/dist/lib/redis.d.ts.map +1 -0
- package/dist/lib/referral-intent.d.ts +99 -0
- package/dist/lib/referral-intent.d.ts.map +1 -0
- package/dist/lib/referral-link.d.ts +59 -0
- package/dist/lib/referral-link.d.ts.map +1 -0
- package/dist/lib/referral-registry.d.ts +37 -0
- package/dist/lib/referral-registry.d.ts.map +1 -0
- package/dist/lib/referral-report.d.ts +178 -0
- package/dist/lib/referral-report.d.ts.map +1 -0
- package/dist/lib/referral-runtime.d.ts +43 -0
- package/dist/lib/referral-runtime.d.ts.map +1 -0
- package/dist/lib/referrals.d.ts +184 -0
- package/dist/lib/referrals.d.ts.map +1 -0
- package/dist/lib/refine-chain.d.ts +236 -0
- package/dist/lib/refine-chain.d.ts.map +1 -0
- package/dist/lib/refine-traits.d.ts +78 -0
- package/dist/lib/refine-traits.d.ts.map +1 -0
- package/dist/lib/refine.d.ts +35 -0
- package/dist/lib/refine.d.ts.map +1 -0
- package/dist/lib/reset-email.d.ts +38 -0
- package/dist/lib/reset-email.d.ts.map +1 -0
- package/dist/lib/revenue.d.ts +61 -0
- package/dist/lib/revenue.d.ts.map +1 -0
- package/dist/lib/schemas.d.ts +9 -0
- package/dist/lib/schemas.d.ts.map +1 -0
- package/dist/lib/seed-posthog-destination.d.ts +22 -0
- package/dist/lib/seed-posthog-destination.d.ts.map +1 -0
- package/dist/lib/semantic-click.d.ts +58 -0
- package/dist/lib/semantic-click.d.ts.map +1 -0
- package/dist/lib/sending-domain-guidance.d.ts +40 -0
- package/dist/lib/sending-domain-guidance.d.ts.map +1 -0
- package/dist/lib/singleton.d.ts +24 -0
- package/dist/lib/singleton.d.ts.map +1 -0
- package/dist/lib/sms-frequency-cap.d.ts +16 -0
- package/dist/lib/sms-frequency-cap.d.ts.map +1 -0
- package/dist/lib/sms-inbound.d.ts +37 -0
- package/dist/lib/sms-inbound.d.ts.map +1 -0
- package/dist/lib/sms-link-tracking.d.ts +53 -0
- package/dist/lib/sms-link-tracking.d.ts.map +1 -0
- package/dist/lib/sms-mailer.d.ts +12 -0
- package/dist/lib/sms-mailer.d.ts.map +1 -0
- package/dist/lib/sms-provider-registry.d.ts +20 -0
- package/dist/lib/sms-provider-registry.d.ts.map +1 -0
- package/dist/lib/sms-providers-from-env.d.ts +4 -0
- package/dist/lib/sms-providers-from-env.d.ts.map +1 -0
- package/dist/lib/sms-service-types.d.ts +131 -0
- package/dist/lib/sms-service-types.d.ts.map +1 -0
- package/dist/lib/sms-tracked.d.ts +36 -0
- package/dist/lib/sms-tracked.d.ts.map +1 -0
- package/dist/lib/sms.d.ts +58 -0
- package/dist/lib/sms.d.ts.map +1 -0
- package/dist/lib/snippet.d.ts +32 -0
- package/dist/lib/snippet.d.ts.map +1 -0
- package/dist/lib/stable-stringify.d.ts +12 -0
- package/dist/lib/stable-stringify.d.ts.map +1 -0
- package/dist/lib/studio.d.ts +21 -0
- package/dist/lib/studio.d.ts.map +1 -0
- package/dist/lib/survey.d.ts +35 -0
- package/dist/lib/survey.d.ts.map +1 -0
- package/dist/lib/test-mode.d.ts +77 -0
- package/dist/lib/test-mode.d.ts.map +1 -0
- package/dist/lib/timezone.d.ts +55 -0
- package/dist/lib/timezone.d.ts.map +1 -0
- package/dist/lib/tracked.d.ts +95 -0
- package/dist/lib/tracked.d.ts.map +1 -0
- package/dist/lib/tracking-event-names.d.ts +7 -0
- package/dist/lib/tracking-event-names.d.ts.map +1 -0
- package/dist/lib/tracking-events.d.ts +232 -0
- package/dist/lib/tracking-events.d.ts.map +1 -0
- package/dist/lib/tracking.d.ts +47 -0
- package/dist/lib/tracking.d.ts.map +1 -0
- package/dist/lib/unconfigured-email-provider.d.ts +20 -0
- package/dist/lib/unconfigured-email-provider.d.ts.map +1 -0
- package/dist/lib/unique-violation.d.ts +22 -0
- package/dist/lib/unique-violation.d.ts.map +1 -0
- package/dist/lib/user-token.d.ts +44 -0
- package/dist/lib/user-token.d.ts.map +1 -0
- package/dist/lib/variant.d.ts +44 -0
- package/dist/lib/variant.d.ts.map +1 -0
- package/dist/lib/webhook-signing.d.ts +120 -0
- package/dist/lib/webhook-signing.d.ts.map +1 -0
- package/dist/lib/worker-heartbeat.d.ts +18 -0
- package/dist/lib/worker-heartbeat.d.ts.map +1 -0
- package/dist/lists/channels.d.ts +43 -0
- package/dist/lists/channels.d.ts.map +1 -0
- package/dist/lists/define-list.d.ts +76 -0
- package/dist/lists/define-list.d.ts.map +1 -0
- package/dist/lists/registry-singleton.d.ts +8 -0
- package/dist/lists/registry-singleton.d.ts.map +1 -0
- package/dist/lists/registry.d.ts +66 -0
- package/dist/lists/registry.d.ts.map +1 -0
- package/dist/lists/subscription.d.ts +10 -0
- package/dist/lists/subscription.d.ts.map +1 -0
- package/dist/mcp/authoring-guide.d.ts +33 -0
- package/dist/mcp/authoring-guide.d.ts.map +1 -0
- package/dist/mcp/blueprint-tools.d.ts +266 -0
- package/dist/mcp/blueprint-tools.d.ts.map +1 -0
- package/dist/middleware/api-key.d.ts +45 -0
- package/dist/middleware/api-key.d.ts.map +1 -0
- package/dist/middleware/audit.d.ts +3 -0
- package/dist/middleware/audit.d.ts.map +1 -0
- package/dist/middleware/error-handler.d.ts +4 -0
- package/dist/middleware/error-handler.d.ts.map +1 -0
- package/dist/middleware/publishable-key.d.ts +27 -0
- package/dist/middleware/publishable-key.d.ts.map +1 -0
- package/dist/middleware/rate-limit.d.ts +105 -0
- package/dist/middleware/rate-limit.d.ts.map +1 -0
- package/dist/middleware/request-logger.d.ts +4 -0
- package/dist/middleware/request-logger.d.ts.map +1 -0
- package/dist/middleware/require-admin.d.ts +3 -0
- package/dist/middleware/require-admin.d.ts.map +1 -0
- package/dist/routes/_shared.d.ts +52 -0
- package/dist/routes/_shared.d.ts.map +1 -0
- package/dist/routes/accounts/callback.d.ts +18 -0
- package/dist/routes/accounts/callback.d.ts.map +1 -0
- package/dist/routes/accounts/emit.d.ts +96 -0
- package/dist/routes/accounts/emit.d.ts.map +1 -0
- package/dist/routes/accounts/import-links.d.ts +4 -0
- package/dist/routes/accounts/import-links.d.ts.map +1 -0
- package/dist/routes/accounts/index.d.ts +39 -0
- package/dist/routes/accounts/index.d.ts.map +1 -0
- package/dist/routes/accounts/lookup.d.ts +6 -0
- package/dist/routes/accounts/lookup.d.ts.map +1 -0
- package/dist/routes/accounts/me.d.ts +5 -0
- package/dist/routes/accounts/me.d.ts.map +1 -0
- package/dist/routes/accounts/mint.d.ts +5 -0
- package/dist/routes/accounts/mint.d.ts.map +1 -0
- package/dist/routes/accounts/pages.d.ts +23 -0
- package/dist/routes/accounts/pages.d.ts.map +1 -0
- package/dist/routes/accounts/resolve.d.ts +33 -0
- package/dist/routes/accounts/resolve.d.ts.map +1 -0
- package/dist/routes/accounts/serialize.d.ts +57 -0
- package/dist/routes/accounts/serialize.d.ts.map +1 -0
- package/dist/routes/accounts/shared.d.ts +68 -0
- package/dist/routes/accounts/shared.d.ts.map +1 -0
- package/dist/routes/accounts/start.d.ts +16 -0
- package/dist/routes/accounts/start.d.ts.map +1 -0
- package/dist/routes/accounts/unlink.d.ts +36 -0
- package/dist/routes/accounts/unlink.d.ts.map +1 -0
- package/dist/routes/admin/agent.d.ts +4 -0
- package/dist/routes/admin/agent.d.ts.map +1 -0
- package/dist/routes/admin/alerts.d.ts +190 -0
- package/dist/routes/admin/alerts.d.ts.map +1 -0
- package/dist/routes/admin/analytics.d.ts +137 -0
- package/dist/routes/admin/analytics.d.ts.map +1 -0
- package/dist/routes/admin/api-keys.d.ts +158 -0
- package/dist/routes/admin/api-keys.d.ts.map +1 -0
- package/dist/routes/admin/attribution.d.ts +93 -0
- package/dist/routes/admin/attribution.d.ts.map +1 -0
- package/dist/routes/admin/audit-logs.d.ts +40 -0
- package/dist/routes/admin/audit-logs.d.ts.map +1 -0
- package/dist/routes/admin/blueprints.d.ts +4 -0
- package/dist/routes/admin/blueprints.d.ts.map +1 -0
- package/dist/routes/admin/buckets.d.ts +215 -0
- package/dist/routes/admin/buckets.d.ts.map +1 -0
- package/dist/routes/admin/bulk.d.ts +203 -0
- package/dist/routes/admin/bulk.d.ts.map +1 -0
- package/dist/routes/admin/campaigns.d.ts +198 -0
- package/dist/routes/admin/campaigns.d.ts.map +1 -0
- package/dist/routes/admin/connectors.d.ts +116 -0
- package/dist/routes/admin/connectors.d.ts.map +1 -0
- package/dist/routes/admin/contacts.d.ts +246 -0
- package/dist/routes/admin/contacts.d.ts.map +1 -0
- package/dist/routes/admin/conversions.d.ts +103 -0
- package/dist/routes/admin/conversions.d.ts.map +1 -0
- package/dist/routes/admin/deals.d.ts +136 -0
- package/dist/routes/admin/deals.d.ts.map +1 -0
- package/dist/routes/admin/dlq.d.ts +100 -0
- package/dist/routes/admin/dlq.d.ts.map +1 -0
- package/dist/routes/admin/domain.d.ts +314 -0
- package/dist/routes/admin/domain.d.ts.map +1 -0
- package/dist/routes/admin/emails.d.ts +127 -0
- package/dist/routes/admin/emails.d.ts.map +1 -0
- package/dist/routes/admin/events.d.ts +140 -0
- package/dist/routes/admin/events.d.ts.map +1 -0
- package/dist/routes/admin/flags.d.ts +719 -0
- package/dist/routes/admin/flags.d.ts.map +1 -0
- package/dist/routes/admin/funnels.d.ts +71 -0
- package/dist/routes/admin/funnels.d.ts.map +1 -0
- package/dist/routes/admin/groups.d.ts +169 -0
- package/dist/routes/admin/groups.d.ts.map +1 -0
- package/dist/routes/admin/identity.d.ts +72 -0
- package/dist/routes/admin/identity.d.ts.map +1 -0
- package/dist/routes/admin/impact-schemas.d.ts +48 -0
- package/dist/routes/admin/impact-schemas.d.ts.map +1 -0
- package/dist/routes/admin/impact.d.ts +316 -0
- package/dist/routes/admin/impact.d.ts.map +1 -0
- package/dist/routes/admin/index.d.ts +4 -0
- package/dist/routes/admin/index.d.ts.map +1 -0
- package/dist/routes/admin/journey-impact.d.ts +320 -0
- package/dist/routes/admin/journey-impact.d.ts.map +1 -0
- package/dist/routes/admin/journey-logs.d.ts +57 -0
- package/dist/routes/admin/journey-logs.d.ts.map +1 -0
- package/dist/routes/admin/journeys.d.ts +736 -0
- package/dist/routes/admin/journeys.d.ts.map +1 -0
- package/dist/routes/admin/links.d.ts +382 -0
- package/dist/routes/admin/links.d.ts.map +1 -0
- package/dist/routes/admin/lists.d.ts +22 -0
- package/dist/routes/admin/lists.d.ts.map +1 -0
- package/dist/routes/admin/maintenance.d.ts +72 -0
- package/dist/routes/admin/maintenance.d.ts.map +1 -0
- package/dist/routes/admin/metrics.d.ts +212 -0
- package/dist/routes/admin/metrics.d.ts.map +1 -0
- package/dist/routes/admin/open-editor.d.ts +36 -0
- package/dist/routes/admin/open-editor.d.ts.map +1 -0
- package/dist/routes/admin/preferences.d.ts +109 -0
- package/dist/routes/admin/preferences.d.ts.map +1 -0
- package/dist/routes/admin/provider-credentials.d.ts +108 -0
- package/dist/routes/admin/provider-credentials.d.ts.map +1 -0
- package/dist/routes/admin/readiness.d.ts +24 -0
- package/dist/routes/admin/readiness.d.ts.map +1 -0
- package/dist/routes/admin/referrals.d.ts +230 -0
- package/dist/routes/admin/referrals.d.ts.map +1 -0
- package/dist/routes/admin/reporting.d.ts +149 -0
- package/dist/routes/admin/reporting.d.ts.map +1 -0
- package/dist/routes/admin/settings.d.ts +80 -0
- package/dist/routes/admin/settings.d.ts.map +1 -0
- package/dist/routes/admin/suppressions.d.ts +90 -0
- package/dist/routes/admin/suppressions.d.ts.map +1 -0
- package/dist/routes/admin/targeting.d.ts +58 -0
- package/dist/routes/admin/targeting.d.ts.map +1 -0
- package/dist/routes/admin/templates.d.ts +197 -0
- package/dist/routes/admin/templates.d.ts.map +1 -0
- package/dist/routes/admin/timeline.d.ts +51 -0
- package/dist/routes/admin/timeline.d.ts.map +1 -0
- package/dist/routes/admin/webhooks.d.ts +250 -0
- package/dist/routes/admin/webhooks.d.ts.map +1 -0
- package/dist/routes/campaigns/index.d.ts +239 -0
- package/dist/routes/campaigns/index.d.ts.map +1 -0
- package/dist/routes/connectors/index.d.ts +16 -0
- package/dist/routes/connectors/index.d.ts.map +1 -0
- package/dist/routes/contacts/index.d.ts +187 -0
- package/dist/routes/contacts/index.d.ts.map +1 -0
- package/dist/routes/email/index.d.ts +4 -0
- package/dist/routes/email/index.d.ts.map +1 -0
- package/dist/routes/email/preferences.d.ts +17 -0
- package/dist/routes/email/preferences.d.ts.map +1 -0
- package/dist/routes/email/unsubscribe.d.ts +17 -0
- package/dist/routes/email/unsubscribe.d.ts.map +1 -0
- package/dist/routes/emails/index.d.ts +90 -0
- package/dist/routes/emails/index.d.ts.map +1 -0
- package/dist/routes/events/index.d.ts +116 -0
- package/dist/routes/events/index.d.ts.map +1 -0
- package/dist/routes/feed/index.d.ts +248 -0
- package/dist/routes/feed/index.d.ts.map +1 -0
- package/dist/routes/feed/recipient.d.ts +65 -0
- package/dist/routes/feed/recipient.d.ts.map +1 -0
- package/dist/routes/flags/index.d.ts +94 -0
- package/dist/routes/flags/index.d.ts.map +1 -0
- package/dist/routes/groups/index.d.ts +192 -0
- package/dist/routes/groups/index.d.ts.map +1 -0
- package/dist/routes/health.d.ts +57 -0
- package/dist/routes/health.d.ts.map +1 -0
- package/dist/routes/index.d.ts +8 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/lists/index.d.ts +266 -0
- package/dist/routes/lists/index.d.ts.map +1 -0
- package/dist/routes/referrals/index.d.ts +22 -0
- package/dist/routes/referrals/index.d.ts.map +1 -0
- package/dist/routes/referrals/me.d.ts +4 -0
- package/dist/routes/referrals/me.d.ts.map +1 -0
- package/dist/routes/referrals/report.d.ts +5 -0
- package/dist/routes/referrals/report.d.ts.map +1 -0
- package/dist/routes/referrals/shared.d.ts +16 -0
- package/dist/routes/referrals/shared.d.ts.map +1 -0
- package/dist/routes/referrals/touch.d.ts +5 -0
- package/dist/routes/referrals/touch.d.ts.map +1 -0
- package/dist/routes/snippet.d.ts +12 -0
- package/dist/routes/snippet.d.ts.map +1 -0
- package/dist/routes/tracking/answer.d.ts +56 -0
- package/dist/routes/tracking/answer.d.ts.map +1 -0
- package/dist/routes/tracking/arrive.d.ts +32 -0
- package/dist/routes/tracking/arrive.d.ts.map +1 -0
- package/dist/routes/tracking/click-pipeline.d.ts +213 -0
- package/dist/routes/tracking/click-pipeline.d.ts.map +1 -0
- package/dist/routes/tracking/click.d.ts +26 -0
- package/dist/routes/tracking/click.d.ts.map +1 -0
- package/dist/routes/tracking/identify.d.ts +32 -0
- package/dist/routes/tracking/identify.d.ts.map +1 -0
- package/dist/routes/tracking/index.d.ts +4 -0
- package/dist/routes/tracking/index.d.ts.map +1 -0
- package/dist/routes/tracking/open.d.ts +17 -0
- package/dist/routes/tracking/open.d.ts.map +1 -0
- package/dist/routes/tracking/short.d.ts +17 -0
- package/dist/routes/tracking/short.d.ts.map +1 -0
- package/dist/routes/tracking/vanity.d.ts +17 -0
- package/dist/routes/tracking/vanity.d.ts.map +1 -0
- package/dist/routes/webhooks/crm-provider.d.ts +24 -0
- package/dist/routes/webhooks/crm-provider.d.ts.map +1 -0
- package/dist/routes/webhooks/email-provider.d.ts +21 -0
- package/dist/routes/webhooks/email-provider.d.ts.map +1 -0
- package/dist/routes/webhooks/index.d.ts +8 -0
- package/dist/routes/webhooks/index.d.ts.map +1 -0
- package/dist/routes/webhooks/resend.d.ts +35 -0
- package/dist/routes/webhooks/resend.d.ts.map +1 -0
- package/dist/routes/webhooks/sms-provider.d.ts +23 -0
- package/dist/routes/webhooks/sms-provider.d.ts.map +1 -0
- package/dist/routes/webhooks/sources.d.ts +12 -0
- package/dist/routes/webhooks/sources.d.ts.map +1 -0
- package/dist/sources/define-contact-source.d.ts +114 -0
- package/dist/sources/define-contact-source.d.ts.map +1 -0
- package/dist/sources/registry.d.ts +31 -0
- package/dist/sources/registry.d.ts.map +1 -0
- package/dist/sources/webhook-source.d.ts +53 -0
- package/dist/sources/webhook-source.d.ts.map +1 -0
- package/dist/testing.d.ts +10 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/webhook-sources/define-webhook-source.d.ts +60 -0
- package/dist/webhook-sources/define-webhook-source.d.ts.map +1 -0
- package/dist/webhook-sources/presets/clerk.d.ts +9 -0
- package/dist/webhook-sources/presets/clerk.d.ts.map +1 -0
- package/dist/webhook-sources/presets/index.d.ts +140 -0
- package/dist/webhook-sources/presets/index.d.ts.map +1 -0
- package/dist/webhook-sources/presets/intercom.d.ts +44 -0
- package/dist/webhook-sources/presets/intercom.d.ts.map +1 -0
- package/dist/webhook-sources/presets/segment.d.ts +16 -0
- package/dist/webhook-sources/presets/segment.d.ts.map +1 -0
- package/dist/webhook-sources/presets/stripe.d.ts +20 -0
- package/dist/webhook-sources/presets/stripe.d.ts.map +1 -0
- package/dist/webhook-sources/presets/supabase.d.ts +23 -0
- package/dist/webhook-sources/presets/supabase.d.ts.map +1 -0
- package/dist/webhook-sources/verify.d.ts +48 -0
- package/dist/webhook-sources/verify.d.ts.map +1 -0
- package/dist/worker.d.ts +37 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/workflows/backfill-contact-id.d.ts +202 -0
- package/dist/workflows/backfill-contact-id.d.ts.map +1 -0
- package/dist/workflows/bucket-backfill.d.ts +64 -0
- package/dist/workflows/bucket-backfill.d.ts.map +1 -0
- package/dist/workflows/bucket-reconcile.d.ts +73 -0
- package/dist/workflows/bucket-reconcile.d.ts.map +1 -0
- package/dist/workflows/check-alerts.d.ts +10 -0
- package/dist/workflows/check-alerts.d.ts.map +1 -0
- package/dist/workflows/confirm-semantic-click.d.ts +15 -0
- package/dist/workflows/confirm-semantic-click.d.ts.map +1 -0
- package/dist/workflows/crm-reconcile.d.ts +27 -0
- package/dist/workflows/crm-reconcile.d.ts.map +1 -0
- package/dist/workflows/deliver-webhook.d.ts +88 -0
- package/dist/workflows/deliver-webhook.d.ts.map +1 -0
- package/dist/workflows/dispatch-conversion.d.ts +14 -0
- package/dist/workflows/dispatch-conversion.d.ts.map +1 -0
- package/dist/workflows/identity-alias-backfill.d.ts +96 -0
- package/dist/workflows/identity-alias-backfill.d.ts.map +1 -0
- package/dist/workflows/impact-digest.d.ts +142 -0
- package/dist/workflows/impact-digest.d.ts.map +1 -0
- package/dist/workflows/import-contacts.d.ts +14 -0
- package/dist/workflows/import-contacts.d.ts.map +1 -0
- package/dist/workflows/import-suppressions.d.ts +55 -0
- package/dist/workflows/import-suppressions.d.ts.map +1 -0
- package/dist/workflows/journey-blueprint-interpreter.d.ts +73 -0
- package/dist/workflows/journey-blueprint-interpreter.d.ts.map +1 -0
- package/dist/workflows/send-campaign.d.ts +128 -0
- package/dist/workflows/send-campaign.d.ts.map +1 -0
- package/dist/workflows/send-email.d.ts +15 -0
- package/dist/workflows/send-email.d.ts.map +1 -0
- package/dist/workflows/send-feed.d.ts +37 -0
- package/dist/workflows/send-feed.d.ts.map +1 -0
- package/package.json +60 -22
- package/src/app.ts +9 -1
- package/src/buckets/check-membership.ts +54 -20
- package/src/env.ts +30 -0
- package/src/journeys/journey-log.ts +25 -8
- package/src/lib/contacts.ts +47 -1
- package/src/lib/email-service-types.ts +10 -0
- package/src/lib/ingestion.ts +30 -19
- package/src/lib/mailer-bounce-idempotency.test.ts +7 -2
- package/src/lib/mailer-replied.test.ts +7 -2
- package/src/lib/mailer.ts +1 -0
- package/src/lib/outbound-endpoint-cache.ts +83 -0
- package/src/lib/outbound.ts +56 -37
- package/src/lib/seed-posthog-destination.ts +5 -1
- package/src/lib/tracked.ts +11 -3
- package/src/lib/tracking-events.ts +20 -3
- package/src/middleware/api-key.ts +69 -60
- package/src/middleware/publishable-key.ts +11 -23
- package/src/middleware/rate-limit.ts +165 -3
- package/src/routes/admin/api-keys.ts +148 -0
- package/src/routes/admin/targeting.ts +6 -1
- package/src/routes/admin/webhooks.ts +4 -0
- package/src/routes/index.ts +67 -24
- package/src/workflows/backfill-contact-id.ts +3 -7
- package/src/workflows/bucket-backfill.ts +2 -2
- package/src/workflows/bucket-reconcile.ts +28 -12
- package/src/workflows/check-alerts.ts +3 -9
- package/src/workflows/crm-reconcile.ts +3 -2
- package/src/workflows/deliver-webhook.ts +21 -8
- package/src/workflows/dispatch-conversion.ts +2 -2
- package/src/workflows/identity-alias-backfill.ts +3 -2
- package/src/workflows/impact-digest.ts +2 -2
- package/src/workflows/import-contacts.ts +3 -4
- package/src/workflows/import-suppressions.ts +4 -5
- package/src/workflows/send-campaign.ts +10 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-source-locations-singleton.d.ts","sourceRoot":"","sources":["../../src/journeys/journey-source-locations-singleton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAe3D,eAAO,MAAM,yBAAyB,qDAAgB,CAAC;AACvD,eAAO,MAAM,yBAAyB,0CAAgB,CAAC;AACvD,mDAAmD;AACnD,eAAO,MAAM,2BAA2B,YAAkB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const setJourneySources: (value: Map<string, string>) => void;
|
|
2
|
+
export declare const getJourneySources: () => Map<string, string>;
|
|
3
|
+
/** Reset the singleton — only for test cleanup. */
|
|
4
|
+
export declare const resetJourneySources: () => void;
|
|
5
|
+
//# sourceMappingURL=journey-sources-singleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-sources-singleton.d.ts","sourceRoot":"","sources":["../../src/journeys/journey-sources-singleton.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB,sCAAgB,CAAC;AAC/C,eAAO,MAAM,iBAAiB,2BAAgB,CAAC;AAC/C,mDAAmD;AACnD,eAAO,MAAM,mBAAmB,YAAkB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HatchetClient } from "@hatchet-dev/typescript-sdk/v1/index.js";
|
|
2
|
+
import type { JourneyMeta, JourneyRunFn } from "@hogsend/core/types";
|
|
3
|
+
/** The durable Hatchet declaration attached to a production journey. */
|
|
4
|
+
export type JourneyTask = ReturnType<HatchetClient["durableTask"]>;
|
|
5
|
+
type JourneyTaskFactory = (meta: JourneyMeta, run: JourneyRunFn) => JourneyTask;
|
|
6
|
+
/** Install the production Hatchet binding without coupling authoring imports to env. */
|
|
7
|
+
export declare function installJourneyTaskFactory(factory: JourneyTaskFactory): void;
|
|
8
|
+
export declare function hasJourneyTaskFactory(): boolean;
|
|
9
|
+
export declare function createJourneyTask(meta: JourneyMeta, run: JourneyRunFn): JourneyTask;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=journey-task-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-task-factory.d.ts","sourceRoot":"","sources":["../../src/journeys/journey-task-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAErE,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;AAEnE,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,KAAK,WAAW,CAAC;AAIhF,wFAAwF;AACxF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAE3E;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,YAAY,GAChB,WAAW,CAQb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-task-runtime.d.ts","sourceRoot":"","sources":["../../src/journeys/journey-task-runtime.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { JourneyMeta } from "@hogsend/core/types";
|
|
2
|
+
/**
|
|
3
|
+
* Deterministic, dependency-free normalization of a Function.prototype
|
|
4
|
+
* .toString() capture, so formatting- and comment-only edits do not fork a
|
|
5
|
+
* version cohort:
|
|
6
|
+
* 1. strip // line and block comments with a string-aware single-pass
|
|
7
|
+
* scanner (states: code | single | double | template | lineComment |
|
|
8
|
+
* blockComment; a \ inside any string state consumes the next char;
|
|
9
|
+
* each stripped comment is replaced by one space),
|
|
10
|
+
* 2. collapse every whitespace run to a single space, trim.
|
|
11
|
+
* KNOWN LIMITS (documented, deterministic): (a) a // inside a regex literal
|
|
12
|
+
* is misread as a comment start and mangles the rest of that line; (b) the
|
|
13
|
+
* scanner exits `template` state at the first backtick, so a nested
|
|
14
|
+
* template or a string/comment inside ${...} is misclassified. In both
|
|
15
|
+
* cases the output is still a pure function of the input, so the hash
|
|
16
|
+
* stays stable — the only cost is fork-detection fidelity on those lines.
|
|
17
|
+
* Never throws; empty input → "".
|
|
18
|
+
*/
|
|
19
|
+
export declare function normalizeRunSource(source: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Content fingerprint of one journey version: sha256, first 12 hex chars
|
|
22
|
+
* (48 bits — per-journey version counts are tiny; collision negligible).
|
|
23
|
+
* Input = HASH_INPUT_VERSION + "\n" + normalizeRunSource(body ?? "") +
|
|
24
|
+
* "\n" + stableStringify(hashable meta).
|
|
25
|
+
*
|
|
26
|
+
* Hashable meta = the meta MINUS `enabled` (toggling — including the
|
|
27
|
+
* journey_configs admin override — is not a content change), `version`
|
|
28
|
+
* (display label), `versionHash` (self), `name`, `description` (display
|
|
29
|
+
* only — display fields don't fork cohorts; this exclusion list is FROZEN
|
|
30
|
+
* at first release, since changing it later reforks every journey once).
|
|
31
|
+
* Everything else is included BY DEFAULT via rest-destructuring — id,
|
|
32
|
+
* trigger, entryLimit, entryPeriod, exitOn, category, suppress, holdout,
|
|
33
|
+
* goal, sourceBucketId, reactionKind, dwellSchedule, and any FUTURE meta
|
|
34
|
+
* field — because missing a real behavior change is worse than a spurious
|
|
35
|
+
* fork.
|
|
36
|
+
*
|
|
37
|
+
* For blueprints, `body` is stableStringify(row.graph), which ALSO passes
|
|
38
|
+
* through normalizeRunSource. Safe: stableStringify emits no whitespace or
|
|
39
|
+
* comments outside JSON strings, and // inside double-quoted string values
|
|
40
|
+
* (URLs in graph node config) is protected by the string-aware scanner,
|
|
41
|
+
* including \" escapes.
|
|
42
|
+
*
|
|
43
|
+
* ACCEPTED HASH CHURN ACROSS BUILD MODES: runSource is captured from the
|
|
44
|
+
* RUNNING artifact (define-journey.ts) — tsx dev output differs from the
|
|
45
|
+
* consumer tsup bundle, and esbuild identifier aliasing / toolchain-bump
|
|
46
|
+
* emit drift can fork a prod cohort once with zero content change.
|
|
47
|
+
* Accepted: forks are append-only cohort noise; labels give continuity.
|
|
48
|
+
* All readout/digest consumers MUST treat a new hash as "possible new
|
|
49
|
+
* version", never proof of change.
|
|
50
|
+
*
|
|
51
|
+
* TEMPLATE EDITS ARE NOT IN THE HASH: email template components (the
|
|
52
|
+
* consumer's src/emails/*.tsx) are referenced by registry KEY, and that
|
|
53
|
+
* key is all the run source carries — rewriting template copy forks NO
|
|
54
|
+
* cohort. Documented operator practice: bump `meta.version` (the display
|
|
55
|
+
* label) when you rework a template; the impact digest reports a label
|
|
56
|
+
* change as a first-class shipped signal (change: "new_label"). The real
|
|
57
|
+
* fix — folding a rendered-template-registry hash into the body input —
|
|
58
|
+
* is an explicit out-of-scope follow-up.
|
|
59
|
+
*
|
|
60
|
+
* Determinism: `where` builder fns are resolved ONCE into POJOs by
|
|
61
|
+
* normalizeWhere at defineJourney time, so the hashed meta is canonical
|
|
62
|
+
* data, never a function; stableStringify sorts keys and drops undefined,
|
|
63
|
+
* so key order and optional-field spreading cannot churn the hash. NO RNG,
|
|
64
|
+
* NO clock (the replay law).
|
|
65
|
+
*/
|
|
66
|
+
export declare function computeJourneyVersionHash(opts: {
|
|
67
|
+
meta: JourneyMeta;
|
|
68
|
+
/** runSource for code journeys; stableStringify(graph) for blueprints. */
|
|
69
|
+
body?: string;
|
|
70
|
+
}): string;
|
|
71
|
+
//# sourceMappingURL=journey-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-version.d.ts","sourceRoot":"","sources":["../../src/journeys/journey-version.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAmBvD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAsDzD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,IAAI,EAAE,WAAW,CAAC;IAClB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAcT"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type Database } from "@hogsend/db";
|
|
2
|
+
/** The reserved `journey_states.context` sub-bags a record-once value can live
|
|
3
|
+
* under. A closed union — the ONLY values reachable at the SQL path, so the
|
|
4
|
+
* token can be interpolated into the jsonb path (see {@link recordOnce}) while
|
|
5
|
+
* `key`/value stay bound parameters. */
|
|
6
|
+
export type RecordNamespace = "__once__" | "__digest__" | "__throttle__" | "__variants__" | "__groupKeys__" | "__waits__";
|
|
7
|
+
/**
|
|
8
|
+
* Durable set-once for a single `(stateId, namespace, key)` — the replay-safety
|
|
9
|
+
* primitive shared by `ctx.once`, `ctx.digest`, `ctx.throttle`, and the
|
|
10
|
+
* journey-suppress guard. Guarantees:
|
|
11
|
+
*
|
|
12
|
+
* - **Set-once**: the first committed write for a `(stateId, namespace, key)`
|
|
13
|
+
* wins; `compute` runs at most once per winning writer and never again once a
|
|
14
|
+
* value is recorded (a replay-from-top re-reads the stored value).
|
|
15
|
+
* - **First-writer-wins under a concurrent race**: a zombie double-writer (a
|
|
16
|
+
* partitioned worker's original execution racing its replay) CANNOT clobber a
|
|
17
|
+
* value the winner already returned to author code. The persist uses a
|
|
18
|
+
* FIRST-writer-wins jsonb merge and returns the value from the UPDATE's
|
|
19
|
+
* RETURNING (the post-merge committed row), so both racers observe the SAME
|
|
20
|
+
* (first-committed) value even if the loser computed something different.
|
|
21
|
+
*
|
|
22
|
+
* Values MUST be JSON-serializable (stored in a jsonb column, round-tripped
|
|
23
|
+
* through `JSON.stringify`/Postgres jsonb).
|
|
24
|
+
*/
|
|
25
|
+
export declare function recordOnce<T>(opts: {
|
|
26
|
+
db: Database;
|
|
27
|
+
stateId: string;
|
|
28
|
+
namespace: RecordNamespace;
|
|
29
|
+
key: string;
|
|
30
|
+
compute: () => Promise<T> | T;
|
|
31
|
+
}): Promise<T>;
|
|
32
|
+
/**
|
|
33
|
+
* Read an already-recorded `(stateId, namespace, key)` value WITHOUT computing
|
|
34
|
+
* or writing — `undefined` when nothing is recorded. The read-only companion
|
|
35
|
+
* to {@link recordOnce} for call sites whose compute would issue durable work
|
|
36
|
+
* (recordOnce's `compute` must never add journal nodes).
|
|
37
|
+
*/
|
|
38
|
+
export declare function readRecordedValue(opts: {
|
|
39
|
+
db: Database;
|
|
40
|
+
stateId: string;
|
|
41
|
+
namespace: RecordNamespace;
|
|
42
|
+
key: string;
|
|
43
|
+
}): Promise<unknown>;
|
|
44
|
+
/**
|
|
45
|
+
* Drop ALL reserved record-once namespace keys from an event-properties bag.
|
|
46
|
+
* Enrollment seeds `journey_states.context` from trigger-event properties
|
|
47
|
+
* (execute-journey-run.ts — BOTH the fresh-entry and held_out inserts);
|
|
48
|
+
* without this strip a publishable-key browser event carrying e.g.
|
|
49
|
+
* `__variants__` could pre-fill a reserved bag — choosing its own ctx.variant
|
|
50
|
+
* arm AND injecting arbitrary strings into the impact readout's GROUP BY
|
|
51
|
+
* dimension. One filter protects every bag at once. Engine-supplied
|
|
52
|
+
* `extraContext` (e.g. `__blueprintVersion`) is deliberately NOT passed
|
|
53
|
+
* through this filter.
|
|
54
|
+
*/
|
|
55
|
+
export declare function stripRecordNamespaces<T>(properties: Record<string, T>): Record<string, T>;
|
|
56
|
+
//# sourceMappingURL=record-once.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-once.d.ts","sourceRoot":"","sources":["../../src/journeys/record-once.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,aAAa,CAAC;AAG3D;;;wCAGwC;AACxC,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,YAAY,GACZ,cAAc,GACd,cAAc,GACd,eAAe,GACf,WAAW,CAAC;AAwBhB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE;IACxC,EAAE,EAAE,QAAQ,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,eAAe,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAC/B,GAAG,OAAO,CAAC,CAAC,CAAC,CAyDb;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,EAAE,EAAE,QAAQ,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,eAAe,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,OAAO,CAAC,OAAO,CAAC,CAQnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAC5B,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAMnB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JourneyRegistry } from "@hogsend/core/registry";
|
|
2
|
+
export declare const setJourneyRegistry: (value: JourneyRegistry) => void;
|
|
3
|
+
export declare const getJourneyRegistrySingleton: () => JourneyRegistry;
|
|
4
|
+
/** Reset the singleton — only for test cleanup. */
|
|
5
|
+
export declare const resetJourneyRegistry: () => void;
|
|
6
|
+
//# sourceMappingURL=registry-singleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-singleton.d.ts","sourceRoot":"","sources":["../../src/journeys/registry-singleton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAK9D,eAAO,MAAM,kBAAkB,kCAAgB,CAAC;AAChD,eAAO,MAAM,2BAA2B,uBAAgB,CAAC;AACzD,mDAAmD;AACnD,eAAO,MAAM,oBAAoB,YAAkB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { JourneyRegistry } from "@hogsend/core/registry";
|
|
2
|
+
import type { DefinedJourney } from "./define-journey.js";
|
|
3
|
+
/**
|
|
4
|
+
* Parse the `ENABLED_JOURNEYS` filter. Returns `"*"` to enable all journeys, or
|
|
5
|
+
* a `Set` of journey ids to enable. Only an empty/undefined value or a literal
|
|
6
|
+
* `"*"` (after trim) means all; a whitespace-only value (e.g. `" "`) falls
|
|
7
|
+
* through to an empty `Set` (enables nothing).
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseEnabledFilter(filter?: string): "*" | Set<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Resolve AND validate the `ENABLED_JOURNEYS` filter against the closed set of
|
|
12
|
+
* known journey ids. `ENABLED_JOURNEYS` is operator config over a fully-known
|
|
13
|
+
* universe (`journeys.map(j => j.meta.id)` plus `extraKnownIds`), so a filter id
|
|
14
|
+
* that matches no journey is a typo or a stale reference to a renamed/removed
|
|
15
|
+
* journey — silently dropping it means the intended journey never registers and
|
|
16
|
+
* never fires in prod. Fail loud instead (the analog of the EMAIL_PROVIDER /
|
|
17
|
+
* ANALYTICS_PROVIDER boot throws):
|
|
18
|
+
*
|
|
19
|
+
* - `"*"` / empty → `"*"` (enable all); no validation, no throw.
|
|
20
|
+
* - **Empty top-level `journeys[]`** → no validation, no throw. `ENABLED_JOURNEYS`
|
|
21
|
+
* restricts the top-level journeys; a bucket-only client injects none here
|
|
22
|
+
* (its bucket-reaction journeys are registered separately, gated by
|
|
23
|
+
* `ENABLED_BUCKETS`), so there is nothing this filter can validate.
|
|
24
|
+
* - Otherwise validate every filter id against ALL known ids — the top-level
|
|
25
|
+
* journey ids (INCLUDING `meta.enabled: false` ones, since a disabled journey
|
|
26
|
+
* is a known id, not a typo) PLUS `extraKnownIds` (the bucket-reaction journey
|
|
27
|
+
* ids `bucket-<id>-on-<kind>`, which ARE registered journeys even though they
|
|
28
|
+
* bypass this filter). Unknown ids throw a single error naming each one (with a
|
|
29
|
+
* `(did you mean "…"?)` when a close known id exists) plus the known-id list.
|
|
30
|
+
* - An empty `Set` (e.g. filter `","`) has nothing to validate → no throw
|
|
31
|
+
* (enables nothing; pre-existing behavior).
|
|
32
|
+
*
|
|
33
|
+
* @param extraKnownIds additional valid ids not present in `journeys[]` (e.g.
|
|
34
|
+
* bucket-reaction journey ids) — accepted in the filter without a throw.
|
|
35
|
+
*
|
|
36
|
+
* Pure/synchronous; both boot paths ({@link buildJourneyRegistry} at container
|
|
37
|
+
* boot, {@link selectJourneyTasks} at worker boot) route through it.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveEnabledFilter(journeys: DefinedJourney[], enabledFilter?: string, extraKnownIds?: string[]): "*" | Set<string>;
|
|
40
|
+
/**
|
|
41
|
+
* Build a {@link JourneyRegistry} from an injected array of journeys, applying
|
|
42
|
+
* the enabled filter, and install it as the process singleton (so durable tasks
|
|
43
|
+
* can resolve it). Returns the registry. Throws (via
|
|
44
|
+
* {@link resolveEnabledFilter}) when the filter references an unknown journey.
|
|
45
|
+
*
|
|
46
|
+
* @param extraKnownIds additional valid ids (e.g. bucket-reaction journey ids)
|
|
47
|
+
* accepted in the filter without a throw — see {@link resolveEnabledFilter}.
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildJourneyRegistry(journeys: DefinedJourney[], enabledFilter?: string, extraKnownIds?: string[]): JourneyRegistry;
|
|
50
|
+
/**
|
|
51
|
+
* Select the Hatchet durable tasks for the enabled journeys from an injected
|
|
52
|
+
* array of journeys. Throws (via {@link resolveEnabledFilter}) when the filter
|
|
53
|
+
* references an unknown journey.
|
|
54
|
+
*
|
|
55
|
+
* @param extraKnownIds additional valid ids (e.g. bucket-reaction journey ids)
|
|
56
|
+
* accepted in the filter without a throw — see {@link resolveEnabledFilter}.
|
|
57
|
+
*/
|
|
58
|
+
export declare function selectJourneyTasks(journeys: DefinedJourney[], enabledFilter?: string, extraKnownIds?: string[]): import("@hatchet-dev/typescript-sdk/index.js").TaskWorkflowDeclaration<import("@hatchet-dev/typescript-sdk/index.js").JsonObject, import("@hatchet-dev/typescript-sdk/index.js").OutputType, {}, {}, {}, {}>[];
|
|
59
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/journeys/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAK1D;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAQrE;AAkDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,cAAc,EAAE,EAC1B,aAAa,CAAC,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,MAAM,EAAE,GACvB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CA6BnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,cAAc,EAAE,EAC1B,aAAa,CAAC,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,MAAM,EAAE,GACvB,eAAe,CA4BjB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,cAAc,EAAE,EAC1B,aAAa,CAAC,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,MAAM,EAAE,kNAMzB"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type JourneyKeyKind } from "./journey-boundary.js";
|
|
2
|
+
/**
|
|
3
|
+
* The brand is a module-private `unique symbol`: no other module can name it,
|
|
4
|
+
* so no other module can construct a {@link CallerRef} structurally. The ONLY
|
|
5
|
+
* two ways to produce one are {@link callerRefFromArgs} and a deliberate
|
|
6
|
+
* `as CallerRef` cast — the first is the sanctioned chokepoint, the second is
|
|
7
|
+
* greppable and indefensible in review. That is the point: provenance ("this
|
|
8
|
+
* string came from the caller's own arguments, not from an awaited DB read")
|
|
9
|
+
* is not something TypeScript can track through data flow, so the design
|
|
10
|
+
* substitutes a single, named, reviewable construction site for it.
|
|
11
|
+
*/
|
|
12
|
+
declare const CALLER_REF: unique symbol;
|
|
13
|
+
/**
|
|
14
|
+
* A string proven — by construction — to be derived from the CALLER'S OWN
|
|
15
|
+
* ARGUMENTS, and therefore legal as a durable-memo key discriminant.
|
|
16
|
+
*
|
|
17
|
+
* THE LAW (`lib/feed.ts:152-165`): the Hatchet journal is positional, and
|
|
18
|
+
* `boundary.memoize` is a durable call, so its KEY must never contain the
|
|
19
|
+
* result of a live DB read. Hatchet re-derives task input from the recorded
|
|
20
|
+
* payload, so an ARGUMENT is identical on a run and its replay — a resolved
|
|
21
|
+
* row value is not (defects 2 and 3 of this class both keyed a memo off a
|
|
22
|
+
* value the database could change mid-sleep).
|
|
23
|
+
*
|
|
24
|
+
* A bare `string` — including every string that arrives via `await` — fails to
|
|
25
|
+
* type-check where a `CallerRef` is required. Route it through
|
|
26
|
+
* {@link callerRefFromArgs} ONLY when the value is an authored argument.
|
|
27
|
+
*/
|
|
28
|
+
export type CallerRef = string & {
|
|
29
|
+
readonly [CALLER_REF]: true;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Brand a value from the caller's own arguments as a {@link CallerRef}.
|
|
33
|
+
*
|
|
34
|
+
* CONTRACT (the compiler cannot check this half — the call site carries it):
|
|
35
|
+
* `value` must be derived exclusively from the caller's authored arguments.
|
|
36
|
+
* Never pass a value produced by an awaited read (a `contacts` row, a ledger
|
|
37
|
+
* row, a provider response) — that is precisely the bug class this type
|
|
38
|
+
* exists to make unwritable.
|
|
39
|
+
*
|
|
40
|
+
* Trims, and returns `undefined` for an empty/whitespace value so callers can
|
|
41
|
+
* fall through their argument-precedence chain with `??`/`if`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function callerRefFromArgs(value: string | undefined): CallerRef | undefined;
|
|
44
|
+
export interface WithDurableGateOptions {
|
|
45
|
+
/** The side-effect namespace — keeps e.g. a refine and a send from ever
|
|
46
|
+
* colliding under one wait label. */
|
|
47
|
+
kind: JourneyKeyKind;
|
|
48
|
+
/**
|
|
49
|
+
* The memo-key discriminant, derived ONLY from the caller's own arguments —
|
|
50
|
+
* the branded type makes a raw (possibly DB-read) string a type error at the
|
|
51
|
+
* call site. See {@link CallerRef}.
|
|
52
|
+
*/
|
|
53
|
+
callerRef: CallerRef;
|
|
54
|
+
/**
|
|
55
|
+
* Disambiguates the key when two sites of the same `kind` in one journey
|
|
56
|
+
* share a nearest wait label. Mirrors `sendEmail`/`sendSms`/`refineContact`.
|
|
57
|
+
*/
|
|
58
|
+
idempotencyLabel?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Run `gates` under the positional-journal law, so the law is structural
|
|
62
|
+
* rather than prose.
|
|
63
|
+
*
|
|
64
|
+
* Four bugs of one class shipped in one release, by three different authors,
|
|
65
|
+
* every one green on every gate: an early return placed before the memoize, a
|
|
66
|
+
* memo key derived from a value the function itself writes, a live read
|
|
67
|
+
* feeding both the decision to memoize and the key, and a skip path that
|
|
68
|
+
* issued zero durable calls. Each author re-derived this shape by hand and
|
|
69
|
+
* got one line of it wrong. This primitive owns the shape, so the ordering is
|
|
70
|
+
* no longer the author's to write.
|
|
71
|
+
*
|
|
72
|
+
* What it does, in this order and UNCONDITIONALLY:
|
|
73
|
+
*
|
|
74
|
+
* 1. Resolve the journey boundary. With NO boundary (a webhook, a cron, a
|
|
75
|
+
* test) there is no replay to defend against and no anchor to key from —
|
|
76
|
+
* `gates()` runs directly, zero durable calls, and Layer 2 (the callee's
|
|
77
|
+
* unique-index dedup) carries exactly-once on its own.
|
|
78
|
+
* 2. With a boundary: derive the key from `kind` + the replay-stable
|
|
79
|
+
* `runAnchor` + the site (`idempotencyLabel ?? nearest wait label ??
|
|
80
|
+
* callerRef`) + the branded `callerRef` — arguments only, never a
|
|
81
|
+
* resolved value.
|
|
82
|
+
* 3. `registerKey` — an intra-run collision (two sites, one key) throws
|
|
83
|
+
* loudly at dev time instead of silently over-deduping.
|
|
84
|
+
* 4. Issue `boundary.memoize([key], …)` — EXACTLY ONCE, with nothing between
|
|
85
|
+
* the boundary check and this call that reads a database or branches on
|
|
86
|
+
* one. Every stateful read and every verdict — including every skip —
|
|
87
|
+
* lives INSIDE `gates`, so it is recorded by the durable memo and
|
|
88
|
+
* replayed verbatim.
|
|
89
|
+
*
|
|
90
|
+
* `gates` receives the derived key (undefined outside a boundary) to thread
|
|
91
|
+
* into its Layer-2 writes as the idempotency key. A throw from `gates`
|
|
92
|
+
* propagates unswallowed; the memo layer records no value for a rejected
|
|
93
|
+
* closure, so a replay re-enters it.
|
|
94
|
+
*/
|
|
95
|
+
export declare function withDurableGate<T>(opts: WithDurableGateOptions, gates: (idempotencyKey?: string) => Promise<T>): Promise<T>;
|
|
96
|
+
export {};
|
|
97
|
+
//# sourceMappingURL=with-durable-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-durable-gate.d.ts","sourceRoot":"","sources":["../../src/journeys/with-durable-gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAM/B;;;;;;;;;GASG;AACH,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AAExC;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,SAAS,GAAG,SAAS,CAGvB;AAMD,MAAM,WAAW,sBAAsB;IACrC;yCACqC;IACrC,IAAI,EAAE,cAAc,CAAC;IACrB;;;;OAIG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,eAAe,CAAC,CAAC,EACrC,IAAI,EAAE,sBAAsB,EAC5B,KAAK,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAC7C,OAAO,CAAC,CAAC,CAAC,CAsBZ"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { HatchetClient } from "@hatchet-dev/typescript-sdk/v1/index.js";
|
|
2
|
+
import type { Database } from "@hogsend/db";
|
|
3
|
+
import { type AccountUnlinkedFacts } from "./account-link-events.js";
|
|
4
|
+
import { type Logger } from "./logger.js";
|
|
5
|
+
/**
|
|
6
|
+
* The container's handles, when the caller has a container.
|
|
7
|
+
*
|
|
8
|
+
* `logger` attributes the emit to the caller's request. `hatchet` buys exactly
|
|
9
|
+
* one thing — it spares this module the `./hatchet.js` dynamic import below,
|
|
10
|
+
* which is what runs `HatchetClient.init` — plus satisfying `emitOutbound`'s
|
|
11
|
+
* signature. It does NOT redirect delivery, and claiming otherwise would be
|
|
12
|
+
* false: `emitOutbound` destructures
|
|
13
|
+
* `const { db, logger, event, payload, dedupeKey } = opts`
|
|
14
|
+
* (`outbound.ts:619`) and never reads `opts.hatchet`, and the enqueue runs
|
|
15
|
+
* through the MODULE-LEVEL `deliverWebhookTask` built from the singleton at
|
|
16
|
+
* import time, so `opts.overrides.hatchet` cannot reroute it. Both fields are
|
|
17
|
+
* optional so the container-free `lib/contacts.ts` call sites stay a two-arg
|
|
18
|
+
* call.
|
|
19
|
+
*/
|
|
20
|
+
export type EmitHandles = {
|
|
21
|
+
hatchet?: HatchetClient;
|
|
22
|
+
logger?: Logger;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Fan out one `account.unlinked` per mutation fact (PRD 08 T3).
|
|
26
|
+
*
|
|
27
|
+
* This exists so the emit SHAPE lives once: `MergedLinkUnlink` (the merge's
|
|
28
|
+
* singleton-collision soft-unlink, `reason: "relinked"`) and
|
|
29
|
+
* `ContactUnlinkFact` (the contact-deletion leg, `reason: "api"`) both satisfy
|
|
30
|
+
* {@link AccountUnlinkedFacts} structurally, so both legs share this loop and
|
|
31
|
+
* cannot drift apart on the payload or the dedupe key.
|
|
32
|
+
*
|
|
33
|
+
* ## Call it AFTER the mutation's transaction has RESOLVED, never inside it
|
|
34
|
+
*
|
|
35
|
+
* DECISIONS §8 puts emission at the commit/intent layer. Both callers hand us
|
|
36
|
+
* facts a `db.transaction(...)` already returned: a rolled-back merge or
|
|
37
|
+
* delete must never have announced an unlink that did not happen, and a
|
|
38
|
+
* subscriber that reacts by re-reading the pull plane inside the write's own
|
|
39
|
+
* transaction window would read pre-commit state.
|
|
40
|
+
*
|
|
41
|
+
* ## Fire-and-forget, and it stays that way
|
|
42
|
+
*
|
|
43
|
+
* `emitOutbound` never throws (`outbound.ts:600-608`); the `void … .catch` is
|
|
44
|
+
* the defence-in-depth its own docstring asks every call site for. A webhook
|
|
45
|
+
* problem must never fail a contact merge or a GDPR deletion, so this function
|
|
46
|
+
* returns `void` rather than a promise — there is deliberately nothing for a
|
|
47
|
+
* caller to await and therefore nothing for a caller to accidentally fail on.
|
|
48
|
+
*
|
|
49
|
+
* `version` is threaded through as the decimal STRING the store produced and
|
|
50
|
+
* is never parsed (DECISIONS §5.1). `userId`/`email` come off `fact.owner`,
|
|
51
|
+
* read inside the mutation's transaction, and are never looked up here.
|
|
52
|
+
*
|
|
53
|
+
* ## The spine is reached by DYNAMIC import, on purpose
|
|
54
|
+
*
|
|
55
|
+
* `lib/contacts.ts` imports this module, and `src/testing.ts` re-exports
|
|
56
|
+
* `softDeleteContact` from `lib/contacts.ts`. A STATIC `./hatchet.js` or
|
|
57
|
+
* `./outbound.js` import here (outbound → `workflows/deliver-webhook.js` →
|
|
58
|
+
* `lib/hatchet.js`) would therefore run `HatchetClient.init(...)` the moment
|
|
59
|
+
* anything touched the `@hogsend/engine/testing` barrel, which is documented
|
|
60
|
+
* side-effect-free and is consumed where no real Hatchet token exists — it
|
|
61
|
+
* throws `Invalid token format` before a single test runs. Resolving both
|
|
62
|
+
* inside the fire-and-forget body keeps that barrel clean; the ESM module
|
|
63
|
+
* cache makes every call after the first free, and the emit is already
|
|
64
|
+
* asynchronous so nothing about the timing or the post-commit ordering
|
|
65
|
+
* changes. `account-links-emit.test.ts` pins the absence of the static form —
|
|
66
|
+
* every gate stays green without it, so only that guard catches a regression.
|
|
67
|
+
*/
|
|
68
|
+
export declare function emitAccountUnlinked(db: Database, facts: readonly AccountUnlinkedFacts[], handles?: EmitHandles): void;
|
|
69
|
+
//# sourceMappingURL=account-link-emit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-link-emit.d.ts","sourceRoot":"","sources":["../../src/lib/account-link-emit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAQxD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,SAAS,oBAAoB,EAAE,EACtC,OAAO,GAAE,WAAgB,GACxB,IAAI,CAsBN"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { LinkAccountResult, LinkOwner } from "./account-links.js";
|
|
2
|
+
import type { OutboundPayloads } from "./outbound.js";
|
|
3
|
+
/**
|
|
4
|
+
* The ONE place an `account.*` outbound payload or dedupe key is constructed
|
|
5
|
+
* (PRD 08 T3).
|
|
6
|
+
*
|
|
7
|
+
* Six emit sites across four PRDs build these — the hosted callback (linked +
|
|
8
|
+
* four link_failed reasons), the data-plane import, two data-plane revokes,
|
|
9
|
+
* the manage page, the merge's singleton-collision unlink and the
|
|
10
|
+
* contact-deletion leg. Hand-rolling the shape at each of them is how the
|
|
11
|
+
* `email` field ends up carrying the PROVIDER-reported address at one site and
|
|
12
|
+
* the contact's at another, or how one site emits `v3` while another emits
|
|
13
|
+
* `v3.0`. Everything here is a pure function of the facts a mutation already
|
|
14
|
+
* returned.
|
|
15
|
+
*
|
|
16
|
+
* This module has NO runtime imports on purpose (both imports above are
|
|
17
|
+
* `import type`, fully erased). `outbound.ts` reaches the delivery task, which
|
|
18
|
+
* reaches `env.ts`, which validates at IMPORT time — a payload builder must
|
|
19
|
+
* never drag that into a caller that has no env.
|
|
20
|
+
*
|
|
21
|
+
* ## Replay safety — there is none to reach for, and that is deliberate
|
|
22
|
+
*
|
|
23
|
+
* Linking happens in ROUTE-HANDLER runtime (the hosted callback, the data
|
|
24
|
+
* plane), never inside a Hatchet durable task. So nothing here enters the
|
|
25
|
+
* Hatchet journal, the positional-journal law that governs `ctx.sleep` /
|
|
26
|
+
* `ctx.waitForEvent` / the digest+throttle primitives does not apply, and the
|
|
27
|
+
* tracked mailer's exactly-once machinery (auto-keying off the replay-stable
|
|
28
|
+
* Hatchet run id) is NOT involved and must not be reached for.
|
|
29
|
+
*
|
|
30
|
+
* Idempotency here is DB-level, in three layers: the pair advisory lock plus
|
|
31
|
+
* the `(provider, provider_user_id, version)` unique constraint (DECISIONS
|
|
32
|
+
* §5.6) on the write side, and the `(endpointId, dedupeKey)` partial-unique
|
|
33
|
+
* index on the outbound side — which is what {@link buildDedupeKey} feeds. A
|
|
34
|
+
* journey that REACTS to `account.linked` is an ordinary event-triggered
|
|
35
|
+
* journey and obeys every existing replay law unchanged.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* `al:<provider>:<providerUserId>:v<version>` — DECISIONS §5.5, riding the
|
|
39
|
+
* existing `(endpointId, dedupeKey)` partial-unique index on
|
|
40
|
+
* `webhook_deliveries`.
|
|
41
|
+
*
|
|
42
|
+
* A PURE TEMPLATE. Do NOT add URL-encoding, escaping or normalization: the key
|
|
43
|
+
* only has to be stable and unique per mutation, and the instant its spelling
|
|
44
|
+
* changes, a re-emit of a version minted before the change no longer collides
|
|
45
|
+
* with the row written after it — the dedupe silently stops deduping, which no
|
|
46
|
+
* delivery assertion can see.
|
|
47
|
+
*
|
|
48
|
+
* `version` is a decimal STRING in and a STRING out, never parsed
|
|
49
|
+
* (DECISIONS §5.1: the column is a Postgres `bigint`, so `Number()` loses
|
|
50
|
+
* fidelity past `Number.MAX_SAFE_INTEGER` and breaks the consumer's
|
|
51
|
+
* `incoming.version > stored.version` guard in exactly the case it exists for).
|
|
52
|
+
*/
|
|
53
|
+
export declare function buildDedupeKey(provider: string, providerUserId: string, version: string): string;
|
|
54
|
+
/** The two {@link LinkAccountResult} arms that actually bound something. */
|
|
55
|
+
type LinkedFacts = Extract<LinkAccountResult, {
|
|
56
|
+
status: "linked";
|
|
57
|
+
} | {
|
|
58
|
+
status: "relinked";
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* FULL CURRENT STATE for a successful bind (DECISIONS §5.2), built from the
|
|
62
|
+
* facts `linkAccount()` returned and nothing else.
|
|
63
|
+
*
|
|
64
|
+
* `userId` and `email` come off `facts.owner` — the join to `contacts` the
|
|
65
|
+
* store performed INSIDE its advisory-locked transaction (DECISIONS §15.5).
|
|
66
|
+
* Neither field exists on `linked_accounts`, and re-reading them here would be
|
|
67
|
+
* a read after the lock released: no longer the state that was committed.
|
|
68
|
+
* `userId` is `contactKey()` (`external_id ?? anonymous_id ?? id`), the ONE
|
|
69
|
+
* definition shared by the PULL, PUSH and IN-PROCESS planes — never the raw
|
|
70
|
+
* `externalId`.
|
|
71
|
+
*
|
|
72
|
+
* `email` is the CONTACT's address. `row.verifiedEmail` (the
|
|
73
|
+
* provider-reported one) is deliberately never read here: it is a display
|
|
74
|
+
* property at most, and putting it in a field named `email` beside `contactId`
|
|
75
|
+
* is precisely how a downstream system ends up resolving identity on it.
|
|
76
|
+
*/
|
|
77
|
+
export declare function buildAccountLinkedPayload(facts: LinkedFacts, at?: Date): OutboundPayloads["account.linked"];
|
|
78
|
+
/**
|
|
79
|
+
* The facts every unlink site already has in hand.
|
|
80
|
+
*
|
|
81
|
+
* The merge fold's `MergedLinkUnlink` and the delete leg's `ContactUnlinkFact`
|
|
82
|
+
* satisfy this structurally, so `lib/account-link-emit.ts` fans both out
|
|
83
|
+
* without reshaping either. `UnlinkAccountResult` does NOT: its `unlinked` arm
|
|
84
|
+
* carries `provider`/`providerUserId` on `.row`, not at the top level, so a
|
|
85
|
+
* revoke site (PRD 09, PRD 11) passes those two up from `res.row` alongside
|
|
86
|
+
* `res.version`, `res.owner` and its own `reason`.
|
|
87
|
+
*/
|
|
88
|
+
export interface AccountUnlinkedFacts {
|
|
89
|
+
provider: string;
|
|
90
|
+
providerUserId: string;
|
|
91
|
+
/** That pair's OWN next version, a decimal STRING (DECISIONS §5.1). */
|
|
92
|
+
version: string;
|
|
93
|
+
reason: "player" | "api" | "relinked";
|
|
94
|
+
/** Read inside the mutation's transaction — see {@link LinkOwner}. */
|
|
95
|
+
owner: LinkOwner;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* FULL CURRENT STATE for a release (DECISIONS §5.2). Shares the
|
|
99
|
+
* `(provider, providerUserId)` version sequence with `account.linked`, so a
|
|
100
|
+
* consumer's single monotonic guard makes reorder, duplicate and late delivery
|
|
101
|
+
* all no-ops.
|
|
102
|
+
*
|
|
103
|
+
* `contactId`/`userId`/`email` are read off `owner` and nowhere else, for the
|
|
104
|
+
* same reason as {@link buildAccountLinkedPayload}.
|
|
105
|
+
*/
|
|
106
|
+
export declare function buildAccountUnlinkedPayload(facts: AccountUnlinkedFacts, at?: Date): OutboundPayloads["account.unlinked"];
|
|
107
|
+
/**
|
|
108
|
+
* A link flow ended without binding anything.
|
|
109
|
+
*
|
|
110
|
+
* Carries NO `version` and NO `state`: nothing mutated, so there is nothing
|
|
111
|
+
* for the consumer's `incoming.version > stored.version` guard to compare and
|
|
112
|
+
* no current state to report. It gets NO dedupeKey either (the caller passes
|
|
113
|
+
* none) — two genuine failures in a row are two genuine facts, and suppressing
|
|
114
|
+
* the second would hide a brute-force pattern.
|
|
115
|
+
*
|
|
116
|
+
* `reason` is `AccountLinkCallbackError.reason` verbatim; PRD 01 froze that
|
|
117
|
+
* union as the `account.link_failed` union minus `"vetoed"` (which only the
|
|
118
|
+
* hook path produces), so there is no translation table. `contactId` is null
|
|
119
|
+
* whenever the flow failed before a trustworthy contact was in hand, and this
|
|
120
|
+
* event NEVER mints one (DECISIONS §8).
|
|
121
|
+
*/
|
|
122
|
+
export declare function buildLinkFailedPayload(args: {
|
|
123
|
+
provider: string;
|
|
124
|
+
reason: "denied" | "vetoed" | "exchange_failed" | "state_invalid";
|
|
125
|
+
contactId: string | null;
|
|
126
|
+
}, at?: Date): OutboundPayloads["account.link_failed"];
|
|
127
|
+
export {};
|
|
128
|
+
//# sourceMappingURL=account-link-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-link-events.d.ts","sourceRoot":"","sources":["../../src/lib/account-link-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,GACd,MAAM,CAER;AAED,4EAA4E;AAC5E,KAAK,WAAW,GAAG,OAAO,CACxB,iBAAiB,EACjB;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,CAC9C,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,WAAW,EAClB,EAAE,GAAE,IAAiB,GACpB,gBAAgB,CAAC,gBAAgB,CAAC,CAcpC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,QAAQ,GAAG,KAAK,GAAG,UAAU,CAAC;IACtC,sEAAsE;IACtE,KAAK,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,oBAAoB,EAC3B,EAAE,GAAE,IAAiB,GACpB,gBAAgB,CAAC,kBAAkB,CAAC,CAYtC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE;IACJ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,iBAAiB,GAAG,eAAe,CAAC;IAClE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,EACD,EAAE,GAAE,IAAiB,GACpB,gBAAgB,CAAC,qBAAqB,CAAC,CAOzC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AccountLinkHooks, BeforeLinkContext } from "@hogsend/core";
|
|
2
|
+
import type { Logger } from "./logger.js";
|
|
3
|
+
/**
|
|
4
|
+
* The `beforeLink` veto runner — FAIL-CLOSED (DECISIONS §6.7).
|
|
5
|
+
*
|
|
6
|
+
* A throw, a timeout at {@link ACCOUNT_LINK_HOOK_TIMEOUT_MS}, and an explicit
|
|
7
|
+
* `{ allow: false }` all collapse to one outcome: `{ allow: false, reason:
|
|
8
|
+
* "vetoed" }`. A `void`/`undefined` return ALLOWS, per PRD 01's
|
|
9
|
+
* `BeforeLinkResult` — denial is never implicit, so a hook that only observes
|
|
10
|
+
* cannot accidentally veto every link. There is no third outcome and no config
|
|
11
|
+
* flag that turns the veto into a warning.
|
|
12
|
+
*
|
|
13
|
+
* **`runBeforeLink` is the ONLY export of this file, deliberately.**
|
|
14
|
+
* `afterLink` / `afterUnlink` have exactly one invoker — the link store,
|
|
15
|
+
* post-commit (DECISIONS §15.4) — and a second bounded runner living here is
|
|
16
|
+
* precisely how they end up firing twice for every link, invisibly, because
|
|
17
|
+
* they are documented at-least-once and nothing would fail loudly. The veto is
|
|
18
|
+
* genuinely route-owned because it is pre-write and the hosted callback is the
|
|
19
|
+
* only pre-write position. If a bounded fail-OPEN runner is ever wanted
|
|
20
|
+
* elsewhere, it lives in `lib/account-links.ts` beside the commit it follows.
|
|
21
|
+
*/
|
|
22
|
+
export declare function runBeforeLink(args: {
|
|
23
|
+
hooks: AccountLinkHooks;
|
|
24
|
+
ctx: BeforeLinkContext;
|
|
25
|
+
logger?: Logger;
|
|
26
|
+
}): Promise<{
|
|
27
|
+
allow: true;
|
|
28
|
+
} | {
|
|
29
|
+
allow: false;
|
|
30
|
+
reason: "vetoed";
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=account-link-hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-link-hooks.d.ts","sourceRoot":"","sources":["../../src/lib/account-link-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,KAAK,EAAE,gBAAgB,CAAC;IACxB,GAAG,EAAE,iBAAiB,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC,CA6ChE"}
|