UNPKG

gmail-reader

Version:

A Gmail reader package for Google Workspace accounts with domain-wide delegation support

61 lines (60 loc) 1.2 kB
/** * Email interface representing an email message */ export interface Email { id: string; threadId?: string; subject: string; from: string; to: string; date: string; snippet: string; body?: { plain?: string; html?: string; }; attachments?: EmailAttachment[]; labels?: string[]; } /** * Email attachment interface */ export interface EmailAttachment { attachmentId: string; filename: string; mimeType: string; size: number; } /** * Gmail client configuration interface */ export interface GmailClientConfig { clientId: string; clientSecret: string; redirectUri?: string; } /** * Options for fetching emails */ export interface EmailQueryOptions { maxResults?: number; labelIds?: string[]; includeSpamTrash?: boolean; q?: string; pageToken?: string; } /** * Options for reading a specific email */ export interface EmailReadOptions { format?: 'full' | 'metadata' | 'minimal' | 'raw'; metadataHeaders?: string[]; } /** * Response for listing emails */ export interface EmailListResponse { emails: Email[]; nextPageToken?: string; resultSizeEstimate?: number; }