@bobfrankston/iflow-direct 0.1.77 → 0.1.78

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 (2) hide show
  1. package/README.md +33 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -118,8 +118,39 @@ would otherwise issue one SELECT+FETCH per message.
118
118
  `NativeImapClient` exposes the usual IMAP surface: `select`, `examine`,
119
119
  `listFolders`, `getStatus`, `search`, `fetchMessage`, `fetchSinceUid`,
120
120
  `fetchByDate` (both with optional `onChunk` chunked callbacks), `addFlags`,
121
- `removeFlags`, `copyMessage`, `moveMessage`, `deleteMessage`, `expunge`,
122
- `appendMessage`, `startIdle`, `logout`. See `imap-native.ts` for signatures.
121
+ `removeFlags`, `copyMessage`, `moveMessage`, `deleteMessage`, `deleteMessages`,
122
+ `expunge`, `appendMessage`, `getFolderSize`, `startIdle`, `logout`. See
123
+ `imap-native.ts` for signatures.
124
+
125
+ ### Folder size (2026-09-16)
126
+
127
+ `getFolderSize(mailbox)` returns `{ messages, bytes, method }`. When the server
128
+ advertises `STATUS=SIZE` (RFC 8438) it is one `STATUS (MESSAGES SIZE)` round
129
+ trip and `method` is `"status"`. Otherwise it EXAMINEs the folder and sums a
130
+ size-only `UID FETCH 1:* (UID RFC822.SIZE)` — no envelopes or headers — and
131
+ `method` is `"fetch"`. `getStatus(mailbox, items?)` takes an optional item list
132
+ for the same reason; the default is unchanged. `CompatImapClient.getFolderSize`
133
+ is the mailbox-scoped wrapper.
134
+
135
+ ### Bulk delete by criterion (2026-09-16)
136
+
137
+ Search, then delete the UIDs in one go. `CompatImapClient` does the SELECT /
138
+ CLOSE around each call:
139
+
140
+ ```ts
141
+ // Everything in Trash received before 2025-01-01
142
+ const uids = await client.searchMessages("Trash", { before: new Date("2025-01-01") });
143
+ await client.deleteMessagesByUid("Trash", uids);
144
+ ```
145
+
146
+ `searchMessages(mailbox, criteria)` accepts `from`/`to`/`cc`/`subject`/`body`/
147
+ `text` (string or string[]), `since`/`before` (Date — IMAP compares the
148
+ server's INTERNALDATE at day granularity; `before` is exclusive), the boolean
149
+ flags `seen`/`unseen`/`flagged`/`answered`/`draft`, plus `not` and `or` groups.
150
+ `deleteMessagesByUid(mailbox, uids)` issues one `UID STORE <set> +FLAGS.SILENT
151
+ (\Deleted)` per 1000-UID chunk and a single EXPUNGE, instead of a STORE and an
152
+ EXPUNGE round trip per message. Native equivalent: `deleteMessages(uids)` on a
153
+ selected mailbox.
123
154
 
124
155
  IDLE auto-suspends when any other command is issued on the same connection and
125
156
  re-enters afterwards — safe to interleave commands with a long-running IDLE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/iflow-direct",
3
- "version": "0.1.77",
3
+ "version": "0.1.78",
4
4
  "description": "Direct IMAP client — transport-agnostic, no Node.js dependencies, browser-ready",
5
5
  "main": "index.js",
6
6
  "types": "index.ts",