imapflow 2.5.9 → 2.7.0

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.
@@ -76,8 +76,13 @@ export interface ImapFlowOptions {
76
76
  emitLogs?: boolean | undefined;
77
77
  /** If true, then logs out automatically after successful authentication */
78
78
  verifyOnly?: boolean | undefined;
79
- /** If true and verifyOnly is set, lists mailboxes */
79
+ /** If true and verifyOnly is set, lists mailboxes. The listing is in `client.mailboxList` once `connect()` resolved */
80
80
  includeMailboxes?: boolean | undefined;
81
+ /**
82
+ * Data of the application's own to keep with the client, such as the account the connection
83
+ * belongs to. ImapFlow never reads it, it is the initial value of `client.context`
84
+ */
85
+ context?: unknown;
81
86
  /**
82
87
  * Proxy URL. Supports HTTP CONNECT (http:, https:) and SOCKS (socks:, socks4:, socks4a:,
83
88
  * socks5:) proxies. IPv6 proxy endpoints are given in URL form, e.g. `socks5://[2001:db8::1]:1080`.
@@ -789,6 +794,22 @@ export interface ExistsEvent {
789
794
  /** Message count before this update */
790
795
  prevCount: number;
791
796
  }
797
+ /**
798
+ * Payload of the `highestModseq` event: the HIGHESTMODSEQ of the selected mailbox changed (RFC
799
+ * 7162), so flags or other message metadata changed on the server. Emitted when a poll on a
800
+ * server without IDLE (`missingIdleCommand` STATUS or SELECT) or a STATUS or re-SELECT of the
801
+ * open mailbox reports a new value, which is when the changes themselves are not delivered as
802
+ * `flags` events. A consumer resynchronizes with `fetch(range, { flags: true }, { changedSince:
803
+ * prevHighestModseq })`.
804
+ */
805
+ export interface HighestModseqEvent {
806
+ /** Mailbox path */
807
+ path: string;
808
+ /** The new HIGHESTMODSEQ value */
809
+ highestModseq: bigint;
810
+ /** The value before this update, undefined when none was known */
811
+ prevHighestModseq?: bigint | undefined;
812
+ }
792
813
  export interface FlagsEvent {
793
814
  /** Mailbox path */
794
815
  path: string;
@@ -888,7 +909,10 @@ export interface TlsInfo extends CipherNameAndProtocol {
888
909
  export interface ImapFlowEvents {
889
910
  /** Connection close event */
890
911
  close: [];
891
- /** Error event */
912
+ /**
913
+ * Error event. Emitted at most once per connection, the connection closes after it. An error
914
+ * while `connect()` is pending rejects `connect()` instead and is not emitted
915
+ */
892
916
  error: [error: Error];
893
917
  /** Message count in currently opened mailbox changed */
894
918
  exists: [data: ExistsEvent];
@@ -896,7 +920,13 @@ export interface ImapFlowEvents {
896
920
  expunge: [data: ExpungeEvent];
897
921
  /** Flags were updated for a message */
898
922
  flags: [data: FlagsEvent];
899
- /** Mailbox was opened */
923
+ /** The HIGHESTMODSEQ of the selected mailbox changed without the changes being reported, see {@link HighestModseqEvent} */
924
+ highestModseq: [data: HighestModseqEvent];
925
+ /**
926
+ * Mailbox was opened. Also emitted, after `mailboxClose` for the old mailbox object, when the
927
+ * open mailbox turned out to have a new UIDVALIDITY (a re-SELECT, or a STATUS poll on a server
928
+ * without IDLE, which then selects the mailbox again): every cached UID of it is invalid
929
+ */
900
930
  mailboxOpen: [mailbox: MailboxObject];
901
931
  /** Mailbox was closed, either explicitly or because the connection went away while a mailbox was still selected */
902
932
  mailboxClose: [mailbox: MailboxObject];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "2.5.9",
3
+ "version": "2.7.0",
4
4
  "description": "IMAP Client for Node",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/imap-flow.js",