node_modules: update (#332)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurlaanddawidd6 authored and GitHub committed 2026-10-01 09:48:38 +02:00
1 parent c1dac70e3a
commit 6bf0a2f26a
95 files changed
+1102 -503

No files matched your search

+36 -24
View File
@@ -4,8 +4,8 @@ import DKIM, { type DKIMOptions } from '../dkim/index.js';
import MailMessage, { type MailDefaults, type SendMailOptions } from './mail-message.js';
import net from 'node:net';
import type { ConnectionOptions } from 'node:tls';
import type { MailComposerAlternative, MailComposerAttachment, MailComposerIcalEvent, MailComposerListHeaderEntry, MailComposerListHeaders } from '../mail-composer/index.js';
import type { NodemailerError, ResultCallback } from '../errors.js';
import type { MailComposerAlternative, MailComposerAttachment, MailComposerIcalEvent, MailComposerListHeaderEntry, MailComposerListHeaders, MailComposerTextEncoding } from '../mail-composer/index.js';
import type { Callback, NodemailerError, ResultCallback } from '../errors.js';
import type { ParsedUrl } from '../shared/url.js';
import type { MimeNodeAddress, MimeNodeEnvelope, MimeNodeEnvelopeInput, MimeNodeHeaders, MimeNodeOptions } from '../mime-node/index.js';
import type { XOAuth2ProvisionCallback } from '../xoauth2/index.js';
@@ -15,9 +15,10 @@ export type { default as MailMessage } from './mail-message.js';
* The base shape of the object a transport hands back for a sent message. Every bundled
* transport sets the envelope and the Message-ID, the rest depends on the transport.
*
* The index signature keeps a transport specific field readable through this type, and it
* is also what a result type has to inherit to stay assignable to it, so the result type
* of a transport outside this package has to extend this interface rather than restate it
* The index signature keeps a transport specific field readable through this type, the way
* the `any` typed result of @types/nodemailer was, and it is also what a result type has
* to inherit to stay assignable to it, so the result type of a transport outside this
* package has to extend this interface rather than restate it
*/
export interface SentMessageInfo {
/** The envelope the message was sent with */
@@ -33,9 +34,9 @@ export interface SentMessageInfo {
/** Last response from the server */
response?: string | undefined;
/** The generated message, for the transports that hand it back instead of sending it */
message?: unknown;
message?: any;
/** Transport specific fields */
[key: string]: unknown;
[key: string]: any;
}
/**
* Callback for sendMail, receives the transport result once the transport has taken the
@@ -43,9 +44,11 @@ export interface SentMessageInfo {
*/
export type SendMailCallback<T = SentMessageInfo> = (err: NodemailerError | null, info: T) => void;
/**
* Callback for verify(), success is true once the transport accepted the configuration
* Callback for verify(), success is true once the transport accepted the configuration.
* Declared with a required success value, the way @types/nodemailer declared it, the
* error path hands over the error alone
*/
export type VerifyCallback = (err: NodemailerError | null, success?: true) => void;
export type VerifyCallback = Callback<true>;
/**
* Callback a plugin calls once it is done, an error aborts the send
*/
@@ -60,21 +63,23 @@ export type PluginFunction<T = SentMessageInfo> = (mail: MailMessage<T>, callbac
*/
export interface GetSocketOptions {
host?: string | undefined;
port?: number | string | undefined;
port?: number | undefined;
[key: string]: any;
}
/**
* The result of a getSocket handler, the socket to use for the connection
* The result of a getSocket handler, the socket to use for the connection. The object is
* merged into the connection options, so it may carry any of those as well
*/
export interface SocketOptions {
/** An established socket, the proxied connection */
connection?: net.Socket | undefined;
[key: string]: any;
}
/**
* Receives the socket options from a getSocket handler, or the error that prevented the
* connection
* Receives the socket options from a getSocket handler, false when a new socket should be
* opened, or the error that prevented the connection
*/
export type GetSocketCallback = (err: NodemailerError | null, socketOptions?: SocketOptions) => void;
export type GetSocketCallback = (err: Error | null, socketOptions?: SocketOptions | false) => void;
/**
* A socket handler. Mail sets one on the transport as getSocket when a proxy is configured,
* the SMTP transports call it to get a proxied socket instead of connecting directly
@@ -101,9 +106,12 @@ export interface MailMeta {
/**
* A transport as consumed by Mail: any object with a name, a version and a send method
* works, the rest is optional. Mail forwards its close, isIdle and verify calls to the
* methods of the same name as they are, so their arguments are up to the transport
* methods of the same name as they are, so their arguments are up to the transport.
*
* D is the options type of the transport, the second type parameter @types/nodemailer
* declared on Transport, Transporter and Mail
*/
export interface Transport<T = SentMessageInfo> {
export interface Transport<T = SentMessageInfo, D extends TransportOptions = TransportOptions> {
/** Transport name, used for logging */
name: string;
/** Transport version, used for logging */
@@ -119,7 +127,7 @@ export interface Transport<T = SentMessageInfo> {
/** Registers an event listener, the transport may emit 'log', 'error', 'idle' and 'clear' */
on?(event: string | symbol, listener: (...args: any[]) => void): this;
/** The Mail object the transport belongs to, set by Mail */
mailer?: Mail<T> | undefined;
mailer?: Mail<T, D> | undefined;
/** Socket handler for a proxied connection, set by Mail when a proxy is configured */
getSocket?: GetSocketHandler | undefined;
}
@@ -150,22 +158,23 @@ export interface TransportOptions {
attachDataUrls?: boolean | undefined;
}
/**
* The transporter object createTransport returns, a Mail instance wrapping a transport
* The transporter object createTransport returns, a Mail instance wrapping a transport. D
* is the options type of the transport, it types the options field of the transporter
*/
export type Transporter<T = SentMessageInfo> = Mail<T>;
export type Transporter<T = SentMessageInfo, D extends TransportOptions = TransportOptions> = Mail<T, D>;
/**
* Creates an object for exposing the Mail API
*
* @constructor
* @param transporter Transport object instance to pass the mails to
*/
declare class Mail<out T = SentMessageInfo> extends EventEmitter {
options: TransportOptions;
declare class Mail<out T = SentMessageInfo, out D extends TransportOptions = TransportOptions> extends EventEmitter {
options: D;
/** Message defaults given to createTransport, kept public because the DefinitelyTyped typings declared it */
_defaults: MailDefaults;
meta: Map<string, any>;
dkim: DKIM | false;
transporter: Transport<T>;
transporter: Transport<T, D>;
logger: shared.Logger;
/** Closes the transport, the pooled SMTP transport closes its connections */
close: () => void;
@@ -178,7 +187,7 @@ declare class Mail<out T = SentMessageInfo> extends EventEmitter {
};
/** Socket handler for a proxied connection, set by setupProxy and handed to the transport on the next send */
getSocket?: GetSocketHandler | false | undefined;
constructor(transporter: Transport<T>, options?: TransportOptions, defaults?: MailDefaults);
constructor(transporter: Transport<T, D>, options?: D, defaults?: MailDefaults);
use(step: string, plugin: PluginFunction<T>): this;
/**
* Sends an email using the preselected transport object
@@ -213,7 +222,10 @@ declare namespace Mail {
type ListHeader = MailComposerListHeaderEntry;
type ListHeaders = MailComposerListHeaders;
type Envelope = MimeNodeEnvelopeInput;
type TextEncoding = NonNullable<SendMailOptions['textEncoding']>;
type Connection = SocketOptions;
type TextEncoding = MailComposerTextEncoding;
type PluginFunction<T = SentMessageInfo> = MailPluginFunction<T>;
}
/** The same aliases as module level exports, for `import * as Mail` and `import Mail = require()` */
export type { SendMailOptions as Options, MimeNodeAddress as Address, MailComposerAttachment as Attachment, MailComposerAlternative as AttachmentLike, MailComposerAlternative as AmpAttachment, MailComposerIcalEvent as IcalAttachment, MimeNodeHeaders as Headers, MailComposerListHeaderEntry as ListHeader, MailComposerListHeaders as ListHeaders, MimeNodeEnvelopeInput as Envelope, SocketOptions as Connection, MailComposerTextEncoding as TextEncoding };
export default Mail;