chore: 清理macOS同步产生的重复文件

详细说明:
- 删除了352个带数字后缀的重复文件
- 更新.gitignore防止未来产生此类文件
- 这些文件是由iCloud或其他同步服务冲突产生的
- 不影响项目功能,仅清理冗余文件
This commit is contained in:
Yep_Q
2025-09-08 12:06:01 +08:00
parent 1564396449
commit d6f48d6d14
365 changed files with 2039 additions and 68301 deletions

View File

@@ -1,27 +0,0 @@
export abstract class ImapError extends Error {}
/** Error thrown when a connection attempt has timed out */
export class ConnectionTimeoutError extends ImapError {
constructor(
/** timeout in milliseconds that the connection waited before timing out */
readonly timeout?: number,
) {
let message = 'connection timed out';
if (timeout) {
message += `. timeout = ${timeout} ms`;
}
super(message);
}
}
export class ConnectionClosedError extends ImapError {
constructor() {
super('Connection closed unexpectedly');
}
}
export class ConnectionEndedError extends ImapError {
constructor() {
super('Connection ended unexpectedly');
}
}

View File

@@ -1,203 +0,0 @@
import { EventEmitter } from 'events';
import type Imap from 'imap';
import { type ImapMessage } from 'imap';
import { getMessage } from './helpers/get-message';
import { PartData } from './part-data';
import type { Message, MessagePart, SearchCriteria } from './types';
const IMAP_EVENTS = ['alert', 'mail', 'expunge', 'uidvalidity', 'update', 'close', 'end'] as const;
export class ImapSimple extends EventEmitter {
/** flag to determine whether we should suppress ECONNRESET from bubbling up to listener */
private ending = false;
constructor(private readonly imap: Imap) {
super();
// pass most node-imap `Connection` events through 1:1
IMAP_EVENTS.forEach((event) => {
this.imap.on(event, this.emit.bind(this, event));
});
// special handling for `error` event
this.imap.on('error', (e: Error & { code?: string }) => {
// if .end() has been called and an 'ECONNRESET' error is received, don't bubble
if (e && this.ending && e.code?.toUpperCase() === 'ECONNRESET') {
return;
}
this.emit('error', e);
});
}
/** disconnect from the imap server */
end(): void {
// set state flag to suppress 'ECONNRESET' errors that are triggered when .end() is called.
// it is a known issue that has no known fix. This just temporarily ignores that error.
// https://github.com/mscdex/node-imap/issues/391
// https://github.com/mscdex/node-imap/issues/395
this.ending = true;
// using 'close' event to unbind ECONNRESET error handler, because the node-imap
// maintainer claims it is the more reliable event between 'end' and 'close'.
// https://github.com/mscdex/node-imap/issues/394
this.imap.once('close', () => {
this.ending = false;
});
this.imap.end();
}
/**
* Search the currently open mailbox, and retrieve the results
*
* Results are in the form:
*
* [{
* attributes: object,
* parts: [ { which: string, size: number, body: string }, ... ]
* }, ...]
*
* See node-imap's ImapMessage signature for information about `attributes`, `which`, `size`, and `body`.
* For any message part that is a `HEADER`, the body is automatically parsed into an object.
*/
async search(
/** Criteria to use to search. Passed to node-imap's .search() 1:1 */
searchCriteria: SearchCriteria[],
/** Criteria to use to fetch the search results. Passed to node-imap's .fetch() 1:1 */
fetchOptions: Imap.FetchOptions,
/** Optional limit to restrict the number of messages fetched */
limit?: number,
) {
return await new Promise<Message[]>((resolve, reject) => {
this.imap.search(searchCriteria, (e, uids) => {
if (e) {
reject(e);
return;
}
if (uids.length === 0) {
resolve([]);
return;
}
// If limit is specified, take only the first N UIDs
let uidsToFetch = uids;
if (limit && limit > 0 && uids.length > limit) {
uidsToFetch = uids.slice(0, limit);
}
const fetch = this.imap.fetch(uidsToFetch, fetchOptions);
let messagesRetrieved = 0;
const messages: Message[] = [];
const fetchOnMessage = async (message: Imap.ImapMessage, seqNo: number) => {
const msg: Message = await getMessage(message);
msg.seqNo = seqNo;
messages.push(msg);
messagesRetrieved++;
if (messagesRetrieved === uidsToFetch.length) {
resolve(messages.filter((m) => !!m));
}
};
const fetchOnError = (error: Error) => {
fetch.removeListener('message', fetchOnMessage);
fetch.removeListener('end', fetchOnEnd);
reject(error);
};
const fetchOnEnd = () => {
fetch.removeListener('message', fetchOnMessage);
fetch.removeListener('error', fetchOnError);
};
fetch.on('message', fetchOnMessage);
fetch.once('error', fetchOnError);
fetch.once('end', fetchOnEnd);
});
});
}
/** Download a "part" (either a portion of the message body, or an attachment) */
async getPartData(
/** The message returned from `search()` */
message: Message,
/** The message part to be downloaded, from the `message.attributes.struct` Array */
part: MessagePart,
) {
return await new Promise<PartData>((resolve, reject) => {
const fetch = this.imap.fetch(message.attributes.uid, {
bodies: [part.partID],
struct: true,
});
const fetchOnMessage = async (msg: ImapMessage) => {
const result = await getMessage(msg);
if (result.parts.length !== 1) {
reject(new Error('Got ' + result.parts.length + ' parts, should get 1'));
return;
}
const data = result.parts[0].body as string;
const encoding = part.encoding.toUpperCase();
resolve(PartData.fromData(data, encoding));
};
const fetchOnError = (error: Error) => {
fetch.removeListener('message', fetchOnMessage);
fetch.removeListener('end', fetchOnEnd);
reject(error);
};
const fetchOnEnd = () => {
fetch.removeListener('message', fetchOnMessage);
fetch.removeListener('error', fetchOnError);
};
fetch.once('message', fetchOnMessage);
fetch.once('error', fetchOnError);
fetch.once('end', fetchOnEnd);
});
}
/** Adds the provided flag(s) to the specified message(s). */
async addFlags(
/** The messages uid */
uid: number[],
/** The flags to add to the message(s). */
flags: string | string[],
) {
return await new Promise<void>((resolve, reject) => {
this.imap.addFlags(uid, flags, (e) => (e ? reject(e) : resolve()));
});
}
/** Returns a list of mailboxes (folders). */
async getBoxes() {
return await new Promise<Imap.MailBoxes>((resolve, reject) => {
this.imap.getBoxes((e, boxes) => (e ? reject(e) : resolve(boxes)));
});
}
/** Open a mailbox */
async openBox(
/** The name of the box to open */
boxName: string,
): Promise<Imap.Box> {
return await new Promise((resolve, reject) => {
this.imap.openBox(boxName, (e, result) => (e ? reject(e) : resolve(result)));
});
}
/** Close a mailbox */
async closeBox(
/** If autoExpunge is true, any messages marked as Deleted in the currently open mailbox will be removed @default true */
autoExpunge = true,
) {
return await new Promise<void>((resolve, reject) => {
this.imap.closeBox(autoExpunge, (e) => (e ? reject(e) : resolve()));
});
}
}

