@cosmicdrift/kumiko-samples 0.377.0 → 0.379.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-counter/changes.json +12 -0
- package/packages/bundled-features/src/cap-counter/stock-cap-guard.ts +9 -0
- 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 +1 -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/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/changes.json +6 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-accounts.query.ts +11 -4
- 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/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/mail-foundation/changes.json +6 -0
- package/packages/bundled-features/src/mail-foundation/i18n.ts +3 -2
- package/packages/bundled-features/src/mail-transport-smtp/i18n.ts +1 -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 +1 -1
- 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/{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 +63 -0
- package/packages/bundled-features/src/template-resolver/compile-document-body.ts +62 -4
- 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 +39 -4
- package/packages/bundled-features/src/template-resolver/feature.ts +88 -38
- 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 +20 -7
- package/packages/bundled-features/src/template-resolver/handlers/collection-shared.ts +0 -6
- package/packages/bundled-features/src/template-resolver/handlers/copy-locale.write.ts +69 -60
- 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 +37 -14
- 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/import-bundle.write.ts +37 -28
- 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 +132 -70
- package/packages/bundled-features/src/template-resolver/handlers/patch-draft.write.ts +106 -97
- package/packages/bundled-features/src/template-resolver/handlers/reset-to-system.write.ts +62 -49
- package/packages/bundled-features/src/template-resolver/handlers/resource-link-pdf.write.ts +44 -29
- package/packages/bundled-features/src/template-resolver/handlers/resource-remove.write.ts +52 -36
- 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 +127 -107
- package/packages/bundled-features/src/template-resolver/handlers/send-test-shared.ts +38 -0
- package/packages/bundled-features/src/template-resolver/handlers/send-test-status.query.ts +31 -0
- package/packages/bundled-features/src/template-resolver/handlers/send-test.write.ts +106 -112
- package/packages/bundled-features/src/template-resolver/handlers/set.write.ts +111 -104
- 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/toggle-status.write.ts +56 -28
- package/packages/bundled-features/src/template-resolver/handlers/upsert-tenant.write.ts +38 -29
- 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 +68 -60
- 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 +91 -0
- package/packages/bundled-features/src/template-resolver/template-meta.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-preview.ts +22 -12
- package/packages/bundled-features/src/template-resolver/template-usage.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-validation.ts +33 -12
- 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} +10 -10
- package/packages/bundled-features/src/template-resolver/{document-blocks.ts → web/document-blocks.ts} +3 -2
- package/packages/bundled-features/src/template-resolver/web/document-editor-extensions.ts +31 -3
- package/packages/bundled-features/src/template-resolver/web/document-editor.tsx +0 -1
- package/packages/bundled-features/src/template-resolver/web/document-images.ts +28 -0
- package/packages/bundled-features/src/template-resolver/{document-schema.ts → web/document-schema.ts} +5 -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 +48 -11
- package/packages/bundled-features/src/template-resolver/web/document-toolbar-blocks.ts +4 -3
- package/packages/bundled-features/src/template-resolver/web/editor-handle.ts +1 -2
- package/packages/bundled-features/src/template-resolver/web/i18n.ts +8 -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} +2 -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/help-action.tsx +37 -0
- package/samples/apps/ui-walkthrough/src/app/seed-rental.ts +17 -1
- package/samples/apps/ui-walkthrough/src/app/seed-templates.ts +13 -0
- package/samples/apps/ui-walkthrough/src/app/server.ts +2 -1
- package/samples/apps/ui-walkthrough/src/app/shell.tsx +6 -0
- package/samples/apps/ui-walkthrough/src/app/template-seed-data.ts +20 -0
- 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 +120 -2
- package/samples/apps/ui-walkthrough/src/features/rental/i18n.ts +94 -0
- package/samples/apps/ui-walkthrough/src/features/rental/invoice-receive.ts +19 -0
- package/samples/apps/ui-walkthrough/src/features/rental/lease-support.ts +32 -1
- package/samples/apps/ui-walkthrough/src/features/rental/qualified-names.ts +5 -0
- package/samples/apps/ui-walkthrough/src/features/rental/receipts-upload.ts +70 -0
- package/samples/apps/ui-walkthrough/src/features/rental/screens.ts +156 -0
- 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/features/tasks/i18n.ts +8 -0
- package/samples/apps/ui-walkthrough/src/run-config.ts +43 -3
- package/samples/apps/use-all-bundled/e2e-billing-gallery/server.ts +1 -1
- package/samples/apps/use-all-bundled/feature-manifest.json +5 -5
- 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/delivery-notifications/README.md +1 -1
- package/samples/recipes/embedded/README.md +8 -0
- package/samples/recipes/embedded/src/feature.ts +8 -0
- package/samples/recipes/embedded/src/handlers/invoice-receive.write.ts +37 -0
- package/samples/recipes/embedded/src/screens/invoice-receive.screen.ts +56 -0
- 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
|
@@ -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
|
|
@@ -6,7 +6,7 @@ import { isExpiredAt } from "./expiry.ts";
|
|
|
6
6
|
import { hashPatToken } from "./hash.ts";
|
|
7
7
|
import { resolvePatRoles } from "./roles.ts";
|
|
8
8
|
import { apiTokenTable } from "./schema/api-token.ts";
|
|
9
|
-
import { expandScopes, type PatScopeConfig } from "./scopes.ts";
|
|
9
|
+
import { expandScopes, type PatScopeConfig } from "./web/scopes.ts";
|
|
10
10
|
|
|
11
11
|
// Hot-path resolver — raw-DB like session-callbacks (a dispatcher roundtrip on
|
|
12
12
|
// every request buys nothing here). Hash the bearer token, point-read the row,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
createTextField,
|
|
6
6
|
createTimestampField,
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
8
|
-
import { API_TOKEN_ENTITY_NAME } from "../constants.ts";
|
|
8
|
+
import { API_TOKEN_ENTITY_NAME } from "../web/constants.ts";
|
|
9
9
|
|
|
10
10
|
// One row per Personal Access Token. Like store_user_sessions this is a
|
|
11
11
|
// direct-write store (r.unmanagedTable): the create/revoke handlers write it and
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
PAT_SCREEN_ID,
|
|
13
13
|
PatHandlers,
|
|
14
14
|
PatQueries,
|
|
15
|
-
} from "./constants.ts";
|
|
16
|
-
import type { PatScopeConfig } from "./scopes.ts";
|
|
15
|
+
} from "./web/constants.ts";
|
|
16
|
+
import type { PatScopeConfig } from "./web/scopes.ts";
|
|
17
17
|
|
|
18
18
|
const PAT_STATUS_OPTION_KEY_PREFIX = "pat.list.status.";
|
|
19
19
|
// Same keys the mint form's `scopes` multiSelect options resolve through
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.379.0",
|
|
4
|
+
"type": "breaking",
|
|
5
|
+
"title": "dsgvoSelfServiceFeatures removed",
|
|
6
|
+
"detail": "The deprecated preset dsgvoSelfServiceFeatures and its DsgvoSelfServiceOptions type are gone. composeGdprStack covers the same features.",
|
|
7
|
+
"migration": "Use composeGdprStack({ selfService: { userDataRights } }), or mount createSessionsFeature, createDataRetentionFeature, createComplianceProfilesFeature, createUserDataRightsFeature and createUserProfileFeature yourself."
|
|
8
|
+
},
|
|
2
9
|
{
|
|
3
10
|
"version": "0.370.0",
|
|
4
11
|
"type": "improvement",
|
|
@@ -9,7 +9,7 @@ export type SecurityBaselineOptions = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
// Host app must mount user, tenant, auth-foundation (sessions/audit requires).
|
|
12
|
-
/** @deprecated Removed in
|
|
12
|
+
/** @deprecated Removed in 0.390.0. Use `composeSecurityStack({ includeSessions })`
|
|
13
13
|
* from `@cosmicdrift/kumiko-dev-server/compose-stacks`. */
|
|
14
14
|
export function securityBaselineFeatures(opts: SecurityBaselineOptions = {}): FeatureDefinition[] {
|
|
15
15
|
return [
|
|
@@ -165,7 +165,7 @@ export type ImageOptions = {
|
|
|
165
165
|
//
|
|
166
166
|
// **Beispiel renderer-mail-html:**
|
|
167
167
|
// import { createTemplateResolverApi } from "@cosmicdrift/kumiko-bundled-features/template-resolver";
|
|
168
|
-
// const tplApi = createTemplateResolverApi(ctx.db);
|
|
168
|
+
// const tplApi = createTemplateResolverApi(ctx.db, ctx.registry);
|
|
169
169
|
// const layout = await tplApi.resolveTemplate({ tenantId: ctx.tenantId, slug, kind });
|
|
170
170
|
export type RendererContext = {
|
|
171
171
|
readonly db: DbRunner | TenantDb;
|
|
@@ -10,7 +10,6 @@ import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
|
10
10
|
import { SETTINGS_HUB_I18N } from "@cosmicdrift/kumiko-framework/i18n";
|
|
11
11
|
import type { SecretsContext } from "@cosmicdrift/kumiko-framework/secrets";
|
|
12
12
|
import * as z from "zod";
|
|
13
|
-
import { DEFAULT_SECRETS_ACCESS } from "./constants.ts";
|
|
14
13
|
import { createDeleteHandler } from "./handlers/delete.write.ts";
|
|
15
14
|
import { createListHandler } from "./handlers/list.query.ts";
|
|
16
15
|
import { rotateJob } from "./handlers/rotate.job.ts";
|
|
@@ -18,6 +17,7 @@ import { createSetHandler } from "./handlers/set.write.ts";
|
|
|
18
17
|
import { SECRETS_I18N } from "./i18n.ts";
|
|
19
18
|
import { secretReadSchema } from "./secrets-context.ts";
|
|
20
19
|
import { tenantSecretEntity, tenantSecretsTable } from "./table.ts";
|
|
20
|
+
import { DEFAULT_SECRETS_ACCESS } from "./web/constants.ts";
|
|
21
21
|
|
|
22
22
|
const ROTATE_ESCAPE_HATCH_REASON = "re-encrypts every tenant's secrets with the new master key";
|
|
23
23
|
|
|
@@ -2,8 +2,8 @@ import { type AccessRule, defineWriteHandler } from "@cosmicdrift/kumiko-framewo
|
|
|
2
2
|
import { failNotFound } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { announceSecretChange } from "../announce-secret-change.ts";
|
|
5
|
-
import { DEFAULT_SECRETS_ACCESS, SecretsHandlers } from "../constants.ts";
|
|
6
5
|
import { JOIN_REQUEST_TRANSACTION_REASON, requireSecretsContext } from "../feature.ts";
|
|
6
|
+
import { DEFAULT_SECRETS_ACCESS, SecretsHandlers } from "../web/constants.ts";
|
|
7
7
|
import { checkSecretKeyWrite } from "../write-gate.ts";
|
|
8
8
|
|
|
9
9
|
export function createDeleteHandler(access: AccessRule = DEFAULT_SECRETS_ACCESS) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AccessRule, defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import { DEFAULT_SECRETS_ACCESS } from "../constants.ts";
|
|
4
3
|
import { tenantSecretsTable } from "../table.ts";
|
|
4
|
+
import { DEFAULT_SECRETS_ACCESS } from "../web/constants.ts";
|
|
5
5
|
|
|
6
6
|
// Lists all secrets for the current tenant. Returns redactedPreview, never
|
|
7
7
|
// the plaintext. Decryption would be pointless here anyway — this is the
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type AccessRule, defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { announceSecretChange } from "../announce-secret-change.ts";
|
|
4
|
-
import { DEFAULT_SECRETS_ACCESS, SecretsHandlers } from "../constants.ts";
|
|
5
4
|
import { JOIN_REQUEST_TRANSACTION_REASON, requireSecretsContext } from "../feature.ts";
|
|
5
|
+
import { DEFAULT_SECRETS_ACCESS, SecretsHandlers } from "../web/constants.ts";
|
|
6
6
|
import { checkSecretKeyWrite, checkSecretValue } from "../write-gate.ts";
|
|
7
7
|
|
|
8
8
|
export function createSetHandler(access: AccessRule = DEFAULT_SECRETS_ACCESS) {
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
DEFAULT_SECRETS_ACCESS,
|
|
3
|
-
DEFAULT_SECRETS_ROLES,
|
|
4
|
-
INVALID_SECRET_VALUE_CODE,
|
|
5
|
-
SECRETS_ERROR_KEYS,
|
|
6
|
-
SecretsHandlers,
|
|
7
|
-
SecretsQueries,
|
|
8
|
-
} from "./constants.ts";
|
|
9
1
|
export {
|
|
10
2
|
createSecretsContext,
|
|
11
3
|
createSecretsFeature,
|
|
@@ -29,4 +21,12 @@ export {
|
|
|
29
21
|
rotateJob,
|
|
30
22
|
} from "./handlers/rotate.job.ts";
|
|
31
23
|
export { createSetHandler } from "./handlers/set.write.ts";
|
|
24
|
+
export {
|
|
25
|
+
DEFAULT_SECRETS_ACCESS,
|
|
26
|
+
DEFAULT_SECRETS_ROLES,
|
|
27
|
+
INVALID_SECRET_VALUE_CODE,
|
|
28
|
+
SECRETS_ERROR_KEYS,
|
|
29
|
+
SecretsHandlers,
|
|
30
|
+
SecretsQueries,
|
|
31
|
+
} from "./web/constants.ts";
|
|
32
32
|
export { isInvalidSecretValueError } from "./write-gate.ts";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type WriteFailure,
|
|
12
12
|
writeFailure,
|
|
13
13
|
} from "@cosmicdrift/kumiko-framework/errors";
|
|
14
|
-
import { INVALID_SECRET_VALUE_CODE, SECRETS_ERROR_KEYS } from "./constants.ts";
|
|
14
|
+
import { INVALID_SECRET_VALUE_CODE, SECRETS_ERROR_KEYS } from "./web/constants.ts";
|
|
15
15
|
|
|
16
16
|
// Fixed keys carry their definition (redact fn, writeRoles); namespace keys
|
|
17
17
|
// only the namespace, which has no redact fn.
|
|
@@ -17,7 +17,6 @@ import { mineQuery } from "./handlers/mine.query.ts";
|
|
|
17
17
|
import { revokeWrite } from "./handlers/revoke.write.ts";
|
|
18
18
|
import { revokeAllForUserWrite } from "./handlers/revoke-all-for-user.write.ts";
|
|
19
19
|
import { revokeAllOthersWrite } from "./handlers/revoke-all-others.write.ts";
|
|
20
|
-
import { SESSIONS_I18N } from "./i18n.ts";
|
|
21
20
|
import { userSessionEntity } from "./schema/user-session.ts";
|
|
22
21
|
import {
|
|
23
22
|
createSessionDetailScreen,
|
|
@@ -30,6 +29,7 @@ import {
|
|
|
30
29
|
type SessionMassRevoker,
|
|
31
30
|
} from "./session-callbacks.ts";
|
|
32
31
|
import { SESSION_REVOKED_EVENT_SHORT, sessionRevokedSchema } from "./session-revoked-event.ts";
|
|
32
|
+
import { SESSIONS_I18N } from "./web/i18n.ts";
|
|
33
33
|
|
|
34
34
|
const CLEANUP_ESCAPE_HATCH_REASON = "deletes expired session rows of every tenant";
|
|
35
35
|
|
|
@@ -211,11 +211,15 @@ export function createSessionsFeature(options?: SessionsFeatureOptions): Feature
|
|
|
211
211
|
// sessionChecker blocks a status-locked principal on its next request
|
|
212
212
|
// regardless.
|
|
213
213
|
const REVOKE_TRIGGERING_FIELDS = ["passwordHash"] as const;
|
|
214
|
-
|
|
214
|
+
// Explicit option wins; the runtime binding is replaceable so a second boot of the same
|
|
215
|
+
// feature instance (a new app or test stack in one process) binds its own database.
|
|
216
|
+
const explicitAutoRevoke = options?.autoRevokeOnPasswordChange;
|
|
217
|
+
let boundAutoRevoke: SessionMassRevoker | undefined;
|
|
215
218
|
r.hook({
|
|
216
219
|
type: "postSave",
|
|
217
220
|
target: { allOf: "user" },
|
|
218
221
|
handler: async (ctx) => {
|
|
222
|
+
const autoRevoke = explicitAutoRevoke ?? boundAutoRevoke;
|
|
219
223
|
// skip: nothing bound — stateless-JWT deployments without a runtime
|
|
220
224
|
// that calls bindAutoRevokeOnPasswordChange keep the old behavior.
|
|
221
225
|
if (!autoRevoke) return;
|
|
@@ -231,8 +235,7 @@ export function createSessionsFeature(options?: SessionsFeatureOptions): Feature
|
|
|
231
235
|
});
|
|
232
236
|
|
|
233
237
|
const bindAutoRevokeOnPasswordChange: BindAutoRevokeOnPasswordChange = (revoker) => {
|
|
234
|
-
|
|
235
|
-
autoRevoke ??= revoker;
|
|
238
|
+
boundAutoRevoke = revoker;
|
|
236
239
|
};
|
|
237
240
|
|
|
238
241
|
r.translations({ keys: SESSIONS_I18N });
|
|
@@ -22,7 +22,12 @@ export { isWithinGracePeriod } from "./grace-period.ts";
|
|
|
22
22
|
export { isIdentityV3Hash, verifyIdentityV3Hash } from "./identity-v3-hash.ts";
|
|
23
23
|
export { isTenantDb } from "./is-tenant-db.ts";
|
|
24
24
|
export { createLockoutCounter, type LockoutCounterState } from "./lockout-counter.ts";
|
|
25
|
-
export {
|
|
25
|
+
export {
|
|
26
|
+
mailHeading,
|
|
27
|
+
mailParagraph,
|
|
28
|
+
mailParagraphWithLink,
|
|
29
|
+
mailRepeatedRows,
|
|
30
|
+
} from "./mail-template-body.ts";
|
|
26
31
|
export { mapWithConcurrency } from "./map-with-concurrency.ts";
|
|
27
32
|
export {
|
|
28
33
|
denyUnlessJoinRowParentVisible,
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
FILE_REF_ENTITY_NAME,
|
|
24
24
|
fileRefEntity,
|
|
25
25
|
fileRefsTable,
|
|
26
|
+
listActionFormFileFields,
|
|
26
27
|
} from "@cosmicdrift/kumiko-framework/files";
|
|
27
28
|
import {
|
|
28
29
|
collectSingleFileHolders,
|
|
@@ -213,7 +214,7 @@ export async function purgeFilesReachingSubject(args: {
|
|
|
213
214
|
db,
|
|
214
215
|
registry,
|
|
215
216
|
subject,
|
|
216
|
-
fileFieldKeys: pendingFieldKeys(fileEntities),
|
|
217
|
+
fileFieldKeys: pendingFieldKeys(fileEntities, registry),
|
|
217
218
|
fileHolders,
|
|
218
219
|
storageByTenant,
|
|
219
220
|
resolveDeleteBytes,
|
|
@@ -226,8 +227,15 @@ export async function purgeFilesReachingSubject(args: {
|
|
|
226
227
|
const pendingFieldKey = (entityType: unknown, fieldName: unknown) =>
|
|
227
228
|
`${entityType}\u0000${fieldName}`;
|
|
228
229
|
|
|
229
|
-
|
|
230
|
+
// A pending upload of an actionForm files field is keyed by the screen QN, like an entity's by its name.
|
|
231
|
+
function pendingFieldKeys(
|
|
232
|
+
fileEntities: readonly FileEntity[],
|
|
233
|
+
registry: Registry,
|
|
234
|
+
): ReadonlySet<string> {
|
|
230
235
|
const keys = new Set<string>();
|
|
236
|
+
for (const { screenQn, fieldName } of listActionFormFileFields(registry)) {
|
|
237
|
+
keys.add(pendingFieldKey(screenQn, fieldName));
|
|
238
|
+
}
|
|
231
239
|
for (const { entityName, fileFields } of fileEntities) {
|
|
232
240
|
for (const fieldName of fileFields) keys.add(pendingFieldKey(entityName, fieldName));
|
|
233
241
|
}
|
|
@@ -53,6 +53,7 @@ import {
|
|
|
53
53
|
createStripePlanSwitchSession,
|
|
54
54
|
createStripePortalSession,
|
|
55
55
|
createStripePriceCache,
|
|
56
|
+
createStripeResumeSubscription,
|
|
56
57
|
createStripeRetrievePrices,
|
|
57
58
|
createStripeRetrieveSubscription,
|
|
58
59
|
} from "./plugin-methods.ts";
|
|
@@ -258,6 +259,7 @@ export function createSubscriptionStripeFeature(
|
|
|
258
259
|
}),
|
|
259
260
|
createPortalSession: createStripePortalSession(runtimes.ctx),
|
|
260
261
|
cancelSubscription: createStripeCancelSubscription(runtimes.ctx),
|
|
262
|
+
resumeSubscription: createStripeResumeSubscription(runtimes.ctx),
|
|
261
263
|
priceToTier: options.priceToTier ?? {},
|
|
262
264
|
oneOffPriceIds: options.oneOffPriceIds ?? [],
|
|
263
265
|
isBillingEnabled: runtimes.ctx.isBillingEnabled,
|
|
@@ -219,6 +219,25 @@ export function createStripePortalSession(runtime: StripeCtxRuntime) {
|
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
+
// =============================================================================
|
|
223
|
+
// resumeSubscription
|
|
224
|
+
// =============================================================================
|
|
225
|
+
//
|
|
226
|
+
// Takes back a period-end cancel; the following `customer.subscription.updated`
|
|
227
|
+
// carries cancel_at null, which the projection stores as "renews".
|
|
228
|
+
|
|
229
|
+
export function createStripeResumeSubscription(runtime: StripeCtxRuntime) {
|
|
230
|
+
return async (
|
|
231
|
+
ctx: HandlerContext,
|
|
232
|
+
options: { readonly providerSubscriptionId: string },
|
|
233
|
+
): Promise<void> => {
|
|
234
|
+
const stripe = await runtime.clientForCtx(ctx);
|
|
235
|
+
await stripe.subscriptions.update(options.providerSubscriptionId, {
|
|
236
|
+
cancel_at_period_end: false,
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
222
241
|
// =============================================================================
|
|
223
242
|
// cancelSubscription
|
|
224
243
|
// =============================================================================
|
|
@@ -176,6 +176,7 @@ export function verifyAndParseStripeWebhook(
|
|
|
176
176
|
...(consentId !== undefined && { consentId }),
|
|
177
177
|
providerCustomerId: typeof sub.customer === "string" ? sub.customer : sub.customer.id,
|
|
178
178
|
providerSubscriptionId: sub.id,
|
|
179
|
+
providerEventAt: Temporal.Instant.fromEpochMilliseconds(event.created * 1000).toString(),
|
|
179
180
|
...state,
|
|
180
181
|
};
|
|
181
182
|
};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.379.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "assign-tag and delete-tag no longer race",
|
|
6
|
+
"detail": "Re-assigning a tag after it was deleted no longer restores the assignment of a gone tag. assign-tag and delete-tag now take the same per-tag advisory lock, so a parallel assign can no longer leave an assignment for a deleted tag."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.370.0",
|
|
4
10
|
"type": "breaking",
|
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
type FeatureRegistrar,
|
|
29
29
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
30
30
|
import { assertNoWhereRuleInOwnershipWrite } from "../shared/index.ts";
|
|
31
|
-
import { DEFAULT_TAG_ACCESS, TAGS_FEATURE_NAME } from "./constants.ts";
|
|
32
31
|
import { createTagAssignmentEntity, tagEntity } from "./entity.ts";
|
|
33
32
|
import { createTagAssignmentExecutor } from "./executor.ts";
|
|
34
33
|
import { createAssignTagHandler } from "./handlers/assign-tag.write.ts";
|
|
@@ -38,6 +37,7 @@ import { createRemoveTagHandler } from "./handlers/remove-tag.write.ts";
|
|
|
38
37
|
import { createUpdateTagHandler } from "./handlers/update-tag.write.ts";
|
|
39
38
|
import { TAGS_FEATURE_I18N } from "./i18n.ts";
|
|
40
39
|
import { createTagEditScreen, createTagListScreen } from "./screens.ts";
|
|
40
|
+
import { DEFAULT_TAG_ACCESS, TAGS_FEATURE_NAME } from "./web/constants.ts";
|
|
41
41
|
|
|
42
42
|
// Opt-in tier-gating: when set, the feature declares itself r.toggleable so the
|
|
43
43
|
// dispatcher gate + feature-toggles + tier-engine can switch the WHOLE feature
|
|
@@ -3,9 +3,9 @@ import { NotFoundError, writeFailure } from "@cosmicdrift/kumiko-framework/error
|
|
|
3
3
|
import { isPlainObject } from "@cosmicdrift/kumiko-types/type-guards";
|
|
4
4
|
import { denyUnlessJoinRowParentVisible } from "../../shared/index.ts";
|
|
5
5
|
import { tagAssignmentAggregateId } from "../aggregate-id.ts";
|
|
6
|
-
import { DEFAULT_TAG_ACCESS } from "../constants.ts";
|
|
7
6
|
import { tagAssignmentExecutor, tagExecutor } from "../executor.ts";
|
|
8
7
|
import { type AssignTagPayload, assignTagPayloadSchema } from "../schemas.ts";
|
|
8
|
+
import { DEFAULT_TAG_ACCESS, TAG_LOCK_NAMESPACE } from "../web/constants.ts";
|
|
9
9
|
|
|
10
10
|
// assign-tag — links a tag to a host entity by (entityType, entityId). The
|
|
11
11
|
// assignment id is deterministic, so the row is unique per (tag, entity).
|
|
@@ -20,9 +20,9 @@ import { type AssignTagPayload, assignTagPayloadSchema } from "../schemas.ts";
|
|
|
20
20
|
// create(), the loser's create() version_conflicts, and the handler treats
|
|
21
21
|
// that as success since the winner already wrote the desired end state.
|
|
22
22
|
//
|
|
23
|
-
// Referential integrity: there is no FK (event-sourced, no JOIN), so
|
|
24
|
-
//
|
|
25
|
-
//
|
|
23
|
+
// Referential integrity: there is no FK (event-sourced, no JOIN), so we verify
|
|
24
|
+
// the tag exists in the catalog before any restore/create — otherwise a call
|
|
25
|
+
// racing delete-tag would resurrect or project an assignment for a gone tag.
|
|
26
26
|
//
|
|
27
27
|
// Host reference: entityType/entityId are never trusted client input either —
|
|
28
28
|
// the aggregate-id is tenant-scoped, so this is not a cross-tenant hole, but
|
|
@@ -49,6 +49,13 @@ export function createAssignTagHandler(
|
|
|
49
49
|
);
|
|
50
50
|
if (denied) return denied;
|
|
51
51
|
|
|
52
|
+
// Same lock as delete-tag: the existence check below and the assignment
|
|
53
|
+
// write must not interleave with a delete-tag cascade, or the cascade
|
|
54
|
+
// misses the new assignment and leaves an orphan.
|
|
55
|
+
await ctx.db.advisoryXactLock(TAG_LOCK_NAMESPACE, payload.tagId);
|
|
56
|
+
const tag = await tagExecutor.detail({ id: payload.tagId }, event.user, ctx.db);
|
|
57
|
+
if (!tag) return writeFailure(new NotFoundError("tag", payload.tagId));
|
|
58
|
+
|
|
52
59
|
const id = tagAssignmentAggregateId(
|
|
53
60
|
event.user.tenantId,
|
|
54
61
|
payload.tagId,
|
|
@@ -76,9 +83,6 @@ export function createAssignTagHandler(
|
|
|
76
83
|
}
|
|
77
84
|
if (restored.error.code !== "not_found") return restored;
|
|
78
85
|
|
|
79
|
-
const tag = await tagExecutor.detail({ id: payload.tagId }, event.user, ctx.db);
|
|
80
|
-
if (!tag) return writeFailure(new NotFoundError("tag", payload.tagId));
|
|
81
|
-
|
|
82
86
|
const created = await assignmentExecutor.create(
|
|
83
87
|
{
|
|
84
88
|
id,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AccessRule, WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { DEFAULT_TAG_ACCESS } from "../constants.ts";
|
|
3
2
|
import { tagExecutor } from "../executor.ts";
|
|
4
3
|
import { type CreateTagPayload, createTagPayloadSchema } from "../schemas.ts";
|
|
4
|
+
import { DEFAULT_TAG_ACCESS } from "../web/constants.ts";
|
|
5
5
|
|
|
6
6
|
// create-tag — adds a tag to the tenant's catalog. The framework mints a fresh
|
|
7
7
|
// UUIDv7 id (no explicit id passed). Tag names are not unique by design: the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AccessRule, WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { DEFAULT_TAG_ACCESS } from "../constants.ts";
|
|
3
2
|
import { tagAssignmentExecutor, tagExecutor } from "../executor.ts";
|
|
4
3
|
import { type DeleteTagPayload, deleteTagPayloadSchema } from "../schemas.ts";
|
|
4
|
+
import { DEFAULT_TAG_ACCESS, TAG_LOCK_NAMESPACE } from "../web/constants.ts";
|
|
5
5
|
|
|
6
6
|
const CASCADE_PAGE = 200;
|
|
7
7
|
|
|
@@ -30,6 +30,9 @@ export function createDeleteTagHandler(
|
|
|
30
30
|
handler: async (event, ctx) => {
|
|
31
31
|
const payload = event.payload as DeleteTagPayload; // @cast-boundary engine-payload
|
|
32
32
|
|
|
33
|
+
// Serialises with assign-tag (see there): the cascade must see every
|
|
34
|
+
// assignment that a concurrent assign-tag committed before the tag goes.
|
|
35
|
+
await ctx.db.advisoryXactLock(TAG_LOCK_NAMESPACE, payload.id);
|
|
33
36
|
const existing = await tagExecutor.detail({ id: payload.id }, event.user, ctx.db);
|
|
34
37
|
if (!existing) {
|
|
35
38
|
return { isSuccess: true as const, data: { id: payload.id } };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AccessRule, WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { denyUnlessJoinRowParentVisible } from "../../shared/index.ts";
|
|
3
3
|
import { tagAssignmentAggregateId } from "../aggregate-id.ts";
|
|
4
|
-
import { DEFAULT_TAG_ACCESS } from "../constants.ts";
|
|
5
4
|
import { tagAssignmentExecutor } from "../executor.ts";
|
|
6
5
|
import { type RemoveTagPayload, removeTagPayloadSchema } from "../schemas.ts";
|
|
6
|
+
import { DEFAULT_TAG_ACCESS } from "../web/constants.ts";
|
|
7
7
|
|
|
8
8
|
// remove-tag — unlinks a tag from a host entity. Idempotent: removing an
|
|
9
9
|
// assignment that doesn't exist is already the requested end state (not
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AccessRule, WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { DEFAULT_TAG_ACCESS } from "../constants.ts";
|
|
3
2
|
import { tagExecutor } from "../executor.ts";
|
|
4
3
|
import { type UpdateTagPayload, updateTagPayloadSchema } from "../schemas.ts";
|
|
4
|
+
import { DEFAULT_TAG_ACCESS } from "../web/constants.ts";
|
|
5
5
|
|
|
6
6
|
// update-tag — edits a catalog tag (rename / recolor / re-scope). Optimistic-
|
|
7
7
|
// locked: the client sends the `version` it read (mirrors tenant:update). Only
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
export { tagAssignmentAggregateId } from "./aggregate-id.ts";
|
|
2
|
-
export {
|
|
3
|
-
DEFAULT_TAG_ACCESS,
|
|
4
|
-
DEFAULT_TAG_ROLES,
|
|
5
|
-
TAGS_COLUMN_RENDERER_NAME,
|
|
6
|
-
TAGS_EDIT_SCREEN_ID,
|
|
7
|
-
TAGS_FEATURE_NAME,
|
|
8
|
-
TAGS_FILTER_EXTENSION_NAME,
|
|
9
|
-
TAGS_SCREEN_ID,
|
|
10
|
-
TAGS_SECTION_EXTENSION_NAME,
|
|
11
|
-
TagsHandlers,
|
|
12
|
-
TagsQueries,
|
|
13
|
-
} from "./constants.ts";
|
|
14
2
|
export { tagAssignmentEntity, tagEntity } from "./entity.ts";
|
|
15
3
|
export { createTagsFeature, type TagsFeatureOptions } from "./feature.ts";
|
|
16
4
|
export {
|
|
@@ -46,3 +34,15 @@ export {
|
|
|
46
34
|
updateTagPayloadSchema,
|
|
47
35
|
} from "./schemas.ts";
|
|
48
36
|
export { createTagEditScreen, createTagListScreen } from "./screens.ts";
|
|
37
|
+
export {
|
|
38
|
+
DEFAULT_TAG_ACCESS,
|
|
39
|
+
DEFAULT_TAG_ROLES,
|
|
40
|
+
TAGS_COLUMN_RENDERER_NAME,
|
|
41
|
+
TAGS_EDIT_SCREEN_ID,
|
|
42
|
+
TAGS_FEATURE_NAME,
|
|
43
|
+
TAGS_FILTER_EXTENSION_NAME,
|
|
44
|
+
TAGS_SCREEN_ID,
|
|
45
|
+
TAGS_SECTION_EXTENSION_NAME,
|
|
46
|
+
TagsHandlers,
|
|
47
|
+
TagsQueries,
|
|
48
|
+
} from "./web/constants.ts";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type EntityListScreenDefinition,
|
|
5
5
|
i18nKey,
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
-
import { DEFAULT_TAG_ACCESS, TAGS_EDIT_SCREEN_ID, TAGS_SCREEN_ID } from "./constants.ts";
|
|
7
|
+
import { DEFAULT_TAG_ACCESS, TAGS_EDIT_SCREEN_ID, TAGS_SCREEN_ID } from "./web/constants.ts";
|
|
8
8
|
|
|
9
9
|
// Declarative catalog screens (Phase-3 / #2312). Access matches create/update/
|
|
10
10
|
// delete so createTagsFeature({ access|roles }) stays consistent. TagManager
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
// @runtime client
|
|
2
|
-
|
|
3
1
|
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
4
2
|
import {
|
|
5
3
|
TAGS_COLUMN_RENDERER_NAME,
|
|
6
4
|
TAGS_FEATURE_NAME,
|
|
7
5
|
TAGS_FILTER_EXTENSION_NAME,
|
|
8
6
|
TAGS_SECTION_EXTENSION_NAME,
|
|
9
|
-
} from "
|
|
7
|
+
} from "./constants.ts";
|
|
10
8
|
import { defaultTranslations } from "./i18n.ts";
|
|
11
9
|
import { TagFilter } from "./tag-filter.tsx";
|
|
12
10
|
import { TagSection } from "./tag-section.tsx";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// tags bundle constants — feature-name + qualified handler/query names.
|
|
3
2
|
//
|
|
4
3
|
// Spec: kumiko-platform/docs/plans/features/tags.md
|
|
@@ -59,3 +58,7 @@ export const DEFAULT_TAG_ROLES = ["TenantAdmin", "TenantMember"] as const;
|
|
|
59
58
|
// makes tagging reachable for any authenticated tenant user — matching apps
|
|
60
59
|
// whose other handlers are openToAll rather than role-gated.
|
|
61
60
|
export const DEFAULT_TAG_ACCESS: AccessRule = { roles: DEFAULT_TAG_ROLES };
|
|
61
|
+
|
|
62
|
+
// Advisory-lock namespace serialising assign-tag against delete-tag per tag id
|
|
63
|
+
// (no FK in the event-sourced catalog, so the DB cannot guard the orphan race).
|
|
64
|
+
export const TAG_LOCK_NAMESPACE = 0x74_61_67_73; // 'tags'
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// EntityTags — read-only colored tag row for ANY entity. Drop it on a card or
|
|
3
2
|
// detail view: <EntityTags entityName="note" entityId={id} />. Loads the
|
|
4
3
|
// catalog (for name+color) and the entity's assignments, renders a TagChip per
|
|
@@ -6,7 +5,7 @@
|
|
|
6
5
|
|
|
7
6
|
import { useQuery } from "@cosmicdrift/kumiko-renderer";
|
|
8
7
|
import type { ReactNode } from "react";
|
|
9
|
-
import { TagsQueries } from "
|
|
8
|
+
import { TagsQueries } from "./constants.ts";
|
|
10
9
|
import { TagChip } from "./tag-chip.tsx";
|
|
11
10
|
|
|
12
11
|
type TagRow = { readonly id: string; readonly name: string; readonly color?: string | null };
|