@bobfrankston/mailx 1.0.169 → 1.0.172

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.
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Mail provider interface — abstraction over IMAP, Gmail API, and Microsoft Graph.
3
+ * Sync code uses this interface; never calls IMAP/REST directly.
4
+ */
5
+ export interface ProviderFolder {
6
+ path: string;
7
+ name: string;
8
+ delimiter: string;
9
+ specialUse: string;
10
+ flags: string[];
11
+ }
12
+ export interface ProviderMessage {
13
+ uid: number;
14
+ messageId: string;
15
+ providerId: string;
16
+ date: Date | null;
17
+ subject: string;
18
+ from: {
19
+ name?: string;
20
+ address?: string;
21
+ }[];
22
+ to: {
23
+ name?: string;
24
+ address?: string;
25
+ }[];
26
+ cc: {
27
+ name?: string;
28
+ address?: string;
29
+ }[];
30
+ seen: boolean;
31
+ flagged: boolean;
32
+ answered: boolean;
33
+ draft: boolean;
34
+ size: number;
35
+ source: string;
36
+ }
37
+ export interface FetchOptions {
38
+ source?: boolean;
39
+ }
40
+ /**
41
+ * A mail provider that can list folders, fetch messages, and perform actions.
42
+ * Implementations: ImapProvider (existing iflow), GmailApiProvider, GraphApiProvider.
43
+ */
44
+ export interface MailProvider {
45
+ /** List all folders/labels */
46
+ listFolders(): Promise<ProviderFolder[]>;
47
+ /** Fetch messages newer than sinceUid (incremental sync) */
48
+ fetchSince(folder: string, sinceUid: number, options?: FetchOptions): Promise<ProviderMessage[]>;
49
+ /** Fetch messages by date range (first sync) */
50
+ fetchByDate(folder: string, since: Date, before: Date, options?: FetchOptions, onChunk?: (msgs: ProviderMessage[]) => void): Promise<ProviderMessage[]>;
51
+ /** Fetch specific messages by UID */
52
+ fetchByUids(folder: string, uids: number[], options?: FetchOptions): Promise<ProviderMessage[]>;
53
+ /** Fetch a single message by UID */
54
+ fetchOne(folder: string, uid: number, options?: FetchOptions): Promise<ProviderMessage | null>;
55
+ /** Get all UIDs in a folder (for reconciliation) */
56
+ getUids(folder: string): Promise<number[]>;
57
+ /** Close/cleanup */
58
+ close(): Promise<void>;
59
+ }
60
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Mail provider interface — abstraction over IMAP, Gmail API, and Microsoft Graph.
3
+ * Sync code uses this interface; never calls IMAP/REST directly.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=types.js.map
@@ -42,6 +42,7 @@ declare const DEFAULT_PREFERENCES: {
42
42
  sync: {
43
43
  intervalMinutes: number;
44
44
  historyDays: number;
45
+ prefetch: boolean;
45
46
  };
46
47
  autocomplete: {
47
48
  enabled: boolean;
@@ -99,5 +100,7 @@ export declare function initCloudConfig(provider?: "gdrive"): Promise<void>;
99
100
  declare const DEFAULT_SETTINGS: MailxSettings;
100
101
  /** Get historyDays for an account: per-account override > system override > shared default */
101
102
  export declare function getHistoryDays(accountId?: string): number;
103
+ /** Get prefetch setting: download bodies during sync (default true) */
104
+ export declare function getPrefetch(): boolean;
102
105
  export { DEFAULT_SETTINGS, DEFAULT_ALLOWLIST, DEFAULT_PREFERENCES, DEFAULT_AUTOCOMPLETE, LOCAL_DIR };
103
106
  //# sourceMappingURL=index.d.ts.map
@@ -338,6 +338,7 @@ const DEFAULT_PREFERENCES = {
338
338
  sync: {
339
339
  intervalMinutes: 5,
340
340
  historyDays: 30,
341
+ prefetch: true,
341
342
  },
342
343
  autocomplete: {
343
344
  enabled: false,
@@ -633,5 +634,10 @@ export function getHistoryDays(accountId) {
633
634
  const prefs = loadPreferences();
634
635
  return prefs.sync.historyDays || 0;
635
636
  }
637
+ /** Get prefetch setting: download bodies during sync (default true) */
638
+ export function getPrefetch() {
639
+ const prefs = loadPreferences();
640
+ return prefs.sync.prefetch !== false;
641
+ }
636
642
  export { DEFAULT_SETTINGS, DEFAULT_ALLOWLIST, DEFAULT_PREFERENCES, DEFAULT_AUTOCOMPLETE, LOCAL_DIR };
637
643
  //# sourceMappingURL=index.js.map
@@ -191,6 +191,7 @@ export interface MailxSettings {
191
191
  sync: {
192
192
  intervalMinutes: number;
193
193
  historyDays: number; /** 0 = all history */
194
+ prefetch: boolean; /** Download message bodies during sync (default true) */
194
195
  };
195
196
  store: {
196
197
  basePath: string; /** Where message bodies are stored */