@bobfrankston/mailx-imap 0.1.186 → 0.1.189

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.
Files changed (3) hide show
  1. package/index.d.ts +4 -1
  2. package/index.js +5 -2
  3. package/package.json +11 -11
package/index.d.ts CHANGED
@@ -179,7 +179,10 @@ export declare class ImapManager extends EventEmitter {
179
179
  * removal stays with the caller (it knows the folderId). */
180
180
  deleteFolderViaServer(accountId: string, path: string): Promise<void>;
181
181
  /** Expunge every message in `path` on the server. */
182
- emptyFolderViaServer(accountId: string, path: string): Promise<void>;
182
+ /** Returns how many messages the server reported (and were flagged +
183
+ * expunged). 2026-09-16 — Claude Code (Fable 5.1): was one STORE+EXPUNGE
184
+ * round trip PER UID; now one bulk delete (chunked STORE, single EXPUNGE). */
185
+ emptyFolderViaServer(accountId: string, path: string): Promise<number>;
183
186
  /** Move a folder into Trash by IMAP RENAME, falling back to spilling its
184
187
  * messages into Trash root + deleting the empty folder when the server
185
188
  * forbids nesting under Trash. Self-contained on the worker. */
package/index.js CHANGED
@@ -646,12 +646,15 @@ export class ImapManager extends EventEmitter {
646
646
  }
647
647
  }
648
648
  /** Expunge every message in `path` on the server. */
649
+ /** Returns how many messages the server reported (and were flagged +
650
+ * expunged). 2026-09-16 — Claude Code (Fable 5.1): was one STORE+EXPUNGE
651
+ * round trip PER UID; now one bulk delete (chunked STORE, single EXPUNGE). */
649
652
  async emptyFolderViaServer(accountId, path) {
650
653
  const client = await this.createPublicClient(accountId);
651
654
  try {
652
655
  const uids = await client.getUids(path);
653
- for (const uid of uids)
654
- await client.deleteMessageByUid(path, uid);
656
+ await client.deleteMessagesByUid(path, uids);
657
+ return uids.length;
655
658
  }
656
659
  finally {
657
660
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-imap",
3
- "version": "0.1.186",
3
+ "version": "0.1.189",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -9,13 +9,13 @@
9
9
  },
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
- "@bobfrankston/mailx-types": "^0.1.100",
13
- "@bobfrankston/mailx-settings": "^0.1.92",
14
- "@bobfrankston/mailx-store": "^0.1.126",
15
- "@bobfrankston/iflow-direct": "^0.1.68",
12
+ "@bobfrankston/mailx-types": "^0.1.102",
13
+ "@bobfrankston/mailx-settings": "^0.1.95",
14
+ "@bobfrankston/mailx-store": "^0.1.128",
15
+ "@bobfrankston/iflow-direct": "^0.1.74",
16
16
  "@bobfrankston/tcp-transport": "^0.1.8",
17
17
  "@bobfrankston/smtp-direct": "^0.1.9",
18
- "@bobfrankston/mailx-sync": "^0.1.29",
18
+ "@bobfrankston/mailx-sync": "^0.1.31",
19
19
  "@bobfrankston/oauthsupport": "^1.0.35"
20
20
  },
21
21
  "repository": {
@@ -37,13 +37,13 @@
37
37
  },
38
38
  ".transformedSnapshot": {
39
39
  "dependencies": {
40
- "@bobfrankston/mailx-types": "^0.1.100",
41
- "@bobfrankston/mailx-settings": "^0.1.92",
42
- "@bobfrankston/mailx-store": "^0.1.126",
43
- "@bobfrankston/iflow-direct": "^0.1.68",
40
+ "@bobfrankston/mailx-types": "^0.1.102",
41
+ "@bobfrankston/mailx-settings": "^0.1.95",
42
+ "@bobfrankston/mailx-store": "^0.1.128",
43
+ "@bobfrankston/iflow-direct": "^0.1.74",
44
44
  "@bobfrankston/tcp-transport": "^0.1.8",
45
45
  "@bobfrankston/smtp-direct": "^0.1.9",
46
- "@bobfrankston/mailx-sync": "^0.1.29",
46
+ "@bobfrankston/mailx-sync": "^0.1.31",
47
47
  "@bobfrankston/oauthsupport": "^1.0.35"
48
48
  }
49
49
  }