@cosmicdrift/kumiko-bundled-features 0.362.0 → 0.364.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/admin-shell/feature.d.ts +3 -0
- package/dist/admin-shell/feature.js +6 -1
- package/dist/agent-tools/agent-manifest.js +2 -1
- package/dist/agent-tools/filter-ops.d.ts +1 -1
- package/dist/agent-tools/filter-ops.js +1 -3
- package/dist/agent-tools/tool-dispatch.js +2 -1
- package/dist/audit/handlers/list.query.js +9 -5
- package/dist/auth-email-password/bootstrap.d.ts +8 -5
- package/dist/auth-email-password/bootstrap.js +12 -4
- package/dist/auth-email-password/email-rate-limits.d.ts +4 -0
- package/dist/auth-email-password/email-rate-limits.js +13 -0
- package/dist/auth-email-password/email-templates.d.ts +4 -26
- package/dist/auth-email-password/email-templates.js +9 -101
- package/dist/auth-email-password/feature.js +24 -6
- package/dist/auth-email-password/handlers/change-password.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/change-password.write.js +6 -2
- package/dist/auth-email-password/handlers/confirm-account-unlock.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/invite-accept-with-login.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/invite-accept.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/invite-create.write.d.ts +2 -2
- package/dist/auth-email-password/handlers/invite-create.write.js +4 -4
- package/dist/auth-email-password/handlers/invite-signup-complete.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/login.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/logout.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/logout.write.js +6 -2
- package/dist/auth-email-password/handlers/request-account-unlock.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/request-account-unlock.write.js +2 -4
- package/dist/auth-email-password/handlers/request-email-verification.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/request-email-verification.write.js +2 -4
- package/dist/auth-email-password/handlers/request-password-reset.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/request-password-reset.write.js +2 -4
- package/dist/auth-email-password/handlers/reset-password.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/signup-confirm.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/signup-confirm.write.js +3 -4
- package/dist/auth-email-password/handlers/signup-request.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/signup-request.write.js +2 -1
- package/dist/auth-email-password/handlers/switch-tenant-mfa-gate.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/token-request-handler.d.ts +2 -3
- package/dist/auth-email-password/handlers/token-request-handler.js +2 -2
- package/dist/auth-email-password/handlers/verify-email.write.d.ts +1 -1
- package/dist/auth-email-password/index.d.ts +2 -2
- package/dist/auth-email-password/index.js +1 -1
- package/dist/auth-email-password/magic-link-mail.d.ts +3 -2
- package/dist/auth-email-password/magic-link-mail.js +19 -14
- package/dist/auth-email-password/mail-notifications.d.ts +32 -0
- package/dist/auth-email-password/mail-notifications.js +116 -0
- package/dist/auth-email-password/signup-activation.d.ts +1 -1
- package/dist/auth-email-password/signup-activation.js +2 -3
- package/dist/auth-email-password/web/auth-gate.js +16 -4
- package/dist/auth-foundation/types.js +2 -8
- package/dist/auth-mfa/feature.js +4 -4
- package/dist/auth-mfa/handlers/disable.write.d.ts +1 -1
- package/dist/auth-mfa/handlers/enable-confirm-preauth.write.d.ts +1 -1
- package/dist/auth-mfa/handlers/enable-confirm.write.d.ts +1 -1
- package/dist/auth-mfa/handlers/enable-start-preauth.write.d.ts +1 -1
- package/dist/auth-mfa/handlers/enable-start.write.d.ts +1 -1
- package/dist/auth-mfa/handlers/regenerate-recovery.write.d.ts +1 -1
- package/dist/auth-mfa/handlers/verify.write.d.ts +1 -1
- package/dist/auth-mfa/hmac-token-codec.js +4 -4
- package/dist/auth-mfa/mfa-challenge-token.js +3 -3
- package/dist/auth-mfa/mfa-preauth-setup-token.js +3 -3
- package/dist/auth-mfa/mfa-setup-token.js +8 -8
- package/dist/billing-foundation/constants.d.ts +3 -3
- package/dist/billing-foundation/constants.js +5 -4
- package/dist/billing-foundation/consumer-protection/confirmation-mail.d.ts +32 -14
- package/dist/billing-foundation/consumer-protection/confirmation-mail.js +74 -32
- package/dist/billing-foundation/consumer-protection/consent-gate.d.ts +3 -0
- package/dist/billing-foundation/consumer-protection/consent-gate.js +21 -2
- package/dist/billing-foundation/consumer-protection/issue-confirmation.js +3 -3
- package/dist/billing-foundation/consumer-protection/mail-notifications.d.ts +8 -0
- package/dist/billing-foundation/consumer-protection/mail-notifications.js +95 -0
- package/dist/billing-foundation/consumer-protection/register-consent.js +2 -0
- package/dist/billing-foundation/consumer-protection/register-termination.js +11 -1
- package/dist/billing-foundation/consumer-protection/termination-mail.d.ts +25 -13
- package/dist/billing-foundation/consumer-protection/termination-mail.js +11 -23
- package/dist/billing-foundation/consumer-protection/termination-notify.js +2 -2
- package/dist/billing-foundation/consumer-protection/termination-pages.js +1 -3
- package/dist/billing-foundation/consumer-protection/termination-receipt-limit.d.ts +6 -0
- package/dist/billing-foundation/consumer-protection/termination-receipt-limit.js +34 -0
- package/dist/billing-foundation/consumer-protection/termination-record.d.ts +2 -0
- package/dist/billing-foundation/consumer-protection/termination-record.js +7 -1
- package/dist/billing-foundation/consumer-protection/termination-request.js +31 -21
- package/dist/billing-foundation/consumer-protection/termination-texts.d.ts +1 -1
- package/dist/billing-foundation/consumer-protection/termination-texts.js +6 -0
- package/dist/billing-foundation/consumer-protection/withdrawal-period.d.ts +10 -0
- package/dist/billing-foundation/consumer-protection/withdrawal-period.js +26 -0
- package/dist/billing-foundation/handlers/create-checkout-session.write.js +11 -5
- package/dist/billing-foundation/handlers/process-event.write.js +12 -8
- package/dist/billing-foundation/handlers/process-payment-event.write.js +1 -1
- package/dist/billing-foundation/i18n.js +3 -0
- package/dist/billing-foundation/subscription-tier-sync.d.ts +7 -1
- package/dist/billing-foundation/subscription-tier-sync.js +16 -9
- package/dist/billing-foundation/types.d.ts +7 -2
- package/dist/cap-counter/calendar-cap-usage-reservation.js +2 -0
- package/dist/cap-counter/enforce-cap.d.ts +18 -1
- package/dist/cap-counter/enforce-cap.js +49 -6
- package/dist/cap-counter/index.d.ts +1 -1
- package/dist/cap-counter/index.js +1 -1
- package/dist/cap-counter/with-cap-enforcement.d.ts +2 -0
- package/dist/cap-overview/handlers/tenant-caps-list.query.js +2 -1
- package/dist/cap-overview/web/cap-usage-cell.js +5 -4
- package/dist/channel-email/email-channel.d.ts +2 -2
- package/dist/channel-email/email-channel.js +101 -26
- package/dist/channel-email/feature.js +3 -3
- package/dist/channel-email/index.d.ts +1 -1
- package/dist/channel-email/index.js +1 -1
- package/dist/channel-email/pii-guard.js +10 -0
- package/dist/channel-email/smtp-transport.js +13 -0
- package/dist/channel-email/types.d.ts +8 -0
- package/dist/channel-in-app/handlers/mark-all-read.write.d.ts +1 -1
- package/dist/channel-in-app/handlers/mark-read.write.d.ts +1 -1
- package/dist/compliance-profiles/handlers/set-profile.write.d.ts +1 -1
- package/dist/config/handlers/reset.write.d.ts +1 -1
- package/dist/config/handlers/set.write.d.ts +1 -1
- package/dist/config/handlers/set.write.js +3 -4
- package/dist/config/resolver.d.ts +1 -0
- package/dist/config/resolver.js +11 -14
- package/dist/config/write-helpers.d.ts +2 -0
- package/dist/config/write-helpers.js +19 -0
- package/dist/crypto-shredding/handlers/forget-subject.write.d.ts +1 -1
- package/dist/crypto-shredding/handlers/forget-subject.write.js +29 -19
- package/dist/custom-fields/handlers/update-tenant-field.write.js +0 -1
- package/dist/custom-fields/lib/value-schema.js +10 -11
- package/dist/custom-fields/wire-user-data-rights.js +7 -6
- package/dist/data-retention/index.d.ts +1 -0
- package/dist/data-retention/index.js +1 -0
- package/dist/data-retention/run-retention-cleanup.js +6 -6
- package/dist/delivery/attachment-ref.d.ts +41 -0
- package/dist/delivery/attachment-ref.js +78 -0
- package/dist/delivery/channel-context.d.ts +8 -4
- package/dist/delivery/channel-context.js +94 -2
- package/dist/delivery/constants.d.ts +1 -0
- package/dist/delivery/constants.js +1 -0
- package/dist/delivery/delivery-service.d.ts +4 -1
- package/dist/delivery/delivery-service.js +38 -32
- package/dist/delivery/feature.js +1 -1
- package/dist/delivery/handlers/resubscribe-address.write.d.ts +1 -1
- package/dist/delivery/handlers/resubscribe-user.write.d.ts +1 -1
- package/dist/delivery/handlers/set-preference.write.d.ts +1 -1
- package/dist/delivery/handlers/unsubscribe-address.write.d.ts +1 -1
- package/dist/delivery/handlers/unsubscribe-user.write.d.ts +1 -1
- package/dist/delivery/index.d.ts +5 -2
- package/dist/delivery/index.js +4 -1
- package/dist/delivery/jobs.js +66 -14
- package/dist/delivery/notify-factory.js +4 -1
- package/dist/delivery/testing.d.ts +4 -1
- package/dist/delivery/types.d.ts +26 -14
- package/dist/delivery/unsubscribe.js +4 -1
- package/dist/derivatives-sharp/render.js +1 -18
- package/dist/document-ingest-foundation/pages.js +4 -4
- package/dist/feature-toggles/handlers/set.write.d.ts +1 -1
- package/dist/feature-toggles/toggle-sync-signal.js +4 -4
- package/dist/file-derivatives/handlers/public-variant.query.js +1 -1
- package/dist/file-foundation/index.d.ts +1 -0
- package/dist/file-foundation/index.js +1 -0
- package/dist/file-foundation/read-file-ref-content.d.ts +27 -0
- package/dist/file-foundation/read-file-ref-content.js +51 -0
- package/dist/files-tenant-data/hooks.js +4 -0
- package/dist/folders/web/folder-manager.js +3 -2
- package/dist/form-draft/db/queries/cleanup.js +4 -4
- package/dist/form-draft/db/queries/draft-count.js +2 -2
- package/dist/form-draft/db/queries/owned-file-refs.js +2 -2
- package/dist/form-draft/handlers/discard.write.d.ts +1 -1
- package/dist/form-draft/handlers/save.write.d.ts +1 -1
- package/dist/form-draft/release-file-refs.js +3 -2
- package/dist/inbound-mail-foundation/handlers/connect-account.write.js +1 -1
- package/dist/inbound-mail-foundation/handlers/ingest-message.write.js +6 -6
- package/dist/inbound-mail-foundation/handlers/scope-visibility.d.ts +1 -1
- package/dist/inbound-mail-foundation/oauth-access-token.js +8 -3
- package/dist/inbound-mail-foundation/oauth-state.js +7 -7
- package/dist/inbound-mail-foundation/types.js +4 -4
- package/dist/inbound-mail-foundation/watch-supervisor.js +24 -13
- package/dist/inbound-provider-imap/imap-client.js +4 -3
- package/dist/jobs/db/queries/stale-run-sweep.d.ts +1 -1
- package/dist/jobs/db/queries/stale-run-sweep.js +12 -5
- package/dist/jobs/feature.js +5 -3
- package/dist/jobs/handlers/list.query.js +3 -1
- package/dist/jobs/handlers/retry.write.d.ts +1 -1
- package/dist/jobs/handlers/stale-run-sweep.job.d.ts +1 -1
- package/dist/jobs/handlers/stale-run-sweep.job.js +2 -2
- package/dist/jobs/handlers/trigger.write.d.ts +1 -1
- package/dist/jobs/job-run-logger.js +32 -10
- package/dist/jobs/tenant-job-run-table.js +3 -2
- package/dist/ledger/entity.js +3 -1
- package/dist/ledger/recurring.js +1 -3
- package/dist/managed-pages/branding.d.ts +2 -0
- package/dist/managed-pages/branding.js +24 -2
- package/dist/managed-pages/feature.js +1 -0
- package/dist/managed-pages/handlers/set.write.d.ts +1 -1
- package/dist/managed-pages/i18n.js +1 -0
- package/dist/managed-pages/screens/branding-screen.js +8 -1
- package/dist/page-render/branding.d.ts +1 -0
- package/dist/page-render/branding.js +1 -0
- package/dist/page-render/markdown.js +1 -1
- package/dist/personal-access-tokens/feature.js +1 -1
- package/dist/personal-access-tokens/handlers/create.write.d.ts +1 -1
- package/dist/personal-access-tokens/handlers/list.query.js +2 -1
- package/dist/personal-access-tokens/handlers/revoke.write.d.ts +1 -1
- package/dist/personal-access-tokens/revoke-for-user.js +2 -1
- package/dist/renderer-foundation/api.d.ts +13 -13
- package/dist/renderer-foundation/api.js +1 -1
- package/dist/renderer-foundation/constants.js +2 -4
- package/dist/renderer-foundation/feature.js +7 -7
- package/dist/renderer-foundation/index.d.ts +2 -1
- package/dist/renderer-foundation/index.js +1 -0
- package/dist/renderer-foundation/types.d.ts +94 -32
- package/dist/renderer-pdf/feature.js +7 -1
- package/dist/renderer-pdf/render-table-pdf.d.ts +27 -33
- package/dist/renderer-pdf/render-table-pdf.js +95 -34
- package/dist/secrets/feature.js +4 -3
- package/dist/secrets/handlers/delete.write.d.ts +1 -1
- package/dist/secrets/handlers/set.write.d.ts +1 -1
- package/dist/secrets/secrets-context.js +15 -3
- package/dist/sessions/db/queries/cleanup.js +2 -2
- package/dist/sessions/feature.js +1 -1
- package/dist/sessions/handlers/list.query.js +2 -1
- package/dist/sessions/handlers/revoke-all-for-user.write.d.ts +1 -1
- package/dist/sessions/handlers/revoke-all-others.write.d.ts +1 -1
- package/dist/sessions/handlers/revoke.write.d.ts +1 -1
- package/dist/shared/attachment-file-name.d.ts +3 -0
- package/dist/shared/attachment-file-name.js +35 -0
- package/dist/shared/chunked-entity-migration.d.ts +1 -0
- package/dist/shared/chunked-entity-migration.js +1 -1
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.js +3 -0
- package/dist/shared/is-tenant-db.js +1 -1
- package/dist/shared/mail-template-body.d.ts +7 -0
- package/dist/shared/mail-template-body.js +27 -0
- package/dist/shared/sharp-input-limits.d.ts +6 -0
- package/dist/shared/sharp-input-limits.js +22 -0
- package/dist/shared/signup-handover.js +2 -2
- package/dist/subscription-stripe/plugin-methods.js +18 -8
- package/dist/subscription-stripe/verify-webhook.d.ts +1 -1
- package/dist/tags/handlers/assign-tag.write.js +3 -1
- package/dist/tags/web/tag-chip.js +2 -0
- package/dist/template-resolver/api.d.ts +30 -2
- package/dist/template-resolver/api.js +42 -6
- package/dist/template-resolver/compile-document-body.d.ts +12 -0
- package/dist/template-resolver/compile-document-body.js +205 -0
- package/dist/template-resolver/constants.d.ts +13 -4
- package/dist/template-resolver/constants.js +32 -10
- package/dist/template-resolver/document-sanitizer.d.ts +32 -0
- package/dist/template-resolver/document-sanitizer.js +201 -0
- package/dist/template-resolver/document-schema.d.ts +21 -0
- package/dist/template-resolver/document-schema.js +316 -0
- package/dist/template-resolver/feature.d.ts +20 -0
- package/dist/template-resolver/feature.js +53 -6
- package/dist/template-resolver/handlers/bundle-import.d.ts +20 -0
- package/dist/template-resolver/handlers/bundle-import.js +147 -0
- package/dist/template-resolver/handlers/collection-set.write.d.ts +1 -1
- package/dist/template-resolver/handlers/collection-set.write.js +25 -2
- package/dist/template-resolver/handlers/copy-locale.write.d.ts +19 -0
- package/dist/template-resolver/handlers/copy-locale.write.js +134 -0
- package/dist/template-resolver/handlers/diff-to-system.query.d.ts +22 -0
- package/dist/template-resolver/handlers/diff-to-system.query.js +30 -0
- package/dist/template-resolver/handlers/discard-draft.write.d.ts +13 -0
- package/dist/template-resolver/handlers/discard-draft.write.js +37 -0
- package/dist/template-resolver/handlers/export-bundle.query.d.ts +35 -0
- package/dist/template-resolver/handlers/export-bundle.query.js +118 -0
- package/dist/template-resolver/handlers/find-by-id.query.d.ts +2 -0
- package/dist/template-resolver/handlers/find-by-id.query.js +9 -6
- package/dist/template-resolver/handlers/import-bundle-system.write.d.ts +39 -0
- package/dist/template-resolver/handlers/import-bundle-system.write.js +36 -0
- package/dist/template-resolver/handlers/import-bundle.write.d.ts +40 -0
- package/dist/template-resolver/handlers/import-bundle.write.js +19 -0
- package/dist/template-resolver/handlers/layout-source.query.d.ts +31 -0
- package/dist/template-resolver/handlers/layout-source.query.js +87 -0
- package/dist/template-resolver/handlers/list.query.d.ts +4 -1
- package/dist/template-resolver/handlers/list.query.js +9 -8
- package/dist/template-resolver/handlers/override-diff.d.ts +20 -0
- package/dist/template-resolver/handlers/override-diff.js +41 -0
- package/dist/template-resolver/handlers/overview.query.d.ts +65 -0
- package/dist/template-resolver/handlers/overview.query.js +205 -0
- package/dist/template-resolver/handlers/preview.query.d.ts +12 -0
- package/dist/template-resolver/handlers/preview.query.js +24 -0
- package/dist/template-resolver/handlers/reset-to-system.write.d.ts +8 -0
- package/dist/template-resolver/handlers/reset-to-system.write.js +50 -0
- package/dist/template-resolver/handlers/resource-link-pdf.write.d.ts +8 -0
- package/dist/template-resolver/handlers/resource-link-pdf.write.js +32 -0
- package/dist/template-resolver/handlers/resource-remove.write.d.ts +9 -0
- package/dist/template-resolver/handlers/resource-remove.write.js +44 -0
- package/dist/template-resolver/handlers/resource-shared.d.ts +9 -0
- package/dist/template-resolver/handlers/resource-shared.js +14 -0
- package/dist/template-resolver/handlers/resource-upload.write.d.ts +13 -0
- package/dist/template-resolver/handlers/resource-upload.write.js +98 -0
- package/dist/template-resolver/handlers/send-test.write.d.ts +13 -0
- package/dist/template-resolver/handlers/send-test.write.js +108 -0
- package/dist/template-resolver/handlers/set.write.d.ts +5 -2
- package/dist/template-resolver/handlers/set.write.js +25 -3
- package/dist/template-resolver/handlers/shared.d.ts +9 -5
- package/dist/template-resolver/handlers/shared.js +6 -2
- package/dist/template-resolver/handlers/template-gates.d.ts +36 -0
- package/dist/template-resolver/handlers/template-gates.js +142 -0
- package/dist/template-resolver/handlers/template-write.d.ts +45 -0
- package/dist/template-resolver/handlers/template-write.js +141 -0
- package/dist/template-resolver/handlers/tenant-overrides.query.d.ts +49 -0
- package/dist/template-resolver/handlers/tenant-overrides.query.js +112 -0
- package/dist/template-resolver/handlers/toggle-status.write.d.ts +27 -2
- package/dist/template-resolver/handlers/toggle-status.write.js +47 -15
- package/dist/template-resolver/handlers/upsert-system.write.d.ts +5 -8
- package/dist/template-resolver/handlers/upsert-system.write.js +14 -59
- package/dist/template-resolver/handlers/upsert-tenant.write.d.ts +5 -8
- package/dist/template-resolver/handlers/upsert-tenant.write.js +11 -62
- package/dist/template-resolver/handlers/usage.query.d.ts +17 -0
- package/dist/template-resolver/handlers/usage.query.js +24 -0
- package/dist/template-resolver/handlers/validate.query.d.ts +74 -0
- package/dist/template-resolver/handlers/validate.query.js +80 -0
- package/dist/template-resolver/index.d.ts +19 -1
- package/dist/template-resolver/index.js +17 -1
- package/dist/template-resolver/layout-appearance.d.ts +10 -0
- package/dist/template-resolver/layout-appearance.js +26 -0
- package/dist/template-resolver/layout-regions.d.ts +23 -0
- package/dist/template-resolver/layout-regions.js +125 -0
- package/dist/template-resolver/linked-resources.d.ts +17 -0
- package/dist/template-resolver/linked-resources.js +75 -0
- package/dist/template-resolver/pdf-constants.d.ts +7 -0
- package/dist/template-resolver/pdf-constants.js +8 -0
- package/dist/template-resolver/preview-display-html.d.ts +7 -0
- package/dist/template-resolver/preview-display-html.js +27 -0
- package/dist/template-resolver/print-document.d.ts +1 -0
- package/dist/template-resolver/print-document.js +55 -0
- package/dist/template-resolver/qualified-names.d.ts +34 -0
- package/dist/template-resolver/qualified-names.js +34 -0
- package/dist/template-resolver/record-mapping.d.ts +2 -0
- package/dist/template-resolver/record-mapping.js +21 -0
- package/dist/template-resolver/resource-image.d.ts +15 -0
- package/dist/template-resolver/resource-image.js +34 -0
- package/dist/template-resolver/seeding.d.ts +14 -1
- package/dist/template-resolver/seeding.js +125 -18
- package/dist/template-resolver/store-template-resource.d.ts +64 -0
- package/dist/template-resolver/store-template-resource.js +264 -0
- package/dist/template-resolver/table.d.ts +150 -8
- package/dist/template-resolver/table.js +20 -2
- package/dist/template-resolver/template-bundle.d.ts +36 -0
- package/dist/template-resolver/template-bundle.js +60 -0
- package/dist/template-resolver/template-diff.d.ts +7 -0
- package/dist/template-resolver/template-diff.js +68 -0
- package/dist/template-resolver/template-draft.d.ts +51 -0
- package/dist/template-resolver/template-draft.js +72 -0
- package/dist/template-resolver/template-meta.d.ts +85 -0
- package/dist/template-resolver/template-meta.js +145 -0
- package/dist/template-resolver/template-preview.d.ts +103 -0
- package/dist/template-resolver/template-preview.js +418 -0
- package/dist/template-resolver/template-resources.d.ts +19 -0
- package/dist/template-resolver/template-resources.js +73 -0
- package/dist/template-resolver/template-usage.d.ts +16 -0
- package/dist/template-resolver/template-usage.js +35 -0
- package/dist/template-resolver/template-validation.d.ts +22 -0
- package/dist/template-resolver/template-validation.js +173 -0
- package/dist/template-resolver/testing.js +5 -5
- package/dist/template-resolver/user-content-table.d.ts +14 -8
- package/dist/template-resolver/web/client-plugin.d.ts +1 -0
- package/dist/template-resolver/web/client-plugin.js +12 -7
- package/dist/template-resolver/web/document-editor-extensions.d.ts +18 -0
- package/dist/template-resolver/web/document-editor-extensions.js +145 -0
- package/dist/template-resolver/web/document-editor.d.ts +4 -0
- package/dist/template-resolver/web/document-editor.js +17 -0
- package/dist/template-resolver/web/document-tiptap-editor.d.ts +3 -0
- package/dist/template-resolver/web/document-tiptap-editor.js +492 -0
- package/dist/template-resolver/web/document-toolbar-blocks.d.ts +41 -0
- package/dist/template-resolver/web/document-toolbar-blocks.js +19 -0
- package/dist/template-resolver/web/editor-handle.d.ts +3 -0
- package/dist/template-resolver/web/editor-handle.js +24 -0
- package/dist/template-resolver/web/i18n.js +91 -0
- package/dist/template-resolver/web/index.d.ts +5 -0
- package/dist/template-resolver/web/index.js +5 -0
- package/dist/template-resolver/web/placeholder-line-editor-lazy.d.ts +4 -0
- package/dist/template-resolver/web/placeholder-line-editor-lazy.js +16 -0
- package/dist/template-resolver/web/placeholder-line-editor.d.ts +17 -0
- package/dist/template-resolver/web/placeholder-line-editor.js +94 -0
- package/dist/template-resolver/web/placeholder-text.d.ts +4 -0
- package/dist/template-resolver/web/placeholder-text.js +34 -0
- package/dist/template-resolver/web/use-stable-by-key.d.ts +1 -0
- package/dist/template-resolver/web/use-stable-by-key.js +13 -0
- package/dist/tenant/handlers/add-member.write.d.ts +1 -1
- package/dist/tenant/handlers/cancel-invitation.write.d.ts +1 -1
- package/dist/tenant/handlers/create.write.d.ts +1 -1
- package/dist/tenant/handlers/remove-member.write.d.ts +1 -1
- package/dist/tenant/handlers/team-list.query.js +3 -2
- package/dist/tenant/handlers/toggle-enabled.write.d.ts +2 -2
- package/dist/tenant/handlers/update-member-roles.write.d.ts +1 -1
- package/dist/tenant/handlers/update.write.d.ts +1 -1
- package/dist/tenant/seeding.js +31 -6
- package/dist/tenant-handover/handlers/claim.write.d.ts +1 -1
- package/dist/tenant-lifecycle/handlers/cancel-destruction.write.d.ts +2 -2
- package/dist/tenant-lifecycle/handlers/cancel-destruction.write.js +2 -1
- package/dist/tenant-lifecycle/handlers/request-destruction.write.d.ts +1 -1
- package/dist/tier-engine/feature.js +9 -3
- package/dist/tier-engine/handlers/set-tenant-tier.write.d.ts +1 -1
- package/dist/user/db/queries/stream-tenant-backfill.js +4 -4
- package/dist/user/handlers/create.write.d.ts +1 -1
- package/dist/user/handlers/detail.query.js +2 -1
- package/dist/user/handlers/update.write.d.ts +1 -1
- package/dist/user/resolve-display-names.js +5 -9
- package/dist/user/seeding.js +20 -1
- package/dist/user-data-rights/db/queries/forget-cleanup.d.ts +2 -2
- package/dist/user-data-rights/email-templates.d.ts +1 -29
- package/dist/user-data-rights/email-templates.js +5 -106
- package/dist/user-data-rights/feature.js +53 -35
- package/dist/user-data-rights/handlers/cancel-deletion.write.d.ts +2 -2
- package/dist/user-data-rights/handlers/cancel-deletion.write.js +2 -1
- package/dist/user-data-rights/handlers/confirm-deletion-by-token.write.d.ts +1 -1
- package/dist/user-data-rights/handlers/lift-restriction.write.d.ts +1 -1
- package/dist/user-data-rights/handlers/request-deletion-by-email.write.d.ts +1 -1
- package/dist/user-data-rights/handlers/request-deletion.write.d.ts +1 -1
- package/dist/user-data-rights/handlers/request-deletion.write.js +5 -7
- package/dist/user-data-rights/handlers/request-export.write.d.ts +1 -1
- package/dist/user-data-rights/handlers/restrict-account.write.d.ts +1 -1
- package/dist/user-data-rights/handlers/run-forget-cleanup.write.d.ts +1 -1
- package/dist/user-data-rights/lib/default-mailers.d.ts +15 -7
- package/dist/user-data-rights/lib/default-mailers.js +100 -48
- package/dist/user-data-rights/lib/update-user-lifecycle.js +1 -1
- package/dist/user-data-rights/mail-notifications.d.ts +13 -0
- package/dist/user-data-rights/mail-notifications.js +118 -0
- package/dist/user-data-rights/web/privacy-center-screen.js +2 -1
- package/dist/user-profile/handlers/change-email.write.d.ts +1 -1
- package/dist/user-profile/web/profile-screen.js +2 -1
- package/dist/waitlist/feature.js +10 -0
- package/dist/waitlist/handlers/invite.write.d.ts +1 -1
- package/dist/waitlist/handlers/reject.write.d.ts +1 -1
- package/dist/waitlist/handlers/submit.write.d.ts +1 -1
- package/dist/waitlist/handlers/submit.write.js +3 -4
- package/dist/waitlist/mail.d.ts +19 -6
- package/dist/waitlist/mail.js +50 -14
- package/dist/waitlist/options.js +1 -1
- package/dist/workflow-runner/event-trigger.js +2 -2
- package/dist/workflow-runner/handlers/resume-run.write.js +7 -2
- package/package.json +37 -17
- package/src/admin-shell/changes.json +6 -0
- package/src/audit/changes.json +6 -0
- package/src/auth-email-password/changes.json +51 -0
- package/src/billing-foundation/changes.json +43 -0
- package/src/cap-counter/changes.json +6 -0
- package/src/channel-email/changes.json +19 -0
- package/src/config/changes.json +6 -0
- package/src/crypto-shredding/changes.json +6 -0
- package/src/custom-fields/changes.json +6 -0
- package/src/data-retention/changes.json +6 -0
- package/src/delivery/changes.json +66 -0
- package/src/file-foundation/changes.json +6 -0
- package/src/files-tenant-data/changes.json +6 -0
- package/src/inbound-mail-foundation/changes.json +6 -0
- package/src/jobs/changes.json +19 -0
- package/src/ledger/changes.json +7 -0
- package/src/managed-pages/changes.json +6 -0
- package/src/renderer-foundation/changes.json +39 -0
- package/src/renderer-pdf/changes.json +12 -0
- package/src/secrets/changes.json +6 -0
- package/src/shared/changes.json +6 -0
- package/src/subscription-stripe/changes.json +6 -0
- package/src/template-resolver/changes.json +186 -0
- package/src/tier-engine/changes.json +6 -0
- package/src/user/changes.json +6 -0
- package/src/user-data-rights/changes.json +13 -0
- package/src/user-profile/changes.json +1 -1
- package/src/waitlist/changes.json +7 -0
- package/src/workflow-runner/changes.json +6 -0
- package/dist/renderer-simple/feature.d.ts +0 -10
- package/dist/renderer-simple/feature.js +0 -42
- package/dist/renderer-simple/index.d.ts +0 -3
- package/dist/renderer-simple/index.js +0 -2
- package/dist/renderer-simple/mail-blocks.d.ts +0 -21
- package/dist/renderer-simple/mail-blocks.js +0 -107
- package/dist/renderer-simple/resolve-variables.d.ts +0 -7
- package/dist/renderer-simple/resolve-variables.js +0 -47
- package/dist/renderer-simple/simple-renderer.d.ts +0 -24
- package/dist/renderer-simple/simple-renderer.js +0 -200
- package/src/renderer-simple/changes.json +0 -27
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { type TemplateKind } from "./constants.js";
|
|
3
|
+
export declare const templateSlugSchema: z.ZodString;
|
|
4
|
+
export declare const MAIL_CATEGORIES: readonly ["transactional", "marketing"];
|
|
5
|
+
export type MailCategory = (typeof MAIL_CATEGORIES)[number];
|
|
6
|
+
declare const mailMetaSchema: z.ZodPreprocess<z.ZodObject<{
|
|
7
|
+
subject: z.ZodString;
|
|
8
|
+
previewText: z.ZodOptional<z.ZodString>;
|
|
9
|
+
layoutSlug: z.ZodOptional<z.ZodString>;
|
|
10
|
+
category: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
marketing: "marketing";
|
|
12
|
+
transactional: "transactional";
|
|
13
|
+
}>>;
|
|
14
|
+
senderName: z.ZodOptional<z.ZodString>;
|
|
15
|
+
replyTo: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodEmail>>;
|
|
16
|
+
}, z.core.$strict>, unknown>;
|
|
17
|
+
export declare const pdfAttachmentFileNamePatternSchema: z.ZodString;
|
|
18
|
+
declare const pdfMetaSchema: z.ZodObject<{
|
|
19
|
+
layoutSlug: z.ZodOptional<z.ZodString>;
|
|
20
|
+
pageFormat: z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
A4: "A4";
|
|
22
|
+
Letter: "Letter";
|
|
23
|
+
}>>;
|
|
24
|
+
orientation: z.ZodOptional<z.ZodEnum<{
|
|
25
|
+
landscape: "landscape";
|
|
26
|
+
portrait: "portrait";
|
|
27
|
+
}>>;
|
|
28
|
+
printBackground: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
layoutHeaderFooter: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
margins: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
top: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
right: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
bottom: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
left: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
}, z.core.$strict>>;
|
|
36
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
37
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
title: z.ZodOptional<z.ZodString>;
|
|
39
|
+
author: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.core.$strict>>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
declare const mailLayoutMetaSchema: z.ZodObject<{
|
|
43
|
+
width: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<560>, z.ZodLiteral<600>, z.ZodLiteral<640>]>>;
|
|
44
|
+
font: z.ZodOptional<z.ZodEnum<{
|
|
45
|
+
sans: "sans";
|
|
46
|
+
serif: "serif";
|
|
47
|
+
}>>;
|
|
48
|
+
outerBackground: z.ZodOptional<z.ZodString>;
|
|
49
|
+
accentLine: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
branding: "branding";
|
|
51
|
+
none: "none";
|
|
52
|
+
}>>;
|
|
53
|
+
buttonStyle: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
"filled-rounded": "filled-rounded";
|
|
55
|
+
"filled-square": "filled-square";
|
|
56
|
+
outline: "outline";
|
|
57
|
+
}>>;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
declare const pdfLayoutMetaSchema: z.ZodObject<{}, z.core.$strict>;
|
|
60
|
+
export type MailTemplateMeta = z.infer<typeof mailMetaSchema>;
|
|
61
|
+
export type PdfTemplateMeta = z.infer<typeof pdfMetaSchema>;
|
|
62
|
+
export type MailLayoutMeta = z.infer<typeof mailLayoutMetaSchema>;
|
|
63
|
+
export type LayoutTemplateMeta = MailLayoutMeta | z.infer<typeof pdfLayoutMetaSchema>;
|
|
64
|
+
export type TemplateMeta = MailTemplateMeta | PdfTemplateMeta | LayoutTemplateMeta;
|
|
65
|
+
export declare function isMailTemplateMeta(meta: TemplateMeta | null): meta is MailTemplateMeta;
|
|
66
|
+
export declare function readPdfTemplateMeta(meta: TemplateMeta | null): PdfTemplateMeta | null;
|
|
67
|
+
export declare function readMailLayoutMeta(meta: unknown): MailLayoutMeta;
|
|
68
|
+
export type TemplateMetaIssue = {
|
|
69
|
+
readonly path: string;
|
|
70
|
+
/** The setting the issue is about (`subject`), `meta` when it concerns the object as a whole. */
|
|
71
|
+
readonly field: string;
|
|
72
|
+
/** The value is absent or empty, as opposed to present and wrong. */
|
|
73
|
+
readonly missing: boolean;
|
|
74
|
+
/** Parser wording; for logs and tests, never for the UI. */
|
|
75
|
+
readonly message: string;
|
|
76
|
+
};
|
|
77
|
+
export type TemplateMetaResult = {
|
|
78
|
+
readonly ok: true;
|
|
79
|
+
readonly meta: TemplateMeta | null;
|
|
80
|
+
} | {
|
|
81
|
+
readonly ok: false;
|
|
82
|
+
readonly issues: readonly TemplateMetaIssue[];
|
|
83
|
+
};
|
|
84
|
+
export declare function parseTemplateMeta(kind: TemplateKind, raw: unknown): TemplateMetaResult;
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { HEX_COLOR_PATTERN, PDF_ORIENTATIONS, PDF_PAGE_FORMATS, } from "./constants.js";
|
|
3
|
+
// One or more kebab segments joined by ":" — notification templates are seeded
|
|
4
|
+
// under their qualified name `feature:notify:name`.
|
|
5
|
+
export const templateSlugSchema = z
|
|
6
|
+
.string()
|
|
7
|
+
.min(1)
|
|
8
|
+
.max(120)
|
|
9
|
+
.regex(/^[a-z0-9]+(-[a-z0-9]+)*(:[a-z0-9]+(-[a-z0-9]+)*)*$/, "slug must be kebab-case segments joined by ':'");
|
|
10
|
+
export const MAIL_CATEGORIES = ["transactional", "marketing"];
|
|
11
|
+
// Header values: a CR/LF would let an author inject extra mail headers.
|
|
12
|
+
const singleLine = (max) => z
|
|
13
|
+
.string()
|
|
14
|
+
.max(max)
|
|
15
|
+
.refine((value) => !/[\r\n]/.test(value), "must not contain line breaks");
|
|
16
|
+
// Rows saved before the sender key was dropped still carry it; discard it on read so they stay editable.
|
|
17
|
+
function withoutLegacySender(raw) {
|
|
18
|
+
if (typeof raw !== "object" || raw === null || !("sender" in raw))
|
|
19
|
+
return raw;
|
|
20
|
+
const { sender: _legacySender, ...rest } = raw;
|
|
21
|
+
return rest;
|
|
22
|
+
}
|
|
23
|
+
const mailMetaSchema = z.preprocess(withoutLegacySender, z
|
|
24
|
+
.object({
|
|
25
|
+
subject: singleLine(200).min(1),
|
|
26
|
+
previewText: singleLine(200).optional(),
|
|
27
|
+
layoutSlug: templateSlugSchema.optional(),
|
|
28
|
+
category: z.enum(MAIL_CATEGORIES).optional(),
|
|
29
|
+
senderName: singleLine(80).min(1).optional(),
|
|
30
|
+
replyTo: singleLine(254).pipe(z.email()).optional(),
|
|
31
|
+
})
|
|
32
|
+
.strict());
|
|
33
|
+
const marginMm = z.number().finite().min(0).max(100).optional();
|
|
34
|
+
// The file name ends up in a Content-Disposition header and on disk.
|
|
35
|
+
const FORBIDDEN_FILE_NAME = /[/\\";]|\.\./;
|
|
36
|
+
// Name of a PDF rendered into a mail; {{placeholders}} are filled at render time.
|
|
37
|
+
export const pdfAttachmentFileNamePatternSchema = singleLine(200)
|
|
38
|
+
.min(1)
|
|
39
|
+
.refine((value) => !FORBIDDEN_FILE_NAME.test(value), 'must not contain / \\ " ; or ..')
|
|
40
|
+
.refine((value) => value.toLowerCase().endsWith(".pdf"), "must end with .pdf");
|
|
41
|
+
const pdfMetaSchema = z
|
|
42
|
+
.object({
|
|
43
|
+
layoutSlug: templateSlugSchema.optional(),
|
|
44
|
+
pageFormat: z.enum(PDF_PAGE_FORMATS).optional(),
|
|
45
|
+
orientation: z.enum(PDF_ORIENTATIONS).optional(),
|
|
46
|
+
printBackground: z.boolean().optional(),
|
|
47
|
+
layoutHeaderFooter: z.boolean().optional(),
|
|
48
|
+
margins: z
|
|
49
|
+
.object({ top: marginMm, right: marginMm, bottom: marginMm, left: marginMm })
|
|
50
|
+
.strict()
|
|
51
|
+
.optional(),
|
|
52
|
+
fileName: singleLine(200)
|
|
53
|
+
.min(1)
|
|
54
|
+
.refine((value) => !FORBIDDEN_FILE_NAME.test(value), 'must not contain / \\ " ; or ..')
|
|
55
|
+
.optional(),
|
|
56
|
+
metadata: z
|
|
57
|
+
.object({ title: singleLine(200).optional(), author: singleLine(200).optional() })
|
|
58
|
+
.strict()
|
|
59
|
+
.optional(),
|
|
60
|
+
})
|
|
61
|
+
.strict();
|
|
62
|
+
const MAIL_LAYOUT_FONTS = ["sans", "serif"];
|
|
63
|
+
const MAIL_LAYOUT_ACCENT_LINES = ["branding", "none"];
|
|
64
|
+
const MAIL_LAYOUT_BUTTON_STYLES = ["filled-rounded", "filled-square", "outline"];
|
|
65
|
+
const mailLayoutMetaSchema = z
|
|
66
|
+
.object({
|
|
67
|
+
width: z.union([z.literal(560), z.literal(600), z.literal(640)]).optional(),
|
|
68
|
+
font: z.enum(MAIL_LAYOUT_FONTS).optional(),
|
|
69
|
+
outerBackground: z.string().regex(HEX_COLOR_PATTERN, "must be a #rrggbb color").optional(),
|
|
70
|
+
accentLine: z.enum(MAIL_LAYOUT_ACCENT_LINES).optional(),
|
|
71
|
+
buttonStyle: z.enum(MAIL_LAYOUT_BUTTON_STYLES).optional(),
|
|
72
|
+
})
|
|
73
|
+
.strict();
|
|
74
|
+
const pdfLayoutMetaSchema = z.object({}).strict();
|
|
75
|
+
export function isMailTemplateMeta(meta) {
|
|
76
|
+
return meta !== null && "subject" in meta;
|
|
77
|
+
}
|
|
78
|
+
export function readPdfTemplateMeta(meta) {
|
|
79
|
+
const parsed = pdfMetaSchema.safeParse(meta);
|
|
80
|
+
return parsed.success ? parsed.data : null;
|
|
81
|
+
}
|
|
82
|
+
export function readMailLayoutMeta(meta) {
|
|
83
|
+
const parsed = mailLayoutMetaSchema.safeParse(meta ?? {});
|
|
84
|
+
return parsed.success ? parsed.data : {};
|
|
85
|
+
}
|
|
86
|
+
function valueAt(raw, path) {
|
|
87
|
+
let current = raw;
|
|
88
|
+
for (const key of path) {
|
|
89
|
+
if (typeof current !== "object" || current === null)
|
|
90
|
+
return undefined;
|
|
91
|
+
current = Object.entries(current).find(([name]) => name === String(key))?.[1];
|
|
92
|
+
}
|
|
93
|
+
return current;
|
|
94
|
+
}
|
|
95
|
+
function schemaForKind(kind) {
|
|
96
|
+
switch (kind) {
|
|
97
|
+
case "mail":
|
|
98
|
+
return mailMetaSchema;
|
|
99
|
+
case "document-pdf":
|
|
100
|
+
return pdfMetaSchema;
|
|
101
|
+
case "mail-layout":
|
|
102
|
+
return mailLayoutMetaSchema;
|
|
103
|
+
case "pdf-layout":
|
|
104
|
+
return pdfLayoutMetaSchema;
|
|
105
|
+
default:
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Kinds without a meta schema must not carry meta at all; mail needs it,
|
|
110
|
+
// layouts and PDFs may omit it.
|
|
111
|
+
export function parseTemplateMeta(kind, raw) {
|
|
112
|
+
const schema = schemaForKind(kind);
|
|
113
|
+
if (schema === null) {
|
|
114
|
+
return raw === undefined || raw === null
|
|
115
|
+
? { ok: true, meta: null }
|
|
116
|
+
: {
|
|
117
|
+
ok: false,
|
|
118
|
+
issues: [
|
|
119
|
+
{
|
|
120
|
+
path: "meta",
|
|
121
|
+
field: "meta",
|
|
122
|
+
missing: false,
|
|
123
|
+
message: `kind ${kind} does not take meta`,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
if ((raw === undefined || raw === null) && kind !== "mail")
|
|
129
|
+
return { ok: true, meta: null };
|
|
130
|
+
const parsed = schema.safeParse(raw ?? undefined);
|
|
131
|
+
if (parsed.success)
|
|
132
|
+
return { ok: true, meta: parsed.data };
|
|
133
|
+
return {
|
|
134
|
+
ok: false,
|
|
135
|
+
issues: parsed.error.issues.map((issue) => {
|
|
136
|
+
const value = valueAt(raw, issue.path);
|
|
137
|
+
return {
|
|
138
|
+
path: ["meta", ...issue.path.map(String)].join("."),
|
|
139
|
+
field: issue.path.length === 0 ? "meta" : String(issue.path[0]),
|
|
140
|
+
missing: value === undefined || value === "",
|
|
141
|
+
message: issue.message,
|
|
142
|
+
};
|
|
143
|
+
}),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { HandlerContext, SessionUser, TemplateVariables } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import { type KumikoError } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
|
+
import { type MailAttachmentRef } from "../renderer-foundation/index.js";
|
|
4
|
+
import { type TemplateScope } from "./constants.js";
|
|
5
|
+
import { validateTemplateDraft } from "./handlers/validate.query.js";
|
|
6
|
+
import { type LayoutRegions, type TemplateWriteScope } from "./layout-regions.js";
|
|
7
|
+
import { type PdfTemplateMeta } from "./template-meta.js";
|
|
8
|
+
export declare function sampleValuesFor(variables: TemplateVariables): Record<string, unknown>;
|
|
9
|
+
export type PreviewCheckCode = "resources_resolved" | "text_present" | "size_under_cap" | "required_placeholders";
|
|
10
|
+
export type PreviewCheck = {
|
|
11
|
+
readonly code: PreviewCheckCode;
|
|
12
|
+
readonly ok: boolean;
|
|
13
|
+
readonly i18nKey: string;
|
|
14
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
15
|
+
};
|
|
16
|
+
export type PreviewAttachment = {
|
|
17
|
+
readonly kind: "inline";
|
|
18
|
+
readonly cid: string;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly sizeBytes: number;
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: "file";
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly sizeBytes: number;
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: "rendered-pdf";
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly templateSlug: string;
|
|
29
|
+
};
|
|
30
|
+
export type PreviewLayout = {
|
|
31
|
+
readonly slug: string;
|
|
32
|
+
readonly scope: TemplateScope;
|
|
33
|
+
readonly html: string;
|
|
34
|
+
readonly regions: LayoutRegions;
|
|
35
|
+
};
|
|
36
|
+
export type TemplatePreviewInput = {
|
|
37
|
+
readonly slug: string;
|
|
38
|
+
readonly kind: "mail" | "document-pdf";
|
|
39
|
+
readonly locale: string;
|
|
40
|
+
readonly content?: string | undefined;
|
|
41
|
+
readonly meta?: unknown;
|
|
42
|
+
readonly variableSchema: Readonly<Record<string, unknown>>;
|
|
43
|
+
};
|
|
44
|
+
type ValidationResponse = Awaited<ReturnType<typeof validateTemplateDraft>>["response"];
|
|
45
|
+
export type TemplatePreview = {
|
|
46
|
+
readonly kind: TemplatePreviewInput["kind"];
|
|
47
|
+
readonly subject: string | null;
|
|
48
|
+
readonly previewText: string | null;
|
|
49
|
+
readonly html: string;
|
|
50
|
+
/** Mail only: `html` with resolved inline images as data URIs, for showing in a browser. */
|
|
51
|
+
readonly displayHtml?: string;
|
|
52
|
+
readonly text: string | null;
|
|
53
|
+
readonly attachments: readonly PreviewAttachment[];
|
|
54
|
+
readonly layout: PreviewLayout | null;
|
|
55
|
+
/** Mail only: which layout version the html was rendered through. */
|
|
56
|
+
readonly mailLayout?: {
|
|
57
|
+
readonly slug: string;
|
|
58
|
+
readonly scope: TemplateScope;
|
|
59
|
+
readonly version: number;
|
|
60
|
+
} | null;
|
|
61
|
+
readonly sampleValues: Readonly<Record<string, unknown>>;
|
|
62
|
+
readonly checks: readonly PreviewCheck[];
|
|
63
|
+
readonly validation: ValidationResponse;
|
|
64
|
+
};
|
|
65
|
+
export type TemplatePreviewOutcome = {
|
|
66
|
+
readonly ok: true;
|
|
67
|
+
readonly preview: TemplatePreview;
|
|
68
|
+
/** What the send path needs to attach; kept out of the response shown to the editor. */
|
|
69
|
+
readonly mailAttachments: readonly MailAttachmentRef[];
|
|
70
|
+
readonly sender: {
|
|
71
|
+
readonly fromName?: string;
|
|
72
|
+
readonly replyTo?: string;
|
|
73
|
+
};
|
|
74
|
+
} | {
|
|
75
|
+
readonly ok: false;
|
|
76
|
+
readonly error: KumikoError;
|
|
77
|
+
};
|
|
78
|
+
export declare const MIME_PART_OVERHEAD_BYTES = 512;
|
|
79
|
+
export declare function encodedAttachmentBytes(rawBytes: number): number;
|
|
80
|
+
export declare function estimateMailBytes(args: {
|
|
81
|
+
readonly html: string;
|
|
82
|
+
readonly text: string;
|
|
83
|
+
readonly attachments: readonly PreviewAttachment[];
|
|
84
|
+
}): number;
|
|
85
|
+
export type DocumentDraftOutcome = {
|
|
86
|
+
readonly ok: true;
|
|
87
|
+
readonly content: string;
|
|
88
|
+
readonly meta: PdfTemplateMeta | null;
|
|
89
|
+
readonly variableSchema: Readonly<Record<string, unknown>>;
|
|
90
|
+
readonly sampleValues: Readonly<Record<string, unknown>>;
|
|
91
|
+
} | {
|
|
92
|
+
readonly ok: false;
|
|
93
|
+
readonly error: KumikoError;
|
|
94
|
+
};
|
|
95
|
+
export declare function evaluateDocumentDraft(ctx: HandlerContext, user: SessionUser, scope: TemplateWriteScope, draft: {
|
|
96
|
+
readonly slug: string;
|
|
97
|
+
readonly locale: string;
|
|
98
|
+
readonly content: string;
|
|
99
|
+
readonly meta?: unknown;
|
|
100
|
+
readonly variableSchema: Readonly<Record<string, unknown>>;
|
|
101
|
+
}): Promise<DocumentDraftOutcome>;
|
|
102
|
+
export declare function renderTemplatePreview(ctx: HandlerContext, user: SessionUser, input: TemplatePreviewInput): Promise<TemplatePreviewOutcome>;
|
|
103
|
+
export {};
|