@cosmicdrift/kumiko-samples 0.369.0 → 0.371.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/package.json +1 -1
- package/packages/bundled-features/package.json +21 -11
- package/packages/bundled-features/src/account-security/README.md +31 -0
- package/packages/bundled-features/src/account-security/changes.json +8 -0
- package/packages/bundled-features/src/account-security/constants.ts +6 -0
- package/packages/bundled-features/src/account-security/feature.ts +100 -0
- package/packages/bundled-features/src/account-security/i18n.ts +9 -0
- package/packages/bundled-features/src/account-security/index.ts +13 -0
- package/packages/bundled-features/src/admin-shell/feature.ts +4 -4
- package/packages/bundled-features/src/admin-shell/index.ts +4 -4
- package/packages/bundled-features/src/admin-shell/overview-allowlist.ts +3 -3
- package/packages/bundled-features/src/admin-shell/overview-panels.ts +3 -3
- package/packages/bundled-features/src/admin-shell/web/client-plugin.tsx +2 -2
- package/packages/bundled-features/src/admin-shell/web/i18n.ts +1 -1
- package/packages/bundled-features/src/admin-shell/web/index.ts +1 -1
- package/packages/bundled-features/src/agent-tools/agent-doc-lint.ts +1 -1
- package/packages/bundled-features/src/agent-tools/agent-manifest.ts +2 -2
- package/packages/bundled-features/src/agent-tools/feature.ts +1 -1
- package/packages/bundled-features/src/agent-tools/index.ts +8 -8
- package/packages/bundled-features/src/agent-tools/manifest-deny-qns.ts +1 -1
- package/packages/bundled-features/src/agent-tools/tool-catalog.ts +3 -3
- package/packages/bundled-features/src/agent-tools/tool-dispatch.ts +2 -2
- package/packages/bundled-features/src/audit/feature.ts +6 -6
- package/packages/bundled-features/src/audit/handlers/details.query.ts +3 -3
- package/packages/bundled-features/src/audit/handlers/list.query.ts +3 -3
- package/packages/bundled-features/src/audit/handlers/resolve-audit-tenant.ts +1 -1
- package/packages/bundled-features/src/audit/index.ts +3 -3
- package/packages/bundled-features/src/audit/run-escape-hatch-retention.ts +4 -4
- package/packages/bundled-features/src/audit/web/client-plugin.tsx +2 -2
- package/packages/bundled-features/src/audit/web/i18n.ts +1 -1
- package/packages/bundled-features/src/audit/web/index.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/bootstrap.ts +10 -10
- package/packages/bundled-features/src/auth-email-password/changes.json +6 -0
- package/packages/bundled-features/src/auth-email-password/errors.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/feature.ts +26 -24
- package/packages/bundled-features/src/auth-email-password/handlers/change-password.write.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/handlers/confirm-account-unlock.write.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/handlers/confirm-token-flow.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts +10 -10
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept.write.ts +7 -7
- package/packages/bundled-features/src/auth-email-password/handlers/invite-create.write.ts +11 -11
- package/packages/bundled-features/src/auth-email-password/handlers/invite-info.query.ts +5 -5
- package/packages/bundled-features/src/auth-email-password/handlers/invite-signup-complete.write.ts +11 -11
- package/packages/bundled-features/src/auth-email-password/handlers/login.write.ts +6 -6
- package/packages/bundled-features/src/auth-email-password/handlers/request-account-unlock.write.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/handlers/request-email-verification.write.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/handlers/request-password-reset.write.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/handlers/reset-password.write.ts +6 -6
- package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/signup-confirm.write.ts +7 -7
- package/packages/bundled-features/src/auth-email-password/handlers/signup-request.write.ts +7 -7
- package/packages/bundled-features/src/auth-email-password/handlers/switch-tenant-mfa-gate.write.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/handlers/token-request-handler.ts +5 -5
- package/packages/bundled-features/src/auth-email-password/handlers/verify-email.write.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/index.ts +13 -13
- package/packages/bundled-features/src/auth-email-password/invite-token-store.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/lockout-store.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/magic-link-mail.ts +2 -2
- package/packages/bundled-features/src/auth-email-password/mail-notifications.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/reset-token.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/seeding.ts +6 -6
- package/packages/bundled-features/src/auth-email-password/signed-token.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/signup-activation.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/signup-token-store.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/testing.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/unlock-token.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/verification-token.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-gate.tsx +4 -4
- package/packages/bundled-features/src/auth-email-password/web/client-plugin.ts +3 -3
- package/packages/bundled-features/src/auth-email-password/web/confirm-account-unlock-screen.tsx +2 -2
- package/packages/bundled-features/src/auth-email-password/web/default-topbar-actions.tsx +2 -2
- package/packages/bundled-features/src/auth-email-password/web/forgot-password-screen.tsx +2 -2
- package/packages/bundled-features/src/auth-email-password/web/index.ts +42 -42
- package/packages/bundled-features/src/auth-email-password/web/invite-accept-screen.tsx +4 -4
- package/packages/bundled-features/src/auth-email-password/web/login-screen.tsx +4 -4
- package/packages/bundled-features/src/auth-email-password/web/request-account-unlock-screen.tsx +2 -2
- package/packages/bundled-features/src/auth-email-password/web/reset-password-screen.tsx +3 -3
- package/packages/bundled-features/src/auth-email-password/web/session-bootstrap-error.tsx +2 -2
- package/packages/bundled-features/src/auth-email-password/web/session.tsx +1 -1
- package/packages/bundled-features/src/auth-email-password/web/signup-complete-screen.tsx +4 -4
- package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +3 -3
- package/packages/bundled-features/src/auth-email-password/web/tenant-menu-items.tsx +1 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-switcher.tsx +1 -1
- package/packages/bundled-features/src/auth-email-password/web/use-shell-user.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/web/user-menu.tsx +1 -1
- package/packages/bundled-features/src/auth-email-password/web/verify-email-screen.tsx +2 -2
- package/packages/bundled-features/src/auth-foundation/boot-checks.ts +1 -1
- package/packages/bundled-features/src/auth-foundation/changes.json +14 -0
- package/packages/bundled-features/src/auth-foundation/feature.ts +3 -6
- package/packages/bundled-features/src/auth-foundation/index.ts +3 -4
- package/packages/bundled-features/src/auth-foundation/resolve-anonymous-access.ts +19 -4
- package/packages/bundled-features/src/auth-mfa/changes.json +6 -0
- package/packages/bundled-features/src/auth-mfa/db/queries.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/env.ts +28 -0
- package/packages/bundled-features/src/auth-mfa/errors.ts +2 -2
- package/packages/bundled-features/src/auth-mfa/feature-exports.ts +100 -0
- package/packages/bundled-features/src/auth-mfa/feature.ts +86 -105
- package/packages/bundled-features/src/auth-mfa/handlers/disable.write.ts +4 -4
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +10 -10
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm.write.ts +7 -7
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start-preauth.write.ts +9 -9
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start.write.ts +9 -9
- package/packages/bundled-features/src/auth-mfa/handlers/reencrypt.job.ts +2 -2
- package/packages/bundled-features/src/auth-mfa/handlers/regenerate-recovery.write.ts +5 -5
- package/packages/bundled-features/src/auth-mfa/handlers/status.query.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/verify.write.ts +9 -9
- package/packages/bundled-features/src/auth-mfa/index.ts +16 -11
- package/packages/bundled-features/src/auth-mfa/mfa-challenge-token.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/mfa-code-verifier.ts +2 -2
- package/packages/bundled-features/src/auth-mfa/mfa-preauth-setup-token.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/mfa-status-checker.ts +5 -5
- package/packages/bundled-features/src/auth-mfa/mfa-verify-attempts.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/otpauth-uri.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/recovery-codes.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/screens.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/testing.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/token-secrets.ts +26 -0
- package/packages/bundled-features/src/auth-mfa/verify-factor.ts +5 -5
- package/packages/bundled-features/src/auth-mfa/web/client-plugin.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/web/index.ts +15 -15
- package/packages/bundled-features/src/auth-mfa/web/mfa-client.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-disable-dialog.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-regenerate-recovery-dialog.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-setup-preauth-screen.tsx +2 -2
- package/packages/bundled-features/src/auth-mfa/web/mfa-verify-screen.tsx +2 -2
- package/packages/bundled-features/src/auth-mfa-user-data/changes.json +10 -1
- package/packages/bundled-features/src/auth-mfa-user-data/hooks.ts +2 -2
- package/packages/bundled-features/src/auth-mfa-user-data/index.ts +1 -4
- package/packages/bundled-features/src/billing-foundation/billing-info-query.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/changes.json +14 -0
- package/packages/bundled-features/src/billing-foundation/checkout-core.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/confirmation-mail.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-gate.ts +5 -5
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-text.ts +2 -2
- package/packages/bundled-features/src/billing-foundation/consumer-protection/issue-confirmation.ts +8 -8
- package/packages/bundled-features/src/billing-foundation/consumer-protection/mail-notifications.ts +4 -4
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-consent.ts +7 -7
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-termination.ts +5 -5
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-mail.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-notify.ts +6 -6
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-pages.ts +7 -7
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-record.ts +10 -10
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-request.ts +12 -12
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-texts.ts +2 -2
- package/packages/bundled-features/src/billing-foundation/consumer-protection/withdrawal-period.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/events.ts +2 -2
- package/packages/bundled-features/src/billing-foundation/feature.ts +19 -22
- package/packages/bundled-features/src/billing-foundation/get-subscription-for-tenant.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/handlers/billing-plans.query.ts +4 -4
- package/packages/bundled-features/src/billing-foundation/handlers/create-checkout-session.write.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/handlers/create-portal-session.write.ts +6 -6
- package/packages/bundled-features/src/billing-foundation/handlers/list-subscriptions.query.ts +2 -2
- package/packages/bundled-features/src/billing-foundation/handlers/process-event.write.ts +5 -5
- package/packages/bundled-features/src/billing-foundation/handlers/process-payment-event.write.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/handlers/start-plan-checkout.write.ts +4 -4
- package/packages/bundled-features/src/billing-foundation/handlers/switch-plan.write.ts +5 -5
- package/packages/bundled-features/src/billing-foundation/handlers/sync-subscription.write.ts +4 -4
- package/packages/bundled-features/src/billing-foundation/index.ts +17 -16
- package/packages/bundled-features/src/billing-foundation/plan-catalog.ts +4 -4
- package/packages/bundled-features/src/billing-foundation/projection.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/screens.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/subscription-tier-sync.ts +88 -22
- package/packages/bundled-features/src/billing-foundation/tenant-destroy-hook.ts +4 -4
- package/packages/bundled-features/src/billing-foundation/types.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/validate-options.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/web/billing-plans-panel.tsx +4 -4
- package/packages/bundled-features/src/billing-foundation/web/cancel-contract-dialog.tsx +2 -2
- package/packages/bundled-features/src/billing-foundation/web/checkout-consent-dialog.tsx +2 -2
- package/packages/bundled-features/src/billing-foundation/web/client-plugin.tsx +2 -2
- package/packages/bundled-features/src/billing-foundation/web/index.ts +6 -6
- package/packages/bundled-features/src/billing-foundation/webhook-handler.ts +5 -4
- package/packages/bundled-features/src/cap-counter/book-cap-usage.ts +3 -3
- package/packages/bundled-features/src/cap-counter/calendar-cap-usage-reservation.ts +4 -4
- package/packages/bundled-features/src/cap-counter/cap-reservation.ts +4 -4
- package/packages/bundled-features/src/cap-counter/changes.json +8 -0
- package/packages/bundled-features/src/cap-counter/enforce-cap.ts +2 -2
- package/packages/bundled-features/src/cap-counter/feature.ts +8 -11
- package/packages/bundled-features/src/cap-counter/handlers/get-counter.query.ts +1 -1
- package/packages/bundled-features/src/cap-counter/handlers/increment-rolling.write.ts +2 -2
- package/packages/bundled-features/src/cap-counter/handlers/increment.write.ts +1 -1
- package/packages/bundled-features/src/cap-counter/handlers/mark-soft-warned.write.ts +1 -1
- package/packages/bundled-features/src/cap-counter/index.ts +13 -13
- package/packages/bundled-features/src/cap-counter/stock-cap-guard.ts +1 -1
- package/packages/bundled-features/src/cap-counter/value-cap-guard.ts +2 -2
- package/packages/bundled-features/src/cap-counter/with-cap-enforcement.ts +4 -4
- package/packages/bundled-features/src/cap-overview/feature.ts +8 -8
- package/packages/bundled-features/src/cap-overview/handlers/caps-usage.query.ts +3 -3
- package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +7 -7
- package/packages/bundled-features/src/cap-overview/handlers/tenant-options.query.ts +1 -1
- package/packages/bundled-features/src/cap-overview/index.ts +6 -6
- package/packages/bundled-features/src/cap-overview/screens.ts +2 -2
- package/packages/bundled-features/src/cap-overview/types.ts +1 -1
- package/packages/bundled-features/src/cap-overview/usage-math.ts +1 -1
- package/packages/bundled-features/src/cap-overview/web/cap-cards-panel.tsx +3 -3
- package/packages/bundled-features/src/cap-overview/web/cap-usage-bar.tsx +2 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-cell.tsx +2 -2
- package/packages/bundled-features/src/cap-overview/web/client-plugin.tsx +3 -3
- package/packages/bundled-features/src/cap-overview/web/index.ts +4 -4
- package/packages/bundled-features/src/channel-discord/discord-channel.ts +1 -1
- package/packages/bundled-features/src/channel-discord/feature.ts +1 -1
- package/packages/bundled-features/src/channel-discord/index.ts +2 -2
- package/packages/bundled-features/src/channel-email/changes.json +6 -0
- package/packages/bundled-features/src/channel-email/email-channel.ts +4 -4
- package/packages/bundled-features/src/channel-email/env.ts +28 -0
- package/packages/bundled-features/src/channel-email/feature.ts +8 -4
- package/packages/bundled-features/src/channel-email/index.ts +6 -5
- package/packages/bundled-features/src/channel-email/pii-guard.ts +1 -1
- package/packages/bundled-features/src/channel-email/smtp-transport.ts +1 -1
- package/packages/bundled-features/src/channel-email/types.ts +1 -1
- package/packages/bundled-features/src/channel-in-app/feature.ts +6 -6
- package/packages/bundled-features/src/channel-in-app/handlers/inbox.query.ts +1 -1
- package/packages/bundled-features/src/channel-in-app/handlers/mark-all-read.write.ts +1 -1
- package/packages/bundled-features/src/channel-in-app/handlers/mark-read.write.ts +1 -1
- package/packages/bundled-features/src/channel-in-app/handlers/unread-count.query.ts +1 -1
- package/packages/bundled-features/src/channel-in-app/in-app-channel.ts +2 -2
- package/packages/bundled-features/src/channel-in-app/index.ts +4 -4
- package/packages/bundled-features/src/channel-push/feature.ts +1 -1
- package/packages/bundled-features/src/channel-push/index.ts +3 -3
- package/packages/bundled-features/src/channel-push/push-channel.ts +2 -2
- package/packages/bundled-features/src/channel-slack/feature.ts +1 -1
- package/packages/bundled-features/src/channel-slack/index.ts +2 -2
- package/packages/bundled-features/src/channel-slack/slack-channel.ts +1 -1
- package/packages/bundled-features/src/channel-teams/feature.ts +1 -1
- package/packages/bundled-features/src/channel-teams/index.ts +2 -2
- package/packages/bundled-features/src/channel-teams/teams-channel.ts +1 -1
- package/packages/bundled-features/src/channel-telegram/feature.ts +1 -1
- package/packages/bundled-features/src/channel-telegram/index.ts +2 -2
- package/packages/bundled-features/src/channel-telegram/telegram-channel.ts +1 -1
- package/packages/bundled-features/src/compliance-profiles/feature.ts +9 -9
- package/packages/bundled-features/src/compliance-profiles/handlers/for-tenant.query.ts +2 -2
- package/packages/bundled-features/src/compliance-profiles/handlers/needs-profile.query.ts +1 -1
- package/packages/bundled-features/src/compliance-profiles/handlers/set-profile.write.ts +2 -2
- package/packages/bundled-features/src/compliance-profiles/index.ts +3 -3
- package/packages/bundled-features/src/compliance-profiles/resolve-for-tenant.ts +3 -3
- package/packages/bundled-features/src/compliance-profiles/seeding.ts +1 -1
- package/packages/bundled-features/src/compliance-profiles/web/client-plugin.tsx +3 -3
- package/packages/bundled-features/src/compliance-profiles/web/compliance-profile-catalog.tsx +1 -1
- package/packages/bundled-features/src/compliance-profiles/web/index.ts +2 -2
- package/packages/bundled-features/src/compliance-profiles-ops/changes.json +10 -0
- package/packages/bundled-features/src/compliance-profiles-ops/handlers/tenants-missing-profile.query.ts +2 -2
- package/packages/bundled-features/src/compliance-profiles-ops/index.ts +1 -4
- package/packages/bundled-features/src/config/db/queries/resolver.ts +1 -1
- package/packages/bundled-features/src/config/feature.ts +11 -11
- package/packages/bundled-features/src/config/handlers/cascade.query.ts +3 -3
- package/packages/bundled-features/src/config/handlers/readiness.query.ts +2 -2
- package/packages/bundled-features/src/config/handlers/reencrypt.job.ts +2 -2
- package/packages/bundled-features/src/config/handlers/reset.write.ts +3 -3
- package/packages/bundled-features/src/config/handlers/schema.query.ts +1 -1
- package/packages/bundled-features/src/config/handlers/selected-extensions.query.ts +3 -3
- package/packages/bundled-features/src/config/handlers/set.write.ts +4 -4
- package/packages/bundled-features/src/config/handlers/values.query.ts +3 -3
- package/packages/bundled-features/src/config/index.ts +9 -9
- package/packages/bundled-features/src/config/resolver.ts +2 -2
- package/packages/bundled-features/src/config/web/client-plugin.ts +2 -2
- package/packages/bundled-features/src/config/web/index.ts +2 -2
- package/packages/bundled-features/src/config/write-helpers.ts +3 -3
- package/packages/bundled-features/src/crypto-shredding/changes.json +6 -0
- package/packages/bundled-features/src/crypto-shredding/env/index.ts +94 -0
- package/packages/bundled-features/src/crypto-shredding/feature.ts +9 -5
- package/packages/bundled-features/src/crypto-shredding/handlers/forget-subject.write.ts +6 -6
- package/packages/bundled-features/src/crypto-shredding/index.ts +4 -3
- package/packages/bundled-features/src/custom-fields/changes.json +8 -0
- package/packages/bundled-features/src/custom-fields/executor.ts +1 -1
- package/packages/bundled-features/src/custom-fields/feature.ts +10 -13
- package/packages/bundled-features/src/custom-fields/handlers/clear-custom-field.write.ts +3 -3
- package/packages/bundled-features/src/custom-fields/handlers/define-system-field.write.ts +5 -5
- package/packages/bundled-features/src/custom-fields/handlers/define-tenant-field.write.ts +6 -6
- package/packages/bundled-features/src/custom-fields/handlers/delete-system-field.write.ts +6 -6
- package/packages/bundled-features/src/custom-fields/handlers/delete-tenant-field.write.ts +5 -5
- package/packages/bundled-features/src/custom-fields/handlers/set-custom-field.write.ts +4 -4
- package/packages/bundled-features/src/custom-fields/handlers/update-tenant-field.write.ts +5 -5
- package/packages/bundled-features/src/custom-fields/index.ts +10 -11
- package/packages/bundled-features/src/custom-fields/lib/define-or-resurrect.ts +2 -2
- package/packages/bundled-features/src/custom-fields/lib/field-access.ts +2 -2
- package/packages/bundled-features/src/custom-fields/lib/field-definition-row.ts +1 -1
- package/packages/bundled-features/src/custom-fields/lib/quota.ts +1 -1
- package/packages/bundled-features/src/custom-fields/lib/value-schema.ts +1 -1
- package/packages/bundled-features/src/custom-fields/run-retention.ts +3 -3
- package/packages/bundled-features/src/custom-fields/schemas.ts +1 -1
- package/packages/bundled-features/src/custom-fields/web/client-plugin.tsx +3 -3
- package/packages/bundled-features/src/custom-fields/web/custom-fields-form-section.tsx +1 -1
- package/packages/bundled-features/src/custom-fields/web/index.ts +3 -3
- package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +4 -4
- package/packages/bundled-features/src/custom-fields/wire-user-data-rights.ts +1 -1
- package/packages/bundled-features/src/data-retention/_internal/parse-override.ts +2 -2
- package/packages/bundled-features/src/data-retention/feature.ts +11 -11
- package/packages/bundled-features/src/data-retention/handlers/policy-for.query.ts +2 -2
- package/packages/bundled-features/src/data-retention/index.ts +3 -3
- package/packages/bundled-features/src/data-retention/resolve-for-tenant.ts +6 -6
- package/packages/bundled-features/src/data-retention/resolve-tenant-preset.ts +2 -2
- package/packages/bundled-features/src/data-retention/resolver.ts +1 -1
- package/packages/bundled-features/src/data-retention/run-retention-cleanup.ts +5 -5
- package/packages/bundled-features/src/delivery/address-opt-out.ts +2 -2
- package/packages/bundled-features/src/delivery/attachment-ref.ts +3 -3
- package/packages/bundled-features/src/delivery/attempt-log-retention.ts +1 -1
- package/packages/bundled-features/src/delivery/attempt-log.ts +4 -4
- package/packages/bundled-features/src/delivery/changes.json +13 -0
- package/packages/bundled-features/src/delivery/channel-context.ts +5 -5
- package/packages/bundled-features/src/delivery/chat-webhook-channel.ts +2 -2
- package/packages/bundled-features/src/delivery/constants.ts +2 -2
- package/packages/bundled-features/src/delivery/db/queries/address-opt-outs.ts +1 -1
- package/packages/bundled-features/src/delivery/delivery-service.ts +11 -11
- package/packages/bundled-features/src/delivery/events.ts +1 -1
- package/packages/bundled-features/src/delivery/feature.ts +15 -13
- package/packages/bundled-features/src/delivery/handlers/log.query.ts +4 -4
- package/packages/bundled-features/src/delivery/handlers/preferences.query.ts +1 -1
- package/packages/bundled-features/src/delivery/handlers/resubscribe-address.write.ts +2 -2
- package/packages/bundled-features/src/delivery/handlers/resubscribe-user.write.ts +2 -2
- package/packages/bundled-features/src/delivery/handlers/set-preference.write.ts +2 -2
- package/packages/bundled-features/src/delivery/handlers/unsubscribe-address.write.ts +2 -2
- package/packages/bundled-features/src/delivery/handlers/unsubscribe-page-chrome.query.ts +56 -0
- package/packages/bundled-features/src/delivery/handlers/unsubscribe-user.write.ts +2 -2
- package/packages/bundled-features/src/delivery/i18n.ts +1 -1
- package/packages/bundled-features/src/delivery/index.ts +20 -20
- package/packages/bundled-features/src/delivery/jobs.ts +7 -7
- package/packages/bundled-features/src/delivery/notify-factory.ts +1 -1
- package/packages/bundled-features/src/delivery/public-names.ts +1 -0
- package/packages/bundled-features/src/delivery/testing.ts +5 -5
- package/packages/bundled-features/src/delivery/types.ts +3 -3
- package/packages/bundled-features/src/delivery/unsubscribe-link.ts +4 -4
- package/packages/bundled-features/src/delivery/unsubscribe-page-strings.ts +5 -0
- package/packages/bundled-features/src/delivery/unsubscribe-page.ts +226 -0
- package/packages/bundled-features/src/delivery/unsubscribe.ts +204 -108
- package/packages/bundled-features/src/delivery/upsert-preference.ts +1 -1
- package/packages/bundled-features/src/delivery/web/client-plugin.tsx +6 -6
- package/packages/bundled-features/src/delivery/web/delivery-channel-cell.tsx +1 -1
- package/packages/bundled-features/src/delivery/web/delivery-error-cell.tsx +1 -1
- package/packages/bundled-features/src/delivery/web/delivery-status-cell.tsx +2 -2
- package/packages/bundled-features/src/delivery/web/delivery-type-cell.tsx +1 -1
- package/packages/bundled-features/src/delivery/web/index.ts +2 -2
- package/packages/bundled-features/src/derivatives-sharp/changes.json +8 -0
- package/packages/bundled-features/src/derivatives-sharp/feature.ts +1 -4
- package/packages/bundled-features/src/derivatives-sharp/index.ts +2 -2
- package/packages/bundled-features/src/derivatives-sharp/render.ts +1 -1
- package/packages/bundled-features/src/document-ingest-foundation/boot-checks.ts +2 -2
- package/packages/bundled-features/src/document-ingest-foundation/changes.json +8 -0
- package/packages/bundled-features/src/document-ingest-foundation/executor.ts +1 -1
- package/packages/bundled-features/src/document-ingest-foundation/feature.ts +7 -10
- package/packages/bundled-features/src/document-ingest-foundation/forget-extract-with-file-ref.ts +3 -3
- package/packages/bundled-features/src/document-ingest-foundation/index.ts +7 -10
- package/packages/bundled-features/src/document-ingest-foundation/pages.ts +1 -1
- package/packages/bundled-features/src/document-ingest-foundation/providers.ts +1 -1
- package/packages/bundled-features/src/document-ingest-foundation/tenant-destroy-hook.ts +2 -2
- package/packages/bundled-features/src/document-ingest-foundation/write-document-extract.ts +4 -4
- package/packages/bundled-features/src/feature-toggles/compose-tier-resolver.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/feature.ts +12 -12
- package/packages/bundled-features/src/feature-toggles/handlers/list.query.ts +2 -2
- package/packages/bundled-features/src/feature-toggles/handlers/registered.query.ts +2 -2
- package/packages/bundled-features/src/feature-toggles/handlers/set.write.ts +3 -3
- package/packages/bundled-features/src/feature-toggles/index.ts +3 -3
- package/packages/bundled-features/src/feature-toggles/toggle-runtime.ts +2 -2
- package/packages/bundled-features/src/feature-toggles/toggle-sync-signal.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/web/client-plugin.tsx +2 -2
- package/packages/bundled-features/src/feature-toggles/web/index.ts +1 -1
- package/packages/bundled-features/src/file-derivatives/changes.json +8 -0
- package/packages/bundled-features/src/file-derivatives/feature.ts +2 -5
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant-by-file-ref.query.ts +2 -2
- package/packages/bundled-features/src/file-derivatives/index.ts +4 -4
- package/packages/bundled-features/src/file-foundation/changes.json +8 -0
- package/packages/bundled-features/src/file-foundation/feature.ts +0 -3
- package/packages/bundled-features/src/file-foundation/index.ts +2 -3
- package/packages/bundled-features/src/file-provider-inmemory/changes.json +10 -1
- package/packages/bundled-features/src/file-provider-inmemory/feature.ts +0 -3
- package/packages/bundled-features/src/file-provider-inmemory/index.ts +1 -2
- package/packages/bundled-features/src/file-provider-s3/changes.json +28 -0
- package/packages/bundled-features/src/file-provider-s3/env-feature.ts +10 -7
- package/packages/bundled-features/src/file-provider-s3/env-schema.ts +73 -0
- package/packages/bundled-features/src/file-provider-s3/feature.ts +2 -5
- package/packages/bundled-features/src/file-provider-s3/index.ts +2 -2
- package/packages/bundled-features/src/file-provider-s3/lib/env-helper.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/lib/index.ts +3 -3
- package/packages/bundled-features/src/files/index.ts +1 -1
- package/packages/bundled-features/src/files-tenant-data/handlers/sweep-orphaned-derivatives.job.ts +2 -2
- package/packages/bundled-features/src/files-tenant-data/hooks.ts +1 -1
- package/packages/bundled-features/src/files-tenant-data/index.ts +4 -4
- package/packages/bundled-features/src/folders/changes.json +8 -0
- package/packages/bundled-features/src/folders/executor.ts +1 -1
- package/packages/bundled-features/src/folders/feature.ts +6 -9
- package/packages/bundled-features/src/folders/handlers/clear-folder.write.ts +5 -5
- package/packages/bundled-features/src/folders/handlers/delete-folder.write.ts +3 -3
- package/packages/bundled-features/src/folders/handlers/set-folder.write.ts +5 -5
- package/packages/bundled-features/src/folders/index.ts +7 -8
- package/packages/bundled-features/src/folders/web/client-plugin.tsx +3 -3
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +2 -2
- package/packages/bundled-features/src/folders/web/folder-section.tsx +2 -2
- package/packages/bundled-features/src/folders/web/index.ts +5 -5
- package/packages/bundled-features/src/folders-user-data/changes.json +10 -1
- package/packages/bundled-features/src/folders-user-data/hooks.ts +1 -1
- package/packages/bundled-features/src/folders-user-data/index.ts +1 -4
- package/packages/bundled-features/src/form-draft/changes.json +8 -0
- package/packages/bundled-features/src/form-draft/db/queries/cleanup.ts +1 -1
- package/packages/bundled-features/src/form-draft/entity.ts +1 -1
- package/packages/bundled-features/src/form-draft/executor.ts +1 -1
- package/packages/bundled-features/src/form-draft/feature.ts +7 -10
- package/packages/bundled-features/src/form-draft/handlers/cleanup.job.ts +4 -4
- package/packages/bundled-features/src/form-draft/handlers/discard.write.ts +6 -6
- package/packages/bundled-features/src/form-draft/handlers/get.query.ts +4 -4
- package/packages/bundled-features/src/form-draft/handlers/list.query.ts +3 -3
- package/packages/bundled-features/src/form-draft/handlers/save.write.ts +5 -5
- package/packages/bundled-features/src/form-draft/index.ts +10 -10
- package/packages/bundled-features/src/form-draft/lookup.ts +2 -2
- package/packages/bundled-features/src/form-draft/release-file-refs.ts +1 -1
- package/packages/bundled-features/src/form-draft/schemas.ts +1 -1
- package/packages/bundled-features/src/form-draft-user-data/changes.json +10 -1
- package/packages/bundled-features/src/form-draft-user-data/hooks.ts +1 -1
- package/packages/bundled-features/src/form-draft-user-data/index.ts +1 -4
- package/packages/bundled-features/src/foundation-shared/build-info-env.ts +16 -0
- package/packages/bundled-features/src/foundation-shared/changes.json +8 -1
- package/packages/bundled-features/src/foundation-shared/demo-admin-env.ts +24 -0
- package/packages/bundled-features/src/foundation-shared/index.ts +5 -3
- package/packages/bundled-features/src/foundation-shared/mail-host-policy.ts +1 -1
- package/packages/bundled-features/src/host-routing/README.md +89 -0
- package/packages/bundled-features/src/host-routing/changes.json +8 -0
- package/packages/bundled-features/src/host-routing/constants.ts +24 -0
- package/packages/bundled-features/src/host-routing/dispatch.ts +130 -0
- package/packages/bundled-features/src/host-routing/feature.ts +146 -0
- package/packages/bundled-features/src/host-routing/host.ts +42 -0
- package/packages/bundled-features/src/host-routing/index.ts +21 -0
- package/packages/bundled-features/src/host-routing/options.ts +43 -0
- package/packages/bundled-features/src/host-routing/validate-options.ts +38 -0
- package/packages/bundled-features/src/inbound-mail-foundation/changes.json +8 -0
- package/packages/bundled-features/src/inbound-mail-foundation/connect-routes.ts +5 -5
- package/packages/bundled-features/src/inbound-mail-foundation/events.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/feature.ts +12 -15
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/account-state.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/connect-account.write.ts +3 -3
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/disconnect-account.write.ts +3 -3
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/ingest-message.write.ts +4 -4
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-accounts.query.ts +3 -3
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-messages.query.ts +3 -3
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/update-account.write.ts +3 -3
- package/packages/bundled-features/src/inbound-mail-foundation/index.ts +12 -12
- package/packages/bundled-features/src/inbound-mail-foundation/oauth-access-token.ts +2 -2
- package/packages/bundled-features/src/inbound-mail-foundation/projection.ts +2 -2
- package/packages/bundled-features/src/inbound-mail-foundation/provider-factory.ts +2 -2
- package/packages/bundled-features/src/inbound-mail-foundation/retention-sweep.ts +3 -3
- package/packages/bundled-features/src/inbound-mail-foundation/tenant-destroy-hook.ts +3 -3
- package/packages/bundled-features/src/inbound-mail-foundation/types.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/watch-supervisor.ts +6 -6
- package/packages/bundled-features/src/inbound-provider-imap/changes.json +8 -0
- package/packages/bundled-features/src/inbound-provider-imap/feature.ts +3 -6
- package/packages/bundled-features/src/inbound-provider-imap/imap-client.ts +1 -1
- package/packages/bundled-features/src/inbound-provider-imap/index.ts +3 -4
- package/packages/bundled-features/src/inbound-provider-inmemory/changes.json +10 -1
- package/packages/bundled-features/src/inbound-provider-inmemory/feature.ts +0 -3
- package/packages/bundled-features/src/inbound-provider-inmemory/index.ts +1 -2
- package/packages/bundled-features/src/jobs/db/queries/retention.ts +3 -3
- package/packages/bundled-features/src/jobs/db/queries/stale-run-sweep.ts +5 -5
- package/packages/bundled-features/src/jobs/feature.ts +16 -16
- package/packages/bundled-features/src/jobs/handlers/catalog.query.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/detail.query.ts +2 -2
- package/packages/bundled-features/src/jobs/handlers/list.query.ts +2 -2
- package/packages/bundled-features/src/jobs/handlers/retention-cleanup.job.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/retry.write.ts +3 -3
- package/packages/bundled-features/src/jobs/handlers/stale-run-sweep.job.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/tenant-failures.query.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/tenant-runs.query.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/trigger.write.ts +2 -2
- package/packages/bundled-features/src/jobs/index.ts +9 -9
- package/packages/bundled-features/src/jobs/job-run-logger.ts +6 -6
- package/packages/bundled-features/src/jobs/web/client-plugin.tsx +2 -2
- package/packages/bundled-features/src/jobs/web/i18n.ts +1 -1
- package/packages/bundled-features/src/jobs/web/index.ts +1 -1
- package/packages/bundled-features/src/ledger/changes.json +8 -0
- package/packages/bundled-features/src/ledger/entity.ts +1 -1
- package/packages/bundled-features/src/ledger/executor.ts +1 -1
- package/packages/bundled-features/src/ledger/feature.ts +7 -10
- package/packages/bundled-features/src/ledger/handlers/confirm-schedule-period.write.ts +5 -5
- package/packages/bundled-features/src/ledger/handlers/create-transaction.write.ts +3 -3
- package/packages/bundled-features/src/ledger/handlers/reports.query.ts +3 -3
- package/packages/bundled-features/src/ledger/handlers/reverse-transaction.write.ts +5 -5
- package/packages/bundled-features/src/ledger/index.ts +10 -11
- package/packages/bundled-features/src/ledger/recurring.ts +2 -2
- package/packages/bundled-features/src/ledger/reports.ts +2 -2
- package/packages/bundled-features/src/ledger/schemas.ts +1 -1
- package/packages/bundled-features/src/ledger/web/index.ts +3 -3
- package/packages/bundled-features/src/legal-pages/README.md +39 -0
- package/packages/bundled-features/src/legal-pages/changes.json +6 -0
- package/packages/bundled-features/src/legal-pages/constants.ts +22 -0
- package/packages/bundled-features/src/legal-pages/feature.ts +14 -7
- package/packages/bundled-features/src/legal-pages/index.ts +12 -3
- package/packages/bundled-features/src/legal-pages/layout.ts +45 -0
- package/packages/bundled-features/src/legal-pages/lib/boot-check.ts +1 -1
- package/packages/bundled-features/src/legal-pages/lib/validate-routes.ts +1 -1
- package/packages/bundled-features/src/legal-pages/markdown.ts +2 -2
- package/packages/bundled-features/src/legal-pages/seed.ts +53 -0
- package/packages/bundled-features/src/legal-pages/web/client-plugin.ts +1 -1
- package/packages/bundled-features/src/legal-pages/web/index.ts +1 -1
- package/packages/bundled-features/src/mail-foundation/changes.json +10 -1
- package/packages/bundled-features/src/mail-foundation/feature.ts +1 -4
- package/packages/bundled-features/src/mail-foundation/index.ts +1 -2
- package/packages/bundled-features/src/mail-transport-inmemory/changes.json +10 -1
- package/packages/bundled-features/src/mail-transport-inmemory/feature.ts +0 -3
- package/packages/bundled-features/src/mail-transport-inmemory/index.ts +1 -2
- package/packages/bundled-features/src/mail-transport-smtp/changes.json +8 -0
- package/packages/bundled-features/src/mail-transport-smtp/feature.ts +2 -5
- package/packages/bundled-features/src/mail-transport-smtp/index.ts +1 -2
- package/packages/bundled-features/src/managed-pages/branding.ts +1 -1
- package/packages/bundled-features/src/managed-pages/css-gate.ts +1 -1
- package/packages/bundled-features/src/managed-pages/feature.ts +12 -12
- package/packages/bundled-features/src/managed-pages/handlers/branding.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-tenant-published.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/page-crud.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/set.write.ts +2 -2
- package/packages/bundled-features/src/managed-pages/index.ts +5 -5
- package/packages/bundled-features/src/managed-pages/screens/branding-screen.ts +1 -1
- package/packages/bundled-features/src/managed-pages/seeding.ts +1 -1
- package/packages/bundled-features/src/managed-pages/web/client-plugin.tsx +1 -1
- package/packages/bundled-features/src/managed-pages/web/i18n.ts +1 -1
- package/packages/bundled-features/src/managed-pages/web/index.ts +2 -2
- package/packages/bundled-features/src/metrics/compute.ts +3 -3
- package/packages/bundled-features/src/metrics/default-metrics.ts +5 -5
- package/packages/bundled-features/src/metrics/feature.ts +7 -7
- package/packages/bundled-features/src/metrics/filters.ts +1 -1
- package/packages/bundled-features/src/metrics/index.ts +5 -5
- package/packages/bundled-features/src/metrics/types.ts +1 -1
- package/packages/bundled-features/src/metrics/validate.ts +3 -3
- package/packages/bundled-features/src/metrics/window.ts +2 -2
- package/packages/bundled-features/src/notes-history/changes.json +8 -0
- package/packages/bundled-features/src/notes-history/executor.ts +1 -1
- package/packages/bundled-features/src/notes-history/feature.ts +6 -9
- package/packages/bundled-features/src/notes-history/handlers/add-note.write.ts +6 -6
- package/packages/bundled-features/src/notes-history/index.ts +6 -7
- package/packages/bundled-features/src/notes-history/web/client-plugin.tsx +3 -3
- package/packages/bundled-features/src/notes-history/web/index.ts +3 -3
- package/packages/bundled-features/src/notes-history/web/notes-section.tsx +1 -1
- package/packages/bundled-features/src/notes-history-user-data/changes.json +8 -0
- package/packages/bundled-features/src/notes-history-user-data/hooks.ts +1 -1
- package/packages/bundled-features/src/notes-history-user-data/index.ts +2 -5
- package/packages/bundled-features/src/page-render/cached-page-response.ts +1 -1
- package/packages/bundled-features/src/page-render/index.ts +7 -7
- package/packages/bundled-features/src/page-render/layout.ts +2 -2
- package/packages/bundled-features/src/page-render/web.ts +5 -5
- package/packages/bundled-features/src/personal-access-tokens/feature.ts +13 -13
- package/packages/bundled-features/src/personal-access-tokens/handlers/available-scopes.query.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +5 -5
- package/packages/bundled-features/src/personal-access-tokens/handlers/list.query.ts +3 -3
- package/packages/bundled-features/src/personal-access-tokens/handlers/revoke.write.ts +3 -3
- package/packages/bundled-features/src/personal-access-tokens/hash.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/i18n.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/index.ts +13 -13
- package/packages/bundled-features/src/personal-access-tokens/resolver.ts +5 -5
- package/packages/bundled-features/src/personal-access-tokens/revoke-for-user.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/roles.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/schema/api-token.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/screens.ts +2 -2
- package/packages/bundled-features/src/presets/changes.json +6 -0
- package/packages/bundled-features/src/presets/dsgvo-self-service.ts +7 -5
- package/packages/bundled-features/src/presets/index.ts +2 -2
- package/packages/bundled-features/src/presets/security-baseline.ts +6 -4
- package/packages/bundled-features/src/rate-limiting/feature.ts +2 -2
- package/packages/bundled-features/src/rate-limiting/handlers/bucket-access.ts +1 -1
- package/packages/bundled-features/src/rate-limiting/handlers/status.query.ts +2 -2
- package/packages/bundled-features/src/rate-limiting/index.ts +2 -2
- package/packages/bundled-features/src/readiness/changes.json +10 -1
- package/packages/bundled-features/src/readiness/feature.ts +1 -4
- package/packages/bundled-features/src/readiness/handlers/status.query.ts +1 -1
- package/packages/bundled-features/src/readiness/index.ts +3 -3
- package/packages/bundled-features/src/renderer-foundation/api.ts +2 -2
- package/packages/bundled-features/src/renderer-foundation/constants.ts +2 -2
- package/packages/bundled-features/src/renderer-foundation/feature.ts +2 -2
- package/packages/bundled-features/src/renderer-foundation/index.ts +8 -5
- package/packages/bundled-features/src/renderer-foundation/types.ts +22 -2
- package/packages/bundled-features/src/renderer-pdf/feature.ts +2 -2
- package/packages/bundled-features/src/renderer-pdf/index.ts +2 -2
- package/packages/bundled-features/src/renderer-pdf/render-table-pdf.ts +2 -2
- package/packages/bundled-features/src/secrets/changes.json +12 -0
- package/packages/bundled-features/src/secrets/constants.ts +9 -0
- package/packages/bundled-features/src/secrets/db/queries/read.ts +1 -1
- package/packages/bundled-features/src/secrets/feature.ts +17 -13
- package/packages/bundled-features/src/secrets/handlers/delete.write.ts +5 -5
- package/packages/bundled-features/src/secrets/handlers/list.query.ts +2 -2
- package/packages/bundled-features/src/secrets/handlers/rotate.job.ts +2 -2
- package/packages/bundled-features/src/secrets/handlers/set.write.ts +5 -5
- package/packages/bundled-features/src/secrets/i18n.ts +1 -1
- package/packages/bundled-features/src/secrets/index.ts +9 -7
- package/packages/bundled-features/src/secrets/secrets-context.ts +3 -3
- package/packages/bundled-features/src/secrets/write-gate.ts +1 -1
- package/packages/bundled-features/src/seo/feature.ts +8 -8
- package/packages/bundled-features/src/seo/handlers/seo-config.query.ts +1 -1
- package/packages/bundled-features/src/seo/index.ts +6 -6
- package/packages/bundled-features/src/sessions/feature.ts +13 -13
- package/packages/bundled-features/src/sessions/handlers/cleanup.job.ts +1 -1
- package/packages/bundled-features/src/sessions/handlers/detail.query.ts +2 -2
- package/packages/bundled-features/src/sessions/handlers/list.query.ts +2 -2
- package/packages/bundled-features/src/sessions/handlers/mine.query.ts +2 -2
- package/packages/bundled-features/src/sessions/handlers/revoke-all-for-user.write.ts +2 -2
- package/packages/bundled-features/src/sessions/handlers/revoke-all-others.write.ts +3 -3
- package/packages/bundled-features/src/sessions/handlers/revoke.write.ts +3 -3
- package/packages/bundled-features/src/sessions/index.ts +8 -8
- package/packages/bundled-features/src/sessions/schema/user-session.ts +1 -1
- package/packages/bundled-features/src/sessions/screens.ts +1 -1
- package/packages/bundled-features/src/sessions/session-callbacks.ts +6 -6
- package/packages/bundled-features/src/sessions/testing.ts +1 -1
- package/packages/bundled-features/src/shared/index.ts +31 -31
- package/packages/bundled-features/src/shared/password-hashing.ts +1 -1
- package/packages/bundled-features/src/shared/row-bound-grant.ts +1 -1
- package/packages/bundled-features/src/step-dispatcher/deliver-dispatch-request.ts +4 -4
- package/packages/bundled-features/src/step-dispatcher/dispatch-payload.ts +2 -2
- package/packages/bundled-features/src/step-dispatcher/feature.ts +3 -3
- package/packages/bundled-features/src/step-dispatcher/index.ts +3 -3
- package/packages/bundled-features/src/step-dispatcher/webhook-runner.ts +1 -1
- package/packages/bundled-features/src/subscription-mollie/feature.ts +3 -3
- package/packages/bundled-features/src/subscription-mollie/index.ts +3 -3
- package/packages/bundled-features/src/subscription-mollie/verify-webhook.ts +2 -2
- package/packages/bundled-features/src/subscription-stripe/changes.json +6 -0
- package/packages/bundled-features/src/subscription-stripe/feature.ts +34 -6
- package/packages/bundled-features/src/subscription-stripe/index.ts +3 -2
- package/packages/bundled-features/src/subscription-stripe/plugin-methods.ts +2 -2
- package/packages/bundled-features/src/subscription-stripe/runtime.ts +1 -1
- package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +2 -2
- package/packages/bundled-features/src/tags/changes.json +8 -0
- package/packages/bundled-features/src/tags/executor.ts +1 -1
- package/packages/bundled-features/src/tags/feature.ts +11 -14
- package/packages/bundled-features/src/tags/handlers/assign-tag.write.ts +5 -5
- package/packages/bundled-features/src/tags/handlers/create-tag.write.ts +3 -3
- package/packages/bundled-features/src/tags/handlers/delete-tag.write.ts +3 -3
- package/packages/bundled-features/src/tags/handlers/remove-tag.write.ts +5 -5
- package/packages/bundled-features/src/tags/handlers/update-tag.write.ts +3 -3
- package/packages/bundled-features/src/tags/index.ts +11 -11
- package/packages/bundled-features/src/tags/screens.ts +1 -1
- package/packages/bundled-features/src/tags/web/client-plugin.tsx +5 -5
- package/packages/bundled-features/src/tags/web/entity-tags.tsx +2 -2
- package/packages/bundled-features/src/tags/web/index.ts +9 -9
- package/packages/bundled-features/src/tags/web/tag-filter.tsx +3 -3
- package/packages/bundled-features/src/tags/web/tag-manager.tsx +2 -2
- package/packages/bundled-features/src/tags/web/tag-picker.tsx +1 -1
- package/packages/bundled-features/src/tags/web/tag-section.tsx +3 -3
- package/packages/bundled-features/src/tags/web/tags-cell.tsx +2 -2
- package/packages/bundled-features/src/template-resolver/api.ts +7 -7
- package/packages/bundled-features/src/template-resolver/changes.json +6 -0
- package/packages/bundled-features/src/template-resolver/compile-document-body.ts +4 -4
- package/packages/bundled-features/src/template-resolver/compile-steps-block.ts +3 -3
- package/packages/bundled-features/src/template-resolver/constants.ts +1 -1
- package/packages/bundled-features/src/template-resolver/document-sanitizer.ts +4 -4
- package/packages/bundled-features/src/template-resolver/document-schema.ts +1 -1
- package/packages/bundled-features/src/template-resolver/feature.ts +31 -31
- package/packages/bundled-features/src/template-resolver/handlers/bundle-import.ts +11 -11
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/collection-item.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-list.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-set.write.ts +5 -5
- package/packages/bundled-features/src/template-resolver/handlers/collection-shared.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/copy-locale.write.ts +13 -13
- package/packages/bundled-features/src/template-resolver/handlers/diff-to-system.query.ts +3 -3
- package/packages/bundled-features/src/template-resolver/handlers/discard-draft.write.ts +3 -3
- package/packages/bundled-features/src/template-resolver/handlers/export-bundle.query.ts +7 -7
- package/packages/bundled-features/src/template-resolver/handlers/find-by-id.query.ts +3 -3
- package/packages/bundled-features/src/template-resolver/handlers/import-bundle-system.write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/import-bundle.write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/layout-source.query.ts +7 -7
- package/packages/bundled-features/src/template-resolver/handlers/list.query.ts +4 -4
- package/packages/bundled-features/src/template-resolver/handlers/override-diff.ts +3 -3
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +6 -6
- package/packages/bundled-features/src/template-resolver/handlers/preview.query.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/reset-to-system.write.ts +3 -3
- package/packages/bundled-features/src/template-resolver/handlers/resource-link-pdf.write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/resource-remove.write.ts +5 -5
- package/packages/bundled-features/src/template-resolver/handlers/resource-shared.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/resource-upload.write.ts +5 -5
- package/packages/bundled-features/src/template-resolver/handlers/send-test.write.ts +6 -6
- package/packages/bundled-features/src/template-resolver/handlers/set.write.ts +7 -7
- package/packages/bundled-features/src/template-resolver/handlers/shared.ts +3 -3
- package/packages/bundled-features/src/template-resolver/handlers/template-gates.ts +7 -7
- package/packages/bundled-features/src/template-resolver/handlers/template-write.ts +10 -10
- package/packages/bundled-features/src/template-resolver/handlers/tenant-overrides.query.ts +5 -5
- package/packages/bundled-features/src/template-resolver/handlers/toggle-status.write.ts +6 -6
- package/packages/bundled-features/src/template-resolver/handlers/upsert-system.write.ts +3 -3
- package/packages/bundled-features/src/template-resolver/handlers/upsert-tenant.write.ts +3 -3
- package/packages/bundled-features/src/template-resolver/handlers/usage.query.ts +5 -5
- package/packages/bundled-features/src/template-resolver/handlers/validate.query.ts +8 -8
- package/packages/bundled-features/src/template-resolver/index.ts +25 -25
- package/packages/bundled-features/src/template-resolver/layout-appearance.ts +2 -2
- package/packages/bundled-features/src/template-resolver/layout-regions.ts +2 -2
- package/packages/bundled-features/src/template-resolver/linked-resources.ts +2 -2
- package/packages/bundled-features/src/template-resolver/preview-display-html.ts +1 -1
- package/packages/bundled-features/src/template-resolver/print-document.ts +1 -1
- package/packages/bundled-features/src/template-resolver/resource-image.ts +1 -1
- package/packages/bundled-features/src/template-resolver/seeding.ts +10 -10
- package/packages/bundled-features/src/template-resolver/store-template-resource.ts +10 -10
- package/packages/bundled-features/src/template-resolver/table.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-bundle.ts +4 -4
- package/packages/bundled-features/src/template-resolver/template-diff.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-draft.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-meta.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-preview.ts +40 -25
- package/packages/bundled-features/src/template-resolver/template-resources.ts +4 -4
- package/packages/bundled-features/src/template-resolver/template-system-only.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-usage.ts +4 -1
- package/packages/bundled-features/src/template-resolver/template-validation.ts +3 -3
- package/packages/bundled-features/src/template-resolver/testing.ts +4 -4
- package/packages/bundled-features/src/template-resolver/user-content-table.ts +2 -2
- package/packages/bundled-features/src/template-resolver/web/client-plugin.tsx +4 -4
- package/packages/bundled-features/src/template-resolver/web/document-editor-extensions.ts +8 -5
- package/packages/bundled-features/src/template-resolver/web/document-editor.tsx +2 -2
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-editor.tsx +30 -11
- package/packages/bundled-features/src/template-resolver/web/editor-handle.ts +2 -2
- package/packages/bundled-features/src/template-resolver/web/index.ts +7 -7
- package/packages/bundled-features/src/template-resolver/web/placeholder-line-editor-lazy.tsx +3 -3
- package/packages/bundled-features/src/template-resolver/web/placeholder-line-editor.tsx +6 -6
- package/packages/bundled-features/src/template-resolver/web/placeholder-text.ts +1 -1
- package/packages/bundled-features/src/template-resolver-user-data/changes.json +10 -0
- package/packages/bundled-features/src/template-resolver-user-data/hooks.ts +1 -1
- package/packages/bundled-features/src/template-resolver-user-data/index.ts +1 -4
- package/packages/bundled-features/src/tenant/cancel-pending-invitation.ts +2 -2
- package/packages/bundled-features/src/tenant/command-schemas.ts +6 -6
- package/packages/bundled-features/src/tenant/decrypt-tenant-names.ts +1 -1
- package/packages/bundled-features/src/tenant/feature.ts +24 -24
- package/packages/bundled-features/src/tenant/handlers/active-tenant-ids.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/add-member.write.ts +3 -3
- package/packages/bundled-features/src/tenant/handlers/cancel-invitation.write.ts +2 -2
- package/packages/bundled-features/src/tenant/handlers/create.write.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/invitations.query.ts +3 -3
- package/packages/bundled-features/src/tenant/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/me.query.ts +2 -2
- package/packages/bundled-features/src/tenant/handlers/member-directory.query.ts +4 -4
- package/packages/bundled-features/src/tenant/handlers/member-role-availability.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/members.query.ts +3 -3
- package/packages/bundled-features/src/tenant/handlers/memberships.query.ts +3 -3
- package/packages/bundled-features/src/tenant/handlers/remove-member.write.ts +6 -6
- package/packages/bundled-features/src/tenant/handlers/resolve-user-ids.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/team-list.query.ts +5 -5
- package/packages/bundled-features/src/tenant/handlers/tenant-directory.query.ts +3 -3
- package/packages/bundled-features/src/tenant/handlers/toggle-enabled.write.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/update-member-roles.write.ts +3 -3
- package/packages/bundled-features/src/tenant/handlers/update.write.ts +1 -1
- package/packages/bundled-features/src/tenant/index.ts +10 -10
- package/packages/bundled-features/src/tenant/invitation-table.ts +1 -1
- package/packages/bundled-features/src/tenant/invited-membership.ts +4 -4
- package/packages/bundled-features/src/tenant/is-tenant-serving-public-content.ts +1 -1
- package/packages/bundled-features/src/tenant/last-tenant-admin.ts +2 -2
- package/packages/bundled-features/src/tenant/member-role-options.ts +1 -1
- package/packages/bundled-features/src/tenant/screens.ts +2 -2
- package/packages/bundled-features/src/tenant/seeding.ts +3 -3
- package/packages/bundled-features/src/tenant/testing.ts +1 -1
- package/packages/bundled-features/src/tenant/web/client-plugin.tsx +3 -3
- package/packages/bundled-features/src/tenant/web/index.ts +3 -3
- package/packages/bundled-features/src/tenant/web/member-roles-cell.tsx +1 -1
- package/packages/bundled-features/src/tenant/web/member-status-cell.tsx +1 -1
- package/packages/bundled-features/src/tenant-handover/feature.ts +4 -4
- package/packages/bundled-features/src/tenant-handover/grant.ts +1 -1
- package/packages/bundled-features/src/tenant-handover/handlers/claim.write.ts +5 -5
- package/packages/bundled-features/src/tenant-handover/index.ts +3 -3
- package/packages/bundled-features/src/tenant-handover/move-entity-graph.ts +1 -1
- package/packages/bundled-features/src/tenant-handover/root-anchor.ts +1 -1
- package/packages/bundled-features/src/tenant-handover/signup-handover-provider.ts +5 -5
- package/packages/bundled-features/src/tenant-lifecycle/boot-checks.ts +1 -1
- package/packages/bundled-features/src/tenant-lifecycle/feature.ts +8 -8
- package/packages/bundled-features/src/tenant-lifecycle/handlers/cancel-destruction.write.ts +4 -4
- package/packages/bundled-features/src/tenant-lifecycle/handlers/request-destruction.write.ts +5 -5
- package/packages/bundled-features/src/tenant-lifecycle/index.ts +3 -3
- package/packages/bundled-features/src/tenant-lifecycle/lib/revoke-tenant-sessions.ts +1 -1
- package/packages/bundled-features/src/tenant-lifecycle/lifecycle-gate.ts +1 -1
- package/packages/bundled-features/src/tenant-lifecycle/run-tenant-destroy.ts +5 -5
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +3 -3
- package/packages/bundled-features/src/tenant-lifecycle/testing.ts +3 -3
- package/packages/bundled-features/src/tenant-settings/changes.json +10 -1
- package/packages/bundled-features/src/tenant-settings/feature.ts +2 -5
- package/packages/bundled-features/src/tenant-settings/index.ts +4 -5
- package/packages/bundled-features/src/tenant-settings/tenant-defaults.ts +1 -1
- package/packages/bundled-features/src/tier-engine/changes.json +8 -0
- package/packages/bundled-features/src/tier-engine/entity.ts +1 -1
- package/packages/bundled-features/src/tier-engine/feature.ts +10 -13
- package/packages/bundled-features/src/tier-engine/handlers/get-tenant-tier.query.ts +1 -1
- package/packages/bundled-features/src/tier-engine/handlers/set-tenant-tier.write.ts +4 -4
- package/packages/bundled-features/src/tier-engine/i18n.ts +4 -10
- package/packages/bundled-features/src/tier-engine/index.ts +8 -9
- package/packages/bundled-features/src/tier-engine/tier-option-gate.ts +1 -1
- package/packages/bundled-features/src/tier-engine/tier-resolver.ts +2 -2
- package/packages/bundled-features/src/tier-engine/web/client-plugin.tsx +9 -3
- package/packages/bundled-features/src/tier-engine/web/index.ts +1 -1
- package/packages/bundled-features/src/user/command-schemas.ts +2 -2
- package/packages/bundled-features/src/user/feature.ts +10 -10
- package/packages/bundled-features/src/user/handlers/create.write.ts +3 -3
- package/packages/bundled-features/src/user/handlers/detail.query.ts +2 -2
- package/packages/bundled-features/src/user/handlers/find-for-auth.query.ts +1 -1
- package/packages/bundled-features/src/user/handlers/list.query.ts +2 -2
- package/packages/bundled-features/src/user/handlers/me.query.ts +1 -1
- package/packages/bundled-features/src/user/handlers/update-roles.ts +2 -2
- package/packages/bundled-features/src/user/handlers/update.write.ts +4 -4
- package/packages/bundled-features/src/user/index.ts +8 -8
- package/packages/bundled-features/src/user/invited-global-roles.ts +2 -2
- package/packages/bundled-features/src/user/principal-status.ts +1 -1
- package/packages/bundled-features/src/user/resolve-display-names.ts +2 -2
- package/packages/bundled-features/src/user/schema/user.ts +1 -1
- package/packages/bundled-features/src/user/seeding.ts +2 -2
- package/packages/bundled-features/src/user/testing.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/audit-download.ts +2 -2
- package/packages/bundled-features/src/user-data-rights/boot-checks.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/db/queries/export-jobs.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/db/queries/forget-cleanup.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/deletion-token.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/feature.ts +31 -31
- package/packages/bundled-features/src/user-data-rights/handlers/cancel-deletion.write.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/handlers/deletion-grace-period.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/handlers/download-attempt-list.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-job.query.ts +4 -4
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-token.query.ts +5 -5
- package/packages/bundled-features/src/user-data-rights/handlers/export-job-detail.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/export-job-list.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/export-status.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/lift-restriction.write.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/handlers/list-download-attempts.query.ts +2 -2
- package/packages/bundled-features/src/user-data-rights/handlers/my-audit-log.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/request-deletion-by-email.write.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/handlers/request-deletion.write.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/handlers/request-export.write.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/restrict-account.write.ts +4 -4
- package/packages/bundled-features/src/user-data-rights/handlers/run-forget-cleanup.write.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/index.ts +13 -13
- package/packages/bundled-features/src/user-data-rights/lib/default-mailers.ts +7 -7
- package/packages/bundled-features/src/user-data-rights/lib/deny-if-target-outside-admin-tenant.ts +2 -2
- package/packages/bundled-features/src/user-data-rights/lib/mail-transport-resolver.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/lib/resolve-tenant-model.ts +2 -2
- package/packages/bundled-features/src/user-data-rights/lib/storage-provider-resolver.ts +2 -2
- package/packages/bundled-features/src/user-data-rights/lib/update-user-lifecycle.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/mail-notifications.ts +2 -2
- package/packages/bundled-features/src/user-data-rights/run-export-jobs.ts +8 -8
- package/packages/bundled-features/src/user-data-rights/run-forget-cleanup.ts +6 -6
- package/packages/bundled-features/src/user-data-rights/run-user-export.ts +2 -2
- package/packages/bundled-features/src/user-data-rights/web/client-plugin.tsx +4 -4
- package/packages/bundled-features/src/user-data-rights/web/i18n.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/web/index.ts +8 -8
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +1 -1
- package/packages/bundled-features/src/user-data-rights/web/public-deletion-gate.tsx +2 -2
- package/packages/bundled-features/src/user-data-rights-defaults/feature.ts +11 -11
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/api-token.userdata-hook.ts +2 -2
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/config-value.userdata-hook.ts +3 -3
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/delivery-attempt.userdata-hook.ts +2 -2
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/download-attempt.userdata-hook.ts +2 -2
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/file-ref.userdata-hook.ts +1 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/in-app-message.userdata-hook.ts +2 -2
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/job-run.userdata-hook.ts +2 -2
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/notification-preference.userdata-hook.ts +3 -3
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/tenant-invitation.userdata-hook.ts +4 -4
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/user-session.userdata-hook.ts +2 -2
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/user.userdata-hook.ts +1 -1
- package/packages/bundled-features/src/user-data-rights-defaults/index.ts +11 -11
- package/packages/bundled-features/src/user-profile/feature.ts +2 -2
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +4 -4
- package/packages/bundled-features/src/user-profile/index.ts +2 -2
- package/packages/bundled-features/src/user-profile/web/client-plugin.ts +3 -3
- package/packages/bundled-features/src/user-profile/web/index.ts +2 -2
- package/packages/bundled-features/src/user-profile/web/profile-screen.tsx +3 -3
- package/packages/bundled-features/src/waitlist/changes.json +7 -0
- package/packages/bundled-features/src/waitlist/constants.ts +12 -0
- package/packages/bundled-features/src/waitlist/entity.ts +5 -3
- package/packages/bundled-features/src/waitlist/entries-admin.ts +55 -0
- package/packages/bundled-features/src/waitlist/feature.ts +33 -12
- package/packages/bundled-features/src/waitlist/handlers/export-purge.write.ts +81 -0
- package/packages/bundled-features/src/waitlist/handlers/invite.write.ts +7 -7
- package/packages/bundled-features/src/waitlist/handlers/list.query.ts +2 -2
- package/packages/bundled-features/src/waitlist/handlers/reject.write.ts +5 -5
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +5 -5
- package/packages/bundled-features/src/waitlist/i18n.ts +4 -0
- package/packages/bundled-features/src/waitlist/import.ts +83 -0
- package/packages/bundled-features/src/waitlist/index.ts +23 -5
- package/packages/bundled-features/src/waitlist/legacy-migrate.ts +220 -0
- package/packages/bundled-features/src/waitlist/lib.ts +5 -5
- package/packages/bundled-features/src/waitlist/link-on-signup.ts +106 -0
- package/packages/bundled-features/src/waitlist/mail.ts +1 -1
- package/packages/bundled-features/src/waitlist/options.ts +15 -3
- package/packages/bundled-features/src/waitlist/payloads.ts +3 -1
- package/packages/bundled-features/src/waitlist/screens.ts +2 -2
- package/packages/bundled-features/src/waitlist/user-data-hooks.ts +3 -3
- package/packages/bundled-features/src/workflow-runner/changes.json +8 -0
- package/packages/bundled-features/src/workflow-runner/db/queries/due-runs.ts +1 -1
- package/packages/bundled-features/src/workflow-runner/event-subscriber.ts +2 -2
- package/packages/bundled-features/src/workflow-runner/event-trigger.ts +4 -4
- package/packages/bundled-features/src/workflow-runner/feature.ts +4 -7
- package/packages/bundled-features/src/workflow-runner/handlers/resume-run.write.ts +3 -3
- package/packages/bundled-features/src/workflow-runner/index.ts +4 -4
- package/packages/bundled-features/src/workflow-runner/pending-projection.ts +1 -1
- package/samples/apps/ui-walkthrough/package.json +2 -1
- package/samples/apps/ui-walkthrough/src/app/auth-constants.ts +4 -0
- package/samples/apps/ui-walkthrough/src/app/server.ts +10 -1
- package/samples/apps/ui-walkthrough/src/app/template-seed-data.ts +1 -1
- package/samples/apps/ui-walkthrough/src/features/billing/feature.ts +11 -10
- package/samples/apps/ui-walkthrough/src/features/billing/i18n.ts +22 -1
- package/samples/apps/ui-walkthrough/src/run-config.ts +14 -5
- package/samples/apps/ui-walkthrough/tsconfig.json +1 -0
- package/samples/apps/use-all-bundled/feature-manifest.json +44 -3
- package/samples/apps/use-all-bundled/scripts/check-coverage.ts +2 -3
- package/samples/apps/use-all-bundled/src/run-config.ts +22 -20
- package/samples/recipes/apex-surface-auth/README.md +1 -0
- package/samples/recipes/apex-surface-auth/src/feature.ts +1 -1
- package/samples/recipes/api-worker-split/bin/api.ts +6 -1
- package/samples/recipes/app-config/README.md +28 -0
- package/samples/recipes/app-config/kumiko.config.ts +9 -0
- package/samples/recipes/app-config/package.json +8 -0
- package/samples/recipes/app-config/src/feature.ts +6 -0
- package/samples/recipes/app-config/tsconfig.json +22 -0
- package/samples/recipes/auth-mfa/README.md +14 -0
- package/samples/recipes/auth-mfa/src/feature.ts +7 -0
- package/samples/recipes/compose-stacks/README.md +60 -0
- package/samples/recipes/compose-stacks/package.json +11 -0
- package/samples/recipes/compose-stacks/src/app.ts +44 -0
- package/samples/recipes/env-composition/README.md +36 -0
- package/samples/recipes/env-composition/bin/server.ts +15 -0
- package/samples/recipes/env-composition/package.json +15 -0
- package/samples/recipes/env-composition/src/env.ts +47 -0
- package/samples/recipes/host-routing/README.md +25 -0
- package/samples/recipes/host-routing/package.json +12 -0
- package/samples/recipes/host-routing/src/feature.ts +35 -0
- package/samples/recipes/legal-pages/README.md +15 -0
- package/samples/recipes/legal-pages/src/feature.ts +13 -2
- package/samples/recipes/managed-config/README.md +1 -0
- package/samples/recipes/managed-pages/README.md +1 -0
- package/samples/recipes/prod-boot-options/README.md +48 -0
- package/samples/recipes/prod-boot-options/bin/server.ts +11 -0
- package/samples/recipes/prod-boot-options/package.json +13 -0
- package/samples/recipes/prod-boot-options/src/app.ts +32 -0
- package/samples/recipes/security-baseline/README.md +16 -13
- package/samples/recipes/security-baseline/package.json +2 -1
- package/samples/recipes/security-baseline/src/feature.ts +3 -3
- package/packages/bundled-features/src/file-provider-s3-env/changes.json +0 -1
- package/packages/bundled-features/src/file-provider-s3-env/index.ts +0 -8
- package/packages/bundled-features/src/files-provider-s3/changes.json +0 -1
- package/packages/bundled-features/src/files-provider-s3/index.ts +0 -11
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { mailT } from "@cosmicdrift/kumiko-framework/i18n";
|
|
3
|
+
import { escapeHtml, escapeHtmlAttr } from "@cosmicdrift/kumiko-headless";
|
|
4
|
+
import type { MailChrome, MailChromeLink } from "../renderer-foundation/index.ts";
|
|
5
|
+
import { DELIVERY_RESUBSCRIBE_PATH, DELIVERY_UNSUBSCRIBE_PATH } from "./public-names.ts";
|
|
6
|
+
import "./unsubscribe-page-strings.ts";
|
|
7
|
+
|
|
8
|
+
export type UnsubscribePageState =
|
|
9
|
+
| { readonly kind: "confirm"; readonly token: string }
|
|
10
|
+
// Without a resubscribeToken the page offers no undo button.
|
|
11
|
+
| { readonly kind: "unsubscribed"; readonly resubscribeToken?: string }
|
|
12
|
+
| { readonly kind: "resubscribed" }
|
|
13
|
+
| { readonly kind: "failed" }
|
|
14
|
+
| { readonly kind: "invalid" };
|
|
15
|
+
|
|
16
|
+
export type UnsubscribePageInput = {
|
|
17
|
+
readonly state: UnsubscribePageState;
|
|
18
|
+
/** A locale with registered mail translations (see resolveMailLocale). */
|
|
19
|
+
readonly locale: string;
|
|
20
|
+
/** The tenant's mail look; without it the page shows the plain card. */
|
|
21
|
+
readonly chrome?: MailChrome | null | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// Same values as the in-code mail layout of renderer-mail-html, so the page reads as the mail's sequel.
|
|
25
|
+
const DEFAULT_ACCENT_COLOR = "#1f5468";
|
|
26
|
+
const HEX_COLOR = /^#[0-9a-fA-F]{6}$/;
|
|
27
|
+
const FONT_URL_PREFIX = "/assets/kumiko/fonts/ibm-plex-sans-latin-";
|
|
28
|
+
|
|
29
|
+
function accentOf(chrome: MailChrome | null | undefined): string {
|
|
30
|
+
const accent = chrome?.accentColor;
|
|
31
|
+
return accent !== undefined && HEX_COLOR.test(accent) ? accent : DEFAULT_ACCENT_COLOR;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function httpsOrigin(url: string | undefined): string | undefined {
|
|
35
|
+
if (url === undefined) return undefined;
|
|
36
|
+
try {
|
|
37
|
+
const parsed = new URL(url);
|
|
38
|
+
return parsed.protocol === "https:" ? parsed.origin : undefined;
|
|
39
|
+
} catch {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function webHost(url: string): string | undefined {
|
|
45
|
+
try {
|
|
46
|
+
const parsed = new URL(url);
|
|
47
|
+
return parsed.protocol === "https:" || parsed.protocol === "http:" ? parsed.host : undefined;
|
|
48
|
+
} catch {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const SAFE_LINK_URL = /^(https?:|mailto:)/i;
|
|
54
|
+
|
|
55
|
+
function linkHtml(link: MailChromeLink): string {
|
|
56
|
+
const url = link.url.trim();
|
|
57
|
+
if (!SAFE_LINK_URL.test(url) || link.label.trim() === "") return "";
|
|
58
|
+
return `<a href="${escapeHtmlAttr(url)}">${escapeHtml(link.label)}</a>`;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// The style block is static apart from the validated hex accent and the markup carries
|
|
62
|
+
// no style attributes, so the CSP admits exactly this block by its hash.
|
|
63
|
+
function pageStyle(accent: string): string {
|
|
64
|
+
return `@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:400;font-display:swap;src:url("${FONT_URL_PREFIX}400.woff2") format("woff2")}
|
|
65
|
+
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:600;font-display:swap;src:url("${FONT_URL_PREFIX}600.woff2") format("woff2")}
|
|
66
|
+
:root{--accent:${accent}}
|
|
67
|
+
*{box-sizing:border-box}
|
|
68
|
+
html,body{margin:0;padding:0}
|
|
69
|
+
body{background:#ecedea;color:#2a2f3a;font-family:"IBM Plex Sans",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:16px;line-height:1.65;-webkit-font-smoothing:antialiased}
|
|
70
|
+
.page{max-width:560px;margin:0 auto;padding:48px 16px}
|
|
71
|
+
.card{background:#fff;border:1px solid #dcdfda;border-radius:14px;overflow:hidden}
|
|
72
|
+
.accent{height:4px;background:var(--accent)}
|
|
73
|
+
.brand{display:flex;align-items:center;gap:10px;padding:32px 40px 0}
|
|
74
|
+
.brand img{height:28px;width:auto;max-width:140px;display:block}
|
|
75
|
+
.tile{width:28px;height:28px;line-height:28px;border-radius:8px;background:var(--accent);color:#fff;font-weight:600;font-size:14px;text-align:center;flex:none}
|
|
76
|
+
.name{font-size:15px;font-weight:600;color:#0b0d12}
|
|
77
|
+
.suffix{font-size:13px;color:#5a6170}
|
|
78
|
+
.content{padding:28px 40px 36px}
|
|
79
|
+
h1{margin:0 0 8px;font-size:22px;line-height:1.3;font-weight:600;color:#0b0d12}
|
|
80
|
+
p{margin:0}
|
|
81
|
+
form{margin:24px 0 0}
|
|
82
|
+
.button{display:inline-block;font:inherit;font-weight:600;font-size:15px;line-height:1.4;padding:10px 20px;border-radius:6px;border:1px solid var(--accent);background:var(--accent);color:#fff;cursor:pointer}
|
|
83
|
+
.button.secondary{background:#fff;color:var(--accent)}
|
|
84
|
+
.button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
|
|
85
|
+
.hint{margin-top:24px;font-size:14px;color:#5a6170}
|
|
86
|
+
.hint+form{margin-top:12px}
|
|
87
|
+
.band{background:#fbfbfa;border-top:1px solid #ecedea;padding:16px 40px;font-size:13px;color:#5a6170}
|
|
88
|
+
.band a{color:#4a515e}
|
|
89
|
+
.footer{padding:20px 24px 0;text-align:center;font-size:12px;color:#5a6170}
|
|
90
|
+
.footer a{color:#5a6170}
|
|
91
|
+
@media (max-width:480px){.page{padding:24px 12px}.brand{padding:24px 20px 0}.content{padding:20px 20px 28px}.band{padding:14px 20px}h1{font-size:20px}.button{width:100%}}`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function brandRowHtml(chrome: MailChrome): string {
|
|
95
|
+
const name = chrome.tenantName.trim();
|
|
96
|
+
const initial = Array.from(name)[0]?.toLocaleUpperCase() ?? "";
|
|
97
|
+
const mark =
|
|
98
|
+
httpsOrigin(chrome.logoUrl) !== undefined && chrome.logoUrl !== undefined
|
|
99
|
+
? `<img src="${escapeHtmlAttr(chrome.logoUrl)}" alt="">`
|
|
100
|
+
: initial === ""
|
|
101
|
+
? ""
|
|
102
|
+
: `<span class="tile" aria-hidden="true">${escapeHtml(initial)}</span>`;
|
|
103
|
+
const suffix = chrome.brandSuffix.trim();
|
|
104
|
+
if (mark === "" && name === "") return "";
|
|
105
|
+
return `<div class="brand">${mark}${name === "" ? "" : `<span class="name">${escapeHtml(name)}</span>`}${suffix === "" ? "" : `<span class="suffix">${escapeHtml(suffix)}</span>`}</div>`;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function bandHtml(chrome: MailChrome): string {
|
|
109
|
+
const host = chrome.siteUrl === undefined ? undefined : webHost(chrome.siteUrl);
|
|
110
|
+
if (host === undefined || chrome.siteUrl === undefined) return "";
|
|
111
|
+
return `<div class="band"><a href="${escapeHtmlAttr(chrome.siteUrl)}">${escapeHtml(host)}</a></div>`;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function footerHtml(chrome: MailChrome): string {
|
|
115
|
+
const text = chrome.footerText?.trim() ?? "";
|
|
116
|
+
const links = [chrome.imprint, chrome.privacy]
|
|
117
|
+
.map((link) => (link === undefined ? "" : linkHtml(link)))
|
|
118
|
+
.filter((html) => html !== "");
|
|
119
|
+
const lineHtmls = [
|
|
120
|
+
...(text === "" ? [] : [escapeHtml(text)]),
|
|
121
|
+
...(links.length === 0 ? [] : [links.join(" · ")]),
|
|
122
|
+
];
|
|
123
|
+
const linesHtml = lineHtmls.join("<br>");
|
|
124
|
+
return linesHtml === "" ? "" : `<footer class="footer">${linesHtml}</footer>`;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function tokenForm(action: string, token: string, label: string, variant: string): string {
|
|
128
|
+
return `<form method="post" action="${escapeHtmlAttr(action)}">
|
|
129
|
+
<input type="hidden" name="token" value="${escapeHtmlAttr(token)}">
|
|
130
|
+
<button type="submit" class="${escapeHtmlAttr(variant)}">${escapeHtml(label)}</button>
|
|
131
|
+
</form>`;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
type PageText = { readonly title: string; readonly bodyHtml: string };
|
|
135
|
+
|
|
136
|
+
function pageText(state: UnsubscribePageState, lang: string): PageText {
|
|
137
|
+
const paragraph = (key: string): string => `<p>${escapeHtml(mailT(lang, key))}</p>`;
|
|
138
|
+
switch (state.kind) {
|
|
139
|
+
case "confirm":
|
|
140
|
+
return {
|
|
141
|
+
title: mailT(lang, "mail.unsubscribe.confirmTitle"),
|
|
142
|
+
bodyHtml: `${paragraph("mail.unsubscribe.confirmQuestion")}
|
|
143
|
+
${tokenForm(DELIVERY_UNSUBSCRIBE_PATH, state.token, mailT(lang, "mail.unsubscribe.confirmButton"), "button")}`,
|
|
144
|
+
};
|
|
145
|
+
case "unsubscribed":
|
|
146
|
+
return {
|
|
147
|
+
title: mailT(lang, "mail.unsubscribe.doneTitle"),
|
|
148
|
+
bodyHtml:
|
|
149
|
+
state.resubscribeToken === undefined
|
|
150
|
+
? paragraph("mail.unsubscribe.doneMessage")
|
|
151
|
+
: `${paragraph("mail.unsubscribe.doneMessage")}
|
|
152
|
+
<p class="hint">${escapeHtml(mailT(lang, "mail.unsubscribe.undoHint"))}</p>
|
|
153
|
+
${tokenForm(DELIVERY_RESUBSCRIBE_PATH, state.resubscribeToken, mailT(lang, "mail.unsubscribe.undoButton"), "button secondary")}`,
|
|
154
|
+
};
|
|
155
|
+
case "resubscribed":
|
|
156
|
+
return {
|
|
157
|
+
title: mailT(lang, "mail.unsubscribe.resubscribedTitle"),
|
|
158
|
+
bodyHtml: paragraph("mail.unsubscribe.resubscribedMessage"),
|
|
159
|
+
};
|
|
160
|
+
case "failed":
|
|
161
|
+
return {
|
|
162
|
+
title: mailT(lang, "mail.unsubscribe.failedTitle"),
|
|
163
|
+
bodyHtml: paragraph("mail.unsubscribe.failed"),
|
|
164
|
+
};
|
|
165
|
+
case "invalid":
|
|
166
|
+
return {
|
|
167
|
+
title: mailT(lang, "mail.unsubscribe.invalidTitle"),
|
|
168
|
+
bodyHtml: paragraph("mail.unsubscribe.invalidMessage"),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export type RenderedUnsubscribePage = {
|
|
174
|
+
readonly html: string;
|
|
175
|
+
readonly contentSecurityPolicy: string;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// The page loads nothing but its own style block, the same-origin font and, with
|
|
179
|
+
// branding, the tenant's https logo. Forms only post back to the same origin.
|
|
180
|
+
function contentSecurityPolicy(style: string, chrome: MailChrome | null | undefined): string {
|
|
181
|
+
const styleHash = createHash("sha256").update(style).digest("base64");
|
|
182
|
+
const logoOrigin = httpsOrigin(chrome?.logoUrl);
|
|
183
|
+
return [
|
|
184
|
+
"default-src 'none'",
|
|
185
|
+
`style-src 'sha256-${styleHash}'`,
|
|
186
|
+
"font-src 'self'",
|
|
187
|
+
`img-src 'self' data:${logoOrigin === undefined ? "" : ` ${logoOrigin}`}`,
|
|
188
|
+
"form-action 'self'",
|
|
189
|
+
"base-uri 'none'",
|
|
190
|
+
"frame-ancestors 'none'",
|
|
191
|
+
].join("; ");
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function renderUnsubscribePage(input: UnsubscribePageInput): RenderedUnsubscribePage {
|
|
195
|
+
const { state, locale, chrome } = input;
|
|
196
|
+
const { title, bodyHtml } = pageText(state, locale);
|
|
197
|
+
const style = pageStyle(accentOf(chrome));
|
|
198
|
+
const branded = chrome !== null && chrome !== undefined;
|
|
199
|
+
// html-ok: static CSS whose only variable is the hex-validated accent; escaping would break its quotes and the CSP hash.
|
|
200
|
+
const styleBlockHtml = `<style>${style}</style>`;
|
|
201
|
+
const html = `<!doctype html>
|
|
202
|
+
<html lang="${escapeHtmlAttr(locale)}">
|
|
203
|
+
<head>
|
|
204
|
+
<meta charset="utf-8">
|
|
205
|
+
<meta name="robots" content="noindex">
|
|
206
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
207
|
+
<title>${escapeHtml(title)}</title>
|
|
208
|
+
${styleBlockHtml}
|
|
209
|
+
</head>
|
|
210
|
+
<body>
|
|
211
|
+
<main class="page">
|
|
212
|
+
<div class="card">
|
|
213
|
+
<div class="accent"></div>
|
|
214
|
+
${branded ? brandRowHtml(chrome) : ""}
|
|
215
|
+
<div class="content">
|
|
216
|
+
<h1>${escapeHtml(title)}</h1>
|
|
217
|
+
${bodyHtml}
|
|
218
|
+
</div>
|
|
219
|
+
${branded ? bandHtml(chrome) : ""}
|
|
220
|
+
</div>
|
|
221
|
+
${branded ? footerHtml(chrome) : ""}
|
|
222
|
+
</main>
|
|
223
|
+
</body>
|
|
224
|
+
</html>`;
|
|
225
|
+
return { html, contentSecurityPolicy: contentSecurityPolicy(style, chrome) };
|
|
226
|
+
}
|
|
@@ -6,19 +6,22 @@ import {
|
|
|
6
6
|
signatureRoute,
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/api";
|
|
8
8
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { resolveMailLocale } from "@cosmicdrift/kumiko-framework/i18n";
|
|
10
|
+
import { createFallbackLogger } from "@cosmicdrift/kumiko-framework/logging";
|
|
11
11
|
import { isPlainObject } from "@cosmicdrift/kumiko-types/type-guards";
|
|
12
|
+
import type { Context } from "hono";
|
|
12
13
|
import * as jose from "jose";
|
|
13
14
|
import * as z from "zod";
|
|
14
|
-
import {
|
|
15
|
+
import type { MailChrome } from "../renderer-foundation/index.ts";
|
|
16
|
+
import { hashUnsubscribeAddress } from "./address-opt-out.ts";
|
|
15
17
|
import {
|
|
16
18
|
DELIVERY_RESUBSCRIBE_PATH,
|
|
17
19
|
DELIVERY_UNSUBSCRIBE_PATH,
|
|
18
20
|
DeliveryErrors,
|
|
19
21
|
DeliveryHandlers,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
DeliveryQueries,
|
|
23
|
+
} from "./constants.ts";
|
|
24
|
+
import { renderUnsubscribePage, type UnsubscribePageState } from "./unsubscribe-page.ts";
|
|
22
25
|
|
|
23
26
|
// The mail's locale, so the pages behind the link speak the mail's language. Optional: links
|
|
24
27
|
// signed before the claim existed keep verifying and fall back to English.
|
|
@@ -109,6 +112,32 @@ const UNSUBSCRIBE_TOKEN_INVALID_BODY = {
|
|
|
109
112
|
error: { code: "unsubscribe_token_invalid", message: "Invalid or expired token" },
|
|
110
113
|
} as const;
|
|
111
114
|
|
|
115
|
+
// jose checks the signature and the issuer before the expiry, so the claims of an
|
|
116
|
+
// expired token are authentic: enough to dress the "link expired" page in the
|
|
117
|
+
// tenant's look and language, never enough to write.
|
|
118
|
+
const expiredTokenScopeSchema = z.object({
|
|
119
|
+
iss: z.literal(UNSUBSCRIBE_ISSUER),
|
|
120
|
+
tenantId: z.string().min(1),
|
|
121
|
+
locale: localeClaimSchema,
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
class ExpiredUnsubscribeTokenRejection extends ExtraRouteRejection {
|
|
125
|
+
constructor(
|
|
126
|
+
readonly tenantId: TenantId,
|
|
127
|
+
readonly locale: string | undefined,
|
|
128
|
+
) {
|
|
129
|
+
super(400, UNSUBSCRIBE_TOKEN_INVALID_BODY, "unsubscribe token expired");
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function expiredTokenRejection(err: unknown): ExpiredUnsubscribeTokenRejection | null {
|
|
134
|
+
if (!(err instanceof jose.errors.JWTExpired)) return null;
|
|
135
|
+
const scope = expiredTokenScopeSchema.safeParse(err.payload);
|
|
136
|
+
if (!scope.success) return null;
|
|
137
|
+
// @cast-boundary engine-bridge — string post-zod → branded TenantId
|
|
138
|
+
return new ExpiredUnsubscribeTokenRejection(scope.data.tenantId as TenantId, scope.data.locale);
|
|
139
|
+
}
|
|
140
|
+
|
|
112
141
|
export async function signUnsubscribeToken(
|
|
113
142
|
payload: UnsubscribeTokenPayload,
|
|
114
143
|
secret: string,
|
|
@@ -189,11 +218,6 @@ type VerifiedUnsubscribe =
|
|
|
189
218
|
// one-click client POSTs.
|
|
190
219
|
export const DELIVERY_UNSUBSCRIBE_ONE_CLICK_HEADER_VALUE = "List-Unsubscribe=One-Click" as const;
|
|
191
220
|
|
|
192
|
-
const CONFIRMATION_PAGE_HEADERS = {
|
|
193
|
-
"Cache-Control": "no-store",
|
|
194
|
-
"Referrer-Policy": "no-referrer",
|
|
195
|
-
} as const;
|
|
196
|
-
|
|
197
221
|
// Undo token, handed out only in the response of a successful unsubscribe. A
|
|
198
222
|
// separate audience and a short expiry keep the long-lived mailed unsubscribe
|
|
199
223
|
// link from being able to undo an opt-out (and vice versa).
|
|
@@ -302,10 +326,13 @@ async function verifyUnsubscribeToken(
|
|
|
302
326
|
};
|
|
303
327
|
} catch (err) {
|
|
304
328
|
if (err instanceof ExtraRouteRejection) throw err;
|
|
305
|
-
throw
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
329
|
+
throw (
|
|
330
|
+
expiredTokenRejection(err) ??
|
|
331
|
+
new ExtraRouteRejection(
|
|
332
|
+
400,
|
|
333
|
+
UNSUBSCRIBE_TOKEN_INVALID_BODY,
|
|
334
|
+
"unsubscribe token verification failed",
|
|
335
|
+
)
|
|
309
336
|
);
|
|
310
337
|
}
|
|
311
338
|
}
|
|
@@ -387,76 +414,144 @@ function pageLocale(locale: string | undefined): string {
|
|
|
387
414
|
return resolveMailLocale(locale ?? "en");
|
|
388
415
|
}
|
|
389
416
|
|
|
390
|
-
function htmlPage(locale: string, title: string, bodyHtml: string): string {
|
|
391
|
-
return `<!doctype html>
|
|
392
|
-
<html lang="${escapeHtmlAttr(locale)}">
|
|
393
|
-
<head>
|
|
394
|
-
<meta charset="utf-8">
|
|
395
|
-
<meta name="robots" content="noindex">
|
|
396
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
397
|
-
<title>${escapeHtmlAttr(title)}</title>
|
|
398
|
-
</head>
|
|
399
|
-
<body>
|
|
400
|
-
${bodyHtml}
|
|
401
|
-
</body>
|
|
402
|
-
</html>`;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
function confirmationPage(token: string, locale: string | undefined): string {
|
|
406
|
-
const lang = pageLocale(locale);
|
|
407
|
-
return htmlPage(
|
|
408
|
-
lang,
|
|
409
|
-
mailT(lang, "mail.unsubscribe.confirmTitle"),
|
|
410
|
-
`<p>${escapeHtmlAttr(mailT(lang, "mail.unsubscribe.confirmQuestion"))}</p>
|
|
411
|
-
<form method="post" action="${DELIVERY_UNSUBSCRIBE_PATH}">
|
|
412
|
-
<input type="hidden" name="token" value="${escapeHtmlAttr(token)}">
|
|
413
|
-
<button type="submit">${escapeHtmlAttr(mailT(lang, "mail.unsubscribe.confirmButton"))}</button>
|
|
414
|
-
</form>`,
|
|
415
|
-
);
|
|
416
|
-
}
|
|
417
|
-
|
|
418
417
|
export type UnsubscribeResultPage =
|
|
419
418
|
// Without a resubscribeToken the page offers no undo button.
|
|
420
419
|
| { readonly kind: "unsubscribed"; readonly resubscribeToken?: string }
|
|
421
420
|
| { readonly kind: "resubscribed" }
|
|
422
|
-
| { readonly kind: "failed" }
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
421
|
+
| { readonly kind: "failed" }
|
|
422
|
+
| { readonly kind: "invalid" };
|
|
423
|
+
|
|
424
|
+
/** The result page the unsubscribe routes answer with, for apps serving their own
|
|
425
|
+
* (e.g. legacy) unsubscribe links. Texts come from the mail translations of `locale`;
|
|
426
|
+
* `chrome` (the mail renderer's readMailChrome) adds the tenant's brand row and footer.
|
|
427
|
+
* Served under runProdApp's default CSP the style block and the same-origin font pass;
|
|
428
|
+
* an https logo additionally needs its origin, e.g.
|
|
429
|
+
* `securityHeaders: { csp: { extend: { "img-src": [logoOrigin] } } }`. A hand-written CSP
|
|
430
|
+
* needs `style-src 'unsafe-inline'` as well. */
|
|
426
431
|
export function renderUnsubscribeResultPage(
|
|
427
|
-
page: UnsubscribeResultPage & {
|
|
432
|
+
page: UnsubscribeResultPage & {
|
|
433
|
+
readonly locale?: string | undefined;
|
|
434
|
+
readonly chrome?: MailChrome | null | undefined;
|
|
435
|
+
},
|
|
428
436
|
): string {
|
|
429
|
-
const
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
437
|
+
const { locale, chrome, ...state } = page;
|
|
438
|
+
return renderUnsubscribePage({ state, locale: pageLocale(locale), chrome }).html;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
const NO_STORE_HEADERS = { "Cache-Control": "no-store" } as const;
|
|
442
|
+
|
|
443
|
+
const mailChromeLinkSchema = z.object({ label: z.string(), url: z.string() });
|
|
444
|
+
const mailChromeSchema = z
|
|
445
|
+
.object({
|
|
446
|
+
tenantName: z.string(),
|
|
447
|
+
brandSuffix: z.string(),
|
|
448
|
+
logoUrl: z.string().optional(),
|
|
449
|
+
accentColor: z.string().optional(),
|
|
450
|
+
siteUrl: z.string().optional(),
|
|
451
|
+
footerText: z.string().optional(),
|
|
452
|
+
imprint: mailChromeLinkSchema.optional(),
|
|
453
|
+
privacy: mailChromeLinkSchema.optional(),
|
|
454
|
+
})
|
|
455
|
+
.nullable();
|
|
456
|
+
|
|
457
|
+
// Branding is decoration: an opt-out that went through must never turn into an
|
|
458
|
+
// error page because a footer resolver or the config read failed.
|
|
459
|
+
async function readPageChrome(
|
|
460
|
+
deps: SignatureExtraRouteDeps,
|
|
461
|
+
tenantId: TenantId,
|
|
462
|
+
locale: string,
|
|
463
|
+
): Promise<MailChrome | null> {
|
|
464
|
+
try {
|
|
465
|
+
const result = await deps.dispatchSystemQuery({
|
|
466
|
+
handlerQn: DeliveryQueries.unsubscribePageChrome,
|
|
467
|
+
payload: { locale },
|
|
468
|
+
tenantId,
|
|
469
|
+
});
|
|
470
|
+
const parsed = mailChromeSchema.safeParse(result);
|
|
471
|
+
return parsed.success ? parsed.data : null;
|
|
472
|
+
} catch (err) {
|
|
473
|
+
createFallbackLogger("delivery").warn("unsubscribe page shown without tenant branding", {
|
|
474
|
+
errorName: err instanceof Error ? err.name : typeof err,
|
|
475
|
+
});
|
|
476
|
+
return null;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
type PageScope = { readonly tenantId: TenantId | undefined; readonly locale: string | undefined };
|
|
481
|
+
|
|
482
|
+
// no-referrer on every page: the GET page carries the token in its URL, and the
|
|
483
|
+
// tenant logo and site link would otherwise receive it in the Referer header.
|
|
484
|
+
const PAGE_HEADERS = {
|
|
485
|
+
"Cache-Control": "no-store",
|
|
486
|
+
"Referrer-Policy": "no-referrer",
|
|
487
|
+
} as const;
|
|
488
|
+
|
|
489
|
+
async function pageResponse(
|
|
490
|
+
// biome-ignore lint/suspicious/noExplicitAny: Hono context generics are invisible at the framework boundary
|
|
491
|
+
c: Context<any, any>,
|
|
492
|
+
deps: SignatureExtraRouteDeps,
|
|
493
|
+
state: UnsubscribePageState,
|
|
494
|
+
scope: PageScope,
|
|
495
|
+
status: 200 | 400 | 409 | 500,
|
|
496
|
+
): Promise<Response> {
|
|
497
|
+
const locale = pageLocale(scope.locale);
|
|
498
|
+
const chrome =
|
|
499
|
+
scope.tenantId === undefined ? null : await readPageChrome(deps, scope.tenantId, locale);
|
|
500
|
+
const page = renderUnsubscribePage({ state, locale, chrome });
|
|
501
|
+
return c.html(page.html, status, {
|
|
502
|
+
...PAGE_HEADERS,
|
|
503
|
+
"Content-Security-Policy": page.contentSecurityPolicy,
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
type RejectedForPage = { readonly kind: "rejected" } & PageScope;
|
|
508
|
+
|
|
509
|
+
function localeFromAcceptLanguage(header: string | undefined): string | undefined {
|
|
510
|
+
const first = header?.split(",")[0]?.split(";")[0]?.trim();
|
|
511
|
+
return first !== undefined && first !== "" && localeClaimSchema.safeParse(first).success
|
|
512
|
+
? first
|
|
513
|
+
: undefined;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// A browser lands on a page even for a dead link; API callers keep the JSON 400 from
|
|
517
|
+
// verifyUnsubscribeToken. The rejected result never reaches a write.
|
|
518
|
+
async function verifyForPage(
|
|
519
|
+
token: string | undefined,
|
|
520
|
+
encodedSecret: Uint8Array,
|
|
521
|
+
purpose: TokenPurpose,
|
|
522
|
+
headers: SignatureExtraRouteVerifyRequest["headers"],
|
|
523
|
+
): Promise<VerifiedUnsubscribe | RejectedForPage> {
|
|
524
|
+
try {
|
|
525
|
+
return await verifyUnsubscribeToken(token, encodedSecret, purpose);
|
|
526
|
+
} catch (err) {
|
|
527
|
+
if (err instanceof ExpiredUnsubscribeTokenRejection) {
|
|
528
|
+
return {
|
|
529
|
+
kind: "rejected",
|
|
530
|
+
tenantId: err.tenantId,
|
|
531
|
+
locale: err.locale ?? localeFromAcceptLanguage(headers["accept-language"]),
|
|
532
|
+
};
|
|
445
533
|
}
|
|
446
|
-
|
|
447
|
-
return
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
case "failed": {
|
|
453
|
-
const message = mailT(lang, "mail.unsubscribe.failed");
|
|
454
|
-
return htmlPage(lang, message, `<p>${escapeHtmlAttr(message)}</p>`);
|
|
534
|
+
if (err instanceof ExtraRouteRejection) {
|
|
535
|
+
return {
|
|
536
|
+
kind: "rejected",
|
|
537
|
+
tenantId: undefined,
|
|
538
|
+
locale: localeFromAcceptLanguage(headers["accept-language"]),
|
|
539
|
+
};
|
|
455
540
|
}
|
|
541
|
+
throw err;
|
|
456
542
|
}
|
|
457
543
|
}
|
|
458
544
|
|
|
459
|
-
|
|
545
|
+
async function verifyPost(
|
|
546
|
+
request: SignatureExtraRouteVerifyRequest,
|
|
547
|
+
token: string | undefined,
|
|
548
|
+
encodedSecret: Uint8Array,
|
|
549
|
+
purpose: TokenPurpose,
|
|
550
|
+
): Promise<VerifiedUnsubscribe | RejectedForPage> {
|
|
551
|
+
return isFormRequest(request.headers["content-type"])
|
|
552
|
+
? verifyForPage(token, encodedSecret, purpose, request.headers)
|
|
553
|
+
: verifyUnsubscribeToken(token, encodedSecret, purpose);
|
|
554
|
+
}
|
|
460
555
|
|
|
461
556
|
function isFormRequest(contentType: string | undefined): boolean {
|
|
462
557
|
return contentType?.includes("application/x-www-form-urlencoded") === true;
|
|
@@ -499,52 +594,52 @@ export function createUnsubscribeRoutes(
|
|
|
499
594
|
assertUnsubscribeSecret(options.secret, "createUnsubscribeRoutes");
|
|
500
595
|
const encodedSecret = new TextEncoder().encode(options.secret);
|
|
501
596
|
|
|
502
|
-
const confirmRoute = signatureRoute<
|
|
597
|
+
const confirmRoute = signatureRoute<
|
|
598
|
+
({ readonly kind: "confirm"; readonly token: string } & PageScope) | RejectedForPage
|
|
599
|
+
>({
|
|
503
600
|
method: "GET",
|
|
504
601
|
path: DELIVERY_UNSUBSCRIBE_PATH,
|
|
505
602
|
entry: "signature",
|
|
506
|
-
verify: async ({ query }) => {
|
|
603
|
+
verify: async ({ query, headers }) => {
|
|
507
604
|
const token = query["token"];
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
);
|
|
514
|
-
}
|
|
515
|
-
const verified = await verifyUnsubscribeToken(token, encodedSecret, "unsubscribe");
|
|
516
|
-
return { token, locale: verified.locale };
|
|
605
|
+
const verified = await verifyForPage(token, encodedSecret, "unsubscribe", headers);
|
|
606
|
+
if (verified.kind === "rejected") return verified;
|
|
607
|
+
// verifyForPage only accepts a present token, the check is for the type.
|
|
608
|
+
if (token === undefined) return { kind: "rejected", tenantId: undefined, locale: undefined };
|
|
609
|
+
return { kind: "confirm", token, tenantId: verified.tenantId, locale: verified.locale };
|
|
517
610
|
},
|
|
518
|
-
handler: async (c,
|
|
519
|
-
|
|
611
|
+
handler: async (c, verified, deps) =>
|
|
612
|
+
verified.kind === "rejected"
|
|
613
|
+
? pageResponse(c, deps, { kind: "invalid" }, verified, 400)
|
|
614
|
+
: pageResponse(c, deps, { kind: "confirm", token: verified.token }, verified, 200),
|
|
520
615
|
});
|
|
521
616
|
|
|
522
|
-
const writeRoute = signatureRoute<VerifiedUnsubscribe>({
|
|
617
|
+
const writeRoute = signatureRoute<VerifiedUnsubscribe | RejectedForPage>({
|
|
523
618
|
method: "POST",
|
|
524
619
|
path: DELIVERY_UNSUBSCRIBE_PATH,
|
|
525
620
|
entry: "signature",
|
|
526
621
|
verify: async (request) =>
|
|
527
|
-
|
|
622
|
+
verifyPost(request, tokenFromPostRequest(request), encodedSecret, "unsubscribe"),
|
|
528
623
|
handler: async (c, verified, deps) => {
|
|
624
|
+
if (verified.kind === "rejected") {
|
|
625
|
+
return pageResponse(c, deps, { kind: "invalid" }, verified, 400);
|
|
626
|
+
}
|
|
529
627
|
// Token-verify passed — everything below is a legitimate write. Don't
|
|
530
628
|
// swallow write-errors as "invalid token", that would mask real bugs
|
|
531
629
|
// (e.g. events-table missing, DB down) behind a misleading 400.
|
|
532
630
|
const succeeded = await dispatchUnsubscribeWrite(verified, deps);
|
|
533
631
|
if (!succeeded) {
|
|
534
|
-
return c
|
|
535
|
-
renderUnsubscribeResultPage({ kind: "failed", locale: verified.locale }),
|
|
536
|
-
500,
|
|
537
|
-
NO_STORE_HEADERS,
|
|
538
|
-
);
|
|
632
|
+
return pageResponse(c, deps, { kind: "failed" }, verified, 500);
|
|
539
633
|
}
|
|
540
|
-
return
|
|
541
|
-
|
|
634
|
+
return pageResponse(
|
|
635
|
+
c,
|
|
636
|
+
deps,
|
|
637
|
+
{
|
|
542
638
|
kind: "unsubscribed",
|
|
543
639
|
resubscribeToken: await signResubscribeToken(verified, encodedSecret),
|
|
544
|
-
|
|
545
|
-
|
|
640
|
+
},
|
|
641
|
+
verified,
|
|
546
642
|
200,
|
|
547
|
-
NO_STORE_HEADERS,
|
|
548
643
|
);
|
|
549
644
|
},
|
|
550
645
|
});
|
|
@@ -552,26 +647,27 @@ export function createUnsubscribeRoutes(
|
|
|
552
647
|
// Undo direction: token only from the JSON/form body, never the query
|
|
553
648
|
// (see tokenFromRequestBody) — no GET confirmation-page variant,
|
|
554
649
|
// this is a one-shot POST from the unsubscribe-page's "Undo" button.
|
|
555
|
-
const resubscribeRoute = signatureRoute<VerifiedUnsubscribe>({
|
|
650
|
+
const resubscribeRoute = signatureRoute<VerifiedUnsubscribe | RejectedForPage>({
|
|
556
651
|
method: "POST",
|
|
557
652
|
path: DELIVERY_RESUBSCRIBE_PATH,
|
|
558
653
|
entry: "signature",
|
|
559
654
|
verify: async (request) =>
|
|
560
|
-
|
|
655
|
+
verifyPost(request, tokenFromRequestBody(request), encodedSecret, "resubscribe"),
|
|
561
656
|
handler: async (c, verified, deps) => {
|
|
657
|
+
if (verified.kind === "rejected") {
|
|
658
|
+
return pageResponse(c, deps, { kind: "invalid" }, verified, 400);
|
|
659
|
+
}
|
|
562
660
|
const outcome = await dispatchResubscribeWrite(verified, deps);
|
|
563
661
|
// The undo button on the unsubscribed page posts a form; a browser should land on a page.
|
|
564
662
|
if (isFormRequest(c.req.header("content-type"))) {
|
|
565
663
|
return outcome === "success"
|
|
566
|
-
? c
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
renderUnsubscribeResultPage({ kind: "failed", locale: verified.locale }),
|
|
664
|
+
? pageResponse(c, deps, { kind: "resubscribed" }, verified, 200)
|
|
665
|
+
: pageResponse(
|
|
666
|
+
c,
|
|
667
|
+
deps,
|
|
668
|
+
{ kind: "failed" },
|
|
669
|
+
verified,
|
|
573
670
|
outcome === "limit_reached" ? 409 : 500,
|
|
574
|
-
NO_STORE_HEADERS,
|
|
575
671
|
);
|
|
576
672
|
}
|
|
577
673
|
if (outcome === "limit_reached") {
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "@cosmicdrift/kumiko-framework/db";
|
|
21
21
|
import type { SessionUser, TenantId, WriteResult } from "@cosmicdrift/kumiko-framework/engine";
|
|
22
22
|
import { generateDeterministicId } from "@cosmicdrift/kumiko-framework/utils";
|
|
23
|
-
import { notificationPreferenceEntity, notificationPreferencesTable } from "./tables.
|
|
23
|
+
import { notificationPreferenceEntity, notificationPreferencesTable } from "./tables.ts";
|
|
24
24
|
|
|
25
25
|
const executor = createEventStoreExecutor(
|
|
26
26
|
notificationPreferencesTable,
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
DELIVERY_STATUS_CELL_COMPONENT,
|
|
9
9
|
DELIVERY_TIME_CELL_COMPONENT,
|
|
10
10
|
DELIVERY_TYPE_CELL_COMPONENT,
|
|
11
|
-
} from "../public-names.
|
|
12
|
-
import { DeliveryChannelCell } from "./delivery-channel-cell.
|
|
13
|
-
import { DeliveryErrorCell } from "./delivery-error-cell.
|
|
14
|
-
import { DeliveryStatusCell } from "./delivery-status-cell.
|
|
15
|
-
import { DeliveryTimeCell } from "./delivery-time-cell.
|
|
16
|
-
import { DeliveryTypeCell } from "./delivery-type-cell.
|
|
11
|
+
} from "../public-names.ts";
|
|
12
|
+
import { DeliveryChannelCell } from "./delivery-channel-cell.tsx";
|
|
13
|
+
import { DeliveryErrorCell } from "./delivery-error-cell.tsx";
|
|
14
|
+
import { DeliveryStatusCell } from "./delivery-status-cell.tsx";
|
|
15
|
+
import { DeliveryTimeCell } from "./delivery-time-cell.tsx";
|
|
16
|
+
import { DeliveryTypeCell } from "./delivery-type-cell.tsx";
|
|
17
17
|
|
|
18
18
|
export type DeliveryClientOptions = {
|
|
19
19
|
readonly translations?: TranslationsByLocale;
|