View File

@@ -1,266 +0,0 @@
import { EventEmitter } from 'events';
import Imap, { type Box, type MailBoxes } from 'imap';
import { Readable } from 'stream';
import type { Mocked } from 'vitest';
import { mock } from 'vitest-mock-extended';
import { ImapSimple } from './imap-simple';
import { PartData } from './part-data';
type MockImap = EventEmitter & {
connect: Mocked<() => unknown>;
fetch: Mocked<() => unknown>;
end: Mocked<() => unknown>;
search: Mocked<(...args: Parameters<Imap['search']>) => unknown>;
sort: Mocked<(...args: Parameters<Imap['sort']>) => unknown>;
openBox: Mocked<
(boxName: string, onOpen: (error: Error | null, box?: Box) => unknown) => unknown
>;
closeBox: Mocked<(...args: Parameters<Imap['closeBox']>) => unknown>;
getBoxes: Mocked<(onBoxes: (error: Error | null, boxes?: MailBoxes) => unknown) => unknown>;
addFlags: Mocked<(...args: Parameters<Imap['addFlags']>) => unknown>;
};
vi.mock('imap', () => {
return {
default: class InlineMockImap extends EventEmitter implements MockImap {
connect = vi.fn();
fetch = vi.fn();
end = vi.fn();
search = vi.fn();
sort = vi.fn();
openBox = vi.fn();
closeBox = vi.fn();
addFlags = vi.fn();
getBoxes = vi.fn();
},
};
});
vi.mock('./part-data', () => ({
// eslint-disable-next-line @typescript-eslint/naming-convention
PartData: { fromData: vi.fn(() => 'decoded') },
}));
describe('ImapSimple', () => {
function createImap() {
const imap = new Imap({ user: 'testuser', password: 'testpass' });
return { imapSimple: new ImapSimple(imap), mockImap: imap as unknown as MockImap };
}
describe('constructor', () => {
it('should forward nonerror events', () => {
const { imapSimple, mockImap } = createImap();
const onMail = vi.fn();
imapSimple.on('mail', onMail);
mockImap.emit('mail', 3);
expect(onMail).toHaveBeenCalledWith(3);
});
it('should suppress ECONNRESET errors if ending', () => {
const { imapSimple, mockImap } = createImap();
const onError = vi.fn();
imapSimple.on('error', onError);
imapSimple.end();
mockImap.emit('error', { message: 'reset', code: 'ECONNRESET' });
expect(onError).not.toHaveBeenCalled();
});
it('should forward ECONNRESET errors if not ending', () => {
const { imapSimple, mockImap } = createImap();
const onError = vi.fn();
imapSimple.on('error', onError);
const error = { message: 'reset', code: 'ECONNRESET' };
mockImap.emit('error', error);
expect(onError).toHaveBeenCalledWith(error);
});
});
describe('search', () => {
it('should resolve with messages returned from fetch', async () => {
const { imapSimple, mockImap } = createImap();
const fetchEmitter = new EventEmitter();
const mockMessages = [{ uid: 1 }, { uid: 2 }, { uid: 3 }];
vi.mocked(mockImap.search).mockImplementation((_criteria, onResult) =>
onResult(
null as unknown as Error,
mockMessages.map((m) => m.uid),
),
);
mockImap.fetch = vi.fn(() => fetchEmitter);
const searchPromise = imapSimple.search(['UNSEEN', ['FROM', 'test@n8n.io']], {
bodies: ['BODY'],
});
expect(mockImap.search).toHaveBeenCalledWith(
['UNSEEN', ['FROM', 'test@n8n.io']],
expect.any(Function),
);
for (const message of mockMessages) {
const messageEmitter = new EventEmitter();
const body = 'body' + message.uid;
const bodyStream = Readable.from(body);
fetchEmitter.emit('message', messageEmitter, message.uid);
messageEmitter.emit('body', bodyStream, { which: 'TEXT', size: Buffer.byteLength(body) });
messageEmitter.emit('attributes', { uid: message.uid });
await new Promise((resolve) => {
bodyStream.on('end', resolve);
});
messageEmitter.emit('end');
}
fetchEmitter.emit('end');
const messages = await searchPromise;
expect(messages).toEqual([
{
attributes: { uid: 1 },
parts: [{ body: 'body1', size: 5, which: 'TEXT' }],
seqNo: 1,
},
{
attributes: { uid: 2 },
parts: [{ body: 'body2', size: 5, which: 'TEXT' }],
seqNo: 2,
},
{
attributes: { uid: 3 },
parts: [{ body: 'body3', size: 5, which: 'TEXT' }],
seqNo: 3,
},
]);
});
});
describe('getPartData', () => {
it('should return decoded part data', async () => {
const { imapSimple, mockImap } = createImap();
const fetchEmitter = new EventEmitter();
mockImap.fetch = vi.fn(() => fetchEmitter);
const message = { attributes: { uid: 123 } };
const part = { partID: '1.2', encoding: 'BASE64' };
const partDataPromise = imapSimple.getPartData(mock(message), mock(part));
const body = 'encoded-body';
const messageEmitter = new EventEmitter();
const bodyStream = Readable.from(body);
fetchEmitter.emit('message', messageEmitter);
messageEmitter.emit('body', bodyStream, {
which: part.partID,
size: Buffer.byteLength(body),
});
messageEmitter.emit('attributes', {});
await new Promise((resolve) => bodyStream.on('end', resolve));
messageEmitter.emit('end');
fetchEmitter.emit('end');
const result = await partDataPromise;
expect(PartData.fromData).toHaveBeenCalledWith('encoded-body', 'BASE64');
expect(result).toBe('decoded');
});
});
describe('openBox', () => {
it('should open the mailbox', async () => {
const { imapSimple, mockImap } = createImap();
const box = mock<Box>({ name: 'INBOX' });
vi.mocked(mockImap.openBox).mockImplementation((_boxName, onOpen) =>
onOpen(null as unknown as Error, box),
);
await expect(imapSimple.openBox('INBOX')).resolves.toEqual(box);
});
it('should reject on error', async () => {
const { imapSimple, mockImap } = createImap();
vi.mocked(mockImap.openBox).mockImplementation((_boxName, onOpen) =>
onOpen(new Error('nope')),
);
await expect(imapSimple.openBox('INBOX')).rejects.toThrow('nope');
});
});
describe('closeBox', () => {
it('should close the mailbox with default autoExpunge=true', async () => {
const { imapSimple, mockImap } = createImap();
vi.mocked(mockImap.closeBox).mockImplementation((_expunge, onClose) =>
onClose(null as unknown as Error),
);
await expect(imapSimple.closeBox()).resolves.toBeUndefined();
expect(mockImap.closeBox).toHaveBeenCalledWith(true, expect.any(Function));
});
it('should close the mailbox with autoExpunge=false', async () => {
const { imapSimple, mockImap } = createImap();
vi.mocked(mockImap.closeBox).mockImplementation((_expunge, onClose) =>
onClose(null as unknown as Error),
);
await expect(imapSimple.closeBox(false)).resolves.toBeUndefined();
expect(mockImap.closeBox).toHaveBeenCalledWith(false, expect.any(Function));
});
it('should reject on error', async () => {
const { imapSimple, mockImap } = createImap();
vi.mocked(mockImap.closeBox).mockImplementation((_expunge, onClose) =>
onClose(new Error('fail')),
);
await expect(imapSimple.closeBox()).rejects.toThrow('fail');
});
});
describe('addFlags', () => {
it('should add flags to messages and resolve', async () => {
const { imapSimple, mockImap } = createImap();
vi.mocked(mockImap.addFlags).mockImplementation((_uids, _flags, onAdd) =>
onAdd(null as unknown as Error),
);
await expect(imapSimple.addFlags([1, 2], ['\\Seen'])).resolves.toBeUndefined();
expect(mockImap.addFlags).toHaveBeenCalledWith([1, 2], ['\\Seen'], expect.any(Function));
});
it('should reject on error', async () => {
const { imapSimple, mockImap } = createImap();
vi.mocked(mockImap.addFlags).mockImplementation((_uids, _flags, onAdd) =>
onAdd(new Error('add flags failed')),
);
await expect(imapSimple.addFlags([1], '\\Seen')).rejects.toThrow('add flags failed');
});
});
describe('getBoxes', () => {
it('should resolve with list of mailboxes', async () => {
const { imapSimple, mockImap } = createImap();
// eslint-disable-next-line @typescript-eslint/naming-convention
const boxes = mock<MailBoxes>({ INBOX: {}, Archive: {} });
vi.mocked(mockImap.getBoxes).mockImplementation((onBoxes) =>
onBoxes(null as unknown as Error, boxes),
);
await expect(imapSimple.getBoxes()).resolves.toEqual(boxes);
expect(mockImap.getBoxes).toHaveBeenCalledWith(expect.any(Function));
});
it('should reject on error', async () => {
const { imapSimple, mockImap } = createImap();
vi.mocked(mockImap.getBoxes).mockImplementation((onBoxes) =>
onBoxes(new Error('getBoxes failed')),
);
await expect(imapSimple.getBoxes()).rejects.toThrow('getBoxes failed');
});
});
});

