@hogsend/engine 0.66.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/container.ts +77 -0
- package/src/env.ts +30 -0
- package/src/index.ts +78 -0
- package/src/journeys/journey-log.ts +25 -8
- package/src/lib/contacts.ts +117 -1
- package/src/lib/email-service-types.ts +10 -0
- package/src/lib/ingestion.ts +91 -19
- package/src/lib/links.ts +94 -11
- 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 +150 -37
- package/src/lib/referral-intent.ts +723 -0
- package/src/lib/referral-link.ts +200 -0
- package/src/lib/referral-registry.ts +83 -0
- package/src/lib/referral-report.ts +739 -0
- package/src/lib/referral-runtime.ts +49 -0
- package/src/lib/referrals-no-emit.test.ts +109 -0
- package/src/lib/referrals.ts +712 -0
- 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/lib/webhook-signing.ts +10 -0
- 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 +153 -0
- package/src/routes/admin/index.ts +2 -0
- package/src/routes/admin/links.ts +14 -5
- package/src/routes/admin/referrals.ts +565 -0
- package/src/routes/admin/targeting.ts +6 -1
- package/src/routes/admin/webhooks.ts +4 -0
- package/src/routes/contacts/index.ts +78 -0
- package/src/routes/index.ts +104 -22
- package/src/routes/referrals/index.ts +41 -0
- package/src/routes/referrals/me.ts +123 -0
- package/src/routes/referrals/report.ts +285 -0
- package/src/routes/referrals/shared.ts +34 -0
- package/src/routes/referrals/touch.ts +313 -0
- package/src/routes/tracking/arrive.ts +90 -0
- package/src/routes/tracking/click-pipeline.ts +8 -0
- 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,678 @@
|
|
|
1
|
+
import type { HatchetClient } from "@hatchet-dev/typescript-sdk/v1/index.js";
|
|
2
|
+
import type { AccountLinkHooks, AccountLinkProvider, AnalyticsEventMirrorConfig, AnalyticsProvider, ConversionDestination, CrmProvider, CrmStageMap, DefinedConversion, DefinedFlag, DefinedFunnel, DefinedReferral, EmailProvider, EnrichmentProvider, FunnelStageEntry, FxRateProvider, JourneySourceLocation, PostHogService, SmsProvider, TimeZone } from "@hogsend/core";
|
|
3
|
+
import type { BucketRegistry, JourneyRegistry } from "@hogsend/core/registry";
|
|
4
|
+
import type { SendWindow } from "@hogsend/core/schedule";
|
|
5
|
+
import { type Database, type DatabaseClient, type JournalShape } from "@hogsend/db";
|
|
6
|
+
import type { TemplateRegistry } from "@hogsend/email";
|
|
7
|
+
import type { SmsTemplateRegistry } from "@hogsend/sms";
|
|
8
|
+
import type { DefinedBucket } from "./buckets/define-bucket.js";
|
|
9
|
+
import type { DefinedCampaign } from "./campaigns/define-campaign.js";
|
|
10
|
+
import { ConnectorActionRegistry } from "./connectors/action-registry-singleton.js";
|
|
11
|
+
import type { DefinedConnectorAction } from "./connectors/define-action.js";
|
|
12
|
+
import type { DefinedConnector } from "./connectors/define-connector.js";
|
|
13
|
+
import { ConnectorRegistry } from "./connectors/registry-singleton.js";
|
|
14
|
+
import type { DefinedDestination } from "./destinations/define-destination.js";
|
|
15
|
+
import { env } from "./env.js";
|
|
16
|
+
import type { DefinedJourney } from "./journeys/define-journey.js";
|
|
17
|
+
import { AccountLinkProviderRegistry } from "./lib/account-link-provider-registry.js";
|
|
18
|
+
import { AnalyticsProviderRegistry } from "./lib/analytics-provider-registry.js";
|
|
19
|
+
import { type Auth } from "./lib/auth.js";
|
|
20
|
+
import { CrmProviderRegistry } from "./lib/crm-provider-registry.js";
|
|
21
|
+
import { type DomainStatusService } from "./lib/domain-status.js";
|
|
22
|
+
import { EmailProviderRegistry } from "./lib/email-provider-registry.js";
|
|
23
|
+
import type { EmailService, FrequencyCapConfig } from "./lib/email-service-types.js";
|
|
24
|
+
import { EnrichmentProviderRegistry } from "./lib/enrichment-provider-registry.js";
|
|
25
|
+
import { FlagRegistry } from "./lib/flags-registry.js";
|
|
26
|
+
import { FunnelRegistry } from "./lib/funnel-registry.js";
|
|
27
|
+
import { type FxLens } from "./lib/fx.js";
|
|
28
|
+
import { type IdentityService } from "./lib/identity-service.js";
|
|
29
|
+
import { type Logger } from "./lib/logger.js";
|
|
30
|
+
import { ReferralRegistry } from "./lib/referral-registry.js";
|
|
31
|
+
import { SmsProviderRegistry } from "./lib/sms-provider-registry.js";
|
|
32
|
+
import type { SmsService } from "./lib/sms-service-types.js";
|
|
33
|
+
import { type DefinedList } from "./lists/define-list.js";
|
|
34
|
+
import { type ListRegistry } from "./lists/registry.js";
|
|
35
|
+
import { type DefinedContactSource } from "./sources/define-contact-source.js";
|
|
36
|
+
import { type ContactSourceRegistry } from "./sources/registry.js";
|
|
37
|
+
import { type DefinedWebhookSource } from "./webhook-sources/define-webhook-source.js";
|
|
38
|
+
export interface HogsendDefaults {
|
|
39
|
+
/** Global fallback IANA timezone for scheduling. Defaults to "UTC". */
|
|
40
|
+
timezone: TimeZone;
|
|
41
|
+
/** Default quiet-hours / send window auto-applied by `ctx.when`. */
|
|
42
|
+
sendWindow?: SendWindow;
|
|
43
|
+
/** Optional per-recipient frequency cap enforced in the mailer. */
|
|
44
|
+
frequencyCap?: FrequencyCapConfig;
|
|
45
|
+
}
|
|
46
|
+
export interface HogsendClient {
|
|
47
|
+
env: typeof env;
|
|
48
|
+
logger: Logger;
|
|
49
|
+
db: Database;
|
|
50
|
+
dbClient: DatabaseClient;
|
|
51
|
+
auth: Auth;
|
|
52
|
+
emailService: EmailService;
|
|
53
|
+
/**
|
|
54
|
+
* The container-held registry of email providers, keyed by `meta.id`. The
|
|
55
|
+
* `POST /v1/webhooks/email/:providerId` route resolves the verifying provider
|
|
56
|
+
* out of this. Holds at least the resolved active provider.
|
|
57
|
+
*/
|
|
58
|
+
emailProviders: EmailProviderRegistry;
|
|
59
|
+
/**
|
|
60
|
+
* The single resolved active email provider (the one the mailer sends
|
|
61
|
+
* through). Resolved from `opts.email.defaultProvider` / `EMAIL_PROVIDER`,
|
|
62
|
+
* defaulting to the env-built Resend provider for byte-for-byte parity.
|
|
63
|
+
*/
|
|
64
|
+
emailProvider: EmailProvider;
|
|
65
|
+
/**
|
|
66
|
+
* Cached sending-domain status for the ACTIVE provider. Consumed by the
|
|
67
|
+
* mailer's test-mode check (F3 — sync `testModeCached()` per send), the
|
|
68
|
+
* `GET/POST /v1/admin/domain` routes, and (via HTTP) the CLI
|
|
69
|
+
* (`hogsend domain`) + Studio Setup view. In-memory cache only; the per-send
|
|
70
|
+
* path never awaits a provider call.
|
|
71
|
+
*/
|
|
72
|
+
domainStatus: DomainStatusService;
|
|
73
|
+
/**
|
|
74
|
+
* The app's template registry (key → component + subject + category +
|
|
75
|
+
* optional preview/examples). Same object threaded into the engine mailer;
|
|
76
|
+
* exposed here so admin preview/catalog routes can enumerate keys and render
|
|
77
|
+
* templates without going through a send. Empty when no templates are wired.
|
|
78
|
+
*/
|
|
79
|
+
templates: TemplateRegistry;
|
|
80
|
+
/**
|
|
81
|
+
* The engine-owned tracked SMS sender (the SMS sibling of {@link emailService}).
|
|
82
|
+
* When no SMS provider is configured this is an inert stub whose `send` throws
|
|
83
|
+
* an actionable error — so an existing deploy without Twilio creds boots clean.
|
|
84
|
+
*/
|
|
85
|
+
smsService: SmsService;
|
|
86
|
+
/**
|
|
87
|
+
* The container-held registry of SMS providers, keyed by `meta.id`. The
|
|
88
|
+
* `POST /v1/webhooks/sms/:providerId` route resolves the verifying provider
|
|
89
|
+
* out of this. Empty when no SMS provider is configured.
|
|
90
|
+
*/
|
|
91
|
+
smsProviders: SmsProviderRegistry;
|
|
92
|
+
/**
|
|
93
|
+
* The single resolved active SMS provider the tracked sender delivers through.
|
|
94
|
+
* Undefined when no SMS provider is configured.
|
|
95
|
+
*/
|
|
96
|
+
smsProvider?: SmsProvider;
|
|
97
|
+
/**
|
|
98
|
+
* The container-held registry of account-link providers (Steam, Twitch, or
|
|
99
|
+
* consumer-authored via `defineAccountLink`), keyed by `meta.id`. The
|
|
100
|
+
* `/v1/accounts/:provider/*` routes resolve providers out of this and 404 an
|
|
101
|
+
* unknown id. Unlike email/SMS/analytics there is NO single active provider:
|
|
102
|
+
* the player picks one per link, so there is no `accountLinkProvider` field,
|
|
103
|
+
* no `ACCOUNT_LINK_PROVIDER` env, and no "not registered" boot throw — the
|
|
104
|
+
* missing symmetry is deliberate. Empty when none configured (an
|
|
105
|
+
* unconfigured provider is ABSENT, never present-but-disabled).
|
|
106
|
+
*/
|
|
107
|
+
accountLinkProviders: AccountLinkProviderRegistry;
|
|
108
|
+
/**
|
|
109
|
+
* The consumer's account-link hooks, held VERBATIM — no wrapping, no
|
|
110
|
+
* per-hook defaulting. The container only holds them: `beforeLink` is
|
|
111
|
+
* invoked by the hosted callback (PRD 07) and `afterLink`/`afterUnlink` by
|
|
112
|
+
* the link store (PRD 03), and by nothing else (DECISIONS §15.4). `{}` when
|
|
113
|
+
* none supplied.
|
|
114
|
+
*/
|
|
115
|
+
accountLinkHooks: AccountLinkHooks;
|
|
116
|
+
/** Parsed + validated ACCOUNT_LINK_ALLOWED_ORIGINS. Empty array = none permitted. */
|
|
117
|
+
accountLinkAllowedOrigins: string[];
|
|
118
|
+
/**
|
|
119
|
+
* The container-held registry of referral definitions (`defineReferral`),
|
|
120
|
+
* keyed by id. There is NO env preset and NO single active referral: a
|
|
121
|
+
* referral exists because it was authored in code, and a product may run
|
|
122
|
+
* several at once. EMPTY is the normal state of a deploy that never asked
|
|
123
|
+
* for referrals, and every wired site (the arrive touch, the bind at
|
|
124
|
+
* identity adoption, the qualify evaluation in `ingestEvent`, the conversion
|
|
125
|
+
* tree walk) is INERT while it stays empty.
|
|
126
|
+
*/
|
|
127
|
+
referrals: ReferralRegistry;
|
|
128
|
+
/**
|
|
129
|
+
* The container-held registry of enrichment providers, keyed by `meta.id` —
|
|
130
|
+
* the enrichment sibling of {@link smsProviders}. Empty when no enrichment
|
|
131
|
+
* provider is configured.
|
|
132
|
+
*/
|
|
133
|
+
enrichmentProviders: EnrichmentProviderRegistry;
|
|
134
|
+
/**
|
|
135
|
+
* The single resolved active enrichment provider `refineContact()` looks up
|
|
136
|
+
* through. Undefined when no enrichment provider is configured — a deploy
|
|
137
|
+
* with no enrichment is a valid deploy (refinement stays inert).
|
|
138
|
+
*/
|
|
139
|
+
enrichmentProvider?: EnrichmentProvider;
|
|
140
|
+
/**
|
|
141
|
+
* The container-held registry of CRM providers, keyed by `meta.id`. The
|
|
142
|
+
* `POST /v1/webhooks/crm/:providerId` route resolves the verifying provider
|
|
143
|
+
* out of this and the reconciliation poll walks it. Unlike email/SMS there
|
|
144
|
+
* is no single "active" CRM — many sync concurrently; `pushLead` callers
|
|
145
|
+
* name the provider. Empty when none configured.
|
|
146
|
+
*/
|
|
147
|
+
crmProviders: CrmProviderRegistry;
|
|
148
|
+
/**
|
|
149
|
+
* The funnel registry (§5b.4): every `defineFunnel` plus the synthesized
|
|
150
|
+
* `"default"` carrying the crm sugar. Routes stage events by
|
|
151
|
+
* (provider, pipeline) claim; admin stats/Studio render per funnel.
|
|
152
|
+
*/
|
|
153
|
+
funnels: FunnelRegistry;
|
|
154
|
+
/**
|
|
155
|
+
* The registry of code-defined feature flags (`defineFlag`), keyed by
|
|
156
|
+
* `meta.key`. Built from `opts.flags`; the boot reconciler + Studio read it.
|
|
157
|
+
* Empty when no flags are defined in code (DB/Studio flags still evaluate).
|
|
158
|
+
*/
|
|
159
|
+
flagRegistry: FlagRegistry;
|
|
160
|
+
/**
|
|
161
|
+
* The container-held registry of analytics providers, keyed by `meta.id` —
|
|
162
|
+
* the analytics sibling of {@link emailProviders}. Built from env presets
|
|
163
|
+
* (`analyticsProvidersFromEnv`) merged consumer-last.
|
|
164
|
+
*/
|
|
165
|
+
analyticsProviders: AnalyticsProviderRegistry;
|
|
166
|
+
/**
|
|
167
|
+
* The single resolved ACTIVE analytics provider (identity PULL + person
|
|
168
|
+
* writes + capture). Undefined when nothing is configured — every consumer
|
|
169
|
+
* treats that as a silent no-op.
|
|
170
|
+
*/
|
|
171
|
+
analytics?: AnalyticsProvider;
|
|
172
|
+
/**
|
|
173
|
+
* Identity-attach helper that resolves/merges a contact AND propagates the
|
|
174
|
+
* analytics merge (§5.3) in one call, for identity-attach OUTSIDE the
|
|
175
|
+
* `/v1/events` ingest path. Discord `/link` (§7) wires its `resolveContact`
|
|
176
|
+
* callback to `client.identity.linkContact` so a successful contact-merge
|
|
177
|
+
* folds the discord-keyed person into the canonical one through the SAME
|
|
178
|
+
* engine emission ingest uses — never bespoke per-consumer plumbing.
|
|
179
|
+
*/
|
|
180
|
+
identity: IdentityService;
|
|
181
|
+
/**
|
|
182
|
+
* The OPTIONAL base-currency FX lens (docs/groups.md §Base-currency lens):
|
|
183
|
+
* `getBaseCurrency()` resolves the effective reporting currency PER CALL
|
|
184
|
+
* (code pin → Studio operator setting → env `BASE_CURRENCY`; null = lens
|
|
185
|
+
* off) and `getRatesToBase()` is the fail-soft quote→base sheet the admin
|
|
186
|
+
* group revenue views convert through. The per-currency revenue LAW is
|
|
187
|
+
* untouched; this only serves an opt-in converted view on top of it.
|
|
188
|
+
*/
|
|
189
|
+
fx: FxLens;
|
|
190
|
+
registry: JourneyRegistry;
|
|
191
|
+
/**
|
|
192
|
+
* Map of enabled journey id → its captured `run` source string. Populated by
|
|
193
|
+
* `buildJourneyRegistry` (skips journeys whose source failed to serialize).
|
|
194
|
+
* Consumed by the Studio journey-graph route, which parses the source lazily
|
|
195
|
+
* with acorn to derive a visual workflow. Empty when no journeys are wired.
|
|
196
|
+
*/
|
|
197
|
+
journeySources: Map<string, string>;
|
|
198
|
+
/**
|
|
199
|
+
* The consumer's `Templates`/`Events` `as const` maps, normalized to always
|
|
200
|
+
* be present (`{ templates: {}, events: {} }` when unwired). Consumed by the
|
|
201
|
+
* Studio journey-graph route to resolve `Templates.X` / `Events.X` member
|
|
202
|
+
* expressions to their real values, for exact previews + stable node ids.
|
|
203
|
+
*/
|
|
204
|
+
journeyConstants: {
|
|
205
|
+
templates: Record<string, string>;
|
|
206
|
+
events: Record<string, string>;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Map of enabled journey id → its `defineJourney` call-site `{ path, line }`.
|
|
210
|
+
* Populated by `buildJourneyRegistry`. Consumed by the Studio journey-graph
|
|
211
|
+
* route to build an "open in editor" deep link. Absent ids had no capturable
|
|
212
|
+
* call-site (e.g. bucket-generated reaction journeys).
|
|
213
|
+
*/
|
|
214
|
+
journeySourceLocations: Map<string, JourneySourceLocation>;
|
|
215
|
+
/**
|
|
216
|
+
* The bucket registry (id map + event/property inverted indexes for candidate
|
|
217
|
+
* narrowing). Built and installed as the process singleton at client build;
|
|
218
|
+
* the real-time ingest path reads it via `getBucketRegistrySingleton()`.
|
|
219
|
+
* Empty when no buckets are wired.
|
|
220
|
+
*/
|
|
221
|
+
bucketRegistry: BucketRegistry;
|
|
222
|
+
/**
|
|
223
|
+
* The email-list registry (D3): code-defined subscription categories layered
|
|
224
|
+
* on `email_preferences.categories`, with the LOCKED polarity rule that is the
|
|
225
|
+
* single source of truth for the mailer's suppression check AND the preference
|
|
226
|
+
* center. Built and installed as the process singleton at client build (read
|
|
227
|
+
* elsewhere via `getListRegistry()`). Empty when no lists are wired.
|
|
228
|
+
*/
|
|
229
|
+
listRegistry: ListRegistry;
|
|
230
|
+
/**
|
|
231
|
+
* Code-defined one-shot campaigns (broadcasts), verbatim from
|
|
232
|
+
* `opts.campaigns`. The worker's boot reconciler turns them into scheduled
|
|
233
|
+
* `campaigns` rows; empty when none are wired.
|
|
234
|
+
*/
|
|
235
|
+
campaigns: DefinedCampaign[];
|
|
236
|
+
/**
|
|
237
|
+
* The unified inbound CONNECTOR registry, keyed by `meta.id`. Holds every
|
|
238
|
+
* transport: webhook (the `:sourceId` dispatch + legacy webhookSources),
|
|
239
|
+
* gateway, and poll. Installed as the process singleton in BOTH the API and
|
|
240
|
+
* worker. The webhook route reads `getByTransport("webhook")`; the generic
|
|
241
|
+
* `/v1/connectors/:id/*` routes read `get(id).handlers`.
|
|
242
|
+
*/
|
|
243
|
+
connectorRegistry: ConnectorRegistry;
|
|
244
|
+
/**
|
|
245
|
+
* The contact-source registry (Clay/Attio/generic-webhook origins), keyed by
|
|
246
|
+
* `meta.id`. `isProspectSource()` classifies a contact's `contacts.source` as
|
|
247
|
+
* a cold prospect origin; the cold posture + write-back travel with each
|
|
248
|
+
* entry. Installed as the process singleton in BOTH the API and worker.
|
|
249
|
+
*/
|
|
250
|
+
contactSourceRegistry: ContactSourceRegistry;
|
|
251
|
+
/**
|
|
252
|
+
* The connector OUTBOUND ACTION registry, keyed by `${connectorId}:${name}`.
|
|
253
|
+
* Holds the journey-callable imperative actions (Discord post / broadcast /
|
|
254
|
+
* mention / DM) the standalone `sendConnectorAction()` resolves. Socket-free —
|
|
255
|
+
* independent of any inbound gateway runtime. Empty when none are wired.
|
|
256
|
+
*/
|
|
257
|
+
connectorActionRegistry: ConnectorActionRegistry;
|
|
258
|
+
hatchet: HatchetClient;
|
|
259
|
+
/**
|
|
260
|
+
* The client repo's migration journal (`migrations/meta/_journal.json`),
|
|
261
|
+
* powering the `schema.client` block of `GET /v1/health`. Defaults to an
|
|
262
|
+
* empty journal — a client that injects none has a trivially-in-sync client
|
|
263
|
+
* track. The CLIENT track never gates boot (client-owned); engine does.
|
|
264
|
+
*/
|
|
265
|
+
clientJournal: JournalShape;
|
|
266
|
+
/**
|
|
267
|
+
* Resolved scheduling + frequency-cap defaults. `timezone` always has a value
|
|
268
|
+
* ("UTC" when unset). Read by the journey context (tz/window) and the mailer
|
|
269
|
+
* (frequency cap).
|
|
270
|
+
*/
|
|
271
|
+
defaults: HogsendDefaults;
|
|
272
|
+
/**
|
|
273
|
+
* Resolved browser-readable contact projection (`GET /v1/contacts/me`).
|
|
274
|
+
* `publicProperties` is an operator ALLOWLIST of exact `contacts.properties`
|
|
275
|
+
* keys; `exposeEmail` opts the address in. Both default to closed
|
|
276
|
+
* (`[]` / `false`), so a deploy that configures nothing exposes nothing.
|
|
277
|
+
*/
|
|
278
|
+
contactsConfig: {
|
|
279
|
+
publicProperties: string[];
|
|
280
|
+
exposeEmail: boolean;
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
export interface HogsendClientOptions {
|
|
284
|
+
/** Journeys to register in the {@link JourneyRegistry}. Defaults to none. */
|
|
285
|
+
journeys?: DefinedJourney[];
|
|
286
|
+
/**
|
|
287
|
+
* The consumer's `Templates`/`Events` `as const` maps (each a
|
|
288
|
+
* `CONST_NAME -> "value"` record). Threaded into the Studio journey-graph
|
|
289
|
+
* route so `Templates.X` / `Events.X` member expressions in a journey's `run`
|
|
290
|
+
* source resolve to their real runtime values — yielding exact email-template
|
|
291
|
+
* previews and stable, join-safe `wait-event:${value}` / `digest:${value}`
|
|
292
|
+
* node ids (instead of positional `unstable` synthetics). Defaults to none.
|
|
293
|
+
*/
|
|
294
|
+
journeyConstants?: {
|
|
295
|
+
templates?: Record<string, string>;
|
|
296
|
+
events?: Record<string, string>;
|
|
297
|
+
};
|
|
298
|
+
/** Buckets to register in the {@link BucketRegistry}. Defaults to none. */
|
|
299
|
+
buckets?: DefinedBucket[];
|
|
300
|
+
/**
|
|
301
|
+
* Email lists (D3) to register in the {@link ListRegistry}. Each is a
|
|
302
|
+
* `defineList()` subscription category (id + name + `defaultOptIn`). The
|
|
303
|
+
* registry drives the mailer's list-aware suppression check and the
|
|
304
|
+
* preference center. Defaults to none (empty registry ⇒ legacy opt-in).
|
|
305
|
+
*/
|
|
306
|
+
lists?: DefinedList[];
|
|
307
|
+
/**
|
|
308
|
+
* Code-defined one-shot campaigns (broadcasts) — `defineCampaign()` files.
|
|
309
|
+
* Carried on the client so the worker's boot reconciler can schedule them
|
|
310
|
+
* (see `reconcileDefinedCampaigns`); the API process only stores them.
|
|
311
|
+
* Defaults to none.
|
|
312
|
+
*/
|
|
313
|
+
campaigns?: DefinedCampaign[];
|
|
314
|
+
/**
|
|
315
|
+
* Email is a first-class channel. Its config is grouped here rather than
|
|
316
|
+
* spread across top-level args — the engine owns the cohesive email pipeline
|
|
317
|
+
* (templates → render → preference checks → tracking → `email_sends` write),
|
|
318
|
+
* and the {@link EmailProvider} is only the swappable wire under it.
|
|
319
|
+
*
|
|
320
|
+
* - `provider` — a single swappable email provider (Resend, Postmark, SES…),
|
|
321
|
+
* the back-compat one-provider seam. MERGED LAST (after env presets and
|
|
322
|
+
* `providers`), so it wins on id collision. Tracking/rendering/preferences
|
|
323
|
+
* come along for free regardless of which provider you supply.
|
|
324
|
+
* - `providers` — register MANY providers into the {@link EmailProviderRegistry}
|
|
325
|
+
* (e.g. Resend + Postmark) so the `POST /v1/webhooks/email/:providerId`
|
|
326
|
+
* route can verify each one's webhooks. Merged AFTER the env presets and
|
|
327
|
+
* BEFORE `provider`.
|
|
328
|
+
* - `defaultProvider` — the active provider id the mailer sends through.
|
|
329
|
+
* Resolves as `defaultProvider ?? EMAIL_PROVIDER ?? "resend"`. If it names a
|
|
330
|
+
* provider that isn't registered, the container throws at boot with the list
|
|
331
|
+
* of registered ids.
|
|
332
|
+
* - `templates` — the app's template registry (key → component + subject +
|
|
333
|
+
* category), threaded into the engine mailer and onward to
|
|
334
|
+
* `getTemplate(..., { registry })`. The engine bakes in no business
|
|
335
|
+
* templates; clients own their `.tsx` files + registry. Defaults to an
|
|
336
|
+
* empty registry (no sendable template keys).
|
|
337
|
+
*
|
|
338
|
+
* Other channels (SMS, push, Slack) are NOT configured here — they're plain
|
|
339
|
+
* functions a journey imports and calls.
|
|
340
|
+
*/
|
|
341
|
+
email?: {
|
|
342
|
+
provider?: EmailProvider;
|
|
343
|
+
providers?: EmailProvider[];
|
|
344
|
+
defaultProvider?: string;
|
|
345
|
+
templates?: TemplateRegistry;
|
|
346
|
+
};
|
|
347
|
+
/**
|
|
348
|
+
* SMS is a first-class channel (the SMS sibling of {@link email}). Its config
|
|
349
|
+
* is grouped here; the engine owns the cohesive SMS pipeline (templates →
|
|
350
|
+
* render → preference/suppression checks → `sms_sends` write → STOP handling),
|
|
351
|
+
* and the {@link SmsProvider} (Twilio, …) is only the swappable wire.
|
|
352
|
+
*
|
|
353
|
+
* - `provider` — a single SMS provider. Merged LAST (after env presets and
|
|
354
|
+
* `providers`), so it wins on id collision.
|
|
355
|
+
* - `providers` — register MANY providers into the {@link SmsProviderRegistry}
|
|
356
|
+
* so `POST /v1/webhooks/sms/:providerId` can verify each one's webhooks.
|
|
357
|
+
* - `defaultProvider` — the active provider id the tracked sender delivers
|
|
358
|
+
* through. Resolves as `defaultProvider ?? SMS_PROVIDER ?? "twilio"`. If it
|
|
359
|
+
* names an unregistered provider, the container throws at boot.
|
|
360
|
+
* - `templates` — the app's SMS template registry (key → component +
|
|
361
|
+
* category), threaded into the tracked SMS sender.
|
|
362
|
+
* - `from` — the E.164 default sender (overrides env `SMS_FROM`).
|
|
363
|
+
* - `stopFooter` — the compliance footer appended to non-transactional
|
|
364
|
+
* bodies; `false` disables it, a string overrides the default text.
|
|
365
|
+
* - `optOutReplies` — send STOP/START/HELP confirmation replies (default off;
|
|
366
|
+
* the carrier already replies and a post-STOP send is blocked).
|
|
367
|
+
* - `linkTracking` — rewrite bare URLs in rendered bodies to first-party
|
|
368
|
+
* short tracked links (`/s/:code`). Default true (overrides env
|
|
369
|
+
* `SMS_LINK_TRACKING`).
|
|
370
|
+
* - `linkHost` — the full origin short links are minted under (overrides
|
|
371
|
+
* env `SMS_LINK_HOST`; falls back to `API_PUBLIC_URL`).
|
|
372
|
+
*
|
|
373
|
+
* Omitting `sms` entirely (or configuring no provider) installs an inert stub
|
|
374
|
+
* SMS service — an existing deploy without Twilio creds boots unchanged.
|
|
375
|
+
*/
|
|
376
|
+
sms?: {
|
|
377
|
+
provider?: SmsProvider;
|
|
378
|
+
providers?: SmsProvider[];
|
|
379
|
+
defaultProvider?: string;
|
|
380
|
+
templates?: SmsTemplateRegistry;
|
|
381
|
+
from?: string;
|
|
382
|
+
stopFooter?: string | false;
|
|
383
|
+
optOutReplies?: boolean;
|
|
384
|
+
linkTracking?: boolean;
|
|
385
|
+
linkHost?: string;
|
|
386
|
+
};
|
|
387
|
+
/**
|
|
388
|
+
* What `GET /v1/contacts/me` may hand back to a browser.
|
|
389
|
+
*
|
|
390
|
+
* - `publicProperties` — EXACT `contacts.properties` keys the browser may
|
|
391
|
+
* read. No wildcard, no prefix match. Anything not listed is omitted.
|
|
392
|
+
* - `exposeEmail` — include the contact's email address in the response.
|
|
393
|
+
*
|
|
394
|
+
* Defaults are closed (`[]` / `false`): with no `contacts` option the route
|
|
395
|
+
* answers `{ identified: false, traits: {} }` for everyone.
|
|
396
|
+
*/
|
|
397
|
+
contacts?: {
|
|
398
|
+
publicProperties?: string[];
|
|
399
|
+
exposeEmail?: boolean;
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* Account linking (Steam, Twitch, or your own `defineAccountLink` provider).
|
|
403
|
+
* The engine owns the stateful flow (state tokens, the link store,
|
|
404
|
+
* versioning, hooks, outbound events); a provider is only the two proof
|
|
405
|
+
* wires (authorize URL + callback → proven identity).
|
|
406
|
+
*/
|
|
407
|
+
accountLinks?: {
|
|
408
|
+
/** Register MANY providers. Merged AFTER env presets, so a same-id provider wins. */
|
|
409
|
+
providers?: AccountLinkProvider[];
|
|
410
|
+
/** In-process hooks. beforeLink is fail-closed; afterLink/afterUnlink fail-open (DECISIONS §9). */
|
|
411
|
+
hooks?: AccountLinkHooks;
|
|
412
|
+
/**
|
|
413
|
+
* Extra allowed origins, concatenated AFTER ACCOUNT_LINK_ALLOWED_ORIGINS and
|
|
414
|
+
* parsed by the same rule. A malformed entry THROWS at boot. This is the ONE
|
|
415
|
+
* allowlist: PRD 07 checks `returnTo` against it, PRD 10 uses it as the
|
|
416
|
+
* `postMessage` targetOrigin set, and PRD 10 validates its `resultRedirect`
|
|
417
|
+
* against it. PRD 10 CONSUMES this field and does not redeclare it.
|
|
418
|
+
*/
|
|
419
|
+
allowedOrigins?: string[];
|
|
420
|
+
};
|
|
421
|
+
/**
|
|
422
|
+
* Referral programs, authored with `defineReferral` (PRD 05). Pass the SAME
|
|
423
|
+
* array in BOTH `index.ts` and `worker.ts`: the HTTP side runs the touch and
|
|
424
|
+
* the bind, the worker side runs `getReferralLink` inside journeys.
|
|
425
|
+
* Duplicate ids inside one array warn and last-writer-wins, like every other
|
|
426
|
+
* registry merge. Omitted ⇒ referrals are entirely inert.
|
|
427
|
+
*/
|
|
428
|
+
referrals?: DefinedReferral[];
|
|
429
|
+
/**
|
|
430
|
+
* Enrichment (Refinement) is a first-class provider kind mirroring
|
|
431
|
+
* {@link email}/{@link sms}. The engine owns the cohesive refinement
|
|
432
|
+
* pipeline (ledger → TTL/negative cache → budget cap → ingest write), and
|
|
433
|
+
* the {@link EnrichmentProvider} (Apollo, Clay, …) is only the swappable
|
|
434
|
+
* vendor wire under it.
|
|
435
|
+
*
|
|
436
|
+
* - `provider` — a single enrichment provider. Merged LAST (after env
|
|
437
|
+
* presets and `providers`), so it wins on id collision.
|
|
438
|
+
* - `providers` — register MANY providers into the
|
|
439
|
+
* {@link EnrichmentProviderRegistry}.
|
|
440
|
+
* - `defaultProvider` — the active provider id `refineContact()` looks up
|
|
441
|
+
* through. Resolves as `defaultProvider ?? ENRICHMENT_PROVIDER ?? "apollo"`.
|
|
442
|
+
* If it names an unregistered provider, the container throws at boot.
|
|
443
|
+
* When nothing is explicitly requested and exactly ONE provider is
|
|
444
|
+
* registered, that one is used (the SMS DX rule).
|
|
445
|
+
*
|
|
446
|
+
* Omitting `enrichment` entirely (or configuring no provider) leaves
|
|
447
|
+
* refinement inert — a deploy with no enrichment is a valid deploy.
|
|
448
|
+
*/
|
|
449
|
+
enrichment?: {
|
|
450
|
+
provider?: EnrichmentProvider;
|
|
451
|
+
providers?: EnrichmentProvider[];
|
|
452
|
+
defaultProvider?: string;
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
455
|
+
* The OPTIONAL base-currency FX lens (docs/groups.md §Base-currency lens).
|
|
456
|
+
* OFF unless a base currency resolves — with no `fx.baseCurrency` pin, no
|
|
457
|
+
* Studio operator setting, and no env `BASE_CURRENCY`, nothing anywhere
|
|
458
|
+
* converts.
|
|
459
|
+
*
|
|
460
|
+
* - `provider` — a BYO {@link FxRateProvider} rate source. WINS over the env
|
|
461
|
+
* presets entirely (the same consumer-over-env spirit as `analytics`,
|
|
462
|
+
* minus the registry — exactly one FX source resolves at boot; multiple
|
|
463
|
+
* simultaneous rate sources have no use case). Without it, env resolves:
|
|
464
|
+
* `FX_PROVIDER=frankfurter` → the ECB preset, else a set `FX_RATES` → the
|
|
465
|
+
* sovereign static preset, else no source (lens stays off).
|
|
466
|
+
* - `baseCurrency` — the code-level PIN: wins over BOTH the Studio operator
|
|
467
|
+
* setting and env `BASE_CURRENCY` (the `defaults.timezone` pattern; also
|
|
468
|
+
* the test seam, since `env` is a process singleton). Without it the base
|
|
469
|
+
* resolves per call: Studio setting (explicit null there = lens OFF,
|
|
470
|
+
* beating env) → env `BASE_CURRENCY`.
|
|
471
|
+
*/
|
|
472
|
+
fx?: {
|
|
473
|
+
provider?: FxRateProvider;
|
|
474
|
+
baseCurrency?: string;
|
|
475
|
+
};
|
|
476
|
+
/**
|
|
477
|
+
* Code-first conversion-point definitions (plan §5.1) — `defineConversion`
|
|
478
|
+
* results. Evaluated inside `ingestEvent` after every fresh event insert;
|
|
479
|
+
* fired instances land in the `conversions` table. Every journey
|
|
480
|
+
* `meta.goal` is boot-validated against this set (plus the seeded
|
|
481
|
+
* "revenue" definition when active) — an unknown goal throws here.
|
|
482
|
+
*/
|
|
483
|
+
conversions?: DefinedConversion[];
|
|
484
|
+
/**
|
|
485
|
+
* Code-first feature-flag definitions (`defineFlag()` results). Reconciled
|
|
486
|
+
* into `flags` rows at boot (create-if-absent, disabled + rollout 0; contract
|
|
487
|
+
* drift synced on code-origin rows; operator state never clobbered — see
|
|
488
|
+
* `reconcileDefinedFlags`). Only the CONTRACT is expressed here; targeting /
|
|
489
|
+
* rollout / enabling are DB/operator-owned. Wire in BOTH `index.ts` and
|
|
490
|
+
* `worker.ts` so both processes reconcile. Defaults to none.
|
|
491
|
+
*/
|
|
492
|
+
flags?: DefinedFlag[];
|
|
493
|
+
/**
|
|
494
|
+
* Conversion DESTINATIONS (plan §5.2) — ad-platform feedback providers
|
|
495
|
+
* (`defineConversionDestination`; Meta CAPI is the reference). Referenced
|
|
496
|
+
* by id from `defineConversion({ destinations })`.
|
|
497
|
+
*/
|
|
498
|
+
conversionDestinations?: ConversionDestination[];
|
|
499
|
+
/**
|
|
500
|
+
* CRM sync providers — the pluggable
|
|
501
|
+
* layer that pushes leads INTO client CRMs and lands pipeline stage changes
|
|
502
|
+
* + deal values back on the event spine as `funnel.stage_changed`. Register
|
|
503
|
+
* one (`provider`) or many (`providers`); each is webhook-served at
|
|
504
|
+
* `POST /v1/webhooks/crm/:providerId` and polled for reconciliation where
|
|
505
|
+
* it implements `poll`. No "active" selection — many CRMs sync at once.
|
|
506
|
+
*/
|
|
507
|
+
crm?: {
|
|
508
|
+
provider?: CrmProvider;
|
|
509
|
+
providers?: CrmProvider[];
|
|
510
|
+
/**
|
|
511
|
+
* Per-provider stage maps: native `(pipelineId|'*') → stageId → canonical
|
|
512
|
+
* stage` — the one-CRM-no-funnels 3-liner. Desugars into `crmPipeline`
|
|
513
|
+
* bindings on the synthesized `"default"` funnel. Unmapped stages record
|
|
514
|
+
* native ids and warn (the provider's won/lost status hint still resolves
|
|
515
|
+
* sold/lost). Every mapped value must be a ladder stage or `"lost"` —
|
|
516
|
+
* validated at boot.
|
|
517
|
+
*/
|
|
518
|
+
stageMaps?: Record<string, CrmStageMap>;
|
|
519
|
+
/**
|
|
520
|
+
* YOUR canonical funnel's stages, in rank order — replaces the built-in
|
|
521
|
+
* `lead → contacted → survey_booked → quoted → sold`. Same entries as
|
|
522
|
+
* `defineFunnel`: plain strings, or objects carrying `milestone` (and
|
|
523
|
+
* `on` event triggers). All-string arrays get the legacy money defaults
|
|
524
|
+
* (soldStage = last stage, quotedStage = a stage literally named
|
|
525
|
+
* "quoted"); any object entry makes milestones explicit-only. `"lost"`
|
|
526
|
+
* stays the implicit terminal. Zero migration: only new stage events
|
|
527
|
+
* re-rank.
|
|
528
|
+
*/
|
|
529
|
+
stages?: FunnelStageEntry[];
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
532
|
+
* Funnels as code-first primitives (§5b.4) — `defineFunnel` results. Each
|
|
533
|
+
* claims CRM traffic via its `bindings` (provider, pipeline) pairs;
|
|
534
|
+
* overlapping claims throw at boot. The `crm.{stages,stageMaps}` group
|
|
535
|
+
* above is sugar for a single `"default"` funnel and composes with these.
|
|
536
|
+
*/
|
|
537
|
+
funnels?: DefinedFunnel[];
|
|
538
|
+
/**
|
|
539
|
+
* The analytics provider(s) — provider-neutral since the
|
|
540
|
+
* `AnalyticsProvider` contract (the analytics sibling of `EmailProvider`;
|
|
541
|
+
* PostHog is the reference implementation, not the architecture). Its role
|
|
542
|
+
* is deliberately NARROW — it is NOT the outbound-catalog firing path (the
|
|
543
|
+
* email/contact/journey/bucket lifecycle fans out durably via DESTINATIONS
|
|
544
|
+
* on the webhook spine). The ACTIVE provider serves:
|
|
545
|
+
*
|
|
546
|
+
* 1. The identity PULL — `getPersonProperties` for per-user timezone
|
|
547
|
+
* resolution at journey enrollment (`define-journey` / `lib/timezone.ts`).
|
|
548
|
+
* On PostHog this needs `POSTHOG_PERSONAL_API_KEY` (the phc_ project key
|
|
549
|
+
* is write-only by design); reads soft-fail to contact-property
|
|
550
|
+
* fallbacks without it.
|
|
551
|
+
* 2. Person WRITES — `setPersonProperties` (the opt-in `bucket.syncToPostHog`
|
|
552
|
+
* mirror, and trait propagation). Rides the capture pipeline; no extra
|
|
553
|
+
* credential.
|
|
554
|
+
*
|
|
555
|
+
* Accepted shapes (mirrors `email`):
|
|
556
|
+
* - a group: `{ provider?, providers?, defaultProvider? }` — register one or
|
|
557
|
+
* many `AnalyticsProvider`s; env presets (`analyticsProvidersFromEnv` —
|
|
558
|
+
* PostHog when `POSTHOG_API_KEY` is set) merge consumer-LAST;
|
|
559
|
+
* `defaultProvider` / env `ANALYTICS_PROVIDER` picks the active id
|
|
560
|
+
* (default `"posthog"`).
|
|
561
|
+
* - a bare `AnalyticsProvider` — registered and made active.
|
|
562
|
+
* - @deprecated a legacy `PostHogService` — wrapped via
|
|
563
|
+
* `wrapLegacyAnalyticsService` and made active.
|
|
564
|
+
*
|
|
565
|
+
* Lives at the top level (not under `email`) because the engine itself uses
|
|
566
|
+
* it for the PULL.
|
|
567
|
+
*/
|
|
568
|
+
analytics?: PostHogService | AnalyticsProvider | {
|
|
569
|
+
provider?: AnalyticsProvider;
|
|
570
|
+
providers?: AnalyticsProvider[];
|
|
571
|
+
defaultProvider?: string;
|
|
572
|
+
eventMirror?: AnalyticsEventMirrorConfig;
|
|
573
|
+
};
|
|
574
|
+
/**
|
|
575
|
+
* Code-defined outbound DESTINATIONS (Phase 3). Each is a
|
|
576
|
+
* `defineDestination()` delivery-time transform keyed by its `meta.id`, which
|
|
577
|
+
* the delivery task resolves by `webhook_endpoints.kind`. They are MERGED with
|
|
578
|
+
* the env-enabled presets ({@link destinationsFromEnv}): a consumer
|
|
579
|
+
* destination WINS over a preset of the same id (so you can override the
|
|
580
|
+
* shipped `posthog`/`segment`/`slack` shapes). The `webhook` + `posthog`
|
|
581
|
+
* presets are always present, so the no-regression signed-POST path can never
|
|
582
|
+
* be turned off here. Installed as the process registry the self-booting
|
|
583
|
+
* delivery task reads — and `createHogsendClient` runs in BOTH the API and
|
|
584
|
+
* worker, so it is wired in both. Defaults to none (presets only).
|
|
585
|
+
*/
|
|
586
|
+
destinations?: DefinedDestination[];
|
|
587
|
+
/**
|
|
588
|
+
* Code-defined inbound CONNECTORS (the unified umbrella). Each is a
|
|
589
|
+
* `defineConnector()` of any transport. MERGED with `connectorsFromEnv` env
|
|
590
|
+
* presets (consumer LAST ⇒ wins on id collision, mirroring destinations). The
|
|
591
|
+
* legacy `webhookSources` array is folded in here as `transport:"webhook"`
|
|
592
|
+
* connectors. Defaults to none.
|
|
593
|
+
*/
|
|
594
|
+
connectors?: DefinedConnector[];
|
|
595
|
+
/**
|
|
596
|
+
* Connector OUTBOUND ACTIONS (e.g. `discordActions` from `@hogsend/plugin-discord`)
|
|
597
|
+
* — journey-callable imperative actions registered into the
|
|
598
|
+
* {@link ConnectorActionRegistry} and invoked via the standalone
|
|
599
|
+
* `sendConnectorAction()`. Socket-free; independent of any inbound gateway
|
|
600
|
+
* runtime. Defaults to none.
|
|
601
|
+
*/
|
|
602
|
+
connectorActions?: DefinedConnectorAction[];
|
|
603
|
+
/**
|
|
604
|
+
* @deprecated pass `connectors` instead. Back-compat array of
|
|
605
|
+
* `defineWebhookSource()` sources; converted to webhook-transport connectors.
|
|
606
|
+
* Still also accepted by `createApp({ webhookSources })`.
|
|
607
|
+
*/
|
|
608
|
+
webhookSources?: DefinedWebhookSource[];
|
|
609
|
+
/**
|
|
610
|
+
* Code-defined CONTACT SOURCES (`defineContactSource()`) — Clay/Attio/generic
|
|
611
|
+
* webhook origins of cold "prospects". Each is lifted onto the webhook-source
|
|
612
|
+
* umbrella (served at `POST /v1/webhooks/:sourceId`, provenance-stamped from
|
|
613
|
+
* `meta.id`) AND registered in the {@link ContactSourceRegistry} so the engine
|
|
614
|
+
* can classify sourced contacts + resolve their cold posture / write-back.
|
|
615
|
+
* Wire in BOTH `index.ts` and `worker.ts`. Defaults to none.
|
|
616
|
+
*/
|
|
617
|
+
contactSources?: DefinedContactSource[];
|
|
618
|
+
/**
|
|
619
|
+
* Auto-register the shipped webhook-source PRESETS (Clerk, Supabase, Stripe,
|
|
620
|
+
* Segment) for every preset whose env secret is configured (gated further by
|
|
621
|
+
* `ENABLED_WEBHOOK_PRESETS`). Set `false` to suppress env presets entirely.
|
|
622
|
+
* Default `true`. (Mirrors — and is also honored from — the deprecated
|
|
623
|
+
* `createApp({ enablePresets })` flag, which strips preset ids back out of the
|
|
624
|
+
* registry when set there.)
|
|
625
|
+
*/
|
|
626
|
+
enablePresets?: boolean;
|
|
627
|
+
/**
|
|
628
|
+
* Comma-separated ids (or `*`) controlling which journeys load. Defaults to
|
|
629
|
+
* `env.ENABLED_JOURNEYS`.
|
|
630
|
+
*/
|
|
631
|
+
enabledJourneys?: string;
|
|
632
|
+
/**
|
|
633
|
+
* Comma-separated ids (or `*`) controlling which buckets load. Defaults to
|
|
634
|
+
* `env.ENABLED_BUCKETS`.
|
|
635
|
+
*/
|
|
636
|
+
enabledBuckets?: string;
|
|
637
|
+
/**
|
|
638
|
+
* Comma-separated ids (or `*`) controlling which lists load. Defaults to
|
|
639
|
+
* `env.ENABLED_LISTS`.
|
|
640
|
+
*/
|
|
641
|
+
enabledLists?: string;
|
|
642
|
+
/**
|
|
643
|
+
* The client repo's migration journal for the `schema.client` health block.
|
|
644
|
+
* Defaults to `{ entries: [] }` (empty client track ⇒ trivially in sync).
|
|
645
|
+
*/
|
|
646
|
+
clientJournal?: JournalShape;
|
|
647
|
+
/**
|
|
648
|
+
* Declarative scheduling + delivery defaults.
|
|
649
|
+
*
|
|
650
|
+
* - `timezone` — global fallback IANA tz (e.g. "UTC"), the terminal step of
|
|
651
|
+
* the per-user tz resolution chain.
|
|
652
|
+
* - `sendWindow` — quiet-hours window ("HH:mm".."HH:mm") auto-applied by
|
|
653
|
+
* `ctx.when` so scheduled instants land inside the window. Enforced ONLY at
|
|
654
|
+
* the scheduling layer; immediate transactional sends bypass it.
|
|
655
|
+
* - `frequencyCap` — per-recipient send cap enforced in the mailer choke
|
|
656
|
+
* point. Opt-in; "transactional" is exempt by default.
|
|
657
|
+
*/
|
|
658
|
+
defaults?: {
|
|
659
|
+
timezone?: TimeZone;
|
|
660
|
+
sendWindow?: SendWindow;
|
|
661
|
+
frequencyCap?: FrequencyCapConfig;
|
|
662
|
+
};
|
|
663
|
+
/**
|
|
664
|
+
* Genuinely advanced / test-only seams. You probably don't need these —
|
|
665
|
+
* prefer the first-class `email` / `analytics` args above.
|
|
666
|
+
* `mailer` replaces the engine-built {@link EmailService} wholesale (used by
|
|
667
|
+
* tests to inject a mock); `auth`, `hatchet`, and `db` swap their respective
|
|
668
|
+
* infrastructure singletons.
|
|
669
|
+
*/
|
|
670
|
+
overrides?: {
|
|
671
|
+
mailer?: EmailService;
|
|
672
|
+
auth?: Auth;
|
|
673
|
+
hatchet?: HatchetClient;
|
|
674
|
+
db?: Database;
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
export declare function createHogsendClient(opts?: HogsendClientOptions): HogsendClient;
|
|
678
|
+
//# sourceMappingURL=container.d.ts.map
|