@cosmicdrift/kumiko-samples 0.368.0 → 0.370.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 +8 -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 +2 -2
- 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 +8 -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 +16 -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 +6 -5
- 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 +2 -2
- 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 +13 -0
- package/packages/bundled-features/src/channel-email/email-channel.ts +43 -12
- package/packages/bundled-features/src/channel-email/env.ts +28 -0
- package/packages/bundled-features/src/channel-email/feature.ts +9 -5
- package/packages/bundled-features/src/channel-email/index.ts +10 -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/i18n.ts +1 -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 +12 -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 +16 -14
- 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 +26 -19
- 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 +217 -92
- 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 +22 -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 +71 -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 +21 -15
- package/packages/bundled-features/src/mail-foundation/i18n.ts +8 -0
- 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 +6 -3
- package/packages/bundled-features/src/mail-transport-inmemory/index.ts +1 -2
- package/packages/bundled-features/src/mail-transport-smtp/changes.json +15 -0
- package/packages/bundled-features/src/mail-transport-smtp/config-keys.ts +67 -0
- package/packages/bundled-features/src/mail-transport-smtp/feature.ts +6 -36
- package/packages/bundled-features/src/mail-transport-smtp/i18n.ts +28 -0
- 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 +18 -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 +34 -15
- package/packages/bundled-features/src/secrets/handlers/delete.write.ts +8 -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 +8 -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 -2
- 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 +9 -7
- 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/changes.json +6 -0
- 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 +38 -35
- 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 +46 -9
- 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 +59 -18
- 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,81 @@
|
|
|
1
|
+
import { defineWriteHandler, type HandlerContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
|
+
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
import {
|
|
6
|
+
WAITLIST_AUDIT_AGGREGATE_TYPE,
|
|
7
|
+
WAITLIST_EXPORTED_EVENT_QN,
|
|
8
|
+
WAITLIST_PURGED_EVENT_QN,
|
|
9
|
+
WaitlistErrors,
|
|
10
|
+
} from "../constants.ts";
|
|
11
|
+
import { listAllWaitlistRows, purgeWaitlistRows } from "../entries-admin.ts";
|
|
12
|
+
import { adminAccess, waitlistDb } from "../lib.ts";
|
|
13
|
+
|
|
14
|
+
export type WaitlistExportData = {
|
|
15
|
+
readonly count: number;
|
|
16
|
+
readonly entries: readonly Record<string, unknown>[];
|
|
17
|
+
};
|
|
18
|
+
export type WaitlistPurgeData = { readonly purged: number };
|
|
19
|
+
|
|
20
|
+
const PurgeSchema = z.object({ confirmCount: z.number().int().min(0) }).strict();
|
|
21
|
+
const ExportSchema = z.object({}).strict();
|
|
22
|
+
|
|
23
|
+
async function appendAudit(ctx: HandlerContext, type: string, count: number): Promise<void> {
|
|
24
|
+
await ctx.unsafeAppendEvent({
|
|
25
|
+
aggregateId: generateId(),
|
|
26
|
+
aggregateType: WAITLIST_AUDIT_AGGREGATE_TYPE,
|
|
27
|
+
type,
|
|
28
|
+
payload: { count },
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function exportedRow(row: Record<string, unknown>): Record<string, unknown> {
|
|
33
|
+
return {
|
|
34
|
+
id: row["id"],
|
|
35
|
+
name: row["name"],
|
|
36
|
+
email: row["email"],
|
|
37
|
+
company: row["company"],
|
|
38
|
+
portfolio: row["portfolio"],
|
|
39
|
+
message: row["message"],
|
|
40
|
+
locale: row["locale"],
|
|
41
|
+
status: row["status"],
|
|
42
|
+
submittedAt: String(row["submittedAt"] ?? ""),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const exportHandler = defineWriteHandler<"export", typeof ExportSchema, WaitlistExportData>({
|
|
47
|
+
name: "export",
|
|
48
|
+
schema: ExportSchema,
|
|
49
|
+
access: adminAccess,
|
|
50
|
+
agent: { expose: false, risk: "high" },
|
|
51
|
+
description:
|
|
52
|
+
"Returns every waitlist entry with its personal data for a hand-over and records the export as an audit event that carries only the count.",
|
|
53
|
+
handler: async (_event, ctx) => {
|
|
54
|
+
const rows = await listAllWaitlistRows(waitlistDb(ctx));
|
|
55
|
+
await appendAudit(ctx, WAITLIST_EXPORTED_EVENT_QN, rows.length);
|
|
56
|
+
return { isSuccess: true, data: { count: rows.length, entries: rows.map(exportedRow) } };
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export const purgeHandler = defineWriteHandler<"purge", typeof PurgeSchema, WaitlistPurgeData>({
|
|
61
|
+
name: "purge",
|
|
62
|
+
schema: PurgeSchema,
|
|
63
|
+
access: adminAccess,
|
|
64
|
+
agent: { expose: false, risk: "high" },
|
|
65
|
+
description:
|
|
66
|
+
"Erases every waitlist entry and shreds its personal data. confirmCount must equal the current entry count, so a stale export cannot purge newer entries.",
|
|
67
|
+
handler: async (event, ctx) => {
|
|
68
|
+
const db = waitlistDb(ctx);
|
|
69
|
+
const rows = await listAllWaitlistRows(db);
|
|
70
|
+
if (rows.length !== event.payload.confirmCount) {
|
|
71
|
+
return writeFailure(
|
|
72
|
+
new UnprocessableError(WaitlistErrors.confirmCountMismatch, {
|
|
73
|
+
details: { confirmCount: event.payload.confirmCount, actualCount: rows.length },
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
await purgeWaitlistRows(db, rows, event.user.id);
|
|
78
|
+
await appendAudit(ctx, WAITLIST_PURGED_EVENT_QN, rows.length);
|
|
79
|
+
return { isSuccess: true, data: { purged: rows.length } };
|
|
80
|
+
},
|
|
81
|
+
});
|
|
@@ -14,19 +14,19 @@ import {
|
|
|
14
14
|
writeFailure,
|
|
15
15
|
} from "@cosmicdrift/kumiko-framework/errors";
|
|
16
16
|
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
17
|
-
import { AuthErrors, AuthHandlers } from "../../auth-email-password/index.
|
|
18
|
-
import { TenantHandlers, tenantTable } from "../../tenant/index.
|
|
19
|
-
import { DEFAULT_OWN_TENANT_INVITE_ROLE, WAITLIST_STATUS, WaitlistErrors } from "../constants.
|
|
20
|
-
import { isOpenWaitlistStatus } from "../entity.
|
|
17
|
+
import { AuthErrors, AuthHandlers } from "../../auth-email-password/index.ts";
|
|
18
|
+
import { TenantHandlers, tenantTable } from "../../tenant/index.ts";
|
|
19
|
+
import { DEFAULT_OWN_TENANT_INVITE_ROLE, WAITLIST_STATUS, WaitlistErrors } from "../constants.ts";
|
|
20
|
+
import { isOpenWaitlistStatus } from "../entity.ts";
|
|
21
21
|
import {
|
|
22
22
|
adminAccess,
|
|
23
23
|
isTenantMember,
|
|
24
24
|
platformActor,
|
|
25
25
|
waitlistDb,
|
|
26
26
|
waitlistExecutor,
|
|
27
|
-
} from "../lib.
|
|
28
|
-
import type { WaitlistInviteOptions } from "../options.
|
|
29
|
-
import { WaitlistIdSchema } from "../payloads.
|
|
27
|
+
} from "../lib.ts";
|
|
28
|
+
import type { WaitlistInviteOptions } from "../options.ts";
|
|
29
|
+
import { WaitlistIdSchema } from "../payloads.ts";
|
|
30
30
|
|
|
31
31
|
export type WaitlistInviteData = {
|
|
32
32
|
readonly kind: "invited";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineEntityListHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { waitlistEntryEntity } from "../entity.
|
|
3
|
-
import { adminAccess } from "../lib.
|
|
2
|
+
import { waitlistEntryEntity } from "../entity.ts";
|
|
3
|
+
import { adminAccess } from "../lib.ts";
|
|
4
4
|
|
|
5
5
|
// Entity-convention list: the QN waitlist:query:waitlist-entry:list is what the
|
|
6
6
|
// entityList screen resolves; paging, search and sort come from the entity flags.
|
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
cancelPendingInvitation,
|
|
17
17
|
INVITATION_STATUS,
|
|
18
18
|
tenantInvitationsTable,
|
|
19
|
-
} from "../../tenant/index.
|
|
20
|
-
import { WAITLIST_STATUS, WaitlistErrors } from "../constants.
|
|
21
|
-
import { isOpenWaitlistStatus } from "../entity.
|
|
19
|
+
} from "../../tenant/index.ts";
|
|
20
|
+
import { WAITLIST_STATUS, WaitlistErrors } from "../constants.ts";
|
|
21
|
+
import { isOpenWaitlistStatus } from "../entity.ts";
|
|
22
22
|
import {
|
|
23
23
|
adminAccess,
|
|
24
24
|
isTenantMember,
|
|
@@ -26,8 +26,8 @@ import {
|
|
|
26
26
|
platformActor,
|
|
27
27
|
waitlistDb,
|
|
28
28
|
waitlistExecutor,
|
|
29
|
-
} from "../lib.
|
|
30
|
-
import { WaitlistIdSchema } from "../payloads.
|
|
29
|
+
} from "../lib.ts";
|
|
30
|
+
import { WaitlistIdSchema } from "../payloads.ts";
|
|
31
31
|
|
|
32
32
|
export type WaitlistRejectData = { readonly kind: "rejected"; readonly id: string };
|
|
33
33
|
|
|
@@ -7,20 +7,20 @@ import {
|
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
9
9
|
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
10
|
-
import { WAITLIST_NOTIFICATION_TYPES, WAITLIST_STATUS } from "../constants.
|
|
11
|
-
import { normalizeEmail, platformActor, waitlistDb, waitlistExecutor } from "../lib.
|
|
10
|
+
import { WAITLIST_NOTIFICATION_TYPES, WAITLIST_STATUS } from "../constants.ts";
|
|
11
|
+
import { normalizeEmail, platformActor, waitlistDb, waitlistExecutor } from "../lib.ts";
|
|
12
12
|
import {
|
|
13
13
|
resolveWaitlistAdminMailLocale,
|
|
14
14
|
resolveWaitlistMailLocale,
|
|
15
15
|
waitlistAdminNoticeVariables,
|
|
16
16
|
waitlistConfirmationVariables,
|
|
17
|
-
} from "../mail.
|
|
17
|
+
} from "../mail.ts";
|
|
18
18
|
import {
|
|
19
19
|
DEFAULT_SUBMIT_EMAIL_RATE_LIMITS,
|
|
20
20
|
DEFAULT_SUBMIT_RATE_LIMIT,
|
|
21
21
|
type WaitlistOptions,
|
|
22
|
-
} from "../options.
|
|
23
|
-
import { type WaitlistSubmitInput, WaitlistSubmitSchema } from "../payloads.
|
|
22
|
+
} from "../options.ts";
|
|
23
|
+
import { type WaitlistSubmitInput, WaitlistSubmitSchema } from "../payloads.ts";
|
|
24
24
|
|
|
25
25
|
// pg_advisory_xact_lock namespace (int4): 'wlst' as ASCII, disjoint from the
|
|
26
26
|
// framework's other fixed advisory-lock keys.
|
|
@@ -28,6 +28,10 @@ export const WAITLIST_I18N: Readonly<Record<string, LocalizedString>> = {
|
|
|
28
28
|
en: "Invited",
|
|
29
29
|
de: "Eingeladen",
|
|
30
30
|
},
|
|
31
|
+
"waitlist:entity:waitlistEntry:field:status:option:provisioned": {
|
|
32
|
+
en: "Provisioned",
|
|
33
|
+
de: "Eingerichtet",
|
|
34
|
+
},
|
|
31
35
|
"waitlist:entity:waitlistEntry:field:status:option:rejected": {
|
|
32
36
|
en: "Rejected",
|
|
33
37
|
de: "Abgelehnt",
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import type { TenantDb } from "@cosmicdrift/kumiko-framework/db";
|
|
3
|
+
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
|
+
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
5
|
+
import type { WaitlistStatus } from "./constants.ts";
|
|
6
|
+
import { normalizeEmail, platformActor, waitlistExecutor } from "./lib.ts";
|
|
7
|
+
|
|
8
|
+
export type WaitlistImportEntry = {
|
|
9
|
+
/** Stable identity of the source row (e.g. `offlot:<uuid>`); the new entry id derives from it. */
|
|
10
|
+
readonly sourceKey: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly email: string;
|
|
13
|
+
readonly locale: string;
|
|
14
|
+
readonly status: WaitlistStatus;
|
|
15
|
+
readonly submittedAt: Temporal.Instant;
|
|
16
|
+
readonly company?: string;
|
|
17
|
+
readonly portfolio?: string;
|
|
18
|
+
readonly message?: string;
|
|
19
|
+
readonly invitedAt?: Temporal.Instant;
|
|
20
|
+
readonly invitedBy?: string;
|
|
21
|
+
readonly provisionedAt?: Temporal.Instant;
|
|
22
|
+
readonly linkedTenantId?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type WaitlistImportOutcome = "created" | "skipped";
|
|
26
|
+
|
|
27
|
+
// RFC 4122 name-based UUID (v5 layout, fixed namespace) so a re-run finds the entry
|
|
28
|
+
// it created before without matching on encrypted personal data.
|
|
29
|
+
const IMPORT_NAMESPACE = "kumiko-waitlist-import";
|
|
30
|
+
|
|
31
|
+
export function waitlistImportId(sourceKey: string): string {
|
|
32
|
+
const bytes = createHash("sha1").update(`${IMPORT_NAMESPACE}:${sourceKey}`).digest();
|
|
33
|
+
const byte6 = bytes[6] ?? 0;
|
|
34
|
+
const byte8 = bytes[8] ?? 0;
|
|
35
|
+
bytes[6] = (byte6 & 0x0f) | 0x50;
|
|
36
|
+
bytes[8] = (byte8 & 0x3f) | 0x80;
|
|
37
|
+
const hex = bytes.subarray(0, 16).toString("hex");
|
|
38
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20, 32)}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function presentOnly(fields: Record<string, unknown>): Record<string, unknown> {
|
|
42
|
+
return Object.fromEntries(Object.entries(fields).filter(([, value]) => value !== undefined));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Writes through the entity executor, so events, projection and subject encryption
|
|
46
|
+
// behave exactly as for a live submit. No mail, no rate limit, no duplicate-by-email
|
|
47
|
+
// check: the source row is the truth and the id makes the call idempotent.
|
|
48
|
+
export async function importWaitlistEntry(
|
|
49
|
+
db: TenantDb,
|
|
50
|
+
entry: WaitlistImportEntry,
|
|
51
|
+
options: { readonly dryRun?: boolean } = {},
|
|
52
|
+
): Promise<WaitlistImportOutcome> {
|
|
53
|
+
const id = waitlistImportId(entry.sourceKey);
|
|
54
|
+
const existing = await waitlistExecutor.detail({ id }, platformActor(), db);
|
|
55
|
+
if (existing) return "skipped";
|
|
56
|
+
if (options.dryRun === true) return "created";
|
|
57
|
+
const created = await waitlistExecutor.create(
|
|
58
|
+
{
|
|
59
|
+
id,
|
|
60
|
+
name: entry.name,
|
|
61
|
+
email: normalizeEmail(entry.email),
|
|
62
|
+
locale: entry.locale,
|
|
63
|
+
status: entry.status,
|
|
64
|
+
submittedAt: entry.submittedAt,
|
|
65
|
+
...presentOnly({
|
|
66
|
+
company: entry.company,
|
|
67
|
+
portfolio: entry.portfolio,
|
|
68
|
+
message: entry.message,
|
|
69
|
+
invitedAt: entry.invitedAt,
|
|
70
|
+
invitedBy: entry.invitedBy,
|
|
71
|
+
provisionedAt: entry.provisionedAt,
|
|
72
|
+
linkedTenantId: entry.linkedTenantId,
|
|
73
|
+
}),
|
|
74
|
+
},
|
|
75
|
+
platformActor(),
|
|
76
|
+
db,
|
|
77
|
+
);
|
|
78
|
+
if (!created.isSuccess)
|
|
79
|
+
throw new InternalError({
|
|
80
|
+
message: `waitlist import failed for ${entry.sourceKey}: ${created.error.code}`,
|
|
81
|
+
});
|
|
82
|
+
return "created";
|
|
83
|
+
}
|
|
@@ -8,8 +8,26 @@ export {
|
|
|
8
8
|
WaitlistHandlers,
|
|
9
9
|
WaitlistQueries,
|
|
10
10
|
type WaitlistStatus,
|
|
11
|
-
} from "./constants.
|
|
12
|
-
export { isOpenWaitlistStatus, waitlistEntryEntity, waitlistEntryTable } from "./entity.
|
|
13
|
-
export { createWaitlistFeature } from "./feature.
|
|
14
|
-
export
|
|
15
|
-
|
|
11
|
+
} from "./constants.ts";
|
|
12
|
+
export { isOpenWaitlistStatus, waitlistEntryEntity, waitlistEntryTable } from "./entity.ts";
|
|
13
|
+
export { createWaitlistFeature } from "./feature.ts";
|
|
14
|
+
export {
|
|
15
|
+
importWaitlistEntry,
|
|
16
|
+
type WaitlistImportEntry,
|
|
17
|
+
type WaitlistImportOutcome,
|
|
18
|
+
waitlistImportId,
|
|
19
|
+
} from "./import.ts";
|
|
20
|
+
export {
|
|
21
|
+
DEFAULT_IMPORT_LOCALE,
|
|
22
|
+
DEFAULT_LEGACY_SOURCE_TABLE,
|
|
23
|
+
isLegacyWaitlistSource,
|
|
24
|
+
LEGACY_WAITLIST_SOURCES,
|
|
25
|
+
type LegacyWaitlistMigrateOptions,
|
|
26
|
+
type LegacyWaitlistMigrateReport,
|
|
27
|
+
type LegacyWaitlistSource,
|
|
28
|
+
migrateLegacyWaitlist,
|
|
29
|
+
offlotLegacyTable,
|
|
30
|
+
publicstatusLegacyTable,
|
|
31
|
+
} from "./legacy-migrate.ts";
|
|
32
|
+
export type { WaitlistInviteOptions, WaitlistOptions } from "./options.ts";
|
|
33
|
+
export { type WaitlistSubmitInput, WaitlistSubmitSchema } from "./payloads.ts";
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import {
|
|
2
|
+
configuredPiiSubjectKms,
|
|
3
|
+
decryptPiiFieldValues,
|
|
4
|
+
isPiiCiphertext,
|
|
5
|
+
PII_ERASED_SENTINEL,
|
|
6
|
+
} from "@cosmicdrift/kumiko-framework/crypto";
|
|
7
|
+
import {
|
|
8
|
+
createTenantDb,
|
|
9
|
+
selectMany,
|
|
10
|
+
table,
|
|
11
|
+
text as textColumn,
|
|
12
|
+
timestamp,
|
|
13
|
+
transaction,
|
|
14
|
+
uuid,
|
|
15
|
+
} from "@cosmicdrift/kumiko-framework/db";
|
|
16
|
+
import { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
17
|
+
import type { DbConnection } from "@cosmicdrift/kumiko-types/db-connection";
|
|
18
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
19
|
+
import { WAITLIST_STATUS, type WaitlistStatus } from "./constants.ts";
|
|
20
|
+
import { importWaitlistEntry, type WaitlistImportEntry } from "./import.ts";
|
|
21
|
+
|
|
22
|
+
export const LEGACY_WAITLIST_SOURCES = ["offlot", "publicstatus"] as const;
|
|
23
|
+
export type LegacyWaitlistSource = (typeof LEGACY_WAITLIST_SOURCES)[number];
|
|
24
|
+
|
|
25
|
+
export function isLegacyWaitlistSource(value: string | undefined): value is LegacyWaitlistSource {
|
|
26
|
+
return LEGACY_WAITLIST_SOURCES.some((known) => known === value);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const DEFAULT_LEGACY_SOURCE_TABLE: Readonly<Record<LegacyWaitlistSource, string>> = {
|
|
30
|
+
offlot: "read_waitlist_entries",
|
|
31
|
+
publicstatus: "marketing_waitlist",
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const DEFAULT_IMPORT_LOCALE = "en";
|
|
35
|
+
|
|
36
|
+
export type LegacyWaitlistMigrateOptions = {
|
|
37
|
+
readonly from: LegacyWaitlistSource;
|
|
38
|
+
readonly dryRun: boolean;
|
|
39
|
+
readonly sourceTable: string;
|
|
40
|
+
/** publicstatus rows carry no language; every imported entry gets this one. */
|
|
41
|
+
readonly defaultLocale: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type LegacyWaitlistMigrateReport = {
|
|
45
|
+
readonly read: number;
|
|
46
|
+
readonly created: number;
|
|
47
|
+
readonly skipped: number;
|
|
48
|
+
readonly unreadable: number;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type LegacyRow = Readonly<Record<string, unknown>>;
|
|
52
|
+
|
|
53
|
+
function toInstant(value: unknown): Temporal.Instant | undefined {
|
|
54
|
+
if (value === null || value === undefined) return undefined;
|
|
55
|
+
if (value instanceof Temporal.Instant) return value;
|
|
56
|
+
if (value instanceof Date) return Temporal.Instant.fromEpochMilliseconds(Number(value));
|
|
57
|
+
if (typeof value !== "string") return undefined;
|
|
58
|
+
try {
|
|
59
|
+
return Temporal.Instant.from(value);
|
|
60
|
+
} catch {
|
|
61
|
+
// Temporal.Instant.from throws RangeError for a non-ISO string.
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function nonEmpty(value: unknown): string | undefined {
|
|
67
|
+
return typeof value === "string" && value.trim() !== "" ? value : undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function isWaitlistStatus(value: string | undefined): value is WaitlistStatus {
|
|
71
|
+
return Object.values(WAITLIST_STATUS).some((known) => known === value);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Legacy offlot rows may hold subject ciphertext; decryption is self-describing and
|
|
75
|
+
// needs the same KMS the app ran with. Without it the value cannot be read, so the
|
|
76
|
+
// caller counts the row as unreadable instead of importing ciphertext as the name.
|
|
77
|
+
async function readPii(value: unknown, field: string): Promise<string | undefined> {
|
|
78
|
+
const raw = nonEmpty(value);
|
|
79
|
+
if (raw === undefined || !isPiiCiphertext(raw)) return raw;
|
|
80
|
+
const kms = configuredPiiSubjectKms();
|
|
81
|
+
if (!kms) return undefined;
|
|
82
|
+
const decrypted = await decryptPiiFieldValues({ [field]: raw }, [field], kms, {
|
|
83
|
+
requestId: "waitlist-migrate",
|
|
84
|
+
});
|
|
85
|
+
const plain = decrypted[field];
|
|
86
|
+
return typeof plain === "string" && plain !== PII_ERASED_SENTINEL ? plain : undefined;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Source columns without a FW counterpart (city, stock, country, notes) are kept
|
|
90
|
+
// as labelled lines in `message`, so no information is lost.
|
|
91
|
+
function offlotMessage(row: LegacyRow): string | undefined {
|
|
92
|
+
const lines = [
|
|
93
|
+
["City", nonEmpty(row["city"])],
|
|
94
|
+
["Stock", nonEmpty(row["stock"])],
|
|
95
|
+
["Country", nonEmpty(row["country"])],
|
|
96
|
+
["Notes", nonEmpty(row["notes"])],
|
|
97
|
+
].flatMap(([label, value]) => (value === undefined ? [] : [`${label}: ${value}`]));
|
|
98
|
+
return lines.length === 0 ? undefined : lines.join("\n");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export async function mapOfflotRow(row: LegacyRow): Promise<WaitlistImportEntry | undefined> {
|
|
102
|
+
const id = nonEmpty(row["id"]);
|
|
103
|
+
const name = await readPii(row["name"], "name");
|
|
104
|
+
const email = await readPii(row["email"], "email");
|
|
105
|
+
const submittedAt = toInstant(row["submittedAt"]);
|
|
106
|
+
const status = nonEmpty(row["status"]);
|
|
107
|
+
if (!id || !name || !email || !submittedAt || !isWaitlistStatus(status)) return undefined;
|
|
108
|
+
const company = nonEmpty(row["dealership"]);
|
|
109
|
+
const message = offlotMessage(row);
|
|
110
|
+
const invitedAt = toInstant(row["invitedAt"]);
|
|
111
|
+
const provisionedAt = toInstant(row["provisionedAt"]);
|
|
112
|
+
const invitedBy = nonEmpty(row["invitedBy"]);
|
|
113
|
+
const linkedTenantId = nonEmpty(row["linkedTenantId"]);
|
|
114
|
+
return {
|
|
115
|
+
sourceKey: `offlot:${id}`,
|
|
116
|
+
name,
|
|
117
|
+
email,
|
|
118
|
+
locale: nonEmpty(row["locale"]) ?? DEFAULT_IMPORT_LOCALE,
|
|
119
|
+
status,
|
|
120
|
+
submittedAt,
|
|
121
|
+
...(company !== undefined && { company }),
|
|
122
|
+
...(message !== undefined && { message }),
|
|
123
|
+
...(invitedAt !== undefined && { invitedAt }),
|
|
124
|
+
...(invitedBy !== undefined && { invitedBy }),
|
|
125
|
+
...(provisionedAt !== undefined && { provisionedAt }),
|
|
126
|
+
...(linkedTenantId !== undefined && { linkedTenantId }),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function mapPublicstatusRow(
|
|
131
|
+
row: LegacyRow,
|
|
132
|
+
defaultLocale: string,
|
|
133
|
+
): WaitlistImportEntry | undefined {
|
|
134
|
+
const id = nonEmpty(row["id"]);
|
|
135
|
+
const email = nonEmpty(row["email"]);
|
|
136
|
+
const submittedAt = toInstant(row["createdAt"]);
|
|
137
|
+
if (!id || !email || !submittedAt) return undefined;
|
|
138
|
+
return {
|
|
139
|
+
sourceKey: `publicstatus:${id}`,
|
|
140
|
+
// The apex form only asked for an address; the FW entry requires a name.
|
|
141
|
+
name: email.split("@")[0] ?? email,
|
|
142
|
+
email,
|
|
143
|
+
locale: defaultLocale,
|
|
144
|
+
status: WAITLIST_STATUS.Pending,
|
|
145
|
+
submittedAt,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function publicstatusLegacyTable(sourceTable: string) {
|
|
150
|
+
return table(sourceTable, {
|
|
151
|
+
id: uuid("id").primaryKey(),
|
|
152
|
+
email: textColumn("email").notNull(),
|
|
153
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function offlotLegacyTable(sourceTable: string) {
|
|
158
|
+
return table(sourceTable, {
|
|
159
|
+
id: uuid("id").primaryKey(),
|
|
160
|
+
name: textColumn("name").notNull(),
|
|
161
|
+
email: textColumn("email").notNull(),
|
|
162
|
+
dealership: textColumn("dealership"),
|
|
163
|
+
city: textColumn("city"),
|
|
164
|
+
stock: textColumn("stock"),
|
|
165
|
+
country: textColumn("country"),
|
|
166
|
+
locale: textColumn("locale").notNull(),
|
|
167
|
+
status: textColumn("status").notNull(),
|
|
168
|
+
submittedAt: timestamp("submitted_at", { withTimezone: true }).notNull(),
|
|
169
|
+
invitedAt: timestamp("invited_at", { withTimezone: true }),
|
|
170
|
+
invitedBy: textColumn("invited_by"),
|
|
171
|
+
provisionedAt: timestamp("provisioned_at", { withTimezone: true }),
|
|
172
|
+
linkedTenantId: textColumn("linked_tenant_id"),
|
|
173
|
+
notes: textColumn("notes"),
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
async function readLegacyRows(
|
|
178
|
+
db: DbConnection,
|
|
179
|
+
from: LegacyWaitlistSource,
|
|
180
|
+
sourceTable: string,
|
|
181
|
+
): Promise<readonly LegacyRow[]> {
|
|
182
|
+
if (from === "publicstatus") {
|
|
183
|
+
return await selectMany<LegacyRow>(db, publicstatusLegacyTable(sourceTable), undefined, {
|
|
184
|
+
orderBy: { col: "createdAt", direction: "asc" },
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
return await selectMany<LegacyRow>(db, offlotLegacyTable(sourceTable), undefined, {
|
|
188
|
+
orderBy: { col: "submittedAt", direction: "asc" },
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Idempotent: the new entry id derives from the source row id, so a re-run finds
|
|
193
|
+
// what an earlier run wrote and skips it. Writes go through the waitlist entity
|
|
194
|
+
// executor (events, projection, subject encryption), never into tables directly.
|
|
195
|
+
export async function migrateLegacyWaitlist(
|
|
196
|
+
db: DbConnection,
|
|
197
|
+
options: LegacyWaitlistMigrateOptions,
|
|
198
|
+
): Promise<LegacyWaitlistMigrateReport> {
|
|
199
|
+
const rows = await readLegacyRows(db, options.from, options.sourceTable);
|
|
200
|
+
let created = 0;
|
|
201
|
+
let skipped = 0;
|
|
202
|
+
let unreadable = 0;
|
|
203
|
+
for (const row of rows) {
|
|
204
|
+
const entry =
|
|
205
|
+
options.from === "offlot"
|
|
206
|
+
? await mapOfflotRow(row)
|
|
207
|
+
: mapPublicstatusRow(row, options.defaultLocale);
|
|
208
|
+
if (!entry) {
|
|
209
|
+
unreadable += 1;
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
await transaction(db, async (tx) => {
|
|
213
|
+
const tenantDb = createTenantDb({ db: tx, tenantId: SYSTEM_TENANT_ID, mode: "system" });
|
|
214
|
+
const outcome = await importWaitlistEntry(tenantDb, entry, { dryRun: options.dryRun });
|
|
215
|
+
if (outcome === "created") created += 1;
|
|
216
|
+
else skipped += 1;
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
return { read: rows.length, created, skipped, unreadable };
|
|
220
|
+
}
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
type TenantDb,
|
|
5
5
|
} from "@cosmicdrift/kumiko-framework/db";
|
|
6
6
|
import {
|
|
7
|
+
type AppContext,
|
|
7
8
|
access,
|
|
8
9
|
createSystemUser,
|
|
9
|
-
type HandlerContext,
|
|
10
10
|
type SessionUser,
|
|
11
11
|
SYSTEM_TENANT_ID,
|
|
12
12
|
type TenantId,
|
|
13
13
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
14
14
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
15
|
-
import { tenantMembershipsTable } from "../tenant/index.
|
|
16
|
-
import { userTable } from "../user/index.
|
|
17
|
-
import { waitlistEntryEntity, waitlistEntryTable } from "./entity.
|
|
15
|
+
import { tenantMembershipsTable } from "../tenant/index.ts";
|
|
16
|
+
import { userTable } from "../user/index.ts";
|
|
17
|
+
import { waitlistEntryEntity, waitlistEntryTable } from "./entity.ts";
|
|
18
18
|
|
|
19
19
|
export const WAITLIST_CROSS_TENANT_REASON = "waitlist is platform-wide (systemScope)";
|
|
20
20
|
|
|
@@ -28,7 +28,7 @@ export function normalizeEmail(email: string): string {
|
|
|
28
28
|
return email.toLowerCase();
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export function waitlistDb(ctx:
|
|
31
|
+
export function waitlistDb(ctx: Pick<AppContext, "systemDb">): TenantDb {
|
|
32
32
|
if (!ctx.systemDb) {
|
|
33
33
|
throw new InternalError({
|
|
34
34
|
message: "waitlist requires ctx.systemDb — is r.systemScope() set on the feature?",
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createTenantDb,
|
|
3
|
+
entityEventName,
|
|
4
|
+
fetchOne,
|
|
5
|
+
selectMany,
|
|
6
|
+
} from "@cosmicdrift/kumiko-framework/db";
|
|
7
|
+
import { type MultiStreamApplyFn, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
8
|
+
import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
9
|
+
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
10
|
+
import { decryptStoredPii } from "../shared/index.ts";
|
|
11
|
+
import { tenantMembershipsTable } from "../tenant/index.ts";
|
|
12
|
+
import { userTable } from "../user/index.ts";
|
|
13
|
+
import { DEFAULT_OWN_TENANT_INVITE_ROLE, WAITLIST_STATUS } from "./constants.ts";
|
|
14
|
+
import { normalizeEmail, platformActor, waitlistExecutor } from "./lib.ts";
|
|
15
|
+
|
|
16
|
+
const PII_DECRYPT_REASON = "waitlist:link-on-signup";
|
|
17
|
+
|
|
18
|
+
export const WAITLIST_MEMBERSHIP_CREATED_EVENT = entityEventName("tenant-membership", "created");
|
|
19
|
+
|
|
20
|
+
type SignupOwnerMembership = { readonly userId: string; readonly tenantId: string };
|
|
21
|
+
|
|
22
|
+
// Only a TenantAdmin membership can be the signup owner; invite-accept memberships of
|
|
23
|
+
// other roles are not owners.
|
|
24
|
+
function readSignupOwnerMembership(
|
|
25
|
+
event: Parameters<MultiStreamApplyFn>[0],
|
|
26
|
+
): SignupOwnerMembership | undefined {
|
|
27
|
+
const { userId, roles } = event.payload;
|
|
28
|
+
if (typeof userId !== "string") return undefined;
|
|
29
|
+
if (!parseRoles(roles).includes(DEFAULT_OWN_TENANT_INVITE_ROLE)) return undefined;
|
|
30
|
+
return { userId, tenantId: event.tenantId };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// An unreadable submittedAt sorts last instead of throwing: one bad row must not
|
|
34
|
+
// stall the at-least-once consumer.
|
|
35
|
+
function newestSubmittedFirst(a: Record<string, unknown>, b: Record<string, unknown>): number {
|
|
36
|
+
return submittedAtMillis(b) - submittedAtMillis(a);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function submittedAtMillis(row: Record<string, unknown>): number {
|
|
40
|
+
return instantMillis(row["submittedAt"]);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function instantMillis(value: unknown): number {
|
|
44
|
+
if (value instanceof Temporal.Instant) return value.epochMilliseconds;
|
|
45
|
+
if (typeof value !== "string") return 0;
|
|
46
|
+
try {
|
|
47
|
+
return Temporal.Instant.from(value).epochMilliseconds;
|
|
48
|
+
} catch {
|
|
49
|
+
// Temporal.Instant.from throws RangeError for a non-ISO string.
|
|
50
|
+
return 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Runs as a multi-stream consumer (at least once): the hook phase of the signup and
|
|
55
|
+
// invite-accept paths has no system db handle, and a waitlist problem must not roll
|
|
56
|
+
// back the signup. Idempotent because only `invited` entries are updated.
|
|
57
|
+
export const linkWaitlistOnSignup: MultiStreamApplyFn = async (event, tx) => {
|
|
58
|
+
const membership = readSignupOwnerMembership(event);
|
|
59
|
+
// skip: not a TenantAdmin membership, nothing to link.
|
|
60
|
+
if (!membership) return;
|
|
61
|
+
|
|
62
|
+
// Only the tenant's first membership is the owner; later TenantAdmin invites must not link.
|
|
63
|
+
const [first] = await selectMany<{ readonly id: string }>(
|
|
64
|
+
tx,
|
|
65
|
+
tenantMembershipsTable,
|
|
66
|
+
{ tenantId: membership.tenantId },
|
|
67
|
+
{ limit: 1, fields: ["id"], orderBy: [{ col: "insertedAt" }, { col: "id" }] },
|
|
68
|
+
);
|
|
69
|
+
// skip: another membership came first.
|
|
70
|
+
if (first && first.id !== event.aggregateId) return;
|
|
71
|
+
|
|
72
|
+
const db = createTenantDb({ db: tx, tenantId: SYSTEM_TENANT_ID, mode: "system" });
|
|
73
|
+
const user = await fetchOne<{ email?: unknown }>(tx, userTable, { id: membership.userId });
|
|
74
|
+
// skip: user row unreadable (erased or not projected yet).
|
|
75
|
+
if (typeof user?.email !== "string") return;
|
|
76
|
+
const email = normalizeEmail(await decryptStoredPii(user.email, "email", PII_DECRYPT_REASON));
|
|
77
|
+
|
|
78
|
+
const found = await waitlistExecutor.list(
|
|
79
|
+
{
|
|
80
|
+
filter: { field: "email", op: "eq", value: email },
|
|
81
|
+
filters: [{ field: "status", op: "in", value: [WAITLIST_STATUS.Invited] }],
|
|
82
|
+
},
|
|
83
|
+
platformActor(),
|
|
84
|
+
db,
|
|
85
|
+
);
|
|
86
|
+
const invited = [...found.rows].sort(newestSubmittedFirst)[0];
|
|
87
|
+
// skip: the signup email has no invited waitlist entry (open signup or stale invite).
|
|
88
|
+
if (!invited) return;
|
|
89
|
+
const { id, version } = invited;
|
|
90
|
+
// skip: defensive guard on the row shape.
|
|
91
|
+
if (typeof id !== "string" || typeof version !== "number") return;
|
|
92
|
+
|
|
93
|
+
await waitlistExecutor.update(
|
|
94
|
+
{
|
|
95
|
+
id,
|
|
96
|
+
version,
|
|
97
|
+
changes: {
|
|
98
|
+
status: WAITLIST_STATUS.Provisioned,
|
|
99
|
+
linkedTenantId: membership.tenantId,
|
|
100
|
+
provisionedAt: Temporal.Now.instant(),
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
platformActor(),
|
|
104
|
+
db,
|
|
105
|
+
);
|
|
106
|
+
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type TemplateVariables,
|
|
5
5
|
templateVariable,
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
-
import { mailHeading, mailParagraph, mailRepeatedRows } from "../shared/index.
|
|
7
|
+
import { mailHeading, mailParagraph, mailRepeatedRows } from "../shared/index.ts";
|
|
8
8
|
|
|
9
9
|
export type WaitlistMailLocale = "en" | "de" | "es";
|
|
10
10
|
|