@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,301 @@
|
|
|
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
|
+
import '@aglyn/shared-util-fbserver';
|
|
18
|
+
import { type BeaconCheck } from '@aglyn/aglyn/server';
|
|
19
|
+
export interface ClientErrorEvent {
|
|
20
|
+
kind: string;
|
|
21
|
+
message: string;
|
|
22
|
+
stack?: string;
|
|
23
|
+
source?: string;
|
|
24
|
+
line?: number;
|
|
25
|
+
url?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The events in a posted payload, clamped and capped. Anything malformed is
|
|
29
|
+
* simply dropped — this endpoint never argues with a browser — and so is an
|
|
30
|
+
* error none of our code threw (see {@link isForeignOnlyStack}).
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseClientErrorEvents(payload: unknown): ClientErrorEvent[];
|
|
33
|
+
/** The log the beacon writes; the alert policy and any triage query key on it. */
|
|
34
|
+
export declare const CLIENT_ERROR_LOG_ID = "client-errors";
|
|
35
|
+
/**
|
|
36
|
+
* The admin credential and project the beacon writes under.
|
|
37
|
+
*
|
|
38
|
+
* Extracted (AGL-1923) so the heartbeat below mints its token through the
|
|
39
|
+
* SAME path the reporter does. That sharing is the whole value of the
|
|
40
|
+
* heartbeat: the failures it exists to catch — an expired service-account
|
|
41
|
+
* key, a revoked `logging.logEntries.create`, an exhausted Logging quota —
|
|
42
|
+
* are environmental, and a heartbeat that acquired its credential some other
|
|
43
|
+
* way could report healthy while every real report was being dropped.
|
|
44
|
+
*
|
|
45
|
+
* Returns null when either half is missing; the caller decides what that
|
|
46
|
+
* means (the reporter drops the batch, the heartbeat reports degraded).
|
|
47
|
+
*
|
|
48
|
+
* EXPORTED for the Vercel log-drain receiver (AGL-1921, third arm), which
|
|
49
|
+
* writes to `vercel-runtime` through this same credential for the same
|
|
50
|
+
* reason the heartbeat does: the failures that would silence the drain are
|
|
51
|
+
* the environmental ones AGL-1923's heartbeat already probes, and it probes
|
|
52
|
+
* them through exactly this path. A receiver that minted its own token would
|
|
53
|
+
* need its own dead-man's switch.
|
|
54
|
+
*/
|
|
55
|
+
export declare function beaconLoggingTarget(): Promise<{
|
|
56
|
+
token: string;
|
|
57
|
+
projectId: string;
|
|
58
|
+
} | null>;
|
|
59
|
+
/** The credential, plus WHY there isn't one when there isn't. */
|
|
60
|
+
export interface BeaconTargetResolution {
|
|
61
|
+
target: {
|
|
62
|
+
token: string;
|
|
63
|
+
projectId: string;
|
|
64
|
+
} | null;
|
|
65
|
+
/** Set only when `target` is null. */
|
|
66
|
+
code?: 'no-credential' | 'credential-unavailable';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The same resolution, saying which of two very different things went wrong
|
|
70
|
+
* (AGL-2713).
|
|
71
|
+
*
|
|
72
|
+
* `no-credential` used to cover both, and the collapse is what made
|
|
73
|
+
* `/api/health/error-beacon` cry wolf: one of the two is permanent and one is
|
|
74
|
+
* a cold lambda's first outbound connection.
|
|
75
|
+
*
|
|
76
|
+
* - **`no-credential`** — there is no admin app, or it has no project, or it
|
|
77
|
+
* has no credential object. `initializeApp` runs at module load and is
|
|
78
|
+
* guarded on `FIREBASE_PRIVATE_KEY` + `FIREBASE_CLIENT_EMAIL` +
|
|
79
|
+
* `NEXT_PUBLIC_FIREBASE_PROJECT_ID`, so this is a STATIC fact about the
|
|
80
|
+
* deployment's environment: it cannot heal on the next request, and every
|
|
81
|
+
* browser error is being dropped for as long as it holds. Red immediately —
|
|
82
|
+
* which is exactly what the remedy text on the staff board already says
|
|
83
|
+
* (`no-credential` is the deployment `FIREBASE_*` env).
|
|
84
|
+
* - **`credential-unavailable`** — the app and the certificate are both there
|
|
85
|
+
* and `getAccessToken()` did not produce a token on THIS attempt. That is a
|
|
86
|
+
* JWT-bearer exchange against `oauth2.googleapis.com`, and on a cold
|
|
87
|
+
* instance it is the first outbound TLS handshake the sandbox has ever made.
|
|
88
|
+
* Nothing was decided, so nothing about the beacon has been established.
|
|
89
|
+
*/
|
|
90
|
+
export declare function resolveBeaconLoggingTarget(): Promise<BeaconTargetResolution>;
|
|
91
|
+
/**
|
|
92
|
+
* Forwards events under the admin service account — via Cloud LOGGING, not
|
|
93
|
+
* the Error Reporting `events:report` API, and the transport is the point:
|
|
94
|
+
* a log entry whose payload carries the `ReportedErrorEvent` `@type` is
|
|
95
|
+
* ingested by Error Reporting automatically (grouping, the Error Reporting
|
|
96
|
+
* console, version tracking), while ALSO being a real log entry that a
|
|
97
|
+
* Cloud Monitoring log-match alert policy can page on — `events:report`
|
|
98
|
+
* produces no log entry and nothing standard to alert from. One batched
|
|
99
|
+
* write per request instead of one call per event is the bonus.
|
|
100
|
+
*
|
|
101
|
+
* Returns how many events were written; failures are logged (one line) and
|
|
102
|
+
* swallowed.
|
|
103
|
+
*/
|
|
104
|
+
export declare function reportClientErrors(events: readonly ClientErrorEvent[], options: {
|
|
105
|
+
service: string;
|
|
106
|
+
}): Promise<number>;
|
|
107
|
+
/**
|
|
108
|
+
* The log the SERVER half writes to (AGL-1921).
|
|
109
|
+
*
|
|
110
|
+
* DELIBERATELY NOT `client-errors`. The `Client error beacon` policy is a
|
|
111
|
+
* log-match on that log id, and a server 5xx is a different incident with a
|
|
112
|
+
* different first move — a browser error is one visitor's broken render, a
|
|
113
|
+
* 500 rate is every visitor's. Merging the streams would make the existing
|
|
114
|
+
* policy fire for both and force triage to start by asking which it was.
|
|
115
|
+
* A sibling log id also lets the counter this whole issue is about key on
|
|
116
|
+
* server errors ALONE.
|
|
117
|
+
*/
|
|
118
|
+
export declare const SERVER_ERROR_LOG_ID = "server-errors";
|
|
119
|
+
/**
|
|
120
|
+
* One server-side error, as `onRequestError` sees it.
|
|
121
|
+
*
|
|
122
|
+
* `route` is the route PATTERN (`/[host]/[scheme]/[[...slug]]`), never the resolved
|
|
123
|
+
* path: the resolved path carries org slugs, document ids and whatever a
|
|
124
|
+
* visitor typed into a URL, and this payload leaves our origin for a Google
|
|
125
|
+
* log. The pattern is what you group and alert on anyway.
|
|
126
|
+
*/
|
|
127
|
+
export interface ServerErrorEvent {
|
|
128
|
+
message: string;
|
|
129
|
+
stack?: string;
|
|
130
|
+
route?: string;
|
|
131
|
+
method?: string;
|
|
132
|
+
routeType?: string;
|
|
133
|
+
digest?: string;
|
|
134
|
+
}
|
|
135
|
+
/** What happened to one `reportServerError` call, for tests and callers. */
|
|
136
|
+
export type ServerErrorOutcome = 'written' | 'suppressed' | 'dropped';
|
|
137
|
+
/**
|
|
138
|
+
* Forwards ONE server-side error to Cloud Logging under the admin credential.
|
|
139
|
+
*
|
|
140
|
+
* This is AGL-1921's fallback arm, and it is a fallback on purpose: it cannot
|
|
141
|
+
* see an error that kills the process before the handler runs, nor a
|
|
142
|
+
* platform-level 5xx that never reaches our code at all. A Vercel log drain
|
|
143
|
+
* would see both. What this does buy is the case that matters most and is
|
|
144
|
+
* most likely — our own route handlers and renders throwing — reported
|
|
145
|
+
* through a transport that already works, on an account we already pay for.
|
|
146
|
+
* `docs/UPTIME_AND_SLA.md` carries the blind spots in writing, because
|
|
147
|
+
* partial visibility whose gaps are documented beats none.
|
|
148
|
+
*
|
|
149
|
+
* It shares `beaconLoggingTarget` with the client reporter deliberately: that
|
|
150
|
+
* makes AGL-1923's heartbeat a dead-man's switch for THIS path too. The
|
|
151
|
+
* failures that would silence server-error reporting — expired key, revoked
|
|
152
|
+
* `logging.logEntries.create`, exhausted quota — are the same environmental
|
|
153
|
+
* ones the heartbeat already probes, and it probes them through this exact
|
|
154
|
+
* credential.
|
|
155
|
+
*
|
|
156
|
+
* Fail-soft and never throws: this runs inside `onRequestError`, so throwing
|
|
157
|
+
* here would turn an observed error into a second one during an incident.
|
|
158
|
+
*/
|
|
159
|
+
export declare function reportServerError(event: ServerErrorEvent, options: {
|
|
160
|
+
service: string;
|
|
161
|
+
}): Promise<ServerErrorOutcome>;
|
|
162
|
+
/**
|
|
163
|
+
* The log the beacon's heartbeat is written to (AGL-1923).
|
|
164
|
+
*
|
|
165
|
+
* DELIBERATELY NOT `client-errors`. The `Client error beacon` alert policy is
|
|
166
|
+
* a log-match on `logName="…/client-errors" AND severity>=ERROR`, so a
|
|
167
|
+
* heartbeat written there would page the on-call owner on every probe — building the
|
|
168
|
+
* alert-fatigue mechanism the heartbeat exists to protect against. A separate
|
|
169
|
+
* log id at INFO keeps the two streams from ever being confused, and keeps
|
|
170
|
+
* the payload out of Error Reporting (which ingests on the
|
|
171
|
+
* `ReportedErrorEvent` `@type`, absent here on purpose).
|
|
172
|
+
*/
|
|
173
|
+
export declare const BEACON_HEARTBEAT_LOG_ID = "client-error-beacon-heartbeat";
|
|
174
|
+
/** What a heartbeat attempt proved, for the health verdict to reduce. */
|
|
175
|
+
export interface BeaconHeartbeatResult {
|
|
176
|
+
/** Did the entry actually reach Cloud Logging? */
|
|
177
|
+
ok: boolean;
|
|
178
|
+
/** A stable code on failure — never a raw error message. */
|
|
179
|
+
code?: string;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Write one heartbeat entry through the beacon's own transport (AGL-1923).
|
|
183
|
+
*
|
|
184
|
+
* ## Why this exists
|
|
185
|
+
*
|
|
186
|
+
* `reportClientErrors` is fail-soft by design and must stay that way — it may
|
|
187
|
+
* never turn an observed error into a served one. But every one of its
|
|
188
|
+
* failure paths ends in a `console.warn` to the Vercel runtime log, which
|
|
189
|
+
* retains about an hour and drains nowhere (AGL-1799). So the beacon can fail
|
|
190
|
+
* completely and the only readings anyone has are "Error Reporting shows zero
|
|
191
|
+
* errors" and "the log-match policy is silent" — which are exactly the
|
|
192
|
+
* readings a clean launch produces. **A dead beacon is indistinguishable from
|
|
193
|
+
* zero errors.**
|
|
194
|
+
*
|
|
195
|
+
* A log-match policy can only ever report presence. The fix is a signal whose
|
|
196
|
+
* ABSENCE is detectable, and the cheapest one that needs no new vendor is a
|
|
197
|
+
* write that a health endpoint can grade synchronously: this returns whether
|
|
198
|
+
* the write landed, `/api/health/error-beacon` turns that into the 200/503
|
|
199
|
+
* contract the sibling health checks already speak, and the existing uptime
|
|
200
|
+
* check + alert + email path becomes the listener. The uptime probe is what
|
|
201
|
+
* winds the dead-man's switch, so there is no cron to forget.
|
|
202
|
+
*
|
|
203
|
+
* ## What it can and cannot prove
|
|
204
|
+
*
|
|
205
|
+
* It proves the credential mints, the IAM grant still covers
|
|
206
|
+
* `logging.logEntries.create`, the Logging API answers, and the quota is not
|
|
207
|
+
* exhausted — the whole environmental failure class AGL-1923 names. It does
|
|
208
|
+
* NOT prove a browser can reach `/api/errors`, and it does not prove the
|
|
209
|
+
* payload shape Error Reporting ingests on, because it deliberately does not
|
|
210
|
+
* write that shape.
|
|
211
|
+
*
|
|
212
|
+
* ## Clearing
|
|
213
|
+
*
|
|
214
|
+
* The condition it raises is an EVENT, not a state: the next successful write
|
|
215
|
+
* clears it, within one probe TTL. Nothing here can latch (AGL-1843).
|
|
216
|
+
*
|
|
217
|
+
* Never throws. A heartbeat that could 500 a health endpoint would be a
|
|
218
|
+
* monitoring probe that causes the outage it reports.
|
|
219
|
+
*/
|
|
220
|
+
export declare function writeBeaconHeartbeat(options: {
|
|
221
|
+
service: string;
|
|
222
|
+
}): Promise<BeaconHeartbeatResult>;
|
|
223
|
+
/**
|
|
224
|
+
* How long the probe waits before its second attempt (AGL-2713).
|
|
225
|
+
*
|
|
226
|
+
* Long enough for a JWT-bearer exchange that lost its first connection to get
|
|
227
|
+
* another one, short enough that it is invisible next to a probe already
|
|
228
|
+
* budgeted at 4s for the Logging write. It is a delay, not a backoff schedule:
|
|
229
|
+
* a second attempt either establishes something or it does not, and a third
|
|
230
|
+
* would only spend a public endpoint's time proving the same point.
|
|
231
|
+
*/
|
|
232
|
+
export declare const BEACON_HEARTBEAT_RETRY_DELAY_MS = 250;
|
|
233
|
+
/**
|
|
234
|
+
* How long a missed heartbeat is forgiven after the last one that landed.
|
|
235
|
+
*
|
|
236
|
+
* One monitor interval. The uptime workflow reads this door every 15 minutes,
|
|
237
|
+
* so a grace of exactly that means the FIRST probe after a miss can be
|
|
238
|
+
* forgiven and the second cannot — "tolerate a single miss, red on a
|
|
239
|
+
* sustained one", stated in the only unit the reader actually samples in.
|
|
240
|
+
*
|
|
241
|
+
* The bound this puts on a real outage: the marker is refreshed by every
|
|
242
|
+
* successful probe, and this endpoint is polled every 5 minutes, so the last
|
|
243
|
+
* landing is at most one probe TTL old when a sustained failure starts. Worst
|
|
244
|
+
* case the door reds 20 minutes later than it does today, and the 15-minute
|
|
245
|
+
* workflow sees it on its next run.
|
|
246
|
+
*/
|
|
247
|
+
export declare const BEACON_HEARTBEAT_GRACE_MS: number;
|
|
248
|
+
/** Injectable clock, sleep, writer and store, so a spec can drive every branch. */
|
|
249
|
+
export interface BeaconHeartbeatProbeOptions {
|
|
250
|
+
service: string;
|
|
251
|
+
now?: () => number;
|
|
252
|
+
sleep?: (ms: number) => Promise<void>;
|
|
253
|
+
firestore?: any;
|
|
254
|
+
graceMs?: number;
|
|
255
|
+
retryDelayMs?: number;
|
|
256
|
+
/**
|
|
257
|
+
* The heartbeat writer. Defaults to the real one, and exists as a seam
|
|
258
|
+
* because the belt below catches a contract `writeBeaconHeartbeat` is
|
|
259
|
+
* documented never to break — a branch that is otherwise unreachable, and
|
|
260
|
+
* therefore one nobody has ever watched work.
|
|
261
|
+
*/
|
|
262
|
+
write?: (options: {
|
|
263
|
+
service: string;
|
|
264
|
+
}) => Promise<BeaconHeartbeatResult>;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* One heartbeat probe, graded — the whole of what both doors do (AGL-2713).
|
|
268
|
+
*
|
|
269
|
+
* ## Why this is one function and not two copies
|
|
270
|
+
*
|
|
271
|
+
* `apps/console` and `apps/tenant` each own a copy of
|
|
272
|
+
* `/api/health/error-beacon`, and they must: the deployments carry different
|
|
273
|
+
* admin credentials, so a console heartbeat proves nothing about the tenant
|
|
274
|
+
* one. What they do NOT need is two copies of the policy. Before this the two
|
|
275
|
+
* route files were byte-identical apart from a service name, which is the
|
|
276
|
+
* arrangement that guarantees a fix reaches one door and not the other. The
|
|
277
|
+
* per-deployment part (which credential, which service name, which memo) stays
|
|
278
|
+
* in the routes; the grading lives here, once.
|
|
279
|
+
*
|
|
280
|
+
* ## The sequence, and why each step is where it is
|
|
281
|
+
*
|
|
282
|
+
* 1. Write. If it lands, record the durable marker and report green — the
|
|
283
|
+
* marker being the evidence a LATER miss will be forgiven with.
|
|
284
|
+
* 2. If it did not land and the code is a refusal — `http-401`/`http-403`
|
|
285
|
+
* (a lost `logging.logEntries.create` grant), `http-429` (quota),
|
|
286
|
+
* `no-credential` (the deployment env) — report red NOW, with no retry and
|
|
287
|
+
* no grace. Those are permanent until a person acts, and re-asking a
|
|
288
|
+
* credential that has been revoked only delays the page.
|
|
289
|
+
* 3. Otherwise nothing was decided, so ask once more after a short delay. On a
|
|
290
|
+
* cold lambda this is the step that actually fixes the measured incident:
|
|
291
|
+
* the memo is per-instance, so a fresh instance has no history to be
|
|
292
|
+
* forgiving WITH, and the only tolerance available inside the request is
|
|
293
|
+
* another attempt.
|
|
294
|
+
* 4. If the second attempt misses too, forgive only against the durable
|
|
295
|
+
* marker — see {@link beaconHealth}, which will not forgive without proof.
|
|
296
|
+
*
|
|
297
|
+
* `attempts` and `ms` ride in the body on every outcome, including green ones,
|
|
298
|
+
* because a retry that is quietly always needed is a credential on its way out
|
|
299
|
+
* and a door that hid it would be back where it started.
|
|
300
|
+
*/
|
|
301
|
+
export declare function beaconHeartbeatProbe(options: BeaconHeartbeatProbeOptions): Promise<BeaconCheck>;
|