@aglyn/tenant-data-admin 1.0.0-beta.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +7 -0
- package/jest.integration.config.d.ts +39 -0
- package/jest.integration.setup.d.ts +17 -0
- package/package.json +51 -0
- package/src/index.d.ts +17 -0
- package/src/index.js +18 -0
- package/src/index.js.map +1 -0
- package/src/lib/render-cache.d.ts +184 -0
- package/src/lib/render-cache.js +198 -0
- package/src/lib/render-cache.js.map +1 -0
- package/src/lib/server/account-addresses.d.ts +160 -0
- package/src/lib/server/account-addresses.js +311 -0
- package/src/lib/server/account-addresses.js.map +1 -0
- package/src/lib/server/account-emails.d.ts +219 -0
- package/src/lib/server/account-emails.js +640 -0
- package/src/lib/server/account-emails.js.map +1 -0
- package/src/lib/server/admin-audit.d.ts +180 -0
- package/src/lib/server/admin-audit.js +233 -0
- package/src/lib/server/admin-audit.js.map +1 -0
- package/src/lib/server/analytics-retention.d.ts +63 -0
- package/src/lib/server/analytics-retention.js +66 -0
- package/src/lib/server/analytics-retention.js.map +1 -0
- package/src/lib/server/api-http.d.ts +159 -0
- package/src/lib/server/api-http.js +230 -0
- package/src/lib/server/api-http.js.map +1 -0
- package/src/lib/server/api-keys.d.ts +117 -0
- package/src/lib/server/api-keys.js +298 -0
- package/src/lib/server/api-keys.js.map +1 -0
- package/src/lib/server/auth-handoff.d.ts +165 -0
- package/src/lib/server/auth-handoff.js +482 -0
- package/src/lib/server/auth-handoff.js.map +1 -0
- package/src/lib/server/auth-pools.d.ts +246 -0
- package/src/lib/server/auth-pools.js +551 -0
- package/src/lib/server/auth-pools.js.map +1 -0
- package/src/lib/server/billing-addons.d.ts +171 -0
- package/src/lib/server/billing-addons.js +277 -0
- package/src/lib/server/billing-addons.js.map +1 -0
- package/src/lib/server/campaign-attribution-store.d.ts +55 -0
- package/src/lib/server/campaign-attribution-store.js +95 -0
- package/src/lib/server/campaign-attribution-store.js.map +1 -0
- package/src/lib/server/campaign-conversion-attribution.d.ts +205 -0
- package/src/lib/server/campaign-conversion-attribution.js +279 -0
- package/src/lib/server/campaign-conversion-attribution.js.map +1 -0
- package/src/lib/server/client-error-report.d.ts +301 -0
- package/src/lib/server/client-error-report.js +755 -0
- package/src/lib/server/client-error-report.js.map +1 -0
- package/src/lib/server/connect-account-status.d.ts +74 -0
- package/src/lib/server/connect-account-status.js +94 -0
- package/src/lib/server/connect-account-status.js.map +1 -0
- package/src/lib/server/connect-payout-failure.d.ts +103 -0
- package/src/lib/server/connect-payout-failure.js +127 -0
- package/src/lib/server/connect-payout-failure.js.map +1 -0
- package/src/lib/server/console-api-rate-limit.d.ts +81 -0
- package/src/lib/server/console-api-rate-limit.js +111 -0
- package/src/lib/server/console-api-rate-limit.js.map +1 -0
- package/src/lib/server/console-domains.d.ts +326 -0
- package/src/lib/server/console-domains.js +779 -0
- package/src/lib/server/console-domains.js.map +1 -0
- package/src/lib/server/consume-once.d.ts +91 -0
- package/src/lib/server/consume-once.js +96 -0
- package/src/lib/server/consume-once.js.map +1 -0
- package/src/lib/server/contact-company-link.d.ts +85 -0
- package/src/lib/server/contact-company-link.js +105 -0
- package/src/lib/server/contact-company-link.js.map +1 -0
- package/src/lib/server/contact-email-engagement.d.ts +32 -0
- package/src/lib/server/contact-email-engagement.js +145 -0
- package/src/lib/server/contact-email-engagement.js.map +1 -0
- package/src/lib/server/contact-email-index.d.ts +56 -0
- package/src/lib/server/contact-email-index.js +158 -0
- package/src/lib/server/contact-email-index.js.map +1 -0
- package/src/lib/server/contact-lifecycle-floor.d.ts +89 -0
- package/src/lib/server/contact-lifecycle-floor.js +88 -0
- package/src/lib/server/contact-lifecycle-floor.js.map +1 -0
- package/src/lib/server/contact-merge.d.ts +55 -0
- package/src/lib/server/contact-merge.js +279 -0
- package/src/lib/server/contact-merge.js.map +1 -0
- package/src/lib/server/contact-suppression.d.ts +153 -0
- package/src/lib/server/contact-suppression.js +259 -0
- package/src/lib/server/contact-suppression.js.map +1 -0
- package/src/lib/server/crm-booking-activity.d.ts +86 -0
- package/src/lib/server/crm-booking-activity.js +251 -0
- package/src/lib/server/crm-booking-activity.js.map +1 -0
- package/src/lib/server/crm-email-activity.d.ts +112 -0
- package/src/lib/server/crm-email-activity.js +143 -0
- package/src/lib/server/crm-email-activity.js.map +1 -0
- package/src/lib/server/crm-inbound-email.d.ts +145 -0
- package/src/lib/server/crm-inbound-email.js +287 -0
- package/src/lib/server/crm-inbound-email.js.map +1 -0
- package/src/lib/server/crm-next-activity.d.ts +74 -0
- package/src/lib/server/crm-next-activity.js +194 -0
- package/src/lib/server/crm-next-activity.js.map +1 -0
- package/src/lib/server/crm-records.d.ts +144 -0
- package/src/lib/server/crm-records.js +218 -0
- package/src/lib/server/crm-records.js.map +1 -0
- package/src/lib/server/csp-aggregate.d.ts +62 -0
- package/src/lib/server/csp-aggregate.js +276 -0
- package/src/lib/server/csp-aggregate.js.map +1 -0
- package/src/lib/server/data-storage-gate.d.ts +66 -0
- package/src/lib/server/data-storage-gate.js +48 -0
- package/src/lib/server/data-storage-gate.js.map +1 -0
- package/src/lib/server/dataset-live-pages.d.ts +179 -0
- package/src/lib/server/dataset-live-pages.js +421 -0
- package/src/lib/server/dataset-live-pages.js.map +1 -0
- package/src/lib/server/dns-probe.d.ts +53 -0
- package/src/lib/server/dns-probe.js +184 -0
- package/src/lib/server/dns-probe.js.map +1 -0
- package/src/lib/server/document-id.d.ts +29 -0
- package/src/lib/server/document-id.js +100 -0
- package/src/lib/server/document-id.js.map +1 -0
- package/src/lib/server/domain-provider-vercel.d.ts +33 -0
- package/src/lib/server/domain-provider-vercel.js +298 -0
- package/src/lib/server/domain-provider-vercel.js.map +1 -0
- package/src/lib/server/domain-provider-webhook.d.ts +73 -0
- package/src/lib/server/domain-provider-webhook.js +223 -0
- package/src/lib/server/domain-provider-webhook.js.map +1 -0
- package/src/lib/server/domain-provider-wildcard.d.ts +54 -0
- package/src/lib/server/domain-provider-wildcard.js +163 -0
- package/src/lib/server/domain-provider-wildcard.js.map +1 -0
- package/src/lib/server/domain-provider.d.ts +197 -0
- package/src/lib/server/domain-provider.js +221 -0
- package/src/lib/server/domain-provider.js.map +1 -0
- package/src/lib/server/duplicate-activity.d.ts +54 -0
- package/src/lib/server/duplicate-activity.js +67 -0
- package/src/lib/server/duplicate-activity.js.map +1 -0
- package/src/lib/server/duplicate-resource.d.ts +55 -0
- package/src/lib/server/duplicate-resource.js +474 -0
- package/src/lib/server/duplicate-resource.js.map +1 -0
- package/src/lib/server/dynamic-list-materialize.d.ts +153 -0
- package/src/lib/server/dynamic-list-materialize.js +581 -0
- package/src/lib/server/dynamic-list-materialize.js.map +1 -0
- package/src/lib/server/edit-access-authz.d.ts +56 -0
- package/src/lib/server/edit-access-authz.js +107 -0
- package/src/lib/server/edit-access-authz.js.map +1 -0
- package/src/lib/server/edit-access-token.d.ts +72 -0
- package/src/lib/server/edit-access-token.js +116 -0
- package/src/lib/server/edit-access-token.js.map +1 -0
- package/src/lib/server/edit-hint-token.d.ts +83 -0
- package/src/lib/server/edit-hint-token.js +119 -0
- package/src/lib/server/edit-hint-token.js.map +1 -0
- package/src/lib/server/email-delivery-log.d.ts +509 -0
- package/src/lib/server/email-delivery-log.js +1043 -0
- package/src/lib/server/email-delivery-log.js.map +1 -0
- package/src/lib/server/email-flow-gate.d.ts +80 -0
- package/src/lib/server/email-flow-gate.js +153 -0
- package/src/lib/server/email-flow-gate.js.map +1 -0
- package/src/lib/server/email-marketing-gate.d.ts +333 -0
- package/src/lib/server/email-marketing-gate.js +639 -0
- package/src/lib/server/email-marketing-gate.js.map +1 -0
- package/src/lib/server/email-metering.d.ts +293 -0
- package/src/lib/server/email-metering.js +359 -0
- package/src/lib/server/email-metering.js.map +1 -0
- package/src/lib/server/email-revenue-attribution.d.ts +185 -0
- package/src/lib/server/email-revenue-attribution.js +300 -0
- package/src/lib/server/email-revenue-attribution.js.map +1 -0
- package/src/lib/server/email-send-rate.d.ts +232 -0
- package/src/lib/server/email-send-rate.js +417 -0
- package/src/lib/server/email-send-rate.js.map +1 -0
- package/src/lib/server/email-sender-reputation.d.ts +317 -0
- package/src/lib/server/email-sender-reputation.js +464 -0
- package/src/lib/server/email-sender-reputation.js.map +1 -0
- package/src/lib/server/email-suppression.d.ts +490 -0
- package/src/lib/server/email-suppression.js +648 -0
- package/src/lib/server/email-suppression.js.map +1 -0
- package/src/lib/server/email-topic-confirmation.d.ts +150 -0
- package/src/lib/server/email-topic-confirmation.js +272 -0
- package/src/lib/server/email-topic-confirmation.js.map +1 -0
- package/src/lib/server/email-unsubscribe-link.d.ts +174 -0
- package/src/lib/server/email-unsubscribe-link.js +236 -0
- package/src/lib/server/email-unsubscribe-link.js.map +1 -0
- package/src/lib/server/erase-person.d.ts +116 -0
- package/src/lib/server/erase-person.js +272 -0
- package/src/lib/server/erase-person.js.map +1 -0
- package/src/lib/server/erase.d.ts +458 -0
- package/src/lib/server/erase.js +1506 -0
- package/src/lib/server/erase.js.map +1 -0
- package/src/lib/server/firebase-admin.d.ts +71 -0
- package/src/lib/server/firebase-admin.js +343 -0
- package/src/lib/server/firebase-admin.js.map +1 -0
- package/src/lib/server/form-dataset-binding-token.d.ts +35 -0
- package/src/lib/server/form-dataset-binding-token.js +107 -0
- package/src/lib/server/form-dataset-binding-token.js.map +1 -0
- package/src/lib/server/free-workspace-cap.d.ts +201 -0
- package/src/lib/server/free-workspace-cap.js +404 -0
- package/src/lib/server/free-workspace-cap.js.map +1 -0
- package/src/lib/server/ga4-measurement-protocol.d.ts +256 -0
- package/src/lib/server/ga4-measurement-protocol.js +558 -0
- package/src/lib/server/ga4-measurement-protocol.js.map +1 -0
- package/src/lib/server/host-email-tokens.d.ts +47 -0
- package/src/lib/server/host-email-tokens.js +72 -0
- package/src/lib/server/host-email-tokens.js.map +1 -0
- package/src/lib/server/host-memberships.d.ts +54 -0
- package/src/lib/server/host-memberships.js +194 -0
- package/src/lib/server/host-memberships.js.map +1 -0
- package/src/lib/server/host-sending-domain.d.ts +292 -0
- package/src/lib/server/host-sending-domain.js +451 -0
- package/src/lib/server/host-sending-domain.js.map +1 -0
- package/src/lib/server/host-visitor-records.d.ts +150 -0
- package/src/lib/server/host-visitor-records.js +262 -0
- package/src/lib/server/host-visitor-records.js.map +1 -0
- package/src/lib/server/id-token-refusal.d.ts +28 -0
- package/src/lib/server/id-token-refusal.js +111 -0
- package/src/lib/server/id-token-refusal.js.map +1 -0
- package/src/lib/server/legal-acceptance.d.ts +214 -0
- package/src/lib/server/legal-acceptance.js +305 -0
- package/src/lib/server/legal-acceptance.js.map +1 -0
- package/src/lib/server/list-members.d.ts +211 -0
- package/src/lib/server/list-members.js +176 -0
- package/src/lib/server/list-members.js.map +1 -0
- package/src/lib/server/live-page-usage.d.ts +202 -0
- package/src/lib/server/live-page-usage.js +300 -0
- package/src/lib/server/live-page-usage.js.map +1 -0
- package/src/lib/server/lockdown.d.ts +313 -0
- package/src/lib/server/lockdown.js +643 -0
- package/src/lib/server/lockdown.js.map +1 -0
- package/src/lib/server/media-cdn-rate-limit.d.ts +188 -0
- package/src/lib/server/media-cdn-rate-limit.js +204 -0
- package/src/lib/server/media-cdn-rate-limit.js.map +1 -0
- package/src/lib/server/media-delivery.d.ts +267 -0
- package/src/lib/server/media-delivery.js +485 -0
- package/src/lib/server/media-delivery.js.map +1 -0
- package/src/lib/server/media-download-tokens.d.ts +161 -0
- package/src/lib/server/media-download-tokens.js +386 -0
- package/src/lib/server/media-download-tokens.js.map +1 -0
- package/src/lib/server/media-quarantine.d.ts +127 -0
- package/src/lib/server/media-quarantine.js +170 -0
- package/src/lib/server/media-quarantine.js.map +1 -0
- package/src/lib/server/media-signing.d.ts +126 -0
- package/src/lib/server/media-signing.js +159 -0
- package/src/lib/server/media-signing.js.map +1 -0
- package/src/lib/server/media-storage-path.d.ts +96 -0
- package/src/lib/server/media-storage-path.js +111 -0
- package/src/lib/server/media-storage-path.js.map +1 -0
- package/src/lib/server/media-strong-digest.d.ts +85 -0
- package/src/lib/server/media-strong-digest.js +190 -0
- package/src/lib/server/media-strong-digest.js.map +1 -0
- package/src/lib/server/media-tombstone.d.ts +276 -0
- package/src/lib/server/media-tombstone.js +421 -0
- package/src/lib/server/media-tombstone.js.map +1 -0
- package/src/lib/server/media-variants.d.ts +309 -0
- package/src/lib/server/media-variants.js +428 -0
- package/src/lib/server/media-variants.js.map +1 -0
- package/src/lib/server/member-email-aliases.d.ts +180 -0
- package/src/lib/server/member-email-aliases.js +420 -0
- package/src/lib/server/member-email-aliases.js.map +1 -0
- package/src/lib/server/member-photo.d.ts +88 -0
- package/src/lib/server/member-photo.js +185 -0
- package/src/lib/server/member-photo.js.map +1 -0
- package/src/lib/server/membership-recover-throttle.d.ts +211 -0
- package/src/lib/server/membership-recover-throttle.js +231 -0
- package/src/lib/server/membership-recover-throttle.js.map +1 -0
- package/src/lib/server/notifications.d.ts +55 -0
- package/src/lib/server/notifications.js +134 -0
- package/src/lib/server/notifications.js.map +1 -0
- package/src/lib/server/org-billing.d.ts +97 -0
- package/src/lib/server/org-billing.js +236 -0
- package/src/lib/server/org-billing.js.map +1 -0
- package/src/lib/server/organizations.d.ts +837 -0
- package/src/lib/server/organizations.js +1814 -0
- package/src/lib/server/organizations.js.map +1 -0
- package/src/lib/server/password-reset-throttle.d.ts +84 -0
- package/src/lib/server/password-reset-throttle.js +102 -0
- package/src/lib/server/password-reset-throttle.js.map +1 -0
- package/src/lib/server/personal-data-export.d.ts +241 -0
- package/src/lib/server/personal-data-export.js +858 -0
- package/src/lib/server/personal-data-export.js.map +1 -0
- package/src/lib/server/platform-domain-names.d.ts +62 -0
- package/src/lib/server/platform-domain-names.js +197 -0
- package/src/lib/server/platform-domain-names.js.map +1 -0
- package/src/lib/server/platform-marketing-consent.d.ts +133 -0
- package/src/lib/server/platform-marketing-consent.js +209 -0
- package/src/lib/server/platform-marketing-consent.js.map +1 -0
- package/src/lib/server/rate-limit-store.d.ts +702 -0
- package/src/lib/server/rate-limit-store.js +1220 -0
- package/src/lib/server/rate-limit-store.js.map +1 -0
- package/src/lib/server/realm-plugins.d.ts +67 -0
- package/src/lib/server/realm-plugins.js +250 -0
- package/src/lib/server/realm-plugins.js.map +1 -0
- package/src/lib/server/recaptcha-allowlist.d.ts +90 -0
- package/src/lib/server/recaptcha-allowlist.js +409 -0
- package/src/lib/server/recaptcha-allowlist.js.map +1 -0
- package/src/lib/server/release-flags.d.ts +105 -0
- package/src/lib/server/release-flags.js +183 -0
- package/src/lib/server/release-flags.js.map +1 -0
- package/src/lib/server/replay-erasures.d.ts +126 -0
- package/src/lib/server/replay-erasures.js +217 -0
- package/src/lib/server/replay-erasures.js.map +1 -0
- package/src/lib/server/resolve-people.d.ts +66 -0
- package/src/lib/server/resolve-people.js +112 -0
- package/src/lib/server/resolve-people.js.map +1 -0
- package/src/lib/server/safe-equal.d.ts +45 -0
- package/src/lib/server/safe-equal.js +58 -0
- package/src/lib/server/safe-equal.js.map +1 -0
- package/src/lib/server/sending-domain-debt.d.ts +127 -0
- package/src/lib/server/sending-domain-debt.js +268 -0
- package/src/lib/server/sending-domain-debt.js.map +1 -0
- package/src/lib/server/sending-domain-recheck.d.ts +151 -0
- package/src/lib/server/sending-domain-recheck.js +253 -0
- package/src/lib/server/sending-domain-recheck.js.map +1 -0
- package/src/lib/server/sending-domains.d.ts +364 -0
- package/src/lib/server/sending-domains.js +683 -0
- package/src/lib/server/sending-domains.js.map +1 -0
- package/src/lib/server/serve-media-cdn.d.ts +433 -0
- package/src/lib/server/serve-media-cdn.js +1370 -0
- package/src/lib/server/serve-media-cdn.js.map +1 -0
- package/src/lib/server/serve-plugin-fetch.d.ts +61 -0
- package/src/lib/server/serve-plugin-fetch.js +294 -0
- package/src/lib/server/serve-plugin-fetch.js.map +1 -0
- package/src/lib/server/sms-keywords.d.ts +63 -0
- package/src/lib/server/sms-keywords.js +146 -0
- package/src/lib/server/sms-keywords.js.map +1 -0
- package/src/lib/server/sso-break-glass-owners.d.ts +91 -0
- package/src/lib/server/sso-break-glass-owners.js +227 -0
- package/src/lib/server/sso-break-glass-owners.js.map +1 -0
- package/src/lib/server/sso-domain-policy.d.ts +140 -0
- package/src/lib/server/sso-domain-policy.js +239 -0
- package/src/lib/server/sso-domain-policy.js.map +1 -0
- package/src/lib/server/sso-drift-logic.d.ts +106 -0
- package/src/lib/server/sso-drift-logic.js +95 -0
- package/src/lib/server/sso-drift-logic.js.map +1 -0
- package/src/lib/server/sso-enforcement.d.ts +204 -0
- package/src/lib/server/sso-enforcement.js +309 -0
- package/src/lib/server/sso-enforcement.js.map +1 -0
- package/src/lib/server/sso-provisioning.d.ts +320 -0
- package/src/lib/server/sso-provisioning.js +715 -0
- package/src/lib/server/sso-provisioning.js.map +1 -0
- package/src/lib/server/staff-alert-email.d.ts +41 -0
- package/src/lib/server/staff-alert-email.js +63 -0
- package/src/lib/server/staff-alert-email.js.map +1 -0
- package/src/lib/server/stripe-account-mode.d.ts +156 -0
- package/src/lib/server/stripe-account-mode.js +162 -0
- package/src/lib/server/stripe-account-mode.js.map +1 -0
- package/src/lib/server/tenant-write-lockdown.d.ts +131 -0
- package/src/lib/server/tenant-write-lockdown.js +176 -0
- package/src/lib/server/tenant-write-lockdown.js.map +1 -0
- package/src/lib/server/test-firestore.d.ts +45 -0
- package/src/lib/server/test-firestore.js +124 -0
- package/src/lib/server/test-firestore.js.map +1 -0
- package/src/lib/server/token-revocation.d.ts +140 -0
- package/src/lib/server/token-revocation.js +255 -0
- package/src/lib/server/token-revocation.js.map +1 -0
- package/src/lib/server/update-existing.d.ts +32 -0
- package/src/lib/server/update-existing.js +73 -0
- package/src/lib/server/update-existing.js.map +1 -0
- package/src/lib/server/upload-cors-reconcile.d.ts +118 -0
- package/src/lib/server/upload-cors-reconcile.js +234 -0
- package/src/lib/server/upload-cors-reconcile.js.map +1 -0
- package/src/lib/server/upsert-contact.d.ts +262 -0
- package/src/lib/server/upsert-contact.js +546 -0
- package/src/lib/server/upsert-contact.js.map +1 -0
- package/src/lib/server/usage-invoice.d.ts +203 -0
- package/src/lib/server/usage-invoice.js +397 -0
- package/src/lib/server/usage-invoice.js.map +1 -0
- package/src/lib/server/user-profiles.d.ts +151 -0
- package/src/lib/server/user-profiles.js +364 -0
- package/src/lib/server/user-profiles.js.map +1 -0
- package/src/lib/server/vercel-drain-signature.d.ts +30 -0
- package/src/lib/server/vercel-drain-signature.js +61 -0
- package/src/lib/server/vercel-drain-signature.js.map +1 -0
- package/src/lib/server/vercel-log-drain.d.ts +259 -0
- package/src/lib/server/vercel-log-drain.js +479 -0
- package/src/lib/server/vercel-log-drain.js.map +1 -0
- package/src/lib/server/verify-email-cooldown.d.ts +102 -0
- package/src/lib/server/verify-email-cooldown.js +114 -0
- package/src/lib/server/verify-email-cooldown.js.map +1 -0
- package/src/lib/server/visitor-write-rate-limit.d.ts +87 -0
- package/src/lib/server/visitor-write-rate-limit.js +117 -0
- package/src/lib/server/visitor-write-rate-limit.js.map +1 -0
- package/src/lib/server/workspace-domains.d.ts +156 -0
- package/src/lib/server/workspace-domains.js +271 -0
- package/src/lib/server/workspace-domains.js.map +1 -0
- package/src/tenancy.d.ts +115 -0
- package/src/tenancy.js +142 -0
- package/src/tenancy.js.map +1 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* THE PER-SITE SENDING DOMAIN — the claim, and nothing else.
|
|
19
|
+
*
|
|
20
|
+
* Provisioning a site's sending domain is two writes to two vendors and one
|
|
21
|
+
* write of our own. This module owns only the third: the LABEL CLAIM and the
|
|
22
|
+
* record that says a domain has been asked for. It calls no vendor, reads no
|
|
23
|
+
* credential, and is safe for the tenant runtime to import — which matters,
|
|
24
|
+
* because the tenant runtime is where a site first discovers it needs to send.
|
|
25
|
+
*
|
|
26
|
+
* The vendor half lives in the console (`provision-sending-domain.ts`), for
|
|
27
|
+
* the same structural reason `sending-domain-provider.ts` does: the keys that
|
|
28
|
+
* create a Resend domain and write our DNS zone must not be reachable from a
|
|
29
|
+
* process that serves published sites.
|
|
30
|
+
*
|
|
31
|
+
* ## Request here, issue there
|
|
32
|
+
*
|
|
33
|
+
* That split is what makes provisioning ON DEMAND possible at all.
|
|
34
|
+
* {@link requestHostSendingDomain} is a cheap Firestore write with no
|
|
35
|
+
* credential behind it; the console-side sweep picks the claim up and does the
|
|
36
|
+
* vendor work, and the re-check sweep then moves the domain to `verified` on
|
|
37
|
+
* its own.
|
|
38
|
+
*
|
|
39
|
+
* So a site is never blocked waiting on a credential it cannot hold, and the
|
|
40
|
+
* credential is never held by a process that should not have it.
|
|
41
|
+
*
|
|
42
|
+
* ## NOTHING HERE RUNS WITHOUT SOMEBODY ASKING
|
|
43
|
+
*
|
|
44
|
+
* A dedicated subdomain is the one shape in the sending model that draws on a
|
|
45
|
+
* resource we cannot buy our way out of at scale: a slot in the provider's
|
|
46
|
+
* account-wide domain allowance, three records in our own zone, and a
|
|
47
|
+
* permanent place in the re-verification sweep. The shared pool is flat at any
|
|
48
|
+
* number of sites, and a domain the CUSTOMER owns costs our zone nothing at
|
|
49
|
+
* all — so this is the only one that has to be rationed, and the only one a
|
|
50
|
+
* ceiling can bind.
|
|
51
|
+
*
|
|
52
|
+
* It used to be claimed automatically at three moments: site creation, the
|
|
53
|
+
* billing webhook's upgrade transition, and a sweep that walked hosts looking
|
|
54
|
+
* for entitled sites without one. All three made the count grow with paying
|
|
55
|
+
* customers rather than with anybody's decision, and a merchant who never
|
|
56
|
+
* wanted an Aglyn-branded sending name still spent a slot on one.
|
|
57
|
+
*
|
|
58
|
+
* The function is named for a REQUEST rather than for an invariant on purpose.
|
|
59
|
+
* `ensure…` is an invitation to call it defensively — "just make sure it
|
|
60
|
+
* exists" — which is exactly how the three automatic callers came to be, and
|
|
61
|
+
* `requestedBy` cannot be supplied by a caller that has nobody to name. A
|
|
62
|
+
* caller that finds itself inventing a value for it is a caller that should
|
|
63
|
+
* not be claiming.
|
|
64
|
+
*
|
|
65
|
+
* ## The label is pinned, and a rename does not move it
|
|
66
|
+
*
|
|
67
|
+
* `hosts/{hostId}.sendingLabel` is written ONCE and never rewritten. A site's
|
|
68
|
+
* `subdomain` is mutable — the rename route rewrites that field in place — and
|
|
69
|
+
* a sending domain derived from it would move every time a merchant renamed
|
|
70
|
+
* their site, discarding the accumulated sending reputation that is the whole
|
|
71
|
+
* point of having a domain per tenant, and stranding the return path that mail
|
|
72
|
+
* already in flight will bounce to.
|
|
73
|
+
*
|
|
74
|
+
* The web address follows the slug. The sending identity does not. A merchant
|
|
75
|
+
* who genuinely wants a different sending name gets
|
|
76
|
+
* {@link restartHostSendingDomain}, which says plainly that it starts
|
|
77
|
+
* reputation over — never a silent side effect of renaming.
|
|
78
|
+
*
|
|
79
|
+
* The label is proposed from the site's subdomain AT THE MOMENT OF THE
|
|
80
|
+
* REQUEST, which is the name the merchant is looking at when they ask. It was
|
|
81
|
+
* previously the creation-time slug, because the claim happened at creation
|
|
82
|
+
* and there was no later moment to read; a name derived from what the site is
|
|
83
|
+
* called today is the less surprising of the two, and the pin is what makes it
|
|
84
|
+
* stable from then on either way.
|
|
85
|
+
*/
|
|
86
|
+
import { type SendingDomainRecord } from '@aglyn/shared-util-email';
|
|
87
|
+
/**
|
|
88
|
+
* Whether this org's sites may hold a dedicated domain.
|
|
89
|
+
*
|
|
90
|
+
* One read, and only ever on a CLAIM path — never on a send. A site that does
|
|
91
|
+
* not qualify has a sending identity regardless (the shared pool), so nothing
|
|
92
|
+
* here is on the critical path of a message.
|
|
93
|
+
*
|
|
94
|
+
* The WHOLE org document goes to the gate rather than its `plan` field, and
|
|
95
|
+
* that is what makes a per-org grant real: the entitlement resolves the plan's
|
|
96
|
+
* default and then the org's own overrides, so an account staff have granted
|
|
97
|
+
* one may claim without being moved up a tier — and an account whose
|
|
98
|
+
* subscription has died may not, because `resolveEffectivePlan` reads a dead
|
|
99
|
+
* subscription down to `free`. A single field would have hidden both.
|
|
100
|
+
*
|
|
101
|
+
* Fails closed on a read error, and that is the safe direction: the cost of
|
|
102
|
+
* answering `false` wrongly is a request the merchant makes again, while the
|
|
103
|
+
* cost of answering `true` wrongly is a zone record and a provider slot spent
|
|
104
|
+
* on a site that cannot use them.
|
|
105
|
+
*/
|
|
106
|
+
export declare function orgHoldsDedicatedSendingDomain(orgId: string | null | undefined): Promise<boolean>;
|
|
107
|
+
/**
|
|
108
|
+
* The uniqueness index for pinned mail labels.
|
|
109
|
+
*
|
|
110
|
+
* A root collection with the LABEL as the document id, which is what makes the
|
|
111
|
+
* claim atomic: Firestore's `create` fails when the document exists, so two
|
|
112
|
+
* sites racing for one label produce one winner and one retry rather than two
|
|
113
|
+
* winners. This is the same technique the web-subdomain index uses, kept
|
|
114
|
+
* separate from it on purpose — see `platform-sending-domain.ts` for why the
|
|
115
|
+
* two namespaces do not share a claim.
|
|
116
|
+
*/
|
|
117
|
+
export declare const SENDING_LABELS_COLLECTION = "sendingLabels";
|
|
118
|
+
export interface SendingLabelClaim {
|
|
119
|
+
label: string;
|
|
120
|
+
hostId: string;
|
|
121
|
+
orgId: string;
|
|
122
|
+
domain: string;
|
|
123
|
+
claimedAtMs: number;
|
|
124
|
+
}
|
|
125
|
+
export interface HostSendingDomainResult {
|
|
126
|
+
/** The site's sending domain, or null when none could be provisioned. */
|
|
127
|
+
domain: string | null;
|
|
128
|
+
label: string | null;
|
|
129
|
+
/** True when this call created the claim rather than finding one. */
|
|
130
|
+
created: boolean;
|
|
131
|
+
/** Why nothing could be claimed. Null on success. */
|
|
132
|
+
error: string | null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Claim the sending domain a site has ASKED for, or return the one it has.
|
|
136
|
+
*
|
|
137
|
+
* Idempotent in the way that matters for a two-vendor provisioning flow: it is
|
|
138
|
+
* the FIRST of the three writes, and it is the one that decides the name. Once
|
|
139
|
+
* it has returned a domain, every retry — of this function, of the Resend
|
|
140
|
+
* call, of the DNS write — resolves against the same name. A retry can
|
|
141
|
+
* therefore never produce a second Resend domain or a second record set,
|
|
142
|
+
* because there is no second name for them to be created under.
|
|
143
|
+
*
|
|
144
|
+
* The three writes it makes are ordered so that a crash between any two leaves
|
|
145
|
+
* a state the sweep can finish rather than one it must untangle:
|
|
146
|
+
*
|
|
147
|
+
* 1. Claim the label. Fails closed on a race; nothing else has happened yet.
|
|
148
|
+
* 2. Create the domain record at `requested`. This is what the console sweep
|
|
149
|
+
* looks for, so a crash after this point still gets picked up.
|
|
150
|
+
* 3. Point the host at it. A crash before this leaves an unreferenced record
|
|
151
|
+
* that the sweep will provision and the next call will attach.
|
|
152
|
+
*
|
|
153
|
+
* Step 3 is deliberately last and deliberately non-destructive: a host that
|
|
154
|
+
* already carries a `sendingLabel` returns early at the top and never reaches
|
|
155
|
+
* any of this.
|
|
156
|
+
*/
|
|
157
|
+
export declare function requestHostSendingDomain(options: {
|
|
158
|
+
hostId: string;
|
|
159
|
+
orgId: string;
|
|
160
|
+
/** The site's CURRENT subdomain. Read once, to propose a label. */
|
|
161
|
+
subdomain: string;
|
|
162
|
+
/**
|
|
163
|
+
* WHO ASKED. Required, and there is no default.
|
|
164
|
+
*
|
|
165
|
+
* A dedicated subdomain is a draw on a bounded resource, so the record of
|
|
166
|
+
* who drew it is part of the claim rather than something reconstructed from
|
|
167
|
+
* logs later. `merchant` is somebody with `org.settings` acting on their own
|
|
168
|
+
* workspace; `staff` is a support action taken on their behalf.
|
|
169
|
+
*
|
|
170
|
+
* Its real work is at compile time. A caller that wants to claim
|
|
171
|
+
* defensively — on a plan change, on a sweep, on site creation — has no
|
|
172
|
+
* honest value to put here, and that is the point: the parameter cannot be
|
|
173
|
+
* satisfied by a process, only by a person.
|
|
174
|
+
*/
|
|
175
|
+
requestedBy: 'merchant' | 'staff';
|
|
176
|
+
}): Promise<HostSendingDomainResult>;
|
|
177
|
+
/**
|
|
178
|
+
* Everything provisioned for one site, for a caller that must take it apart.
|
|
179
|
+
*
|
|
180
|
+
* Returned as data rather than acted on, because the acting needs vendor
|
|
181
|
+
* credentials this module must not hold. The console's cleanup path takes this
|
|
182
|
+
* and makes the calls.
|
|
183
|
+
*/
|
|
184
|
+
export interface HostSendingDomainTeardown {
|
|
185
|
+
hostId: string;
|
|
186
|
+
orgId: string | null;
|
|
187
|
+
label: string | null;
|
|
188
|
+
domain: string | null;
|
|
189
|
+
/** The provider's id for the domain object, when one was recorded. */
|
|
190
|
+
providerDomainId: string | null;
|
|
191
|
+
/**
|
|
192
|
+
* The selector the provider signs under, needed to name the DKIM record for
|
|
193
|
+
* deletion. Read from the record rather than assumed: the provider chooses
|
|
194
|
+
* it, and a guessed selector deletes nothing while reporting success — which
|
|
195
|
+
* would leave a live signing key in the zone for a site that no longer
|
|
196
|
+
* exists, ready to be inherited by whoever claims the label next.
|
|
197
|
+
*/
|
|
198
|
+
dkimSelector: string | null;
|
|
199
|
+
/**
|
|
200
|
+
* The provider's tracking host, when this domain had one.
|
|
201
|
+
*
|
|
202
|
+
* Read because it changes WHEN the domain may be released, not just what is
|
|
203
|
+
* deleted: links in mail this domain has already sent point at that host,
|
|
204
|
+
* and deleting the domain object takes it with them. See the retention
|
|
205
|
+
* window in `teardownSendingDomain`.
|
|
206
|
+
*/
|
|
207
|
+
trackingTarget: string | null;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* What a host's deletion has to clean up, read before anything is deleted.
|
|
211
|
+
*
|
|
212
|
+
* Split from the deletion itself so the caller can do the vendor work FIRST
|
|
213
|
+
* and delete our records only once it has succeeded. The other order loses the
|
|
214
|
+
* name of the thing it still has to remove: a zone accumulating records for
|
|
215
|
+
* sites that no longer exist is bad on its own, and a future site reusing the
|
|
216
|
+
* label would inherit a stranger's DKIM key — which is a working signature for
|
|
217
|
+
* a domain somebody else's mail leaves on.
|
|
218
|
+
*/
|
|
219
|
+
export declare function readHostSendingTeardown(hostId: string): Promise<HostSendingDomainTeardown | null>;
|
|
220
|
+
/**
|
|
221
|
+
* Drop our own record of a site's sending domain, once the vendors are clean.
|
|
222
|
+
*
|
|
223
|
+
* Releasing the label LAST is deliberate. The label is what makes the domain
|
|
224
|
+
* findable; while it exists, a half-finished teardown is a thing the sweep can
|
|
225
|
+
* find and finish. Released first, a crash mid-teardown would leave a Resend
|
|
226
|
+
* domain and a set of DNS records that nothing points at and nothing will ever
|
|
227
|
+
* look for again.
|
|
228
|
+
*
|
|
229
|
+
* The release is real rather than a tombstone. Once the DKIM record is gone
|
|
230
|
+
* from the zone and the domain object is gone from the account, a future site
|
|
231
|
+
* claiming the label inherits nothing — no key, no records, no reputation. A
|
|
232
|
+
* permanent reservation would only be needed if teardown were unreliable, and
|
|
233
|
+
* the answer to unreliable teardown is to fix it, not to leak a name for every
|
|
234
|
+
* site ever deleted.
|
|
235
|
+
*/
|
|
236
|
+
export declare function releaseHostSendingDomain(teardown: HostSendingDomainTeardown): Promise<void>;
|
|
237
|
+
/**
|
|
238
|
+
* Give a site a NEW sending domain, abandoning the one it has.
|
|
239
|
+
*
|
|
240
|
+
* The explicit action behind "I want my mail to come from a different name".
|
|
241
|
+
* It exists so that renaming a site can stay free of side effects: a merchant
|
|
242
|
+
* who wants the sending name to follow the rename asks for it here, and is
|
|
243
|
+
* told what it costs.
|
|
244
|
+
*
|
|
245
|
+
* What it costs is the reputation. A sending domain's value is its age and its
|
|
246
|
+
* history with the receiving networks; a new one starts at zero and is treated
|
|
247
|
+
* with more suspicion than the old one, for weeks. That is why this is not
|
|
248
|
+
* what a rename does, and why the caller is expected to have said so out loud
|
|
249
|
+
* before getting here.
|
|
250
|
+
*
|
|
251
|
+
* Returns the teardown for the OLD domain. The caller must complete the vendor
|
|
252
|
+
* cleanup for it, exactly as for a deleted host — the old Resend domain and
|
|
253
|
+
* its zone records are no more welcome to linger here than there.
|
|
254
|
+
*/
|
|
255
|
+
export declare function restartHostSendingDomain(options: {
|
|
256
|
+
hostId: string;
|
|
257
|
+
orgId: string;
|
|
258
|
+
subdomain: string;
|
|
259
|
+
/** Carried through to the new claim. See `requestHostSendingDomain`. */
|
|
260
|
+
requestedBy: 'merchant' | 'staff';
|
|
261
|
+
}): Promise<{
|
|
262
|
+
teardown: HostSendingDomainTeardown | null;
|
|
263
|
+
provisioned: HostSendingDomainResult;
|
|
264
|
+
}>;
|
|
265
|
+
export interface PendingSendingDomain {
|
|
266
|
+
orgId: string;
|
|
267
|
+
record: SendingDomainRecord;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Platform sending domains that still need vendor work, oldest first.
|
|
271
|
+
*
|
|
272
|
+
* A collection-group query over every org's `sendingDomains`, filtered to the
|
|
273
|
+
* ones inside our own mail apex — a customer's own domain is records they
|
|
274
|
+
* publish, and this sweep must never try to write to a zone we do not own.
|
|
275
|
+
*
|
|
276
|
+
* `orderBy` on the creation time, and not merely `limit`. A `limit()` with no
|
|
277
|
+
* `orderBy` returns documents in ID order, which is a stable arbitrary sample
|
|
278
|
+
* rather than a queue: the same handful of domains would be returned on every
|
|
279
|
+
* run and anything sorting after them would never be provisioned at all.
|
|
280
|
+
*
|
|
281
|
+
* Ordering on a field means a document missing that field is dropped by the
|
|
282
|
+
* query. That is acceptable here and nowhere else in this file, because
|
|
283
|
+
* `requestHostSendingDomain` is the only writer and it always sets
|
|
284
|
+
* `createdAtMs`.
|
|
285
|
+
*/
|
|
286
|
+
export declare function listPendingSendingDomains(limit?: number): Promise<PendingSendingDomain[]>;
|
|
287
|
+
/**
|
|
288
|
+
* The label a platform domain belongs to, for a caller assembling zone record
|
|
289
|
+
* names. Re-derived rather than read off the host, so a cleanup can name the
|
|
290
|
+
* records for a host document that is already gone.
|
|
291
|
+
*/
|
|
292
|
+
export declare function sendingDomainLabel(domain: string): string;
|