node_modules: update (#290)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurla
2026-04-28 12:50:45 +02:00
committed by GitHub
parent 63e1562580
commit 42942bc2f8
1077 changed files with 12540 additions and 33773 deletions

View File

@@ -49,11 +49,8 @@ class SMTPTransport extends EventEmitter {
component: this.options.component || 'smtp-transport'
});
// temporary object
let connection = new SMTPConnection(this.options);
this.name = 'SMTP';
this.version = packageData.version + '[client:' + connection.version + ']';
this.version = packageData.version + '[client:' + packageData.version + ']';
if (this.options.auth) {
this.auth = this.getAuth({});
@@ -77,24 +74,13 @@ class SMTPTransport extends EventEmitter {
return this.auth;
}
let hasAuth = false;
let authData = {};
const authData = Object.assign(
{},
this.options.auth && typeof this.options.auth === 'object' ? this.options.auth : {},
authOpts && typeof authOpts === 'object' ? authOpts : {}
);
if (this.options.auth && typeof this.options.auth === 'object') {
Object.keys(this.options.auth).forEach(key => {
hasAuth = true;
authData[key] = this.options.auth[key];
});
}
if (authOpts && typeof authOpts === 'object') {
Object.keys(authOpts).forEach(key => {
hasAuth = true;
authData[key] = authOpts[key];
});
}
if (!hasAuth) {
if (Object.keys(authData).length === 0) {
return false;
}
@@ -103,7 +89,7 @@ class SMTPTransport extends EventEmitter {
if (!authData.service && !authData.user) {
return false;
}
let oauth2 = new XOAuth2(authData, this.logger);
const oauth2 = new XOAuth2(authData, this.logger);
oauth2.provisionCallback = (this.mailer && this.mailer.get('oauth2_provision_cb')) || oauth2.provisionCallback;
oauth2.on('token', token => this.mailer.emit('token', token));
oauth2.on('error', err => this.emit('error', err));
@@ -160,13 +146,10 @@ class SMTPTransport extends EventEmitter {
);
// only copy options if we need to modify it
options = shared.assign(false, options);
Object.keys(socketOptions).forEach(key => {
options[key] = socketOptions[key];
});
options = Object.assign(shared.assign(false, options), socketOptions);
}
let connection = new SMTPConnection(options);
const connection = new SMTPConnection(options);
connection.once('error', err => {
if (returned) {
@@ -182,13 +165,13 @@ class SMTPTransport extends EventEmitter {
return;
}
let timer = setTimeout(() => {
const timer = setTimeout(() => {
if (returned) {
return;
}
returned = true;
// still have not returned, this means we have an unexpected connection close
let err = new Error('Unexpected socket close');
const err = new Error('Unexpected socket close');
if (connection && connection._socket && connection._socket.upgrading) {
// starttls connection errors
err.code = errors.ETLS;
@@ -203,11 +186,11 @@ class SMTPTransport extends EventEmitter {
}
});
let sendMessage = () => {
let envelope = mail.message.getEnvelope();
let messageId = mail.message.messageId();
const sendMessage = () => {
const envelope = mail.message.getEnvelope();
const messageId = mail.message.messageId();
let recipients = [].concat(envelope.to || []);
const recipients = [].concat(envelope.to || []);
if (recipients.length > 3) {
recipients.push('...and ' + recipients.splice(2).length + ' more');
}
@@ -272,7 +255,7 @@ class SMTPTransport extends EventEmitter {
return;
}
let auth = this.getAuth(mail.data.auth);
const auth = this.getAuth(mail.data.auth);
if (auth && (connection.allowsAuth || options.forceAuth)) {
connection.login(auth, err => {
@@ -335,13 +318,10 @@ class SMTPTransport extends EventEmitter {
options.port || ''
);
options = shared.assign(false, options);
Object.keys(socketOptions).forEach(key => {
options[key] = socketOptions[key];
});
options = Object.assign(shared.assign(false, options), socketOptions);
}
let connection = new SMTPConnection(options);
const connection = new SMTPConnection(options);
let returned = false;
connection.once('error', err => {
@@ -361,7 +341,7 @@ class SMTPTransport extends EventEmitter {
return callback(new Error('Connection closed'));
});
let finalize = () => {
const finalize = () => {
if (returned) {
return;
}
@@ -375,7 +355,7 @@ class SMTPTransport extends EventEmitter {
return;
}
let authData = this.getAuth({});
const authData = this.getAuth({});
if (authData && (connection.allowsAuth || options.forceAuth)) {
connection.login(authData, err => {
@@ -392,7 +372,7 @@ class SMTPTransport extends EventEmitter {
finalize();
});
} else if (!authData && connection.allowsAuth && options.forceAuth) {
let err = new Error('Authentication info was not provided');
const err = new Error('Authentication info was not provided');
err.code = errors.ENOAUTH;
returned = true;