mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2025-08-19 12:04:41 +07:00
node_modules: update
This commit is contained in:
22
node_modules/nodemailer/lib/mail-composer/index.js
generated
vendored
22
node_modules/nodemailer/lib/mail-composer/index.js
generated
vendored
@ -100,12 +100,7 @@ class MailComposer {
|
||||
if (attachment.filename) {
|
||||
data.filename = attachment.filename;
|
||||
} else if (!isMessageNode && attachment.filename !== false) {
|
||||
data.filename =
|
||||
(attachment.path || attachment.href || '')
|
||||
.split('/')
|
||||
.pop()
|
||||
.split('?')
|
||||
.shift() || 'attachment-' + (i + 1);
|
||||
data.filename = (attachment.path || attachment.href || '').split('/').pop().split('?').shift() || 'attachment-' + (i + 1);
|
||||
if (data.filename.indexOf('.') < 0) {
|
||||
data.filename += '.' + mimeFuncs.detectExtension(data.contentType);
|
||||
}
|
||||
@ -207,7 +202,7 @@ class MailComposer {
|
||||
content: this.mail.text
|
||||
};
|
||||
}
|
||||
text.contentType = 'text/plain' + (!text.encoding && mimeFuncs.isPlainText(text.content) ? '' : '; charset=utf-8');
|
||||
text.contentType = 'text/plain; charset=utf-8';
|
||||
}
|
||||
|
||||
if (this.mail.watchHtml) {
|
||||
@ -221,7 +216,7 @@ class MailComposer {
|
||||
content: this.mail.watchHtml
|
||||
};
|
||||
}
|
||||
watchHtml.contentType = 'text/watch-html' + (!watchHtml.encoding && mimeFuncs.isPlainText(watchHtml.content) ? '' : '; charset=utf-8');
|
||||
watchHtml.contentType = 'text/watch-html; charset=utf-8';
|
||||
}
|
||||
|
||||
if (this.mail.amp) {
|
||||
@ -232,7 +227,7 @@ class MailComposer {
|
||||
content: this.mail.amp
|
||||
};
|
||||
}
|
||||
amp.contentType = 'text/x-amp-html' + (!amp.encoding && mimeFuncs.isPlainText(amp.content) ? '' : '; charset=utf-8');
|
||||
amp.contentType = 'text/x-amp-html; charset=utf-8';
|
||||
}
|
||||
|
||||
// only include the calendar alternative if there are no attachments
|
||||
@ -261,12 +256,7 @@ class MailComposer {
|
||||
}
|
||||
|
||||
eventObject.filename = false;
|
||||
eventObject.contentType =
|
||||
'text/calendar; charset="utf-8"; method=' +
|
||||
(eventObject.method || 'PUBLISH')
|
||||
.toString()
|
||||
.trim()
|
||||
.toUpperCase();
|
||||
eventObject.contentType = 'text/calendar; charset=utf-8; method=' + (eventObject.method || 'PUBLISH').toString().trim().toUpperCase();
|
||||
if (!eventObject.headers) {
|
||||
eventObject.headers = {};
|
||||
}
|
||||
@ -280,7 +270,7 @@ class MailComposer {
|
||||
content: this.mail.html
|
||||
};
|
||||
}
|
||||
html.contentType = 'text/html' + (!html.encoding && mimeFuncs.isPlainText(html.content) ? '' : '; charset=utf-8');
|
||||
html.contentType = 'text/html; charset=utf-8';
|
||||
}
|
||||
|
||||
[]
|
||||
|
18
node_modules/nodemailer/lib/mime-node/index.js
generated
vendored
18
node_modules/nodemailer/lib/mime-node/index.js
generated
vendored
@ -80,11 +80,7 @@ class MimeNode {
|
||||
/**
|
||||
* Indicates which encoding should be used for header strings: "Q" or "B"
|
||||
*/
|
||||
this.textEncoding = (options.textEncoding || '')
|
||||
.toString()
|
||||
.trim()
|
||||
.charAt(0)
|
||||
.toUpperCase();
|
||||
this.textEncoding = (options.textEncoding || '').toString().trim().charAt(0).toUpperCase();
|
||||
|
||||
/**
|
||||
* Immediate parent for this node (or undefined if not set)
|
||||
@ -441,16 +437,10 @@ class MimeNode {
|
||||
|
||||
getTransferEncoding() {
|
||||
let transferEncoding = false;
|
||||
let contentType = (this.getHeader('Content-Type') || '')
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.trim();
|
||||
let contentType = (this.getHeader('Content-Type') || '').toString().toLowerCase().trim();
|
||||
|
||||
if (this.content) {
|
||||
transferEncoding = (this.getHeader('Content-Transfer-Encoding') || '')
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.trim();
|
||||
transferEncoding = (this.getHeader('Content-Transfer-Encoding') || '').toString().toLowerCase().trim();
|
||||
if (!transferEncoding || !['base64', 'quoted-printable'].includes(transferEncoding)) {
|
||||
if (/^text\//i.test(contentType)) {
|
||||
// If there are no special symbols, no need to modify the text
|
||||
@ -1023,7 +1013,7 @@ class MimeNode {
|
||||
_handleContentType(structured) {
|
||||
this.contentType = structured.value.trim().toLowerCase();
|
||||
|
||||
this.multipart = this.contentType.split('/').reduce((prev, value) => (prev === 'multipart' ? value : false));
|
||||
this.multipart = /^multipart\//i.test(this.contentType) ? this.contentType.substr(this.contentType.indexOf('/') + 1) : false;
|
||||
|
||||
if (this.multipart) {
|
||||
this.boundary = structured.params.boundary = structured.params.boundary || this.boundary || this._generateBoundary();
|
||||
|
12
node_modules/nodemailer/lib/xoauth2/index.js
generated
vendored
12
node_modules/nodemailer/lib/xoauth2/index.js
generated
vendored
@ -163,7 +163,12 @@ class XOAuth2 extends Stream {
|
||||
iat,
|
||||
exp: iat + this.options.serviceRequestTimeout
|
||||
};
|
||||
let token = this.jwtSignRS256(tokenData);
|
||||
let token;
|
||||
try {
|
||||
token = this.jwtSignRS256(tokenData);
|
||||
} catch (err) {
|
||||
return callback(new Error('Can\x27t generate token. Check your auth options'));
|
||||
}
|
||||
|
||||
urlOptions = {
|
||||
grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',
|
||||
@ -355,10 +360,7 @@ class XOAuth2 extends Stream {
|
||||
*/
|
||||
jwtSignRS256(payload) {
|
||||
payload = ['{"alg":"RS256","typ":"JWT"}', JSON.stringify(payload)].map(val => this.toBase64URL(val)).join('.');
|
||||
let signature = crypto
|
||||
.createSign('RSA-SHA256')
|
||||
.update(payload)
|
||||
.sign(this.options.privateKey);
|
||||
let signature = crypto.createSign('RSA-SHA256').update(payload).sign(this.options.privateKey);
|
||||
return payload + '.' + this.toBase64URL(signature);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user