imapflow 2.2.8 → 2.2.9

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.9](https://github.com/postalsys/imapflow/compare/v2.2.8...v2.2.9) (2026-10-07)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * declare DownloadOptions.binary, the QRESYNC mailboxOpen options and FetchQueryObject.emailId ([2ae26e6](https://github.com/postalsys/imapflow/commit/2ae26e64c39c83ac3e04a67e9d4d808a1258c55b))
9
+
3
10
  ## [2.2.8](https://github.com/postalsys/imapflow/compare/v2.2.7...v2.2.8) (2026-10-07)
4
11
 
5
12
 
@@ -1,24 +1,13 @@
1
1
  import type { ImapFlow } from '../imap-flow.js';
2
2
  import type { MailboxObject, MailboxOpenOptions } from '../types.js';
3
- /**
4
- * Options for SELECT/EXAMINE: the public open options plus the QRESYNC resynchronization
5
- * parameters, which are only honored when the QRESYNC extension has been enabled
6
- */
7
- export interface SelectOptions extends MailboxOpenOptions {
8
- /** QRESYNC modseq value to fetch changes since */
9
- changedSince?: bigint | number | string | undefined;
10
- /** QRESYNC UID validity value */
11
- uidValidity?: bigint | number | string | undefined;
12
- }
3
+ /** SELECT/EXAMINE options, the QRESYNC parameters are part of the public mailboxOpen() options */
4
+ export type SelectOptions = MailboxOpenOptions;
13
5
  /**
14
6
  * Selects or examines a mailbox, making it the current mailbox for subsequent operations.
15
7
  *
16
8
  * @param connection - IMAP connection instance
17
9
  * @param path - Mailbox path to select
18
- * @param options - Select options
19
- * @param options.readOnly - If true, use EXAMINE instead of SELECT (read-only access)
20
- * @param options.changedSince - QRESYNC modseq value to fetch changes since
21
- * @param options.uidValidity - QRESYNC UID validity value
10
+ * @param options - Select options, see MailboxOpenOptions
22
11
  * @returns Mailbox info object with path, flags, exists, uidNext, uidValidity, highestModseq, etc., or undefined if preconditions not met
23
12
  * @throws If the SELECT/EXAMINE command fails
24
13
  */
@@ -51,10 +51,7 @@ const VALUED_RESPONSE_CODES = Object.assign(Object.create(null), {
51
51
  *
52
52
  * @param connection - IMAP connection instance
53
53
  * @param path - Mailbox path to select
54
- * @param options - Select options
55
- * @param options.readOnly - If true, use EXAMINE instead of SELECT (read-only access)
56
- * @param options.changedSince - QRESYNC modseq value to fetch changes since
57
- * @param options.uidValidity - QRESYNC UID validity value
54
+ * @param options - Select options, see MailboxOpenOptions
58
55
  * @returns Mailbox info object with path, flags, exists, uidNext, uidValidity, highestModseq, etc., or undefined if preconditions not met
59
56
  * @throws If the SELECT/EXAMINE command fails
60
57
  */
@@ -1,3 +1,3 @@
1
1
  export declare const name = "imapflow";
2
- export declare const version = "2.2.8";
2
+ export declare const version = "2.2.9";
3
3
  export declare const homepage = "https://imapflow.com/";
@@ -3,5 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.homepage = exports.version = exports.name = void 0;
5
5
  exports.name = "imapflow";
6
- exports.version = "2.2.8";
6
+ exports.version = "2.2.9";
7
7
  exports.homepage = "https://imapflow.com/";
@@ -499,6 +499,8 @@ export interface FetchQueryObject {
499
499
  /** Include full message in the response, up to maxLength bytes */
500
500
  maxLength?: number | undefined;
501
501
  } | undefined;
502
+ /** Email ID (OBJECTID EMAILID or Gmail X-GM-MSGID) is always requested when the server supports either extension, so this is accepted but changes nothing */
503
+ emailId?: boolean | undefined;
502
504
  /** If true then include thread ID in the response (only if server supports either OBJECTID or X-GM-EXT-1 extensions) */
503
505
  threadId?: boolean | undefined;
504
506
  /** If true then include GMail labels in the response (only if server supports X-GM-EXT-1 extension) */
@@ -653,9 +655,11 @@ export interface DownloadOptions {
653
655
  maxBytes?: number | undefined;
654
656
  /** How large content parts to ask from the server. Defaults to 65536 */
655
657
  chunkSize?: number | undefined;
658
+ /** If true then requests the content with FETCH BINARY when the server supports it (BINARY or IMAP4rev2), so the server removes the transfer encoding */
659
+ binary?: boolean | undefined;
656
660
  }
657
661
  /** Options for downloadMany(): the download() options without `chunkSize`, as the parts come in one FETCH */
658
- export type DownloadManyOptions = Pick<DownloadOptions, 'uid' | 'maxBytes'>;
662
+ export type DownloadManyOptions = Pick<DownloadOptions, 'uid' | 'maxBytes' | 'binary'>;
659
663
  export interface DownloadManyPart {
660
664
  meta: DownloadMeta;
661
665
  content?: Buffer | null | undefined;
@@ -706,6 +710,10 @@ export interface MailboxOpenOptions {
706
710
  readOnly?: boolean | undefined;
707
711
  /** Optional description for mailbox lock tracking */
708
712
  description?: string | undefined;
713
+ /** QRESYNC (RFC 7162): HIGHESTMODSEQ from an earlier session. With `uidValidity` and QRESYNC enabled, changes since then are reported as `flags` and `expunge` events. getMailboxLock() only applies it when it selects the mailbox, not when the mailbox is already open */
714
+ changedSince?: bigint | number | string | undefined;
715
+ /** QRESYNC (RFC 7162): the UIDVALIDITY known from the previous session, required with `changedSince` */
716
+ uidValidity?: bigint | number | string | undefined;
709
717
  }
710
718
  export interface MailboxLockOptions extends MailboxOpenOptions {
711
719
  /**
@@ -1,24 +1,13 @@
1
1
  import type { ImapFlow } from '../imap-flow.js';
2
2
  import type { MailboxObject, MailboxOpenOptions } from '../types.js';
3
- /**
4
- * Options for SELECT/EXAMINE: the public open options plus the QRESYNC resynchronization
5
- * parameters, which are only honored when the QRESYNC extension has been enabled
6
- */
7
- export interface SelectOptions extends MailboxOpenOptions {
8
- /** QRESYNC modseq value to fetch changes since */
9
- changedSince?: bigint | number | string | undefined;
10
- /** QRESYNC UID validity value */
11
- uidValidity?: bigint | number | string | undefined;
12
- }
3
+ /** SELECT/EXAMINE options, the QRESYNC parameters are part of the public mailboxOpen() options */
4
+ export type SelectOptions = MailboxOpenOptions;
13
5
  /**
14
6
  * Selects or examines a mailbox, making it the current mailbox for subsequent operations.
15
7
  *
16
8
  * @param connection - IMAP connection instance
17
9
  * @param path - Mailbox path to select
18
- * @param options - Select options
19
- * @param options.readOnly - If true, use EXAMINE instead of SELECT (read-only access)
20
- * @param options.changedSince - QRESYNC modseq value to fetch changes since
21
- * @param options.uidValidity - QRESYNC UID validity value
10
+ * @param options - Select options, see MailboxOpenOptions
22
11
  * @returns Mailbox info object with path, flags, exists, uidNext, uidValidity, highestModseq, etc., or undefined if preconditions not met
23
12
  * @throws If the SELECT/EXAMINE command fails
24
13
  */
@@ -48,10 +48,7 @@ const VALUED_RESPONSE_CODES = Object.assign(Object.create(null), {
48
48
  *
49
49
  * @param connection - IMAP connection instance
50
50
  * @param path - Mailbox path to select
51
- * @param options - Select options
52
- * @param options.readOnly - If true, use EXAMINE instead of SELECT (read-only access)
53
- * @param options.changedSince - QRESYNC modseq value to fetch changes since
54
- * @param options.uidValidity - QRESYNC UID validity value
51
+ * @param options - Select options, see MailboxOpenOptions
55
52
  * @returns Mailbox info object with path, flags, exists, uidNext, uidValidity, highestModseq, etc., or undefined if preconditions not met
56
53
  * @throws If the SELECT/EXAMINE command fails
57
54
  */
@@ -1,3 +1,3 @@
1
1
  export declare const name = "imapflow";
2
- export declare const version = "2.2.8";
2
+ export declare const version = "2.2.9";
3
3
  export declare const homepage = "https://imapflow.com/";
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build.js from package.json. Do not edit by hand.
2
2
  export const name = "imapflow";
3
- export const version = "2.2.8";
3
+ export const version = "2.2.9";
4
4
  export const homepage = "https://imapflow.com/";
@@ -499,6 +499,8 @@ export interface FetchQueryObject {
499
499
  /** Include full message in the response, up to maxLength bytes */
500
500
  maxLength?: number | undefined;
501
501
  } | undefined;
502
+ /** Email ID (OBJECTID EMAILID or Gmail X-GM-MSGID) is always requested when the server supports either extension, so this is accepted but changes nothing */
503
+ emailId?: boolean | undefined;
502
504
  /** If true then include thread ID in the response (only if server supports either OBJECTID or X-GM-EXT-1 extensions) */
503
505
  threadId?: boolean | undefined;
504
506
  /** If true then include GMail labels in the response (only if server supports X-GM-EXT-1 extension) */
@@ -653,9 +655,11 @@ export interface DownloadOptions {
653
655
  maxBytes?: number | undefined;
654
656
  /** How large content parts to ask from the server. Defaults to 65536 */
655
657
  chunkSize?: number | undefined;
658
+ /** If true then requests the content with FETCH BINARY when the server supports it (BINARY or IMAP4rev2), so the server removes the transfer encoding */
659
+ binary?: boolean | undefined;
656
660
  }
657
661
  /** Options for downloadMany(): the download() options without `chunkSize`, as the parts come in one FETCH */
658
- export type DownloadManyOptions = Pick<DownloadOptions, 'uid' | 'maxBytes'>;
662
+ export type DownloadManyOptions = Pick<DownloadOptions, 'uid' | 'maxBytes' | 'binary'>;
659
663
  export interface DownloadManyPart {
660
664
  meta: DownloadMeta;
661
665
  content?: Buffer | null | undefined;
@@ -706,6 +710,10 @@ export interface MailboxOpenOptions {
706
710
  readOnly?: boolean | undefined;
707
711
  /** Optional description for mailbox lock tracking */
708
712
  description?: string | undefined;
713
+ /** QRESYNC (RFC 7162): HIGHESTMODSEQ from an earlier session. With `uidValidity` and QRESYNC enabled, changes since then are reported as `flags` and `expunge` events. getMailboxLock() only applies it when it selects the mailbox, not when the mailbox is already open */
714
+ changedSince?: bigint | number | string | undefined;
715
+ /** QRESYNC (RFC 7162): the UIDVALIDITY known from the previous session, required with `changedSince` */
716
+ uidValidity?: bigint | number | string | undefined;
709
717
  }
710
718
  export interface MailboxLockOptions extends MailboxOpenOptions {
711
719
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "2.2.8",
3
+ "version": "2.2.9",
4
4
  "description": "IMAP Client for Node",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/imap-flow.js",