@cosmicdrift/kumiko-samples 0.378.0 → 0.380.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/bundled-features/package.json +18 -17
- package/packages/bundled-features/src/account-security/feature.ts +2 -2
- package/packages/bundled-features/src/account-security/index.ts +8 -8
- package/packages/bundled-features/src/account-security/{constants.ts → web/constants.ts} +0 -2
- package/packages/bundled-features/src/account-security/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/admin-shell/feature.ts +10 -9
- package/packages/bundled-features/src/admin-shell/index.ts +8 -8
- package/packages/bundled-features/src/admin-shell/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/admin-shell/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/admin-shell/web/default-translations.ts +10 -0
- package/packages/bundled-features/src/admin-shell/web/i18n.ts +51 -9
- package/packages/bundled-features/src/admin-shell/web/index.ts +0 -1
- package/packages/bundled-features/src/audit/changes.json +7 -0
- package/packages/bundled-features/src/audit/feature.ts +72 -64
- package/packages/bundled-features/src/audit/handlers/audit-events.ts +153 -0
- package/packages/bundled-features/src/audit/handlers/audit-system-db.ts +13 -0
- package/packages/bundled-features/src/audit/handlers/details-all-tenants.query.ts +26 -0
- package/packages/bundled-features/src/audit/handlers/details.query.ts +11 -39
- package/packages/bundled-features/src/audit/handlers/list-all-tenants.query.ts +47 -0
- package/packages/bundled-features/src/audit/handlers/list.query.ts +16 -123
- package/packages/bundled-features/src/audit/handlers/resolve-audit-tenant.ts +21 -7
- package/packages/bundled-features/src/audit/index.ts +1 -1
- package/packages/bundled-features/src/audit/run-escape-hatch-retention.ts +4 -4
- package/packages/bundled-features/src/audit/screens.ts +82 -0
- package/packages/bundled-features/src/audit/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/audit/{constants.ts → web/constants.ts} +11 -1
- package/packages/bundled-features/src/audit/web/default-translations.ts +7 -0
- package/packages/bundled-features/src/audit/web/i18n.ts +33 -7
- package/packages/bundled-features/src/audit/web/index.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/bootstrap.ts +6 -6
- package/packages/bundled-features/src/auth-email-password/changes.json +6 -0
- package/packages/bundled-features/src/auth-email-password/errors.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/feature.ts +2 -2
- package/packages/bundled-features/src/auth-email-password/handlers/confirm-account-unlock.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/handlers/invite-create.write.ts +3 -3
- package/packages/bundled-features/src/auth-email-password/handlers/invite-info.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/login.write.ts +38 -4
- package/packages/bundled-features/src/auth-email-password/handlers/request-account-unlock.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-email-verification.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-password-reset.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/reset-password.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/verify-email.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/index.ts +6 -1
- package/packages/bundled-features/src/auth-email-password/mail-notifications.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/signup-activation.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-client.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-form-logic.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-form-primitives.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-gate.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-redirect.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/client-actions.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/auth-email-password/web/confirm-account-unlock-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{constants.ts → web/constants.ts} +3 -6
- package/packages/bundled-features/src/auth-email-password/web/default-topbar-actions.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/forgot-password-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{i18n.ts → web/i18n.ts} +3 -4
- package/packages/bundled-features/src/auth-email-password/web/index.ts +1 -2
- package/packages/bundled-features/src/auth-email-password/web/invite-accept-screen.tsx +2 -3
- package/packages/bundled-features/src/auth-email-password/web/login-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{mail-i18n.ts → web/mail-i18n.ts} +0 -1
- package/packages/bundled-features/src/auth-email-password/web/request-account-unlock-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/reset-password-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/session-bootstrap-error.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/session.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/signup-complete-screen.tsx +2 -3
- package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-menu-items.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-switcher.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/use-shell-user.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/user-menu.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/verify-email-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-mfa/changes.json +6 -0
- package/packages/bundled-features/src/auth-mfa/errors.ts +2 -2
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/verify.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/index.ts +8 -8
- package/packages/bundled-features/src/auth-mfa/mfa-status-checker.ts +4 -4
- package/packages/bundled-features/src/auth-mfa/screens.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/web/client-plugin.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/auth-mfa/web/i18n.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/index.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-client.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-disable-dialog.tsx +1 -2
- package/packages/bundled-features/src/auth-mfa/web/mfa-recovery-codes-reveal.tsx +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-regenerate-recovery-dialog.tsx +1 -2
- package/packages/bundled-features/src/auth-mfa/web/mfa-setup-preauth-screen.tsx +21 -23
- package/packages/bundled-features/src/auth-mfa/web/mfa-verify-screen.tsx +0 -1
- package/packages/bundled-features/src/billing-foundation/changes.json +18 -0
- package/packages/bundled-features/src/billing-foundation/checkout-core.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-text.ts +2 -2
- package/packages/bundled-features/src/billing-foundation/consumer-protection/issue-confirmation.ts +11 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/mail-notifications.ts +11 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-consent.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-termination.ts +12 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/stored-user-email.ts +12 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-mail.ts +6 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-notify.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-pages.ts +167 -28
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-record.ts +102 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-request.ts +43 -12
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-revoke.ts +202 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-texts.ts +70 -0
- package/packages/bundled-features/src/billing-foundation/events.ts +20 -2
- package/packages/bundled-features/src/billing-foundation/feature.ts +5 -5
- package/packages/bundled-features/src/billing-foundation/handlers/process-event.write.ts +82 -9
- package/packages/bundled-features/src/billing-foundation/handlers/switch-plan.write.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/handlers/sync-subscription.write.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/index.ts +27 -27
- package/packages/bundled-features/src/billing-foundation/plan-catalog.ts +7 -7
- package/packages/bundled-features/src/billing-foundation/screens.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/subscription-tier-sync.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/types.ts +17 -3
- package/packages/bundled-features/src/billing-foundation/validate-options.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/web/billing-contact-plan.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/billing-plans-panel.tsx +5 -7
- package/packages/bundled-features/src/billing-foundation/web/cancel-contract-dialog.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/checkout-consent-dialog.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/billing-foundation/{constants.ts → web/constants.ts} +37 -31
- package/packages/bundled-features/src/billing-foundation/{consumer-protection → web/consumer-protection}/consent-locale.ts +0 -1
- package/packages/bundled-features/src/billing-foundation/{contact-card.ts → web/contact-card.ts} +0 -2
- package/packages/bundled-features/src/billing-foundation/web/index.ts +14 -15
- package/packages/bundled-features/src/billing-foundation/web/localized-params.ts +0 -2
- package/packages/bundled-features/src/billing-foundation/webhook-handler.ts +5 -2
- package/packages/bundled-features/src/cap-overview/feature.ts +1 -1
- package/packages/bundled-features/src/cap-overview/handlers/caps-usage.query.ts +1 -1
- package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +2 -2
- package/packages/bundled-features/src/cap-overview/index.ts +9 -9
- package/packages/bundled-features/src/cap-overview/screens.ts +2 -2
- package/packages/bundled-features/src/cap-overview/web/cap-cards-panel.tsx +1 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-bar.tsx +1 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-cell.tsx +0 -2
- package/packages/bundled-features/src/cap-overview/web/client-plugin.tsx +3 -4
- package/packages/bundled-features/src/cap-overview/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/cap-overview/web/index.ts +0 -1
- package/packages/bundled-features/src/cap-overview/{usage-math.ts → web/usage-math.ts} +1 -2
- package/packages/bundled-features/src/compliance-profiles/feature.ts +5 -5
- package/packages/bundled-features/src/compliance-profiles/index.ts +6 -6
- package/packages/bundled-features/src/compliance-profiles/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/compliance-profiles/web/compliance-profile-catalog.tsx +1 -2
- package/packages/bundled-features/src/compliance-profiles/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/compliance-profiles/web/i18n.ts +0 -1
- package/packages/bundled-features/src/compliance-profiles/web/index.ts +0 -1
- package/packages/bundled-features/src/config/index.ts +6 -6
- package/packages/bundled-features/src/config/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/config/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/config/web/i18n.ts +0 -1
- package/packages/bundled-features/src/config/web/index.ts +1 -3
- package/packages/bundled-features/src/config/write-helpers.ts +1 -1
- package/packages/bundled-features/src/custom-fields/feature.ts +8 -8
- package/packages/bundled-features/src/custom-fields/handlers/clear-custom-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/define-tenant-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/delete-system-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/delete-tenant-field.write.ts +4 -4
- package/packages/bundled-features/src/custom-fields/handlers/set-custom-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/update-tenant-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/index.ts +8 -8
- package/packages/bundled-features/src/custom-fields/lib/value-schema.ts +1 -1
- package/packages/bundled-features/src/custom-fields/schemas.ts +1 -1
- package/packages/bundled-features/src/custom-fields/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/custom-fields/{constants.ts → web/constants.ts} +18 -19
- package/packages/bundled-features/src/custom-fields/web/custom-fields-form-section.tsx +1 -2
- package/packages/bundled-features/src/custom-fields/web/i18n.ts +0 -1
- package/packages/bundled-features/src/custom-fields/web/index.ts +2 -3
- package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +1 -2
- package/packages/bundled-features/src/delivery/address-opt-out.ts +1 -1
- package/packages/bundled-features/src/delivery/attempt-log-retention.ts +24 -8
- package/packages/bundled-features/src/delivery/changes.json +6 -0
- package/packages/bundled-features/src/delivery/constants.ts +2 -2
- package/packages/bundled-features/src/delivery/i18n.ts +1 -1
- package/packages/bundled-features/src/delivery/unsubscribe-page.ts +1 -1
- package/packages/bundled-features/src/delivery/web/client-plugin.tsx +6 -7
- package/packages/bundled-features/src/delivery/web/delivery-channel-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-error-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-status-cell.tsx +1 -2
- package/packages/bundled-features/src/delivery/web/delivery-time-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-type-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/index.ts +0 -1
- package/packages/bundled-features/src/delivery/{public-names.ts → web/public-names.ts} +0 -1
- package/packages/bundled-features/src/document-ingest-foundation/changes.json +6 -0
- package/packages/bundled-features/src/document-ingest-foundation/events.ts +4 -0
- package/packages/bundled-features/src/document-ingest-foundation/executor.ts +2 -1
- package/packages/bundled-features/src/document-ingest-foundation/feature.ts +18 -4
- package/packages/bundled-features/src/document-ingest-foundation/index.ts +1 -0
- package/packages/bundled-features/src/feature-toggles/feature.ts +7 -7
- package/packages/bundled-features/src/feature-toggles/global-feature-state-table.ts +14 -13
- package/packages/bundled-features/src/feature-toggles/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/registered.query.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/set.write.ts +3 -3
- package/packages/bundled-features/src/feature-toggles/index.ts +6 -6
- package/packages/bundled-features/src/feature-toggles/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/feature-toggles/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/feature-toggles/web/i18n.ts +0 -1
- package/packages/bundled-features/src/feature-toggles/web/index.ts +0 -1
- package/packages/bundled-features/src/files/changes.json +7 -0
- package/packages/bundled-features/src/folders/feature.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/clear-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/delete-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/set-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/index.ts +8 -8
- package/packages/bundled-features/src/folders/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/folders/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +1 -2
- package/packages/bundled-features/src/folders/web/folder-section.tsx +1 -2
- package/packages/bundled-features/src/folders/web/i18n.ts +0 -1
- package/packages/bundled-features/src/folders/web/index.ts +1 -2
- package/packages/bundled-features/src/folders/web/tree.ts +0 -1
- package/packages/bundled-features/src/form-draft/changes.json +7 -0
- package/packages/bundled-features/src/form-draft/db/queries/cleanup.ts +25 -11
- package/packages/bundled-features/src/form-draft/decrypt-draft.ts +24 -0
- package/packages/bundled-features/src/form-draft/entity.ts +6 -9
- package/packages/bundled-features/src/form-draft/feature.ts +1 -1
- package/packages/bundled-features/src/form-draft/handlers/cleanup.job.ts +26 -5
- package/packages/bundled-features/src/form-draft/handlers/discard.write.ts +1 -1
- package/packages/bundled-features/src/form-draft/handlers/get.query.ts +6 -7
- package/packages/bundled-features/src/form-draft/handlers/list.query.ts +13 -7
- package/packages/bundled-features/src/form-draft/handlers/save.write.ts +5 -5
- package/packages/bundled-features/src/form-draft/index.ts +8 -8
- package/packages/bundled-features/src/form-draft/lookup.ts +10 -4
- package/packages/bundled-features/src/form-draft/schemas.ts +1 -1
- package/packages/bundled-features/src/form-draft/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/form-draft-user-data/hooks.ts +2 -2
- package/packages/bundled-features/src/inbound-mail-foundation/retention-sweep.ts +10 -10
- package/packages/bundled-features/src/jobs/feature.ts +7 -7
- package/packages/bundled-features/src/jobs/handlers/retry.write.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/trigger.write.ts +1 -1
- package/packages/bundled-features/src/jobs/index.ts +1 -1
- package/packages/bundled-features/src/jobs/job-run-table.ts +4 -3
- package/packages/bundled-features/src/jobs/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/jobs/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/jobs/web/default-translations.ts +7 -0
- package/packages/bundled-features/src/jobs/web/i18n.ts +53 -7
- package/packages/bundled-features/src/jobs/web/index.ts +0 -1
- package/packages/bundled-features/src/ledger/changes.json +7 -0
- package/packages/bundled-features/src/ledger/entity.ts +1 -1
- package/packages/bundled-features/src/ledger/feature.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/confirm-schedule-period.write.ts +2 -10
- package/packages/bundled-features/src/ledger/handlers/create-transaction.write.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/reports.query.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/reverse-transaction.write.ts +1 -1
- package/packages/bundled-features/src/ledger/index.ts +13 -13
- package/packages/bundled-features/src/ledger/recurring.ts +1 -1
- package/packages/bundled-features/src/ledger/reports.ts +1 -1
- package/packages/bundled-features/src/ledger/schemas.ts +1 -1
- package/packages/bundled-features/src/ledger/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/ledger/web/index.ts +11 -12
- package/packages/bundled-features/src/legal-pages/README.md +1 -1
- package/packages/bundled-features/src/legal-pages/feature.ts +5 -5
- package/packages/bundled-features/src/legal-pages/index.ts +11 -11
- package/packages/bundled-features/src/legal-pages/lib/boot-check.ts +1 -1
- package/packages/bundled-features/src/legal-pages/lib/validate-routes.ts +1 -1
- package/packages/bundled-features/src/legal-pages/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/legal-pages/{constants.ts → web/constants.ts} +6 -8
- package/packages/bundled-features/src/legal-pages/web/index.ts +0 -1
- package/packages/bundled-features/src/managed-pages/feature.ts +1 -1
- package/packages/bundled-features/src/managed-pages/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/managed-pages/web/default-translations.ts +17 -0
- package/packages/bundled-features/src/managed-pages/web/i18n.ts +59 -16
- package/packages/bundled-features/src/managed-pages/web/index.ts +1 -2
- package/packages/bundled-features/src/metrics/compute.ts +1 -1
- package/packages/bundled-features/src/metrics/feature.ts +6 -6
- package/packages/bundled-features/src/metrics/index.ts +8 -8
- package/packages/bundled-features/src/metrics/types.ts +1 -1
- package/packages/bundled-features/src/metrics/validate.ts +1 -1
- package/packages/bundled-features/src/metrics/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/metrics/window.ts +1 -1
- package/packages/bundled-features/src/notes-history/feature.ts +1 -1
- package/packages/bundled-features/src/notes-history/handlers/add-note.write.ts +1 -1
- package/packages/bundled-features/src/notes-history/index.ts +8 -8
- package/packages/bundled-features/src/notes-history/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/notes-history/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/notes-history/web/i18n.ts +0 -1
- package/packages/bundled-features/src/notes-history/web/index.ts +2 -3
- package/packages/bundled-features/src/notes-history/web/notes-section.tsx +2 -3
- package/packages/bundled-features/src/personal-access-tokens/feature.ts +12 -10
- package/packages/bundled-features/src/personal-access-tokens/handlers/available-scopes.query.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/revoke.write.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/hash.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/i18n.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/index.ts +5 -5
- package/packages/bundled-features/src/personal-access-tokens/resolver.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/schema/api-token.ts +3 -3
- package/packages/bundled-features/src/personal-access-tokens/screens.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/personal-access-tokens/{scopes.ts → web/scopes.ts} +0 -1
- package/packages/bundled-features/src/presets/changes.json +7 -0
- package/packages/bundled-features/src/presets/index.ts +0 -1
- package/packages/bundled-features/src/presets/security-baseline.ts +1 -1
- package/packages/bundled-features/src/renderer-foundation/types.ts +1 -1
- package/packages/bundled-features/src/secrets/feature.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/delete.write.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/set.write.ts +1 -1
- package/packages/bundled-features/src/secrets/i18n.ts +1 -1
- package/packages/bundled-features/src/secrets/index.ts +8 -8
- package/packages/bundled-features/src/secrets/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/secrets/write-gate.ts +1 -1
- package/packages/bundled-features/src/sessions/feature.ts +7 -4
- package/packages/bundled-features/src/sessions/schema/user-session.ts +2 -3
- package/packages/bundled-features/src/sessions/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/shared/index.ts +6 -1
- package/packages/bundled-features/src/shared/purge-files-reaching-subject.ts +10 -2
- package/packages/bundled-features/src/shared/web/translate-or-raw.ts +0 -1
- package/packages/bundled-features/src/subscription-stripe/feature.ts +2 -0
- package/packages/bundled-features/src/subscription-stripe/plugin-methods.ts +19 -0
- package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +1 -0
- package/packages/bundled-features/src/tags/changes.json +6 -0
- package/packages/bundled-features/src/tags/feature.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/assign-tag.write.ts +11 -7
- package/packages/bundled-features/src/tags/handlers/create-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/delete-tag.write.ts +4 -1
- package/packages/bundled-features/src/tags/handlers/remove-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/update-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/index.ts +12 -12
- package/packages/bundled-features/src/tags/screens.ts +1 -1
- package/packages/bundled-features/src/tags/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/tags/{constants.ts → web/constants.ts} +4 -1
- package/packages/bundled-features/src/tags/web/entity-tags.tsx +1 -2
- package/packages/bundled-features/src/tags/web/i18n.ts +2 -2
- package/packages/bundled-features/src/tags/web/index.ts +2 -3
- package/packages/bundled-features/src/tags/web/tag-chip.tsx +0 -1
- package/packages/bundled-features/src/tags/web/tag-filter.tsx +1 -2
- package/packages/bundled-features/src/tags/web/tag-manager.tsx +5 -4
- package/packages/bundled-features/src/tags/web/tag-picker.tsx +0 -1
- package/packages/bundled-features/src/tags/web/tag-section.tsx +1 -2
- package/packages/bundled-features/src/tags/web/tags-cell.tsx +1 -2
- package/packages/bundled-features/src/template-resolver/README.md +1 -1
- package/packages/bundled-features/src/template-resolver/api.ts +75 -28
- package/packages/bundled-features/src/template-resolver/changes.json +43 -0
- package/packages/bundled-features/src/template-resolver/compile-document-body.ts +1 -1
- package/packages/bundled-features/src/template-resolver/compile-steps-block.ts +2 -2
- package/packages/bundled-features/src/template-resolver/document-ops.ts +5 -5
- package/packages/bundled-features/src/template-resolver/document-sanitizer.ts +4 -4
- package/packages/bundled-features/src/template-resolver/feature.ts +13 -4
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +6 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +6 -2
- package/packages/bundled-features/src/template-resolver/handlers/collection-item.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-list.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-set.write.ts +19 -2
- package/packages/bundled-features/src/template-resolver/handlers/copy-locale.write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/diff-to-system.query.ts +7 -1
- package/packages/bundled-features/src/template-resolver/handlers/discard-draft.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/document-base.ts +8 -2
- package/packages/bundled-features/src/template-resolver/handlers/document-blocks.query.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/export-bundle.query.ts +5 -2
- package/packages/bundled-features/src/template-resolver/handlers/find-by-id.query.ts +4 -2
- package/packages/bundled-features/src/template-resolver/handlers/layout-source.query.ts +10 -5
- package/packages/bundled-features/src/template-resolver/handlers/list.query.ts +5 -2
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +68 -10
- package/packages/bundled-features/src/template-resolver/handlers/patch-draft.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/resource-shared.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/resource-upload.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/send-test.write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/set.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/shared.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/template-gates.ts +6 -6
- package/packages/bundled-features/src/template-resolver/handlers/template-write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/usage.query.ts +8 -2
- package/packages/bundled-features/src/template-resolver/handlers/validate.query.ts +4 -2
- package/packages/bundled-features/src/template-resolver/i18n.ts +25 -0
- package/packages/bundled-features/src/template-resolver/index.ts +60 -59
- package/packages/bundled-features/src/template-resolver/layout-appearance.ts +1 -1
- package/packages/bundled-features/src/template-resolver/layout-regions.ts +1 -1
- package/packages/bundled-features/src/template-resolver/seeding.ts +16 -7
- package/packages/bundled-features/src/template-resolver/store-template-resource.ts +2 -2
- package/packages/bundled-features/src/template-resolver/table.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-bundle.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-delivery-policy.ts +82 -0
- package/packages/bundled-features/src/template-resolver/template-draft.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-edit-policy.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-meta.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-preview.ts +14 -10
- package/packages/bundled-features/src/template-resolver/template-usage.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-validation.ts +2 -2
- package/packages/bundled-features/src/template-resolver/testing.ts +2 -2
- package/packages/bundled-features/src/template-resolver/user-content-table.ts +1 -1
- package/packages/bundled-features/src/template-resolver/web/client-plugin.tsx +4 -5
- package/packages/bundled-features/src/template-resolver/{constants.ts → web/constants.ts} +7 -10
- package/packages/bundled-features/src/template-resolver/{document-blocks.ts → web/document-blocks.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/document-editor-extensions.ts +2 -3
- package/packages/bundled-features/src/template-resolver/web/document-editor.tsx +0 -1
- package/packages/bundled-features/src/template-resolver/{document-images.ts → web/document-images.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{document-schema.ts → web/document-schema.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{document-steps.ts → web/document-steps.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-editor.tsx +6 -7
- package/packages/bundled-features/src/template-resolver/web/document-toolbar-blocks.ts +2 -3
- package/packages/bundled-features/src/template-resolver/web/editor-handle.ts +1 -2
- package/packages/bundled-features/src/template-resolver/web/i18n.ts +2 -1
- package/packages/bundled-features/src/template-resolver/web/index.ts +13 -14
- package/packages/bundled-features/src/template-resolver/{mail-constants.ts → web/mail-constants.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{pdf-constants.ts → web/pdf-constants.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/placeholder-line-editor-lazy.tsx +0 -1
- package/packages/bundled-features/src/template-resolver/web/placeholder-line-editor.tsx +5 -4
- package/packages/bundled-features/src/template-resolver/{placeholder-text.ts → web/placeholder-text.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{qualified-names.ts → web/qualified-names.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/use-stable-by-key.ts +0 -1
- package/packages/bundled-features/src/tenant/handlers/add-member.write.ts +1 -1
- package/packages/bundled-features/src/tenant/index.ts +7 -7
- package/packages/bundled-features/src/tenant/invitation-table.ts +1 -1
- package/packages/bundled-features/src/tenant/invited-membership.ts +1 -1
- package/packages/bundled-features/src/tenant/last-tenant-admin.ts +1 -1
- package/packages/bundled-features/src/tenant/member-role-options.ts +1 -1
- package/packages/bundled-features/src/tenant/screens.ts +2 -2
- package/packages/bundled-features/src/tenant/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/tenant/{constants.ts → web/constants.ts} +3 -6
- package/packages/bundled-features/src/tenant/web/index.ts +0 -1
- package/packages/bundled-features/src/tenant/web/member-roles-cell.tsx +0 -1
- package/packages/bundled-features/src/tenant/web/member-status-cell.tsx +0 -1
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +2 -2
- package/packages/bundled-features/src/tier-engine/entity.ts +1 -1
- package/packages/bundled-features/src/tier-engine/feature.ts +7 -7
- package/packages/bundled-features/src/tier-engine/handlers/set-tenant-tier.write.ts +1 -1
- package/packages/bundled-features/src/tier-engine/index.ts +8 -8
- package/packages/bundled-features/src/tier-engine/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/tier-engine/{constants.ts → web/constants.ts} +2 -3
- package/packages/bundled-features/src/tier-engine/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/tier-engine/web/index.ts +0 -1
- package/packages/bundled-features/src/user/handlers/create.write.ts +1 -1
- package/packages/bundled-features/src/user/handlers/update-roles.ts +1 -1
- package/packages/bundled-features/src/user/handlers/update.write.ts +1 -1
- package/packages/bundled-features/src/user/index.ts +1 -1
- package/packages/bundled-features/src/user/invited-global-roles.ts +1 -1
- package/packages/bundled-features/src/user/schema/user.ts +1 -1
- package/packages/bundled-features/src/user/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/user-data-rights/changes.json +14 -0
- package/packages/bundled-features/src/user-data-rights/env.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/feature.ts +9 -9
- package/packages/bundled-features/src/user-data-rights/index.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/lib/resolve-tenant-model.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/mail-notifications.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/user-data-rights/web/confirm-deletion-screen.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights/{constants.ts → web/constants.ts} +11 -12
- package/packages/bundled-features/src/user-data-rights/web/default-translations.ts +91 -0
- package/packages/bundled-features/src/user-data-rights/web/i18n.ts +41 -91
- package/packages/bundled-features/src/user-data-rights/web/index.ts +1 -2
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +1 -2
- package/packages/bundled-features/src/user-data-rights/web/public-deletion-gate.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights/web/request-deletion-screen.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/file-ref.userdata-hook.ts +10 -1
- package/packages/bundled-features/src/user-profile/feature.ts +2 -2
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +1 -1
- package/packages/bundled-features/src/user-profile/index.ts +3 -2
- package/packages/bundled-features/src/user-profile/web/client-plugin.ts +2 -3
- package/packages/bundled-features/src/user-profile/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/user-profile/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/user-profile/web/profile-screen.tsx +2 -3
- package/packages/bundled-features/src/waitlist/changes.json +6 -0
- package/packages/bundled-features/src/waitlist/entity.ts +1 -1
- package/packages/bundled-features/src/waitlist/feature.ts +5 -5
- package/packages/bundled-features/src/waitlist/handlers/export-purge.write.ts +3 -3
- package/packages/bundled-features/src/waitlist/handlers/invite.write.ts +5 -1
- package/packages/bundled-features/src/waitlist/handlers/reject.write.ts +1 -1
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +3 -3
- package/packages/bundled-features/src/waitlist/import.ts +1 -1
- package/packages/bundled-features/src/waitlist/index.ts +11 -11
- package/packages/bundled-features/src/waitlist/legacy-migrate.ts +1 -1
- package/packages/bundled-features/src/waitlist/link-on-signup.ts +1 -1
- package/packages/bundled-features/src/waitlist/mail.ts +7 -6
- package/packages/bundled-features/src/waitlist/payloads.ts +1 -1
- package/packages/bundled-features/src/waitlist/screens.ts +1 -1
- package/packages/bundled-features/src/waitlist/{constants.ts → web/constants.ts} +0 -1
- package/samples/apps/styleguide/src/features/content/web.tsx +0 -1
- package/samples/apps/ui-walkthrough/src/app/client.tsx +2 -0
- package/samples/apps/ui-walkthrough/src/app/seed-rental.ts +17 -1
- package/samples/apps/ui-walkthrough/src/app/seed-templates.ts +11 -0
- package/samples/apps/ui-walkthrough/src/app/server.ts +2 -1
- package/samples/apps/ui-walkthrough/src/features/billing/feature.ts +35 -7
- package/samples/apps/ui-walkthrough/src/features/billing/i18n.ts +6 -0
- package/samples/apps/ui-walkthrough/src/features/rental/entities.ts +27 -0
- package/samples/apps/ui-walkthrough/src/features/rental/feature.ts +61 -7
- package/samples/apps/ui-walkthrough/src/features/rental/i18n.ts +48 -24
- package/samples/apps/ui-walkthrough/src/features/rental/invoice-receive.ts +0 -1
- package/samples/apps/ui-walkthrough/src/features/rental/lease-support.ts +17 -1
- package/samples/apps/ui-walkthrough/src/features/rental/qualified-names.ts +3 -0
- package/samples/apps/ui-walkthrough/src/features/rental/receipts-upload.ts +70 -0
- package/samples/apps/ui-walkthrough/src/features/rental/screens.ts +90 -13
- package/samples/apps/ui-walkthrough/src/features/rental/web/index.ts +0 -2
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/feature.ts +103 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/i18n.ts +36 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/index.ts +2 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/seed.ts +21 -0
- package/samples/apps/ui-walkthrough/src/run-config.ts +11 -0
- package/samples/apps/use-all-bundled/e2e-billing-gallery/server.ts +1 -1
- package/samples/apps/use-all-bundled/feature-manifest.json +4 -4
- package/samples/apps/use-all-bundled/scripts/check-coverage.ts +1 -1
- package/samples/apps/use-all-bundled/src/app/dev-app-options.ts +3 -1
- package/samples/recipes/compose-stacks/README.md +1 -2
- package/samples/recipes/embedded/README.md +5 -5
- package/samples/recipes/embedded/src/handlers/invoice-receive.write.ts +0 -1
- package/samples/recipes/embedded/src/screens/invoice-receive.screen.ts +9 -12
- package/samples/recipes/legal-pages/README.md +2 -2
- package/samples/recipes/legal-pages/src/feature.ts +1 -1
- package/samples/recipes/reference-data/src/feature.ts +3 -7
- package/packages/bundled-features/src/admin-shell/i18n.ts +0 -54
- package/packages/bundled-features/src/audit/i18n.ts +0 -25
- package/packages/bundled-features/src/auth-mfa/web/qrcode-browser.d.ts +0 -11
- package/packages/bundled-features/src/jobs/i18n.ts +0 -55
- package/packages/bundled-features/src/managed-pages/i18n.ts +0 -63
- package/packages/bundled-features/src/presets/dsgvo-self-service.ts +0 -35
- package/packages/bundled-features/src/user-data-rights/i18n.ts +0 -44
- package/samples/apps/ui-walkthrough/src/features/rental/web/upload-standard-layout.tsx +0 -61
|
@@ -36,7 +36,7 @@ runProdApp({
|
|
|
36
36
|
// only uses the API via ctx)
|
|
37
37
|
anonymousAccess: { defaultTenantId: SYSTEM_TENANT_ID },
|
|
38
38
|
extraContext: ({ db }) => ({
|
|
39
|
-
templateResolver: createTemplateResolverApi(db),
|
|
39
|
+
templateResolver: createTemplateResolverApi(db, registry),
|
|
40
40
|
}),
|
|
41
41
|
});
|
|
42
42
|
```
|
|
@@ -11,16 +11,16 @@ import {
|
|
|
11
11
|
redirectToCanonicalPath,
|
|
12
12
|
slashVariantOf,
|
|
13
13
|
} from "../page-render/index.ts";
|
|
14
|
+
import { runLegalPagesBootCheck } from "./lib/boot-check.ts";
|
|
15
|
+
import { validateRoutes } from "./lib/validate-routes.ts";
|
|
16
|
+
import { renderMarkdownToHtml, wrapInLayout } from "./markdown.ts";
|
|
14
17
|
import {
|
|
15
18
|
LEGAL_REQUIRED_BLOCKS,
|
|
16
19
|
LEGAL_ROUTES,
|
|
17
20
|
LEGAL_TERMS_ROUTES,
|
|
18
21
|
type LegalPageRoute,
|
|
19
22
|
type LegalRequiredBlock,
|
|
20
|
-
} from "./constants.ts";
|
|
21
|
-
import { runLegalPagesBootCheck } from "./lib/boot-check.ts";
|
|
22
|
-
import { validateRoutes } from "./lib/validate-routes.ts";
|
|
23
|
-
import { renderMarkdownToHtml, wrapInLayout } from "./markdown.ts";
|
|
23
|
+
} from "./web/constants.ts";
|
|
24
24
|
|
|
25
25
|
export { type LegalPagesBootCheckCtx, runLegalPagesBootCheck } from "./lib/boot-check.ts";
|
|
26
26
|
|
|
@@ -61,7 +61,7 @@ const PUBLIC_PAGE_CACHE = { kind: "revalidate", maxAgeSeconds: 60 } as const;
|
|
|
61
61
|
// nicht gegen Cross-Feature-Coupling
|
|
62
62
|
//
|
|
63
63
|
// Voraussetzungen für Production:
|
|
64
|
-
// • App-Bootstrap muss extraContext: { templateResolver: createTemplateResolverApi(db) }
|
|
64
|
+
// • App-Bootstrap muss extraContext: { templateResolver: createTemplateResolverApi(db, registry) }
|
|
65
65
|
// setzen — sonst wirft Boot-Check beim Start
|
|
66
66
|
// • anonymousAccess: { defaultTenantId: SYSTEM_TENANT_ID } — sonst
|
|
67
67
|
// antworten die Routes mit 503
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
LEGAL_OPTIONAL_BLOCKS,
|
|
3
|
-
LEGAL_PAGES_FEATURE,
|
|
4
|
-
LEGAL_REQUIRED_BLOCKS,
|
|
5
|
-
LEGAL_ROUTES,
|
|
6
|
-
LEGAL_TERMS_ROUTES,
|
|
7
|
-
type LegalPageRoute,
|
|
8
|
-
LegalPagesErrors,
|
|
9
|
-
type LegalRequiredBlock,
|
|
10
|
-
legalPagePath,
|
|
11
|
-
} from "./constants.ts";
|
|
12
1
|
export {
|
|
13
2
|
createLegalPagesFeature,
|
|
14
3
|
type LegalPagesBootCheckCtx,
|
|
@@ -23,3 +12,14 @@ export {
|
|
|
23
12
|
type LegalContentSeedSource,
|
|
24
13
|
legalContentSeed,
|
|
25
14
|
} from "./seed.ts";
|
|
15
|
+
export {
|
|
16
|
+
LEGAL_OPTIONAL_BLOCKS,
|
|
17
|
+
LEGAL_PAGES_FEATURE,
|
|
18
|
+
LEGAL_REQUIRED_BLOCKS,
|
|
19
|
+
LEGAL_ROUTES,
|
|
20
|
+
LEGAL_TERMS_ROUTES,
|
|
21
|
+
type LegalPageRoute,
|
|
22
|
+
LegalPagesErrors,
|
|
23
|
+
type LegalRequiredBlock,
|
|
24
|
+
legalPagePath,
|
|
25
|
+
} from "./web/constants.ts";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type TemplateResolverApi,
|
|
5
5
|
} from "@cosmicdrift/kumiko-bundled-features/template-resolver";
|
|
6
6
|
import { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
-
import { LEGAL_REQUIRED_BLOCKS, type LegalRequiredBlock } from "../constants.ts";
|
|
7
|
+
import { LEGAL_REQUIRED_BLOCKS, type LegalRequiredBlock } from "../web/constants.ts";
|
|
8
8
|
|
|
9
9
|
// Only the fields the check reads, so HandlerContext, AppContext or a hand-built
|
|
10
10
|
// object in a unit test all fit.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// Client-Feature-Factory für legal-pages Visual-Tree. Liefert statische
|
|
3
2
|
// Tree-Knoten für die DACH-Compliance-Blöcke (imprint, privacy in de/en).
|
|
4
3
|
// Jeder Knoten linkt auf text-content's edit-Action — reines Cross-Feature-
|
|
@@ -18,7 +17,7 @@
|
|
|
18
17
|
|
|
19
18
|
import type { TreeChildrenSubscribe, TreeNode } from "@cosmicdrift/kumiko-framework/engine";
|
|
20
19
|
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
21
|
-
import { LEGAL_OPTIONAL_BLOCKS, LEGAL_REQUIRED_BLOCKS } from "
|
|
20
|
+
import { LEGAL_OPTIONAL_BLOCKS, LEGAL_REQUIRED_BLOCKS } from "./constants.ts";
|
|
22
21
|
|
|
23
22
|
const treeProvider: TreeChildrenSubscribe = () => (emit) => {
|
|
24
23
|
// V.1.5d Slug-first Verschachtelung (Variante C):
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// Feature name
|
|
3
2
|
export const LEGAL_PAGES_FEATURE = "legal-pages" as const;
|
|
4
3
|
|
|
@@ -22,23 +21,22 @@ export type LegalRequiredBlock = {
|
|
|
22
21
|
};
|
|
23
22
|
|
|
24
23
|
// Required slugs that must exist as text-blocks for production-boot.
|
|
25
|
-
//
|
|
26
|
-
//
|
|
24
|
+
// One mandatory slug per language; anyone who wants more languages extends
|
|
25
|
+
// the list, the boot check is generated dynamically from it.
|
|
27
26
|
export const LEGAL_REQUIRED_BLOCKS = [
|
|
28
27
|
{ slug: "imprint", lang: "de" },
|
|
29
28
|
{ slug: "privacy", lang: "de" },
|
|
30
29
|
] as const;
|
|
31
30
|
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
// "nice-to-have".
|
|
31
|
+
// Optional blocks that are NOT boot-fail relevant, but whose routes are
|
|
32
|
+
// served when present. EN versions are often only nice-to-have in DACH apps.
|
|
35
33
|
export const LEGAL_OPTIONAL_BLOCKS = [
|
|
36
34
|
{ slug: "imprint", lang: "en" },
|
|
37
35
|
{ slug: "privacy", lang: "en" },
|
|
38
36
|
] as const;
|
|
39
37
|
|
|
40
|
-
// Public
|
|
41
|
-
//
|
|
38
|
+
// Public route mapping: URL path -> (slug, lang). DE uses the German
|
|
39
|
+
// standard names, EN the English ones.
|
|
42
40
|
export const LEGAL_ROUTES = [
|
|
43
41
|
{ path: "/legal/impressum", slug: "imprint", lang: "de", titleFallback: "Impressum" },
|
|
44
42
|
{
|
|
@@ -15,10 +15,10 @@ import { bySlugQuery } from "./handlers/by-slug.query.ts";
|
|
|
15
15
|
import { byTenantPublishedQuery } from "./handlers/by-tenant-published.query.ts";
|
|
16
16
|
import { pageCrudQueries, pageCrudWrites } from "./handlers/page-crud.ts";
|
|
17
17
|
import { setWrite } from "./handlers/set.write.ts";
|
|
18
|
-
import { MANAGED_PAGES_I18N } from "./i18n.ts";
|
|
19
18
|
import { createBrandingSettingsScreen } from "./screens/branding-screen.ts";
|
|
20
19
|
import { pageEditScreen, pageListScreen } from "./screens/page-screens.ts";
|
|
21
20
|
import { pageEntity } from "./table.ts";
|
|
21
|
+
import { MANAGED_PAGES_I18N } from "./web/i18n.ts";
|
|
22
22
|
|
|
23
23
|
// 60s-shared-cache saves the origin-revalidate roundtrip; CMS edits are live within 60s.
|
|
24
24
|
const PUBLIC_PAGE_CACHE = { kind: "revalidate", maxAgeSeconds: 60 } as const;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// Client-Feature-Factory für managed-pages. Bringt NUR die Übersetzungen mit —
|
|
3
2
|
// die Screens (page-list/page-edit/branding-settings) sind schema-driven
|
|
4
3
|
// (entityList/entityEdit/configEdit), also keine custom-React-Components zu
|
|
@@ -7,7 +6,7 @@
|
|
|
7
6
|
|
|
8
7
|
import { mergeTranslations, type TranslationsByLocale } from "@cosmicdrift/kumiko-renderer";
|
|
9
8
|
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
10
|
-
import { defaultTranslations } from "./
|
|
9
|
+
import { defaultTranslations } from "./default-translations.ts";
|
|
11
10
|
|
|
12
11
|
export type ManagedPagesClientOptions = {
|
|
13
12
|
/** Key-wise Overrides über die Default-Bundles (de/en). */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Client i18n bundle for the managed-pages admin screens. The browser renderer
|
|
2
|
+
// builds its fallback locale store ONLY from clientFeatures[].translations; the
|
|
3
|
+
// server-side r.translations bundle (feature.ts) never reaches it. To render the
|
|
4
|
+
// configEdit/entityEdit labels translated instead of raw, we mirror the same keys here.
|
|
5
|
+
//
|
|
6
|
+
// Single source: pivots MANAGED_PAGES_I18N (key-first { key: {de,en} }, server
|
|
7
|
+
// form) into the locale-first TranslationsByLocale form the client expects, so
|
|
8
|
+
// there is no key duplication and no drift.
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
type TranslationsByLocale,
|
|
12
|
+
translationsByLocaleFromKeys,
|
|
13
|
+
} from "@cosmicdrift/kumiko-renderer";
|
|
14
|
+
import { MANAGED_PAGES_I18N } from "./i18n.ts";
|
|
15
|
+
|
|
16
|
+
export const defaultTranslations: TranslationsByLocale =
|
|
17
|
+
translationsByLocaleFromKeys(MANAGED_PAGES_I18N);
|
|
@@ -1,19 +1,62 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// server-seitige r.translations-Bundle (feature.ts) erreicht ihn nie. Damit die
|
|
5
|
-
// configEdit/entityEdit-Labels im Client übersetzt rendern statt roh, spiegeln
|
|
6
|
-
// wir hier dieselben Keys.
|
|
1
|
+
// Pure data (i18n keys) that lives under web/ so the web bundle may pivot it into
|
|
2
|
+
// the browser store; feature.ts (server) imports it as well (the server may import
|
|
3
|
+
// client-safe pure data, like PAT constants.ts).
|
|
7
4
|
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
5
|
+
// Translation bundle for the managed-pages admin screens. Without these keys the
|
|
6
|
+
// UI renders the raw i18n keys (screen:*.title, entity:*:field:*, section
|
|
7
|
+
// headers). Once a feature calls r.translations, the boot validator
|
|
8
|
+
// (required-surface-keys) demands the COMPLETE required-surface set in de+en;
|
|
9
|
+
// this file covers every screen/field/section key managed-pages registers. The
|
|
10
|
+
// two customCss keys are always supplied (harmless with allowCustomCss:false, but
|
|
11
|
+
// required for consumers that enable it).
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
type TranslationsByLocale,
|
|
14
|
-
translationsByLocaleFromKeys,
|
|
15
|
-
} from "@cosmicdrift/kumiko-renderer";
|
|
16
|
-
import { MANAGED_PAGES_I18N } from "../i18n.ts";
|
|
13
|
+
type LocalizedString = { readonly en: string };
|
|
17
14
|
|
|
18
|
-
export const
|
|
19
|
-
|
|
15
|
+
export const MANAGED_PAGES_I18N: Readonly<Record<string, LocalizedString>> = {
|
|
16
|
+
// Screen titles (global/unprefixed, screenTitleKey = screen:<id>.title)
|
|
17
|
+
"screen:page-list.title": { en: "Pages" },
|
|
18
|
+
"screen:page-edit.title": { en: "Edit page" },
|
|
19
|
+
"screen:branding-settings.title": { en: "Branding" },
|
|
20
|
+
|
|
21
|
+
// Page-Entity Feld-Labels (managed-pages:entity:page:field:*)
|
|
22
|
+
"managed-pages:entity:page:field:slug": { en: "Slug" },
|
|
23
|
+
"managed-pages:entity:page:field:lang": { en: "Language" },
|
|
24
|
+
"managed-pages:entity:page:field:title": { en: "Title" },
|
|
25
|
+
"managed-pages:entity:page:field:published": { en: "Published" },
|
|
26
|
+
"managed-pages:entity:page:field:published:option:true": {
|
|
27
|
+
en: "Published",
|
|
28
|
+
},
|
|
29
|
+
"managed-pages:entity:page:field:published:option:false": { en: "Draft" },
|
|
30
|
+
"managed-pages:entity:page:field:description": { en: "Description" },
|
|
31
|
+
"managed-pages:entity:page:field:ogImage": { en: "OG image" },
|
|
32
|
+
"managed-pages:entity:page:field:body": { en: "Content" },
|
|
33
|
+
|
|
34
|
+
// Config-Edit Feld-Labels (managed-pages:entity:__config-edit__:field:*, camelCase Form-Keys)
|
|
35
|
+
"managed-pages:entity:__config-edit__:field:title": { en: "Site title" },
|
|
36
|
+
"managed-pages:entity:__config-edit__:field:description": {
|
|
37
|
+
en: "Description",
|
|
38
|
+
},
|
|
39
|
+
"managed-pages:entity:__config-edit__:field:siteUrl": { en: "Site URL" },
|
|
40
|
+
"managed-pages:entity:__config-edit__:field:accentColor": {
|
|
41
|
+
en: "Accent color",
|
|
42
|
+
},
|
|
43
|
+
"managed-pages:entity:__config-edit__:field:logoUrl": { en: "Logo URL" },
|
|
44
|
+
"managed-pages:entity:__config-edit__:field:logoFile": { en: "Logo file" },
|
|
45
|
+
"managed-pages:entity:__config-edit__:field:layoutPreset": { en: "Layout" },
|
|
46
|
+
|
|
47
|
+
// Section-Header
|
|
48
|
+
"managed-pages:section.meta": { en: "Metadata" },
|
|
49
|
+
"managed-pages:section.body": { en: "Content" },
|
|
50
|
+
"managed-pages:branding.section.identity": { en: "Identity" },
|
|
51
|
+
|
|
52
|
+
// Row-Actions + Confirm (pageListScreen)
|
|
53
|
+
"managed-pages:actions.edit": { en: "Edit" },
|
|
54
|
+
"managed-pages:actions.delete": { en: "Delete" },
|
|
55
|
+
"managed-pages:confirms.page-delete": {
|
|
56
|
+
en: "Delete this page?",
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
// Nur bei allowCustomCss:true im Screen — unconditional geliefert
|
|
60
|
+
"managed-pages:entity:__config-edit__:field:customCss": { en: "Custom CSS" },
|
|
61
|
+
"managed-pages:branding.section.custom-css": { en: "Custom CSS" },
|
|
62
|
+
};
|
|
@@ -6,7 +6,6 @@ import type {
|
|
|
6
6
|
} from "@cosmicdrift/kumiko-types/aggregate-types";
|
|
7
7
|
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
8
8
|
import type { TenantDb } from "@cosmicdrift/kumiko-types/tenant-db-types";
|
|
9
|
-
import { MAX_GROUP_ROWS, type MetricRange } from "./constants.ts";
|
|
10
9
|
import type {
|
|
11
10
|
MetricDefinition,
|
|
12
11
|
MetricDeltaDirection,
|
|
@@ -16,6 +15,7 @@ import type {
|
|
|
16
15
|
MetricSegment,
|
|
17
16
|
MetricSeries,
|
|
18
17
|
} from "./types.ts";
|
|
18
|
+
import { MAX_GROUP_ROWS, type MetricRange } from "./web/constants.ts";
|
|
19
19
|
import { bucketStartsMs, computeWindow, resolveBucket } from "./window.ts";
|
|
20
20
|
|
|
21
21
|
export type MetricRunParams = {
|
|
@@ -9,12 +9,6 @@ import { InternalError, ValidationError } from "@cosmicdrift/kumiko-framework/er
|
|
|
9
9
|
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
10
10
|
import * as z from "zod";
|
|
11
11
|
import { runMetric } from "./compute.ts";
|
|
12
|
-
import {
|
|
13
|
-
METRIC_RANGES,
|
|
14
|
-
METRICS_FEATURE,
|
|
15
|
-
METRICS_SYSTEM_FEATURE,
|
|
16
|
-
type MetricScope,
|
|
17
|
-
} from "./constants.ts";
|
|
18
12
|
import {
|
|
19
13
|
metricFilterPayloadShape,
|
|
20
14
|
metricFilterWhere,
|
|
@@ -23,6 +17,12 @@ import {
|
|
|
23
17
|
import { METRICS_I18N } from "./i18n.ts";
|
|
24
18
|
import type { MetricDefinition, MetricsFeatureOptions } from "./types.ts";
|
|
25
19
|
import { metricHasTenantColumn, validateMetrics } from "./validate.ts";
|
|
20
|
+
import {
|
|
21
|
+
METRIC_RANGES,
|
|
22
|
+
METRICS_FEATURE,
|
|
23
|
+
METRICS_SYSTEM_FEATURE,
|
|
24
|
+
type MetricScope,
|
|
25
|
+
} from "./web/constants.ts";
|
|
26
26
|
import { isValidTimeZone } from "./window.ts";
|
|
27
27
|
|
|
28
28
|
const DEFAULT_RANGE = "7d";
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
// Public API of the metrics bundled-feature.
|
|
2
2
|
|
|
3
|
-
export {
|
|
4
|
-
METRIC_RANGES,
|
|
5
|
-
METRICS_FEATURE,
|
|
6
|
-
METRICS_SYSTEM_FEATURE,
|
|
7
|
-
type MetricRange,
|
|
8
|
-
type MetricScope,
|
|
9
|
-
metricQueryName,
|
|
10
|
-
} from "./constants.ts";
|
|
11
3
|
export {
|
|
12
4
|
activeTenantsMetric,
|
|
13
5
|
activeUsersMetric,
|
|
@@ -32,3 +24,11 @@ export {
|
|
|
32
24
|
type MetricSeries,
|
|
33
25
|
type MetricsFeatureOptions,
|
|
34
26
|
} from "./types.ts";
|
|
27
|
+
export {
|
|
28
|
+
METRIC_RANGES,
|
|
29
|
+
METRICS_FEATURE,
|
|
30
|
+
METRICS_SYSTEM_FEATURE,
|
|
31
|
+
type MetricRange,
|
|
32
|
+
type MetricScope,
|
|
33
|
+
metricQueryName,
|
|
34
|
+
} from "./web/constants.ts";
|
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
import type { SchemaTable } from "@cosmicdrift/kumiko-types/schema-table-types";
|
|
8
8
|
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
9
9
|
import type { WhereObject } from "@cosmicdrift/kumiko-types/where-clause-types";
|
|
10
|
-
import type { MetricRange, MetricScope } from "./constants.ts";
|
|
10
|
+
import type { MetricRange, MetricScope } from "./web/constants.ts";
|
|
11
11
|
|
|
12
12
|
/** Maps a payload value (e.g. a folder id) to the values `column` may have (e.g. the folder and its subfolders' loan ids). Runs with the tenant handler context, so reads stay tenant-scoped; the result only narrows. An empty result yields no rows. */
|
|
13
13
|
export type MetricFilterResolver = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extractTableInfo, isTimestamptzType } from "@cosmicdrift/kumiko-framework/db";
|
|
2
|
-
import { METRIC_RANGES } from "./constants.ts";
|
|
3
2
|
import { filterValueKindOf, metricFilterEntries, RESERVED_PAYLOAD_KEYS } from "./filters.ts";
|
|
4
3
|
import type { MetricDefinition } from "./types.ts";
|
|
4
|
+
import { METRIC_RANGES } from "./web/constants.ts";
|
|
5
5
|
|
|
6
6
|
const KEBAB_ID = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
|
|
7
7
|
const FILTER_PAYLOAD_KEY = /^[a-z][a-zA-Z0-9]*$/;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AggregateTimeBucket } from "@cosmicdrift/kumiko-types/aggregate-types";
|
|
2
2
|
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
3
|
-
import type { MetricRange } from "./constants.ts";
|
|
4
3
|
import type { MetricDefinition } from "./types.ts";
|
|
4
|
+
import type { MetricRange } from "./web/constants.ts";
|
|
5
5
|
|
|
6
6
|
export type MetricWindow = {
|
|
7
7
|
readonly start: Temporal.Instant;
|
|
@@ -21,11 +21,11 @@ import {
|
|
|
21
21
|
type FeatureRegistrar,
|
|
22
22
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
23
23
|
import { assertNoWhereRuleInOwnershipWrite } from "../shared/index.ts";
|
|
24
|
-
import { DEFAULT_NOTES_HISTORY_ACCESS, NOTES_HISTORY_FEATURE_NAME } from "./constants.ts";
|
|
25
24
|
import { createNoteEntryEntity, noteMentionEntity } from "./entity.ts";
|
|
26
25
|
import { createNoteEntryExecutor } from "./executor.ts";
|
|
27
26
|
import { createAddNoteHandler } from "./handlers/add-note.write.ts";
|
|
28
27
|
import { NOTES_HISTORY_FEATURE_I18N } from "./i18n.ts";
|
|
28
|
+
import { DEFAULT_NOTES_HISTORY_ACCESS, NOTES_HISTORY_FEATURE_NAME } from "./web/constants.ts";
|
|
29
29
|
|
|
30
30
|
function registerNotesHistory(
|
|
31
31
|
r: FeatureRegistrar<typeof NOTES_HISTORY_FEATURE_NAME>,
|
|
@@ -4,9 +4,9 @@ import { ValidationError, writeFailure } from "@cosmicdrift/kumiko-framework/err
|
|
|
4
4
|
import { decryptStoredPii, denyUnlessJoinRowParentVisible } from "../../shared/index.ts";
|
|
5
5
|
import { tenantMembershipsTable } from "../../tenant/index.ts";
|
|
6
6
|
import { userTable } from "../../user/index.ts";
|
|
7
|
-
import { DEFAULT_NOTES_HISTORY_ACCESS } from "../constants.ts";
|
|
8
7
|
import { noteEntryExecutor, noteMentionExecutor } from "../executor.ts";
|
|
9
8
|
import { type AddNotePayload, addNotePayloadSchema } from "../schemas.ts";
|
|
9
|
+
import { DEFAULT_NOTES_HISTORY_ACCESS } from "../web/constants.ts";
|
|
10
10
|
|
|
11
11
|
const READ_AUTHOR_DISPLAY_NAME_REASON =
|
|
12
12
|
"reads the author's displayName from the global users table inside a savepoint so a missing user feature cannot poison the note transaction";
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
DEFAULT_NOTES_HISTORY_ACCESS,
|
|
3
|
-
DEFAULT_NOTES_HISTORY_ROLES,
|
|
4
|
-
NOTES_HISTORY_FEATURE_NAME,
|
|
5
|
-
NOTES_SECTION_EXTENSION_NAME,
|
|
6
|
-
NotesHistoryHandlers,
|
|
7
|
-
NotesHistoryQueries,
|
|
8
|
-
} from "./constants.ts";
|
|
9
1
|
export { noteEntryEntity, noteMentionEntity } from "./entity.ts";
|
|
10
2
|
export {
|
|
11
3
|
noteEntryExecutor,
|
|
@@ -22,3 +14,11 @@ export {
|
|
|
22
14
|
createAddNoteHandler,
|
|
23
15
|
} from "./handlers/add-note.write.ts";
|
|
24
16
|
export { type AddNotePayload, addNotePayloadSchema } from "./schemas.ts";
|
|
17
|
+
export {
|
|
18
|
+
DEFAULT_NOTES_HISTORY_ACCESS,
|
|
19
|
+
DEFAULT_NOTES_HISTORY_ROLES,
|
|
20
|
+
NOTES_HISTORY_FEATURE_NAME,
|
|
21
|
+
NOTES_SECTION_EXTENSION_NAME,
|
|
22
|
+
NotesHistoryHandlers,
|
|
23
|
+
NotesHistoryQueries,
|
|
24
|
+
} from "./web/constants.ts";
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
// @runtime client
|
|
2
|
-
|
|
3
1
|
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
4
|
-
import { NOTES_HISTORY_FEATURE_NAME, NOTES_SECTION_EXTENSION_NAME } from "
|
|
2
|
+
import { NOTES_HISTORY_FEATURE_NAME, NOTES_SECTION_EXTENSION_NAME } from "./constants.ts";
|
|
5
3
|
import { defaultTranslations } from "./i18n.ts";
|
|
6
4
|
import { NotesSection } from "./notes-section.tsx";
|
|
7
5
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export { notesHistoryClient } from "./client-plugin.tsx";
|
|
2
2
|
export {
|
|
3
3
|
NOTES_SECTION_EXTENSION_NAME,
|
|
4
4
|
NotesHistoryHandlers,
|
|
5
5
|
NotesHistoryQueries,
|
|
6
|
-
} from "
|
|
7
|
-
export { notesHistoryClient } from "./client-plugin.tsx";
|
|
6
|
+
} from "./constants.ts";
|
|
8
7
|
export { NotesSection } from "./notes-section.tsx";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// NotesSection — drop-in note history for ANY entity. Shows every note
|
|
3
2
|
// chronologically (newest first) with author + timestamp, plus a textarea to
|
|
4
3
|
// append a new one. Append-only: there is no edit/delete affordance because
|
|
@@ -19,7 +18,7 @@ import {
|
|
|
19
18
|
useTranslation,
|
|
20
19
|
} from "@cosmicdrift/kumiko-renderer";
|
|
21
20
|
import { type ReactNode, useState } from "react";
|
|
22
|
-
import { NotesHistoryHandlers, NotesHistoryQueries } from "
|
|
21
|
+
import { NotesHistoryHandlers, NotesHistoryQueries } from "./constants.ts";
|
|
23
22
|
|
|
24
23
|
type NoteRow = {
|
|
25
24
|
readonly id: string;
|
|
@@ -33,7 +32,7 @@ type NoteRow = {
|
|
|
33
32
|
};
|
|
34
33
|
|
|
35
34
|
// Matches @cosmicdrift/kumiko-framework/crypto PII_ERASED_SENTINEL — cannot
|
|
36
|
-
// import that module from
|
|
35
|
+
// import that module from client code (runtime-isolation).
|
|
37
36
|
const PII_ERASED_SENTINEL = "[[erased]]";
|
|
38
37
|
|
|
39
38
|
function displayAuthorName(authorName: string | null, unknownLabel: string): string {
|
|
@@ -9,12 +9,6 @@ import {
|
|
|
9
9
|
type FeatureDefinition,
|
|
10
10
|
type ProjectionListScreenDefinition,
|
|
11
11
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
12
|
-
import {
|
|
13
|
-
API_TOKEN_ENTITY_NAME,
|
|
14
|
-
PAT_DEFAULT_RATE_LIMIT,
|
|
15
|
-
PAT_FEATURE,
|
|
16
|
-
type PatRateLimit,
|
|
17
|
-
} from "./constants.ts";
|
|
18
12
|
import { availabilityQuery } from "./handlers/availability.query.ts";
|
|
19
13
|
import { buildAvailableScopesQuery } from "./handlers/available-scopes.query.ts";
|
|
20
14
|
import { type CreatePatOptions, createPatCreateHandler } from "./handlers/create.write.ts";
|
|
@@ -24,8 +18,14 @@ import { PAT_FEATURE_I18N, patScopeOptionTranslations } from "./i18n.ts";
|
|
|
24
18
|
import { PAT_REVOKED_EVENT_SHORT, patRevokedSchema } from "./pat-revoked-event.ts";
|
|
25
19
|
import { createPatResolver } from "./resolver.ts";
|
|
26
20
|
import { apiTokenEntity } from "./schema/api-token.ts";
|
|
27
|
-
import type { PatScopeConfig } from "./scopes.ts";
|
|
28
21
|
import { createPatMintScreen, patListScreen } from "./screens.ts";
|
|
22
|
+
import {
|
|
23
|
+
API_TOKEN_ENTITY_NAME,
|
|
24
|
+
PAT_DEFAULT_RATE_LIMIT,
|
|
25
|
+
PAT_FEATURE,
|
|
26
|
+
type PatRateLimit,
|
|
27
|
+
} from "./web/constants.ts";
|
|
28
|
+
import type { PatScopeConfig } from "./web/scopes.ts";
|
|
29
29
|
|
|
30
30
|
// Password-change is the only field-level trigger — see the postSave hook
|
|
31
31
|
// below. MFA-enable/disable is wired separately (auth-mfa's
|
|
@@ -148,11 +148,14 @@ export function createPersonalAccessTokensFeature(
|
|
|
148
148
|
// is r.systemScope()'d (the user aggregate is a systemStream, framework
|
|
149
149
|
// #497), so a postSave hook on "user" gets a poisoned ctx.db here. The
|
|
150
150
|
// concrete revoker is bound once run{Prod,Dev}App has a real db handle.
|
|
151
|
-
|
|
151
|
+
// Explicit option wins; the runtime binding is replaceable so a second boot of the same
|
|
152
|
+
// feature instance binds its own database.
|
|
153
|
+
let boundAutoRevoke: ((userId: string) => Promise<number>) | undefined;
|
|
152
154
|
r.hook({
|
|
153
155
|
type: "postSave",
|
|
154
156
|
target: { allOf: "user" },
|
|
155
157
|
handler: async (result) => {
|
|
158
|
+
const autoRevokeOnPasswordChange = options.autoRevokeOnPasswordChange ?? boundAutoRevoke;
|
|
156
159
|
// skip: nothing bound — same late-bind pattern as sessions/feature.ts
|
|
157
160
|
if (!autoRevokeOnPasswordChange) return;
|
|
158
161
|
// skip: brand-new user, no PATs can exist yet
|
|
@@ -165,8 +168,7 @@ export function createPersonalAccessTokensFeature(
|
|
|
165
168
|
},
|
|
166
169
|
});
|
|
167
170
|
const bindAutoRevokeOnPasswordChange: BindPatAutoRevokeOnPasswordChange = (revoker) => {
|
|
168
|
-
|
|
169
|
-
autoRevokeOnPasswordChange ??= revoker;
|
|
171
|
+
boundAutoRevoke = revoker;
|
|
170
172
|
};
|
|
171
173
|
|
|
172
174
|
const handlers = {
|
package/packages/bundled-features/src/personal-access-tokens/handlers/available-scopes.query.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import type { PatScopeConfig } from "../scopes.ts";
|
|
3
|
+
import type { PatScopeConfig } from "../web/scopes.ts";
|
|
4
4
|
|
|
5
5
|
// Returns the app-declared scope domains ({name, label, canWrite}) so the mint
|
|
6
6
|
// UI can render a per-domain level picker (no access / read / read & write).
|
|
@@ -11,9 +11,9 @@ import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
|
11
11
|
import * as z from "zod";
|
|
12
12
|
import { encryptForDirectWrite, verifyPassword } from "../../shared/index.ts";
|
|
13
13
|
import { UserQueries } from "../../user/index.ts";
|
|
14
|
-
import { API_TOKEN_ENTITY_NAME, PAT_DEFAULT_EXPIRES_IN_DAYS, PatErrors } from "../constants.ts";
|
|
15
14
|
import { mintPatToken } from "../hash.ts";
|
|
16
15
|
import { apiTokenEntity, apiTokenTable } from "../schema/api-token.ts";
|
|
16
|
+
import { API_TOKEN_ENTITY_NAME, PAT_DEFAULT_EXPIRES_IN_DAYS, PatErrors } from "../web/constants.ts";
|
|
17
17
|
|
|
18
18
|
export type PatMfaVerifyResult = { readonly enrolled: boolean; readonly ok: boolean };
|
|
19
19
|
|
|
@@ -4,9 +4,9 @@ import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/
|
|
|
4
4
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
5
5
|
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
6
6
|
import * as z from "zod";
|
|
7
|
-
import { API_TOKEN_ENTITY_NAME, PatErrors } from "../constants.ts";
|
|
8
7
|
import { PAT_REVOKED_AGGREGATE_TYPE, PAT_REVOKED_EVENT_QN } from "../pat-revoked-event.ts";
|
|
9
8
|
import { apiTokenTable } from "../schema/api-token.ts";
|
|
9
|
+
import { API_TOKEN_ENTITY_NAME, PatErrors } from "../web/constants.ts";
|
|
10
10
|
|
|
11
11
|
// Revoke one of the caller's own tokens. Ownership is enforced in the WHERE
|
|
12
12
|
// (userId = caller), so a caller can't revoke another user's token and a miss
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { generateToken, PAT_TOKEN_PREFIX } from "@cosmicdrift/kumiko-framework/api";
|
|
3
|
-
import { PAT_PREFIX_DISPLAY_LENGTH } from "./constants.ts";
|
|
3
|
+
import { PAT_PREFIX_DISPLAY_LENGTH } from "./web/constants.ts";
|
|
4
4
|
|
|
5
5
|
// A PAT is high-entropy (32 random bytes from generateToken). A single SHA-256
|
|
6
6
|
// is the right hash here: fast on the per-request auth path, and there's no
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ACTION_FORM_ENTITY } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
2
|
import { fieldLabelKey, fieldOptionLabelKey } from "@cosmicdrift/kumiko-renderer/headless";
|
|
3
|
-
import { PAT_FEATURE } from "./constants.ts";
|
|
4
|
-
import type { PatScopeConfig } from "./scopes.ts";
|
|
3
|
+
import { PAT_FEATURE } from "./web/constants.ts";
|
|
4
|
+
import type { PatScopeConfig } from "./web/scopes.ts";
|
|
5
5
|
|
|
6
6
|
const mintFieldKey = (field: string): string =>
|
|
7
7
|
fieldLabelKey(PAT_FEATURE, ACTION_FORM_ENTITY, field);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { FeatureDefinition } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { PAT_DEFAULT_RATE_LIMIT, type PatRateLimit } from "./constants.ts";
|
|
2
|
+
import { PAT_DEFAULT_RATE_LIMIT, type PatRateLimit } from "./web/constants.ts";
|
|
3
3
|
|
|
4
|
-
export type { PatRateLimit } from "./constants.ts";
|
|
5
|
-
export { PAT_DEFAULT_RATE_LIMIT, PAT_FEATURE, PatHandlers, PatQueries } from "./constants.ts";
|
|
6
4
|
export type { BindPatAutoRevokeOnPasswordChange, PersonalAccessTokensOptions } from "./feature.ts";
|
|
7
5
|
export {
|
|
8
6
|
bindPatAutoRevokeOnPasswordChangeFromFeature,
|
|
@@ -20,8 +18,10 @@ export {
|
|
|
20
18
|
export { createPatResolver } from "./resolver.ts";
|
|
21
19
|
export { revokeAllPatTokensForUser } from "./revoke-for-user.ts";
|
|
22
20
|
export { apiTokenEntity, apiTokenTable } from "./schema/api-token.ts";
|
|
23
|
-
export type {
|
|
24
|
-
export {
|
|
21
|
+
export type { PatRateLimit } from "./web/constants.ts";
|
|
22
|
+
export { PAT_DEFAULT_RATE_LIMIT, PAT_FEATURE, PatHandlers, PatQueries } from "./web/constants.ts";
|
|
23
|
+
export type { PatScopeConfig, PatScopeDef } from "./web/scopes.ts";
|
|
24
|
+
export { expandScopes } from "./web/scopes.ts";
|
|
25
25
|
|
|
26
26
|
// Reads the per-token rate-limit config off a mounted PAT feature's exports.
|
|
27
27
|
// Falls back to the default when absent. run-prod-app uses this to build the
|