mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-10-09 18:04:08 +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
+13
-5
@@ -4,7 +4,7 @@ import * as shared from '../shared/index.js';
|
||||
import { type XOAuth2Options } from '../xoauth2/index.js';
|
||||
import type { ResultCallback } from '../errors.js';
|
||||
import type MailMessage from '../mailer/mail-message.js';
|
||||
import type { default as Mail, SentMessageInfo, SendMailOptions, TransportOptions, VerifyCallback } from '../mailer/index.js';
|
||||
import type { default as Mail, GetSocketCallback, SentMessageInfo, SendMailOptions, TransportOptions, VerifyCallback } from '../mailer/index.js';
|
||||
import type { MimeNodeEnvelope } from '../mime-node/index.js';
|
||||
/**
|
||||
* Authentication settings, either from the transport options or from the message data.
|
||||
@@ -38,9 +38,10 @@ export interface SMTPTransportAuth extends SMTPConnectionAuth {
|
||||
/**
|
||||
* Receives the socket details from getSocket, false when a new socket should be opened. The
|
||||
* object is merged into the connection options, a proxy handler provides the connected socket
|
||||
* as `connection`
|
||||
* as `connection`. The same callback type Mail hands to a transport, so that the SMTP
|
||||
* transports stay assignable to the Transport interface
|
||||
*/
|
||||
export type SMTPTransportGetSocketCallback = (err: Error | null, socketOptions?: SMTPConnectionOptions | false) => void;
|
||||
export type SMTPTransportGetSocketCallback = GetSocketCallback;
|
||||
/**
|
||||
* Custom socket provider, replaces the getSocket method of the transport
|
||||
*/
|
||||
@@ -78,6 +79,8 @@ export interface SMTPSentMessageInfo extends SMTPConnectionSendInfo, SentMessage
|
||||
accepted: string[];
|
||||
/** Recipients the server rejected */
|
||||
rejected: string[];
|
||||
/** Final server response for the message */
|
||||
response: string;
|
||||
}
|
||||
/**
|
||||
* Callback for send()
|
||||
@@ -101,7 +104,7 @@ declare class SMTPTransport extends EventEmitter {
|
||||
/**
|
||||
* The Mail instance using this transport, assigned by Mail
|
||||
*/
|
||||
mailer?: Mail<SMTPSentMessageInfo> | undefined;
|
||||
mailer?: Mail<SMTPSentMessageInfo, SMTPTransportOptions> | undefined;
|
||||
constructor(options?: SMTPTransportOptions | string);
|
||||
/**
|
||||
* Placeholder function for creating proxy sockets. This method immediatelly returns
|
||||
@@ -118,7 +121,7 @@ declare class SMTPTransport extends EventEmitter {
|
||||
* @param mail Mail object
|
||||
* @param callback Callback function
|
||||
*/
|
||||
send(mail: MailMessage, callback: SMTPTransportSendCallback): void;
|
||||
send(mail: MailMessage<SMTPSentMessageInfo>, callback: SMTPTransportSendCallback): void;
|
||||
/**
|
||||
* Verifies SMTP configuration
|
||||
*
|
||||
@@ -139,5 +142,10 @@ declare namespace SMTPTransport {
|
||||
type MailOptions = SendMailOptions;
|
||||
type SentMessageInfo = SMTPSentMessageInfo;
|
||||
type AuthenticationType = SMTPTransportAuth;
|
||||
type AuthenticationTypeLogin = SMTPTransportAuth;
|
||||
type AuthenticationTypeOAuth2 = SMTPTransportAuth;
|
||||
type AuthenticationTypeCustom = SMTPTransportAuth;
|
||||
}
|
||||
/** The same aliases as module level exports, for `import * as SMTPTransport` and `import SMTPTransport = require()` */
|
||||
export type { SMTPTransportOptions as Options, SendMailOptions as MailOptions, SMTPSentMessageInfo as SentMessageInfo, SMTPTransportAuth as AuthenticationType, SMTPTransportAuth as AuthenticationTypeLogin, SMTPTransportAuth as AuthenticationTypeOAuth2, SMTPTransportAuth as AuthenticationTypeCustom };
|
||||
export default SMTPTransport;
|
||||
+9
-7
@@ -189,7 +189,7 @@ class SMTPTransport extends node_events_1.EventEmitter {
|
||||
cleanupPerCallAuth();
|
||||
// still have not returned, this means we have an unexpected connection close
|
||||
const err = new Error('Unexpected socket close');
|
||||
if (connection && connection._socket && connection._socket.upgrading) {
|
||||
if (connection && connection.upgrading) {
|
||||
// starttls connection errors
|
||||
err.code = errors.ETLS;
|
||||
}
|
||||
@@ -279,9 +279,11 @@ class SMTPTransport extends node_events_1.EventEmitter {
|
||||
callback = shared.callbackPromise(resolve, reject);
|
||||
});
|
||||
}
|
||||
// the error paths hand over the error alone
|
||||
const done = callback;
|
||||
this.getSocket(this.options, (err, socketOptions) => {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
return done(err);
|
||||
}
|
||||
let options = this.options;
|
||||
if (socketOptions && socketOptions.connection) {
|
||||
@@ -311,7 +313,7 @@ class SMTPTransport extends node_events_1.EventEmitter {
|
||||
returned = true;
|
||||
cleanupPerCallAuth();
|
||||
connection.close();
|
||||
return callback(err);
|
||||
return done(err);
|
||||
});
|
||||
connection.once('end', () => {
|
||||
if (returned) {
|
||||
@@ -319,7 +321,7 @@ class SMTPTransport extends node_events_1.EventEmitter {
|
||||
}
|
||||
returned = true;
|
||||
cleanupPerCallAuth();
|
||||
return callback(new Error('Connection closed'));
|
||||
return done(new Error('Connection closed'));
|
||||
});
|
||||
const finalize = () => {
|
||||
if (returned) {
|
||||
@@ -328,7 +330,7 @@ class SMTPTransport extends node_events_1.EventEmitter {
|
||||
returned = true;
|
||||
cleanupPerCallAuth();
|
||||
connection.quit();
|
||||
return callback(null, true);
|
||||
return done(null, true);
|
||||
};
|
||||
connection.connect(() => {
|
||||
if (returned) {
|
||||
@@ -344,7 +346,7 @@ class SMTPTransport extends node_events_1.EventEmitter {
|
||||
if (err) {
|
||||
returned = true;
|
||||
connection.close();
|
||||
return callback(err);
|
||||
return done(err);
|
||||
}
|
||||
finalize();
|
||||
});
|
||||
@@ -355,7 +357,7 @@ class SMTPTransport extends node_events_1.EventEmitter {
|
||||
returned = true;
|
||||
cleanupPerCallAuth();
|
||||
connection.close();
|
||||
return callback(err);
|
||||
return done(err);
|
||||
}
|
||||
else {
|
||||
finalize();
|
||||
|
||||
Reference in new issue
Block a user