@cosmicdrift/kumiko-bundled-features 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/dist/account-security/feature.js +2 -2
- package/dist/account-security/index.d.ts +2 -2
- package/dist/account-security/index.js +2 -2
- package/dist/account-security/{constants.js → web/constants.js} +0 -1
- package/dist/account-security/{i18n.js → web/i18n.js} +0 -1
- package/dist/admin-shell/feature.js +4 -3
- package/dist/admin-shell/index.d.ts +2 -2
- package/dist/admin-shell/index.js +2 -2
- package/dist/admin-shell/web/client-plugin.js +2 -3
- package/dist/admin-shell/{constants.js → web/constants.js} +0 -1
- package/dist/admin-shell/web/default-translations.d.ts +2 -0
- package/dist/admin-shell/web/default-translations.js +4 -0
- package/dist/admin-shell/web/i18n.d.ts +5 -2
- package/dist/admin-shell/web/i18n.js +50 -5
- package/dist/admin-shell/web/index.js +0 -1
- package/dist/audit/feature.js +58 -59
- package/dist/audit/handlers/audit-events.d.ts +102 -0
- package/dist/audit/handlers/audit-events.js +112 -0
- package/dist/audit/handlers/audit-system-db.d.ts +1 -0
- package/dist/audit/handlers/audit-system-db.js +9 -0
- package/dist/audit/handlers/details-all-tenants.query.d.ts +15 -0
- package/dist/audit/handlers/details-all-tenants.query.js +20 -0
- package/dist/audit/handlers/details.query.d.ts +2 -1
- package/dist/audit/handlers/details.query.js +8 -24
- package/dist/audit/handlers/list-all-tenants.query.d.ts +41 -0
- package/dist/audit/handlers/list-all-tenants.query.js +32 -0
- package/dist/audit/handlers/list.query.d.ts +2 -1
- package/dist/audit/handlers/list.query.js +9 -99
- package/dist/audit/handlers/resolve-audit-tenant.d.ts +3 -1
- package/dist/audit/handlers/resolve-audit-tenant.js +21 -7
- package/dist/audit/index.d.ts +1 -1
- package/dist/audit/index.js +1 -1
- package/dist/audit/run-escape-hatch-retention.js +1 -1
- package/dist/audit/screens.d.ts +65 -0
- package/dist/audit/screens.js +73 -0
- package/dist/audit/web/client-plugin.js +2 -3
- package/dist/audit/{constants.d.ts → web/constants.d.ts} +8 -0
- package/dist/audit/{constants.js → web/constants.js} +8 -1
- package/dist/audit/web/default-translations.d.ts +2 -0
- package/dist/audit/web/default-translations.js +3 -0
- package/dist/audit/web/i18n.d.ts +5 -2
- package/dist/audit/web/i18n.js +31 -4
- package/dist/audit/web/index.js +0 -1
- package/dist/auth-email-password/bootstrap.d.ts +1 -1
- package/dist/auth-email-password/bootstrap.js +4 -4
- package/dist/auth-email-password/errors.js +1 -1
- package/dist/auth-email-password/feature.js +2 -2
- package/dist/auth-email-password/handlers/confirm-account-unlock.write.js +1 -1
- package/dist/auth-email-password/handlers/invite-accept-with-login.write.js +1 -1
- package/dist/auth-email-password/handlers/invite-create.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/invite-create.write.js +3 -3
- package/dist/auth-email-password/handlers/invite-info.query.js +1 -1
- package/dist/auth-email-password/handlers/login.write.d.ts +1 -0
- package/dist/auth-email-password/handlers/login.write.js +26 -1
- package/dist/auth-email-password/handlers/request-account-unlock.write.js +1 -1
- package/dist/auth-email-password/handlers/request-email-verification.write.js +1 -1
- package/dist/auth-email-password/handlers/request-password-reset.write.js +1 -1
- package/dist/auth-email-password/handlers/reset-password.write.js +1 -1
- package/dist/auth-email-password/handlers/verify-email.write.js +1 -1
- package/dist/auth-email-password/index.d.ts +1 -1
- package/dist/auth-email-password/index.js +1 -1
- package/dist/auth-email-password/mail-notifications.js +1 -1
- package/dist/auth-email-password/signup-activation.js +1 -1
- package/dist/auth-email-password/web/auth-client.js +0 -1
- package/dist/auth-email-password/web/auth-form-logic.js +0 -1
- package/dist/auth-email-password/web/auth-form-primitives.js +0 -1
- package/dist/auth-email-password/web/auth-gate.js +0 -1
- package/dist/auth-email-password/web/auth-redirect.js +0 -1
- package/dist/auth-email-password/web/client-actions.js +0 -1
- package/dist/auth-email-password/web/client-plugin.js +1 -2
- package/dist/auth-email-password/web/confirm-account-unlock-screen.js +0 -1
- package/dist/auth-email-password/{constants.js → web/constants.js} +3 -6
- package/dist/auth-email-password/web/default-topbar-actions.js +0 -1
- package/dist/auth-email-password/web/forgot-password-screen.js +0 -1
- package/dist/auth-email-password/{i18n.js → web/i18n.js} +3 -4
- package/dist/auth-email-password/web/index.d.ts +1 -1
- package/dist/auth-email-password/web/index.js +1 -2
- package/dist/auth-email-password/web/invite-accept-screen.d.ts +2 -2
- package/dist/auth-email-password/web/invite-accept-screen.js +0 -1
- package/dist/auth-email-password/web/login-screen.js +0 -1
- package/dist/auth-email-password/{mail-i18n.js → web/mail-i18n.js} +0 -1
- package/dist/auth-email-password/web/request-account-unlock-screen.js +0 -1
- package/dist/auth-email-password/web/reset-password-screen.js +0 -1
- package/dist/auth-email-password/web/session-bootstrap-error.js +0 -1
- package/dist/auth-email-password/web/session.js +0 -1
- package/dist/auth-email-password/web/signup-complete-screen.d.ts +2 -2
- package/dist/auth-email-password/web/signup-complete-screen.js +0 -1
- package/dist/auth-email-password/web/signup-screen.js +0 -1
- package/dist/auth-email-password/web/tenant-menu-items.js +0 -1
- package/dist/auth-email-password/web/tenant-switcher.js +0 -1
- package/dist/auth-email-password/web/use-shell-user.js +0 -1
- package/dist/auth-email-password/web/user-menu.js +0 -1
- package/dist/auth-email-password/web/verify-email-screen.js +0 -1
- package/dist/auth-mfa/errors.d.ts +1 -1
- package/dist/auth-mfa/errors.js +2 -2
- package/dist/auth-mfa/handlers/enable-confirm-preauth.write.js +1 -1
- package/dist/auth-mfa/handlers/enable-start-preauth.write.js +1 -1
- package/dist/auth-mfa/handlers/enable-start.write.js +1 -1
- package/dist/auth-mfa/handlers/verify.write.js +1 -1
- package/dist/auth-mfa/index.d.ts +1 -1
- package/dist/auth-mfa/index.js +1 -1
- package/dist/auth-mfa/mfa-status-checker.js +1 -1
- package/dist/auth-mfa/screens.js +1 -1
- package/dist/auth-mfa/web/client-plugin.js +0 -1
- package/dist/auth-mfa/{constants.js → web/constants.js} +0 -1
- package/dist/auth-mfa/web/i18n.js +0 -1
- package/dist/auth-mfa/web/index.js +0 -1
- package/dist/auth-mfa/web/mfa-client.js +0 -1
- package/dist/auth-mfa/web/mfa-disable-dialog.js +1 -2
- package/dist/auth-mfa/web/mfa-recovery-codes-reveal.js +0 -1
- package/dist/auth-mfa/web/mfa-regenerate-recovery-dialog.js +1 -2
- package/dist/auth-mfa/web/mfa-setup-preauth-screen.js +11 -18
- package/dist/auth-mfa/web/mfa-verify-screen.js +0 -1
- package/dist/billing-foundation/checkout-core.js +1 -1
- package/dist/billing-foundation/consumer-protection/consent-text.d.ts +2 -2
- package/dist/billing-foundation/consumer-protection/consent-text.js +1 -1
- package/dist/billing-foundation/consumer-protection/issue-confirmation.js +7 -3
- package/dist/billing-foundation/consumer-protection/mail-notifications.js +3 -1
- package/dist/billing-foundation/consumer-protection/register-consent.js +1 -1
- package/dist/billing-foundation/consumer-protection/register-termination.js +8 -2
- package/dist/billing-foundation/consumer-protection/stored-user-email.d.ts +1 -0
- package/dist/billing-foundation/consumer-protection/stored-user-email.js +8 -0
- package/dist/billing-foundation/consumer-protection/termination-mail.d.ts +5 -1
- package/dist/billing-foundation/consumer-protection/termination-mail.js +3 -1
- package/dist/billing-foundation/consumer-protection/termination-notify.js +1 -1
- package/dist/billing-foundation/consumer-protection/termination-pages.js +109 -15
- package/dist/billing-foundation/consumer-protection/termination-record.d.ts +8 -1
- package/dist/billing-foundation/consumer-protection/termination-record.js +76 -3
- package/dist/billing-foundation/consumer-protection/termination-request.js +33 -6
- package/dist/billing-foundation/consumer-protection/termination-revoke.d.ts +28 -0
- package/dist/billing-foundation/consumer-protection/termination-revoke.js +149 -0
- package/dist/billing-foundation/consumer-protection/termination-texts.d.ts +17 -1
- package/dist/billing-foundation/consumer-protection/termination-texts.js +39 -0
- package/dist/billing-foundation/events.d.ts +9 -0
- package/dist/billing-foundation/events.js +14 -2
- package/dist/billing-foundation/feature.js +1 -1
- package/dist/billing-foundation/handlers/process-event.write.d.ts +5 -1
- package/dist/billing-foundation/handlers/process-event.write.js +57 -3
- package/dist/billing-foundation/handlers/switch-plan.write.js +1 -1
- package/dist/billing-foundation/handlers/sync-subscription.write.js +1 -1
- package/dist/billing-foundation/index.d.ts +2 -2
- package/dist/billing-foundation/index.js +2 -2
- package/dist/billing-foundation/plan-catalog.js +1 -1
- package/dist/billing-foundation/screens.js +1 -1
- package/dist/billing-foundation/subscription-tier-sync.js +1 -1
- package/dist/billing-foundation/types.d.ts +14 -2
- package/dist/billing-foundation/types.js +1 -1
- package/dist/billing-foundation/validate-options.js +3 -3
- package/dist/billing-foundation/web/billing-contact-plan.js +1 -2
- package/dist/billing-foundation/web/billing-plans-panel.js +1 -2
- package/dist/billing-foundation/web/cancel-contract-dialog.js +1 -2
- package/dist/billing-foundation/web/checkout-consent-dialog.js +1 -2
- package/dist/billing-foundation/web/client-plugin.js +1 -1
- package/dist/billing-foundation/{constants.d.ts → web/constants.d.ts} +21 -14
- package/dist/billing-foundation/{constants.js → web/constants.js} +35 -31
- package/dist/billing-foundation/{consumer-protection → web/consumer-protection}/consent-locale.js +0 -1
- package/dist/billing-foundation/{contact-card.js → web/contact-card.js} +0 -1
- package/dist/billing-foundation/web/index.d.ts +2 -2
- package/dist/billing-foundation/web/index.js +2 -3
- package/dist/billing-foundation/web/localized-params.js +0 -1
- package/dist/billing-foundation/webhook-handler.js +4 -1
- package/dist/cap-counter/stock-cap-guard.js +8 -0
- package/dist/cap-overview/feature.js +1 -1
- package/dist/cap-overview/handlers/caps-usage.query.js +1 -1
- package/dist/cap-overview/handlers/tenant-caps-list.query.js +2 -2
- package/dist/cap-overview/index.d.ts +2 -2
- package/dist/cap-overview/index.js +2 -2
- package/dist/cap-overview/screens.js +1 -1
- package/dist/cap-overview/web/cap-cards-panel.js +1 -1
- package/dist/cap-overview/web/cap-usage-bar.js +1 -2
- package/dist/cap-overview/web/client-plugin.js +1 -1
- package/dist/cap-overview/{constants.js → web/constants.js} +0 -1
- package/dist/cap-overview/web/index.js +0 -1
- package/dist/cap-overview/{usage-math.d.ts → web/usage-math.d.ts} +1 -1
- package/dist/compliance-profiles/feature.js +1 -1
- package/dist/compliance-profiles/index.d.ts +1 -1
- package/dist/compliance-profiles/index.js +1 -1
- package/dist/compliance-profiles/web/client-plugin.js +1 -2
- package/dist/compliance-profiles/web/compliance-profile-catalog.js +1 -2
- package/dist/compliance-profiles/{constants.js → web/constants.js} +0 -1
- package/dist/compliance-profiles/web/index.js +0 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/web/client-plugin.d.ts +1 -1
- package/dist/config/web/client-plugin.js +1 -2
- package/dist/config/{constants.js → web/constants.js} +0 -1
- package/dist/config/web/i18n.js +1 -1
- package/dist/config/web/index.d.ts +1 -1
- package/dist/config/web/index.js +1 -2
- package/dist/config/write-helpers.js +1 -1
- package/dist/custom-fields/feature.js +1 -1
- package/dist/custom-fields/handlers/clear-custom-field.write.js +1 -1
- package/dist/custom-fields/handlers/define-tenant-field.write.js +1 -1
- package/dist/custom-fields/handlers/delete-system-field.write.js +1 -1
- package/dist/custom-fields/handlers/delete-tenant-field.write.js +1 -1
- package/dist/custom-fields/handlers/set-custom-field.write.js +1 -1
- package/dist/custom-fields/handlers/update-tenant-field.write.js +1 -1
- package/dist/custom-fields/index.d.ts +1 -1
- package/dist/custom-fields/index.js +1 -1
- package/dist/custom-fields/lib/value-schema.js +1 -1
- package/dist/custom-fields/schemas.js +1 -1
- package/dist/custom-fields/web/client-plugin.js +1 -2
- package/dist/custom-fields/{constants.js → web/constants.js} +18 -19
- package/dist/custom-fields/web/custom-fields-form-section.js +1 -2
- package/dist/custom-fields/web/i18n.js +0 -1
- package/dist/custom-fields/web/index.d.ts +1 -1
- package/dist/custom-fields/web/index.js +1 -2
- package/dist/custom-fields/wire-for-entity.js +1 -1
- package/dist/delivery/address-opt-out.js +1 -1
- package/dist/delivery/attempt-log-retention.js +21 -3
- package/dist/delivery/constants.d.ts +1 -1
- package/dist/delivery/constants.js +2 -2
- package/dist/delivery/i18n.js +1 -1
- package/dist/delivery/unsubscribe-page.js +1 -1
- package/dist/delivery/web/client-plugin.js +1 -1
- package/dist/delivery/web/delivery-channel-cell.js +0 -1
- package/dist/delivery/web/delivery-error-cell.js +0 -1
- package/dist/delivery/web/delivery-status-cell.js +1 -2
- package/dist/delivery/web/delivery-time-cell.js +0 -1
- package/dist/delivery/web/delivery-type-cell.js +0 -1
- package/dist/delivery/web/index.js +0 -1
- package/dist/delivery/{public-names.js → web/public-names.js} +0 -1
- package/dist/document-ingest-foundation/events.d.ts +1 -0
- package/dist/document-ingest-foundation/events.js +3 -0
- package/dist/document-ingest-foundation/executor.js +2 -1
- package/dist/document-ingest-foundation/feature.js +16 -5
- package/dist/document-ingest-foundation/index.d.ts +1 -1
- package/dist/document-ingest-foundation/index.js +1 -1
- package/dist/feature-toggles/feature.d.ts +1 -1
- package/dist/feature-toggles/feature.js +2 -2
- package/dist/feature-toggles/handlers/list.query.js +1 -1
- package/dist/feature-toggles/handlers/registered.query.js +1 -1
- package/dist/feature-toggles/handlers/set.write.js +1 -1
- package/dist/feature-toggles/index.d.ts +1 -1
- package/dist/feature-toggles/index.js +1 -1
- package/dist/feature-toggles/web/client-plugin.js +1 -2
- package/dist/feature-toggles/{constants.js → web/constants.js} +0 -1
- package/dist/feature-toggles/web/index.js +0 -1
- package/dist/folders/feature.js +1 -1
- package/dist/folders/handlers/clear-folder.write.js +1 -1
- package/dist/folders/handlers/delete-folder.write.js +1 -1
- package/dist/folders/handlers/set-folder.write.js +1 -1
- package/dist/folders/index.d.ts +1 -1
- package/dist/folders/index.js +1 -1
- package/dist/folders/web/client-plugin.js +1 -2
- package/dist/folders/{constants.js → web/constants.js} +0 -1
- package/dist/folders/web/folder-manager.js +1 -2
- package/dist/folders/web/folder-section.js +1 -2
- package/dist/folders/web/i18n.js +0 -1
- package/dist/folders/web/index.d.ts +1 -1
- package/dist/folders/web/index.js +1 -2
- package/dist/folders/web/tree.js +0 -1
- package/dist/form-draft/db/queries/cleanup.d.ts +3 -2
- package/dist/form-draft/db/queries/cleanup.js +18 -9
- package/dist/form-draft/decrypt-draft.d.ts +2 -0
- package/dist/form-draft/decrypt-draft.js +19 -0
- package/dist/form-draft/entity.js +6 -9
- package/dist/form-draft/feature.js +1 -1
- package/dist/form-draft/handlers/cleanup.job.d.ts +1 -0
- package/dist/form-draft/handlers/cleanup.job.js +17 -4
- package/dist/form-draft/handlers/discard.write.js +1 -1
- package/dist/form-draft/handlers/get.query.js +6 -7
- package/dist/form-draft/handlers/list.query.js +11 -7
- package/dist/form-draft/handlers/save.write.js +1 -1
- package/dist/form-draft/index.d.ts +1 -1
- package/dist/form-draft/index.js +1 -1
- package/dist/form-draft/lookup.d.ts +2 -2
- package/dist/form-draft/lookup.js +7 -2
- package/dist/form-draft/schemas.js +1 -1
- package/dist/form-draft/{constants.js → web/constants.js} +0 -1
- package/dist/form-draft-user-data/hooks.js +2 -2
- package/dist/inbound-mail-foundation/handlers/list-accounts.query.d.ts +1 -1
- package/dist/inbound-mail-foundation/handlers/list-accounts.query.js +11 -3
- package/dist/inbound-mail-foundation/retention-sweep.js +7 -5
- package/dist/jobs/feature.js +2 -2
- package/dist/jobs/handlers/retry.write.js +1 -1
- package/dist/jobs/handlers/trigger.write.js +1 -1
- package/dist/jobs/index.d.ts +1 -1
- package/dist/jobs/index.js +1 -1
- package/dist/jobs/web/client-plugin.js +2 -3
- package/dist/jobs/{constants.js → web/constants.js} +0 -1
- package/dist/jobs/web/default-translations.d.ts +2 -0
- package/dist/jobs/web/default-translations.js +3 -0
- package/dist/jobs/web/i18n.d.ts +5 -2
- package/dist/jobs/web/i18n.js +51 -4
- package/dist/jobs/web/index.js +0 -1
- package/dist/ledger/entity.d.ts +1 -1
- package/dist/ledger/entity.js +1 -1
- package/dist/ledger/feature.js +1 -1
- package/dist/ledger/handlers/confirm-schedule-period.write.js +2 -5
- package/dist/ledger/handlers/create-transaction.write.js +1 -1
- package/dist/ledger/handlers/reports.query.js +1 -1
- package/dist/ledger/handlers/reverse-transaction.write.js +1 -1
- package/dist/ledger/index.d.ts +1 -1
- package/dist/ledger/index.js +1 -1
- package/dist/ledger/recurring.d.ts +1 -1
- package/dist/ledger/reports.d.ts +1 -1
- package/dist/ledger/schemas.js +1 -1
- package/dist/ledger/{constants.js → web/constants.js} +0 -1
- package/dist/ledger/web/index.d.ts +1 -1
- package/dist/ledger/web/index.js +1 -2
- package/dist/legal-pages/feature.d.ts +1 -1
- package/dist/legal-pages/feature.js +1 -1
- package/dist/legal-pages/index.d.ts +1 -1
- package/dist/legal-pages/index.js +1 -1
- package/dist/legal-pages/lib/boot-check.d.ts +1 -1
- package/dist/legal-pages/lib/boot-check.js +1 -1
- package/dist/legal-pages/lib/validate-routes.d.ts +1 -1
- package/dist/legal-pages/web/client-plugin.js +1 -2
- package/dist/legal-pages/{constants.js → web/constants.js} +6 -8
- package/dist/legal-pages/web/index.js +0 -1
- package/dist/mail-foundation/i18n.d.ts +5 -2
- package/dist/mail-foundation/i18n.js +3 -2
- package/dist/mail-transport-smtp/i18n.d.ts +1 -1
- package/dist/mail-transport-smtp/i18n.js +1 -1
- package/dist/managed-pages/feature.js +1 -1
- package/dist/managed-pages/web/client-plugin.js +1 -2
- package/dist/managed-pages/web/default-translations.d.ts +2 -0
- package/dist/managed-pages/web/default-translations.js +11 -0
- package/dist/managed-pages/web/i18n.d.ts +5 -2
- package/dist/managed-pages/web/i18n.js +53 -12
- package/dist/managed-pages/web/index.d.ts +1 -1
- package/dist/managed-pages/web/index.js +1 -2
- package/dist/metrics/compute.d.ts +1 -1
- package/dist/metrics/compute.js +1 -1
- package/dist/metrics/feature.js +1 -1
- package/dist/metrics/index.d.ts +1 -1
- package/dist/metrics/index.js +1 -1
- package/dist/metrics/types.d.ts +1 -1
- package/dist/metrics/validate.js +1 -1
- package/dist/metrics/{constants.js → web/constants.js} +0 -1
- package/dist/metrics/window.d.ts +1 -1
- package/dist/notes-history/feature.js +1 -1
- package/dist/notes-history/handlers/add-note.write.js +1 -1
- package/dist/notes-history/index.d.ts +1 -1
- package/dist/notes-history/index.js +1 -1
- package/dist/notes-history/web/client-plugin.js +1 -2
- package/dist/notes-history/{constants.js → web/constants.js} +0 -1
- package/dist/notes-history/web/i18n.js +0 -1
- package/dist/notes-history/web/index.d.ts +1 -1
- package/dist/notes-history/web/index.js +1 -2
- package/dist/notes-history/web/notes-section.js +2 -3
- package/dist/personal-access-tokens/feature.d.ts +2 -2
- package/dist/personal-access-tokens/feature.js +6 -4
- package/dist/personal-access-tokens/handlers/available-scopes.query.d.ts +1 -1
- package/dist/personal-access-tokens/handlers/create.write.js +1 -1
- package/dist/personal-access-tokens/handlers/revoke.write.js +1 -1
- package/dist/personal-access-tokens/hash.js +1 -1
- package/dist/personal-access-tokens/i18n.d.ts +1 -1
- package/dist/personal-access-tokens/i18n.js +1 -1
- package/dist/personal-access-tokens/index.d.ts +5 -5
- package/dist/personal-access-tokens/index.js +3 -3
- package/dist/personal-access-tokens/resolver.d.ts +1 -1
- package/dist/personal-access-tokens/resolver.js +1 -1
- package/dist/personal-access-tokens/schema/api-token.js +1 -1
- package/dist/personal-access-tokens/screens.d.ts +1 -1
- package/dist/personal-access-tokens/screens.js +1 -1
- package/dist/personal-access-tokens/{constants.js → web/constants.js} +0 -1
- package/dist/presets/index.d.ts +0 -1
- package/dist/presets/index.js +0 -1
- package/dist/presets/security-baseline.d.ts +1 -1
- package/dist/presets/security-baseline.js +1 -1
- package/dist/secrets/feature.js +1 -1
- package/dist/secrets/handlers/delete.write.js +1 -1
- package/dist/secrets/handlers/list.query.js +1 -1
- package/dist/secrets/handlers/set.write.js +1 -1
- package/dist/secrets/i18n.js +1 -1
- package/dist/secrets/index.d.ts +1 -1
- package/dist/secrets/index.js +1 -1
- package/dist/secrets/{constants.js → web/constants.js} +0 -1
- package/dist/secrets/write-gate.js +1 -1
- package/dist/sessions/feature.js +7 -4
- package/dist/sessions/{i18n.js → web/i18n.js} +0 -1
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/purge-files-reaching-subject.js +7 -3
- package/dist/subscription-stripe/feature.js +2 -1
- package/dist/subscription-stripe/plugin-methods.d.ts +3 -0
- package/dist/subscription-stripe/plugin-methods.js +14 -0
- package/dist/subscription-stripe/verify-webhook.js +1 -0
- package/dist/tags/feature.js +1 -1
- package/dist/tags/handlers/assign-tag.write.js +11 -7
- package/dist/tags/handlers/create-tag.write.js +1 -1
- package/dist/tags/handlers/delete-tag.write.js +4 -1
- package/dist/tags/handlers/remove-tag.write.js +1 -1
- package/dist/tags/handlers/update-tag.write.js +1 -1
- package/dist/tags/index.d.ts +1 -1
- package/dist/tags/index.js +1 -1
- package/dist/tags/screens.js +1 -1
- package/dist/tags/web/client-plugin.js +1 -2
- package/dist/tags/{constants.d.ts → web/constants.d.ts} +1 -0
- package/dist/tags/{constants.js → web/constants.js} +3 -1
- package/dist/tags/web/entity-tags.js +1 -2
- package/dist/tags/web/i18n.js +2 -2
- package/dist/tags/web/index.d.ts +1 -1
- package/dist/tags/web/index.js +1 -2
- package/dist/tags/web/tag-filter.js +1 -2
- package/dist/tags/web/tag-manager.js +5 -4
- package/dist/tags/web/tag-picker.js +0 -1
- package/dist/tags/web/tag-section.js +1 -2
- package/dist/tags/web/tags-cell.js +1 -2
- package/dist/template-resolver/api.d.ts +21 -23
- package/dist/template-resolver/api.js +34 -6
- package/dist/template-resolver/compile-document-body.d.ts +3 -0
- package/dist/template-resolver/compile-document-body.js +51 -4
- package/dist/template-resolver/compile-steps-block.js +2 -2
- package/dist/template-resolver/document-ops.d.ts +1 -1
- package/dist/template-resolver/document-ops.js +3 -3
- package/dist/template-resolver/document-sanitizer.d.ts +2 -2
- package/dist/template-resolver/document-sanitizer.js +23 -3
- package/dist/template-resolver/feature.d.ts +11 -0
- package/dist/template-resolver/feature.js +68 -35
- package/dist/template-resolver/handlers/by-slug.query.js +6 -1
- package/dist/template-resolver/handlers/by-tenant.query.js +6 -2
- package/dist/template-resolver/handlers/collection-item.query.js +2 -1
- package/dist/template-resolver/handlers/collection-list.query.js +2 -1
- package/dist/template-resolver/handlers/collection-set.write.d.ts +2 -1
- package/dist/template-resolver/handlers/collection-set.write.js +15 -3
- package/dist/template-resolver/handlers/collection-shared.d.ts +1 -2
- package/dist/template-resolver/handlers/collection-shared.js +0 -4
- package/dist/template-resolver/handlers/copy-locale.write.d.ts +2 -1
- package/dist/template-resolver/handlers/copy-locale.write.js +69 -65
- package/dist/template-resolver/handlers/diff-to-system.query.js +5 -1
- package/dist/template-resolver/handlers/discard-draft.write.d.ts +3 -2
- package/dist/template-resolver/handlers/discard-draft.write.js +19 -7
- package/dist/template-resolver/handlers/document-base.d.ts +1 -1
- package/dist/template-resolver/handlers/document-base.js +6 -1
- package/dist/template-resolver/handlers/document-blocks.query.d.ts +1 -1
- package/dist/template-resolver/handlers/document-blocks.query.js +2 -2
- package/dist/template-resolver/handlers/export-bundle.query.js +5 -2
- package/dist/template-resolver/handlers/find-by-id.query.js +4 -2
- package/dist/template-resolver/handlers/import-bundle.write.d.ts +2 -1
- package/dist/template-resolver/handlers/import-bundle.write.js +30 -25
- package/dist/template-resolver/handlers/layout-source.query.js +5 -5
- package/dist/template-resolver/handlers/list.query.js +5 -2
- package/dist/template-resolver/handlers/overview.query.d.ts +12 -3
- package/dist/template-resolver/handlers/overview.query.js +87 -51
- package/dist/template-resolver/handlers/patch-draft.write.d.ts +2 -1
- package/dist/template-resolver/handlers/patch-draft.write.js +93 -87
- package/dist/template-resolver/handlers/reset-to-system.write.d.ts +2 -1
- package/dist/template-resolver/handlers/reset-to-system.write.js +51 -44
- package/dist/template-resolver/handlers/resource-link-pdf.write.d.ts +2 -1
- package/dist/template-resolver/handlers/resource-link-pdf.write.js +34 -28
- package/dist/template-resolver/handlers/resource-remove.write.d.ts +2 -1
- package/dist/template-resolver/handlers/resource-remove.write.js +39 -33
- package/dist/template-resolver/handlers/resource-shared.js +1 -1
- package/dist/template-resolver/handlers/resource-upload.write.d.ts +2 -1
- package/dist/template-resolver/handlers/resource-upload.write.js +105 -97
- package/dist/template-resolver/handlers/send-test-shared.d.ts +5 -0
- package/dist/template-resolver/handlers/send-test-shared.js +19 -0
- package/dist/template-resolver/handlers/send-test-status.query.d.ts +9 -0
- package/dist/template-resolver/handlers/send-test-status.query.js +18 -0
- package/dist/template-resolver/handlers/send-test.write.d.ts +2 -1
- package/dist/template-resolver/handlers/send-test.write.js +89 -91
- package/dist/template-resolver/handlers/set.write.d.ts +2 -1
- package/dist/template-resolver/handlers/set.write.js +95 -91
- package/dist/template-resolver/handlers/shared.js +1 -1
- package/dist/template-resolver/handlers/template-gates.d.ts +1 -1
- package/dist/template-resolver/handlers/template-gates.js +1 -1
- package/dist/template-resolver/handlers/template-write.d.ts +1 -1
- package/dist/template-resolver/handlers/template-write.js +1 -1
- package/dist/template-resolver/handlers/toggle-status.write.d.ts +6 -7
- package/dist/template-resolver/handlers/toggle-status.write.js +28 -10
- package/dist/template-resolver/handlers/upsert-tenant.write.d.ts +2 -1
- package/dist/template-resolver/handlers/upsert-tenant.write.js +30 -24
- package/dist/template-resolver/handlers/usage.query.js +3 -2
- package/dist/template-resolver/handlers/validate.query.d.ts +1 -1
- package/dist/template-resolver/handlers/validate.query.js +3 -1
- package/dist/template-resolver/i18n.d.ts +3 -0
- package/dist/template-resolver/i18n.js +24 -0
- package/dist/template-resolver/index.d.ts +8 -5
- package/dist/template-resolver/index.js +6 -4
- package/dist/template-resolver/layout-appearance.js +1 -1
- package/dist/template-resolver/layout-regions.d.ts +1 -1
- package/dist/template-resolver/seeding.d.ts +4 -1
- package/dist/template-resolver/seeding.js +13 -7
- package/dist/template-resolver/store-template-resource.js +2 -2
- package/dist/template-resolver/table.js +1 -1
- package/dist/template-resolver/template-bundle.js +2 -2
- package/dist/template-resolver/template-delivery-policy.d.ts +22 -0
- package/dist/template-resolver/template-delivery-policy.js +40 -0
- package/dist/template-resolver/template-draft.d.ts +1 -1
- package/dist/template-resolver/template-draft.js +1 -1
- package/dist/template-resolver/template-edit-policy.d.ts +22 -0
- package/dist/template-resolver/template-edit-policy.js +45 -0
- package/dist/template-resolver/template-meta.d.ts +2 -2
- package/dist/template-resolver/template-meta.js +2 -2
- package/dist/template-resolver/template-preview.d.ts +1 -1
- package/dist/template-resolver/template-preview.js +15 -6
- package/dist/template-resolver/template-usage.d.ts +1 -1
- package/dist/template-resolver/template-usage.js +1 -1
- package/dist/template-resolver/template-validation.js +34 -14
- package/dist/template-resolver/testing.js +1 -1
- package/dist/template-resolver/user-content-table.js +1 -1
- package/dist/template-resolver/web/client-plugin.js +1 -2
- package/dist/template-resolver/{constants.d.ts → web/constants.d.ts} +4 -1
- package/dist/template-resolver/{constants.js → web/constants.js} +9 -10
- package/dist/template-resolver/{document-blocks.d.ts → web/document-blocks.d.ts} +2 -2
- package/dist/template-resolver/{document-blocks.js → web/document-blocks.js} +1 -0
- package/dist/template-resolver/web/document-editor-extensions.d.ts +1 -0
- package/dist/template-resolver/web/document-editor-extensions.js +22 -2
- package/dist/template-resolver/web/document-editor.js +0 -1
- package/dist/template-resolver/web/document-images.d.ts +2 -0
- package/dist/template-resolver/web/document-images.js +27 -0
- package/dist/template-resolver/{document-schema.d.ts → web/document-schema.d.ts} +2 -1
- package/dist/template-resolver/{document-schema.js → web/document-schema.js} +4 -1
- package/dist/template-resolver/{document-steps.js → web/document-steps.js} +0 -1
- package/dist/template-resolver/web/document-tiptap-editor.d.ts +1 -1
- package/dist/template-resolver/web/document-tiptap-editor.js +24 -9
- package/dist/template-resolver/web/document-toolbar-blocks.d.ts +4 -2
- package/dist/template-resolver/web/document-toolbar-blocks.js +1 -1
- package/dist/template-resolver/web/editor-handle.js +1 -1
- package/dist/template-resolver/web/i18n.js +5 -1
- package/dist/template-resolver/web/index.d.ts +3 -3
- package/dist/template-resolver/web/index.js +3 -4
- package/dist/template-resolver/{mail-constants.js → web/mail-constants.js} +0 -1
- package/dist/template-resolver/{pdf-constants.js → web/pdf-constants.js} +0 -1
- package/dist/template-resolver/web/placeholder-line-editor-lazy.js +0 -1
- package/dist/template-resolver/web/placeholder-line-editor.js +6 -4
- package/dist/template-resolver/{qualified-names.d.ts → web/qualified-names.d.ts} +2 -0
- package/dist/template-resolver/{qualified-names.js → web/qualified-names.js} +2 -1
- package/dist/template-resolver/web/use-stable-by-key.js +0 -1
- package/dist/tenant/handlers/add-member.write.js +1 -1
- package/dist/tenant/index.d.ts +1 -1
- package/dist/tenant/index.js +1 -1
- package/dist/tenant/invitation-table.js +1 -1
- package/dist/tenant/invited-membership.js +1 -1
- package/dist/tenant/last-tenant-admin.js +1 -1
- package/dist/tenant/member-role-options.js +1 -1
- package/dist/tenant/screens.js +1 -1
- package/dist/tenant/web/client-plugin.js +1 -2
- package/dist/tenant/{constants.js → web/constants.js} +3 -6
- package/dist/tenant/web/index.js +0 -1
- package/dist/tenant/web/member-roles-cell.js +0 -1
- package/dist/tenant/web/member-status-cell.js +0 -1
- package/dist/tenant-lifecycle/stages.js +2 -3
- package/dist/tier-engine/entity.d.ts +1 -1
- package/dist/tier-engine/entity.js +1 -1
- package/dist/tier-engine/feature.js +2 -2
- package/dist/tier-engine/handlers/set-tenant-tier.write.js +1 -1
- package/dist/tier-engine/index.d.ts +1 -1
- package/dist/tier-engine/index.js +1 -1
- package/dist/tier-engine/web/client-plugin.js +2 -3
- package/dist/tier-engine/{constants.js → web/constants.js} +2 -3
- package/dist/tier-engine/{i18n.js → web/i18n.js} +0 -1
- package/dist/tier-engine/web/index.js +0 -1
- package/dist/user/handlers/create.write.js +1 -1
- package/dist/user/handlers/update-roles.js +1 -1
- package/dist/user/handlers/update.write.js +1 -1
- package/dist/user/index.d.ts +1 -1
- package/dist/user/index.js +1 -1
- package/dist/user/invited-global-roles.d.ts +1 -1
- package/dist/user/invited-global-roles.js +1 -1
- package/dist/user/schema/user.js +1 -1
- package/dist/user/{constants.js → web/constants.js} +0 -1
- package/dist/user-data-rights/env.js +1 -1
- package/dist/user-data-rights/feature.js +3 -3
- package/dist/user-data-rights/index.d.ts +1 -1
- package/dist/user-data-rights/index.js +1 -1
- package/dist/user-data-rights/lib/resolve-tenant-model.js +1 -1
- package/dist/user-data-rights/mail-notifications.js +1 -1
- package/dist/user-data-rights/web/client-plugin.js +2 -3
- package/dist/user-data-rights/web/confirm-deletion-screen.js +0 -1
- package/dist/user-data-rights/{constants.js → web/constants.js} +11 -12
- package/dist/user-data-rights/web/default-translations.d.ts +2 -0
- package/dist/user-data-rights/web/default-translations.js +59 -0
- package/dist/user-data-rights/web/i18n.d.ts +5 -2
- package/dist/user-data-rights/web/i18n.js +37 -59
- package/dist/user-data-rights/web/index.d.ts +1 -1
- package/dist/user-data-rights/web/index.js +1 -2
- package/dist/user-data-rights/web/privacy-center-screen.js +1 -2
- package/dist/user-data-rights/web/request-deletion-screen.js +0 -1
- package/dist/user-data-rights-defaults/hooks/file-ref.userdata-hook.js +6 -1
- package/dist/user-profile/feature.js +1 -1
- package/dist/user-profile/handlers/change-email.write.js +1 -1
- package/dist/user-profile/index.d.ts +1 -1
- package/dist/user-profile/index.js +1 -1
- package/dist/user-profile/web/client-plugin.js +2 -3
- package/dist/user-profile/{constants.js → web/constants.js} +0 -1
- package/dist/user-profile/{i18n.js → web/i18n.js} +0 -1
- package/dist/user-profile/web/profile-screen.js +2 -3
- package/dist/waitlist/entity.js +1 -1
- package/dist/waitlist/feature.js +1 -1
- package/dist/waitlist/handlers/export-purge.write.js +1 -1
- package/dist/waitlist/handlers/invite.write.js +1 -1
- package/dist/waitlist/handlers/reject.write.js +1 -1
- package/dist/waitlist/handlers/submit.write.js +4 -3
- package/dist/waitlist/import.d.ts +1 -1
- package/dist/waitlist/index.d.ts +1 -1
- package/dist/waitlist/index.js +1 -1
- package/dist/waitlist/legacy-migrate.js +1 -1
- package/dist/waitlist/link-on-signup.js +1 -1
- package/dist/waitlist/mail.d.ts +0 -1
- package/dist/waitlist/mail.js +6 -4
- package/dist/waitlist/payloads.js +1 -1
- package/dist/waitlist/screens.js +1 -1
- package/dist/waitlist/{constants.js → web/constants.js} +0 -1
- package/kumiko-es-tables.json +102 -0
- package/package.json +30 -29
- package/src/audit/changes.json +7 -0
- package/src/auth-email-password/changes.json +6 -0
- package/src/auth-mfa/changes.json +6 -0
- package/src/billing-foundation/changes.json +18 -0
- package/src/cap-counter/changes.json +12 -0
- package/src/delivery/changes.json +6 -0
- package/src/document-ingest-foundation/changes.json +6 -0
- package/src/files/changes.json +7 -0
- package/src/form-draft/changes.json +7 -0
- package/src/inbound-mail-foundation/changes.json +6 -0
- package/src/ledger/changes.json +7 -0
- package/src/mail-foundation/changes.json +6 -0
- package/src/presets/changes.json +7 -0
- package/src/tags/changes.json +6 -0
- package/src/template-resolver/changes.json +63 -0
- package/src/user-data-rights/changes.json +14 -0
- package/src/waitlist/changes.json +6 -0
- package/dist/admin-shell/i18n.d.ts +0 -5
- package/dist/admin-shell/i18n.js +0 -51
- package/dist/audit/i18n.d.ts +0 -5
- package/dist/audit/i18n.js +0 -22
- package/dist/jobs/i18n.d.ts +0 -5
- package/dist/jobs/i18n.js +0 -52
- package/dist/managed-pages/i18n.d.ts +0 -5
- package/dist/managed-pages/i18n.js +0 -55
- package/dist/presets/dsgvo-self-service.d.ts +0 -10
- package/dist/presets/dsgvo-self-service.js +0 -24
- package/dist/user-data-rights/i18n.d.ts +0 -5
- package/dist/user-data-rights/i18n.js +0 -39
- /package/dist/account-security/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/account-security/{i18n.d.ts → web/i18n.d.ts} +0 -0
- /package/dist/admin-shell/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/auth-email-password/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/auth-email-password/{i18n.d.ts → web/i18n.d.ts} +0 -0
- /package/dist/auth-email-password/{mail-i18n.d.ts → web/mail-i18n.d.ts} +0 -0
- /package/dist/auth-mfa/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/billing-foundation/{consumer-protection → web/consumer-protection}/consent-locale.d.ts +0 -0
- /package/dist/billing-foundation/{contact-card.d.ts → web/contact-card.d.ts} +0 -0
- /package/dist/cap-overview/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/cap-overview/{usage-math.js → web/usage-math.js} +0 -0
- /package/dist/compliance-profiles/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/config/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/custom-fields/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/delivery/{public-names.d.ts → web/public-names.d.ts} +0 -0
- /package/dist/feature-toggles/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/folders/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/form-draft/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/jobs/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/ledger/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/legal-pages/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/metrics/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/notes-history/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/personal-access-tokens/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/personal-access-tokens/{scopes.d.ts → web/scopes.d.ts} +0 -0
- /package/dist/personal-access-tokens/{scopes.js → web/scopes.js} +0 -0
- /package/dist/secrets/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/sessions/{i18n.d.ts → web/i18n.d.ts} +0 -0
- /package/dist/template-resolver/{document-steps.d.ts → web/document-steps.d.ts} +0 -0
- /package/dist/template-resolver/{mail-constants.d.ts → web/mail-constants.d.ts} +0 -0
- /package/dist/template-resolver/{pdf-constants.d.ts → web/pdf-constants.d.ts} +0 -0
- /package/dist/template-resolver/{placeholder-text.d.ts → web/placeholder-text.d.ts} +0 -0
- /package/dist/template-resolver/{placeholder-text.js → web/placeholder-text.js} +0 -0
- /package/dist/tenant/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/tier-engine/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/tier-engine/{i18n.d.ts → web/i18n.d.ts} +0 -0
- /package/dist/user/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/user-data-rights/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/user-profile/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/user-profile/{i18n.d.ts → web/i18n.d.ts} +0 -0
- /package/dist/waitlist/{constants.d.ts → web/constants.d.ts} +0 -0
|
@@ -74,12 +74,19 @@ export function groupStaleDraftIdsByTenant(batch) {
|
|
|
74
74
|
// tenant first (see groupStaleDraftIdsByTenant above).
|
|
75
75
|
export async function deleteStaleDraftsBatch(batch, db, retentionDays, log) {
|
|
76
76
|
const deletedRows = [];
|
|
77
|
+
const deferredIds = [];
|
|
77
78
|
let skippedCount = 0;
|
|
78
79
|
const byId = new Map(batch.map((row) => [row.id, row]));
|
|
79
80
|
for (const [tenantId, ids] of groupStaleDraftIdsByTenant(batch)) {
|
|
80
81
|
const systemUser = createSystemUser(tenantId);
|
|
81
82
|
const tenantDb = createTenantDb({ db, tenantId, mode: "system" });
|
|
82
83
|
for (const id of ids) {
|
|
84
|
+
// skip: an unreadable blob hides its FileRefs; deleting now would orphan them, so the next run retries.
|
|
85
|
+
if (byId.get(id)?.draftUnreadable) {
|
|
86
|
+
log?.warn?.(`[form-draft:cleanup] draft id=${id} tenant=${tenantId} could not be decrypted — kept for the next run`);
|
|
87
|
+
deferredIds.push(id);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
83
90
|
// Race: user may have saved between select and here — skip if no longer stale.
|
|
84
91
|
if (!(await isDraftStillStale(db, tenantId, id, retentionDays))) {
|
|
85
92
|
skippedCount++;
|
|
@@ -96,7 +103,7 @@ export async function deleteStaleDraftsBatch(batch, db, retentionDays, log) {
|
|
|
96
103
|
}
|
|
97
104
|
}
|
|
98
105
|
}
|
|
99
|
-
return { deletedRows, skippedCount };
|
|
106
|
+
return { deletedRows, skippedCount, deferredIds };
|
|
100
107
|
}
|
|
101
108
|
export async function cleanupDraftsJob(_payload, ctx, db) {
|
|
102
109
|
const resolved = ctx.configResolver
|
|
@@ -112,10 +119,13 @@ export async function cleanupDraftsJob(_payload, ctx, db) {
|
|
|
112
119
|
const retentionDays = isValidRetention ? resolved : FORM_DRAFT_DEFAULT_RETENTION_DAYS;
|
|
113
120
|
const fileProviderResolver = ctx._fileProviderResolver;
|
|
114
121
|
let deleted = 0;
|
|
122
|
+
const deferred = new Set();
|
|
115
123
|
while (true) {
|
|
116
124
|
if (ctx.signal?.aborted)
|
|
117
125
|
break;
|
|
118
|
-
const batch = await selectStaleDraftsBatch(db, retentionDays, DEFAULT_BATCH_SIZE
|
|
126
|
+
const batch = await selectStaleDraftsBatch(db, retentionDays, DEFAULT_BATCH_SIZE, [
|
|
127
|
+
...deferred,
|
|
128
|
+
]);
|
|
119
129
|
if (batch.length === 0)
|
|
120
130
|
break;
|
|
121
131
|
// Rows span arbitrary tenants (this job sweeps the whole table under
|
|
@@ -125,7 +135,9 @@ export async function cleanupDraftsJob(_payload, ctx, db) {
|
|
|
125
135
|
// entirely for rows with no FileRefs in the blob, the common case.
|
|
126
136
|
// Delete first (with staleness re-check), then release binaries from rows
|
|
127
137
|
// that actually disappeared — never release a draft the user just saved.
|
|
128
|
-
const { deletedRows, skippedCount } = await deleteStaleDraftsBatch(batch, db, retentionDays, ctx.log);
|
|
138
|
+
const { deletedRows, skippedCount, deferredIds } = await deleteStaleDraftsBatch(batch, db, retentionDays, ctx.log);
|
|
139
|
+
for (const id of deferredIds)
|
|
140
|
+
deferred.add(id);
|
|
129
141
|
for (const row of deletedRows) {
|
|
130
142
|
await releaseRowFileRefs(row, db, fileProviderResolver, ctx.log);
|
|
131
143
|
}
|
|
@@ -133,7 +145,8 @@ export async function cleanupDraftsJob(_payload, ctx, db) {
|
|
|
133
145
|
// A skipped row is no longer stale, so the next select drops it — a fully
|
|
134
146
|
// skipped batch still makes progress. Only a batch with neither deletes nor
|
|
135
147
|
// skips (all failed) would reselect the same rows forever.
|
|
136
|
-
if (deletedRows.length + skippedCount === 0 ||
|
|
148
|
+
if (deletedRows.length + skippedCount + deferredIds.length === 0 ||
|
|
149
|
+
batch.length < DEFAULT_BATCH_SIZE)
|
|
137
150
|
break;
|
|
138
151
|
}
|
|
139
152
|
ctx.log?.info?.(`[form-draft:cleanup] deleted=${deleted} retentionDays=${retentionDays}`);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { fileRefEntity, fileRefsTable } from "@cosmicdrift/kumiko-framework/files";
|
|
4
|
-
import { FORM_DRAFT_ACCESS } from "../constants.js";
|
|
5
4
|
import { filterOwnedFileRefs } from "../db/queries/owned-file-refs.js";
|
|
6
5
|
import { formDraftExecutor } from "../executor.js";
|
|
7
6
|
import { lookupDraft } from "../lookup.js";
|
|
8
7
|
import { collectDraftFileRefKeys, releaseDraftFileRefs } from "../release-file-refs.js";
|
|
9
8
|
import { discardDraftPayloadSchema } from "../schemas.js";
|
|
9
|
+
import { FORM_DRAFT_ACCESS } from "../web/constants.js";
|
|
10
10
|
// Same construction as file-routes.ts/user-data-rights-defaults' fileRef
|
|
11
11
|
// hook — self-contained (table + entity), no registry needed. `.forget()`
|
|
12
12
|
// hard-deletes the file_refs row via a `fileRef.forgotten` event (rebuild-
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { FORM_DRAFT_ACCESS } from "../constants.js";
|
|
3
2
|
import { lookupDraft } from "../lookup.js";
|
|
4
|
-
import {
|
|
3
|
+
import { getDraftPayloadSchema } from "../schemas.js";
|
|
4
|
+
import { FORM_DRAFT_ACCESS } from "../web/constants.js";
|
|
5
5
|
// get — resolves to `{ draft: null }` for both "no draft saved yet" and "a
|
|
6
6
|
// draft exists but belongs to someone else / another tenant" — the lookup
|
|
7
7
|
// is scoped by (tenantId, ownerId, draftKey), so a foreign caller's query
|
|
@@ -15,13 +15,12 @@ export const getDraftQuery = defineQueryHandler({
|
|
|
15
15
|
const row = await lookupDraft(ctx.db, query.user.tenantId, query.user.id, query.payload.draftKey);
|
|
16
16
|
if (!row)
|
|
17
17
|
return { draft: null };
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// Schema evolution or a corrupt jsonb row: surface it to operators
|
|
18
|
+
if (!row.draft) {
|
|
19
|
+
// Schema evolution or a corrupt/erased row: surface it to operators
|
|
21
20
|
// instead of silently making the user's draft vanish.
|
|
22
|
-
ctx.log?.warn?.(`[form-draft:get] stored blob for draftKey=${query.payload.draftKey} failed schema, treating as absent
|
|
21
|
+
ctx.log?.warn?.(`[form-draft:get] stored blob for draftKey=${query.payload.draftKey} failed schema or decryption, treating as absent`);
|
|
23
22
|
return { draft: null };
|
|
24
23
|
}
|
|
25
|
-
return { draft:
|
|
24
|
+
return { draft: row.draft };
|
|
26
25
|
},
|
|
27
26
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { FORM_DRAFT_ACCESS } from "../constants.js";
|
|
3
2
|
import { listDraftsByScreen } from "../lookup.js";
|
|
4
3
|
import { listDraftsPayloadSchema } from "../schemas.js";
|
|
4
|
+
import { FORM_DRAFT_ACCESS } from "../web/constants.js";
|
|
5
5
|
// Two saves landing in the same millisecond tie on savedAt — there's no
|
|
6
6
|
// knowable "true" order between them, so `id` only buys a deterministic,
|
|
7
7
|
// repeatable result, not chronological accuracy.
|
|
@@ -20,12 +20,16 @@ export const listDraftsQuery = defineQueryHandler({
|
|
|
20
20
|
handler: async (query, ctx) => {
|
|
21
21
|
const rows = await listDraftsByScreen(ctx.db, query.user.tenantId, query.user.id, query.payload.screenId);
|
|
22
22
|
const drafts = rows
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
.flatMap((row) => row.draft
|
|
24
|
+
? [
|
|
25
|
+
{
|
|
26
|
+
id: row.id,
|
|
27
|
+
draftKey: row.draftKey,
|
|
28
|
+
stepIndex: row.draft.stepIndex,
|
|
29
|
+
savedAt: row.draft.savedAt,
|
|
30
|
+
},
|
|
31
|
+
]
|
|
32
|
+
: [])
|
|
29
33
|
.sort(byNewestFirst)
|
|
30
34
|
// Matches listDraftsByScreen selectMany limit — JS sort cannot push the
|
|
31
35
|
// ceiling into SQL while savedAt lives inside jsonb.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { failUnprocessable } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
3
|
import { getTemporal } from "@cosmicdrift/kumiko-framework/time";
|
|
4
|
-
import { FORM_DRAFT_ACCESS, FORM_DRAFT_MAX_PER_OWNER, FORM_DRAFT_UNIQUE_KEY_CONSTRAINT, } from "../constants.js";
|
|
5
4
|
import { countDraftsByOwner } from "../db/queries/draft-count.js";
|
|
6
5
|
import { formDraftExecutor } from "../executor.js";
|
|
7
6
|
import { lookupDraft } from "../lookup.js";
|
|
8
7
|
import { saveDraftPayloadSchema } from "../schemas.js";
|
|
8
|
+
import { FORM_DRAFT_ACCESS, FORM_DRAFT_MAX_PER_OWNER, FORM_DRAFT_UNIQUE_KEY_CONSTRAINT, } from "../web/constants.js";
|
|
9
9
|
/**
|
|
10
10
|
* save is an upsert keyed on (tenantId, ownerId, draftKey) — same
|
|
11
11
|
* lookup-then-create|update-with-race-retry idiom as
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { FORM_DRAFT_ACCESS, FORM_DRAFT_FEATURE_NAME, FORM_DRAFT_KEY_MAX_LENGTH, FORM_DRAFT_UNIQUE_KEY_CONSTRAINT, FormDraftHandlers, FormDraftQueries, } from "./constants.ts";
|
|
2
1
|
export { formDraftEntity } from "./entity.ts";
|
|
3
2
|
export { formDraftExecutor, formDraftTable } from "./executor.ts";
|
|
4
3
|
export { createFormDraftFeature } from "./feature.ts";
|
|
@@ -8,3 +7,4 @@ export { type ListDraftsResult, listDraftsQuery } from "./handlers/list.query.ts
|
|
|
8
7
|
export { saveDraftWrite } from "./handlers/save.write.ts";
|
|
9
8
|
export { type FormDraftRow, lookupDraft } from "./lookup.ts";
|
|
10
9
|
export { type DiscardDraftPayload, discardDraftPayloadSchema, type FormDraftBlob, formDraftBlobSchema, type GetDraftPayload, getDraftPayloadSchema, type ListDraftsPayload, listDraftsPayloadSchema, type SaveDraftPayload, saveDraftPayloadSchema, } from "./schemas.ts";
|
|
10
|
+
export { FORM_DRAFT_ACCESS, FORM_DRAFT_FEATURE_NAME, FORM_DRAFT_KEY_MAX_LENGTH, FORM_DRAFT_UNIQUE_KEY_CONSTRAINT, FormDraftHandlers, FormDraftQueries, } from "./web/constants.ts";
|
package/dist/form-draft/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { FORM_DRAFT_ACCESS, FORM_DRAFT_FEATURE_NAME, FORM_DRAFT_KEY_MAX_LENGTH, FORM_DRAFT_UNIQUE_KEY_CONSTRAINT, FormDraftHandlers, FormDraftQueries, } from "./constants.js";
|
|
2
1
|
export { formDraftEntity } from "./entity.js";
|
|
3
2
|
export { formDraftExecutor, formDraftTable } from "./executor.js";
|
|
4
3
|
export { createFormDraftFeature } from "./feature.js";
|
|
@@ -8,3 +7,4 @@ export { listDraftsQuery } from "./handlers/list.query.js";
|
|
|
8
7
|
export { saveDraftWrite } from "./handlers/save.write.js";
|
|
9
8
|
export { lookupDraft } from "./lookup.js";
|
|
10
9
|
export { discardDraftPayloadSchema, formDraftBlobSchema, getDraftPayloadSchema, listDraftsPayloadSchema, saveDraftPayloadSchema, } from "./schemas.js";
|
|
10
|
+
export { FORM_DRAFT_ACCESS, FORM_DRAFT_FEATURE_NAME, FORM_DRAFT_KEY_MAX_LENGTH, FORM_DRAFT_UNIQUE_KEY_CONSTRAINT, FormDraftHandlers, FormDraftQueries, } from "./web/constants.js";
|
|
@@ -5,13 +5,13 @@ import type { FormDraftBlob } from "./schemas.ts";
|
|
|
5
5
|
export type FormDraftRow = {
|
|
6
6
|
readonly id: string;
|
|
7
7
|
readonly version: number;
|
|
8
|
-
readonly draft: FormDraftBlob;
|
|
8
|
+
readonly draft: FormDraftBlob | null;
|
|
9
9
|
readonly insertedAt: Temporal.Instant;
|
|
10
10
|
};
|
|
11
11
|
export declare function lookupDraft(db: TenantDb, tenantId: TenantId, ownerId: string, draftKey: string): Promise<FormDraftRow | undefined>;
|
|
12
12
|
export type FormDraftSummaryRow = {
|
|
13
13
|
readonly id: string;
|
|
14
14
|
readonly draftKey: string;
|
|
15
|
-
readonly draft: FormDraftBlob;
|
|
15
|
+
readonly draft: FormDraftBlob | null;
|
|
16
16
|
};
|
|
17
17
|
export declare function listDraftsByScreen(db: TenantDb, tenantId: TenantId, ownerId: string, screenId: string): Promise<readonly FormDraftSummaryRow[]>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { fetchOne, selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
|
+
import { readStoredDraft } from "./decrypt-draft.js";
|
|
2
3
|
import { formDraftTable } from "./executor.js";
|
|
3
4
|
// Shared by save (upsert lookup + race re-lookup), discard, and get — always
|
|
4
5
|
// scoped by tenantId + ownerId + draftKey, tenantId included explicitly
|
|
5
6
|
// (not relying on TenantDb auto-scoping) to mirror delivery/upsert-preference.ts.
|
|
6
7
|
export async function lookupDraft(db, tenantId, ownerId, draftKey) {
|
|
7
|
-
|
|
8
|
+
const row = await fetchOne(db, formDraftTable, { tenantId, ownerId, draftKey });
|
|
9
|
+
if (!row)
|
|
10
|
+
return undefined;
|
|
11
|
+
return { ...row, draft: await readStoredDraft(row.draft) };
|
|
8
12
|
}
|
|
9
13
|
// LIKE metacharacters in a caller-controlled screenId must not widen the
|
|
10
14
|
// prefix scan (e.g. a literal "%" matching every draft).
|
|
@@ -19,9 +23,10 @@ function escapeLikePattern(value) {
|
|
|
19
23
|
export async function listDraftsByScreen(db, tenantId, ownerId, screenId) {
|
|
20
24
|
// ponytail: hard cap — savedAt lives in jsonb so SQL ORDER BY+LIMIT is wrong;
|
|
21
25
|
// promote savedAt to a column when callers need correct newest-N under the ceiling.
|
|
22
|
-
|
|
26
|
+
const rows = await selectMany(db, formDraftTable, {
|
|
23
27
|
tenantId,
|
|
24
28
|
ownerId,
|
|
25
29
|
draftKey: { like: `${escapeLikePattern(screenId)}:%` },
|
|
26
30
|
}, { limit: 200 });
|
|
31
|
+
return Promise.all(rows.map(async (row) => ({ ...row, draft: await readStoredDraft(row.draft) })));
|
|
27
32
|
}
|
|
@@ -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.js";
|
|
2
|
+
import { FORM_DRAFT_KEY_MAX_LENGTH, FORM_DRAFT_VALUES_MAX_BYTES } from "./web/constants.js";
|
|
3
3
|
const draftKeySchema = z.string().trim().min(1).max(FORM_DRAFT_KEY_MAX_LENGTH);
|
|
4
4
|
// UTF-8 byte length, not string.length — `values` is arbitrary JSON that can
|
|
5
5
|
// hold multi-byte characters, and the event-store row this ends up in is
|
|
@@ -21,8 +21,8 @@ export const formDraftExportHook = async (ctx) => {
|
|
|
21
21
|
})),
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
//
|
|
25
|
-
//
|
|
24
|
+
// Deletes the row through the event store; `draft` is ciphertext under the
|
|
25
|
+
// owner's key in the row and in every event (previous of the delete included).
|
|
26
26
|
// A drafted form is pure pre-submit scratch state with no value once the
|
|
27
27
|
// owner is gone, so both forget strategies (delete/anonymize) remove the
|
|
28
28
|
// row outright rather than anonymizing in place. Per-row via the executor
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type QueryHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
export declare const listAccountsQuery: QueryHandlerDef;
|
|
@@ -8,21 +8,29 @@
|
|
|
8
8
|
// in-memory nach dem tenant-scoped select — Volumen ist die Anzahl
|
|
9
9
|
// verbundener Postfächer eines Tenants (einstellig bis zweistellig).
|
|
10
10
|
import { configuredPiiSubjectKms, decryptPiiFieldValues, } from "@cosmicdrift/kumiko-framework/crypto";
|
|
11
|
+
import { MAX_LIST_LIMIT } from "@cosmicdrift/kumiko-framework/engine";
|
|
11
12
|
import * as z from "zod";
|
|
12
13
|
import { MAIL_ACCOUNT_PII_FIELDS } from "../entities.js";
|
|
13
14
|
import { mailAccountsProjectionTable } from "../projection.js";
|
|
14
15
|
import { isVisibleToCaller } from "./scope-visibility.js";
|
|
15
|
-
|
|
16
|
+
// The projectionList screen always sends `limit`; unknown keys stay rejected.
|
|
17
|
+
const listAccountsSchema = z
|
|
18
|
+
.object({ limit: z.number().int().min(1).max(MAX_LIST_LIMIT).default(MAX_LIST_LIMIT) })
|
|
19
|
+
.strict();
|
|
16
20
|
export const listAccountsQuery = {
|
|
17
21
|
name: "account:list",
|
|
18
22
|
schema: listAccountsSchema,
|
|
19
23
|
access: { roles: ["SystemAdmin", "TenantAdmin", "User"] },
|
|
20
24
|
description: "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.",
|
|
21
|
-
handler: async (
|
|
25
|
+
handler: async (query, ctx) => {
|
|
26
|
+
const { limit } = listAccountsSchema.parse(query.payload);
|
|
22
27
|
const allRows = await ctx.db.selectMany(mailAccountsProjectionTable, {
|
|
23
28
|
tenantId: ctx.user.tenantId,
|
|
24
29
|
});
|
|
25
|
-
const rows = allRows
|
|
30
|
+
const rows = allRows
|
|
31
|
+
.filter((row) => isVisibleToCaller(row, ctx.user))
|
|
32
|
+
.sort((a, b) => String(a["id"]).localeCompare(String(b["id"])))
|
|
33
|
+
.slice(0, limit);
|
|
26
34
|
const piiKms = configuredPiiSubjectKms();
|
|
27
35
|
if (!piiKms)
|
|
28
36
|
return { rows };
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
// shreddet keinen Key. Echte Art.-17-Erasure der Event-Payloads passiert
|
|
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
|
-
import { deleteMany, selectMany
|
|
27
|
-
import { archiveStream } from "@cosmicdrift/kumiko-framework/event-store";
|
|
26
|
+
import { deleteMany, selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
27
|
+
import { archiveStream, deleteRowsWithoutReplayableStream, } from "@cosmicdrift/kumiko-framework/event-store";
|
|
28
28
|
import { seenMessageTable } from "./entities.js";
|
|
29
29
|
import { INBOUND_MESSAGE_AGGREGATE_TYPE } from "./events.js";
|
|
30
30
|
import { inboundMessagesProjectionTable } from "./projection.js";
|
|
@@ -86,10 +86,12 @@ async function purgeExpiredMessages(args, cutoff) {
|
|
|
86
86
|
ids.push(row.id);
|
|
87
87
|
}
|
|
88
88
|
if (ids.length > 0) {
|
|
89
|
-
await
|
|
90
|
-
|
|
89
|
+
const deleted = await deleteRowsWithoutReplayableStream(args.db, {
|
|
90
|
+
table: inboundMessagesProjectionTable,
|
|
91
|
+
ids,
|
|
92
|
+
tenantId: args.tenantId,
|
|
91
93
|
});
|
|
92
|
-
messagesPurged +=
|
|
94
|
+
messagesPurged += deleted.length;
|
|
93
95
|
}
|
|
94
96
|
if (rows.length < BATCH_LIMIT)
|
|
95
97
|
break;
|
package/dist/jobs/feature.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { defineFeature, i18nKey, } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { JOB_RUN_DETAIL_SCREEN_ID, JOB_RUNS_SCREEN_ID, JobHandlers, JobQueries, } from "./constants.js";
|
|
3
2
|
import { catalogQuery } from "./handlers/catalog.query.js";
|
|
4
3
|
import { detailQuery } from "./handlers/detail.query.js";
|
|
5
4
|
import { listQuery } from "./handlers/list.query.js";
|
|
@@ -11,10 +10,11 @@ import { createStaleRunSweepJob, DEFAULT_JOB_RUN_STALE_TIMEOUT_HOURS, } from "./
|
|
|
11
10
|
import { tenantFailuresQuery } from "./handlers/tenant-failures.query.js";
|
|
12
11
|
import { tenantRunsQuery } from "./handlers/tenant-runs.query.js";
|
|
13
12
|
import { triggerWrite } from "./handlers/trigger.write.js";
|
|
14
|
-
import { JOBS_I18N } from "./i18n.js";
|
|
15
13
|
import { jobRunLogsTableMeta, jobRunsTableMeta } from "./job-run-table.js";
|
|
16
14
|
import { tenantJobFailuresTableMeta } from "./tenant-job-failure-table.js";
|
|
17
15
|
import { tenantJobRunsTableMeta } from "./tenant-job-run-table.js";
|
|
16
|
+
import { JOB_RUN_DETAIL_SCREEN_ID, JOB_RUNS_SCREEN_ID, JobHandlers, JobQueries, } from "./web/constants.js";
|
|
17
|
+
import { JOBS_I18N } from "./web/i18n.js";
|
|
18
18
|
export function createJobsFeature(options = {}) {
|
|
19
19
|
const retentionDays = options.retentionDays ?? DEFAULT_JOB_RUN_RETENTION_DAYS;
|
|
20
20
|
const staleRunTimeoutHours = options.staleRunTimeoutHours ?? DEFAULT_JOB_RUN_STALE_TIMEOUT_HOURS;
|
|
@@ -5,8 +5,8 @@ import { InternalError, NotFoundError, UnprocessableError, writeFailure, } from
|
|
|
5
5
|
import { parseJsonOrThrow } from "@cosmicdrift/kumiko-framework/utils";
|
|
6
6
|
import * as z from "zod";
|
|
7
7
|
import { decryptStoredPii } from "../../shared/index.js";
|
|
8
|
-
import { JobErrors } from "../constants.js";
|
|
9
8
|
import { jobRunsTable } from "../job-run-table.js";
|
|
9
|
+
import { JobErrors } from "../web/constants.js";
|
|
10
10
|
export const retryWrite = defineWriteHandler({
|
|
11
11
|
name: "retry",
|
|
12
12
|
description: "Re-dispatches a failed job run with its original payload and triggering user; use it to rerun a job that failed for a transient reason.",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { NotFoundError, UnprocessableError, validationErrorFromZod, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
3
|
import * as z from "zod";
|
|
4
|
-
import { JobErrors } from "../constants.js";
|
|
5
4
|
import { isManualTrigger } from "../is-manual-trigger.js";
|
|
5
|
+
import { JobErrors } from "../web/constants.js";
|
|
6
6
|
function invalidPayloadError() {
|
|
7
7
|
return new UnprocessableError(JobErrors.invalidPayload, {
|
|
8
8
|
i18nKey: "jobs.errors.invalidPayload",
|
package/dist/jobs/index.d.ts
CHANGED
|
@@ -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";
|
package/dist/jobs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { JOBS_FEATURE, JobErrors, JobHandlers, JobQueries } from "./constants.js";
|
|
2
1
|
export { createJobsFeature } from "./feature.js";
|
|
3
2
|
export { createJobRunLogger } from "./job-run-logger.js";
|
|
4
3
|
export { jobRunLogsTable, jobRunsTable } from "./job-run-table.js";
|
|
5
4
|
export { tenantJobFailuresTable } from "./tenant-job-failure-table.js";
|
|
6
5
|
export { tenantJobRunsTable } from "./tenant-job-run-table.js";
|
|
6
|
+
export { JOBS_FEATURE, JobErrors, JobHandlers, JobQueries } from "./web/constants.js";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
import { mergeTranslations } from "@cosmicdrift/kumiko-renderer";
|
|
3
|
-
import { JOBS_FEATURE } from "
|
|
4
|
-
import { defaultTranslations } from "./
|
|
2
|
+
import { JOBS_FEATURE } from "./constants.js";
|
|
3
|
+
import { defaultTranslations } from "./default-translations.js";
|
|
5
4
|
export function jobsClient(options) {
|
|
6
5
|
return {
|
|
7
6
|
name: JOBS_FEATURE,
|
package/dist/jobs/web/i18n.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type LocalizedString = {
|
|
2
|
+
readonly en: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const JOBS_I18N: Readonly<Record<string, LocalizedString>>;
|
|
5
|
+
export {};
|
package/dist/jobs/web/i18n.js
CHANGED
|
@@ -1,4 +1,51 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// Server + client i18n for jobs operator screens.
|
|
2
|
+
export const JOBS_I18N = {
|
|
3
|
+
"screen:job-runs.title": { en: "Job runs" },
|
|
4
|
+
"screen:job-run-detail.title": { en: "Job run" },
|
|
5
|
+
"screen:job-trigger.title": { en: "Trigger job" },
|
|
6
|
+
"jobs.screen.job-trigger.subtitle": {
|
|
7
|
+
en: "Start a job manually by name, with an optional JSON payload.",
|
|
8
|
+
},
|
|
9
|
+
"jobs.screen.job-run-detail.subtitle": {
|
|
10
|
+
en: "Status, timings, error and log lines of one job run.",
|
|
11
|
+
},
|
|
12
|
+
"jobs:entity:__action-form__:field:jobName": { en: "Job name" },
|
|
13
|
+
"jobs:entity:__action-form__:field:payload": { en: "JSON payload" },
|
|
14
|
+
"jobs:nav.jobRuns": { en: "Jobs" },
|
|
15
|
+
"jobs.runs.open": { en: "Details" },
|
|
16
|
+
"jobs.runs.filter.status": { en: "Status" },
|
|
17
|
+
"jobs.runs.filter.completed": { en: "Completed" },
|
|
18
|
+
"jobs.runs.filter.failed": { en: "Failed" },
|
|
19
|
+
"jobs.runs.filter.running": { en: "Running" },
|
|
20
|
+
"jobs.runs.filter.queued": { en: "Queued" },
|
|
21
|
+
"jobs.runs.col.job": { en: "Job" },
|
|
22
|
+
"jobs.runs.col.status": { en: "Status" },
|
|
23
|
+
"jobs.runs.col.started": { en: "Started" },
|
|
24
|
+
"jobs.runs.col.duration": { en: "Duration (ms)" },
|
|
25
|
+
"jobs.detail.field.job": { en: "Job" },
|
|
26
|
+
"jobs.detail.field.status": { en: "Status" },
|
|
27
|
+
"jobs.detail.field.id": { en: "Run ID" },
|
|
28
|
+
"jobs.detail.field.started": { en: "Started" },
|
|
29
|
+
"jobs.detail.field.finished": { en: "Finished" },
|
|
30
|
+
"jobs.detail.field.duration": { en: "Duration (ms)" },
|
|
31
|
+
"jobs.detail.field.error": { en: "Error" },
|
|
32
|
+
"jobs.detail.logs": { en: "Logs" },
|
|
33
|
+
"jobs.detail.retry": { en: "Retry" },
|
|
34
|
+
"jobs.trigger.title": { en: "Run a job" },
|
|
35
|
+
"jobs.errors.invalidCursor": { en: "The pagination cursor is invalid." },
|
|
36
|
+
"jobs.trigger.submit": { en: "Run" },
|
|
37
|
+
"jobs.errors.unknownJob": { en: "Unknown job." },
|
|
38
|
+
"jobs.errors.notManual": {
|
|
39
|
+
en: "This job cannot be triggered manually.",
|
|
40
|
+
},
|
|
41
|
+
"jobs.errors.invalidPayload": {
|
|
42
|
+
en: "The payload must be a valid JSON object.",
|
|
43
|
+
},
|
|
44
|
+
"jobs.errors.notFound": { en: "Not found." },
|
|
45
|
+
"jobs.errors.onlyFailedCanRetry": {
|
|
46
|
+
en: "Only failed runs can be retried.",
|
|
47
|
+
},
|
|
48
|
+
"jobs.errors.payloadErased": {
|
|
49
|
+
en: "This run's payload can no longer be read — the triggering user's data was erased.",
|
|
50
|
+
},
|
|
51
|
+
};
|
package/dist/jobs/web/index.js
CHANGED
package/dist/ledger/entity.d.ts
CHANGED
|
@@ -188,7 +188,7 @@ export declare const transactionEntity: import("@cosmicdrift/kumiko-types/fields
|
|
|
188
188
|
readonly minItems?: number;
|
|
189
189
|
readonly maxItems?: number;
|
|
190
190
|
readonly derived?: Readonly<Record<string, import("@cosmicdrift/kumiko-types/fields").EmbeddedDerivedCellDef>>;
|
|
191
|
-
readonly totals?: readonly
|
|
191
|
+
readonly totals?: readonly import("@cosmicdrift/kumiko-types/fields").EmbeddedTotalDef[];
|
|
192
192
|
readonly totalsMatch?: Readonly<Record<string, string>>;
|
|
193
193
|
} & import("@cosmicdrift/kumiko-types/fields").ResolvedPiiFlags & {
|
|
194
194
|
multiple: true;
|
package/dist/ledger/entity.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sql } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { createDateField, createEmbeddedListField, createEntity, createNumberField, createSelectField, createTextField, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
-
import { ACCOUNT_TYPES, SCHEDULE_INTERVALS, TRANSACTION_STATUS } from "./constants.js";
|
|
3
|
+
import { ACCOUNT_TYPES, SCHEDULE_INTERVALS, TRANSACTION_STATUS } from "./web/constants.js";
|
|
4
4
|
// account — a node in the chart of accounts. Event-sourced (create/update/list/
|
|
5
5
|
// detail via the standard handlers); the framework projects `read_ledger_accounts`
|
|
6
6
|
// from its CRUD events. `parentId` null → root account; otherwise the chart-of-
|
package/dist/ledger/feature.js
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
//
|
|
13
13
|
// Spec: kumiko-platform/docs/plans/ledger-feature.md
|
|
14
14
|
import { defineEntityCreateHandler, defineEntityDetailHandler, defineEntityListHandler, defineEntityUpdateHandler, defineFeature, } from "@cosmicdrift/kumiko-framework/engine";
|
|
15
|
-
import { DEFAULT_LEDGER_ACCESS, LEDGER_FEATURE_NAME } from "./constants.js";
|
|
16
15
|
import { accountEntity, scheduleEntity, transactionEntity } from "./entity.js";
|
|
17
16
|
import { createConfirmSchedulePeriodHandler } from "./handlers/confirm-schedule-period.write.js";
|
|
18
17
|
import { createCreateTransactionHandler } from "./handlers/create-transaction.write.js";
|
|
19
18
|
import { createBalanceSheetHandler, createBalancesReportHandler, createIncomeStatementHandler, } from "./handlers/reports.query.js";
|
|
20
19
|
import { createReverseTransactionHandler } from "./handlers/reverse-transaction.write.js";
|
|
21
20
|
import { requireScheduleSubjectPair } from "./schedule-subject-pair.js";
|
|
21
|
+
import { DEFAULT_LEDGER_ACCESS, LEDGER_FEATURE_NAME } from "./web/constants.js";
|
|
22
22
|
function registerLedger(r, access, toggleable) {
|
|
23
23
|
r.describe("Double-entry bookkeeping primitive. Owns two event-sourced entities — the per-tenant `account` chart of accounts (`read_ledger_accounts`, self-referential via parentId, typed asset/liability/equity/income/expense) and immutable `transaction` journal entries (`read_ledger_transactions`) whose balanced posting lines are embedded as jsonb (Σ amount = 0, signed integer minor units). The account catalog uses the generic entity handlers (create, update, list, detail); create-transaction books a balanced entry (Σ=0 and ≥2 distinct accounts enforced at the command boundary, referential integrity against accounts checked) and reverse-transaction books its Storno mirror — there is deliberately NO transaction update/delete, so a posted entry is an immutable fact and the audit trail stays intact. Recurring schedules (`read_ledger_schedules`) layer Dauerauftrag templates on top — a schedule names debit/credit accounts, an amount, a monthly interval and an optional caller-assigned `sourceRef` key (filterable, to find a schedule again), from which the Soll (forecast) is a pure projection (projectSchedule) needing no bookings, and confirm-schedule-period materialises one period as an idempotent, reversal-aware balanced entry referencing scheduleReference(id, period); only confirming writes. Balances and reports (balance sheet, P&L, cashflow) derive as pure queries over the postings. Everything financial — banking, accounting, rent cashflow, credits, invoices — models as accounts + balanced transactions on top. Pin roles with createLedgerFeature({ roles }) or adopt the host model with { access }; pass { toggleable: { default: false } } to tier-gate the whole feature.");
|
|
24
24
|
r.uiHints({
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { acquireNamespacedAdvisoryLock } from "@cosmicdrift/kumiko-framework/db";
|
|
2
1
|
import { NotFoundError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
2
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
4
|
-
import { DEFAULT_LEDGER_ACCESS } from "../constants.js";
|
|
5
3
|
import { accountExecutor, scheduleExecutor, transactionExecutor, transactionTable, } from "../executor.js";
|
|
6
4
|
import { findReversedIds, isoMonth, scheduleReference } from "../recurring.js";
|
|
7
5
|
import { confirmSchedulePeriodPayloadSchema, } from "../schemas.js";
|
|
8
6
|
import { readSubjectReference } from "../subject-reference.js";
|
|
7
|
+
import { DEFAULT_LEDGER_ACCESS } from "../web/constants.js";
|
|
9
8
|
// pg_advisory_xact_lock namespace (int4): 'lcsp' as ASCII, disjoint from the
|
|
10
9
|
// framework's other fixed advisory-lock keys.
|
|
11
10
|
const CONFIRM_PERIOD_LOCK_NAMESPACE = 0x6c637370;
|
|
12
|
-
const CONFIRM_PERIOD_LOCK_REASON = "takes the per-(tenant, reference) advisory lock so parallel confirms cannot both pass the already-booked check; TenantDb has no lock API";
|
|
13
11
|
// confirm-schedule-period — turn ONE projected period of a schedule into a posted,
|
|
14
12
|
// balanced transaction (debit +amount / credit −amount), tagged with
|
|
15
13
|
// scheduleReference(scheduleId, period) so the host can merge Soll vs. Ist.
|
|
@@ -24,7 +22,6 @@ export function createConfirmSchedulePeriodHandler(access = DEFAULT_LEDGER_ACCES
|
|
|
24
22
|
name: "confirm-schedule-period",
|
|
25
23
|
schema: confirmSchedulePeriodPayloadSchema,
|
|
26
24
|
access,
|
|
27
|
-
escapeHatch: { grants: ["unsafeRaw"], reason: CONFIRM_PERIOD_LOCK_REASON },
|
|
28
25
|
description: "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.",
|
|
29
26
|
handler: async (event, ctx) => {
|
|
30
27
|
const payload = event.payload; // @cast-boundary engine-payload
|
|
@@ -50,7 +47,7 @@ export function createConfirmSchedulePeriodHandler(access = DEFAULT_LEDGER_ACCES
|
|
|
50
47
|
// tx's `reference` names its id).
|
|
51
48
|
// No unique index on (tenantId, reference): a Storno makes re-confirming the
|
|
52
49
|
// same reference legitimate, so the check-then-write is serialized by a lock.
|
|
53
|
-
await
|
|
50
|
+
await ctx.db.advisoryXactLock(CONFIRM_PERIOD_LOCK_NAMESPACE, reference);
|
|
54
51
|
const candidates = await ctx.db.selectMany(transactionTable, {
|
|
55
52
|
tenantId: event.user.tenantId,
|
|
56
53
|
reference,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NotFoundError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
2
2
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
3
|
-
import { DEFAULT_LEDGER_ACCESS } from "../constants.js";
|
|
4
3
|
import { accountExecutor, transactionExecutor } from "../executor.js";
|
|
5
4
|
import { createTransactionPayloadSchema } from "../schemas.js";
|
|
5
|
+
import { DEFAULT_LEDGER_ACCESS } from "../web/constants.js";
|
|
6
6
|
// create-transaction — books a balanced journal entry. The Σ=0 and ≥2-accounts
|
|
7
7
|
// invariants are enforced by createTransactionPayloadSchema (command boundary).
|
|
8
8
|
// This handler adds referential integrity (every posting's account must exist —
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { DEFAULT_LEDGER_ACCESS } from "../constants.js";
|
|
3
2
|
import { accountTable, transactionTable } from "../executor.js";
|
|
4
3
|
import { accountBalances, balanceSheet, incomeStatement, toAccounts, toEntries, } from "../reports.js";
|
|
4
|
+
import { DEFAULT_LEDGER_ACCESS } from "../web/constants.js";
|
|
5
5
|
// Reports take an optional reporting period. Balance-sheet is cumulative → pass
|
|
6
6
|
// { to: asOf }; income-statement is a period → { from, to }.
|
|
7
7
|
const periodSchema = z.object({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ConflictError, NotFoundError, UnprocessableError, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
|
|
2
2
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
3
|
-
import { DEFAULT_LEDGER_ACCESS } from "../constants.js";
|
|
4
3
|
import { transactionExecutor, transactionTable } from "../executor.js";
|
|
5
4
|
import { normalizeLines } from "../reports.js";
|
|
6
5
|
import { reverseTransactionPayloadSchema } from "../schemas.js";
|
|
7
6
|
import { readSubjectReference } from "../subject-reference.js";
|
|
7
|
+
import { DEFAULT_LEDGER_ACCESS } from "../web/constants.js";
|
|
8
8
|
// reverse-transaction (Storno) — the ONLY correction path for a posted entry.
|
|
9
9
|
// Books the mirror image (every amount negated) as a new posted entry that
|
|
10
10
|
// references the original, leaving the original untouched. This is why
|
package/dist/ledger/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { ACCOUNT_TYPES, type AccountType, DEFAULT_LEDGER_ACCESS, DEFAULT_LEDGER_ROLES, LEDGER_FEATURE_NAME, LedgerHandlers, LedgerQueries, SCHEDULE_INTERVALS, type ScheduleInterval, TRANSACTION_STATUS, type TransactionStatus, } from "./constants.ts";
|
|
2
1
|
export { accountEntity, scheduleEntity, transactionEntity } from "./entity.ts";
|
|
3
2
|
export { createLedgerFeature, type LedgerFeatureOptions, } from "./feature.ts";
|
|
4
3
|
export { confirmSchedulePeriodHandler, createConfirmSchedulePeriodHandler, } from "./handlers/confirm-schedule-period.write.ts";
|
|
@@ -8,3 +7,4 @@ export { createReverseTransactionHandler, reverseTransactionHandler, } from "./h
|
|
|
8
7
|
export { findReversedIds, type LedgerTxRow, mergeScheduleActuals, type ProjectedPeriod, projectSchedule, type ScheduleDef, type ScheduleMonth, type ScheduleMonthStatus, scheduleReference, } from "./recurring.ts";
|
|
9
8
|
export { type AccountBalance, accountBalances, type BalanceSheet, type BalancesReport, balanceSheet, type IncomeStatement, incomeStatement, type LedgerAccount, type LedgerEntry, type Period, rawBalances, } from "./reports.ts";
|
|
10
9
|
export { accountTypeSchema, type ConfirmSchedulePeriodPayload, type CreateTransactionPayload, confirmSchedulePeriodPayloadSchema, createTransactionPayloadSchema, type Posting, postingSchema, type ReverseTransactionPayload, reverseTransactionPayloadSchema, } from "./schemas.ts";
|
|
10
|
+
export { ACCOUNT_TYPES, type AccountType, DEFAULT_LEDGER_ACCESS, DEFAULT_LEDGER_ROLES, LEDGER_FEATURE_NAME, LedgerHandlers, LedgerQueries, SCHEDULE_INTERVALS, type ScheduleInterval, TRANSACTION_STATUS, type TransactionStatus, } from "./web/constants.ts";
|
package/dist/ledger/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { ACCOUNT_TYPES, DEFAULT_LEDGER_ACCESS, DEFAULT_LEDGER_ROLES, LEDGER_FEATURE_NAME, LedgerHandlers, LedgerQueries, SCHEDULE_INTERVALS, TRANSACTION_STATUS, } from "./constants.js";
|
|
2
1
|
export { accountEntity, scheduleEntity, transactionEntity } from "./entity.js";
|
|
3
2
|
export { createLedgerFeature, } from "./feature.js";
|
|
4
3
|
export { confirmSchedulePeriodHandler, createConfirmSchedulePeriodHandler, } from "./handlers/confirm-schedule-period.write.js";
|
|
@@ -8,3 +7,4 @@ export { createReverseTransactionHandler, reverseTransactionHandler, } from "./h
|
|
|
8
7
|
export { findReversedIds, mergeScheduleActuals, projectSchedule, scheduleReference, } from "./recurring.js";
|
|
9
8
|
export { accountBalances, balanceSheet, incomeStatement, rawBalances, } from "./reports.js";
|
|
10
9
|
export { accountTypeSchema, confirmSchedulePeriodPayloadSchema, createTransactionPayloadSchema, postingSchema, reverseTransactionPayloadSchema, } from "./schemas.js";
|
|
10
|
+
export { ACCOUNT_TYPES, DEFAULT_LEDGER_ACCESS, DEFAULT_LEDGER_ROLES, LEDGER_FEATURE_NAME, LedgerHandlers, LedgerQueries, SCHEDULE_INTERVALS, TRANSACTION_STATUS, } from "./web/constants.js";
|