View File

@@ -1,100 +0,0 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import Imap from 'imap';
import { ConnectionClosedError, ConnectionEndedError, ConnectionTimeoutError } from './errors';
import { ImapSimple } from './imap-simple';
import type { ImapSimpleOptions, MessagePart } from './types';
/**
* Connect to an Imap server, returning an ImapSimple instance, which is a wrapper over node-imap to simplify it's api for common use cases.
*/
export async function connect(options: ImapSimpleOptions): Promise<ImapSimple> {
const authTimeout = options.imap.authTimeout ?? 2000;
options.imap.authTimeout = authTimeout;
const imap = new Imap(options.imap);
return await new Promise<ImapSimple>((resolve, reject) => {
const cleanUp = () => {
imap.removeListener('ready', imapOnReady);
imap.removeListener('error', imapOnError);
imap.removeListener('close', imapOnClose);
imap.removeListener('end', imapOnEnd);
};
const imapOnReady = () => {
cleanUp();
resolve(new ImapSimple(imap));
};
const imapOnError = (e: Error & { source?: string }) => {
if (e.source === 'timeout-auth') {
e = new ConnectionTimeoutError(authTimeout);
}
cleanUp();
reject(e);
};
const imapOnEnd = () => {
cleanUp();
reject(new ConnectionEndedError());
};
const imapOnClose = () => {
cleanUp();
reject(new ConnectionClosedError());
};
imap.once('ready', imapOnReady);
imap.once('error', imapOnError);
imap.once('close', imapOnClose);
imap.once('end', imapOnEnd);
if (options.onMail) {
imap.on('mail', options.onMail);
}
if (options.onExpunge) {
imap.on('expunge', options.onExpunge);
}
if (options.onUpdate) {
imap.on('update', options.onUpdate);
}
imap.connect();
});
}
/**
* Given the `message.attributes.struct`, retrieve a flattened array of `parts` objects that describe the structure of
* the different parts of the message's body. Useful for getting a simple list to iterate for the purposes of,
* for example, finding all attachments.
*
* Code taken from http://stackoverflow.com/questions/25247207/how-to-read-and-save-attachments-using-node-imap
*
* @returns {Array} a flattened array of `parts` objects that describe the structure of the different parts of the
* message's body
*/
export function getParts(
/** The `message.attributes.struct` value from the message you wish to retrieve parts for. */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
struct: any,
/** The list of parts to push to. */
parts: MessagePart[] = [],
): MessagePart[] {
for (let i = 0; i < struct.length; i++) {
if (Array.isArray(struct[i])) {
getParts(struct[i], parts);
} else if (struct[i].partID) {
parts.push(struct[i] as MessagePart);
}
}
return parts;
}
export * from './imap-simple';
export * from './errors';
export * from './types';

