@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
|
@@ -1,19 +1,18 @@
|
|
|
1
|
+
export { isResourceImageContentType } from "../shared/index.js";
|
|
1
2
|
export { createTemplateResolverApi, requireTemplateResolver, TemplateNotFoundError, } from "./api.js";
|
|
2
|
-
export { collectDocumentResourceKeys, compileDocumentBodyToHandlebars, toResourceDataUri, } from "./compile-document-body.js";
|
|
3
|
-
export { CONTENT_FORMATS, DEFAULT_MAIL_LAYOUT_SLUG, DEFAULT_PDF_LAYOUT_SLUG, DOCUMENT_HTML_KINDS, FALLBACK_LOCALE, NON_RENDER_KINDS, PDF_DEFAULT_MARGIN_MM, PDF_FOOTER_MARGIN_MM, PDF_HEADER_MARGIN_MM, PDF_ORIENTATIONS, PDF_PAGE_FORMATS, RENDER_KINDS, SYSTEM_TENANT_ID, TEMPLATE_KINDS, TEMPLATE_SCOPES, TEMPLATE_STATUSES, TEXT_BLOCK_KIND, UPSERT_KINDS, } from "./constants.js";
|
|
3
|
+
export { collectDocumentImageVariables, collectDocumentResourceKeys, compileDocumentBodyToHandlebars, toResourceDataUri, } from "./compile-document-body.js";
|
|
4
4
|
export { documentViolationsToFieldIssues, flattenParagraphsToLineBreaks, sanitizeDocumentHtml, sanitizeTemplateBody, } from "./document-sanitizer.js";
|
|
5
|
-
export { DOCUMENT_CONDITION_ATTRIBUTE, DOCUMENT_NODE_NAMES, DOCUMENT_TEXT_ALIGNMENTS, DocumentButton, DocumentCondition, DocumentDivider, DocumentLink, DocumentPageBreak, DocumentResource, DocumentTable, DocumentTableCell, DocumentTableHeader, DocumentTableRow, DocumentTextAlign, DocumentVariable, documentExtensions, isAllowedDocumentLinkHref, isDocumentPlaceholderHref, isDocumentReferenceName, isDocumentResourceKey, } from "./document-schema.js";
|
|
6
5
|
export { createTemplateResolverFeature } from "./feature.js";
|
|
7
6
|
export { localeSchema } from "./handlers/shared.js";
|
|
8
7
|
export { isHexColor, mailLayoutAppearance, } from "./layout-appearance.js";
|
|
9
8
|
export { readLayoutRegions, sanitizeLayoutHtml, } from "./layout-regions.js";
|
|
10
9
|
export { fileAttachmentsOf, imageLinksOf, parseLinkedResourceEntries, pdfAttachmentLinksOf, templatePdfAttachmentLinkSchema, } from "./linked-resources.js";
|
|
11
10
|
export { prepareDocumentForPrint } from "./print-document.js";
|
|
12
|
-
export { TEMPLATE_RESOLVER_FEATURE, TemplateResolverErrors, TemplateResolverHandlers, TemplateResolverQueries, } from "./qualified-names.js";
|
|
13
11
|
export { mapRecordToVariables } from "./record-mapping.js";
|
|
14
12
|
export { prepareTemplateResourceBeforeTransaction, readTemplateResourceMaxBytes, storePreparedTemplateResource, } from "./store-template-resource.js";
|
|
15
13
|
export { templateResourceEntity, templateResourcesTable, } from "./table.js";
|
|
16
14
|
export { templateBundleSchema } from "./template-bundle.js";
|
|
15
|
+
export { templateEditAccess, } from "./template-edit-policy.js";
|
|
17
16
|
export { isMailTemplateMeta, MAIL_CATEGORIES, MAIL_TONES, parseTemplateMeta, pdfAttachmentFileNamePatternSchema, readMailLayoutMeta, readPdfTemplateMeta, templateSlugSchema, } from "./template-meta.js";
|
|
18
17
|
export { evaluateDocumentDraft } from "./template-preview.js";
|
|
19
18
|
export { readTemplateResource } from "./template-resources.js";
|
|
@@ -21,3 +20,6 @@ export { isSystemOnlyTemplate } from "./template-system-only.js";
|
|
|
21
20
|
export { collectTemplateUsage } from "./template-usage.js";
|
|
22
21
|
export { hasPlaceholderProblems, resolveTemplateVariables, SYSTEM_PLACEHOLDERS, systemPlaceholdersFor, validateTemplatePlaceholders, } from "./template-validation.js";
|
|
23
22
|
export { userContentEntriesTable, userContentEntryEntity, } from "./user-content-table.js";
|
|
23
|
+
export { CONTENT_FORMATS, DEFAULT_MAIL_LAYOUT_SLUG, DEFAULT_PDF_LAYOUT_SLUG, DOCUMENT_HTML_KINDS, FALLBACK_LOCALE, NON_RENDER_KINDS, PDF_DEFAULT_MARGIN_MM, PDF_FOOTER_MARGIN_MM, PDF_HEADER_MARGIN_MM, PDF_ORIENTATIONS, PDF_PAGE_FORMATS, RENDER_KINDS, SYSTEM_TENANT_ID, TEMPLATE_KINDS, TEMPLATE_SCOPES, TEMPLATE_STATUSES, TEXT_BLOCK_KIND, UPSERT_KINDS, } from "./web/constants.js";
|
|
24
|
+
export { DOCUMENT_CONDITION_ATTRIBUTE, DOCUMENT_NODE_NAMES, DOCUMENT_TEXT_ALIGNMENTS, DocumentButton, DocumentCondition, DocumentDivider, DocumentLink, DocumentPageBreak, DocumentResource, DocumentTable, DocumentTableCell, DocumentTableHeader, DocumentTableRow, DocumentTextAlign, DocumentVariable, documentExtensions, isAllowedDocumentLinkHref, isDocumentPlaceholderHref, isDocumentReferenceName, isDocumentResourceKey, } from "./web/document-schema.js";
|
|
25
|
+
export { TEMPLATE_RESOLVER_FEATURE, TemplateResolverErrors, TemplateResolverHandlers, TemplateResolverQueries, } from "./web/qualified-names.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HEX_COLOR_PATTERN } from "./constants.js";
|
|
2
1
|
import { readMailLayoutMeta } from "./template-meta.js";
|
|
2
|
+
import { HEX_COLOR_PATTERN } from "./web/constants.js";
|
|
3
3
|
const FONT_FAMILIES = {
|
|
4
4
|
sans: "Arial, Helvetica, sans-serif",
|
|
5
5
|
serif: "Georgia, 'Times New Roman', serif",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ContentFormat } from "./constants.ts";
|
|
2
1
|
import { type DocumentViolation, type SanitizeBodyResult } from "./document-sanitizer.ts";
|
|
2
|
+
import type { ContentFormat } from "./web/constants.ts";
|
|
3
3
|
export type LayoutRegions = {
|
|
4
4
|
readonly header: string;
|
|
5
5
|
readonly signature: string;
|
|
@@ -2,8 +2,8 @@ import { type DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
|
2
2
|
import { type Registry, type SessionUser, type TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import type { Dispatcher } from "@cosmicdrift/kumiko-framework/pipeline";
|
|
4
4
|
import { type SeedIfExists } from "@cosmicdrift/kumiko-framework/seeding";
|
|
5
|
-
import { type ContentFormat, type UpsertKind } from "./constants.ts";
|
|
6
5
|
import type { TemplateBundle } from "./template-bundle.ts";
|
|
6
|
+
import { type ContentFormat, type UpsertKind } from "./web/constants.ts";
|
|
7
7
|
export type SeedSystemTemplateOptions = {
|
|
8
8
|
readonly slug: string;
|
|
9
9
|
readonly kind: UpsertKind;
|
|
@@ -16,6 +16,9 @@ export type SeedSystemTemplateOptions = {
|
|
|
16
16
|
readonly linkedResources?: Record<string, string>;
|
|
17
17
|
readonly meta?: unknown;
|
|
18
18
|
readonly title?: string;
|
|
19
|
+
/** Translatable title for the overview and designer, stored in the title column; the client
|
|
20
|
+
* shows the translation and falls back to the key. Mutually exclusive with `title`. */
|
|
21
|
+
readonly titleI18nKey?: string;
|
|
19
22
|
readonly parentTemplateId?: string | null;
|
|
20
23
|
readonly by?: SessionUser;
|
|
21
24
|
readonly ifExists?: SeedIfExists;
|
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
//
|
|
9
9
|
// Default ifExists="skip". The actor is `createSystemUser(SYSTEM_TENANT_ID)`,
|
|
10
10
|
// deliberately not TestUsers (prod seeds are not test utilities).
|
|
11
|
-
import { createTenantDb,
|
|
11
|
+
import { createTenantDb, fetchOne, } from "@cosmicdrift/kumiko-framework/db";
|
|
12
12
|
import { createSystemUser, SYSTEM_TENANT_ID, } from "@cosmicdrift/kumiko-framework/engine";
|
|
13
|
-
import { getStreamVersion, getUnscopedStreamMaxVersionForSeed, } from "@cosmicdrift/kumiko-framework/event-store";
|
|
13
|
+
import { deleteRowsWithoutReplayableStream, getStreamVersion, getUnscopedStreamMaxVersionForSeed, } from "@cosmicdrift/kumiko-framework/event-store";
|
|
14
14
|
import { runEventStoreSeed } from "@cosmicdrift/kumiko-framework/seeding";
|
|
15
15
|
import { isPlainObject } from "@cosmicdrift/kumiko-types/type-guards";
|
|
16
|
-
import { TEXT_BLOCK_KIND } from "./constants.js";
|
|
17
16
|
import { executor } from "./handlers/shared.js";
|
|
18
17
|
import { evaluateTemplateWrite } from "./handlers/template-gates.js";
|
|
19
|
-
import { TEMPLATE_RESOLVER_FEATURE, TemplateResolverHandlers } from "./qualified-names.js";
|
|
20
18
|
import { templateResourcesTable } from "./table.js";
|
|
21
19
|
import { activeStampChanges, servedStampChanges } from "./template-draft.js";
|
|
22
20
|
import { templateSlugSchema } from "./template-meta.js";
|
|
23
21
|
import { variablesFromSchema } from "./template-validation.js";
|
|
22
|
+
import { TEXT_BLOCK_KIND } from "./web/constants.js";
|
|
23
|
+
import { TEMPLATE_RESOLVER_FEATURE, TemplateResolverHandlers } from "./web/qualified-names.js";
|
|
24
24
|
/** Drop projection orphans (no events anywhere) so boot seeds can recreate. */
|
|
25
25
|
async function resolveExistingForEventStoreSeed(db, tdb, existingRow, tenantId) {
|
|
26
26
|
if (existingRow == null)
|
|
@@ -34,12 +34,17 @@ async function resolveExistingForEventStoreSeed(db, tdb, existingRow, tenantId)
|
|
|
34
34
|
if (unscoped !== 0) {
|
|
35
35
|
throw new Error(`seed orphan check: projection ${id} has no events for tenant ${tenantId} but unscoped stream version is ${unscoped} — refusing delete/recreate to avoid wiping a live stream`);
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
await deleteMany(tdb, templateResourcesTable, { id, tenantId });
|
|
37
|
+
await deleteRowsWithoutReplayableStream(tdb, { table: templateResourcesTable, ids: [id] });
|
|
39
38
|
return null;
|
|
40
39
|
}
|
|
41
40
|
return { id, version: streamVersion };
|
|
42
41
|
}
|
|
42
|
+
function seedTitleColumn(opts, label) {
|
|
43
|
+
if (opts.title !== undefined && opts.titleI18nKey !== undefined) {
|
|
44
|
+
throw new Error(`${label} rejected: set either title or titleI18nKey, not both`);
|
|
45
|
+
}
|
|
46
|
+
return opts.titleI18nKey ?? opts.title ?? null;
|
|
47
|
+
}
|
|
43
48
|
export async function seedSystemTemplate(db, opts) {
|
|
44
49
|
const tenantId = SYSTEM_TENANT_ID;
|
|
45
50
|
const by = opts.by ?? createSystemUser(tenantId);
|
|
@@ -48,6 +53,7 @@ export async function seedSystemTemplate(db, opts) {
|
|
|
48
53
|
const slug = templateSlugSchema.safeParse(opts.slug);
|
|
49
54
|
if (!slug.success)
|
|
50
55
|
throw new Error(`${label} rejected: ${slug.error.issues[0]?.message}`);
|
|
56
|
+
const title = seedTitleColumn(opts, label);
|
|
51
57
|
const evaluated = evaluateTemplateWrite({
|
|
52
58
|
kind: opts.kind,
|
|
53
59
|
scope: "system",
|
|
@@ -81,7 +87,7 @@ export async function seedSystemTemplate(db, opts) {
|
|
|
81
87
|
variableSchema,
|
|
82
88
|
...(linkedResources !== undefined && { linkedResources }),
|
|
83
89
|
meta,
|
|
84
|
-
title
|
|
90
|
+
title,
|
|
85
91
|
folder: null,
|
|
86
92
|
scope: "system",
|
|
87
93
|
parentTemplateId,
|
|
@@ -3,14 +3,14 @@ import { NotFoundError, UnprocessableError, writeFailure, } from "@cosmicdrift/k
|
|
|
3
3
|
import { createFileRefFromUploadedBytes, uploadFileBytesBeforeTransaction, } from "@cosmicdrift/kumiko-framework/files";
|
|
4
4
|
import { fileContextForTenant } from "../file-foundation/index.js";
|
|
5
5
|
import { extensionForResourceContentType, requireForTenant } from "../shared/index.js";
|
|
6
|
-
import { ACTIVE_TEMPLATE_STATUS, SYSTEM_TENANT_ID } from "./constants.js";
|
|
7
6
|
import { DEFAULT_RESOURCE_MAX_BYTES, MAX_FILE_ATTACHMENTS_PER_TEMPLATE, RESOURCE_MAX_BYTES_CONFIG_KEY, } from "./handlers/resource-shared.js";
|
|
8
7
|
import { executor } from "./handlers/shared.js";
|
|
9
8
|
import { attachmentEntriesOf, parseLinkedResourceEntries, templatePdfAttachmentLinkSchema, } from "./linked-resources.js";
|
|
10
|
-
import { TemplateResolverErrors } from "./qualified-names.js";
|
|
11
9
|
import { normalizeResourceImage } from "./resource-image.js";
|
|
12
10
|
import { templateResourcesTable } from "./table.js";
|
|
13
11
|
import { readTemplateResource } from "./template-resources.js";
|
|
12
|
+
import { ACTIVE_TEMPLATE_STATUS, SYSTEM_TENANT_ID } from "./web/constants.js";
|
|
13
|
+
import { TemplateResolverErrors } from "./web/qualified-names.js";
|
|
14
14
|
export async function readTemplateResourceMaxBytes(config, registry) {
|
|
15
15
|
if (config === undefined || registry.getConfigKey(RESOURCE_MAX_BYTES_CONFIG_KEY) === undefined) {
|
|
16
16
|
return DEFAULT_RESOURCE_MAX_BYTES;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { buildEntityTable } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { createEntity, createLongTextField, createNumberField, createSelectField, createTextField, createTimestampField, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
-
import { CONTENT_FORMATS, TEMPLATE_KINDS, TEMPLATE_SCOPES, TEMPLATE_STATUSES, } from "./constants.js";
|
|
3
|
+
import { CONTENT_FORMATS, TEMPLATE_KINDS, TEMPLATE_SCOPES, TEMPLATE_STATUSES, } from "./web/constants.js";
|
|
4
4
|
// Stored v1 events name the kind "mail-html", which is now "mail".
|
|
5
5
|
const renameMailHtmlKind = {
|
|
6
6
|
fromVersion: 1,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { CONTENT_FORMATS, UPSERT_KINDS } from "./constants.js";
|
|
3
|
-
import { isDocumentResourceKey } from "./document-schema.js";
|
|
4
2
|
import { templatePdfAttachmentLinkSchema } from "./linked-resources.js";
|
|
5
3
|
import { templateSlugSchema } from "./template-meta.js";
|
|
4
|
+
import { CONTENT_FORMATS, UPSERT_KINDS } from "./web/constants.js";
|
|
5
|
+
import { isDocumentResourceKey } from "./web/document-schema.js";
|
|
6
6
|
const MAX_RESOURCES = 20;
|
|
7
7
|
const MAX_LOCALES = 50;
|
|
8
8
|
const MAX_RESOURCE_BYTES = 2 * 1024 * 1024;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Registry } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
type DeliveryTarget = {
|
|
3
|
+
readonly kind: string;
|
|
4
|
+
readonly slug: string;
|
|
5
|
+
};
|
|
6
|
+
export type TemplateDeliveryPolicy = {
|
|
7
|
+
readonly tenantEditable: readonly DeliveryTarget[];
|
|
8
|
+
/** Kinds of collections mounted with an explicit `access`; their tenant rows are edited by design. */
|
|
9
|
+
readonly collectionKinds: readonly string[];
|
|
10
|
+
};
|
|
11
|
+
export declare function isTenantOverrideServed(policy: TemplateDeliveryPolicy, target: DeliveryTarget): boolean;
|
|
12
|
+
export declare function isServedByCollectionOnly(policy: TemplateDeliveryPolicy, target: DeliveryTarget): boolean;
|
|
13
|
+
export declare function isRowServed(policy: TemplateDeliveryPolicy, row: DeliveryTarget & {
|
|
14
|
+
readonly tenantId: string;
|
|
15
|
+
}): boolean;
|
|
16
|
+
export declare function isRowServedTo(policy: TemplateDeliveryPolicy, user: {
|
|
17
|
+
readonly roles: readonly string[];
|
|
18
|
+
}, row: DeliveryTarget & {
|
|
19
|
+
readonly tenantId: string;
|
|
20
|
+
}): boolean;
|
|
21
|
+
export declare function deliveryPolicyOf(registry: Registry): TemplateDeliveryPolicy;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { isPlainObject, propertyOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
2
|
+
import { isSystemAdmin } from "./template-draft.js";
|
|
3
|
+
import { SYSTEM_TENANT_ID } from "./web/constants.js";
|
|
4
|
+
import { TEMPLATE_RESOLVER_FEATURE } from "./web/qualified-names.js";
|
|
5
|
+
const NOTHING_UNLOCKED = { tenantEditable: [], collectionKinds: [] };
|
|
6
|
+
export function isTenantOverrideServed(policy, target) {
|
|
7
|
+
return (policy.collectionKinds.includes(target.kind) ||
|
|
8
|
+
policy.tenantEditable.some((entry) => entry.kind === target.kind && entry.slug === target.slug));
|
|
9
|
+
}
|
|
10
|
+
// Served only because its kind belongs to a collection with `access`, not because the template
|
|
11
|
+
// is listed in tenantEditable. For these a system row of the same slug must win.
|
|
12
|
+
export function isServedByCollectionOnly(policy, target) {
|
|
13
|
+
return (policy.collectionKinds.includes(target.kind) &&
|
|
14
|
+
!policy.tenantEditable.some((entry) => entry.kind === target.kind && entry.slug === target.slug));
|
|
15
|
+
}
|
|
16
|
+
export function isRowServed(policy, row) {
|
|
17
|
+
return row.tenantId === SYSTEM_TENANT_ID || isTenantOverrideServed(policy, row);
|
|
18
|
+
}
|
|
19
|
+
// A SystemAdmin sees every stored row, so a locked override can still be reset; everyone else
|
|
20
|
+
// sees only what is delivered, which keeps a locked override out of the template-resolver queries for a TenantAdmin (the audit log keeps the history).
|
|
21
|
+
export function isRowServedTo(policy, user, row) {
|
|
22
|
+
return isSystemAdmin(user) || isRowServed(policy, row);
|
|
23
|
+
}
|
|
24
|
+
function isDeliveryTarget(value) {
|
|
25
|
+
return (typeof propertyOf(value, "kind") === "string" && typeof propertyOf(value, "slug") === "string");
|
|
26
|
+
}
|
|
27
|
+
function isTemplateDeliveryPolicy(value) {
|
|
28
|
+
if (!isPlainObject(value))
|
|
29
|
+
return false;
|
|
30
|
+
const { tenantEditable, collectionKinds } = value;
|
|
31
|
+
return (Array.isArray(tenantEditable) &&
|
|
32
|
+
tenantEditable.every(isDeliveryTarget) &&
|
|
33
|
+
Array.isArray(collectionKinds) &&
|
|
34
|
+
collectionKinds.every((kind) => typeof kind === "string"));
|
|
35
|
+
}
|
|
36
|
+
// Fail closed: without the mounted feature (or its exports) no tenant row counts as unlocked.
|
|
37
|
+
export function deliveryPolicyOf(registry) {
|
|
38
|
+
const exported = propertyOf(propertyOf(registry.getFeature(TEMPLATE_RESOLVER_FEATURE), "exports"), "deliveryPolicy");
|
|
39
|
+
return isTemplateDeliveryPolicy(exported) ? exported : NOTHING_UNLOCKED;
|
|
40
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
2
|
-
import { type ContentFormat } from "./constants.ts";
|
|
3
2
|
import type { TemplateResourceRow } from "./table.ts";
|
|
3
|
+
import { type ContentFormat } from "./web/constants.ts";
|
|
4
4
|
export type TemplateDraft = {
|
|
5
5
|
readonly content: string | null;
|
|
6
6
|
readonly contentFormat: ContentFormat;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import { CONTENT_FORMATS } from "./constants.js";
|
|
3
|
+
import { CONTENT_FORMATS } from "./web/constants.js";
|
|
4
4
|
const templateDraftSchema = z.object({
|
|
5
5
|
content: z.string().nullable(),
|
|
6
6
|
contentFormat: z.enum(CONTENT_FORMATS),
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type HandlerContext, type RoleAccessRule, type SessionUser } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import { type WriteFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
|
+
import type { TemplateKind } from "./web/constants.ts";
|
|
4
|
+
export type TenantEditableTemplate = {
|
|
5
|
+
readonly kind: TemplateKind;
|
|
6
|
+
readonly slug: string;
|
|
7
|
+
readonly access: RoleAccessRule;
|
|
8
|
+
};
|
|
9
|
+
export type TemplateEditPolicy = {
|
|
10
|
+
readonly tenantEditable: readonly TenantEditableTemplate[];
|
|
11
|
+
};
|
|
12
|
+
type EditTarget = {
|
|
13
|
+
readonly slug: string;
|
|
14
|
+
readonly kind: string;
|
|
15
|
+
};
|
|
16
|
+
type EditUser = Pick<SessionUser, "roles">;
|
|
17
|
+
export declare function templateEditAccess(entries: readonly TenantEditableTemplate[]): RoleAccessRule;
|
|
18
|
+
export declare function mayEditTemplate(policy: TemplateEditPolicy, user: EditUser, target: EditTarget): boolean;
|
|
19
|
+
export declare function refuseTemplateEdit(policy: TemplateEditPolicy, user: EditUser, target: EditTarget): WriteFailure | null;
|
|
20
|
+
export declare function refuseMissingTemplate(policy: TemplateEditPolicy, user: EditUser): WriteFailure | null;
|
|
21
|
+
export declare function refuseTemplateEditById(db: HandlerContext["db"], policy: TemplateEditPolicy, user: EditUser, tenantId: string, templateId: string): Promise<WriteFailure | null>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
|
+
import { hasAccess, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
+
import { AccessDeniedError, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
|
+
import { templateResourcesTable } from "./table.js";
|
|
5
|
+
import { isSystemAdmin } from "./template-draft.js";
|
|
6
|
+
import { TemplateResolverErrors } from "./web/qualified-names.js";
|
|
7
|
+
const SYSTEM_ADMIN_ROLE = "SystemAdmin";
|
|
8
|
+
export function templateEditAccess(entries) {
|
|
9
|
+
const roles = new Set([SYSTEM_ADMIN_ROLE]);
|
|
10
|
+
for (const entry of entries) {
|
|
11
|
+
for (const role of entry.access.roles)
|
|
12
|
+
roles.add(role);
|
|
13
|
+
}
|
|
14
|
+
return { roles: [...roles] };
|
|
15
|
+
}
|
|
16
|
+
export function mayEditTemplate(policy, user, target) {
|
|
17
|
+
if (isSystemAdmin(user))
|
|
18
|
+
return true;
|
|
19
|
+
const entry = policy.tenantEditable.find((candidate) => candidate.slug === target.slug && candidate.kind === target.kind);
|
|
20
|
+
return entry !== undefined && hasAccess(user, entry.access);
|
|
21
|
+
}
|
|
22
|
+
export function refuseTemplateEdit(policy, user, target) {
|
|
23
|
+
if (mayEditTemplate(policy, user, target))
|
|
24
|
+
return null;
|
|
25
|
+
return writeFailure(new AccessDeniedError({
|
|
26
|
+
i18nKey: "templateResolver.errors.templateNotTenantEditable",
|
|
27
|
+
details: { reason: TemplateResolverErrors.templateNotTenantEditable },
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
// Fail closed: a missing row gives a non-SystemAdmin the same refusal as a locked one,
|
|
31
|
+
// so the response never reveals whether an id exists. SystemAdmin keeps the 404.
|
|
32
|
+
export function refuseMissingTemplate(policy, user) {
|
|
33
|
+
return isSystemAdmin(user) ? null : refuseTemplateEdit(policy, user, { slug: "", kind: "" });
|
|
34
|
+
}
|
|
35
|
+
export async function refuseTemplateEditById(db, policy, user, tenantId, templateId) {
|
|
36
|
+
if (isSystemAdmin(user))
|
|
37
|
+
return null;
|
|
38
|
+
const row = await fetchOne(db, templateResourcesTable, {
|
|
39
|
+
tenantId,
|
|
40
|
+
id: templateId,
|
|
41
|
+
});
|
|
42
|
+
return row === undefined
|
|
43
|
+
? refuseMissingTemplate(policy, user)
|
|
44
|
+
: refuseTemplateEdit(policy, user, row);
|
|
45
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { type TemplateKind } from "./constants.ts";
|
|
3
|
-
import { MAIL_TONES, type MailTone } from "./mail-constants.ts";
|
|
2
|
+
import { type TemplateKind } from "./web/constants.ts";
|
|
3
|
+
import { MAIL_TONES, type MailTone } from "./web/mail-constants.ts";
|
|
4
4
|
export declare const templateSlugSchema: z.ZodString;
|
|
5
5
|
export declare const MAIL_CATEGORIES: readonly ["transactional", "marketing"];
|
|
6
6
|
export type MailCategory = (typeof MAIL_CATEGORIES)[number];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { HEX_COLOR_PATTERN, PDF_ORIENTATIONS, PDF_PAGE_FORMATS, } from "./constants.js";
|
|
3
|
-
import { MAIL_TONES } from "./mail-constants.js";
|
|
2
|
+
import { HEX_COLOR_PATTERN, PDF_ORIENTATIONS, PDF_PAGE_FORMATS, } from "./web/constants.js";
|
|
3
|
+
import { MAIL_TONES } from "./web/mail-constants.js";
|
|
4
4
|
// One or more kebab segments joined by ":" — notification templates are seeded
|
|
5
5
|
// under their qualified name `feature:notify:name`.
|
|
6
6
|
export const templateSlugSchema = z
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type HandlerContext, type SessionUser, type TemplateVariables } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { type KumikoError } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
3
|
import { type MailAttachmentRef } from "../renderer-foundation/index.ts";
|
|
4
|
-
import { type TemplateScope } from "./constants.ts";
|
|
5
4
|
import { validateTemplateDraft } from "./handlers/validate.query.ts";
|
|
6
5
|
import { type LayoutRegions, type TemplateWriteScope } from "./layout-regions.ts";
|
|
7
6
|
import { type PdfTemplateMeta } from "./template-meta.ts";
|
|
7
|
+
import { type TemplateScope } from "./web/constants.ts";
|
|
8
8
|
type LabelText = (label: string) => string;
|
|
9
9
|
export declare function sampleValuesFor(variables: TemplateVariables, labelText?: LabelText): Record<string, unknown>;
|
|
10
10
|
export type PreviewCheckCode = "resources_resolved" | "text_present" | "size_under_cap" | "required_placeholders";
|
|
@@ -10,15 +10,16 @@ import { fileContextForTenant } from "../file-foundation/index.js";
|
|
|
10
10
|
import { collectRendererPlugins, createRendererFoundationApi, RendererError, } from "../renderer-foundation/index.js";
|
|
11
11
|
import { createTemplateResolverApi, TemplateNotFoundError } from "./api.js";
|
|
12
12
|
import { collectDocumentResourceKeys } from "./compile-document-body.js";
|
|
13
|
-
import { DEFAULT_MAIL_LAYOUT_SLUG, DEFAULT_PDF_LAYOUT_SLUG, MAIL_PREVIEW_MAX_BYTES, SYSTEM_TENANT_ID, } from "./constants.js";
|
|
14
13
|
import { parseStoredJson } from "./handlers/template-gates.js";
|
|
15
14
|
import { validateTemplateDraft } from "./handlers/validate.query.js";
|
|
16
15
|
import { readLayoutRegions, sanitizeLayoutHtml, } from "./layout-regions.js";
|
|
17
16
|
import { parseLinkedResourceEntries } from "./linked-resources.js";
|
|
18
17
|
import { buildDisplayHtml } from "./preview-display-html.js";
|
|
19
|
-
import { TemplateResolverErrors } from "./qualified-names.js";
|
|
20
18
|
import { templateResourcesTable } from "./table.js";
|
|
19
|
+
import { deliveryPolicyOf, isRowServedTo } from "./template-delivery-policy.js";
|
|
21
20
|
import { isMailTemplateMeta, parseTemplateMeta, readPdfTemplateMeta, } from "./template-meta.js";
|
|
21
|
+
import { DEFAULT_MAIL_LAYOUT_SLUG, DEFAULT_PDF_LAYOUT_SLUG, MAIL_PREVIEW_MAX_BYTES, SYSTEM_TENANT_ID, } from "./web/constants.js";
|
|
22
|
+
import { TemplateResolverErrors } from "./web/qualified-names.js";
|
|
22
23
|
const SAMPLE_LINK = "https://example.com";
|
|
23
24
|
const SAMPLE_DATE = "2026-01-15";
|
|
24
25
|
const SAMPLE_LIST_ROWS = 3;
|
|
@@ -64,12 +65,17 @@ function sampleList(def, labelText) {
|
|
|
64
65
|
rows.push(sampleRow(def.item, labelText));
|
|
65
66
|
return rows;
|
|
66
67
|
}
|
|
68
|
+
function sampleValueFor(name, def, labelText) {
|
|
69
|
+
// An images variable has no sample: file ids are record data, never preview content.
|
|
70
|
+
if (def.type === "images")
|
|
71
|
+
return [];
|
|
72
|
+
return def.type === "list" ? sampleList(def, labelText) : sampleScalar(name, def, labelText);
|
|
73
|
+
}
|
|
67
74
|
// Declared examples win; the fallbacks are deterministic so a preview never differs between calls.
|
|
68
75
|
export function sampleValuesFor(variables, labelText = (label) => label) {
|
|
69
76
|
const values = {};
|
|
70
77
|
for (const [name, def] of Object.entries(variables)) {
|
|
71
|
-
values[name] =
|
|
72
|
-
def.type === "list" ? sampleList(def, labelText) : sampleScalar(name, def, labelText);
|
|
78
|
+
values[name] = sampleValueFor(name, def, labelText);
|
|
73
79
|
}
|
|
74
80
|
return values;
|
|
75
81
|
}
|
|
@@ -81,7 +87,7 @@ const utf8Bytes = (value) => new TextEncoder().encode(value).length;
|
|
|
81
87
|
const failed = (error) => ({ ok: false, error });
|
|
82
88
|
async function loadStoredDraft(ctx, user, input) {
|
|
83
89
|
try {
|
|
84
|
-
return await createTemplateResolverApi(ctx.db).resolveTemplate({
|
|
90
|
+
return await createTemplateResolverApi(ctx.db, ctx.registry).resolveTemplate({
|
|
85
91
|
tenantId: user.tenantId,
|
|
86
92
|
slug: input.slug,
|
|
87
93
|
kind: input.kind,
|
|
@@ -143,10 +149,13 @@ export function estimateMailBytes(args) {
|
|
|
143
149
|
async function loadEditedRowResources(ctx, user, input) {
|
|
144
150
|
const rows = await selectMany(ctx.db, templateResourcesTable, { tenantId: user.tenantId, slug: input.slug, kind: "mail", locale: input.locale }, { limit: 1 });
|
|
145
151
|
const row = rows[0];
|
|
152
|
+
if (row !== undefined && !isRowServedTo(deliveryPolicyOf(ctx.registry), user, row)) {
|
|
153
|
+
return undefined;
|
|
154
|
+
}
|
|
146
155
|
return row === undefined ? undefined : parseLinkedResourceEntries(row.linkedResources);
|
|
147
156
|
}
|
|
148
157
|
async function resolvePdfLayout(ctx, user, slug, locale) {
|
|
149
|
-
const api = createTemplateResolverApi(ctx.db);
|
|
158
|
+
const api = createTemplateResolverApi(ctx.db, ctx.registry);
|
|
150
159
|
const find = async (tenantId) => {
|
|
151
160
|
try {
|
|
152
161
|
return await api.resolveLayout({ tenantId, slug, kind: "pdf-layout", locale });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Registry } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { type TemplateKind } from "./constants.ts";
|
|
2
|
+
import { type TemplateKind } from "./web/constants.ts";
|
|
3
3
|
type UsageRole = "template" | "layout";
|
|
4
4
|
export type TemplateUsageEntry = {
|
|
5
5
|
readonly qualifiedName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseQn, } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { DEFAULT_MAIL_LAYOUT_SLUG } from "./constants.js";
|
|
2
|
+
import { DEFAULT_MAIL_LAYOUT_SLUG } from "./web/constants.js";
|
|
3
3
|
function layoutSlugsOf(qualifiedName, notification, effectiveLayouts) {
|
|
4
4
|
const stored = effectiveLayouts.get(qualifiedName);
|
|
5
5
|
const locales = new Set([
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { conditionScopeElement, withParsedDocument } from "./document-sanitizer.js";
|
|
3
|
-
import { DOCUMENT_CONDITION_ATTRIBUTE, isDocumentPlaceholderHref, isDocumentReferenceName, } from "./document-schema.js";
|
|
3
|
+
import { DOCUMENT_CONDITION_ATTRIBUTE, isDocumentPlaceholderHref, isDocumentReferenceName, } from "./web/document-schema.js";
|
|
4
4
|
export const SYSTEM_PLACEHOLDERS = new Set([
|
|
5
5
|
"tenantName",
|
|
6
6
|
"signature",
|
|
@@ -38,6 +38,7 @@ const scalarVariableSchema = z.discriminatedUnion("type", [
|
|
|
38
38
|
]);
|
|
39
39
|
const variableDefSchema = z.union([
|
|
40
40
|
scalarVariableSchema,
|
|
41
|
+
z.object({ ...variableCommon, type: z.literal("images") }),
|
|
41
42
|
z.object({
|
|
42
43
|
...variableCommon,
|
|
43
44
|
type: z.literal("list"),
|
|
@@ -74,7 +75,9 @@ function listItemFields(variables, listName) {
|
|
|
74
75
|
const def = listName !== null && Object.hasOwn(variables, listName) ? variables[listName] : undefined;
|
|
75
76
|
return def?.type === "list" ? def.item : {};
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
+
// An images variable holds file ids: as text it would leak them, so only an images block
|
|
79
|
+
// (and a condition on its presence) may name it.
|
|
80
|
+
function isKnownName(name, scope, itemFields, allowImages = false) {
|
|
78
81
|
const { variables } = scope;
|
|
79
82
|
const root = rootName(name);
|
|
80
83
|
// Declared variables and item fields are scalars: a dotted path under one never renders a value.
|
|
@@ -82,12 +85,15 @@ function isKnownName(name, scope, itemFields) {
|
|
|
82
85
|
return { known: true, used: "" };
|
|
83
86
|
if (scope.systemPlaceholders.has(root))
|
|
84
87
|
return { known: true, used: "" };
|
|
85
|
-
if (Object.hasOwn(variables, name))
|
|
86
|
-
return
|
|
88
|
+
if (Object.hasOwn(variables, name)) {
|
|
89
|
+
return variables[name]?.type === "images" && !allowImages
|
|
90
|
+
? { known: false, used: "" }
|
|
91
|
+
: { known: true, used: name };
|
|
92
|
+
}
|
|
87
93
|
return { known: false, used: "" };
|
|
88
94
|
}
|
|
89
|
-
function recordName(name, itemFields, scope) {
|
|
90
|
-
const resolution = isKnownName(name, scope, itemFields);
|
|
95
|
+
function recordName(name, itemFields, scope, allowImages = false) {
|
|
96
|
+
const resolution = isKnownName(name, scope, itemFields, allowImages);
|
|
91
97
|
if (!resolution.known)
|
|
92
98
|
scope.unknown.add(name);
|
|
93
99
|
else if (resolution.used !== "")
|
|
@@ -96,10 +102,21 @@ function recordName(name, itemFields, scope) {
|
|
|
96
102
|
function enclosingEachName(element) {
|
|
97
103
|
return element.closest("tr[data-each]")?.getAttribute("data-each") ?? null;
|
|
98
104
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
function nameAttributeOf(element) {
|
|
106
|
+
const tag = element.tagName.toLowerCase();
|
|
107
|
+
if (tag === "span")
|
|
108
|
+
return "data-variable";
|
|
109
|
+
if (tag !== "div")
|
|
110
|
+
return undefined;
|
|
111
|
+
return element.hasAttribute("data-images") ? "data-images" : "data-steps";
|
|
112
|
+
}
|
|
113
|
+
function recordImagesName(name, scope) {
|
|
114
|
+
const def = Object.hasOwn(scope.variables, name) ? scope.variables[name] : undefined;
|
|
115
|
+
if (def?.type === "images")
|
|
116
|
+
scope.used.add(name);
|
|
117
|
+
else
|
|
118
|
+
scope.unknown.add(name);
|
|
119
|
+
}
|
|
103
120
|
function scanRepeatRows(root, scope) {
|
|
104
121
|
for (const element of Array.from(root.querySelectorAll("tr[data-each]"))) {
|
|
105
122
|
const listName = element.getAttribute("data-each") ?? "";
|
|
@@ -113,15 +130,18 @@ function scanRepeatRows(root, scope) {
|
|
|
113
130
|
function scanConditions(root, scope) {
|
|
114
131
|
for (const element of Array.from(root.querySelectorAll(`[${DOCUMENT_CONDITION_ATTRIBUTE}]`))) {
|
|
115
132
|
const itemFields = listItemFields(scope.variables, enclosingEachName(conditionScopeElement(element)));
|
|
116
|
-
recordName(element.getAttribute(DOCUMENT_CONDITION_ATTRIBUTE) ?? "", itemFields, scope);
|
|
133
|
+
recordName(element.getAttribute(DOCUMENT_CONDITION_ATTRIBUTE) ?? "", itemFields, scope, true);
|
|
117
134
|
}
|
|
118
135
|
}
|
|
119
136
|
function scanReferences(root, scope) {
|
|
120
|
-
for (const element of Array.from(root.querySelectorAll("span[data-variable], div[data-steps], a[href], img[data-resource]"))) {
|
|
137
|
+
for (const element of Array.from(root.querySelectorAll("span[data-variable], div[data-steps], div[data-images], a[href], img[data-resource]"))) {
|
|
121
138
|
const itemFields = listItemFields(scope.variables, enclosingEachName(element));
|
|
122
139
|
const tag = element.tagName.toLowerCase();
|
|
123
|
-
const nameAttribute =
|
|
124
|
-
if (nameAttribute
|
|
140
|
+
const nameAttribute = nameAttributeOf(element);
|
|
141
|
+
if (nameAttribute === "data-images") {
|
|
142
|
+
recordImagesName(element.getAttribute(nameAttribute) ?? "", scope);
|
|
143
|
+
}
|
|
144
|
+
else if (nameAttribute !== undefined) {
|
|
125
145
|
recordName(element.getAttribute(nameAttribute) ?? "", itemFields, scope);
|
|
126
146
|
}
|
|
127
147
|
else if (tag === "a") {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// No bun:test here — callers register cases with their own test runner.
|
|
4
4
|
import { seedRow } from "@cosmicdrift/kumiko-testing/helpers";
|
|
5
5
|
import { TemplateNotFoundError } from "./api.js";
|
|
6
|
-
import { FALLBACK_LOCALE, SYSTEM_TENANT_ID, } from "./constants.js";
|
|
7
6
|
import { templateResourcesTable } from "./table.js";
|
|
7
|
+
import { FALLBACK_LOCALE, SYSTEM_TENANT_ID, } from "./web/constants.js";
|
|
8
8
|
export class ConformanceAssertionError extends Error {
|
|
9
9
|
constructor(message) {
|
|
10
10
|
super(message);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { buildEntityTable } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { createEntity, createLongTextField, createSelectField, createTextField, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
-
import { CONTENT_FORMATS, TEMPLATE_KINDS } from "./constants.js";
|
|
3
|
+
import { CONTENT_FORMATS, TEMPLATE_KINDS } from "./web/constants.js";
|
|
4
4
|
// UserContentEntry — the per-user half of the content store: mail signatures
|
|
5
5
|
// and personal reply snippets, one row per (tenantId, ownerId, slug, kind,
|
|
6
6
|
// locale).
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-renderer/headless";
|
|
3
|
-
// @runtime client
|
|
4
3
|
// Client feature factory for the text-block content tree. Apps mount it via
|
|
5
4
|
// createKumikoApp({ clientFeatures: [textBlocksClient()] }); it loads the
|
|
6
5
|
// blocks from the by-tenant query, groups them by their `folder` field and
|
|
@@ -16,10 +15,10 @@ import { ContentPreview, useAppFeatures, useContentEditor, useDispatcher, usePri
|
|
|
16
15
|
import { CSRF_HEADER_NAME, readCsrfToken } from "@cosmicdrift/kumiko-renderer/live";
|
|
17
16
|
import { PlainContentEditor, RichContentEditor, } from "@cosmicdrift/kumiko-renderer/web";
|
|
18
17
|
import { useEffect, useId, useState } from "react";
|
|
19
|
-
import { collectionHandlerName, collectionQueryName, TemplateResolverHandlers, TemplateResolverQueries, } from "../qualified-names.js";
|
|
20
18
|
import { DocumentBlocksContext, DocumentContentEditor } from "./document-editor.js";
|
|
21
19
|
import { documentBlocksForKind } from "./document-toolbar-blocks.js";
|
|
22
20
|
import { defaultTranslations } from "./i18n.js";
|
|
21
|
+
import { collectionHandlerName, collectionQueryName, TemplateResolverHandlers, TemplateResolverQueries, } from "./qualified-names.js";
|
|
23
22
|
function newFolderNode() {
|
|
24
23
|
return { leaves: [], subFolders: new Map() };
|
|
25
24
|
}
|
|
@@ -24,5 +24,8 @@ export declare const DEFAULT_MAIL_LAYOUT_SLUG = "default";
|
|
|
24
24
|
export declare const DEFAULT_PDF_LAYOUT_SLUG = "default";
|
|
25
25
|
export declare const MAIL_PREVIEW_MAX_BYTES: number;
|
|
26
26
|
export declare const TEST_MAIL_SUBJECT_PREFIX = "[TEST] ";
|
|
27
|
-
export { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-
|
|
27
|
+
export { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-types/identifiers";
|
|
28
28
|
export declare const FALLBACK_LOCALE = "de";
|
|
29
|
+
export declare const DEFAULT_COLLECTION_ACCESS: {
|
|
30
|
+
readonly roles: readonly ["SystemAdmin"];
|
|
31
|
+
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// Plain data, no imports — the content tree in web/ needs TEXT_BLOCK_KIND to
|
|
3
2
|
// pick between the public and the admin query.
|
|
4
3
|
//
|
|
5
|
-
// RenderKind
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// (markdown/mjml/html) entscheidet wer's rendert.
|
|
4
|
+
// RenderKind identifies the consumer class of a template. Plugin renderers in
|
|
5
|
+
// `renderer-foundation` match on kind; the resolver here is kind-agnostic: it
|
|
6
|
+
// only loads, and the content format (markdown/mjml/html) decides who renders it.
|
|
9
7
|
export const RENDER_KINDS = ["mail", "document-pdf", "image-snapshot"];
|
|
10
8
|
// Kinds whose html body is a rich document: the server rebuilds it through the
|
|
11
9
|
// document schema on every write (see document-sanitizer.ts).
|
|
@@ -60,9 +58,10 @@ export const DEFAULT_PDF_LAYOUT_SLUG = "default";
|
|
|
60
58
|
// The mail transport enforces no size limit of its own; 10 MiB is a common provider ceiling.
|
|
61
59
|
export const MAIL_PREVIEW_MAX_BYTES = 10 * 1024 * 1024;
|
|
62
60
|
export const TEST_MAIL_SUBJECT_PREFIX = "[TEST] ";
|
|
63
|
-
// System
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
//
|
|
67
|
-
// fällt darauf zurück wenn requested locale + tenant-default fehlen.
|
|
61
|
+
// System templates live under the SYSTEM_TENANT_ID sentinel; the client-safe types package is its single source.
|
|
62
|
+
export { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-types/identifiers";
|
|
63
|
+
// Default locale when the tenant configures none. The resolver falls back to
|
|
64
|
+
// it when the requested locale and the tenant default are missing.
|
|
68
65
|
export const FALLBACK_LOCALE = "de";
|
|
66
|
+
// A collection mounted without `access` is maintained by the platform only; TenantAdmin access is an explicit mount decision.
|
|
67
|
+
export const DEFAULT_COLLECTION_ACCESS = { roles: ["SystemAdmin"] };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type DocumentToolbarBlock = "image" | "table" | "button" | "divider" | "repeat" | "pageBreak" | "align" | "steps";
|
|
1
|
+
export type DocumentToolbarBlock = "image" | "table" | "button" | "divider" | "repeat" | "pageBreak" | "align" | "steps" | "images";
|
|
2
2
|
export declare const MAIL_DOCUMENT_BLOCKS: readonly ["image", "table", "button", "divider", "repeat", "steps"];
|
|
3
|
-
export declare const PDF_DOCUMENT_BLOCKS: readonly ["align", "image", "table", "divider", "repeat", "steps", "pageBreak"];
|
|
3
|
+
export declare const PDF_DOCUMENT_BLOCKS: readonly ["align", "image", "table", "divider", "repeat", "steps", "images", "pageBreak"];
|
|
4
4
|
/** Block set for a template-resource kind; every kind except "document-pdf" gets the mail set. */
|
|
5
5
|
export declare function documentBlocksForKind(kind: string | undefined): readonly DocumentToolbarBlock[];
|