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.
- package/CHANGELOG.md +25 -0
- package/README.md +10 -0
- package/dist/cjs/commands/fetch.d.ts +2 -1
- package/dist/cjs/commands/fetch.js +8 -2
- package/dist/cjs/commands/idle.js +7 -0
- package/dist/cjs/commands/select.js +17 -6
- package/dist/cjs/commands/status.js +19 -5
- package/dist/cjs/download.js +3 -3
- package/dist/cjs/errors.d.ts +1 -0
- package/dist/cjs/errors.js +3 -1
- package/dist/cjs/imap-flow.d.ts +44 -2
- package/dist/cjs/imap-flow.js +93 -14
- package/dist/cjs/package-info.d.ts +1 -1
- package/dist/cjs/package-info.js +1 -1
- package/dist/cjs/types.d.ts +33 -3
- package/dist/esm/commands/fetch.d.ts +2 -1
- package/dist/esm/commands/fetch.js +8 -2
- package/dist/esm/commands/idle.js +7 -0
- package/dist/esm/commands/select.js +17 -6
- package/dist/esm/commands/status.js +19 -5
- package/dist/esm/download.js +3 -3
- package/dist/esm/errors.d.ts +1 -0
- package/dist/esm/errors.js +3 -1
- package/dist/esm/imap-flow.d.ts +44 -2
- package/dist/esm/imap-flow.js +93 -14
- package/dist/esm/package-info.d.ts +1 -1
- package/dist/esm/package-info.js +1 -1
- package/dist/esm/types.d.ts +33 -3
- package/package.json +1 -1
package/dist/esm/types.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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
|
-
/**
|
|
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];
|