@cosmicdrift/kumiko-samples 0.378.0 → 0.380.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 +18 -17
- package/packages/bundled-features/src/account-security/feature.ts +2 -2
- package/packages/bundled-features/src/account-security/index.ts +8 -8
- package/packages/bundled-features/src/account-security/{constants.ts → web/constants.ts} +0 -2
- package/packages/bundled-features/src/account-security/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/admin-shell/feature.ts +10 -9
- package/packages/bundled-features/src/admin-shell/index.ts +8 -8
- package/packages/bundled-features/src/admin-shell/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/admin-shell/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/admin-shell/web/default-translations.ts +10 -0
- package/packages/bundled-features/src/admin-shell/web/i18n.ts +51 -9
- package/packages/bundled-features/src/admin-shell/web/index.ts +0 -1
- package/packages/bundled-features/src/audit/changes.json +7 -0
- package/packages/bundled-features/src/audit/feature.ts +72 -64
- package/packages/bundled-features/src/audit/handlers/audit-events.ts +153 -0
- package/packages/bundled-features/src/audit/handlers/audit-system-db.ts +13 -0
- package/packages/bundled-features/src/audit/handlers/details-all-tenants.query.ts +26 -0
- package/packages/bundled-features/src/audit/handlers/details.query.ts +11 -39
- package/packages/bundled-features/src/audit/handlers/list-all-tenants.query.ts +47 -0
- package/packages/bundled-features/src/audit/handlers/list.query.ts +16 -123
- package/packages/bundled-features/src/audit/handlers/resolve-audit-tenant.ts +21 -7
- package/packages/bundled-features/src/audit/index.ts +1 -1
- package/packages/bundled-features/src/audit/run-escape-hatch-retention.ts +4 -4
- package/packages/bundled-features/src/audit/screens.ts +82 -0
- package/packages/bundled-features/src/audit/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/audit/{constants.ts → web/constants.ts} +11 -1
- package/packages/bundled-features/src/audit/web/default-translations.ts +7 -0
- package/packages/bundled-features/src/audit/web/i18n.ts +33 -7
- package/packages/bundled-features/src/audit/web/index.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/bootstrap.ts +6 -6
- 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 +2 -2
- package/packages/bundled-features/src/auth-email-password/handlers/confirm-account-unlock.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/handlers/invite-create.write.ts +3 -3
- package/packages/bundled-features/src/auth-email-password/handlers/invite-info.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/login.write.ts +38 -4
- package/packages/bundled-features/src/auth-email-password/handlers/request-account-unlock.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-email-verification.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-password-reset.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/reset-password.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/verify-email.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/index.ts +6 -1
- package/packages/bundled-features/src/auth-email-password/mail-notifications.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/signup-activation.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-client.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-form-logic.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-form-primitives.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-gate.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-redirect.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/client-actions.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/auth-email-password/web/confirm-account-unlock-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{constants.ts → web/constants.ts} +3 -6
- package/packages/bundled-features/src/auth-email-password/web/default-topbar-actions.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/forgot-password-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{i18n.ts → web/i18n.ts} +3 -4
- package/packages/bundled-features/src/auth-email-password/web/index.ts +1 -2
- package/packages/bundled-features/src/auth-email-password/web/invite-accept-screen.tsx +2 -3
- package/packages/bundled-features/src/auth-email-password/web/login-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{mail-i18n.ts → web/mail-i18n.ts} +0 -1
- package/packages/bundled-features/src/auth-email-password/web/request-account-unlock-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/reset-password-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/session-bootstrap-error.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/session.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/signup-complete-screen.tsx +2 -3
- package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-menu-items.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-switcher.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/use-shell-user.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/user-menu.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/verify-email-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-mfa/changes.json +6 -0
- package/packages/bundled-features/src/auth-mfa/errors.ts +2 -2
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/verify.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/index.ts +8 -8
- package/packages/bundled-features/src/auth-mfa/mfa-status-checker.ts +4 -4
- package/packages/bundled-features/src/auth-mfa/screens.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/web/client-plugin.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/auth-mfa/web/i18n.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/index.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-client.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-disable-dialog.tsx +1 -2
- package/packages/bundled-features/src/auth-mfa/web/mfa-recovery-codes-reveal.tsx +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-regenerate-recovery-dialog.tsx +1 -2
- package/packages/bundled-features/src/auth-mfa/web/mfa-setup-preauth-screen.tsx +21 -23
- package/packages/bundled-features/src/auth-mfa/web/mfa-verify-screen.tsx +0 -1
- package/packages/bundled-features/src/billing-foundation/changes.json +18 -0
- package/packages/bundled-features/src/billing-foundation/checkout-core.ts +3 -3
- 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 +11 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/mail-notifications.ts +11 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-consent.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-termination.ts +12 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/stored-user-email.ts +12 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-mail.ts +6 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-notify.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-pages.ts +167 -28
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-record.ts +102 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-request.ts +43 -12
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-revoke.ts +202 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-texts.ts +70 -0
- package/packages/bundled-features/src/billing-foundation/events.ts +20 -2
- package/packages/bundled-features/src/billing-foundation/feature.ts +5 -5
- package/packages/bundled-features/src/billing-foundation/handlers/process-event.write.ts +82 -9
- package/packages/bundled-features/src/billing-foundation/handlers/switch-plan.write.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/handlers/sync-subscription.write.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/index.ts +27 -27
- package/packages/bundled-features/src/billing-foundation/plan-catalog.ts +7 -7
- package/packages/bundled-features/src/billing-foundation/screens.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/subscription-tier-sync.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/types.ts +17 -3
- package/packages/bundled-features/src/billing-foundation/validate-options.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/web/billing-contact-plan.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/billing-plans-panel.tsx +5 -7
- package/packages/bundled-features/src/billing-foundation/web/cancel-contract-dialog.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/checkout-consent-dialog.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/billing-foundation/{constants.ts → web/constants.ts} +37 -31
- package/packages/bundled-features/src/billing-foundation/{consumer-protection → web/consumer-protection}/consent-locale.ts +0 -1
- package/packages/bundled-features/src/billing-foundation/{contact-card.ts → web/contact-card.ts} +0 -2
- package/packages/bundled-features/src/billing-foundation/web/index.ts +14 -15
- package/packages/bundled-features/src/billing-foundation/web/localized-params.ts +0 -2
- package/packages/bundled-features/src/billing-foundation/webhook-handler.ts +5 -2
- package/packages/bundled-features/src/cap-overview/feature.ts +1 -1
- package/packages/bundled-features/src/cap-overview/handlers/caps-usage.query.ts +1 -1
- package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +2 -2
- package/packages/bundled-features/src/cap-overview/index.ts +9 -9
- package/packages/bundled-features/src/cap-overview/screens.ts +2 -2
- package/packages/bundled-features/src/cap-overview/web/cap-cards-panel.tsx +1 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-bar.tsx +1 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-cell.tsx +0 -2
- package/packages/bundled-features/src/cap-overview/web/client-plugin.tsx +3 -4
- package/packages/bundled-features/src/cap-overview/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/cap-overview/web/index.ts +0 -1
- package/packages/bundled-features/src/cap-overview/{usage-math.ts → web/usage-math.ts} +1 -2
- package/packages/bundled-features/src/compliance-profiles/feature.ts +5 -5
- package/packages/bundled-features/src/compliance-profiles/index.ts +6 -6
- package/packages/bundled-features/src/compliance-profiles/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/compliance-profiles/web/compliance-profile-catalog.tsx +1 -2
- package/packages/bundled-features/src/compliance-profiles/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/compliance-profiles/web/i18n.ts +0 -1
- package/packages/bundled-features/src/compliance-profiles/web/index.ts +0 -1
- package/packages/bundled-features/src/config/index.ts +6 -6
- package/packages/bundled-features/src/config/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/config/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/config/web/i18n.ts +0 -1
- package/packages/bundled-features/src/config/web/index.ts +1 -3
- package/packages/bundled-features/src/config/write-helpers.ts +1 -1
- package/packages/bundled-features/src/custom-fields/feature.ts +8 -8
- package/packages/bundled-features/src/custom-fields/handlers/clear-custom-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/define-tenant-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/delete-system-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/delete-tenant-field.write.ts +4 -4
- package/packages/bundled-features/src/custom-fields/handlers/set-custom-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/update-tenant-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/index.ts +8 -8
- package/packages/bundled-features/src/custom-fields/lib/value-schema.ts +1 -1
- package/packages/bundled-features/src/custom-fields/schemas.ts +1 -1
- package/packages/bundled-features/src/custom-fields/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/custom-fields/{constants.ts → web/constants.ts} +18 -19
- package/packages/bundled-features/src/custom-fields/web/custom-fields-form-section.tsx +1 -2
- package/packages/bundled-features/src/custom-fields/web/i18n.ts +0 -1
- package/packages/bundled-features/src/custom-fields/web/index.ts +2 -3
- package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +1 -2
- package/packages/bundled-features/src/delivery/address-opt-out.ts +1 -1
- package/packages/bundled-features/src/delivery/attempt-log-retention.ts +24 -8
- package/packages/bundled-features/src/delivery/changes.json +6 -0
- package/packages/bundled-features/src/delivery/constants.ts +2 -2
- package/packages/bundled-features/src/delivery/i18n.ts +1 -1
- package/packages/bundled-features/src/delivery/unsubscribe-page.ts +1 -1
- package/packages/bundled-features/src/delivery/web/client-plugin.tsx +6 -7
- package/packages/bundled-features/src/delivery/web/delivery-channel-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-error-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-status-cell.tsx +1 -2
- package/packages/bundled-features/src/delivery/web/delivery-time-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-type-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/index.ts +0 -1
- package/packages/bundled-features/src/delivery/{public-names.ts → web/public-names.ts} +0 -1
- package/packages/bundled-features/src/document-ingest-foundation/changes.json +6 -0
- package/packages/bundled-features/src/document-ingest-foundation/events.ts +4 -0
- package/packages/bundled-features/src/document-ingest-foundation/executor.ts +2 -1
- package/packages/bundled-features/src/document-ingest-foundation/feature.ts +18 -4
- package/packages/bundled-features/src/document-ingest-foundation/index.ts +1 -0
- package/packages/bundled-features/src/feature-toggles/feature.ts +7 -7
- package/packages/bundled-features/src/feature-toggles/global-feature-state-table.ts +14 -13
- package/packages/bundled-features/src/feature-toggles/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/registered.query.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/set.write.ts +3 -3
- package/packages/bundled-features/src/feature-toggles/index.ts +6 -6
- package/packages/bundled-features/src/feature-toggles/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/feature-toggles/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/feature-toggles/web/i18n.ts +0 -1
- package/packages/bundled-features/src/feature-toggles/web/index.ts +0 -1
- package/packages/bundled-features/src/files/changes.json +7 -0
- package/packages/bundled-features/src/folders/feature.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/clear-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/delete-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/set-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/index.ts +8 -8
- package/packages/bundled-features/src/folders/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/folders/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +1 -2
- package/packages/bundled-features/src/folders/web/folder-section.tsx +1 -2
- package/packages/bundled-features/src/folders/web/i18n.ts +0 -1
- package/packages/bundled-features/src/folders/web/index.ts +1 -2
- package/packages/bundled-features/src/folders/web/tree.ts +0 -1
- package/packages/bundled-features/src/form-draft/changes.json +7 -0
- package/packages/bundled-features/src/form-draft/db/queries/cleanup.ts +25 -11
- package/packages/bundled-features/src/form-draft/decrypt-draft.ts +24 -0
- package/packages/bundled-features/src/form-draft/entity.ts +6 -9
- package/packages/bundled-features/src/form-draft/feature.ts +1 -1
- package/packages/bundled-features/src/form-draft/handlers/cleanup.job.ts +26 -5
- package/packages/bundled-features/src/form-draft/handlers/discard.write.ts +1 -1
- package/packages/bundled-features/src/form-draft/handlers/get.query.ts +6 -7
- package/packages/bundled-features/src/form-draft/handlers/list.query.ts +13 -7
- package/packages/bundled-features/src/form-draft/handlers/save.write.ts +5 -5
- package/packages/bundled-features/src/form-draft/index.ts +8 -8
- package/packages/bundled-features/src/form-draft/lookup.ts +10 -4
- package/packages/bundled-features/src/form-draft/schemas.ts +1 -1
- package/packages/bundled-features/src/form-draft/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/form-draft-user-data/hooks.ts +2 -2
- package/packages/bundled-features/src/inbound-mail-foundation/retention-sweep.ts +10 -10
- package/packages/bundled-features/src/jobs/feature.ts +7 -7
- package/packages/bundled-features/src/jobs/handlers/retry.write.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/trigger.write.ts +1 -1
- package/packages/bundled-features/src/jobs/index.ts +1 -1
- package/packages/bundled-features/src/jobs/job-run-table.ts +4 -3
- package/packages/bundled-features/src/jobs/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/jobs/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/jobs/web/default-translations.ts +7 -0
- package/packages/bundled-features/src/jobs/web/i18n.ts +53 -7
- package/packages/bundled-features/src/jobs/web/index.ts +0 -1
- package/packages/bundled-features/src/ledger/changes.json +7 -0
- package/packages/bundled-features/src/ledger/entity.ts +1 -1
- package/packages/bundled-features/src/ledger/feature.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/confirm-schedule-period.write.ts +2 -10
- package/packages/bundled-features/src/ledger/handlers/create-transaction.write.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/reports.query.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/reverse-transaction.write.ts +1 -1
- package/packages/bundled-features/src/ledger/index.ts +13 -13
- package/packages/bundled-features/src/ledger/recurring.ts +1 -1
- package/packages/bundled-features/src/ledger/reports.ts +1 -1
- package/packages/bundled-features/src/ledger/schemas.ts +1 -1
- package/packages/bundled-features/src/ledger/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/ledger/web/index.ts +11 -12
- package/packages/bundled-features/src/legal-pages/README.md +1 -1
- package/packages/bundled-features/src/legal-pages/feature.ts +5 -5
- package/packages/bundled-features/src/legal-pages/index.ts +11 -11
- 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/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/legal-pages/{constants.ts → web/constants.ts} +6 -8
- package/packages/bundled-features/src/legal-pages/web/index.ts +0 -1
- package/packages/bundled-features/src/managed-pages/feature.ts +1 -1
- package/packages/bundled-features/src/managed-pages/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/managed-pages/web/default-translations.ts +17 -0
- package/packages/bundled-features/src/managed-pages/web/i18n.ts +59 -16
- package/packages/bundled-features/src/managed-pages/web/index.ts +1 -2
- package/packages/bundled-features/src/metrics/compute.ts +1 -1
- package/packages/bundled-features/src/metrics/feature.ts +6 -6
- package/packages/bundled-features/src/metrics/index.ts +8 -8
- package/packages/bundled-features/src/metrics/types.ts +1 -1
- package/packages/bundled-features/src/metrics/validate.ts +1 -1
- package/packages/bundled-features/src/metrics/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/metrics/window.ts +1 -1
- package/packages/bundled-features/src/notes-history/feature.ts +1 -1
- package/packages/bundled-features/src/notes-history/handlers/add-note.write.ts +1 -1
- package/packages/bundled-features/src/notes-history/index.ts +8 -8
- package/packages/bundled-features/src/notes-history/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/notes-history/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/notes-history/web/i18n.ts +0 -1
- package/packages/bundled-features/src/notes-history/web/index.ts +2 -3
- package/packages/bundled-features/src/notes-history/web/notes-section.tsx +2 -3
- package/packages/bundled-features/src/personal-access-tokens/feature.ts +12 -10
- 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 +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/revoke.write.ts +1 -1
- 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 +5 -5
- package/packages/bundled-features/src/personal-access-tokens/resolver.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/schema/api-token.ts +3 -3
- package/packages/bundled-features/src/personal-access-tokens/screens.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/personal-access-tokens/{scopes.ts → web/scopes.ts} +0 -1
- package/packages/bundled-features/src/presets/changes.json +7 -0
- package/packages/bundled-features/src/presets/index.ts +0 -1
- package/packages/bundled-features/src/presets/security-baseline.ts +1 -1
- package/packages/bundled-features/src/renderer-foundation/types.ts +1 -1
- package/packages/bundled-features/src/secrets/feature.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/delete.write.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/set.write.ts +1 -1
- package/packages/bundled-features/src/secrets/i18n.ts +1 -1
- package/packages/bundled-features/src/secrets/index.ts +8 -8
- package/packages/bundled-features/src/secrets/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/secrets/write-gate.ts +1 -1
- package/packages/bundled-features/src/sessions/feature.ts +7 -4
- package/packages/bundled-features/src/sessions/schema/user-session.ts +2 -3
- package/packages/bundled-features/src/sessions/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/shared/index.ts +6 -1
- package/packages/bundled-features/src/shared/purge-files-reaching-subject.ts +10 -2
- package/packages/bundled-features/src/shared/web/translate-or-raw.ts +0 -1
- package/packages/bundled-features/src/subscription-stripe/feature.ts +2 -0
- package/packages/bundled-features/src/subscription-stripe/plugin-methods.ts +19 -0
- package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +1 -0
- package/packages/bundled-features/src/tags/changes.json +6 -0
- package/packages/bundled-features/src/tags/feature.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/assign-tag.write.ts +11 -7
- package/packages/bundled-features/src/tags/handlers/create-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/delete-tag.write.ts +4 -1
- package/packages/bundled-features/src/tags/handlers/remove-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/update-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/index.ts +12 -12
- package/packages/bundled-features/src/tags/screens.ts +1 -1
- package/packages/bundled-features/src/tags/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/tags/{constants.ts → web/constants.ts} +4 -1
- package/packages/bundled-features/src/tags/web/entity-tags.tsx +1 -2
- package/packages/bundled-features/src/tags/web/i18n.ts +2 -2
- package/packages/bundled-features/src/tags/web/index.ts +2 -3
- package/packages/bundled-features/src/tags/web/tag-chip.tsx +0 -1
- package/packages/bundled-features/src/tags/web/tag-filter.tsx +1 -2
- package/packages/bundled-features/src/tags/web/tag-manager.tsx +5 -4
- package/packages/bundled-features/src/tags/web/tag-picker.tsx +0 -1
- package/packages/bundled-features/src/tags/web/tag-section.tsx +1 -2
- package/packages/bundled-features/src/tags/web/tags-cell.tsx +1 -2
- package/packages/bundled-features/src/template-resolver/README.md +1 -1
- package/packages/bundled-features/src/template-resolver/api.ts +75 -28
- package/packages/bundled-features/src/template-resolver/changes.json +43 -0
- package/packages/bundled-features/src/template-resolver/compile-document-body.ts +1 -1
- package/packages/bundled-features/src/template-resolver/compile-steps-block.ts +2 -2
- package/packages/bundled-features/src/template-resolver/document-ops.ts +5 -5
- package/packages/bundled-features/src/template-resolver/document-sanitizer.ts +4 -4
- package/packages/bundled-features/src/template-resolver/feature.ts +13 -4
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +6 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +6 -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 +19 -2
- package/packages/bundled-features/src/template-resolver/handlers/copy-locale.write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/diff-to-system.query.ts +7 -1
- package/packages/bundled-features/src/template-resolver/handlers/discard-draft.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/document-base.ts +8 -2
- package/packages/bundled-features/src/template-resolver/handlers/document-blocks.query.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/export-bundle.query.ts +5 -2
- package/packages/bundled-features/src/template-resolver/handlers/find-by-id.query.ts +4 -2
- package/packages/bundled-features/src/template-resolver/handlers/layout-source.query.ts +10 -5
- package/packages/bundled-features/src/template-resolver/handlers/list.query.ts +5 -2
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +68 -10
- package/packages/bundled-features/src/template-resolver/handlers/patch-draft.write.ts +1 -1
- 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 +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/send-test.write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/set.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/shared.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/template-gates.ts +6 -6
- package/packages/bundled-features/src/template-resolver/handlers/template-write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/usage.query.ts +8 -2
- package/packages/bundled-features/src/template-resolver/handlers/validate.query.ts +4 -2
- package/packages/bundled-features/src/template-resolver/i18n.ts +25 -0
- package/packages/bundled-features/src/template-resolver/index.ts +60 -59
- package/packages/bundled-features/src/template-resolver/layout-appearance.ts +1 -1
- package/packages/bundled-features/src/template-resolver/layout-regions.ts +1 -1
- package/packages/bundled-features/src/template-resolver/seeding.ts +16 -7
- package/packages/bundled-features/src/template-resolver/store-template-resource.ts +2 -2
- package/packages/bundled-features/src/template-resolver/table.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-bundle.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-delivery-policy.ts +82 -0
- package/packages/bundled-features/src/template-resolver/template-draft.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-edit-policy.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 +14 -10
- package/packages/bundled-features/src/template-resolver/template-usage.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-validation.ts +2 -2
- package/packages/bundled-features/src/template-resolver/testing.ts +2 -2
- package/packages/bundled-features/src/template-resolver/user-content-table.ts +1 -1
- package/packages/bundled-features/src/template-resolver/web/client-plugin.tsx +4 -5
- package/packages/bundled-features/src/template-resolver/{constants.ts → web/constants.ts} +7 -10
- package/packages/bundled-features/src/template-resolver/{document-blocks.ts → web/document-blocks.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/document-editor-extensions.ts +2 -3
- package/packages/bundled-features/src/template-resolver/web/document-editor.tsx +0 -1
- package/packages/bundled-features/src/template-resolver/{document-images.ts → web/document-images.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{document-schema.ts → web/document-schema.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{document-steps.ts → web/document-steps.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-editor.tsx +6 -7
- package/packages/bundled-features/src/template-resolver/web/document-toolbar-blocks.ts +2 -3
- package/packages/bundled-features/src/template-resolver/web/editor-handle.ts +1 -2
- package/packages/bundled-features/src/template-resolver/web/i18n.ts +2 -1
- package/packages/bundled-features/src/template-resolver/web/index.ts +13 -14
- package/packages/bundled-features/src/template-resolver/{mail-constants.ts → web/mail-constants.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{pdf-constants.ts → web/pdf-constants.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/placeholder-line-editor-lazy.tsx +0 -1
- package/packages/bundled-features/src/template-resolver/web/placeholder-line-editor.tsx +5 -4
- package/packages/bundled-features/src/template-resolver/{placeholder-text.ts → web/placeholder-text.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{qualified-names.ts → web/qualified-names.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/use-stable-by-key.ts +0 -1
- package/packages/bundled-features/src/tenant/handlers/add-member.write.ts +1 -1
- package/packages/bundled-features/src/tenant/index.ts +7 -7
- package/packages/bundled-features/src/tenant/invitation-table.ts +1 -1
- package/packages/bundled-features/src/tenant/invited-membership.ts +1 -1
- package/packages/bundled-features/src/tenant/last-tenant-admin.ts +1 -1
- 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/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/tenant/{constants.ts → web/constants.ts} +3 -6
- package/packages/bundled-features/src/tenant/web/index.ts +0 -1
- package/packages/bundled-features/src/tenant/web/member-roles-cell.tsx +0 -1
- package/packages/bundled-features/src/tenant/web/member-status-cell.tsx +0 -1
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +2 -2
- package/packages/bundled-features/src/tier-engine/entity.ts +1 -1
- package/packages/bundled-features/src/tier-engine/feature.ts +7 -7
- package/packages/bundled-features/src/tier-engine/handlers/set-tenant-tier.write.ts +1 -1
- package/packages/bundled-features/src/tier-engine/index.ts +8 -8
- package/packages/bundled-features/src/tier-engine/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/tier-engine/{constants.ts → web/constants.ts} +2 -3
- package/packages/bundled-features/src/tier-engine/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/tier-engine/web/index.ts +0 -1
- package/packages/bundled-features/src/user/handlers/create.write.ts +1 -1
- package/packages/bundled-features/src/user/handlers/update-roles.ts +1 -1
- package/packages/bundled-features/src/user/handlers/update.write.ts +1 -1
- package/packages/bundled-features/src/user/index.ts +1 -1
- package/packages/bundled-features/src/user/invited-global-roles.ts +1 -1
- package/packages/bundled-features/src/user/schema/user.ts +1 -1
- package/packages/bundled-features/src/user/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/user-data-rights/changes.json +14 -0
- package/packages/bundled-features/src/user-data-rights/env.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/feature.ts +9 -9
- package/packages/bundled-features/src/user-data-rights/index.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/lib/resolve-tenant-model.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/mail-notifications.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/user-data-rights/web/confirm-deletion-screen.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights/{constants.ts → web/constants.ts} +11 -12
- package/packages/bundled-features/src/user-data-rights/web/default-translations.ts +91 -0
- package/packages/bundled-features/src/user-data-rights/web/i18n.ts +41 -91
- package/packages/bundled-features/src/user-data-rights/web/index.ts +1 -2
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +1 -2
- package/packages/bundled-features/src/user-data-rights/web/public-deletion-gate.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights/web/request-deletion-screen.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/file-ref.userdata-hook.ts +10 -1
- package/packages/bundled-features/src/user-profile/feature.ts +2 -2
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +1 -1
- package/packages/bundled-features/src/user-profile/index.ts +3 -2
- package/packages/bundled-features/src/user-profile/web/client-plugin.ts +2 -3
- package/packages/bundled-features/src/user-profile/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/user-profile/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/user-profile/web/profile-screen.tsx +2 -3
- package/packages/bundled-features/src/waitlist/changes.json +6 -0
- package/packages/bundled-features/src/waitlist/entity.ts +1 -1
- package/packages/bundled-features/src/waitlist/feature.ts +5 -5
- package/packages/bundled-features/src/waitlist/handlers/export-purge.write.ts +3 -3
- package/packages/bundled-features/src/waitlist/handlers/invite.write.ts +5 -1
- package/packages/bundled-features/src/waitlist/handlers/reject.write.ts +1 -1
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +3 -3
- package/packages/bundled-features/src/waitlist/import.ts +1 -1
- package/packages/bundled-features/src/waitlist/index.ts +11 -11
- package/packages/bundled-features/src/waitlist/legacy-migrate.ts +1 -1
- package/packages/bundled-features/src/waitlist/link-on-signup.ts +1 -1
- package/packages/bundled-features/src/waitlist/mail.ts +7 -6
- package/packages/bundled-features/src/waitlist/payloads.ts +1 -1
- package/packages/bundled-features/src/waitlist/screens.ts +1 -1
- package/packages/bundled-features/src/waitlist/{constants.ts → web/constants.ts} +0 -1
- package/samples/apps/styleguide/src/features/content/web.tsx +0 -1
- package/samples/apps/ui-walkthrough/src/app/client.tsx +2 -0
- package/samples/apps/ui-walkthrough/src/app/seed-rental.ts +17 -1
- package/samples/apps/ui-walkthrough/src/app/seed-templates.ts +11 -0
- package/samples/apps/ui-walkthrough/src/app/server.ts +2 -1
- package/samples/apps/ui-walkthrough/src/features/billing/feature.ts +35 -7
- package/samples/apps/ui-walkthrough/src/features/billing/i18n.ts +6 -0
- package/samples/apps/ui-walkthrough/src/features/rental/entities.ts +27 -0
- package/samples/apps/ui-walkthrough/src/features/rental/feature.ts +61 -7
- package/samples/apps/ui-walkthrough/src/features/rental/i18n.ts +48 -24
- package/samples/apps/ui-walkthrough/src/features/rental/invoice-receive.ts +0 -1
- package/samples/apps/ui-walkthrough/src/features/rental/lease-support.ts +17 -1
- package/samples/apps/ui-walkthrough/src/features/rental/qualified-names.ts +3 -0
- package/samples/apps/ui-walkthrough/src/features/rental/receipts-upload.ts +70 -0
- package/samples/apps/ui-walkthrough/src/features/rental/screens.ts +90 -13
- package/samples/apps/ui-walkthrough/src/features/rental/web/index.ts +0 -2
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/feature.ts +103 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/i18n.ts +36 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/index.ts +2 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/seed.ts +21 -0
- package/samples/apps/ui-walkthrough/src/run-config.ts +11 -0
- package/samples/apps/use-all-bundled/e2e-billing-gallery/server.ts +1 -1
- package/samples/apps/use-all-bundled/feature-manifest.json +4 -4
- package/samples/apps/use-all-bundled/scripts/check-coverage.ts +1 -1
- package/samples/apps/use-all-bundled/src/app/dev-app-options.ts +3 -1
- package/samples/recipes/compose-stacks/README.md +1 -2
- package/samples/recipes/embedded/README.md +5 -5
- package/samples/recipes/embedded/src/handlers/invoice-receive.write.ts +0 -1
- package/samples/recipes/embedded/src/screens/invoice-receive.screen.ts +9 -12
- package/samples/recipes/legal-pages/README.md +2 -2
- package/samples/recipes/legal-pages/src/feature.ts +1 -1
- package/samples/recipes/reference-data/src/feature.ts +3 -7
- package/packages/bundled-features/src/admin-shell/i18n.ts +0 -54
- package/packages/bundled-features/src/audit/i18n.ts +0 -25
- package/packages/bundled-features/src/auth-mfa/web/qrcode-browser.d.ts +0 -11
- package/packages/bundled-features/src/jobs/i18n.ts +0 -55
- package/packages/bundled-features/src/managed-pages/i18n.ts +0 -63
- package/packages/bundled-features/src/presets/dsgvo-self-service.ts +0 -35
- package/packages/bundled-features/src/user-data-rights/i18n.ts +0 -44
- package/samples/apps/ui-walkthrough/src/features/rental/web/upload-standard-layout.tsx +0 -61
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
type WriteFailure,
|
|
4
4
|
writeFailure,
|
|
5
5
|
} from "@cosmicdrift/kumiko-framework/errors";
|
|
6
|
-
import { AuthMfaErrorCodes } from "./constants.ts";
|
|
6
|
+
import { AuthMfaErrorCodes } from "./web/constants.ts";
|
|
7
7
|
|
|
8
|
-
export { AuthMfaErrorCodes as AuthMfaErrors } from "./constants.ts";
|
|
8
|
+
export { AuthMfaErrorCodes as AuthMfaErrors } from "./web/constants.ts";
|
|
9
9
|
|
|
10
10
|
export function mfaAlreadyEnabled(): WriteFailure {
|
|
11
11
|
return writeFailure(
|
|
@@ -12,7 +12,6 @@ import * as z from "zod";
|
|
|
12
12
|
import { burnToken, sessionLocaleField, sessionTimezoneField } from "../../shared/index.ts";
|
|
13
13
|
import { USER_STATUS, UserQueries } from "../../user/index.ts";
|
|
14
14
|
import { base32Decode } from "../base32.ts";
|
|
15
|
-
import { MFA_VERIFY_LOCKOUT_MINUTES, MFA_VERIFY_MAX_ATTEMPTS } from "../constants.ts";
|
|
16
15
|
import { findUserMfaRow } from "../db/queries.ts";
|
|
17
16
|
import {
|
|
18
17
|
invalidSetupToken,
|
|
@@ -28,6 +27,7 @@ import {
|
|
|
28
27
|
} from "../mfa-verify-attempts.ts";
|
|
29
28
|
import { encodeRecoveryCodes, userMfaEntity, userMfaTable } from "../schema/user-mfa.ts";
|
|
30
29
|
import { verifyTotp } from "../totp.ts";
|
|
30
|
+
import { MFA_VERIFY_LOCKOUT_MINUTES, MFA_VERIFY_MAX_ATTEMPTS } from "../web/constants.ts";
|
|
31
31
|
|
|
32
32
|
export type EnableConfirmPreauthOptions = {
|
|
33
33
|
// Must match the secret enable-start-preauth.write.ts signs setupTokens
|
|
@@ -2,7 +2,6 @@ import { createTenantDb } from "@cosmicdrift/kumiko-framework/db";
|
|
|
2
2
|
import { defineWriteHandler, type SessionUser } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { base32Encode } from "../base32.ts";
|
|
5
|
-
import { MFA_SETUP_TOKEN_TTL_MINUTES } from "../constants.ts";
|
|
6
5
|
import { findUserMfaRow } from "../db/queries.ts";
|
|
7
6
|
import { invalidChallengeToken, mfaAlreadyEnabled } from "../errors.ts";
|
|
8
7
|
import { verifyMfaPreauthSetupToken } from "../mfa-preauth-setup-token.ts";
|
|
@@ -10,6 +9,7 @@ import { signMfaSetupToken } from "../mfa-setup-token.ts";
|
|
|
10
9
|
import { buildOtpauthUri } from "../otpauth-uri.ts";
|
|
11
10
|
import { generateRecoveryCodes, hashRecoveryCodes } from "../recovery-codes.ts";
|
|
12
11
|
import { generateTotpSecret } from "../totp.ts";
|
|
12
|
+
import { MFA_SETUP_TOKEN_TTL_MINUTES } from "../web/constants.ts";
|
|
13
13
|
|
|
14
14
|
const ENABLE_START_PREAUTH_TENANT_REASON =
|
|
15
15
|
"reads the MFA enrollment of the tenant named in the signed login/setup token, not the guest dispatch tenant";
|
|
@@ -2,13 +2,13 @@ import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { UserQueries } from "../../user/index.ts";
|
|
4
4
|
import { base32Encode } from "../base32.ts";
|
|
5
|
-
import { MFA_SETUP_TOKEN_TTL_MINUTES } from "../constants.ts";
|
|
6
5
|
import { findUserMfaRow } from "../db/queries.ts";
|
|
7
6
|
import { mfaAlreadyEnabled } from "../errors.ts";
|
|
8
7
|
import { signMfaSetupToken } from "../mfa-setup-token.ts";
|
|
9
8
|
import { buildOtpauthUri } from "../otpauth-uri.ts";
|
|
10
9
|
import { generateRecoveryCodes, hashRecoveryCodes } from "../recovery-codes.ts";
|
|
11
10
|
import { generateTotpSecret } from "../totp.ts";
|
|
11
|
+
import { MFA_SETUP_TOKEN_TTL_MINUTES } from "../web/constants.ts";
|
|
12
12
|
|
|
13
13
|
export type EnableStartOptions = {
|
|
14
14
|
readonly setupTokenSecret: string;
|
|
@@ -10,7 +10,6 @@ import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
|
10
10
|
import * as z from "zod";
|
|
11
11
|
import { burnToken, sessionLocaleField, sessionTimezoneField } from "../../shared/index.ts";
|
|
12
12
|
import { USER_STATUS, UserQueries } from "../../user/index.ts";
|
|
13
|
-
import { MFA_VERIFY_LOCKOUT_MINUTES, MFA_VERIFY_MAX_ATTEMPTS } from "../constants.ts";
|
|
14
13
|
import { findUserMfaRow } from "../db/queries.ts";
|
|
15
14
|
import { invalidChallengeToken, invalidTotpCode, tooManyAttempts } from "../errors.ts";
|
|
16
15
|
import { verifyMfaChallengeToken } from "../mfa-challenge-token.ts";
|
|
@@ -21,6 +20,7 @@ import {
|
|
|
21
20
|
} from "../mfa-verify-attempts.ts";
|
|
22
21
|
import { encodeRecoveryCodes, userMfaEntity, userMfaTable } from "../schema/user-mfa.ts";
|
|
23
22
|
import { verifyMfaFactor } from "../verify-factor.ts";
|
|
23
|
+
import { MFA_VERIFY_LOCKOUT_MINUTES, MFA_VERIFY_MAX_ATTEMPTS } from "../web/constants.ts";
|
|
24
24
|
|
|
25
25
|
export type MfaVerifyOptions = {
|
|
26
26
|
// Must match the secret the login handler signs mfa-challenge tokens
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
export { base32Decode } from "./base32.ts";
|
|
2
2
|
export { type MfaRequiredPolicy, mfaRequiredConfigHandle } from "./config.ts";
|
|
3
|
-
export {
|
|
4
|
-
AUTH_MFA_FEATURE,
|
|
5
|
-
AuthMfaHandlers,
|
|
6
|
-
AuthMfaQueries,
|
|
7
|
-
MFA_DISABLE_SCREEN_ID,
|
|
8
|
-
MFA_ENABLE_SCREEN_ID,
|
|
9
|
-
MFA_REGENERATE_RECOVERY_SCREEN_ID,
|
|
10
|
-
} from "./constants.ts";
|
|
11
3
|
export { authMfaEnvSchema, mfaTokenSecretsEnvSchema } from "./env.ts";
|
|
12
4
|
export type { AuthMfaFeatureOptions } from "./feature.ts";
|
|
13
5
|
export { createAuthMfaFeature } from "./feature.ts";
|
|
@@ -33,3 +25,11 @@ export {
|
|
|
33
25
|
resolveMfaTokenSecrets,
|
|
34
26
|
resolveMfaTokenSecretsFromEnv,
|
|
35
27
|
} from "./token-secrets.ts";
|
|
28
|
+
export {
|
|
29
|
+
AUTH_MFA_FEATURE,
|
|
30
|
+
AuthMfaHandlers,
|
|
31
|
+
AuthMfaQueries,
|
|
32
|
+
MFA_DISABLE_SCREEN_ID,
|
|
33
|
+
MFA_ENABLE_SCREEN_ID,
|
|
34
|
+
MFA_REGENERATE_RECOVERY_SCREEN_ID,
|
|
35
|
+
} from "./web/constants.ts";
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
type TenantId,
|
|
8
8
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
9
9
|
import { type MfaRequiredPolicy, mfaRequiredConfigHandle, mfaRequiredConfigKey } from "./config.ts";
|
|
10
|
-
import {
|
|
11
|
-
MFA_CHALLENGE_TOKEN_TTL_MINUTES,
|
|
12
|
-
MFA_PREAUTH_SETUP_TOKEN_TTL_MINUTES,
|
|
13
|
-
} from "./constants.ts";
|
|
14
10
|
import { findUserMfaRow } from "./db/queries.ts";
|
|
15
11
|
import { signMfaChallengeToken } from "./mfa-challenge-token.ts";
|
|
16
12
|
import { signMfaPreauthSetupToken } from "./mfa-preauth-setup-token.ts";
|
|
13
|
+
import {
|
|
14
|
+
MFA_CHALLENGE_TOKEN_TTL_MINUTES,
|
|
15
|
+
MFA_PREAUTH_SETUP_TOKEN_TTL_MINUTES,
|
|
16
|
+
} from "./web/constants.ts";
|
|
17
17
|
|
|
18
18
|
export type MfaStatusCheckResult =
|
|
19
19
|
| { readonly required: false }
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
MFA_DISABLE_SCREEN_ID,
|
|
9
9
|
MFA_ENABLE_SCREEN_ID,
|
|
10
10
|
MFA_REGENERATE_RECOVERY_SCREEN_ID,
|
|
11
|
-
} from "./constants.ts";
|
|
11
|
+
} from "./web/constants.ts";
|
|
12
12
|
|
|
13
13
|
// Declarative TOTP-enrollment screen: mint (no input) -> reveal QR/secret/
|
|
14
14
|
// recovery-codes -> confirm with a 6-digit code. `setupToken` is carried
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// MfaDisableDialog — confirm-with-code before turning MFA off. Uses the
|
|
3
2
|
// generic Dialog primitive (unlike MfaRegenerateRecoveryDialog): disable is
|
|
4
3
|
// single-step, no state to preserve after confirm, so
|
|
@@ -12,7 +11,7 @@
|
|
|
12
11
|
|
|
13
12
|
import { useDispatcher, usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
14
13
|
import { type ReactNode, useState } from "react";
|
|
15
|
-
import { AuthMfaHandlers } from "
|
|
14
|
+
import { AuthMfaHandlers } from "./constants.ts";
|
|
16
15
|
|
|
17
16
|
export type MfaDisableDialogProps = {
|
|
18
17
|
readonly open: boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// MfaRegenerateRecoveryDialog — confirm-with-code, then the caller reveals
|
|
3
2
|
// the new codes. The reveal itself can't live inside this Dialog: Dialog
|
|
4
3
|
// closes in a `finally` right after onConfirm resolves (see profile-screen.
|
|
@@ -9,7 +8,7 @@
|
|
|
9
8
|
|
|
10
9
|
import { useDispatcher, usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
11
10
|
import { type ReactNode, useState } from "react";
|
|
12
|
-
import { AuthMfaHandlers } from "
|
|
11
|
+
import { AuthMfaHandlers } from "./constants.ts";
|
|
13
12
|
|
|
14
13
|
export type MfaRegenerateRecoveryDialogProps = {
|
|
15
14
|
readonly open: boolean;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
|
-
// Consumers that type-check this source never include the ambient declaration on their own.
|
|
3
|
-
/// <reference path="./qrcode-browser.d.ts" />
|
|
4
1
|
// Pre-auth twin of the declarative auth-mfa-enable secretMint screen: a user
|
|
5
2
|
// blocked at login by MFA enforcement and not yet enrolled lands here
|
|
6
3
|
// straight out of the login flow — there is no session yet. Identity comes
|
|
@@ -17,9 +14,6 @@
|
|
|
17
14
|
// stays "unauthenticated" until the next reload.
|
|
18
15
|
|
|
19
16
|
import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
20
|
-
// qrcode's package.json#browser remap avoids Node-only deps (yargs/pngjs)
|
|
21
|
-
// for bundlers that honor it — Metro doesn't, hence the explicit subpath.
|
|
22
|
-
import QRCode from "qrcode/lib/browser.js";
|
|
23
17
|
import { type FormEvent, type ReactNode, useState } from "react";
|
|
24
18
|
// kumiko-lint-ignore cross-feature-import client-only component, the feature's server barrel has no web/ re-export
|
|
25
19
|
import { AuthCard } from "../../auth-email-password/web/index.ts";
|
|
@@ -29,7 +23,7 @@ type SetupState = {
|
|
|
29
23
|
readonly setupToken: string;
|
|
30
24
|
readonly secretParam: string;
|
|
31
25
|
readonly recoveryCodes: readonly string[];
|
|
32
|
-
readonly
|
|
26
|
+
readonly otpauthUri: string;
|
|
33
27
|
};
|
|
34
28
|
|
|
35
29
|
// otpauth:// URIs put the secret in the query string — extract it for the
|
|
@@ -80,7 +74,7 @@ export function MfaSetupPreauthScreen({
|
|
|
80
74
|
onCancel,
|
|
81
75
|
}: MfaSetupPreauthScreenProps): ReactNode {
|
|
82
76
|
const t = useTranslation();
|
|
83
|
-
const { Button, Banner, Field, Form, Input, Section } = usePrimitives();
|
|
77
|
+
const { Button, Banner, Field, Form, Input, Section, SecretReveal } = usePrimitives();
|
|
84
78
|
|
|
85
79
|
const [setup, setSetup] = useState<SetupState | null>(null);
|
|
86
80
|
const [acknowledged, setAcknowledged] = useState(false);
|
|
@@ -100,18 +94,11 @@ export function MfaSetupPreauthScreen({
|
|
|
100
94
|
setRetryAfterSeconds(res.error.retryAfterSeconds ?? null);
|
|
101
95
|
return;
|
|
102
96
|
}
|
|
103
|
-
// errorCorrectionLevel "H" (~30% redundancy) — more resilient to
|
|
104
|
-
// camera/lighting issues than the default, no downside for a code
|
|
105
|
-
// this short-lived.
|
|
106
|
-
const qrSvg = await QRCode.toString(res.data.otpauthUri, {
|
|
107
|
-
type: "svg",
|
|
108
|
-
errorCorrectionLevel: "H",
|
|
109
|
-
});
|
|
110
97
|
setSetup({
|
|
111
98
|
setupToken: res.data.setupToken,
|
|
112
99
|
secretParam: extractSecret(res.data.otpauthUri),
|
|
113
100
|
recoveryCodes: res.data.recoveryCodes,
|
|
114
|
-
|
|
101
|
+
otpauthUri: res.data.otpauthUri,
|
|
115
102
|
});
|
|
116
103
|
setAcknowledged(false);
|
|
117
104
|
setCode("");
|
|
@@ -192,13 +179,24 @@ export function MfaSetupPreauthScreen({
|
|
|
192
179
|
<Form onSubmit={onSubmit}>
|
|
193
180
|
<Section testId="mfa-setup-preauth-setup">
|
|
194
181
|
<div className="flex flex-col items-center gap-2 text-center">
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
182
|
+
{SecretReveal !== undefined ? (
|
|
183
|
+
<SecretReveal
|
|
184
|
+
values={[
|
|
185
|
+
{
|
|
186
|
+
label: t("auth.mfa.enable.scanTitle"),
|
|
187
|
+
value: setup.otpauthUri,
|
|
188
|
+
qr: true,
|
|
189
|
+
copyable: false,
|
|
190
|
+
multiline: false,
|
|
191
|
+
},
|
|
192
|
+
]}
|
|
193
|
+
copyLabel={t("kumiko.secretMint.copy")}
|
|
194
|
+
copiedLabel={t("kumiko.secretMint.copied")}
|
|
195
|
+
testId="mfa-setup-preauth-qr"
|
|
196
|
+
/>
|
|
197
|
+
) : (
|
|
198
|
+
<span className="text-sm font-semibold">{t("auth.mfa.enable.scanTitle")}</span>
|
|
199
|
+
)}
|
|
202
200
|
<span className="text-xs text-muted-foreground">
|
|
203
201
|
{t("auth.mfa.enable.manualEntry")}
|
|
204
202
|
</span>
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.379.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "Late Stripe events are dropped",
|
|
6
|
+
"detail": "The Stripe plugin passes event.created as providerEventAt, process-event stores it as providerEventAtIso in the subscription event and drops a created, updated or canceled event that is older than one already stored (result stale: true). A canceled subscription is no longer reactivated by a late delivery. Providers without a timestamp are unaffected; no migration."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.379.0",
|
|
10
|
+
"type": "fix",
|
|
11
|
+
"title": "Contract mails reach users with encrypted email addresses",
|
|
12
|
+
"detail": "With a KMS configured, the contract confirmation and the receipt for a termination from the user account used the stored, encrypted email address as recipient. The mail channel refuses such addresses, so neither mail was sent and the send job failed after its retries. Both now decrypt the address first; an erased user gets no mail, as before for deleted users."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"version": "0.379.0",
|
|
16
|
+
"type": "improvement",
|
|
17
|
+
"title": "\"This cancellation was not me\" link in the public cancellation receipt",
|
|
18
|
+
"detail": "When a public § 312k declaration matches an account, the receipt mail carries a one-time link (random token, only its sha256 is stored as revocationTokenHash in the declared event). The link opens a confirmation page; confirming with POST takes the cancellation back until it takes effect, resumes the provider subscription through the new optional SubscriptionProviderPlugin.resumeSubscription (Stripe sets cancel_at_period_end to false) or asks the operator to do it by hand, appends contract-termination.revoked and notifies the operator. Unknown requests and wrong tokens get the same answer; after the effective date the page says it is too late. Declarations stored before this release have no token and cannot be revoked by link."
|
|
19
|
+
},
|
|
2
20
|
{
|
|
3
21
|
"version": "0.377.0",
|
|
4
22
|
"type": "improvement",
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
UnconfiguredError,
|
|
12
12
|
UnprocessableError,
|
|
13
13
|
} from "@cosmicdrift/kumiko-framework/errors";
|
|
14
|
+
import { getSubscriptionForTenant } from "./get-subscription-for-tenant.ts";
|
|
15
|
+
import type { BillingPlanCatalog, SubscriptionProviderPlugin } from "./types.ts";
|
|
14
16
|
import {
|
|
15
17
|
BILLING_FOUNDATION_FEATURE,
|
|
16
18
|
isSubscriptionBlockingCheckout,
|
|
17
19
|
SUBSCRIPTION_PROVIDER_EXTENSION,
|
|
18
|
-
} from "./constants.ts";
|
|
19
|
-
import { getSubscriptionForTenant } from "./get-subscription-for-tenant.ts";
|
|
20
|
-
import type { BillingPlanCatalog, SubscriptionProviderPlugin } from "./types.ts";
|
|
20
|
+
} from "./web/constants.ts";
|
|
21
21
|
|
|
22
22
|
/** Narrows a `readonly string[]` to the non-empty tuple shape `z.enum`
|
|
23
23
|
* needs. Callers only reach this with a catalog's `plans` — the feature
|
package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-text.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import type { ConsentLocale } from "
|
|
2
|
+
import type { ConsentLocale } from "../web/consumer-protection/consent-locale.ts";
|
|
3
3
|
|
|
4
4
|
export {
|
|
5
5
|
CONSENT_LOCALES,
|
|
6
6
|
type ConsentLocale,
|
|
7
7
|
FALLBACK_CONSENT_LOCALE,
|
|
8
8
|
resolveConsentLocale,
|
|
9
|
-
} from "
|
|
9
|
+
} from "../web/consumer-protection/consent-locale.ts";
|
|
10
10
|
|
|
11
11
|
// Legal texts, deliberately inline de/en: the wording is part of the recorded
|
|
12
12
|
// consent, so it cannot follow the en-only i18n convention.
|
package/packages/bundled-features/src/billing-foundation/consumer-protection/issue-confirmation.ts
CHANGED
|
@@ -15,7 +15,6 @@ import * as z from "zod";
|
|
|
15
15
|
import { requireTemplateResolver, TEXT_BLOCK_KIND } from "../../template-resolver/index.ts";
|
|
16
16
|
import { UserQueries } from "../../user/index.ts";
|
|
17
17
|
import { paymentAggregateId, subscriptionAggregateId } from "../aggregate-id.ts";
|
|
18
|
-
import { CONTRACT_CONFIRMATION_NOTIFICATION_TYPE } from "../constants.ts";
|
|
19
18
|
import {
|
|
20
19
|
CHECKOUT_CONSENT_RECORDED_EVENT_QN,
|
|
21
20
|
type CheckoutConsentRecordedPayload,
|
|
@@ -27,8 +26,10 @@ import {
|
|
|
27
26
|
SUBSCRIPTION_AGGREGATE_TYPE,
|
|
28
27
|
} from "../events.ts";
|
|
29
28
|
import type { ConsumerProtectionOptions, ResolvedBillingFoundationOptions } from "../types.ts";
|
|
29
|
+
import { CONTRACT_CONFIRMATION_NOTIFICATION_TYPE } from "../web/constants.ts";
|
|
30
30
|
import { contractConfirmationVariables } from "./confirmation-mail.ts";
|
|
31
31
|
import { resolveConsentLocale } from "./consent-text.ts";
|
|
32
|
+
import { openStoredUserEmail } from "./stored-user-email.ts";
|
|
32
33
|
|
|
33
34
|
export const issueContractConfirmationSchema = z
|
|
34
35
|
.object({
|
|
@@ -142,7 +143,14 @@ export function createIssueContractConfirmationHandler(
|
|
|
142
143
|
id: consent.actorUserId,
|
|
143
144
|
}),
|
|
144
145
|
);
|
|
145
|
-
|
|
146
|
+
const recipientEmail =
|
|
147
|
+
recipient.success && recipient.data.isDeleted !== true
|
|
148
|
+
? await openStoredUserEmail(
|
|
149
|
+
recipient.data.email,
|
|
150
|
+
"billing-foundation:issue-contract-confirmation",
|
|
151
|
+
)
|
|
152
|
+
: null;
|
|
153
|
+
if (!recipient.success || recipientEmail === null) {
|
|
146
154
|
ctx.log?.warn(
|
|
147
155
|
`[billing-foundation:issue-contract-confirmation] recipient of consent ${payload.consentId} not found; no mail sent`,
|
|
148
156
|
);
|
|
@@ -219,7 +227,7 @@ export function createIssueContractConfirmationHandler(
|
|
|
219
227
|
await stream.appendOne({ type: CONTRACT_CONFIRMATION_ISSUED_EVENT_QN, payload: issued });
|
|
220
228
|
|
|
221
229
|
await ctx.notify(CONTRACT_CONFIRMATION_NOTIFICATION_TYPE, {
|
|
222
|
-
route: { email:
|
|
230
|
+
route: { email: recipientEmail },
|
|
223
231
|
data: variables,
|
|
224
232
|
locale,
|
|
225
233
|
priority: "critical",
|
package/packages/bundled-features/src/billing-foundation/consumer-protection/mail-notifications.ts
CHANGED
|
@@ -4,7 +4,12 @@ import {
|
|
|
4
4
|
type TemplateVariables,
|
|
5
5
|
templateVariable,
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
mailHeading,
|
|
9
|
+
mailParagraph,
|
|
10
|
+
mailParagraphWithLink,
|
|
11
|
+
mailRepeatedRows,
|
|
12
|
+
} from "../../shared/index.ts";
|
|
8
13
|
import { CONFIRMATION_LABELS } from "./confirmation-mail.ts";
|
|
9
14
|
import { CONSENT_LOCALES, CONSENT_TEXTS, type ConsentLocale } from "./consent-text.ts";
|
|
10
15
|
import { TERMINATION_TEXTS } from "./termination-texts.ts";
|
|
@@ -21,6 +26,7 @@ export const TERMINATION_RECEIPT_VARIABLES: TemplateVariables = {
|
|
|
21
26
|
requestId: templateVariable.text({ required: true }),
|
|
22
27
|
details: textRows(),
|
|
23
28
|
operatorEmail: templateVariable.text({ required: true }),
|
|
29
|
+
revokeUrl: templateVariable.link(),
|
|
24
30
|
};
|
|
25
31
|
|
|
26
32
|
export const OPERATOR_NOTICE_VARIABLES: TemplateVariables = {
|
|
@@ -63,6 +69,10 @@ export function terminationReceiptTemplate(): NotificationLocalizedTemplate {
|
|
|
63
69
|
mailRepeatedRows("details", "text"),
|
|
64
70
|
mailParagraph(texts.receiptNextSteps),
|
|
65
71
|
mailParagraph(texts.receiptRevoke(OPERATOR_EMAIL_SLOT)),
|
|
72
|
+
mailParagraphWithLink(texts.receiptNotMe, texts.receiptNotMeLink, "revokeUrl").replace(
|
|
73
|
+
"<p>",
|
|
74
|
+
'<p data-if="revokeUrl">',
|
|
75
|
+
),
|
|
66
76
|
mailParagraph(`${texts.contact} {operatorEmail}`),
|
|
67
77
|
].join(""),
|
|
68
78
|
};
|
package/packages/bundled-features/src/billing-foundation/consumer-protection/register-consent.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { FeatureRegistrar } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { paymentAggregateId, subscriptionAggregateId } from "../aggregate-id.ts";
|
|
3
|
-
import { SubscriptionFoundationHandlers, SubscriptionStatuses } from "../constants.ts";
|
|
4
3
|
import {
|
|
5
4
|
CHECKOUT_CONSENT_RECORDED_EVENT_SHORT,
|
|
6
5
|
CONTRACT_CONFIRMATION_ISSUED_EVENT_SHORT,
|
|
@@ -12,6 +11,7 @@ import {
|
|
|
12
11
|
SUBSCRIPTION_UPDATED_EVENT_QN,
|
|
13
12
|
} from "../events.ts";
|
|
14
13
|
import type { ConsumerProtectionOptions, ResolvedBillingFoundationOptions } from "../types.ts";
|
|
14
|
+
import { SubscriptionFoundationHandlers, SubscriptionStatuses } from "../web/constants.ts";
|
|
15
15
|
import { createIssueContractConfirmationHandler } from "./issue-confirmation.ts";
|
|
16
16
|
import { registerConsumerProtectionMails } from "./mail-notifications.ts";
|
|
17
17
|
import { registerContractTermination } from "./register-termination.ts";
|
package/packages/bundled-features/src/billing-foundation/consumer-protection/register-termination.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { FeatureRegistrar } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { SubscriptionCancelTimings, SubscriptionFoundationHandlers } from "../constants.ts";
|
|
3
2
|
import {
|
|
4
3
|
CONTRACT_TERMINATION_DECLARED_EVENT_QN,
|
|
5
4
|
CONTRACT_TERMINATION_DECLARED_EVENT_SHORT,
|
|
6
5
|
CONTRACT_TERMINATION_REQUESTED_EVENT_SHORT,
|
|
6
|
+
CONTRACT_TERMINATION_REVOKED_EVENT_SHORT,
|
|
7
7
|
CONTRACT_TERMINATION_UNMATCHED_EVENT_SHORT,
|
|
8
8
|
contractTerminationDeclaredPayloadSchema,
|
|
9
9
|
contractTerminationRequestedPayloadSchema,
|
|
10
|
+
contractTerminationRevokedPayloadSchema,
|
|
10
11
|
contractTerminationUnmatchedPayloadSchema,
|
|
11
12
|
} from "../events.ts";
|
|
12
13
|
import type { ConsumerProtectionOptions, ResolvedBillingFoundationOptions } from "../types.ts";
|
|
14
|
+
import { SubscriptionCancelTimings, SubscriptionFoundationHandlers } from "../web/constants.ts";
|
|
13
15
|
import {
|
|
14
16
|
createDeclareContractTerminationHandler,
|
|
15
17
|
createRecordContractTerminationHandler,
|
|
@@ -20,6 +22,10 @@ import {
|
|
|
20
22
|
createRequestContractTerminationHandler,
|
|
21
23
|
createTerminateContractHandler,
|
|
22
24
|
} from "./termination-request.ts";
|
|
25
|
+
import {
|
|
26
|
+
createRecordContractTerminationRevocationHandler,
|
|
27
|
+
createRevokeContractTerminationHandler,
|
|
28
|
+
} from "./termination-revoke.ts";
|
|
23
29
|
|
|
24
30
|
export function registerContractTermination(
|
|
25
31
|
r: FeatureRegistrar,
|
|
@@ -36,6 +42,9 @@ export function registerContractTermination(
|
|
|
36
42
|
contractTerminationDeclaredPayloadSchema,
|
|
37
43
|
{ piiFields: "none" },
|
|
38
44
|
);
|
|
45
|
+
r.defineEvent(CONTRACT_TERMINATION_REVOKED_EVENT_SHORT, contractTerminationRevokedPayloadSchema, {
|
|
46
|
+
piiFields: "none",
|
|
47
|
+
});
|
|
39
48
|
r.defineEvent(
|
|
40
49
|
CONTRACT_TERMINATION_UNMATCHED_EVENT_SHORT,
|
|
41
50
|
contractTerminationUnmatchedPayloadSchema,
|
|
@@ -47,6 +56,8 @@ export function registerContractTermination(
|
|
|
47
56
|
r.writeHandler(createRecordUnmatchedContractTerminationHandler());
|
|
48
57
|
r.writeHandler(createRequestContractTerminationHandler(options, consumerProtection));
|
|
49
58
|
r.writeHandler(createTerminateContractHandler(options, consumerProtection));
|
|
59
|
+
r.writeHandler(createRevokeContractTerminationHandler());
|
|
60
|
+
r.writeHandler(createRecordContractTerminationRevocationHandler(options, consumerProtection));
|
|
50
61
|
|
|
51
62
|
// The provider cancel of a public declaration runs here, not in the
|
|
52
63
|
// request: matched and unmatched requests then do the same work and the
|
package/packages/bundled-features/src/billing-foundation/consumer-protection/stored-user-email.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PII_ERASED_SENTINEL } from "@cosmicdrift/kumiko-framework/crypto";
|
|
2
|
+
import { decryptStoredPii } from "../../shared/index.ts";
|
|
3
|
+
|
|
4
|
+
// findForAuth returns the stored column, which is ciphertext under an active KMS;
|
|
5
|
+
// channel-email refuses to mail a ciphertext address. Null for an erased subject.
|
|
6
|
+
export async function openStoredUserEmail(
|
|
7
|
+
stored: string,
|
|
8
|
+
fallbackRequestId: string,
|
|
9
|
+
): Promise<string | null> {
|
|
10
|
+
const email = await decryptStoredPii(stored, "email", fallbackRequestId);
|
|
11
|
+
return email === PII_ERASED_SENTINEL ? null : email;
|
|
12
|
+
}
|
package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-mail.ts
CHANGED
|
@@ -16,6 +16,8 @@ export type TerminationReceiptVariables = {
|
|
|
16
16
|
readonly requestId: string;
|
|
17
17
|
readonly details: readonly TextRow[];
|
|
18
18
|
readonly operatorEmail: string;
|
|
19
|
+
/** Only a matched declaration carries the "this was not me" link. */
|
|
20
|
+
readonly revokeUrl?: string;
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
/** Variables of the operator notice template. */
|
|
@@ -92,9 +94,11 @@ export type TerminationReceiptArgs = {
|
|
|
92
94
|
readonly receivedAtIso: string;
|
|
93
95
|
readonly declaration: ReceiptDeclaration;
|
|
94
96
|
readonly operatorEmail: string;
|
|
97
|
+
readonly revokeUrl?: string;
|
|
95
98
|
};
|
|
96
99
|
|
|
97
|
-
/**
|
|
100
|
+
/** Apart from the revoke link, the content must not depend on whether the declaration
|
|
101
|
+
* matched a contract; the link only goes to the address the declarant entered. */
|
|
98
102
|
export function terminationReceiptVariables(
|
|
99
103
|
args: TerminationReceiptArgs,
|
|
100
104
|
): TerminationReceiptVariables {
|
|
@@ -105,6 +109,7 @@ export function terminationReceiptVariables(
|
|
|
105
109
|
requestId: args.requestId,
|
|
106
110
|
details: declarationLines(args.declaration, args.locale),
|
|
107
111
|
operatorEmail: args.operatorEmail,
|
|
112
|
+
...(args.revokeUrl !== undefined && { revokeUrl: args.revokeUrl }),
|
|
108
113
|
};
|
|
109
114
|
}
|
|
110
115
|
|
package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-notify.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { HandlerContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
|
-
import { CONTRACT_TERMINATION_OPERATOR_NOTIFICATION_TYPE } from "../constants.ts";
|
|
4
3
|
import type { ProviderCancelOutcome } from "../events.ts";
|
|
5
4
|
import type { ConsumerProtectionOptions } from "../types.ts";
|
|
5
|
+
import { CONTRACT_TERMINATION_OPERATOR_NOTIFICATION_TYPE } from "../web/constants.ts";
|
|
6
6
|
import type { ConsentLocale } from "./consent-text.ts";
|
|
7
7
|
import { type OperatorNoticeDeclaration, operatorNoticeVariables } from "./termination-mail.ts";
|
|
8
8
|
import type { OperatorNoticeReason } from "./termination-texts.ts";
|