mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-10-09 09:59:45 +07:00
node_modules: update (#332)
Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
1 parent
c1dac70e3a
commit
6bf0a2f26a
95 files changed
+1102
-503
No files matched your search
+57
-22
@@ -3,8 +3,9 @@ import net from 'node:net';
|
||||
import tls from 'node:tls';
|
||||
import { type Readable } from 'node:stream';
|
||||
import * as shared from '../shared/index.js';
|
||||
import type { NodemailerError } from '../errors.js';
|
||||
import type { Callback, NodemailerError } from '../errors.js';
|
||||
import type XOAuth2 from '../xoauth2/index.js';
|
||||
import type { XOAuth2Options } from '../xoauth2/index.js';
|
||||
/**
|
||||
* Custom authentication handlers keyed by (case insensitive) SASL method name
|
||||
*/
|
||||
@@ -117,12 +118,23 @@ export interface SMTPConnectionCustomAuthResponse {
|
||||
* Callback for a command sent by a custom authentication handler
|
||||
*/
|
||||
export type SMTPConnectionCustomAuthCommandCallback = (err: Error | null, data: SMTPConnectionCustomAuthResponse) => void;
|
||||
/**
|
||||
* The auth object as a custom authentication handler sees it: the object handed to login()
|
||||
* with the credentials filled in from its user and pass values
|
||||
*/
|
||||
export interface SMTPConnectionCustomAuthData extends SMTPConnectionAuth {
|
||||
/** The user and pass values of the auth object, the way @types/nodemailer declared them */
|
||||
credentials: SMTPConnectionCredentials & {
|
||||
user: string;
|
||||
pass: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* The object a custom authentication handler is run with
|
||||
*/
|
||||
export interface SMTPConnectionCustomAuthContext {
|
||||
/** The auth object handed to login() */
|
||||
auth: SMTPConnectionAuth;
|
||||
/** The auth object handed to login(), with the credentials filled in */
|
||||
auth: SMTPConnectionCustomAuthData;
|
||||
/** Selected authentication method name */
|
||||
method: string;
|
||||
/** SMTP extensions the server advertised */
|
||||
@@ -131,17 +143,20 @@ export interface SMTPConnectionCustomAuthContext {
|
||||
authMethods: string[];
|
||||
/** Maximum message size the server accepts, false when not advertised */
|
||||
maxAllowedSize: number | false;
|
||||
/** Sends a command to the server. Returns a promise when no callback is given */
|
||||
sendCommand(cmd: string, done?: SMTPConnectionCustomAuthCommandCallback): Promise<SMTPConnectionCustomAuthResponse> | undefined;
|
||||
/** Sends a command to the server and resolves with the parsed reply */
|
||||
sendCommand(cmd: string): Promise<SMTPConnectionCustomAuthResponse>;
|
||||
/** Sends a command to the server and hands the parsed reply to the callback */
|
||||
sendCommand(cmd: string, done: SMTPConnectionCustomAuthCommandCallback): void;
|
||||
/** Marks the user as authenticated */
|
||||
resolve(): void;
|
||||
/** Fails the authentication with an error */
|
||||
reject(err: Error | string): void;
|
||||
}
|
||||
/**
|
||||
* A custom authentication handler. Calls resolve() or reject() on the context, or returns a promise
|
||||
* A custom authentication handler. Calls resolve() or reject() on the context, or returns a
|
||||
* promise that settles the authentication. Any other return value is ignored
|
||||
*/
|
||||
export type SMTPConnectionCustomAuthHandler = (ctx: SMTPConnectionCustomAuthContext) => void | Promise<unknown>;
|
||||
export type SMTPConnectionCustomAuthHandler = (ctx: SMTPConnectionCustomAuthContext) => unknown;
|
||||
/**
|
||||
* An envelope address, either a plain string or an object with an address property
|
||||
*/
|
||||
@@ -168,12 +183,16 @@ export interface SMTPEnvelopeDsn {
|
||||
/** Alias of recipient, in the 'rfc822;address' form */
|
||||
orcpt?: string | null | undefined;
|
||||
}
|
||||
/**
|
||||
* A single DSN notify value
|
||||
*/
|
||||
export type SMTPEnvelopeDsnNotify = 'NEVER' | 'SUCCESS' | 'FAILURE' | 'DELAY';
|
||||
/**
|
||||
* Envelope object accepted by send()
|
||||
*/
|
||||
export interface SMTPEnvelope {
|
||||
/** Sender address */
|
||||
from?: string | SMTPEnvelopeAddress | undefined;
|
||||
/** Sender address, false for the null sender of a bounce message (MAIL FROM:<>) */
|
||||
from?: string | SMTPEnvelopeAddress | false | undefined;
|
||||
/** Recipient address or addresses */
|
||||
to?: string | SMTPEnvelopeAddress | Array<string | SMTPEnvelopeAddress> | undefined;
|
||||
/** Message size in bytes, sent as the SIZE parameter when the server supports it */
|
||||
@@ -202,9 +221,9 @@ export interface SMTPConnectionEnvelope extends SMTPEnvelope {
|
||||
accepted: string[];
|
||||
}
|
||||
/**
|
||||
* Result of a sent message
|
||||
* The recipient bookkeeping of a sent message, known once the envelope is accepted
|
||||
*/
|
||||
export interface SMTPConnectionSendInfo {
|
||||
export interface SMTPConnectionEnvelopeInfo {
|
||||
/** Recipients the server accepted */
|
||||
accepted: string[];
|
||||
/** Recipients the server rejected */
|
||||
@@ -213,19 +232,25 @@ export interface SMTPConnectionSendInfo {
|
||||
ehlo?: string[] | undefined;
|
||||
/** Errors for the rejected recipients */
|
||||
rejectedErrors?: NodemailerError[] | undefined;
|
||||
/** Time in ms spent on the envelope commands */
|
||||
envelopeTime?: number | undefined;
|
||||
/** Time in ms spent on streaming the message */
|
||||
messageTime?: number | undefined;
|
||||
/** Size of the encoded message in bytes */
|
||||
messageSize?: number | undefined;
|
||||
/** Final server response for the message */
|
||||
response?: string | undefined;
|
||||
}
|
||||
/**
|
||||
* Callback for send()
|
||||
* Result of a sent message
|
||||
*/
|
||||
export type SMTPConnectionSendCallback = (err: NodemailerError | null, info?: SMTPConnectionSendInfo) => void;
|
||||
export interface SMTPConnectionSendInfo extends SMTPConnectionEnvelopeInfo {
|
||||
/** Time in ms spent on the envelope commands */
|
||||
envelopeTime: number;
|
||||
/** Time in ms spent on streaming the message */
|
||||
messageTime: number;
|
||||
/** Size of the encoded message in bytes */
|
||||
messageSize: number;
|
||||
/** Final server response for the message */
|
||||
response: string;
|
||||
}
|
||||
/**
|
||||
* Callback for send(), receives the result once the server accepted the message. The error
|
||||
* path hands over the error alone
|
||||
*/
|
||||
export type SMTPConnectionSendCallback = Callback<SMTPConnectionSendInfo>;
|
||||
/**
|
||||
* Callback for login() and reset(), the result is true on success
|
||||
*/
|
||||
@@ -285,7 +310,7 @@ export type SMTPConnectionResponseAction = (str: string) => void;
|
||||
*/
|
||||
declare class SMTPConnection extends EventEmitter {
|
||||
id: string;
|
||||
stage: string;
|
||||
stage: 'init' | 'connected';
|
||||
options: SMTPConnectionOptions;
|
||||
secureConnection: boolean;
|
||||
alreadySecured: boolean;
|
||||
@@ -370,12 +395,22 @@ declare class SMTPConnection extends EventEmitter {
|
||||
declare namespace SMTPConnection {
|
||||
type Options = SMTPConnectionOptions;
|
||||
type AuthenticationType = SMTPConnectionAuth;
|
||||
type AuthenticationTypeLogin = SMTPConnectionAuth;
|
||||
type AuthenticationTypeOAuth2 = SMTPConnectionAuth;
|
||||
type AuthenticationTypeCustom = SMTPConnectionAuth;
|
||||
type AuthenticationCredentials = SMTPConnectionAuth;
|
||||
type AuthenticationOAuth2 = SMTPConnectionAuth;
|
||||
type Credentials = SMTPConnectionCredentials;
|
||||
type OAuth2 = XOAuth2Options;
|
||||
type Envelope = SMTPEnvelope;
|
||||
type DSNOptions = SMTPEnvelopeDsn;
|
||||
type DSNOption = SMTPEnvelopeDsnNotify;
|
||||
type SentMessageInfo = SMTPConnectionSendInfo;
|
||||
type SMTPError = NodemailerError;
|
||||
type CustomAuthenticationContext = SMTPConnectionCustomAuthContext;
|
||||
type CustomAuthenticationResponse = SMTPConnectionCustomAuthResponse;
|
||||
type CustomAuthenticationHandlers = SMTPConnectionCustomAuthHandlers;
|
||||
}
|
||||
/** The same aliases as module level exports, for `import * as SMTPConnection` and `import SMTPConnection = require()` */
|
||||
export type { SMTPConnectionOptions as Options, SMTPConnectionAuth as AuthenticationType, SMTPConnectionAuth as AuthenticationTypeLogin, SMTPConnectionAuth as AuthenticationTypeOAuth2, SMTPConnectionAuth as AuthenticationTypeCustom, SMTPConnectionAuth as AuthenticationCredentials, SMTPConnectionAuth as AuthenticationOAuth2, SMTPConnectionCredentials as Credentials, XOAuth2Options as OAuth2, SMTPEnvelope as Envelope, SMTPEnvelopeDsn as DSNOptions, SMTPEnvelopeDsnNotify as DSNOption, SMTPConnectionSendInfo as SentMessageInfo, NodemailerError as SMTPError, SMTPConnectionCustomAuthContext as CustomAuthenticationContext, SMTPConnectionCustomAuthResponse as CustomAuthenticationResponse, SMTPConnectionCustomAuthHandlers as CustomAuthenticationHandlers };
|
||||
export default SMTPConnection;
|
||||
Reference in new issue
Block a user