@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { FORM_DRAFT_ACCESS } from "../constants.ts";
|
|
3
2
|
import { lookupDraft } from "../lookup.ts";
|
|
4
3
|
import type { FormDraftBlob } from "../schemas.ts";
|
|
5
|
-
import {
|
|
4
|
+
import { getDraftPayloadSchema } from "../schemas.ts";
|
|
5
|
+
import { FORM_DRAFT_ACCESS } from "../web/constants.ts";
|
|
6
6
|
|
|
7
7
|
export type GetDraftResult = { readonly draft: FormDraftBlob | null };
|
|
8
8
|
|
|
@@ -24,15 +24,14 @@ export const getDraftQuery = defineQueryHandler({
|
|
|
24
24
|
query.payload.draftKey,
|
|
25
25
|
);
|
|
26
26
|
if (!row) return { draft: null };
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// Schema evolution or a corrupt jsonb row: surface it to operators
|
|
27
|
+
if (!row.draft) {
|
|
28
|
+
// Schema evolution or a corrupt/erased row: surface it to operators
|
|
30
29
|
// instead of silently making the user's draft vanish.
|
|
31
30
|
ctx.log?.warn?.(
|
|
32
|
-
`[form-draft:get] stored blob for draftKey=${query.payload.draftKey} failed schema, treating as absent
|
|
31
|
+
`[form-draft:get] stored blob for draftKey=${query.payload.draftKey} failed schema or decryption, treating as absent`,
|
|
33
32
|
);
|
|
34
33
|
return { draft: null };
|
|
35
34
|
}
|
|
36
|
-
return { draft:
|
|
35
|
+
return { draft: row.draft };
|
|
37
36
|
},
|
|
38
37
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { FORM_DRAFT_ACCESS } from "../constants.ts";
|
|
3
2
|
import { listDraftsByScreen } from "../lookup.ts";
|
|
4
3
|
import { listDraftsPayloadSchema } from "../schemas.ts";
|
|
4
|
+
import { FORM_DRAFT_ACCESS } from "../web/constants.ts";
|
|
5
5
|
|
|
6
6
|
export type ListDraftsResult = {
|
|
7
7
|
readonly drafts: readonly {
|
|
@@ -39,12 +39,18 @@ export const listDraftsQuery = defineQueryHandler({
|
|
|
39
39
|
query.payload.screenId,
|
|
40
40
|
);
|
|
41
41
|
const drafts = rows
|
|
42
|
-
.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
.flatMap((row) =>
|
|
43
|
+
row.draft
|
|
44
|
+
? [
|
|
45
|
+
{
|
|
46
|
+
id: row.id,
|
|
47
|
+
draftKey: row.draftKey,
|
|
48
|
+
stepIndex: row.draft.stepIndex,
|
|
49
|
+
savedAt: row.draft.savedAt,
|
|
50
|
+
},
|
|
51
|
+
]
|
|
52
|
+
: [],
|
|
53
|
+
)
|
|
48
54
|
.sort(byNewestFirst)
|
|
49
55
|
// Matches listDraftsByScreen selectMany limit — JS sort cannot push the
|
|
50
56
|
// ceiling into SQL while savedAt lives inside jsonb.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { failUnprocessable, type WriteFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
3
|
import { getTemporal } from "@cosmicdrift/kumiko-framework/time";
|
|
4
|
-
import {
|
|
5
|
-
FORM_DRAFT_ACCESS,
|
|
6
|
-
FORM_DRAFT_MAX_PER_OWNER,
|
|
7
|
-
FORM_DRAFT_UNIQUE_KEY_CONSTRAINT,
|
|
8
|
-
} from "../constants.ts";
|
|
9
4
|
import { countDraftsByOwner } from "../db/queries/draft-count.ts";
|
|
10
5
|
import { formDraftExecutor } from "../executor.ts";
|
|
11
6
|
import { lookupDraft } from "../lookup.ts";
|
|
12
7
|
import { saveDraftPayloadSchema } from "../schemas.ts";
|
|
8
|
+
import {
|
|
9
|
+
FORM_DRAFT_ACCESS,
|
|
10
|
+
FORM_DRAFT_MAX_PER_OWNER,
|
|
11
|
+
FORM_DRAFT_UNIQUE_KEY_CONSTRAINT,
|
|
12
|
+
} from "../web/constants.ts";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* save is an upsert keyed on (tenantId, ownerId, draftKey) — same
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
FORM_DRAFT_ACCESS,
|
|
3
|
-
FORM_DRAFT_FEATURE_NAME,
|
|
4
|
-
FORM_DRAFT_KEY_MAX_LENGTH,
|
|
5
|
-
FORM_DRAFT_UNIQUE_KEY_CONSTRAINT,
|
|
6
|
-
FormDraftHandlers,
|
|
7
|
-
FormDraftQueries,
|
|
8
|
-
} from "./constants.ts";
|
|
9
1
|
export { formDraftEntity } from "./entity.ts";
|
|
10
2
|
export { formDraftExecutor, formDraftTable } from "./executor.ts";
|
|
11
3
|
export { createFormDraftFeature } from "./feature.ts";
|
|
@@ -26,3 +18,11 @@ export {
|
|
|
26
18
|
type SaveDraftPayload,
|
|
27
19
|
saveDraftPayloadSchema,
|
|
28
20
|
} from "./schemas.ts";
|
|
21
|
+
export {
|
|
22
|
+
FORM_DRAFT_ACCESS,
|
|
23
|
+
FORM_DRAFT_FEATURE_NAME,
|
|
24
|
+
FORM_DRAFT_KEY_MAX_LENGTH,
|
|
25
|
+
FORM_DRAFT_UNIQUE_KEY_CONSTRAINT,
|
|
26
|
+
FormDraftHandlers,
|
|
27
|
+
FormDraftQueries,
|
|
28
|
+
} from "./web/constants.ts";
|
|
@@ -2,13 +2,14 @@ import type { TenantDb } from "@cosmicdrift/kumiko-framework/db";
|
|
|
2
2
|
import { fetchOne, selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
4
|
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
5
|
+
import { readStoredDraft } from "./decrypt-draft.ts";
|
|
5
6
|
import { formDraftTable } from "./executor.ts";
|
|
6
7
|
import type { FormDraftBlob } from "./schemas.ts";
|
|
7
8
|
|
|
8
9
|
export type FormDraftRow = {
|
|
9
10
|
readonly id: string;
|
|
10
11
|
readonly version: number;
|
|
11
|
-
readonly draft: FormDraftBlob;
|
|
12
|
+
readonly draft: FormDraftBlob | null;
|
|
12
13
|
readonly insertedAt: Temporal.Instant;
|
|
13
14
|
};
|
|
14
15
|
|
|
@@ -21,13 +22,15 @@ export async function lookupDraft(
|
|
|
21
22
|
ownerId: string,
|
|
22
23
|
draftKey: string,
|
|
23
24
|
): Promise<FormDraftRow | undefined> {
|
|
24
|
-
|
|
25
|
+
const row = await fetchOne<FormDraftRow>(db, formDraftTable, { tenantId, ownerId, draftKey });
|
|
26
|
+
if (!row) return undefined;
|
|
27
|
+
return { ...row, draft: await readStoredDraft(row.draft) };
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
export type FormDraftSummaryRow = {
|
|
28
31
|
readonly id: string;
|
|
29
32
|
readonly draftKey: string;
|
|
30
|
-
readonly draft: FormDraftBlob;
|
|
33
|
+
readonly draft: FormDraftBlob | null;
|
|
31
34
|
};
|
|
32
35
|
|
|
33
36
|
// LIKE metacharacters in a caller-controlled screenId must not widen the
|
|
@@ -49,7 +52,7 @@ export async function listDraftsByScreen(
|
|
|
49
52
|
): Promise<readonly FormDraftSummaryRow[]> {
|
|
50
53
|
// ponytail: hard cap — savedAt lives in jsonb so SQL ORDER BY+LIMIT is wrong;
|
|
51
54
|
// promote savedAt to a column when callers need correct newest-N under the ceiling.
|
|
52
|
-
|
|
55
|
+
const rows = await selectMany<FormDraftSummaryRow>(
|
|
53
56
|
db,
|
|
54
57
|
formDraftTable,
|
|
55
58
|
{
|
|
@@ -59,4 +62,7 @@ export async function listDraftsByScreen(
|
|
|
59
62
|
},
|
|
60
63
|
{ limit: 200 },
|
|
61
64
|
);
|
|
65
|
+
return Promise.all(
|
|
66
|
+
rows.map(async (row) => ({ ...row, draft: await readStoredDraft(row.draft) })),
|
|
67
|
+
);
|
|
62
68
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { FORM_DRAFT_KEY_MAX_LENGTH, FORM_DRAFT_VALUES_MAX_BYTES } from "./constants.ts";
|
|
2
|
+
import { FORM_DRAFT_KEY_MAX_LENGTH, FORM_DRAFT_VALUES_MAX_BYTES } from "./web/constants.ts";
|
|
3
3
|
|
|
4
4
|
const draftKeySchema = z.string().trim().min(1).max(FORM_DRAFT_KEY_MAX_LENGTH);
|
|
5
5
|
|
|
@@ -27,8 +27,8 @@ export const formDraftExportHook: UserDataExportHook = async (ctx) => {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
//
|
|
31
|
-
//
|
|
30
|
+
// Deletes the row through the event store; `draft` is ciphertext under the
|
|
31
|
+
// owner's key in the row and in every event (previous of the delete included).
|
|
32
32
|
// A drafted form is pure pre-submit scratch state with no value once the
|
|
33
33
|
// owner is gone, so both forget strategies (delete/anonymize) remove the
|
|
34
34
|
// row outright rather than anonymizing in place. Per-row via the executor
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.378.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "Mailbox list accepts the screen's limit",
|
|
6
|
+
"detail": "account:list accepted an empty payload only, so the projectionList screen's limit was rejected. It now takes limit up to MAX_LIST_LIMIT and returns the visible mailboxes ordered by id."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.377.0",
|
|
4
10
|
"type": "improvement",
|
package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-accounts.query.ts
CHANGED
|
@@ -11,13 +11,16 @@ import {
|
|
|
11
11
|
configuredPiiSubjectKms,
|
|
12
12
|
decryptPiiFieldValues,
|
|
13
13
|
} from "@cosmicdrift/kumiko-framework/crypto";
|
|
14
|
-
import type
|
|
14
|
+
import { MAX_LIST_LIMIT, type QueryHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
15
15
|
import * as z from "zod";
|
|
16
16
|
import { MAIL_ACCOUNT_PII_FIELDS } from "../entities.ts";
|
|
17
17
|
import { mailAccountsProjectionTable } from "../projection.ts";
|
|
18
18
|
import { isVisibleToCaller } from "./scope-visibility.ts";
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
// The projectionList screen always sends `limit`; unknown keys stay rejected.
|
|
21
|
+
const listAccountsSchema = z
|
|
22
|
+
.object({ limit: z.number().int().min(1).max(MAX_LIST_LIMIT).default(MAX_LIST_LIMIT) })
|
|
23
|
+
.strict();
|
|
21
24
|
|
|
22
25
|
export const listAccountsQuery: QueryHandlerDef = {
|
|
23
26
|
name: "account:list",
|
|
@@ -25,11 +28,15 @@ export const listAccountsQuery: QueryHandlerDef = {
|
|
|
25
28
|
access: { roles: ["SystemAdmin", "TenantAdmin", "User"] },
|
|
26
29
|
description:
|
|
27
30
|
"Lists the connected mailboxes of the caller's tenant with the mailbox address decrypted, hiding personal mailboxes the caller neither owns nor administers; use it for the mail connect and settings views.",
|
|
28
|
-
handler: async (
|
|
31
|
+
handler: async (query, ctx) => {
|
|
32
|
+
const { limit } = listAccountsSchema.parse(query.payload);
|
|
29
33
|
const allRows = await ctx.db.selectMany(mailAccountsProjectionTable, {
|
|
30
34
|
tenantId: ctx.user.tenantId,
|
|
31
35
|
});
|
|
32
|
-
const rows = allRows
|
|
36
|
+
const rows = allRows
|
|
37
|
+
.filter((row) => isVisibleToCaller(row, ctx.user))
|
|
38
|
+
.sort((a, b) => String(a["id"]).localeCompare(String(b["id"])))
|
|
39
|
+
.slice(0, limit);
|
|
33
40
|
const piiKms = configuredPiiSubjectKms();
|
|
34
41
|
if (!piiKms) return { rows };
|
|
35
42
|
const decryptedRows = await Promise.all(
|
|
@@ -24,14 +24,12 @@
|
|
|
24
24
|
// erst bei tenant-destroy (Key-Erase). Read-Row + Body-File sind nach dem
|
|
25
25
|
// Sweep weg; das Event-Log ist append-only by design.
|
|
26
26
|
|
|
27
|
-
import {
|
|
28
|
-
type DbRunner,
|
|
29
|
-
deleteMany,
|
|
30
|
-
type EntityTableMeta,
|
|
31
|
-
selectMany,
|
|
32
|
-
} from "@cosmicdrift/kumiko-framework/db";
|
|
27
|
+
import { type DbRunner, deleteMany, selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
33
28
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
34
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
archiveStream,
|
|
31
|
+
deleteRowsWithoutReplayableStream,
|
|
32
|
+
} from "@cosmicdrift/kumiko-framework/event-store";
|
|
35
33
|
import type { getTemporal } from "@cosmicdrift/kumiko-framework/time";
|
|
36
34
|
import { seenMessageTable } from "./entities.ts";
|
|
37
35
|
import { INBOUND_MESSAGE_AGGREGATE_TYPE } from "./events.ts";
|
|
@@ -136,10 +134,12 @@ async function purgeExpiredMessages(
|
|
|
136
134
|
ids.push(row.id);
|
|
137
135
|
}
|
|
138
136
|
if (ids.length > 0) {
|
|
139
|
-
await
|
|
140
|
-
|
|
137
|
+
const deleted = await deleteRowsWithoutReplayableStream(args.db, {
|
|
138
|
+
table: inboundMessagesProjectionTable,
|
|
139
|
+
ids,
|
|
140
|
+
tenantId: args.tenantId,
|
|
141
141
|
});
|
|
142
|
-
messagesPurged +=
|
|
142
|
+
messagesPurged += deleted.length;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
if (rows.length < BATCH_LIMIT) break;
|
|
@@ -3,12 +3,6 @@ import {
|
|
|
3
3
|
type FeatureDefinition,
|
|
4
4
|
i18nKey,
|
|
5
5
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
6
|
-
import {
|
|
7
|
-
JOB_RUN_DETAIL_SCREEN_ID,
|
|
8
|
-
JOB_RUNS_SCREEN_ID,
|
|
9
|
-
JobHandlers,
|
|
10
|
-
JobQueries,
|
|
11
|
-
} from "./constants.ts";
|
|
12
6
|
import { catalogQuery } from "./handlers/catalog.query.ts";
|
|
13
7
|
import { detailQuery } from "./handlers/detail.query.ts";
|
|
14
8
|
import { listQuery } from "./handlers/list.query.ts";
|
|
@@ -29,10 +23,16 @@ import {
|
|
|
29
23
|
import { tenantFailuresQuery } from "./handlers/tenant-failures.query.ts";
|
|
30
24
|
import { tenantRunsQuery } from "./handlers/tenant-runs.query.ts";
|
|
31
25
|
import { triggerWrite } from "./handlers/trigger.write.ts";
|
|
32
|
-
import { JOBS_I18N } from "./i18n.ts";
|
|
33
26
|
import { jobRunLogsTableMeta, jobRunsTableMeta } from "./job-run-table.ts";
|
|
34
27
|
import { tenantJobFailuresTableMeta } from "./tenant-job-failure-table.ts";
|
|
35
28
|
import { tenantJobRunsTableMeta } from "./tenant-job-run-table.ts";
|
|
29
|
+
import {
|
|
30
|
+
JOB_RUN_DETAIL_SCREEN_ID,
|
|
31
|
+
JOB_RUNS_SCREEN_ID,
|
|
32
|
+
JobHandlers,
|
|
33
|
+
JobQueries,
|
|
34
|
+
} from "./web/constants.ts";
|
|
35
|
+
import { JOBS_I18N } from "./web/i18n.ts";
|
|
36
36
|
|
|
37
37
|
export type JobsFeatureOptions = {
|
|
38
38
|
// How long a job run (and its logs) stays in store_job_runs/
|
|
@@ -11,8 +11,8 @@ import type { JobRunner } from "@cosmicdrift/kumiko-framework/jobs";
|
|
|
11
11
|
import { parseJsonOrThrow } from "@cosmicdrift/kumiko-framework/utils";
|
|
12
12
|
import * as z from "zod";
|
|
13
13
|
import { decryptStoredPii } from "../../shared/index.ts";
|
|
14
|
-
import { JobErrors } from "../constants.ts";
|
|
15
14
|
import { jobRunsTable } from "../job-run-table.ts";
|
|
15
|
+
import { JobErrors } from "../web/constants.ts";
|
|
16
16
|
|
|
17
17
|
type JobRunRow = {
|
|
18
18
|
readonly status: string;
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
} from "@cosmicdrift/kumiko-framework/errors";
|
|
9
9
|
import type { JobRunner } from "@cosmicdrift/kumiko-framework/jobs";
|
|
10
10
|
import * as z from "zod";
|
|
11
|
-
import { JobErrors } from "../constants.ts";
|
|
12
11
|
import { isManualTrigger } from "../is-manual-trigger.ts";
|
|
12
|
+
import { JobErrors } from "../web/constants.ts";
|
|
13
13
|
|
|
14
14
|
function invalidPayloadError(): UnprocessableError {
|
|
15
15
|
return new UnprocessableError(JobErrors.invalidPayload, {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { JOBS_FEATURE, JobErrors, JobHandlers, JobQueries } from "./constants.ts";
|
|
2
1
|
export { createJobsFeature, type JobsFeatureOptions } from "./feature.ts";
|
|
3
2
|
export type { JobRunLoggerCallbacks } from "./job-run-logger.ts";
|
|
4
3
|
export { createJobRunLogger } from "./job-run-logger.ts";
|
|
@@ -7,3 +6,4 @@ export { jobRunLogsTable, jobRunsTable } from "./job-run-table.ts";
|
|
|
7
6
|
export { tenantJobFailuresTable } from "./tenant-job-failure-table.ts";
|
|
8
7
|
export type { TenantJobRunStatus } from "./tenant-job-run-table.ts";
|
|
9
8
|
export { tenantJobRunsTable } from "./tenant-job-run-table.ts";
|
|
9
|
+
export { JOBS_FEATURE, JobErrors, JobHandlers, JobQueries } from "./web/constants.ts";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
import { mergeTranslations, type TranslationsByLocale } from "@cosmicdrift/kumiko-renderer";
|
|
3
2
|
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
4
|
-
import { JOBS_FEATURE } from "
|
|
5
|
-
import { defaultTranslations } from "./
|
|
3
|
+
import { JOBS_FEATURE } from "./constants.ts";
|
|
4
|
+
import { defaultTranslations } from "./default-translations.ts";
|
|
6
5
|
|
|
7
6
|
export type JobsClientOptions = {
|
|
8
7
|
readonly translations?: TranslationsByLocale;
|
|
@@ -1,8 +1,54 @@
|
|
|
1
|
-
//
|
|
2
|
-
import {
|
|
3
|
-
type TranslationsByLocale,
|
|
4
|
-
translationsByLocaleFromKeys,
|
|
5
|
-
} from "@cosmicdrift/kumiko-renderer";
|
|
6
|
-
import { JOBS_I18N } from "../i18n.ts";
|
|
1
|
+
// Server + client i18n for jobs operator screens.
|
|
7
2
|
|
|
8
|
-
|
|
3
|
+
type LocalizedString = { readonly en: string };
|
|
4
|
+
|
|
5
|
+
export const JOBS_I18N: Readonly<Record<string, LocalizedString>> = {
|
|
6
|
+
"screen:job-runs.title": { en: "Job runs" },
|
|
7
|
+
"screen:job-run-detail.title": { en: "Job run" },
|
|
8
|
+
"screen:job-trigger.title": { en: "Trigger job" },
|
|
9
|
+
"jobs.screen.job-trigger.subtitle": {
|
|
10
|
+
en: "Start a job manually by name, with an optional JSON payload.",
|
|
11
|
+
},
|
|
12
|
+
"jobs.screen.job-run-detail.subtitle": {
|
|
13
|
+
en: "Status, timings, error and log lines of one job run.",
|
|
14
|
+
},
|
|
15
|
+
"jobs:entity:__action-form__:field:jobName": { en: "Job name" },
|
|
16
|
+
"jobs:entity:__action-form__:field:payload": { en: "JSON payload" },
|
|
17
|
+
"jobs:nav.jobRuns": { en: "Jobs" },
|
|
18
|
+
"jobs.runs.open": { en: "Details" },
|
|
19
|
+
"jobs.runs.filter.status": { en: "Status" },
|
|
20
|
+
"jobs.runs.filter.completed": { en: "Completed" },
|
|
21
|
+
"jobs.runs.filter.failed": { en: "Failed" },
|
|
22
|
+
"jobs.runs.filter.running": { en: "Running" },
|
|
23
|
+
"jobs.runs.filter.queued": { en: "Queued" },
|
|
24
|
+
"jobs.runs.col.job": { en: "Job" },
|
|
25
|
+
"jobs.runs.col.status": { en: "Status" },
|
|
26
|
+
"jobs.runs.col.started": { en: "Started" },
|
|
27
|
+
"jobs.runs.col.duration": { en: "Duration (ms)" },
|
|
28
|
+
"jobs.detail.field.job": { en: "Job" },
|
|
29
|
+
"jobs.detail.field.status": { en: "Status" },
|
|
30
|
+
"jobs.detail.field.id": { en: "Run ID" },
|
|
31
|
+
"jobs.detail.field.started": { en: "Started" },
|
|
32
|
+
"jobs.detail.field.finished": { en: "Finished" },
|
|
33
|
+
"jobs.detail.field.duration": { en: "Duration (ms)" },
|
|
34
|
+
"jobs.detail.field.error": { en: "Error" },
|
|
35
|
+
"jobs.detail.logs": { en: "Logs" },
|
|
36
|
+
"jobs.detail.retry": { en: "Retry" },
|
|
37
|
+
"jobs.trigger.title": { en: "Run a job" },
|
|
38
|
+
"jobs.errors.invalidCursor": { en: "The pagination cursor is invalid." },
|
|
39
|
+
"jobs.trigger.submit": { en: "Run" },
|
|
40
|
+
"jobs.errors.unknownJob": { en: "Unknown job." },
|
|
41
|
+
"jobs.errors.notManual": {
|
|
42
|
+
en: "This job cannot be triggered manually.",
|
|
43
|
+
},
|
|
44
|
+
"jobs.errors.invalidPayload": {
|
|
45
|
+
en: "The payload must be a valid JSON object.",
|
|
46
|
+
},
|
|
47
|
+
"jobs.errors.notFound": { en: "Not found." },
|
|
48
|
+
"jobs.errors.onlyFailedCanRetry": {
|
|
49
|
+
en: "Only failed runs can be retried.",
|
|
50
|
+
},
|
|
51
|
+
"jobs.errors.payloadErased": {
|
|
52
|
+
en: "This run's payload can no longer be read — the triggering user's data was erased.",
|
|
53
|
+
},
|
|
54
|
+
};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.379.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "ledger confirm-schedule-period takes its lock through TenantDb",
|
|
6
|
+
"detail": "confirm-schedule-period serializes parallel confirms of one schedule period with ctx.db.advisoryXactLock instead of an unsafeRaw connection and an escapeHatch declaration. The lock key is unchanged (tenant id plus reference), so nothing changes for running installations.",
|
|
7
|
+
"migration": "None."
|
|
8
|
+
},
|
|
2
9
|
{
|
|
3
10
|
"version": "0.370.0",
|
|
4
11
|
"type": "breaking",
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
createSelectField,
|
|
8
8
|
createTextField,
|
|
9
9
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
10
|
-
import { ACCOUNT_TYPES, SCHEDULE_INTERVALS, TRANSACTION_STATUS } from "./constants.ts";
|
|
10
|
+
import { ACCOUNT_TYPES, SCHEDULE_INTERVALS, TRANSACTION_STATUS } from "./web/constants.ts";
|
|
11
11
|
|
|
12
12
|
// account — a node in the chart of accounts. Event-sourced (create/update/list/
|
|
13
13
|
// detail via the standard handlers); the framework projects `read_ledger_accounts`
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
defineFeature,
|
|
22
22
|
type FeatureRegistrar,
|
|
23
23
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
24
|
-
import { DEFAULT_LEDGER_ACCESS, LEDGER_FEATURE_NAME } from "./constants.ts";
|
|
25
24
|
import { accountEntity, scheduleEntity, transactionEntity } from "./entity.ts";
|
|
26
25
|
import { createConfirmSchedulePeriodHandler } from "./handlers/confirm-schedule-period.write.ts";
|
|
27
26
|
import { createCreateTransactionHandler } from "./handlers/create-transaction.write.ts";
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
} from "./handlers/reports.query.ts";
|
|
33
32
|
import { createReverseTransactionHandler } from "./handlers/reverse-transaction.write.ts";
|
|
34
33
|
import { requireScheduleSubjectPair } from "./schedule-subject-pair.ts";
|
|
34
|
+
import { DEFAULT_LEDGER_ACCESS, LEDGER_FEATURE_NAME } from "./web/constants.ts";
|
|
35
35
|
|
|
36
36
|
// Opt-in tier-gating (mirrors folders): when set, the feature declares itself
|
|
37
37
|
// r.toggleable so the dispatcher gate + tier-engine can switch the WHOLE ledger
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { acquireNamespacedAdvisoryLock } from "@cosmicdrift/kumiko-framework/db";
|
|
2
1
|
import type {
|
|
3
2
|
AccessRule,
|
|
4
3
|
WriteHandlerDef,
|
|
@@ -6,7 +5,6 @@ import type {
|
|
|
6
5
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
7
6
|
import { NotFoundError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
8
7
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
9
|
-
import { DEFAULT_LEDGER_ACCESS } from "../constants.ts";
|
|
10
8
|
import {
|
|
11
9
|
accountExecutor,
|
|
12
10
|
scheduleExecutor,
|
|
@@ -19,12 +17,11 @@ import {
|
|
|
19
17
|
confirmSchedulePeriodPayloadSchema,
|
|
20
18
|
} from "../schemas.ts";
|
|
21
19
|
import { readSubjectReference } from "../subject-reference.ts";
|
|
20
|
+
import { DEFAULT_LEDGER_ACCESS } from "../web/constants.ts";
|
|
22
21
|
|
|
23
22
|
// pg_advisory_xact_lock namespace (int4): 'lcsp' as ASCII, disjoint from the
|
|
24
23
|
// framework's other fixed advisory-lock keys.
|
|
25
24
|
const CONFIRM_PERIOD_LOCK_NAMESPACE = 0x6c637370;
|
|
26
|
-
const CONFIRM_PERIOD_LOCK_REASON =
|
|
27
|
-
"takes the per-(tenant, reference) advisory lock so parallel confirms cannot both pass the already-booked check; TenantDb has no lock API";
|
|
28
25
|
|
|
29
26
|
// confirm-schedule-period — turn ONE projected period of a schedule into a posted,
|
|
30
27
|
// balanced transaction (debit +amount / credit −amount), tagged with
|
|
@@ -42,7 +39,6 @@ export function createConfirmSchedulePeriodHandler(
|
|
|
42
39
|
name: "confirm-schedule-period",
|
|
43
40
|
schema: confirmSchedulePeriodPayloadSchema,
|
|
44
41
|
access,
|
|
45
|
-
escapeHatch: { grants: ["unsafeRaw"], reason: CONFIRM_PERIOD_LOCK_REASON },
|
|
46
42
|
description:
|
|
47
43
|
"Turns one month of a recurring schedule into a posted balanced entry between its debit and credit account, returning the existing booking instead when that period is already booked and not reversed; use it to move a forecast period into the actual books.",
|
|
48
44
|
handler: async (event, ctx) => {
|
|
@@ -78,11 +74,7 @@ export function createConfirmSchedulePeriodHandler(
|
|
|
78
74
|
// tx's `reference` names its id).
|
|
79
75
|
// No unique index on (tenantId, reference): a Storno makes re-confirming the
|
|
80
76
|
// same reference legitimate, so the check-then-write is serialized by a lock.
|
|
81
|
-
await
|
|
82
|
-
ctx.db.unsafeRaw(),
|
|
83
|
-
CONFIRM_PERIOD_LOCK_NAMESPACE,
|
|
84
|
-
`${event.user.tenantId}:${reference}`,
|
|
85
|
-
);
|
|
77
|
+
await ctx.db.advisoryXactLock(CONFIRM_PERIOD_LOCK_NAMESPACE, reference);
|
|
86
78
|
const candidates = await ctx.db.selectMany(transactionTable, {
|
|
87
79
|
tenantId: event.user.tenantId,
|
|
88
80
|
reference,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AccessRule, WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { NotFoundError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
3
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
4
|
-
import { DEFAULT_LEDGER_ACCESS } from "../constants.ts";
|
|
5
4
|
import { accountExecutor, transactionExecutor } from "../executor.ts";
|
|
6
5
|
import { type CreateTransactionPayload, createTransactionPayloadSchema } from "../schemas.ts";
|
|
6
|
+
import { DEFAULT_LEDGER_ACCESS } from "../web/constants.ts";
|
|
7
7
|
|
|
8
8
|
// create-transaction — books a balanced journal entry. The Σ=0 and ≥2-accounts
|
|
9
9
|
// invariants are enforced by createTransactionPayloadSchema (command boundary).
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AccessRule, QueryHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import { DEFAULT_LEDGER_ACCESS } from "../constants.ts";
|
|
4
3
|
import { accountTable, transactionTable } from "../executor.ts";
|
|
5
4
|
import {
|
|
6
5
|
accountBalances,
|
|
@@ -11,6 +10,7 @@ import {
|
|
|
11
10
|
toAccounts,
|
|
12
11
|
toEntries,
|
|
13
12
|
} from "../reports.ts";
|
|
13
|
+
import { DEFAULT_LEDGER_ACCESS } from "../web/constants.ts";
|
|
14
14
|
|
|
15
15
|
// Reports take an optional reporting period. Balance-sheet is cumulative → pass
|
|
16
16
|
// { to: asOf }; income-statement is a period → { from, to }.
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
writeFailure,
|
|
7
7
|
} from "@cosmicdrift/kumiko-framework/errors";
|
|
8
8
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
9
|
-
import { DEFAULT_LEDGER_ACCESS } from "../constants.ts";
|
|
10
9
|
import { transactionExecutor, transactionTable } from "../executor.ts";
|
|
11
10
|
import { normalizeLines } from "../reports.ts";
|
|
12
11
|
import { type ReverseTransactionPayload, reverseTransactionPayloadSchema } from "../schemas.ts";
|
|
13
12
|
import { readSubjectReference } from "../subject-reference.ts";
|
|
13
|
+
import { DEFAULT_LEDGER_ACCESS } from "../web/constants.ts";
|
|
14
14
|
|
|
15
15
|
// reverse-transaction (Storno) — the ONLY correction path for a posted entry.
|
|
16
16
|
// Books the mirror image (every amount negated) as a new posted entry that
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
ACCOUNT_TYPES,
|
|
3
|
-
type AccountType,
|
|
4
|
-
DEFAULT_LEDGER_ACCESS,
|
|
5
|
-
DEFAULT_LEDGER_ROLES,
|
|
6
|
-
LEDGER_FEATURE_NAME,
|
|
7
|
-
LedgerHandlers,
|
|
8
|
-
LedgerQueries,
|
|
9
|
-
SCHEDULE_INTERVALS,
|
|
10
|
-
type ScheduleInterval,
|
|
11
|
-
TRANSACTION_STATUS,
|
|
12
|
-
type TransactionStatus,
|
|
13
|
-
} from "./constants.ts";
|
|
14
1
|
export { accountEntity, scheduleEntity, transactionEntity } from "./entity.ts";
|
|
15
2
|
export {
|
|
16
3
|
createLedgerFeature,
|
|
@@ -68,3 +55,16 @@ export {
|
|
|
68
55
|
type ReverseTransactionPayload,
|
|
69
56
|
reverseTransactionPayloadSchema,
|
|
70
57
|
} from "./schemas.ts";
|
|
58
|
+
export {
|
|
59
|
+
ACCOUNT_TYPES,
|
|
60
|
+
type AccountType,
|
|
61
|
+
DEFAULT_LEDGER_ACCESS,
|
|
62
|
+
DEFAULT_LEDGER_ROLES,
|
|
63
|
+
LEDGER_FEATURE_NAME,
|
|
64
|
+
LedgerHandlers,
|
|
65
|
+
LedgerQueries,
|
|
66
|
+
SCHEDULE_INTERVALS,
|
|
67
|
+
type ScheduleInterval,
|
|
68
|
+
TRANSACTION_STATUS,
|
|
69
|
+
type TransactionStatus,
|
|
70
|
+
} from "./web/constants.ts";
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
// pure — no DB, no Date API (windows/asOf come in as params) — so the no-date-api
|
|
14
14
|
// guard stays green and the forecast is deterministic.
|
|
15
15
|
|
|
16
|
-
import type { ScheduleInterval } from "./constants.ts";
|
|
17
16
|
import type { Posting } from "./schemas.ts";
|
|
17
|
+
import type { ScheduleInterval } from "./web/constants.ts";
|
|
18
18
|
|
|
19
19
|
export type ScheduleDef = {
|
|
20
20
|
readonly startDate: string; // ISO; first period (day ignored for monthly)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseJsonSafe } from "@cosmicdrift/kumiko-framework/utils";
|
|
2
|
-
import type { AccountType } from "./constants.ts";
|
|
3
2
|
import type { Posting } from "./schemas.ts";
|
|
3
|
+
import type { AccountType } from "./web/constants.ts";
|
|
4
4
|
|
|
5
5
|
// Pure report aggregation over posted journal entries. No DB, no IO — the query
|
|
6
6
|
// handlers fetch accounts + transactions (selectMany) and feed them here, so the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { ACCOUNT_TYPES, TRANSACTION_STATUS } from "./constants.ts";
|
|
2
|
+
import { ACCOUNT_TYPES, TRANSACTION_STATUS } from "./web/constants.ts";
|
|
3
3
|
|
|
4
4
|
// A posting line. amount is integer minor units (cents), SIGNED: Soll/debit > 0,
|
|
5
5
|
// Haben/credit < 0. Integer → the balance check is exact (=== 0), no float epsilon.
|