imapflow 2.0.7 → 2.0.8
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 +9 -0
- package/dist/cjs/commands/append.js +12 -12
- package/dist/cjs/commands/authenticate.d.ts +3 -8
- package/dist/cjs/commands/close.js +2 -1
- package/dist/cjs/commands/copy.js +4 -4
- package/dist/cjs/commands/create.js +2 -3
- package/dist/cjs/commands/delete.js +4 -4
- package/dist/cjs/commands/expunge.js +8 -5
- package/dist/cjs/commands/fetch.js +12 -10
- package/dist/cjs/commands/idle.js +6 -2
- package/dist/cjs/commands/list.js +2 -2
- package/dist/cjs/commands/move.js +11 -6
- package/dist/cjs/commands/namespace.js +1 -1
- package/dist/cjs/commands/quota.js +10 -9
- package/dist/cjs/commands/rename.js +4 -4
- package/dist/cjs/commands/search.js +7 -8
- package/dist/cjs/commands/select.js +5 -6
- package/dist/cjs/commands/status.js +11 -11
- package/dist/cjs/commands/store.js +5 -5
- package/dist/cjs/commands/subscribe.js +2 -17
- package/dist/cjs/commands/subscription.d.ts +10 -0
- package/dist/cjs/commands/subscription.js +29 -0
- package/dist/cjs/commands/unsubscribe.js +2 -17
- package/dist/cjs/download.d.ts +22 -0
- package/dist/cjs/download.js +588 -0
- package/dist/cjs/errors.d.ts +2 -0
- package/dist/cjs/handler/imap-compiler.js +1 -1
- package/dist/cjs/handler/imap-stream.js +4 -4
- package/dist/cjs/handler/parser-instance.js +2 -2
- package/dist/cjs/handler/token-parser.js +1 -1
- package/dist/cjs/imap-flow.d.ts +16 -7
- package/dist/cjs/imap-flow.js +247 -730
- package/dist/cjs/jp-decoder.js +1 -1
- package/dist/cjs/package-info.d.ts +1 -1
- package/dist/cjs/package-info.js +3 -3
- package/dist/cjs/search-compiler.js +5 -12
- package/dist/cjs/tools.d.ts +51 -10
- package/dist/cjs/tools.js +77 -15
- package/dist/cjs/types.d.ts +30 -16
- package/dist/esm/commands/append.js +13 -13
- package/dist/esm/commands/authenticate.d.ts +3 -8
- package/dist/esm/commands/close.js +2 -1
- package/dist/esm/commands/copy.js +5 -5
- package/dist/esm/commands/create.js +3 -4
- package/dist/esm/commands/delete.js +5 -5
- package/dist/esm/commands/expunge.js +9 -6
- package/dist/esm/commands/fetch.js +13 -11
- package/dist/esm/commands/idle.js +7 -3
- package/dist/esm/commands/list.js +2 -2
- package/dist/esm/commands/move.js +12 -7
- package/dist/esm/commands/namespace.js +2 -2
- package/dist/esm/commands/quota.js +11 -10
- package/dist/esm/commands/rename.js +5 -5
- package/dist/esm/commands/search.js +8 -9
- package/dist/esm/commands/select.js +6 -7
- package/dist/esm/commands/status.js +12 -12
- package/dist/esm/commands/store.js +6 -6
- package/dist/esm/commands/subscribe.js +2 -17
- package/dist/esm/commands/subscription.d.ts +10 -0
- package/dist/esm/commands/subscription.js +26 -0
- package/dist/esm/commands/unsubscribe.js +2 -17
- package/dist/esm/download.d.ts +22 -0
- package/dist/esm/download.js +581 -0
- package/dist/esm/errors.d.ts +2 -0
- package/dist/esm/handler/imap-compiler.js +1 -1
- package/dist/esm/handler/imap-stream.js +4 -4
- package/dist/esm/handler/parser-instance.js +2 -2
- package/dist/esm/handler/token-parser.js +1 -1
- package/dist/esm/imap-flow.d.ts +16 -7
- package/dist/esm/imap-flow.js +248 -731
- package/dist/esm/jp-decoder.js +1 -1
- package/dist/esm/package-info.d.ts +1 -1
- package/dist/esm/package-info.js +3 -3
- package/dist/esm/search-compiler.js +5 -12
- package/dist/esm/tools.d.ts +51 -10
- package/dist/esm/tools.js +72 -15
- package/dist/esm/types.d.ts +30 -16
- package/package.json +4 -4
package/dist/esm/imap-flow.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import net from 'node:net';
|
|
|
6
6
|
import { EventEmitter } from 'node:events';
|
|
7
7
|
import { PassThrough, type Readable } from 'node:stream';
|
|
8
8
|
import { AuthenticationFailure } from './errors.js';
|
|
9
|
-
import type { AppendResponseObject, CopyResponseObject, DownloadManyOptions, DownloadManyResult, DownloadObject, DownloadOptions, ESearchResult, FetchMessageObject, FetchOptions, FetchQueryObject, IdInfoObject, ImapFlowEvents, ImapFlowOptions, InternalLogger, ListOptions, ListResponse, ListTreeResponse, MailboxCreateResponse, MailboxDeleteResponse, MailboxLockObject, MailboxLockOptions, MailboxObject, MailboxOpenOptions, MailboxRenameResponse, MessageRange, MessageRangeOptions, NamespaceObject, NamespacesObject, QuotaResponse, SearchObject, SearchOptions, SearchReturnOption, SequenceString, StatusObject, StatusQuery, StoreOptions, TlsInfo } from './types.js';
|
|
9
|
+
import type { AppendResponseObject, CopyResponseObject, DownloadManyOptions, DownloadManyResult, DownloadObject, DownloadNotFound, DownloadOptions, ESearchResult, FetchMessageObject, FetchOptions, FetchQueryObject, IdInfoObject, ImapFlowEvents, ImapFlowOptions, InternalLogger, ListOptions, ListResponse, ListTreeResponse, MailboxCreateResponse, MailboxDeleteResponse, MailboxLockObject, MailboxLockOptions, MailboxObject, MailboxOpenOptions, MailboxRenameResponse, MessageRange, MessageRangeOptions, NamespaceObject, NamespacesObject, QuotaResponse, SearchObject, SearchOptions, SearchReturnOption, SequenceString, StatusObject, StatusQuery, StoreOptions, TlsInfo } from './types.js';
|
|
10
10
|
export type * from './types.js';
|
|
11
11
|
export type { ImapFlowError } from './errors.js';
|
|
12
12
|
export { AuthenticationFailure } from './errors.js';
|
|
@@ -135,6 +135,9 @@ export declare class ImapFlow extends EventEmitter {
|
|
|
135
135
|
byeReason: string | undefined;
|
|
136
136
|
/** Negotiated TLS session details, `false` for a cleartext connection */
|
|
137
137
|
tls: TlsInfo | false | undefined;
|
|
138
|
+
/**
|
|
139
|
+
* Creates a client for one IMAP connection. Nothing is sent before `connect()` is called
|
|
140
|
+
*/
|
|
138
141
|
constructor(options?: ImapFlowOptions | undefined);
|
|
139
142
|
/**
|
|
140
143
|
* Returns byte counters for the current connection.
|
|
@@ -315,20 +318,20 @@ export declare class ImapFlow extends EventEmitter {
|
|
|
315
318
|
*
|
|
316
319
|
* @param path mailbox path to check for (unicode string). If value is an array then it is joined using current delimiter symbols. Namespace prefix is added automatically if required.
|
|
317
320
|
* @param query defines requested status items
|
|
318
|
-
* @returns status of the indicated mailbox
|
|
321
|
+
* @returns status of the indicated mailbox, or `false` if the server rejected the request
|
|
319
322
|
*
|
|
320
323
|
* @example
|
|
321
324
|
* let status = await client.status('INBOX', {unseen: true});
|
|
322
325
|
* console.log(status.unseen);
|
|
323
326
|
* // 123
|
|
324
327
|
*/
|
|
325
|
-
status(path: string | string[], query: StatusQuery): Promise<StatusObject>;
|
|
328
|
+
status(path: string | string[], query: StatusQuery): Promise<StatusObject | false>;
|
|
326
329
|
/**
|
|
327
330
|
* Starts listening for new or deleted messages from the currently opened mailbox. Only required if `disableAutoIdle` is set to `true`
|
|
328
331
|
* otherwise IDLE is started by default on connection inactivity. NB! If `idle()` is called manually then it does not
|
|
329
332
|
* return until IDLE is finished which means you would have to call some other command out of scope.
|
|
330
333
|
*
|
|
331
|
-
* @returns
|
|
334
|
+
* @returns `false` if IDLE failed, `undefined` otherwise
|
|
332
335
|
*
|
|
333
336
|
* @example
|
|
334
337
|
* let mailbox = await client.mailboxOpen('INBOX');
|
|
@@ -470,6 +473,10 @@ export declare class ImapFlow extends EventEmitter {
|
|
|
470
473
|
* ]});
|
|
471
474
|
*/
|
|
472
475
|
search(query: SearchObject, options?: MessageRangeOptions | undefined): Promise<number[] | false | undefined>;
|
|
476
|
+
/**
|
|
477
|
+
* Search with `returnOptions` set: an ESEARCH result object from a server that supports
|
|
478
|
+
* ESEARCH, the plain list of numbers otherwise
|
|
479
|
+
*/
|
|
473
480
|
search(query: SearchObject, options: SearchOptions & {
|
|
474
481
|
returnOptions: SearchReturnOption[];
|
|
475
482
|
}): Promise<ESearchResult | number[] | false | undefined>;
|
|
@@ -540,10 +547,12 @@ export declare class ImapFlow extends EventEmitter {
|
|
|
540
547
|
* @example
|
|
541
548
|
* let mailbox = await client.mailboxOpen('INBOX');
|
|
542
549
|
* // download body part nr '1.2' from latest message
|
|
543
|
-
* let
|
|
544
|
-
*
|
|
550
|
+
* let download = await client.download('*', '1.2');
|
|
551
|
+
* if (download.content) {
|
|
552
|
+
* download.content.pipe(fs.createWriteStream(download.meta.filename));
|
|
553
|
+
* }
|
|
545
554
|
*/
|
|
546
|
-
download(range: SequenceString, part?: string | undefined, options?: DownloadOptions | undefined): Promise<DownloadObject>;
|
|
555
|
+
download(range: SequenceString, part?: string | undefined, options?: DownloadOptions | undefined): Promise<DownloadObject | DownloadNotFound>;
|
|
547
556
|
/**
|
|
548
557
|
* Fetch multiple attachments as Buffer values
|
|
549
558
|
*
|