View File

@@ -1,83 +0,0 @@
import * as iconvlite from 'iconv-lite';
import * as qp from 'quoted-printable';
import * as utf8 from 'utf8';
import * as uuencode from 'uuencode';
export abstract class PartData {
constructor(readonly buffer: Buffer) {}
toString() {
return this.buffer.toString();
}
static fromData(data: string, encoding: string, charset?: string): PartData {
if (encoding === 'BASE64') {
return new Base64PartData(data);
}
if (encoding === 'QUOTED-PRINTABLE') {
return new QuotedPrintablePartData(data, charset);
}
if (encoding === '7BIT') {
return new SevenBitPartData(data);
}
if (encoding === '8BIT' || encoding === 'BINARY') {
return new BinaryPartData(data, charset);
}
if (encoding === 'UUENCODE') {
return new UuencodedPartData(data);
}
// if it gets here, the encoding is not currently supported
throw new Error('Unknown encoding ' + encoding);
}
}
export class Base64PartData extends PartData {
constructor(data: string) {
super(Buffer.from(data, 'base64'));
}
}
export class QuotedPrintablePartData extends PartData {
constructor(data: string, charset?: string) {
const decoded =
charset?.toUpperCase() === 'UTF-8' ? utf8.decode(qp.decode(data)) : qp.decode(data);
super(Buffer.from(decoded));
}
}
export class SevenBitPartData extends PartData {
constructor(data: string) {
super(Buffer.from(data));
}
toString() {
return this.buffer.toString('ascii');
}
}
export class BinaryPartData extends PartData {
constructor(
data: string,
readonly charset: string = 'utf-8',
) {
super(Buffer.from(data));
}
toString() {
return iconvlite.decode(this.buffer, this.charset);
}
}
export class UuencodedPartData extends PartData {
constructor(data: string) {
const parts = data.split('\n'); // remove newline characters
const merged = parts.splice(1, parts.length - 4).join(''); // remove excess lines and join lines with empty string
const decoded = uuencode.decode(merged);
super(decoded);
}
}

