@nocobase/app-plugin-mail 0.0.0-stage → 1.0.0-beta.8
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/CHANGELOG.md +258 -0
- package/README.md +55 -2
- package/dist/client/components/index.d.ts +19 -0
- package/dist/client/components/index.d.ts.map +1 -0
- package/dist/client/components/index.js +19 -0
- package/dist/client/components/index.js.map +1 -0
- package/dist/client/components/mail-account-card.d.ts +14 -0
- package/dist/client/components/mail-account-card.d.ts.map +1 -0
- package/dist/client/components/mail-account-card.js +18 -0
- package/dist/client/components/mail-account-card.js.map +1 -0
- package/dist/client/components/mail-account-connector.d.ts +32 -0
- package/dist/client/components/mail-account-connector.d.ts.map +1 -0
- package/dist/client/components/mail-account-connector.js +59 -0
- package/dist/client/components/mail-account-connector.js.map +1 -0
- package/dist/client/components/mail-bulk-send-logs.d.ts +3 -0
- package/dist/client/components/mail-bulk-send-logs.d.ts.map +1 -0
- package/dist/client/components/mail-bulk-send-logs.js +185 -0
- package/dist/client/components/mail-bulk-send-logs.js.map +1 -0
- package/dist/client/components/mail-composer.d.ts +4 -0
- package/dist/client/components/mail-composer.d.ts.map +1 -0
- package/dist/client/components/mail-composer.js +312 -0
- package/dist/client/components/mail-composer.js.map +1 -0
- package/dist/client/components/mail-conversation-view.d.ts +64 -0
- package/dist/client/components/mail-conversation-view.d.ts.map +1 -0
- package/dist/client/components/mail-conversation-view.js +196 -0
- package/dist/client/components/mail-conversation-view.js.map +1 -0
- package/dist/client/components/mail-dev-page-shell.d.ts +10 -0
- package/dist/client/components/mail-dev-page-shell.d.ts.map +1 -0
- package/dist/client/components/mail-dev-page-shell.js +7 -0
- package/dist/client/components/mail-dev-page-shell.js.map +1 -0
- package/dist/client/components/mail-error-description.d.ts +6 -0
- package/dist/client/components/mail-error-description.d.ts.map +1 -0
- package/dist/client/components/mail-error-description.js +10 -0
- package/dist/client/components/mail-error-description.js.map +1 -0
- package/dist/client/components/mail-html-body.d.ts +9 -0
- package/dist/client/components/mail-html-body.d.ts.map +1 -0
- package/dist/client/components/mail-html-body.js +60 -0
- package/dist/client/components/mail-html-body.js.map +1 -0
- package/dist/client/components/mail-image-resizer.d.ts +10 -0
- package/dist/client/components/mail-image-resizer.d.ts.map +1 -0
- package/dist/client/components/mail-image-resizer.js +168 -0
- package/dist/client/components/mail-image-resizer.js.map +1 -0
- package/dist/client/components/mail-label-manager.d.ts +3 -0
- package/dist/client/components/mail-label-manager.d.ts.map +1 -0
- package/dist/client/components/mail-label-manager.js +145 -0
- package/dist/client/components/mail-label-manager.js.map +1 -0
- package/dist/client/components/mail-label-tag.d.ts +15 -0
- package/dist/client/components/mail-label-tag.d.ts.map +1 -0
- package/dist/client/components/mail-label-tag.js +12 -0
- package/dist/client/components/mail-label-tag.js.map +1 -0
- package/dist/client/components/mail-management-form-actions.d.ts +14 -0
- package/dist/client/components/mail-management-form-actions.d.ts.map +1 -0
- package/dist/client/components/mail-management-form-actions.js +8 -0
- package/dist/client/components/mail-management-form-actions.js.map +1 -0
- package/dist/client/components/mail-management-list-item.d.ts +11 -0
- package/dist/client/components/mail-management-list-item.d.ts.map +1 -0
- package/dist/client/components/mail-management-list-item.js +8 -0
- package/dist/client/components/mail-management-list-item.js.map +1 -0
- package/dist/client/components/mail-management-message-detail.d.ts +8 -0
- package/dist/client/components/mail-management-message-detail.d.ts.map +1 -0
- package/dist/client/components/mail-management-message-detail.js +88 -0
- package/dist/client/components/mail-management-message-detail.js.map +1 -0
- package/dist/client/components/mail-message-content.d.ts +9 -0
- package/dist/client/components/mail-message-content.d.ts.map +1 -0
- package/dist/client/components/mail-message-content.js +44 -0
- package/dist/client/components/mail-message-content.js.map +1 -0
- package/dist/client/components/mail-message-list.d.ts +25 -0
- package/dist/client/components/mail-message-list.d.ts.map +1 -0
- package/dist/client/components/mail-message-list.js +77 -0
- package/dist/client/components/mail-message-list.js.map +1 -0
- package/dist/client/components/mail-navigation-icon.d.ts +5 -0
- package/dist/client/components/mail-navigation-icon.d.ts.map +1 -0
- package/dist/client/components/mail-navigation-icon.js +63 -0
- package/dist/client/components/mail-navigation-icon.js.map +1 -0
- package/dist/client/components/mail-page-header.d.ts +9 -0
- package/dist/client/components/mail-page-header.d.ts.map +1 -0
- package/dist/client/components/mail-page-header.js +6 -0
- package/dist/client/components/mail-page-header.js.map +1 -0
- package/dist/client/components/mail-pagination.d.ts +12 -0
- package/dist/client/components/mail-pagination.d.ts.map +1 -0
- package/dist/client/components/mail-pagination.js +62 -0
- package/dist/client/components/mail-pagination.js.map +1 -0
- package/dist/client/components/mail-pending-deliveries.d.ts +6 -0
- package/dist/client/components/mail-pending-deliveries.d.ts.map +1 -0
- package/dist/client/components/mail-pending-deliveries.js +50 -0
- package/dist/client/components/mail-pending-deliveries.js.map +1 -0
- package/dist/client/components/mail-provider-card.d.ts +13 -0
- package/dist/client/components/mail-provider-card.d.ts.map +1 -0
- package/dist/client/components/mail-provider-card.js +11 -0
- package/dist/client/components/mail-provider-card.js.map +1 -0
- package/dist/client/components/mail-rich-text-editor.d.ts +64 -0
- package/dist/client/components/mail-rich-text-editor.d.ts.map +1 -0
- package/dist/client/components/mail-rich-text-editor.js +199 -0
- package/dist/client/components/mail-rich-text-editor.js.map +1 -0
- package/dist/client/components/mail-scheduled-status.d.ts +8 -0
- package/dist/client/components/mail-scheduled-status.d.ts.map +1 -0
- package/dist/client/components/mail-scheduled-status.js +52 -0
- package/dist/client/components/mail-scheduled-status.js.map +1 -0
- package/dist/client/components/mail-signature-manager.d.ts +8 -0
- package/dist/client/components/mail-signature-manager.d.ts.map +1 -0
- package/dist/client/components/mail-signature-manager.js +255 -0
- package/dist/client/components/mail-signature-manager.js.map +1 -0
- package/dist/client/components/mail-status-badge.d.ts +8 -0
- package/dist/client/components/mail-status-badge.d.ts.map +1 -0
- package/dist/client/components/mail-status-badge.js +12 -0
- package/dist/client/components/mail-status-badge.js.map +1 -0
- package/dist/client/components/mail-submission-status.d.ts +6 -0
- package/dist/client/components/mail-submission-status.d.ts.map +1 -0
- package/dist/client/components/mail-submission-status.js +24 -0
- package/dist/client/components/mail-submission-status.js.map +1 -0
- package/dist/client/components/mail-sync-policy-fields.d.ts +14 -0
- package/dist/client/components/mail-sync-policy-fields.d.ts.map +1 -0
- package/dist/client/components/mail-sync-policy-fields.js +27 -0
- package/dist/client/components/mail-sync-policy-fields.js.map +1 -0
- package/dist/client/components/mail-template-manager.d.ts +3 -0
- package/dist/client/components/mail-template-manager.d.ts.map +1 -0
- package/dist/client/components/mail-template-manager.js +135 -0
- package/dist/client/components/mail-template-manager.js.map +1 -0
- package/dist/client/components/mail-text-body.d.ts +5 -0
- package/dist/client/components/mail-text-body.d.ts.map +1 -0
- package/dist/client/components/mail-text-body.js +11 -0
- package/dist/client/components/mail-text-body.js.map +1 -0
- package/dist/client/components/mail-workspace-composer.d.ts +4 -0
- package/dist/client/components/mail-workspace-composer.d.ts.map +1 -0
- package/dist/client/components/mail-workspace-composer.js +74 -0
- package/dist/client/components/mail-workspace-composer.js.map +1 -0
- package/dist/client/components/mailbox-sidebar.d.ts +38 -0
- package/dist/client/components/mailbox-sidebar.d.ts.map +1 -0
- package/dist/client/components/mailbox-sidebar.js +71 -0
- package/dist/client/components/mailbox-sidebar.js.map +1 -0
- package/dist/client/components/page-container.d.ts +4 -0
- package/dist/client/components/page-container.d.ts.map +1 -0
- package/dist/client/components/page-container.js +6 -0
- package/dist/client/components/page-container.js.map +1 -0
- package/dist/client/components/page-header.d.ts +8 -0
- package/dist/client/components/page-header.d.ts.map +1 -0
- package/dist/client/components/page-header.js +5 -0
- package/dist/client/components/page-header.js.map +1 -0
- package/dist/client/components/public.d.ts +19 -0
- package/dist/client/components/public.d.ts.map +1 -0
- package/dist/client/components/public.js +18 -0
- package/dist/client/components/public.js.map +1 -0
- package/dist/client/components/ui/button.d.ts +7 -0
- package/dist/client/components/ui/button.d.ts.map +1 -0
- package/dist/client/components/ui/button.js +19 -0
- package/dist/client/components/ui/button.js.map +1 -0
- package/dist/client/components/ui/calendar.d.ts +9 -0
- package/dist/client/components/ui/calendar.d.ts.map +1 -0
- package/dist/client/components/ui/calendar.js +23 -0
- package/dist/client/components/ui/calendar.js.map +1 -0
- package/dist/client/components/ui/card.d.ts +3 -0
- package/dist/client/components/ui/card.d.ts.map +1 -0
- package/dist/client/components/ui/card.js +6 -0
- package/dist/client/components/ui/card.js.map +1 -0
- package/dist/client/components/ui/checkbox.d.ts +5 -0
- package/dist/client/components/ui/checkbox.d.ts.map +1 -0
- package/dist/client/components/ui/checkbox.js +8 -0
- package/dist/client/components/ui/checkbox.js.map +1 -0
- package/dist/client/components/ui/collapsible.d.ts +6 -0
- package/dist/client/components/ui/collapsible.d.ts.map +1 -0
- package/dist/client/components/ui/collapsible.js +12 -0
- package/dist/client/components/ui/collapsible.js.map +1 -0
- package/dist/client/components/ui/dialog.d.ts +14 -0
- package/dist/client/components/ui/dialog.d.ts.map +1 -0
- package/dist/client/components/ui/dialog.js +36 -0
- package/dist/client/components/ui/dialog.js.map +1 -0
- package/dist/client/components/ui/dropdown-menu.d.ts +8 -0
- package/dist/client/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/client/components/ui/dropdown-menu.js +21 -0
- package/dist/client/components/ui/dropdown-menu.js.map +1 -0
- package/dist/client/components/ui/input.d.ts +4 -0
- package/dist/client/components/ui/input.d.ts.map +1 -0
- package/dist/client/components/ui/input.js +7 -0
- package/dist/client/components/ui/input.js.map +1 -0
- package/dist/client/components/ui/native-select.d.ts +4 -0
- package/dist/client/components/ui/native-select.d.ts.map +1 -0
- package/dist/client/components/ui/native-select.js +7 -0
- package/dist/client/components/ui/native-select.js.map +1 -0
- package/dist/client/components/ui/popover.d.ts +10 -0
- package/dist/client/components/ui/popover.d.ts.map +1 -0
- package/dist/client/components/ui/popover.js +23 -0
- package/dist/client/components/ui/popover.js.map +1 -0
- package/dist/client/components/ui/sheet.d.ts +13 -0
- package/dist/client/components/ui/sheet.d.ts.map +1 -0
- package/dist/client/components/ui/sheet.js +28 -0
- package/dist/client/components/ui/sheet.js.map +1 -0
- package/dist/client/components/ui/textarea.d.ts +4 -0
- package/dist/client/components/ui/textarea.d.ts.map +1 -0
- package/dist/client/components/ui/textarea.js +6 -0
- package/dist/client/components/ui/textarea.js.map +1 -0
- package/dist/client/components/ui/tooltip.d.ts +7 -0
- package/dist/client/components/ui/tooltip.d.ts.map +1 -0
- package/dist/client/components/ui/tooltip.js +16 -0
- package/dist/client/components/ui/tooltip.js.map +1 -0
- package/dist/client/contracts/composer.d.ts +68 -0
- package/dist/client/contracts/composer.d.ts.map +1 -0
- package/dist/client/contracts/composer.js +12 -0
- package/dist/client/contracts/composer.js.map +1 -0
- package/dist/client/hooks/use-mail-composer.d.ts +52 -0
- package/dist/client/hooks/use-mail-composer.d.ts.map +1 -0
- package/dist/client/hooks/use-mail-composer.js +633 -0
- package/dist/client/hooks/use-mail-composer.js.map +1 -0
- package/dist/client/hooks/use-mail-invalidations.d.ts +3 -0
- package/dist/client/hooks/use-mail-invalidations.d.ts.map +1 -0
- package/dist/client/hooks/use-mail-invalidations.js +28 -0
- package/dist/client/hooks/use-mail-invalidations.js.map +1 -0
- package/dist/client/hooks/use-mail-log-page.d.ts +17 -0
- package/dist/client/hooks/use-mail-log-page.d.ts.map +1 -0
- package/dist/client/hooks/use-mail-log-page.js +85 -0
- package/dist/client/hooks/use-mail-log-page.js.map +1 -0
- package/dist/client/hooks/use-mail-table-page.d.ts +12 -0
- package/dist/client/hooks/use-mail-table-page.d.ts.map +1 -0
- package/dist/client/hooks/use-mail-table-page.js +22 -0
- package/dist/client/hooks/use-mail-table-page.js.map +1 -0
- package/dist/client/hooks/use-mail-workspace-data.d.ts +35 -0
- package/dist/client/hooks/use-mail-workspace-data.d.ts.map +1 -0
- package/dist/client/hooks/use-mail-workspace-data.js +409 -0
- package/dist/client/hooks/use-mail-workspace-data.js.map +1 -0
- package/dist/client/index.d.ts +14 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +10 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/lib/mail-address.d.ts +5 -0
- package/dist/client/lib/mail-address.d.ts.map +1 -0
- package/dist/client/lib/mail-address.js +14 -0
- package/dist/client/lib/mail-address.js.map +1 -0
- package/dist/client/lib/mail-body-theme.d.ts +3 -0
- package/dist/client/lib/mail-body-theme.d.ts.map +1 -0
- package/dist/client/lib/mail-body-theme.js +69 -0
- package/dist/client/lib/mail-body-theme.js.map +1 -0
- package/dist/client/lib/mail-composer-state.d.ts +36 -0
- package/dist/client/lib/mail-composer-state.d.ts.map +1 -0
- package/dist/client/lib/mail-composer-state.js +212 -0
- package/dist/client/lib/mail-composer-state.js.map +1 -0
- package/dist/client/lib/mail-editor-headings.d.ts +3 -0
- package/dist/client/lib/mail-editor-headings.d.ts.map +1 -0
- package/dist/client/lib/mail-editor-headings.js +27 -0
- package/dist/client/lib/mail-editor-headings.js.map +1 -0
- package/dist/client/lib/mail-editor-images.d.ts +10 -0
- package/dist/client/lib/mail-editor-images.d.ts.map +1 -0
- package/dist/client/lib/mail-editor-images.js +82 -0
- package/dist/client/lib/mail-editor-images.js.map +1 -0
- package/dist/client/lib/mail-editor-labels.d.ts +3 -0
- package/dist/client/lib/mail-editor-labels.d.ts.map +1 -0
- package/dist/client/lib/mail-editor-labels.js +43 -0
- package/dist/client/lib/mail-editor-labels.js.map +1 -0
- package/dist/client/lib/mail-error-description.d.ts +7 -0
- package/dist/client/lib/mail-error-description.d.ts.map +1 -0
- package/dist/client/lib/mail-error-description.js +84 -0
- package/dist/client/lib/mail-error-description.js.map +1 -0
- package/dist/client/lib/mail-folders.d.ts +40 -0
- package/dist/client/lib/mail-folders.d.ts.map +1 -0
- package/dist/client/lib/mail-folders.js +215 -0
- package/dist/client/lib/mail-folders.js.map +1 -0
- package/dist/client/lib/mail-forward-content.d.ts +19 -0
- package/dist/client/lib/mail-forward-content.d.ts.map +1 -0
- package/dist/client/lib/mail-forward-content.js +120 -0
- package/dist/client/lib/mail-forward-content.js.map +1 -0
- package/dist/client/lib/mail-inline-images.d.ts +6 -0
- package/dist/client/lib/mail-inline-images.d.ts.map +1 -0
- package/dist/client/lib/mail-inline-images.js +41 -0
- package/dist/client/lib/mail-inline-images.js.map +1 -0
- package/dist/client/lib/mail-label.d.ts +10 -0
- package/dist/client/lib/mail-label.d.ts.map +1 -0
- package/dist/client/lib/mail-label.js +47 -0
- package/dist/client/lib/mail-label.js.map +1 -0
- package/dist/client/lib/mail-message-document.d.ts +6 -0
- package/dist/client/lib/mail-message-document.d.ts.map +1 -0
- package/dist/client/lib/mail-message-document.js +68 -0
- package/dist/client/lib/mail-message-document.js.map +1 -0
- package/dist/client/lib/mail-pending-delivery.d.ts +22 -0
- package/dist/client/lib/mail-pending-delivery.d.ts.map +1 -0
- package/dist/client/lib/mail-pending-delivery.js +81 -0
- package/dist/client/lib/mail-pending-delivery.js.map +1 -0
- package/dist/client/lib/mail-quoted-content.d.ts +8 -0
- package/dist/client/lib/mail-quoted-content.d.ts.map +1 -0
- package/dist/client/lib/mail-quoted-content.js +62 -0
- package/dist/client/lib/mail-quoted-content.js.map +1 -0
- package/dist/client/lib/mail-reply-content.d.ts +9 -0
- package/dist/client/lib/mail-reply-content.d.ts.map +1 -0
- package/dist/client/lib/mail-reply-content.js +50 -0
- package/dist/client/lib/mail-reply-content.js.map +1 -0
- package/dist/client/lib/mail-signature.d.ts +8 -0
- package/dist/client/lib/mail-signature.d.ts.map +1 -0
- package/dist/client/lib/mail-signature.js +40 -0
- package/dist/client/lib/mail-signature.js.map +1 -0
- package/dist/client/lib/mail-template.d.ts +14 -0
- package/dist/client/lib/mail-template.d.ts.map +1 -0
- package/dist/client/lib/mail-template.js +189 -0
- package/dist/client/lib/mail-template.js.map +1 -0
- package/dist/client/lib/utils.d.ts +2 -0
- package/dist/client/lib/utils.d.ts.map +1 -0
- package/dist/client/lib/utils.js +2 -0
- package/dist/client/lib/utils.js.map +1 -0
- package/dist/client/locales/en-US.d.ts +677 -0
- package/dist/client/locales/en-US.d.ts.map +1 -0
- package/dist/client/locales/en-US.js +675 -0
- package/dist/client/locales/en-US.js.map +1 -0
- package/dist/client/locales/index.d.ts +4 -0
- package/dist/client/locales/index.d.ts.map +1 -0
- package/dist/client/locales/index.js +6 -0
- package/dist/client/locales/index.js.map +1 -0
- package/dist/client/locales/zh-CN.d.ts +4 -0
- package/dist/client/locales/zh-CN.d.ts.map +1 -0
- package/dist/client/locales/zh-CN.js +675 -0
- package/dist/client/locales/zh-CN.js.map +1 -0
- package/dist/client/mail-client.d.ts +112 -0
- package/dist/client/mail-client.d.ts.map +1 -0
- package/dist/client/mail-client.js +412 -0
- package/dist/client/mail-client.js.map +1 -0
- package/dist/client/namespace.d.ts +4 -0
- package/dist/client/namespace.d.ts.map +1 -0
- package/dist/client/namespace.js +3 -0
- package/dist/client/namespace.js.map +1 -0
- package/dist/client/pages/mail-accounts-dev-page.d.ts +2 -0
- package/dist/client/pages/mail-accounts-dev-page.d.ts.map +1 -0
- package/dist/client/pages/mail-accounts-dev-page.js +2 -0
- package/dist/client/pages/mail-accounts-dev-page.js.map +1 -0
- package/dist/client/pages/mail-accounts-page.d.ts +8 -0
- package/dist/client/pages/mail-accounts-page.d.ts.map +1 -0
- package/dist/client/pages/mail-accounts-page.js +463 -0
- package/dist/client/pages/mail-accounts-page.js.map +1 -0
- package/dist/client/pages/mail-dev-hub-page.d.ts +9 -0
- package/dist/client/pages/mail-dev-hub-page.d.ts.map +1 -0
- package/dist/client/pages/mail-dev-hub-page.js +49 -0
- package/dist/client/pages/mail-dev-hub-page.js.map +1 -0
- package/dist/client/pages/mail-dev-page.d.ts +5 -0
- package/dist/client/pages/mail-dev-page.d.ts.map +1 -0
- package/dist/client/pages/mail-dev-page.js +12 -0
- package/dist/client/pages/mail-dev-page.js.map +1 -0
- package/dist/client/pages/mail-management-page.d.ts +3 -0
- package/dist/client/pages/mail-management-page.d.ts.map +1 -0
- package/dist/client/pages/mail-management-page.js +335 -0
- package/dist/client/pages/mail-management-page.js.map +1 -0
- package/dist/client/pages/mail-send-logs-page.d.ts +3 -0
- package/dist/client/pages/mail-send-logs-page.d.ts.map +1 -0
- package/dist/client/pages/mail-send-logs-page.js +79 -0
- package/dist/client/pages/mail-send-logs-page.js.map +1 -0
- package/dist/client/pages/mail-send-page.d.ts +3 -0
- package/dist/client/pages/mail-send-page.d.ts.map +1 -0
- package/dist/client/pages/mail-send-page.js +127 -0
- package/dist/client/pages/mail-send-page.js.map +1 -0
- package/dist/client/pages/mail-settings-page.d.ts +3 -0
- package/dist/client/pages/mail-settings-page.d.ts.map +1 -0
- package/dist/client/pages/mail-settings-page.js +79 -0
- package/dist/client/pages/mail-settings-page.js.map +1 -0
- package/dist/client/pages/mail-sync-logs-page.d.ts +3 -0
- package/dist/client/pages/mail-sync-logs-page.d.ts.map +1 -0
- package/dist/client/pages/mail-sync-logs-page.js +80 -0
- package/dist/client/pages/mail-sync-logs-page.js.map +1 -0
- package/dist/client/pages/mail-workspace-page.d.ts +10 -0
- package/dist/client/pages/mail-workspace-page.d.ts.map +1 -0
- package/dist/client/pages/mail-workspace-page.js +834 -0
- package/dist/client/pages/mail-workspace-page.js.map +1 -0
- package/dist/client/plugin.d.ts +7 -0
- package/dist/client/plugin.d.ts.map +1 -0
- package/dist/client/plugin.js +12 -0
- package/dist/client/plugin.js.map +1 -0
- package/dist/client/routes.d.ts +4 -0
- package/dist/client/routes.d.ts.map +1 -0
- package/dist/client/routes.js +146 -0
- package/dist/client/routes.js.map +1 -0
- package/dist/client/runtime.d.ts +5 -0
- package/dist/client/runtime.d.ts.map +1 -0
- package/dist/client/runtime.js +7 -0
- package/dist/client/runtime.js.map +1 -0
- package/dist/client/service-provider.d.ts +10 -0
- package/dist/client/service-provider.d.ts.map +1 -0
- package/dist/client/service-provider.js +15 -0
- package/dist/client/service-provider.js.map +1 -0
- package/dist/client/subscription.d.ts +8 -0
- package/dist/client/subscription.d.ts.map +1 -0
- package/dist/client/subscription.js +33 -0
- package/dist/client/subscription.js.map +1 -0
- package/dist/database/migrations/.manifest.json +21 -0
- package/dist/database/migrations/202609030001_create_mail_tables.d.ts +4 -0
- package/dist/database/migrations/202609030001_create_mail_tables.d.ts.map +1 -0
- package/dist/database/migrations/202609030001_create_mail_tables.js +536 -0
- package/dist/database/migrations/202609030001_create_mail_tables.js.map +1 -0
- package/dist/database/migrations/202609200001_backfill_mail_conversations.d.ts +4 -0
- package/dist/database/migrations/202609200001_backfill_mail_conversations.d.ts.map +1 -0
- package/dist/database/migrations/202609200001_backfill_mail_conversations.js +42 -0
- package/dist/database/migrations/202609200001_backfill_mail_conversations.js.map +1 -0
- package/dist/database/migrations/202609210001_normalize_mail_folders.d.ts +4 -0
- package/dist/database/migrations/202609210001_normalize_mail_folders.d.ts.map +1 -0
- package/dist/database/migrations/202609210001_normalize_mail_folders.js +42 -0
- package/dist/database/migrations/202609210001_normalize_mail_folders.js.map +1 -0
- package/dist/database/migrations/202609260001_add_mail_sync_retry_attempts.d.ts +4 -0
- package/dist/database/migrations/202609260001_add_mail_sync_retry_attempts.d.ts.map +1 -0
- package/dist/database/migrations/202609260001_add_mail_sync_retry_attempts.js +17 -0
- package/dist/database/migrations/202609260001_add_mail_sync_retry_attempts.js.map +1 -0
- package/dist/server/adapter-resolver.d.ts +14 -0
- package/dist/server/adapter-resolver.d.ts.map +1 -0
- package/dist/server/adapter-resolver.js +21 -0
- package/dist/server/adapter-resolver.js.map +1 -0
- package/dist/server/adapters/gmail/adapter.d.ts +42 -0
- package/dist/server/adapters/gmail/adapter.d.ts.map +1 -0
- package/dist/server/adapters/gmail/adapter.js +800 -0
- package/dist/server/adapters/gmail/adapter.js.map +1 -0
- package/dist/server/adapters/gmail/auth.d.ts +9 -0
- package/dist/server/adapters/gmail/auth.d.ts.map +1 -0
- package/dist/server/adapters/gmail/auth.js +178 -0
- package/dist/server/adapters/gmail/auth.js.map +1 -0
- package/dist/server/adapters/gmail/batch.d.ts +8 -0
- package/dist/server/adapters/gmail/batch.d.ts.map +1 -0
- package/dist/server/adapters/gmail/batch.js +116 -0
- package/dist/server/adapters/gmail/batch.js.map +1 -0
- package/dist/server/adapters/gmail/concurrency.d.ts +2 -0
- package/dist/server/adapters/gmail/concurrency.d.ts.map +1 -0
- package/dist/server/adapters/gmail/concurrency.js +12 -0
- package/dist/server/adapters/gmail/concurrency.js.map +1 -0
- package/dist/server/adapters/gmail/constants.d.ts +7 -0
- package/dist/server/adapters/gmail/constants.d.ts.map +1 -0
- package/dist/server/adapters/gmail/constants.js +19 -0
- package/dist/server/adapters/gmail/constants.js.map +1 -0
- package/dist/server/adapters/gmail/definition.d.ts +4 -0
- package/dist/server/adapters/gmail/definition.d.ts.map +1 -0
- package/dist/server/adapters/gmail/definition.js +58 -0
- package/dist/server/adapters/gmail/definition.js.map +1 -0
- package/dist/server/adapters/gmail/errors.d.ts +12 -0
- package/dist/server/adapters/gmail/errors.d.ts.map +1 -0
- package/dist/server/adapters/gmail/errors.js +58 -0
- package/dist/server/adapters/gmail/errors.js.map +1 -0
- package/dist/server/adapters/gmail/http.d.ts +11 -0
- package/dist/server/adapters/gmail/http.d.ts.map +1 -0
- package/dist/server/adapters/gmail/http.js +152 -0
- package/dist/server/adapters/gmail/http.js.map +1 -0
- package/dist/server/adapters/gmail/index.d.ts +4 -0
- package/dist/server/adapters/gmail/index.d.ts.map +1 -0
- package/dist/server/adapters/gmail/index.js +3 -0
- package/dist/server/adapters/gmail/index.js.map +1 -0
- package/dist/server/adapters/gmail/mime.d.ts +7 -0
- package/dist/server/adapters/gmail/mime.d.ts.map +1 -0
- package/dist/server/adapters/gmail/mime.js +189 -0
- package/dist/server/adapters/gmail/mime.js.map +1 -0
- package/dist/server/adapters/gmail/normalize.d.ts +7 -0
- package/dist/server/adapters/gmail/normalize.d.ts.map +1 -0
- package/dist/server/adapters/gmail/normalize.js +104 -0
- package/dist/server/adapters/gmail/normalize.js.map +1 -0
- package/dist/server/adapters/gmail/quota.d.ts +3 -0
- package/dist/server/adapters/gmail/quota.d.ts.map +1 -0
- package/dist/server/adapters/gmail/quota.js +112 -0
- package/dist/server/adapters/gmail/quota.js.map +1 -0
- package/dist/server/adapters/gmail/sync.d.ts +5 -0
- package/dist/server/adapters/gmail/sync.d.ts.map +1 -0
- package/dist/server/adapters/gmail/sync.js +32 -0
- package/dist/server/adapters/gmail/sync.js.map +1 -0
- package/dist/server/adapters/gmail/types.d.ts +141 -0
- package/dist/server/adapters/gmail/types.d.ts.map +1 -0
- package/dist/server/adapters/gmail/types.js +2 -0
- package/dist/server/adapters/gmail/types.js.map +1 -0
- package/dist/server/adapters/imap-smtp/adapter.d.ts +40 -0
- package/dist/server/adapters/imap-smtp/adapter.d.ts.map +1 -0
- package/dist/server/adapters/imap-smtp/adapter.js +721 -0
- package/dist/server/adapters/imap-smtp/adapter.js.map +1 -0
- package/dist/server/adapters/imap-smtp/config.d.ts +19 -0
- package/dist/server/adapters/imap-smtp/config.d.ts.map +1 -0
- package/dist/server/adapters/imap-smtp/config.js +2 -0
- package/dist/server/adapters/imap-smtp/config.js.map +1 -0
- package/dist/server/adapters/imap-smtp/connection.d.ts +9 -0
- package/dist/server/adapters/imap-smtp/connection.d.ts.map +1 -0
- package/dist/server/adapters/imap-smtp/connection.js +72 -0
- package/dist/server/adapters/imap-smtp/connection.js.map +1 -0
- package/dist/server/adapters/imap-smtp/constants.d.ts +7 -0
- package/dist/server/adapters/imap-smtp/constants.d.ts.map +1 -0
- package/dist/server/adapters/imap-smtp/constants.js +16 -0
- package/dist/server/adapters/imap-smtp/constants.js.map +1 -0
- package/dist/server/adapters/imap-smtp/content.d.ts +11 -0
- package/dist/server/adapters/imap-smtp/content.d.ts.map +1 -0
- package/dist/server/adapters/imap-smtp/content.js +157 -0
- package/dist/server/adapters/imap-smtp/content.js.map +1 -0
- package/dist/server/adapters/imap-smtp/definition.d.ts +4 -0
- package/dist/server/adapters/imap-smtp/definition.d.ts.map +1 -0
- package/dist/server/adapters/imap-smtp/definition.js +59 -0
- package/dist/server/adapters/imap-smtp/definition.js.map +1 -0
- package/dist/server/adapters/imap-smtp/errors.d.ts +10 -0
- package/dist/server/adapters/imap-smtp/errors.d.ts.map +1 -0
- package/dist/server/adapters/imap-smtp/errors.js +95 -0
- package/dist/server/adapters/imap-smtp/errors.js.map +1 -0
- package/dist/server/adapters/imap-smtp/folders.d.ts +7 -0
- package/dist/server/adapters/imap-smtp/folders.d.ts.map +1 -0
- package/dist/server/adapters/imap-smtp/folders.js +39 -0
- package/dist/server/adapters/imap-smtp/folders.js.map +1 -0
- package/dist/server/adapters/imap-smtp/index.d.ts +3 -0
- package/dist/server/adapters/imap-smtp/index.d.ts.map +1 -0
- package/dist/server/adapters/imap-smtp/index.js +2 -0
- package/dist/server/adapters/imap-smtp/index.js.map +1 -0
- package/dist/server/adapters/imap-smtp/locators.d.ts +23 -0
- package/dist/server/adapters/imap-smtp/locators.d.ts.map +1 -0
- package/dist/server/adapters/imap-smtp/locators.js +156 -0
- package/dist/server/adapters/imap-smtp/locators.js.map +1 -0
- package/dist/server/adapters/imap-smtp/normalize.d.ts +27 -0
- package/dist/server/adapters/imap-smtp/normalize.d.ts.map +1 -0
- package/dist/server/adapters/imap-smtp/normalize.js +64 -0
- package/dist/server/adapters/imap-smtp/normalize.js.map +1 -0
- package/dist/server/adapters/imap-smtp/types.d.ts +21 -0
- package/dist/server/adapters/imap-smtp/types.d.ts.map +1 -0
- package/dist/server/adapters/imap-smtp/types.js +2 -0
- package/dist/server/adapters/imap-smtp/types.js.map +1 -0
- package/dist/server/adapters/incomplete-message.d.ts +4 -0
- package/dist/server/adapters/incomplete-message.d.ts.map +1 -0
- package/dist/server/adapters/incomplete-message.js +21 -0
- package/dist/server/adapters/incomplete-message.js.map +1 -0
- package/dist/server/adapters/microsoft/adapter.d.ts +42 -0
- package/dist/server/adapters/microsoft/adapter.d.ts.map +1 -0
- package/dist/server/adapters/microsoft/adapter.js +1063 -0
- package/dist/server/adapters/microsoft/adapter.js.map +1 -0
- package/dist/server/adapters/microsoft/auth.d.ts +10 -0
- package/dist/server/adapters/microsoft/auth.d.ts.map +1 -0
- package/dist/server/adapters/microsoft/auth.js +153 -0
- package/dist/server/adapters/microsoft/auth.js.map +1 -0
- package/dist/server/adapters/microsoft/concurrency.d.ts +2 -0
- package/dist/server/adapters/microsoft/concurrency.d.ts.map +1 -0
- package/dist/server/adapters/microsoft/concurrency.js +15 -0
- package/dist/server/adapters/microsoft/concurrency.js.map +1 -0
- package/dist/server/adapters/microsoft/constants.d.ts +10 -0
- package/dist/server/adapters/microsoft/constants.d.ts.map +1 -0
- package/dist/server/adapters/microsoft/constants.js +46 -0
- package/dist/server/adapters/microsoft/constants.js.map +1 -0
- package/dist/server/adapters/microsoft/content.d.ts +9 -0
- package/dist/server/adapters/microsoft/content.d.ts.map +1 -0
- package/dist/server/adapters/microsoft/content.js +40 -0
- package/dist/server/adapters/microsoft/content.js.map +1 -0
- package/dist/server/adapters/microsoft/definition.d.ts +4 -0
- package/dist/server/adapters/microsoft/definition.d.ts.map +1 -0
- package/dist/server/adapters/microsoft/definition.js +48 -0
- package/dist/server/adapters/microsoft/definition.js.map +1 -0
- package/dist/server/adapters/microsoft/errors.d.ts +12 -0
- package/dist/server/adapters/microsoft/errors.d.ts.map +1 -0
- package/dist/server/adapters/microsoft/errors.js +51 -0
- package/dist/server/adapters/microsoft/errors.js.map +1 -0
- package/dist/server/adapters/microsoft/http.d.ts +13 -0
- package/dist/server/adapters/microsoft/http.d.ts.map +1 -0
- package/dist/server/adapters/microsoft/http.js +115 -0
- package/dist/server/adapters/microsoft/http.js.map +1 -0
- package/dist/server/adapters/microsoft/index.d.ts +4 -0
- package/dist/server/adapters/microsoft/index.d.ts.map +1 -0
- package/dist/server/adapters/microsoft/index.js +3 -0
- package/dist/server/adapters/microsoft/index.js.map +1 -0
- package/dist/server/adapters/microsoft/normalize.d.ts +14 -0
- package/dist/server/adapters/microsoft/normalize.d.ts.map +1 -0
- package/dist/server/adapters/microsoft/normalize.js +110 -0
- package/dist/server/adapters/microsoft/normalize.js.map +1 -0
- package/dist/server/adapters/microsoft/sync.d.ts +12 -0
- package/dist/server/adapters/microsoft/sync.d.ts.map +1 -0
- package/dist/server/adapters/microsoft/sync.js +111 -0
- package/dist/server/adapters/microsoft/sync.js.map +1 -0
- package/dist/server/adapters/microsoft/types.d.ts +128 -0
- package/dist/server/adapters/microsoft/types.d.ts.map +1 -0
- package/dist/server/adapters/microsoft/types.js +2 -0
- package/dist/server/adapters/microsoft/types.js.map +1 -0
- package/dist/server/config.d.ts +56 -0
- package/dist/server/config.d.ts.map +1 -0
- package/dist/server/config.js +251 -0
- package/dist/server/config.js.map +1 -0
- package/dist/server/contracts/persistence.d.ts +220 -0
- package/dist/server/contracts/persistence.d.ts.map +1 -0
- package/dist/server/contracts/persistence.js +2 -0
- package/dist/server/contracts/persistence.js.map +1 -0
- package/dist/server/contracts/provider.d.ts +303 -0
- package/dist/server/contracts/provider.d.ts.map +1 -0
- package/dist/server/contracts/provider.js +4 -0
- package/dist/server/contracts/provider.js.map +1 -0
- package/dist/server/contracts/service.d.ts +82 -0
- package/dist/server/contracts/service.d.ts.map +1 -0
- package/dist/server/contracts/service.js +2 -0
- package/dist/server/contracts/service.js.map +1 -0
- package/dist/server/credentials.d.ts +24 -0
- package/dist/server/credentials.d.ts.map +1 -0
- package/dist/server/credentials.js +263 -0
- package/dist/server/credentials.js.map +1 -0
- package/dist/server/index.d.ts +13 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +7 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/jobs/send-scheduled-mail.d.ts +8 -0
- package/dist/server/jobs/send-scheduled-mail.d.ts.map +1 -0
- package/dist/server/jobs/send-scheduled-mail.js +18 -0
- package/dist/server/jobs/send-scheduled-mail.js.map +1 -0
- package/dist/server/jobs/sync-mailbox.d.ts +11 -0
- package/dist/server/jobs/sync-mailbox.d.ts.map +1 -0
- package/dist/server/jobs/sync-mailbox.js +23 -0
- package/dist/server/jobs/sync-mailbox.js.map +1 -0
- package/dist/server/locales/en-US.d.ts +18 -0
- package/dist/server/locales/en-US.d.ts.map +1 -0
- package/dist/server/locales/en-US.js +16 -0
- package/dist/server/locales/en-US.js.map +1 -0
- package/dist/server/locales/index.d.ts +4 -0
- package/dist/server/locales/index.d.ts.map +1 -0
- package/dist/server/locales/index.js +6 -0
- package/dist/server/locales/index.js.map +1 -0
- package/dist/server/locales/zh-CN.d.ts +4 -0
- package/dist/server/locales/zh-CN.d.ts.map +1 -0
- package/dist/server/locales/zh-CN.js +16 -0
- package/dist/server/locales/zh-CN.js.map +1 -0
- package/dist/server/log-pagination.d.ts +2 -0
- package/dist/server/log-pagination.d.ts.map +1 -0
- package/dist/server/log-pagination.js +8 -0
- package/dist/server/log-pagination.js.map +1 -0
- package/dist/server/logging.d.ts +16 -0
- package/dist/server/logging.d.ts.map +1 -0
- package/dist/server/logging.js +24 -0
- package/dist/server/logging.js.map +1 -0
- package/dist/server/operations/index.d.ts +3 -0
- package/dist/server/operations/index.d.ts.map +1 -0
- package/dist/server/operations/index.js +3 -0
- package/dist/server/operations/index.js.map +1 -0
- package/dist/server/operations/message-mutations.d.ts +16 -0
- package/dist/server/operations/message-mutations.d.ts.map +1 -0
- package/dist/server/operations/message-mutations.js +139 -0
- package/dist/server/operations/message-mutations.js.map +1 -0
- package/dist/server/operations/schedule-sync.d.ts +15 -0
- package/dist/server/operations/schedule-sync.d.ts.map +1 -0
- package/dist/server/operations/schedule-sync.js +44 -0
- package/dist/server/operations/schedule-sync.js.map +1 -0
- package/dist/server/operations/send-mail.d.ts +36 -0
- package/dist/server/operations/send-mail.d.ts.map +1 -0
- package/dist/server/operations/send-mail.js +691 -0
- package/dist/server/operations/send-mail.js.map +1 -0
- package/dist/server/operations/sync-mailbox.d.ts +29 -0
- package/dist/server/operations/sync-mailbox.d.ts.map +1 -0
- package/dist/server/operations/sync-mailbox.js +388 -0
- package/dist/server/operations/sync-mailbox.js.map +1 -0
- package/dist/server/outbound-attachments.d.ts +28 -0
- package/dist/server/outbound-attachments.d.ts.map +1 -0
- package/dist/server/outbound-attachments.js +91 -0
- package/dist/server/outbound-attachments.js.map +1 -0
- package/dist/server/plugin.d.ts +4 -0
- package/dist/server/plugin.d.ts.map +1 -0
- package/dist/server/plugin.js +16 -0
- package/dist/server/plugin.js.map +1 -0
- package/dist/server/providers/index.d.ts +4 -0
- package/dist/server/providers/index.d.ts.map +1 -0
- package/dist/server/providers/index.js +8 -0
- package/dist/server/providers/index.js.map +1 -0
- package/dist/server/providers/mail-builtins.d.ts +7 -0
- package/dist/server/providers/mail-builtins.d.ts.map +1 -0
- package/dist/server/providers/mail-builtins.js +17 -0
- package/dist/server/providers/mail-builtins.js.map +1 -0
- package/dist/server/providers/mail-core.d.ts +23 -0
- package/dist/server/providers/mail-core.d.ts.map +1 -0
- package/dist/server/providers/mail-core.js +150 -0
- package/dist/server/providers/mail-core.js.map +1 -0
- package/dist/server/public-types.d.ts +7 -0
- package/dist/server/public-types.d.ts.map +1 -0
- package/dist/server/public-types.js +2 -0
- package/dist/server/public-types.js.map +1 -0
- package/dist/server/realtime.d.ts +11 -0
- package/dist/server/realtime.d.ts.map +1 -0
- package/dist/server/realtime.js +20 -0
- package/dist/server/realtime.js.map +1 -0
- package/dist/server/registry.d.ts +10 -0
- package/dist/server/registry.d.ts.map +1 -0
- package/dist/server/registry.js +21 -0
- package/dist/server/registry.js.map +1 -0
- package/dist/server/routes/api.d.ts +4 -0
- package/dist/server/routes/api.d.ts.map +1 -0
- package/dist/server/routes/api.js +1025 -0
- package/dist/server/routes/api.js.map +1 -0
- package/dist/server/routes/index.d.ts +5 -0
- package/dist/server/routes/index.d.ts.map +1 -0
- package/dist/server/routes/index.js +10 -0
- package/dist/server/routes/index.js.map +1 -0
- package/dist/server/routes/oauth-callback.d.ts +5 -0
- package/dist/server/routes/oauth-callback.d.ts.map +1 -0
- package/dist/server/routes/oauth-callback.js +41 -0
- package/dist/server/routes/oauth-callback.js.map +1 -0
- package/dist/server/routes/push-webhook.d.ts +5 -0
- package/dist/server/routes/push-webhook.d.ts.map +1 -0
- package/dist/server/routes/push-webhook.js +95 -0
- package/dist/server/routes/push-webhook.js.map +1 -0
- package/dist/server/routes/schemas.d.ts +345 -0
- package/dist/server/routes/schemas.d.ts.map +1 -0
- package/dist/server/routes/schemas.js +649 -0
- package/dist/server/routes/schemas.js.map +1 -0
- package/dist/server/runtime/account-removals.d.ts +8 -0
- package/dist/server/runtime/account-removals.d.ts.map +1 -0
- package/dist/server/runtime/account-removals.js +84 -0
- package/dist/server/runtime/account-removals.js.map +1 -0
- package/dist/server/runtime/background-tasks.d.ts +8 -0
- package/dist/server/runtime/background-tasks.d.ts.map +1 -0
- package/dist/server/runtime/background-tasks.js +18 -0
- package/dist/server/runtime/background-tasks.js.map +1 -0
- package/dist/server/runtime/outbox-relay.d.ts +19 -0
- package/dist/server/runtime/outbox-relay.d.ts.map +1 -0
- package/dist/server/runtime/outbox-relay.js +41 -0
- package/dist/server/runtime/outbox-relay.js.map +1 -0
- package/dist/server/runtime/push-subscriptions.d.ts +15 -0
- package/dist/server/runtime/push-subscriptions.d.ts.map +1 -0
- package/dist/server/runtime/push-subscriptions.js +144 -0
- package/dist/server/runtime/push-subscriptions.js.map +1 -0
- package/dist/server/runtime.d.ts +67 -0
- package/dist/server/runtime.d.ts.map +1 -0
- package/dist/server/runtime.js +296 -0
- package/dist/server/runtime.js.map +1 -0
- package/dist/server/service.d.ts +75 -0
- package/dist/server/service.d.ts.map +1 -0
- package/dist/server/service.js +213 -0
- package/dist/server/service.js.map +1 -0
- package/dist/server/services/access.d.ts +10 -0
- package/dist/server/services/access.d.ts.map +1 -0
- package/dist/server/services/access.js +33 -0
- package/dist/server/services/access.js.map +1 -0
- package/dist/server/services/accounts.d.ts +10 -0
- package/dist/server/services/accounts.d.ts.map +1 -0
- package/dist/server/services/accounts.js +58 -0
- package/dist/server/services/accounts.js.map +1 -0
- package/dist/server/services/attachments.d.ts +12 -0
- package/dist/server/services/attachments.d.ts.map +1 -0
- package/dist/server/services/attachments.js +92 -0
- package/dist/server/services/attachments.js.map +1 -0
- package/dist/server/services/authorization.d.ts +15 -0
- package/dist/server/services/authorization.d.ts.map +1 -0
- package/dist/server/services/authorization.js +221 -0
- package/dist/server/services/authorization.js.map +1 -0
- package/dist/server/services/dependencies.d.ts +30 -0
- package/dist/server/services/dependencies.d.ts.map +1 -0
- package/dist/server/services/dependencies.js +2 -0
- package/dist/server/services/dependencies.js.map +1 -0
- package/dist/server/services/draft-content.d.ts +10 -0
- package/dist/server/services/draft-content.d.ts.map +1 -0
- package/dist/server/services/draft-content.js +81 -0
- package/dist/server/services/draft-content.js.map +1 -0
- package/dist/server/services/drafts.d.ts +12 -0
- package/dist/server/services/drafts.d.ts.map +1 -0
- package/dist/server/services/drafts.js +173 -0
- package/dist/server/services/drafts.js.map +1 -0
- package/dist/server/services/errors.d.ts +76 -0
- package/dist/server/services/errors.d.ts.map +1 -0
- package/dist/server/services/errors.js +131 -0
- package/dist/server/services/errors.js.map +1 -0
- package/dist/server/services/input.d.ts +7 -0
- package/dist/server/services/input.d.ts.map +1 -0
- package/dist/server/services/input.js +37 -0
- package/dist/server/services/input.js.map +1 -0
- package/dist/server/services/management.d.ts +17 -0
- package/dist/server/services/management.d.ts.map +1 -0
- package/dist/server/services/management.js +133 -0
- package/dist/server/services/management.js.map +1 -0
- package/dist/server/services/messages.d.ts +18 -0
- package/dist/server/services/messages.d.ts.map +1 -0
- package/dist/server/services/messages.js +77 -0
- package/dist/server/services/messages.js.map +1 -0
- package/dist/server/services/preferences.d.ts +21 -0
- package/dist/server/services/preferences.d.ts.map +1 -0
- package/dist/server/services/preferences.js +186 -0
- package/dist/server/services/preferences.js.map +1 -0
- package/dist/server/services/provider-lifecycle.d.ts +5 -0
- package/dist/server/services/provider-lifecycle.d.ts.map +1 -0
- package/dist/server/services/provider-lifecycle.js +46 -0
- package/dist/server/services/provider-lifecycle.js.map +1 -0
- package/dist/server/services/providers.d.ts +8 -0
- package/dist/server/services/providers.d.ts.map +1 -0
- package/dist/server/services/providers.js +58 -0
- package/dist/server/services/providers.js.map +1 -0
- package/dist/server/services/submissions.d.ts +14 -0
- package/dist/server/services/submissions.d.ts.map +1 -0
- package/dist/server/services/submissions.js +93 -0
- package/dist/server/services/submissions.js.map +1 -0
- package/dist/server/services/sync.d.ts +15 -0
- package/dist/server/services/sync.d.ts.map +1 -0
- package/dist/server/services/sync.js +74 -0
- package/dist/server/services/sync.js.map +1 -0
- package/dist/server/store/account-guard.d.ts +4 -0
- package/dist/server/store/account-guard.d.ts.map +1 -0
- package/dist/server/store/account-guard.js +13 -0
- package/dist/server/store/account-guard.js.map +1 -0
- package/dist/server/store/account-removals.d.ts +13 -0
- package/dist/server/store/account-removals.d.ts.map +1 -0
- package/dist/server/store/account-removals.js +170 -0
- package/dist/server/store/account-removals.js.map +1 -0
- package/dist/server/store/account-writes.d.ts +6 -0
- package/dist/server/store/account-writes.d.ts.map +1 -0
- package/dist/server/store/account-writes.js +137 -0
- package/dist/server/store/account-writes.js.map +1 -0
- package/dist/server/store/accounts.d.ts +16 -0
- package/dist/server/store/accounts.d.ts.map +1 -0
- package/dist/server/store/accounts.js +142 -0
- package/dist/server/store/accounts.js.map +1 -0
- package/dist/server/store/attachments.d.ts +13 -0
- package/dist/server/store/attachments.d.ts.map +1 -0
- package/dist/server/store/attachments.js +157 -0
- package/dist/server/store/attachments.js.map +1 -0
- package/dist/server/store/authorization.d.ts +10 -0
- package/dist/server/store/authorization.d.ts.map +1 -0
- package/dist/server/store/authorization.js +71 -0
- package/dist/server/store/authorization.js.map +1 -0
- package/dist/server/store/draft-states.d.ts +5 -0
- package/dist/server/store/draft-states.d.ts.map +1 -0
- package/dist/server/store/draft-states.js +96 -0
- package/dist/server/store/draft-states.js.map +1 -0
- package/dist/server/store/mappers.d.ts +22 -0
- package/dist/server/store/mappers.d.ts.map +1 -0
- package/dist/server/store/mappers.js +378 -0
- package/dist/server/store/mappers.js.map +1 -0
- package/dist/server/store/message-cursor.d.ts +8 -0
- package/dist/server/store/message-cursor.d.ts.map +1 -0
- package/dist/server/store/message-cursor.js +26 -0
- package/dist/server/store/message-cursor.js.map +1 -0
- package/dist/server/store/message-queries.d.ts +8 -0
- package/dist/server/store/message-queries.d.ts.map +1 -0
- package/dist/server/store/message-queries.js +116 -0
- package/dist/server/store/message-queries.js.map +1 -0
- package/dist/server/store/message-writes.d.ts +8 -0
- package/dist/server/store/message-writes.d.ts.map +1 -0
- package/dist/server/store/message-writes.js +180 -0
- package/dist/server/store/message-writes.js.map +1 -0
- package/dist/server/store/messages.d.ts +32 -0
- package/dist/server/store/messages.d.ts.map +1 -0
- package/dist/server/store/messages.js +564 -0
- package/dist/server/store/messages.js.map +1 -0
- package/dist/server/store/metadata.d.ts +22 -0
- package/dist/server/store/metadata.d.ts.map +1 -0
- package/dist/server/store/metadata.js +178 -0
- package/dist/server/store/metadata.js.map +1 -0
- package/dist/server/store/outbox.d.ts +11 -0
- package/dist/server/store/outbox.d.ts.map +1 -0
- package/dist/server/store/outbox.js +98 -0
- package/dist/server/store/outbox.js.map +1 -0
- package/dist/server/store/push.d.ts +22 -0
- package/dist/server/store/push.d.ts.map +1 -0
- package/dist/server/store/push.js +302 -0
- package/dist/server/store/push.js.map +1 -0
- package/dist/server/store/rows.d.ts +224 -0
- package/dist/server/store/rows.d.ts.map +1 -0
- package/dist/server/store/rows.js +2 -0
- package/dist/server/store/rows.js.map +1 -0
- package/dist/server/store/scheduled-drafts.d.ts +6 -0
- package/dist/server/store/scheduled-drafts.d.ts.map +1 -0
- package/dist/server/store/scheduled-drafts.js +38 -0
- package/dist/server/store/scheduled-drafts.js.map +1 -0
- package/dist/server/store/serialization.d.ts +6 -0
- package/dist/server/store/serialization.d.ts.map +1 -0
- package/dist/server/store/serialization.js +27 -0
- package/dist/server/store/serialization.js.map +1 -0
- package/dist/server/store/submissions.d.ts +23 -0
- package/dist/server/store/submissions.d.ts.map +1 -0
- package/dist/server/store/submissions.js +498 -0
- package/dist/server/store/submissions.js.map +1 -0
- package/dist/server/store/sync-writes.d.ts +5 -0
- package/dist/server/store/sync-writes.d.ts.map +1 -0
- package/dist/server/store/sync-writes.js +48 -0
- package/dist/server/store/sync-writes.js.map +1 -0
- package/dist/server/store/sync.d.ts +27 -0
- package/dist/server/store/sync.d.ts.map +1 -0
- package/dist/server/store/sync.js +508 -0
- package/dist/server/store/sync.js.map +1 -0
- package/dist/server/store/templates.d.ts +10 -0
- package/dist/server/store/templates.d.ts.map +1 -0
- package/dist/server/store/templates.js +70 -0
- package/dist/server/store/templates.js.map +1 -0
- package/dist/server/store.d.ts +128 -0
- package/dist/server/store.d.ts.map +1 -0
- package/dist/server/store.js +343 -0
- package/dist/server/store.js.map +1 -0
- package/dist/server/tokens.d.ts +13 -0
- package/dist/server/tokens.d.ts.map +1 -0
- package/dist/server/tokens.js +9 -0
- package/dist/server/tokens.js.map +1 -0
- package/dist/server/types.d.ts +6 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/server/types.js +6 -0
- package/dist/server/types.js.map +1 -0
- package/dist/server/views.d.ts +6 -0
- package/dist/server/views.d.ts.map +1 -0
- package/dist/server/views.js +65 -0
- package/dist/server/views.js.map +1 -0
- package/dist/shared/inline-images.d.ts +12 -0
- package/dist/shared/inline-images.d.ts.map +1 -0
- package/dist/shared/inline-images.js +15 -0
- package/dist/shared/inline-images.js.map +1 -0
- package/dist/shared/mail-sync-date.d.ts +2 -0
- package/dist/shared/mail-sync-date.d.ts.map +1 -0
- package/dist/shared/mail-sync-date.js +10 -0
- package/dist/shared/mail-sync-date.js.map +1 -0
- package/dist/shared/mail.d.ts +667 -0
- package/dist/shared/mail.d.ts.map +1 -0
- package/dist/shared/mail.js +50 -0
- package/dist/shared/mail.js.map +1 -0
- package/dist/shared/realtime.d.ts +5 -0
- package/dist/shared/realtime.d.ts.map +1 -0
- package/dist/shared/realtime.js +2 -0
- package/dist/shared/realtime.js.map +1 -0
- package/package.json +126 -3
- package/skills/nocobase-app-plugin-mail/SKILL.md +118 -0
- package/skills/nocobase-app-plugin-mail/references/client-integration.md +107 -0
- package/skills/nocobase-app-plugin-mail/references/configuration-and-accounts.md +167 -0
- package/skills/nocobase-app-plugin-mail/references/http-api.md +131 -0
- package/skills/nocobase-app-plugin-mail/references/public-api.md +117 -0
- package/skills/nocobase-app-plugin-mail/references/sending-and-drafts.md +53 -0
- package/skills/nocobase-app-plugin-mail/references/synchronization-and-diagnostics.md +57 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Configuration and accounts
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- [Registration and configuration ownership](#registration-and-configuration-ownership)
|
|
6
|
+
- [Connect and manage accounts](#connect-and-manage-accounts)
|
|
7
|
+
- [OAuth callback and return page](#oauth-callback-and-return-page)
|
|
8
|
+
- [Push synchronization](#push-synchronization)
|
|
9
|
+
- [IMAP/SMTP boundaries and sent copies](#imapsmtp-boundaries-and-sent-copies)
|
|
10
|
+
- [Credential storage and provider extensions](#credential-storage-and-provider-extensions)
|
|
11
|
+
- [Verify this path](#verify-this-path)
|
|
12
|
+
|
|
13
|
+
## Registration and configuration ownership
|
|
14
|
+
|
|
15
|
+
Inspect the application's Client, Server, and configuration composition roots before adding Mail. `pnpm nocobase plugin register mail` installs the package, wires Client/Server composition entries, and synchronizes this Skill, but it does not register the application-owned `mail` configuration. Add `server/config/mail.ts`, import it from `server/config/index.ts`, and complete the required migrations through the application's migration workflow. Configuration and credential work alone do not require creating another plugin or another migration. Background synchronization and scheduled sending require the application jobs service: `JobExecutorServiceProvider` from `@nocobase/app-server/jobs` in `server/app.ts`, which the application templates already compose. Mail runs them on its `@nocobase/app-plugin-mail` scope. `mail.jobs` (override `MAIL_JOBS`) names the `jobs` configuration they run on, for example one with its own `concurrency`; left out, they follow `jobs.default`, and a name that `jobs` does not define stops the application from starting. The memory adapter serves one process, so an application running more than one instance needs a `redis` jobs configuration.
|
|
16
|
+
|
|
17
|
+
Use this minimal configuration registration in an application that does not already provide it:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
// server/config/mail.ts
|
|
21
|
+
import { mailConfig } from '@nocobase/app-plugin-mail/server';
|
|
22
|
+
|
|
23
|
+
export default mailConfig;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Then add `import mail from './mail.js';`, `mail: ReturnType<typeof mail>;`, and `mail,` to `server/config/index.ts` alongside the existing application config factories. The Mail plugin falls back to built-in defaults when the whole namespace is absent, but provider instances still require this registration. If the application uses `MAIL_*` environment overrides, merge `mailEnvironmentMappings` from `@nocobase/app-plugin-mail/server` into its mappings in `server/environment.ts`; package metadata lists supported variables but does not activate them. The OAuth overrides are `MAIL_OAUTH_CALLBACK_URL` and `MAIL_OAUTH_RETURN_URL`.
|
|
27
|
+
|
|
28
|
+
`mail.providers` is a map keyed by stable instance names. The map key is the provider name; each value contains `type` and provider-specific options. Multiple instances of the same type can coexist. Renaming an instance breaks its existing account association. `enabled` defaults to `true`; disabling an instance also makes it unavailable to existing accounts.
|
|
29
|
+
|
|
30
|
+
Keep only the instances needed by the application. These placeholders describe the configuration shape; replace them before connecting an account. User mailbox providers are separate from SMTP providers under `notification` used for system notifications.
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
mail:
|
|
34
|
+
providers:
|
|
35
|
+
google:
|
|
36
|
+
type: gmail
|
|
37
|
+
clientId: replace-with-google-oauth-client-id
|
|
38
|
+
clientSecret: replace-with-google-oauth-client-secret
|
|
39
|
+
# Optional. Set to the quota allocated to this Google Cloud project.
|
|
40
|
+
quota:
|
|
41
|
+
projectId: replace-with-google-cloud-project-id
|
|
42
|
+
unitsPerUserPerMinute: 6000
|
|
43
|
+
unitsPerProjectPerMinute: 1200000
|
|
44
|
+
microsoft-365:
|
|
45
|
+
type: microsoft
|
|
46
|
+
clientId: replace-with-microsoft-entra-client-id
|
|
47
|
+
clientSecret: replace-with-microsoft-entra-client-secret
|
|
48
|
+
# tenant: common # Default; override for a specific tenant.
|
|
49
|
+
company-mail:
|
|
50
|
+
type: imap-smtp
|
|
51
|
+
imap:
|
|
52
|
+
host: imap.example.com
|
|
53
|
+
port: 993
|
|
54
|
+
secure: true
|
|
55
|
+
smtp:
|
|
56
|
+
host: smtp.example.com
|
|
57
|
+
port: 465
|
|
58
|
+
secure: true
|
|
59
|
+
# Enable only when the SMTP service does not save sent messages itself.
|
|
60
|
+
# sentCopyMode: client
|
|
61
|
+
# sentFolder: Sent # Existing folder; optional if the server marks a Sent folder.
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Use one of the following instance shapes; inspect the installed provider types for optional settings rather than copying internal adapter code.
|
|
65
|
+
|
|
66
|
+
| Type | Required configuration and connection |
|
|
67
|
+
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
+
| `gmail` | `clientId`, `clientSecret`; connect through Google OAuth |
|
|
69
|
+
| `microsoft` | `clientId`, `clientSecret`; optional `tenant` defaults to `common`; connect through Microsoft OAuth |
|
|
70
|
+
| `imap-smtp` | `imap` and `smtp`, each with `host`, `port`, and `secure`; the user supplies mailbox address, username and password during connection |
|
|
71
|
+
|
|
72
|
+
## Gmail quota configuration
|
|
73
|
+
|
|
74
|
+
`quota` is an optional server-side setting on each Gmail provider instance; it is not an end-user setting. Both values are positive integer quota units per minute. When omitted, Mail uses 6,000 units per user per project per minute and 1,200,000 units per project per minute, then paces requests at 80% of those limits. These are the current default limits for newer Google Cloud projects; actual allocations can differ, especially for older or quota-adjusted projects. Check the Gmail API quota page and the project's Google Cloud Console before raising a value. A local override does not request or increase Google's quota.
|
|
75
|
+
|
|
76
|
+
The limiter keys project usage by `quota.projectId` (or falls back to OAuth `clientId`) and user usage by that project ID plus mailbox address. Set the same Google Cloud project ID on provider instances that use different OAuth client IDs from one project, so their quotas are coordinated in-process. The limiter is in-memory per application process. When multiple server processes share the same Gmail project, divide the project's actual per-user and per-project limits among those processes (or route Gmail sync through one worker); repeating the full project quota on every process can exceed Google's shared quota.
|
|
77
|
+
|
|
78
|
+
```yaml
|
|
79
|
+
mail:
|
|
80
|
+
providers:
|
|
81
|
+
google:
|
|
82
|
+
type: gmail
|
|
83
|
+
clientId: replace-with-google-oauth-client-id
|
|
84
|
+
clientSecret: replace-with-google-oauth-client-secret
|
|
85
|
+
quota:
|
|
86
|
+
projectId: replace-with-google-cloud-project-id
|
|
87
|
+
unitsPerUserPerMinute: 6000 # Replace with the actual allocation when it differs.
|
|
88
|
+
unitsPerProjectPerMinute: 1200000
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Use the un-throttled Google quota values in configuration; Mail applies its 20% headroom internally. Omit either property to use the corresponding default. The defaults are intentionally conservative and may slow projects with higher approved quotas.
|
|
92
|
+
|
|
93
|
+
Official references: [Gmail API quotas and quota-increase guidance](https://developers.google.com/workspace/gmail/api/reference/quota?hl=zh-cn). [verified: 2026-09-26]
|
|
94
|
+
|
|
95
|
+
For IMAP/SMTP, `secure: true` means TLS from connection start; STARTTLS endpoints use the service's prescribed settings. TLS certificate verification defaults to enabled. Mail validates both endpoints before saving account credentials. Use the provider-required app password or authorization code where applicable.
|
|
96
|
+
|
|
97
|
+
Provider secrets, endpoints and allowed OAuth `scopes` live in `mail.providers`. The top-level `MAIL_*` overrides below do not create per-provider credential environment mappings. Do not assume generic `${NAME}` interpolation in YAML; use the target application's supported server configuration mechanism. In applications generated from the OSS default template, merge `mailEnvironmentMappings` into the application-owned mappings in `server/environment.ts`. Keep actual secrets in private server configuration, out of committed examples and client bundles, and restart after changing configuration.
|
|
98
|
+
|
|
99
|
+
## Connect and manage accounts
|
|
100
|
+
|
|
101
|
+
Development account setup is at `/dev/mail/accounts`, relative to the application's public base path. It contains account connection, a history start date defaulting to one calendar month ago, account suspend/resume and removal, and signature, template and NocoBase label management. New OAuth and credential-based account requests must include `initialSyncReceivedAfter` as a valid ISO 8601 date-time; the server rejects a missing or invalid boundary instead of allowing an unbounded initial import. A registered provider without a configured instance is unavailable for connection.
|
|
102
|
+
|
|
103
|
+
Use public account and authorization APIs or the existing client flow. OAuth starts with an authenticated request to `POST /api/mail/authorizations`; credential-based connection uses `POST /api/mail/accounts/connect`. Preserve the plugin's short-lived, single-use OAuth state. Account and log responses must remain free of credentials and tokens.
|
|
104
|
+
|
|
105
|
+
Personal account operations use `/api/mail/accounts`. `/settings/mail/accounts` is a read-only overview backed by `/api/mail/settings/accounts`, with owner names and a user-ID fallback. Suspending prevents sending and synchronization. Removing an account clears its local data and authorization without deleting provider mailbox messages; remote subscription cleanup can fail without preventing local removal.
|
|
106
|
+
|
|
107
|
+
## OAuth callback and return page
|
|
108
|
+
|
|
109
|
+
The default callback is the app-local `/mail/oauth/callback`. Mail combines `app.publicOrigin` (or the request origin) with `app.publicBasePath` and that path. An application mounted at `/main` with origin `https://mail.example.com` uses:
|
|
110
|
+
|
|
111
|
+
```text
|
|
112
|
+
https://mail.example.com/main/mail/oauth/callback
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Override through `mail.oauthCallbackUrl` or `MAIL_OAUTH_CALLBACK_URL`. A relative path receives the application prefix; an absolute HTTP(S) URL must already include it and reach the mounted callback. Register the exact resulting URL with the OAuth provider. Fragments are invalid. `oauthCallbackUrl` controls only the provider callback endpoint, not the page shown in the browser after authorization.
|
|
116
|
+
|
|
117
|
+
Configure the browser destination through `mail.oauthReturnUrl` or `MAIL_OAUTH_RETURN_URL`. It defaults to `/dev/mail/accounts` for backward compatibility. A relative return path receives the application public base path, so `/mail/accounts` under `/main` becomes `/main/mail/accounts`; an absolute HTTP(S) URL is also supported and is treated as trusted server configuration. Fragments are invalid.
|
|
118
|
+
|
|
119
|
+
For a production application, configure the callback and return paths together so the provider callback and application page are not confused:
|
|
120
|
+
|
|
121
|
+
```yaml
|
|
122
|
+
mail:
|
|
123
|
+
oauthCallbackUrl: /mail/oauth/callback
|
|
124
|
+
oauthReturnUrl: /mail/accounts
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
With origin `https://mail.example.com` and public base path `/main`, the provider must redirect to `https://mail.example.com/main/mail/oauth/callback`, and the browser will finish at `https://mail.example.com/main/mail/accounts?mailAuthorization=success` or `https://mail.example.com/main/mail/accounts?mailAuthorization=failure`. Register the full callback URL with the selected OAuth provider, such as Google for Gmail or Microsoft Entra ID for Microsoft 365, not the return page URL.
|
|
128
|
+
|
|
129
|
+
When deployment values come from environment variables, use `MAIL_OAUTH_CALLBACK_URL=/mail/oauth/callback` and `MAIL_OAUTH_RETURN_URL=/mail/accounts` as the values and explicitly map them to `mail.oauthCallbackUrl` and `mail.oauthReturnUrl` in the application's `server/environment.ts`. Declaring the variables in the Mail package metadata does not replace the application's mapping, and generic `${NAME}` interpolation must not be assumed.
|
|
130
|
+
|
|
131
|
+
The plugin preserves query parameters already present in the configured return URL and adds or replaces `mailAuthorization=success` or `mailAuthorization=failure`. The application-owned return page can use this status to show a result and refresh its account state.
|
|
132
|
+
|
|
133
|
+
The callback route still performs provider code exchange, OAuth state validation, and account persistence before redirecting. A custom return page therefore does not implement the OAuth callback and does not call `POST /api/mail/accounts/connect` to save the just-authorized account again. If the page also exposes a new-account action, it may compose `MailAccountConnector` or call the documented authorization APIs for that separate action.
|
|
134
|
+
|
|
135
|
+
The browser flow is: the provider redirects to `oauthCallbackUrl`; Mail validates the one-time state, completes authorization and saves the account; Mail redirects to `oauthReturnUrl`; the application-owned page reads `mailAuthorization` and refreshes `GET /api/mail/accounts` if needed. A missing `state` is rejected with HTTP 400 and does not redirect to the return page.
|
|
136
|
+
|
|
137
|
+
Before enabling production account connection, confirm that the application-owned return route exists in the production client, the full callback URL is registered with the provider, the configured relative paths match the public base path, and both success and failure destinations are handled.
|
|
138
|
+
|
|
139
|
+
## Push synchronization
|
|
140
|
+
|
|
141
|
+
Push is optional and supplements periodic synchronization. Configure both `mail.pushWebhookUrl` and `mail.pushWebhookSecret`, or their overrides `MAIL_PUSH_WEBHOOK_URL` and `MAIL_PUSH_WEBHOOK_SECRET`. The base URL must reach the public Mail webhook route; the secret is 32–128 characters using letters, digits, `_`, or `-`.
|
|
142
|
+
|
|
143
|
+
For example, base `https://mail.example.com/main/mail/webhooks`, type `gmail`, and instance `google` produce `https://mail.example.com/main/mail/webhooks/gmail/google/<secret>`.
|
|
144
|
+
|
|
145
|
+
- Gmail also needs `pushTopicName` and a Pub/Sub push subscription targeting the complete URL. The topic must allow Gmail's push service to publish. Optional `pushLabelIds` narrows the watch; Mail creates and renews account watches.
|
|
146
|
+
- Microsoft Graph subscriptions, endpoint validation, `clientState` checks and renewal are handled by Mail. The endpoint must be publicly reachable over HTTPS.
|
|
147
|
+
- IMAP/SMTP has no push support.
|
|
148
|
+
|
|
149
|
+
Preserve webhook secret validation and the provider-specific boundary; external webhook callers have no application session. A notification schedules the existing incremental path rather than writing messages directly. Keep periodic sync enabled as the fallback.
|
|
150
|
+
|
|
151
|
+
## IMAP/SMTP boundaries and sent copies
|
|
152
|
+
|
|
153
|
+
The generic adapter supports periodic new-UID discovery, sending, attachments, read/star updates and explicit permanent deletion. It does not support remote draft mirrors, discovered aliases, provider-native labels, move-to-folder, or complete external flag/deletion/move reconciliation. Local drafts and NocoBase metadata remain supported. Ordinary deletion is rejected because this adapter cannot move mail to Trash; do not substitute permanent deletion for that action.
|
|
154
|
+
|
|
155
|
+
`sentCopyMode` defaults to `server`, leaving sent-mail archiving to SMTP. When the service does not save sent copies, set `sentCopyMode: client` and use an existing `sentFolder` or server-designated Sent folder. The plugin appends the sent content and checks Message-ID before append. Keep `server` when the service saves asynchronously: an immediate duplicate check cannot see a future server copy.
|
|
156
|
+
|
|
157
|
+
A failed append records `IMAP_SENT_COPY_FAILED` while retaining the accepted submission. Fix the archive configuration without resending the accepted mail. The client does not automatically retry an ambiguous append. Advanced folder hints `sentFolder`, `trashFolder`, and `draftsFolder` identify provider folders; they do not enable unsupported move or remote-draft capabilities. Keep `trashFolder` and `draftsFolder` out of the minimal configuration example. Setting `sentFolder` alone does not enable client archiving; `sentCopyMode: client` is required.
|
|
158
|
+
|
|
159
|
+
## Credential storage and provider extensions
|
|
160
|
+
|
|
161
|
+
The default `mailCredentialVaultToken` implementation persists plain JSON. For encryption, register a compatible replacement before Mail Core and verify save, load, token rotation, and removal through account operations. Preserve ownership checks and API redaction; encryption does not replace either.
|
|
162
|
+
|
|
163
|
+
Third-party provider definitions register through `mailProviderRegistryToken`. For a requested extension, inspect the installed `MailProviderDefinition` and `MailProviderAdapter` types and the package's shipped provider documentation. Implement the capabilities actually advertised, including resumable page and cursor contracts where synchronization is supported. Built-in provider configuration alone needs no extension.
|
|
164
|
+
|
|
165
|
+
## Verify this path
|
|
166
|
+
|
|
167
|
+
Confirm registration, migrations, provider availability, and connection with the intended account. Check that the account API returns no token material, an unrelated user cannot operate it, and disabling it blocks send/sync. For OAuth changes, verify exact callback matching, rejection of reused state, account persistence before redirect, configured destinations under the actual application base path, preservation of existing query parameters, and the destination after both success and failure. For push changes, verify the generated endpoint and an actual sync trigger separately from periodic polling.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Mail HTTP API
|
|
2
|
+
|
|
3
|
+
## Contract and access
|
|
4
|
+
|
|
5
|
+
The authenticated API base is `/api/mail`, the plugin's namespace; every resource (accounts, messages, labels, templates, sync runs, submissions) lives under it. Paths are camelCase, and custom methods are `POST /{collection}/{id}/{verb}` or `POST /{collection}/{verb}`. Successful JSON responses use `{ data }`; a list is `{ data: [...], meta }`. Creates return `201`, deletes return `204` with an empty body, and attachment reads return a byte stream. Prefer `MailClient` from `@nocobase/app-plugin-mail/client` so callers share the package's request types, path encoding, and paging.
|
|
6
|
+
|
|
7
|
+
The running application documents every `/api/mail` route — parameters, bodies, response schemas, and error statuses — in its OpenAPI document: Swagger UI at `/api/swagger/docs` and the JSON at `/api/swagger`, readable with a signed-in session or an API key. Each route is tagged `Mail` and has an operationId of the form `mail<Verb><Resource>`, such as `mailSendMessage`. Treat that document as the reference for exact shapes; this page explains behavior it cannot.
|
|
8
|
+
|
|
9
|
+
Every route under `/api/mail` requires an authenticated user and access to a Mail page resource, checked before input is validated or any record is read. Routes under `/settings` require `mail.admin`; routes under `/management` require `mail.management`; all other routes require `mail.workspace`. Personal account and message operations enforce account ownership. Management message reads are read-only.
|
|
10
|
+
|
|
11
|
+
Lists page one of two ways. Feeds (`/messages` and conversation messages) take `pageSize` and `pageToken` and answer `meta: { nextPageToken, total }`; `nextPageToken` is absent on the last page and is sent back unchanged as `pageToken`. Log and management tables (`/syncRuns`, `/submissions`, `/settings/syncRuns`, `/settings/submissions`, `/management/messages`) take `page` and `pageSize` and answer `meta: { page, pageSize, total }`. `pageSize` defaults to 20 and is at most 100. Search is `q`. Bounded lists — Providers, accounts, identities, signatures, folders, labels, templates, and the admin and management account overviews — are answered whole as `{ data, meta: { total } }`. Dates in requests, such as `initialSyncReceivedAfter`, `receivedAfter`, and `scheduledAt`, are RFC 3339 date-times.
|
|
12
|
+
|
|
13
|
+
Every JSON body is validated strictly: an unknown or invalid field is `400 INVALID_ARGUMENT` with reason `INVALID_INPUT` (domain `app`) and a `fieldViolations` entry per problem. A `PATCH` changes only the fields it sends; an omitted field keeps its stored value.
|
|
14
|
+
|
|
15
|
+
## Errors
|
|
16
|
+
|
|
17
|
+
Failures use the standard body `{ error: { code, status, reason, domain, message, localizedMessage?, fieldViolations?, metadata?, requestId } }`. Mail's errors use domain `mail`; branch on `reason`, never on `message`, which is English developer text. `localizedMessage` carries the text translated for the request's locale, which `mailErrorMessage(cause, fallback)` shows.
|
|
18
|
+
|
|
19
|
+
| HTTP | `status` | `reason` |
|
|
20
|
+
| ---- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
21
|
+
| 400 | `INVALID_ARGUMENT` | `INVALID_MAIL_REQUEST` for input Mail rejects below the schema, such as an invalid page token or a missing upload `file`; `MAIL_ACCOUNT_CREDENTIALS_INVALID` when the Provider refuses the sign-in while connecting an account, with a field violation on `password`; a resource the body refers to that is missing, with `fieldViolations` naming the field: `MAIL_ACCOUNT_NOT_FOUND`, `MAIL_IDENTITY_NOT_FOUND`, … |
|
|
22
|
+
| 400 | `FAILED_PRECONDITION` | `MAIL_ACCOUNT_INACTIVE`, `MAIL_ACCOUNT_REMOVING`, `MAIL_DRAFT_SCHEDULED`, `MAIL_SYNC_RUN_STATE_INVALID`, `MAIL_SUBMISSION_STATE_INVALID`, `MAIL_PROVIDER_UNAVAILABLE`, `MAIL_PROVIDER_OPERATION_UNSUPPORTED`, …; `MAIL_ACCOUNT_REAUTHORIZATION_REQUIRED` when the Provider no longer accepts the account's authorization (revoked or expired) and the user must reconnect it; `MAIL_PROVIDER_REQUEST_FAILED` when the Provider refused the request itself, such as a recipient or content it does not accept |
|
|
23
|
+
| 403 | `PERMISSION_DENIED` | `MAIL_ACCESS_DENIED` |
|
|
24
|
+
| 404 | `NOT_FOUND` | The resource the URL names: `MAIL_ACCOUNT_NOT_FOUND`, `MAIL_MESSAGE_NOT_FOUND`, `MAIL_SYNC_RUN_NOT_FOUND`, `MAIL_SUBMISSION_NOT_FOUND`, `MAIL_LABEL_NOT_FOUND`, `MAIL_TEMPLATE_NOT_FOUND`, `MAIL_SIGNATURE_NOT_FOUND`, `MAIL_ATTACHMENT_NOT_FOUND`, … |
|
|
25
|
+
| 409 | `ALREADY_EXISTS` | `MAIL_LABEL_ALREADY_EXISTS`, `MAIL_ACCOUNT_ALREADY_CONNECTED` |
|
|
26
|
+
| 409 | `ABORTED` | `MAIL_IDEMPOTENCY_CONFLICT`, `MAIL_DRAFT_REVISION_OUTDATED` |
|
|
27
|
+
| 413 | `INVALID_ARGUMENT` | `BODY_TOO_LARGE`: a JSON body over 8 MiB or an upload over 27 MiB |
|
|
28
|
+
| 415 | `INVALID_ARGUMENT` | `INVALID_MAIL_REQUEST`: an upload that is not `multipart/form-data` |
|
|
29
|
+
| 429 | `RESOURCE_EXHAUSTED` | `MAIL_PROVIDER_REQUEST_FAILED` when the Provider throttles the request or a Provider quota ran out; when the Provider says how long to wait, `Retry-After` and `metadata.retryAfter` give the delay in seconds |
|
|
30
|
+
| 503 | `UNAVAILABLE` | `MAIL_PROVIDER_REQUEST_FAILED` when the Provider is unreachable, times out or fails on its side, such as an HTTP 5xx or a transient SMTP reply; `Retry-After` is set when the Provider gave a delay |
|
|
31
|
+
|
|
32
|
+
Only a route that waits for the Provider while answering can return the Provider statuses: connecting an account, changing read or starred state, moving or deleting a message, retrying message content, and downloading a Provider attachment. Sending, saving drafts and synchronization reach the Provider in the background or record its failure on the submission or sync run (`error` with `code`, `category`, `retryable`), so they never answer `429` or `503`. Every Provider error carries the public Provider error in `metadata` (`code`, `category`, `retryable`, `retryAfterMs` and an allowlisted `reasonCode` when known), never the Provider's own message.
|
|
33
|
+
|
|
34
|
+
An unexpected failure is `500 INTERNAL` and reveals nothing about its cause.
|
|
35
|
+
|
|
36
|
+
Request and response types use the names exported from `@nocobase/app-plugin-mail/server` and `@nocobase/app-plugin-mail/client`. New response fields are optional, and callers should ignore fields they do not use. Account, folder, sync, submission, Provider error category/reason, and realtime event values may be unknown to an older client; keep a fallback for those values.
|
|
37
|
+
|
|
38
|
+
Mail publishes the user-scoped realtime topic `mail:messages` with `{ kind: 'mail.changed' }` as an invalidation signal; it contains no message content. Subscribe through the host Realtime client and refresh affected data after the event or a reconnect. The Client package exports `MAIL_REALTIME_TOPIC` and `MailRealtimeEvent` from its client entry and the `realtime` subpath.
|
|
39
|
+
|
|
40
|
+
## Providers and accounts
|
|
41
|
+
|
|
42
|
+
| Method | Path | Request / result |
|
|
43
|
+
| -------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
44
|
+
| `GET` | `/providers` | Returns `MailProviderView[]`. |
|
|
45
|
+
| `POST` | `/authorizations` | Provider `type` and `name`, optional `scopes`, and required `initialSyncReceivedAfter`; returns `201` and `MailAuthorizationStartResult`. |
|
|
46
|
+
| `POST` | `/accounts/connect` | Provider `type` and `name`, `address`, optional `displayName`, `username`, required `password`, and required `initialSyncReceivedAfter`; verifies the credentials, then returns `201` and the created `MailAccountView`. |
|
|
47
|
+
| `GET` | `/accounts` | Returns the current user's `MailAccountView[]`. |
|
|
48
|
+
| `PATCH` | `/accounts/:accountId` | Optional `status` (`active` or `suspended`); returns the updated `MailAccountView`. |
|
|
49
|
+
| `DELETE` | `/accounts/:accountId` | Starts the asynchronous, durable account removal; returns `202` with the account in its `removing` status, or `202` with no body when the removal already finished. |
|
|
50
|
+
| `GET` | `/settings/accounts` | Admin overview (`mail.admin`); returns `MailManagedAccountView[]`. |
|
|
51
|
+
| `GET` | `/settings/syncRuns` | Admin view of every user's sync runs, newest first, paged with `page` and `pageSize`; `canManage` marks the caller's own. |
|
|
52
|
+
| `GET` | `/settings/submissions` | Admin view of every user's submissions, newest first, paged with `page` and `pageSize`. |
|
|
53
|
+
| `GET` | `/management/accounts` | Management overview (`mail.management`); returns `MailManagedAccountView[]`. |
|
|
54
|
+
| `GET` | `/management/accounts/:accountId/folders` | Returns folders for the selected account; `404 MAIL_ACCOUNT_NOT_FOUND` when the account does not exist. |
|
|
55
|
+
|
|
56
|
+
`/settings/accounts` and `/management/accounts` return the same list for two different pages, each gated by its own page permission.
|
|
57
|
+
|
|
58
|
+
## Identities, signatures, labels, and templates
|
|
59
|
+
|
|
60
|
+
| Method | Path | Request / result |
|
|
61
|
+
| -------- | ---------------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
62
|
+
| `GET` | `/accounts/:accountId/identities` | Returns `MailIdentity[]`. |
|
|
63
|
+
| `PATCH` | `/accounts/:accountId/identities/:identityId` | Optional `displayName`; returns the updated `MailIdentity`. |
|
|
64
|
+
| `GET` | `/accounts/:accountId/signatures` | Returns `MailSignature[]`. |
|
|
65
|
+
| `POST` | `/accounts/:accountId/signatures` | Creates a signature from name, text/html content, and default selection; returns `201`. |
|
|
66
|
+
| `PATCH` | `/accounts/:accountId/signatures/:signatureId` | Updates the sent fields of a signature (`name`, `text`, `html`, `isDefault`). |
|
|
67
|
+
| `DELETE` | `/accounts/:accountId/signatures/:signatureId` | Deletes a signature; returns `204`. |
|
|
68
|
+
| `GET` | `/accounts/:accountId/folders` | Returns the current user's folders for the account. |
|
|
69
|
+
| `GET` | `/labels` | Returns the current user's labels. |
|
|
70
|
+
| `POST` | `/labels` | Creates a label from `MailSaveLabelInput`; returns `201`. |
|
|
71
|
+
| `PATCH` | `/labels/:labelId` | Updates the sent fields of a label (`name`, `color`). |
|
|
72
|
+
| `DELETE` | `/labels/:labelId` | Deletes a label; returns `204`. |
|
|
73
|
+
| `GET` | `/templates` | Returns the current user's `MailTemplate[]`. |
|
|
74
|
+
| `POST` | `/templates` | Creates a template from `MailSaveTemplateInput`; returns `201`. |
|
|
75
|
+
| `PATCH` | `/templates/:templateId` | Updates the sent fields of a template (`name`, `subject`, `text`, `html`). |
|
|
76
|
+
| `DELETE` | `/templates/:templateId` | Deletes a template; returns `204`. |
|
|
77
|
+
|
|
78
|
+
## Messages, conversations, attachments, and sending
|
|
79
|
+
|
|
80
|
+
| Method | Path | Request / result |
|
|
81
|
+
| -------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
82
|
+
| `GET` | `/messages` | Filters by `accountId`, `folderId`, `labelId`, `conversationId`, `q`, `unread`, and `starred`; pages with `pageSize` and `pageToken`. |
|
|
83
|
+
| `GET` | `/messages/countUnread` | Returns the current user's unread count as a number. |
|
|
84
|
+
| `POST` | `/messages/send` | Accepts `MailComposeInput`; returns `MailSubmissionView`. |
|
|
85
|
+
| `POST` | `/messages/sendBulk` | Accepts `MailBulkComposeInput`; returns `MailSubmissionView[]`. |
|
|
86
|
+
| `POST` | `/messages/saveDraft` | Accepts draft compose fields; creates the draft or replaces the one named by `draftMessageId` or `draftKey`; returns `MailMessage`. |
|
|
87
|
+
| `GET` | `/accounts/:accountId/conversations/:conversationId/messages` | Conversation messages, paged with `pageSize` and `pageToken`. |
|
|
88
|
+
| `GET` | `/accounts/:accountId/messages/:messageId` | Returns a `MailMessage`. |
|
|
89
|
+
| `PATCH` | `/accounts/:accountId/messages/:messageId` | Optional read/starred/note/todo changes; returns the updated `MailMessage`. |
|
|
90
|
+
| `DELETE` | `/accounts/:accountId/messages/:messageId` | Optional `permanently=true` query parameter; returns `204`. |
|
|
91
|
+
| `GET` | `/accounts/:accountId/messages/:messageId/attachments/:attachmentId` | Streams a personal mailbox attachment. |
|
|
92
|
+
| `POST` | `/accounts/:accountId/messages/:messageId/modifyLabels` | `addLabelIds` and/or `removeLabelIds`; returns the updated `MailMessage`. |
|
|
93
|
+
| `POST` | `/accounts/:accountId/messages/:messageId/move` | Requires `providerFolderId`; returns the updated `MailMessage`. |
|
|
94
|
+
| `POST` | `/accounts/:accountId/messages/:messageId/retryContent` | Retries deferred message content retrieval; returns the updated `MailMessage`. |
|
|
95
|
+
| `POST` | `/accounts/:accountId/messages/:messageId/resolveDraftConflict` | Requires `action` `useRemote` or `keepLocal`; returns the resolved `MailMessage`. |
|
|
96
|
+
| `POST` | `/attachments` | `multipart/form-data` with field `file`, at most 27 MiB; returns `201` and `MailOutboundAttachmentView`. |
|
|
97
|
+
| `GET` | `/attachments/:attachmentId` | Streams an uploaded outbound attachment. |
|
|
98
|
+
|
|
99
|
+
## Synchronization and delivery history
|
|
100
|
+
|
|
101
|
+
| Method | Path | Request / result |
|
|
102
|
+
| ------ | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
103
|
+
| `POST` | `/accounts/:accountId/sync` | Accepts optional `mode` and `receivedAfter`; returns `202` and `MailSyncRunView`. |
|
|
104
|
+
| `GET` | `/syncRuns` | The current user's sync runs, paged with `page` and `pageSize`. |
|
|
105
|
+
| `GET` | `/syncRuns/:syncRunId` | Returns one `MailSyncRunView`. |
|
|
106
|
+
| `POST` | `/syncRuns/:syncRunId/retry` | Queues a retry; returns `202` and the updated run. |
|
|
107
|
+
| `POST` | `/syncRuns/:syncRunId/cancel` | Cancels a run; returns the updated run. |
|
|
108
|
+
| `GET` | `/submissions` | Paged with `page` and `pageSize`; filters with `bulkOnly` and `groupByBatch`. Grouped bulk results count whole batches. |
|
|
109
|
+
| `POST` | `/submissions/:submissionId/retry` | Retries an eligible submission; returns `MailSubmissionLogView`. |
|
|
110
|
+
| `POST` | `/submissions/:submissionId/cancel` | Cancels an eligible submission; returns `MailSubmissionLogView`. |
|
|
111
|
+
|
|
112
|
+
## All-user management
|
|
113
|
+
|
|
114
|
+
| Method | Path | Request / result |
|
|
115
|
+
| ------ | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
116
|
+
| `GET` | `/management/messages` | Filters by `accountId`, `folderId`, `q`, `unread`, and `starred`; paged with `page` and `pageSize`. |
|
|
117
|
+
| `POST` | `/management/messages/batchApply` | Accepts `MailManagementMessageActionInput`; returns per-item results. |
|
|
118
|
+
| `GET` | `/management/accounts/:accountId/messages/:messageId` | Returns a read-only `MailMessage`; does not mark it read. |
|
|
119
|
+
| `GET` | `/management/accounts/:accountId/messages/:messageId/attachments/:attachmentId` | Streams an all-user management attachment. |
|
|
120
|
+
|
|
121
|
+
## OAuth and Provider webhooks
|
|
122
|
+
|
|
123
|
+
These two are root routes outside `/api`, so they answer what their protocol requires rather than the API body above, and the OpenAPI document does not list them.
|
|
124
|
+
|
|
125
|
+
OAuth uses the configured callback path, defaulting to `/mail/oauth/callback`. It requires a short-lived, single-use `state` returned by `POST /api/mail/authorizations`; successful and failed callbacks redirect to the configured `mail.oauthReturnUrl` with `mailAuthorization=success` or `mailAuthorization=failure`.
|
|
126
|
+
|
|
127
|
+
Provider push notifications use `POST /mail/webhooks/:providerType/:providerName/:secret`. The URL secret and Provider client state are validated by the plugin; webhook request bodies are limited to 1,000,000 bytes.
|
|
128
|
+
|
|
129
|
+
## Compatibility
|
|
130
|
+
|
|
131
|
+
Within a major version, existing methods, paths, request requirements, response meanings, error reasons, permission resources, and stream behavior remain stable. Additive request fields are optional; additive response fields are optional. A required-field addition, path removal, behavior change, or permission change requires a new major version and a migration note.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Mail public API
|
|
2
|
+
|
|
3
|
+
## Package entries
|
|
4
|
+
|
|
5
|
+
| Entry | Purpose |
|
|
6
|
+
| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
7
|
+
| `@nocobase/app-plugin-mail/server` | Server plugin, application configuration, Server service token and Provider extension contracts. |
|
|
8
|
+
| `@nocobase/app-plugin-mail/client` | Client plugin, `MailClient`, its application token/hook, `MailWorkspacePage`, template helpers and realtime event contract. |
|
|
9
|
+
| `@nocobase/app-plugin-mail/client/components` | Curated Mail UI components and their props/state types. |
|
|
10
|
+
| `@nocobase/app-plugin-mail/realtime` | Realtime topic and event type for consumers that only need the event contract. |
|
|
11
|
+
| `@nocobase/app-plugin-mail/package.json` | Package metadata. |
|
|
12
|
+
|
|
13
|
+
The package root is a Server alias retained for plugin registration and application configuration. Use the explicit `/server` entry in new application code. Package export maps are the public boundary; source files such as `server/tokens`, `server/types`, `client/plugin`, `client/routes`, and the internal component barrel are not public imports.
|
|
14
|
+
|
|
15
|
+
## Server entry
|
|
16
|
+
|
|
17
|
+
### Plugin and configuration
|
|
18
|
+
|
|
19
|
+
The Server entry exports the default plugin, `mailConfig`, `DEFAULT_MAIL_CONFIG`, `mailEnvironmentMappings`, `resolveMailConfig`, and the `MailConfig`/provider configuration types. Applications register the plugin and explicitly compose its configuration factory as described in [Configuration and accounts](configuration-and-accounts.md).
|
|
20
|
+
|
|
21
|
+
### Supported tokens
|
|
22
|
+
|
|
23
|
+
- `mailServiceToken` resolves `MailService`, the consumer-facing facade for account, mailbox, message, label, signature, template, synchronization and delivery operations. Application plugins consume this service; they do not implement it.
|
|
24
|
+
- `mailProviderRegistryToken` resolves `MailProviderRegistry`. A Server plugin registers a `MailProviderDefinition` during boot.
|
|
25
|
+
- `mailCredentialVaultToken` resolves `MailCredentialVault`. Replace it only before Mail Core initializes, when the application owns an alternative credential store.
|
|
26
|
+
- `createMailProviderRegistry()` creates an isolated registry, primarily for tests and standalone integrations. Application plugins should register with the Mail Core registry token instead of replacing it.
|
|
27
|
+
|
|
28
|
+
Internal persistence, runtime, adapter-resolver and outbound-storage tokens are intentionally excluded.
|
|
29
|
+
|
|
30
|
+
### Provider extension contract
|
|
31
|
+
|
|
32
|
+
Use `defineMailProviderDefinition()` to type-check a `MailProviderDefinition<TConfig>`. Its stable extension points are:
|
|
33
|
+
|
|
34
|
+
- `type`, `label`, optional `validateConfig`, and extensible `capabilities` metadata.
|
|
35
|
+
- Optional `authorization`, `connection`, and `push` handlers.
|
|
36
|
+
- Required `createAdapter(context, config, account)`, returning a `MailProviderAdapter` for folder/message listing, content and attachment reads, sends, drafts, message mutations, and optional push subscription operations. The `MailProviderAccount` argument exposes only the account ID, address, Provider identity, and opaque credential reference; retrieve credentials through `context.credentials`.
|
|
37
|
+
- `MailProviderContext` provides the public base path and the credential vault. The vault supports `put`, `get`, `replace`, `getOrRefresh`, `delete`, and optionally `deleteExpired`. Authorization secrets belong in that vault, not in account records or logs.
|
|
38
|
+
|
|
39
|
+
Associated request/result contracts are exported for authorization, connection, change/folder/message pagination, normalized mail records, sending, push notifications and credential access. Advertise only the capabilities supported by the returned adapter; Mail checks capabilities as well as the corresponding adapter method. Provider-defined capability keys may be added. Mail Core ignores unknown keys and treats absent known keys as unsupported; consumers preserve or ignore keys they do not understand.
|
|
40
|
+
|
|
41
|
+
Built-in Provider config interfaces (`GmailMailProviderConfig`, `MicrosoftMailProviderConfig`, and `ImapSmtpMailProviderConfig`) are exported for applications that need to type their configuration. They are not extension points for changing built-in adapters.
|
|
42
|
+
|
|
43
|
+
### Domain types
|
|
44
|
+
|
|
45
|
+
The Server entry exports API-safe account, identity, folder, label, message, attachment, template, signature, operation, synchronization and submission records, plus their request/result types. `MailAccountView` excludes credential references; `MailProviderAccount` is a separate server-only adapter input and carries an opaque vault reference, not a credential. Persistence-only models are not exposed. `MailPublicError` omits provider-internal messages. `MailOperationContext` carries the acting `actorId` and request `AbortSignal` into service calls.
|
|
46
|
+
|
|
47
|
+
`MAIL_PROVIDER_CAPABILITIES` lists Mail's recognized capability keys, while `MAIL_PROVIDER_ERROR_CATEGORIES` lists its recognized Provider error categories. These runtime constants describe current built-in behavior; consumers should still tolerate unknown capability and error values from later releases.
|
|
48
|
+
|
|
49
|
+
`MailService` exposes these operation groups:
|
|
50
|
+
|
|
51
|
+
- Provider discovery and account authorization, connection, listing, update and removal.
|
|
52
|
+
- Personal and managed account, folder, message, attachment and operation-log reads; management actions.
|
|
53
|
+
- Identity, signature, label and template CRUD.
|
|
54
|
+
- Personal message/conversation reads, deferred-content retry, message state updates, label changes, moves and deletion.
|
|
55
|
+
- Single and bulk sending, draft save/conflict resolution, and outbound attachment upload/read.
|
|
56
|
+
- Sync run and submission history, pagination, retry and cancellation, plus unread counts.
|
|
57
|
+
|
|
58
|
+
Output status, folder-type and Provider error category/reason types have `Known...` aliases for currently recognized values and open `Mail...` types for values added by a later compatible release. Inputs that trigger a specific operation remain constrained to the values Mail currently accepts.
|
|
59
|
+
|
|
60
|
+
## Client entry
|
|
61
|
+
|
|
62
|
+
### Composition and data access
|
|
63
|
+
|
|
64
|
+
- The default export registers the Mail Client plugin.
|
|
65
|
+
- `MailWorkspacePage` and `MailWorkspacePageProps` provide the full workspace. `templateVariables` supplies an allowlisted record context for saved template placeholders; it does not associate messages with application records.
|
|
66
|
+
- `MailClient` and `mailClientToken` expose the typed client data layer. Resolve the app-owned instance with `useMailClient()` in React or `app.services.resolve(mailClientToken)` elsewhere; do not construct a separate `MailClient` for normal UI integration.
|
|
67
|
+
- `mailErrorMessage(cause, fallback)` returns the text to show for a failed call: the server's `localizedMessage`, or `fallback`. Code that must react to a specific failure branches on `ApiClientError.reason` from `@nocobase/app-client` instead.
|
|
68
|
+
- `renderMailTemplate()`, `plainTextToMailHtml()`, and `htmlToPlainText()` are supported template/body helpers. `MailTemplateVariables` and `RenderedMailTemplate` describe their data.
|
|
69
|
+
- `MAIL_PLUGIN_NS`, `MAIL_REALTIME_TOPIC`, and `MailRealtimeEvent` expose the translation namespace and invalidation event contract.
|
|
70
|
+
- `MAIL_VIRTUAL_FOLDER_IDS` provides stable query identifiers for built-in cross-account folders. `MAIL_LABEL_COLORS` and `DEFAULT_MAIL_LABEL_COLOR` provide the supported user-label palette and default.
|
|
71
|
+
|
|
72
|
+
### `MailClient` method groups
|
|
73
|
+
|
|
74
|
+
- **Providers and accounts:** `listProviders`, `listAccounts`, `startAuthorization`, `connectAccount`, `updateAccount`, `removeAccount`, `getUnreadCount`.
|
|
75
|
+
- **Managed accounts:** `listManagedAccounts`, `listManagementAccounts`, `listManagedFolders`, `listManagedSyncRunsPage`, `listManagedSubmissionsPage`.
|
|
76
|
+
- **Identities and signatures:** `listIdentities`, `updateIdentity`, `listSignatures`, `saveSignature`, `deleteSignature`.
|
|
77
|
+
- **Folders, labels and templates:** `listFolders`, `listLabels`, `createLabel`, `updateLabel`, `deleteLabel`, `listTemplates`, `saveTemplate`, `deleteTemplate`.
|
|
78
|
+
- **Mailbox reads and message actions:** `listMessages`, `listManagedMessages`, `manageMessages`, `listConversationMessages`, `getMessage`, `getManagedMessage`, `retryMessageContent`, `updateMessage`, `updateMessageLabels`, `moveMessage`, `deleteMessage`.
|
|
79
|
+
- **Attachments:** `uploadAttachment`, `downloadAttachment`, `downloadManagedAttachment`.
|
|
80
|
+
- **Compose and drafts:** `sendMessage`, `sendBulk`, `saveDraft`, `resolveDraftConflict`.
|
|
81
|
+
- **Synchronization:** `startSync`, `getSyncRun`, `listSyncRunsPage`, `retrySyncRun`, `cancelSyncRun`.
|
|
82
|
+
- **Delivery history:** `listSubmissionsPage`, `retrySubmission`, `cancelSubmission`.
|
|
83
|
+
|
|
84
|
+
The TypeScript signatures are the request/result source of truth. For direct HTTP clients, see [HTTP API](http-api.md).
|
|
85
|
+
|
|
86
|
+
## Reusable components
|
|
87
|
+
|
|
88
|
+
All components below are exported from `@nocobase/app-plugin-mail/client/components`. Components that call `useMailClient()` require the Mail Client plugin to be registered in the host application.
|
|
89
|
+
|
|
90
|
+
| Component | Exported props and related types |
|
|
91
|
+
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
92
|
+
| `MailAccountCard` | `MailAccountCardProps` |
|
|
93
|
+
| `MailAccountConnector` | `MailAccountConnectorProps`, `MailAccountConnectorLabels`, `MailAccountCredentials` |
|
|
94
|
+
| `MailConversationView` | `MailConversationViewProps`, `MailConversationViewLabels` |
|
|
95
|
+
| `MailMessageList` | `MailMessageListProps`, `MailMessageListLabels` |
|
|
96
|
+
| `MailProviderCard` | `MailProviderCardProps` |
|
|
97
|
+
| `MailRichTextEditor` | `MailRichTextEditorProps`, `MailRichTextValue`, `MailRichTextEditorLabels`, `MailRichTextEditorInsertOption`, `MailRichTextEditorInsertMenu`, `MailRichTextEditorInsertActions` |
|
|
98
|
+
| `MailNavigationIcon` | No props; displays the user's unread count using the host app services. |
|
|
99
|
+
| `MailLabelManager` | No props; reads and edits the current user's labels. |
|
|
100
|
+
| `MailLabelTag`, `MailLabelColorDot` | `MailLabelTagProps`, `MailLabelColorDotProps` |
|
|
101
|
+
| `MailSignatureManager` | `MailSignatureManagerProps` |
|
|
102
|
+
| `MailStatusBadge` | `MailStatusBadgeProps`, `MailStatusTone` |
|
|
103
|
+
| `MailSyncPolicyFields` | `MailSyncPolicyFieldsProps`, `MailSyncPolicyValue` |
|
|
104
|
+
| `MailTemplateManager` | No props; reads and edits the current user's templates. |
|
|
105
|
+
| `MailboxSidebar` | `MailboxSidebarProps`, `MailboxSidebarLabels`, `MailboxFolderGroup`, `MailboxSmartView` |
|
|
106
|
+
| `MailComposer` | `MailComposerComponentProps` and shared `MailComposerProps`, `MailComposerRequest`, `MailComposerState`, `MailComposerCompletionResult`, `MailForwardQuote`, `MailTemplateVariables`, `EMPTY_MAIL_COMPOSER` |
|
|
107
|
+
| `MailWorkspaceComposer` | `MailWorkspaceComposerProps` and the shared composer contracts above. |
|
|
108
|
+
|
|
109
|
+
`MailComposer` renders one supplied account/request. `MailWorkspaceComposer` also manages account and sender identity selection across eligible accounts. Completion results are open strings; callers should handle known results and provide a fallback for future outcomes.
|
|
110
|
+
|
|
111
|
+
## HTTP and realtime
|
|
112
|
+
|
|
113
|
+
The authenticated `/api/mail` routes, payloads, paging, permission resources, error reasons, OAuth callback and Provider webhook are documented in [HTTP API](http-api.md). Prefer `MailClient` for application code. The `mail:messages` realtime event is a user-scoped invalidation signal with no message body; refresh affected Mail data after receiving it or reconnecting.
|
|
114
|
+
|
|
115
|
+
## Evolution rules
|
|
116
|
+
|
|
117
|
+
Within a major version, keep existing names, required props and request fields, response meaning, permission checks and event semantics stable. Add fields as optional, add optional component props and Provider methods, preserve unknown capability/status/error/event values, and give consumers safe fallbacks. Reserve removal, required-field additions and semantic changes for a major version with a migration note. Do not make application code depend on implementation paths outside the package export map.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Sending and drafts
|
|
2
|
+
|
|
3
|
+
## Submit through Mail
|
|
4
|
+
|
|
5
|
+
Resolve `MailService` with `mailServiceToken`, or use the authenticated `POST /api/mail/messages/send` API. Inspect the installed request type and derive the actor from the server session; a browser-supplied owner ID is not authorization. Mail enforces account ownership and rejects inactive accounts.
|
|
6
|
+
|
|
7
|
+
Supply a stable `idempotencyKey` for one logical send and retain it across transport retries. A key reused with different content is rejected. After a lost response, query submission history or repeat the same logical request with the same key; generating a new key can duplicate mail. Mail owns persisted submissions and outbox/background job delivery, so application code should not add a second provider submission path.
|
|
8
|
+
|
|
9
|
+
Submission history is available through `MailService.listSubmissions()`, `GET /api/mail/submissions`, and `/dev/mail/logs/send`. A failed request answers the standard error body `{ error: { code, status, reason, domain: 'mail', message, localizedMessage } }`; branch on `reason` (for example `MAIL_IDEMPOTENCY_CONFLICT` or `MAIL_ACCOUNT_INACTIVE`), never on `message`, and show `localizedMessage` when present. A submission's own delivery error is a public Provider error with `code`, `category` and `retryable`. Public views omit internal provider errors, request fingerprints and leases.
|
|
10
|
+
|
|
11
|
+
## Delivery outcomes and retries
|
|
12
|
+
|
|
13
|
+
| Status | Meaning and handling |
|
|
14
|
+
| ------------ | ------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `pending` | Waiting, possibly for scheduled time; cancellable before a worker claims it |
|
|
16
|
+
| `submitting` | Submission in progress; observe its result |
|
|
17
|
+
| `accepted` | Provider accepted the request; not proof of recipient delivery or reading |
|
|
18
|
+
| `failed` | Inspect the error and retry eligibility; supported retries reuse the stored snapshot |
|
|
19
|
+
| `unknown` | Provider may have accepted it; confirm provider-side outcome before deciding further action |
|
|
20
|
+
|
|
21
|
+
Use `POST /api/mail/submissions/:submissionId/retry` or `/cancel` for eligible persisted submissions. Accepted and unknown submissions cannot be retried or cancelled through these actions. Older records whose snapshots were cleared cannot recover recipient details or be retried. Do not implement retry as “send a new message” for every terminal status.
|
|
22
|
+
|
|
23
|
+
SMTP can accept some recipients and reject others. The submission remains `accepted` with `SMTP_RECIPIENTS_REJECTED`, accepted/rejected recipient lists and `retryable: false`. Present the partial outcome; only rejected recipients belong in a new send. Avoid resending to everyone based on the presence of an error field.
|
|
24
|
+
|
|
25
|
+
## Drafts, attachments and composition
|
|
26
|
+
|
|
27
|
+
Local drafts support every sending provider. Autosave writes locally after two seconds of inactivity (maximum ten seconds during continuous input), never disables editing or sending, and reports failure only in the autosave indicator. Imported provider drafts are localized before editing; no remote mirroring or conflict prompt is used. Close flushes changes in the background. Preserve stable draft keys, revisions and closed-draft records so late saves cannot recreate a consumed draft.
|
|
28
|
+
|
|
29
|
+
Retain the attachment IDs returned when uploading or reopening a draft. Local upload identities differ from provider attachment IDs; Mail keeps uploads alive while referenced by a live draft or outgoing submission snapshot. Reopened or rescheduled drafts must use the retained file content, including after page reload. Do not reconstruct attachment references from display names or remove a shared upload when another draft still owns it.
|
|
30
|
+
|
|
31
|
+
Keep sender-account selection, signatures, templates, scheduled time and attachments consistent with the selected account. Templates resolve variables when applied and preserve unknown placeholders. Forwarded source HTML and the sender's new comment are separate content; preserve that split across editing, autosave and recovery.
|
|
32
|
+
|
|
33
|
+
Sending clears the composer and browser draft recovery for every result, including failure, unknown delivery and partial acceptance. Validation errors before handoff preserve editing. Transport uncertainty keeps the original request in browser outgoing records; resume it with the same idempotency key instead of creating another draft or submission.
|
|
34
|
+
|
|
35
|
+
## Scheduled and separate sending
|
|
36
|
+
|
|
37
|
+
Scheduled sends persist their message snapshot and run through Mail's outbox and the application jobs service. Browser timers are insufficient. The account and provider must still be available when the worker executes.
|
|
38
|
+
|
|
39
|
+
Ordinary scheduled messages remain in Drafts with `scheduledSend` metadata. Use the submission cancellation action before editing, deleting or sending the draft again; wait for cancellation success before opening the composer. Cancellation restores the same draft and retains recipients, content and attachments. Pending schedules are cancellable before sending starts. Accepted, failed and unknown delivery all remove the draft; outgoing snapshots remain available for inspection and eligible retries. The upgrade migration restores draft associations for existing ordinary schedules. Separate sending continues to use batch history.
|
|
40
|
+
|
|
41
|
+
`POST /api/mail/messages/sendBulk` creates separate per-recipient submissions. The shared development composer at `/dev/mail/send` offers both ordinary sending and Send separately. Separate sending deduplicates at most 100 recipients and requires empty Cc/Bcc; each child owns its content and attachment references; the source draft is removed once every child request is persisted.
|
|
42
|
+
|
|
43
|
+
Display grouped history using `GET /api/mail/submissions?bulkOnly=true&groupByBatch=true`. Pages (`page`, `pageSize`) and `meta.total` count complete batches. Expand the parent for recipient details; parent actions apply only to eligible children in that batch. Refresh pending results and retry only failed eligible children, preserving accepted and unknown outcomes.
|
|
44
|
+
|
|
45
|
+
## Sent-folder refresh
|
|
46
|
+
|
|
47
|
+
Accepted submissions schedule mailbox refreshes immediately and after 5 and 30 seconds, allowing delayed provider visibility. A request during active sync schedules a follow-up. Synced messages, keyed by account and provider message ID, populate the sent folder; application code should not manufacture a second sent-message record.
|
|
48
|
+
|
|
49
|
+
A refresh error does not mean delivery failed and must never resend an accepted submission. For IMAP/SMTP, sent copies depend on `sentCopyMode`; read [sent-copy configuration](configuration-and-accounts.md#imapsmtp-boundaries-and-sent-copies). `IMAP_SENT_COPY_FAILED` retains accepted delivery and calls for archive diagnosis, not another send.
|
|
50
|
+
|
|
51
|
+
## Verify this path
|
|
52
|
+
|
|
53
|
+
Use provider mocks or an authorized test mailbox to verify stable-key retries produce one provider submission, a key with changed content is rejected, and a lost response does not generate a new send. For the changed behavior, cover unknown results, partial SMTP acceptance, accepted delivery with failed sent-copy saving, restored draft attachments, job-backed scheduling, or batch retry eligibility as applicable. Distinguish provider acceptance from actual recipient receipt in the reported results.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Synchronization and diagnostics
|
|
2
|
+
|
|
3
|
+
## Start and observe synchronization
|
|
4
|
+
|
|
5
|
+
Use `MailService.startSync()` or `POST /api/mail/accounts/:accountId/sync`. The workspace's all-mailbox action targets active accounts supporting incremental synchronization; selecting an account narrows the scope. Observe history through `GET /api/mail/syncRuns` (paged by `page` and `pageSize`), a run through `GET /api/mail/syncRuns/{syncRunId}`, or `/dev/mail/logs/sync`.
|
|
6
|
+
|
|
7
|
+
Automatic synchronization is configured globally through `mail.automaticSyncIntervalMs` or `MAIL_AUTOMATIC_SYNC_INTERVAL_MS`. It defaults to `300000` milliseconds, minimum `60000`, and applies to both existing and new accounts. The runtime checks due accounts every minute. Account forms and account-update APIs do not set independent automatic intervals.
|
|
8
|
+
|
|
9
|
+
`mail.syncBatchSize` or `MAIL_SYNC_BATCH_SIZE` defaults to 100, with an integer range of 1–200. This bounds each provider list page, not the total imported history. The account screen defaults a new initial sync to one calendar month ago. Direct account-creation APIs require `initialSyncReceivedAfter`; direct initial-sync requests must carry `receivedAfter` unless the account already has a saved start date. Both are RFC 3339 date-times such as `2026-01-01T00:00:00Z`. Legacy accounts without one use a one-month boundary for automatic or push-triggered first syncs. An active pre-upgrade initial run missing a valid boundary restarts with the same one-month fallback; Gmail rejects any initial list call without a valid date. The sync request no longer accepts `maxMessages`; an import is bounded only by its start date.
|
|
10
|
+
|
|
11
|
+
## Gmail quota, HTTP batch, and retry behavior
|
|
12
|
+
|
|
13
|
+
For Gmail, one list page is fetched with `messages.list`, followed by one `messages.get` per message. Mail groups up to 10 message gets into each HTTP `multipart/mixed` batch request. Batching reduces HTTP connections only: Google charges every embedded call separately, so `messages.get` still costs 20 quota units and `messages.list` costs 5. A 100-message page therefore costs about 2,005 units before incidental profile, label, history, or fallback metadata calls; it does not become a single quota unit. See [Gmail quota configuration](configuration-and-accounts.md#gmail-quota-configuration) for defaults and project overrides.
|
|
14
|
+
|
|
15
|
+
Google recommends keeping Gmail batches at or below 50 calls; Mail uses 10 to bound response size. A batch-level transport failure retries the page; an individual embedded error is preserved and surfaced. Quota pacing uses the per-user and per-project limits configured for the Gmail provider with 20% headroom. The defaults are 6,000 units/user/minute and 1,200,000 units/project/minute. Since pacing state is process-local, split those quota values among app processes sharing the same project or centralize sync work on one process.
|
|
16
|
+
|
|
17
|
+
HTTP 403 is not automatically a quota failure. `rateLimitExceeded` and `userRateLimitExceeded` (and HTTP 429) are retryable; authorization/permission 403 responses are not. Retryable sync errors honor `Retry-After` and use truncated exponential backoff with random jitter, capped at 64 seconds. After 12 consecutive scheduled retries, the run is marked failed for an operator to inspect and retry. A local quota override cannot change the quota granted by Google.
|
|
18
|
+
|
|
19
|
+
Official references: [Gmail API quotas and retry guidance](https://developers.google.com/workspace/gmail/api/reference/quota?hl=zh-cn) and [HTTP batch behavior and limits](https://developers.google.com/workspace/gmail/api/guides/batch?hl=zh-cn). [verified: 2026-09-26]
|
|
20
|
+
|
|
21
|
+
## Recovery and correctness
|
|
22
|
+
|
|
23
|
+
Mail captures a provider baseline before scanning history, then alternates history and incremental pages with separate persisted cursors. It serializes account writes and commits messages, checkpoints and the next outbox task together. The outbox relay submits background jobs; each job advances a bounded step. Application code should not enqueue independent sync jobs or write checkpoints directly.
|
|
24
|
+
|
|
25
|
+
Startup and periodic maintenance recover expired workers and published job deliveries without progress. Recovery uses task revisions and leases so old workers cannot advance newer state. Pending delayed retries retain their schedule. An idle-looking run is not evidence that a replacement run should be created; inspect its public progress and the jobs backend first.
|
|
26
|
+
|
|
27
|
+
A provider cursor error starts a fresh scan of the configured history range with a new baseline. Never set a failed cursor to “current” and report completion without scanning, because that loses unseen changes. Existing messages and local metadata remain available; history must not overwrite newer synchronized state or resurrect a message deleted during the scan. A rescan does not reconcile deletions that have already disappeared from provider history.
|
|
28
|
+
|
|
29
|
+
The owner can cancel an active run through `POST /api/mail/syncRuns/{syncRunId}/cancel` and retry a failed or cancelled run through `POST /api/mail/syncRuns/{syncRunId}/retry`. Keep retry and cancellation behind the service/API transitions rather than editing run status.
|
|
30
|
+
|
|
31
|
+
## Incomplete content
|
|
32
|
+
|
|
33
|
+
Keep visible records with `contentStatus: deferred` or `failed`. IMAP bounds encoded body input and retained decoded text to 2 MiB each per message during background synchronization (16 MiB for manual retries using bounded chunk requests), while retaining envelope and attachment metadata for deferred content. Attachments stream separately on demand; large attachments alone do not defer a small body. Parsing failures retain a durable message identity rather than blocking the whole mailbox.
|
|
34
|
+
|
|
35
|
+
The owner can load or retry content through the message detail action or `POST /api/mail/accounts/:accountId/messages/:messageId/retryContent`. This fetch is independent of the background size limit and can use memory proportional to the full message. Preserve current read/starred state, labels, notes and follow-up markers during a content retry.
|
|
36
|
+
|
|
37
|
+
Logs expose `recovering` and `historyComplete` to distinguish recovery from unfinished history import. A sync run can finish as `partial` when content remains unresolved. Its `pendingMessages` count describes the completion snapshot; loading content later does not rewrite historical log totals. Later synchronization refreshes those counts. Distinguish this from a `failed` batch caused by a network or authentication error.
|
|
38
|
+
|
|
39
|
+
## Diagnostic order
|
|
40
|
+
|
|
41
|
+
| Symptom | Check and response |
|
|
42
|
+
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| Mail capability absent | Client/Server registration, migrations and enabled provider configuration; inspectors cover composition only |
|
|
44
|
+
| Account cannot send or sync | Account status, provider availability and ownership; `reauthorizationRequired` requires reconnecting |
|
|
45
|
+
| Task remains pending | Application jobs service, Mail runtime, migration state and server logs; page refresh cannot execute queued work |
|
|
46
|
+
| Progress stops after restart | Lease/delivery recovery and pending retry schedule, using the same application database |
|
|
47
|
+
| History appears incomplete | Configured start date, ongoing history progress and incomplete-content records; do not introduce a total import cap |
|
|
48
|
+
| Gmail returns quota 403 | Check `rateLimitExceeded`/`userRateLimitExceeded`, real project quotas, batch subrequest count, and whether all app processes share one pacing budget |
|
|
49
|
+
| Cursor fails repeatedly | Provider authorization and cursor recovery; preserve the date-scoped rescan instead of skipping to now |
|
|
50
|
+
| IMAP external state differs | New-UID sync does not fully reconcile external flags, deletions or moves |
|
|
51
|
+
| Sent mail missing | Provider visibility and sent-copy mode; delivery outcome is authoritative for whether to resend |
|
|
52
|
+
|
|
53
|
+
Personal diagnostics require workspace permission and ownership. Cross-user operation history is available under admin permission as two paged lists, `GET /api/mail/settings/syncRuns` and `GET /api/mail/settings/submissions` (`page`, `pageSize` up to 100, `meta.total`); `GET /api/mail/settings/accounts` lists the accounts with API-safe metadata. It has no built-in settings page. Keep credential references, cursors, leases and internal provider errors out of application diagnostics.
|
|
54
|
+
|
|
55
|
+
## Verify this path
|
|
56
|
+
|
|
57
|
+
For synchronization integration, verify multiple history pages and a message arriving during history import, not merely one successful list request. For recovery changes, verify restart with retained progress, rejection of stale worker writes and invalid-cursor rescan without skipped changes. For incomplete-content UI, verify continued visibility, independent retry and metadata preservation. Confirm local NocoBase labels/notes survive resync. Run only the scenarios relevant to the requested change; provider and job executor mocks do not prove a deployment's live connectivity.
|