/** * In-Memory Email Metadata Store * * Implements IEmailMetadataStore with in-memory storage for email metadata. * Provides filtering, sorting, pagination, read tracking, and full-text search. * * @see Requirement 13.1 - Inbox query for To, Cc, or Bcc recipients * @see Requirement 13.2 - Sort by Date header (newest first by default) * @see Requirement 13.3 - Filter by read/unread, sender, date range, etc. * @see Requirement 13.4 - Full-text search across subject and body * @see Requirement 13.6 - Pagination with configurable page size * @see Requirement 13.7 - Sort by date, sender, subject, size * @see Requirement 13.8 - Track and return unread count */ import type { IEmailMetadata } from '../../interfaces/messaging/emailMetadata'; import type { IEmailMetadataStore, IInboxQuery, IInboxResult } from './emailMessageService'; export declare class InMemoryEmailMetadataStore implements IEmailMetadataStore { private readonly emails; /** Set of "messageId::userId" keys for read tracking */ private readonly readSet; /** Attachment content keyed by checksum */ private readonly attachmentContents; /** Maps userId (memberId GUID) → email address for inbox lookups */ private readonly userEmailMap; /** * Register a mapping from userId (memberId GUID) to email address. * This allows inbox queries by memberId to resolve to the correct email. */ registerUserEmail(userId: string, email: string): void; /** * Resolve a userId to an email address. * If the userId is already an email (contains @), returns it as-is. * Otherwise looks up the userEmailMap for a memberId → email mapping. */ private resolveUserEmail; store(metadata: IEmailMetadata): Promise; get(messageId: string): Promise; delete(messageId: string): Promise; update(messageId: string, updates: Partial): Promise; /** * Query emails for a user's inbox. * * Returns emails where the user (identified by email address) is a * To, Cc, or Bcc recipient. Supports filtering, sorting, and pagination. * * @see Requirement 13.1 - Inbox query for To, Cc, or Bcc recipients */ queryInbox(userId: string, query: IInboxQuery): Promise; getUnreadCount(userId: string): Promise; markAsRead(messageId: string, userId: string): Promise; getThread(messageId: string): Promise; getRootMessage(messageId: string): Promise; private readKey; /** * Check if userId (email address) is a To, Cc, or Bcc recipient. */ private isRecipient; private applyFilters; /** * Full-text search: checks subject and body content (text parts). * @see Requirement 13.4 */ private matchesSearch; private partContainsText; private sortEmails; /** Check if a user has read a specific email */ isRead(messageId: string, userId: string): boolean; /** Get total stored email count (for testing) */ get count(): number; storeAttachmentContent(key: string, content: Uint8Array): Promise; getAttachmentContent(key: string): Promise; } //# sourceMappingURL=inMemoryEmailMetadataStore.d.ts.map