View File

@@ -1,88 +0,0 @@
import {
PartData,
Base64PartData,
QuotedPrintablePartData,
SevenBitPartData,
BinaryPartData,
UuencodedPartData,
} from '../src/part-data';
describe('PartData', () => {
describe('fromData', () => {
it('should return an instance of Base64PartData when encoding is BASE64', () => {
const result = PartData.fromData('data', 'BASE64');
expect(result).toBeInstanceOf(Base64PartData);
});
it('should return an instance of QuotedPrintablePartData when encoding is QUOTED-PRINTABLE', () => {
const result = PartData.fromData('data', 'QUOTED-PRINTABLE');
expect(result).toBeInstanceOf(QuotedPrintablePartData);
});
it('should return an instance of SevenBitPartData when encoding is 7BIT', () => {
const result = PartData.fromData('data', '7BIT');
expect(result).toBeInstanceOf(SevenBitPartData);
});
it('should return an instance of BinaryPartData when encoding is 8BIT or BINARY', () => {
let result = PartData.fromData('data', '8BIT');
expect(result).toBeInstanceOf(BinaryPartData);
result = PartData.fromData('data', 'BINARY');
expect(result).toBeInstanceOf(BinaryPartData);
});
it('should return an instance of UuencodedPartData when encoding is UUENCODE', () => {
const result = PartData.fromData('data', 'UUENCODE');
expect(result).toBeInstanceOf(UuencodedPartData);
});
it('should throw an error when encoding is not supported', () => {
expect(() => PartData.fromData('data', 'UNSUPPORTED')).toThrow(
'Unknown encoding UNSUPPORTED',
);
});
});
});
describe('Base64PartData', () => {
it('should correctly decode base64 data', () => {
const data = Buffer.from('Hello, world!', 'utf-8').toString('base64');
const partData = new Base64PartData(data);
expect(partData.toString()).toBe('Hello, world!');
});
});
describe('QuotedPrintablePartData', () => {
it('should correctly decode quoted-printable data', () => {
const data = '=48=65=6C=6C=6F=2C=20=77=6F=72=6C=64=21'; // 'Hello, world!' in quoted-printable
const partData = new QuotedPrintablePartData(data);
expect(partData.toString()).toBe('Hello, world!');
});
});
describe('SevenBitPartData', () => {
it('should correctly decode 7bit data', () => {
const data = 'Hello, world!';
const partData = new SevenBitPartData(data);
expect(partData.toString()).toBe('Hello, world!');
});
});
describe('BinaryPartData', () => {
it('should correctly decode binary data', () => {
const data = Buffer.from('Hello, world!', 'utf-8').toString();
const partData = new BinaryPartData(data);
expect(partData.toString()).toBe('Hello, world!');
});
});
describe('UuencodedPartData', () => {
it('should correctly decode uuencoded data', () => {
const data = Buffer.from(
'YmVnaW4gNjQ0IGRhdGEKLTImNUw7JlxMKCc9TzxGUUQoMGBgCmAKZW5kCg==',
'base64',
).toString('binary');
const partData = new UuencodedPartData(data);
expect(partData.toString()).toBe('Hello, world!');
});
});

