@cosmicdrift/kumiko-samples 0.413.1 → 0.414.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/bundled-features/package.json +16 -1
- package/packages/bundled-features/src/admin-shell/changes.json +6 -0
- package/packages/bundled-features/src/admin-shell/feature.ts +8 -7
- package/packages/bundled-features/src/agent-tools/agent-doc-lint.ts +5 -1
- package/packages/bundled-features/src/agent-tools/agent-manifest.ts +36 -27
- package/packages/bundled-features/src/agent-tools/api-docs/collect-events.ts +8 -1
- package/packages/bundled-features/src/agent-tools/api-docs/collect.ts +3 -2
- package/packages/bundled-features/src/agent-tools/api-docs/generate.ts +6 -0
- package/packages/bundled-features/src/agent-tools/api-docs/index.ts +1 -0
- package/packages/bundled-features/src/agent-tools/api-docs/problems.ts +38 -1
- package/packages/bundled-features/src/agent-tools/api-docs/render-openapi.ts +1 -0
- package/packages/bundled-features/src/agent-tools/api-docs/resolve-config.ts +17 -0
- package/packages/bundled-features/src/agent-tools/api-docs/scope-slug-collisions.ts +17 -0
- package/packages/bundled-features/src/agent-tools/api-docs/translation-gaps.ts +42 -0
- package/packages/bundled-features/src/agent-tools/api-docs/webhook-example-problems.ts +30 -0
- package/packages/bundled-features/src/agent-tools/changes.json +12 -0
- package/packages/bundled-features/src/agent-tools/index.ts +1 -0
- package/packages/bundled-features/src/agent-tools/labels.ts +19 -6
- package/packages/bundled-features/src/agent-tools/tool-catalog.ts +18 -7
- package/packages/bundled-features/src/agent-tools/tool-dispatch.ts +14 -1
- package/packages/bundled-features/src/agent-tools/types.ts +4 -0
- package/packages/bundled-features/src/audit/event-classification.ts +6 -0
- package/packages/bundled-features/src/audit/web/i18n.ts +1 -0
- package/packages/bundled-features/src/auth-email-password/changes.json +18 -0
- package/packages/bundled-features/src/auth-email-password/errors.ts +0 -13
- package/packages/bundled-features/src/auth-email-password/handlers/invite-signup-complete.write.ts +147 -121
- package/packages/bundled-features/src/auth-email-password/handlers/login-options.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-account-unlock.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-email-verification.write.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-password-reset.write.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/reset-token.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/seeding.ts +39 -7
- package/packages/bundled-features/src/auth-email-password/unlock-token.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/verification-token.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/web/auth-form-primitives.tsx +2 -2
- package/packages/bundled-features/src/auth-email-password/web/auth-gate.tsx +2 -2
- package/packages/bundled-features/src/auth-email-password/web/auth-redirect.ts +5 -0
- package/packages/bundled-features/src/auth-email-password/web/forgot-password-screen.tsx +1 -6
- package/packages/bundled-features/src/auth-email-password/web/invite-accept-screen.tsx +1 -1
- package/packages/bundled-features/src/auth-email-password/web/return-path.ts +2 -1
- package/packages/bundled-features/src/auth-email-password/web/session.tsx +10 -12
- package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +1 -6
- package/packages/bundled-features/src/auth-email-password/web/static-account.ts +6 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-switcher.tsx +1 -1
- package/packages/bundled-features/src/auth-email-password/web/token-confirm-screen.tsx +4 -5
- package/packages/bundled-features/src/auth-email-password/web/user-menu.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-code-or-recovery-field.tsx +17 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-disable-dialog.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-regenerate-recovery-dialog.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-setup-preauth-screen.tsx +1 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-verify-screen.tsx +16 -47
- package/packages/bundled-features/src/auth-mfa-user-data/index.ts +5 -6
- package/packages/bundled-features/src/billing-foundation/aggregate-id.ts +0 -4
- package/packages/bundled-features/src/billing-foundation/changes.json +37 -0
- package/packages/bundled-features/src/billing-foundation/checkout-core.ts +8 -1
- package/packages/bundled-features/src/billing-foundation/checkout-ledger.ts +59 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-gate.ts +2 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-text.ts +49 -2
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-open-cancels.ts +5 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-provider-timeout.ts +23 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-record.ts +12 -7
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-revoke.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/events.ts +49 -10
- package/packages/bundled-features/src/billing-foundation/feature.ts +15 -1
- package/packages/bundled-features/src/billing-foundation/handlers/billing-plans.query.ts +47 -14
- package/packages/bundled-features/src/billing-foundation/handlers/create-checkout-session.write.ts +7 -1
- package/packages/bundled-features/src/billing-foundation/handlers/process-event.write.ts +124 -10
- package/packages/bundled-features/src/billing-foundation/handlers/process-payment-event.write.ts +33 -9
- package/packages/bundled-features/src/billing-foundation/handlers/record-checkout-opened.write.ts +25 -0
- package/packages/bundled-features/src/billing-foundation/handlers/start-plan-checkout.write.ts +7 -1
- package/packages/bundled-features/src/billing-foundation/handlers/switch-plan.write.ts +16 -4
- package/packages/bundled-features/src/billing-foundation/i18n.ts +3 -0
- package/packages/bundled-features/src/billing-foundation/pending-plan-switch.ts +80 -0
- package/packages/bundled-features/src/billing-foundation/scrub-raw-payload-headers.ts +50 -0
- package/packages/bundled-features/src/billing-foundation/types.ts +47 -30
- package/packages/bundled-features/src/billing-foundation/validate-options.ts +18 -0
- package/packages/bundled-features/src/billing-foundation/web/billing-plans-panel.tsx +10 -5
- package/packages/bundled-features/src/billing-foundation/web/cancel-contract-dialog.tsx +1 -1
- package/packages/bundled-features/src/billing-foundation/web/checkout-consent-dialog.tsx +1 -1
- package/packages/bundled-features/src/billing-foundation/web/constants.ts +5 -2
- package/packages/bundled-features/src/billing-foundation/web/plan-switch-confirm-dialog.tsx +1 -1
- package/packages/bundled-features/src/billing-foundation/webhook-handler.ts +65 -17
- package/packages/bundled-features/src/cap-counter/aggregate-id.ts +0 -2
- package/packages/bundled-features/src/cap-counter/changes.json +6 -0
- package/packages/bundled-features/src/cap-counter/stock-cap-guard.ts +19 -4
- package/packages/bundled-features/src/cap-overview/changes.json +6 -0
- package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +22 -6
- package/packages/bundled-features/src/cap-overview/i18n.ts +1 -0
- package/packages/bundled-features/src/cap-overview/index.ts +1 -0
- package/packages/bundled-features/src/cap-overview/types.ts +11 -1
- package/packages/bundled-features/src/cap-overview/web/cap-cards-panel.tsx +6 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-bar.tsx +10 -1
- package/packages/bundled-features/src/cap-overview/web/usage-math.ts +5 -0
- package/packages/bundled-features/src/channel-in-app/changes.json +6 -0
- package/packages/bundled-features/src/channel-in-app/handlers/read-state-by-keys.query.ts +2 -2
- package/packages/bundled-features/src/channel-whatsapp/aggregate-id.ts +29 -0
- package/packages/bundled-features/src/channel-whatsapp/changes.json +8 -0
- package/packages/bundled-features/src/channel-whatsapp/constants.ts +46 -0
- package/packages/bundled-features/src/channel-whatsapp/events.ts +93 -0
- package/packages/bundled-features/src/channel-whatsapp/feature.ts +72 -0
- package/packages/bundled-features/src/channel-whatsapp/graph-client.ts +398 -0
- package/packages/bundled-features/src/channel-whatsapp/in-memory-meta.ts +300 -0
- package/packages/bundled-features/src/channel-whatsapp/inbound-handlers.ts +189 -0
- package/packages/bundled-features/src/channel-whatsapp/index.ts +66 -0
- package/packages/bundled-features/src/channel-whatsapp/meta-signature.ts +26 -0
- package/packages/bundled-features/src/channel-whatsapp/options.ts +149 -0
- package/packages/bundled-features/src/channel-whatsapp/pii.ts +109 -0
- package/packages/bundled-features/src/channel-whatsapp/webhook-normalize.ts +226 -0
- package/packages/bundled-features/src/channel-whatsapp/webhook-routes.ts +185 -0
- package/packages/bundled-features/src/compliance-profiles/handlers/sub-processors.query.ts +1 -1
- package/packages/bundled-features/src/config/changes.json +12 -0
- package/packages/bundled-features/src/config/handlers/set.write.ts +7 -0
- package/packages/bundled-features/src/config/handlers/values.query.ts +8 -1
- package/packages/bundled-features/src/config/index.ts +1 -0
- package/packages/bundled-features/src/config/read-redaction.ts +6 -3
- package/packages/bundled-features/src/config/table.ts +1 -0
- package/packages/bundled-features/src/config/write-helpers.ts +3 -2
- package/packages/bundled-features/src/crypto-shredding/changes.json +18 -0
- package/packages/bundled-features/src/crypto-shredding/constants.ts +2 -0
- package/packages/bundled-features/src/crypto-shredding/handlers/forget-subject.write.ts +38 -18
- package/packages/bundled-features/src/crypto-shredding/index.ts +4 -0
- package/packages/bundled-features/src/crypto-shredding/subject-forget-after-delete-hook.ts +49 -0
- package/packages/bundled-features/src/custom-fields/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/custom-fields/entity.ts +1 -0
- package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +0 -1
- package/packages/bundled-features/src/data-retention/changes.json +12 -0
- package/packages/bundled-features/src/data-retention/erase-notes-of-deleted-row.ts +23 -0
- package/packages/bundled-features/src/data-retention/feature.ts +1 -5
- package/packages/bundled-features/src/data-retention/run-retention-cleanup.ts +38 -18
- package/packages/bundled-features/src/data-retention/tenant-destruction-hold.ts +9 -0
- package/packages/bundled-features/src/delivery/attempt-log-factory.ts +11 -0
- package/packages/bundled-features/src/delivery/attempt-log.ts +3 -3
- package/packages/bundled-features/src/delivery/changes.json +6 -0
- package/packages/bundled-features/src/delivery/channel-context.ts +6 -3
- package/packages/bundled-features/src/delivery/db/queries/preferences.ts +0 -1
- package/packages/bundled-features/src/delivery/delivery-service.ts +3 -0
- package/packages/bundled-features/src/delivery/feature.ts +4 -13
- package/packages/bundled-features/src/delivery/handlers/opted-in-user-ids.query.ts +45 -0
- package/packages/bundled-features/src/delivery/handlers/preferences.query.ts +2 -20
- package/packages/bundled-features/src/delivery/handlers/resubscribe-user.write.ts +2 -25
- package/packages/bundled-features/src/delivery/handlers/unsubscribe-page-chrome.query.ts +2 -0
- package/packages/bundled-features/src/delivery/handlers/unsubscribe-user.write.ts +2 -27
- package/packages/bundled-features/src/delivery/index.ts +3 -1
- package/packages/bundled-features/src/delivery/options.ts +11 -0
- package/packages/bundled-features/src/delivery/preference-rows.ts +33 -0
- package/packages/bundled-features/src/delivery/set-preference-enabled.ts +40 -0
- package/packages/bundled-features/src/delivery/testing.ts +3 -1
- package/packages/bundled-features/src/delivery/types.ts +1 -0
- package/packages/bundled-features/src/delivery/unsubscribe-page.ts +7 -1
- package/packages/bundled-features/src/delivery/upsert-preference.ts +0 -1
- package/packages/bundled-features/src/delivery/web/public-names.ts +1 -0
- package/packages/bundled-features/src/derivatives-sharp/render.ts +9 -9
- package/packages/bundled-features/src/document-ingest-foundation/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/document-ingest-foundation/append-missing-extract-event.ts +37 -25
- package/packages/bundled-features/src/document-ingest-foundation/report-ingest-progress.ts +32 -14
- package/packages/bundled-features/src/documents/aggregate-id.ts +0 -2
- package/packages/bundled-features/src/documents/changes.json +18 -0
- package/packages/bundled-features/src/documents/constants.ts +10 -2
- package/packages/bundled-features/src/documents/ensure-link.ts +3 -4
- package/packages/bundled-features/src/documents/feature.ts +28 -6
- package/packages/bundled-features/src/documents/handlers/import.write.ts +2 -2
- package/packages/bundled-features/src/documents/queries/expiry-overview.query.ts +2 -1
- package/packages/bundled-features/src/documents/queries/for-record.query.ts +3 -4
- package/packages/bundled-features/src/documents/queries/list-page.ts +11 -3
- package/packages/bundled-features/src/documents/queries/overview.query.ts +2 -2
- package/packages/bundled-features/src/documents/screens.ts +8 -3
- package/packages/bundled-features/src/documents/tab.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/toggle-sync-signal.ts +6 -3
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant-by-file-ref.query.ts +1 -1
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant.query.ts +1 -1
- package/packages/bundled-features/src/file-foundation/probe.ts +9 -3
- package/packages/bundled-features/src/file-foundation/read-file-ref-content.ts +24 -11
- package/packages/bundled-features/src/file-provider-inmemory/feature.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/changes.json +14 -0
- package/packages/bundled-features/src/file-provider-s3/env-feature.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/env-named-feature.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/env-schema.ts +24 -7
- package/packages/bundled-features/src/file-provider-s3/feature.ts +1 -1
- package/packages/bundled-features/src/file-provider-s3/index.ts +7 -1
- package/packages/bundled-features/src/file-provider-s3/lib/env-helper.ts +21 -13
- package/packages/bundled-features/src/file-provider-s3/lib/s3-provider.ts +8 -1
- package/packages/bundled-features/src/files/changes.json +7 -0
- package/packages/bundled-features/src/folders/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +6 -6
- package/packages/bundled-features/src/folders-user-data/index.ts +12 -14
- package/packages/bundled-features/src/helpdesk/changes.json +50 -0
- package/packages/bundled-features/src/helpdesk/entity.ts +4 -1
- package/packages/bundled-features/src/helpdesk/feature.ts +41 -0
- package/packages/bundled-features/src/helpdesk/handlers/access.ts +0 -10
- package/packages/bundled-features/src/helpdesk/handlers/attempts.ts +7 -14
- package/packages/bundled-features/src/helpdesk/handlers/challenge.query.ts +1 -2
- package/packages/bundled-features/src/helpdesk/handlers/reply.write.ts +2 -9
- package/packages/bundled-features/src/helpdesk/handlers/report.write.ts +2 -9
- package/packages/bundled-features/src/helpdesk/handlers/submit.write.ts +3 -11
- package/packages/bundled-features/src/helpdesk/index.ts +1 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-config.ts +61 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-erasure.ts +45 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-retention.ts +65 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-streams.ts +185 -0
- package/packages/bundled-features/src/helpdesk/legacy-contact-user-data.ts +84 -0
- package/packages/bundled-features/src/helpdesk/lib.ts +47 -34
- package/packages/bundled-features/src/helpdesk/user-data-hooks.ts +89 -48
- package/packages/bundled-features/src/helpdesk/web/constants.ts +0 -1
- package/packages/bundled-features/src/inbound-mail-foundation/account-health.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/account-poll.ts +5 -1
- package/packages/bundled-features/src/inbound-mail-foundation/aggregate-id.ts +0 -2
- package/packages/bundled-features/src/inbound-mail-foundation/changes.json +48 -0
- package/packages/bundled-features/src/inbound-mail-foundation/constants.ts +6 -0
- package/packages/bundled-features/src/inbound-mail-foundation/content-refetch.ts +15 -1
- package/packages/bundled-features/src/inbound-mail-foundation/entities.ts +64 -15
- package/packages/bundled-features/src/inbound-mail-foundation/events.ts +15 -16
- package/packages/bundled-features/src/inbound-mail-foundation/feature.ts +3 -1
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/account-address.ts +16 -2
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/attach-message-content.write.ts +10 -3
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/connect-account.write.ts +21 -8
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/forget-message.write.ts +73 -0
- package/packages/bundled-features/src/inbound-mail-foundation/i18n.ts +3 -0
- package/packages/bundled-features/src/inbound-mail-foundation/index.ts +1 -0
- package/packages/bundled-features/src/inbound-mail-foundation/oauth-access-token.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/outbound-mail.ts +2 -0
- package/packages/bundled-features/src/inbound-mail-foundation/personal-address.ts +20 -0
- package/packages/bundled-features/src/inbound-mail-foundation/purge-messages.ts +54 -0
- package/packages/bundled-features/src/inbound-mail-foundation/quarantine.ts +15 -5
- package/packages/bundled-features/src/inbound-mail-foundation/retention-job.ts +1 -5
- package/packages/bundled-features/src/inbound-mail-foundation/retention-sweep.ts +21 -34
- package/packages/bundled-features/src/inbound-mail-foundation/send-from-account.ts +9 -1
- package/packages/bundled-features/src/inbound-mail-foundation/supervisor-ingest.ts +7 -1
- package/packages/bundled-features/src/inbound-mail-foundation/sync-account-now.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/tenant-destroy-hook.ts +14 -17
- package/packages/bundled-features/src/inbound-mail-foundation/watch-supervisor.ts +1 -1
- package/packages/bundled-features/src/inbound-provider-imap/byte-budget.ts +80 -0
- package/packages/bundled-features/src/inbound-provider-imap/changes.json +13 -0
- package/packages/bundled-features/src/inbound-provider-imap/connect-mailbox.ts +8 -4
- package/packages/bundled-features/src/inbound-provider-imap/connect-my-mailbox.ts +23 -6
- package/packages/bundled-features/src/inbound-provider-imap/connect-target-rate-limit.ts +46 -0
- package/packages/bundled-features/src/inbound-provider-imap/download-batch.ts +47 -10
- package/packages/bundled-features/src/inbound-provider-imap/feature.ts +7 -4
- package/packages/bundled-features/src/inbound-provider-imap/fetch-content.ts +43 -29
- package/packages/bundled-features/src/inbound-provider-imap/i18n.ts +2 -2
- package/packages/bundled-features/src/inbound-provider-imap/parse-message.ts +14 -0
- package/packages/bundled-features/src/inbound-provider-imap/reconnect-mailbox.ts +5 -4
- package/packages/bundled-features/src/inbound-provider-imap/send-mail.ts +39 -7
- package/packages/bundled-features/src/inbound-provider-imap/smtp-client.ts +19 -4
- package/packages/bundled-features/src/inbound-provider-imap/watch-mailbox.ts +8 -23
- package/packages/bundled-features/src/inbound-provider-inmemory/feature.ts +1 -1
- package/packages/bundled-features/src/jobs/events.ts +10 -0
- package/packages/bundled-features/src/jobs/feature.ts +2 -0
- package/packages/bundled-features/src/jobs/handlers/consumer.write.ts +41 -16
- package/packages/bundled-features/src/jobs/web/constants.ts +4 -0
- package/packages/bundled-features/src/mail-foundation/changes.json +6 -0
- package/packages/bundled-features/src/mail-transport-inmemory/feature.ts +1 -1
- package/packages/bundled-features/src/mail-transport-smtp/feature.ts +3 -2
- package/packages/bundled-features/src/managed-pages/changes.json +12 -0
- package/packages/bundled-features/src/managed-pages/handlers/branding.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-tenant-published.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/render-page-body.ts +18 -10
- package/packages/bundled-features/src/managed-pages/screens/page-screens.ts +18 -38
- package/packages/bundled-features/src/managed-pages/table.ts +1 -0
- package/packages/bundled-features/src/managed-pages/web/client-plugin.tsx +8 -6
- package/packages/bundled-features/src/managed-pages/web/constants.ts +8 -1
- package/packages/bundled-features/src/managed-pages/web/i18n.ts +11 -3
- package/packages/bundled-features/src/managed-pages/web/markdown-to-document.ts +1 -1
- package/packages/bundled-features/src/managed-pages/web/page-edit-draft.ts +108 -0
- package/packages/bundled-features/src/managed-pages/web/page-edit-screen.tsx +198 -0
- package/packages/bundled-features/src/managed-pages/web/page-settings-rail.tsx +117 -0
- package/packages/bundled-features/src/notes-history-user-data/index.ts +8 -14
- package/packages/bundled-features/src/personal-access-tokens/boot-rules.ts +5 -0
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +0 -1
- package/packages/bundled-features/src/personal-access-tokens/scope-events-check.ts +31 -5
- package/packages/bundled-features/src/presence/changes.json +6 -0
- package/packages/bundled-features/src/presence/handlers/list.query.ts +28 -11
- package/packages/bundled-features/src/presence/room.ts +21 -7
- package/packages/bundled-features/src/presence/store.ts +79 -21
- package/packages/bundled-features/src/readiness/changes.json +25 -0
- package/packages/bundled-features/src/readiness/handlers/latest-summary.query.ts +11 -6
- package/packages/bundled-features/src/readiness/handlers/run-probes.write.ts +35 -5
- package/packages/bundled-features/src/readiness/handlers/run-tone.ts +3 -2
- package/packages/bundled-features/src/readiness/handlers/status.query.ts +15 -1
- package/packages/bundled-features/src/readiness/probe-context.ts +11 -10
- package/packages/bundled-features/src/readiness/screens.ts +4 -4
- package/packages/bundled-features/src/readiness/visible-results.ts +5 -3
- package/packages/bundled-features/src/renderer-foundation/api.ts +6 -13
- package/packages/bundled-features/src/renderer-foundation/types.ts +2 -2
- package/packages/bundled-features/src/secrets/changes.json +7 -0
- package/packages/bundled-features/src/secrets/db/queries/read.ts +18 -4
- package/packages/bundled-features/src/secrets/handlers/list.query.ts +8 -2
- package/packages/bundled-features/src/secrets/secret-scope.ts +2 -3
- package/packages/bundled-features/src/secrets/secrets-context.ts +6 -4
- package/packages/bundled-features/src/secrets/write-gate.ts +4 -2
- package/packages/bundled-features/src/seo/handlers/seo-config.query.ts +1 -1
- package/packages/bundled-features/src/shared/acknowledged-system-db.ts +20 -0
- package/packages/bundled-features/src/shared/assert-billing-live.ts +9 -2
- package/packages/bundled-features/src/shared/changes.json +6 -0
- package/packages/bundled-features/src/shared/index.ts +6 -1
- package/packages/bundled-features/src/shared/parent-visibility.ts +25 -1
- package/packages/bundled-features/src/shared/password-hashing.ts +0 -1
- package/packages/bundled-features/src/shared/price-env-shape.ts +1 -4
- package/packages/bundled-features/src/shared/register-user-data-hooks.ts +29 -0
- package/packages/bundled-features/src/shared/require-bootstrap-extension.ts +26 -0
- package/packages/bundled-features/src/shared/send-best-effort.ts +19 -0
- package/packages/bundled-features/src/shared/stream-tenant-backfill.ts +22 -1
- package/packages/bundled-features/src/shared/stream-tenant-derived-state.ts +31 -1
- package/packages/bundled-features/src/step-dispatcher/changes.json +12 -0
- package/packages/bundled-features/src/step-dispatcher/constants.ts +13 -0
- package/packages/bundled-features/src/step-dispatcher/deliver-dispatch-request.ts +47 -2
- package/packages/bundled-features/src/step-dispatcher/feature.ts +28 -1
- package/packages/bundled-features/src/step-dispatcher/mail-runner.ts +0 -1
- package/packages/bundled-features/src/step-dispatcher/sweep-abandoned.ts +57 -0
- package/packages/bundled-features/src/subscription-mollie/changes.json +7 -0
- package/packages/bundled-features/src/subscription-mollie/plugin-methods.ts +5 -3
- package/packages/bundled-features/src/subscription-mollie/verify-webhook.ts +5 -5
- package/packages/bundled-features/src/subscription-paddle/backfill-checkout-ledger.ts +159 -0
- package/packages/bundled-features/src/subscription-paddle/changes.json +13 -0
- package/packages/bundled-features/src/subscription-paddle/checkout-config.query.ts +1 -1
- package/packages/bundled-features/src/subscription-paddle/checkout-methods.ts +2 -8
- package/packages/bundled-features/src/subscription-paddle/constants.ts +1 -2
- package/packages/bundled-features/src/subscription-paddle/feature.ts +26 -24
- package/packages/bundled-features/src/subscription-paddle/ledger-backfill-marker.ts +70 -0
- package/packages/bundled-features/src/subscription-paddle/plan-switch-methods.ts +2 -8
- package/packages/bundled-features/src/subscription-paddle/redeliver-legacy-checkout.ts +36 -0
- package/packages/bundled-features/src/subscription-paddle/runtime.ts +13 -24
- package/packages/bundled-features/src/subscription-paddle/subscription-state.ts +1 -0
- package/packages/bundled-features/src/subscription-paddle/webhook-events.ts +68 -21
- package/packages/bundled-features/src/subscription-stripe/changes.json +7 -0
- package/packages/bundled-features/src/subscription-stripe/feature.ts +5 -0
- package/packages/bundled-features/src/subscription-stripe/plugin-methods.ts +6 -6
- package/packages/bundled-features/src/subscription-stripe/runtime.ts +8 -7
- package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +24 -6
- package/packages/bundled-features/src/tags/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/tags/web/tag-chip.tsx +4 -5
- package/packages/bundled-features/src/tags/web/tag-manager.tsx +2 -1
- package/packages/bundled-features/src/template-resolver/api.ts +6 -13
- package/packages/bundled-features/src/template-resolver/changes.json +36 -0
- package/packages/bundled-features/src/template-resolver/document-sanitizer.ts +25 -0
- package/packages/bundled-features/src/template-resolver/feature.ts +2 -0
- package/packages/bundled-features/src/template-resolver/handlers/body-preview.query.ts +41 -0
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-shared.ts +5 -11
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +3 -2
- package/packages/bundled-features/src/template-resolver/handlers/send-test.write.ts +37 -8
- package/packages/bundled-features/src/template-resolver/linked-resources.ts +2 -5
- package/packages/bundled-features/src/template-resolver/seeding.ts +77 -0
- package/packages/bundled-features/src/template-resolver/table.ts +1 -0
- package/packages/bundled-features/src/template-resolver/template-draft.ts +2 -1
- package/packages/bundled-features/src/template-resolver/template-preview.ts +14 -3
- package/packages/bundled-features/src/template-resolver/testing.ts +0 -2
- package/packages/bundled-features/src/template-resolver/web/client-plugin.tsx +3 -0
- package/packages/bundled-features/src/template-resolver/web/collection-entry-create-form.tsx +33 -33
- package/packages/bundled-features/src/template-resolver/web/constants.ts +7 -0
- package/packages/bundled-features/src/template-resolver/web/content-tree-provider.ts +0 -1
- package/packages/bundled-features/src/template-resolver/web/content-workbench.tsx +142 -0
- package/packages/bundled-features/src/template-resolver/web/document-insert-model.ts +3 -8
- package/packages/bundled-features/src/template-resolver/web/document-link-policy.ts +58 -0
- package/packages/bundled-features/src/template-resolver/web/document-schema.ts +11 -57
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-bubble.tsx +2 -4
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-context.ts +4 -5
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-editor.tsx +2 -2
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-helpers.ts +6 -3
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-toolbar-groups.tsx +2 -3
- package/packages/bundled-features/src/template-resolver/web/editor-handle.ts +1 -0
- package/packages/bundled-features/src/template-resolver/web/fill-document-variables.ts +24 -0
- package/packages/bundled-features/src/template-resolver/web/i18n.ts +14 -0
- package/packages/bundled-features/src/template-resolver/web/index.ts +3 -0
- package/packages/bundled-features/src/template-resolver/web/preview-targets.ts +25 -0
- package/packages/bundled-features/src/template-resolver/web/qualified-names.ts +1 -0
- package/packages/bundled-features/src/template-resolver/web/snippet-preview-renderer.tsx +24 -0
- package/packages/bundled-features/src/template-resolver/web/string-values.ts +7 -0
- package/packages/bundled-features/src/template-resolver/web/text-block-editor.tsx +38 -50
- package/packages/bundled-features/src/template-resolver/web/use-collection-entry-create.ts +7 -0
- package/packages/bundled-features/src/template-resolver/web/use-content-write.ts +1 -3
- package/packages/bundled-features/src/template-resolver/web/use-document-tiptap-model.ts +1 -2
- package/packages/bundled-features/src/template-resolver/web/use-text-block-editor.ts +28 -7
- package/packages/bundled-features/src/template-resolver/web/web-preview-renderer.tsx +126 -0
- package/packages/bundled-features/src/template-resolver-user-data/index.ts +11 -10
- package/packages/bundled-features/src/tenant/changes.json +6 -0
- package/packages/bundled-features/src/tenant/handlers/create.write.ts +7 -8
- package/packages/bundled-features/src/tenant/handlers/list.query.ts +7 -9
- package/packages/bundled-features/src/tenant/handlers/member-directory.query.ts +10 -4
- package/packages/bundled-features/src/tenant/handlers/toggle-enabled.write.ts +1 -1
- package/packages/bundled-features/src/tenant/invited-membership.ts +10 -1
- package/packages/bundled-features/src/tenant/seeding.ts +4 -2
- package/packages/bundled-features/src/tenant/stream-tenant-backfill.ts +5 -1
- package/packages/bundled-features/src/tenant/testing.ts +1 -1
- package/packages/bundled-features/src/tenant-inactivity/check-inactive-tenants.ts +4 -3
- package/packages/bundled-features/src/tenant-inactivity/constants.ts +1 -2
- package/packages/bundled-features/src/tenant-inactivity/handlers/keep-account.write.ts +1 -2
- package/packages/bundled-features/src/tenant-inactivity/state-store.ts +10 -1
- package/packages/bundled-features/src/tenant-lifecycle/changes.json +18 -0
- package/packages/bundled-features/src/tenant-lifecycle/constants.ts +4 -0
- package/packages/bundled-features/src/tenant-lifecycle/run-tenant-destroy.ts +43 -6
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +15 -2
- package/packages/bundled-features/src/tier-engine/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/tier-engine/changes.json +6 -0
- package/packages/bundled-features/src/tier-engine/feature.ts +8 -2
- package/packages/bundled-features/src/user/changes.json +6 -0
- package/packages/bundled-features/src/user/db/queries/stream-tenant-backfill.ts +2 -1
- package/packages/bundled-features/src/user/handlers/me.query.ts +3 -1
- package/packages/bundled-features/src/user/index.ts +1 -0
- package/packages/bundled-features/src/user/resolve-verified-user-email.ts +17 -0
- package/packages/bundled-features/src/user-data-rights/db/queries/export-jobs.ts +0 -1
- package/packages/bundled-features/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-token.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/request-deletion-by-email.write.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/run-export-jobs.ts +0 -2
- package/packages/bundled-features/src/user-data-rights/run-forget-cleanup.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/schema/download-attempt.ts +3 -2
- package/packages/bundled-features/src/user-data-rights/web/confirm-deletion-screen.tsx +1 -1
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +1 -1
- package/packages/bundled-features/src/user-data-rights/web/request-deletion-screen.tsx +1 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/api-token.userdata-hook.ts +5 -5
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/hard-delete-own-rows-hook.ts +17 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/in-app-message.userdata-hook.ts +5 -5
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/job-run.userdata-hook.ts +2 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/user-session.userdata-hook.ts +5 -5
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +0 -1
- package/packages/bundled-features/src/waitlist/changes.json +6 -0
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +4 -28
- package/packages/bundled-features/src/waitlist/lib.ts +2 -7
- package/packages/bundled-features/src/waitlist/user-data-hooks.ts +6 -19
- package/packages/bundled-features/src/workflow-runner/aggregate-id.ts +0 -1
- package/packages/bundled-features/src/workflow-runner/event-trigger.ts +6 -2
- package/packages/bundled-features/src/workflow-runner/feature.ts +1 -5
- package/packages/bundled-features/src/workflow-runner/handlers/resume-run.write.ts +5 -4
- package/packages/bundled-features/src/workflow-runner/runner.ts +2 -0
- package/samples/apps/showcase/src/features/demos/web/pages/dialog.tsx +0 -1
- package/samples/apps/showcase/src/features/demos/web/pages/layout.tsx +1 -1
- package/samples/apps/showcase/src/features/demos/web/pages/sidebar-panel.tsx +0 -1
- package/samples/apps/styleguide/src/features/gallery/web/Gallery.tsx +1 -4
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/feature.ts +6 -2
- package/samples/apps/use-all-bundled/e2e-billing-gallery/gallery-features.ts +12 -14
- package/samples/apps/use-all-bundled/feature-manifest.json +60 -29
- package/samples/apps/use-all-bundled/playwright.billing-docs.config.ts +1 -1
- package/samples/apps/use-all-bundled/playwright.config.ts +1 -0
- package/samples/apps/use-all-bundled/src/app/seed.ts +1 -1
- package/samples/apps/use-all-bundled/src/run-config.ts +2 -1
- package/samples/recipes/auth-mfa/src/web/confirmation-code-step.tsx +32 -10
- package/samples/recipes/chat-channels/README.md +2 -0
- package/samples/recipes/currencies-global/src/entities/currency.ts +1 -0
- package/samples/recipes/managed-pages/README.md +5 -1
- package/samples/recipes/managed-pages/package.json +3 -2
- package/samples/recipes/managed-pages/src/web/branded-preview.tsx +21 -0
- package/samples/recipes/managed-pages/tsconfig.json +8 -0
- package/samples/recipes/pwa-shell/README.md +52 -0
- package/samples/recipes/pwa-shell/bin/server.ts +12 -0
- package/samples/recipes/pwa-shell/package.json +13 -0
- package/samples/recipes/pwa-shell/src/app.ts +34 -0
- package/samples/recipes/rate-limiting/README.md +3 -3
- package/samples/recipes/record-detail-layout/README.md +33 -0
- package/samples/recipes/record-detail-layout/src/feature.ts +525 -44
- package/samples/recipes/record-detail-layout/src/order-board.ts +521 -0
- package/packages/bundled-features/src/managed-pages/web/page-body-section.tsx +0 -72
- package/packages/bundled-features/src/subscription-paddle/tenant-binding.ts +0 -34
- package/packages/bundled-features/src/template-resolver/web/content-field.tsx +0 -61
|
@@ -125,15 +125,17 @@ async function fetchMessages(
|
|
|
125
125
|
? await unknownUidsOf(uids, serverUidValidity, opts.filterUnknownMessageIds)
|
|
126
126
|
: uids;
|
|
127
127
|
const batch = unknown.slice(0, opts.maxMessages);
|
|
128
|
-
const
|
|
129
|
-
const { messages, rejected } = await downloadBatch(
|
|
128
|
+
const { messages, rejected, deferred } = await downloadBatch(
|
|
130
129
|
client,
|
|
131
130
|
batch,
|
|
132
131
|
serverUidValidity,
|
|
133
132
|
account.trustedAuthservId ?? null,
|
|
134
133
|
);
|
|
134
|
+
const deferredUids = new Set(deferred);
|
|
135
|
+
const handled = batch.filter((uid) => !deferredUids.has(uid));
|
|
136
|
+
const hasMore = unknown.length > handled.length;
|
|
135
137
|
// From the UIDs, not from what was downloaded: a known or skipped mail must not hold the cursor back.
|
|
136
|
-
const lastUid = Math.max(parsedCursor?.lastUid ?? 0, ...(hasMore ?
|
|
138
|
+
const lastUid = Math.max(parsedCursor?.lastUid ?? 0, ...(hasMore ? handled : uids));
|
|
137
139
|
|
|
138
140
|
return {
|
|
139
141
|
messages,
|
|
@@ -174,7 +176,7 @@ export function createInboundProviderImapFeature(options: InboundMailRoleOptions
|
|
|
174
176
|
FEATURE_NAME,
|
|
175
177
|
(r) => {
|
|
176
178
|
r.describe(
|
|
177
|
-
'Registers the `"imap"` provider for `inbound-mail-foundation` using imapflow — password/app-password auth covers classic IMAP hosts without any OAuth (plus an XOAUTH2 fallback consuming an access token from the secret slot). Incremental sync via a UIDVALIDITY:lastUid cursor (UIDVALIDITY change triggers a cursor-invalid full resync), initial backfill bounded by the foundation backfill window, and live push via IMAP IDLE for the watch supervisor. Tenant admins connect a shared mailbox through the "Connect mailbox" form on the mail accounts list and members a personal one through the same form on "My mail accounts" (`connect-mailbox` and `connect-my-mailbox` check the IMAP login and the SMTP login of the outgoing server first, then creates the account and its credential secret in one transaction; `reconnect-mailbox` does the same check for an existing mailbox with a sign-in error and overwrites its credential secret); programmatic setups store the per-account connection JSON (host/port/secure/user/password, plus smtpHost/smtpPort for sending) in the account credential secret slot before the first sync. Implements the provider `send`: `sendMailFromAccount` sends over the SMTP server of the mailbox itself (implicit
|
|
179
|
+
'Registers the `"imap"` provider for `inbound-mail-foundation` using imapflow — password/app-password auth covers classic IMAP hosts without any OAuth (plus an XOAUTH2 fallback consuming an access token from the secret slot). Incremental sync via a UIDVALIDITY:lastUid cursor (UIDVALIDITY change triggers a cursor-invalid full resync), initial backfill bounded by the foundation backfill window, and live push via IMAP IDLE for the watch supervisor. Tenant admins connect a shared mailbox through the "Connect mailbox" form on the mail accounts list and members a personal one through the same form on "My mail accounts" (`connect-mailbox` and `connect-my-mailbox` check the IMAP login and the SMTP login of the outgoing server first, then creates the account and its credential secret in one transaction; `reconnect-mailbox` does the same check for an existing mailbox with a sign-in error and overwrites its credential secret); programmatic setups store the per-account connection JSON (host/port/secure/user/password, plus smtpHost/smtpPort for sending) in the account credential secret slot before the first sync. Implements the provider `send`: `sendMailFromAccount` sends over the SMTP server of the mailbox itself (TLS enforced: implicit on port 465, STARTTLS with requireTLS on every other port, port from the credential document, connect form default 587; same login) with the mailbox address as From and stores a copy in its sent folder.',
|
|
178
180
|
);
|
|
179
181
|
r.uiHints({
|
|
180
182
|
displayLabel: "Inbound Mail · IMAP",
|
|
@@ -183,6 +185,7 @@ export function createInboundProviderImapFeature(options: InboundMailRoleOptions
|
|
|
183
185
|
});
|
|
184
186
|
r.requires({ features: ["inbound-mail-foundation"] });
|
|
185
187
|
r.requires({ features: ["secrets"] });
|
|
188
|
+
r.requires({ features: ["user"] });
|
|
186
189
|
r.envSchema(mailAllowedPrivateHostsEnvSchema);
|
|
187
190
|
r.useExtension(INBOUND_MAIL_PROVIDER_EXTENSION, IMAP_PROVIDER_KEY, imapInboundMailPlugin);
|
|
188
191
|
r.bootCheck(({ features }) => assertRolesMatchFoundation(FEATURE_NAME, roles, features));
|
|
@@ -10,7 +10,10 @@ import type {
|
|
|
10
10
|
RejectedInboundMessage,
|
|
11
11
|
} from "@cosmicdrift/kumiko-bundled-features/inbound-mail-foundation";
|
|
12
12
|
import { InboundTransientError } from "@cosmicdrift/kumiko-bundled-features/inbound-mail-foundation";
|
|
13
|
+
import type { ImapFlow } from "imapflow";
|
|
14
|
+
import { planWithinByteBudget } from "./byte-budget.ts";
|
|
13
15
|
import { readCredentialDocument } from "./credential-document.ts";
|
|
16
|
+
import { fetchAndParse } from "./download-batch.ts";
|
|
14
17
|
import {
|
|
15
18
|
closeOnAbort,
|
|
16
19
|
createImapClient,
|
|
@@ -18,7 +21,6 @@ import {
|
|
|
18
21
|
imapMailHostGuard,
|
|
19
22
|
mapImapError,
|
|
20
23
|
} from "./imap-client.ts";
|
|
21
|
-
import { coerceDate, parseOrReject } from "./parse-message.ts";
|
|
22
24
|
|
|
23
25
|
function uidOf(providerMessageId: string, serverUidValidity: string): number | null {
|
|
24
26
|
const separator = providerMessageId.lastIndexOf(":");
|
|
@@ -27,6 +29,41 @@ function uidOf(providerMessageId: string, serverUidValidity: string): number | n
|
|
|
27
29
|
return Number.isInteger(uid) && uid > 0 ? uid : null;
|
|
28
30
|
}
|
|
29
31
|
|
|
32
|
+
function splitByServerUidValidity(
|
|
33
|
+
providerMessageIds: readonly string[],
|
|
34
|
+
serverUidValidity: string,
|
|
35
|
+
): { readonly idByUid: Map<number, string>; readonly missing: string[] } {
|
|
36
|
+
const idByUid = new Map<number, string>();
|
|
37
|
+
const missing: string[] = [];
|
|
38
|
+
for (const id of providerMessageIds) {
|
|
39
|
+
const uid = uidOf(id, serverUidValidity);
|
|
40
|
+
if (uid === null) missing.push(id);
|
|
41
|
+
else idByUid.set(uid, id);
|
|
42
|
+
}
|
|
43
|
+
return { idByUid, missing };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function downloadWithinBudget(
|
|
47
|
+
client: ImapFlow,
|
|
48
|
+
idByUid: Map<number, string>,
|
|
49
|
+
serverUidValidity: string,
|
|
50
|
+
): Promise<{
|
|
51
|
+
readonly messages: RawInboundMessage[];
|
|
52
|
+
readonly rejected: RejectedInboundMessage[];
|
|
53
|
+
}> {
|
|
54
|
+
const plan = await planWithinByteBudget(client, [...idByUid.keys()], serverUidValidity);
|
|
55
|
+
for (const rejectedMail of plan.tooLarge) {
|
|
56
|
+
const tooLargeUid = uidOf(rejectedMail.providerMessageId, serverUidValidity);
|
|
57
|
+
if (tooLargeUid !== null) idByUid.delete(tooLargeUid);
|
|
58
|
+
}
|
|
59
|
+
// Cut by the byte budget, not gone: they stay candidates and come in a later round.
|
|
60
|
+
for (const uid of plan.deferred) idByUid.delete(uid);
|
|
61
|
+
if (plan.download.length === 0) return { messages: [], rejected: [...plan.tooLarge] };
|
|
62
|
+
const fetched = await fetchAndParse(client, plan.download.join(","), serverUidValidity, null);
|
|
63
|
+
for (const uid of fetched.seenUids) idByUid.delete(uid);
|
|
64
|
+
return { messages: fetched.messages, rejected: [...plan.tooLarge, ...fetched.rejected] };
|
|
65
|
+
}
|
|
66
|
+
|
|
30
67
|
export async function fetchMessageContent(
|
|
31
68
|
ctx: InboundMailContext,
|
|
32
69
|
account: MailAccountRecord,
|
|
@@ -43,34 +80,11 @@ export async function fetchMessageContent(
|
|
|
43
80
|
const mailbox = client.mailbox;
|
|
44
81
|
if (typeof mailbox === "boolean") throw new InboundTransientError("mailbox not open");
|
|
45
82
|
const serverUidValidity = String(mailbox.uidValidity);
|
|
46
|
-
const idByUid =
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
else idByUid.set(uid, id);
|
|
52
|
-
}
|
|
53
|
-
const messages: RawInboundMessage[] = [];
|
|
54
|
-
const rejected: RejectedInboundMessage[] = [];
|
|
55
|
-
if (idByUid.size > 0) {
|
|
56
|
-
for await (const msg of client.fetch(
|
|
57
|
-
[...idByUid.keys()].join(","),
|
|
58
|
-
{ uid: true, internalDate: true, source: true, envelope: true },
|
|
59
|
-
{ uid: true },
|
|
60
|
-
)) {
|
|
61
|
-
if (!msg.source) continue;
|
|
62
|
-
const parsed = await parseOrReject({
|
|
63
|
-
source: msg.source,
|
|
64
|
-
uid: msg.uid,
|
|
65
|
-
uidValidity: serverUidValidity,
|
|
66
|
-
internalDate: coerceDate(msg.internalDate ?? undefined),
|
|
67
|
-
envelope: msg.envelope,
|
|
68
|
-
});
|
|
69
|
-
idByUid.delete(msg.uid);
|
|
70
|
-
if ("message" in parsed) messages.push(parsed.message);
|
|
71
|
-
else rejected.push(parsed.rejected);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
83
|
+
const { idByUid, missing } = splitByServerUidValidity(providerMessageIds, serverUidValidity);
|
|
84
|
+
const { messages, rejected } =
|
|
85
|
+
idByUid.size > 0
|
|
86
|
+
? await downloadWithinBudget(client, idByUid, serverUidValidity)
|
|
87
|
+
: { messages: [], rejected: [] };
|
|
74
88
|
// What the server did not return is gone (expunged since the import).
|
|
75
89
|
missing.push(...idByUid.values());
|
|
76
90
|
return { messages, missing, rejected };
|
|
@@ -33,7 +33,7 @@ export const INBOUND_PROVIDER_IMAP_I18N: Readonly<Record<string, { readonly en:
|
|
|
33
33
|
"inboundMail.imap.connect.server": { en: "Server sign-in" },
|
|
34
34
|
"inboundMail.imap.connect.outgoing": { en: "Sending" },
|
|
35
35
|
"inboundMail.imap.connect.outgoingHint": {
|
|
36
|
-
en: "Replies go out from this address over your own mail server, with the same user name and password. Leave the field empty if the server is called like the IMAP server, with smtp. instead of imap. Usually 587, even when your provider lists 465/SSL.",
|
|
36
|
+
en: "Replies go out from this address over your own mail server, with the same user name and password. Leave the field empty if the server is called like the IMAP server, with smtp. instead of imap. Usually 587, even when your provider lists 465/SSL. Port 465 means SSL/TLS, every other port means STARTTLS.",
|
|
37
37
|
},
|
|
38
38
|
[formFieldKey("trustedAuthservId")]: { en: "Mail server ID" },
|
|
39
39
|
"inboundMail.imap.connect.senderCheck": { en: "Sender check" },
|
|
@@ -55,7 +55,7 @@ export const INBOUND_PROVIDER_IMAP_I18N: Readonly<Record<string, { readonly en:
|
|
|
55
55
|
en: "The IMAP server rejected the sign-in. Check the user name and password.",
|
|
56
56
|
},
|
|
57
57
|
[IMAP_CONNECT_ERRORS.tlsFailed.i18nKey]: {
|
|
58
|
-
en: "The encrypted connection failed. Check the port
|
|
58
|
+
en: "The encrypted connection failed. Check that the port is the IMAPS port (usually 993).",
|
|
59
59
|
},
|
|
60
60
|
[IMAP_CONNECT_ERRORS.connectFailed.i18nKey]: {
|
|
61
61
|
en: "No connection to the IMAP server. Check the server name and port.",
|
|
@@ -120,6 +120,20 @@ function headersOfEnvelope(
|
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
/** A mail that was not downloaded (too large): quarantined by its envelope, with no original to retry from. */
|
|
124
|
+
export function rejectedWithoutSource(args: {
|
|
125
|
+
readonly uid: number;
|
|
126
|
+
readonly uidValidity: string;
|
|
127
|
+
readonly internalDate: Date | undefined;
|
|
128
|
+
readonly envelope?: MessageEnvelopeObject | undefined;
|
|
129
|
+
}): RejectedInboundMessage {
|
|
130
|
+
return {
|
|
131
|
+
providerMessageId: buildProviderMessageId(args.uidValidity, args.uid),
|
|
132
|
+
reason: "unparseable",
|
|
133
|
+
...(args.envelope && { headers: headersOfEnvelope(args.envelope, args.internalDate) }),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
123
137
|
export type ParsedOrRejected =
|
|
124
138
|
| { readonly message: RawInboundMessage }
|
|
125
139
|
| { readonly rejected: RejectedInboundMessage };
|
|
@@ -60,7 +60,7 @@ export const createReconnectMailboxHandler = ({ memberRoles, adminRoles }: Inbou
|
|
|
60
60
|
if (!mayReactivateMailbox(lookup.row.ownerUserId, ctx.user, adminRoles)) {
|
|
61
61
|
return failNotFound("mail-account", event.payload.accountId);
|
|
62
62
|
}
|
|
63
|
-
return checkMailboxLogin(credentialDocumentOf(event.payload), ctx
|
|
63
|
+
return checkMailboxLogin(credentialDocumentOf(event.payload), ctx);
|
|
64
64
|
},
|
|
65
65
|
handler: async (event, ctx) => {
|
|
66
66
|
const { accountId } = event.payload;
|
|
@@ -86,14 +86,15 @@ export const createReconnectMailboxHandler = ({ memberRoles, adminRoles }: Inbou
|
|
|
86
86
|
},
|
|
87
87
|
);
|
|
88
88
|
if (!reactivated.isSuccess) return reactivated;
|
|
89
|
-
// The sender-check policy is tenant-wide: only admins set it,
|
|
90
|
-
|
|
89
|
+
// The sender-check policy is tenant-wide: only admins set it, and only when the form carries
|
|
90
|
+
// the field. The owner's form omits it, and an admin using that form must not clear the policy.
|
|
91
|
+
if (isMailAdmin(event.user, adminRoles) && event.payload.trustedAuthservId !== undefined) {
|
|
91
92
|
// The admin form shows the stored id, so an empty field means the admin cleared it.
|
|
92
93
|
const trusted = await ctx.dispatch.write(
|
|
93
94
|
InboundMailFoundationHandlers.setTrustedAuthservId,
|
|
94
95
|
{
|
|
95
96
|
accountId,
|
|
96
|
-
trustedAuthservId: event.payload.trustedAuthservId
|
|
97
|
+
trustedAuthservId: event.payload.trustedAuthservId,
|
|
97
98
|
},
|
|
98
99
|
);
|
|
99
100
|
if (!trusted.isSuccess) return trusted;
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
InboundAuthError,
|
|
7
7
|
type InboundMailContext,
|
|
8
8
|
InboundTransientError,
|
|
9
|
+
isInboundAuthError,
|
|
9
10
|
type MailAccountRecord,
|
|
10
11
|
MailSendNotConfiguredError,
|
|
11
12
|
MailSendRejectedError,
|
|
@@ -15,11 +16,18 @@ import {
|
|
|
15
16
|
} from "@cosmicdrift/kumiko-bundled-features/inbound-mail-foundation";
|
|
16
17
|
import MailComposer from "nodemailer/lib/mail-composer";
|
|
17
18
|
import { FEATURE_NAME } from "./constants.ts";
|
|
18
|
-
import { readCredentialDocument } from "./credential-document.ts";
|
|
19
|
+
import { type ImapCredentialDocument, readCredentialDocument } from "./credential-document.ts";
|
|
19
20
|
import { appendToSentFolder } from "./sent-folder.ts";
|
|
20
21
|
import { SmtpFailureError, sendRawViaSmtp } from "./smtp-client.ts";
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
// A host the guard blocks stays blocked and a failed certificate check stays failed: retrying
|
|
24
|
+
// cannot help, the tenant has to connect the mailbox again.
|
|
25
|
+
function isPermanentSmtpFailure(err: SmtpFailureError): boolean {
|
|
26
|
+
return err.failure === "tlsFailed" || (err.failure === "hostUnreachable" && err.blocked);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function toFoundationSendError(err: SmtpFailureError): Error {
|
|
30
|
+
if (isPermanentSmtpFailure(err)) return new MailSendNotConfiguredError(err.message);
|
|
23
31
|
switch (err.failure) {
|
|
24
32
|
case "loginRejected":
|
|
25
33
|
return new InboundAuthError(err.message);
|
|
@@ -34,13 +42,31 @@ function stripAngles(id: string): string {
|
|
|
34
42
|
return id.replace(/^<|>$/g, "");
|
|
35
43
|
}
|
|
36
44
|
|
|
45
|
+
// A missing or unreadable credential document means no login was attempted: the mailbox has to be
|
|
46
|
+
// connected again, which is not a rejected password.
|
|
47
|
+
async function readSendCredentialDocument(
|
|
48
|
+
ctx: InboundMailContext,
|
|
49
|
+
account: MailAccountRecord,
|
|
50
|
+
): Promise<ImapCredentialDocument> {
|
|
51
|
+
try {
|
|
52
|
+
return await readCredentialDocument(ctx, account);
|
|
53
|
+
} catch (err) {
|
|
54
|
+
if (isInboundAuthError(err)) {
|
|
55
|
+
throw new MailSendNotConfiguredError(
|
|
56
|
+
`${FEATURE_NAME}: account ${account.id} has no usable credential document`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
throw err;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
37
63
|
export async function sendFromImapAccount(
|
|
38
64
|
ctx: InboundMailContext,
|
|
39
65
|
account: MailAccountRecord,
|
|
40
66
|
message: OutboundMailMessage,
|
|
41
67
|
attachments: readonly OutboundAttachment[],
|
|
42
68
|
): Promise<ProviderSentMail> {
|
|
43
|
-
const doc = await
|
|
69
|
+
const doc = await readSendCredentialDocument(ctx, account);
|
|
44
70
|
if (!doc.smtpHost || !doc.password) {
|
|
45
71
|
throw new MailSendNotConfiguredError(
|
|
46
72
|
`${FEATURE_NAME}: account ${account.id} has no outgoing server stored`,
|
|
@@ -67,16 +93,22 @@ export async function sendFromImapAccount(
|
|
|
67
93
|
}).compile();
|
|
68
94
|
const raw = await mime.build();
|
|
69
95
|
|
|
96
|
+
let rejectedRecipients: readonly string[];
|
|
70
97
|
try {
|
|
71
|
-
await sendRawViaSmtp(
|
|
98
|
+
({ rejectedRecipients } = await sendRawViaSmtp(
|
|
72
99
|
{ host: doc.smtpHost, port: doc.smtpPort, user: doc.user, password: doc.password },
|
|
73
100
|
{ from: account.address, to: [...message.to, ...(message.cc ?? [])] },
|
|
74
101
|
raw,
|
|
75
|
-
);
|
|
102
|
+
));
|
|
76
103
|
} catch (err) {
|
|
77
104
|
throw err instanceof SmtpFailureError ? toFoundationSendError(err) : err;
|
|
78
105
|
}
|
|
79
106
|
|
|
80
|
-
|
|
81
|
-
|
|
107
|
+
// Detached: the copy is best effort and must not keep the caller (maybe inside a request
|
|
108
|
+
// transaction) waiting for another server round trip; appendToSentFolder never rejects.
|
|
109
|
+
void appendToSentFolder(doc, raw, account.id);
|
|
110
|
+
return {
|
|
111
|
+
messageIdHeader: stripAngles(mime.messageId()),
|
|
112
|
+
...(rejectedRecipients.length > 0 && { rejectedRecipients }),
|
|
113
|
+
};
|
|
82
114
|
}
|
|
@@ -38,10 +38,13 @@ export type SmtpFailure =
|
|
|
38
38
|
// response, which stay in the server log.
|
|
39
39
|
export class SmtpFailureError extends Error {
|
|
40
40
|
readonly failure: SmtpFailure;
|
|
41
|
-
|
|
41
|
+
/** The host guard refused the target; as opposed to a name that did not resolve. */
|
|
42
|
+
readonly blocked: boolean;
|
|
43
|
+
constructor(failure: SmtpFailure, detail: string, blocked = false) {
|
|
42
44
|
super(`SMTP ${failure}: ${detail}`);
|
|
43
45
|
this.name = "SmtpFailureError";
|
|
44
46
|
this.failure = failure;
|
|
47
|
+
this.blocked = blocked;
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
|
|
@@ -94,7 +97,7 @@ async function openSmtpTransport(login: SmtpLogin): Promise<Transporter> {
|
|
|
94
97
|
host: login.host,
|
|
95
98
|
reason,
|
|
96
99
|
});
|
|
97
|
-
throw new SmtpFailureError("hostUnreachable", blocked ? "blocked" : "unresolved");
|
|
100
|
+
throw new SmtpFailureError("hostUnreachable", blocked ? "blocked" : "unresolved", blocked);
|
|
98
101
|
}
|
|
99
102
|
return createTransport(smtpTransportOptions(login, target));
|
|
100
103
|
}
|
|
@@ -119,14 +122,26 @@ export async function verifySmtpLogin(login: SmtpLogin): Promise<void> {
|
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
124
|
|
|
125
|
+
// nodemailer throws only when every recipient is refused; a partial refusal resolves and lists
|
|
126
|
+
// the refused addresses here (as strings or address objects).
|
|
127
|
+
export function rejectedRecipientsOf(
|
|
128
|
+
rejected: ReadonlyArray<string | { readonly address: string }> | undefined,
|
|
129
|
+
): string[] {
|
|
130
|
+
return (rejected ?? []).map((entry) => (typeof entry === "string" ? entry : entry.address));
|
|
131
|
+
}
|
|
132
|
+
|
|
122
133
|
export async function sendRawViaSmtp(
|
|
123
134
|
login: SmtpLogin,
|
|
124
135
|
envelope: { readonly from: string; readonly to: readonly string[] },
|
|
125
136
|
raw: Buffer,
|
|
126
|
-
): Promise<
|
|
137
|
+
): Promise<{ readonly rejectedRecipients: readonly string[] }> {
|
|
127
138
|
const transport = await openSmtpTransport(login);
|
|
128
139
|
try {
|
|
129
|
-
await transport.sendMail({
|
|
140
|
+
const info = await transport.sendMail({
|
|
141
|
+
envelope: { from: envelope.from, to: [...envelope.to] },
|
|
142
|
+
raw,
|
|
143
|
+
});
|
|
144
|
+
return { rejectedRecipients: rejectedRecipientsOf(info.rejected) };
|
|
130
145
|
} catch (err) {
|
|
131
146
|
throw smtpFailureOf(err, login.host);
|
|
132
147
|
} finally {
|
|
@@ -6,8 +6,8 @@ import type {
|
|
|
6
6
|
} from "@cosmicdrift/kumiko-bundled-features/inbound-mail-foundation";
|
|
7
7
|
import type { ImapFlow } from "imapflow";
|
|
8
8
|
import { readCredentialDocument } from "./credential-document.ts";
|
|
9
|
+
import { fetchAndParse } from "./download-batch.ts";
|
|
9
10
|
import { createImapClient, IMAP_MAILBOX, imapMailHostGuard, mapImapError } from "./imap-client.ts";
|
|
10
|
-
import { coerceDate, parseOrReject } from "./parse-message.ts";
|
|
11
11
|
|
|
12
12
|
// IMAP IDLE (imapflow idles automatically while the mailbox is open
|
|
13
13
|
// and emits 'exists' for new messages).
|
|
@@ -36,29 +36,14 @@ export async function watchMailbox(
|
|
|
36
36
|
let nextUid = Number(mailbox.uidNext ?? 1);
|
|
37
37
|
|
|
38
38
|
const drainNew = async () => {
|
|
39
|
-
const messages
|
|
40
|
-
|
|
41
|
-
let maxSeen = nextUid - 1;
|
|
42
|
-
for await (const msg of client.fetch(
|
|
39
|
+
const { messages, rejected, seenUids } = await fetchAndParse(
|
|
40
|
+
client,
|
|
43
41
|
`${nextUid}:*`,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const parsed = await parseOrReject({
|
|
50
|
-
source: msg.source,
|
|
51
|
-
envelope: msg.envelope,
|
|
52
|
-
uid: msg.uid,
|
|
53
|
-
uidValidity,
|
|
54
|
-
internalDate: coerceDate(msg.internalDate ?? undefined),
|
|
55
|
-
trustedAuthservId: account.trustedAuthservId ?? null,
|
|
56
|
-
});
|
|
57
|
-
if ("message" in parsed) messages.push(parsed.message);
|
|
58
|
-
else rejected.push(parsed.rejected);
|
|
59
|
-
if (msg.uid > maxSeen) maxSeen = msg.uid;
|
|
60
|
-
}
|
|
61
|
-
nextUid = maxSeen + 1;
|
|
42
|
+
uidValidity,
|
|
43
|
+
account.trustedAuthservId ?? null,
|
|
44
|
+
nextUid,
|
|
45
|
+
);
|
|
46
|
+
nextUid = seenUids.reduce((highest, uid) => Math.max(highest, uid), nextUid - 1) + 1;
|
|
62
47
|
if (messages.length > 0 || rejected.length > 0) await handlers.onMessages(messages, rejected);
|
|
63
48
|
};
|
|
64
49
|
|
|
@@ -199,7 +199,7 @@ export const inMemoryInboundMailPlugin: InboundMailProviderPlugin = {
|
|
|
199
199
|
fetch: async (ctx, account, cursor, opts): Promise<InboundFetchResult> => {
|
|
200
200
|
const state = stateFor(account.id);
|
|
201
201
|
state.lastFetchSignal = opts.signal;
|
|
202
|
-
if (state.hangingFetch) await state.hangingFetch;
|
|
202
|
+
if (state.hangingFetch !== null) await state.hangingFetch;
|
|
203
203
|
if (state.nextFetchError) {
|
|
204
204
|
const err = state.nextFetchError;
|
|
205
205
|
state.nextFetchError = null;
|
|
@@ -34,3 +34,13 @@ export const runFailedSchema = z.object({
|
|
|
34
34
|
error: z.string(),
|
|
35
35
|
logs: z.array(jobLogEntrySchema),
|
|
36
36
|
});
|
|
37
|
+
|
|
38
|
+
export const CONSUMER_STATE_ACTIONS = ["restarted", "skipped", "disabled", "enabled"] as const;
|
|
39
|
+
|
|
40
|
+
export const consumerStateChangedSchema = z.object({
|
|
41
|
+
action: z.enum(CONSUMER_STATE_ACTIONS),
|
|
42
|
+
name: z.string(),
|
|
43
|
+
instanceId: z.string(),
|
|
44
|
+
skippedEventId: z.string().nullable(),
|
|
45
|
+
actor: z.string(),
|
|
46
|
+
});
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
type FeatureDefinition,
|
|
5
5
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
6
6
|
import { JOBS_BOOT_RULES } from "./boot-rules.ts";
|
|
7
|
+
import { consumerStateChangedSchema } from "./events.ts";
|
|
7
8
|
import { catalogQuery } from "./handlers/catalog.query.ts";
|
|
8
9
|
import {
|
|
9
10
|
consumerDisableWrite,
|
|
@@ -80,6 +81,7 @@ export function createJobsFeature(options: JobsFeatureOptions = {}): FeatureDefi
|
|
|
80
81
|
recommended: false,
|
|
81
82
|
});
|
|
82
83
|
r.systemScope();
|
|
84
|
+
r.defineEvent("consumer-state-changed", consumerStateChangedSchema, { piiFields: "none" });
|
|
83
85
|
r.storeTable(jobRunsTableMeta, {
|
|
84
86
|
reason: "direct_write.job_runs",
|
|
85
87
|
// payload/error carry personal:{of:"triggeredById"} (job-run-table.ts): encrypted under the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
1
|
+
import { defineWriteHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import {
|
|
3
3
|
InternalError,
|
|
4
4
|
UnprocessableError,
|
|
@@ -14,7 +14,12 @@ import {
|
|
|
14
14
|
skipPoisonEvent,
|
|
15
15
|
} from "@cosmicdrift/kumiko-framework/pipeline";
|
|
16
16
|
import * as z from "zod";
|
|
17
|
-
import {
|
|
17
|
+
import type { CONSUMER_STATE_ACTIONS } from "../events.ts";
|
|
18
|
+
import {
|
|
19
|
+
CONSUMER_STATE_CHANGED_EVENT_NAME,
|
|
20
|
+
JOBS_AGGREGATE_TYPE,
|
|
21
|
+
JobErrors,
|
|
22
|
+
} from "../web/constants.ts";
|
|
18
23
|
|
|
19
24
|
const consumerTargetSchema = z.object({ name: z.string().min(1), instanceId: z.string().min(1) });
|
|
20
25
|
|
|
@@ -30,7 +35,12 @@ type ConsumerTransition = (
|
|
|
30
35
|
instanceId: string,
|
|
31
36
|
) => Promise<ConsumerRecoveryState & { readonly skippedEventId?: bigint | null }>;
|
|
32
37
|
|
|
33
|
-
function defineConsumerWrite(
|
|
38
|
+
function defineConsumerWrite(
|
|
39
|
+
name: string,
|
|
40
|
+
action: (typeof CONSUMER_STATE_ACTIONS)[number],
|
|
41
|
+
description: string,
|
|
42
|
+
transition: ConsumerTransition,
|
|
43
|
+
) {
|
|
34
44
|
return defineWriteHandler({
|
|
35
45
|
name,
|
|
36
46
|
description,
|
|
@@ -45,20 +55,9 @@ function defineConsumerWrite(name: string, description: string, transition: Cons
|
|
|
45
55
|
});
|
|
46
56
|
}
|
|
47
57
|
const db = ctx.systemDb.unsafeRaw(CONSUMER_STATE_REASON);
|
|
58
|
+
let next: Awaited<ReturnType<ConsumerTransition>>;
|
|
48
59
|
try {
|
|
49
|
-
|
|
50
|
-
if (next.skippedEventId === null) {
|
|
51
|
-
return rejected(JobErrors.consumerNothingToSkip, "jobs.errors.consumerNothingToSkip");
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
isSuccess: true,
|
|
55
|
-
data: {
|
|
56
|
-
name: next.name,
|
|
57
|
-
instanceId: next.instanceId,
|
|
58
|
-
status: next.status,
|
|
59
|
-
skippedEventId: next.skippedEventId?.toString() ?? null,
|
|
60
|
-
},
|
|
61
|
-
};
|
|
60
|
+
next = await transition(db, event.payload.name, event.payload.instanceId);
|
|
62
61
|
} catch (e) {
|
|
63
62
|
if (e instanceof ConsumerTransitionError) {
|
|
64
63
|
return e.rejection === "unknown-consumer"
|
|
@@ -74,28 +73,54 @@ function defineConsumerWrite(name: string, description: string, transition: Cons
|
|
|
74
73
|
);
|
|
75
74
|
return rejected(JobErrors.consumerTransitionFailed, "jobs.errors.consumerTransitionFailed");
|
|
76
75
|
}
|
|
76
|
+
if (next.skippedEventId === null) {
|
|
77
|
+
return rejected(JobErrors.consumerNothingToSkip, "jobs.errors.consumerNothingToSkip");
|
|
78
|
+
}
|
|
79
|
+
const skippedEventId = next.skippedEventId?.toString() ?? null;
|
|
80
|
+
// unsafeAppend: bundled-features cannot see an app's event map; the schema is checked via
|
|
81
|
+
// r.defineEvent("consumer-state-changed", ...).
|
|
82
|
+
await ctx.events.unsafeAppend({
|
|
83
|
+
aggregateId: SYSTEM_TENANT_ID,
|
|
84
|
+
aggregateType: JOBS_AGGREGATE_TYPE,
|
|
85
|
+
type: CONSUMER_STATE_CHANGED_EVENT_NAME,
|
|
86
|
+
payload: {
|
|
87
|
+
action,
|
|
88
|
+
name: next.name,
|
|
89
|
+
instanceId: next.instanceId,
|
|
90
|
+
skippedEventId,
|
|
91
|
+
actor: event.user.id,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
return {
|
|
95
|
+
isSuccess: true,
|
|
96
|
+
data: { name: next.name, instanceId: next.instanceId, status: next.status, skippedEventId },
|
|
97
|
+
};
|
|
77
98
|
},
|
|
78
99
|
});
|
|
79
100
|
}
|
|
80
101
|
|
|
81
102
|
export const consumerRestartWrite = defineConsumerWrite(
|
|
82
103
|
"consumer-restart",
|
|
104
|
+
"restarted",
|
|
83
105
|
"Sets a dead event consumer back to idle so it retries the event that stopped it; use it after a transient failure is fixed.",
|
|
84
106
|
restartConsumer,
|
|
85
107
|
);
|
|
86
108
|
export const consumerSkipWrite = defineConsumerWrite(
|
|
87
109
|
"consumer-skip",
|
|
110
|
+
"skipped",
|
|
88
111
|
"Moves a stuck event consumer past the event that keeps failing; that event is never delivered to this consumer, so use it only for events that can never succeed.",
|
|
89
112
|
(db, consumerName, instanceId) =>
|
|
90
113
|
skipPoisonEvent(db, consumerName, instanceId, { requireStatus: ConsumerStatuses.dead }),
|
|
91
114
|
);
|
|
92
115
|
export const consumerDisableWrite = defineConsumerWrite(
|
|
93
116
|
"consumer-disable",
|
|
117
|
+
"disabled",
|
|
94
118
|
"Pauses an event consumer; the dispatcher skips it until it is enabled again.",
|
|
95
119
|
disableConsumer,
|
|
96
120
|
);
|
|
97
121
|
export const consumerEnableWrite = defineConsumerWrite(
|
|
98
122
|
"consumer-enable",
|
|
123
|
+
"enabled",
|
|
99
124
|
"Resumes a paused event consumer from where it stopped.",
|
|
100
125
|
enableConsumer,
|
|
101
126
|
);
|
|
@@ -11,6 +11,10 @@ export const JobHandlers = {
|
|
|
11
11
|
consumerEnable: "jobs:write:consumer-enable",
|
|
12
12
|
} as const;
|
|
13
13
|
|
|
14
|
+
/** Operator transitions of an event consumer; the events table is the audit trail for them. */
|
|
15
|
+
export const CONSUMER_STATE_CHANGED_EVENT_NAME = "jobs:event:consumer-state-changed" as const;
|
|
16
|
+
export const JOBS_AGGREGATE_TYPE = "jobs" as const;
|
|
17
|
+
|
|
14
18
|
// Qualified query handler names (QN format: scope:type:name)
|
|
15
19
|
export const JobQueries = {
|
|
16
20
|
list: "jobs:query:list",
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.414.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "Missing inline images no longer fail a mail",
|
|
6
|
+
"detail": "An inline mail image whose stored object is gone is skipped instead of failing the mail."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.392.0",
|
|
4
10
|
"type": "improvement",
|
|
@@ -95,7 +95,7 @@ export function createMailTransportInMemoryFeature() {
|
|
|
95
95
|
// Returns the per-tenant buffer. Identity-stable across calls so the
|
|
96
96
|
// demo inbox keeps accumulating.
|
|
97
97
|
return getOrCreateTransportForTenant(tenantId);
|
|
98
|
-
},
|
|
98
|
+
},
|
|
99
99
|
};
|
|
100
100
|
r.useExtension(MAIL_TRANSPORT_EXTENSION, "inmemory", plugin);
|
|
101
101
|
r.translations({
|
|
@@ -54,6 +54,7 @@ import { SMTP_CONFIG_KEYS } from "./config-keys.ts";
|
|
|
54
54
|
import { MAIL_TRANSPORT_SMTP_I18N } from "./i18n.ts";
|
|
55
55
|
|
|
56
56
|
const FEATURE_NAME = "mail-transport-smtp";
|
|
57
|
+
const SMTP_AUTH_USER_CONFIG_QN = `${FEATURE_NAME}:config:auth-user`;
|
|
57
58
|
|
|
58
59
|
const log = createFallbackLogger(FEATURE_NAME);
|
|
59
60
|
|
|
@@ -105,7 +106,7 @@ export function createMailTransportSmtpFeature() {
|
|
|
105
106
|
return `${plaintext.slice(0, 3)}...${plaintext.slice(-2)}`;
|
|
106
107
|
},
|
|
107
108
|
scope: "tenant",
|
|
108
|
-
|
|
109
|
+
requiredWhenConfigSet: SMTP_AUTH_USER_CONFIG_QN,
|
|
109
110
|
});
|
|
110
111
|
|
|
111
112
|
const configKeys = r.config({ keys: SMTP_CONFIG_KEYS });
|
|
@@ -117,7 +118,7 @@ export function createMailTransportSmtpFeature() {
|
|
|
117
118
|
// `provider` config-key to pick this transport.
|
|
118
119
|
const plugin: MailTransportPlugin = {
|
|
119
120
|
build: async (ctx: MailTransportContext, tenantId: string) =>
|
|
120
|
-
buildSmtpTransport(ctx, tenantId),
|
|
121
|
+
buildSmtpTransport(ctx, tenantId),
|
|
121
122
|
};
|
|
122
123
|
r.useExtension(MAIL_TRANSPORT_EXTENSION, "smtp", plugin);
|
|
123
124
|
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.414.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "page mask on the editor workbench with a live preview of the unsaved body",
|
|
6
|
+
"detail": "`managedPagesClient()` registers the page mask and the shared `web` preview renderer from template-resolver (Desktop and 375 px Mobil), so the page preview works without `textBlocksClient`; the preview query lives in template-resolver. The `page-edit` screen is now a custom screen under the same id: settings in the right rail, body editor with the lossy-Markdown warning, one submit for both (create via `managed-pages:write:page:create`, update with only the changed fields). The page list has `createScreen: \"page-edit\"`. The extension section `managed-pages:page-body` and `PAGE_BODY_EXTENSION_NAME` are removed; an app that replaced `page-edit` with its own screen is not affected. New keys `managed-pages:editor.*` in all locale packages."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.414.0",
|
|
10
|
+
"type": "fix",
|
|
11
|
+
"title": "managed-pages client bundle no longer loads tiptap at start",
|
|
12
|
+
"detail": "The link policy helpers moved from `document-schema.ts` into the tiptap-free `document-link-policy.ts` (re-exported from `document-schema.ts`), so `markdown-to-document.ts` stays out of the editor chunk. A test guards the static import closure."
|
|
13
|
+
},
|
|
2
14
|
{
|
|
3
15
|
"version": "0.402.0",
|
|
4
16
|
"type": "improvement",
|
|
@@ -18,7 +18,7 @@ export function createBrandingQuery(opts: { readonly allowCustomCss: boolean })
|
|
|
18
18
|
return defineQueryHandler({
|
|
19
19
|
name: "branding",
|
|
20
20
|
schema: z.object({}),
|
|
21
|
-
access: { roles: ["anonymous"
|
|
21
|
+
access: { roles: ["anonymous"], anySignedIn: true },
|
|
22
22
|
rateLimit: { per: "ip+handler", limit: 60, windowSeconds: 60 },
|
|
23
23
|
description:
|
|
24
24
|
"Reads the tenant's public branding values for the rendered page shell, adding the raw custom CSS only when the app opted in and the per-tenant CSS toggle is on; anonymous callers may read it because it dresses public pages.",
|
|
@@ -15,7 +15,7 @@ export const bySlugQuery = defineQueryHandler({
|
|
|
15
15
|
slug: z.string().min(1).max(64),
|
|
16
16
|
lang: z.string().min(2).max(8),
|
|
17
17
|
}),
|
|
18
|
-
access: { roles: ["anonymous"
|
|
18
|
+
access: { roles: ["anonymous"], anySignedIn: true },
|
|
19
19
|
rateLimit: { per: "ip+handler", limit: 60, windowSeconds: 60 },
|
|
20
20
|
description:
|
|
21
21
|
"Reads the body and metadata of one published managed page of the caller's tenant by slug and language, returning null for drafts and bodyless pages; use it to render a public page, not to load one for editing.",
|