@cosmicdrift/kumiko-samples 0.338.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/LICENSE +57 -0
- package/README.md +14 -0
- package/package.json +34 -0
- package/packages/bundled-features/package.json +647 -0
- package/packages/bundled-features/src/admin-shell/changes.json +27 -0
- package/packages/bundled-features/src/admin-shell/constants.ts +11 -0
- package/packages/bundled-features/src/admin-shell/feature.ts +184 -0
- package/packages/bundled-features/src/admin-shell/i18n.ts +54 -0
- package/packages/bundled-features/src/admin-shell/index.ts +17 -0
- package/packages/bundled-features/src/admin-shell/overview-allowlist.ts +47 -0
- package/packages/bundled-features/src/admin-shell/overview-panels.ts +225 -0
- package/packages/bundled-features/src/admin-shell/web/client-plugin.tsx +16 -0
- package/packages/bundled-features/src/admin-shell/web/i18n.ts +11 -0
- package/packages/bundled-features/src/admin-shell/web/index.ts +2 -0
- package/packages/bundled-features/src/agent-tools/agent-doc-lint.ts +166 -0
- package/packages/bundled-features/src/agent-tools/agent-manifest.ts +460 -0
- package/packages/bundled-features/src/agent-tools/changes.json +40 -0
- package/packages/bundled-features/src/agent-tools/feature.ts +36 -0
- package/packages/bundled-features/src/agent-tools/filter-ops.ts +5 -0
- package/packages/bundled-features/src/agent-tools/index.ts +25 -0
- package/packages/bundled-features/src/agent-tools/tool-catalog.ts +658 -0
- package/packages/bundled-features/src/agent-tools/tool-dispatch.ts +374 -0
- package/packages/bundled-features/src/agent-tools/types.ts +222 -0
- package/packages/bundled-features/src/audit/changes.json +40 -0
- package/packages/bundled-features/src/audit/constants.ts +26 -0
- package/packages/bundled-features/src/audit/escape-hatch-audit-sink.ts +52 -0
- package/packages/bundled-features/src/audit/feature.ts +145 -0
- package/packages/bundled-features/src/audit/handlers/details.query.ts +49 -0
- package/packages/bundled-features/src/audit/handlers/list.query.ts +130 -0
- package/packages/bundled-features/src/audit/i18n.ts +22 -0
- package/packages/bundled-features/src/audit/index.ts +3 -0
- package/packages/bundled-features/src/audit/web/client-plugin.tsx +16 -0
- package/packages/bundled-features/src/audit/web/i18n.ts +8 -0
- package/packages/bundled-features/src/audit/web/index.ts +3 -0
- package/packages/bundled-features/src/auth-email-password/auth-paths.ts +28 -0
- package/packages/bundled-features/src/auth-email-password/auth-user-row.ts +51 -0
- package/packages/bundled-features/src/auth-email-password/changes.json +143 -0
- package/packages/bundled-features/src/auth-email-password/constants.ts +146 -0
- package/packages/bundled-features/src/auth-email-password/email-templates.ts +198 -0
- package/packages/bundled-features/src/auth-email-password/errors.ts +112 -0
- package/packages/bundled-features/src/auth-email-password/feature.ts +269 -0
- package/packages/bundled-features/src/auth-email-password/handlers/change-password.write.ts +70 -0
- package/packages/bundled-features/src/auth-email-password/handlers/confirm-account-unlock.write.ts +61 -0
- package/packages/bundled-features/src/auth-email-password/handlers/confirm-token-flow.ts +148 -0
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts +290 -0
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept.write.ts +195 -0
- package/packages/bundled-features/src/auth-email-password/handlers/invite-create.write.ts +232 -0
- package/packages/bundled-features/src/auth-email-password/handlers/invite-info.query.ts +90 -0
- package/packages/bundled-features/src/auth-email-password/handlers/invite-signup-complete.write.ts +221 -0
- package/packages/bundled-features/src/auth-email-password/handlers/login.write.ts +344 -0
- package/packages/bundled-features/src/auth-email-password/handlers/logout.write.ts +16 -0
- package/packages/bundled-features/src/auth-email-password/handlers/request-account-unlock.write.ts +40 -0
- package/packages/bundled-features/src/auth-email-password/handlers/request-email-verification.write.ts +37 -0
- package/packages/bundled-features/src/auth-email-password/handlers/request-password-reset.write.ts +39 -0
- package/packages/bundled-features/src/auth-email-password/handlers/reset-password.write.ts +62 -0
- package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts +26 -0
- package/packages/bundled-features/src/auth-email-password/handlers/signup-confirm.write.ts +249 -0
- package/packages/bundled-features/src/auth-email-password/handlers/signup-request.write.ts +229 -0
- package/packages/bundled-features/src/auth-email-password/handlers/token-request-handler.ts +170 -0
- package/packages/bundled-features/src/auth-email-password/handlers/verify-email.write.ts +62 -0
- package/packages/bundled-features/src/auth-email-password/i18n.ts +153 -0
- package/packages/bundled-features/src/auth-email-password/index.ts +47 -0
- package/packages/bundled-features/src/auth-email-password/invite-token-store.ts +78 -0
- package/packages/bundled-features/src/auth-email-password/lockout-store.ts +34 -0
- package/packages/bundled-features/src/auth-email-password/magic-link-mail.ts +87 -0
- package/packages/bundled-features/src/auth-email-password/password-policy.ts +2108 -0
- package/packages/bundled-features/src/auth-email-password/reset-token.ts +30 -0
- package/packages/bundled-features/src/auth-email-password/seeding.ts +368 -0
- package/packages/bundled-features/src/auth-email-password/self-registration-toggle.ts +25 -0
- package/packages/bundled-features/src/auth-email-password/signed-token.ts +4 -0
- package/packages/bundled-features/src/auth-email-password/signup-token-store.ts +155 -0
- package/packages/bundled-features/src/auth-email-password/testing.ts +5 -0
- package/packages/bundled-features/src/auth-email-password/unlock-token.ts +28 -0
- package/packages/bundled-features/src/auth-email-password/verification-token.ts +29 -0
- package/packages/bundled-features/src/auth-email-password/web/auth-client.ts +472 -0
- package/packages/bundled-features/src/auth-email-password/web/auth-form-logic.ts +40 -0
- package/packages/bundled-features/src/auth-email-password/web/auth-form-primitives.tsx +112 -0
- package/packages/bundled-features/src/auth-email-password/web/auth-gate.tsx +179 -0
- package/packages/bundled-features/src/auth-email-password/web/client-plugin.ts +69 -0
- package/packages/bundled-features/src/auth-email-password/web/confirm-account-unlock-screen.tsx +96 -0
- package/packages/bundled-features/src/auth-email-password/web/default-topbar-actions.tsx +47 -0
- package/packages/bundled-features/src/auth-email-password/web/forgot-password-screen.tsx +111 -0
- package/packages/bundled-features/src/auth-email-password/web/index.ts +81 -0
- package/packages/bundled-features/src/auth-email-password/web/invite-accept-screen.tsx +272 -0
- package/packages/bundled-features/src/auth-email-password/web/login-screen.tsx +298 -0
- package/packages/bundled-features/src/auth-email-password/web/request-account-unlock-screen.tsx +112 -0
- package/packages/bundled-features/src/auth-email-password/web/reset-password-screen.tsx +149 -0
- package/packages/bundled-features/src/auth-email-password/web/session-bootstrap-error.tsx +66 -0
- package/packages/bundled-features/src/auth-email-password/web/session.tsx +231 -0
- package/packages/bundled-features/src/auth-email-password/web/signup-complete-screen.tsx +181 -0
- package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +128 -0
- package/packages/bundled-features/src/auth-email-password/web/tenant-menu-items.tsx +47 -0
- package/packages/bundled-features/src/auth-email-password/web/tenant-switcher.tsx +123 -0
- package/packages/bundled-features/src/auth-email-password/web/use-shell-user.ts +37 -0
- package/packages/bundled-features/src/auth-email-password/web/user-menu.tsx +149 -0
- package/packages/bundled-features/src/auth-email-password/web/verify-email-screen.tsx +99 -0
- package/packages/bundled-features/src/auth-foundation/boot-checks.ts +150 -0
- package/packages/bundled-features/src/auth-foundation/changes.json +20 -0
- package/packages/bundled-features/src/auth-foundation/feature.ts +157 -0
- package/packages/bundled-features/src/auth-foundation/index.ts +37 -0
- package/packages/bundled-features/src/auth-foundation/resolve-anonymous-access.ts +62 -0
- package/packages/bundled-features/src/auth-foundation/types.ts +180 -0
- package/packages/bundled-features/src/auth-mfa/base32.ts +51 -0
- package/packages/bundled-features/src/auth-mfa/changes.json +62 -0
- package/packages/bundled-features/src/auth-mfa/config.ts +26 -0
- package/packages/bundled-features/src/auth-mfa/constants.ts +47 -0
- package/packages/bundled-features/src/auth-mfa/db/queries.ts +45 -0
- package/packages/bundled-features/src/auth-mfa/errors.ts +66 -0
- package/packages/bundled-features/src/auth-mfa/feature.ts +251 -0
- package/packages/bundled-features/src/auth-mfa/handlers/disable.write.ts +83 -0
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +242 -0
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm.write.ts +123 -0
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start-preauth.write.ts +104 -0
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start.write.ts +95 -0
- package/packages/bundled-features/src/auth-mfa/handlers/reencrypt.job.ts +223 -0
- package/packages/bundled-features/src/auth-mfa/handlers/regenerate-recovery.write.ts +88 -0
- package/packages/bundled-features/src/auth-mfa/handlers/status.query.ts +32 -0
- package/packages/bundled-features/src/auth-mfa/handlers/verify.write.ts +203 -0
- package/packages/bundled-features/src/auth-mfa/hmac-token-codec.ts +79 -0
- package/packages/bundled-features/src/auth-mfa/i18n.ts +50 -0
- package/packages/bundled-features/src/auth-mfa/index.ts +30 -0
- package/packages/bundled-features/src/auth-mfa/mfa-challenge-token.ts +39 -0
- package/packages/bundled-features/src/auth-mfa/mfa-code-verifier.ts +45 -0
- package/packages/bundled-features/src/auth-mfa/mfa-preauth-setup-token.ts +38 -0
- package/packages/bundled-features/src/auth-mfa/mfa-setup-token.ts +96 -0
- package/packages/bundled-features/src/auth-mfa/mfa-status-checker.ts +98 -0
- package/packages/bundled-features/src/auth-mfa/mfa-verify-attempts.ts +32 -0
- package/packages/bundled-features/src/auth-mfa/otpauth-uri.ts +21 -0
- package/packages/bundled-features/src/auth-mfa/recovery-codes.ts +54 -0
- package/packages/bundled-features/src/auth-mfa/schema/user-mfa.ts +65 -0
- package/packages/bundled-features/src/auth-mfa/screens.ts +124 -0
- package/packages/bundled-features/src/auth-mfa/testing.ts +5 -0
- package/packages/bundled-features/src/auth-mfa/token-secrets.ts +41 -0
- package/packages/bundled-features/src/auth-mfa/totp.ts +67 -0
- package/packages/bundled-features/src/auth-mfa/verify-factor.ts +58 -0
- package/packages/bundled-features/src/auth-mfa/web/client-plugin.ts +36 -0
- package/packages/bundled-features/src/auth-mfa/web/i18n.ts +66 -0
- package/packages/bundled-features/src/auth-mfa/web/index.ts +25 -0
- package/packages/bundled-features/src/auth-mfa/web/mfa-client.ts +196 -0
- package/packages/bundled-features/src/auth-mfa/web/mfa-disable-dialog.tsx +70 -0
- package/packages/bundled-features/src/auth-mfa/web/mfa-recovery-codes-reveal.tsx +53 -0
- package/packages/bundled-features/src/auth-mfa/web/mfa-regenerate-recovery-dialog.tsx +69 -0
- package/packages/bundled-features/src/auth-mfa/web/mfa-setup-preauth-screen.tsx +269 -0
- package/packages/bundled-features/src/auth-mfa/web/mfa-verify-screen.tsx +117 -0
- package/packages/bundled-features/src/auth-mfa/web/qrcode-browser.d.ts +11 -0
- package/packages/bundled-features/src/auth-mfa-user-data/changes.json +1 -0
- package/packages/bundled-features/src/auth-mfa-user-data/hooks.ts +60 -0
- package/packages/bundled-features/src/auth-mfa-user-data/index.ts +21 -0
- package/packages/bundled-features/src/billing-foundation/aggregate-id.ts +74 -0
- package/packages/bundled-features/src/billing-foundation/billing-info-query.ts +95 -0
- package/packages/bundled-features/src/billing-foundation/changes.json +162 -0
- package/packages/bundled-features/src/billing-foundation/checkout-core.ts +395 -0
- package/packages/bundled-features/src/billing-foundation/constants.ts +237 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/confirmation-mail.ts +170 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-gate.ts +140 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-locale.ts +18 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-text.ts +55 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/issue-confirmation.ts +200 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-consent.ts +97 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-termination.ts +39 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-mail.ts +128 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-pages.ts +339 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-record.ts +206 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-request.ts +377 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-texts.ts +242 -0
- package/packages/bundled-features/src/billing-foundation/db/queries/payment-projection.ts +19 -0
- package/packages/bundled-features/src/billing-foundation/db/queries/subscription-projection.ts +15 -0
- package/packages/bundled-features/src/billing-foundation/entities.ts +132 -0
- package/packages/bundled-features/src/billing-foundation/events.ts +215 -0
- package/packages/bundled-features/src/billing-foundation/feature.ts +290 -0
- package/packages/bundled-features/src/billing-foundation/get-subscription-for-tenant.ts +58 -0
- package/packages/bundled-features/src/billing-foundation/handlers/billing-plans.query.ts +54 -0
- package/packages/bundled-features/src/billing-foundation/handlers/create-checkout-session.write.ts +132 -0
- package/packages/bundled-features/src/billing-foundation/handlers/create-portal-session.write.ts +103 -0
- package/packages/bundled-features/src/billing-foundation/handlers/list-subscriptions.query.ts +37 -0
- package/packages/bundled-features/src/billing-foundation/handlers/process-event.write.ts +244 -0
- package/packages/bundled-features/src/billing-foundation/handlers/process-payment-event.write.ts +122 -0
- package/packages/bundled-features/src/billing-foundation/handlers/start-plan-checkout.write.ts +100 -0
- package/packages/bundled-features/src/billing-foundation/handlers/switch-plan.write.ts +109 -0
- package/packages/bundled-features/src/billing-foundation/handlers/sync-subscription.write.ts +163 -0
- package/packages/bundled-features/src/billing-foundation/i18n.ts +133 -0
- package/packages/bundled-features/src/billing-foundation/index.ts +92 -0
- package/packages/bundled-features/src/billing-foundation/plan-catalog.ts +235 -0
- package/packages/bundled-features/src/billing-foundation/projection.ts +227 -0
- package/packages/bundled-features/src/billing-foundation/screens.ts +25 -0
- package/packages/bundled-features/src/billing-foundation/subscription-tier-sync.ts +175 -0
- package/packages/bundled-features/src/billing-foundation/tenant-destroy-hook.ts +81 -0
- package/packages/bundled-features/src/billing-foundation/types.ts +478 -0
- package/packages/bundled-features/src/billing-foundation/validate-options.ts +111 -0
- package/packages/bundled-features/src/billing-foundation/web/billing-plans-panel.tsx +361 -0
- package/packages/bundled-features/src/billing-foundation/web/cancel-contract-dialog.tsx +201 -0
- package/packages/bundled-features/src/billing-foundation/web/checkout-consent-dialog.tsx +146 -0
- package/packages/bundled-features/src/billing-foundation/web/client-plugin.tsx +21 -0
- package/packages/bundled-features/src/billing-foundation/web/index.ts +23 -0
- package/packages/bundled-features/src/billing-foundation/webhook-handler.ts +165 -0
- package/packages/bundled-features/src/cap-counter/aggregate-id.ts +49 -0
- package/packages/bundled-features/src/cap-counter/book-cap-usage.ts +205 -0
- package/packages/bundled-features/src/cap-counter/changes.json +47 -0
- package/packages/bundled-features/src/cap-counter/constants.ts +34 -0
- package/packages/bundled-features/src/cap-counter/enforce-cap.ts +415 -0
- package/packages/bundled-features/src/cap-counter/entity.ts +57 -0
- package/packages/bundled-features/src/cap-counter/feature.ts +135 -0
- package/packages/bundled-features/src/cap-counter/handlers/get-counter.query.ts +37 -0
- package/packages/bundled-features/src/cap-counter/handlers/increment-rolling.write.ts +80 -0
- package/packages/bundled-features/src/cap-counter/handlers/increment.write.ts +51 -0
- package/packages/bundled-features/src/cap-counter/handlers/mark-soft-warned.write.ts +30 -0
- package/packages/bundled-features/src/cap-counter/i18n.ts +13 -0
- package/packages/bundled-features/src/cap-counter/index.ts +50 -0
- package/packages/bundled-features/src/cap-counter/stock-cap-guard.ts +80 -0
- package/packages/bundled-features/src/cap-counter/with-cap-enforcement.ts +183 -0
- package/packages/bundled-features/src/cap-overview/access.ts +35 -0
- package/packages/bundled-features/src/cap-overview/changes.json +57 -0
- package/packages/bundled-features/src/cap-overview/constants.ts +26 -0
- package/packages/bundled-features/src/cap-overview/feature.ts +87 -0
- package/packages/bundled-features/src/cap-overview/handlers/caps-usage.query.ts +109 -0
- package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +306 -0
- package/packages/bundled-features/src/cap-overview/handlers/tenant-options.query.ts +35 -0
- package/packages/bundled-features/src/cap-overview/i18n.ts +31 -0
- package/packages/bundled-features/src/cap-overview/index.ts +21 -0
- package/packages/bundled-features/src/cap-overview/screens.ts +109 -0
- package/packages/bundled-features/src/cap-overview/types.ts +66 -0
- package/packages/bundled-features/src/cap-overview/usage-math.ts +34 -0
- package/packages/bundled-features/src/cap-overview/web/cap-cards-panel.tsx +119 -0
- package/packages/bundled-features/src/cap-overview/web/cap-usage-bar.tsx +56 -0
- package/packages/bundled-features/src/cap-overview/web/cap-usage-cell.tsx +21 -0
- package/packages/bundled-features/src/cap-overview/web/client-plugin.tsx +27 -0
- package/packages/bundled-features/src/cap-overview/web/index.ts +10 -0
- package/packages/bundled-features/src/channel-email/changes.json +15 -0
- package/packages/bundled-features/src/channel-email/email-channel.ts +127 -0
- package/packages/bundled-features/src/channel-email/feature.ts +26 -0
- package/packages/bundled-features/src/channel-email/index.ts +10 -0
- package/packages/bundled-features/src/channel-email/pii-guard.ts +55 -0
- package/packages/bundled-features/src/channel-email/smtp-transport.ts +111 -0
- package/packages/bundled-features/src/channel-email/types.ts +43 -0
- package/packages/bundled-features/src/channel-in-app/changes.json +1 -0
- package/packages/bundled-features/src/channel-in-app/constants.ts +11 -0
- package/packages/bundled-features/src/channel-in-app/feature.ts +45 -0
- package/packages/bundled-features/src/channel-in-app/handlers/inbox.query.ts +30 -0
- package/packages/bundled-features/src/channel-in-app/handlers/mark-all-read.write.ts +27 -0
- package/packages/bundled-features/src/channel-in-app/handlers/mark-read.write.ts +34 -0
- package/packages/bundled-features/src/channel-in-app/handlers/unread-count.query.ts +29 -0
- package/packages/bundled-features/src/channel-in-app/in-app-channel.ts +41 -0
- package/packages/bundled-features/src/channel-in-app/index.ts +4 -0
- package/packages/bundled-features/src/channel-in-app/tables.ts +31 -0
- package/packages/bundled-features/src/channel-push/changes.json +1 -0
- package/packages/bundled-features/src/channel-push/feature.ts +25 -0
- package/packages/bundled-features/src/channel-push/index.ts +3 -0
- package/packages/bundled-features/src/channel-push/push-channel.ts +34 -0
- package/packages/bundled-features/src/channel-push/types.ts +22 -0
- package/packages/bundled-features/src/compliance-profiles/README.md +88 -0
- package/packages/bundled-features/src/compliance-profiles/_internal/parse-override.ts +20 -0
- package/packages/bundled-features/src/compliance-profiles/changes.json +8 -0
- package/packages/bundled-features/src/compliance-profiles/constants.ts +20 -0
- package/packages/bundled-features/src/compliance-profiles/feature.ts +114 -0
- package/packages/bundled-features/src/compliance-profiles/handlers/for-tenant.query.ts +50 -0
- package/packages/bundled-features/src/compliance-profiles/handlers/list-profiles.query.ts +52 -0
- package/packages/bundled-features/src/compliance-profiles/handlers/needs-profile.query.ts +75 -0
- package/packages/bundled-features/src/compliance-profiles/handlers/set-profile.write.ts +142 -0
- package/packages/bundled-features/src/compliance-profiles/handlers/sub-processors.query.ts +46 -0
- package/packages/bundled-features/src/compliance-profiles/i18n.ts +31 -0
- package/packages/bundled-features/src/compliance-profiles/index.ts +13 -0
- package/packages/bundled-features/src/compliance-profiles/resolve-for-tenant.ts +57 -0
- package/packages/bundled-features/src/compliance-profiles/schema/profile-selection.ts +53 -0
- package/packages/bundled-features/src/compliance-profiles/seeding.ts +101 -0
- package/packages/bundled-features/src/compliance-profiles/web/client-plugin.tsx +25 -0
- package/packages/bundled-features/src/compliance-profiles/web/compliance-profile-catalog.tsx +55 -0
- package/packages/bundled-features/src/compliance-profiles/web/i18n.ts +9 -0
- package/packages/bundled-features/src/compliance-profiles/web/index.ts +6 -0
- package/packages/bundled-features/src/compliance-profiles-ops/handlers/tenants-missing-profile.query.ts +56 -0
- package/packages/bundled-features/src/compliance-profiles-ops/index.ts +34 -0
- package/packages/bundled-features/src/config/changes.json +35 -0
- package/packages/bundled-features/src/config/constants.ts +30 -0
- package/packages/bundled-features/src/config/db/queries/resolver.ts +51 -0
- package/packages/bundled-features/src/config/feature.ts +169 -0
- package/packages/bundled-features/src/config/handlers/cascade.query.ts +94 -0
- package/packages/bundled-features/src/config/handlers/readiness.query.ts +164 -0
- package/packages/bundled-features/src/config/handlers/reencrypt.job.ts +274 -0
- package/packages/bundled-features/src/config/handlers/reset.write.ts +76 -0
- package/packages/bundled-features/src/config/handlers/schema.query.ts +36 -0
- package/packages/bundled-features/src/config/handlers/selected-extensions.query.ts +71 -0
- package/packages/bundled-features/src/config/handlers/set.write.ts +227 -0
- package/packages/bundled-features/src/config/handlers/values.query.ts +92 -0
- package/packages/bundled-features/src/config/i18n.ts +4 -0
- package/packages/bundled-features/src/config/index.ts +38 -0
- package/packages/bundled-features/src/config/read-redaction.ts +64 -0
- package/packages/bundled-features/src/config/resolver.ts +687 -0
- package/packages/bundled-features/src/config/table.ts +40 -0
- package/packages/bundled-features/src/config/web/client-plugin.ts +24 -0
- package/packages/bundled-features/src/config/web/i18n.ts +48 -0
- package/packages/bundled-features/src/config/web/index.ts +7 -0
- package/packages/bundled-features/src/config/write-helpers.ts +377 -0
- package/packages/bundled-features/src/crypto-shredding/changes.json +58 -0
- package/packages/bundled-features/src/crypto-shredding/constants.ts +11 -0
- package/packages/bundled-features/src/crypto-shredding/feature.ts +30 -0
- package/packages/bundled-features/src/crypto-shredding/handlers/forget-subject.write.ts +454 -0
- package/packages/bundled-features/src/crypto-shredding/index.ts +13 -0
- package/packages/bundled-features/src/custom-fields/aggregate-id.ts +34 -0
- package/packages/bundled-features/src/custom-fields/changes.json +15 -0
- package/packages/bundled-features/src/custom-fields/constants.ts +79 -0
- package/packages/bundled-features/src/custom-fields/db/queries/field-access.ts +17 -0
- package/packages/bundled-features/src/custom-fields/db/queries/projection.ts +84 -0
- package/packages/bundled-features/src/custom-fields/db/queries/quota.ts +20 -0
- package/packages/bundled-features/src/custom-fields/db/queries/retention.ts +43 -0
- package/packages/bundled-features/src/custom-fields/db/queries/user-data-rights.ts +39 -0
- package/packages/bundled-features/src/custom-fields/entity.ts +112 -0
- package/packages/bundled-features/src/custom-fields/events.ts +25 -0
- package/packages/bundled-features/src/custom-fields/executor.ts +10 -0
- package/packages/bundled-features/src/custom-fields/feature.ts +289 -0
- package/packages/bundled-features/src/custom-fields/handlers/clear-custom-field.write.ts +82 -0
- package/packages/bundled-features/src/custom-fields/handlers/define-system-field.write.ts +45 -0
- package/packages/bundled-features/src/custom-fields/handlers/define-tenant-field.write.ts +108 -0
- package/packages/bundled-features/src/custom-fields/handlers/delete-system-field.write.ts +49 -0
- package/packages/bundled-features/src/custom-fields/handlers/delete-tenant-field.write.ts +74 -0
- package/packages/bundled-features/src/custom-fields/handlers/set-custom-field.write.ts +124 -0
- package/packages/bundled-features/src/custom-fields/handlers/update-tenant-field.write.ts +98 -0
- package/packages/bundled-features/src/custom-fields/index.ts +40 -0
- package/packages/bundled-features/src/custom-fields/lib/define-or-resurrect.ts +52 -0
- package/packages/bundled-features/src/custom-fields/lib/field-access.ts +75 -0
- package/packages/bundled-features/src/custom-fields/lib/field-definition-row.ts +33 -0
- package/packages/bundled-features/src/custom-fields/lib/parse-serialized-field.ts +64 -0
- package/packages/bundled-features/src/custom-fields/lib/quota.ts +5 -0
- package/packages/bundled-features/src/custom-fields/lib/value-schema.ts +91 -0
- package/packages/bundled-features/src/custom-fields/run-retention.ts +201 -0
- package/packages/bundled-features/src/custom-fields/schemas.ts +98 -0
- package/packages/bundled-features/src/custom-fields/web/client-plugin.tsx +27 -0
- package/packages/bundled-features/src/custom-fields/web/custom-fields-form-section.tsx +247 -0
- package/packages/bundled-features/src/custom-fields/web/i18n.ts +22 -0
- package/packages/bundled-features/src/custom-fields/web/index.ts +8 -0
- package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +226 -0
- package/packages/bundled-features/src/custom-fields/wire-user-data-rights.ts +79 -0
- package/packages/bundled-features/src/data-retention/_internal/parse-override.ts +34 -0
- package/packages/bundled-features/src/data-retention/changes.json +50 -0
- package/packages/bundled-features/src/data-retention/feature.ts +123 -0
- package/packages/bundled-features/src/data-retention/handlers/policy-for.query.ts +46 -0
- package/packages/bundled-features/src/data-retention/index.ts +20 -0
- package/packages/bundled-features/src/data-retention/keep-for.ts +75 -0
- package/packages/bundled-features/src/data-retention/override-schema.ts +37 -0
- package/packages/bundled-features/src/data-retention/presets.ts +72 -0
- package/packages/bundled-features/src/data-retention/resolve-for-tenant.ts +84 -0
- package/packages/bundled-features/src/data-retention/resolve-tenant-preset.ts +54 -0
- package/packages/bundled-features/src/data-retention/resolver.ts +107 -0
- package/packages/bundled-features/src/data-retention/run-retention-cleanup.ts +814 -0
- package/packages/bundled-features/src/data-retention/schema/tenant-retention-override.ts +50 -0
- package/packages/bundled-features/src/delivery/address-opt-out.ts +204 -0
- package/packages/bundled-features/src/delivery/attempt-log.ts +66 -0
- package/packages/bundled-features/src/delivery/changes.json +86 -0
- package/packages/bundled-features/src/delivery/channel-context.ts +17 -0
- package/packages/bundled-features/src/delivery/constants.ts +36 -0
- package/packages/bundled-features/src/delivery/db/queries/address-opt-outs.ts +23 -0
- package/packages/bundled-features/src/delivery/db/queries/preferences.ts +32 -0
- package/packages/bundled-features/src/delivery/delivery-service.ts +625 -0
- package/packages/bundled-features/src/delivery/events.ts +24 -0
- package/packages/bundled-features/src/delivery/feature.ts +206 -0
- package/packages/bundled-features/src/delivery/handlers/log.query.ts +177 -0
- package/packages/bundled-features/src/delivery/handlers/preferences.query.ts +42 -0
- package/packages/bundled-features/src/delivery/handlers/resubscribe-address.write.ts +42 -0
- package/packages/bundled-features/src/delivery/handlers/resubscribe-user.write.ts +41 -0
- package/packages/bundled-features/src/delivery/handlers/set-preference.write.ts +47 -0
- package/packages/bundled-features/src/delivery/handlers/unsubscribe-address.write.ts +40 -0
- package/packages/bundled-features/src/delivery/handlers/unsubscribe-user.write.ts +43 -0
- package/packages/bundled-features/src/delivery/i18n.ts +11 -0
- package/packages/bundled-features/src/delivery/index.ts +52 -0
- package/packages/bundled-features/src/delivery/jobs.ts +169 -0
- package/packages/bundled-features/src/delivery/public-names.ts +60 -0
- package/packages/bundled-features/src/delivery/tables.ts +155 -0
- package/packages/bundled-features/src/delivery/testing.ts +53 -0
- package/packages/bundled-features/src/delivery/types.ts +121 -0
- package/packages/bundled-features/src/delivery/unsubscribe.ts +429 -0
- package/packages/bundled-features/src/delivery/upsert-preference.ts +154 -0
- package/packages/bundled-features/src/delivery/web/client-plugin.tsx +19 -0
- package/packages/bundled-features/src/delivery/web/delivery-status-cell.tsx +26 -0
- package/packages/bundled-features/src/delivery/web/index.ts +3 -0
- package/packages/bundled-features/src/derivatives-sharp/changes.json +19 -0
- package/packages/bundled-features/src/derivatives-sharp/feature.ts +22 -0
- package/packages/bundled-features/src/derivatives-sharp/index.ts +2 -0
- package/packages/bundled-features/src/derivatives-sharp/render.ts +431 -0
- package/packages/bundled-features/src/document-ingest-foundation/boot-checks.ts +58 -0
- package/packages/bundled-features/src/document-ingest-foundation/changes.json +44 -0
- package/packages/bundled-features/src/document-ingest-foundation/entity.ts +59 -0
- package/packages/bundled-features/src/document-ingest-foundation/events.ts +43 -0
- package/packages/bundled-features/src/document-ingest-foundation/executor.ts +12 -0
- package/packages/bundled-features/src/document-ingest-foundation/feature.ts +226 -0
- package/packages/bundled-features/src/document-ingest-foundation/file-ref-liveness.ts +10 -0
- package/packages/bundled-features/src/document-ingest-foundation/forget-extract-with-file-ref.ts +84 -0
- package/packages/bundled-features/src/document-ingest-foundation/index.ts +34 -0
- package/packages/bundled-features/src/document-ingest-foundation/pages.ts +34 -0
- package/packages/bundled-features/src/document-ingest-foundation/providers.ts +87 -0
- package/packages/bundled-features/src/document-ingest-foundation/tenant-destroy-hook.ts +34 -0
- package/packages/bundled-features/src/document-ingest-foundation/write-document-extract.ts +57 -0
- package/packages/bundled-features/src/feature-toggles/changes.json +31 -0
- package/packages/bundled-features/src/feature-toggles/compose-tier-resolver.ts +134 -0
- package/packages/bundled-features/src/feature-toggles/constants.ts +40 -0
- package/packages/bundled-features/src/feature-toggles/events.ts +18 -0
- package/packages/bundled-features/src/feature-toggles/feature.ts +173 -0
- package/packages/bundled-features/src/feature-toggles/global-feature-state-table.ts +47 -0
- package/packages/bundled-features/src/feature-toggles/handlers/list.query.ts +45 -0
- package/packages/bundled-features/src/feature-toggles/handlers/registered.query.ts +87 -0
- package/packages/bundled-features/src/feature-toggles/handlers/set.write.ts +194 -0
- package/packages/bundled-features/src/feature-toggles/i18n.ts +11 -0
- package/packages/bundled-features/src/feature-toggles/index.ts +20 -0
- package/packages/bundled-features/src/feature-toggles/toggle-runtime.ts +135 -0
- package/packages/bundled-features/src/feature-toggles/toggle-sync-signal.ts +64 -0
- package/packages/bundled-features/src/feature-toggles/web/client-plugin.tsx +18 -0
- package/packages/bundled-features/src/feature-toggles/web/i18n.ts +17 -0
- package/packages/bundled-features/src/feature-toggles/web/index.ts +5 -0
- package/packages/bundled-features/src/file-derivatives/changes.json +27 -0
- package/packages/bundled-features/src/file-derivatives/feature.ts +236 -0
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant-by-file-ref.query.ts +57 -0
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant.query.ts +156 -0
- package/packages/bundled-features/src/file-derivatives/index.ts +11 -0
- package/packages/bundled-features/src/file-derivatives/presets.ts +10 -0
- package/packages/bundled-features/src/file-foundation/changes.json +9 -0
- package/packages/bundled-features/src/file-foundation/feature.ts +72 -0
- package/packages/bundled-features/src/file-foundation/index.ts +9 -0
- package/packages/bundled-features/src/file-provider-inmemory/changes.json +1 -0
- package/packages/bundled-features/src/file-provider-inmemory/feature.ts +84 -0
- package/packages/bundled-features/src/file-provider-inmemory/index.ts +3 -0
- package/packages/bundled-features/src/file-provider-s3/changes.json +1 -0
- package/packages/bundled-features/src/file-provider-s3/feature.ts +176 -0
- package/packages/bundled-features/src/file-provider-s3/index.ts +3 -0
- package/packages/bundled-features/src/file-provider-s3-env/changes.json +1 -0
- package/packages/bundled-features/src/file-provider-s3-env/feature.ts +58 -0
- package/packages/bundled-features/src/file-provider-s3-env/index.ts +3 -0
- package/packages/bundled-features/src/files/README.md +50 -0
- package/packages/bundled-features/src/files/changes.json +1 -0
- package/packages/bundled-features/src/files/feature.ts +7 -0
- package/packages/bundled-features/src/files/index.ts +1 -0
- package/packages/bundled-features/src/files-provider-s3/changes.json +1 -0
- package/packages/bundled-features/src/files-provider-s3/env-helper.ts +49 -0
- package/packages/bundled-features/src/files-provider-s3/index.ts +3 -0
- package/packages/bundled-features/src/files-provider-s3/s3-provider.ts +196 -0
- package/packages/bundled-features/src/files-tenant-data/changes.json +9 -0
- package/packages/bundled-features/src/files-tenant-data/handlers/sweep-orphaned-derivatives.job.ts +168 -0
- package/packages/bundled-features/src/files-tenant-data/hooks.ts +203 -0
- package/packages/bundled-features/src/files-tenant-data/index.ts +68 -0
- package/packages/bundled-features/src/folders/aggregate-id.ts +23 -0
- package/packages/bundled-features/src/folders/changes.json +9 -0
- package/packages/bundled-features/src/folders/constants.ts +40 -0
- package/packages/bundled-features/src/folders/entity.ts +87 -0
- package/packages/bundled-features/src/folders/executor.ts +11 -0
- package/packages/bundled-features/src/folders/feature.ts +192 -0
- package/packages/bundled-features/src/folders/handlers/clear-folder.write.ts +51 -0
- package/packages/bundled-features/src/folders/handlers/delete-folder.write.ts +43 -0
- package/packages/bundled-features/src/folders/handlers/set-folder.write.ts +99 -0
- package/packages/bundled-features/src/folders/index.ts +23 -0
- package/packages/bundled-features/src/folders/schemas.ts +18 -0
- package/packages/bundled-features/src/folders/web/client-plugin.tsx +16 -0
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +562 -0
- package/packages/bundled-features/src/folders/web/folder-section.tsx +205 -0
- package/packages/bundled-features/src/folders/web/i18n.ts +34 -0
- package/packages/bundled-features/src/folders/web/index.ts +6 -0
- package/packages/bundled-features/src/folders/web/tree.ts +65 -0
- package/packages/bundled-features/src/folders-user-data/changes.json +1 -0
- package/packages/bundled-features/src/folders-user-data/hooks.ts +76 -0
- package/packages/bundled-features/src/folders-user-data/index.ts +33 -0
- package/packages/bundled-features/src/form-draft/changes.json +1 -0
- package/packages/bundled-features/src/form-draft/constants.ts +50 -0
- package/packages/bundled-features/src/form-draft/db/queries/cleanup.ts +72 -0
- package/packages/bundled-features/src/form-draft/db/queries/draft-count.ts +21 -0
- package/packages/bundled-features/src/form-draft/db/queries/owned-file-refs.ts +74 -0
- package/packages/bundled-features/src/form-draft/entity.ts +59 -0
- package/packages/bundled-features/src/form-draft/executor.ts +7 -0
- package/packages/bundled-features/src/form-draft/feature.ts +59 -0
- package/packages/bundled-features/src/form-draft/handlers/cleanup.job.ts +200 -0
- package/packages/bundled-features/src/form-draft/handlers/discard.write.ts +110 -0
- package/packages/bundled-features/src/form-draft/handlers/get.query.ts +38 -0
- package/packages/bundled-features/src/form-draft/handlers/list.query.ts +54 -0
- package/packages/bundled-features/src/form-draft/handlers/save.write.ts +86 -0
- package/packages/bundled-features/src/form-draft/index.ts +28 -0
- package/packages/bundled-features/src/form-draft/lookup.ts +62 -0
- package/packages/bundled-features/src/form-draft/release-file-refs.ts +69 -0
- package/packages/bundled-features/src/form-draft/schemas.ts +61 -0
- package/packages/bundled-features/src/form-draft-user-data/changes.json +1 -0
- package/packages/bundled-features/src/form-draft-user-data/hooks.ts +57 -0
- package/packages/bundled-features/src/form-draft-user-data/index.ts +21 -0
- package/packages/bundled-features/src/foundation-shared/changes.json +1 -0
- package/packages/bundled-features/src/foundation-shared/config-helpers.ts +97 -0
- package/packages/bundled-features/src/foundation-shared/host-allowlist.ts +17 -0
- package/packages/bundled-features/src/foundation-shared/index.ts +14 -0
- package/packages/bundled-features/src/foundation-shared/mail-host-policy.ts +60 -0
- package/packages/bundled-features/src/inbound-mail-foundation/aggregate-id.ts +40 -0
- package/packages/bundled-features/src/inbound-mail-foundation/changes.json +32 -0
- package/packages/bundled-features/src/inbound-mail-foundation/connect-routes.ts +253 -0
- package/packages/bundled-features/src/inbound-mail-foundation/constants.ts +80 -0
- package/packages/bundled-features/src/inbound-mail-foundation/db/queries/inbound-projections.ts +38 -0
- package/packages/bundled-features/src/inbound-mail-foundation/entities.ts +222 -0
- package/packages/bundled-features/src/inbound-mail-foundation/events.ts +147 -0
- package/packages/bundled-features/src/inbound-mail-foundation/feature.ts +265 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/account-state.ts +23 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/connect-account.write.ts +118 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/disconnect-account.write.ts +72 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/ingest-message.write.ts +339 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-accounts.query.ts +44 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-messages.query.ts +59 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/scope-visibility.ts +14 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/update-account.write.ts +80 -0
- package/packages/bundled-features/src/inbound-mail-foundation/index.ts +96 -0
- package/packages/bundled-features/src/inbound-mail-foundation/oauth-state.ts +103 -0
- package/packages/bundled-features/src/inbound-mail-foundation/projection.ts +155 -0
- package/packages/bundled-features/src/inbound-mail-foundation/provider-factory.ts +53 -0
- package/packages/bundled-features/src/inbound-mail-foundation/retention-sweep.ts +168 -0
- package/packages/bundled-features/src/inbound-mail-foundation/tenant-destroy-hook.ts +88 -0
- package/packages/bundled-features/src/inbound-mail-foundation/types.ts +257 -0
- package/packages/bundled-features/src/inbound-mail-foundation/watch-supervisor.ts +678 -0
- package/packages/bundled-features/src/inbound-provider-imap/changes.json +14 -0
- package/packages/bundled-features/src/inbound-provider-imap/credential-document.ts +51 -0
- package/packages/bundled-features/src/inbound-provider-imap/feature.ts +286 -0
- package/packages/bundled-features/src/inbound-provider-imap/imap-client.ts +216 -0
- package/packages/bundled-features/src/inbound-provider-imap/index.ts +17 -0
- package/packages/bundled-features/src/inbound-provider-inmemory/changes.json +1 -0
- package/packages/bundled-features/src/inbound-provider-inmemory/feature.ts +154 -0
- package/packages/bundled-features/src/inbound-provider-inmemory/index.ts +12 -0
- package/packages/bundled-features/src/jobs/changes.json +47 -0
- package/packages/bundled-features/src/jobs/constants.ts +33 -0
- package/packages/bundled-features/src/jobs/db/queries/retention.ts +60 -0
- package/packages/bundled-features/src/jobs/db/queries/stale-run-sweep.ts +84 -0
- package/packages/bundled-features/src/jobs/events.ts +36 -0
- package/packages/bundled-features/src/jobs/feature.ts +256 -0
- package/packages/bundled-features/src/jobs/handlers/catalog.query.ts +42 -0
- package/packages/bundled-features/src/jobs/handlers/detail.query.ts +69 -0
- package/packages/bundled-features/src/jobs/handlers/list.query.ts +79 -0
- package/packages/bundled-features/src/jobs/handlers/projection-rebuild.job.ts +43 -0
- package/packages/bundled-features/src/jobs/handlers/reindex-entity.job.ts +56 -0
- package/packages/bundled-features/src/jobs/handlers/retention-cleanup.job.ts +23 -0
- package/packages/bundled-features/src/jobs/handlers/retry.write.ts +100 -0
- package/packages/bundled-features/src/jobs/handlers/stale-run-sweep.job.ts +30 -0
- package/packages/bundled-features/src/jobs/handlers/tenant-failures.query.ts +73 -0
- package/packages/bundled-features/src/jobs/handlers/trigger.write.ts +85 -0
- package/packages/bundled-features/src/jobs/i18n.ts +54 -0
- package/packages/bundled-features/src/jobs/index.ts +7 -0
- package/packages/bundled-features/src/jobs/is-manual-trigger.ts +5 -0
- package/packages/bundled-features/src/jobs/job-instant.ts +9 -0
- package/packages/bundled-features/src/jobs/job-run-logger.ts +457 -0
- package/packages/bundled-features/src/jobs/job-run-table.ts +101 -0
- package/packages/bundled-features/src/jobs/tenant-job-failure-table.ts +38 -0
- package/packages/bundled-features/src/jobs/web/client-plugin.tsx +16 -0
- package/packages/bundled-features/src/jobs/web/i18n.ts +8 -0
- package/packages/bundled-features/src/jobs/web/index.ts +2 -0
- package/packages/bundled-features/src/ledger/changes.json +16 -0
- package/packages/bundled-features/src/ledger/constants.ts +60 -0
- package/packages/bundled-features/src/ledger/entity.ts +177 -0
- package/packages/bundled-features/src/ledger/executor.ts +18 -0
- package/packages/bundled-features/src/ledger/feature.ts +180 -0
- package/packages/bundled-features/src/ledger/handlers/confirm-schedule-period.write.ts +134 -0
- package/packages/bundled-features/src/ledger/handlers/create-transaction.write.ts +48 -0
- package/packages/bundled-features/src/ledger/handlers/reports.query.ts +84 -0
- package/packages/bundled-features/src/ledger/handlers/reverse-transaction.write.ts +95 -0
- package/packages/bundled-features/src/ledger/index.ts +71 -0
- package/packages/bundled-features/src/ledger/recurring.ts +149 -0
- package/packages/bundled-features/src/ledger/reports.ts +164 -0
- package/packages/bundled-features/src/ledger/schemas.ts +71 -0
- package/packages/bundled-features/src/ledger/subject-reference.ts +10 -0
- package/packages/bundled-features/src/ledger/web/index.ts +36 -0
- package/packages/bundled-features/src/legal-pages/README.md +238 -0
- package/packages/bundled-features/src/legal-pages/changes.json +8 -0
- package/packages/bundled-features/src/legal-pages/constants.ts +54 -0
- package/packages/bundled-features/src/legal-pages/feature.ts +287 -0
- package/packages/bundled-features/src/legal-pages/index.ts +16 -0
- package/packages/bundled-features/src/legal-pages/markdown.ts +7 -0
- package/packages/bundled-features/src/legal-pages/web/client-plugin.ts +81 -0
- package/packages/bundled-features/src/legal-pages/web/index.ts +4 -0
- package/packages/bundled-features/src/mail-foundation/changes.json +1 -0
- package/packages/bundled-features/src/mail-foundation/feature.ts +233 -0
- package/packages/bundled-features/src/mail-foundation/index.ts +17 -0
- package/packages/bundled-features/src/mail-transport-inmemory/changes.json +1 -0
- package/packages/bundled-features/src/mail-transport-inmemory/feature.ts +97 -0
- package/packages/bundled-features/src/mail-transport-inmemory/index.ts +3 -0
- package/packages/bundled-features/src/mail-transport-smtp/changes.json +20 -0
- package/packages/bundled-features/src/mail-transport-smtp/feature.ts +268 -0
- package/packages/bundled-features/src/mail-transport-smtp/index.ts +8 -0
- package/packages/bundled-features/src/managed-pages/branding.ts +173 -0
- package/packages/bundled-features/src/managed-pages/changes.json +25 -0
- package/packages/bundled-features/src/managed-pages/css-gate.ts +24 -0
- package/packages/bundled-features/src/managed-pages/feature.ts +267 -0
- package/packages/bundled-features/src/managed-pages/handlers/branding.query.ts +37 -0
- package/packages/bundled-features/src/managed-pages/handlers/by-slug.query.ts +40 -0
- package/packages/bundled-features/src/managed-pages/handlers/by-tenant-published.query.ts +55 -0
- package/packages/bundled-features/src/managed-pages/handlers/page-crud.ts +49 -0
- package/packages/bundled-features/src/managed-pages/handlers/set.write.ts +133 -0
- package/packages/bundled-features/src/managed-pages/i18n.ts +62 -0
- package/packages/bundled-features/src/managed-pages/index.ts +30 -0
- package/packages/bundled-features/src/managed-pages/screens/branding-screen.ts +115 -0
- package/packages/bundled-features/src/managed-pages/screens/page-screens.ts +89 -0
- package/packages/bundled-features/src/managed-pages/seeding.ts +99 -0
- package/packages/bundled-features/src/managed-pages/table.ts +80 -0
- package/packages/bundled-features/src/managed-pages/web/client-plugin.tsx +22 -0
- package/packages/bundled-features/src/managed-pages/web/i18n.ts +19 -0
- package/packages/bundled-features/src/managed-pages/web/index.ts +3 -0
- package/packages/bundled-features/src/metrics/changes.json +21 -0
- package/packages/bundled-features/src/metrics/compute.ts +243 -0
- package/packages/bundled-features/src/metrics/constants.ts +22 -0
- package/packages/bundled-features/src/metrics/default-metrics.ts +133 -0
- package/packages/bundled-features/src/metrics/feature.ts +159 -0
- package/packages/bundled-features/src/metrics/i18n.ts +18 -0
- package/packages/bundled-features/src/metrics/index.ts +33 -0
- package/packages/bundled-features/src/metrics/types.ts +81 -0
- package/packages/bundled-features/src/metrics/validate.ts +73 -0
- package/packages/bundled-features/src/metrics/window.ts +89 -0
- package/packages/bundled-features/src/notes-history/changes.json +30 -0
- package/packages/bundled-features/src/notes-history/constants.ts +34 -0
- package/packages/bundled-features/src/notes-history/entity.ts +128 -0
- package/packages/bundled-features/src/notes-history/executor.ts +22 -0
- package/packages/bundled-features/src/notes-history/feature.ts +150 -0
- package/packages/bundled-features/src/notes-history/handlers/add-note.write.ts +118 -0
- package/packages/bundled-features/src/notes-history/i18n.ts +3 -0
- package/packages/bundled-features/src/notes-history/index.ts +25 -0
- package/packages/bundled-features/src/notes-history/schemas.ts +17 -0
- package/packages/bundled-features/src/notes-history/web/client-plugin.tsx +16 -0
- package/packages/bundled-features/src/notes-history/web/i18n.ts +22 -0
- package/packages/bundled-features/src/notes-history/web/index.ts +8 -0
- package/packages/bundled-features/src/notes-history/web/notes-section.tsx +190 -0
- package/packages/bundled-features/src/notes-history-user-data/changes.json +8 -0
- package/packages/bundled-features/src/notes-history-user-data/hooks.ts +131 -0
- package/packages/bundled-features/src/notes-history-user-data/index.ts +34 -0
- package/packages/bundled-features/src/page-render/branding.ts +100 -0
- package/packages/bundled-features/src/page-render/cached-page-response.ts +25 -0
- package/packages/bundled-features/src/page-render/changes.json +14 -0
- package/packages/bundled-features/src/page-render/css-sanitize.ts +344 -0
- package/packages/bundled-features/src/page-render/index.ts +22 -0
- package/packages/bundled-features/src/page-render/layout.ts +115 -0
- package/packages/bundled-features/src/page-render/markdown.ts +31 -0
- package/packages/bundled-features/src/page-render/security-headers.ts +19 -0
- package/packages/bundled-features/src/page-render/web.ts +14 -0
- package/packages/bundled-features/src/personal-access-tokens/changes.json +25 -0
- package/packages/bundled-features/src/personal-access-tokens/constants.ts +45 -0
- package/packages/bundled-features/src/personal-access-tokens/expiry.ts +7 -0
- package/packages/bundled-features/src/personal-access-tokens/feature.ts +184 -0
- package/packages/bundled-features/src/personal-access-tokens/handlers/available-scopes.query.ts +29 -0
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +124 -0
- package/packages/bundled-features/src/personal-access-tokens/handlers/list.query.ts +117 -0
- package/packages/bundled-features/src/personal-access-tokens/handlers/revoke.write.ts +62 -0
- package/packages/bundled-features/src/personal-access-tokens/hash.ts +17 -0
- package/packages/bundled-features/src/personal-access-tokens/i18n.ts +64 -0
- package/packages/bundled-features/src/personal-access-tokens/index.ts +43 -0
- package/packages/bundled-features/src/personal-access-tokens/pat-revoked-event.ts +23 -0
- package/packages/bundled-features/src/personal-access-tokens/resolver.ts +53 -0
- package/packages/bundled-features/src/personal-access-tokens/revoke-for-user.ts +62 -0
- package/packages/bundled-features/src/personal-access-tokens/roles.ts +37 -0
- package/packages/bundled-features/src/personal-access-tokens/schema/api-token.ts +93 -0
- package/packages/bundled-features/src/personal-access-tokens/scopes.ts +43 -0
- package/packages/bundled-features/src/personal-access-tokens/screens.ts +131 -0
- package/packages/bundled-features/src/presets/changes.json +8 -0
- package/packages/bundled-features/src/presets/dsgvo-self-service.ts +33 -0
- package/packages/bundled-features/src/presets/index.ts +2 -0
- package/packages/bundled-features/src/presets/security-baseline.ts +19 -0
- package/packages/bundled-features/src/rate-limiting/changes.json +14 -0
- package/packages/bundled-features/src/rate-limiting/constants.ts +10 -0
- package/packages/bundled-features/src/rate-limiting/feature.ts +30 -0
- package/packages/bundled-features/src/rate-limiting/handlers/bucket-access.ts +45 -0
- package/packages/bundled-features/src/rate-limiting/handlers/status.query.ts +60 -0
- package/packages/bundled-features/src/rate-limiting/i18n.ts +10 -0
- package/packages/bundled-features/src/rate-limiting/index.ts +2 -0
- package/packages/bundled-features/src/readiness/changes.json +1 -0
- package/packages/bundled-features/src/readiness/constants.ts +7 -0
- package/packages/bundled-features/src/readiness/feature.ts +31 -0
- package/packages/bundled-features/src/readiness/handlers/status.query.ts +55 -0
- package/packages/bundled-features/src/readiness/index.ts +3 -0
- package/packages/bundled-features/src/renderer-foundation/README.md +86 -0
- package/packages/bundled-features/src/renderer-foundation/api.ts +106 -0
- package/packages/bundled-features/src/renderer-foundation/changes.json +8 -0
- package/packages/bundled-features/src/renderer-foundation/constants.ts +25 -0
- package/packages/bundled-features/src/renderer-foundation/feature.ts +52 -0
- package/packages/bundled-features/src/renderer-foundation/index.ts +28 -0
- package/packages/bundled-features/src/renderer-foundation/types.ts +131 -0
- package/packages/bundled-features/src/renderer-simple/changes.json +1 -0
- package/packages/bundled-features/src/renderer-simple/feature.ts +57 -0
- package/packages/bundled-features/src/renderer-simple/index.ts +2 -0
- package/packages/bundled-features/src/renderer-simple/resolve-variables.ts +57 -0
- package/packages/bundled-features/src/renderer-simple/simple-renderer.ts +65 -0
- package/packages/bundled-features/src/secrets/changes.json +29 -0
- package/packages/bundled-features/src/secrets/constants.ts +12 -0
- package/packages/bundled-features/src/secrets/db/queries/read.ts +16 -0
- package/packages/bundled-features/src/secrets/feature.ts +197 -0
- package/packages/bundled-features/src/secrets/handlers/delete.write.ts +29 -0
- package/packages/bundled-features/src/secrets/handlers/list.query.ts +40 -0
- package/packages/bundled-features/src/secrets/handlers/rotate.job.ts +166 -0
- package/packages/bundled-features/src/secrets/handlers/set.write.ts +60 -0
- package/packages/bundled-features/src/secrets/i18n.ts +10 -0
- package/packages/bundled-features/src/secrets/index.ts +23 -0
- package/packages/bundled-features/src/secrets/secrets-context.ts +261 -0
- package/packages/bundled-features/src/secrets/table.ts +69 -0
- package/packages/bundled-features/src/secrets/write-gate.ts +62 -0
- package/packages/bundled-features/src/seo/changes.json +20 -0
- package/packages/bundled-features/src/seo/constants.ts +60 -0
- package/packages/bundled-features/src/seo/feature.ts +317 -0
- package/packages/bundled-features/src/seo/handlers/seo-config.query.ts +38 -0
- package/packages/bundled-features/src/seo/index.ts +24 -0
- package/packages/bundled-features/src/seo/llms-txt.ts +33 -0
- package/packages/bundled-features/src/seo/robots-txt.ts +33 -0
- package/packages/bundled-features/src/seo/schema-builders.ts +57 -0
- package/packages/bundled-features/src/seo/sitemap.ts +33 -0
- package/packages/bundled-features/src/sessions/changes.json +45 -0
- package/packages/bundled-features/src/sessions/constants.ts +58 -0
- package/packages/bundled-features/src/sessions/db/queries/cleanup.ts +21 -0
- package/packages/bundled-features/src/sessions/feature.ts +240 -0
- package/packages/bundled-features/src/sessions/handlers/cleanup.job.ts +83 -0
- package/packages/bundled-features/src/sessions/handlers/detail.query.ts +51 -0
- package/packages/bundled-features/src/sessions/handlers/list.query.ts +92 -0
- package/packages/bundled-features/src/sessions/handlers/mine.query.ts +67 -0
- package/packages/bundled-features/src/sessions/handlers/revoke-all-for-user.write.ts +122 -0
- package/packages/bundled-features/src/sessions/handlers/revoke-all-others.write.ts +68 -0
- package/packages/bundled-features/src/sessions/handlers/revoke.write.ts +94 -0
- package/packages/bundled-features/src/sessions/i18n.ts +33 -0
- package/packages/bundled-features/src/sessions/index.ts +25 -0
- package/packages/bundled-features/src/sessions/schema/user-session.ts +91 -0
- package/packages/bundled-features/src/sessions/screens.ts +157 -0
- package/packages/bundled-features/src/sessions/session-callbacks.ts +302 -0
- package/packages/bundled-features/src/sessions/session-revoked-event.ts +37 -0
- package/packages/bundled-features/src/sessions/testing.ts +55 -0
- package/packages/bundled-features/src/shared/assert-erased.ts +26 -0
- package/packages/bundled-features/src/shared/changes.json +14 -0
- package/packages/bundled-features/src/shared/chunked-entity-migration.ts +89 -0
- package/packages/bundled-features/src/shared/classify-stored-envelope.ts +21 -0
- package/packages/bundled-features/src/shared/decrypt-stored-pii.ts +26 -0
- package/packages/bundled-features/src/shared/encrypt-for-direct-write.ts +29 -0
- package/packages/bundled-features/src/shared/entities-of.ts +17 -0
- package/packages/bundled-features/src/shared/grace-period.ts +21 -0
- package/packages/bundled-features/src/shared/has-where-rule.ts +11 -0
- package/packages/bundled-features/src/shared/identity-v3-hash.ts +97 -0
- package/packages/bundled-features/src/shared/index.ts +53 -0
- package/packages/bundled-features/src/shared/is-tenant-db.ts +9 -0
- package/packages/bundled-features/src/shared/lockout-counter.ts +108 -0
- package/packages/bundled-features/src/shared/map-with-concurrency.ts +38 -0
- package/packages/bundled-features/src/shared/parent-visibility.ts +104 -0
- package/packages/bundled-features/src/shared/password-hashing.ts +55 -0
- package/packages/bundled-features/src/shared/row-bound-grant.ts +128 -0
- package/packages/bundled-features/src/shared/run-in-sub-transaction.ts +35 -0
- package/packages/bundled-features/src/shared/session-locale-field.ts +9 -0
- package/packages/bundled-features/src/shared/session-timezone-field.ts +8 -0
- package/packages/bundled-features/src/shared/signed-token.ts +101 -0
- package/packages/bundled-features/src/shared/signup-handover.ts +67 -0
- package/packages/bundled-features/src/shared/single-use-token-store.ts +148 -0
- package/packages/bundled-features/src/shared/system-query.ts +5 -0
- package/packages/bundled-features/src/shared/token-burn-store.ts +57 -0
- package/packages/bundled-features/src/step-dispatcher/changes.json +32 -0
- package/packages/bundled-features/src/step-dispatcher/feature.ts +299 -0
- package/packages/bundled-features/src/step-dispatcher/index.ts +25 -0
- package/packages/bundled-features/src/step-dispatcher/mail-runner.ts +39 -0
- package/packages/bundled-features/src/step-dispatcher/webhook-runner.ts +221 -0
- package/packages/bundled-features/src/subscription-mollie/changes.json +28 -0
- package/packages/bundled-features/src/subscription-mollie/constants.ts +33 -0
- package/packages/bundled-features/src/subscription-mollie/feature.ts +169 -0
- package/packages/bundled-features/src/subscription-mollie/index.ts +14 -0
- package/packages/bundled-features/src/subscription-mollie/plugin-methods.ts +97 -0
- package/packages/bundled-features/src/subscription-mollie/verify-webhook.ts +259 -0
- package/packages/bundled-features/src/subscription-stripe/changes.json +80 -0
- package/packages/bundled-features/src/subscription-stripe/constants.ts +35 -0
- package/packages/bundled-features/src/subscription-stripe/feature.ts +251 -0
- package/packages/bundled-features/src/subscription-stripe/index.ts +18 -0
- package/packages/bundled-features/src/subscription-stripe/plugin-methods.ts +646 -0
- package/packages/bundled-features/src/subscription-stripe/runtime.ts +193 -0
- package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +436 -0
- package/packages/bundled-features/src/tags/aggregate-id.ts +23 -0
- package/packages/bundled-features/src/tags/changes.json +16 -0
- package/packages/bundled-features/src/tags/constants.ts +61 -0
- package/packages/bundled-features/src/tags/entity.ts +99 -0
- package/packages/bundled-features/src/tags/executor.ts +24 -0
- package/packages/bundled-features/src/tags/feature.ts +219 -0
- package/packages/bundled-features/src/tags/handlers/assign-tag.write.ts +101 -0
- package/packages/bundled-features/src/tags/handlers/create-tag.write.ts +27 -0
- package/packages/bundled-features/src/tags/handlers/delete-tag.write.ts +60 -0
- package/packages/bundled-features/src/tags/handlers/remove-tag.write.ts +53 -0
- package/packages/bundled-features/src/tags/handlers/update-tag.write.ts +36 -0
- package/packages/bundled-features/src/tags/i18n.ts +9 -0
- package/packages/bundled-features/src/tags/index.ts +48 -0
- package/packages/bundled-features/src/tags/schemas.ts +61 -0
- package/packages/bundled-features/src/tags/screens.ts +70 -0
- package/packages/bundled-features/src/tags/web/client-plugin.tsx +30 -0
- package/packages/bundled-features/src/tags/web/entity-tags.tsx +54 -0
- package/packages/bundled-features/src/tags/web/i18n.ts +34 -0
- package/packages/bundled-features/src/tags/web/index.ts +18 -0
- package/packages/bundled-features/src/tags/web/tag-chip.tsx +65 -0
- package/packages/bundled-features/src/tags/web/tag-filter.tsx +100 -0
- package/packages/bundled-features/src/tags/web/tag-manager.tsx +391 -0
- package/packages/bundled-features/src/tags/web/tag-picker.tsx +55 -0
- package/packages/bundled-features/src/tags/web/tag-section.tsx +179 -0
- package/packages/bundled-features/src/tags/web/tags-cell.tsx +46 -0
- package/packages/bundled-features/src/template-resolver/README.md +255 -0
- package/packages/bundled-features/src/template-resolver/api.ts +202 -0
- package/packages/bundled-features/src/template-resolver/changes.json +16 -0
- package/packages/bundled-features/src/template-resolver/constants.ts +54 -0
- package/packages/bundled-features/src/template-resolver/feature.ts +99 -0
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +61 -0
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +63 -0
- package/packages/bundled-features/src/template-resolver/handlers/collection-item.query.ts +53 -0
- package/packages/bundled-features/src/template-resolver/handlers/collection-list.query.ts +56 -0
- package/packages/bundled-features/src/template-resolver/handlers/collection-set.write.ts +117 -0
- package/packages/bundled-features/src/template-resolver/handlers/collection-shared.ts +90 -0
- package/packages/bundled-features/src/template-resolver/handlers/find-by-id.query.ts +44 -0
- package/packages/bundled-features/src/template-resolver/handlers/list.query.ts +60 -0
- package/packages/bundled-features/src/template-resolver/handlers/set.write.ts +126 -0
- package/packages/bundled-features/src/template-resolver/handlers/shared.ts +51 -0
- package/packages/bundled-features/src/template-resolver/handlers/toggle-status.write.ts +46 -0
- package/packages/bundled-features/src/template-resolver/handlers/upsert-system.write.ts +81 -0
- package/packages/bundled-features/src/template-resolver/handlers/upsert-tenant.write.ts +105 -0
- package/packages/bundled-features/src/template-resolver/index.ts +44 -0
- package/packages/bundled-features/src/template-resolver/qualified-names.ts +40 -0
- package/packages/bundled-features/src/template-resolver/seeding.ts +323 -0
- package/packages/bundled-features/src/template-resolver/table.ts +90 -0
- package/packages/bundled-features/src/template-resolver/testing.ts +199 -0
- package/packages/bundled-features/src/template-resolver/user-content-table.ts +68 -0
- package/packages/bundled-features/src/template-resolver/web/client-plugin.tsx +516 -0
- package/packages/bundled-features/src/template-resolver/web/i18n.ts +25 -0
- package/packages/bundled-features/src/template-resolver/web/index.ts +8 -0
- package/packages/bundled-features/src/template-resolver-user-data/hooks.ts +40 -0
- package/packages/bundled-features/src/template-resolver-user-data/index.ts +25 -0
- package/packages/bundled-features/src/tenant/cancel-pending-invitation.ts +43 -0
- package/packages/bundled-features/src/tenant/changes.json +105 -0
- package/packages/bundled-features/src/tenant/command-schemas.ts +37 -0
- package/packages/bundled-features/src/tenant/constants.ts +78 -0
- package/packages/bundled-features/src/tenant/feature.ts +213 -0
- package/packages/bundled-features/src/tenant/handlers/active-tenant-ids.query.ts +30 -0
- package/packages/bundled-features/src/tenant/handlers/add-member.write.ts +64 -0
- package/packages/bundled-features/src/tenant/handlers/cancel-invitation.write.ts +68 -0
- package/packages/bundled-features/src/tenant/handlers/create.write.ts +37 -0
- package/packages/bundled-features/src/tenant/handlers/invitations.query.ts +58 -0
- package/packages/bundled-features/src/tenant/handlers/is-system-admin.ts +5 -0
- package/packages/bundled-features/src/tenant/handlers/list.query.ts +30 -0
- package/packages/bundled-features/src/tenant/handlers/me.query.ts +38 -0
- package/packages/bundled-features/src/tenant/handlers/member-directory.query.ts +108 -0
- package/packages/bundled-features/src/tenant/handlers/members.query.ts +73 -0
- package/packages/bundled-features/src/tenant/handlers/memberships.query.ts +58 -0
- package/packages/bundled-features/src/tenant/handlers/remove-member.write.ts +142 -0
- package/packages/bundled-features/src/tenant/handlers/resolve-user-ids.query.ts +44 -0
- package/packages/bundled-features/src/tenant/handlers/team-list.query.ts +257 -0
- package/packages/bundled-features/src/tenant/handlers/tenant-directory.query.ts +71 -0
- package/packages/bundled-features/src/tenant/handlers/toggle-enabled.write.ts +37 -0
- package/packages/bundled-features/src/tenant/handlers/update-member-roles.write.ts +208 -0
- package/packages/bundled-features/src/tenant/handlers/update.write.ts +55 -0
- package/packages/bundled-features/src/tenant/i18n.ts +61 -0
- package/packages/bundled-features/src/tenant/index.ts +24 -0
- package/packages/bundled-features/src/tenant/invitation-table.ts +104 -0
- package/packages/bundled-features/src/tenant/invited-membership.ts +97 -0
- package/packages/bundled-features/src/tenant/is-tenant-serving-public-content.ts +13 -0
- package/packages/bundled-features/src/tenant/last-tenant-admin.ts +43 -0
- package/packages/bundled-features/src/tenant/membership-roles.ts +34 -0
- package/packages/bundled-features/src/tenant/membership-table.ts +32 -0
- package/packages/bundled-features/src/tenant/schema/tenant.ts +73 -0
- package/packages/bundled-features/src/tenant/screens.ts +221 -0
- package/packages/bundled-features/src/tenant/seeding.ts +335 -0
- package/packages/bundled-features/src/tenant/testing.ts +8 -0
- package/packages/bundled-features/src/tenant/web/client-plugin.tsx +25 -0
- package/packages/bundled-features/src/tenant/web/index.ts +4 -0
- package/packages/bundled-features/src/tenant/web/member-roles-cell.tsx +21 -0
- package/packages/bundled-features/src/tenant/web/member-status-cell.tsx +27 -0
- package/packages/bundled-features/src/tenant/web/translate-or-raw.ts +13 -0
- package/packages/bundled-features/src/tenant-handover/changes.json +34 -0
- package/packages/bundled-features/src/tenant-handover/events.ts +32 -0
- package/packages/bundled-features/src/tenant-handover/feature.ts +46 -0
- package/packages/bundled-features/src/tenant-handover/grant.ts +43 -0
- package/packages/bundled-features/src/tenant-handover/handlers/claim.write.ts +134 -0
- package/packages/bundled-features/src/tenant-handover/index.ts +9 -0
- package/packages/bundled-features/src/tenant-handover/move-entity-graph.ts +355 -0
- package/packages/bundled-features/src/tenant-handover/root-anchor.ts +50 -0
- package/packages/bundled-features/src/tenant-handover/signup-handover-provider.ts +62 -0
- package/packages/bundled-features/src/tenant-handover/transfer-graph.ts +128 -0
- package/packages/bundled-features/src/tenant-lifecycle/boot-checks.ts +79 -0
- package/packages/bundled-features/src/tenant-lifecycle/changes.json +8 -0
- package/packages/bundled-features/src/tenant-lifecycle/constants.ts +56 -0
- package/packages/bundled-features/src/tenant-lifecycle/events.ts +46 -0
- package/packages/bundled-features/src/tenant-lifecycle/feature.ts +150 -0
- package/packages/bundled-features/src/tenant-lifecycle/handlers/cancel-destruction.write.ts +86 -0
- package/packages/bundled-features/src/tenant-lifecycle/handlers/request-destruction.write.ts +94 -0
- package/packages/bundled-features/src/tenant-lifecycle/index.ts +7 -0
- package/packages/bundled-features/src/tenant-lifecycle/lib/revoke-tenant-sessions.ts +16 -0
- package/packages/bundled-features/src/tenant-lifecycle/lifecycle-gate.ts +87 -0
- package/packages/bundled-features/src/tenant-lifecycle/run-tenant-destroy.ts +387 -0
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +242 -0
- package/packages/bundled-features/src/tenant-settings/changes.json +1 -0
- package/packages/bundled-features/src/tenant-settings/config.ts +43 -0
- package/packages/bundled-features/src/tenant-settings/constants.ts +21 -0
- package/packages/bundled-features/src/tenant-settings/feature.ts +55 -0
- package/packages/bundled-features/src/tenant-settings/index.ts +8 -0
- package/packages/bundled-features/src/tenant-settings/tenant-defaults.ts +78 -0
- package/packages/bundled-features/src/tier-engine/aggregate-id.ts +28 -0
- package/packages/bundled-features/src/tier-engine/changes.json +16 -0
- package/packages/bundled-features/src/tier-engine/compose-app.ts +153 -0
- package/packages/bundled-features/src/tier-engine/constants.ts +28 -0
- package/packages/bundled-features/src/tier-engine/entity.ts +55 -0
- package/packages/bundled-features/src/tier-engine/feature.ts +549 -0
- package/packages/bundled-features/src/tier-engine/handlers/active-tier.query.ts +25 -0
- package/packages/bundled-features/src/tier-engine/handlers/get-tenant-tier.query.ts +32 -0
- package/packages/bundled-features/src/tier-engine/handlers/set-tenant-tier.write.ts +108 -0
- package/packages/bundled-features/src/tier-engine/i18n.ts +31 -0
- package/packages/bundled-features/src/tier-engine/index.ts +32 -0
- package/packages/bundled-features/src/tier-engine/tier-resolver.ts +38 -0
- package/packages/bundled-features/src/tier-engine/trial.ts +26 -0
- package/packages/bundled-features/src/tier-engine/web/client-plugin.tsx +21 -0
- package/packages/bundled-features/src/tier-engine/web/index.ts +7 -0
- package/packages/bundled-features/src/user/changes.json +48 -0
- package/packages/bundled-features/src/user/command-schemas.ts +15 -0
- package/packages/bundled-features/src/user/constants.ts +32 -0
- package/packages/bundled-features/src/user/db/queries/stream-tenant-backfill.ts +113 -0
- package/packages/bundled-features/src/user/feature.ts +61 -0
- package/packages/bundled-features/src/user/handlers/create.write.ts +136 -0
- package/packages/bundled-features/src/user/handlers/detail.query.ts +34 -0
- package/packages/bundled-features/src/user/handlers/find-for-auth.query.ts +51 -0
- package/packages/bundled-features/src/user/handlers/list.query.ts +123 -0
- package/packages/bundled-features/src/user/handlers/me.query.ts +38 -0
- package/packages/bundled-features/src/user/handlers/update-roles.ts +203 -0
- package/packages/bundled-features/src/user/handlers/update.write.ts +112 -0
- package/packages/bundled-features/src/user/i18n.ts +23 -0
- package/packages/bundled-features/src/user/index.ts +19 -0
- package/packages/bundled-features/src/user/principal-status.ts +47 -0
- package/packages/bundled-features/src/user/roles-input-schema.ts +20 -0
- package/packages/bundled-features/src/user/schema/user.ts +215 -0
- package/packages/bundled-features/src/user/screens.ts +54 -0
- package/packages/bundled-features/src/user/seeding.ts +139 -0
- package/packages/bundled-features/src/user/testing.ts +5 -0
- package/packages/bundled-features/src/user-data-rights/COMPLIANCE.md +202 -0
- package/packages/bundled-features/src/user-data-rights/README.md +109 -0
- package/packages/bundled-features/src/user-data-rights/audit-download.ts +125 -0
- package/packages/bundled-features/src/user-data-rights/boot-checks.ts +71 -0
- package/packages/bundled-features/src/user-data-rights/changes.json +116 -0
- package/packages/bundled-features/src/user-data-rights/constants.ts +63 -0
- package/packages/bundled-features/src/user-data-rights/db/queries/export-jobs.ts +28 -0
- package/packages/bundled-features/src/user-data-rights/db/queries/forget-cleanup.ts +25 -0
- package/packages/bundled-features/src/user-data-rights/deletion-token.ts +58 -0
- package/packages/bundled-features/src/user-data-rights/email-templates.ts +175 -0
- package/packages/bundled-features/src/user-data-rights/feature.ts +808 -0
- package/packages/bundled-features/src/user-data-rights/handlers/cancel-deletion.write.ts +83 -0
- package/packages/bundled-features/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts +107 -0
- package/packages/bundled-features/src/user-data-rights/handlers/deletion-grace-period.ts +138 -0
- package/packages/bundled-features/src/user-data-rights/handlers/download-attempt-list.query.ts +20 -0
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-job.query.ts +220 -0
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-token.query.ts +259 -0
- package/packages/bundled-features/src/user-data-rights/handlers/export-job-detail.query.ts +13 -0
- package/packages/bundled-features/src/user-data-rights/handlers/export-job-list.query.ts +14 -0
- package/packages/bundled-features/src/user-data-rights/handlers/export-status.query.ts +75 -0
- package/packages/bundled-features/src/user-data-rights/handlers/lift-restriction.write.ts +88 -0
- package/packages/bundled-features/src/user-data-rights/handlers/list-download-attempts.query.ts +49 -0
- package/packages/bundled-features/src/user-data-rights/handlers/my-audit-log.query.ts +87 -0
- package/packages/bundled-features/src/user-data-rights/handlers/request-deletion-by-email.write.ts +127 -0
- package/packages/bundled-features/src/user-data-rights/handlers/request-deletion.write.ts +117 -0
- package/packages/bundled-features/src/user-data-rights/handlers/request-export.write.ts +165 -0
- package/packages/bundled-features/src/user-data-rights/handlers/restrict-account.write.ts +133 -0
- package/packages/bundled-features/src/user-data-rights/handlers/run-forget-cleanup.write.ts +95 -0
- package/packages/bundled-features/src/user-data-rights/i18n.ts +39 -0
- package/packages/bundled-features/src/user-data-rights/index.ts +33 -0
- package/packages/bundled-features/src/user-data-rights/lib/default-mailers.ts +120 -0
- package/packages/bundled-features/src/user-data-rights/lib/deny-if-target-outside-admin-tenant.ts +32 -0
- package/packages/bundled-features/src/user-data-rights/lib/is-admin-actor.ts +19 -0
- package/packages/bundled-features/src/user-data-rights/lib/mail-transport-resolver.ts +50 -0
- package/packages/bundled-features/src/user-data-rights/lib/resolve-tenant-model.ts +34 -0
- package/packages/bundled-features/src/user-data-rights/lib/storage-provider-resolver.ts +49 -0
- package/packages/bundled-features/src/user-data-rights/lib/update-user-lifecycle.ts +126 -0
- package/packages/bundled-features/src/user-data-rights/run-export-jobs.ts +998 -0
- package/packages/bundled-features/src/user-data-rights/run-forget-cleanup.ts +665 -0
- package/packages/bundled-features/src/user-data-rights/run-user-export.ts +346 -0
- package/packages/bundled-features/src/user-data-rights/schema/download-attempt.ts +57 -0
- package/packages/bundled-features/src/user-data-rights/schema/download-token.ts +119 -0
- package/packages/bundled-features/src/user-data-rights/schema/export-job.ts +174 -0
- package/packages/bundled-features/src/user-data-rights/screens.ts +77 -0
- package/packages/bundled-features/src/user-data-rights/token-helpers.ts +67 -0
- package/packages/bundled-features/src/user-data-rights/web/client-plugin.tsx +52 -0
- package/packages/bundled-features/src/user-data-rights/web/confirm-deletion-screen.tsx +97 -0
- package/packages/bundled-features/src/user-data-rights/web/i18n.ts +93 -0
- package/packages/bundled-features/src/user-data-rights/web/index.ts +15 -0
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +185 -0
- package/packages/bundled-features/src/user-data-rights/web/public-deletion-gate.tsx +42 -0
- package/packages/bundled-features/src/user-data-rights/web/request-deletion-screen.tsx +104 -0
- package/packages/bundled-features/src/user-data-rights/zip-path.ts +94 -0
- package/packages/bundled-features/src/user-data-rights-defaults/changes.json +13 -0
- package/packages/bundled-features/src/user-data-rights-defaults/feature.ts +136 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/api-token.userdata-hook.ts +36 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/config-value.userdata-hook.ts +57 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/delivery-attempt.userdata-hook.ts +36 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/feature-mounted.ts +10 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/file-ref.userdata-hook.ts +280 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/in-app-message.userdata-hook.ts +37 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/job-run.userdata-hook.ts +34 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/notification-preference.userdata-hook.ts +63 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/tenant-invitation.userdata-hook.ts +144 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/user-session.userdata-hook.ts +41 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/user.userdata-hook.ts +126 -0
- package/packages/bundled-features/src/user-data-rights-defaults/index.ts +32 -0
- package/packages/bundled-features/src/user-profile/changes.json +21 -0
- package/packages/bundled-features/src/user-profile/constants.ts +35 -0
- package/packages/bundled-features/src/user-profile/feature.ts +154 -0
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +99 -0
- package/packages/bundled-features/src/user-profile/i18n.ts +46 -0
- package/packages/bundled-features/src/user-profile/index.ts +11 -0
- package/packages/bundled-features/src/user-profile/web/client-plugin.ts +45 -0
- package/packages/bundled-features/src/user-profile/web/index.ts +6 -0
- package/packages/bundled-features/src/user-profile/web/profile-screen.tsx +234 -0
- package/packages/bundled-features/src/workflow-runner/aggregate-id.ts +20 -0
- package/packages/bundled-features/src/workflow-runner/changes.json +20 -0
- package/packages/bundled-features/src/workflow-runner/db/queries/due-runs.ts +24 -0
- package/packages/bundled-features/src/workflow-runner/event-subscriber.ts +113 -0
- package/packages/bundled-features/src/workflow-runner/event-trigger.ts +121 -0
- package/packages/bundled-features/src/workflow-runner/feature.ts +96 -0
- package/packages/bundled-features/src/workflow-runner/handlers/resume-run.write.ts +358 -0
- package/packages/bundled-features/src/workflow-runner/index.ts +12 -0
- package/packages/bundled-features/src/workflow-runner/pending-projection.ts +158 -0
- package/packages/bundled-features/src/workflow-runner/runner.ts +153 -0
- package/packages/bundled-features/src/workflow-runner/tables.ts +95 -0
- package/packages/bundled-features/src/workflow-runner/workflow-registry.ts +23 -0
- package/samples/apps/admin-console/README.md +90 -0
- package/samples/apps/admin-console/package.json +22 -0
- package/samples/apps/admin-console/playwright.config.ts +13 -0
- package/samples/apps/admin-console/src/app/auth-constants.ts +10 -0
- package/samples/apps/admin-console/src/app/client.tsx +29 -0
- package/samples/apps/admin-console/src/app/home-screen.tsx +14 -0
- package/samples/apps/admin-console/src/app/seed-users.ts +42 -0
- package/samples/apps/admin-console/src/app/server.ts +35 -0
- package/samples/apps/admin-console/src/app/shell.tsx +48 -0
- package/samples/apps/admin-console/src/run-config.ts +60 -0
- package/samples/apps/admin-console/tsconfig.json +23 -0
- package/samples/apps/cap-billing-demo/README.md +151 -0
- package/samples/apps/cap-billing-demo/bin/server.ts +37 -0
- package/samples/apps/cap-billing-demo/package.json +16 -0
- package/samples/apps/cap-billing-demo/src/feature.ts +208 -0
- package/samples/apps/cap-billing-demo/src/run-config.ts +51 -0
- package/samples/apps/cap-billing-demo/src/tier-map.ts +46 -0
- package/samples/apps/cap-billing-demo/tsconfig.json +21 -0
- package/samples/apps/config-demo/README.md +81 -0
- package/samples/apps/config-demo/package.json +22 -0
- package/samples/apps/config-demo/playwright.config.ts +11 -0
- package/samples/apps/config-demo/src/app/client.tsx +12 -0
- package/samples/apps/config-demo/src/app/server.ts +31 -0
- package/samples/apps/config-demo/src/app/shell.tsx +31 -0
- package/samples/apps/config-demo/src/features/demo/feature.ts +84 -0
- package/samples/apps/config-demo/src/features/demo/i18n.ts +23 -0
- package/samples/apps/config-demo/src/features/demo/web/index.ts +7 -0
- package/samples/apps/config-demo/tsconfig.json +41 -0
- package/samples/apps/marketing-demo/README.md +89 -0
- package/samples/apps/marketing-demo/package.json +22 -0
- package/samples/apps/marketing-demo/playwright.config.ts +16 -0
- package/samples/apps/marketing-demo/src/app/client.tsx +13 -0
- package/samples/apps/marketing-demo/src/app/seed-data.ts +443 -0
- package/samples/apps/marketing-demo/src/app/seed.ts +143 -0
- package/samples/apps/marketing-demo/src/app/server.ts +25 -0
- package/samples/apps/marketing-demo/src/app/shell.tsx +37 -0
- package/samples/apps/marketing-demo/src/db/queries/seed-counts.ts +18 -0
- package/samples/apps/marketing-demo/src/features/assets/feature.ts +54 -0
- package/samples/apps/marketing-demo/src/features/assets/i18n.ts +103 -0
- package/samples/apps/marketing-demo/src/features/assets/schema/asset.ts +129 -0
- package/samples/apps/marketing-demo/src/features/assets/schema/index.ts +11 -0
- package/samples/apps/marketing-demo/src/features/assets/web/index.ts +10 -0
- package/samples/apps/marketing-demo/src/features/helpdesk/feature.ts +52 -0
- package/samples/apps/marketing-demo/src/features/helpdesk/i18n.ts +100 -0
- package/samples/apps/marketing-demo/src/features/helpdesk/schema/index.ts +13 -0
- package/samples/apps/marketing-demo/src/features/helpdesk/schema/ticket.ts +136 -0
- package/samples/apps/marketing-demo/src/features/helpdesk/web/index.ts +7 -0
- package/samples/apps/marketing-demo/tsconfig.json +23 -0
- package/samples/apps/showcase/README.md +123 -0
- package/samples/apps/showcase/kumiko.config.ts +10 -0
- package/samples/apps/showcase/package.json +23 -0
- package/samples/apps/showcase/playwright.config.ts +13 -0
- package/samples/apps/showcase/src/app/client.tsx +15 -0
- package/samples/apps/showcase/src/app/mount-public-screenshots.ts +26 -0
- package/samples/apps/showcase/src/app/seed-items.ts +129 -0
- package/samples/apps/showcase/src/app/server.ts +30 -0
- package/samples/apps/showcase/src/app/shell.tsx +110 -0
- package/samples/apps/showcase/src/features/demos/feature.ts +168 -0
- package/samples/apps/showcase/src/features/demos/i18n.ts +45 -0
- package/samples/apps/showcase/src/features/demos/index.ts +5 -0
- package/samples/apps/showcase/src/features/demos/web/components/page.tsx +50 -0
- package/samples/apps/showcase/src/features/demos/web/index.ts +30 -0
- package/samples/apps/showcase/src/features/demos/web/pages/banner.tsx +36 -0
- package/samples/apps/showcase/src/features/demos/web/pages/buttons.tsx +55 -0
- package/samples/apps/showcase/src/features/demos/web/pages/dialog.tsx +89 -0
- package/samples/apps/showcase/src/features/demos/web/pages/inputs.tsx +242 -0
- package/samples/apps/showcase/src/features/demos/web/pages/layout.tsx +203 -0
- package/samples/apps/showcase/src/features/demos/web/pages/sidebar-panel.tsx +144 -0
- package/samples/apps/showcase/src/features/demos/web/pages/text.tsx +27 -0
- package/samples/apps/showcase/src/features/demos/web/pages/toast.tsx +71 -0
- package/samples/apps/showcase/src/features/items/feature.ts +109 -0
- package/samples/apps/showcase/src/features/items/i18n.ts +79 -0
- package/samples/apps/showcase/src/features/items/index.ts +6 -0
- package/samples/apps/showcase/src/features/items/schema/index.ts +13 -0
- package/samples/apps/showcase/src/features/items/schema/item.ts +215 -0
- package/samples/apps/showcase/src/features/items/web/index.ts +15 -0
- package/samples/apps/styleguide/README.md +47 -0
- package/samples/apps/styleguide/package.json +22 -0
- package/samples/apps/styleguide/playwright.config.ts +11 -0
- package/samples/apps/styleguide/src/app/client.tsx +28 -0
- package/samples/apps/styleguide/src/app/seed.ts +58 -0
- package/samples/apps/styleguide/src/app/server.ts +51 -0
- package/samples/apps/styleguide/src/app/shell.tsx +66 -0
- package/samples/apps/styleguide/src/features/ai-settings/catalog.ts +82 -0
- package/samples/apps/styleguide/src/features/ai-settings/feature.ts +295 -0
- package/samples/apps/styleguide/src/features/ai-settings/i18n.ts +54 -0
- package/samples/apps/styleguide/src/features/ai-settings/seed.ts +29 -0
- package/samples/apps/styleguide/src/features/ai-settings/web.ts +14 -0
- package/samples/apps/styleguide/src/features/content/feature.ts +39 -0
- package/samples/apps/styleguide/src/features/content/web.tsx +160 -0
- package/samples/apps/styleguide/src/features/demo/feature.ts +288 -0
- package/samples/apps/styleguide/src/features/demo/i18n.ts +38 -0
- package/samples/apps/styleguide/src/features/demo/web.ts +13 -0
- package/samples/apps/styleguide/src/features/examples/feature.ts +173 -0
- package/samples/apps/styleguide/src/features/examples/i18n.ts +69 -0
- package/samples/apps/styleguide/src/features/examples/web.ts +14 -0
- package/samples/apps/styleguide/src/features/gallery/feature.ts +35 -0
- package/samples/apps/styleguide/src/features/gallery/web/Gallery.tsx +832 -0
- package/samples/apps/styleguide/src/features/gallery/web/index.ts +16 -0
- package/samples/apps/styleguide/src/features/shared-i18n.ts +16 -0
- package/samples/apps/styleguide/src/features/widgets/ai-text-demo.ts +70 -0
- package/samples/apps/styleguide/src/features/widgets/feature.ts +314 -0
- package/samples/apps/styleguide/src/features/widgets/i18n.ts +208 -0
- package/samples/apps/styleguide/src/features/widgets/lib/format.ts +32 -0
- package/samples/apps/styleguide/src/features/widgets/web/DashboardFilterEcho.tsx +21 -0
- package/samples/apps/styleguide/src/features/widgets/web/DashboardKpiIcon.tsx +20 -0
- package/samples/apps/styleguide/src/features/widgets/web/FormExamples.tsx +352 -0
- package/samples/apps/styleguide/src/features/widgets/web/Widgets.tsx +656 -0
- package/samples/apps/styleguide/src/features/widgets/web/index.ts +30 -0
- package/samples/apps/styleguide/tsconfig.json +41 -0
- package/samples/apps/ui-walkthrough/README.md +105 -0
- package/samples/apps/ui-walkthrough/kumiko/schema.ts +14 -0
- package/samples/apps/ui-walkthrough/package.json +23 -0
- package/samples/apps/ui-walkthrough/playwright.config.ts +29 -0
- package/samples/apps/ui-walkthrough/scripts/emit-e2e-data.ts +19 -0
- package/samples/apps/ui-walkthrough/src/app/assistant-action.tsx +49 -0
- package/samples/apps/ui-walkthrough/src/app/auth-constants.ts +20 -0
- package/samples/apps/ui-walkthrough/src/app/client.tsx +21 -0
- package/samples/apps/ui-walkthrough/src/app/seed-rental.ts +266 -0
- package/samples/apps/ui-walkthrough/src/app/seed-vehicles.ts +172 -0
- package/samples/apps/ui-walkthrough/src/app/seed.ts +25 -0
- package/samples/apps/ui-walkthrough/src/app/server.ts +56 -0
- package/samples/apps/ui-walkthrough/src/app/shell.tsx +67 -0
- package/samples/apps/ui-walkthrough/src/db/queries/row-counts.ts +24 -0
- package/samples/apps/ui-walkthrough/src/db/queries/task-counts.ts +10 -0
- package/samples/apps/ui-walkthrough/src/features/rental/entities.ts +57 -0
- package/samples/apps/ui-walkthrough/src/features/rental/feature.ts +258 -0
- package/samples/apps/ui-walkthrough/src/features/rental/i18n.ts +214 -0
- package/samples/apps/ui-walkthrough/src/features/rental/index.ts +2 -0
- package/samples/apps/ui-walkthrough/src/features/rental/lease-support.ts +110 -0
- package/samples/apps/ui-walkthrough/src/features/rental/qualified-names.ts +12 -0
- package/samples/apps/ui-walkthrough/src/features/rental/screens.ts +450 -0
- package/samples/apps/ui-walkthrough/src/features/rental/web/index.ts +12 -0
- package/samples/apps/ui-walkthrough/src/features/rental/web/lease-hub-components.tsx +29 -0
- package/samples/apps/ui-walkthrough/src/features/tasks/feature.ts +49 -0
- package/samples/apps/ui-walkthrough/src/features/tasks/i18n.ts +39 -0
- package/samples/apps/ui-walkthrough/src/features/tasks/index.ts +4 -0
- package/samples/apps/ui-walkthrough/src/features/tasks/schema/index.ts +3 -0
- package/samples/apps/ui-walkthrough/src/features/tasks/schema/task.ts +85 -0
- package/samples/apps/ui-walkthrough/src/features/tasks/web/index.ts +10 -0
- package/samples/apps/ui-walkthrough/src/features/translations.ts +17 -0
- package/samples/apps/ui-walkthrough/src/features/vehicles/campaign-support.ts +22 -0
- package/samples/apps/ui-walkthrough/src/features/vehicles/entities.ts +89 -0
- package/samples/apps/ui-walkthrough/src/features/vehicles/feature.ts +95 -0
- package/samples/apps/ui-walkthrough/src/features/vehicles/i18n.ts +222 -0
- package/samples/apps/ui-walkthrough/src/features/vehicles/index.ts +2 -0
- package/samples/apps/ui-walkthrough/src/features/vehicles/qualified-names.ts +7 -0
- package/samples/apps/ui-walkthrough/src/features/vehicles/screens.ts +188 -0
- package/samples/apps/ui-walkthrough/src/features/vehicles/web/index.ts +7 -0
- package/samples/apps/ui-walkthrough/src/run-config.ts +15 -0
- package/samples/apps/ui-walkthrough/tsconfig.json +19 -0
- package/samples/apps/use-all-bundled/README.md +57 -0
- package/samples/apps/use-all-bundled/bin/main.ts +53 -0
- package/samples/apps/use-all-bundled/feature-manifest.json +2963 -0
- package/samples/apps/use-all-bundled/kumiko/migrations/0003_notes-history.rebuild.json +4 -0
- package/samples/apps/use-all-bundled/kumiko/migrations/0005_user-content-entries.rebuild.json +4 -0
- package/samples/apps/use-all-bundled/kumiko/migrations/0007_form-draft.rebuild.json +4 -0
- package/samples/apps/use-all-bundled/kumiko/migrations/0008_ledger-date-column-1924.rebuild.json +4 -0
- package/samples/apps/use-all-bundled/kumiko/migrations/0009_form-draft-owner-required.rebuild.json +4 -0
- package/samples/apps/use-all-bundled/kumiko/migrations/0012_add-user-email-unique-index.rebuild.json +4 -0
- package/samples/apps/use-all-bundled/kumiko/migrations/0015_pii-field-api-v2-bidx.rebuild.json +4 -0
- package/samples/apps/use-all-bundled/kumiko/migrations/0023_add-note-mentions.rebuild.json +4 -0
- package/samples/apps/use-all-bundled/kumiko/migrations/0028_add-ledger-account-code-unique-index.rebuild.json +4 -0
- package/samples/apps/use-all-bundled/kumiko/schema.ts +24 -0
- package/samples/apps/use-all-bundled/kumiko.config.ts +24 -0
- package/samples/apps/use-all-bundled/package.json +30 -0
- package/samples/apps/use-all-bundled/playwright.config.ts +10 -0
- package/samples/apps/use-all-bundled/schema/generate.ts +577 -0
- package/samples/apps/use-all-bundled/schema/migrations/meta/0000_snapshot.json +3055 -0
- package/samples/apps/use-all-bundled/schema/migrations/meta/_journal.json +13 -0
- package/samples/apps/use-all-bundled/schema/schema.generated.ts +88 -0
- package/samples/apps/use-all-bundled/schema/schema.ts +9 -0
- package/samples/apps/use-all-bundled/scripts/check-coverage.ts +203 -0
- package/samples/apps/use-all-bundled/scripts/gen-feature-manifest.ts +85 -0
- package/samples/apps/use-all-bundled/scripts/gen-sample-index.ts +290 -0
- package/samples/apps/use-all-bundled/src/app/auth-constants.ts +16 -0
- package/samples/apps/use-all-bundled/src/app/cap-overview-caps.ts +71 -0
- package/samples/apps/use-all-bundled/src/app/cap-overview-labels-feature.ts +18 -0
- package/samples/apps/use-all-bundled/src/app/client.tsx +126 -0
- package/samples/apps/use-all-bundled/src/app/collection-labels-feature.ts +16 -0
- package/samples/apps/use-all-bundled/src/app/dev-app-options.ts +75 -0
- package/samples/apps/use-all-bundled/src/app/notes-feature.ts +174 -0
- package/samples/apps/use-all-bundled/src/app/screens-feature.ts +39 -0
- package/samples/apps/use-all-bundled/src/app/seed.ts +429 -0
- package/samples/apps/use-all-bundled/src/app/server.ts +5 -0
- package/samples/apps/use-all-bundled/src/app/shell.tsx +62 -0
- package/samples/apps/use-all-bundled/src/run-config.ts +433 -0
- package/samples/apps/use-all-bundled/tsconfig.json +31 -0
- package/samples/apps/user-data-rights-demo/README.md +159 -0
- package/samples/apps/user-data-rights-demo/bin/server.ts +35 -0
- package/samples/apps/user-data-rights-demo/package.json +16 -0
- package/samples/apps/user-data-rights-demo/src/feature.ts +200 -0
- package/samples/apps/user-data-rights-demo/src/run-config.ts +48 -0
- package/samples/apps/user-data-rights-demo/tsconfig.json +21 -0
- package/samples/apps/workspaces/README.md +69 -0
- package/samples/apps/workspaces/package.json +20 -0
- package/samples/apps/workspaces/playwright.config.ts +18 -0
- package/samples/apps/workspaces/src/app/auth-constants.ts +6 -0
- package/samples/apps/workspaces/src/app/client.tsx +11 -0
- package/samples/apps/workspaces/src/app/server.ts +47 -0
- package/samples/apps/workspaces/src/app/shell.tsx +51 -0
- package/samples/apps/workspaces/src/features/demo/feature.ts +89 -0
- package/samples/apps/workspaces/src/features/demo/i18n.ts +20 -0
- package/samples/apps/workspaces/src/features/demo/index.ts +2 -0
- package/samples/apps/workspaces/src/features/demo/schema/index.ts +1 -0
- package/samples/apps/workspaces/src/features/demo/schema/order.ts +43 -0
- package/samples/apps/workspaces/src/features/demo/web/index.ts +7 -0
- package/samples/apps/workspaces/src/features/demo-driver/feature.ts +31 -0
- package/samples/apps/workspaces/src/features/demo-driver/i18n.ts +10 -0
- package/samples/apps/workspaces/src/features/demo-driver/index.ts +2 -0
- package/samples/apps/workspaces/src/features/demo-driver/web/index.ts +7 -0
- package/samples/recipes/access-control/README.md +21 -0
- package/samples/recipes/access-control/package.json +8 -0
- package/samples/recipes/access-control/src/feature.ts +145 -0
- package/samples/recipes/anonymous-access/README.md +21 -0
- package/samples/recipes/anonymous-access/package.json +8 -0
- package/samples/recipes/anonymous-access/src/feature.ts +132 -0
- package/samples/recipes/anonymous-access-multitenant/README.md +21 -0
- package/samples/recipes/anonymous-access-multitenant/package.json +8 -0
- package/samples/recipes/anonymous-access-multitenant/src/feature.ts +65 -0
- package/samples/recipes/anonymous-access-multitenant/src/subdomain-resolver.ts +105 -0
- package/samples/recipes/apex-landing/README.md +32 -0
- package/samples/recipes/apex-landing/package.json +16 -0
- package/samples/recipes/apex-landing/playwright.config.ts +23 -0
- package/samples/recipes/apex-landing/src/constants.ts +7 -0
- package/samples/recipes/apex-landing/src/feature.ts +307 -0
- package/samples/recipes/apex-surface-auth/README.md +114 -0
- package/samples/recipes/apex-surface-auth/package.json +9 -0
- package/samples/recipes/apex-surface-auth/src/feature.ts +113 -0
- package/samples/recipes/api-worker-split/README.md +68 -0
- package/samples/recipes/api-worker-split/bin/api.ts +13 -0
- package/samples/recipes/api-worker-split/bin/kumiko.ts +7 -0
- package/samples/recipes/api-worker-split/bin/worker.ts +24 -0
- package/samples/recipes/api-worker-split/package.json +16 -0
- package/samples/recipes/api-worker-split/src/feature.ts +167 -0
- package/samples/recipes/auth-claims/README.md +21 -0
- package/samples/recipes/auth-claims/package.json +8 -0
- package/samples/recipes/auth-claims/src/feature.ts +123 -0
- package/samples/recipes/auth-foundation-providers/README.md +19 -0
- package/samples/recipes/auth-foundation-providers/package.json +9 -0
- package/samples/recipes/auth-foundation-providers/src/feature.ts +76 -0
- package/samples/recipes/auth-mfa/README.md +67 -0
- package/samples/recipes/auth-mfa/package.json +9 -0
- package/samples/recipes/auth-mfa/src/feature.ts +72 -0
- package/samples/recipes/basic-entity/README.md +64 -0
- package/samples/recipes/basic-entity/package.json +8 -0
- package/samples/recipes/basic-entity/src/feature.ts +45 -0
- package/samples/recipes/boot-check/README.md +54 -0
- package/samples/recipes/boot-check/package.json +8 -0
- package/samples/recipes/boot-check/src/feature.ts +29 -0
- package/samples/recipes/compliance-profiles-demo/README.md +68 -0
- package/samples/recipes/compliance-profiles-demo/package.json +9 -0
- package/samples/recipes/compliance-profiles-demo/src/feature.ts +27 -0
- package/samples/recipes/cross-feature-events/README.md +63 -0
- package/samples/recipes/cross-feature-events/package.json +9 -0
- package/samples/recipes/cross-feature-events/src/feature.ts +122 -0
- package/samples/recipes/crypto-shredding-hr/README.md +74 -0
- package/samples/recipes/crypto-shredding-hr/package.json +8 -0
- package/samples/recipes/crypto-shredding-hr/src/feature.ts +38 -0
- package/samples/recipes/currencies-global/README.md +21 -0
- package/samples/recipes/currencies-global/package.json +8 -0
- package/samples/recipes/currencies-global/src/entities/currency.ts +15 -0
- package/samples/recipes/currencies-global/src/entities/invoice.ts +18 -0
- package/samples/recipes/currencies-global/src/entities/tenant-currency.ts +19 -0
- package/samples/recipes/currencies-global/src/feature.ts +62 -0
- package/samples/recipes/currencies-global/src/handlers/invoice-create.write.ts +68 -0
- package/samples/recipes/currencies-global/src/handlers/invoice-detail.query.ts +19 -0
- package/samples/recipes/currencies-global/src/handlers/tenant-currency-assign.write.ts +40 -0
- package/samples/recipes/currencies-per-tenant/README.md +21 -0
- package/samples/recipes/currencies-per-tenant/package.json +8 -0
- package/samples/recipes/currencies-per-tenant/src/entities/currency.ts +20 -0
- package/samples/recipes/currencies-per-tenant/src/entities/invoice.ts +18 -0
- package/samples/recipes/currencies-per-tenant/src/feature.ts +29 -0
- package/samples/recipes/currencies-per-tenant/src/handlers/currency-create.write.ts +24 -0
- package/samples/recipes/currencies-per-tenant/src/handlers/invoice-create.write.ts +66 -0
- package/samples/recipes/currencies-per-tenant/src/handlers/invoice-detail.query.ts +19 -0
- package/samples/recipes/custom-fields-basic/README.md +84 -0
- package/samples/recipes/custom-fields-basic/package.json +9 -0
- package/samples/recipes/custom-fields-basic/src/feature.ts +98 -0
- package/samples/recipes/custom-handlers/README.md +46 -0
- package/samples/recipes/custom-handlers/package.json +8 -0
- package/samples/recipes/custom-handlers/src/feature.ts +118 -0
- package/samples/recipes/delivery-notifications/README.md +48 -0
- package/samples/recipes/delivery-notifications/package.json +9 -0
- package/samples/recipes/delivery-notifications/src/feature.ts +108 -0
- package/samples/recipes/designer-demo/README.md +16 -0
- package/samples/recipes/designer-demo/package.json +8 -0
- package/samples/recipes/designer-demo/src/feature.ts +55 -0
- package/samples/recipes/e2e-generator/README.md +19 -0
- package/samples/recipes/e2e-generator/package.json +8 -0
- package/samples/recipes/e2e-generator/src/feature.ts +83 -0
- package/samples/recipes/embedded/README.md +33 -0
- package/samples/recipes/embedded/package.json +8 -0
- package/samples/recipes/embedded/src/entities/contact.ts +46 -0
- package/samples/recipes/embedded/src/entities/invoice.ts +35 -0
- package/samples/recipes/embedded/src/entities/product.ts +14 -0
- package/samples/recipes/embedded/src/feature.ts +58 -0
- package/samples/recipes/embedded/src/handlers/contact-create.write.ts +45 -0
- package/samples/recipes/embedded/src/handlers/contact-detail.query.ts +20 -0
- package/samples/recipes/embedded-entity-form/README.md +65 -0
- package/samples/recipes/embedded-entity-form/package.json +14 -0
- package/samples/recipes/embedded-entity-form/src/entities/prospect.ts +21 -0
- package/samples/recipes/embedded-entity-form/src/entities/suggestion.ts +22 -0
- package/samples/recipes/embedded-entity-form/src/feature.ts +120 -0
- package/samples/recipes/embedded-entity-form/src/screens/prospect-accept-screen.ts +13 -0
- package/samples/recipes/embedded-entity-form/src/web/accept-suggestion-drawer.tsx +125 -0
- package/samples/recipes/embedded-entity-form/tsconfig.json +8 -0
- package/samples/recipes/encrypted-tenant-config/README.md +131 -0
- package/samples/recipes/encrypted-tenant-config/package.json +9 -0
- package/samples/recipes/encrypted-tenant-config/src/feature.ts +100 -0
- package/samples/recipes/error-contract/README.md +97 -0
- package/samples/recipes/error-contract/package.json +8 -0
- package/samples/recipes/error-contract/src/feature.ts +238 -0
- package/samples/recipes/event-sourcing/README.md +70 -0
- package/samples/recipes/event-sourcing/package.json +9 -0
- package/samples/recipes/event-sourcing/src/feature.ts +486 -0
- package/samples/recipes/event-sourcing/tsconfig.json +26 -0
- package/samples/recipes/feature-toggles/README.md +21 -0
- package/samples/recipes/feature-toggles/package.json +9 -0
- package/samples/recipes/feature-toggles/src/feature.ts +111 -0
- package/samples/recipes/field-access/README.md +71 -0
- package/samples/recipes/field-access/package.json +8 -0
- package/samples/recipes/field-access/src/feature.ts +32 -0
- package/samples/recipes/files-post-processing/README.md +21 -0
- package/samples/recipes/files-post-processing/package.json +12 -0
- package/samples/recipes/files-post-processing/src/feature.ts +138 -0
- package/samples/recipes/i18n/README.md +36 -0
- package/samples/recipes/i18n/package.json +8 -0
- package/samples/recipes/i18n/src/feature.ts +52 -0
- package/samples/recipes/idempotency/README.md +21 -0
- package/samples/recipes/idempotency/package.json +8 -0
- package/samples/recipes/idempotency/src/feature.ts +50 -0
- package/samples/recipes/inbound-mail-triage/README.md +30 -0
- package/samples/recipes/inbound-mail-triage/package.json +9 -0
- package/samples/recipes/inbound-mail-triage/src/feature.ts +68 -0
- package/samples/recipes/lane-routing/README.md +21 -0
- package/samples/recipes/lane-routing/package.json +8 -0
- package/samples/recipes/lane-routing/src/feature.ts +106 -0
- package/samples/recipes/ledger-banking/README.md +47 -0
- package/samples/recipes/ledger-banking/package.json +9 -0
- package/samples/recipes/ledger-banking/src/usage.ts +86 -0
- package/samples/recipes/ledger-invoicing/README.md +54 -0
- package/samples/recipes/ledger-invoicing/package.json +9 -0
- package/samples/recipes/ledger-invoicing/src/usage.ts +93 -0
- package/samples/recipes/legal-pages/README.md +204 -0
- package/samples/recipes/legal-pages/package.json +9 -0
- package/samples/recipes/legal-pages/src/feature.ts +50 -0
- package/samples/recipes/lifecycle-hooks/README.md +46 -0
- package/samples/recipes/lifecycle-hooks/package.json +8 -0
- package/samples/recipes/lifecycle-hooks/src/feature.ts +104 -0
- package/samples/recipes/managed-config/README.md +136 -0
- package/samples/recipes/managed-config/package.json +9 -0
- package/samples/recipes/managed-config/src/feature.ts +88 -0
- package/samples/recipes/managed-pages/README.md +158 -0
- package/samples/recipes/managed-pages/package.json +9 -0
- package/samples/recipes/managed-pages/src/feature.ts +25 -0
- package/samples/recipes/notes-history-basic/README.md +93 -0
- package/samples/recipes/notes-history-basic/package.json +9 -0
- package/samples/recipes/notes-history-basic/src/feature.ts +72 -0
- package/samples/recipes/notes-history-basic/src/usage.ts +42 -0
- package/samples/recipes/ownership/README.md +21 -0
- package/samples/recipes/ownership/package.json +8 -0
- package/samples/recipes/ownership/src/feature.ts +98 -0
- package/samples/recipes/pipeline-basics/README.md +106 -0
- package/samples/recipes/pipeline-basics/package.json +8 -0
- package/samples/recipes/pipeline-basics/src/feature.ts +424 -0
- package/samples/recipes/pipeline-basics/tsconfig.json +15 -0
- package/samples/recipes/public-share-token/README.md +37 -0
- package/samples/recipes/public-share-token/package.json +8 -0
- package/samples/recipes/public-share-token/src/feature.ts +197 -0
- package/samples/recipes/rate-limiting/README.md +21 -0
- package/samples/recipes/rate-limiting/package.json +8 -0
- package/samples/recipes/rate-limiting/src/feature.ts +26 -0
- package/samples/recipes/realtime-sse/README.md +21 -0
- package/samples/recipes/realtime-sse/package.json +8 -0
- package/samples/recipes/realtime-sse/src/feature.ts +27 -0
- package/samples/recipes/record-detail-layout/README.md +25 -0
- package/samples/recipes/record-detail-layout/package.json +22 -0
- package/samples/recipes/record-detail-layout/src/feature.ts +140 -0
- package/samples/recipes/reference-data/README.md +21 -0
- package/samples/recipes/reference-data/package.json +8 -0
- package/samples/recipes/reference-data/src/feature.ts +37 -0
- package/samples/recipes/relations/README.md +21 -0
- package/samples/recipes/relations/package.json +8 -0
- package/samples/recipes/relations/src/feature.ts +81 -0
- package/samples/recipes/screens-nav/README.md +19 -0
- package/samples/recipes/screens-nav/package.json +8 -0
- package/samples/recipes/screens-nav/src/feature.ts +142 -0
- package/samples/recipes/search/README.md +21 -0
- package/samples/recipes/search/package.json +8 -0
- package/samples/recipes/search/src/feature.ts +72 -0
- package/samples/recipes/secrets-demo/README.md +21 -0
- package/samples/recipes/secrets-demo/package.json +9 -0
- package/samples/recipes/secrets-demo/src/feature.ts +88 -0
- package/samples/recipes/security-baseline/README.md +81 -0
- package/samples/recipes/security-baseline/package.json +9 -0
- package/samples/recipes/security-baseline/src/feature.ts +19 -0
- package/samples/recipes/seed-migration/README.md +81 -0
- package/samples/recipes/seed-migration/package.json +10 -0
- package/samples/recipes/seed-migration/scripts/smoke.ts +125 -0
- package/samples/recipes/seed-migration/seeds/2026-01-01-initial-tenants.ts +32 -0
- package/samples/recipes/seed-migration/seeds/2026-02-01-fix-admin-roles.ts +38 -0
- package/samples/recipes/session-revocation/README.md +49 -0
- package/samples/recipes/session-revocation/package.json +9 -0
- package/samples/recipes/session-revocation/src/feature.ts +50 -0
- package/samples/recipes/state-machine/README.md +21 -0
- package/samples/recipes/state-machine/package.json +9 -0
- package/samples/recipes/state-machine/src/entities/invoice.ts +35 -0
- package/samples/recipes/state-machine/src/events.ts +32 -0
- package/samples/recipes/state-machine/src/feature.ts +89 -0
- package/samples/recipes/state-machine/src/handlers/_helpers.ts +68 -0
- package/samples/recipes/state-machine/src/handlers/create.ts +27 -0
- package/samples/recipes/state-machine/src/handlers/transitions.ts +137 -0
- package/samples/recipes/state-machine/src/reducer.ts +50 -0
- package/samples/recipes/state-machine/tsconfig.json +26 -0
- package/samples/recipes/tags-basic/README.md +100 -0
- package/samples/recipes/tags-basic/package.json +9 -0
- package/samples/recipes/tags-basic/src/feature.ts +71 -0
- package/samples/recipes/tags-basic/src/usage.ts +50 -0
- package/samples/recipes/tenant-isolation/README.md +21 -0
- package/samples/recipes/tenant-isolation/package.json +8 -0
- package/samples/recipes/tenant-isolation/src/feature.ts +28 -0
- package/samples/recipes/tenant-settings/README.md +112 -0
- package/samples/recipes/tenant-settings/package.json +9 -0
- package/samples/recipes/tenant-settings/src/feature.ts +35 -0
- package/samples/recipes/tier-admin/README.md +80 -0
- package/samples/recipes/tier-admin/package.json +9 -0
- package/samples/recipes/tier-admin/src/feature.ts +60 -0
- package/samples/recipes/timezones/README.md +97 -0
- package/samples/recipes/timezones/package.json +8 -0
- package/samples/recipes/timezones/src/feature.ts +72 -0
- package/samples/recipes/tsconfig.base.json +23 -0
- package/samples/recipes/user-data-rights/README.md +100 -0
- package/samples/recipes/user-data-rights/package.json +9 -0
- package/samples/recipes/user-data-rights/src/feature.ts +97 -0
- package/samples/recipes/user-profile/README.md +86 -0
- package/samples/recipes/user-profile/package.json +9 -0
- package/samples/recipes/user-profile/src/feature.ts +73 -0
- package/samples/recipes/webhook-step/README.md +47 -0
- package/samples/recipes/webhook-step/package.json +9 -0
- package/samples/recipes/webhook-step/src/feature.ts +203 -0
- package/samples/recipes/webhook-step/tsconfig.json +18 -0
- package/samples/recipes/wizard-form/README.md +79 -0
- package/samples/recipes/wizard-form/package.json +23 -0
- package/samples/recipes/wizard-form/src/entities/listing.ts +27 -0
- package/samples/recipes/wizard-form/src/feature.ts +48 -0
- package/samples/recipes/wizard-form/src/web/index.ts +16 -0
- package/samples/recipes/wizard-form/src/web/listing-review-section.tsx +21 -0
- package/samples/recipes/wizard-form/tsconfig.json +8 -0
- package/samples/recipes/workflow-engine/README.md +21 -0
- package/samples/recipes/workflow-engine/package.json +9 -0
- package/samples/recipes/workflow-engine/src/cron-scheduler.ts +110 -0
- package/samples/recipes/workflow-engine/src/db/queries/suspended-runs.ts +14 -0
- package/samples/recipes/workflow-engine/src/event-trigger.ts +84 -0
- package/samples/recipes/workflow-engine/src/feature.ts +167 -0
- package/samples/recipes/workflow-engine/src/postgres-resume-loop.ts +98 -0
- package/samples/recipes/workflow-engine/src/resume-loop.ts +209 -0
- package/samples/recipes/workflow-engine/src/workflow-runner.ts +97 -0
- package/samples/recipes/workflow-engine/tsconfig.json +21 -0
- package/samples/recipes/writeform-section/README.md +30 -0
- package/samples/recipes/writeform-section/package.json +23 -0
- package/samples/recipes/writeform-section/src/feature.ts +123 -0
- package/samples/recipes/writeform-section/src/note-fixture.ts +8 -0
- package/samples/recipes/writeform-section/tsconfig.json +8 -0
|
@@ -0,0 +1,808 @@
|
|
|
1
|
+
// kumiko-lint-ignore app-feature-structure Phase-3 conversion tracked in #2312 (feature.ts > 300 lines)
|
|
2
|
+
import { UNKNOWN_CLIENT_IP } from "@cosmicdrift/kumiko-framework/api";
|
|
3
|
+
import {
|
|
4
|
+
createSystemConfig,
|
|
5
|
+
defineFeature,
|
|
6
|
+
EXT_USER_DATA,
|
|
7
|
+
type FeatureDefinition,
|
|
8
|
+
i18nKey,
|
|
9
|
+
SYSTEM_USER_ID,
|
|
10
|
+
} from "@cosmicdrift/kumiko-framework/engine";
|
|
11
|
+
import {
|
|
12
|
+
createMetricsHandle,
|
|
13
|
+
createNoopMetricsHandle,
|
|
14
|
+
} from "@cosmicdrift/kumiko-framework/observability";
|
|
15
|
+
import { validateGdprHookCompleteness, validateGdprPiiHookCoverage } from "./boot-checks.js";
|
|
16
|
+
import {
|
|
17
|
+
EXPORT_SECTION_EXTENSION_NAME,
|
|
18
|
+
PRIVACY_CENTER_SCREEN_ID,
|
|
19
|
+
STATUS_OPTION_KEY_PREFIX,
|
|
20
|
+
USER_ME_QUERY,
|
|
21
|
+
UserDataRightsHandlers,
|
|
22
|
+
} from "./constants.js";
|
|
23
|
+
import { cancelDeletionWrite } from "./handlers/cancel-deletion.write.js";
|
|
24
|
+
import { createConfirmDeletionByTokenHandler } from "./handlers/confirm-deletion-by-token.write.js";
|
|
25
|
+
import { downloadAttemptListQuery } from "./handlers/download-attempt-list.query.js";
|
|
26
|
+
import { downloadByJobQuery } from "./handlers/download-by-job.query.js";
|
|
27
|
+
import { downloadByTokenQuery } from "./handlers/download-by-token.query.js";
|
|
28
|
+
import { exportJobDetailQuery } from "./handlers/export-job-detail.query.js";
|
|
29
|
+
import { exportJobListQuery } from "./handlers/export-job-list.query.js";
|
|
30
|
+
import { exportStatusQuery } from "./handlers/export-status.query.js";
|
|
31
|
+
import { liftRestrictionWrite } from "./handlers/lift-restriction.write.js";
|
|
32
|
+
import { listDownloadAttemptsQuery } from "./handlers/list-download-attempts.query.js";
|
|
33
|
+
import { myAuditLogQuery } from "./handlers/my-audit-log.query.js";
|
|
34
|
+
import {
|
|
35
|
+
createRequestDeletionHandler,
|
|
36
|
+
type SendDeletionRequestedEmailFn,
|
|
37
|
+
} from "./handlers/request-deletion.write.js";
|
|
38
|
+
import {
|
|
39
|
+
createRequestDeletionByEmailHandler,
|
|
40
|
+
type SendDeletionVerificationEmailFn,
|
|
41
|
+
} from "./handlers/request-deletion-by-email.write.js";
|
|
42
|
+
import { requestExportWrite } from "./handlers/request-export.write.js";
|
|
43
|
+
import { restrictAccountWrite } from "./handlers/restrict-account.write.js";
|
|
44
|
+
import { createRunForgetCleanupHandler } from "./handlers/run-forget-cleanup.write.js";
|
|
45
|
+
import { USER_DATA_RIGHTS_I18N } from "./i18n.js";
|
|
46
|
+
import {
|
|
47
|
+
type GdprMailDefaults,
|
|
48
|
+
isMailTransportAvailable,
|
|
49
|
+
makeDefaultDeletionExecutedEmail,
|
|
50
|
+
makeDefaultExportFailedEmail,
|
|
51
|
+
makeDefaultExportReadyEmail,
|
|
52
|
+
} from "./lib/default-mailers.js";
|
|
53
|
+
import { makeTenantMailTransportResolver } from "./lib/mail-transport-resolver.js";
|
|
54
|
+
import { resolveAppTenantModel } from "./lib/resolve-tenant-model.js";
|
|
55
|
+
import { makeTenantStorageProviderResolver } from "./lib/storage-provider-resolver.js";
|
|
56
|
+
import {
|
|
57
|
+
EXPORT_CLEANUP_BACKLOG_AGE_METRIC,
|
|
58
|
+
EXPORT_CLEANUP_LAST_RUN_TIMESTAMP_METRIC,
|
|
59
|
+
runExportJobs,
|
|
60
|
+
type SendExportFailedEmailFn,
|
|
61
|
+
type SendExportReadyEmailFn,
|
|
62
|
+
} from "./run-export-jobs.js";
|
|
63
|
+
import {
|
|
64
|
+
runForgetCleanup,
|
|
65
|
+
type SendDeletionExecutedEmailFn,
|
|
66
|
+
sanitizeReasonForLog,
|
|
67
|
+
} from "./run-forget-cleanup.js";
|
|
68
|
+
import { downloadAttemptEntity } from "./schema/download-attempt.js";
|
|
69
|
+
import { exportDownloadTokenEntity } from "./schema/download-token.js";
|
|
70
|
+
import { exportJobEntity } from "./schema/export-job.js";
|
|
71
|
+
import {
|
|
72
|
+
downloadAttemptListScreen,
|
|
73
|
+
exportJobDetailScreen,
|
|
74
|
+
exportJobListScreen,
|
|
75
|
+
} from "./screens.js";
|
|
76
|
+
|
|
77
|
+
// user-data-rights — DSGVO Art. 15 (Auskunft) + Art. 17 (Löschung) +
|
|
78
|
+
// Art. 18 (Restriction) + Art. 20 (Portabilität) als Core-Feature.
|
|
79
|
+
//
|
|
80
|
+
// Pattern (Plan-Roadmap docs/plans/datenschutz/user-data-rights.md):
|
|
81
|
+
// Statt jedes Feature seine eigene Forget-/Export-Logik schreibt,
|
|
82
|
+
// haengt es sich via `r.useExtension(EXT_USER_DATA, "<entity>", {
|
|
83
|
+
// export, delete })` an. user-data-rights orchestriert:
|
|
84
|
+
// - Export-Job: iteriert alle Extension-Registrierungen, sammelt JSON
|
|
85
|
+
// - Forget-Job: iteriert alle, ruft delete-Hook mit Strategy aus
|
|
86
|
+
// retention.policyFor (data-retention)
|
|
87
|
+
// - Restriction: status-Flip auf user-Schema, Auth-Middleware-Guard
|
|
88
|
+
/**
|
|
89
|
+
* Options fuer createUserDataRightsFeature. Notification-Callbacks
|
|
90
|
+
* (Atom 5) folgen dem password-reset-Pattern aus auth-routes.ts.
|
|
91
|
+
*
|
|
92
|
+
* Plain-Token landet NIE in DB/event-store/jobRunsTable — Worker reicht
|
|
93
|
+
* ihn ephemeral via Callback-arg an die App-Author-Implementation
|
|
94
|
+
* (typisch: `delivery.notify(...)` mit `r.notification`-Templates,
|
|
95
|
+
* `mailFoundation.send` direkt, oder Custom Resend/SES).
|
|
96
|
+
*
|
|
97
|
+
* Worker-Run-Tracking + Retry kommt automatisch via existing
|
|
98
|
+
* `jobs`-Feature (siehe CLAUDE.md "Bundled-Features by Concern").
|
|
99
|
+
*/
|
|
100
|
+
export type UserDataRightsOptions = {
|
|
101
|
+
/** Email-Notification beim Export-done. App-Author wired das an seinen
|
|
102
|
+
* Email-Provider. Best-effort (Atom 5.fix3): send-Throw fuer Job A
|
|
103
|
+
* killt den Batch nicht — restliche pending-Jobs werden weiter
|
|
104
|
+
* verarbeitet, Failure wird via console.warn sichtbar. (Vorher
|
|
105
|
+
* bubbelte der Throw zum r.job-Wrap, was bei mehreren pending Jobs
|
|
106
|
+
* zum silent-miss fuehrte: Job A done committed, B/C/D nie
|
|
107
|
+
* verarbeitet, retry findet niemand.) */
|
|
108
|
+
readonly sendExportReadyEmail?: SendExportReadyEmailFn;
|
|
109
|
+
/** Email-Notification beim Export-failed. Best-effort analog
|
|
110
|
+
* sendExportReadyEmail. */
|
|
111
|
+
readonly sendExportFailedEmail?: SendExportFailedEmailFn;
|
|
112
|
+
/** Base-URL fuer den Magic-Link, z.B.
|
|
113
|
+
* "https://app.example.com/user-export/by-token". Worker bauen
|
|
114
|
+
* a URL fragment (`#token=<plain>`, issue #1271). Required wenn
|
|
115
|
+
* sendExportReadyEmail gesetzt. Per-Tenant via reverse-proxy host
|
|
116
|
+
* routing — nicht via per-Tenant-config-key (App-Author-Decision). */
|
|
117
|
+
readonly appExportDownloadUrl?: string;
|
|
118
|
+
/** Atom 5b — Email-Notification beim deletion-requested-flip
|
|
119
|
+
* ("Account-Loeschung in 30 Tagen"). Best-effort: send-failure killt
|
|
120
|
+
* den Status-Flip nicht (siehe handlers/request-deletion.write.ts). */
|
|
121
|
+
readonly sendDeletionRequestedEmail?: SendDeletionRequestedEmailFn;
|
|
122
|
+
/** Atom 5b — Email-Notification beim Cleanup-Runner-done-Pfad
|
|
123
|
+
* ("Account wurde geloescht"). Best-effort. Der Versand passiert NACH
|
|
124
|
+
* dem User-Hook-Anonymisieren, deshalb cached der Worker
|
|
125
|
+
* userEmail+tenantIds PRE-tx und reicht sie ephemeral an die
|
|
126
|
+
* Callback-Implementation (siehe run-forget-cleanup.ts). */
|
|
127
|
+
readonly sendDeletionExecutedEmail?: SendDeletionExecutedEmailFn;
|
|
128
|
+
/** Anonymer, email-verifizierter Apex-Deletion-Flow (Lockout-sicher).
|
|
129
|
+
* HMAC-Secret zum Signieren des Verify-Tokens. Ohne Secret bleibt der
|
|
130
|
+
* Flow deaktiviert (request-by-email antwortet still success, confirm-
|
|
131
|
+
* by-token weist generisch ab). */
|
|
132
|
+
readonly deletionTokenSecret?: string;
|
|
133
|
+
/** Basis-URL des Apex-Confirm-Screens, z.B.
|
|
134
|
+
* "https://app.example.com/delete-account/confirm". Der Handler hängt das
|
|
135
|
+
* Token als URL-Fragment an (`#token=<token>`, fw#1554). Required wenn
|
|
136
|
+
* deletionTokenSecret gesetzt. */
|
|
137
|
+
readonly deletionVerifyUrl?: string;
|
|
138
|
+
/** Versand des Verify-Magic-Links (Schritt 1 des anonymen Flows).
|
|
139
|
+
* Best-effort, app-author-wired. MUSS non-blocking sein (enqueue, z.B.
|
|
140
|
+
* delivery.notify) — ein synchroner Send reintroduziert ein Timing-Oracle
|
|
141
|
+
* für Account-Enumeration (siehe SendDeletionVerificationEmailFn-Doc).
|
|
142
|
+
* Bewusst KEINE mail-foundation-Default: ein synchroner Default-Send
|
|
143
|
+
* brächte genau dieses Enumeration-Oracle zurück, deshalb app-wired. */
|
|
144
|
+
readonly sendDeletionVerificationEmail?: SendDeletionVerificationEmailFn;
|
|
145
|
+
/** C6 — Zero-Callback-GDPR-Mails: ist mail-foundation + ein mail-transport-*
|
|
146
|
+
* gemountet, versendet user-data-rights die Export-/Loesch-Notifications
|
|
147
|
+
* selbst (Export-ready/-failed, Deletion-requested/-executed) ueber die
|
|
148
|
+
* Default-Templates (email-templates.ts) — die App schreibt keinen Callback.
|
|
149
|
+
* `mailDefaults` brandet diese Default-Mails (Locale + App-Name). Greift NUR
|
|
150
|
+
* wenn der jeweilige send*Email-Opt NICHT gesetzt ist; Export-ready braucht
|
|
151
|
+
* zusaetzlich appExportDownloadUrl. */
|
|
152
|
+
readonly mailDefaults?: GdprMailDefaults;
|
|
153
|
+
/** Hides the Art. 17 deletion section + its request-deletion/cancel-deletion
|
|
154
|
+
* actions on the privacy-center screen — for apps that already offer
|
|
155
|
+
* account deletion elsewhere (e.g. a profile danger-zone), against
|
|
156
|
+
* duplication. Default `true` (deletion section shown).
|
|
157
|
+
* BREAKING (fw#2312): replaces the removed client-side
|
|
158
|
+
* `userDataRightsClient({ privacyCenter: { showDeletion } })` option —
|
|
159
|
+
* the screen is now declared once, server-side (`type: "projectionDetail"`),
|
|
160
|
+
* so per-app visibility can only be a boot-time option, not a client-side
|
|
161
|
+
* component swap. Consumers that passed `showDeletion: false` client-side
|
|
162
|
+
* must move it here. */
|
|
163
|
+
readonly privacyCenterShowDeletion?: boolean;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export function createUserDataRightsFeature(opts: UserDataRightsOptions = {}): FeatureDefinition {
|
|
167
|
+
// One-shot operator warning (the export cron fires daily — warn once per
|
|
168
|
+
// process, not every run). Lives in the factory scope so the cron closure
|
|
169
|
+
// shares it across runs.
|
|
170
|
+
let warnedMissingExportUrl = false;
|
|
171
|
+
const showDeletion = opts.privacyCenterShowDeletion ?? true;
|
|
172
|
+
return defineFeature("user-data-rights", (r) => {
|
|
173
|
+
r.describe(
|
|
174
|
+
'Implements GDPR Art. 15 (access / `my-audit-log` query), Art. 17 (erasure / `request-deletion` + `cancel-deletion`, plus the anonymous email-verified `request-deletion-by-email` + `confirm-deletion-by-token` flow for lockout-safe self-service, + cron cleanup with grace period), Art. 18 (restriction / `restrict-account` + `lift-restriction`), and Art. 20 (portability / async `request-export` \u2192 ZIP via `file-foundation`, Magic-Link download) as first-class HTTP handlers and cron jobs. Each domain feature opts in by calling `r.useExtension(EXT_USER_DATA, "<entity>", { export, delete })` \u2014 the feature then orchestrates the export and forget pipelines across all registered hooks automatically. When `mail-foundation` and a `mail-transport-*` are mounted, it also sends the four GDPR notifications (export ready/failed, deletion requested/executed) itself with no app callback code, rendered in each recipient’s locale. Requires `user`, `data-retention`, `compliance-profiles`, and `sessions`.',
|
|
175
|
+
);
|
|
176
|
+
r.uiHints({
|
|
177
|
+
displayLabel: "User Data Rights \u00b7 GDPR",
|
|
178
|
+
category: "compliance",
|
|
179
|
+
recommended: false,
|
|
180
|
+
});
|
|
181
|
+
r.requires("user", "data-retention", "compliance-profiles", "sessions");
|
|
182
|
+
r.usesApi("compliance.forTenant");
|
|
183
|
+
r.usesApi("retention.policyFor");
|
|
184
|
+
// S2.U6 — restrict-account ruft sessions.revokeAllForUser cross-feature.
|
|
185
|
+
// r.usesApi sorgt fuer Boot-Validation: App ohne sessions-feature wirft
|
|
186
|
+
// beim Boot, statt erst beim ersten Restrict-Call ein opaque "handler
|
|
187
|
+
// not found" zu werfen.
|
|
188
|
+
r.usesApi("sessions.revokeAllForUser");
|
|
189
|
+
// file-foundation ist soft-dep: nur der Export-Worker (Atom 3b)
|
|
190
|
+
// braucht ihn fuer Storage-Schreiben. Apps die nur Forget nutzen
|
|
191
|
+
// (kein Export) muessen file-foundation nicht mounten.
|
|
192
|
+
|
|
193
|
+
r.extendsRegistrar(EXT_USER_DATA, {});
|
|
194
|
+
|
|
195
|
+
// GDPR-storage guards V2+V3 (#1314) — moved off the framework-internal
|
|
196
|
+
// boot-validator onto this feature's own r.bootCheck(), since it's the
|
|
197
|
+
// EXT_USER_DATA channel owner: any r.useExtension(EXT_USER_DATA, ...)
|
|
198
|
+
// usage already requires user-data-rights to be mounted.
|
|
199
|
+
r.bootCheck(({ features }) => validateGdprHookCompleteness(features));
|
|
200
|
+
r.bootCheck(({ features }) => validateGdprPiiHookCoverage(features));
|
|
201
|
+
|
|
202
|
+
// App-level tenant-occupancy model. Default "multi-user" → tenant-scoped
|
|
203
|
+
// contributors (e.g. credit) NEVER erase tenant data on a per-user forget
|
|
204
|
+
// (would harm co-members). An app with one user per tenant sets this to
|
|
205
|
+
// "single-user" via appOverrides (TENANT_MODEL_CONFIG_KEY) so the forget
|
|
206
|
+
// pipeline may erase the tenant's data as that user's personal data — still
|
|
207
|
+
// gated by a runtime sole-member check in run-forget-cleanup.
|
|
208
|
+
r.config(
|
|
209
|
+
"tenantModel",
|
|
210
|
+
createSystemConfig("select", {
|
|
211
|
+
default: "multi-user",
|
|
212
|
+
options: ["single-user", "multi-user"],
|
|
213
|
+
env: "TENANT_MODEL",
|
|
214
|
+
}),
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
// S2.U3 Atom 1b — ExportJob-Lifecycle-Entity.
|
|
218
|
+
r.entity("export-job", exportJobEntity);
|
|
219
|
+
|
|
220
|
+
// S2.U3 Atom 4a — Download-Token-Entity. Worker generiert Token beim
|
|
221
|
+
// Flip auf done (siehe run-export-jobs.ts). Hash in DB, plain im
|
|
222
|
+
// RunExportJobsResult fuer Atom 5 (Notification per Email).
|
|
223
|
+
r.entity("export-download-token", exportDownloadTokenEntity);
|
|
224
|
+
|
|
225
|
+
// S2.U7 — Audit-Trail invalid Download-Attempts (DPO Brute-Force-Detection).
|
|
226
|
+
r.entity("download-attempt", downloadAttemptEntity);
|
|
227
|
+
|
|
228
|
+
// S2.U6 — DSGVO Art. 18 Account-Freeze (Verarbeitungs-Pause).
|
|
229
|
+
// Endpoints fuer Restrict + Lift. Login-Block fuer Restricted Users
|
|
230
|
+
// lebt in auth-email-password/login.write.ts.
|
|
231
|
+
r.writeHandler(restrictAccountWrite);
|
|
232
|
+
r.writeHandler(liftRestrictionWrite);
|
|
233
|
+
|
|
234
|
+
// S2.U5a — Endpoints fuer DSGVO Art. 17 Forget-Pfad mit Grace.
|
|
235
|
+
r.writeHandler(
|
|
236
|
+
createRequestDeletionHandler({
|
|
237
|
+
...(opts.sendDeletionRequestedEmail && {
|
|
238
|
+
sendDeletionRequestedEmail: opts.sendDeletionRequestedEmail,
|
|
239
|
+
}),
|
|
240
|
+
...(opts.mailDefaults && { mailDefaults: opts.mailDefaults }),
|
|
241
|
+
}),
|
|
242
|
+
);
|
|
243
|
+
r.writeHandler(cancelDeletionWrite);
|
|
244
|
+
|
|
245
|
+
// Anonymer, email-verifizierter Apex-Deletion-Flow (Lockout-sicher):
|
|
246
|
+
// request-by-email (Schritt 1, Magic-Link) + confirm-by-token (Schritt 2,
|
|
247
|
+
// startet dieselbe Grace-Period via startDeletionGracePeriod).
|
|
248
|
+
r.writeHandler(
|
|
249
|
+
createRequestDeletionByEmailHandler({
|
|
250
|
+
...(opts.deletionTokenSecret !== undefined && {
|
|
251
|
+
deletionTokenSecret: opts.deletionTokenSecret,
|
|
252
|
+
}),
|
|
253
|
+
...(opts.deletionVerifyUrl !== undefined && { deletionVerifyUrl: opts.deletionVerifyUrl }),
|
|
254
|
+
...(opts.sendDeletionVerificationEmail !== undefined && {
|
|
255
|
+
sendDeletionVerificationEmail: opts.sendDeletionVerificationEmail,
|
|
256
|
+
}),
|
|
257
|
+
}),
|
|
258
|
+
);
|
|
259
|
+
r.writeHandler(
|
|
260
|
+
createConfirmDeletionByTokenHandler(
|
|
261
|
+
opts.deletionTokenSecret !== undefined
|
|
262
|
+
? { deletionTokenSecret: opts.deletionTokenSecret }
|
|
263
|
+
: {},
|
|
264
|
+
),
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
// S2.U5b — Cleanup-Runner als privileged-Handler. Atom 5b: Wenn
|
|
268
|
+
// sendDeletionExecutedEmail gesetzt, reicht der Handler den Callback
|
|
269
|
+
// an runForgetCleanup weiter (Worker cached userEmail+tenantIds
|
|
270
|
+
// PRE-tx, siehe run-forget-cleanup.ts).
|
|
271
|
+
r.writeHandler(
|
|
272
|
+
createRunForgetCleanupHandler(
|
|
273
|
+
opts.sendDeletionExecutedEmail
|
|
274
|
+
? { sendDeletionExecutedEmail: opts.sendDeletionExecutedEmail }
|
|
275
|
+
: {},
|
|
276
|
+
),
|
|
277
|
+
);
|
|
278
|
+
r.exposesApi("userDataRights.runForget");
|
|
279
|
+
|
|
280
|
+
// S2.U3 Atom 2 — User-Touchpoints fuer Async Export-Pipeline.
|
|
281
|
+
r.writeHandler(requestExportWrite);
|
|
282
|
+
r.queryHandler(exportStatusQuery);
|
|
283
|
+
r.exposesApi("userDataRights.runExport");
|
|
284
|
+
|
|
285
|
+
// S2.U3 Atom 4b — Download-Endpoints (Token-Pfad + Session-Pfad).
|
|
286
|
+
// Beide query-handlers verifizieren Token/Session, holen signed-URL
|
|
287
|
+
// vom Storage-Provider, und persistieren Audit-Felder am Token-Row.
|
|
288
|
+
// r.httpRoute-Wrapper unten machen den 302-Redirect zu signedUrl.
|
|
289
|
+
r.queryHandler(downloadByTokenQuery);
|
|
290
|
+
r.queryHandler(downloadByJobQuery);
|
|
291
|
+
|
|
292
|
+
// S2.U7 — User-Selbstauskunft (Art. 15) + Operator-Sicht auf
|
|
293
|
+
// invalid Download-Attempts (DPO).
|
|
294
|
+
r.queryHandler(myAuditLogQuery);
|
|
295
|
+
r.queryHandler(listDownloadAttemptsQuery);
|
|
296
|
+
|
|
297
|
+
// Read-only GDPR operator inspector (SystemAdmin) — screens stay inert until an app navs them.
|
|
298
|
+
r.queryHandler(exportJobListQuery);
|
|
299
|
+
r.queryHandler(exportJobDetailQuery);
|
|
300
|
+
r.queryHandler(downloadAttemptListQuery);
|
|
301
|
+
r.screen(exportJobListScreen);
|
|
302
|
+
r.screen(exportJobDetailScreen);
|
|
303
|
+
r.screen(downloadAttemptListScreen);
|
|
304
|
+
|
|
305
|
+
r.nav({
|
|
306
|
+
id: "export-job-list",
|
|
307
|
+
label: "user-data-rights:nav.exportJobs",
|
|
308
|
+
icon: "download",
|
|
309
|
+
screen: "user-data-rights:screen:export-job-list",
|
|
310
|
+
order: 25,
|
|
311
|
+
access: { roles: ["SystemAdmin"] },
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
r.translations({ keys: USER_DATA_RIGHTS_I18N });
|
|
315
|
+
// Privacy-center dot-form labels (i18nKey()-marked below), duplicated in
|
|
316
|
+
// web/i18n.ts's client bundle since privacy-center-screen.tsx renders
|
|
317
|
+
// them client-side.
|
|
318
|
+
r.translations({
|
|
319
|
+
keys: {
|
|
320
|
+
"userDataRights.privacyCenter.field.status": { en: "Account status" },
|
|
321
|
+
"userDataRights.privacyCenter.field.gracePeriodEnd": { en: "Scheduled deletion date" },
|
|
322
|
+
"userDataRights.privacyCenter.export.title": { en: "Export your data (Art. 20)" },
|
|
323
|
+
"userDataRights.privacyCenter.restriction.title": { en: "Restrict processing (Art. 18)" },
|
|
324
|
+
"userDataRights.privacyCenter.restriction.explainer": {
|
|
325
|
+
en: "Freeze your account: processing of your data is paused and you are signed out. Lifting the restriction afterwards is only possible via support.",
|
|
326
|
+
},
|
|
327
|
+
"userDataRights.privacyCenter.restriction.restrict": { en: "Restrict account" },
|
|
328
|
+
"userDataRights.privacyCenter.restriction.dialogTitle": { en: "Restrict your account?" },
|
|
329
|
+
"userDataRights.privacyCenter.restriction.dialogDescription": {
|
|
330
|
+
en: "You will be signed out immediately and cannot sign in again until support lifts the restriction.",
|
|
331
|
+
},
|
|
332
|
+
"userDataRights.privacyCenter.deletion.title": { en: "Delete account (Art. 17)" },
|
|
333
|
+
"userDataRights.privacyCenter.deletion.explainer": {
|
|
334
|
+
en: "Request deletion of your account. Until the grace period ends you can cancel the deletion.",
|
|
335
|
+
},
|
|
336
|
+
"userDataRights.privacyCenter.deletion.delete": { en: "Delete account" },
|
|
337
|
+
"userDataRights.privacyCenter.deletion.cancel": { en: "Cancel deletion" },
|
|
338
|
+
"userDataRights.privacyCenter.deletion.dialogTitle": { en: "Delete your account?" },
|
|
339
|
+
"userDataRights.privacyCenter.deletion.dialogDescription": {
|
|
340
|
+
en: "Confirming starts the deletion grace period. You can cancel the deletion until it ends.",
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// Self-service screen (Art. 15/17/18/20): export, restriction, deletion
|
|
346
|
+
// in one projectionDetail screen bound to the user's own `me` row. No
|
|
347
|
+
// r.nav — the app places it in its logged-in area; `dormant: true` opts
|
|
348
|
+
// it out of the nav-area boot check. access is openToAll because no app role name is
|
|
349
|
+
// portable; the per-user handlers enforce auth server-side.
|
|
350
|
+
//
|
|
351
|
+
// Restriction/Deletion are declarative fields + actions; Export stays a
|
|
352
|
+
// custom extension section (web/client-plugin.tsx registers the
|
|
353
|
+
// component under EXPORT_SECTION_EXTENSION_NAME) since it needs
|
|
354
|
+
// async-job polling + a signed-URL download that a declarative action
|
|
355
|
+
// can't express. entityName: "export-job" names the domain entity the
|
|
356
|
+
// extension persists against (projectionDetail has no real entity of
|
|
357
|
+
// its own for the extension to default to).
|
|
358
|
+
r.screen({
|
|
359
|
+
id: PRIVACY_CENTER_SCREEN_ID,
|
|
360
|
+
type: "projectionDetail",
|
|
361
|
+
query: USER_ME_QUERY,
|
|
362
|
+
singleton: true,
|
|
363
|
+
access: {
|
|
364
|
+
openToAll: {
|
|
365
|
+
reason:
|
|
366
|
+
"each signed-in user manages GDPR self-service actions (export, restriction, " +
|
|
367
|
+
"deletion) for only their own account; the bound query and every action handler " +
|
|
368
|
+
"operate on the caller's own userId, and no app role name is portable enough to gate this",
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
dormant: true,
|
|
372
|
+
description: "userDataRights.privacyCenter.subtitle",
|
|
373
|
+
fieldLabels: {
|
|
374
|
+
status: i18nKey("userDataRights.privacyCenter.field.status"),
|
|
375
|
+
gracePeriodEnd: i18nKey("userDataRights.privacyCenter.field.gracePeriodEnd"),
|
|
376
|
+
},
|
|
377
|
+
layout: {
|
|
378
|
+
sections: [
|
|
379
|
+
{
|
|
380
|
+
kind: "extension",
|
|
381
|
+
title: i18nKey("userDataRights.privacyCenter.export.title"),
|
|
382
|
+
component: { react: { __component: EXPORT_SECTION_EXTENSION_NAME } },
|
|
383
|
+
entityName: "export-job",
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
// `status` lives here (not in Deletion) because this is the one
|
|
387
|
+
// section always on the screen — Deletion is dropped entirely
|
|
388
|
+
// when `showDeletion` is false, and status covers restriction
|
|
389
|
+
// AND deletion state, so it can't hang off the optional section.
|
|
390
|
+
title: i18nKey("userDataRights.privacyCenter.restriction.title"),
|
|
391
|
+
description: i18nKey("userDataRights.privacyCenter.restriction.explainer"),
|
|
392
|
+
fields: [
|
|
393
|
+
{
|
|
394
|
+
field: "status",
|
|
395
|
+
renderer: { format: "enumOption", keyPrefix: STATUS_OPTION_KEY_PREFIX },
|
|
396
|
+
},
|
|
397
|
+
],
|
|
398
|
+
},
|
|
399
|
+
...(showDeletion
|
|
400
|
+
? [
|
|
401
|
+
{
|
|
402
|
+
title: i18nKey("userDataRights.privacyCenter.deletion.title"),
|
|
403
|
+
description: i18nKey("userDataRights.privacyCenter.deletion.explainer"),
|
|
404
|
+
// gracePeriodEnd is only meaningful once a deletion is
|
|
405
|
+
// actually pending — hide it instead of showing an empty
|
|
406
|
+
// date when status isn't deletionRequested.
|
|
407
|
+
fields: [
|
|
408
|
+
{
|
|
409
|
+
field: "gracePeriodEnd",
|
|
410
|
+
renderer: { format: "date" as const },
|
|
411
|
+
visible: { field: "status", eq: "deletionRequested" },
|
|
412
|
+
},
|
|
413
|
+
],
|
|
414
|
+
},
|
|
415
|
+
]
|
|
416
|
+
: []),
|
|
417
|
+
],
|
|
418
|
+
},
|
|
419
|
+
actions: [
|
|
420
|
+
{
|
|
421
|
+
id: "restrict",
|
|
422
|
+
icon: "lock",
|
|
423
|
+
label: i18nKey("userDataRights.privacyCenter.restriction.restrict"),
|
|
424
|
+
handler: UserDataRightsHandlers.restrictAccount,
|
|
425
|
+
confirm: i18nKey("userDataRights.privacyCenter.restriction.dialogDescription"),
|
|
426
|
+
visible: { field: "status", ne: "restricted" },
|
|
427
|
+
style: "danger",
|
|
428
|
+
},
|
|
429
|
+
...(showDeletion
|
|
430
|
+
? [
|
|
431
|
+
{
|
|
432
|
+
id: "request-deletion",
|
|
433
|
+
label: i18nKey("userDataRights.privacyCenter.deletion.delete"),
|
|
434
|
+
handler: UserDataRightsHandlers.requestDeletion,
|
|
435
|
+
confirm: i18nKey("userDataRights.privacyCenter.deletion.dialogDescription"),
|
|
436
|
+
visible: { field: "status", ne: "deletionRequested" },
|
|
437
|
+
style: "danger" as const,
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
id: "cancel-deletion",
|
|
441
|
+
label: i18nKey("userDataRights.privacyCenter.deletion.cancel"),
|
|
442
|
+
handler: UserDataRightsHandlers.cancelDeletion,
|
|
443
|
+
visible: { field: "status", eq: "deletionRequested" },
|
|
444
|
+
style: "secondary" as const,
|
|
445
|
+
// Declared: the id's last segment ("deletion") would otherwise resolve to the destructive trash icon.
|
|
446
|
+
icon: "x" as const,
|
|
447
|
+
},
|
|
448
|
+
]
|
|
449
|
+
: []),
|
|
450
|
+
],
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
// Magic-link path (anonymous): the email link carries the token as a
|
|
454
|
+
// URL fragment (`#token=<plain>`) instead of a query param — fragments
|
|
455
|
+
// never leave the browser, so they never hit proxy/access logs
|
|
456
|
+
// (issue #1271). This route only serves the interstitial page; the
|
|
457
|
+
// external script reads the fragment client-side and exchanges the
|
|
458
|
+
// token via POST for the signed URL.
|
|
459
|
+
//
|
|
460
|
+
// No `?token=` query fallback: framework is zero-legacy (#1512) — no
|
|
461
|
+
// live customer data / no pre-#1271 emails in flight that would need
|
|
462
|
+
// bridging, so there's nothing a fallback would need to cover. A query
|
|
463
|
+
// param reaches the server as part of the request URL and gets written
|
|
464
|
+
// to proxy/access logs regardless of what the handler does with it
|
|
465
|
+
// afterward (a redirect doesn't undo an already-logged request) — the
|
|
466
|
+
// only leak-proof fix is to never accept the token that way.
|
|
467
|
+
//
|
|
468
|
+
// Path sits outside /api/* — r.httpRoute must not claim the /api namespace
|
|
469
|
+
// (reserved for write/query/batch/auth/sse-dispatcher).
|
|
470
|
+
//
|
|
471
|
+
// The session path (logged-in download) needs no httpRoute wrapper: the
|
|
472
|
+
// client calls download-by-job via the Dispatcher (with X-CSRF-Token) and
|
|
473
|
+
// navigates to the returned signed URL — see postWithDownload in
|
|
474
|
+
// privacy-center-screen.
|
|
475
|
+
r.httpRoute({
|
|
476
|
+
method: "GET",
|
|
477
|
+
path: "/user-export/by-token",
|
|
478
|
+
anonymous: true,
|
|
479
|
+
handler: async (c) => {
|
|
480
|
+
return c.body(TOKEN_EXCHANGE_PAGE_HTML, 200, {
|
|
481
|
+
"content-type": "text/html; charset=utf-8",
|
|
482
|
+
});
|
|
483
|
+
},
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
// External script for the interstitial page above — same-origin file
|
|
487
|
+
// instead of inline <script>, so the page also works under a strict
|
|
488
|
+
// `script-src 'self'` CSP (apps set CSP via the security-headers
|
|
489
|
+
// option, without assuming `unsafe-inline`).
|
|
490
|
+
r.httpRoute({
|
|
491
|
+
method: "GET",
|
|
492
|
+
path: "/user-export/by-token.js",
|
|
493
|
+
anonymous: true,
|
|
494
|
+
handler: async (c) => {
|
|
495
|
+
return c.body(TOKEN_EXCHANGE_PAGE_JS, 200, {
|
|
496
|
+
"content-type": "application/javascript; charset=utf-8",
|
|
497
|
+
});
|
|
498
|
+
},
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
// Exchange endpoint for the interstitial page: the token arrives here
|
|
502
|
+
// as a POST body instead of a query string (issue #1271). A dedicated
|
|
503
|
+
// route rather than letting the browser JS call /api/query directly,
|
|
504
|
+
// for two reasons:
|
|
505
|
+
// 1. IP/UA audit — extractAuditMeta needs the raw request headers and
|
|
506
|
+
// the framework-resolved client IP, which only the server has, not
|
|
507
|
+
// the browser (see the GET path above). Without this route every
|
|
508
|
+
// fragment-path download would land in download-attempt with
|
|
509
|
+
// lastUsedFromIp/UA = null.
|
|
510
|
+
// 2. /api/query is the reserved dispatcher namespace for
|
|
511
|
+
// authenticated writes/queries — an anonymous cross-origin POST
|
|
512
|
+
// there isn't guaranteed to be reachable (origin guard).
|
|
513
|
+
r.httpRoute({
|
|
514
|
+
method: "POST",
|
|
515
|
+
path: "/user-export/by-token",
|
|
516
|
+
anonymous: true,
|
|
517
|
+
handler: async (c, { app, clientIp }) => {
|
|
518
|
+
const url = new URL(c.req.url);
|
|
519
|
+
const parsedBody = await c.req.json().catch(() => null);
|
|
520
|
+
const token =
|
|
521
|
+
parsedBody && typeof parsedBody === "object" && "token" in parsedBody
|
|
522
|
+
? (parsedBody as { token?: unknown }).token
|
|
523
|
+
: undefined;
|
|
524
|
+
if (typeof token !== "string" || token.length === 0) {
|
|
525
|
+
return c.json({ error: "missing_token" }, 400);
|
|
526
|
+
}
|
|
527
|
+
const auditMeta = extractAuditMeta(c.req.raw.headers, clientIp);
|
|
528
|
+
return app.fetch(
|
|
529
|
+
new Request(`${url.origin}/api/query`, {
|
|
530
|
+
method: "POST",
|
|
531
|
+
headers: { "content-type": "application/json" },
|
|
532
|
+
body: JSON.stringify({
|
|
533
|
+
type: "user-data-rights:query:download-by-token",
|
|
534
|
+
payload: { token, auditMeta },
|
|
535
|
+
}),
|
|
536
|
+
}),
|
|
537
|
+
// download-by-token.query.ts's `rateLimit: { per: "ip", limit: 30 }`
|
|
538
|
+
// resolves the client IP from this internal request's env (2nd
|
|
539
|
+
// app.fetch arg), same as Bun.serve's socket address — without it,
|
|
540
|
+
// the resolver has neither a trusted XFF entry (trustedProxyHops
|
|
541
|
+
// defaults to 0, ignoring headers entirely) nor a socket, so every
|
|
542
|
+
// fragment-POST download would fall to the shared "unknown" bucket,
|
|
543
|
+
// turning the per-user 30/min backstop into one global bucket an
|
|
544
|
+
// attacker can exhaust for everyone (#1307). Passing `clientIp`
|
|
545
|
+
// directly as env — the same server-resolved, trustedProxyHops-
|
|
546
|
+
// aware value the outer request already trusted — reaches
|
|
547
|
+
// extractSocketAddress() without going through header/hop-count
|
|
548
|
+
// logic at all.
|
|
549
|
+
clientIp,
|
|
550
|
+
);
|
|
551
|
+
},
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
// Surfaces a stalled export-cleanup cron: if the daily
|
|
555
|
+
// pass stops running, done-status export bundles keep sitting in
|
|
556
|
+
// storage past their TTL+grace with downloadStorageKey still set
|
|
557
|
+
// (unencrypted PII at rest). Gauges keep their last value in-process, so
|
|
558
|
+
// a dead cron does NOT make the backlog gauge absent; the last-run
|
|
559
|
+
// timestamp gauge below is the liveness signal.
|
|
560
|
+
// Scope: Done-status bundles past expiresAt+grace plus Failed-status
|
|
561
|
+
// orphans (no TTL, due from completedAt ?? startedAt; see storageCleanupPass).
|
|
562
|
+
r.metric(EXPORT_CLEANUP_BACKLOG_AGE_METRIC, {
|
|
563
|
+
type: "gauge",
|
|
564
|
+
unit: "seconds",
|
|
565
|
+
description:
|
|
566
|
+
"Age in seconds of the oldest export bundle (done: expiresAt+grace passed; failed: orphaned ZIP since completedAt or startedAt) whose downloadStorageKey is still set. 0 when the storage-cleanup pass has no backlog.",
|
|
567
|
+
});
|
|
568
|
+
r.metric(EXPORT_CLEANUP_LAST_RUN_TIMESTAMP_METRIC, {
|
|
569
|
+
type: "gauge",
|
|
570
|
+
unit: "seconds",
|
|
571
|
+
description:
|
|
572
|
+
"Unix timestamp of the last export storage-cleanup pass that completed. Alert on time() minus this value exceeding the cron interval plus a buffer; the backlog-age gauge alone stays at its last value when the cron stops.",
|
|
573
|
+
});
|
|
574
|
+
|
|
575
|
+
// S2.U3 Atom 3b — Worker fuer Async Export-Pipeline. Cron-getriggert.
|
|
576
|
+
const RUN_EXPORT_JOBS_REASON = "processes pending export jobs across every tenant";
|
|
577
|
+
r.job({
|
|
578
|
+
name: "run-export-jobs",
|
|
579
|
+
trigger: { cron: "0 3 * * *" },
|
|
580
|
+
concurrency: "skip",
|
|
581
|
+
escapeHatch: { reason: RUN_EXPORT_JOBS_REASON },
|
|
582
|
+
handler: async (_payload, ctx) => {
|
|
583
|
+
if (!ctx.registry) {
|
|
584
|
+
throw new Error("run-export-jobs: ctx.registry required (JobContext incomplete)");
|
|
585
|
+
}
|
|
586
|
+
const T = (await import("@cosmicdrift/kumiko-framework/time")).getTemporal();
|
|
587
|
+
// SYSTEM_USER_ID ist die framework-weite Konvention. Der job-
|
|
588
|
+
// Discriminator wird via handlerName="user-data-rights:run-export-
|
|
589
|
+
// jobs" im Secret-Read-Audit erfasst.
|
|
590
|
+
const exportUserId = ctx._userId ?? SYSTEM_USER_ID;
|
|
591
|
+
const exportDb = ctx.db.unsafeRaw(
|
|
592
|
+
RUN_EXPORT_JOBS_REASON,
|
|
593
|
+
) as import("@cosmicdrift/kumiko-framework/db").DbConnection; // @cast-boundary db-operator — jobs never run inside a DbTx
|
|
594
|
+
const exportRegistry = ctx.registry;
|
|
595
|
+
// JobContext carries ctx.meter (raw), not ctx.metrics — that bound
|
|
596
|
+
// handle only exists on HandlerContext (built per write/query call
|
|
597
|
+
// in dispatch-shared.ts). Build the same handle explicitly here.
|
|
598
|
+
const exportMetrics = ctx.meter
|
|
599
|
+
? createMetricsHandle(ctx.meter, "user-data-rights")
|
|
600
|
+
: createNoopMetricsHandle();
|
|
601
|
+
|
|
602
|
+
// C6 — ohne eigene send*Email-Opts aber mit gemountetem mail-transport
|
|
603
|
+
// versendet der Cron die Export-Notifications selbst (Default-Templates).
|
|
604
|
+
// Der Resolver baut den per-Tenant-Transport aus configResolver — gleiche
|
|
605
|
+
// Bruecke wie buildStorageProvider.
|
|
606
|
+
const exportMailResolver = isMailTransportAvailable(exportRegistry)
|
|
607
|
+
? makeTenantMailTransportResolver({
|
|
608
|
+
registry: exportRegistry,
|
|
609
|
+
configResolver: ctx.configResolver,
|
|
610
|
+
secrets: ctx.secrets,
|
|
611
|
+
db: exportDb,
|
|
612
|
+
userId: exportUserId,
|
|
613
|
+
handlerName: "user-data-rights:run-export-jobs",
|
|
614
|
+
})
|
|
615
|
+
: undefined;
|
|
616
|
+
const sendExportReadyEmail =
|
|
617
|
+
opts.sendExportReadyEmail ??
|
|
618
|
+
(exportMailResolver && opts.appExportDownloadUrl !== undefined
|
|
619
|
+
? makeDefaultExportReadyEmail(exportMailResolver, opts.mailDefaults)
|
|
620
|
+
: undefined);
|
|
621
|
+
const sendExportFailedEmail =
|
|
622
|
+
opts.sendExportFailedEmail ??
|
|
623
|
+
(exportMailResolver
|
|
624
|
+
? makeDefaultExportFailedEmail(exportMailResolver, opts.mailDefaults)
|
|
625
|
+
: undefined);
|
|
626
|
+
if (
|
|
627
|
+
exportMailResolver &&
|
|
628
|
+
!opts.sendExportReadyEmail &&
|
|
629
|
+
opts.appExportDownloadUrl === undefined &&
|
|
630
|
+
!warnedMissingExportUrl
|
|
631
|
+
) {
|
|
632
|
+
warnedMissingExportUrl = true;
|
|
633
|
+
// biome-ignore lint/suspicious/noConsole: one-shot operator visibility for misconfig
|
|
634
|
+
console.warn(
|
|
635
|
+
"[user-data-rights:run-export-jobs] mail transport mounted but appExportDownloadUrl unset — default export-ready emails disabled (export-failed + deletion mails still send)",
|
|
636
|
+
);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
await runExportJobs({
|
|
640
|
+
db: exportDb,
|
|
641
|
+
registry: exportRegistry,
|
|
642
|
+
// Per-tenant provider from the mounted file-foundation. The cron
|
|
643
|
+
// context carries configResolver (not the per-request ConfigAccessor),
|
|
644
|
+
// so the resolver builds a per-tenant accessor from it — otherwise
|
|
645
|
+
// createFileProviderForTenant throws and every export lands on failed.
|
|
646
|
+
buildStorageProvider: makeTenantStorageProviderResolver({
|
|
647
|
+
registry: exportRegistry,
|
|
648
|
+
configResolver: ctx.configResolver,
|
|
649
|
+
secrets: ctx.secrets,
|
|
650
|
+
db: exportDb,
|
|
651
|
+
userId: exportUserId,
|
|
652
|
+
handlerName: "user-data-rights:run-export-jobs",
|
|
653
|
+
}),
|
|
654
|
+
now: T.Now.instant(),
|
|
655
|
+
// App-Author-Callbacks haben Vorrang; sonst greift die mail-foundation-
|
|
656
|
+
// Default oben. Beide optional: ohne mail-transport + ohne Callback
|
|
657
|
+
// bleibt es bei Polling via export-status.query.
|
|
658
|
+
...(sendExportReadyEmail && { sendExportReadyEmail }),
|
|
659
|
+
...(sendExportFailedEmail && { sendExportFailedEmail }),
|
|
660
|
+
...(opts.appExportDownloadUrl !== undefined && {
|
|
661
|
+
appExportDownloadUrl: opts.appExportDownloadUrl,
|
|
662
|
+
}),
|
|
663
|
+
escapeHatchAuditSink: ctx._escapeHatchAuditSink,
|
|
664
|
+
actor: ctx.systemUser.id,
|
|
665
|
+
metrics: exportMetrics,
|
|
666
|
+
});
|
|
667
|
+
},
|
|
668
|
+
});
|
|
669
|
+
|
|
670
|
+
// Autonomer Art.17-Forget-Cron. Spiegelt run-export-jobs: nach Ablauf der
|
|
671
|
+
// Grace-Period laeuft runForgetCleanup unbeaufsichtigt (der manuelle
|
|
672
|
+
// userDataRights.runForget-API bleibt fuer Operator-Runs). Ohne diesen
|
|
673
|
+
// Cron bleibt jeder Loesch-Antrag fuer immer in DeletionRequested haengen
|
|
674
|
+
// — Art.17 wuerde nie ausgefuehrt.
|
|
675
|
+
const RUN_FORGET_CLEANUP_REASON = "executes overdue Art.17 forget requests across every tenant";
|
|
676
|
+
r.job({
|
|
677
|
+
name: "run-forget-cleanup",
|
|
678
|
+
trigger: { cron: "0 3 * * *" },
|
|
679
|
+
concurrency: "skip",
|
|
680
|
+
escapeHatch: { reason: RUN_FORGET_CLEANUP_REASON },
|
|
681
|
+
handler: async (_payload, ctx) => {
|
|
682
|
+
if (!ctx.registry) {
|
|
683
|
+
throw new Error("run-forget-cleanup: ctx.registry required (JobContext incomplete)");
|
|
684
|
+
}
|
|
685
|
+
const T = (await import("@cosmicdrift/kumiko-framework/time")).getTemporal();
|
|
686
|
+
const forgetUserId = ctx._userId ?? SYSTEM_USER_ID;
|
|
687
|
+
const forgetDb = ctx.db.unsafeRaw(
|
|
688
|
+
RUN_FORGET_CLEANUP_REASON,
|
|
689
|
+
) as import("@cosmicdrift/kumiko-framework/db").DbConnection; // @cast-boundary db-operator — jobs never run inside a DbTx
|
|
690
|
+
const forgetRegistry = ctx.registry;
|
|
691
|
+
const tenantModel = await resolveAppTenantModel({
|
|
692
|
+
registry: forgetRegistry,
|
|
693
|
+
configResolver: ctx.configResolver,
|
|
694
|
+
db: forgetDb,
|
|
695
|
+
userId: forgetUserId,
|
|
696
|
+
});
|
|
697
|
+
|
|
698
|
+
// C6 — Default-Mail beim delete-flip wenn kein Callback gesetzt + ein
|
|
699
|
+
// mail-transport gemountet ist (gleiche per-Tenant-Bruecke wie Export).
|
|
700
|
+
const forgetMailResolver = isMailTransportAvailable(forgetRegistry)
|
|
701
|
+
? makeTenantMailTransportResolver({
|
|
702
|
+
registry: forgetRegistry,
|
|
703
|
+
configResolver: ctx.configResolver,
|
|
704
|
+
secrets: ctx.secrets,
|
|
705
|
+
db: forgetDb,
|
|
706
|
+
userId: forgetUserId,
|
|
707
|
+
handlerName: "user-data-rights:run-forget-cleanup",
|
|
708
|
+
})
|
|
709
|
+
: undefined;
|
|
710
|
+
const sendDeletionExecutedEmail =
|
|
711
|
+
opts.sendDeletionExecutedEmail ??
|
|
712
|
+
(forgetMailResolver
|
|
713
|
+
? makeDefaultDeletionExecutedEmail(forgetMailResolver, opts.mailDefaults)
|
|
714
|
+
: undefined);
|
|
715
|
+
|
|
716
|
+
const forgetResult = await runForgetCleanup({
|
|
717
|
+
db: forgetDb,
|
|
718
|
+
registry: forgetRegistry,
|
|
719
|
+
now: T.Now.instant(),
|
|
720
|
+
tenantModel,
|
|
721
|
+
...(ctx.searchAdapter !== undefined && { searchAdapter: ctx.searchAdapter }),
|
|
722
|
+
// Same per-tenant provider resolution as the export cron — forget
|
|
723
|
+
// deletes binaries from the store upload + export use.
|
|
724
|
+
buildStorageProvider: makeTenantStorageProviderResolver({
|
|
725
|
+
registry: forgetRegistry,
|
|
726
|
+
configResolver: ctx.configResolver,
|
|
727
|
+
secrets: ctx.secrets,
|
|
728
|
+
db: forgetDb,
|
|
729
|
+
userId: forgetUserId,
|
|
730
|
+
handlerName: "user-data-rights:run-forget-cleanup",
|
|
731
|
+
}),
|
|
732
|
+
...(sendDeletionExecutedEmail && { sendDeletionExecutedEmail }),
|
|
733
|
+
escapeHatchAuditSink: ctx._escapeHatchAuditSink,
|
|
734
|
+
actor: ctx.systemUser.id,
|
|
735
|
+
});
|
|
736
|
+
|
|
737
|
+
// Persist each incomplete report on the job-run log (#1572). The write
|
|
738
|
+
// handler returns incomplete[] in its response; the cron path used to
|
|
739
|
+
// discard the array (only a console.warn for rolledBack cases).
|
|
740
|
+
// ctx.log feeds createJobRunLogger → store_job_run_logs.
|
|
741
|
+
for (const entry of forgetResult.incomplete) {
|
|
742
|
+
ctx.log?.warn?.(
|
|
743
|
+
`[user-data-rights:run-forget-cleanup] incomplete hook ` +
|
|
744
|
+
`userId=${entry.userId} tenantId=${entry.tenantId} ` +
|
|
745
|
+
`entityName=${entry.entityName} rolledBack=${entry.rolledBack} ` +
|
|
746
|
+
`reason=${sanitizeReasonForLog(entry.reason)}`,
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
});
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
// `clientIp` comes from the server's trustedProxyHops-aware resolver instead
|
|
755
|
+
// of reading X-Forwarded-For here, where a forged first entry would spoof the
|
|
756
|
+
// audit IP. A caller hitting /api/query directly (bypassing this httpRoute
|
|
757
|
+
// wrapper) with its own auditMeta can still lie — accepted, see
|
|
758
|
+
// download-by-token.query.ts.
|
|
759
|
+
export function extractAuditMeta(
|
|
760
|
+
headers: Headers,
|
|
761
|
+
clientIp: string,
|
|
762
|
+
): { ip: string | null; userAgent: string | null } {
|
|
763
|
+
return {
|
|
764
|
+
ip: clientIp === UNKNOWN_CLIENT_IP ? null : clientIp,
|
|
765
|
+
userAgent: headers.get("user-agent"),
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
// Interstitial page for the magic-link fragment exchange (see the
|
|
770
|
+
// httpRoute above). Plain static markup — no build step, no i18n lookup
|
|
771
|
+
// (the server doesn't know a user locale here; anonymous path).
|
|
772
|
+
const TOKEN_EXCHANGE_PAGE_HTML = `<!doctype html>
|
|
773
|
+
<html lang="en">
|
|
774
|
+
<head><meta charset="utf-8"><title>Export Download</title></head>
|
|
775
|
+
<body>
|
|
776
|
+
<p id="status">Preparing your download…</p>
|
|
777
|
+
<script src="/user-export/by-token.js"></script>
|
|
778
|
+
</body>
|
|
779
|
+
</html>`;
|
|
780
|
+
|
|
781
|
+
// Reads the token client-side from the URL fragment (never sent to the
|
|
782
|
+
// server) and exchanges it via POST for the signed URL. Same-origin
|
|
783
|
+
// external file instead of inline <script>, so the page also works under
|
|
784
|
+
// a strict `script-src 'self'` CSP.
|
|
785
|
+
const TOKEN_EXCHANGE_PAGE_JS = `(async () => {
|
|
786
|
+
const status = document.getElementById("status");
|
|
787
|
+
const params = new URLSearchParams(location.hash.slice(1));
|
|
788
|
+
const token = params.get("token");
|
|
789
|
+
if (!token) {
|
|
790
|
+
status.textContent = "Invalid download link.";
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
try {
|
|
794
|
+
const res = await fetch("/user-export/by-token", {
|
|
795
|
+
method: "POST",
|
|
796
|
+
headers: { "content-type": "application/json" },
|
|
797
|
+
body: JSON.stringify({ token }),
|
|
798
|
+
});
|
|
799
|
+
const body = await res.json();
|
|
800
|
+
if (!res.ok || !body || !body.data || !body.data.url) {
|
|
801
|
+
status.textContent = "This download link is invalid or has expired.";
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
location.href = body.data.url;
|
|
805
|
+
} catch {
|
|
806
|
+
status.textContent = "Could not start the download.";
|
|
807
|
+
}
|
|
808
|
+
})();`;
|