View File

@@ -1,43 +0,0 @@
import type { Config, ImapMessageBodyInfo, ImapMessageAttributes } from 'imap';
export interface ImapSimpleOptions {
/** Options to pass to node-imap constructor. */
imap: Config;
/** Server event emitted when new mail arrives in the currently open mailbox. */
onMail?: ((numNewMail: number) => void) | undefined;
/** Server event emitted when a message was expunged externally. seqNo is the sequence number (instead of the unique UID) of the message that was expunged. If you are caching sequence numbers, all sequence numbers higher than this value MUST be decremented by 1 in order to stay synchronized with the server and to keep correct continuity. */
onExpunge?: ((seqNo: number) => void) | undefined;
/** Server event emitted when message metadata (e.g. flags) changes externally. */
onUpdate?:
| ((seqNo: number, info: { num: number | undefined; text: unknown }) => void)
| undefined;
}
export interface MessagePart {
partID: string;
encoding: 'BASE64' | 'QUOTED-PRINTABLE' | '7BIT' | '8BIT' | 'BINARY' | 'UUENCODE';
type: 'TEXT';
subtype: string;
params?: {
charset?: string;
};
disposition?: {
type: string;
};
}
export interface MessageBodyPart extends ImapMessageBodyInfo {
/** string type where which=='TEXT', complex Object where which=='HEADER' */
body: string | object;
}
export interface Message {
attributes: ImapMessageAttributes;
parts: MessageBodyPart[];
seqNo?: number;
}
export type SearchCriteria = string | [string, string];