@cosmicdrift/kumiko-bundled-features 0.328.0 → 0.329.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/dist/admin-shell/constants.d.ts +7 -0
- package/dist/admin-shell/constants.js +8 -0
- package/dist/admin-shell/feature.d.ts +17 -0
- package/dist/admin-shell/feature.js +182 -0
- package/dist/admin-shell/i18n.d.ts +5 -0
- package/dist/admin-shell/i18n.js +25 -0
- package/dist/admin-shell/index.d.ts +4 -0
- package/dist/admin-shell/index.js +4 -0
- package/dist/admin-shell/overview-allowlist.d.ts +9 -0
- package/dist/admin-shell/overview-allowlist.js +30 -0
- package/dist/admin-shell/web/client-plugin.d.ts +6 -0
- package/dist/admin-shell/web/client-plugin.js +10 -0
- package/dist/admin-shell/web/i18n.d.ts +2 -0
- package/dist/admin-shell/web/i18n.js +5 -0
- package/dist/admin-shell/web/index.d.ts +1 -0
- package/dist/admin-shell/web/index.js +2 -0
- package/dist/agent-tools/agent-doc-lint.d.ts +15 -0
- package/dist/agent-tools/agent-doc-lint.js +94 -0
- package/dist/agent-tools/agent-manifest.d.ts +5 -0
- package/dist/agent-tools/agent-manifest.js +252 -0
- package/dist/agent-tools/feature.d.ts +3 -0
- package/dist/agent-tools/feature.js +29 -0
- package/dist/agent-tools/index.d.ts +8 -0
- package/dist/agent-tools/index.js +5 -0
- package/dist/agent-tools/tool-catalog.d.ts +28 -0
- package/dist/agent-tools/tool-catalog.js +450 -0
- package/dist/agent-tools/tool-dispatch.d.ts +39 -0
- package/dist/agent-tools/tool-dispatch.js +264 -0
- package/dist/agent-tools/types.d.ts +194 -0
- package/dist/agent-tools/types.js +1 -0
- package/dist/audit/constants.d.ts +15 -0
- package/dist/audit/constants.js +20 -0
- package/dist/audit/escape-hatch-audit-sink.d.ts +22 -0
- package/dist/audit/escape-hatch-audit-sink.js +44 -0
- package/dist/audit/feature.d.ts +2 -0
- package/dist/audit/feature.js +128 -0
- package/dist/audit/handlers/details.query.d.ts +14 -0
- package/dist/audit/handlers/details.query.js +32 -0
- package/dist/audit/handlers/list.query.d.ts +35 -0
- package/dist/audit/handlers/list.query.js +100 -0
- package/dist/audit/i18n.d.ts +5 -0
- package/dist/audit/i18n.js +19 -0
- package/dist/audit/index.d.ts +3 -0
- package/dist/audit/index.js +3 -0
- package/dist/audit/web/client-plugin.d.ts +6 -0
- package/dist/audit/web/client-plugin.js +10 -0
- package/dist/audit/web/i18n.d.ts +2 -0
- package/dist/audit/web/i18n.js +4 -0
- package/dist/audit/web/index.d.ts +1 -0
- package/dist/audit/web/index.js +2 -0
- package/dist/auth-email-password/auth-paths.d.ts +19 -0
- package/dist/auth-email-password/auth-paths.js +14 -0
- package/dist/auth-email-password/auth-user-row.d.ts +15 -0
- package/dist/auth-email-password/auth-user-row.js +23 -0
- package/dist/auth-email-password/constants.d.ts +50 -0
- package/dist/auth-email-password/constants.js +137 -0
- package/dist/auth-email-password/email-templates.d.ts +30 -0
- package/dist/auth-email-password/email-templates.js +147 -0
- package/dist/auth-email-password/errors.d.ts +12 -0
- package/dist/auth-email-password/errors.js +76 -0
- package/dist/auth-email-password/feature.d.ts +55 -0
- package/dist/auth-email-password/feature.js +142 -0
- package/dist/auth-email-password/handlers/change-password.write.d.ts +7 -0
- package/dist/auth-email-password/handlers/change-password.write.js +54 -0
- package/dist/auth-email-password/handlers/confirm-account-unlock.write.d.ts +9 -0
- package/dist/auth-email-password/handlers/confirm-account-unlock.write.js +47 -0
- package/dist/auth-email-password/handlers/confirm-token-flow.d.ts +15 -0
- package/dist/auth-email-password/handlers/confirm-token-flow.js +96 -0
- package/dist/auth-email-password/handlers/invite-accept-with-login.write.d.ts +21 -0
- package/dist/auth-email-password/handlers/invite-accept-with-login.write.js +170 -0
- package/dist/auth-email-password/handlers/invite-accept.write.d.ts +11 -0
- package/dist/auth-email-password/handlers/invite-accept.write.js +131 -0
- package/dist/auth-email-password/handlers/invite-create.write.d.ts +32 -0
- package/dist/auth-email-password/handlers/invite-create.write.js +135 -0
- package/dist/auth-email-password/handlers/invite-info.query.d.ts +8 -0
- package/dist/auth-email-password/handlers/invite-info.query.js +62 -0
- package/dist/auth-email-password/handlers/invite-signup-complete.write.d.ts +12 -0
- package/dist/auth-email-password/handlers/invite-signup-complete.write.js +145 -0
- package/dist/auth-email-password/handlers/login.write.d.ts +78 -0
- package/dist/auth-email-password/handlers/login.write.js +197 -0
- package/dist/auth-email-password/handlers/logout.write.d.ts +2 -0
- package/dist/auth-email-password/handlers/logout.write.js +14 -0
- package/dist/auth-email-password/handlers/request-account-unlock.write.d.ts +6 -0
- package/dist/auth-email-password/handlers/request-account-unlock.write.js +24 -0
- package/dist/auth-email-password/handlers/request-email-verification.write.d.ts +6 -0
- package/dist/auth-email-password/handlers/request-email-verification.write.js +23 -0
- package/dist/auth-email-password/handlers/request-password-reset.write.d.ts +6 -0
- package/dist/auth-email-password/handlers/request-password-reset.write.js +23 -0
- package/dist/auth-email-password/handlers/reset-password.write.d.ts +10 -0
- package/dist/auth-email-password/handlers/reset-password.write.js +53 -0
- package/dist/auth-email-password/handlers/self-registration-status.query.d.ts +4 -0
- package/dist/auth-email-password/handlers/self-registration-status.query.js +24 -0
- package/dist/auth-email-password/handlers/signup-confirm.write.d.ts +15 -0
- package/dist/auth-email-password/handlers/signup-confirm.write.js +186 -0
- package/dist/auth-email-password/handlers/signup-request.write.d.ts +32 -0
- package/dist/auth-email-password/handlers/signup-request.write.js +174 -0
- package/dist/auth-email-password/handlers/token-request-handler.d.ts +45 -0
- package/dist/auth-email-password/handlers/token-request-handler.js +81 -0
- package/dist/auth-email-password/handlers/verify-email.write.d.ts +12 -0
- package/dist/auth-email-password/handlers/verify-email.write.js +50 -0
- package/dist/auth-email-password/i18n.d.ts +3 -0
- package/dist/auth-email-password/i18n.js +131 -0
- package/dist/auth-email-password/index.d.ts +9 -0
- package/dist/auth-email-password/index.js +18 -0
- package/dist/auth-email-password/invite-token-store.d.ts +30 -0
- package/dist/auth-email-password/invite-token-store.js +60 -0
- package/dist/auth-email-password/lockout-store.d.ts +5 -0
- package/dist/auth-email-password/lockout-store.js +28 -0
- package/dist/auth-email-password/magic-link-mail.d.ts +19 -0
- package/dist/auth-email-password/magic-link-mail.js +49 -0
- package/dist/auth-email-password/password-policy.d.ts +3 -0
- package/dist/auth-email-password/password-policy.js +2104 -0
- package/dist/auth-email-password/reset-token.d.ts +14 -0
- package/dist/auth-email-password/reset-token.js +13 -0
- package/dist/auth-email-password/seeding.d.ts +122 -0
- package/dist/auth-email-password/seeding.js +237 -0
- package/dist/auth-email-password/self-registration-toggle.d.ts +3 -0
- package/dist/auth-email-password/self-registration-toggle.js +21 -0
- package/dist/auth-email-password/signed-token.d.ts +1 -0
- package/dist/auth-email-password/signed-token.js +4 -0
- package/dist/auth-email-password/signup-token-store.d.ts +51 -0
- package/dist/auth-email-password/signup-token-store.js +115 -0
- package/dist/auth-email-password/testing.d.ts +1 -0
- package/dist/auth-email-password/testing.js +4 -0
- package/dist/auth-email-password/unlock-token.d.ts +14 -0
- package/dist/auth-email-password/unlock-token.js +11 -0
- package/dist/auth-email-password/verification-token.d.ts +14 -0
- package/dist/auth-email-password/verification-token.js +12 -0
- package/dist/auth-email-password/web/auth-client.d.ts +133 -0
- package/dist/auth-email-password/web/auth-client.js +290 -0
- package/dist/auth-email-password/web/auth-form-logic.d.ts +10 -0
- package/dist/auth-email-password/web/auth-form-logic.js +26 -0
- package/dist/auth-email-password/web/auth-form-primitives.d.ts +15 -0
- package/dist/auth-email-password/web/auth-form-primitives.js +71 -0
- package/dist/auth-email-password/web/auth-gate.d.ts +31 -0
- package/dist/auth-email-password/web/auth-gate.js +101 -0
- package/dist/auth-email-password/web/client-plugin.d.ts +38 -0
- package/dist/auth-email-password/web/client-plugin.js +24 -0
- package/dist/auth-email-password/web/confirm-account-unlock-screen.d.ts +9 -0
- package/dist/auth-email-password/web/confirm-account-unlock-screen.js +43 -0
- package/dist/auth-email-password/web/default-topbar-actions.d.ts +17 -0
- package/dist/auth-email-password/web/default-topbar-actions.js +14 -0
- package/dist/auth-email-password/web/forgot-password-screen.d.ts +9 -0
- package/dist/auth-email-password/web/forgot-password-screen.js +57 -0
- package/dist/auth-email-password/web/index.d.ts +41 -0
- package/dist/auth-email-password/web/index.js +27 -0
- package/dist/auth-email-password/web/invite-accept-screen.d.ts +18 -0
- package/dist/auth-email-password/web/invite-accept-screen.js +134 -0
- package/dist/auth-email-password/web/login-screen.d.ts +49 -0
- package/dist/auth-email-password/web/login-screen.js +124 -0
- package/dist/auth-email-password/web/request-account-unlock-screen.d.ts +9 -0
- package/dist/auth-email-password/web/request-account-unlock-screen.js +58 -0
- package/dist/auth-email-password/web/reset-password-screen.d.ts +11 -0
- package/dist/auth-email-password/web/reset-password-screen.js +68 -0
- package/dist/auth-email-password/web/session-bootstrap-error.d.ts +9 -0
- package/dist/auth-email-password/web/session-bootstrap-error.js +30 -0
- package/dist/auth-email-password/web/session.d.ts +42 -0
- package/dist/auth-email-password/web/session.js +144 -0
- package/dist/auth-email-password/web/signup-complete-screen.d.ts +20 -0
- package/dist/auth-email-password/web/signup-complete-screen.js +86 -0
- package/dist/auth-email-password/web/signup-screen.d.ts +9 -0
- package/dist/auth-email-password/web/signup-screen.js +71 -0
- package/dist/auth-email-password/web/tenant-menu-items.d.ts +5 -0
- package/dist/auth-email-password/web/tenant-menu-items.js +24 -0
- package/dist/auth-email-password/web/tenant-switcher.d.ts +9 -0
- package/dist/auth-email-password/web/tenant-switcher.js +64 -0
- package/dist/auth-email-password/web/use-shell-user.d.ts +5 -0
- package/dist/auth-email-password/web/use-shell-user.js +32 -0
- package/dist/auth-email-password/web/user-menu.d.ts +13 -0
- package/dist/auth-email-password/web/user-menu.js +44 -0
- package/dist/auth-email-password/web/verify-email-screen.d.ts +9 -0
- package/dist/auth-email-password/web/verify-email-screen.js +46 -0
- package/dist/auth-foundation/boot-checks.d.ts +5 -0
- package/dist/auth-foundation/boot-checks.js +113 -0
- package/dist/auth-foundation/feature.d.ts +37 -0
- package/dist/auth-foundation/feature.js +101 -0
- package/dist/auth-foundation/index.d.ts +3 -0
- package/dist/auth-foundation/index.js +4 -0
- package/dist/auth-foundation/resolve-anonymous-access.d.ts +11 -0
- package/dist/auth-foundation/resolve-anonymous-access.js +41 -0
- package/dist/auth-foundation/types.d.ts +74 -0
- package/dist/auth-foundation/types.js +76 -0
- package/dist/auth-mfa/base32.d.ts +2 -0
- package/dist/auth-mfa/base32.js +50 -0
- package/dist/auth-mfa/config.d.ts +5 -0
- package/dist/auth-mfa/config.js +22 -0
- package/dist/auth-mfa/constants.d.ts +30 -0
- package/dist/auth-mfa/constants.js +42 -0
- package/dist/auth-mfa/db/queries.d.ts +14 -0
- package/dist/auth-mfa/db/queries.js +31 -0
- package/dist/auth-mfa/errors.d.ts +9 -0
- package/dist/auth-mfa/errors.js +40 -0
- package/dist/auth-mfa/feature.d.ts +15 -0
- package/dist/auth-mfa/feature.js +175 -0
- package/dist/auth-mfa/handlers/disable.write.d.ts +10 -0
- package/dist/auth-mfa/handlers/disable.write.js +65 -0
- package/dist/auth-mfa/handlers/enable-confirm-preauth.write.d.ts +16 -0
- package/dist/auth-mfa/handlers/enable-confirm-preauth.write.js +176 -0
- package/dist/auth-mfa/handlers/enable-confirm.write.d.ts +12 -0
- package/dist/auth-mfa/handlers/enable-confirm.write.js +97 -0
- package/dist/auth-mfa/handlers/enable-start-preauth.write.d.ts +14 -0
- package/dist/auth-mfa/handlers/enable-start-preauth.write.js +75 -0
- package/dist/auth-mfa/handlers/enable-start.write.d.ts +13 -0
- package/dist/auth-mfa/handlers/enable-start.write.js +69 -0
- package/dist/auth-mfa/handlers/reencrypt.job.d.ts +16 -0
- package/dist/auth-mfa/handlers/reencrypt.job.js +157 -0
- package/dist/auth-mfa/handlers/regenerate-recovery.write.d.ts +9 -0
- package/dist/auth-mfa/handlers/regenerate-recovery.write.js +69 -0
- package/dist/auth-mfa/handlers/status.query.d.ts +4 -0
- package/dist/auth-mfa/handlers/status.query.js +28 -0
- package/dist/auth-mfa/handlers/verify.write.d.ts +14 -0
- package/dist/auth-mfa/handlers/verify.write.js +149 -0
- package/dist/auth-mfa/hmac-token-codec.d.ts +19 -0
- package/dist/auth-mfa/hmac-token-codec.js +56 -0
- package/dist/auth-mfa/i18n.d.ts +5 -0
- package/dist/auth-mfa/i18n.js +28 -0
- package/dist/auth-mfa/index.d.ts +9 -0
- package/dist/auth-mfa/index.js +6 -0
- package/dist/auth-mfa/mfa-challenge-token.d.ts +13 -0
- package/dist/auth-mfa/mfa-challenge-token.js +15 -0
- package/dist/auth-mfa/mfa-code-verifier.d.ts +7 -0
- package/dist/auth-mfa/mfa-code-verifier.js +28 -0
- package/dist/auth-mfa/mfa-preauth-setup-token.d.ts +13 -0
- package/dist/auth-mfa/mfa-preauth-setup-token.js +15 -0
- package/dist/auth-mfa/mfa-setup-token.d.ts +20 -0
- package/dist/auth-mfa/mfa-setup-token.js +65 -0
- package/dist/auth-mfa/mfa-status-checker.d.ts +14 -0
- package/dist/auth-mfa/mfa-status-checker.js +41 -0
- package/dist/auth-mfa/mfa-verify-attempts.d.ts +5 -0
- package/dist/auth-mfa/mfa-verify-attempts.js +26 -0
- package/dist/auth-mfa/otpauth-uri.d.ts +5 -0
- package/dist/auth-mfa/otpauth-uri.js +16 -0
- package/dist/auth-mfa/recovery-codes.d.ts +3 -0
- package/dist/auth-mfa/recovery-codes.js +45 -0
- package/dist/auth-mfa/schema/user-mfa.d.ts +185 -0
- package/dist/auth-mfa/schema/user-mfa.js +57 -0
- package/dist/auth-mfa/screens.d.ts +4 -0
- package/dist/auth-mfa/screens.js +109 -0
- package/dist/auth-mfa/testing.d.ts +1 -0
- package/dist/auth-mfa/testing.js +5 -0
- package/dist/auth-mfa/token-secrets.d.ts +12 -0
- package/dist/auth-mfa/token-secrets.js +21 -0
- package/dist/auth-mfa/totp.d.ts +4 -0
- package/dist/auth-mfa/totp.js +55 -0
- package/dist/auth-mfa/verify-factor.d.ts +16 -0
- package/dist/auth-mfa/verify-factor.js +46 -0
- package/dist/auth-mfa/web/client-plugin.d.ts +18 -0
- package/dist/auth-mfa/web/client-plugin.js +19 -0
- package/dist/auth-mfa/web/i18n.d.ts +3 -0
- package/dist/auth-mfa/web/i18n.js +55 -0
- package/dist/auth-mfa/web/index.d.ts +15 -0
- package/dist/auth-mfa/web/index.js +13 -0
- package/dist/auth-mfa/web/mfa-client.d.ts +23 -0
- package/dist/auth-mfa/web/mfa-client.js +133 -0
- package/dist/auth-mfa/web/mfa-disable-dialog.d.ts +8 -0
- package/dist/auth-mfa/web/mfa-disable-dialog.js +32 -0
- package/dist/auth-mfa/web/mfa-recovery-codes-reveal.d.ts +6 -0
- package/dist/auth-mfa/web/mfa-recovery-codes-reveal.js +15 -0
- package/dist/auth-mfa/web/mfa-regenerate-recovery-dialog.d.ts +8 -0
- package/dist/auth-mfa/web/mfa-regenerate-recovery-dialog.js +29 -0
- package/dist/auth-mfa/web/mfa-setup-preauth-screen.d.ts +14 -0
- package/dist/auth-mfa/web/mfa-setup-preauth-screen.js +133 -0
- package/dist/auth-mfa/web/mfa-verify-screen.d.ts +13 -0
- package/dist/auth-mfa/web/mfa-verify-screen.js +58 -0
- package/dist/auth-mfa-user-data/hooks.d.ts +3 -0
- package/dist/auth-mfa-user-data/hooks.js +47 -0
- package/dist/auth-mfa-user-data/index.d.ts +3 -0
- package/dist/auth-mfa-user-data/index.js +17 -0
- package/dist/billing-foundation/aggregate-id.d.ts +20 -0
- package/dist/billing-foundation/aggregate-id.js +53 -0
- package/dist/billing-foundation/billing-info-query.d.ts +26 -0
- package/dist/billing-foundation/billing-info-query.js +59 -0
- package/dist/billing-foundation/checkout-core.d.ts +98 -0
- package/dist/billing-foundation/checkout-core.js +282 -0
- package/dist/billing-foundation/constants.d.ts +98 -0
- package/dist/billing-foundation/constants.js +164 -0
- package/dist/billing-foundation/db/queries/payment-projection.d.ts +2 -0
- package/dist/billing-foundation/db/queries/payment-projection.js +13 -0
- package/dist/billing-foundation/db/queries/subscription-projection.d.ts +2 -0
- package/dist/billing-foundation/db/queries/subscription-projection.js +7 -0
- package/dist/billing-foundation/entities.d.ts +196 -0
- package/dist/billing-foundation/entities.js +125 -0
- package/dist/billing-foundation/events.d.ts +47 -0
- package/dist/billing-foundation/events.js +77 -0
- package/dist/billing-foundation/feature.d.ts +4 -0
- package/dist/billing-foundation/feature.js +227 -0
- package/dist/billing-foundation/get-subscription-for-tenant.d.ts +20 -0
- package/dist/billing-foundation/get-subscription-for-tenant.js +33 -0
- package/dist/billing-foundation/handlers/billing-plans.query.d.ts +3 -0
- package/dist/billing-foundation/handlers/billing-plans.query.js +19 -0
- package/dist/billing-foundation/handlers/create-checkout-session.write.d.ts +3 -0
- package/dist/billing-foundation/handlers/create-checkout-session.write.js +68 -0
- package/dist/billing-foundation/handlers/create-portal-session.write.d.ts +3 -0
- package/dist/billing-foundation/handlers/create-portal-session.write.js +76 -0
- package/dist/billing-foundation/handlers/list-subscriptions.query.d.ts +2 -0
- package/dist/billing-foundation/handlers/list-subscriptions.query.js +27 -0
- package/dist/billing-foundation/handlers/process-event.write.d.ts +32 -0
- package/dist/billing-foundation/handlers/process-event.write.js +165 -0
- package/dist/billing-foundation/handlers/process-payment-event.write.d.ts +10 -0
- package/dist/billing-foundation/handlers/process-payment-event.write.js +92 -0
- package/dist/billing-foundation/handlers/start-plan-checkout.write.d.ts +3 -0
- package/dist/billing-foundation/handlers/start-plan-checkout.write.js +47 -0
- package/dist/billing-foundation/handlers/switch-plan.write.d.ts +3 -0
- package/dist/billing-foundation/handlers/switch-plan.write.js +86 -0
- package/dist/billing-foundation/handlers/sync-subscription.write.d.ts +11 -0
- package/dist/billing-foundation/handlers/sync-subscription.write.js +128 -0
- package/dist/billing-foundation/i18n.d.ts +5 -0
- package/dist/billing-foundation/i18n.js +70 -0
- package/dist/billing-foundation/index.d.ts +13 -0
- package/dist/billing-foundation/index.js +14 -0
- package/dist/billing-foundation/plan-catalog.d.ts +23 -0
- package/dist/billing-foundation/plan-catalog.js +163 -0
- package/dist/billing-foundation/projection.d.ts +221 -0
- package/dist/billing-foundation/projection.js +180 -0
- package/dist/billing-foundation/screens.d.ts +8 -0
- package/dist/billing-foundation/screens.js +22 -0
- package/dist/billing-foundation/subscription-tier-sync.d.ts +11 -0
- package/dist/billing-foundation/subscription-tier-sync.js +119 -0
- package/dist/billing-foundation/tenant-destroy-hook.d.ts +14 -0
- package/dist/billing-foundation/tenant-destroy-hook.js +68 -0
- package/dist/billing-foundation/types.d.ts +325 -0
- package/dist/billing-foundation/types.js +31 -0
- package/dist/billing-foundation/validate-options.d.ts +6 -0
- package/dist/billing-foundation/validate-options.js +54 -0
- package/dist/billing-foundation/web/billing-plans-panel.d.ts +3 -0
- package/dist/billing-foundation/web/billing-plans-panel.js +165 -0
- package/dist/billing-foundation/web/client-plugin.d.ts +6 -0
- package/dist/billing-foundation/web/client-plugin.js +11 -0
- package/dist/billing-foundation/web/index.d.ts +4 -0
- package/dist/billing-foundation/web/index.js +8 -0
- package/dist/billing-foundation/webhook-handler.d.ts +16 -0
- package/dist/billing-foundation/webhook-handler.js +100 -0
- package/dist/cap-counter/aggregate-id.d.ts +24 -0
- package/dist/cap-counter/aggregate-id.js +42 -0
- package/dist/cap-counter/book-cap-usage.d.ts +19 -0
- package/dist/cap-counter/book-cap-usage.js +108 -0
- package/dist/cap-counter/constants.d.ts +14 -0
- package/dist/cap-counter/constants.js +29 -0
- package/dist/cap-counter/enforce-cap.d.ts +216 -0
- package/dist/cap-counter/enforce-cap.js +256 -0
- package/dist/cap-counter/entity.d.ts +64 -0
- package/dist/cap-counter/entity.js +50 -0
- package/dist/cap-counter/feature.d.ts +3 -0
- package/dist/cap-counter/feature.js +112 -0
- package/dist/cap-counter/handlers/get-counter.query.d.ts +2 -0
- package/dist/cap-counter/handlers/get-counter.query.js +27 -0
- package/dist/cap-counter/handlers/increment-rolling.write.d.ts +9 -0
- package/dist/cap-counter/handlers/increment-rolling.write.js +72 -0
- package/dist/cap-counter/handlers/increment.write.d.ts +2 -0
- package/dist/cap-counter/handlers/increment.write.js +47 -0
- package/dist/cap-counter/handlers/mark-soft-warned.write.d.ts +2 -0
- package/dist/cap-counter/handlers/mark-soft-warned.write.js +27 -0
- package/dist/cap-counter/i18n.d.ts +5 -0
- package/dist/cap-counter/i18n.js +10 -0
- package/dist/cap-counter/index.d.ts +8 -0
- package/dist/cap-counter/index.js +9 -0
- package/dist/cap-counter/stock-cap-guard.d.ts +19 -0
- package/dist/cap-counter/stock-cap-guard.js +33 -0
- package/dist/cap-counter/with-cap-enforcement.d.ts +60 -0
- package/dist/cap-counter/with-cap-enforcement.js +105 -0
- package/dist/cap-overview/access.d.ts +1 -0
- package/dist/cap-overview/access.js +8 -0
- package/dist/cap-overview/constants.d.ts +12 -0
- package/dist/cap-overview/constants.js +21 -0
- package/dist/cap-overview/feature.d.ts +14 -0
- package/dist/cap-overview/feature.js +55 -0
- package/dist/cap-overview/handlers/caps-usage.query.d.ts +3 -0
- package/dist/cap-overview/handlers/caps-usage.query.js +83 -0
- package/dist/cap-overview/handlers/tenant-caps-list.query.d.ts +32 -0
- package/dist/cap-overview/handlers/tenant-caps-list.query.js +192 -0
- package/dist/cap-overview/handlers/tenant-options.query.d.ts +7 -0
- package/dist/cap-overview/handlers/tenant-options.query.js +23 -0
- package/dist/cap-overview/i18n.d.ts +5 -0
- package/dist/cap-overview/i18n.js +24 -0
- package/dist/cap-overview/index.d.ts +6 -0
- package/dist/cap-overview/index.js +6 -0
- package/dist/cap-overview/screens.d.ts +5 -0
- package/dist/cap-overview/screens.js +90 -0
- package/dist/cap-overview/types.d.ts +33 -0
- package/dist/cap-overview/types.js +1 -0
- package/dist/cap-overview/usage-math.d.ts +4 -0
- package/dist/cap-overview/usage-math.js +28 -0
- package/dist/cap-overview/web/cap-cards-panel.d.ts +3 -0
- package/dist/cap-overview/web/cap-cards-panel.js +61 -0
- package/dist/cap-overview/web/cap-usage-bar.d.ts +6 -0
- package/dist/cap-overview/web/cap-usage-bar.js +16 -0
- package/dist/cap-overview/web/cap-usage-cell.d.ts +3 -0
- package/dist/cap-overview/web/cap-usage-cell.js +16 -0
- package/dist/cap-overview/web/client-plugin.d.ts +6 -0
- package/dist/cap-overview/web/client-plugin.js +15 -0
- package/dist/cap-overview/web/index.d.ts +4 -0
- package/dist/cap-overview/web/index.js +9 -0
- package/dist/channel-email/email-channel.d.ts +12 -0
- package/dist/channel-email/email-channel.js +85 -0
- package/dist/channel-email/feature.d.ts +3 -0
- package/dist/channel-email/feature.js +21 -0
- package/dist/channel-email/index.d.ts +5 -0
- package/dist/channel-email/index.js +5 -0
- package/dist/channel-email/pii-guard.d.ts +3 -0
- package/dist/channel-email/pii-guard.js +47 -0
- package/dist/channel-email/smtp-transport.d.ts +53 -0
- package/dist/channel-email/smtp-transport.js +64 -0
- package/dist/channel-email/types.d.ts +17 -0
- package/dist/channel-email/types.js +20 -0
- package/dist/channel-in-app/constants.d.ts +9 -0
- package/dist/channel-in-app/constants.js +9 -0
- package/dist/channel-in-app/feature.d.ts +2 -0
- package/dist/channel-in-app/feature.js +37 -0
- package/dist/channel-in-app/handlers/inbox.query.d.ts +7 -0
- package/dist/channel-in-app/handlers/inbox.query.js +28 -0
- package/dist/channel-in-app/handlers/mark-all-read.write.d.ts +4 -0
- package/dist/channel-in-app/handlers/mark-all-read.write.js +19 -0
- package/dist/channel-in-app/handlers/mark-read.write.d.ts +6 -0
- package/dist/channel-in-app/handlers/mark-read.write.js +26 -0
- package/dist/channel-in-app/handlers/unread-count.query.d.ts +4 -0
- package/dist/channel-in-app/handlers/unread-count.query.js +26 -0
- package/dist/channel-in-app/in-app-channel.d.ts +2 -0
- package/dist/channel-in-app/in-app-channel.js +34 -0
- package/dist/channel-in-app/index.d.ts +4 -0
- package/dist/channel-in-app/index.js +4 -0
- package/dist/channel-in-app/tables.d.ts +3 -0
- package/dist/channel-in-app/tables.js +21 -0
- package/dist/channel-push/feature.d.ts +3 -0
- package/dist/channel-push/feature.js +20 -0
- package/dist/channel-push/index.d.ts +3 -0
- package/dist/channel-push/index.js +3 -0
- package/dist/channel-push/push-channel.d.ts +11 -0
- package/dist/channel-push/push-channel.js +19 -0
- package/dist/channel-push/types.d.ts +12 -0
- package/dist/channel-push/types.js +9 -0
- package/dist/compliance-profiles/_internal/parse-override.d.ts +2 -0
- package/dist/compliance-profiles/_internal/parse-override.js +16 -0
- package/dist/compliance-profiles/constants.d.ts +12 -0
- package/dist/compliance-profiles/constants.js +16 -0
- package/dist/compliance-profiles/feature.d.ts +6 -0
- package/dist/compliance-profiles/feature.js +67 -0
- package/dist/compliance-profiles/handlers/for-tenant.query.d.ts +3 -0
- package/dist/compliance-profiles/handlers/for-tenant.query.js +37 -0
- package/dist/compliance-profiles/handlers/list-profiles.query.d.ts +13 -0
- package/dist/compliance-profiles/handlers/list-profiles.query.js +35 -0
- package/dist/compliance-profiles/handlers/needs-profile.query.d.ts +9 -0
- package/dist/compliance-profiles/handlers/needs-profile.query.js +61 -0
- package/dist/compliance-profiles/handlers/set-profile.write.d.ts +13 -0
- package/dist/compliance-profiles/handlers/set-profile.write.js +109 -0
- package/dist/compliance-profiles/handlers/sub-processors.query.d.ts +10 -0
- package/dist/compliance-profiles/handlers/sub-processors.query.js +32 -0
- package/dist/compliance-profiles/i18n.d.ts +5 -0
- package/dist/compliance-profiles/i18n.js +22 -0
- package/dist/compliance-profiles/index.d.ts +3 -0
- package/dist/compliance-profiles/index.js +3 -0
- package/dist/compliance-profiles/resolve-for-tenant.d.ts +8 -0
- package/dist/compliance-profiles/resolve-for-tenant.js +29 -0
- package/dist/compliance-profiles/schema/profile-selection.d.ts +76 -0
- package/dist/compliance-profiles/schema/profile-selection.js +44 -0
- package/dist/compliance-profiles/seeding.d.ts +14 -0
- package/dist/compliance-profiles/seeding.js +61 -0
- package/dist/compliance-profiles/web/client-plugin.d.ts +6 -0
- package/dist/compliance-profiles/web/client-plugin.js +14 -0
- package/dist/compliance-profiles/web/compliance-profile-catalog.d.ts +3 -0
- package/dist/compliance-profiles/web/compliance-profile-catalog.js +20 -0
- package/dist/compliance-profiles/web/i18n.d.ts +2 -0
- package/dist/compliance-profiles/web/i18n.js +6 -0
- package/dist/compliance-profiles/web/index.d.ts +2 -0
- package/dist/compliance-profiles/web/index.js +3 -0
- package/dist/compliance-profiles-ops/handlers/tenants-missing-profile.query.d.ts +10 -0
- package/dist/compliance-profiles-ops/handlers/tenants-missing-profile.query.js +42 -0
- package/dist/compliance-profiles-ops/index.d.ts +7 -0
- package/dist/compliance-profiles-ops/index.js +28 -0
- package/dist/config/constants.d.ts +21 -0
- package/dist/config/constants.js +27 -0
- package/dist/config/db/queries/resolver.d.ts +11 -0
- package/dist/config/db/queries/resolver.js +27 -0
- package/dist/config/feature.d.ts +13 -0
- package/dist/config/feature.js +113 -0
- package/dist/config/handlers/cascade.query.d.ts +5 -0
- package/dist/config/handlers/cascade.query.js +71 -0
- package/dist/config/handlers/readiness.query.d.ts +22 -0
- package/dist/config/handlers/readiness.query.js +106 -0
- package/dist/config/handlers/reencrypt.job.d.ts +13 -0
- package/dist/config/handlers/reencrypt.job.js +203 -0
- package/dist/config/handlers/reset.write.d.ts +12 -0
- package/dist/config/handlers/reset.write.js +63 -0
- package/dist/config/handlers/schema.query.d.ts +3 -0
- package/dist/config/handlers/schema.query.js +31 -0
- package/dist/config/handlers/selected-extensions.query.d.ts +2 -0
- package/dist/config/handlers/selected-extensions.query.js +56 -0
- package/dist/config/handlers/set.write.d.ts +14 -0
- package/dist/config/handlers/set.write.js +145 -0
- package/dist/config/handlers/values.query.d.ts +7 -0
- package/dist/config/handlers/values.query.js +63 -0
- package/dist/config/i18n.d.ts +2 -0
- package/dist/config/i18n.js +3 -0
- package/dist/config/index.d.ts +15 -0
- package/dist/config/index.js +14 -0
- package/dist/config/read-redaction.d.ts +5 -0
- package/dist/config/read-redaction.js +49 -0
- package/dist/config/resolver.d.ts +19 -0
- package/dist/config/resolver.js +476 -0
- package/dist/config/table.d.ts +124 -0
- package/dist/config/table.js +38 -0
- package/dist/config/web/client-plugin.d.ts +11 -0
- package/dist/config/web/client-plugin.js +13 -0
- package/dist/config/web/i18n.d.ts +2 -0
- package/dist/config/web/i18n.js +32 -0
- package/dist/config/web/index.d.ts +2 -0
- package/dist/config/web/index.js +3 -0
- package/dist/config/write-helpers.d.ts +44 -0
- package/dist/config/write-helpers.js +267 -0
- package/dist/crypto-shredding/constants.d.ts +8 -0
- package/dist/crypto-shredding/constants.js +8 -0
- package/dist/crypto-shredding/feature.d.ts +2 -0
- package/dist/crypto-shredding/feature.js +17 -0
- package/dist/crypto-shredding/handlers/forget-subject.write.d.ts +50 -0
- package/dist/crypto-shredding/handlers/forget-subject.write.js +292 -0
- package/dist/crypto-shredding/index.d.ts +3 -0
- package/dist/crypto-shredding/index.js +3 -0
- package/dist/custom-fields/aggregate-id.d.ts +19 -0
- package/dist/custom-fields/aggregate-id.js +28 -0
- package/dist/custom-fields/constants.d.ts +25 -0
- package/dist/custom-fields/constants.js +72 -0
- package/dist/custom-fields/db/queries/field-access.d.ts +2 -0
- package/dist/custom-fields/db/queries/field-access.js +6 -0
- package/dist/custom-fields/db/queries/projection.d.ts +6 -0
- package/dist/custom-fields/db/queries/projection.js +45 -0
- package/dist/custom-fields/db/queries/quota.d.ts +2 -0
- package/dist/custom-fields/db/queries/quota.js +12 -0
- package/dist/custom-fields/db/queries/retention.d.ts +3 -0
- package/dist/custom-fields/db/queries/retention.js +23 -0
- package/dist/custom-fields/db/queries/user-data-rights.d.ts +6 -0
- package/dist/custom-fields/db/queries/user-data-rights.js +16 -0
- package/dist/custom-fields/entity.d.ts +107 -0
- package/dist/custom-fields/entity.js +99 -0
- package/dist/custom-fields/events.d.ts +10 -0
- package/dist/custom-fields/events.js +20 -0
- package/dist/custom-fields/executor.d.ts +1 -0
- package/dist/custom-fields/executor.js +6 -0
- package/dist/custom-fields/feature.d.ts +47 -0
- package/dist/custom-fields/feature.js +177 -0
- package/dist/custom-fields/handlers/clear-custom-field.write.d.ts +12 -0
- package/dist/custom-fields/handlers/clear-custom-field.write.js +62 -0
- package/dist/custom-fields/handlers/define-system-field.write.d.ts +2 -0
- package/dist/custom-fields/handlers/define-system-field.write.js +31 -0
- package/dist/custom-fields/handlers/define-tenant-field.write.d.ts +12 -0
- package/dist/custom-fields/handlers/define-tenant-field.write.js +44 -0
- package/dist/custom-fields/handlers/delete-system-field.write.d.ts +2 -0
- package/dist/custom-fields/handlers/delete-system-field.write.js +39 -0
- package/dist/custom-fields/handlers/delete-tenant-field.write.d.ts +8 -0
- package/dist/custom-fields/handlers/delete-tenant-field.write.js +39 -0
- package/dist/custom-fields/handlers/set-custom-field.write.d.ts +14 -0
- package/dist/custom-fields/handlers/set-custom-field.write.js +103 -0
- package/dist/custom-fields/handlers/update-tenant-field.write.d.ts +8 -0
- package/dist/custom-fields/handlers/update-tenant-field.write.js +43 -0
- package/dist/custom-fields/index.d.ts +10 -0
- package/dist/custom-fields/index.js +10 -0
- package/dist/custom-fields/lib/define-or-resurrect.d.ts +7 -0
- package/dist/custom-fields/lib/define-or-resurrect.js +40 -0
- package/dist/custom-fields/lib/field-access.d.ts +18 -0
- package/dist/custom-fields/lib/field-access.js +44 -0
- package/dist/custom-fields/lib/field-definition-row.d.ts +11 -0
- package/dist/custom-fields/lib/field-definition-row.js +19 -0
- package/dist/custom-fields/lib/parse-serialized-field.d.ts +22 -0
- package/dist/custom-fields/lib/parse-serialized-field.js +46 -0
- package/dist/custom-fields/lib/quota.d.ts +1 -0
- package/dist/custom-fields/lib/quota.js +4 -0
- package/dist/custom-fields/lib/value-schema.d.ts +2 -0
- package/dist/custom-fields/lib/value-schema.js +85 -0
- package/dist/custom-fields/run-retention.d.ts +21 -0
- package/dist/custom-fields/run-retention.js +158 -0
- package/dist/custom-fields/schemas.d.ts +73 -0
- package/dist/custom-fields/schemas.js +81 -0
- package/dist/custom-fields/web/client-plugin.d.ts +2 -0
- package/dist/custom-fields/web/client-plugin.js +24 -0
- package/dist/custom-fields/web/custom-fields-form-section.d.ts +10 -0
- package/dist/custom-fields/web/custom-fields-form-section.js +133 -0
- package/dist/custom-fields/web/i18n.d.ts +2 -0
- package/dist/custom-fields/web/i18n.js +19 -0
- package/dist/custom-fields/web/index.d.ts +3 -0
- package/dist/custom-fields/web/index.js +4 -0
- package/dist/custom-fields/wire-for-entity.d.ts +3 -0
- package/dist/custom-fields/wire-for-entity.js +185 -0
- package/dist/custom-fields/wire-user-data-rights.d.ts +7 -0
- package/dist/custom-fields/wire-user-data-rights.js +52 -0
- package/dist/data-retention/_internal/parse-override.d.ts +2 -0
- package/dist/data-retention/_internal/parse-override.js +25 -0
- package/dist/data-retention/feature.d.ts +9 -0
- package/dist/data-retention/feature.js +88 -0
- package/dist/data-retention/handlers/policy-for.query.d.ts +5 -0
- package/dist/data-retention/handlers/policy-for.query.js +40 -0
- package/dist/data-retention/index.d.ts +2 -0
- package/dist/data-retention/index.js +1 -0
- package/dist/data-retention/keep-for.d.ts +23 -0
- package/dist/data-retention/keep-for.js +57 -0
- package/dist/data-retention/override-schema.d.ts +17 -0
- package/dist/data-retention/override-schema.js +33 -0
- package/dist/data-retention/presets.d.ts +20 -0
- package/dist/data-retention/presets.js +55 -0
- package/dist/data-retention/resolve-for-tenant.d.ts +34 -0
- package/dist/data-retention/resolve-for-tenant.js +37 -0
- package/dist/data-retention/resolve-tenant-preset.d.ts +12 -0
- package/dist/data-retention/resolve-tenant-preset.js +34 -0
- package/dist/data-retention/resolver.d.ts +38 -0
- package/dist/data-retention/resolver.js +63 -0
- package/dist/data-retention/run-retention-cleanup.d.ts +39 -0
- package/dist/data-retention/run-retention-cleanup.js +508 -0
- package/dist/data-retention/schema/tenant-retention-override.d.ts +116 -0
- package/dist/data-retention/schema/tenant-retention-override.js +41 -0
- package/dist/delivery/address-opt-out.d.ts +29 -0
- package/dist/delivery/address-opt-out.js +118 -0
- package/dist/delivery/attempt-log.d.ts +5 -0
- package/dist/delivery/attempt-log.js +44 -0
- package/dist/delivery/channel-context.d.ts +5 -0
- package/dist/delivery/channel-context.js +8 -0
- package/dist/delivery/constants.d.ts +8 -0
- package/dist/delivery/constants.js +18 -0
- package/dist/delivery/db/queries/address-opt-outs.d.ts +3 -0
- package/dist/delivery/db/queries/address-opt-outs.js +10 -0
- package/dist/delivery/db/queries/preferences.d.ts +8 -0
- package/dist/delivery/db/queries/preferences.js +13 -0
- package/dist/delivery/delivery-service.d.ts +28 -0
- package/dist/delivery/delivery-service.js +447 -0
- package/dist/delivery/events.d.ts +20 -0
- package/dist/delivery/events.js +20 -0
- package/dist/delivery/feature.d.ts +5 -0
- package/dist/delivery/feature.js +152 -0
- package/dist/delivery/handlers/log.query.d.ts +24 -0
- package/dist/delivery/handlers/log.query.js +114 -0
- package/dist/delivery/handlers/preferences.query.d.ts +4 -0
- package/dist/delivery/handlers/preferences.query.js +36 -0
- package/dist/delivery/handlers/resubscribe-address.write.d.ts +9 -0
- package/dist/delivery/handlers/resubscribe-address.write.js +39 -0
- package/dist/delivery/handlers/resubscribe-user.write.d.ts +9 -0
- package/dist/delivery/handlers/resubscribe-user.write.js +38 -0
- package/dist/delivery/handlers/set-preference.write.d.ts +10 -0
- package/dist/delivery/handlers/set-preference.write.js +43 -0
- package/dist/delivery/handlers/unsubscribe-address.write.d.ts +9 -0
- package/dist/delivery/handlers/unsubscribe-address.write.js +37 -0
- package/dist/delivery/handlers/unsubscribe-user.write.d.ts +9 -0
- package/dist/delivery/handlers/unsubscribe-user.write.js +40 -0
- package/dist/delivery/i18n.d.ts +5 -0
- package/dist/delivery/i18n.js +9 -0
- package/dist/delivery/index.d.ts +9 -0
- package/dist/delivery/index.js +8 -0
- package/dist/delivery/jobs.d.ts +3 -0
- package/dist/delivery/jobs.js +115 -0
- package/dist/delivery/public-names.d.ts +33 -0
- package/dist/delivery/public-names.js +47 -0
- package/dist/delivery/tables.d.ts +132 -0
- package/dist/delivery/tables.js +108 -0
- package/dist/delivery/testing.d.ts +32 -0
- package/dist/delivery/testing.js +26 -0
- package/dist/delivery/types.d.ts +61 -0
- package/dist/delivery/types.js +10 -0
- package/dist/delivery/unsubscribe.d.ts +34 -0
- package/dist/delivery/unsubscribe.js +304 -0
- package/dist/delivery/upsert-preference.d.ts +15 -0
- package/dist/delivery/upsert-preference.js +83 -0
- package/dist/delivery/web/client-plugin.d.ts +6 -0
- package/dist/delivery/web/client-plugin.js +11 -0
- package/dist/delivery/web/delivery-status-cell.d.ts +3 -0
- package/dist/delivery/web/delivery-status-cell.js +13 -0
- package/dist/delivery/web/index.d.ts +2 -0
- package/dist/delivery/web/index.js +3 -0
- package/dist/derivatives-sharp/feature.d.ts +3 -0
- package/dist/derivatives-sharp/feature.js +15 -0
- package/dist/derivatives-sharp/index.d.ts +2 -0
- package/dist/derivatives-sharp/index.js +2 -0
- package/dist/derivatives-sharp/render.d.ts +7 -0
- package/dist/derivatives-sharp/render.js +310 -0
- package/dist/document-ingest-foundation/boot-checks.d.ts +2 -0
- package/dist/document-ingest-foundation/boot-checks.js +50 -0
- package/dist/document-ingest-foundation/entity.d.ts +129 -0
- package/dist/document-ingest-foundation/entity.js +31 -0
- package/dist/document-ingest-foundation/events.d.ts +27 -0
- package/dist/document-ingest-foundation/events.js +32 -0
- package/dist/document-ingest-foundation/executor.d.ts +1 -0
- package/dist/document-ingest-foundation/executor.js +6 -0
- package/dist/document-ingest-foundation/feature.d.ts +6 -0
- package/dist/document-ingest-foundation/feature.js +172 -0
- package/dist/document-ingest-foundation/file-ref-liveness.d.ts +2 -0
- package/dist/document-ingest-foundation/file-ref-liveness.js +5 -0
- package/dist/document-ingest-foundation/forget-extract-with-file-ref.d.ts +4 -0
- package/dist/document-ingest-foundation/forget-extract-with-file-ref.js +74 -0
- package/dist/document-ingest-foundation/index.d.ts +6 -0
- package/dist/document-ingest-foundation/index.js +7 -0
- package/dist/document-ingest-foundation/pages.d.ts +3 -0
- package/dist/document-ingest-foundation/pages.js +32 -0
- package/dist/document-ingest-foundation/providers.d.ts +29 -0
- package/dist/document-ingest-foundation/providers.js +44 -0
- package/dist/document-ingest-foundation/tenant-destroy-hook.d.ts +2 -0
- package/dist/document-ingest-foundation/tenant-destroy-hook.js +30 -0
- package/dist/document-ingest-foundation/write-document-extract.d.ts +18 -0
- package/dist/document-ingest-foundation/write-document-extract.js +28 -0
- package/dist/feature-toggles/compose-tier-resolver.d.ts +3 -0
- package/dist/feature-toggles/compose-tier-resolver.js +116 -0
- package/dist/feature-toggles/constants.d.ts +16 -0
- package/dist/feature-toggles/constants.js +32 -0
- package/dist/feature-toggles/events.d.ts +8 -0
- package/dist/feature-toggles/events.js +15 -0
- package/dist/feature-toggles/feature.d.ts +10 -0
- package/dist/feature-toggles/feature.js +118 -0
- package/dist/feature-toggles/global-feature-state-table.d.ts +4 -0
- package/dist/feature-toggles/global-feature-state-table.js +34 -0
- package/dist/feature-toggles/handlers/list.query.d.ts +10 -0
- package/dist/feature-toggles/handlers/list.query.js +33 -0
- package/dist/feature-toggles/handlers/registered.query.d.ts +17 -0
- package/dist/feature-toggles/handlers/registered.query.js +63 -0
- package/dist/feature-toggles/handlers/set.write.d.ts +10 -0
- package/dist/feature-toggles/handlers/set.write.js +143 -0
- package/dist/feature-toggles/i18n.d.ts +5 -0
- package/dist/feature-toggles/i18n.js +9 -0
- package/dist/feature-toggles/index.d.ts +3 -0
- package/dist/feature-toggles/index.js +3 -0
- package/dist/feature-toggles/toggle-runtime.d.ts +20 -0
- package/dist/feature-toggles/toggle-runtime.js +95 -0
- package/dist/feature-toggles/toggle-sync-signal.d.ts +5 -0
- package/dist/feature-toggles/toggle-sync-signal.js +41 -0
- package/dist/feature-toggles/web/client-plugin.d.ts +6 -0
- package/dist/feature-toggles/web/client-plugin.js +10 -0
- package/dist/feature-toggles/web/i18n.d.ts +2 -0
- package/dist/feature-toggles/web/i18n.js +14 -0
- package/dist/feature-toggles/web/index.d.ts +1 -0
- package/dist/feature-toggles/web/index.js +2 -0
- package/dist/file-derivatives/feature.d.ts +28 -0
- package/dist/file-derivatives/feature.js +166 -0
- package/dist/file-derivatives/handlers/public-variant-by-file-ref.query.d.ts +5 -0
- package/dist/file-derivatives/handlers/public-variant-by-file-ref.query.js +35 -0
- package/dist/file-derivatives/handlers/public-variant.query.d.ts +29 -0
- package/dist/file-derivatives/handlers/public-variant.query.js +110 -0
- package/dist/file-derivatives/index.d.ts +4 -0
- package/dist/file-derivatives/index.js +2 -0
- package/dist/file-derivatives/presets.d.ts +20 -0
- package/dist/file-derivatives/presets.js +8 -0
- package/dist/file-foundation/feature.d.ts +7 -0
- package/dist/file-foundation/feature.js +47 -0
- package/dist/file-foundation/index.d.ts +1 -0
- package/dist/file-foundation/index.js +2 -0
- package/dist/file-provider-inmemory/feature.d.ts +7 -0
- package/dist/file-provider-inmemory/feature.js +64 -0
- package/dist/file-provider-inmemory/index.d.ts +1 -0
- package/dist/file-provider-inmemory/index.js +2 -0
- package/dist/file-provider-s3/feature.d.ts +14 -0
- package/dist/file-provider-s3/feature.js +123 -0
- package/dist/file-provider-s3/index.d.ts +1 -0
- package/dist/file-provider-s3/index.js +2 -0
- package/dist/file-provider-s3-env/feature.d.ts +3 -0
- package/dist/file-provider-s3-env/feature.js +46 -0
- package/dist/file-provider-s3-env/index.d.ts +1 -0
- package/dist/file-provider-s3-env/index.js +2 -0
- package/dist/files/feature.d.ts +1 -0
- package/dist/files/index.d.ts +1 -0
- package/dist/files/index.js +1 -0
- package/dist/files-provider-s3/env-helper.d.ts +4 -0
- package/dist/files-provider-s3/env-helper.js +44 -0
- package/dist/files-provider-s3/index.d.ts +3 -0
- package/dist/files-provider-s3/index.js +2 -0
- package/dist/files-provider-s3/s3-provider.d.ts +20 -0
- package/dist/files-provider-s3/s3-provider.js +149 -0
- package/dist/files-tenant-data/handlers/sweep-orphaned-derivatives.job.d.ts +10 -0
- package/dist/files-tenant-data/handlers/sweep-orphaned-derivatives.job.js +121 -0
- package/dist/files-tenant-data/hooks.d.ts +3 -0
- package/dist/files-tenant-data/hooks.js +161 -0
- package/dist/files-tenant-data/index.d.ts +4 -0
- package/dist/files-tenant-data/index.js +41 -0
- package/dist/folders/aggregate-id.d.ts +9 -0
- package/dist/folders/aggregate-id.js +17 -0
- package/dist/folders/constants.d.ts +17 -0
- package/dist/folders/constants.js +32 -0
- package/dist/folders/entity.d.ts +167 -0
- package/dist/folders/entity.js +75 -0
- package/dist/folders/executor.d.ts +2 -0
- package/dist/folders/executor.js +7 -0
- package/dist/folders/feature.d.ts +45 -0
- package/dist/folders/feature.js +100 -0
- package/dist/folders/handlers/clear-folder.write.d.ts +3 -0
- package/dist/folders/handlers/clear-folder.write.js +40 -0
- package/dist/folders/handlers/delete-folder.write.d.ts +3 -0
- package/dist/folders/handlers/delete-folder.write.js +30 -0
- package/dist/folders/handlers/set-folder.write.d.ts +3 -0
- package/dist/folders/handlers/set-folder.write.js +73 -0
- package/dist/folders/index.d.ts +7 -0
- package/dist/folders/index.js +7 -0
- package/dist/folders/schemas.d.ts +12 -0
- package/dist/folders/schemas.js +13 -0
- package/dist/folders/web/client-plugin.d.ts +2 -0
- package/dist/folders/web/client-plugin.js +13 -0
- package/dist/folders/web/folder-manager.d.ts +23 -0
- package/dist/folders/web/folder-manager.js +304 -0
- package/dist/folders/web/folder-section.d.ts +5 -0
- package/dist/folders/web/folder-section.js +102 -0
- package/dist/folders/web/i18n.d.ts +2 -0
- package/dist/folders/web/i18n.js +29 -0
- package/dist/folders/web/index.d.ts +5 -0
- package/dist/folders/web/index.js +6 -0
- package/dist/folders/web/tree.d.ts +12 -0
- package/dist/folders/web/tree.js +51 -0
- package/dist/folders-user-data/hooks.d.ts +5 -0
- package/dist/folders-user-data/hooks.js +56 -0
- package/dist/folders-user-data/index.d.ts +3 -0
- package/dist/folders-user-data/index.js +24 -0
- package/dist/form-draft/constants.d.ts +15 -0
- package/dist/form-draft/constants.js +39 -0
- package/dist/form-draft/db/queries/cleanup.d.ts +15 -0
- package/dist/form-draft/db/queries/cleanup.js +35 -0
- package/dist/form-draft/db/queries/draft-count.d.ts +3 -0
- package/dist/form-draft/db/queries/draft-count.js +10 -0
- package/dist/form-draft/db/queries/owned-file-refs.d.ts +9 -0
- package/dist/form-draft/db/queries/owned-file-refs.js +37 -0
- package/dist/form-draft/entity.d.ts +43 -0
- package/dist/form-draft/entity.js +54 -0
- package/dist/form-draft/executor.d.ts +1 -0
- package/dist/form-draft/executor.js +3 -0
- package/dist/form-draft/feature.d.ts +3 -0
- package/dist/form-draft/feature.js +43 -0
- package/dist/form-draft/handlers/cleanup.job.d.ts +8 -0
- package/dist/form-draft/handlers/cleanup.job.js +134 -0
- package/dist/form-draft/handlers/discard.write.d.ts +6 -0
- package/dist/form-draft/handlers/discard.write.js +92 -0
- package/dist/form-draft/handlers/get.query.d.ts +7 -0
- package/dist/form-draft/handlers/get.query.js +21 -0
- package/dist/form-draft/handlers/list.query.d.ts +14 -0
- package/dist/form-draft/handlers/list.query.js +35 -0
- package/dist/form-draft/handlers/save.write.d.ts +5 -0
- package/dist/form-draft/handlers/save.write.js +58 -0
- package/dist/form-draft/index.d.ts +10 -0
- package/dist/form-draft/index.js +10 -0
- package/dist/form-draft/lookup.d.ts +17 -0
- package/dist/form-draft/lookup.js +27 -0
- package/dist/form-draft/release-file-refs.d.ts +5 -0
- package/dist/form-draft/release-file-refs.js +63 -0
- package/dist/form-draft/schemas.d.ts +26 -0
- package/dist/form-draft/schemas.js +45 -0
- package/dist/form-draft-user-data/hooks.d.ts +3 -0
- package/dist/form-draft-user-data/hooks.js +51 -0
- package/dist/form-draft-user-data/index.d.ts +3 -0
- package/dist/form-draft-user-data/index.js +17 -0
- package/dist/foundation-shared/config-helpers.d.ts +44 -0
- package/dist/foundation-shared/config-helpers.js +83 -0
- package/dist/foundation-shared/index.d.ts +2 -0
- package/dist/foundation-shared/index.js +4 -0
- package/dist/foundation-shared/mail-host-policy.d.ts +15 -0
- package/dist/foundation-shared/mail-host-policy.js +49 -0
- package/dist/inbound-mail-foundation/aggregate-id.d.ts +20 -0
- package/dist/inbound-mail-foundation/aggregate-id.js +35 -0
- package/dist/inbound-mail-foundation/connect-routes.d.ts +20 -0
- package/dist/inbound-mail-foundation/connect-routes.js +144 -0
- package/dist/inbound-mail-foundation/constants.d.ts +55 -0
- package/dist/inbound-mail-foundation/constants.js +69 -0
- package/dist/inbound-mail-foundation/db/queries/inbound-projections.d.ts +7 -0
- package/dist/inbound-mail-foundation/db/queries/inbound-projections.js +24 -0
- package/dist/inbound-mail-foundation/entities.d.ts +624 -0
- package/dist/inbound-mail-foundation/entities.js +207 -0
- package/dist/inbound-mail-foundation/events.d.ts +64 -0
- package/dist/inbound-mail-foundation/events.js +112 -0
- package/dist/inbound-mail-foundation/feature.d.ts +3 -0
- package/dist/inbound-mail-foundation/feature.js +204 -0
- package/dist/inbound-mail-foundation/handlers/account-state.d.ts +3 -0
- package/dist/inbound-mail-foundation/handlers/account-state.js +16 -0
- package/dist/inbound-mail-foundation/handlers/connect-account.write.d.ts +18 -0
- package/dist/inbound-mail-foundation/handlers/connect-account.write.js +92 -0
- package/dist/inbound-mail-foundation/handlers/disconnect-account.write.d.ts +7 -0
- package/dist/inbound-mail-foundation/handlers/disconnect-account.write.js +58 -0
- package/dist/inbound-mail-foundation/handlers/ingest-message.write.d.ts +21 -0
- package/dist/inbound-mail-foundation/handlers/ingest-message.write.js +286 -0
- package/dist/inbound-mail-foundation/handlers/list-accounts.query.d.ts +2 -0
- package/dist/inbound-mail-foundation/handlers/list-accounts.query.js +34 -0
- package/dist/inbound-mail-foundation/handlers/list-messages.query.d.ts +2 -0
- package/dist/inbound-mail-foundation/handlers/list-messages.query.js +49 -0
- package/dist/inbound-mail-foundation/handlers/scope-visibility.d.ts +4 -0
- package/dist/inbound-mail-foundation/handlers/scope-visibility.js +12 -0
- package/dist/inbound-mail-foundation/handlers/update-account.write.d.ts +14 -0
- package/dist/inbound-mail-foundation/handlers/update-account.write.js +66 -0
- package/dist/inbound-mail-foundation/index.d.ts +11 -0
- package/dist/inbound-mail-foundation/index.js +12 -0
- package/dist/inbound-mail-foundation/oauth-state.d.ts +22 -0
- package/dist/inbound-mail-foundation/oauth-state.js +71 -0
- package/dist/inbound-mail-foundation/projection.d.ts +481 -0
- package/dist/inbound-mail-foundation/projection.js +119 -0
- package/dist/inbound-mail-foundation/provider-factory.d.ts +7 -0
- package/dist/inbound-mail-foundation/provider-factory.js +31 -0
- package/dist/inbound-mail-foundation/retention-sweep.d.ts +25 -0
- package/dist/inbound-mail-foundation/retention-sweep.js +109 -0
- package/dist/inbound-mail-foundation/tenant-destroy-hook.d.ts +5 -0
- package/dist/inbound-mail-foundation/tenant-destroy-hook.js +55 -0
- package/dist/inbound-mail-foundation/types.d.ts +171 -0
- package/dist/inbound-mail-foundation/types.js +77 -0
- package/dist/inbound-mail-foundation/watch-supervisor.d.ts +49 -0
- package/dist/inbound-mail-foundation/watch-supervisor.js +515 -0
- package/dist/inbound-provider-imap/credential-document.d.ts +20 -0
- package/dist/inbound-provider-imap/credential-document.js +42 -0
- package/dist/inbound-provider-imap/feature.d.ts +9 -0
- package/dist/inbound-provider-imap/feature.js +229 -0
- package/dist/inbound-provider-imap/imap-client.d.ts +39 -0
- package/dist/inbound-provider-imap/imap-client.js +166 -0
- package/dist/inbound-provider-imap/index.d.ts +3 -0
- package/dist/inbound-provider-imap/index.js +4 -0
- package/dist/inbound-provider-inmemory/feature.d.ts +23 -0
- package/dist/inbound-provider-inmemory/feature.js +115 -0
- package/dist/inbound-provider-inmemory/index.d.ts +1 -0
- package/dist/inbound-provider-inmemory/index.js +2 -0
- package/dist/jobs/constants.d.ts +22 -0
- package/dist/jobs/constants.js +27 -0
- package/dist/jobs/db/queries/retention.d.ts +7 -0
- package/dist/jobs/db/queries/retention.js +29 -0
- package/dist/jobs/db/queries/stale-run-sweep.d.ts +6 -0
- package/dist/jobs/db/queries/stale-run-sweep.js +54 -0
- package/dist/jobs/events.d.ts +46 -0
- package/dist/jobs/events.js +31 -0
- package/dist/jobs/feature.d.ts +6 -0
- package/dist/jobs/feature.js +197 -0
- package/dist/jobs/handlers/catalog.query.d.ts +11 -0
- package/dist/jobs/handlers/catalog.query.js +35 -0
- package/dist/jobs/handlers/detail.query.d.ts +4 -0
- package/dist/jobs/handlers/detail.query.js +56 -0
- package/dist/jobs/handlers/list.query.d.ts +31 -0
- package/dist/jobs/handlers/list.query.js +65 -0
- package/dist/jobs/handlers/projection-rebuild.job.d.ts +7 -0
- package/dist/jobs/handlers/projection-rebuild.job.js +34 -0
- package/dist/jobs/handlers/reindex-entity.job.d.ts +6 -0
- package/dist/jobs/handlers/reindex-entity.job.js +46 -0
- package/dist/jobs/handlers/retention-cleanup.job.d.ts +3 -0
- package/dist/jobs/handlers/retention-cleanup.job.js +16 -0
- package/dist/jobs/handlers/retry.write.d.ts +8 -0
- package/dist/jobs/handlers/retry.write.js +65 -0
- package/dist/jobs/handlers/stale-run-sweep.job.d.ts +3 -0
- package/dist/jobs/handlers/stale-run-sweep.job.js +23 -0
- package/dist/jobs/handlers/tenant-failures.query.d.ts +14 -0
- package/dist/jobs/handlers/tenant-failures.query.js +70 -0
- package/dist/jobs/handlers/trigger.write.d.ts +8 -0
- package/dist/jobs/handlers/trigger.write.js +63 -0
- package/dist/jobs/i18n.d.ts +5 -0
- package/dist/jobs/i18n.js +42 -0
- package/dist/jobs/index.d.ts +7 -0
- package/dist/jobs/index.js +5 -0
- package/dist/jobs/is-manual-trigger.d.ts +2 -0
- package/dist/jobs/is-manual-trigger.js +3 -0
- package/dist/jobs/job-instant.d.ts +2 -0
- package/dist/jobs/job-instant.js +8 -0
- package/dist/jobs/job-run-logger.d.ts +10 -0
- package/dist/jobs/job-run-logger.js +305 -0
- package/dist/jobs/job-run-table.d.ts +197 -0
- package/dist/jobs/job-run-table.js +80 -0
- package/dist/jobs/tenant-job-failure-table.d.ts +3 -0
- package/dist/jobs/tenant-job-failure-table.js +29 -0
- package/dist/jobs/web/client-plugin.d.ts +6 -0
- package/dist/jobs/web/client-plugin.js +10 -0
- package/dist/jobs/web/i18n.d.ts +2 -0
- package/dist/jobs/web/i18n.js +4 -0
- package/dist/jobs/web/index.d.ts +1 -0
- package/dist/jobs/web/index.js +2 -0
- package/dist/ledger/constants.d.ts +30 -0
- package/dist/ledger/constants.js +47 -0
- package/dist/ledger/entity.d.ts +379 -0
- package/dist/ledger/entity.js +147 -0
- package/dist/ledger/executor.d.ts +3 -0
- package/dist/ledger/executor.js +8 -0
- package/dist/ledger/feature.d.ts +19 -0
- package/dist/ledger/feature.js +106 -0
- package/dist/ledger/handlers/confirm-schedule-period.write.d.ts +3 -0
- package/dist/ledger/handlers/confirm-schedule-period.write.js +100 -0
- package/dist/ledger/handlers/create-transaction.write.d.ts +3 -0
- package/dist/ledger/handlers/create-transaction.write.js +37 -0
- package/dist/ledger/handlers/reports.query.d.ts +4 -0
- package/dist/ledger/handlers/reports.query.js +57 -0
- package/dist/ledger/handlers/reverse-transaction.write.d.ts +3 -0
- package/dist/ledger/handlers/reverse-transaction.write.js +71 -0
- package/dist/ledger/index.d.ts +10 -0
- package/dist/ledger/index.js +10 -0
- package/dist/ledger/recurring.d.ts +37 -0
- package/dist/ledger/recurring.js +87 -0
- package/dist/ledger/reports.d.ts +45 -0
- package/dist/ledger/reports.js +104 -0
- package/dist/ledger/schemas.d.ts +42 -0
- package/dist/ledger/schemas.js +58 -0
- package/dist/ledger/web/index.d.ts +3 -0
- package/dist/ledger/web/index.js +11 -0
- package/dist/legal-pages/constants.d.ts +49 -0
- package/dist/legal-pages/constants.js +33 -0
- package/dist/legal-pages/feature.d.ts +37 -0
- package/dist/legal-pages/feature.js +158 -0
- package/dist/legal-pages/index.d.ts +3 -0
- package/dist/legal-pages/index.js +3 -0
- package/dist/legal-pages/markdown.d.ts +2 -0
- package/dist/legal-pages/markdown.js +6 -0
- package/dist/legal-pages/web/client-plugin.d.ts +4 -0
- package/dist/legal-pages/web/client-plugin.js +75 -0
- package/dist/legal-pages/web/index.d.ts +1 -0
- package/dist/legal-pages/web/index.js +3 -0
- package/dist/mail-foundation/feature.d.ts +71 -0
- package/dist/mail-foundation/feature.js +128 -0
- package/dist/mail-foundation/index.d.ts +1 -0
- package/dist/mail-foundation/index.js +9 -0
- package/dist/mail-transport-inmemory/feature.d.ts +14 -0
- package/dist/mail-transport-inmemory/feature.js +78 -0
- package/dist/mail-transport-inmemory/index.d.ts +1 -0
- package/dist/mail-transport-inmemory/index.js +2 -0
- package/dist/mail-transport-smtp/feature.d.ts +24 -0
- package/dist/mail-transport-smtp/feature.js +199 -0
- package/dist/mail-transport-smtp/index.d.ts +1 -0
- package/dist/mail-transport-smtp/index.js +2 -0
- package/dist/managed-pages/branding.d.ts +28 -0
- package/dist/managed-pages/branding.js +156 -0
- package/dist/managed-pages/css-gate.d.ts +2 -0
- package/dist/managed-pages/css-gate.js +21 -0
- package/dist/managed-pages/feature.d.ts +45 -0
- package/dist/managed-pages/feature.js +181 -0
- package/dist/managed-pages/handlers/branding.query.d.ts +4 -0
- package/dist/managed-pages/handlers/branding.query.js +33 -0
- package/dist/managed-pages/handlers/by-slug.query.d.ts +14 -0
- package/dist/managed-pages/handlers/by-slug.query.js +39 -0
- package/dist/managed-pages/handlers/by-tenant-published.query.d.ts +17 -0
- package/dist/managed-pages/handlers/by-tenant-published.query.js +32 -0
- package/dist/managed-pages/handlers/page-crud.d.ts +2 -0
- package/dist/managed-pages/handlers/page-crud.js +35 -0
- package/dist/managed-pages/handlers/set.write.d.ts +15 -0
- package/dist/managed-pages/handlers/set.write.js +102 -0
- package/dist/managed-pages/i18n.d.ts +5 -0
- package/dist/managed-pages/i18n.js +54 -0
- package/dist/managed-pages/index.d.ts +5 -0
- package/dist/managed-pages/index.js +18 -0
- package/dist/managed-pages/screens/branding-screen.d.ts +4 -0
- package/dist/managed-pages/screens/branding-screen.js +108 -0
- package/dist/managed-pages/screens/page-screens.d.ts +3 -0
- package/dist/managed-pages/screens/page-screens.js +81 -0
- package/dist/managed-pages/seeding.d.ts +18 -0
- package/dist/managed-pages/seeding.js +67 -0
- package/dist/managed-pages/table.d.ts +266 -0
- package/dist/managed-pages/table.js +53 -0
- package/dist/managed-pages/web/client-plugin.d.ts +7 -0
- package/dist/managed-pages/web/client-plugin.js +14 -0
- package/dist/managed-pages/web/i18n.d.ts +2 -0
- package/dist/managed-pages/web/i18n.js +13 -0
- package/dist/managed-pages/web/index.d.ts +2 -0
- package/dist/managed-pages/web/index.js +3 -0
- package/dist/notes-history/constants.d.ts +11 -0
- package/dist/notes-history/constants.js +26 -0
- package/dist/notes-history/entity.d.ts +281 -0
- package/dist/notes-history/entity.js +114 -0
- package/dist/notes-history/executor.d.ts +2 -0
- package/dist/notes-history/executor.js +4 -0
- package/dist/notes-history/feature.d.ts +42 -0
- package/dist/notes-history/feature.js +78 -0
- package/dist/notes-history/handlers/add-note.write.d.ts +3 -0
- package/dist/notes-history/handlers/add-note.write.js +76 -0
- package/dist/notes-history/i18n.d.ts +5 -0
- package/dist/notes-history/i18n.js +1 -0
- package/dist/notes-history/index.d.ts +6 -0
- package/dist/notes-history/index.js +6 -0
- package/dist/notes-history/schemas.d.ts +8 -0
- package/dist/notes-history/schemas.js +15 -0
- package/dist/notes-history/web/client-plugin.d.ts +2 -0
- package/dist/notes-history/web/client-plugin.js +13 -0
- package/dist/notes-history/web/i18n.d.ts +2 -0
- package/dist/notes-history/web/i18n.js +19 -0
- package/dist/notes-history/web/index.d.ts +3 -0
- package/dist/notes-history/web/index.js +4 -0
- package/dist/notes-history/web/notes-section.d.ts +5 -0
- package/dist/notes-history/web/notes-section.js +86 -0
- package/dist/notes-history-user-data/hooks.d.ts +5 -0
- package/dist/notes-history-user-data/hooks.js +90 -0
- package/dist/notes-history-user-data/index.d.ts +3 -0
- package/dist/notes-history-user-data/index.js +25 -0
- package/dist/page-render/branding.d.ts +15 -0
- package/dist/page-render/branding.js +69 -0
- package/dist/page-render/cached-page-response.d.ts +10 -0
- package/dist/page-render/cached-page-response.js +12 -0
- package/dist/page-render/css-sanitize.d.ts +1 -0
- package/dist/page-render/css-sanitize.js +355 -0
- package/dist/page-render/index.d.ts +6 -0
- package/dist/page-render/index.js +6 -0
- package/dist/page-render/layout.d.ts +15 -0
- package/dist/page-render/layout.js +98 -0
- package/dist/page-render/markdown.d.ts +1 -0
- package/dist/page-render/markdown.js +29 -0
- package/dist/page-render/security-headers.d.ts +1 -0
- package/dist/page-render/security-headers.js +18 -0
- package/dist/page-render/web.d.ts +5 -0
- package/dist/page-render/web.js +6 -0
- package/dist/personal-access-tokens/constants.d.ts +22 -0
- package/dist/personal-access-tokens/constants.js +34 -0
- package/dist/personal-access-tokens/expiry.d.ts +3 -0
- package/dist/personal-access-tokens/expiry.js +4 -0
- package/dist/personal-access-tokens/feature.d.ts +23 -0
- package/dist/personal-access-tokens/feature.js +126 -0
- package/dist/personal-access-tokens/handlers/available-scopes.query.d.ts +7 -0
- package/dist/personal-access-tokens/handlers/available-scopes.query.js +24 -0
- package/dist/personal-access-tokens/handlers/create.write.d.ts +20 -0
- package/dist/personal-access-tokens/handlers/create.write.js +88 -0
- package/dist/personal-access-tokens/handlers/list.query.d.ts +22 -0
- package/dist/personal-access-tokens/handlers/list.query.js +88 -0
- package/dist/personal-access-tokens/handlers/revoke.write.d.ts +6 -0
- package/dist/personal-access-tokens/handlers/revoke.write.js +52 -0
- package/dist/personal-access-tokens/hash.d.ts +6 -0
- package/dist/personal-access-tokens/hash.js +15 -0
- package/dist/personal-access-tokens/i18n.d.ts +7 -0
- package/dist/personal-access-tokens/i18n.js +48 -0
- package/dist/personal-access-tokens/index.d.ts +15 -0
- package/dist/personal-access-tokens/index.js +25 -0
- package/dist/personal-access-tokens/pat-revoked-event.d.ts +9 -0
- package/dist/personal-access-tokens/pat-revoked-event.js +18 -0
- package/dist/personal-access-tokens/resolver.d.ts +7 -0
- package/dist/personal-access-tokens/resolver.js +43 -0
- package/dist/personal-access-tokens/revoke-for-user.d.ts +2 -0
- package/dist/personal-access-tokens/revoke-for-user.js +36 -0
- package/dist/personal-access-tokens/roles.d.ts +2 -0
- package/dist/personal-access-tokens/roles.js +33 -0
- package/dist/personal-access-tokens/schema/api-token.d.ts +168 -0
- package/dist/personal-access-tokens/schema/api-token.js +85 -0
- package/dist/personal-access-tokens/scopes.d.ts +12 -0
- package/dist/personal-access-tokens/scopes.js +29 -0
- package/dist/personal-access-tokens/screens.d.ts +5 -0
- package/dist/personal-access-tokens/screens.js +111 -0
- package/dist/presets/dsgvo-self-service.d.ts +8 -0
- package/dist/presets/dsgvo-self-service.js +22 -0
- package/dist/presets/index.d.ts +2 -0
- package/dist/presets/index.js +2 -0
- package/dist/presets/security-baseline.d.ts +5 -0
- package/dist/presets/security-baseline.js +13 -0
- package/dist/rate-limiting/constants.d.ts +8 -0
- package/dist/rate-limiting/constants.js +8 -0
- package/dist/rate-limiting/feature.d.ts +3 -0
- package/dist/rate-limiting/feature.js +21 -0
- package/dist/rate-limiting/handlers/bucket-access.d.ts +8 -0
- package/dist/rate-limiting/handlers/bucket-access.js +28 -0
- package/dist/rate-limiting/handlers/status.query.d.ts +13 -0
- package/dist/rate-limiting/handlers/status.query.js +59 -0
- package/dist/rate-limiting/index.d.ts +2 -0
- package/dist/rate-limiting/index.js +2 -0
- package/dist/readiness/constants.d.ts +4 -0
- package/dist/readiness/constants.js +6 -0
- package/dist/readiness/feature.d.ts +7 -0
- package/dist/readiness/feature.js +25 -0
- package/dist/readiness/handlers/status.query.d.ts +9 -0
- package/dist/readiness/handlers/status.query.js +41 -0
- package/dist/readiness/index.d.ts +3 -0
- package/dist/readiness/index.js +2 -0
- package/dist/renderer-foundation/api.d.ts +30 -0
- package/dist/renderer-foundation/api.js +66 -0
- package/dist/renderer-foundation/constants.d.ts +4 -0
- package/dist/renderer-foundation/constants.js +12 -0
- package/dist/renderer-foundation/feature.d.ts +6 -0
- package/dist/renderer-foundation/feature.js +44 -0
- package/dist/renderer-foundation/index.d.ts +4 -0
- package/dist/renderer-foundation/index.js +4 -0
- package/dist/renderer-foundation/types.d.ts +99 -0
- package/dist/renderer-foundation/types.js +17 -0
- package/dist/renderer-simple/feature.d.ts +4 -0
- package/dist/renderer-simple/feature.js +40 -0
- package/dist/renderer-simple/index.d.ts +2 -0
- package/dist/renderer-simple/index.js +2 -0
- package/dist/renderer-simple/resolve-variables.d.ts +7 -0
- package/dist/renderer-simple/resolve-variables.js +47 -0
- package/dist/renderer-simple/simple-renderer.d.ts +2 -0
- package/dist/renderer-simple/simple-renderer.js +37 -0
- package/dist/secrets/constants.d.ts +3 -0
- package/dist/secrets/constants.js +9 -0
- package/dist/secrets/db/queries/read.d.ts +4 -0
- package/dist/secrets/db/queries/read.js +5 -0
- package/dist/secrets/feature.d.ts +39 -0
- package/dist/secrets/feature.js +144 -0
- package/dist/secrets/handlers/delete.write.d.ts +7 -0
- package/dist/secrets/handlers/delete.write.js +25 -0
- package/dist/secrets/handlers/list.query.d.ts +10 -0
- package/dist/secrets/handlers/list.query.js +28 -0
- package/dist/secrets/handlers/rotate.job.d.ts +15 -0
- package/dist/secrets/handlers/rotate.job.js +114 -0
- package/dist/secrets/handlers/set.write.d.ts +11 -0
- package/dist/secrets/handlers/set.write.js +53 -0
- package/dist/secrets/index.d.ts +6 -0
- package/dist/secrets/index.js +6 -0
- package/dist/secrets/secrets-context.d.ts +16 -0
- package/dist/secrets/secrets-context.js +198 -0
- package/dist/secrets/table.d.ts +47 -0
- package/dist/secrets/table.js +29 -0
- package/dist/seo/constants.d.ts +21 -0
- package/dist/seo/constants.js +51 -0
- package/dist/seo/feature.d.ts +49 -0
- package/dist/seo/feature.js +214 -0
- package/dist/seo/handlers/seo-config.query.d.ts +8 -0
- package/dist/seo/handlers/seo-config.query.js +37 -0
- package/dist/seo/index.d.ts +6 -0
- package/dist/seo/index.js +6 -0
- package/dist/seo/llms-txt.d.ts +15 -0
- package/dist/seo/llms-txt.js +16 -0
- package/dist/seo/robots-txt.d.ts +12 -0
- package/dist/seo/robots-txt.js +19 -0
- package/dist/seo/schema-builders.d.ts +18 -0
- package/dist/seo/schema-builders.js +39 -0
- package/dist/seo/sitemap.d.ts +15 -0
- package/dist/seo/sitemap.js +17 -0
- package/dist/sessions/constants.d.ts +25 -0
- package/dist/sessions/constants.js +50 -0
- package/dist/sessions/db/queries/cleanup.d.ts +2 -0
- package/dist/sessions/db/queries/cleanup.js +12 -0
- package/dist/sessions/feature.d.ts +10 -0
- package/dist/sessions/feature.js +177 -0
- package/dist/sessions/handlers/cleanup.job.d.ts +13 -0
- package/dist/sessions/handlers/cleanup.job.js +58 -0
- package/dist/sessions/handlers/detail.query.d.ts +12 -0
- package/dist/sessions/handlers/detail.query.js +41 -0
- package/dist/sessions/handlers/list.query.d.ts +17 -0
- package/dist/sessions/handlers/list.query.js +69 -0
- package/dist/sessions/handlers/mine.query.d.ts +9 -0
- package/dist/sessions/handlers/mine.query.js +49 -0
- package/dist/sessions/handlers/revoke-all-for-user.write.d.ts +8 -0
- package/dist/sessions/handlers/revoke-all-for-user.write.js +94 -0
- package/dist/sessions/handlers/revoke-all-others.write.d.ts +4 -0
- package/dist/sessions/handlers/revoke-all-others.write.js +52 -0
- package/dist/sessions/handlers/revoke.write.d.ts +6 -0
- package/dist/sessions/handlers/revoke.write.js +75 -0
- package/dist/sessions/i18n.d.ts +5 -0
- package/dist/sessions/i18n.js +30 -0
- package/dist/sessions/index.d.ts +8 -0
- package/dist/sessions/index.js +5 -0
- package/dist/sessions/schema/user-session.d.ts +143 -0
- package/dist/sessions/schema/user-session.js +82 -0
- package/dist/sessions/screens.d.ts +4 -0
- package/dist/sessions/screens.js +136 -0
- package/dist/sessions/session-callbacks.d.ts +18 -0
- package/dist/sessions/session-callbacks.js +197 -0
- package/dist/sessions/session-revoked-event.d.ts +11 -0
- package/dist/sessions/session-revoked-event.js +32 -0
- package/dist/sessions/testing.d.ts +12 -0
- package/dist/sessions/testing.js +36 -0
- package/dist/shared/assert-erased.d.ts +2 -0
- package/dist/shared/assert-erased.js +13 -0
- package/dist/shared/chunked-entity-migration.d.ts +18 -0
- package/dist/shared/chunked-entity-migration.js +63 -0
- package/dist/shared/classify-stored-envelope.d.ts +2 -0
- package/dist/shared/classify-stored-envelope.js +17 -0
- package/dist/shared/decrypt-stored-pii.d.ts +1 -0
- package/dist/shared/decrypt-stored-pii.js +19 -0
- package/dist/shared/encrypt-for-direct-write.d.ts +2 -0
- package/dist/shared/encrypt-for-direct-write.js +12 -0
- package/dist/shared/entities-of.d.ts +2 -0
- package/dist/shared/entities-of.js +13 -0
- package/dist/shared/grace-period.d.ts +6 -0
- package/dist/shared/grace-period.js +13 -0
- package/dist/shared/has-where-rule.d.ts +2 -0
- package/dist/shared/has-where-rule.js +10 -0
- package/dist/shared/identity-v3-hash.d.ts +2 -0
- package/dist/shared/identity-v3-hash.js +97 -0
- package/dist/shared/index.d.ts +24 -0
- package/dist/shared/index.js +23 -0
- package/dist/shared/is-tenant-db.d.ts +2 -0
- package/dist/shared/is-tenant-db.js +7 -0
- package/dist/shared/lockout-counter.d.ts +10 -0
- package/dist/shared/lockout-counter.js +83 -0
- package/dist/shared/map-with-concurrency.d.ts +1 -0
- package/dist/shared/map-with-concurrency.js +37 -0
- package/dist/shared/parent-visibility.d.ts +4 -0
- package/dist/shared/parent-visibility.js +54 -0
- package/dist/shared/password-hashing.d.ts +3 -0
- package/dist/shared/password-hashing.js +52 -0
- package/dist/shared/row-bound-grant.d.ts +32 -0
- package/dist/shared/row-bound-grant.js +74 -0
- package/dist/shared/run-in-sub-transaction.d.ts +2 -0
- package/dist/shared/run-in-sub-transaction.js +25 -0
- package/dist/shared/session-field.d.ts +3 -0
- package/dist/shared/session-field.js +6 -0
- package/dist/shared/session-locale-field.d.ts +2 -0
- package/dist/shared/session-locale-field.js +7 -0
- package/dist/shared/session-timezone-field.d.ts +2 -0
- package/dist/shared/session-timezone-field.js +4 -0
- package/dist/shared/signed-token.d.ts +20 -0
- package/dist/shared/signed-token.js +82 -0
- package/dist/shared/signup-handover.d.ts +31 -0
- package/dist/shared/signup-handover.js +34 -0
- package/dist/shared/single-use-token-store.d.ts +22 -0
- package/dist/shared/single-use-token-store.js +135 -0
- package/dist/shared/system-query.d.ts +1 -0
- package/dist/shared/system-query.js +1 -0
- package/dist/shared/token-burn-store.d.ts +4 -0
- package/dist/shared/token-burn-store.js +38 -0
- package/dist/step-dispatcher/feature.d.ts +7 -0
- package/dist/step-dispatcher/feature.js +231 -0
- package/dist/step-dispatcher/index.d.ts +3 -0
- package/dist/step-dispatcher/index.js +3 -0
- package/dist/step-dispatcher/mail-runner.d.ts +17 -0
- package/dist/step-dispatcher/mail-runner.js +21 -0
- package/dist/step-dispatcher/webhook-runner.d.ts +44 -0
- package/dist/step-dispatcher/webhook-runner.js +166 -0
- package/dist/subscription-mollie/constants.d.ts +2 -0
- package/dist/subscription-mollie/constants.js +31 -0
- package/dist/subscription-mollie/feature.d.ts +39 -0
- package/dist/subscription-mollie/feature.js +116 -0
- package/dist/subscription-mollie/index.d.ts +3 -0
- package/dist/subscription-mollie/index.js +8 -0
- package/dist/subscription-mollie/plugin-methods.d.ts +17 -0
- package/dist/subscription-mollie/plugin-methods.js +57 -0
- package/dist/subscription-mollie/verify-webhook.d.ts +40 -0
- package/dist/subscription-mollie/verify-webhook.js +194 -0
- package/dist/subscription-stripe/constants.d.ts +14 -0
- package/dist/subscription-stripe/constants.js +31 -0
- package/dist/subscription-stripe/feature.d.ts +50 -0
- package/dist/subscription-stripe/feature.js +179 -0
- package/dist/subscription-stripe/index.d.ts +2 -0
- package/dist/subscription-stripe/index.js +9 -0
- package/dist/subscription-stripe/plugin-methods.d.ts +37 -0
- package/dist/subscription-stripe/plugin-methods.js +347 -0
- package/dist/subscription-stripe/runtime.d.ts +45 -0
- package/dist/subscription-stripe/runtime.js +133 -0
- package/dist/subscription-stripe/verify-webhook.d.ts +42 -0
- package/dist/subscription-stripe/verify-webhook.js +320 -0
- package/dist/tags/aggregate-id.d.ts +8 -0
- package/dist/tags/aggregate-id.js +16 -0
- package/dist/tags/constants.d.ts +20 -0
- package/dist/tags/constants.js +50 -0
- package/dist/tags/entity.d.ts +187 -0
- package/dist/tags/entity.js +87 -0
- package/dist/tags/executor.d.ts +2 -0
- package/dist/tags/executor.js +7 -0
- package/dist/tags/feature.d.ts +47 -0
- package/dist/tags/feature.js +121 -0
- package/dist/tags/handlers/assign-tag.write.d.ts +3 -0
- package/dist/tags/handlers/assign-tag.write.js +86 -0
- package/dist/tags/handlers/create-tag.write.d.ts +3 -0
- package/dist/tags/handlers/create-tag.write.js +20 -0
- package/dist/tags/handlers/delete-tag.write.d.ts +3 -0
- package/dist/tags/handlers/delete-tag.write.js +43 -0
- package/dist/tags/handlers/remove-tag.write.d.ts +3 -0
- package/dist/tags/handlers/remove-tag.write.js +40 -0
- package/dist/tags/handlers/update-tag.write.d.ts +3 -0
- package/dist/tags/handlers/update-tag.write.js +28 -0
- package/dist/tags/i18n.d.ts +5 -0
- package/dist/tags/i18n.js +7 -0
- package/dist/tags/index.d.ts +11 -0
- package/dist/tags/index.js +11 -0
- package/dist/tags/schemas.d.ts +31 -0
- package/dist/tags/schemas.js +50 -0
- package/dist/tags/screens.d.ts +3 -0
- package/dist/tags/screens.js +58 -0
- package/dist/tags/web/client-plugin.d.ts +2 -0
- package/dist/tags/web/client-plugin.js +22 -0
- package/dist/tags/web/entity-tags.d.ts +5 -0
- package/dist/tags/web/entity-tags.js +31 -0
- package/dist/tags/web/i18n.d.ts +2 -0
- package/dist/tags/web/i18n.js +31 -0
- package/dist/tags/web/index.d.ts +9 -0
- package/dist/tags/web/index.js +10 -0
- package/dist/tags/web/tag-chip.d.ts +6 -0
- package/dist/tags/web/tag-chip.js +42 -0
- package/dist/tags/web/tag-filter.d.ts +6 -0
- package/dist/tags/web/tag-filter.js +55 -0
- package/dist/tags/web/tag-manager.d.ts +10 -0
- package/dist/tags/web/tag-manager.js +168 -0
- package/dist/tags/web/tag-picker.d.ts +8 -0
- package/dist/tags/web/tag-picker.js +28 -0
- package/dist/tags/web/tag-section.d.ts +9 -0
- package/dist/tags/web/tag-section.js +100 -0
- package/dist/tags/web/tags-cell.d.ts +3 -0
- package/dist/tags/web/tags-cell.js +39 -0
- package/dist/template-resolver/api.d.ts +79 -0
- package/dist/template-resolver/api.js +111 -0
- package/dist/template-resolver/constants.d.ts +17 -0
- package/dist/template-resolver/constants.js +38 -0
- package/dist/template-resolver/feature.d.ts +44 -0
- package/dist/template-resolver/feature.js +68 -0
- package/dist/template-resolver/handlers/by-slug.query.d.ts +14 -0
- package/dist/template-resolver/handlers/by-slug.query.js +53 -0
- package/dist/template-resolver/handlers/by-tenant.query.d.ts +21 -0
- package/dist/template-resolver/handlers/by-tenant.query.js +34 -0
- package/dist/template-resolver/handlers/collection-item.query.d.ts +15 -0
- package/dist/template-resolver/handlers/collection-item.query.js +39 -0
- package/dist/template-resolver/handlers/collection-list.query.d.ts +15 -0
- package/dist/template-resolver/handlers/collection-list.query.js +40 -0
- package/dist/template-resolver/handlers/collection-set.write.d.ts +20 -0
- package/dist/template-resolver/handlers/collection-set.write.js +94 -0
- package/dist/template-resolver/handlers/collection-shared.d.ts +34 -0
- package/dist/template-resolver/handlers/collection-shared.js +50 -0
- package/dist/template-resolver/handlers/find-by-id.query.d.ts +19 -0
- package/dist/template-resolver/handlers/find-by-id.query.js +43 -0
- package/dist/template-resolver/handlers/list.query.d.ts +26 -0
- package/dist/template-resolver/handlers/list.query.js +54 -0
- package/dist/template-resolver/handlers/set.write.d.ts +27 -0
- package/dist/template-resolver/handlers/set.write.js +110 -0
- package/dist/template-resolver/handlers/shared.d.ts +47 -0
- package/dist/template-resolver/handlers/shared.js +44 -0
- package/dist/template-resolver/handlers/toggle-status.write.d.ts +15 -0
- package/dist/template-resolver/handlers/toggle-status.write.js +30 -0
- package/dist/template-resolver/handlers/upsert-system.write.d.ts +27 -0
- package/dist/template-resolver/handlers/upsert-system.write.js +68 -0
- package/dist/template-resolver/handlers/upsert-tenant.write.d.ts +33 -0
- package/dist/template-resolver/handlers/upsert-tenant.write.js +86 -0
- package/dist/template-resolver/index.d.ts +6 -0
- package/dist/template-resolver/index.js +6 -0
- package/dist/template-resolver/qualified-names.d.ts +24 -0
- package/dist/template-resolver/qualified-names.js +35 -0
- package/dist/template-resolver/seeding.d.ts +46 -0
- package/dist/template-resolver/seeding.js +209 -0
- package/dist/template-resolver/table.d.ts +479 -0
- package/dist/template-resolver/table.js +47 -0
- package/dist/template-resolver/testing.d.ts +19 -0
- package/dist/template-resolver/testing.js +131 -0
- package/dist/template-resolver/user-content-table.d.ts +337 -0
- package/dist/template-resolver/user-content-table.js +43 -0
- package/dist/template-resolver/web/client-plugin.d.ts +15 -0
- package/dist/template-resolver/web/client-plugin.js +318 -0
- package/dist/template-resolver/web/i18n.d.ts +2 -0
- package/dist/template-resolver/web/i18n.js +21 -0
- package/dist/template-resolver/web/index.d.ts +1 -0
- package/dist/template-resolver/web/index.js +7 -0
- package/dist/template-resolver-user-data/hooks.d.ts +3 -0
- package/dist/template-resolver-user-data/hooks.js +37 -0
- package/dist/template-resolver-user-data/index.d.ts +3 -0
- package/dist/template-resolver-user-data/index.js +21 -0
- package/dist/tenant/command-schemas.d.ts +31 -0
- package/dist/tenant/command-schemas.js +35 -0
- package/dist/tenant/constants.d.ts +42 -0
- package/dist/tenant/constants.js +62 -0
- package/dist/tenant/feature.d.ts +13 -0
- package/dist/tenant/feature.js +145 -0
- package/dist/tenant/handlers/active-tenant-ids.query.d.ts +2 -0
- package/dist/tenant/handlers/active-tenant-ids.query.js +23 -0
- package/dist/tenant/handlers/add-member.write.d.ts +6 -0
- package/dist/tenant/handlers/add-member.write.js +52 -0
- package/dist/tenant/handlers/cancel-invitation.write.d.ts +7 -0
- package/dist/tenant/handlers/cancel-invitation.write.js +70 -0
- package/dist/tenant/handlers/create.write.d.ts +6 -0
- package/dist/tenant/handlers/create.write.js +33 -0
- package/dist/tenant/handlers/invitations.query.d.ts +5 -0
- package/dist/tenant/handlers/invitations.query.js +52 -0
- package/dist/tenant/handlers/is-system-admin.d.ts +2 -0
- package/dist/tenant/handlers/is-system-admin.js +4 -0
- package/dist/tenant/handlers/list.query.d.ts +7 -0
- package/dist/tenant/handlers/list.query.js +26 -0
- package/dist/tenant/handlers/me.query.d.ts +2 -0
- package/dist/tenant/handlers/me.query.js +33 -0
- package/dist/tenant/handlers/member-directory.query.d.ts +7 -0
- package/dist/tenant/handlers/member-directory.query.js +62 -0
- package/dist/tenant/handlers/members.query.d.ts +4 -0
- package/dist/tenant/handlers/members.query.js +61 -0
- package/dist/tenant/handlers/memberships.query.d.ts +4 -0
- package/dist/tenant/handlers/memberships.query.js +48 -0
- package/dist/tenant/handlers/remove-member.write.d.ts +8 -0
- package/dist/tenant/handlers/remove-member.write.js +97 -0
- package/dist/tenant/handlers/resolve-user-ids.query.d.ts +5 -0
- package/dist/tenant/handlers/resolve-user-ids.query.js +37 -0
- package/dist/tenant/handlers/team-list.query.d.ts +48 -0
- package/dist/tenant/handlers/team-list.query.js +206 -0
- package/dist/tenant/handlers/tenant-directory.query.d.ts +7 -0
- package/dist/tenant/handlers/tenant-directory.query.js +45 -0
- package/dist/tenant/handlers/toggle-enabled.write.d.ts +7 -0
- package/dist/tenant/handlers/toggle-enabled.write.js +32 -0
- package/dist/tenant/handlers/update-member-roles.write.d.ts +10 -0
- package/dist/tenant/handlers/update-member-roles.write.js +119 -0
- package/dist/tenant/handlers/update.write.d.ts +8 -0
- package/dist/tenant/handlers/update.write.js +45 -0
- package/dist/tenant/i18n.d.ts +5 -0
- package/dist/tenant/i18n.js +53 -0
- package/dist/tenant/index.d.ts +8 -0
- package/dist/tenant/index.js +7 -0
- package/dist/tenant/invitation-table.d.ts +202 -0
- package/dist/tenant/invitation-table.js +93 -0
- package/dist/tenant/invited-membership.d.ts +20 -0
- package/dist/tenant/invited-membership.js +60 -0
- package/dist/tenant/is-tenant-serving-public-content.d.ts +10 -0
- package/dist/tenant/is-tenant-serving-public-content.js +8 -0
- package/dist/tenant/last-tenant-admin.d.ts +7 -0
- package/dist/tenant/last-tenant-admin.js +27 -0
- package/dist/tenant/membership-roles.d.ts +6 -0
- package/dist/tenant/membership-roles.js +27 -0
- package/dist/tenant/membership-table.d.ts +84 -0
- package/dist/tenant/membership-table.js +30 -0
- package/dist/tenant/schema/tenant.d.ts +294 -0
- package/dist/tenant/schema/tenant.js +61 -0
- package/dist/tenant/screens.d.ts +62 -0
- package/dist/tenant/screens.js +175 -0
- package/dist/tenant/seeding.d.ts +56 -0
- package/dist/tenant/seeding.js +222 -0
- package/dist/tenant/testing.d.ts +1 -0
- package/dist/tenant/testing.js +7 -0
- package/dist/tenant/web/client-plugin.d.ts +6 -0
- package/dist/tenant/web/client-plugin.js +15 -0
- package/dist/tenant/web/index.d.ts +3 -0
- package/dist/tenant/web/index.js +4 -0
- package/dist/tenant/web/member-roles-cell.d.ts +3 -0
- package/dist/tenant/web/member-roles-cell.js +17 -0
- package/dist/tenant/web/member-status-cell.d.ts +3 -0
- package/dist/tenant/web/member-status-cell.js +19 -0
- package/dist/tenant/web/translate-or-raw.d.ts +8 -0
- package/dist/tenant/web/translate-or-raw.js +8 -0
- package/dist/tenant-handover/events.d.ts +13 -0
- package/dist/tenant-handover/events.js +27 -0
- package/dist/tenant-handover/feature.d.ts +4 -0
- package/dist/tenant-handover/feature.js +35 -0
- package/dist/tenant-handover/grant.d.ts +13 -0
- package/dist/tenant-handover/grant.js +31 -0
- package/dist/tenant-handover/handlers/claim.write.d.ts +14 -0
- package/dist/tenant-handover/handlers/claim.write.js +110 -0
- package/dist/tenant-handover/index.d.ts +3 -0
- package/dist/tenant-handover/index.js +3 -0
- package/dist/tenant-handover/move-entity-graph.d.ts +20 -0
- package/dist/tenant-handover/move-entity-graph.js +246 -0
- package/dist/tenant-handover/root-anchor.d.ts +9 -0
- package/dist/tenant-handover/root-anchor.js +25 -0
- package/dist/tenant-handover/signup-handover-provider.d.ts +4 -0
- package/dist/tenant-handover/signup-handover-provider.js +56 -0
- package/dist/tenant-handover/transfer-graph.d.ts +23 -0
- package/dist/tenant-handover/transfer-graph.js +93 -0
- package/dist/tenant-lifecycle/boot-checks.d.ts +2 -0
- package/dist/tenant-lifecycle/boot-checks.js +36 -0
- package/dist/tenant-lifecycle/constants.d.ts +26 -0
- package/dist/tenant-lifecycle/constants.js +35 -0
- package/dist/tenant-lifecycle/events.d.ts +37 -0
- package/dist/tenant-lifecycle/events.js +37 -0
- package/dist/tenant-lifecycle/feature.d.ts +4 -0
- package/dist/tenant-lifecycle/feature.js +90 -0
- package/dist/tenant-lifecycle/handlers/cancel-destruction.write.d.ts +6 -0
- package/dist/tenant-lifecycle/handlers/cancel-destruction.write.js +61 -0
- package/dist/tenant-lifecycle/handlers/request-destruction.write.d.ts +6 -0
- package/dist/tenant-lifecycle/handlers/request-destruction.write.js +72 -0
- package/dist/tenant-lifecycle/index.d.ts +3 -0
- package/dist/tenant-lifecycle/index.js +3 -0
- package/dist/tenant-lifecycle/lib/revoke-tenant-sessions.d.ts +4 -0
- package/dist/tenant-lifecycle/lib/revoke-tenant-sessions.js +8 -0
- package/dist/tenant-lifecycle/lifecycle-gate.d.ts +14 -0
- package/dist/tenant-lifecycle/lifecycle-gate.js +45 -0
- package/dist/tenant-lifecycle/run-tenant-destroy.d.ts +30 -0
- package/dist/tenant-lifecycle/run-tenant-destroy.js +223 -0
- package/dist/tenant-lifecycle/stages.d.ts +21 -0
- package/dist/tenant-lifecycle/stages.js +162 -0
- package/dist/tenant-settings/config.d.ts +14 -0
- package/dist/tenant-settings/config.js +21 -0
- package/dist/tenant-settings/constants.d.ts +5 -0
- package/dist/tenant-settings/constants.js +18 -0
- package/dist/tenant-settings/feature.d.ts +5 -0
- package/dist/tenant-settings/feature.js +43 -0
- package/dist/tenant-settings/index.d.ts +4 -0
- package/dist/tenant-settings/index.js +4 -0
- package/dist/tenant-settings/tenant-defaults.d.ts +11 -0
- package/dist/tenant-settings/tenant-defaults.js +56 -0
- package/dist/tier-engine/aggregate-id.d.ts +16 -0
- package/dist/tier-engine/aggregate-id.js +26 -0
- package/dist/tier-engine/compose-app.d.ts +81 -0
- package/dist/tier-engine/compose-app.js +73 -0
- package/dist/tier-engine/constants.d.ts +13 -0
- package/dist/tier-engine/constants.js +25 -0
- package/dist/tier-engine/entity.d.ts +49 -0
- package/dist/tier-engine/entity.js +45 -0
- package/dist/tier-engine/feature.d.ts +49 -0
- package/dist/tier-engine/feature.js +431 -0
- package/dist/tier-engine/handlers/active-tier.query.d.ts +2 -0
- package/dist/tier-engine/handlers/active-tier.query.js +20 -0
- package/dist/tier-engine/handlers/get-tenant-tier.query.d.ts +5 -0
- package/dist/tier-engine/handlers/get-tenant-tier.query.js +26 -0
- package/dist/tier-engine/handlers/set-tenant-tier.write.d.ts +22 -0
- package/dist/tier-engine/handlers/set-tenant-tier.write.js +76 -0
- package/dist/tier-engine/i18n.d.ts +7 -0
- package/dist/tier-engine/i18n.js +19 -0
- package/dist/tier-engine/index.d.ts +7 -0
- package/dist/tier-engine/index.js +15 -0
- package/dist/tier-engine/tier-resolver.d.ts +54 -0
- package/dist/tier-engine/tier-resolver.js +20 -0
- package/dist/tier-engine/trial.d.ts +5 -0
- package/dist/tier-engine/trial.js +11 -0
- package/dist/tier-engine/web/client-plugin.d.ts +7 -0
- package/dist/tier-engine/web/client-plugin.js +13 -0
- package/dist/tier-engine/web/index.d.ts +1 -0
- package/dist/tier-engine/web/index.js +6 -0
- package/dist/user/command-schemas.d.ts +24 -0
- package/dist/user/command-schemas.js +13 -0
- package/dist/user/constants.d.ts +22 -0
- package/dist/user/constants.js +28 -0
- package/dist/user/db/queries/stream-tenant-backfill.d.ts +10 -0
- package/dist/user/db/queries/stream-tenant-backfill.js +80 -0
- package/dist/user/feature.d.ts +2 -0
- package/dist/user/feature.js +48 -0
- package/dist/user/handlers/create.write.d.ts +9 -0
- package/dist/user/handlers/create.write.js +102 -0
- package/dist/user/handlers/detail.query.d.ts +15 -0
- package/dist/user/handlers/detail.query.js +21 -0
- package/dist/user/handlers/find-for-auth.query.d.ts +5 -0
- package/dist/user/handlers/find-for-auth.query.js +43 -0
- package/dist/user/handlers/list.query.d.ts +6 -0
- package/dist/user/handlers/list.query.js +95 -0
- package/dist/user/handlers/me.query.d.ts +2 -0
- package/dist/user/handlers/me.query.js +31 -0
- package/dist/user/handlers/update-roles.d.ts +21 -0
- package/dist/user/handlers/update-roles.js +114 -0
- package/dist/user/handlers/update.write.d.ts +15 -0
- package/dist/user/handlers/update.write.js +82 -0
- package/dist/user/i18n.d.ts +5 -0
- package/dist/user/i18n.js +21 -0
- package/dist/user/index.d.ts +7 -0
- package/dist/user/index.js +6 -0
- package/dist/user/principal-status.d.ts +4 -0
- package/dist/user/principal-status.js +36 -0
- package/dist/user/roles-input-schema.d.ts +3 -0
- package/dist/user/roles-input-schema.js +20 -0
- package/dist/user/schema/user.d.ts +369 -0
- package/dist/user/schema/user.js +187 -0
- package/dist/user/screens.d.ts +3 -0
- package/dist/user/screens.js +47 -0
- package/dist/user/seeding.d.ts +33 -0
- package/dist/user/seeding.js +88 -0
- package/dist/user/testing.d.ts +1 -0
- package/dist/user/testing.js +4 -0
- package/dist/user-data-rights/audit-download.d.ts +42 -0
- package/dist/user-data-rights/audit-download.js +71 -0
- package/dist/user-data-rights/boot-checks.d.ts +3 -0
- package/dist/user-data-rights/boot-checks.js +64 -0
- package/dist/user-data-rights/constants.d.ts +24 -0
- package/dist/user-data-rights/constants.js +51 -0
- package/dist/user-data-rights/db/queries/export-jobs.d.ts +12 -0
- package/dist/user-data-rights/db/queries/export-jobs.js +9 -0
- package/dist/user-data-rights/db/queries/forget-cleanup.d.ts +5 -0
- package/dist/user-data-rights/db/queries/forget-cleanup.js +18 -0
- package/dist/user-data-rights/deletion-token.d.ts +13 -0
- package/dist/user-data-rights/deletion-token.js +30 -0
- package/dist/user-data-rights/email-templates.d.ts +30 -0
- package/dist/user-data-rights/email-templates.js +121 -0
- package/dist/user-data-rights/feature.d.ts +88 -0
- package/dist/user-data-rights/feature.js +591 -0
- package/dist/user-data-rights/handlers/cancel-deletion.write.d.ts +6 -0
- package/dist/user-data-rights/handlers/cancel-deletion.write.js +65 -0
- package/dist/user-data-rights/handlers/confirm-deletion-by-token.write.d.ts +10 -0
- package/dist/user-data-rights/handlers/confirm-deletion-by-token.write.js +92 -0
- package/dist/user-data-rights/handlers/deletion-grace-period.d.ts +17 -0
- package/dist/user-data-rights/handlers/deletion-grace-period.js +69 -0
- package/dist/user-data-rights/handlers/download-attempt-list.query.d.ts +1 -0
- package/dist/user-data-rights/handlers/download-attempt-list.query.js +12 -0
- package/dist/user-data-rights/handlers/download-by-job.query.d.ts +8 -0
- package/dist/user-data-rights/handlers/download-by-job.query.js +179 -0
- package/dist/user-data-rights/handlers/download-by-token.query.d.ts +12 -0
- package/dist/user-data-rights/handlers/download-by-token.query.js +210 -0
- package/dist/user-data-rights/handlers/export-job-detail.query.d.ts +1 -0
- package/dist/user-data-rights/handlers/export-job-detail.query.js +10 -0
- package/dist/user-data-rights/handlers/export-job-list.query.d.ts +1 -0
- package/dist/user-data-rights/handlers/export-job-list.query.js +11 -0
- package/dist/user-data-rights/handlers/export-status.query.d.ts +16 -0
- package/dist/user-data-rights/handlers/export-status.query.js +49 -0
- package/dist/user-data-rights/handlers/lift-restriction.write.d.ts +7 -0
- package/dist/user-data-rights/handlers/lift-restriction.write.js +68 -0
- package/dist/user-data-rights/handlers/list-download-attempts.query.d.ts +15 -0
- package/dist/user-data-rights/handlers/list-download-attempts.query.js +47 -0
- package/dist/user-data-rights/handlers/my-audit-log.query.d.ts +20 -0
- package/dist/user-data-rights/handlers/my-audit-log.query.js +74 -0
- package/dist/user-data-rights/handlers/request-deletion-by-email.write.d.ts +22 -0
- package/dist/user-data-rights/handlers/request-deletion-by-email.write.js +82 -0
- package/dist/user-data-rights/handlers/request-deletion.write.d.ts +22 -0
- package/dist/user-data-rights/handlers/request-deletion.write.js +75 -0
- package/dist/user-data-rights/handlers/request-export.write.d.ts +6 -0
- package/dist/user-data-rights/handlers/request-export.write.js +133 -0
- package/dist/user-data-rights/handlers/restrict-account.write.d.ts +7 -0
- package/dist/user-data-rights/handlers/restrict-account.write.js +102 -0
- package/dist/user-data-rights/handlers/run-forget-cleanup.write.d.ts +13 -0
- package/dist/user-data-rights/handlers/run-forget-cleanup.write.js +81 -0
- package/dist/user-data-rights/i18n.d.ts +5 -0
- package/dist/user-data-rights/i18n.js +34 -0
- package/dist/user-data-rights/index.d.ts +11 -0
- package/dist/user-data-rights/index.js +17 -0
- package/dist/user-data-rights/lib/default-mailers.d.ts +17 -0
- package/dist/user-data-rights/lib/default-mailers.js +80 -0
- package/dist/user-data-rights/lib/deny-if-target-outside-admin-tenant.d.ts +8 -0
- package/dist/user-data-rights/lib/deny-if-target-outside-admin-tenant.js +19 -0
- package/dist/user-data-rights/lib/is-admin-actor.d.ts +3 -0
- package/dist/user-data-rights/lib/is-admin-actor.js +15 -0
- package/dist/user-data-rights/lib/mail-transport-resolver.d.ts +13 -0
- package/dist/user-data-rights/lib/mail-transport-resolver.js +19 -0
- package/dist/user-data-rights/lib/resolve-tenant-model.d.ts +8 -0
- package/dist/user-data-rights/lib/resolve-tenant-model.js +16 -0
- package/dist/user-data-rights/lib/storage-provider-resolver.d.ts +13 -0
- package/dist/user-data-rights/lib/storage-provider-resolver.js +20 -0
- package/dist/user-data-rights/lib/update-user-lifecycle.d.ts +15 -0
- package/dist/user-data-rights/lib/update-user-lifecycle.js +86 -0
- package/dist/user-data-rights/run-export-jobs.d.ts +110 -0
- package/dist/user-data-rights/run-export-jobs.js +666 -0
- package/dist/user-data-rights/run-forget-cleanup.d.ts +110 -0
- package/dist/user-data-rights/run-forget-cleanup.js +385 -0
- package/dist/user-data-rights/run-user-export.d.ts +76 -0
- package/dist/user-data-rights/run-user-export.js +232 -0
- package/dist/user-data-rights/schema/download-attempt.d.ts +314 -0
- package/dist/user-data-rights/schema/download-attempt.js +50 -0
- package/dist/user-data-rights/schema/download-token.d.ts +278 -0
- package/dist/user-data-rights/schema/download-token.js +99 -0
- package/dist/user-data-rights/schema/export-job.d.ts +354 -0
- package/dist/user-data-rights/schema/export-job.js +148 -0
- package/dist/user-data-rights/screens.d.ts +4 -0
- package/dist/user-data-rights/screens.js +67 -0
- package/dist/user-data-rights/token-helpers.d.ts +19 -0
- package/dist/user-data-rights/token-helpers.js +60 -0
- package/dist/user-data-rights/web/client-plugin.d.ts +13 -0
- package/dist/user-data-rights/web/client-plugin.js +38 -0
- package/dist/user-data-rights/web/confirm-deletion-screen.d.ts +5 -0
- package/dist/user-data-rights/web/confirm-deletion-screen.js +39 -0
- package/dist/user-data-rights/web/i18n.d.ts +2 -0
- package/dist/user-data-rights/web/i18n.js +59 -0
- package/dist/user-data-rights/web/index.d.ts +8 -0
- package/dist/user-data-rights/web/index.js +12 -0
- package/dist/user-data-rights/web/privacy-center-screen.d.ts +3 -0
- package/dist/user-data-rights/web/privacy-center-screen.js +98 -0
- package/dist/user-data-rights/web/public-deletion-gate.d.ts +13 -0
- package/dist/user-data-rights/web/public-deletion-gate.js +16 -0
- package/dist/user-data-rights/web/request-deletion-screen.d.ts +5 -0
- package/dist/user-data-rights/web/request-deletion-screen.js +49 -0
- package/dist/user-data-rights/zip-path.d.ts +30 -0
- package/dist/user-data-rights/zip-path.js +80 -0
- package/dist/user-data-rights-defaults/feature.d.ts +2 -0
- package/dist/user-data-rights-defaults/feature.js +93 -0
- package/dist/user-data-rights-defaults/hooks/api-token.userdata-hook.d.ts +3 -0
- package/dist/user-data-rights-defaults/hooks/api-token.userdata-hook.js +35 -0
- package/dist/user-data-rights-defaults/hooks/config-value.userdata-hook.d.ts +3 -0
- package/dist/user-data-rights-defaults/hooks/config-value.userdata-hook.js +46 -0
- package/dist/user-data-rights-defaults/hooks/delivery-attempt.userdata-hook.d.ts +3 -0
- package/dist/user-data-rights-defaults/hooks/delivery-attempt.userdata-hook.js +34 -0
- package/dist/user-data-rights-defaults/hooks/feature-mounted.d.ts +2 -0
- package/dist/user-data-rights-defaults/hooks/feature-mounted.js +8 -0
- package/dist/user-data-rights-defaults/hooks/file-ref.userdata-hook.d.ts +3 -0
- package/dist/user-data-rights-defaults/hooks/file-ref.userdata-hook.js +248 -0
- package/dist/user-data-rights-defaults/hooks/in-app-message.userdata-hook.d.ts +3 -0
- package/dist/user-data-rights-defaults/hooks/in-app-message.userdata-hook.js +36 -0
- package/dist/user-data-rights-defaults/hooks/job-run.userdata-hook.d.ts +3 -0
- package/dist/user-data-rights-defaults/hooks/job-run.userdata-hook.js +32 -0
- package/dist/user-data-rights-defaults/hooks/notification-preference.userdata-hook.d.ts +3 -0
- package/dist/user-data-rights-defaults/hooks/notification-preference.userdata-hook.js +49 -0
- package/dist/user-data-rights-defaults/hooks/tenant-invitation.userdata-hook.d.ts +3 -0
- package/dist/user-data-rights-defaults/hooks/tenant-invitation.userdata-hook.js +119 -0
- package/dist/user-data-rights-defaults/hooks/user-session.userdata-hook.d.ts +3 -0
- package/dist/user-data-rights-defaults/hooks/user-session.userdata-hook.js +40 -0
- package/dist/user-data-rights-defaults/hooks/user.userdata-hook.d.ts +3 -0
- package/dist/user-data-rights-defaults/hooks/user.userdata-hook.js +91 -0
- package/dist/user-data-rights-defaults/index.d.ts +11 -0
- package/dist/user-data-rights-defaults/index.js +11 -0
- package/dist/user-profile/constants.d.ts +17 -0
- package/dist/user-profile/constants.js +28 -0
- package/dist/user-profile/feature.d.ts +2 -0
- package/dist/user-profile/feature.js +130 -0
- package/dist/user-profile/handlers/change-email.write.d.ts +8 -0
- package/dist/user-profile/handlers/change-email.write.js +75 -0
- package/dist/user-profile/i18n.d.ts +2 -0
- package/dist/user-profile/i18n.js +35 -0
- package/dist/user-profile/index.d.ts +2 -0
- package/dist/user-profile/index.js +5 -0
- package/dist/user-profile/web/client-plugin.d.ts +18 -0
- package/dist/user-profile/web/client-plugin.js +23 -0
- package/dist/user-profile/web/index.d.ts +2 -0
- package/dist/user-profile/web/index.js +2 -0
- package/dist/user-profile/web/profile-screen.d.ts +4 -0
- package/dist/user-profile/web/profile-screen.js +120 -0
- package/dist/workflow-runner/aggregate-id.d.ts +11 -0
- package/dist/workflow-runner/aggregate-id.js +18 -0
- package/dist/workflow-runner/db/queries/due-runs.d.ts +7 -0
- package/dist/workflow-runner/db/queries/due-runs.js +12 -0
- package/dist/workflow-runner/event-subscriber.d.ts +2 -0
- package/dist/workflow-runner/event-subscriber.js +68 -0
- package/dist/workflow-runner/event-trigger.d.ts +2 -0
- package/dist/workflow-runner/event-trigger.js +106 -0
- package/dist/workflow-runner/feature.d.ts +3 -0
- package/dist/workflow-runner/feature.js +78 -0
- package/dist/workflow-runner/handlers/resume-run.write.d.ts +2 -0
- package/dist/workflow-runner/handlers/resume-run.write.js +242 -0
- package/dist/workflow-runner/index.d.ts +4 -0
- package/dist/workflow-runner/index.js +5 -0
- package/dist/workflow-runner/pending-projection.d.ts +2 -0
- package/dist/workflow-runner/pending-projection.js +90 -0
- package/dist/workflow-runner/runner.d.ts +42 -0
- package/dist/workflow-runner/runner.js +82 -0
- package/dist/workflow-runner/tables.d.ts +3 -0
- package/dist/workflow-runner/tables.js +78 -0
- package/dist/workflow-runner/workflow-registry.d.ts +3 -0
- package/dist/workflow-runner/workflow-registry.js +18 -0
- package/package.json +935 -127
- package/src/auth-email-password/changes.json +6 -0
- package/src/auth-mfa/changes.json +6 -0
- package/src/__tests__/access-invalidation-consumer.integration.test.ts +0 -419
- package/src/__tests__/access-invalidation-stream.integration.test.ts +0 -218
- package/src/__tests__/account-security-composition.boot.test.ts +0 -101
- package/src/__tests__/account-security-composition.integration.test.ts +0 -188
- package/src/__tests__/account-security-fixture.ts +0 -55
- package/src/__tests__/boot-seed-contract.integration.test.ts +0 -122
- package/src/__tests__/credential-scoped-sse-revoke.integration.test.ts +0 -296
- package/src/__tests__/cross-tenant-jobs-escape-hatch.test.ts +0 -45
- package/src/__tests__/env-schemas.test.ts +0 -258
- package/src/__tests__/es-ops-e2e.integration.test.ts +0 -210
- package/src/__tests__/extension-points-typed.test.ts +0 -143
- package/src/__tests__/ride-along-schema-meta.test.ts +0 -33
- package/src/__tests__/use-extension-options.test.ts +0 -278
- package/src/admin-shell/__tests__/admin-shell-security.integration.test.ts +0 -209
- package/src/admin-shell/__tests__/admin-shell.boot.test.ts +0 -213
- package/src/admin-shell/__tests__/overview-allowlist.test.ts +0 -73
- package/src/admin-shell/__tests__/overview-screens.boot.test.ts +0 -43
- package/src/admin-shell/constants.ts +0 -11
- package/src/admin-shell/feature.ts +0 -222
- package/src/admin-shell/i18n.ts +0 -28
- package/src/admin-shell/index.ts +0 -17
- package/src/admin-shell/overview-allowlist.ts +0 -37
- package/src/admin-shell/web/client-plugin.tsx +0 -16
- package/src/admin-shell/web/i18n.ts +0 -11
- package/src/admin-shell/web/index.ts +0 -2
- package/src/agent-tools/__tests__/agent-doc-lint.test.ts +0 -294
- package/src/agent-tools/__tests__/agent-manifest.test.ts +0 -252
- package/src/agent-tools/__tests__/agent-optout.test.ts +0 -271
- package/src/agent-tools/__tests__/agent-tools.integration.test.ts +0 -205
- package/src/agent-tools/__tests__/feature.test.ts +0 -63
- package/src/agent-tools/__tests__/kms-erase-gate.integration.test.ts +0 -127
- package/src/agent-tools/__tests__/tool-catalog.test.ts +0 -464
- package/src/agent-tools/__tests__/tool-dispatch.integration.test.ts +0 -313
- package/src/agent-tools/__tests__/tool-dispatch.test.ts +0 -472
- package/src/agent-tools/agent-doc-lint.ts +0 -133
- package/src/agent-tools/agent-manifest.ts +0 -365
- package/src/agent-tools/feature.ts +0 -36
- package/src/agent-tools/index.ts +0 -25
- package/src/agent-tools/tool-catalog.ts +0 -601
- package/src/agent-tools/tool-dispatch.ts +0 -378
- package/src/agent-tools/types.ts +0 -222
- package/src/audit/__tests__/audit-screens.boot.test.ts +0 -112
- package/src/audit/__tests__/audit-security.integration.test.ts +0 -201
- package/src/audit/__tests__/audit.integration.test.ts +0 -453
- package/src/audit/__tests__/constants.test.ts +0 -13
- package/src/audit/__tests__/escape-hatch-audit.integration.test.ts +0 -107
- package/src/audit/constants.ts +0 -26
- package/src/audit/escape-hatch-audit-sink.ts +0 -52
- package/src/audit/feature.ts +0 -145
- package/src/audit/handlers/details.query.ts +0 -49
- package/src/audit/handlers/list.query.ts +0 -125
- package/src/audit/i18n.ts +0 -22
- package/src/audit/index.ts +0 -3
- package/src/audit/web/client-plugin.tsx +0 -16
- package/src/audit/web/i18n.ts +0 -8
- package/src/audit/web/index.ts +0 -3
- package/src/auth-email-password/__tests__/account-lockout-no-redis.integration.test.ts +0 -150
- package/src/auth-email-password/__tests__/account-lockout.integration.test.ts +0 -309
- package/src/auth-email-password/__tests__/account-unlock.integration.test.ts +0 -283
- package/src/auth-email-password/__tests__/active-membership.integration.test.ts +0 -255
- package/src/auth-email-password/__tests__/auth-claims.integration.test.ts +0 -513
- package/src/auth-email-password/__tests__/auth-tenants-rate-limit.integration.test.ts +0 -119
- package/src/auth-email-password/__tests__/auth-user-row.test.ts +0 -36
- package/src/auth-email-password/__tests__/auth.integration.test.ts +0 -756
- package/src/auth-email-password/__tests__/confirm-token-flow.test.ts +0 -67
- package/src/auth-email-password/__tests__/email-templates.test.ts +0 -107
- package/src/auth-email-password/__tests__/email-verification.integration.test.ts +0 -439
- package/src/auth-email-password/__tests__/feature-options.test.ts +0 -33
- package/src/auth-email-password/__tests__/identity-v3-login.integration.test.ts +0 -205
- package/src/auth-email-password/__tests__/invite-accept-with-login-gates.integration.test.ts +0 -424
- package/src/auth-email-password/__tests__/invite-flow-kms.integration.test.ts +0 -379
- package/src/auth-email-password/__tests__/invite-flow.integration.test.ts +0 -1023
- package/src/auth-email-password/__tests__/login-anonymous-identity-rate-limit.integration.test.ts +0 -124
- package/src/auth-email-password/__tests__/login-gates.test.ts +0 -77
- package/src/auth-email-password/__tests__/login-mfa-setup-required.integration.test.ts +0 -217
- package/src/auth-email-password/__tests__/magic-link-mail.test.ts +0 -38
- package/src/auth-email-password/__tests__/multi-roles.integration.test.ts +0 -297
- package/src/auth-email-password/__tests__/password-policy.test.ts +0 -15
- package/src/auth-email-password/__tests__/password-reset.integration.test.ts +0 -506
- package/src/auth-email-password/__tests__/post-auth-landing.integration.test.ts +0 -321
- package/src/auth-email-password/__tests__/public-routes-rate-limit.integration.test.ts +0 -208
- package/src/auth-email-password/__tests__/query-as-member.integration.test.ts +0 -1170
- package/src/auth-email-password/__tests__/seed-admin-guarded.integration.test.ts +0 -213
- package/src/auth-email-password/__tests__/seed-admin.integration.test.ts +0 -189
- package/src/auth-email-password/__tests__/self-registration-toggle.integration.test.ts +0 -264
- package/src/auth-email-password/__tests__/session-callbacks.integration.test.ts +0 -334
- package/src/auth-email-password/__tests__/session-strict-mode.integration.test.ts +0 -94
- package/src/auth-email-password/__tests__/signup-flow.integration.test.ts +0 -616
- package/src/auth-email-password/__tests__/signup-handover.integration.test.ts +0 -434
- package/src/auth-email-password/auth-paths.ts +0 -28
- package/src/auth-email-password/auth-user-row.ts +0 -51
- package/src/auth-email-password/constants.ts +0 -146
- package/src/auth-email-password/email-templates.ts +0 -198
- package/src/auth-email-password/errors.ts +0 -112
- package/src/auth-email-password/feature.ts +0 -269
- package/src/auth-email-password/handlers/change-password.write.ts +0 -68
- package/src/auth-email-password/handlers/confirm-account-unlock.write.ts +0 -61
- package/src/auth-email-password/handlers/confirm-token-flow.ts +0 -148
- package/src/auth-email-password/handlers/invite-accept-with-login.write.ts +0 -303
- package/src/auth-email-password/handlers/invite-accept.write.ts +0 -218
- package/src/auth-email-password/handlers/invite-create.write.ts +0 -213
- package/src/auth-email-password/handlers/invite-info.query.ts +0 -89
- package/src/auth-email-password/handlers/invite-signup-complete.write.ts +0 -220
- package/src/auth-email-password/handlers/login.write.ts +0 -343
- package/src/auth-email-password/handlers/logout.write.ts +0 -16
- package/src/auth-email-password/handlers/request-account-unlock.write.ts +0 -40
- package/src/auth-email-password/handlers/request-email-verification.write.ts +0 -37
- package/src/auth-email-password/handlers/request-password-reset.write.ts +0 -39
- package/src/auth-email-password/handlers/reset-password.write.ts +0 -62
- package/src/auth-email-password/handlers/self-registration-status.query.ts +0 -26
- package/src/auth-email-password/handlers/signup-confirm.write.ts +0 -248
- package/src/auth-email-password/handlers/signup-request.write.ts +0 -229
- package/src/auth-email-password/handlers/token-request-handler.ts +0 -166
- package/src/auth-email-password/handlers/verify-email.write.ts +0 -62
- package/src/auth-email-password/i18n.ts +0 -151
- package/src/auth-email-password/index.ts +0 -47
- package/src/auth-email-password/invite-token-store.ts +0 -78
- package/src/auth-email-password/lockout-store.ts +0 -34
- package/src/auth-email-password/magic-link-mail.ts +0 -87
- package/src/auth-email-password/password-policy.ts +0 -2108
- package/src/auth-email-password/reset-token.ts +0 -30
- package/src/auth-email-password/seeding.ts +0 -362
- package/src/auth-email-password/self-registration-toggle.ts +0 -25
- package/src/auth-email-password/signed-token.ts +0 -4
- package/src/auth-email-password/signup-token-store.test.ts +0 -29
- package/src/auth-email-password/signup-token-store.ts +0 -155
- package/src/auth-email-password/testing.ts +0 -5
- package/src/auth-email-password/unlock-token.ts +0 -28
- package/src/auth-email-password/verification-token.ts +0 -29
- package/src/auth-email-password/web/__tests__/auth-client.test.ts +0 -578
- package/src/auth-email-password/web/__tests__/auth-form-logic.test.ts +0 -106
- package/src/auth-email-password/web/__tests__/auth-gate.test.tsx +0 -360
- package/src/auth-email-password/web/__tests__/auth-shell.test.tsx +0 -35
- package/src/auth-email-password/web/__tests__/client-plugin.test.tsx +0 -34
- package/src/auth-email-password/web/__tests__/confirm-account-unlock-screen.test.tsx +0 -56
- package/src/auth-email-password/web/__tests__/fetch-mock.ts +0 -14
- package/src/auth-email-password/web/__tests__/forgot-password-screen.test.tsx +0 -67
- package/src/auth-email-password/web/__tests__/invite-accept-screen.test.tsx +0 -319
- package/src/auth-email-password/web/__tests__/login-screen.test.tsx +0 -376
- package/src/auth-email-password/web/__tests__/request-account-unlock-screen.test.tsx +0 -129
- package/src/auth-email-password/web/__tests__/reset-password-screen.test.tsx +0 -99
- package/src/auth-email-password/web/__tests__/session-auth-bootstrap.test.ts +0 -22
- package/src/auth-email-password/web/__tests__/session-bootstrap-error.test.ts +0 -32
- package/src/auth-email-password/web/__tests__/session-roles.test.ts +0 -54
- package/src/auth-email-password/web/__tests__/signup-complete-screen.test.tsx +0 -307
- package/src/auth-email-password/web/__tests__/signup-screen.test.tsx +0 -93
- package/src/auth-email-password/web/__tests__/tenant-switcher.test.tsx +0 -137
- package/src/auth-email-password/web/__tests__/test-utils.tsx +0 -80
- package/src/auth-email-password/web/__tests__/use-url-token.test.tsx +0 -29
- package/src/auth-email-password/web/__tests__/user-menu.test.tsx +0 -116
- package/src/auth-email-password/web/__tests__/verify-email-screen.test.tsx +0 -50
- package/src/auth-email-password/web/auth-client.ts +0 -472
- package/src/auth-email-password/web/auth-form-logic.ts +0 -40
- package/src/auth-email-password/web/auth-form-primitives.tsx +0 -112
- package/src/auth-email-password/web/auth-gate.tsx +0 -178
- package/src/auth-email-password/web/client-plugin.ts +0 -69
- package/src/auth-email-password/web/confirm-account-unlock-screen.tsx +0 -96
- package/src/auth-email-password/web/default-topbar-actions.tsx +0 -47
- package/src/auth-email-password/web/forgot-password-screen.tsx +0 -111
- package/src/auth-email-password/web/index.ts +0 -75
- package/src/auth-email-password/web/invite-accept-screen.tsx +0 -259
- package/src/auth-email-password/web/login-screen.tsx +0 -295
- package/src/auth-email-password/web/request-account-unlock-screen.tsx +0 -112
- package/src/auth-email-password/web/reset-password-screen.tsx +0 -149
- package/src/auth-email-password/web/session-bootstrap-error.tsx +0 -56
- package/src/auth-email-password/web/session.tsx +0 -209
- package/src/auth-email-password/web/signup-complete-screen.tsx +0 -181
- package/src/auth-email-password/web/signup-screen.tsx +0 -128
- package/src/auth-email-password/web/tenant-menu-items.tsx +0 -47
- package/src/auth-email-password/web/tenant-switcher.tsx +0 -123
- package/src/auth-email-password/web/use-shell-user.ts +0 -37
- package/src/auth-email-password/web/user-menu.tsx +0 -149
- package/src/auth-email-password/web/verify-email-screen.tsx +0 -99
- package/src/auth-foundation/__tests__/feature.test.ts +0 -46
- package/src/auth-foundation/__tests__/session-store.test.ts +0 -78
- package/src/auth-foundation/__tests__/tenant-providers.test.ts +0 -161
- package/src/auth-foundation/__tests__/token-verifier.test.ts +0 -152
- package/src/auth-foundation/boot-checks.ts +0 -150
- package/src/auth-foundation/feature.ts +0 -157
- package/src/auth-foundation/index.ts +0 -37
- package/src/auth-foundation/resolve-anonymous-access.ts +0 -62
- package/src/auth-foundation/types.ts +0 -180
- package/src/auth-mfa/__tests__/base32.test.ts +0 -28
- package/src/auth-mfa/__tests__/disable-and-regenerate.integration.test.ts +0 -265
- package/src/auth-mfa/__tests__/enable-confirm-preauth.integration.test.ts +0 -341
- package/src/auth-mfa/__tests__/enable-flow.integration.test.ts +0 -394
- package/src/auth-mfa/__tests__/enable-start-preauth.integration.test.ts +0 -237
- package/src/auth-mfa/__tests__/errors-i18n-parity.test.ts +0 -37
- package/src/auth-mfa/__tests__/mfa-preauth-setup-token.test.ts +0 -113
- package/src/auth-mfa/__tests__/no-redis.integration.test.ts +0 -206
- package/src/auth-mfa/__tests__/pii-subject-encryption.integration.test.ts +0 -138
- package/src/auth-mfa/__tests__/reencrypt-job.integration.test.ts +0 -330
- package/src/auth-mfa/__tests__/screen.test.ts +0 -58
- package/src/auth-mfa/__tests__/session-auto-revoke.integration.test.ts +0 -181
- package/src/auth-mfa/__tests__/session-scoped-sse-revoke.integration.test.ts +0 -270
- package/src/auth-mfa/__tests__/token-secrets.test.ts +0 -59
- package/src/auth-mfa/__tests__/totp.test.ts +0 -131
- package/src/auth-mfa/__tests__/verify.integration.test.ts +0 -420
- package/src/auth-mfa/base32.ts +0 -51
- package/src/auth-mfa/config.ts +0 -26
- package/src/auth-mfa/constants.ts +0 -47
- package/src/auth-mfa/db/queries.ts +0 -45
- package/src/auth-mfa/errors.ts +0 -66
- package/src/auth-mfa/feature.ts +0 -250
- package/src/auth-mfa/handlers/disable.write.ts +0 -83
- package/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +0 -237
- package/src/auth-mfa/handlers/enable-confirm.write.ts +0 -123
- package/src/auth-mfa/handlers/enable-start-preauth.write.ts +0 -103
- package/src/auth-mfa/handlers/enable-start.write.ts +0 -86
- package/src/auth-mfa/handlers/reencrypt.job.ts +0 -223
- package/src/auth-mfa/handlers/regenerate-recovery.write.ts +0 -88
- package/src/auth-mfa/handlers/status.query.ts +0 -31
- package/src/auth-mfa/handlers/verify.write.ts +0 -201
- package/src/auth-mfa/hmac-token-codec.ts +0 -75
- package/src/auth-mfa/i18n.ts +0 -40
- package/src/auth-mfa/index.ts +0 -30
- package/src/auth-mfa/mfa-challenge-token.ts +0 -35
- package/src/auth-mfa/mfa-code-verifier.ts +0 -45
- package/src/auth-mfa/mfa-preauth-setup-token.ts +0 -35
- package/src/auth-mfa/mfa-setup-token.ts +0 -96
- package/src/auth-mfa/mfa-status-checker.ts +0 -95
- package/src/auth-mfa/mfa-verify-attempts.ts +0 -32
- package/src/auth-mfa/otpauth-uri.ts +0 -21
- package/src/auth-mfa/recovery-codes.ts +0 -54
- package/src/auth-mfa/schema/user-mfa.ts +0 -65
- package/src/auth-mfa/screens.ts +0 -127
- package/src/auth-mfa/testing.ts +0 -5
- package/src/auth-mfa/token-secrets.ts +0 -41
- package/src/auth-mfa/totp.ts +0 -67
- package/src/auth-mfa/verify-factor.ts +0 -58
- package/src/auth-mfa/web/__tests__/mfa-client.test.ts +0 -265
- package/src/auth-mfa/web/__tests__/mfa-setup-preauth-screen.test.tsx +0 -375
- package/src/auth-mfa/web/__tests__/mfa-verify-screen.test.tsx +0 -96
- package/src/auth-mfa/web/client-plugin.ts +0 -36
- package/src/auth-mfa/web/i18n.ts +0 -66
- package/src/auth-mfa/web/index.ts +0 -25
- package/src/auth-mfa/web/mfa-client.ts +0 -200
- package/src/auth-mfa/web/mfa-disable-dialog.tsx +0 -70
- package/src/auth-mfa/web/mfa-recovery-codes-reveal.tsx +0 -53
- package/src/auth-mfa/web/mfa-regenerate-recovery-dialog.tsx +0 -69
- package/src/auth-mfa/web/mfa-setup-preauth-screen.tsx +0 -267
- package/src/auth-mfa/web/mfa-verify-screen.tsx +0 -117
- package/src/auth-mfa/web/qrcode-browser.d.ts +0 -12
- package/src/auth-mfa-user-data/__tests__/hooks.integration.test.ts +0 -134
- package/src/auth-mfa-user-data/hooks.ts +0 -53
- package/src/auth-mfa-user-data/index.ts +0 -21
- package/src/billing-foundation/__tests__/billing-foundation.integration.test.ts +0 -1091
- package/src/billing-foundation/__tests__/billing-info-query.test.ts +0 -103
- package/src/billing-foundation/__tests__/billing-plans-admin-only.integration.test.ts +0 -158
- package/src/billing-foundation/__tests__/billing-plans.integration.test.ts +0 -1061
- package/src/billing-foundation/__tests__/checkout-core.test.ts +0 -188
- package/src/billing-foundation/__tests__/constants.test.ts +0 -72
- package/src/billing-foundation/__tests__/feature.test.ts +0 -256
- package/src/billing-foundation/__tests__/subscription-provider-contract.ts +0 -99
- package/src/billing-foundation/__tests__/subscription-tier-sync.integration.test.ts +0 -226
- package/src/billing-foundation/__tests__/subscription-tier-sync.test.ts +0 -37
- package/src/billing-foundation/__tests__/sync-subscription.integration.test.ts +0 -469
- package/src/billing-foundation/__tests__/tenant-destroy.integration.test.ts +0 -199
- package/src/billing-foundation/__tests__/webhook-handler.integration.test.ts +0 -174
- package/src/billing-foundation/aggregate-id.ts +0 -64
- package/src/billing-foundation/billing-info-query.ts +0 -95
- package/src/billing-foundation/checkout-core.ts +0 -386
- package/src/billing-foundation/constants.ts +0 -190
- package/src/billing-foundation/db/queries/payment-projection.ts +0 -19
- package/src/billing-foundation/db/queries/subscription-projection.ts +0 -15
- package/src/billing-foundation/entities.ts +0 -132
- package/src/billing-foundation/events.ts +0 -112
- package/src/billing-foundation/feature.ts +0 -286
- package/src/billing-foundation/get-subscription-for-tenant.ts +0 -57
- package/src/billing-foundation/handlers/billing-plans.query.ts +0 -32
- package/src/billing-foundation/handlers/create-checkout-session.write.ts +0 -83
- package/src/billing-foundation/handlers/create-portal-session.write.ts +0 -103
- package/src/billing-foundation/handlers/list-subscriptions.query.ts +0 -37
- package/src/billing-foundation/handlers/process-event.write.ts +0 -206
- package/src/billing-foundation/handlers/process-payment-event.write.ts +0 -118
- package/src/billing-foundation/handlers/start-plan-checkout.write.ts +0 -75
- package/src/billing-foundation/handlers/switch-plan.write.ts +0 -115
- package/src/billing-foundation/handlers/sync-subscription.write.ts +0 -164
- package/src/billing-foundation/i18n.ts +0 -75
- package/src/billing-foundation/index.ts +0 -84
- package/src/billing-foundation/plan-catalog.ts +0 -235
- package/src/billing-foundation/projection.ts +0 -227
- package/src/billing-foundation/screens.ts +0 -25
- package/src/billing-foundation/subscription-tier-sync.ts +0 -175
- package/src/billing-foundation/tenant-destroy-hook.ts +0 -81
- package/src/billing-foundation/types.ts +0 -430
- package/src/billing-foundation/validate-options.ts +0 -66
- package/src/billing-foundation/web/__tests__/billing-plans-panel.test.tsx +0 -393
- package/src/billing-foundation/web/billing-plans-panel.tsx +0 -290
- package/src/billing-foundation/web/client-plugin.tsx +0 -21
- package/src/billing-foundation/web/index.ts +0 -23
- package/src/billing-foundation/webhook-handler.ts +0 -162
- package/src/cap-counter/__tests__/cap-counter.integration.test.ts +0 -576
- package/src/cap-counter/__tests__/cap-list.boot.test.ts +0 -31
- package/src/cap-counter/__tests__/cap-list.security.integration.test.ts +0 -115
- package/src/cap-counter/__tests__/enforce-cap.test.ts +0 -435
- package/src/cap-counter/__tests__/enforce-stock-cap.test.ts +0 -37
- package/src/cap-counter/__tests__/entity-ddl.test.ts +0 -15
- package/src/cap-counter/__tests__/stock-cap-guard.integration.test.ts +0 -301
- package/src/cap-counter/__tests__/with-cap-enforcement.integration.test.ts +0 -514
- package/src/cap-counter/aggregate-id.ts +0 -50
- package/src/cap-counter/book-cap-usage.ts +0 -188
- package/src/cap-counter/constants.ts +0 -34
- package/src/cap-counter/enforce-cap.ts +0 -406
- package/src/cap-counter/entity.ts +0 -57
- package/src/cap-counter/feature.ts +0 -135
- package/src/cap-counter/handlers/get-counter.query.ts +0 -37
- package/src/cap-counter/handlers/increment-rolling.write.ts +0 -80
- package/src/cap-counter/handlers/increment.write.ts +0 -51
- package/src/cap-counter/handlers/mark-soft-warned.write.ts +0 -30
- package/src/cap-counter/i18n.ts +0 -12
- package/src/cap-counter/index.ts +0 -50
- package/src/cap-counter/stock-cap-guard.ts +0 -80
- package/src/cap-counter/with-cap-enforcement.ts +0 -179
- package/src/cap-overview/__tests__/cap-limit-from-config.integration.test.ts +0 -141
- package/src/cap-overview/__tests__/cap-overview-security.integration.test.ts +0 -254
- package/src/cap-overview/__tests__/cap-overview.boot.test.ts +0 -145
- package/src/cap-overview/__tests__/caps-usage-escape-hatch.integration.test.ts +0 -109
- package/src/cap-overview/__tests__/usage-math.test.ts +0 -72
- package/src/cap-overview/access.ts +0 -9
- package/src/cap-overview/constants.ts +0 -26
- package/src/cap-overview/feature.ts +0 -77
- package/src/cap-overview/handlers/caps-usage.query.ts +0 -108
- package/src/cap-overview/handlers/tenant-caps-list.query.ts +0 -257
- package/src/cap-overview/handlers/tenant-options.query.ts +0 -35
- package/src/cap-overview/i18n.ts +0 -26
- package/src/cap-overview/index.ts +0 -21
- package/src/cap-overview/screens.ts +0 -108
- package/src/cap-overview/types.ts +0 -66
- package/src/cap-overview/usage-math.ts +0 -34
- package/src/cap-overview/web/__tests__/cap-cards-panel.test.tsx +0 -297
- package/src/cap-overview/web/__tests__/cap-usage-bar.test.tsx +0 -112
- package/src/cap-overview/web/cap-cards-panel.tsx +0 -113
- package/src/cap-overview/web/cap-usage-bar.tsx +0 -56
- package/src/cap-overview/web/cap-usage-cell.tsx +0 -21
- package/src/cap-overview/web/client-plugin.tsx +0 -27
- package/src/cap-overview/web/index.ts +0 -10
- package/src/channel-email/__tests__/email-channel.test.ts +0 -194
- package/src/channel-email/__tests__/pii-guard.test.ts +0 -90
- package/src/channel-email/__tests__/smtp-transport-from-env.test.ts +0 -35
- package/src/channel-email/__tests__/smtp-transport-pinning.test.ts +0 -42
- package/src/channel-email/email-channel.ts +0 -114
- package/src/channel-email/feature.ts +0 -26
- package/src/channel-email/index.ts +0 -10
- package/src/channel-email/pii-guard.ts +0 -55
- package/src/channel-email/smtp-transport.ts +0 -111
- package/src/channel-email/types.ts +0 -43
- package/src/channel-in-app/__tests__/store-table.test.ts +0 -25
- package/src/channel-in-app/constants.ts +0 -11
- package/src/channel-in-app/feature.ts +0 -45
- package/src/channel-in-app/handlers/inbox.query.ts +0 -30
- package/src/channel-in-app/handlers/mark-all-read.write.ts +0 -27
- package/src/channel-in-app/handlers/mark-read.write.ts +0 -34
- package/src/channel-in-app/handlers/unread-count.query.ts +0 -29
- package/src/channel-in-app/in-app-channel.ts +0 -41
- package/src/channel-in-app/index.ts +0 -4
- package/src/channel-in-app/tables.ts +0 -32
- package/src/channel-push/feature.ts +0 -25
- package/src/channel-push/index.ts +0 -3
- package/src/channel-push/push-channel.ts +0 -34
- package/src/channel-push/types.ts +0 -22
- package/src/compliance-profiles/README.md +0 -88
- package/src/compliance-profiles/__tests__/compliance-profiles.integration.test.ts +0 -392
- package/src/compliance-profiles/__tests__/parse-override.test.ts +0 -53
- package/src/compliance-profiles/__tests__/profile-picker.boot.test.ts +0 -47
- package/src/compliance-profiles/__tests__/profile-picker.security.integration.test.ts +0 -141
- package/src/compliance-profiles/__tests__/seeding.integration.test.ts +0 -121
- package/src/compliance-profiles/_internal/parse-override.ts +0 -20
- package/src/compliance-profiles/constants.ts +0 -20
- package/src/compliance-profiles/feature.ts +0 -114
- package/src/compliance-profiles/handlers/for-tenant.query.ts +0 -50
- package/src/compliance-profiles/handlers/list-profiles.query.ts +0 -52
- package/src/compliance-profiles/handlers/needs-profile.query.ts +0 -75
- package/src/compliance-profiles/handlers/set-profile.write.ts +0 -142
- package/src/compliance-profiles/handlers/sub-processors.query.ts +0 -46
- package/src/compliance-profiles/i18n.ts +0 -31
- package/src/compliance-profiles/index.ts +0 -13
- package/src/compliance-profiles/resolve-for-tenant.ts +0 -57
- package/src/compliance-profiles/schema/profile-selection.ts +0 -53
- package/src/compliance-profiles/seeding.ts +0 -101
- package/src/compliance-profiles/web/client-plugin.tsx +0 -25
- package/src/compliance-profiles/web/compliance-profile-catalog.tsx +0 -55
- package/src/compliance-profiles/web/i18n.ts +0 -9
- package/src/compliance-profiles/web/index.ts +0 -6
- package/src/compliance-profiles-ops/__tests__/ops.boot.test.ts +0 -42
- package/src/compliance-profiles-ops/__tests__/ops.integration.test.ts +0 -76
- package/src/compliance-profiles-ops/handlers/tenants-missing-profile.query.ts +0 -56
- package/src/compliance-profiles-ops/index.ts +0 -34
- package/src/config/__tests__/app-override-visibility.integration.test.ts +0 -149
- package/src/config/__tests__/app-overrides.test.ts +0 -129
- package/src/config/__tests__/backing-secrets.integration.test.ts +0 -245
- package/src/config/__tests__/cascade.integration.test.ts +0 -564
- package/src/config/__tests__/config.integration.test.ts +0 -1737
- package/src/config/__tests__/deserialize-value.test.ts +0 -64
- package/src/config/__tests__/env-overrides.test.ts +0 -155
- package/src/config/__tests__/inherited-redaction.integration.test.ts +0 -210
- package/src/config/__tests__/pii-encrypted.integration.test.ts +0 -179
- package/src/config/__tests__/read-redaction.test.ts +0 -112
- package/src/config/__tests__/reencrypt-job-concurrent-write-race.integration.test.ts +0 -250
- package/src/config/__tests__/reencrypt-job-kek-rotation.integration.test.ts +0 -257
- package/src/config/__tests__/reencrypt-job-tenant-checks.integration.test.ts +0 -196
- package/src/config/__tests__/require-system-db.test.ts +0 -46
- package/src/config/__tests__/selected-extensions-query-name.test.ts +0 -18
- package/src/config/__tests__/selected-extensions.integration.test.ts +0 -247
- package/src/config/__tests__/settings-hub-feature-name.test.ts +0 -14
- package/src/config/__tests__/tz-resolution.integration.test.ts +0 -106
- package/src/config/__tests__/write-helpers.test.ts +0 -175
- package/src/config/constants.ts +0 -30
- package/src/config/db/queries/__tests__/resolver.test.ts +0 -77
- package/src/config/db/queries/resolver.ts +0 -49
- package/src/config/feature.ts +0 -169
- package/src/config/handlers/__tests__/prepare-config-write.test.ts +0 -330
- package/src/config/handlers/cascade.query.ts +0 -94
- package/src/config/handlers/readiness.query.ts +0 -164
- package/src/config/handlers/reencrypt.job.ts +0 -274
- package/src/config/handlers/reset.write.ts +0 -76
- package/src/config/handlers/schema.query.ts +0 -36
- package/src/config/handlers/selected-extensions.query.ts +0 -71
- package/src/config/handlers/set.write.ts +0 -204
- package/src/config/handlers/values.query.ts +0 -92
- package/src/config/i18n.ts +0 -4
- package/src/config/index.ts +0 -38
- package/src/config/read-redaction.ts +0 -64
- package/src/config/resolver.ts +0 -687
- package/src/config/table.ts +0 -40
- package/src/config/web/client-plugin.ts +0 -24
- package/src/config/web/i18n.ts +0 -36
- package/src/config/web/index.ts +0 -3
- package/src/config/write-helpers.ts +0 -365
- package/src/crypto-shredding/__tests__/forget-subject-record.integration.test.ts +0 -428
- package/src/crypto-shredding/__tests__/forget-subject.integration.test.ts +0 -767
- package/src/crypto-shredding/__tests__/subject-id-schema.test.ts +0 -42
- package/src/crypto-shredding/constants.ts +0 -11
- package/src/crypto-shredding/feature.ts +0 -29
- package/src/crypto-shredding/handlers/forget-subject.write.ts +0 -421
- package/src/crypto-shredding/index.ts +0 -13
- package/src/custom-fields/__tests__/audit-integration.integration.test.ts +0 -312
- package/src/custom-fields/__tests__/cross-tenant-field-delete.integration.test.ts +0 -175
- package/src/custom-fields/__tests__/cross-tenant-set-write.integration.test.ts +0 -176
- package/src/custom-fields/__tests__/custom-fields.integration.test.ts +0 -958
- package/src/custom-fields/__tests__/drift.test.ts +0 -43
- package/src/custom-fields/__tests__/feature.test.ts +0 -259
- package/src/custom-fields/__tests__/field-access.integration.test.ts +0 -350
- package/src/custom-fields/__tests__/field-definition-role-config.integration.test.ts +0 -137
- package/src/custom-fields/__tests__/field-definition-row.test.ts +0 -62
- package/src/custom-fields/__tests__/field-write-access.test.ts +0 -34
- package/src/custom-fields/__tests__/parse-serialized-field.test.ts +0 -53
- package/src/custom-fields/__tests__/quota.integration.test.ts +0 -160
- package/src/custom-fields/__tests__/retention.integration.test.ts +0 -378
- package/src/custom-fields/__tests__/user-data-rights.integration.test.ts +0 -391
- package/src/custom-fields/__tests__/value-schema.test.ts +0 -54
- package/src/custom-fields/__tests__/wire-for-entity.test.ts +0 -152
- package/src/custom-fields/aggregate-id.ts +0 -34
- package/src/custom-fields/constants.ts +0 -82
- package/src/custom-fields/db/queries/__tests__/unsafe-read-retrying.integration.test.ts +0 -94
- package/src/custom-fields/db/queries/field-access.ts +0 -17
- package/src/custom-fields/db/queries/projection.ts +0 -84
- package/src/custom-fields/db/queries/quota.ts +0 -20
- package/src/custom-fields/db/queries/retention.ts +0 -43
- package/src/custom-fields/db/queries/user-data-rights.ts +0 -39
- package/src/custom-fields/entity.ts +0 -112
- package/src/custom-fields/events.ts +0 -25
- package/src/custom-fields/executor.ts +0 -10
- package/src/custom-fields/feature.ts +0 -285
- package/src/custom-fields/handlers/clear-custom-field.write.ts +0 -81
- package/src/custom-fields/handlers/define-system-field.write.ts +0 -45
- package/src/custom-fields/handlers/define-tenant-field.write.ts +0 -107
- package/src/custom-fields/handlers/delete-system-field.write.ts +0 -49
- package/src/custom-fields/handlers/delete-tenant-field.write.ts +0 -74
- package/src/custom-fields/handlers/set-custom-field.write.ts +0 -123
- package/src/custom-fields/handlers/update-tenant-field.write.ts +0 -98
- package/src/custom-fields/index.ts +0 -40
- package/src/custom-fields/lib/define-or-resurrect.ts +0 -52
- package/src/custom-fields/lib/field-access.ts +0 -73
- package/src/custom-fields/lib/field-definition-row.ts +0 -33
- package/src/custom-fields/lib/parse-serialized-field.ts +0 -64
- package/src/custom-fields/lib/quota.ts +0 -5
- package/src/custom-fields/lib/value-schema.ts +0 -91
- package/src/custom-fields/run-retention.ts +0 -201
- package/src/custom-fields/schemas.ts +0 -98
- package/src/custom-fields/web/__tests__/custom-fields-form-section.test.tsx +0 -417
- package/src/custom-fields/web/client-plugin.tsx +0 -27
- package/src/custom-fields/web/custom-fields-form-section.tsx +0 -247
- package/src/custom-fields/web/i18n.ts +0 -22
- package/src/custom-fields/web/index.ts +0 -8
- package/src/custom-fields/wire-for-entity.ts +0 -226
- package/src/custom-fields/wire-user-data-rights.ts +0 -79
- package/src/data-retention/__tests__/cleanup-cron-registration.test.ts +0 -23
- package/src/data-retention/__tests__/data-retention.integration.test.ts +0 -49
- package/src/data-retention/__tests__/keep-for.test.ts +0 -77
- package/src/data-retention/__tests__/override-schema.test.ts +0 -96
- package/src/data-retention/__tests__/parse-override.test.ts +0 -57
- package/src/data-retention/__tests__/policy-for.integration.test.ts +0 -172
- package/src/data-retention/__tests__/resolve-tenant-preset.test.ts +0 -57
- package/src/data-retention/__tests__/resolver.test.ts +0 -203
- package/src/data-retention/__tests__/retention-cleanup-files.integration.test.ts +0 -456
- package/src/data-retention/__tests__/retention-cleanup-kms.integration.test.ts +0 -160
- package/src/data-retention/__tests__/retention-cleanup.integration.test.ts +0 -427
- package/src/data-retention/_internal/parse-override.ts +0 -34
- package/src/data-retention/feature.ts +0 -123
- package/src/data-retention/handlers/policy-for.query.ts +0 -46
- package/src/data-retention/index.ts +0 -20
- package/src/data-retention/keep-for.ts +0 -75
- package/src/data-retention/override-schema.ts +0 -37
- package/src/data-retention/presets.ts +0 -72
- package/src/data-retention/resolve-for-tenant.ts +0 -85
- package/src/data-retention/resolve-tenant-preset.ts +0 -54
- package/src/data-retention/resolver.ts +0 -107
- package/src/data-retention/run-retention-cleanup.ts +0 -746
- package/src/data-retention/schema/tenant-retention-override.ts +0 -50
- package/src/delivery/__tests__/delivery-events.integration.test.ts +0 -153
- package/src/delivery/__tests__/delivery-log-query.integration.test.ts +0 -164
- package/src/delivery/__tests__/delivery-pii-kms.integration.test.ts +0 -253
- package/src/delivery/__tests__/delivery-screens.boot.test.ts +0 -68
- package/src/delivery/__tests__/delivery-security.integration.test.ts +0 -384
- package/src/delivery/__tests__/delivery.integration.test.ts +0 -2503
- package/src/delivery/address-opt-out.ts +0 -204
- package/src/delivery/attempt-log.ts +0 -66
- package/src/delivery/channel-context.ts +0 -17
- package/src/delivery/constants.ts +0 -36
- package/src/delivery/db/queries/address-opt-outs.ts +0 -23
- package/src/delivery/db/queries/preferences.ts +0 -32
- package/src/delivery/delivery-service.ts +0 -631
- package/src/delivery/events.ts +0 -24
- package/src/delivery/feature.ts +0 -206
- package/src/delivery/handlers/log.query.ts +0 -155
- package/src/delivery/handlers/preferences.query.ts +0 -42
- package/src/delivery/handlers/resubscribe-address.write.ts +0 -42
- package/src/delivery/handlers/resubscribe-user.write.ts +0 -41
- package/src/delivery/handlers/set-preference.write.ts +0 -47
- package/src/delivery/handlers/unsubscribe-address.write.ts +0 -40
- package/src/delivery/handlers/unsubscribe-user.write.ts +0 -43
- package/src/delivery/i18n.ts +0 -11
- package/src/delivery/index.ts +0 -52
- package/src/delivery/jobs.ts +0 -164
- package/src/delivery/public-names.ts +0 -60
- package/src/delivery/tables.ts +0 -147
- package/src/delivery/testing.ts +0 -53
- package/src/delivery/types.ts +0 -118
- package/src/delivery/unsubscribe.ts +0 -436
- package/src/delivery/upsert-preference.ts +0 -154
- package/src/delivery/web/client-plugin.tsx +0 -19
- package/src/delivery/web/delivery-status-cell.tsx +0 -26
- package/src/delivery/web/index.ts +0 -3
- package/src/derivatives-sharp/__tests__/derivatives-sharp.integration.test.ts +0 -124
- package/src/derivatives-sharp/__tests__/render.test.ts +0 -546
- package/src/derivatives-sharp/feature.ts +0 -22
- package/src/derivatives-sharp/index.ts +0 -2
- package/src/derivatives-sharp/render.ts +0 -411
- package/src/document-ingest-foundation/__tests__/feature.integration.test.ts +0 -850
- package/src/document-ingest-foundation/__tests__/feature.test.ts +0 -140
- package/src/document-ingest-foundation/__tests__/pages-crypto-shredding.integration.test.ts +0 -111
- package/src/document-ingest-foundation/__tests__/pages.test.ts +0 -37
- package/src/document-ingest-foundation/__tests__/providers.test.ts +0 -204
- package/src/document-ingest-foundation/__tests__/tenant-destroy.integration.test.ts +0 -166
- package/src/document-ingest-foundation/boot-checks.ts +0 -58
- package/src/document-ingest-foundation/entity.ts +0 -59
- package/src/document-ingest-foundation/events.ts +0 -43
- package/src/document-ingest-foundation/executor.ts +0 -12
- package/src/document-ingest-foundation/feature.ts +0 -221
- package/src/document-ingest-foundation/file-ref-liveness.ts +0 -10
- package/src/document-ingest-foundation/forget-extract-with-file-ref.ts +0 -84
- package/src/document-ingest-foundation/index.ts +0 -34
- package/src/document-ingest-foundation/pages.ts +0 -34
- package/src/document-ingest-foundation/providers.ts +0 -78
- package/src/document-ingest-foundation/tenant-destroy-hook.ts +0 -34
- package/src/document-ingest-foundation/write-document-extract.ts +0 -48
- package/src/feature-toggles/__tests__/acknowledge-cross-tenant.test.ts +0 -23
- package/src/feature-toggles/__tests__/compose-tier-resolver.test.ts +0 -304
- package/src/feature-toggles/__tests__/feature-toggles.integration.test.ts +0 -685
- package/src/feature-toggles/__tests__/registered-system-tenant.test.ts +0 -91
- package/src/feature-toggles/__tests__/toggle-admin.boot.test.ts +0 -39
- package/src/feature-toggles/__tests__/toggle-admin.security.integration.test.ts +0 -70
- package/src/feature-toggles/compose-tier-resolver.ts +0 -134
- package/src/feature-toggles/constants.ts +0 -40
- package/src/feature-toggles/events.ts +0 -18
- package/src/feature-toggles/feature.ts +0 -170
- package/src/feature-toggles/global-feature-state-table.ts +0 -51
- package/src/feature-toggles/handlers/list.query.ts +0 -45
- package/src/feature-toggles/handlers/registered.query.ts +0 -87
- package/src/feature-toggles/handlers/set.write.ts +0 -194
- package/src/feature-toggles/i18n.ts +0 -11
- package/src/feature-toggles/index.ts +0 -20
- package/src/feature-toggles/toggle-runtime.ts +0 -122
- package/src/feature-toggles/toggle-sync-signal.ts +0 -57
- package/src/feature-toggles/web/client-plugin.tsx +0 -18
- package/src/feature-toggles/web/i18n.ts +0 -17
- package/src/feature-toggles/web/index.ts +0 -5
- package/src/file-derivatives/__tests__/public-variant-cross-tenant.integration.test.ts +0 -265
- package/src/file-derivatives/__tests__/public-variant-predicate-args.integration.test.ts +0 -142
- package/src/file-derivatives/__tests__/public-variant-query-gating.integration.test.ts +0 -45
- package/src/file-derivatives/__tests__/public-variant-query-validation.integration.test.ts +0 -64
- package/src/file-derivatives/__tests__/public-variant-route.integration.test.ts +0 -399
- package/src/file-derivatives/feature.ts +0 -236
- package/src/file-derivatives/handlers/public-variant-by-file-ref.query.ts +0 -57
- package/src/file-derivatives/handlers/public-variant.query.ts +0 -156
- package/src/file-derivatives/index.ts +0 -11
- package/src/file-derivatives/presets.ts +0 -10
- package/src/file-foundation/__tests__/feature.test.ts +0 -35
- package/src/file-foundation/__tests__/file-foundation.integration.test.ts +0 -418
- package/src/file-foundation/feature.ts +0 -72
- package/src/file-foundation/index.ts +0 -9
- package/src/file-provider-inmemory/__tests__/feature.test.ts +0 -87
- package/src/file-provider-inmemory/feature.ts +0 -84
- package/src/file-provider-inmemory/index.ts +0 -3
- package/src/file-provider-s3/__tests__/feature.test.ts +0 -79
- package/src/file-provider-s3/feature.ts +0 -176
- package/src/file-provider-s3/index.ts +0 -3
- package/src/file-provider-s3-env/feature.ts +0 -58
- package/src/file-provider-s3-env/index.ts +0 -3
- package/src/files/README.md +0 -50
- package/src/files/__tests__/files.integration.test.ts +0 -148
- package/src/files/index.ts +0 -1
- package/src/files-provider-s3/__tests__/env-helper.test.ts +0 -161
- package/src/files-provider-s3/__tests__/s3-provider.integration.test.ts +0 -228
- package/src/files-provider-s3/__tests__/s3-provider.test.ts +0 -152
- package/src/files-provider-s3/env-helper.ts +0 -49
- package/src/files-provider-s3/index.ts +0 -3
- package/src/files-provider-s3/s3-provider.ts +0 -196
- package/src/files-tenant-data/__tests__/hooks.integration.test.ts +0 -364
- package/src/files-tenant-data/__tests__/sweep-orphaned-derivatives.job.integration.test.ts +0 -281
- package/src/files-tenant-data/handlers/sweep-orphaned-derivatives.job.ts +0 -168
- package/src/files-tenant-data/hooks.ts +0 -192
- package/src/files-tenant-data/index.ts +0 -67
- package/src/folders/__tests__/drift.test.ts +0 -43
- package/src/folders/__tests__/feature.test.ts +0 -177
- package/src/folders/__tests__/folders-parent-visibility.integration.test.ts +0 -251
- package/src/folders/__tests__/folders-read-gate.integration.test.ts +0 -182
- package/src/folders/__tests__/folders.integration.test.ts +0 -444
- package/src/folders/aggregate-id.ts +0 -23
- package/src/folders/constants.ts +0 -40
- package/src/folders/entity.ts +0 -87
- package/src/folders/executor.ts +0 -11
- package/src/folders/feature.ts +0 -192
- package/src/folders/handlers/clear-folder.write.ts +0 -61
- package/src/folders/handlers/delete-folder.write.ts +0 -43
- package/src/folders/handlers/set-folder.write.ts +0 -108
- package/src/folders/index.ts +0 -23
- package/src/folders/schemas.ts +0 -18
- package/src/folders/web/__tests__/folder-manager.test.tsx +0 -334
- package/src/folders/web/__tests__/folder-section.test.tsx +0 -181
- package/src/folders/web/__tests__/tree.test.ts +0 -66
- package/src/folders/web/client-plugin.tsx +0 -16
- package/src/folders/web/folder-manager.tsx +0 -562
- package/src/folders/web/folder-section.tsx +0 -198
- package/src/folders/web/i18n.ts +0 -34
- package/src/folders/web/index.ts +0 -6
- package/src/folders/web/tree.ts +0 -65
- package/src/folders-user-data/__tests__/hooks.integration.test.ts +0 -100
- package/src/folders-user-data/hooks.ts +0 -76
- package/src/folders-user-data/index.ts +0 -33
- package/src/form-draft/__tests__/cleanup.integration.test.ts +0 -373
- package/src/form-draft/__tests__/discard-file-refs.integration.test.ts +0 -235
- package/src/form-draft/__tests__/feature-optional-config.integration.test.ts +0 -88
- package/src/form-draft/__tests__/form-draft.integration.test.ts +0 -255
- package/src/form-draft/__tests__/limits.integration.test.ts +0 -110
- package/src/form-draft/constants.ts +0 -50
- package/src/form-draft/db/queries/__tests__/unsafe-read-retrying.integration.test.ts +0 -90
- package/src/form-draft/db/queries/cleanup.ts +0 -72
- package/src/form-draft/db/queries/draft-count.ts +0 -21
- package/src/form-draft/db/queries/owned-file-refs.ts +0 -74
- package/src/form-draft/entity.ts +0 -59
- package/src/form-draft/executor.ts +0 -7
- package/src/form-draft/feature.ts +0 -57
- package/src/form-draft/handlers/__tests__/cleanup.job.test.ts +0 -56
- package/src/form-draft/handlers/__tests__/list.query.test.ts +0 -26
- package/src/form-draft/handlers/cleanup.job.ts +0 -200
- package/src/form-draft/handlers/discard.write.ts +0 -114
- package/src/form-draft/handlers/get.query.ts +0 -30
- package/src/form-draft/handlers/list.query.ts +0 -54
- package/src/form-draft/handlers/save.write.ts +0 -85
- package/src/form-draft/index.ts +0 -28
- package/src/form-draft/lookup.ts +0 -62
- package/src/form-draft/release-file-refs.ts +0 -69
- package/src/form-draft/schemas.ts +0 -61
- package/src/form-draft-user-data/__tests__/hooks-delete-failure.integration.test.ts +0 -64
- package/src/form-draft-user-data/__tests__/hooks.integration.test.ts +0 -155
- package/src/form-draft-user-data/hooks.ts +0 -57
- package/src/form-draft-user-data/index.ts +0 -21
- package/src/foundation-shared/__tests__/config-helpers.test.ts +0 -89
- package/src/foundation-shared/__tests__/mail-host-policy.test.ts +0 -68
- package/src/foundation-shared/config-helpers.ts +0 -97
- package/src/foundation-shared/index.ts +0 -13
- package/src/foundation-shared/mail-host-policy.ts +0 -70
- package/src/inbound-mail-foundation/__tests__/account-state.test.ts +0 -30
- package/src/inbound-mail-foundation/__tests__/connect-routes.integration.test.ts +0 -273
- package/src/inbound-mail-foundation/__tests__/feature.test.ts +0 -169
- package/src/inbound-mail-foundation/__tests__/inbound-mail-foundation.integration.test.ts +0 -646
- package/src/inbound-mail-foundation/__tests__/inbound-mail-provider-contract.ts +0 -111
- package/src/inbound-mail-foundation/__tests__/retention.integration.test.ts +0 -235
- package/src/inbound-mail-foundation/__tests__/tenant-destroy.integration.test.ts +0 -173
- package/src/inbound-mail-foundation/__tests__/watch-supervisor.integration.test.ts +0 -632
- package/src/inbound-mail-foundation/aggregate-id.ts +0 -40
- package/src/inbound-mail-foundation/connect-routes.ts +0 -251
- package/src/inbound-mail-foundation/constants.ts +0 -80
- package/src/inbound-mail-foundation/db/queries/inbound-projections.ts +0 -38
- package/src/inbound-mail-foundation/entities.ts +0 -222
- package/src/inbound-mail-foundation/events.ts +0 -147
- package/src/inbound-mail-foundation/feature.ts +0 -265
- package/src/inbound-mail-foundation/handlers/account-state.ts +0 -23
- package/src/inbound-mail-foundation/handlers/connect-account.write.ts +0 -118
- package/src/inbound-mail-foundation/handlers/disconnect-account.write.ts +0 -72
- package/src/inbound-mail-foundation/handlers/ingest-message.write.ts +0 -338
- package/src/inbound-mail-foundation/handlers/list-accounts.query.ts +0 -44
- package/src/inbound-mail-foundation/handlers/list-messages.query.ts +0 -59
- package/src/inbound-mail-foundation/handlers/scope-visibility.ts +0 -14
- package/src/inbound-mail-foundation/handlers/update-account.write.ts +0 -80
- package/src/inbound-mail-foundation/index.ts +0 -96
- package/src/inbound-mail-foundation/oauth-state.ts +0 -103
- package/src/inbound-mail-foundation/projection.ts +0 -152
- package/src/inbound-mail-foundation/provider-factory.ts +0 -53
- package/src/inbound-mail-foundation/retention-sweep.ts +0 -168
- package/src/inbound-mail-foundation/tenant-destroy-hook.ts +0 -88
- package/src/inbound-mail-foundation/types.ts +0 -257
- package/src/inbound-mail-foundation/watch-supervisor.ts +0 -658
- package/src/inbound-provider-imap/__tests__/feature.test.ts +0 -115
- package/src/inbound-provider-imap/__tests__/imap-foundation.integration.test.ts +0 -308
- package/src/inbound-provider-imap/__tests__/imap-live.integration.test.ts +0 -219
- package/src/inbound-provider-imap/__tests__/plugin-mocked.test.ts +0 -441
- package/src/inbound-provider-imap/credential-document.ts +0 -51
- package/src/inbound-provider-imap/feature.ts +0 -286
- package/src/inbound-provider-imap/imap-client.ts +0 -216
- package/src/inbound-provider-imap/index.ts +0 -17
- package/src/inbound-provider-inmemory/__tests__/feature.test.ts +0 -52
- package/src/inbound-provider-inmemory/feature.ts +0 -154
- package/src/inbound-provider-inmemory/index.ts +0 -12
- package/src/jobs/__tests__/entity-ddl.test.ts +0 -15
- package/src/jobs/__tests__/job-instant.test.ts +0 -15
- package/src/jobs/__tests__/job-system-user.integration.test.ts +0 -204
- package/src/jobs/__tests__/jobs-catalog.integration.test.ts +0 -97
- package/src/jobs/__tests__/jobs-events.integration.test.ts +0 -161
- package/src/jobs/__tests__/jobs-feature.integration.test.ts +0 -397
- package/src/jobs/__tests__/jobs-pii-kms.integration.test.ts +0 -705
- package/src/jobs/__tests__/jobs-retention.integration.test.ts +0 -124
- package/src/jobs/__tests__/jobs-screens.boot.test.ts +0 -42
- package/src/jobs/__tests__/jobs-security.integration.test.ts +0 -149
- package/src/jobs/__tests__/jobs-stale-run-sweep.integration.test.ts +0 -148
- package/src/jobs/__tests__/projection-rebuild-job.integration.test.ts +0 -230
- package/src/jobs/__tests__/reindex-entity-job.integration.test.ts +0 -232
- package/src/jobs/__tests__/tenant-job-failures.integration.test.ts +0 -273
- package/src/jobs/constants.ts +0 -32
- package/src/jobs/db/queries/retention.ts +0 -60
- package/src/jobs/db/queries/stale-run-sweep.ts +0 -73
- package/src/jobs/events.ts +0 -36
- package/src/jobs/feature.ts +0 -252
- package/src/jobs/handlers/catalog.query.ts +0 -42
- package/src/jobs/handlers/detail.query.ts +0 -69
- package/src/jobs/handlers/list.query.ts +0 -70
- package/src/jobs/handlers/projection-rebuild.job.ts +0 -43
- package/src/jobs/handlers/reindex-entity.job.ts +0 -56
- package/src/jobs/handlers/retention-cleanup.job.ts +0 -23
- package/src/jobs/handlers/retry.write.ts +0 -99
- package/src/jobs/handlers/stale-run-sweep.job.ts +0 -30
- package/src/jobs/handlers/tenant-failures.query.ts +0 -82
- package/src/jobs/handlers/trigger.write.ts +0 -79
- package/src/jobs/i18n.ts +0 -45
- package/src/jobs/index.ts +0 -7
- package/src/jobs/is-manual-trigger.test.ts +0 -17
- package/src/jobs/is-manual-trigger.ts +0 -5
- package/src/jobs/job-instant.ts +0 -9
- package/src/jobs/job-run-logger.ts +0 -428
- package/src/jobs/job-run-table.ts +0 -100
- package/src/jobs/tenant-job-failure-table.ts +0 -39
- package/src/jobs/web/client-plugin.tsx +0 -16
- package/src/jobs/web/i18n.ts +0 -8
- package/src/jobs/web/index.ts +0 -2
- package/src/ledger/__tests__/feature.test.ts +0 -169
- package/src/ledger/__tests__/ledger-reports-tenant-isolation.integration.test.ts +0 -146
- package/src/ledger/__tests__/ledger.integration.test.ts +0 -742
- package/src/ledger/__tests__/recurring.test.ts +0 -136
- package/src/ledger/__tests__/reports.test.ts +0 -142
- package/src/ledger/constants.ts +0 -60
- package/src/ledger/entity.ts +0 -163
- package/src/ledger/executor.ts +0 -18
- package/src/ledger/feature.ts +0 -180
- package/src/ledger/handlers/confirm-schedule-period.write.ts +0 -132
- package/src/ledger/handlers/create-transaction.write.ts +0 -48
- package/src/ledger/handlers/reports.query.ts +0 -84
- package/src/ledger/handlers/reverse-transaction.write.ts +0 -96
- package/src/ledger/index.ts +0 -71
- package/src/ledger/recurring.ts +0 -149
- package/src/ledger/reports.ts +0 -164
- package/src/ledger/schemas.ts +0 -71
- package/src/ledger/web/index.ts +0 -36
- package/src/legal-pages/README.md +0 -238
- package/src/legal-pages/__tests__/legal-pages.integration.test.ts +0 -656
- package/src/legal-pages/constants.ts +0 -54
- package/src/legal-pages/feature.ts +0 -275
- package/src/legal-pages/index.ts +0 -16
- package/src/legal-pages/markdown.ts +0 -7
- package/src/legal-pages/web/__tests__/client-plugin.test.ts +0 -53
- package/src/legal-pages/web/client-plugin.ts +0 -81
- package/src/legal-pages/web/index.ts +0 -4
- package/src/mail-foundation/__tests__/feature.test.ts +0 -45
- package/src/mail-foundation/__tests__/mail-foundation.integration.test.ts +0 -370
- package/src/mail-foundation/__tests__/mail-transport-contract.ts +0 -58
- package/src/mail-foundation/feature.ts +0 -233
- package/src/mail-foundation/index.ts +0 -17
- package/src/mail-transport-inmemory/__tests__/feature.test.ts +0 -60
- package/src/mail-transport-inmemory/feature.ts +0 -97
- package/src/mail-transport-inmemory/index.ts +0 -3
- package/src/mail-transport-smtp/__tests__/feature.test.ts +0 -246
- package/src/mail-transport-smtp/feature.ts +0 -268
- package/src/mail-transport-smtp/index.ts +0 -8
- package/src/managed-pages/__tests__/branding-coerce.test.ts +0 -75
- package/src/managed-pages/__tests__/i18n-surface.boot.test.ts +0 -30
- package/src/managed-pages/__tests__/managed-pages.integration.test.ts +0 -806
- package/src/managed-pages/branding.ts +0 -173
- package/src/managed-pages/css-gate.ts +0 -24
- package/src/managed-pages/feature.ts +0 -267
- package/src/managed-pages/handlers/branding.query.ts +0 -37
- package/src/managed-pages/handlers/by-slug.query.ts +0 -40
- package/src/managed-pages/handlers/by-tenant-published.query.ts +0 -55
- package/src/managed-pages/handlers/page-crud.ts +0 -49
- package/src/managed-pages/handlers/set.write.ts +0 -132
- package/src/managed-pages/i18n.ts +0 -62
- package/src/managed-pages/index.ts +0 -30
- package/src/managed-pages/screens/branding-screen.ts +0 -115
- package/src/managed-pages/screens/page-screens.ts +0 -89
- package/src/managed-pages/seeding.ts +0 -99
- package/src/managed-pages/table.ts +0 -80
- package/src/managed-pages/web/client-plugin.tsx +0 -22
- package/src/managed-pages/web/i18n.ts +0 -19
- package/src/managed-pages/web/index.ts +0 -3
- package/src/notes-history/__tests__/add-note-author-name-kms.integration.test.ts +0 -122
- package/src/notes-history/__tests__/notes-history-ownership.integration.test.ts +0 -338
- package/src/notes-history/__tests__/notes-history-parent-visibility.integration.test.ts +0 -241
- package/src/notes-history/__tests__/notes-history.integration.test.ts +0 -202
- package/src/notes-history/__tests__/notes-read-gate.integration.test.ts +0 -248
- package/src/notes-history/__tests__/notes-section.test.tsx +0 -331
- package/src/notes-history/constants.ts +0 -34
- package/src/notes-history/entity.ts +0 -128
- package/src/notes-history/executor.ts +0 -12
- package/src/notes-history/feature.ts +0 -150
- package/src/notes-history/handlers/add-note.write.ts +0 -102
- package/src/notes-history/i18n.ts +0 -3
- package/src/notes-history/index.ts +0 -25
- package/src/notes-history/schemas.ts +0 -17
- package/src/notes-history/web/client-plugin.tsx +0 -16
- package/src/notes-history/web/i18n.ts +0 -22
- package/src/notes-history/web/index.ts +0 -8
- package/src/notes-history/web/notes-section.tsx +0 -185
- package/src/notes-history-user-data/__tests__/hooks.integration.test.ts +0 -119
- package/src/notes-history-user-data/__tests__/mention-forget.integration.test.ts +0 -249
- package/src/notes-history-user-data/hooks.ts +0 -97
- package/src/notes-history-user-data/index.ts +0 -34
- package/src/page-render/__tests__/branding.test.ts +0 -57
- package/src/page-render/__tests__/css-sanitize.test.ts +0 -215
- package/src/page-render/__tests__/layout.test.ts +0 -63
- package/src/page-render/__tests__/markdown.test.ts +0 -70
- package/src/page-render/__tests__/security-headers.test.ts +0 -22
- package/src/page-render/branding.ts +0 -100
- package/src/page-render/cached-page-response.ts +0 -25
- package/src/page-render/css-sanitize.ts +0 -344
- package/src/page-render/index.ts +0 -17
- package/src/page-render/layout.ts +0 -115
- package/src/page-render/markdown.ts +0 -31
- package/src/page-render/security-headers.ts +0 -19
- package/src/page-render/web.ts +0 -14
- package/src/personal-access-tokens/__tests__/expiry.test.ts +0 -19
- package/src/personal-access-tokens/__tests__/feature.test.ts +0 -135
- package/src/personal-access-tokens/__tests__/pat.integration.test.ts +0 -611
- package/src/personal-access-tokens/__tests__/scopes.test.ts +0 -42
- package/src/personal-access-tokens/constants.ts +0 -44
- package/src/personal-access-tokens/expiry.ts +0 -7
- package/src/personal-access-tokens/feature.ts +0 -176
- package/src/personal-access-tokens/handlers/available-scopes.query.ts +0 -29
- package/src/personal-access-tokens/handlers/create.write.ts +0 -124
- package/src/personal-access-tokens/handlers/list.query.ts +0 -117
- package/src/personal-access-tokens/handlers/revoke.write.ts +0 -62
- package/src/personal-access-tokens/hash.ts +0 -17
- package/src/personal-access-tokens/i18n.ts +0 -59
- package/src/personal-access-tokens/index.ts +0 -43
- package/src/personal-access-tokens/pat-revoked-event.ts +0 -23
- package/src/personal-access-tokens/resolver.ts +0 -53
- package/src/personal-access-tokens/revoke-for-user.ts +0 -49
- package/src/personal-access-tokens/roles.ts +0 -37
- package/src/personal-access-tokens/schema/api-token.ts +0 -92
- package/src/personal-access-tokens/scopes.ts +0 -43
- package/src/personal-access-tokens/screens.ts +0 -120
- package/src/presets/__tests__/dsgvo-self-service.test.ts +0 -35
- package/src/presets/__tests__/security-baseline.test.ts +0 -94
- package/src/presets/dsgvo-self-service.ts +0 -30
- package/src/presets/index.ts +0 -2
- package/src/presets/security-baseline.ts +0 -19
- package/src/rate-limiting/__tests__/rate-limiting.integration.test.ts +0 -163
- package/src/rate-limiting/constants.ts +0 -10
- package/src/rate-limiting/feature.ts +0 -28
- package/src/rate-limiting/handlers/bucket-access.ts +0 -39
- package/src/rate-limiting/handlers/status.query.ts +0 -60
- package/src/rate-limiting/index.ts +0 -2
- package/src/readiness/__tests__/readiness.integration.test.ts +0 -373
- package/src/readiness/constants.ts +0 -7
- package/src/readiness/feature.ts +0 -31
- package/src/readiness/handlers/status.query.ts +0 -55
- package/src/readiness/index.ts +0 -3
- package/src/renderer-foundation/README.md +0 -86
- package/src/renderer-foundation/__tests__/api.test.ts +0 -188
- package/src/renderer-foundation/__tests__/collect-plugins.integration.test.ts +0 -123
- package/src/renderer-foundation/api.ts +0 -106
- package/src/renderer-foundation/constants.ts +0 -25
- package/src/renderer-foundation/feature.ts +0 -52
- package/src/renderer-foundation/index.ts +0 -28
- package/src/renderer-foundation/types.ts +0 -131
- package/src/renderer-simple/__tests__/adapter.test.ts +0 -69
- package/src/renderer-simple/__tests__/resolve-variables.test.ts +0 -37
- package/src/renderer-simple/__tests__/simple-renderer.test.ts +0 -97
- package/src/renderer-simple/__tests__/template-resolver.integration.test.ts +0 -102
- package/src/renderer-simple/feature.ts +0 -57
- package/src/renderer-simple/index.ts +0 -2
- package/src/renderer-simple/resolve-variables.ts +0 -57
- package/src/renderer-simple/simple-renderer.ts +0 -65
- package/src/secrets/__tests__/access-options-precedence.test.ts +0 -25
- package/src/secrets/__tests__/access-options.integration.test.ts +0 -126
- package/src/secrets/__tests__/require-secrets-context.test.ts +0 -83
- package/src/secrets/__tests__/rotate.integration.test.ts +0 -270
- package/src/secrets/__tests__/secrets-events.integration.test.ts +0 -118
- package/src/secrets/__tests__/secrets.integration.test.ts +0 -111
- package/src/secrets/__tests__/settings-hub-i18n.test.ts +0 -27
- package/src/secrets/constants.ts +0 -12
- package/src/secrets/db/queries/read.ts +0 -16
- package/src/secrets/feature.ts +0 -195
- package/src/secrets/handlers/delete.write.ts +0 -26
- package/src/secrets/handlers/list.query.ts +0 -40
- package/src/secrets/handlers/rotate.job.ts +0 -166
- package/src/secrets/handlers/set.write.ts +0 -58
- package/src/secrets/index.ts +0 -23
- package/src/secrets/secrets-context.ts +0 -261
- package/src/secrets/table.ts +0 -69
- package/src/seo/__tests__/llms-txt.test.ts +0 -38
- package/src/seo/__tests__/robots-txt.test.ts +0 -39
- package/src/seo/__tests__/schema-builders.test.ts +0 -57
- package/src/seo/__tests__/seo.integration.test.ts +0 -347
- package/src/seo/__tests__/sitemap.test.ts +0 -38
- package/src/seo/constants.ts +0 -60
- package/src/seo/feature.ts +0 -317
- package/src/seo/handlers/seo-config.query.ts +0 -38
- package/src/seo/index.ts +0 -19
- package/src/seo/llms-txt.ts +0 -33
- package/src/seo/robots-txt.ts +0 -33
- package/src/seo/schema-builders.ts +0 -57
- package/src/seo/sitemap.ts +0 -33
- package/src/sessions/__tests__/auto-revoke-binding.test.ts +0 -71
- package/src/sessions/__tests__/cleanup.integration.test.ts +0 -181
- package/src/sessions/__tests__/membership-revoke.integration.test.ts +0 -195
- package/src/sessions/__tests__/password-auto-revoke.integration.test.ts +0 -207
- package/src/sessions/__tests__/rebuild-survival.integration.test.ts +0 -103
- package/src/sessions/__tests__/role-rederivation.integration.test.ts +0 -137
- package/src/sessions/__tests__/session-last-seen.integration.test.ts +0 -165
- package/src/sessions/__tests__/session-store-registration.test.ts +0 -21
- package/src/sessions/__tests__/sessions-screens.boot.test.ts +0 -68
- package/src/sessions/__tests__/sessions.integration.test.ts +0 -977
- package/src/sessions/__tests__/test-helpers.ts +0 -79
- package/src/sessions/constants.ts +0 -57
- package/src/sessions/db/queries/cleanup.ts +0 -21
- package/src/sessions/feature.ts +0 -237
- package/src/sessions/handlers/cleanup.job.ts +0 -83
- package/src/sessions/handlers/detail.query.ts +0 -51
- package/src/sessions/handlers/list.query.ts +0 -92
- package/src/sessions/handlers/mine.query.ts +0 -67
- package/src/sessions/handlers/revoke-all-for-user.write.ts +0 -111
- package/src/sessions/handlers/revoke-all-others.write.ts +0 -65
- package/src/sessions/handlers/revoke.write.ts +0 -91
- package/src/sessions/i18n.ts +0 -33
- package/src/sessions/index.ts +0 -25
- package/src/sessions/schema/user-session.ts +0 -89
- package/src/sessions/screens.ts +0 -152
- package/src/sessions/session-callbacks.ts +0 -287
- package/src/sessions/session-checker-fail-open.test.ts +0 -189
- package/src/sessions/session-revoked-event.ts +0 -37
- package/src/sessions/testing.ts +0 -55
- package/src/shared/__tests__/chunked-entity-migration.test.ts +0 -145
- package/src/shared/__tests__/row-bound-grant.integration.test.ts +0 -184
- package/src/shared/assert-erased.ts +0 -15
- package/src/shared/chunked-entity-migration.ts +0 -89
- package/src/shared/classify-stored-envelope.ts +0 -21
- package/src/shared/decrypt-stored-pii.ts +0 -26
- package/src/shared/encrypt-for-direct-write.ts +0 -29
- package/src/shared/entities-of.ts +0 -17
- package/src/shared/grace-period.test.ts +0 -26
- package/src/shared/grace-period.ts +0 -20
- package/src/shared/has-where-rule.ts +0 -11
- package/src/shared/identity-v3-hash.test.ts +0 -174
- package/src/shared/identity-v3-hash.ts +0 -97
- package/src/shared/index.ts +0 -50
- package/src/shared/is-tenant-db.ts +0 -9
- package/src/shared/lockout-counter.test.ts +0 -91
- package/src/shared/lockout-counter.ts +0 -108
- package/src/shared/map-with-concurrency.test.ts +0 -104
- package/src/shared/map-with-concurrency.ts +0 -38
- package/src/shared/parent-visibility.ts +0 -78
- package/src/shared/password-hashing.test.ts +0 -43
- package/src/shared/password-hashing.ts +0 -55
- package/src/shared/row-bound-grant.test.ts +0 -294
- package/src/shared/row-bound-grant.ts +0 -115
- package/src/shared/run-in-sub-transaction.ts +0 -35
- package/src/shared/session-field.ts +0 -10
- package/src/shared/session-locale-field.test.ts +0 -25
- package/src/shared/session-locale-field.ts +0 -10
- package/src/shared/session-timezone-field.test.ts +0 -16
- package/src/shared/session-timezone-field.ts +0 -8
- package/src/shared/signed-token.test.ts +0 -78
- package/src/shared/signed-token.ts +0 -101
- package/src/shared/signup-handover.ts +0 -67
- package/src/shared/single-use-token-store.test.ts +0 -75
- package/src/shared/single-use-token-store.ts +0 -156
- package/src/shared/system-query.ts +0 -5
- package/src/shared/token-burn-store.ts +0 -57
- package/src/step-dispatcher/__tests__/feature.boot.test.ts +0 -20
- package/src/step-dispatcher/__tests__/step-dispatcher-pii.integration.test.ts +0 -268
- package/src/step-dispatcher/__tests__/webhook-runner.test.ts +0 -297
- package/src/step-dispatcher/feature.ts +0 -292
- package/src/step-dispatcher/index.ts +0 -25
- package/src/step-dispatcher/mail-runner.ts +0 -33
- package/src/step-dispatcher/webhook-runner.ts +0 -212
- package/src/subscription-mollie/__tests__/feature.test.ts +0 -203
- package/src/subscription-mollie/__tests__/mollie-foundation.integration.test.ts +0 -401
- package/src/subscription-mollie/__tests__/plugin-methods.test.ts +0 -86
- package/src/subscription-mollie/__tests__/verify-webhook.test.ts +0 -410
- package/src/subscription-mollie/constants.ts +0 -33
- package/src/subscription-mollie/feature.ts +0 -169
- package/src/subscription-mollie/index.ts +0 -14
- package/src/subscription-mollie/plugin-methods.ts +0 -87
- package/src/subscription-mollie/verify-webhook.ts +0 -249
- package/src/subscription-stripe/__tests__/feature.test.ts +0 -254
- package/src/subscription-stripe/__tests__/payment-checkout.test.ts +0 -167
- package/src/subscription-stripe/__tests__/plugin-methods.test.ts +0 -949
- package/src/subscription-stripe/__tests__/runtime.test.ts +0 -261
- package/src/subscription-stripe/__tests__/stripe-foundation.integration.test.ts +0 -590
- package/src/subscription-stripe/__tests__/verify-webhook.test.ts +0 -392
- package/src/subscription-stripe/constants.ts +0 -35
- package/src/subscription-stripe/feature.ts +0 -251
- package/src/subscription-stripe/index.ts +0 -18
- package/src/subscription-stripe/plugin-methods.ts +0 -524
- package/src/subscription-stripe/runtime.ts +0 -193
- package/src/subscription-stripe/verify-webhook.ts +0 -402
- package/src/tags/__tests__/drift.test.ts +0 -46
- package/src/tags/__tests__/feature.test.ts +0 -274
- package/src/tags/__tests__/schemas.test.ts +0 -34
- package/src/tags/__tests__/tag-screens.boot.test.ts +0 -64
- package/src/tags/__tests__/tags-ownership.test.ts +0 -22
- package/src/tags/__tests__/tags-parent-visibility.integration.test.ts +0 -232
- package/src/tags/__tests__/tags-read-gate.integration.test.ts +0 -368
- package/src/tags/__tests__/tags.integration.test.ts +0 -522
- package/src/tags/aggregate-id.ts +0 -23
- package/src/tags/constants.ts +0 -61
- package/src/tags/entity.ts +0 -99
- package/src/tags/executor.ts +0 -11
- package/src/tags/feature.ts +0 -216
- package/src/tags/handlers/assign-tag.write.ts +0 -101
- package/src/tags/handlers/create-tag.write.ts +0 -27
- package/src/tags/handlers/delete-tag.write.ts +0 -60
- package/src/tags/handlers/remove-tag.write.ts +0 -54
- package/src/tags/handlers/update-tag.write.ts +0 -36
- package/src/tags/i18n.ts +0 -9
- package/src/tags/index.ts +0 -48
- package/src/tags/schemas.ts +0 -61
- package/src/tags/screens.ts +0 -70
- package/src/tags/web/__tests__/entity-tags.test.tsx +0 -116
- package/src/tags/web/__tests__/tag-chip.test.ts +0 -34
- package/src/tags/web/__tests__/tag-filter.test.tsx +0 -124
- package/src/tags/web/__tests__/tag-manager.test.tsx +0 -333
- package/src/tags/web/__tests__/tag-picker.test.tsx +0 -153
- package/src/tags/web/__tests__/tag-section.test.tsx +0 -227
- package/src/tags/web/__tests__/tags-cell.test.tsx +0 -94
- package/src/tags/web/client-plugin.tsx +0 -30
- package/src/tags/web/entity-tags.tsx +0 -54
- package/src/tags/web/i18n.ts +0 -34
- package/src/tags/web/index.ts +0 -18
- package/src/tags/web/tag-chip.tsx +0 -65
- package/src/tags/web/tag-filter.tsx +0 -100
- package/src/tags/web/tag-manager.tsx +0 -391
- package/src/tags/web/tag-picker.tsx +0 -55
- package/src/tags/web/tag-section.tsx +0 -179
- package/src/tags/web/tags-cell.tsx +0 -46
- package/src/template-resolver/README.md +0 -255
- package/src/template-resolver/__tests__/collection-kinds.integration.test.ts +0 -287
- package/src/template-resolver/__tests__/collection-ownership.integration.test.ts +0 -334
- package/src/template-resolver/__tests__/conformance.integration.test.ts +0 -98
- package/src/template-resolver/__tests__/handlers.integration.test.ts +0 -460
- package/src/template-resolver/__tests__/seed-legal-content.integration.test.ts +0 -192
- package/src/template-resolver/__tests__/seeding.integration.test.ts +0 -107
- package/src/template-resolver/__tests__/template-resolver.integration.test.ts +0 -571
- package/src/template-resolver/__tests__/text-blocks.integration.test.ts +0 -562
- package/src/template-resolver/api.ts +0 -202
- package/src/template-resolver/constants.ts +0 -54
- package/src/template-resolver/feature.ts +0 -99
- package/src/template-resolver/handlers/by-slug.query.ts +0 -61
- package/src/template-resolver/handlers/by-tenant.query.ts +0 -62
- package/src/template-resolver/handlers/collection-item.query.ts +0 -53
- package/src/template-resolver/handlers/collection-list.query.ts +0 -56
- package/src/template-resolver/handlers/collection-set.write.ts +0 -117
- package/src/template-resolver/handlers/collection-shared.ts +0 -89
- package/src/template-resolver/handlers/find-by-id.query.ts +0 -44
- package/src/template-resolver/handlers/list.query.ts +0 -60
- package/src/template-resolver/handlers/set.write.ts +0 -126
- package/src/template-resolver/handlers/shared.ts +0 -51
- package/src/template-resolver/handlers/toggle-status.write.ts +0 -46
- package/src/template-resolver/handlers/upsert-system.write.ts +0 -81
- package/src/template-resolver/handlers/upsert-tenant.write.ts +0 -105
- package/src/template-resolver/index.ts +0 -40
- package/src/template-resolver/qualified-names.ts +0 -40
- package/src/template-resolver/seeding.ts +0 -324
- package/src/template-resolver/table.ts +0 -79
- package/src/template-resolver/testing.ts +0 -199
- package/src/template-resolver/user-content-table.ts +0 -71
- package/src/template-resolver/web/__tests__/client-plugin.test.tsx +0 -334
- package/src/template-resolver/web/__tests__/editor-read-only.test.tsx +0 -188
- package/src/template-resolver/web/__tests__/group-blocks.test.ts +0 -229
- package/src/template-resolver/web/client-plugin.tsx +0 -516
- package/src/template-resolver/web/i18n.ts +0 -25
- package/src/template-resolver/web/index.ts +0 -8
- package/src/template-resolver-user-data/hooks.ts +0 -40
- package/src/template-resolver-user-data/index.ts +0 -25
- package/src/tenant/__tests__/is-tenant-serving-public-content.test.ts +0 -21
- package/src/tenant/__tests__/member-directory.integration.test.ts +0 -179
- package/src/tenant/__tests__/members-facet-i18n.test.ts +0 -105
- package/src/tenant/__tests__/members-query-kms.integration.test.ts +0 -97
- package/src/tenant/__tests__/members-screens.boot.test.ts +0 -208
- package/src/tenant/__tests__/multi-tenant.integration.test.ts +0 -405
- package/src/tenant/__tests__/seed-testing.integration.test.ts +0 -230
- package/src/tenant/__tests__/tenant-directory.integration.test.ts +0 -124
- package/src/tenant/__tests__/tenant-security.integration.test.ts +0 -1073
- package/src/tenant/__tests__/tenant-timezone-boot.integration.test.ts +0 -225
- package/src/tenant/__tests__/tenant.integration.test.ts +0 -505
- package/src/tenant/__tests__/update-cross-tenant.integration.test.ts +0 -81
- package/src/tenant/command-schemas.ts +0 -37
- package/src/tenant/constants.ts +0 -71
- package/src/tenant/feature.ts +0 -194
- package/src/tenant/handlers/active-tenant-ids.query.ts +0 -30
- package/src/tenant/handlers/add-member.write.ts +0 -64
- package/src/tenant/handlers/cancel-invitation.write.ts +0 -89
- package/src/tenant/handlers/create.write.ts +0 -37
- package/src/tenant/handlers/invitations.query.ts +0 -58
- package/src/tenant/handlers/is-system-admin.ts +0 -5
- package/src/tenant/handlers/list.query.ts +0 -30
- package/src/tenant/handlers/me.query.ts +0 -38
- package/src/tenant/handlers/member-directory.query.ts +0 -74
- package/src/tenant/handlers/members.query.ts +0 -73
- package/src/tenant/handlers/memberships.query.ts +0 -58
- package/src/tenant/handlers/remove-member.write.ts +0 -84
- package/src/tenant/handlers/resolve-user-ids.query.ts +0 -44
- package/src/tenant/handlers/team-list.query.ts +0 -257
- package/src/tenant/handlers/tenant-directory.query.ts +0 -53
- package/src/tenant/handlers/toggle-enabled.write.ts +0 -37
- package/src/tenant/handlers/update-member-roles.write.ts +0 -175
- package/src/tenant/handlers/update.write.ts +0 -55
- package/src/tenant/i18n.ts +0 -55
- package/src/tenant/index.ts +0 -18
- package/src/tenant/invitation-table.ts +0 -104
- package/src/tenant/is-tenant-serving-public-content.ts +0 -13
- package/src/tenant/last-tenant-admin.ts +0 -39
- package/src/tenant/membership-roles.test.ts +0 -29
- package/src/tenant/membership-roles.ts +0 -34
- package/src/tenant/membership-table.ts +0 -32
- package/src/tenant/schema/tenant.ts +0 -73
- package/src/tenant/screens.ts +0 -199
- package/src/tenant/seeding.ts +0 -328
- package/src/tenant/testing.ts +0 -8
- package/src/tenant/web/__tests__/member-roles-cell.test.tsx +0 -59
- package/src/tenant/web/__tests__/member-status-cell.test.tsx +0 -46
- package/src/tenant/web/client-plugin.tsx +0 -25
- package/src/tenant/web/index.ts +0 -4
- package/src/tenant/web/member-roles-cell.tsx +0 -21
- package/src/tenant/web/member-status-cell.tsx +0 -27
- package/src/tenant/web/translate-or-raw.ts +0 -13
- package/src/tenant-handover/__tests__/claim-storage-usage.integration.test.ts +0 -201
- package/src/tenant-handover/__tests__/claim.integration.test.ts +0 -794
- package/src/tenant-handover/__tests__/transfer-graph.test.ts +0 -193
- package/src/tenant-handover/events.ts +0 -32
- package/src/tenant-handover/feature.ts +0 -46
- package/src/tenant-handover/grant.ts +0 -43
- package/src/tenant-handover/handlers/claim.write.ts +0 -127
- package/src/tenant-handover/index.ts +0 -9
- package/src/tenant-handover/move-entity-graph.ts +0 -348
- package/src/tenant-handover/root-anchor.ts +0 -50
- package/src/tenant-handover/signup-handover-provider.ts +0 -62
- package/src/tenant-handover/transfer-graph.ts +0 -128
- package/src/tenant-lifecycle/__tests__/stages.test.ts +0 -73
- package/src/tenant-lifecycle/__tests__/tenant-lifecycle.integration.test.ts +0 -554
- package/src/tenant-lifecycle/boot-checks.ts +0 -45
- package/src/tenant-lifecycle/constants.ts +0 -56
- package/src/tenant-lifecycle/events.ts +0 -46
- package/src/tenant-lifecycle/feature.ts +0 -149
- package/src/tenant-lifecycle/handlers/cancel-destruction.write.ts +0 -85
- package/src/tenant-lifecycle/handlers/request-destruction.write.ts +0 -93
- package/src/tenant-lifecycle/index.ts +0 -7
- package/src/tenant-lifecycle/lib/revoke-tenant-sessions.ts +0 -16
- package/src/tenant-lifecycle/lifecycle-gate.ts +0 -65
- package/src/tenant-lifecycle/run-tenant-destroy.ts +0 -382
- package/src/tenant-lifecycle/stages.ts +0 -239
- package/src/tenant-settings/__tests__/config.test.ts +0 -19
- package/src/tenant-settings/__tests__/settings-hub-i18n.test.ts +0 -110
- package/src/tenant-settings/__tests__/tenant-currency-read-access.integration.test.ts +0 -50
- package/src/tenant-settings/__tests__/tenant-settings.integration.test.ts +0 -101
- package/src/tenant-settings/config.ts +0 -43
- package/src/tenant-settings/constants.ts +0 -21
- package/src/tenant-settings/feature.ts +0 -52
- package/src/tenant-settings/index.ts +0 -8
- package/src/tenant-settings/tenant-defaults.ts +0 -78
- package/src/tier-engine/__tests__/auto-default-tier.integration.test.ts +0 -112
- package/src/tier-engine/__tests__/compose-app.test.ts +0 -182
- package/src/tier-engine/__tests__/drift.test.ts +0 -46
- package/src/tier-engine/__tests__/resolver.integration.test.ts +0 -280
- package/src/tier-engine/__tests__/tier-engine-screens.boot.test.ts +0 -82
- package/src/tier-engine/__tests__/tier-engine.integration.test.ts +0 -415
- package/src/tier-engine/__tests__/tier-resolver.integration.test.ts +0 -138
- package/src/tier-engine/__tests__/trial-config-validation.test.ts +0 -30
- package/src/tier-engine/__tests__/trial.test.ts +0 -27
- package/src/tier-engine/aggregate-id.ts +0 -28
- package/src/tier-engine/compose-app.ts +0 -153
- package/src/tier-engine/constants.ts +0 -28
- package/src/tier-engine/entity.ts +0 -55
- package/src/tier-engine/feature.ts +0 -551
- package/src/tier-engine/handlers/active-tier.query.ts +0 -25
- package/src/tier-engine/handlers/get-tenant-tier.query.ts +0 -31
- package/src/tier-engine/handlers/set-tenant-tier.write.ts +0 -107
- package/src/tier-engine/i18n.ts +0 -28
- package/src/tier-engine/index.ts +0 -32
- package/src/tier-engine/tier-resolver.ts +0 -38
- package/src/tier-engine/trial.ts +0 -26
- package/src/tier-engine/web/client-plugin.tsx +0 -21
- package/src/tier-engine/web/index.ts +0 -7
- package/src/user/__tests__/admin-screens.boot.test.ts +0 -95
- package/src/user/__tests__/email-unique-blind-index.integration.test.ts +0 -150
- package/src/user/__tests__/email-unique-plaintext-soft-delete.integration.test.ts +0 -137
- package/src/user/__tests__/roles-input-schema.test.ts +0 -20
- package/src/user/__tests__/seed-testing.integration.test.ts +0 -139
- package/src/user/__tests__/stream-tenant-backfill.integration.test.ts +0 -185
- package/src/user/__tests__/user-global-tenancy.integration.test.ts +0 -97
- package/src/user/__tests__/user-status.test.ts +0 -39
- package/src/user/__tests__/user.integration.test.ts +0 -927
- package/src/user/command-schemas.ts +0 -15
- package/src/user/constants.ts +0 -32
- package/src/user/db/queries/__tests__/unsafe-read-retrying.integration.test.ts +0 -54
- package/src/user/db/queries/stream-tenant-backfill.ts +0 -113
- package/src/user/feature.ts +0 -61
- package/src/user/handlers/create.write.ts +0 -130
- package/src/user/handlers/detail.query.ts +0 -33
- package/src/user/handlers/find-for-auth.query.ts +0 -51
- package/src/user/handlers/list.query.ts +0 -122
- package/src/user/handlers/me.query.ts +0 -38
- package/src/user/handlers/update-roles.ts +0 -203
- package/src/user/handlers/update.write.ts +0 -106
- package/src/user/i18n.ts +0 -23
- package/src/user/index.ts +0 -19
- package/src/user/principal-status.ts +0 -47
- package/src/user/roles-input-schema.ts +0 -20
- package/src/user/schema/user.ts +0 -214
- package/src/user/screens.ts +0 -54
- package/src/user/seeding.ts +0 -139
- package/src/user/testing.ts +0 -5
- package/src/user-data-rights/COMPLIANCE.md +0 -202
- package/src/user-data-rights/README.md +0 -109
- package/src/user-data-rights/__tests__/anonymous-deletion-kms.integration.test.ts +0 -146
- package/src/user-data-rights/__tests__/anonymous-deletion.integration.test.ts +0 -429
- package/src/user-data-rights/__tests__/audit-log.integration.test.ts +0 -288
- package/src/user-data-rights/__tests__/boot-checks.test.ts +0 -288
- package/src/user-data-rights/__tests__/cross-data-matrix.integration.test.ts +0 -375
- package/src/user-data-rights/__tests__/default-mailers.test.ts +0 -170
- package/src/user-data-rights/__tests__/deletion-token-compat.test.ts +0 -36
- package/src/user-data-rights/__tests__/download-by-token-ip-bucket.integration.test.ts +0 -170
- package/src/user-data-rights/__tests__/download-by-token-resolver-trust.integration.test.ts +0 -167
- package/src/user-data-rights/__tests__/download.integration.test.ts +0 -647
- package/src/user-data-rights/__tests__/email-templates.test.ts +0 -104
- package/src/user-data-rights/__tests__/escape-hatch-audit.integration.test.ts +0 -131
- package/src/user-data-rights/__tests__/escape-hatch-declaration.integration.test.ts +0 -196
- package/src/user-data-rights/__tests__/export-encrypted-fields.integration.test.ts +0 -153
- package/src/user-data-rights/__tests__/export-job-idempotency.integration.test.ts +0 -249
- package/src/user-data-rights/__tests__/export-job-list-cross-tenant.integration.test.ts +0 -85
- package/src/user-data-rights/__tests__/export-job-schema.test.ts +0 -163
- package/src/user-data-rights/__tests__/extract-audit-meta.test.ts +0 -36
- package/src/user-data-rights/__tests__/file-binary-forget-cleanup.integration.test.ts +0 -227
- package/src/user-data-rights/__tests__/file-binary-forget-failure.integration.test.ts +0 -261
- package/src/user-data-rights/__tests__/file-retention.integration.test.ts +0 -234
- package/src/user-data-rights/__tests__/file-storage-unification.integration.test.ts +0 -167
- package/src/user-data-rights/__tests__/forget-cleanup-hook-ordering.integration.test.ts +0 -262
- package/src/user-data-rights/__tests__/forget-cleanup-search-purge-ordering.integration.test.ts +0 -178
- package/src/user-data-rights/__tests__/forget-hook-registry.integration.test.ts +0 -110
- package/src/user-data-rights/__tests__/forget-test-helpers.ts +0 -103
- package/src/user-data-rights/__tests__/inspector-screens.boot.test.ts +0 -186
- package/src/user-data-rights/__tests__/mail-default-bridge.integration.test.ts +0 -178
- package/src/user-data-rights/__tests__/policy-to-strategy.test.ts +0 -30
- package/src/user-data-rights/__tests__/read-users-rebuild-survives-lifecycle.integration.test.ts +0 -304
- package/src/user-data-rights/__tests__/request-cancel-deletion.integration.test.ts +0 -367
- package/src/user-data-rights/__tests__/request-deletion-callback.integration.test.ts +0 -181
- package/src/user-data-rights/__tests__/request-deletion-url.test.ts +0 -24
- package/src/user-data-rights/__tests__/request-export.integration.test.ts +0 -274
- package/src/user-data-rights/__tests__/restriction-flow.integration.test.ts +0 -480
- package/src/user-data-rights/__tests__/retention-preset-forget.integration.test.ts +0 -272
- package/src/user-data-rights/__tests__/run-export-jobs-cron-context.integration.test.ts +0 -185
- package/src/user-data-rights/__tests__/run-export-jobs.integration.test.ts +0 -1452
- package/src/user-data-rights/__tests__/run-forget-cleanup.integration.test.ts +0 -1131
- package/src/user-data-rights/__tests__/run-user-export.integration.test.ts +0 -605
- package/src/user-data-rights/__tests__/tenant-model-erasure.integration.test.ts +0 -504
- package/src/user-data-rights/__tests__/token-helpers.test.ts +0 -63
- package/src/user-data-rights/__tests__/user-data-rights.integration.test.ts +0 -67
- package/src/user-data-rights/__tests__/zip-path.test.ts +0 -119
- package/src/user-data-rights/audit-download.ts +0 -125
- package/src/user-data-rights/boot-checks.ts +0 -71
- package/src/user-data-rights/constants.ts +0 -63
- package/src/user-data-rights/db/queries/__tests__/forget-cleanup.integration.test.ts +0 -69
- package/src/user-data-rights/db/queries/export-jobs.ts +0 -26
- package/src/user-data-rights/db/queries/forget-cleanup.ts +0 -25
- package/src/user-data-rights/deletion-token.ts +0 -54
- package/src/user-data-rights/email-templates.ts +0 -175
- package/src/user-data-rights/feature.ts +0 -787
- package/src/user-data-rights/handlers/cancel-deletion.write.ts +0 -82
- package/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts +0 -120
- package/src/user-data-rights/handlers/deletion-grace-period.ts +0 -97
- package/src/user-data-rights/handlers/download-attempt-list.query.ts +0 -19
- package/src/user-data-rights/handlers/download-by-job.query.ts +0 -219
- package/src/user-data-rights/handlers/download-by-token.query.ts +0 -258
- package/src/user-data-rights/handlers/export-job-detail.query.ts +0 -13
- package/src/user-data-rights/handlers/export-job-list.query.ts +0 -14
- package/src/user-data-rights/handlers/export-status.query.ts +0 -74
- package/src/user-data-rights/handlers/lift-restriction.write.ts +0 -87
- package/src/user-data-rights/handlers/list-download-attempts.query.ts +0 -49
- package/src/user-data-rights/handlers/my-audit-log.query.ts +0 -86
- package/src/user-data-rights/handlers/request-deletion-by-email.write.ts +0 -126
- package/src/user-data-rights/handlers/request-deletion.write.ts +0 -125
- package/src/user-data-rights/handlers/request-export.write.ts +0 -164
- package/src/user-data-rights/handlers/restrict-account.write.ts +0 -133
- package/src/user-data-rights/handlers/run-forget-cleanup.write.ts +0 -94
- package/src/user-data-rights/i18n.ts +0 -39
- package/src/user-data-rights/index.ts +0 -33
- package/src/user-data-rights/lib/default-mailers.ts +0 -120
- package/src/user-data-rights/lib/deny-if-target-outside-admin-tenant.ts +0 -32
- package/src/user-data-rights/lib/is-admin-actor.ts +0 -19
- package/src/user-data-rights/lib/mail-transport-resolver.ts +0 -50
- package/src/user-data-rights/lib/resolve-tenant-model.ts +0 -34
- package/src/user-data-rights/lib/storage-provider-resolver.ts +0 -49
- package/src/user-data-rights/lib/update-user-lifecycle.ts +0 -135
- package/src/user-data-rights/run-export-jobs.ts +0 -966
- package/src/user-data-rights/run-forget-cleanup.ts +0 -635
- package/src/user-data-rights/run-user-export.ts +0 -338
- package/src/user-data-rights/schema/download-attempt.ts +0 -57
- package/src/user-data-rights/schema/download-token.ts +0 -119
- package/src/user-data-rights/schema/export-job.ts +0 -174
- package/src/user-data-rights/screens.ts +0 -77
- package/src/user-data-rights/token-helpers.ts +0 -67
- package/src/user-data-rights/web/__tests__/deletion-screens.test.tsx +0 -116
- package/src/user-data-rights/web/__tests__/privacy-center-screen.test.tsx +0 -287
- package/src/user-data-rights/web/__tests__/public-deletion-gate.test.tsx +0 -102
- package/src/user-data-rights/web/client-plugin.tsx +0 -52
- package/src/user-data-rights/web/confirm-deletion-screen.tsx +0 -96
- package/src/user-data-rights/web/i18n.ts +0 -91
- package/src/user-data-rights/web/index.ts +0 -15
- package/src/user-data-rights/web/privacy-center-screen.tsx +0 -185
- package/src/user-data-rights/web/public-deletion-gate.tsx +0 -42
- package/src/user-data-rights/web/request-deletion-screen.tsx +0 -103
- package/src/user-data-rights/zip-path.ts +0 -94
- package/src/user-data-rights-defaults/__tests__/bundled-entities.userdata-hooks.integration.test.ts +0 -456
- package/src/user-data-rights-defaults/__tests__/feature-mounted.test.ts +0 -24
- package/src/user-data-rights-defaults/__tests__/user-data-rights-defaults.integration.test.ts +0 -715
- package/src/user-data-rights-defaults/feature.ts +0 -130
- package/src/user-data-rights-defaults/hooks/api-token.userdata-hook.ts +0 -36
- package/src/user-data-rights-defaults/hooks/config-value.userdata-hook.ts +0 -50
- package/src/user-data-rights-defaults/hooks/delivery-attempt.userdata-hook.ts +0 -36
- package/src/user-data-rights-defaults/hooks/feature-mounted.ts +0 -10
- package/src/user-data-rights-defaults/hooks/file-ref.userdata-hook.ts +0 -277
- package/src/user-data-rights-defaults/hooks/in-app-message.userdata-hook.ts +0 -37
- package/src/user-data-rights-defaults/hooks/job-run.userdata-hook.ts +0 -34
- package/src/user-data-rights-defaults/hooks/notification-preference.userdata-hook.ts +0 -53
- package/src/user-data-rights-defaults/hooks/tenant-invitation.userdata-hook.ts +0 -132
- package/src/user-data-rights-defaults/hooks/user-session.userdata-hook.ts +0 -41
- package/src/user-data-rights-defaults/hooks/user.userdata-hook.ts +0 -126
- package/src/user-data-rights-defaults/index.ts +0 -32
- package/src/user-profile/__tests__/change-email.integration.test.ts +0 -227
- package/src/user-profile/__tests__/profile-screen.boot.test.ts +0 -102
- package/src/user-profile/__tests__/profile-screen.test.tsx +0 -338
- package/src/user-profile/constants.ts +0 -35
- package/src/user-profile/feature.ts +0 -149
- package/src/user-profile/handlers/change-email.write.ts +0 -97
- package/src/user-profile/i18n.ts +0 -44
- package/src/user-profile/index.ts +0 -11
- package/src/user-profile/web/client-plugin.ts +0 -45
- package/src/user-profile/web/index.ts +0 -6
- package/src/user-profile/web/profile-screen.tsx +0 -234
- package/src/workflow-runner/__tests__/event-wakeup.integration.test.ts +0 -338
- package/src/workflow-runner/__tests__/pending-projection.integration.test.ts +0 -292
- package/src/workflow-runner/__tests__/resume-loop.integration.test.ts +0 -354
- package/src/workflow-runner/__tests__/workflow-runner.integration.test.ts +0 -307
- package/src/workflow-runner/aggregate-id.ts +0 -20
- package/src/workflow-runner/db/queries/due-runs.ts +0 -23
- package/src/workflow-runner/event-subscriber.ts +0 -93
- package/src/workflow-runner/event-trigger.ts +0 -121
- package/src/workflow-runner/feature.ts +0 -96
- package/src/workflow-runner/handlers/resume-run.write.ts +0 -355
- package/src/workflow-runner/index.ts +0 -12
- package/src/workflow-runner/pending-projection.ts +0 -148
- package/src/workflow-runner/runner.ts +0 -153
- package/src/workflow-runner/tables.ts +0 -95
- package/src/workflow-runner/workflow-registry.ts +0 -23
- /package/{src/files/feature.ts → dist/files/feature.js} +0 -0
|
@@ -1,2503 +0,0 @@
|
|
|
1
|
-
import { afterAll, beforeAll, beforeEach, describe, expect, test } from "bun:test";
|
|
2
|
-
import { deleteMany, selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
3
|
-
import { configureBlindIndexKey } from "@cosmicdrift/kumiko-framework/crypto";
|
|
4
|
-
import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
5
|
-
import {
|
|
6
|
-
buildEntityTable,
|
|
7
|
-
createEventStoreExecutor,
|
|
8
|
-
createSystemDbView,
|
|
9
|
-
createTenantDb,
|
|
10
|
-
} from "@cosmicdrift/kumiko-framework/db";
|
|
11
|
-
import {
|
|
12
|
-
createEntity,
|
|
13
|
-
createTextField,
|
|
14
|
-
defineFeature,
|
|
15
|
-
defineWriteHandler,
|
|
16
|
-
type JobContext,
|
|
17
|
-
type NotifyFn,
|
|
18
|
-
qn,
|
|
19
|
-
type TenantId,
|
|
20
|
-
} from "@cosmicdrift/kumiko-framework/engine";
|
|
21
|
-
import { createJobRunner, type JobRunner } from "@cosmicdrift/kumiko-framework/jobs";
|
|
22
|
-
import {
|
|
23
|
-
createTestUser,
|
|
24
|
-
setupTestStack,
|
|
25
|
-
type TestStack,
|
|
26
|
-
TestUsers,
|
|
27
|
-
testTenantId,
|
|
28
|
-
unsafePushTables,
|
|
29
|
-
} from "@cosmicdrift/kumiko-framework/stack";
|
|
30
|
-
import { resetBlindIndexKeyForTests, waitFor } from "@cosmicdrift/kumiko-framework/testing";
|
|
31
|
-
import * as jose from "jose";
|
|
32
|
-
import * as z from "zod";
|
|
33
|
-
import { createChannelEmailFeature } from "../../channel-email/feature";
|
|
34
|
-
import { createInMemoryTransport, type EmailMessage } from "../../channel-email/types";
|
|
35
|
-
import { InAppHandlers, InAppQueries } from "../../channel-in-app/constants";
|
|
36
|
-
import { createChannelInAppFeature } from "../../channel-in-app/feature";
|
|
37
|
-
import { inAppMessagesTable } from "../../channel-in-app/tables";
|
|
38
|
-
import { createChannelPushFeature } from "../../channel-push/feature";
|
|
39
|
-
import { createInMemoryPushTransport } from "../../channel-push/types";
|
|
40
|
-
import { createConfigFeature } from "../../config/feature";
|
|
41
|
-
import { configValuesTable } from "../../config/table";
|
|
42
|
-
import { createRendererFoundationFeature } from "../../renderer-foundation/feature";
|
|
43
|
-
import { createRendererSimpleFeature } from "../../renderer-simple/feature";
|
|
44
|
-
import { simpleRenderer } from "../../renderer-simple/simple-renderer";
|
|
45
|
-
import { createTemplateResolverFeature } from "../../template-resolver/feature";
|
|
46
|
-
import { TenantQueries } from "../../tenant/constants";
|
|
47
|
-
import { createTenantFeature } from "../../tenant/feature";
|
|
48
|
-
import { tenantMembershipsTable } from "../../tenant/membership-table";
|
|
49
|
-
import { tenantEntity } from "../../tenant/schema/tenant";
|
|
50
|
-
import {
|
|
51
|
-
addressOptOutAggregateIdForTests,
|
|
52
|
-
hashUnsubscribeAddress,
|
|
53
|
-
MAX_ADDRESS_OPT_OUT_GENERATIONS_FOR_TESTS,
|
|
54
|
-
} from "../address-opt-out";
|
|
55
|
-
import {
|
|
56
|
-
DELIVERY_RESUBSCRIBE_PATH,
|
|
57
|
-
DELIVERY_UNSUBSCRIBE_PATH,
|
|
58
|
-
DeliveryErrors,
|
|
59
|
-
DeliveryHandlers,
|
|
60
|
-
DeliveryJobs,
|
|
61
|
-
DeliveryQueries,
|
|
62
|
-
} from "../constants";
|
|
63
|
-
import { collectChannels, createDeliveryService } from "../delivery-service";
|
|
64
|
-
import { createDeliveryFeature } from "../feature";
|
|
65
|
-
import { deliveryRenderJob, deliverySendJob } from "../jobs";
|
|
66
|
-
import {
|
|
67
|
-
deliveryAttemptsTable,
|
|
68
|
-
notificationAddressOptOutEntity,
|
|
69
|
-
notificationAddressOptOutsTable,
|
|
70
|
-
notificationPreferencesTable,
|
|
71
|
-
} from "../tables";
|
|
72
|
-
import { createDeliveryTestContext } from "../testing";
|
|
73
|
-
import type { DeliveryService } from "../types";
|
|
74
|
-
import {
|
|
75
|
-
createUnsubscribeRoutes,
|
|
76
|
-
signAddressUnsubscribeToken,
|
|
77
|
-
signUnsubscribeToken,
|
|
78
|
-
} from "../unsubscribe";
|
|
79
|
-
|
|
80
|
-
// --- Setup ---
|
|
81
|
-
|
|
82
|
-
let stack: TestStack;
|
|
83
|
-
let db: DbConnection;
|
|
84
|
-
let deliveryService: DeliveryService;
|
|
85
|
-
const UNSUBSCRIBE_SECRET = "test-stack-unsubscribe-secret-32-chars-min!!";
|
|
86
|
-
|
|
87
|
-
// Mirrors a confirmation-page form submit / RFC-8058 one-click POST: token in
|
|
88
|
-
// a form-urlencoded body, same encoding both senders use.
|
|
89
|
-
function postUnsubscribe(token: string) {
|
|
90
|
-
return stack.app.request(DELIVERY_UNSUBSCRIBE_PATH, {
|
|
91
|
-
method: "POST",
|
|
92
|
-
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
93
|
-
body: `token=${encodeURIComponent(token)}`,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Mirrors the unsubscribe-page's "Undo" button: JSON body, never the query.
|
|
98
|
-
function postResubscribe(token: string) {
|
|
99
|
-
return stack.app.request(DELIVERY_RESUBSCRIBE_PATH, {
|
|
100
|
-
method: "POST",
|
|
101
|
-
headers: { "content-type": "application/json" },
|
|
102
|
-
body: JSON.stringify({ token }),
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Email test infrastructure
|
|
107
|
-
const emailTransport = createInMemoryTransport();
|
|
108
|
-
const testEmail = (userId: string | number) => `user-${userId}@test.com`;
|
|
109
|
-
|
|
110
|
-
// Push test infrastructure
|
|
111
|
-
const pushTransport = createInMemoryPushTransport();
|
|
112
|
-
const testPushToken = (userId: string | number) => `push-token-${userId}`;
|
|
113
|
-
const resolveTestEmail = async (userId: string) => testEmail(userId);
|
|
114
|
-
|
|
115
|
-
const admin = TestUsers.admin;
|
|
116
|
-
const user1 = createTestUser({ id: 2, roles: ["User"] });
|
|
117
|
-
const user2 = createTestUser({ id: 3, roles: ["User"] });
|
|
118
|
-
|
|
119
|
-
// Delivery service builds the rate-limit key as `{prefix}:{tenantId}:{channel}`
|
|
120
|
-
// — tests set / clear the key directly, so they need the real UUID value.
|
|
121
|
-
const RATE_KEY_EMAIL = `test:delivery:rate:${admin.tenantId}:email`;
|
|
122
|
-
|
|
123
|
-
// App feature that uses ctx.notify() in a handler
|
|
124
|
-
const appFeature = defineFeature("app", (r) => {
|
|
125
|
-
r.requires("delivery");
|
|
126
|
-
|
|
127
|
-
r.writeHandler(
|
|
128
|
-
defineWriteHandler({
|
|
129
|
-
name: "assignOrder",
|
|
130
|
-
schema: z.object({
|
|
131
|
-
orderId: z.number(),
|
|
132
|
-
driverId: z.string(),
|
|
133
|
-
}),
|
|
134
|
-
handler: async (event, ctx) => {
|
|
135
|
-
const notify = ctx.notify as NotifyFn;
|
|
136
|
-
await notify(qn("app", "notify", "order-assigned"), {
|
|
137
|
-
to: event.payload.driverId,
|
|
138
|
-
data: {
|
|
139
|
-
title: "Neuer Auftrag",
|
|
140
|
-
body: `Auftrag #${event.payload.orderId} wurde dir zugewiesen`,
|
|
141
|
-
orderId: event.payload.orderId,
|
|
142
|
-
},
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
return { isSuccess: true, data: { assigned: true } };
|
|
146
|
-
},
|
|
147
|
-
access: { openToAll: { reason: "test handler callable by any signed-in test user" } },
|
|
148
|
-
}),
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
r.writeHandler(
|
|
152
|
-
defineWriteHandler({
|
|
153
|
-
name: "broadcast",
|
|
154
|
-
schema: z.object({
|
|
155
|
-
message: z.string(),
|
|
156
|
-
userIds: z.array(z.string()),
|
|
157
|
-
}),
|
|
158
|
-
handler: async (event, ctx) => {
|
|
159
|
-
const notify = ctx.notify as NotifyFn;
|
|
160
|
-
await notify(qn("app", "notify", "announcement"), {
|
|
161
|
-
to: event.payload.userIds,
|
|
162
|
-
data: {
|
|
163
|
-
title: "Ankuendigung",
|
|
164
|
-
body: event.payload.message,
|
|
165
|
-
},
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
return { isSuccess: true, data: { sent: true } };
|
|
169
|
-
},
|
|
170
|
-
access: { openToAll: { reason: "test handler callable by any signed-in test user" } },
|
|
171
|
-
}),
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
// Generic notify handler that lets tests pick any notificationType from
|
|
175
|
-
// the request payload. Used by the wildcard-conflict test below so it can
|
|
176
|
-
// exercise the full HTTP→dispatcher→notify path instead of poking the
|
|
177
|
-
// deliveryService directly.
|
|
178
|
-
r.writeHandler(
|
|
179
|
-
defineWriteHandler({
|
|
180
|
-
name: "sendNotification",
|
|
181
|
-
schema: z.object({
|
|
182
|
-
notificationType: z.string(),
|
|
183
|
-
toUserId: z.string(),
|
|
184
|
-
title: z.string(),
|
|
185
|
-
body: z.string(),
|
|
186
|
-
}),
|
|
187
|
-
access: { openToAll: { reason: "test handler callable by any signed-in test user" } },
|
|
188
|
-
handler: async (event, ctx) => {
|
|
189
|
-
const notify = ctx.notify as NotifyFn;
|
|
190
|
-
await notify(event.payload.notificationType, {
|
|
191
|
-
to: event.payload.toUserId,
|
|
192
|
-
data: { title: event.payload.title, body: event.payload.body },
|
|
193
|
-
});
|
|
194
|
-
return { isSuccess: true, data: { sent: true } };
|
|
195
|
-
},
|
|
196
|
-
}),
|
|
197
|
-
);
|
|
198
|
-
|
|
199
|
-
// Tenant broadcast handler
|
|
200
|
-
r.writeHandler(
|
|
201
|
-
defineWriteHandler({
|
|
202
|
-
name: "tenantAlert",
|
|
203
|
-
schema: z.object({
|
|
204
|
-
message: z.string(),
|
|
205
|
-
tenantId: z.string(),
|
|
206
|
-
}),
|
|
207
|
-
handler: async (event, ctx) => {
|
|
208
|
-
const notify = ctx.notify as NotifyFn;
|
|
209
|
-
await notify(qn("app", "notify", "tenant-alert"), {
|
|
210
|
-
to: { tenant: event.payload.tenantId },
|
|
211
|
-
data: {
|
|
212
|
-
title: "Tenant-Warnung",
|
|
213
|
-
body: event.payload.message,
|
|
214
|
-
},
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
return { isSuccess: true, data: { sent: true } };
|
|
218
|
-
},
|
|
219
|
-
access: { openToAll: { reason: "test handler callable by any signed-in test user" } },
|
|
220
|
-
}),
|
|
221
|
-
);
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
// Feature with CRUD entity + declarative r.notification()
|
|
225
|
-
const ticketEntity = createEntity({
|
|
226
|
-
fields: {
|
|
227
|
-
title: createTextField({ required: true, personal: false, reason: "technical_reference" }),
|
|
228
|
-
assigneeId: createTextField({ personal: false, reason: "pseudonymous_fk" }),
|
|
229
|
-
status: createTextField({ required: true, personal: false, reason: "technical_reference" }),
|
|
230
|
-
},
|
|
231
|
-
});
|
|
232
|
-
const ticketTable = buildEntityTable("ticket", ticketEntity);
|
|
233
|
-
|
|
234
|
-
function ticketExecutor() {
|
|
235
|
-
return createEventStoreExecutor(ticketTable, ticketEntity, { entityName: "ticket" });
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
const ticketFeature = defineFeature("tickets", (r) => {
|
|
239
|
-
r.requires("delivery");
|
|
240
|
-
|
|
241
|
-
r.entity("ticket", ticketEntity);
|
|
242
|
-
|
|
243
|
-
// Real CRUD handler with CrudExecutor (not stub)
|
|
244
|
-
const createHandler = r.writeHandler(
|
|
245
|
-
"ticket:create",
|
|
246
|
-
z.object({
|
|
247
|
-
title: z.string(),
|
|
248
|
-
assigneeId: z.uuid().optional(),
|
|
249
|
-
status: z.string(),
|
|
250
|
-
}),
|
|
251
|
-
async (event, ctx) => ticketExecutor().create(event.payload, event.user, ctx.db),
|
|
252
|
-
{ access: { openToAll: { reason: "test handler callable by any signed-in test user" } } },
|
|
253
|
-
);
|
|
254
|
-
|
|
255
|
-
// Declarative: notify assignee when ticket is created with assigneeId
|
|
256
|
-
// Uses handler ref + per-channel templates
|
|
257
|
-
r.notification("ticketAssigned", {
|
|
258
|
-
trigger: { on: createHandler },
|
|
259
|
-
recipient: (result) => {
|
|
260
|
-
const assigneeId = result.data["assigneeId"] as string | undefined;
|
|
261
|
-
return assigneeId ?? null;
|
|
262
|
-
},
|
|
263
|
-
data: (result) => ({
|
|
264
|
-
title: "Neues Ticket",
|
|
265
|
-
body: `Ticket "${result.data["title"]}" wurde dir zugewiesen`,
|
|
266
|
-
ticketId: result.id,
|
|
267
|
-
}),
|
|
268
|
-
templates: {
|
|
269
|
-
inApp: (data) => ({
|
|
270
|
-
title: data["title"],
|
|
271
|
-
body: data["body"],
|
|
272
|
-
}),
|
|
273
|
-
email: (data) => ({
|
|
274
|
-
subject: `Ticket #${data["ticketId"]} zugewiesen`,
|
|
275
|
-
header: data["title"] as string,
|
|
276
|
-
sections: [
|
|
277
|
-
{ text: data["body"] as string },
|
|
278
|
-
{ button: { label: "Ticket oeffnen", url: `/tickets/${data["ticketId"]}` } },
|
|
279
|
-
],
|
|
280
|
-
footer: "Kumiko Notifications",
|
|
281
|
-
}),
|
|
282
|
-
},
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
// Second notification on same trigger — tests multiple notifications per handler
|
|
286
|
-
r.notification("ticketCreatedAdmin", {
|
|
287
|
-
trigger: { on: createHandler },
|
|
288
|
-
recipient: () => admin.id, // always notify admin
|
|
289
|
-
data: (result) => ({
|
|
290
|
-
title: "Ticket erstellt",
|
|
291
|
-
body: `Neues Ticket: ${result.data["title"]}`,
|
|
292
|
-
ticketId: result.id,
|
|
293
|
-
}),
|
|
294
|
-
});
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
// A tenantUserIdsQuery handler NOT declared r.systemScope() must get the same
|
|
298
|
-
// tenant-filtered ctx.db / no ctx.systemDb a real dispatch would give it —
|
|
299
|
-
// captured here so the test can assert on it directly.
|
|
300
|
-
let capturedNonSystemQueryCtx: { hasSystemDb: boolean; dbMode: string } | undefined;
|
|
301
|
-
|
|
302
|
-
const nonSystemUserIdsQueryName = "test-non-system-broadcast:query:non-system-user-ids";
|
|
303
|
-
|
|
304
|
-
const nonSystemBroadcastFeature = defineFeature("test-non-system-broadcast", (r) => {
|
|
305
|
-
r.queryHandler({
|
|
306
|
-
name: "nonSystemUserIds",
|
|
307
|
-
schema: z.object({ tenantId: z.string() }),
|
|
308
|
-
access: { roles: ["Admin"] },
|
|
309
|
-
handler: async (_query, ctx) => {
|
|
310
|
-
capturedNonSystemQueryCtx = { hasSystemDb: ctx.systemDb !== undefined, dbMode: ctx.db.mode };
|
|
311
|
-
const rows = await selectMany<{ userId: string }>(ctx.db, tenantMembershipsTable, {});
|
|
312
|
-
return rows.map((r2) => r2.userId);
|
|
313
|
-
},
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
// The dispatcher grants a systemScope handler's ctx.systemDb.unsafeRaw ungated —
|
|
318
|
-
// the grant comes from this feature's own r.systemScope() declaration, not from
|
|
319
|
-
// the delivery service caller. ctx.db stays ungated even here.
|
|
320
|
-
let capturedSystemQueryCtx:
|
|
321
|
-
| { systemDbUnsafeRawWorked: boolean; dbUnsafeRawThrew: boolean }
|
|
322
|
-
| undefined;
|
|
323
|
-
|
|
324
|
-
const systemUserIdsQueryName = "test-system-broadcast:query:system-user-ids";
|
|
325
|
-
|
|
326
|
-
const systemBroadcastFeature = defineFeature("test-system-broadcast", (r) => {
|
|
327
|
-
r.systemScope();
|
|
328
|
-
r.queryHandler({
|
|
329
|
-
name: "systemUserIds",
|
|
330
|
-
schema: z.object({ tenantId: z.string() }),
|
|
331
|
-
access: { roles: ["Admin"] },
|
|
332
|
-
handler: async (_query, ctx) => {
|
|
333
|
-
let dbUnsafeRawThrew = false;
|
|
334
|
-
try {
|
|
335
|
-
ctx.db.unsafeRaw("x");
|
|
336
|
-
} catch {
|
|
337
|
-
dbUnsafeRawThrew = true;
|
|
338
|
-
}
|
|
339
|
-
const runner = ctx.systemDb?.unsafeRaw(
|
|
340
|
-
"test: systemScope handler grants ctx.systemDb.unsafeRaw",
|
|
341
|
-
);
|
|
342
|
-
const rows = runner
|
|
343
|
-
? await selectMany<{ userId: string }>(runner, tenantMembershipsTable, {
|
|
344
|
-
tenantId: _query.payload.tenantId,
|
|
345
|
-
})
|
|
346
|
-
: undefined;
|
|
347
|
-
capturedSystemQueryCtx = {
|
|
348
|
-
systemDbUnsafeRawWorked: rows !== undefined,
|
|
349
|
-
dbUnsafeRawThrew,
|
|
350
|
-
};
|
|
351
|
-
return (rows ?? []).map((r2) => r2.userId);
|
|
352
|
-
},
|
|
353
|
-
});
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
const configFeature = createConfigFeature();
|
|
357
|
-
const tenantFeature = createTenantFeature();
|
|
358
|
-
const templateResolverFeature = createTemplateResolverFeature();
|
|
359
|
-
const rendererFoundationFeature = createRendererFoundationFeature();
|
|
360
|
-
const deliveryFeature = createDeliveryFeature();
|
|
361
|
-
const channelInAppFeature = createChannelInAppFeature();
|
|
362
|
-
const rendererSimpleFeature = createRendererSimpleFeature();
|
|
363
|
-
const channelEmailFeature = createChannelEmailFeature({
|
|
364
|
-
transport: emailTransport,
|
|
365
|
-
renderer: simpleRenderer,
|
|
366
|
-
resolveEmail: resolveTestEmail,
|
|
367
|
-
});
|
|
368
|
-
const channelPushFeature = createChannelPushFeature({
|
|
369
|
-
transport: pushTransport,
|
|
370
|
-
resolveToken: async (userId) => testPushToken(userId),
|
|
371
|
-
});
|
|
372
|
-
const features = [
|
|
373
|
-
configFeature,
|
|
374
|
-
tenantFeature,
|
|
375
|
-
templateResolverFeature,
|
|
376
|
-
rendererFoundationFeature,
|
|
377
|
-
deliveryFeature,
|
|
378
|
-
channelInAppFeature,
|
|
379
|
-
rendererSimpleFeature,
|
|
380
|
-
channelEmailFeature,
|
|
381
|
-
channelPushFeature,
|
|
382
|
-
appFeature,
|
|
383
|
-
ticketFeature,
|
|
384
|
-
nonSystemBroadcastFeature,
|
|
385
|
-
systemBroadcastFeature,
|
|
386
|
-
] as const;
|
|
387
|
-
|
|
388
|
-
beforeAll(async () => {
|
|
389
|
-
stack = await setupTestStack({
|
|
390
|
-
features,
|
|
391
|
-
extraContext: (deps) => {
|
|
392
|
-
const ctx = createDeliveryTestContext(deps, {
|
|
393
|
-
tenantUserIdsQuery: TenantQueries.resolveUserIds,
|
|
394
|
-
rateLimit: { redis: deps.redis, maxPerHour: 100, keyPrefix: "test:delivery:rate" },
|
|
395
|
-
isChannelKilled: async (tenantId, channelName) => {
|
|
396
|
-
const key = `test:delivery:kill:${tenantId}:${channelName}`;
|
|
397
|
-
return (await deps.redis.get(key)) === "1";
|
|
398
|
-
},
|
|
399
|
-
});
|
|
400
|
-
deliveryService = ctx.deliveryService;
|
|
401
|
-
return ctx;
|
|
402
|
-
},
|
|
403
|
-
extraRoutes: [...createUnsubscribeRoutes({ secret: UNSUBSCRIBE_SECRET })],
|
|
404
|
-
});
|
|
405
|
-
db = stack.db;
|
|
406
|
-
|
|
407
|
-
// deliveryAttemptsTable is auto-pushed by setupTestStack as MSP-projection-table;
|
|
408
|
-
// notificationPreferencesTable is an ES-entity, so it still needs explicit
|
|
409
|
-
// push here (entity-tables are not auto-provisioned — only projection ones).
|
|
410
|
-
await unsafePushTables(db, {
|
|
411
|
-
configValuesTable,
|
|
412
|
-
tenantMembershipsTable,
|
|
413
|
-
notificationPreferencesTable,
|
|
414
|
-
notificationAddressOptOutsTable,
|
|
415
|
-
inAppMessagesTable,
|
|
416
|
-
ticketTable,
|
|
417
|
-
});
|
|
418
|
-
|
|
419
|
-
// Create tenant entity table + seed memberships for tenant broadcast tests
|
|
420
|
-
const { unsafeCreateEntityTable } = await import("@cosmicdrift/kumiko-framework/stack");
|
|
421
|
-
await unsafeCreateEntityTable(db, tenantEntity, "tenant");
|
|
422
|
-
|
|
423
|
-
// Create tenant + members via real API
|
|
424
|
-
await stack.http.writeOk(
|
|
425
|
-
"tenant:write:create",
|
|
426
|
-
{ key: "test", name: "Test Tenant" },
|
|
427
|
-
TestUsers.systemAdmin,
|
|
428
|
-
);
|
|
429
|
-
for (const user of [admin, user1, user2]) {
|
|
430
|
-
await stack.http.writeOk(
|
|
431
|
-
"tenant:write:add-member",
|
|
432
|
-
{ userId: user.id, tenantId: "00000000-0000-4000-8000-000000000001", roles: ["User"] },
|
|
433
|
-
TestUsers.systemAdmin,
|
|
434
|
-
);
|
|
435
|
-
}
|
|
436
|
-
});
|
|
437
|
-
|
|
438
|
-
afterAll(async () => {
|
|
439
|
-
await stack.cleanup();
|
|
440
|
-
});
|
|
441
|
-
|
|
442
|
-
// Reset transient state between tests (DB state persists intentionally —
|
|
443
|
-
// tests filter explicitly. Transports + SSE events get cleared.)
|
|
444
|
-
beforeEach(() => {
|
|
445
|
-
stack.events.reset();
|
|
446
|
-
emailTransport.sent.length = 0;
|
|
447
|
-
pushTransport.sent.length = 0;
|
|
448
|
-
});
|
|
449
|
-
|
|
450
|
-
// --- Flow 1: Handler → ctx.notify() → InApp in DB + SSE + DeliveryLog ---
|
|
451
|
-
|
|
452
|
-
describe("flow 1: handler sends notification via ctx.notify()", () => {
|
|
453
|
-
test("notification creates InApp message + SSE event + DeliveryLog entries", async () => {
|
|
454
|
-
const result = await stack.http.writeOk(
|
|
455
|
-
"app:write:assign-order",
|
|
456
|
-
{ orderId: 42, driverId: user1.id },
|
|
457
|
-
admin,
|
|
458
|
-
);
|
|
459
|
-
expect(result).toEqual({ assigned: true });
|
|
460
|
-
|
|
461
|
-
// InApp message in DB
|
|
462
|
-
const messages = await selectMany(db, inAppMessagesTable, { userId: user1.id });
|
|
463
|
-
expect(messages).toHaveLength(1);
|
|
464
|
-
expect(messages[0]?.["title"]).toBe("Neuer Auftrag");
|
|
465
|
-
expect(messages[0]?.["body"]).toBe("Auftrag #42 wurde dir zugewiesen");
|
|
466
|
-
expect(messages[0]?.["isRead"]).toBe(false);
|
|
467
|
-
|
|
468
|
-
// SSE event fired
|
|
469
|
-
const sseEvents = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
470
|
-
expect(sseEvents).toHaveLength(1);
|
|
471
|
-
expect(sseEvents[0]?.data["userId"]).toBe(user1.id);
|
|
472
|
-
|
|
473
|
-
// DeliveryLog entries for all 3 channels
|
|
474
|
-
const logs = await selectMany(db, deliveryAttemptsTable, {
|
|
475
|
-
notificationType: "app:notify:order-assigned",
|
|
476
|
-
});
|
|
477
|
-
expect(logs).toHaveLength(3);
|
|
478
|
-
const channels = logs.map((l) => l["channel"]);
|
|
479
|
-
expect(channels).toContain("inApp");
|
|
480
|
-
expect(channels).toContain("email");
|
|
481
|
-
expect(channels).toContain("push");
|
|
482
|
-
expect(logs.every((l) => l["status"] === "sent")).toBe(true);
|
|
483
|
-
});
|
|
484
|
-
});
|
|
485
|
-
|
|
486
|
-
// --- Flow 2: Inbox lifecycle — query, markRead, unreadCount ---
|
|
487
|
-
|
|
488
|
-
describe("flow 2: inbox lifecycle", () => {
|
|
489
|
-
test("inbox returns user's messages", async () => {
|
|
490
|
-
const result = await stack.http.queryOk<{ rows: Record<string, unknown>[] }>(
|
|
491
|
-
InAppQueries.inbox,
|
|
492
|
-
{},
|
|
493
|
-
user1,
|
|
494
|
-
);
|
|
495
|
-
|
|
496
|
-
expect(result.rows).toHaveLength(1);
|
|
497
|
-
expect(result.rows[0]?.["title"]).toBe("Neuer Auftrag");
|
|
498
|
-
expect(result.rows[0]?.["isRead"]).toBe(false);
|
|
499
|
-
});
|
|
500
|
-
|
|
501
|
-
test("unreadCount reflects unread messages", async () => {
|
|
502
|
-
const result = await stack.http.queryOk<{ count: number }>(InAppQueries.unreadCount, {}, user1);
|
|
503
|
-
expect(result.count).toBe(1);
|
|
504
|
-
});
|
|
505
|
-
|
|
506
|
-
test("markRead marks single message as read", async () => {
|
|
507
|
-
const inbox = await stack.http.queryOk<{ rows: Record<string, unknown>[] }>(
|
|
508
|
-
InAppQueries.inbox,
|
|
509
|
-
{},
|
|
510
|
-
user1,
|
|
511
|
-
);
|
|
512
|
-
const messageId = inbox.rows[0]?.["id"] as number;
|
|
513
|
-
|
|
514
|
-
await stack.http.writeOk(InAppHandlers.markRead, { id: messageId }, user1);
|
|
515
|
-
|
|
516
|
-
const updated = await stack.http.queryOk<{ rows: Record<string, unknown>[] }>(
|
|
517
|
-
InAppQueries.inbox,
|
|
518
|
-
{},
|
|
519
|
-
user1,
|
|
520
|
-
);
|
|
521
|
-
expect(updated.rows[0]?.["isRead"]).toBe(true);
|
|
522
|
-
expect(updated.rows[0]?.["readAt"]).toBeDefined();
|
|
523
|
-
});
|
|
524
|
-
|
|
525
|
-
test("unreadCount is 0 after marking read", async () => {
|
|
526
|
-
const result = await stack.http.queryOk<{ count: number }>(InAppQueries.unreadCount, {}, user1);
|
|
527
|
-
expect(result.count).toBe(0);
|
|
528
|
-
});
|
|
529
|
-
|
|
530
|
-
test("other user sees empty inbox", async () => {
|
|
531
|
-
const result = await stack.http.queryOk<{ rows: Record<string, unknown>[] }>(
|
|
532
|
-
InAppQueries.inbox,
|
|
533
|
-
{},
|
|
534
|
-
user2,
|
|
535
|
-
);
|
|
536
|
-
expect(result.rows).toHaveLength(0);
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
test("markRead on other user's message returns not_found", async () => {
|
|
540
|
-
const inbox = await stack.http.queryOk<{ rows: Record<string, unknown>[] }>(
|
|
541
|
-
InAppQueries.inbox,
|
|
542
|
-
{},
|
|
543
|
-
user1,
|
|
544
|
-
);
|
|
545
|
-
const messageId = inbox.rows[0]?.["id"] as number;
|
|
546
|
-
|
|
547
|
-
const error = await stack.http.writeErr(InAppHandlers.markRead, { id: messageId }, user2);
|
|
548
|
-
expect(error.code).toBe("not_found");
|
|
549
|
-
});
|
|
550
|
-
});
|
|
551
|
-
|
|
552
|
-
// --- Flow 3: Broadcast + markAllRead ---
|
|
553
|
-
|
|
554
|
-
describe("flow 3: broadcast to multiple users + markAllRead", () => {
|
|
555
|
-
test("broadcast creates messages and fires SSE events for all recipients", async () => {
|
|
556
|
-
await stack.http.writeOk(
|
|
557
|
-
"app:write:broadcast",
|
|
558
|
-
{ message: "Wartung heute Nacht", userIds: [user1.id, user2.id] },
|
|
559
|
-
admin,
|
|
560
|
-
);
|
|
561
|
-
|
|
562
|
-
// Both users have messages in DB
|
|
563
|
-
for (const user of [user1, user2]) {
|
|
564
|
-
const messages = await selectMany(db, inAppMessagesTable, {
|
|
565
|
-
userId: user.id,
|
|
566
|
-
notificationType: "app:notify:announcement",
|
|
567
|
-
});
|
|
568
|
-
expect(messages).toHaveLength(1);
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
// SSE events fired for both users
|
|
572
|
-
const sseEvents = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
573
|
-
expect(sseEvents).toHaveLength(2);
|
|
574
|
-
const userIds = sseEvents.map((e) => e.data["userId"]);
|
|
575
|
-
expect(userIds).toContain(user1.id);
|
|
576
|
-
expect(userIds).toContain(user2.id);
|
|
577
|
-
});
|
|
578
|
-
|
|
579
|
-
test("delivery log has entries for all recipients and channels", async () => {
|
|
580
|
-
const logs = await selectMany(db, deliveryAttemptsTable, {
|
|
581
|
-
notificationType: "app:notify:announcement",
|
|
582
|
-
});
|
|
583
|
-
|
|
584
|
-
// 2 users × 3 channels (inApp + email + push) = 6 entries
|
|
585
|
-
expect(logs).toHaveLength(6);
|
|
586
|
-
expect(logs.every((l) => l["status"] === "sent")).toBe(true);
|
|
587
|
-
});
|
|
588
|
-
|
|
589
|
-
test("markAllRead marks all unread messages", async () => {
|
|
590
|
-
const beforeCount = await stack.http.queryOk<{ count: number }>(
|
|
591
|
-
InAppQueries.unreadCount,
|
|
592
|
-
{},
|
|
593
|
-
user1,
|
|
594
|
-
);
|
|
595
|
-
expect(beforeCount.count).toBe(1); // only announcement is unread
|
|
596
|
-
|
|
597
|
-
const result = await stack.http.writeOk<{ marked: number }>(
|
|
598
|
-
InAppHandlers.markAllRead,
|
|
599
|
-
{},
|
|
600
|
-
user1,
|
|
601
|
-
);
|
|
602
|
-
expect(result.marked).toBe(1);
|
|
603
|
-
|
|
604
|
-
const afterCount = await stack.http.queryOk<{ count: number }>(
|
|
605
|
-
InAppQueries.unreadCount,
|
|
606
|
-
{},
|
|
607
|
-
user1,
|
|
608
|
-
);
|
|
609
|
-
expect(afterCount.count).toBe(0);
|
|
610
|
-
});
|
|
611
|
-
|
|
612
|
-
test("delivery log query returns all entries (admin only)", async () => {
|
|
613
|
-
const result = await stack.http.queryOk<{ rows: Record<string, unknown>[] }>(
|
|
614
|
-
"delivery:query:log",
|
|
615
|
-
{ limit: 100 },
|
|
616
|
-
admin,
|
|
617
|
-
);
|
|
618
|
-
|
|
619
|
-
// 1 orderAssigned × 3 channels + 2 announcement × 3 channels = 9 total
|
|
620
|
-
expect(result.rows.length).toBe(9);
|
|
621
|
-
expect(result.rows[0]?.["type"]).toBe("app:notify:announcement");
|
|
622
|
-
});
|
|
623
|
-
});
|
|
624
|
-
|
|
625
|
-
// --- Flow 4: Declarative r.notification() — auto fires on CRUD handler ---
|
|
626
|
-
|
|
627
|
-
describe("flow 4: declarative notification via r.notification()", () => {
|
|
628
|
-
test("CRUD create triggers both notifications with SSE events", async () => {
|
|
629
|
-
await stack.http.writeOk(
|
|
630
|
-
"tickets:write:ticket:create",
|
|
631
|
-
{ title: "Server down", assigneeId: user1.id, status: "open" },
|
|
632
|
-
admin,
|
|
633
|
-
);
|
|
634
|
-
|
|
635
|
-
// user1 gets ticketAssigned, admin gets ticketCreatedAdmin
|
|
636
|
-
const user1Messages = await selectMany(db, inAppMessagesTable, {
|
|
637
|
-
userId: user1.id,
|
|
638
|
-
notificationType: "tickets:notify:ticket-assigned",
|
|
639
|
-
});
|
|
640
|
-
expect(user1Messages).toHaveLength(1);
|
|
641
|
-
expect(user1Messages[0]?.["title"]).toBe("Neues Ticket");
|
|
642
|
-
expect(user1Messages[0]?.["body"]).toContain("Server down");
|
|
643
|
-
|
|
644
|
-
const adminMessages = await selectMany(db, inAppMessagesTable, {
|
|
645
|
-
userId: admin.id,
|
|
646
|
-
notificationType: "tickets:notify:ticket-created-admin",
|
|
647
|
-
});
|
|
648
|
-
expect(adminMessages).toHaveLength(1);
|
|
649
|
-
expect(adminMessages[0]?.["title"]).toBe("Ticket erstellt");
|
|
650
|
-
|
|
651
|
-
// SSE events for both recipients
|
|
652
|
-
const sseEvents = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
653
|
-
expect(sseEvents).toHaveLength(2);
|
|
654
|
-
const userIds = sseEvents.map((e) => e.data["userId"]);
|
|
655
|
-
expect(userIds).toContain(user1.id);
|
|
656
|
-
expect(userIds).toContain(admin.id);
|
|
657
|
-
});
|
|
658
|
-
|
|
659
|
-
test("delivery log entries for both notifications", async () => {
|
|
660
|
-
const logs = await selectMany(db, deliveryAttemptsTable, {
|
|
661
|
-
channel: "inApp",
|
|
662
|
-
recipientId: user1.id,
|
|
663
|
-
notificationType: "tickets:notify:ticket-assigned",
|
|
664
|
-
});
|
|
665
|
-
expect(logs).toHaveLength(1);
|
|
666
|
-
expect(logs[0]?.["status"]).toBe("sent");
|
|
667
|
-
});
|
|
668
|
-
});
|
|
669
|
-
|
|
670
|
-
// --- Flow 5: recipient returns null → notification skipped ---
|
|
671
|
-
|
|
672
|
-
describe("flow 5: notification skipped when recipient is null", () => {
|
|
673
|
-
test("ticket without assigneeId skips ticketAssigned but still sends ticketCreatedAdmin", async () => {
|
|
674
|
-
stack.events.reset();
|
|
675
|
-
|
|
676
|
-
await stack.http.writeOk(
|
|
677
|
-
"tickets:write:ticket:create",
|
|
678
|
-
{ title: "Docs update", status: "open" },
|
|
679
|
-
admin,
|
|
680
|
-
);
|
|
681
|
-
|
|
682
|
-
// No ticketAssigned notification (no assignee)
|
|
683
|
-
const assigneeNotifs = await selectMany(db, inAppMessagesTable, {
|
|
684
|
-
notificationType: "tickets:notify:ticket-assigned",
|
|
685
|
-
});
|
|
686
|
-
// Only the one from flow 4 should exist
|
|
687
|
-
expect(assigneeNotifs).toHaveLength(1);
|
|
688
|
-
|
|
689
|
-
// But admin still gets ticketCreatedAdmin
|
|
690
|
-
const adminMessages = await selectMany(db, inAppMessagesTable, {
|
|
691
|
-
notificationType: "tickets:notify:ticket-created-admin",
|
|
692
|
-
});
|
|
693
|
-
expect(adminMessages).toHaveLength(2); // flow 4 + flow 5
|
|
694
|
-
|
|
695
|
-
// SSE: only 1 event (admin only, no assignee)
|
|
696
|
-
const notifs = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
697
|
-
expect(notifs).toHaveLength(1);
|
|
698
|
-
expect(notifs[0]?.data["userId"]).toBe(admin.id);
|
|
699
|
-
});
|
|
700
|
-
});
|
|
701
|
-
|
|
702
|
-
// --- Flow 6: User Preferences — disable channel, notification skipped ---
|
|
703
|
-
|
|
704
|
-
describe("flow 6: user preferences", () => {
|
|
705
|
-
test("setPreference disables inApp for a notification type", async () => {
|
|
706
|
-
await stack.http.writeOk(
|
|
707
|
-
DeliveryHandlers.setPreference,
|
|
708
|
-
{ notificationType: "app:notify:order-assigned", channel: "inApp", enabled: false },
|
|
709
|
-
user1,
|
|
710
|
-
);
|
|
711
|
-
|
|
712
|
-
// Verify preference is stored
|
|
713
|
-
const prefs = await stack.http.queryOk<{ rows: Record<string, unknown>[] }>(
|
|
714
|
-
DeliveryQueries.preferences,
|
|
715
|
-
{},
|
|
716
|
-
user1,
|
|
717
|
-
);
|
|
718
|
-
expect(prefs.rows).toHaveLength(1);
|
|
719
|
-
expect(prefs.rows[0]?.["notificationType"]).toBe("app:notify:order-assigned");
|
|
720
|
-
expect(prefs.rows[0]?.["channel"]).toBe("inApp");
|
|
721
|
-
expect(prefs.rows[0]?.["enabled"]).toBe(false);
|
|
722
|
-
});
|
|
723
|
-
|
|
724
|
-
test("notification is skipped when channel is disabled by preference", async () => {
|
|
725
|
-
stack.events.reset();
|
|
726
|
-
|
|
727
|
-
// Count messages before
|
|
728
|
-
const before = await selectMany(db, inAppMessagesTable, { userId: user1.id });
|
|
729
|
-
const beforeCount = before.length;
|
|
730
|
-
|
|
731
|
-
// Send notification to user1 who has disabled inApp for orderAssigned
|
|
732
|
-
await stack.http.writeOk("app:write:assign-order", { orderId: 99, driverId: user1.id }, admin);
|
|
733
|
-
|
|
734
|
-
// No new InApp message for user1
|
|
735
|
-
const after = await selectMany(db, inAppMessagesTable, { userId: user1.id });
|
|
736
|
-
expect(after.length).toBe(beforeCount);
|
|
737
|
-
|
|
738
|
-
// No SSE event
|
|
739
|
-
const notifs = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
740
|
-
expect(notifs).toHaveLength(0);
|
|
741
|
-
|
|
742
|
-
// DeliveryLog shows skipped with preference_disabled
|
|
743
|
-
const logs = await selectMany(db, deliveryAttemptsTable, {
|
|
744
|
-
notificationType: "app:notify:order-assigned",
|
|
745
|
-
recipientId: user1.id,
|
|
746
|
-
status: "skipped",
|
|
747
|
-
error: "preference_disabled",
|
|
748
|
-
});
|
|
749
|
-
expect(logs.length).toBeGreaterThanOrEqual(1);
|
|
750
|
-
});
|
|
751
|
-
|
|
752
|
-
test("critical priority ignores preferences", async () => {
|
|
753
|
-
stack.events.reset();
|
|
754
|
-
|
|
755
|
-
// user1 still has inApp disabled for orderAssigned
|
|
756
|
-
// But a critical notification should go through
|
|
757
|
-
await deliveryService.notify(
|
|
758
|
-
"app:notify:order-assigned",
|
|
759
|
-
{
|
|
760
|
-
to: user1.id,
|
|
761
|
-
data: { title: "CRITICAL: Order storniert", body: "Sofort reagieren" },
|
|
762
|
-
priority: "critical",
|
|
763
|
-
},
|
|
764
|
-
admin,
|
|
765
|
-
admin.tenantId,
|
|
766
|
-
);
|
|
767
|
-
|
|
768
|
-
// Should have created a message despite disabled preference
|
|
769
|
-
const notifs = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
770
|
-
expect(notifs).toHaveLength(1);
|
|
771
|
-
expect(notifs[0]?.data["title"]).toBe("CRITICAL: Order storniert");
|
|
772
|
-
});
|
|
773
|
-
|
|
774
|
-
test("re-enable preference restores delivery", async () => {
|
|
775
|
-
stack.events.reset();
|
|
776
|
-
|
|
777
|
-
// Re-enable
|
|
778
|
-
await stack.http.writeOk(
|
|
779
|
-
DeliveryHandlers.setPreference,
|
|
780
|
-
{ notificationType: "app:notify:order-assigned", channel: "inApp", enabled: true },
|
|
781
|
-
user1,
|
|
782
|
-
);
|
|
783
|
-
|
|
784
|
-
// Send notification again
|
|
785
|
-
await stack.http.writeOk("app:write:assign-order", { orderId: 100, driverId: user1.id }, admin);
|
|
786
|
-
|
|
787
|
-
// Should work again
|
|
788
|
-
const notifs = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
789
|
-
expect(notifs).toHaveLength(1);
|
|
790
|
-
expect(notifs[0]?.data["userId"]).toBe(user1.id);
|
|
791
|
-
});
|
|
792
|
-
|
|
793
|
-
test("exact preference overrides wildcard", async () => {
|
|
794
|
-
stack.events.reset();
|
|
795
|
-
|
|
796
|
-
// Disable ALL inApp notifications via wildcard
|
|
797
|
-
await stack.http.writeOk(
|
|
798
|
-
DeliveryHandlers.setPreference,
|
|
799
|
-
{ notificationType: "*", channel: "inApp", enabled: false },
|
|
800
|
-
user1,
|
|
801
|
-
);
|
|
802
|
-
|
|
803
|
-
// user1 still has { orderAssigned, inApp, enabled: true } from re-enable test
|
|
804
|
-
// Send notification — exact match (enabled: true) should win over wildcard (enabled: false)
|
|
805
|
-
await stack.http.writeOk("app:write:assign-order", { orderId: 200, driverId: user1.id }, admin);
|
|
806
|
-
|
|
807
|
-
const notifs = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
808
|
-
expect(notifs).toHaveLength(1);
|
|
809
|
-
expect(notifs[0]?.data["userId"]).toBe(user1.id);
|
|
810
|
-
|
|
811
|
-
// Clean up wildcard preference
|
|
812
|
-
await stack.http.writeOk(
|
|
813
|
-
DeliveryHandlers.setPreference,
|
|
814
|
-
{ notificationType: "*", channel: "inApp", enabled: true },
|
|
815
|
-
user1,
|
|
816
|
-
);
|
|
817
|
-
});
|
|
818
|
-
});
|
|
819
|
-
|
|
820
|
-
// --- Flow 7: Unsubscribe endpoint ---
|
|
821
|
-
|
|
822
|
-
describe("flow 7: unsubscribe endpoint", () => {
|
|
823
|
-
test("GET renders a confirmation page and writes nothing", async () => {
|
|
824
|
-
const token = await signUnsubscribeToken(
|
|
825
|
-
{
|
|
826
|
-
userId: user2.id,
|
|
827
|
-
tenantId: user2.tenantId,
|
|
828
|
-
notificationType: "app:notify:announcement",
|
|
829
|
-
channel: "inApp",
|
|
830
|
-
},
|
|
831
|
-
UNSUBSCRIBE_SECRET,
|
|
832
|
-
);
|
|
833
|
-
|
|
834
|
-
const res = await stack.app.request(`${DELIVERY_UNSUBSCRIBE_PATH}?token=${token}`);
|
|
835
|
-
expect(res.status).toBe(200);
|
|
836
|
-
const html = await res.text();
|
|
837
|
-
expect(html).toContain("<form");
|
|
838
|
-
expect(html).toContain('method="post"');
|
|
839
|
-
|
|
840
|
-
const prefs = await stack.http.queryOk<{ rows: Record<string, unknown>[] }>(
|
|
841
|
-
DeliveryQueries.preferences,
|
|
842
|
-
{},
|
|
843
|
-
user2,
|
|
844
|
-
);
|
|
845
|
-
const pref = prefs.rows.find(
|
|
846
|
-
(r) => r["notificationType"] === "app:notify:announcement" && r["channel"] === "inApp",
|
|
847
|
-
);
|
|
848
|
-
expect(pref).toBeUndefined();
|
|
849
|
-
});
|
|
850
|
-
|
|
851
|
-
test("POST with a form-urlencoded body disables the preference", async () => {
|
|
852
|
-
const token = await signUnsubscribeToken(
|
|
853
|
-
{
|
|
854
|
-
userId: user2.id,
|
|
855
|
-
tenantId: user2.tenantId,
|
|
856
|
-
notificationType: "app:notify:announcement",
|
|
857
|
-
channel: "inApp",
|
|
858
|
-
},
|
|
859
|
-
UNSUBSCRIBE_SECRET,
|
|
860
|
-
);
|
|
861
|
-
|
|
862
|
-
const res = await postUnsubscribe(token);
|
|
863
|
-
expect(res.status).toBe(200);
|
|
864
|
-
const text = await res.text();
|
|
865
|
-
expect(text).toContain("unsubscribed");
|
|
866
|
-
|
|
867
|
-
const prefs = await stack.http.queryOk<{ rows: Record<string, unknown>[] }>(
|
|
868
|
-
DeliveryQueries.preferences,
|
|
869
|
-
{},
|
|
870
|
-
user2,
|
|
871
|
-
);
|
|
872
|
-
const pref = prefs.rows.find(
|
|
873
|
-
(r) => r["notificationType"] === "app:notify:announcement" && r["channel"] === "inApp",
|
|
874
|
-
);
|
|
875
|
-
expect(pref).toBeDefined();
|
|
876
|
-
expect(pref?.["enabled"]).toBe(false);
|
|
877
|
-
});
|
|
878
|
-
|
|
879
|
-
test("RFC 8058 one-click POST (token in query, List-Unsubscribe=One-Click body) disables the preference", async () => {
|
|
880
|
-
const token = await signUnsubscribeToken(
|
|
881
|
-
{
|
|
882
|
-
userId: user2.id,
|
|
883
|
-
tenantId: user2.tenantId,
|
|
884
|
-
notificationType: "app:notify:one-click",
|
|
885
|
-
channel: "inApp",
|
|
886
|
-
},
|
|
887
|
-
UNSUBSCRIBE_SECRET,
|
|
888
|
-
);
|
|
889
|
-
|
|
890
|
-
const res = await stack.app.request(`${DELIVERY_UNSUBSCRIBE_PATH}?token=${token}`, {
|
|
891
|
-
method: "POST",
|
|
892
|
-
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
893
|
-
body: "List-Unsubscribe=One-Click",
|
|
894
|
-
});
|
|
895
|
-
expect(res.status).toBe(200);
|
|
896
|
-
|
|
897
|
-
const prefs = await stack.http.queryOk<{ rows: Record<string, unknown>[] }>(
|
|
898
|
-
DeliveryQueries.preferences,
|
|
899
|
-
{},
|
|
900
|
-
user2,
|
|
901
|
-
);
|
|
902
|
-
const pref = prefs.rows.find(
|
|
903
|
-
(r) => r["notificationType"] === "app:notify:one-click" && r["channel"] === "inApp",
|
|
904
|
-
);
|
|
905
|
-
expect(pref).toBeDefined();
|
|
906
|
-
expect(pref?.["enabled"]).toBe(false);
|
|
907
|
-
});
|
|
908
|
-
|
|
909
|
-
test("preference row belongs to the token's userId, not the dispatching system user", async () => {
|
|
910
|
-
const token = await signUnsubscribeToken(
|
|
911
|
-
{
|
|
912
|
-
userId: user1.id,
|
|
913
|
-
tenantId: user1.tenantId,
|
|
914
|
-
notificationType: "app:notify:flow7-actor-check",
|
|
915
|
-
channel: "inApp",
|
|
916
|
-
},
|
|
917
|
-
UNSUBSCRIBE_SECRET,
|
|
918
|
-
);
|
|
919
|
-
|
|
920
|
-
const res = await postUnsubscribe(token);
|
|
921
|
-
expect(res.status).toBe(200);
|
|
922
|
-
|
|
923
|
-
const rows = await selectMany(db, notificationPreferencesTable, {
|
|
924
|
-
userId: user1.id,
|
|
925
|
-
notificationType: "app:notify:flow7-actor-check",
|
|
926
|
-
channel: "inApp",
|
|
927
|
-
});
|
|
928
|
-
expect(rows).toHaveLength(1);
|
|
929
|
-
expect(rows[0]?.["enabled"]).toBe(false);
|
|
930
|
-
});
|
|
931
|
-
|
|
932
|
-
test("invalid token returns 400 for both GET and POST", async () => {
|
|
933
|
-
const getRes = await stack.app.request(`${DELIVERY_UNSUBSCRIBE_PATH}?token=invalid-jwt-token`);
|
|
934
|
-
expect(getRes.status).toBe(400);
|
|
935
|
-
const getBody = (await getRes.json()) as { error?: { code?: string } };
|
|
936
|
-
expect(getBody.error?.code).toBe("unsubscribe_token_invalid");
|
|
937
|
-
|
|
938
|
-
const postRes = await postUnsubscribe("invalid-jwt-token");
|
|
939
|
-
expect(postRes.status).toBe(400);
|
|
940
|
-
const postBody = (await postRes.json()) as { error?: { code?: string } };
|
|
941
|
-
expect(postBody.error?.code).toBe("unsubscribe_token_invalid");
|
|
942
|
-
});
|
|
943
|
-
|
|
944
|
-
test("missing token returns 400 for both GET and POST", async () => {
|
|
945
|
-
const getRes = await stack.app.request(DELIVERY_UNSUBSCRIBE_PATH);
|
|
946
|
-
expect(getRes.status).toBe(400);
|
|
947
|
-
|
|
948
|
-
const postRes = await stack.app.request(DELIVERY_UNSUBSCRIBE_PATH, { method: "POST" });
|
|
949
|
-
expect(postRes.status).toBe(400);
|
|
950
|
-
});
|
|
951
|
-
|
|
952
|
-
test("normal user cannot dispatch the unsubscribe write handlers directly", async () => {
|
|
953
|
-
const error = await stack.http.writeErr(
|
|
954
|
-
DeliveryHandlers.unsubscribeAddress,
|
|
955
|
-
{ addressHash: "x".repeat(32), notificationType: "app:notify:direct-call", channel: "email" },
|
|
956
|
-
user1,
|
|
957
|
-
);
|
|
958
|
-
expect(error.code).toBe("access_denied");
|
|
959
|
-
|
|
960
|
-
const rows = await selectMany(db, notificationAddressOptOutsTable, {
|
|
961
|
-
notificationType: "app:notify:direct-call",
|
|
962
|
-
channel: "email",
|
|
963
|
-
});
|
|
964
|
-
expect(rows).toHaveLength(0);
|
|
965
|
-
|
|
966
|
-
const userError = await stack.http.writeErr(
|
|
967
|
-
DeliveryHandlers.unsubscribeUser,
|
|
968
|
-
{ userId: user2.id, notificationType: "app:notify:direct-call", channel: "email" },
|
|
969
|
-
user1,
|
|
970
|
-
);
|
|
971
|
-
expect(userError.code).toBe("access_denied");
|
|
972
|
-
|
|
973
|
-
const preferenceRows = await selectMany(db, notificationPreferencesTable, {
|
|
974
|
-
userId: user2.id,
|
|
975
|
-
notificationType: "app:notify:direct-call",
|
|
976
|
-
});
|
|
977
|
-
expect(preferenceRows).toHaveLength(0);
|
|
978
|
-
});
|
|
979
|
-
|
|
980
|
-
test("wrong issuer is rejected with the generic invalid-token code, not a jose error text", async () => {
|
|
981
|
-
const tamperedIssuer = await new jose.SignJWT({
|
|
982
|
-
tenantId: user2.tenantId,
|
|
983
|
-
notificationType: "app:notify:wrong-issuer",
|
|
984
|
-
channel: "inApp",
|
|
985
|
-
})
|
|
986
|
-
.setProtectedHeader({ alg: "HS256" })
|
|
987
|
-
.setSubject(user2.id)
|
|
988
|
-
.setIssuer("not-kumiko:unsubscribe")
|
|
989
|
-
.setIssuedAt()
|
|
990
|
-
.sign(new TextEncoder().encode(UNSUBSCRIBE_SECRET));
|
|
991
|
-
|
|
992
|
-
const res = await postUnsubscribe(tamperedIssuer);
|
|
993
|
-
expect(res.status).toBe(400);
|
|
994
|
-
const body = (await res.json()) as { error?: { code?: string; message?: string } };
|
|
995
|
-
expect(body.error?.code).toBe("unsubscribe_token_invalid");
|
|
996
|
-
expect(JSON.stringify(body)).not.toContain("signature verification failed");
|
|
997
|
-
expect(JSON.stringify(body)).not.toContain("claim");
|
|
998
|
-
|
|
999
|
-
const rows = await selectMany(db, notificationPreferencesTable, {
|
|
1000
|
-
userId: user2.id,
|
|
1001
|
-
notificationType: "app:notify:wrong-issuer",
|
|
1002
|
-
channel: "inApp",
|
|
1003
|
-
});
|
|
1004
|
-
expect(rows).toHaveLength(0);
|
|
1005
|
-
});
|
|
1006
|
-
|
|
1007
|
-
test("a real stack session JWT is rejected at the unsubscribe route", async () => {
|
|
1008
|
-
const sessionToken = await stack.jwt.sign(user1);
|
|
1009
|
-
const res = await postUnsubscribe(sessionToken);
|
|
1010
|
-
expect(res.status).toBe(400);
|
|
1011
|
-
const body = (await res.json()) as { error?: { code?: string } };
|
|
1012
|
-
expect(body.error?.code).toBe("unsubscribe_token_invalid");
|
|
1013
|
-
});
|
|
1014
|
-
});
|
|
1015
|
-
|
|
1016
|
-
// --- Flow 9: Email Channel + Renderer end-to-end ---
|
|
1017
|
-
|
|
1018
|
-
describe("flow 9: email channel with renderer", () => {
|
|
1019
|
-
test("declarative notification fires on all channels with rendered email", async () => {
|
|
1020
|
-
// Create ticket with assignee — triggers ticketAssigned notification
|
|
1021
|
-
await stack.http.writeOk(
|
|
1022
|
-
"tickets:write:ticket:create",
|
|
1023
|
-
{ title: "Login kaputt", assigneeId: user1.id, status: "open" },
|
|
1024
|
-
admin,
|
|
1025
|
-
);
|
|
1026
|
-
|
|
1027
|
-
// Email sent via transport with rendered HTML
|
|
1028
|
-
const emails = emailTransport.sent.filter((e) => e.to === testEmail(user1.id));
|
|
1029
|
-
expect(emails).toHaveLength(1);
|
|
1030
|
-
const email = emails[0] as EmailMessage;
|
|
1031
|
-
expect(email.subject).toMatch(/Ticket #[0-9a-f-]+ zugewiesen/);
|
|
1032
|
-
expect(email.html).toContain("Neues Ticket");
|
|
1033
|
-
expect(email.html).toContain("Login kaputt");
|
|
1034
|
-
expect(email.html).toContain("Ticket oeffnen");
|
|
1035
|
-
expect(email.html).toContain("/tickets/");
|
|
1036
|
-
expect(email.html).toContain("<!DOCTYPE html>");
|
|
1037
|
-
expect(email.html).toContain("</html>");
|
|
1038
|
-
|
|
1039
|
-
// InApp also fired — ticketAssigned for user1 + ticketCreatedAdmin for admin
|
|
1040
|
-
const sseEvents = stack.events.sse.filter(
|
|
1041
|
-
(e) => e.type === "channel-in-app:event:delivered" && e.data["title"] === "Neues Ticket",
|
|
1042
|
-
);
|
|
1043
|
-
expect(sseEvents.length).toBeGreaterThanOrEqual(1);
|
|
1044
|
-
});
|
|
1045
|
-
|
|
1046
|
-
test("delivery log has entries for both channels", async () => {
|
|
1047
|
-
const logs = await selectMany(db, deliveryAttemptsTable, {
|
|
1048
|
-
notificationType: "tickets:notify:ticket-assigned",
|
|
1049
|
-
});
|
|
1050
|
-
|
|
1051
|
-
const channels = logs.map((l) => l["channel"]);
|
|
1052
|
-
expect(channels).toContain("inApp");
|
|
1053
|
-
expect(channels).toContain("email");
|
|
1054
|
-
});
|
|
1055
|
-
|
|
1056
|
-
test("notification without email template skips email rendering", async () => {
|
|
1057
|
-
emailTransport.sent.length = 0;
|
|
1058
|
-
|
|
1059
|
-
// The manual app.assignOrder handler has no email template
|
|
1060
|
-
await stack.http.writeOk("app:write:assign-order", { orderId: 300, driverId: user1.id }, admin);
|
|
1061
|
-
|
|
1062
|
-
// Email still sent (fallback to plain text) since email channel resolves the user
|
|
1063
|
-
const emails = emailTransport.sent.filter((e) => e.to === testEmail(user1.id));
|
|
1064
|
-
expect(emails).toHaveLength(1);
|
|
1065
|
-
// But it uses the simple fallback (title as h1)
|
|
1066
|
-
// Renderer always runs — falls back to title/body as header + section
|
|
1067
|
-
expect(emails[0]?.html).toContain("<!DOCTYPE html>");
|
|
1068
|
-
expect(emails[0]?.html).toContain("<h1"); // title as header
|
|
1069
|
-
expect(emails[0]?.html).toContain("Neuer Auftrag");
|
|
1070
|
-
});
|
|
1071
|
-
});
|
|
1072
|
-
|
|
1073
|
-
// --- Flow 10: Complete end-to-end path ---
|
|
1074
|
-
// CRUD → postSave → r.notification() with templates → both channels → DB + SSE + Email + Log
|
|
1075
|
-
|
|
1076
|
-
describe("flow 10: complete end-to-end", () => {
|
|
1077
|
-
test("single CRUD operation triggers InApp + Email with per-channel templates", async () => {
|
|
1078
|
-
stack.events.reset();
|
|
1079
|
-
emailTransport.sent.length = 0;
|
|
1080
|
-
|
|
1081
|
-
// Create ticket with assignee — fires ticketAssigned notification
|
|
1082
|
-
// which has both inApp and email templates defined
|
|
1083
|
-
await stack.http.writeOk(
|
|
1084
|
-
"tickets:write:ticket:create",
|
|
1085
|
-
{ title: "Datenbank Backup fehlgeschlagen", assigneeId: user2.id, status: "critical" },
|
|
1086
|
-
admin,
|
|
1087
|
-
);
|
|
1088
|
-
|
|
1089
|
-
// --- InApp Channel ---
|
|
1090
|
-
|
|
1091
|
-
// InApp message in DB with template-transformed data
|
|
1092
|
-
const inAppMessages = await selectMany(db, inAppMessagesTable, {
|
|
1093
|
-
userId: user2.id,
|
|
1094
|
-
notificationType: "tickets:notify:ticket-assigned",
|
|
1095
|
-
});
|
|
1096
|
-
// Filter to this specific ticket by checking title
|
|
1097
|
-
const thisMessage = inAppMessages.find((m) =>
|
|
1098
|
-
(m["body"] as string)?.includes("Datenbank Backup"),
|
|
1099
|
-
);
|
|
1100
|
-
expect(thisMessage).toBeDefined();
|
|
1101
|
-
expect(thisMessage?.["title"]).toBe("Neues Ticket");
|
|
1102
|
-
expect(thisMessage?.["body"]).toContain("Datenbank Backup fehlgeschlagen");
|
|
1103
|
-
|
|
1104
|
-
// SSE event fired
|
|
1105
|
-
const sseNotifs = stack.events.sse.filter(
|
|
1106
|
-
(e) =>
|
|
1107
|
-
e.type === "channel-in-app:event:delivered" &&
|
|
1108
|
-
e.data["userId"] === user2.id &&
|
|
1109
|
-
e.data["title"] === "Neues Ticket",
|
|
1110
|
-
);
|
|
1111
|
-
expect(sseNotifs.length).toBeGreaterThanOrEqual(1);
|
|
1112
|
-
|
|
1113
|
-
// --- Email Channel ---
|
|
1114
|
-
|
|
1115
|
-
// Email sent via transport with rendered HTML
|
|
1116
|
-
const emails = emailTransport.sent.filter((e) => e.to === testEmail(user2.id));
|
|
1117
|
-
const thisEmail = emails.find((e) => e.html.includes("Datenbank Backup"));
|
|
1118
|
-
expect(thisEmail).toBeDefined();
|
|
1119
|
-
// Subject from email template
|
|
1120
|
-
expect(thisEmail?.subject).toMatch(/Ticket #[0-9a-f-]+ zugewiesen/);
|
|
1121
|
-
// HTML from Simple Renderer (has DOCTYPE, header, sections, button, footer)
|
|
1122
|
-
expect(thisEmail?.html).toContain("<!DOCTYPE html>");
|
|
1123
|
-
expect(thisEmail?.html).toContain("Neues Ticket"); // header
|
|
1124
|
-
expect(thisEmail?.html).toContain("Datenbank Backup fehlgeschlagen"); // text section
|
|
1125
|
-
expect(thisEmail?.html).toContain("Ticket oeffnen"); // button label
|
|
1126
|
-
expect(thisEmail?.html).toContain("/tickets/"); // button URL
|
|
1127
|
-
expect(thisEmail?.html).toContain("Kumiko Notifications"); // footer
|
|
1128
|
-
|
|
1129
|
-
// --- DeliveryLog ---
|
|
1130
|
-
|
|
1131
|
-
const logs = await selectMany(db, deliveryAttemptsTable, {
|
|
1132
|
-
notificationType: "tickets:notify:ticket-assigned",
|
|
1133
|
-
recipientId: user2.id,
|
|
1134
|
-
});
|
|
1135
|
-
// Filter to logs from this test (there may be prior entries)
|
|
1136
|
-
const inAppLog = logs.find((l) => l["channel"] === "inApp");
|
|
1137
|
-
const emailLog = logs.find((l) => l["channel"] === "email");
|
|
1138
|
-
expect(inAppLog).toBeDefined();
|
|
1139
|
-
expect(inAppLog?.["status"]).toBe("sent");
|
|
1140
|
-
expect(emailLog).toBeDefined();
|
|
1141
|
-
expect(emailLog?.["status"]).toBe("sent");
|
|
1142
|
-
expect(emailLog?.["recipientAddress"]).toBe(testEmail(user2.id));
|
|
1143
|
-
});
|
|
1144
|
-
});
|
|
1145
|
-
|
|
1146
|
-
// --- Flow 8: Tenant broadcast ---
|
|
1147
|
-
|
|
1148
|
-
describe("flow 8: tenant broadcast via to: { tenant }", () => {
|
|
1149
|
-
test("broadcasts to all users with SSE events", async () => {
|
|
1150
|
-
await stack.http.writeOk(
|
|
1151
|
-
"app:write:tenant-alert",
|
|
1152
|
-
{ message: "Server-Wartung um 22:00", tenantId: "00000000-0000-4000-8000-000000000001" },
|
|
1153
|
-
admin,
|
|
1154
|
-
);
|
|
1155
|
-
|
|
1156
|
-
// All 3 tenant users get a message
|
|
1157
|
-
const messages = await selectMany(db, inAppMessagesTable, {
|
|
1158
|
-
notificationType: "app:notify:tenant-alert",
|
|
1159
|
-
});
|
|
1160
|
-
const recipientIds = messages.map((m) => m["userId"]);
|
|
1161
|
-
expect(recipientIds).toContain(admin.id);
|
|
1162
|
-
expect(recipientIds).toContain(user1.id);
|
|
1163
|
-
expect(recipientIds).toContain(user2.id);
|
|
1164
|
-
|
|
1165
|
-
// SSE events for all 3 users
|
|
1166
|
-
const sseEvents = stack.events.sse.filter(
|
|
1167
|
-
(e) =>
|
|
1168
|
-
e.type === "channel-in-app:event:delivered" &&
|
|
1169
|
-
e.data["notificationType"] === "app:notify:tenant-alert",
|
|
1170
|
-
);
|
|
1171
|
-
expect(sseEvents).toHaveLength(3);
|
|
1172
|
-
const userIds = sseEvents.map((e) => e.data["userId"]);
|
|
1173
|
-
expect(userIds).toContain(admin.id);
|
|
1174
|
-
expect(userIds).toContain(user1.id);
|
|
1175
|
-
expect(userIds).toContain(user2.id);
|
|
1176
|
-
});
|
|
1177
|
-
|
|
1178
|
-
test("delivery log has entries for all recipients and channels", async () => {
|
|
1179
|
-
const logs = await selectMany(db, deliveryAttemptsTable, {
|
|
1180
|
-
notificationType: "app:notify:tenant-alert",
|
|
1181
|
-
});
|
|
1182
|
-
|
|
1183
|
-
// 3 users × 3 channels (inApp + email + push) = 9
|
|
1184
|
-
expect(logs).toHaveLength(9);
|
|
1185
|
-
expect(logs.every((l) => l["status"] === "sent")).toBe(true);
|
|
1186
|
-
});
|
|
1187
|
-
});
|
|
1188
|
-
|
|
1189
|
-
// --- Flow 11: Push channel end-to-end ---
|
|
1190
|
-
|
|
1191
|
-
describe("flow 11: push channel", () => {
|
|
1192
|
-
test("notification sends push via transport", async () => {
|
|
1193
|
-
pushTransport.sent.length = 0;
|
|
1194
|
-
|
|
1195
|
-
await stack.http.writeOk("app:write:assign-order", { orderId: 500, driverId: user1.id }, admin);
|
|
1196
|
-
|
|
1197
|
-
const pushes = pushTransport.sent.filter((p) => p.token === testPushToken(user1.id));
|
|
1198
|
-
expect(pushes).toHaveLength(1);
|
|
1199
|
-
expect(pushes[0]?.title).toBe("Neuer Auftrag");
|
|
1200
|
-
});
|
|
1201
|
-
});
|
|
1202
|
-
|
|
1203
|
-
// --- Flow 12: Rate limiting ---
|
|
1204
|
-
|
|
1205
|
-
describe("flow 12: rate limiting", () => {
|
|
1206
|
-
test("notifications are skipped after rate limit is reached", async () => {
|
|
1207
|
-
// Set a very low rate limit via Redis key manipulation
|
|
1208
|
-
// The rate limit key is "test:delivery:rate:{tenantId}:{channel}"
|
|
1209
|
-
// Set it to maxPerHour (100) so the next send is over limit
|
|
1210
|
-
await stack.redis.redis.set(RATE_KEY_EMAIL, "100");
|
|
1211
|
-
await stack.redis.redis.expire(RATE_KEY_EMAIL, 3600);
|
|
1212
|
-
|
|
1213
|
-
stack.events.reset();
|
|
1214
|
-
emailTransport.sent.length = 0;
|
|
1215
|
-
|
|
1216
|
-
await stack.http.writeOk("app:write:assign-order", { orderId: 501, driverId: user1.id }, admin);
|
|
1217
|
-
|
|
1218
|
-
// Email should be skipped (rate limited), but inApp + push should work
|
|
1219
|
-
const emailLogs = await selectMany(db, deliveryAttemptsTable, {
|
|
1220
|
-
notificationType: "app:notify:order-assigned",
|
|
1221
|
-
recipientId: user1.id,
|
|
1222
|
-
channel: "email",
|
|
1223
|
-
error: "rate_limited",
|
|
1224
|
-
});
|
|
1225
|
-
expect(emailLogs.length).toBeGreaterThanOrEqual(1);
|
|
1226
|
-
|
|
1227
|
-
// InApp still works
|
|
1228
|
-
const sseNotifs = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
1229
|
-
expect(sseNotifs.length).toBeGreaterThanOrEqual(1);
|
|
1230
|
-
|
|
1231
|
-
// Clean up
|
|
1232
|
-
await stack.redis.redis.del(RATE_KEY_EMAIL);
|
|
1233
|
-
});
|
|
1234
|
-
});
|
|
1235
|
-
|
|
1236
|
-
// --- Flow 12b: Rate-limit atomicity under concurrent dispatch ---
|
|
1237
|
-
|
|
1238
|
-
describe("flow 12b: rate-limit under concurrent load", () => {
|
|
1239
|
-
test("exactly maxPerHour deliveries allowed, rest rejected (no counter drift)", async () => {
|
|
1240
|
-
// Fresh counter
|
|
1241
|
-
await stack.redis.redis.del(RATE_KEY_EMAIL);
|
|
1242
|
-
|
|
1243
|
-
// Fire 250 concurrent notify calls against an email channel with max=100/h.
|
|
1244
|
-
// The atomic Lua check must allow exactly 100 through and reject 150.
|
|
1245
|
-
const CONCURRENT = 250;
|
|
1246
|
-
const MAX = 100;
|
|
1247
|
-
|
|
1248
|
-
emailTransport.sent.length = 0;
|
|
1249
|
-
stack.events.reset();
|
|
1250
|
-
|
|
1251
|
-
await Promise.all(
|
|
1252
|
-
Array.from({ length: CONCURRENT }, (_, i) =>
|
|
1253
|
-
deliveryService.notify(
|
|
1254
|
-
"app:notify:rate-race",
|
|
1255
|
-
{
|
|
1256
|
-
route: { email: `race-${i}@test.com` },
|
|
1257
|
-
data: { title: "Race", body: "Test" },
|
|
1258
|
-
},
|
|
1259
|
-
admin,
|
|
1260
|
-
admin.tenantId,
|
|
1261
|
-
),
|
|
1262
|
-
),
|
|
1263
|
-
);
|
|
1264
|
-
|
|
1265
|
-
// Exactly MAX emails actually sent. The real proof of atomicity: if the
|
|
1266
|
-
// old non-atomic INCR+DECR had a race, we'd see either MORE than MAX
|
|
1267
|
-
// (two checks both seeing count <= max and slipping through) or LESS
|
|
1268
|
-
// than MAX (DECR rolling back counts that were legitimately used).
|
|
1269
|
-
const raceEmails = emailTransport.sent.filter((e) => e.to.startsWith("race-"));
|
|
1270
|
-
expect(raceEmails.length).toBe(MAX);
|
|
1271
|
-
|
|
1272
|
-
// Redis counter must sit at exactly MAX — never above (would mean two
|
|
1273
|
-
// INCRs slipped past the check), never below (would mean a DECR rolled
|
|
1274
|
-
// back a legitimate hit).
|
|
1275
|
-
const counter = Number(await stack.redis.redis.get(RATE_KEY_EMAIL));
|
|
1276
|
-
expect(counter).toBe(MAX);
|
|
1277
|
-
|
|
1278
|
-
await stack.redis.redis.del(RATE_KEY_EMAIL);
|
|
1279
|
-
});
|
|
1280
|
-
});
|
|
1281
|
-
|
|
1282
|
-
// --- Flow 12c: Idempotency key ---
|
|
1283
|
-
|
|
1284
|
-
describe("flow 12c: idempotency key dedup", () => {
|
|
1285
|
-
test("same idempotencyKey fires only once even when called twice", async () => {
|
|
1286
|
-
emailTransport.sent.length = 0;
|
|
1287
|
-
stack.events.reset();
|
|
1288
|
-
await stack.redis.redis.del(RATE_KEY_EMAIL);
|
|
1289
|
-
|
|
1290
|
-
const idemKey = `idem-${Date.now()}`;
|
|
1291
|
-
|
|
1292
|
-
// First call: should deliver
|
|
1293
|
-
await deliveryService.notify(
|
|
1294
|
-
"app:notify:idem-test",
|
|
1295
|
-
{
|
|
1296
|
-
to: user2.id,
|
|
1297
|
-
data: { title: "Idem", body: "First" },
|
|
1298
|
-
idempotencyKey: idemKey,
|
|
1299
|
-
},
|
|
1300
|
-
admin,
|
|
1301
|
-
admin.tenantId,
|
|
1302
|
-
);
|
|
1303
|
-
|
|
1304
|
-
// Second call with same key: should be deduped → no new delivery
|
|
1305
|
-
await deliveryService.notify(
|
|
1306
|
-
"app:notify:idem-test",
|
|
1307
|
-
{
|
|
1308
|
-
to: user2.id,
|
|
1309
|
-
data: { title: "Idem", body: "Second (ignored)" },
|
|
1310
|
-
idempotencyKey: idemKey,
|
|
1311
|
-
},
|
|
1312
|
-
admin,
|
|
1313
|
-
admin.tenantId,
|
|
1314
|
-
);
|
|
1315
|
-
|
|
1316
|
-
const emails = emailTransport.sent.filter((e) => e.to === testEmail(user2.id));
|
|
1317
|
-
expect(emails.length).toBe(1);
|
|
1318
|
-
|
|
1319
|
-
// Dup attempt is recorded in the log for audit
|
|
1320
|
-
const dupLogs = await selectMany(db, deliveryAttemptsTable, {
|
|
1321
|
-
notificationType: "app:notify:idem-test",
|
|
1322
|
-
error: "duplicate_idempotency_key",
|
|
1323
|
-
});
|
|
1324
|
-
expect(dupLogs.length).toBe(1);
|
|
1325
|
-
});
|
|
1326
|
-
|
|
1327
|
-
test("different idempotencyKey fires separately", async () => {
|
|
1328
|
-
emailTransport.sent.length = 0;
|
|
1329
|
-
stack.events.reset();
|
|
1330
|
-
await stack.redis.redis.del(RATE_KEY_EMAIL);
|
|
1331
|
-
|
|
1332
|
-
const a = `idem-a-${Date.now()}`;
|
|
1333
|
-
const b = `idem-b-${Date.now()}`;
|
|
1334
|
-
|
|
1335
|
-
await deliveryService.notify(
|
|
1336
|
-
"app:notify:idem-separate",
|
|
1337
|
-
{ to: user2.id, data: { title: "A", body: "A" }, idempotencyKey: a },
|
|
1338
|
-
admin,
|
|
1339
|
-
admin.tenantId,
|
|
1340
|
-
);
|
|
1341
|
-
await deliveryService.notify(
|
|
1342
|
-
"app:notify:idem-separate",
|
|
1343
|
-
{ to: user2.id, data: { title: "B", body: "B" }, idempotencyKey: b },
|
|
1344
|
-
admin,
|
|
1345
|
-
admin.tenantId,
|
|
1346
|
-
);
|
|
1347
|
-
|
|
1348
|
-
const emails = emailTransport.sent.filter((e) => e.to === testEmail(user2.id));
|
|
1349
|
-
expect(emails.length).toBe(2);
|
|
1350
|
-
});
|
|
1351
|
-
});
|
|
1352
|
-
|
|
1353
|
-
// --- Flow 12d: Channel error paths ---
|
|
1354
|
-
|
|
1355
|
-
describe("flow 12d: channel error paths", () => {
|
|
1356
|
-
test("transport throws → delivery log status=failed with error message", async () => {
|
|
1357
|
-
emailTransport.sent.length = 0;
|
|
1358
|
-
stack.events.reset();
|
|
1359
|
-
|
|
1360
|
-
// Arm the transport to fail on the next send
|
|
1361
|
-
emailTransport.failNext = { message: "smtp_timeout_simulated" };
|
|
1362
|
-
|
|
1363
|
-
await stack.http.writeOk("app:write:assign-order", { orderId: 700, driverId: user1.id }, admin);
|
|
1364
|
-
|
|
1365
|
-
// Email was attempted but not delivered
|
|
1366
|
-
const emails = emailTransport.sent.filter((e) => e.to === testEmail(user1.id));
|
|
1367
|
-
expect(emails.length).toBe(0);
|
|
1368
|
-
|
|
1369
|
-
// Log shows the failure with the original error string
|
|
1370
|
-
const failedLogs = await selectMany(db, deliveryAttemptsTable, {
|
|
1371
|
-
notificationType: "app:notify:order-assigned",
|
|
1372
|
-
recipientId: user1.id,
|
|
1373
|
-
channel: "email",
|
|
1374
|
-
status: "failed",
|
|
1375
|
-
});
|
|
1376
|
-
expect(failedLogs.length).toBeGreaterThanOrEqual(1);
|
|
1377
|
-
expect(failedLogs.at(-1)?.["error"]).toContain("smtp_timeout_simulated");
|
|
1378
|
-
|
|
1379
|
-
// Other channels still work — one failure does not poison the rest
|
|
1380
|
-
const inAppNotifs = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
1381
|
-
expect(inAppNotifs.some((e) => e.data["userId"] === user1.id)).toBe(true);
|
|
1382
|
-
});
|
|
1383
|
-
|
|
1384
|
-
test("transport failure on one recipient does not block others", async () => {
|
|
1385
|
-
emailTransport.sent.length = 0;
|
|
1386
|
-
stack.events.reset();
|
|
1387
|
-
|
|
1388
|
-
// Fail the NEXT send — which corresponds to the first recipient processed
|
|
1389
|
-
emailTransport.failNext = { message: "smtp_transient" };
|
|
1390
|
-
|
|
1391
|
-
await stack.http.writeOk(
|
|
1392
|
-
"app:write:broadcast",
|
|
1393
|
-
{ message: "Partial outage test", userIds: [user1.id, user2.id] },
|
|
1394
|
-
admin,
|
|
1395
|
-
);
|
|
1396
|
-
|
|
1397
|
-
// Exactly one email succeeded; the other was logged as failed
|
|
1398
|
-
const broadcastEmails = emailTransport.sent.filter(
|
|
1399
|
-
(e) => e.to === testEmail(user1.id) || e.to === testEmail(user2.id),
|
|
1400
|
-
);
|
|
1401
|
-
expect(broadcastEmails.length).toBe(1);
|
|
1402
|
-
|
|
1403
|
-
const failedLogs = await selectMany(db, deliveryAttemptsTable, {
|
|
1404
|
-
notificationType: "app:notify:announcement",
|
|
1405
|
-
channel: "email",
|
|
1406
|
-
status: "failed",
|
|
1407
|
-
error: "smtp_transient",
|
|
1408
|
-
});
|
|
1409
|
-
expect(failedLogs.length).toBe(1);
|
|
1410
|
-
});
|
|
1411
|
-
});
|
|
1412
|
-
|
|
1413
|
-
// --- Flow 13: Kill switch ---
|
|
1414
|
-
|
|
1415
|
-
describe("flow 13: tenant kill switch", () => {
|
|
1416
|
-
test("killed channel is skipped with channel_disabled", async () => {
|
|
1417
|
-
// Kill the push channel for tenant 1 (UUID key matches what the service builds)
|
|
1418
|
-
await stack.redis.redis.set(`test:delivery:kill:${admin.tenantId}:push`, "1");
|
|
1419
|
-
|
|
1420
|
-
stack.events.reset();
|
|
1421
|
-
pushTransport.sent.length = 0;
|
|
1422
|
-
|
|
1423
|
-
await stack.http.writeOk("app:write:assign-order", { orderId: 502, driverId: user1.id }, admin);
|
|
1424
|
-
|
|
1425
|
-
// Push should be skipped
|
|
1426
|
-
const pushes = pushTransport.sent.filter((p) => p.token === testPushToken(user1.id));
|
|
1427
|
-
expect(pushes).toHaveLength(0);
|
|
1428
|
-
|
|
1429
|
-
// DeliveryLog shows channel_disabled
|
|
1430
|
-
const pushLogs = await selectMany(db, deliveryAttemptsTable, {
|
|
1431
|
-
notificationType: "app:notify:order-assigned",
|
|
1432
|
-
recipientId: user1.id,
|
|
1433
|
-
channel: "push",
|
|
1434
|
-
error: "channel_disabled",
|
|
1435
|
-
});
|
|
1436
|
-
expect(pushLogs.length).toBeGreaterThanOrEqual(1);
|
|
1437
|
-
|
|
1438
|
-
// InApp + Email still work
|
|
1439
|
-
const sseNotifs = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
1440
|
-
expect(sseNotifs.length).toBeGreaterThanOrEqual(1);
|
|
1441
|
-
|
|
1442
|
-
// Clean up
|
|
1443
|
-
await stack.redis.redis.del("test:delivery:kill:1:push");
|
|
1444
|
-
});
|
|
1445
|
-
});
|
|
1446
|
-
|
|
1447
|
-
// --- Flow 14: Preference wildcard conflict — deny wins ---
|
|
1448
|
-
|
|
1449
|
-
describe("flow 14: wildcard-only preference conflicts resolve deterministically", () => {
|
|
1450
|
-
test("conflicting wildcards (type=*, false vs channel=*, true) → disabled wins", async () => {
|
|
1451
|
-
// Clean slate for user2 on this type/channel
|
|
1452
|
-
await deleteMany(db, notificationPreferencesTable, { userId: user2.id });
|
|
1453
|
-
|
|
1454
|
-
// Wildcard A: disable inApp globally
|
|
1455
|
-
await stack.http.writeOk(
|
|
1456
|
-
DeliveryHandlers.setPreference,
|
|
1457
|
-
{ notificationType: "*", channel: "inApp", enabled: false },
|
|
1458
|
-
user2,
|
|
1459
|
-
);
|
|
1460
|
-
// Wildcard B: enable this specific type on every channel
|
|
1461
|
-
await stack.http.writeOk(
|
|
1462
|
-
DeliveryHandlers.setPreference,
|
|
1463
|
-
{ notificationType: "app:notify:wildcard-conflict", channel: "*", enabled: true },
|
|
1464
|
-
user2,
|
|
1465
|
-
);
|
|
1466
|
-
|
|
1467
|
-
stack.events.reset();
|
|
1468
|
-
await stack.http.writeOk(
|
|
1469
|
-
"app:write:send-notification",
|
|
1470
|
-
{
|
|
1471
|
-
notificationType: "app:notify:wildcard-conflict",
|
|
1472
|
-
toUserId: user2.id,
|
|
1473
|
-
title: "Konflikt",
|
|
1474
|
-
body: "Test",
|
|
1475
|
-
},
|
|
1476
|
-
admin,
|
|
1477
|
-
);
|
|
1478
|
-
|
|
1479
|
-
// No InApp delivery — "disabled wins" over the enabling wildcard
|
|
1480
|
-
const inAppEvents = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
1481
|
-
expect(inAppEvents.filter((e) => e.data["userId"] === user2.id)).toHaveLength(0);
|
|
1482
|
-
|
|
1483
|
-
const skipped = await selectMany(db, deliveryAttemptsTable, {
|
|
1484
|
-
notificationType: "app:notify:wildcard-conflict",
|
|
1485
|
-
recipientId: user2.id,
|
|
1486
|
-
channel: "inApp",
|
|
1487
|
-
error: "preference_disabled",
|
|
1488
|
-
});
|
|
1489
|
-
expect(skipped.length).toBeGreaterThanOrEqual(1);
|
|
1490
|
-
});
|
|
1491
|
-
|
|
1492
|
-
test("exact-match preference still punches through both wildcards", async () => {
|
|
1493
|
-
// Keep the two conflicting wildcards from the previous test, add an exact override
|
|
1494
|
-
await stack.http.writeOk(
|
|
1495
|
-
DeliveryHandlers.setPreference,
|
|
1496
|
-
{
|
|
1497
|
-
notificationType: "app:notify:wildcard-conflict",
|
|
1498
|
-
channel: "inApp",
|
|
1499
|
-
enabled: true,
|
|
1500
|
-
},
|
|
1501
|
-
user2,
|
|
1502
|
-
);
|
|
1503
|
-
|
|
1504
|
-
stack.events.reset();
|
|
1505
|
-
await stack.http.writeOk(
|
|
1506
|
-
"app:write:send-notification",
|
|
1507
|
-
{
|
|
1508
|
-
notificationType: "app:notify:wildcard-conflict",
|
|
1509
|
-
toUserId: user2.id,
|
|
1510
|
-
title: "Konflikt",
|
|
1511
|
-
body: "Override",
|
|
1512
|
-
},
|
|
1513
|
-
admin,
|
|
1514
|
-
);
|
|
1515
|
-
|
|
1516
|
-
const inAppEvents = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
1517
|
-
expect(inAppEvents.filter((e) => e.data["userId"] === user2.id)).toHaveLength(1);
|
|
1518
|
-
|
|
1519
|
-
// Clean up for later tests
|
|
1520
|
-
await deleteMany(db, notificationPreferencesTable, { userId: user2.id });
|
|
1521
|
-
});
|
|
1522
|
-
});
|
|
1523
|
-
|
|
1524
|
-
// --- Flow 15: Idempotency without Redis throws (no silent no-op) ---
|
|
1525
|
-
|
|
1526
|
-
describe("flow 15: idempotency requires Redis", () => {
|
|
1527
|
-
test("notify() throws when idempotencyKey is used without a Redis handle", async () => {
|
|
1528
|
-
// Build a service with no rateLimit and no idempotencyRedis.
|
|
1529
|
-
// sseBroker is left off — the throw happens before channel dispatch.
|
|
1530
|
-
const bareService = createDeliveryService({
|
|
1531
|
-
db,
|
|
1532
|
-
registry: stack.registry,
|
|
1533
|
-
channels: collectChannels(stack.registry),
|
|
1534
|
-
tenantUserIdsQuery: TenantQueries.resolveUserIds,
|
|
1535
|
-
});
|
|
1536
|
-
|
|
1537
|
-
await expect(
|
|
1538
|
-
bareService.notify(
|
|
1539
|
-
"app:notify:idem-no-redis",
|
|
1540
|
-
{
|
|
1541
|
-
to: user2.id,
|
|
1542
|
-
data: { title: "X", body: "X" },
|
|
1543
|
-
idempotencyKey: "key-without-redis",
|
|
1544
|
-
},
|
|
1545
|
-
admin,
|
|
1546
|
-
admin.tenantId,
|
|
1547
|
-
),
|
|
1548
|
-
).rejects.toThrow(/idempotencyRedis/);
|
|
1549
|
-
});
|
|
1550
|
-
});
|
|
1551
|
-
|
|
1552
|
-
// --- Flow 15b: escape-hatch audit attribution for tenant-broadcast resolveUserIdsForTenant ---
|
|
1553
|
-
|
|
1554
|
-
describe("flow 15b: escape-hatch audit for tenant broadcast", () => {
|
|
1555
|
-
test("recording sink receives an acknowledge-cross-tenant event attributed to tenantUserIdsQuery", async () => {
|
|
1556
|
-
const recorded: import("@cosmicdrift/kumiko-framework/engine").EscapeHatchUseEvent[] = [];
|
|
1557
|
-
const auditedService = createDeliveryService({
|
|
1558
|
-
db,
|
|
1559
|
-
registry: stack.registry,
|
|
1560
|
-
channels: collectChannels(stack.registry),
|
|
1561
|
-
tenantUserIdsQuery: TenantQueries.resolveUserIds,
|
|
1562
|
-
escapeHatchAuditSink: async (event) => {
|
|
1563
|
-
recorded.push(event);
|
|
1564
|
-
},
|
|
1565
|
-
});
|
|
1566
|
-
|
|
1567
|
-
// Distinct tenantId (not used by any earlier test in this file) — the
|
|
1568
|
-
// module-level escape-hatch dedup window suppresses a repeat report for
|
|
1569
|
-
// an identical (handler, kind, reason, tenantId, actor) tuple within 60s,
|
|
1570
|
-
// which would otherwise make this assertion flaky depending on test order.
|
|
1571
|
-
const auditTenantId = testTenantId(915501);
|
|
1572
|
-
|
|
1573
|
-
await auditedService.notify(
|
|
1574
|
-
"app:notify:tenant-alert",
|
|
1575
|
-
{ to: { tenant: auditTenantId }, data: { title: "X", body: "X" } },
|
|
1576
|
-
admin,
|
|
1577
|
-
admin.tenantId,
|
|
1578
|
-
);
|
|
1579
|
-
|
|
1580
|
-
const event = recorded.find((e) => e.kind === "acknowledge-cross-tenant");
|
|
1581
|
-
expect(event?.handler).toBe(TenantQueries.resolveUserIds);
|
|
1582
|
-
expect(event?.tenantId).toBe(auditTenantId);
|
|
1583
|
-
});
|
|
1584
|
-
});
|
|
1585
|
-
|
|
1586
|
-
// --- Flow 15c: tenantUserIdsQuery that is NOT r.systemScope() ---
|
|
1587
|
-
|
|
1588
|
-
describe("flow 15c: tenantUserIdsQuery handler without r.systemScope()", () => {
|
|
1589
|
-
test("gets a tenant-mode db and no systemDb, and the broadcast still resolves recipients", async () => {
|
|
1590
|
-
const nonSystemService = createDeliveryService({
|
|
1591
|
-
db,
|
|
1592
|
-
registry: stack.registry,
|
|
1593
|
-
channels: collectChannels(stack.registry),
|
|
1594
|
-
tenantUserIdsQuery: nonSystemUserIdsQueryName,
|
|
1595
|
-
});
|
|
1596
|
-
|
|
1597
|
-
// Unique title — flow 8 already broadcasts app:notify:tenant-alert to the same
|
|
1598
|
-
// admin/user1/user2, so a plain notificationType filter would pass even if this
|
|
1599
|
-
// service delivered nothing new. Filtering by this test's own title isolates it.
|
|
1600
|
-
const nonSystemBroadcastTitle = "non-system-broadcast-flow-15c";
|
|
1601
|
-
await nonSystemService.notify(
|
|
1602
|
-
"app:notify:tenant-alert",
|
|
1603
|
-
{ to: { tenant: admin.tenantId }, data: { title: nonSystemBroadcastTitle, body: "X" } },
|
|
1604
|
-
admin,
|
|
1605
|
-
admin.tenantId,
|
|
1606
|
-
);
|
|
1607
|
-
|
|
1608
|
-
expect(capturedNonSystemQueryCtx).toEqual({ hasSystemDb: false, dbMode: "tenant" });
|
|
1609
|
-
|
|
1610
|
-
const messages = await selectMany(db, inAppMessagesTable, {
|
|
1611
|
-
notificationType: "app:notify:tenant-alert",
|
|
1612
|
-
title: nonSystemBroadcastTitle,
|
|
1613
|
-
});
|
|
1614
|
-
const recipientIds = messages.map((m) => m["userId"]);
|
|
1615
|
-
expect(recipientIds).toContain(admin.id);
|
|
1616
|
-
expect(recipientIds).toContain(user1.id);
|
|
1617
|
-
expect(recipientIds).toContain(user2.id);
|
|
1618
|
-
});
|
|
1619
|
-
});
|
|
1620
|
-
|
|
1621
|
-
// --- Flow 15d: tenantUserIdsQuery that IS r.systemScope() ---
|
|
1622
|
-
|
|
1623
|
-
describe("flow 15d: tenantUserIdsQuery handler with r.systemScope()", () => {
|
|
1624
|
-
test("ctx.systemDb.unsafeRaw works, ctx.db.unsafeRaw is denied, broadcast still resolves recipients", async () => {
|
|
1625
|
-
const systemService = createDeliveryService({
|
|
1626
|
-
db,
|
|
1627
|
-
registry: stack.registry,
|
|
1628
|
-
channels: collectChannels(stack.registry),
|
|
1629
|
-
tenantUserIdsQuery: systemUserIdsQueryName,
|
|
1630
|
-
});
|
|
1631
|
-
|
|
1632
|
-
const systemBroadcastTitle = "system-broadcast-flow-15d";
|
|
1633
|
-
await systemService.notify(
|
|
1634
|
-
"app:notify:tenant-alert",
|
|
1635
|
-
{ to: { tenant: admin.tenantId }, data: { title: systemBroadcastTitle, body: "X" } },
|
|
1636
|
-
admin,
|
|
1637
|
-
admin.tenantId,
|
|
1638
|
-
);
|
|
1639
|
-
|
|
1640
|
-
expect(capturedSystemQueryCtx).toEqual({
|
|
1641
|
-
systemDbUnsafeRawWorked: true,
|
|
1642
|
-
dbUnsafeRawThrew: true,
|
|
1643
|
-
});
|
|
1644
|
-
|
|
1645
|
-
const messages = await selectMany(db, inAppMessagesTable, {
|
|
1646
|
-
notificationType: "app:notify:tenant-alert",
|
|
1647
|
-
title: systemBroadcastTitle,
|
|
1648
|
-
});
|
|
1649
|
-
const recipientIds = messages.map((m) => m["userId"]);
|
|
1650
|
-
expect(recipientIds).toContain(admin.id);
|
|
1651
|
-
expect(recipientIds).toContain(user1.id);
|
|
1652
|
-
expect(recipientIds).toContain(user2.id);
|
|
1653
|
-
});
|
|
1654
|
-
});
|
|
1655
|
-
|
|
1656
|
-
// --- Flow 16: Unsubscribe race — ON CONFLICT makes repeated clicks safe ---
|
|
1657
|
-
|
|
1658
|
-
describe("flow 16: repeated unsubscribe clicks are idempotent", () => {
|
|
1659
|
-
test("clicking the same unsubscribe link twice concurrently does not error", async () => {
|
|
1660
|
-
const token = await signUnsubscribeToken(
|
|
1661
|
-
{
|
|
1662
|
-
userId: user1.id,
|
|
1663
|
-
tenantId: user1.tenantId,
|
|
1664
|
-
notificationType: "app:notify:concurrent-unsub",
|
|
1665
|
-
channel: "email",
|
|
1666
|
-
},
|
|
1667
|
-
UNSUBSCRIBE_SECRET,
|
|
1668
|
-
);
|
|
1669
|
-
|
|
1670
|
-
const results = await Promise.all([
|
|
1671
|
-
postUnsubscribe(token),
|
|
1672
|
-
postUnsubscribe(token),
|
|
1673
|
-
postUnsubscribe(token),
|
|
1674
|
-
]);
|
|
1675
|
-
|
|
1676
|
-
// All three requests complete with 200 — no duplicate-key crashes
|
|
1677
|
-
for (const res of results) {
|
|
1678
|
-
expect(res.status).toBe(200);
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
// Exactly one row exists, marked disabled
|
|
1682
|
-
const rows = await selectMany(db, notificationPreferencesTable, {
|
|
1683
|
-
userId: user1.id,
|
|
1684
|
-
notificationType: "app:notify:concurrent-unsub",
|
|
1685
|
-
channel: "email",
|
|
1686
|
-
});
|
|
1687
|
-
expect(rows).toHaveLength(1);
|
|
1688
|
-
expect(rows[0]?.["enabled"]).toBe(false);
|
|
1689
|
-
});
|
|
1690
|
-
});
|
|
1691
|
-
|
|
1692
|
-
// --- Flow 17: async delivery via delivery.render → delivery.send jobs ---
|
|
1693
|
-
|
|
1694
|
-
// Dedicated recipient id, untouched by earlier tests, so no stale preference
|
|
1695
|
-
// or unsubscribe row disables a channel under us. String id — notify() treats a
|
|
1696
|
-
// non-string `to` as a broadcast target ("tenant" in to).
|
|
1697
|
-
const asyncRecipient = "7";
|
|
1698
|
-
|
|
1699
|
-
function makeStubRunner(): {
|
|
1700
|
-
runner: JobRunner;
|
|
1701
|
-
dispatched: Array<{
|
|
1702
|
-
name: string;
|
|
1703
|
-
payload: Record<string, unknown>;
|
|
1704
|
-
meta?: Record<string, unknown>;
|
|
1705
|
-
}>;
|
|
1706
|
-
} {
|
|
1707
|
-
const dispatched: Array<{
|
|
1708
|
-
name: string;
|
|
1709
|
-
payload: Record<string, unknown>;
|
|
1710
|
-
meta?: Record<string, unknown>;
|
|
1711
|
-
}> = [];
|
|
1712
|
-
const runner = {
|
|
1713
|
-
async start() {},
|
|
1714
|
-
async stop() {},
|
|
1715
|
-
async dispatch(
|
|
1716
|
-
name: string,
|
|
1717
|
-
payload?: Record<string, unknown>,
|
|
1718
|
-
meta?: Record<string, unknown>,
|
|
1719
|
-
) {
|
|
1720
|
-
dispatched.push({ name, payload: payload ?? {}, ...(meta !== undefined && { meta }) });
|
|
1721
|
-
return "stub-job-id";
|
|
1722
|
-
},
|
|
1723
|
-
async handleEvent() {},
|
|
1724
|
-
} as unknown as JobRunner;
|
|
1725
|
-
return { runner, dispatched };
|
|
1726
|
-
}
|
|
1727
|
-
|
|
1728
|
-
describe("flow 17: async render→send pipeline", () => {
|
|
1729
|
-
test("with a real job runner, email + push deliver via delivery.render → delivery.send", async () => {
|
|
1730
|
-
const redisUrl = process.env["REDIS_URL"];
|
|
1731
|
-
if (!redisUrl) throw new Error("REDIS_URL required for the async delivery e2e test");
|
|
1732
|
-
const queueNamePrefix = `kumiko-delivery-test-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
1733
|
-
const jobRunner = createJobRunner({
|
|
1734
|
-
registry: stack.registry,
|
|
1735
|
-
context: { db },
|
|
1736
|
-
redisUrl,
|
|
1737
|
-
consumerLane: "worker",
|
|
1738
|
-
queueNamePrefix,
|
|
1739
|
-
});
|
|
1740
|
-
await jobRunner.start();
|
|
1741
|
-
try {
|
|
1742
|
-
const asyncService = createDeliveryService({
|
|
1743
|
-
db,
|
|
1744
|
-
registry: stack.registry,
|
|
1745
|
-
channels: collectChannels(stack.registry),
|
|
1746
|
-
tenantUserIdsQuery: TenantQueries.resolveUserIds,
|
|
1747
|
-
jobRunner,
|
|
1748
|
-
});
|
|
1749
|
-
|
|
1750
|
-
await asyncService.notify(
|
|
1751
|
-
"app:notify:async-e2e",
|
|
1752
|
-
{
|
|
1753
|
-
to: asyncRecipient,
|
|
1754
|
-
data: { title: "Async", body: "delivered via jobs", subject: "Async Subject" },
|
|
1755
|
-
},
|
|
1756
|
-
admin,
|
|
1757
|
-
admin.tenantId,
|
|
1758
|
-
);
|
|
1759
|
-
|
|
1760
|
-
// Email: queued → render job → send job → sent. Proves the framework
|
|
1761
|
-
// jobRunner-into-job-ctx injection (render dispatches send) end-to-end.
|
|
1762
|
-
await waitFor(
|
|
1763
|
-
async () => {
|
|
1764
|
-
const rows = await selectMany(db, deliveryAttemptsTable, {
|
|
1765
|
-
notificationType: "app:notify:async-e2e",
|
|
1766
|
-
channel: "email",
|
|
1767
|
-
});
|
|
1768
|
-
expect(rows.some((r) => r["status"] === "sent")).toBe(true);
|
|
1769
|
-
},
|
|
1770
|
-
{ delays: Array(40).fill(250) },
|
|
1771
|
-
);
|
|
1772
|
-
const email = emailTransport.sent.find((m) => m.to === testEmail(asyncRecipient));
|
|
1773
|
-
expect(email).toBeDefined();
|
|
1774
|
-
expect(email?.subject).toBe("Async Subject");
|
|
1775
|
-
expect(email?.html).toContain("delivered via jobs");
|
|
1776
|
-
expect(email?.html).toContain("<!DOCTYPE html>");
|
|
1777
|
-
|
|
1778
|
-
// Push: no render step → dispatched straight to delivery.send.
|
|
1779
|
-
await waitFor(
|
|
1780
|
-
async () => {
|
|
1781
|
-
const rows = await selectMany(db, deliveryAttemptsTable, {
|
|
1782
|
-
notificationType: "app:notify:async-e2e",
|
|
1783
|
-
channel: "push",
|
|
1784
|
-
});
|
|
1785
|
-
expect(rows.some((r) => r["status"] === "sent")).toBe(true);
|
|
1786
|
-
},
|
|
1787
|
-
{ delays: Array(40).fill(250) },
|
|
1788
|
-
);
|
|
1789
|
-
expect(
|
|
1790
|
-
pushTransport.sent.find((m) => m.token === testPushToken(asyncRecipient)),
|
|
1791
|
-
).toBeDefined();
|
|
1792
|
-
} finally {
|
|
1793
|
-
await jobRunner.stop();
|
|
1794
|
-
}
|
|
1795
|
-
}, 20000);
|
|
1796
|
-
|
|
1797
|
-
test("queued channels dispatch jobs instead of sending inline; inApp stays inline", async () => {
|
|
1798
|
-
const { runner, dispatched } = makeStubRunner();
|
|
1799
|
-
const asyncService = createDeliveryService({
|
|
1800
|
-
db,
|
|
1801
|
-
registry: stack.registry,
|
|
1802
|
-
channels: collectChannels(stack.registry),
|
|
1803
|
-
tenantUserIdsQuery: TenantQueries.resolveUserIds,
|
|
1804
|
-
jobRunner: runner,
|
|
1805
|
-
});
|
|
1806
|
-
|
|
1807
|
-
await asyncService.notify(
|
|
1808
|
-
"app:notify:queued-dispatch",
|
|
1809
|
-
{ to: asyncRecipient, data: { title: "Q", body: "Q", subject: "Q" } },
|
|
1810
|
-
admin,
|
|
1811
|
-
admin.tenantId,
|
|
1812
|
-
);
|
|
1813
|
-
|
|
1814
|
-
// email has a render step → delivery.render; push has none → delivery.send.
|
|
1815
|
-
const renderDispatch = dispatched.find((d) => d.name === DeliveryJobs.render);
|
|
1816
|
-
expect(renderDispatch?.payload["channelName"]).toBe("email");
|
|
1817
|
-
expect(renderDispatch?.payload["deliveryAttemptId"]).toBeDefined();
|
|
1818
|
-
expect(
|
|
1819
|
-
dispatched.some((d) => d.name === DeliveryJobs.send && d.payload["channelName"] === "push"),
|
|
1820
|
-
).toBe(true);
|
|
1821
|
-
|
|
1822
|
-
// email is NOT sent inline — it waits for the job.
|
|
1823
|
-
expect(emailTransport.sent.find((m) => m.to === testEmail(asyncRecipient))).toBeUndefined();
|
|
1824
|
-
|
|
1825
|
-
// email attempt row exists as "queued"; inApp was delivered inline ("sent").
|
|
1826
|
-
const emailRows = await selectMany(db, deliveryAttemptsTable, {
|
|
1827
|
-
notificationType: "app:notify:queued-dispatch",
|
|
1828
|
-
channel: "email",
|
|
1829
|
-
});
|
|
1830
|
-
expect(emailRows.some((r) => r["status"] === "queued")).toBe(true);
|
|
1831
|
-
const inAppRows = await selectMany(db, deliveryAttemptsTable, {
|
|
1832
|
-
notificationType: "app:notify:queued-dispatch",
|
|
1833
|
-
channel: "inApp",
|
|
1834
|
-
});
|
|
1835
|
-
expect(inAppRows.some((r) => r["status"] === "sent")).toBe(true);
|
|
1836
|
-
});
|
|
1837
|
-
|
|
1838
|
-
test("without a job runner, queued channels fall back to synchronous inline send", async () => {
|
|
1839
|
-
const inlineService = createDeliveryService({
|
|
1840
|
-
db,
|
|
1841
|
-
registry: stack.registry,
|
|
1842
|
-
channels: collectChannels(stack.registry),
|
|
1843
|
-
tenantUserIdsQuery: TenantQueries.resolveUserIds,
|
|
1844
|
-
});
|
|
1845
|
-
|
|
1846
|
-
await inlineService.notify(
|
|
1847
|
-
"app:notify:inline-fallback",
|
|
1848
|
-
{ to: asyncRecipient, data: { title: "Inline", body: "sent inline", subject: "Inline" } },
|
|
1849
|
-
admin,
|
|
1850
|
-
admin.tenantId,
|
|
1851
|
-
);
|
|
1852
|
-
|
|
1853
|
-
// Sent synchronously during notify() — no job runner, no waiting.
|
|
1854
|
-
expect(emailTransport.sent.find((m) => m.to === testEmail(asyncRecipient))).toBeDefined();
|
|
1855
|
-
const emailRows = await selectMany(db, deliveryAttemptsTable, {
|
|
1856
|
-
notificationType: "app:notify:inline-fallback",
|
|
1857
|
-
channel: "email",
|
|
1858
|
-
});
|
|
1859
|
-
expect(emailRows.some((r) => r["status"] === "sent")).toBe(true);
|
|
1860
|
-
});
|
|
1861
|
-
|
|
1862
|
-
// Mirrors what job-runner.ts's handleJob really builds for a
|
|
1863
|
-
// r.systemScope()'d job (framework#2105) — a real TenantDb wrapped by
|
|
1864
|
-
// createSystemDbView, not a mock, so requireTenantScopedDeps'
|
|
1865
|
-
// assertTenantMatch() call exercises the actual production code path.
|
|
1866
|
-
// The unsafeRaw grant mirrors the systemScope() grant that job-runner.ts's
|
|
1867
|
-
// real ctx.systemDb carries in production.
|
|
1868
|
-
function makeSystemDb(tenantId: TenantId) {
|
|
1869
|
-
return createSystemDbView(
|
|
1870
|
-
createTenantDb(db, tenantId, "system", undefined, undefined, undefined, {
|
|
1871
|
-
unsafeRaw: { reason: "test: job context mirrors systemScope() grant" },
|
|
1872
|
-
}),
|
|
1873
|
-
);
|
|
1874
|
-
}
|
|
1875
|
-
|
|
1876
|
-
test("delivery.render on a channel without a render step records failed and does not dispatch send", async () => {
|
|
1877
|
-
const { runner, dispatched } = makeStubRunner();
|
|
1878
|
-
const attemptId = "00000000-0000-4000-8000-0000000000aa";
|
|
1879
|
-
await expect(
|
|
1880
|
-
deliveryRenderJob(
|
|
1881
|
-
{
|
|
1882
|
-
channelName: "push", // push has no render() — render job must not be used for it
|
|
1883
|
-
address: testPushToken(asyncRecipient),
|
|
1884
|
-
tenantId: admin.tenantId,
|
|
1885
|
-
recipientId: String(asyncRecipient),
|
|
1886
|
-
notificationType: "app:notify:render-isolation",
|
|
1887
|
-
deliveryAttemptId: attemptId,
|
|
1888
|
-
priority: "normal",
|
|
1889
|
-
message: { notificationType: "app:notify:render-isolation", title: "X" },
|
|
1890
|
-
},
|
|
1891
|
-
// @cast-boundary test-seam — job throws before touching systemUser/log/write/queryAs
|
|
1892
|
-
{
|
|
1893
|
-
db,
|
|
1894
|
-
registry: stack.registry,
|
|
1895
|
-
jobRunner: runner,
|
|
1896
|
-
systemDb: makeSystemDb(admin.tenantId),
|
|
1897
|
-
} as unknown as JobContext,
|
|
1898
|
-
),
|
|
1899
|
-
).rejects.toThrow(/no render step/);
|
|
1900
|
-
|
|
1901
|
-
// No send dispatched, and the attempt is recorded as failed (not stuck queued).
|
|
1902
|
-
expect(dispatched).toHaveLength(0);
|
|
1903
|
-
const rows = await selectMany(db, deliveryAttemptsTable, {
|
|
1904
|
-
notificationType: "app:notify:render-isolation",
|
|
1905
|
-
});
|
|
1906
|
-
expect(rows.some((r) => r["status"] === "failed")).toBe(true);
|
|
1907
|
-
});
|
|
1908
|
-
|
|
1909
|
-
// The regression this diff exists to prevent: a payload.tenantId that
|
|
1910
|
-
// doesn't match the systemDb's own tenant must be rejected, not silently
|
|
1911
|
-
// used to read/write another tenant's stream (what ctx.db without
|
|
1912
|
-
// assertTenantMatch would have allowed).
|
|
1913
|
-
test("job handlers throw when payload.tenantId doesn't match ctx.systemDb's tenant", async () => {
|
|
1914
|
-
const { runner, dispatched } = makeStubRunner();
|
|
1915
|
-
const foreignTenantId = testTenantId(999);
|
|
1916
|
-
const attemptId = "00000000-0000-4000-8000-0000000000cc";
|
|
1917
|
-
// @cast-boundary test-seam — mirrors job-runner.ts's real systemDb shape
|
|
1918
|
-
const ctxWithMismatchedSystemDb = {
|
|
1919
|
-
db,
|
|
1920
|
-
registry: stack.registry,
|
|
1921
|
-
jobRunner: runner,
|
|
1922
|
-
systemDb: makeSystemDb(admin.tenantId),
|
|
1923
|
-
} as unknown as JobContext;
|
|
1924
|
-
|
|
1925
|
-
await expect(
|
|
1926
|
-
deliveryRenderJob(
|
|
1927
|
-
{
|
|
1928
|
-
channelName: "email",
|
|
1929
|
-
address: testEmail(asyncRecipient),
|
|
1930
|
-
tenantId: foreignTenantId,
|
|
1931
|
-
recipientId: String(asyncRecipient),
|
|
1932
|
-
notificationType: "app:notify:cross-tenant",
|
|
1933
|
-
deliveryAttemptId: attemptId,
|
|
1934
|
-
priority: "normal",
|
|
1935
|
-
message: { notificationType: "app:notify:cross-tenant", title: "X" },
|
|
1936
|
-
},
|
|
1937
|
-
ctxWithMismatchedSystemDb,
|
|
1938
|
-
),
|
|
1939
|
-
).rejects.toThrow(/tenant self-check failed/);
|
|
1940
|
-
|
|
1941
|
-
expect(dispatched).toHaveLength(0);
|
|
1942
|
-
const rows = await selectMany(db, deliveryAttemptsTable, {
|
|
1943
|
-
notificationType: "app:notify:cross-tenant",
|
|
1944
|
-
});
|
|
1945
|
-
expect(rows).toHaveLength(0);
|
|
1946
|
-
});
|
|
1947
|
-
|
|
1948
|
-
// Unreachable via real dispatch (job-runner.ts only omits systemDb for jobs
|
|
1949
|
-
// whose feature is NOT r.systemScope()'d, and delivery always is) — this
|
|
1950
|
-
// exercises requireTenantScopedDeps' own defensive guard directly, the
|
|
1951
|
-
// same way the missing-render-step case above exercises resolveChannel's.
|
|
1952
|
-
test("job handlers throw when ctx.systemDb is missing on a system-scoped job", async () => {
|
|
1953
|
-
const { runner } = makeStubRunner();
|
|
1954
|
-
const attemptId = "00000000-0000-4000-8000-0000000000bb";
|
|
1955
|
-
const payload = {
|
|
1956
|
-
channelName: "email",
|
|
1957
|
-
address: testEmail(asyncRecipient),
|
|
1958
|
-
tenantId: admin.tenantId,
|
|
1959
|
-
recipientId: String(asyncRecipient),
|
|
1960
|
-
notificationType: "app:notify:missing-systemdb",
|
|
1961
|
-
deliveryAttemptId: attemptId,
|
|
1962
|
-
priority: "normal" as const,
|
|
1963
|
-
message: { notificationType: "app:notify:missing-systemdb", title: "X" },
|
|
1964
|
-
};
|
|
1965
|
-
// @cast-boundary test-seam — no systemDb, unlike what job-runner.ts actually wires
|
|
1966
|
-
const ctxWithoutSystemDb = {
|
|
1967
|
-
db,
|
|
1968
|
-
registry: stack.registry,
|
|
1969
|
-
jobRunner: runner,
|
|
1970
|
-
} as unknown as JobContext;
|
|
1971
|
-
|
|
1972
|
-
await expect(deliveryRenderJob(payload, ctxWithoutSystemDb)).rejects.toThrow(
|
|
1973
|
-
/ctx\.systemDb missing/,
|
|
1974
|
-
);
|
|
1975
|
-
await expect(deliverySendJob(payload, ctxWithoutSystemDb)).rejects.toThrow(
|
|
1976
|
-
/ctx\.systemDb missing/,
|
|
1977
|
-
);
|
|
1978
|
-
});
|
|
1979
|
-
});
|
|
1980
|
-
|
|
1981
|
-
// --- Flow 18: priority maps onto the BullMQ job priority ---
|
|
1982
|
-
|
|
1983
|
-
describe("flow 18: priority → job priority mapping", () => {
|
|
1984
|
-
test("critical/normal/low map to ascending BullMQ priorities on dispatch", async () => {
|
|
1985
|
-
const send = async (notificationType: string, priority: "critical" | "normal" | "low") => {
|
|
1986
|
-
const { runner, dispatched } = makeStubRunner();
|
|
1987
|
-
const asyncService = createDeliveryService({
|
|
1988
|
-
db,
|
|
1989
|
-
registry: stack.registry,
|
|
1990
|
-
channels: collectChannels(stack.registry),
|
|
1991
|
-
tenantUserIdsQuery: TenantQueries.resolveUserIds,
|
|
1992
|
-
jobRunner: runner,
|
|
1993
|
-
});
|
|
1994
|
-
await asyncService.notify(
|
|
1995
|
-
notificationType,
|
|
1996
|
-
{ to: asyncRecipient, data: { title: "P", body: "P" }, priority },
|
|
1997
|
-
admin,
|
|
1998
|
-
admin.tenantId,
|
|
1999
|
-
);
|
|
2000
|
-
// email → delivery.render carries the priority meta.
|
|
2001
|
-
const render = dispatched.find((d) => d.name === DeliveryJobs.render);
|
|
2002
|
-
return render?.meta?.["priority"];
|
|
2003
|
-
};
|
|
2004
|
-
|
|
2005
|
-
const critical = await send("app:notify:prio-critical", "critical");
|
|
2006
|
-
const normal = await send("app:notify:prio-normal", "normal");
|
|
2007
|
-
const low = await send("app:notify:prio-low", "low");
|
|
2008
|
-
|
|
2009
|
-
expect(critical).toBe(1);
|
|
2010
|
-
expect(normal).toBe(2);
|
|
2011
|
-
expect(low).toBe(3);
|
|
2012
|
-
// Lower number = higher priority: critical jumps ahead of normal ahead of low.
|
|
2013
|
-
expect(critical as number).toBeLessThan(normal as number);
|
|
2014
|
-
expect(normal as number).toBeLessThan(low as number);
|
|
2015
|
-
});
|
|
2016
|
-
});
|
|
2017
|
-
|
|
2018
|
-
// --- Flow 19: address unsubscribe — recipient with no user account ---
|
|
2019
|
-
|
|
2020
|
-
describe("flow 19: address unsubscribe (route-based sends, no user account)", () => {
|
|
2021
|
-
const ADDRESS_BIDX_KEY = Buffer.alloc(32, 3).toString("base64");
|
|
2022
|
-
const FOREIGN_JWT_SECRET = "not-the-real-stack-secret-32-characters!";
|
|
2023
|
-
|
|
2024
|
-
beforeAll(() => {
|
|
2025
|
-
configureBlindIndexKey(ADDRESS_BIDX_KEY);
|
|
2026
|
-
});
|
|
2027
|
-
|
|
2028
|
-
afterAll(() => {
|
|
2029
|
-
resetBlindIndexKeyForTests();
|
|
2030
|
-
});
|
|
2031
|
-
|
|
2032
|
-
test("unsubscribe link opts the address out; same type/channel is skipped afterwards", async () => {
|
|
2033
|
-
const address = "flow19-recipient@test.com";
|
|
2034
|
-
|
|
2035
|
-
await deliveryService.notify(
|
|
2036
|
-
"app:notify:address-unsub-19a",
|
|
2037
|
-
{ route: { email: address }, data: { title: "X", body: "X" } },
|
|
2038
|
-
admin,
|
|
2039
|
-
admin.tenantId,
|
|
2040
|
-
);
|
|
2041
|
-
const sentBefore = await selectMany(db, deliveryAttemptsTable, {
|
|
2042
|
-
notificationType: "app:notify:address-unsub-19a",
|
|
2043
|
-
recipientAddress: address,
|
|
2044
|
-
});
|
|
2045
|
-
expect(sentBefore.every((l) => l["status"] === "sent")).toBe(true);
|
|
2046
|
-
expect(sentBefore.length).toBeGreaterThan(0);
|
|
2047
|
-
|
|
2048
|
-
// Sign with a mixed-case, padded variant of the same address — proves
|
|
2049
|
-
// normalization (trim + lowercase) happens before hashing, not just
|
|
2050
|
-
// exact string matches.
|
|
2051
|
-
const token = await signAddressUnsubscribeToken(
|
|
2052
|
-
{
|
|
2053
|
-
tenantId: admin.tenantId,
|
|
2054
|
-
address: ` ${address.toUpperCase()} `,
|
|
2055
|
-
notificationType: "app:notify:address-unsub-19a",
|
|
2056
|
-
channel: "email",
|
|
2057
|
-
},
|
|
2058
|
-
UNSUBSCRIBE_SECRET,
|
|
2059
|
-
);
|
|
2060
|
-
const res = await postUnsubscribe(token);
|
|
2061
|
-
expect(res.status).toBe(200);
|
|
2062
|
-
expect(await res.text()).toContain("unsubscribed");
|
|
2063
|
-
|
|
2064
|
-
// Clicking twice must stay a no-op (one row, no crash).
|
|
2065
|
-
const res2 = await postUnsubscribe(token);
|
|
2066
|
-
expect(res2.status).toBe(200);
|
|
2067
|
-
const optOutRows = await selectMany(db, notificationAddressOptOutsTable, {
|
|
2068
|
-
notificationType: "app:notify:address-unsub-19a",
|
|
2069
|
-
channel: "email",
|
|
2070
|
-
});
|
|
2071
|
-
expect(optOutRows).toHaveLength(1);
|
|
2072
|
-
|
|
2073
|
-
await deliveryService.notify(
|
|
2074
|
-
"app:notify:address-unsub-19a",
|
|
2075
|
-
{ route: { email: address }, data: { title: "Second", body: "Second" } },
|
|
2076
|
-
admin,
|
|
2077
|
-
admin.tenantId,
|
|
2078
|
-
);
|
|
2079
|
-
const skipped = await selectMany(db, deliveryAttemptsTable, {
|
|
2080
|
-
notificationType: "app:notify:address-unsub-19a",
|
|
2081
|
-
status: "skipped",
|
|
2082
|
-
error: "unsubscribed",
|
|
2083
|
-
});
|
|
2084
|
-
expect(skipped.length).toBeGreaterThanOrEqual(1);
|
|
2085
|
-
expect(skipped.every((l) => l["recipientAddress"] === null)).toBe(true);
|
|
2086
|
-
|
|
2087
|
-
// A different notificationType for the same address is unaffected.
|
|
2088
|
-
await deliveryService.notify(
|
|
2089
|
-
"app:notify:address-unsub-19b",
|
|
2090
|
-
{ route: { email: address }, data: { title: "Other type", body: "X" } },
|
|
2091
|
-
admin,
|
|
2092
|
-
admin.tenantId,
|
|
2093
|
-
);
|
|
2094
|
-
const otherTypeLogs = await selectMany(db, deliveryAttemptsTable, {
|
|
2095
|
-
notificationType: "app:notify:address-unsub-19b",
|
|
2096
|
-
recipientAddress: address,
|
|
2097
|
-
});
|
|
2098
|
-
expect(otherTypeLogs.some((l) => l["status"] === "sent")).toBe(true);
|
|
2099
|
-
|
|
2100
|
-
// Critical priority is never suppressed, same rule as user preferences.
|
|
2101
|
-
await deliveryService.notify(
|
|
2102
|
-
"app:notify:address-unsub-19a",
|
|
2103
|
-
{
|
|
2104
|
-
route: { email: address },
|
|
2105
|
-
data: { title: "Critical", body: "X" },
|
|
2106
|
-
priority: "critical",
|
|
2107
|
-
},
|
|
2108
|
-
admin,
|
|
2109
|
-
admin.tenantId,
|
|
2110
|
-
);
|
|
2111
|
-
const criticalLogs = await selectMany(db, deliveryAttemptsTable, {
|
|
2112
|
-
notificationType: "app:notify:address-unsub-19a",
|
|
2113
|
-
recipientAddress: address,
|
|
2114
|
-
priority: "critical",
|
|
2115
|
-
});
|
|
2116
|
-
expect(criticalLogs.some((l) => l["status"] === "sent")).toBe(true);
|
|
2117
|
-
});
|
|
2118
|
-
|
|
2119
|
-
test("tampered token (wrong secret) is rejected and creates no opt-out row", async () => {
|
|
2120
|
-
const address = "flow19-tampered@test.com";
|
|
2121
|
-
const forgedToken = await signAddressUnsubscribeToken(
|
|
2122
|
-
{
|
|
2123
|
-
tenantId: admin.tenantId,
|
|
2124
|
-
address,
|
|
2125
|
-
notificationType: "app:notify:address-unsub-19c",
|
|
2126
|
-
channel: "email",
|
|
2127
|
-
},
|
|
2128
|
-
FOREIGN_JWT_SECRET,
|
|
2129
|
-
);
|
|
2130
|
-
|
|
2131
|
-
const res = await postUnsubscribe(forgedToken);
|
|
2132
|
-
expect(res.status).toBe(400);
|
|
2133
|
-
|
|
2134
|
-
const rows = await selectMany(db, notificationAddressOptOutsTable, {
|
|
2135
|
-
notificationType: "app:notify:address-unsub-19c",
|
|
2136
|
-
channel: "email",
|
|
2137
|
-
});
|
|
2138
|
-
expect(rows).toHaveLength(0);
|
|
2139
|
-
});
|
|
2140
|
-
|
|
2141
|
-
test("signed token payload carries the address hash, never the plaintext address", async () => {
|
|
2142
|
-
const address = "flow19-no-plaintext@test.com";
|
|
2143
|
-
const token = await signAddressUnsubscribeToken(
|
|
2144
|
-
{
|
|
2145
|
-
tenantId: admin.tenantId,
|
|
2146
|
-
address,
|
|
2147
|
-
notificationType: "app:notify:address-unsub-19d",
|
|
2148
|
-
channel: "email",
|
|
2149
|
-
},
|
|
2150
|
-
UNSUBSCRIBE_SECRET,
|
|
2151
|
-
);
|
|
2152
|
-
|
|
2153
|
-
const payload = jose.decodeJwt(token);
|
|
2154
|
-
expect(payload["kind"]).toBe("address");
|
|
2155
|
-
expect(typeof payload["addressHash"]).toBe("string");
|
|
2156
|
-
expect(payload["addressHash"]).not.toBe(address);
|
|
2157
|
-
expect(JSON.stringify(payload)).not.toContain(address);
|
|
2158
|
-
});
|
|
2159
|
-
|
|
2160
|
-
test("opt-out is tenant-scoped: the same address in another tenant is unaffected", async () => {
|
|
2161
|
-
const address = "flow19-cross-tenant@test.com";
|
|
2162
|
-
const otherTenantId = testTenantId(915777);
|
|
2163
|
-
|
|
2164
|
-
const token = await signAddressUnsubscribeToken(
|
|
2165
|
-
{
|
|
2166
|
-
tenantId: admin.tenantId,
|
|
2167
|
-
address,
|
|
2168
|
-
notificationType: "app:notify:address-unsub-19e",
|
|
2169
|
-
channel: "email",
|
|
2170
|
-
},
|
|
2171
|
-
UNSUBSCRIBE_SECRET,
|
|
2172
|
-
);
|
|
2173
|
-
const res = await postUnsubscribe(token);
|
|
2174
|
-
expect(res.status).toBe(200);
|
|
2175
|
-
|
|
2176
|
-
await deliveryService.notify(
|
|
2177
|
-
"app:notify:address-unsub-19e",
|
|
2178
|
-
{ route: { email: address }, data: { title: "X", body: "X" } },
|
|
2179
|
-
admin,
|
|
2180
|
-
otherTenantId,
|
|
2181
|
-
);
|
|
2182
|
-
const otherTenantLogs = await selectMany(db, deliveryAttemptsTable, {
|
|
2183
|
-
notificationType: "app:notify:address-unsub-19e",
|
|
2184
|
-
recipientAddress: address,
|
|
2185
|
-
tenantId: otherTenantId,
|
|
2186
|
-
});
|
|
2187
|
-
expect(otherTenantLogs.some((l) => l["status"] === "sent")).toBe(true);
|
|
2188
|
-
});
|
|
2189
|
-
|
|
2190
|
-
test("signAddressUnsubscribeToken throws when no blind-index key is configured", async () => {
|
|
2191
|
-
resetBlindIndexKeyForTests();
|
|
2192
|
-
try {
|
|
2193
|
-
await expect(
|
|
2194
|
-
signAddressUnsubscribeToken(
|
|
2195
|
-
{
|
|
2196
|
-
tenantId: admin.tenantId,
|
|
2197
|
-
address: "no-key-configured@test.com",
|
|
2198
|
-
notificationType: "app:notify:address-unsub-19f",
|
|
2199
|
-
channel: "email",
|
|
2200
|
-
},
|
|
2201
|
-
UNSUBSCRIBE_SECRET,
|
|
2202
|
-
),
|
|
2203
|
-
).rejects.toThrow(/blind-index key/);
|
|
2204
|
-
} finally {
|
|
2205
|
-
configureBlindIndexKey(ADDRESS_BIDX_KEY);
|
|
2206
|
-
}
|
|
2207
|
-
});
|
|
2208
|
-
|
|
2209
|
-
// #3275: deliverToUser must also honor an address opt-out, not just
|
|
2210
|
-
// deliverDirect's route-based sends — the two paths shared the same
|
|
2211
|
-
// isAddressSuppressed check as of this change.
|
|
2212
|
-
test("account send is suppressed when the resolved address has an opt-out row (#3275)", async () => {
|
|
2213
|
-
await stack.redis.redis.del(RATE_KEY_EMAIL);
|
|
2214
|
-
const notificationType = "app:notify:account-unsub-20";
|
|
2215
|
-
const address = testEmail(user1.id);
|
|
2216
|
-
|
|
2217
|
-
const token = await signAddressUnsubscribeToken(
|
|
2218
|
-
{ tenantId: user1.tenantId, address, notificationType, channel: "email" },
|
|
2219
|
-
UNSUBSCRIBE_SECRET,
|
|
2220
|
-
);
|
|
2221
|
-
const res = await postUnsubscribe(token);
|
|
2222
|
-
expect(res.status).toBe(200);
|
|
2223
|
-
|
|
2224
|
-
emailTransport.sent.length = 0;
|
|
2225
|
-
stack.events.reset();
|
|
2226
|
-
|
|
2227
|
-
await stack.http.writeOk(
|
|
2228
|
-
"app:write:send-notification",
|
|
2229
|
-
{ notificationType, toUserId: user1.id, title: "Konto-Unsub", body: "X" },
|
|
2230
|
-
admin,
|
|
2231
|
-
);
|
|
2232
|
-
|
|
2233
|
-
expect(emailTransport.sent.some((e) => e.to === address)).toBe(false);
|
|
2234
|
-
const emailLogs = await selectMany(db, deliveryAttemptsTable, {
|
|
2235
|
-
notificationType,
|
|
2236
|
-
recipientId: user1.id,
|
|
2237
|
-
channel: "email",
|
|
2238
|
-
});
|
|
2239
|
-
expect(emailLogs.some((l) => l["status"] === "skipped" && l["error"] === "unsubscribed")).toBe(
|
|
2240
|
-
true,
|
|
2241
|
-
);
|
|
2242
|
-
expect(emailLogs.every((l) => l["recipientAddress"] !== address)).toBe(true);
|
|
2243
|
-
|
|
2244
|
-
// inApp is unaffected — the opt-out is per-channel.
|
|
2245
|
-
const inAppNotifs = stack.events.sse.filter((e) => e.type === "channel-in-app:event:delivered");
|
|
2246
|
-
expect(inAppNotifs.some((e) => e.data["userId"] === user1.id)).toBe(true);
|
|
2247
|
-
|
|
2248
|
-
// Critical priority still gets delivered, same rule as the direct-route path.
|
|
2249
|
-
emailTransport.sent.length = 0;
|
|
2250
|
-
await deliveryService.notify(
|
|
2251
|
-
notificationType,
|
|
2252
|
-
{ to: user1.id, data: { title: "Critical", body: "X" }, priority: "critical" },
|
|
2253
|
-
admin,
|
|
2254
|
-
admin.tenantId,
|
|
2255
|
-
);
|
|
2256
|
-
expect(emailTransport.sent.some((e) => e.to === address)).toBe(true);
|
|
2257
|
-
});
|
|
2258
|
-
|
|
2259
|
-
// Address-path counterpart to flow 16 — same deterministic-aggregate-id
|
|
2260
|
-
// race, but through upsertAddressOptOut's create-or-noop instead of
|
|
2261
|
-
// upsertPreference's create-or-update.
|
|
2262
|
-
test("clicking the same address unsubscribe link three times concurrently does not error", async () => {
|
|
2263
|
-
const address = "flow19-concurrent@test.com";
|
|
2264
|
-
const notificationType = "app:notify:address-unsub-concurrent";
|
|
2265
|
-
|
|
2266
|
-
const token = await signAddressUnsubscribeToken(
|
|
2267
|
-
{ tenantId: admin.tenantId, address, notificationType, channel: "email" },
|
|
2268
|
-
UNSUBSCRIBE_SECRET,
|
|
2269
|
-
);
|
|
2270
|
-
|
|
2271
|
-
const results = await Promise.all([
|
|
2272
|
-
postUnsubscribe(token),
|
|
2273
|
-
postUnsubscribe(token),
|
|
2274
|
-
postUnsubscribe(token),
|
|
2275
|
-
]);
|
|
2276
|
-
|
|
2277
|
-
for (const res of results) {
|
|
2278
|
-
expect(res.status).toBe(200);
|
|
2279
|
-
}
|
|
2280
|
-
|
|
2281
|
-
const rows = await selectMany(db, notificationAddressOptOutsTable, {
|
|
2282
|
-
tenantId: admin.tenantId,
|
|
2283
|
-
notificationType,
|
|
2284
|
-
channel: "email",
|
|
2285
|
-
});
|
|
2286
|
-
expect(rows).toHaveLength(1);
|
|
2287
|
-
});
|
|
2288
|
-
});
|
|
2289
|
-
|
|
2290
|
-
// --- Flow 20: resubscribe endpoint (undo direction of unsubscribe) ---
|
|
2291
|
-
|
|
2292
|
-
describe("flow 20: resubscribe endpoint", () => {
|
|
2293
|
-
const ADDRESS_BIDX_KEY = Buffer.alloc(32, 3).toString("base64");
|
|
2294
|
-
|
|
2295
|
-
beforeAll(() => {
|
|
2296
|
-
configureBlindIndexKey(ADDRESS_BIDX_KEY);
|
|
2297
|
-
});
|
|
2298
|
-
|
|
2299
|
-
afterAll(() => {
|
|
2300
|
-
resetBlindIndexKeyForTests();
|
|
2301
|
-
});
|
|
2302
|
-
|
|
2303
|
-
test("address token: unsubscribe → resubscribe → unsubscribe again → resubscribe (id generations)", async () => {
|
|
2304
|
-
const address = "flow20-address@test.com";
|
|
2305
|
-
const notificationType = "app:notify:address-resub-20a";
|
|
2306
|
-
|
|
2307
|
-
const token = await signAddressUnsubscribeToken(
|
|
2308
|
-
{ tenantId: admin.tenantId, address, notificationType, channel: "email" },
|
|
2309
|
-
UNSUBSCRIBE_SECRET,
|
|
2310
|
-
);
|
|
2311
|
-
|
|
2312
|
-
const unsubRes = await postUnsubscribe(token);
|
|
2313
|
-
expect(unsubRes.status).toBe(200);
|
|
2314
|
-
expect(
|
|
2315
|
-
await selectMany(db, notificationAddressOptOutsTable, {
|
|
2316
|
-
tenantId: admin.tenantId,
|
|
2317
|
-
notificationType,
|
|
2318
|
-
channel: "email",
|
|
2319
|
-
}),
|
|
2320
|
-
).toHaveLength(1);
|
|
2321
|
-
|
|
2322
|
-
const resubRes = await postResubscribe(token);
|
|
2323
|
-
expect(resubRes.status).toBe(200);
|
|
2324
|
-
const resubBody = (await resubRes.json()) as { isSuccess?: boolean };
|
|
2325
|
-
expect(resubBody.isSuccess).toBe(true);
|
|
2326
|
-
expect(
|
|
2327
|
-
await selectMany(db, notificationAddressOptOutsTable, {
|
|
2328
|
-
tenantId: admin.tenantId,
|
|
2329
|
-
notificationType,
|
|
2330
|
-
channel: "email",
|
|
2331
|
-
}),
|
|
2332
|
-
).toHaveLength(0);
|
|
2333
|
-
|
|
2334
|
-
// Opting out again must land on a fresh generation — the first
|
|
2335
|
-
// generation's stream was hard-deleted by the resubscribe above.
|
|
2336
|
-
const unsubRes2 = await postUnsubscribe(token);
|
|
2337
|
-
expect(unsubRes2.status).toBe(200);
|
|
2338
|
-
expect(
|
|
2339
|
-
await selectMany(db, notificationAddressOptOutsTable, {
|
|
2340
|
-
tenantId: admin.tenantId,
|
|
2341
|
-
notificationType,
|
|
2342
|
-
channel: "email",
|
|
2343
|
-
}),
|
|
2344
|
-
).toHaveLength(1);
|
|
2345
|
-
|
|
2346
|
-
const resubRes2 = await postResubscribe(token);
|
|
2347
|
-
expect(resubRes2.status).toBe(200);
|
|
2348
|
-
expect(
|
|
2349
|
-
await selectMany(db, notificationAddressOptOutsTable, {
|
|
2350
|
-
tenantId: admin.tenantId,
|
|
2351
|
-
notificationType,
|
|
2352
|
-
channel: "email",
|
|
2353
|
-
}),
|
|
2354
|
-
).toHaveLength(0);
|
|
2355
|
-
});
|
|
2356
|
-
|
|
2357
|
-
test("address token: resubscribe at the last generation is refused with 409, opt-out survives, unsubscribe still works", async () => {
|
|
2358
|
-
const address = "flow20-generation-cap@test.com";
|
|
2359
|
-
const notificationType = "app:notify:address-resub-20-cap";
|
|
2360
|
-
const channel = "email";
|
|
2361
|
-
const addressHash = hashUnsubscribeAddress(address);
|
|
2362
|
-
if (!addressHash) throw new Error("blind-index key not configured for this test");
|
|
2363
|
-
|
|
2364
|
-
// Seed directly at the last generation instead of looping resubscribe
|
|
2365
|
-
// 99 times — same executor.create seed pattern production code itself
|
|
2366
|
-
// uses (see ticketExecutor() above), not a raw table write.
|
|
2367
|
-
const lastGenerationId = addressOptOutAggregateIdForTests(
|
|
2368
|
-
admin.tenantId,
|
|
2369
|
-
addressHash,
|
|
2370
|
-
notificationType,
|
|
2371
|
-
channel,
|
|
2372
|
-
MAX_ADDRESS_OPT_OUT_GENERATIONS_FOR_TESTS - 1,
|
|
2373
|
-
);
|
|
2374
|
-
const optOutExecutor = createEventStoreExecutor(
|
|
2375
|
-
notificationAddressOptOutsTable,
|
|
2376
|
-
notificationAddressOptOutEntity,
|
|
2377
|
-
{ entityName: "notification-address-opt-out" },
|
|
2378
|
-
);
|
|
2379
|
-
const tenantDb = createTenantDb(db, admin.tenantId);
|
|
2380
|
-
const seeded = await optOutExecutor.create(
|
|
2381
|
-
{ id: lastGenerationId, addressHash, notificationType, channel },
|
|
2382
|
-
admin,
|
|
2383
|
-
tenantDb,
|
|
2384
|
-
);
|
|
2385
|
-
expect(seeded.isSuccess).toBe(true);
|
|
2386
|
-
|
|
2387
|
-
const token = await signAddressUnsubscribeToken(
|
|
2388
|
-
{ tenantId: admin.tenantId, address, notificationType, channel },
|
|
2389
|
-
UNSUBSCRIBE_SECRET,
|
|
2390
|
-
);
|
|
2391
|
-
|
|
2392
|
-
const resubRes = await postResubscribe(token);
|
|
2393
|
-
expect(resubRes.status).toBe(409);
|
|
2394
|
-
const resubBody = (await resubRes.json()) as { error?: { code?: string } };
|
|
2395
|
-
expect(resubBody.error?.code).toBe(DeliveryErrors.resubscribeLimitReached);
|
|
2396
|
-
|
|
2397
|
-
expect(
|
|
2398
|
-
await selectMany(db, notificationAddressOptOutsTable, {
|
|
2399
|
-
tenantId: admin.tenantId,
|
|
2400
|
-
notificationType,
|
|
2401
|
-
channel,
|
|
2402
|
-
}),
|
|
2403
|
-
).toHaveLength(1);
|
|
2404
|
-
|
|
2405
|
-
const unsubRes = await postUnsubscribe(token);
|
|
2406
|
-
expect(unsubRes.status).toBe(200);
|
|
2407
|
-
expect(
|
|
2408
|
-
await selectMany(db, notificationAddressOptOutsTable, {
|
|
2409
|
-
tenantId: admin.tenantId,
|
|
2410
|
-
notificationType,
|
|
2411
|
-
channel,
|
|
2412
|
-
}),
|
|
2413
|
-
).toHaveLength(1);
|
|
2414
|
-
});
|
|
2415
|
-
|
|
2416
|
-
test("address token: resubscribe without a prior opt-out is a no-op 200", async () => {
|
|
2417
|
-
const address = "flow20-no-prior-optout@test.com";
|
|
2418
|
-
const notificationType = "app:notify:address-resub-20b";
|
|
2419
|
-
|
|
2420
|
-
const token = await signAddressUnsubscribeToken(
|
|
2421
|
-
{ tenantId: admin.tenantId, address, notificationType, channel: "email" },
|
|
2422
|
-
UNSUBSCRIBE_SECRET,
|
|
2423
|
-
);
|
|
2424
|
-
|
|
2425
|
-
const res = await postResubscribe(token);
|
|
2426
|
-
expect(res.status).toBe(200);
|
|
2427
|
-
const body = (await res.json()) as { isSuccess?: boolean };
|
|
2428
|
-
expect(body.isSuccess).toBe(true);
|
|
2429
|
-
});
|
|
2430
|
-
|
|
2431
|
-
test("user token: resubscribe re-enables the preference", async () => {
|
|
2432
|
-
const token = await signUnsubscribeToken(
|
|
2433
|
-
{
|
|
2434
|
-
userId: user2.id,
|
|
2435
|
-
tenantId: user2.tenantId,
|
|
2436
|
-
notificationType: "app:notify:user-resub-20c",
|
|
2437
|
-
channel: "inApp",
|
|
2438
|
-
},
|
|
2439
|
-
UNSUBSCRIBE_SECRET,
|
|
2440
|
-
);
|
|
2441
|
-
|
|
2442
|
-
await postUnsubscribe(token);
|
|
2443
|
-
const disabled = await selectMany(db, notificationPreferencesTable, {
|
|
2444
|
-
userId: user2.id,
|
|
2445
|
-
notificationType: "app:notify:user-resub-20c",
|
|
2446
|
-
channel: "inApp",
|
|
2447
|
-
});
|
|
2448
|
-
expect(disabled[0]?.["enabled"]).toBe(false);
|
|
2449
|
-
|
|
2450
|
-
const res = await postResubscribe(token);
|
|
2451
|
-
expect(res.status).toBe(200);
|
|
2452
|
-
const enabled = await selectMany(db, notificationPreferencesTable, {
|
|
2453
|
-
userId: user2.id,
|
|
2454
|
-
notificationType: "app:notify:user-resub-20c",
|
|
2455
|
-
channel: "inApp",
|
|
2456
|
-
});
|
|
2457
|
-
expect(enabled[0]?.["enabled"]).toBe(true);
|
|
2458
|
-
});
|
|
2459
|
-
|
|
2460
|
-
test("invalid token returns 400 unsubscribe_token_invalid", async () => {
|
|
2461
|
-
const res = await postResubscribe("invalid-jwt-token");
|
|
2462
|
-
expect(res.status).toBe(400);
|
|
2463
|
-
const body = (await res.json()) as { error?: { code?: string } };
|
|
2464
|
-
expect(body.error?.code).toBe("unsubscribe_token_invalid");
|
|
2465
|
-
});
|
|
2466
|
-
|
|
2467
|
-
test("token only in the query string is rejected (no query fallback, unlike unsubscribe)", async () => {
|
|
2468
|
-
const token = await signUnsubscribeToken(
|
|
2469
|
-
{
|
|
2470
|
-
userId: user2.id,
|
|
2471
|
-
tenantId: user2.tenantId,
|
|
2472
|
-
notificationType: "app:notify:user-resub-20d",
|
|
2473
|
-
channel: "inApp",
|
|
2474
|
-
},
|
|
2475
|
-
UNSUBSCRIBE_SECRET,
|
|
2476
|
-
);
|
|
2477
|
-
|
|
2478
|
-
const res = await stack.app.request(`${DELIVERY_RESUBSCRIBE_PATH}?token=${token}`, {
|
|
2479
|
-
method: "POST",
|
|
2480
|
-
});
|
|
2481
|
-
expect(res.status).toBe(400);
|
|
2482
|
-
});
|
|
2483
|
-
|
|
2484
|
-
test("normal user cannot dispatch the resubscribe write handlers directly", async () => {
|
|
2485
|
-
const addressError = await stack.http.writeErr(
|
|
2486
|
-
DeliveryHandlers.resubscribeAddress,
|
|
2487
|
-
{
|
|
2488
|
-
addressHash: "x".repeat(32),
|
|
2489
|
-
notificationType: "app:notify:direct-resub",
|
|
2490
|
-
channel: "email",
|
|
2491
|
-
},
|
|
2492
|
-
user1,
|
|
2493
|
-
);
|
|
2494
|
-
expect(addressError.code).toBe("access_denied");
|
|
2495
|
-
|
|
2496
|
-
const userError = await stack.http.writeErr(
|
|
2497
|
-
DeliveryHandlers.resubscribeUser,
|
|
2498
|
-
{ userId: user2.id, notificationType: "app:notify:direct-resub", channel: "email" },
|
|
2499
|
-
user1,
|
|
2500
|
-
);
|
|
2501
|
-
expect(userError.code).toBe("access_denied");
|
|
2502
|
-
});
|
|
2503
|
-
});
|