fix(core): update

This commit is contained in:
Philipp Kunz 2020-08-11 14:47:25 +00:00
parent 13e064207f
commit b08b9abb38
4 changed files with 10029 additions and 409 deletions

10387
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,17 +13,17 @@
"format": "(gitzone format)"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.22",
"@gitzone/tstest": "^1.0.15",
"@pushrocks/qenv": "^4.0.6",
"@pushrocks/tapbundle": "^3.2.1",
"@types/node": "^13.13.4",
"tslint": "^6.1.1",
"@gitzone/tsbuild": "^2.1.25",
"@gitzone/tstest": "^1.0.43",
"@pushrocks/qenv": "^4.0.10",
"@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.0.27",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0"
},
"dependencies": {
"@pushrocks/smartfile": "^7.0.12",
"@pushrocks/smartmail": "^1.0.11",
"@pushrocks/smartfile": "^8.0.0",
"@pushrocks/smartmail": "^1.0.18",
"@pushrocks/smartrequest": "^1.1.47",
"@pushrocks/smartstring": "^3.0.18"
},

View File

@ -28,6 +28,17 @@ tap.test('should send a smartmail', async () => {
await testMailgunAccount.sendSmartMail(testSmartmail, 'Sandbox Team <sandbox@mail.git.zone>');
});
tap.test('should send a smartmail with empty body', async () => {
const emptyBodySmartmail = new smartmail.Smartmail<IMailgunMessage>({
body: '',
from: 'Lossless GmbH <noreply@mail.lossless.com>',
subject: 'A message with no body from @mojoio/mailgun test'
});
console.log('ok');
await testMailgunAccount.sendSmartMail(emptyBodySmartmail, 'Sandbox Team <sandbox@mail.git.zone>');
console.log('hey');
});
tap.test('should retrieve a mail using a retrieval url', async () => {
const result = await testMailgunAccount.retrieveSmartMailFromMessageUrl(
'https://sw.api.mailgun.net/v3/domains/mail.lossless.one/messages/AgMFnnnAKC8xp_dDa79LyoxhloxtaVmnRA=='

View File

@ -19,7 +19,8 @@ export class MailgunAccount {
headers: {
Authorization: `Basic ${plugins.smartstring.base64.encode(`api:${this.apiToken}`)}`,
'Content-Type': 'application/json'
}
},
keepAlive: false
};
let response: plugins.smartrequest.IExtendedIncomingMessage;
if (!binaryArg) {
@ -37,7 +38,8 @@ export class MailgunAccount {
{
headers: {
Authorization: `Basic ${plugins.smartstring.base64.encode(`api:${this.apiToken}`)}`
}
},
keepAlive: false
},
formFields
);
@ -68,13 +70,23 @@ export class MailgunAccount {
name: 'subject',
type: 'string',
payload: smartmailArg.getSubject(dataArg)
},
{
}
];
if (smartmailArg.getBody(dataArg)) {
formFields.push({
name: 'html',
type: 'string',
payload: smartmailArg.getBody(dataArg)
}
];
});
} else {
console.log('message has no body');
formFields.push({
name: 'html',
type: 'string',
payload: 'The sender did not provide a bodytext.'
});
}
console.log(smartmailArg.attachments);