import { EmailAccountOptions, MessageSenderInterface, SyncOptions, SyncResult } from '../types'; import { Account } from './Account'; export declare class EmailAccount extends Account { email: string; syncIntervalMinutes: number; constructor(options?: EmailAccountOptions); /** * Options for child rows (folders/emails) created during sync: carries the DB * connection + tenant context from this account, but strips this account's own * identity fields. When this account was hydrated from the DB, `this.options` * holds the account row's `id`/`slug`/`_skipLoad`; spreading those into a new * child would make every synced row inherit the account's primary key and * upsert over each other. */ private childOptions; /** * Create a sender for this email account */ createSender(): Promise; /** * Create an EmailClient from stored settings * Retrieves credentials from smrt-secrets if credentialSecretId is set * * The client factory comes from the messaging provider registry rather than * a direct `@happyvertical/email` import so the email SDK * (googleapis/nodemailer) never becomes reachable from provider-neutral * consumer bundles (#1979). Server code that uses email accounts must * import '@happyvertical/smrt-messages/providers/email' (or * '/providers/all') once during startup. */ createClient(): Promise; /** * Sync emails from the email server to the database */ syncFrom(options?: SyncOptions): Promise; /** * Get all folders for this account */ getFolders(): Promise; /** * Get all emails for this account */ getEmails(limit?: number): Promise; /** * Get unread email count */ getUnreadCount(): Promise; /** * Store credentials securely using smrt-secrets (email-specific) */ setCredentials(credentials: Record, options?: { description?: string; category?: string; }): Promise; /** * Sync all active email accounts (for job runner) * * NOTE: This is a class-wide operation, not per-instance. It syncs ALL active * accounts, ignoring `this` instance. It exists as an instance method because * the TaskRunner dispatches via `objectType: 'EmailAccount', method: 'syncAll'` * which requires an instance method signature. */ syncAll(args?: Record): Promise>; /** * Migrate from plain-text settings to secrets */ migrateToSecrets(): Promise; } //# sourceMappingURL=EmailAccount.d.ts.map