Compare commits

..

10 Commits

Author SHA1 Message Date
6ee7c6af76 1.0.24 2020-01-23 17:31:11 +00:00
aa1750524b fix(core): update 2020-01-23 17:31:10 +00:00
da7c57165e 1.0.23 2020-01-23 16:55:21 +00:00
708c05d1e3 fix(core): update 2020-01-23 16:55:20 +00:00
58b7f602bd 1.0.22 2020-01-21 10:07:07 +00:00
23507b83fc fix(core): update 2020-01-21 10:07:07 +00:00
c160cfd94e 1.0.21 2020-01-21 10:04:29 +00:00
920399a495 fix(core): update 2020-01-21 10:04:28 +00:00
168cb9d5d7 1.0.20 2020-01-13 16:04:25 +00:00
f61e119912 fix(core): update 2020-01-13 16:04:25 +00:00
8 changed files with 189 additions and 159 deletions

View File

@ -3,14 +3,14 @@ image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: "$CI_BUILD_STAGE"
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
- security
- test
- release
- metadata
# ====================
# security stage
@ -18,21 +18,23 @@ stages:
mirror:
stage: security
script:
- npmci git mirror
- npmci git mirror
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
snyk:
image: registry.gitlab.com/hosttoday/ht-docker-node:snyk
stage: security
script:
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
# ====================
# test stage
@ -41,37 +43,40 @@ snyk:
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- priv
- lossless
- docker
- priv
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
- npmci node install stable
- npmci npm publish
only:
- tags
- tags
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
# ====================
# metadata stage
@ -85,18 +90,20 @@ codequality:
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- docker
- priv
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
- npmci trigger
only:
- tags
- tags
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
pages:
stage: metadata
@ -107,6 +114,7 @@ pages:
- npmci npm install
- npmci command tsdoc
tags:
- lossless
- docker
- notpriv
only:
@ -114,5 +122,5 @@ pages:
artifacts:
expire_in: 1 week
paths:
- public
- public
allow_failure: true

4
.snyk Normal file
View File

@ -0,0 +1,4 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.13.5
ignore: {}
patch: {}

202
package-lock.json generated
View File

@ -1,28 +1,28 @@
{
"name": "@mojoio/mailgun",
"version": "1.0.19",
"version": "1.0.24",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@apiglobal/typedrequest-interfaces": {
"version": "1.0.7",
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest-interfaces/-/typedrequest-interfaces-1.0.7.tgz",
"integrity": "sha512-yPl0UcLFMwSQL7bK52wVjkgvadC+x2YS3+7T15V1A1dXNxa96yd4WX1fqcKqwnBrvYexq/8FaxWGi98tZ0oNwg==",
"version": "1.0.10",
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest-interfaces/-/typedrequest-interfaces-1.0.10.tgz",
"integrity": "sha512-RGG7s/mP7MGVz3g+y/kvH0ZrVWY/vJy3BignsUv3DLtoFvfWnvxqT2WWqSJhyXCOSeR/nzVsGxFgKAI/ZVZKdg==",
"dev": true
},
"@babel/code-frame": {
"version": "7.5.5",
"resolved": "https://verdaccio.lossless.one/@babel%2fcode-frame/-/code-frame-7.5.5.tgz",
"integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
"version": "7.8.3",
"resolved": "https://verdaccio.lossless.one/@babel%2fcode-frame/-/code-frame-7.8.3.tgz",
"integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==",
"dev": true,
"requires": {
"@babel/highlight": "^7.0.0"
"@babel/highlight": "^7.8.3"
}
},
"@babel/highlight": {
"version": "7.5.0",
"resolved": "https://verdaccio.lossless.one/@babel%2fhighlight/-/highlight-7.5.0.tgz",
"integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==",
"version": "7.8.3",
"resolved": "https://verdaccio.lossless.one/@babel%2fhighlight/-/highlight-7.8.3.tgz",
"integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==",
"dev": true,
"requires": {
"chalk": "^2.0.0",
@ -99,14 +99,14 @@
}
},
"@pushrocks/lik": {
"version": "3.0.11",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.11.tgz",
"integrity": "sha512-SDKRPj9+xBTqozlDPcA7O6BcccM1Tw/sXPVP+OnhNxCubDZ/L2kGNpPpqm43NJUoNxSSo5wdBw4N7MAFYCGdVg==",
"version": "3.0.13",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.13.tgz",
"integrity": "sha512-YDxYoh2UksEfUxcjSjTwLsW5j852E5FrMG62CUi1I7ZpBxf96b7P1t2pRWsQsNnHRz6FHckW/A1V6XKASB+jZA==",
"dev": true,
"requires": {
"@pushrocks/smartdelay": "^2.0.3",
"@pushrocks/smartpromise": "^3.0.2",
"@pushrocks/smartrx": "^2.0.3",
"@pushrocks/smartdelay": "^2.0.6",
"@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartrx": "^2.0.5",
"@pushrocks/smarttime": "^3.0.12",
"@types/minimatch": "^3.0.3",
"minimatch": "^3.0.4",
@ -147,12 +147,12 @@
}
},
"@pushrocks/smartdelay": {
"version": "2.0.3",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdelay/-/smartdelay-2.0.3.tgz",
"integrity": "sha512-TXKDDqsc7sBTLl+oiYNaF6IdNk1n70i8ur8QfwcUU6tegTnrEkvMWy9h5Zdty/fq1ioCNpKLvuXoA+fgYVwKGQ==",
"version": "2.0.6",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdelay/-/smartdelay-2.0.6.tgz",
"integrity": "sha512-4wUnzWNhRPODpaaL5GuRaje/C5dg+TMhBxmr57PKc2fqYpy6azWJwonf/s5xpcbJLCPJRbj1x8M5MqgCFq2uvg==",
"dev": true,
"requires": {
"@pushrocks/smartpromise": "^3.0.2"
"@pushrocks/smartpromise": "^3.0.6"
}
},
"@pushrocks/smartevent": {
@ -248,9 +248,9 @@
}
},
"@pushrocks/smartmail": {
"version": "1.0.8",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartmail/-/smartmail-1.0.8.tgz",
"integrity": "sha512-ILUmtrJ0TlBe183/LXmJYAq268NueB6A0vA75qqR9+DeZjBAuYOcIAJxLOXyxtMcG/pSnr+AKTDBzsRn/RMz1g==",
"version": "1.0.12",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartmail/-/smartmail-1.0.12.tgz",
"integrity": "sha512-Fv0r8w4w94jKvIuRddFKZZ5OY+jqxFyjWmUaeZFYGXkXyCIUpNbmnJgK0AwZlchPs4N4gH8BDx75QtjuhcHdbw==",
"requires": {
"@pushrocks/smartfile": "^7.0.6",
"@pushrocks/smartmustache": "^2.0.9"
@ -330,11 +330,11 @@
}
},
"@pushrocks/smartstring": {
"version": "3.0.17",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartstring/-/smartstring-3.0.17.tgz",
"integrity": "sha512-60JQptpgw+PjxoC5Gx+Y9m3/dtMstHC5ElpdJhIlbJ7dQV7LkCGSonLAG+NZhPbvrhow2KZ3fob8stW0Iuy3JQ==",
"version": "3.0.18",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartstring/-/smartstring-3.0.18.tgz",
"integrity": "sha512-34Ca5HW6w8fcG2sdbRVDViOZ0vdOHXc/1Qof2KhM5bvWFajU6VASlJjCYNJBrjGg9VCeC2rH6bGIgvd7prSRkg==",
"requires": {
"crypto-random-string": "^3.0.1",
"crypto-random-string": "^3.1.0",
"js-base64": "^2.5.1",
"normalize-newline": "^3.0.0",
"randomatic": "^3.1.1",
@ -432,9 +432,9 @@
}
},
"@types/luxon": {
"version": "1.15.2",
"resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.15.2.tgz",
"integrity": "sha512-zHPoyVrLvNaiMRYdhmh88Rn489ZgAgbc6iLxR5Yi0VCNfeNYHcszbhJV2vDHLNrVGy35BPtWBRn4OP2F9BBvFw==",
"version": "1.21.0",
"resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.21.0.tgz",
"integrity": "sha512-Zhrf65tpjOlVIYrUhX9eu1VzRo8iixQDLFPbfqFxPpG4pBTNNPZ2BFhYE0IAsDfW9GWg+RcrUqiLwrGJH4rq4w==",
"dev": true
},
"@types/minimatch": {
@ -444,9 +444,9 @@
"dev": true
},
"@types/node": {
"version": "13.1.6",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-13.1.6.tgz",
"integrity": "sha512-Jg1F+bmxcpENHP23sVKkNuU3uaxPnsBMW0cLjleiikFKomJQbsn0Cqk2yDvQArqzZN6ABfBkZ0To7pQ8sLdWDg=="
"version": "13.1.8",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-13.1.8.tgz",
"integrity": "sha512-6XzyyNM9EKQW4HKuzbo/CkOIjn/evtCmsU+MUM1xDfJ+3/rNjBttM1NgN7AOQvN6tP1Sl1D1PIKMreTArnxM9A=="
},
"@types/through2": {
"version": "2.0.34",
@ -463,9 +463,9 @@
"dev": true
},
"@types/yargs": {
"version": "12.0.13",
"resolved": "https://verdaccio.lossless.one/@types%2fyargs/-/yargs-12.0.13.tgz",
"integrity": "sha512-CXlavd8Q7ZQkB7sMpx9QKC/B7gUsjtftxMHNr7qGJaDiZZ+Qmhwe4Zt3aS9aXF7cn6BYQuFlKU1UlrebyKsh9g==",
"version": "12.0.15",
"resolved": "https://verdaccio.lossless.one/@types%2fyargs/-/yargs-12.0.15.tgz",
"integrity": "sha512-stWBBTD1IX7iMc/L38Azs0P5vHl6AcuiV8fuuXXgQVLmlXJ7igykYuroMHgpGrD1vwrk56yEBD6dIM5or1Robw==",
"dev": true
},
"agentkeepalive": {
@ -500,9 +500,9 @@
}
},
"arg": {
"version": "4.1.1",
"resolved": "https://verdaccio.lossless.one/arg/-/arg-4.1.1.tgz",
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
"version": "4.1.2",
"resolved": "https://verdaccio.lossless.one/arg/-/arg-4.1.2.tgz",
"integrity": "sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==",
"dev": true
},
"argparse": {
@ -674,9 +674,9 @@
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"cron": {
"version": "1.7.2",
"resolved": "https://verdaccio.lossless.one/cron/-/cron-1.7.2.tgz",
"integrity": "sha512-+SaJ2OfeRvfQqwXQ2kgr0Y5pzBR/lijf5OpnnaruwWnmI799JfWr2jN2ItOV9s3A/+TFOt6mxvKzQq5F0Jp6VQ==",
"version": "1.8.1",
"resolved": "https://verdaccio.lossless.one/cron/-/cron-1.8.1.tgz",
"integrity": "sha512-T60noGxx/2h4FDRBf6449FrINbitSCwIZEcDIwbIPX+mkNkNH0t/4yw0RBGpOiA5yveM4koNHcAuIFopp7vbuA==",
"dev": true,
"requires": {
"moment-timezone": "^0.5.x"
@ -696,11 +696,11 @@
}
},
"crypto-random-string": {
"version": "3.0.1",
"resolved": "https://verdaccio.lossless.one/crypto-random-string/-/crypto-random-string-3.0.1.tgz",
"integrity": "sha512-dUL0cJ4PBLanJGJQBHQUkvZ3C4q13MXzl54oRqAIiJGiNkOZ4JDwkg/SBo7daGghzlJv16yW1p/4lIQukmbedA==",
"version": "3.1.0",
"resolved": "https://verdaccio.lossless.one/crypto-random-string/-/crypto-random-string-3.1.0.tgz",
"integrity": "sha512-Tip3yGB+bA7B0W8E4K4mNf2rZhu5r2G5Tb89/utEl5tP1QuLjTF/S9a1b8ifDrR4ORc9Utf6tscpSEtBY3YcPQ==",
"requires": {
"type-fest": "^0.5.2"
"type-fest": "^0.8.1"
}
},
"debug": {
@ -746,9 +746,9 @@
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
},
"diff": {
"version": "4.0.1",
"resolved": "https://verdaccio.lossless.one/diff/-/diff-4.0.1.tgz",
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
"version": "4.0.2",
"resolved": "https://verdaccio.lossless.one/diff/-/diff-4.0.2.tgz",
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
"dev": true
},
"end-of-stream": {
@ -862,9 +862,9 @@
}
},
"glob": {
"version": "7.1.5",
"resolved": "https://verdaccio.lossless.one/glob/-/glob-7.1.5.tgz",
"integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==",
"version": "7.1.6",
"resolved": "https://verdaccio.lossless.one/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
@ -880,9 +880,9 @@
"integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ=="
},
"handlebars": {
"version": "4.7.1",
"resolved": "https://verdaccio.lossless.one/handlebars/-/handlebars-4.7.1.tgz",
"integrity": "sha512-2dd6soo60cwKNJ90VewNLIzdZPR/E2YhszOTgHpN9V0YuwZk7x33/iZoIBnASwDFVHMY7iJ6NPL8d9f/DWYCTA==",
"version": "4.7.2",
"resolved": "https://verdaccio.lossless.one/handlebars/-/handlebars-4.7.2.tgz",
"integrity": "sha512-4PwqDL2laXtTWZghzzCtunQUTLbo31pcCJrd/B/9JP8XbhVzpS5ZXuKqlOzsd1rtcaLo4KqAn8nl8mkknS4MHw==",
"requires": {
"neo-async": "^2.6.0",
"optimist": "^0.6.1",
@ -982,9 +982,9 @@
}
},
"kind-of": {
"version": "6.0.2",
"resolved": "https://verdaccio.lossless.one/kind-of/-/kind-of-6.0.2.tgz",
"integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA=="
"version": "6.0.3",
"resolved": "https://verdaccio.lossless.one/kind-of/-/kind-of-6.0.3.tgz",
"integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw=="
},
"lcid": {
"version": "2.0.0",
@ -1020,9 +1020,9 @@
}
},
"luxon": {
"version": "1.19.3",
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.19.3.tgz",
"integrity": "sha512-YwTDjGRQC0QC9Iya2g2eKZfgEFqRId4ZoLHORQcfTMB/5xrTx427V7ZPjQJ1vzvhA2vJfG2bh1Kv8V8IFMWCUA==",
"version": "1.21.3",
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.21.3.tgz",
"integrity": "sha512-lLRwNcNnkZLuv13A1FUuZRZmTWF7ro2ricYvb0L9cvBYHPvZhQdKwrYnZzi103D2XKmlVmxWpdn2wfIiOt2YEw==",
"dev": true
},
"make-error": {
@ -1089,9 +1089,9 @@
}
},
"minimist": {
"version": "0.0.8",
"resolved": "https://verdaccio.lossless.one/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
"version": "0.0.10",
"resolved": "https://verdaccio.lossless.one/minimist/-/minimist-0.0.10.tgz",
"integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8="
},
"mkdirp": {
"version": "0.5.1",
@ -1100,6 +1100,14 @@
"dev": true,
"requires": {
"minimist": "0.0.8"
},
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "https://verdaccio.lossless.one/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
}
}
},
"moment": {
@ -1248,9 +1256,9 @@
"dev": true
},
"p-limit": {
"version": "2.2.1",
"resolved": "https://verdaccio.lossless.one/p-limit/-/p-limit-2.2.1.tgz",
"integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==",
"version": "2.2.2",
"resolved": "https://verdaccio.lossless.one/p-limit/-/p-limit-2.2.2.tgz",
"integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==",
"dev": true,
"requires": {
"p-try": "^2.0.0"
@ -1321,9 +1329,9 @@
}
},
"readable-stream": {
"version": "3.4.0",
"resolved": "https://verdaccio.lossless.one/readable-stream/-/readable-stream-3.4.0.tgz",
"integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
"version": "3.5.0",
"resolved": "https://verdaccio.lossless.one/readable-stream/-/readable-stream-3.5.0.tgz",
"integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
@ -1343,9 +1351,9 @@
"dev": true
},
"resolve": {
"version": "1.14.2",
"resolved": "https://verdaccio.lossless.one/resolve/-/resolve-1.14.2.tgz",
"integrity": "sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ==",
"version": "1.15.0",
"resolved": "https://verdaccio.lossless.one/resolve/-/resolve-1.15.0.tgz",
"integrity": "sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==",
"dev": true,
"requires": {
"path-parse": "^1.0.6"
@ -1362,9 +1370,9 @@
}
},
"rxjs": {
"version": "6.5.3",
"resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.5.3.tgz",
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
"version": "6.5.4",
"resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.5.4.tgz",
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
@ -1428,9 +1436,9 @@
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
},
"source-map-support": {
"version": "0.5.13",
"resolved": "https://verdaccio.lossless.one/source-map-support/-/source-map-support-0.5.13.tgz",
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
"version": "0.5.16",
"resolved": "https://verdaccio.lossless.one/source-map-support/-/source-map-support-0.5.16.tgz",
"integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
@ -1507,16 +1515,16 @@
}
},
"ts-node": {
"version": "8.4.1",
"resolved": "https://verdaccio.lossless.one/ts-node/-/ts-node-8.4.1.tgz",
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
"version": "8.6.2",
"resolved": "https://verdaccio.lossless.one/ts-node/-/ts-node-8.6.2.tgz",
"integrity": "sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==",
"dev": true,
"requires": {
"arg": "^4.1.0",
"diff": "^4.0.1",
"make-error": "^1.1.1",
"source-map-support": "^0.5.6",
"yn": "^3.0.0"
"yn": "3.1.1"
}
},
"tslib": {
@ -1526,9 +1534,9 @@
"dev": true
},
"tslint": {
"version": "5.20.1",
"resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.20.1.tgz",
"integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==",
"version": "6.0.0",
"resolved": "https://verdaccio.lossless.one/tslint/-/tslint-6.0.0.tgz",
"integrity": "sha512-9nLya8GBtlFmmFMW7oXXwoXS1NkrccqTqAtwXzdPV9e2mqSEvCki6iHL/Fbzi5oqbugshzgGPk7KBb2qNP1DSA==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
@ -1542,7 +1550,7 @@
"mkdirp": "^0.5.1",
"resolve": "^1.3.2",
"semver": "^5.3.0",
"tslib": "^1.8.0",
"tslib": "^1.10.0",
"tsutils": "^2.29.0"
}
},
@ -1568,20 +1576,20 @@
"dev": true
},
"type-fest": {
"version": "0.5.2",
"resolved": "https://verdaccio.lossless.one/type-fest/-/type-fest-0.5.2.tgz",
"integrity": "sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw=="
"version": "0.8.1",
"resolved": "https://verdaccio.lossless.one/type-fest/-/type-fest-0.8.1.tgz",
"integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA=="
},
"typescript": {
"version": "3.6.4",
"resolved": "https://verdaccio.lossless.one/typescript/-/typescript-3.6.4.tgz",
"integrity": "sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg==",
"version": "3.7.5",
"resolved": "https://verdaccio.lossless.one/typescript/-/typescript-3.7.5.tgz",
"integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==",
"dev": true
},
"uglify-js": {
"version": "3.7.5",
"resolved": "https://verdaccio.lossless.one/uglify-js/-/uglify-js-3.7.5.tgz",
"integrity": "sha512-GFZ3EXRptKGvb/C1Sq6nO1iI7AGcjyqmIyOw0DrD0675e+NNbGO72xmMM2iEBdFbxaTLo70NbjM/Wy54uZIlsg==",
"version": "3.7.6",
"resolved": "https://verdaccio.lossless.one/uglify-js/-/uglify-js-3.7.6.tgz",
"integrity": "sha512-yYqjArOYSxvqeeiYH2VGjZOqq6SVmhxzaPjJC1W2F9e+bqvFL9QXQ2osQuKUFjM2hGjKG2YclQnRKWQSt/nOTQ==",
"optional": true,
"requires": {
"commander": "~2.20.3",

View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/mailgun",
"version": "1.0.19",
"version": "1.0.24",
"private": false,
"description": "an api abstraction package for mailgun",
"main": "dist/index.js",
@ -18,14 +18,14 @@
"@pushrocks/qenv": "^4.0.6",
"@pushrocks/tapbundle": "^3.2.0",
"@types/node": "^13.1.6",
"tslint": "^5.20.1",
"tslint": "^6.0.0",
"tslint-config-prettier": "^1.15.0"
},
"dependencies": {
"@pushrocks/smartfile": "^7.0.6",
"@pushrocks/smartmail": "^1.0.8",
"@pushrocks/smartmail": "^1.0.11",
"@pushrocks/smartrequest": "^1.1.47",
"@pushrocks/smartstring": "^3.0.17"
"@pushrocks/smartstring": "^3.0.18"
},
"files": [
"ts/**/*",

View File

@ -5,12 +5,13 @@ import * as smartmail from '@pushrocks/smartmail';
const testQenv = new Qenv('./', './.nogit');
import * as mailgun from '../ts/index';
import { IMailgunMessage } from '../ts/index';
let testMailgunAccount: mailgun.MailgunAccount;
let testSmartmail: smartmail.Smartmail;
let testSmartmail: smartmail.Smartmail<IMailgunMessage>;
tap.test('first test', async () => {
tap.test('should create a mailgun account', async () => {
testMailgunAccount = new mailgun.MailgunAccount(testQenv.getEnvVarOnDemand('MAILGUN_API_TOKEN'));
expect(testMailgunAccount).to.be.instanceOf(mailgun.MailgunAccount);
});
@ -30,9 +31,11 @@ tap.test('should send a smartmail', async () => {
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==');
result.options.subject = 'hi there. This is a testmail with attachment';
result.options.from = 'noreply@mail.lossless.com';
testMailgunAccount.sendSmartMail(result, 'sandbox@mail.git.zone');
if (result) {
result.options.subject = 'hi there. This is a testmail with attachment';
result.options.from = 'noreply@mail.lossless.com';
testMailgunAccount.sendSmartMail(result, 'sandbox@mail.git.zone');
}
});
tap.start();

View File

@ -15,14 +15,14 @@ export interface IMailgunMessage {
'X-Gm-Message-State': string;
'body-plain': string;
attachments: Array<{
url: string,
'content-type': string,
name: string,
size: number
}>;
url: string;
'content-type': string;
name: string;
size: number;
}>;
'body-html': string;
'Mime-Version': string;
Date: string,
Date: string;
'Message-Id': string;
'Content-Type': string;
'X-Google-Smtp-Source': string;

View File

@ -43,5 +43,5 @@ export interface IMailgunNotification {
'stripped-signature': string;
// Lossless specific
X-Lossless-Auth: string
"X-Lossless-Auth": string;
}

View File

@ -51,7 +51,7 @@ export class MailgunAccount {
/**
* sends a SmartMail
*/
public async sendSmartMail(smartmailArg: plugins.smartmail.Smartmail, toArg: string, dataArg = {}) {
public async sendSmartMail(smartmailArg: plugins.smartmail.Smartmail<interfaces.IMailgunMessage>, toArg: string, dataArg = {}) {
const domain = smartmailArg.options.from.split('@')[1];
const formFields: plugins.smartrequest.IFormField[] = [
{
@ -98,22 +98,29 @@ export class MailgunAccount {
public async retrieveSmartMailFromMessageUrl(messageUrlArg: string) {
const response = await this.getRequest(messageUrlArg);
if (response.statusCode === 404) {
console.log(response.body.message);
return null;
}
const responseBody: interfaces.IMailgunMessage = response.body;
const smartmail = new plugins.smartmail.Smartmail({
const smartmail = new plugins.smartmail.Smartmail<interfaces.IMailgunMessage>({
from: responseBody.From,
body: responseBody["body-html"],
subject: responseBody.Subject,
creationObjectRef: responseBody
});
// lets care about attachments
for (const attachmentInfo of responseBody.attachments) {
const attachmentName = attachmentInfo.name;
const attachmentContents = await this.getRequest(attachmentInfo.url, true);
smartmail.addAttachment(new plugins.smartfile.Smartfile({
path: `./${attachmentName}`,
base: `./${attachmentName}`,
contentBuffer: attachmentContents.body
}));
if (responseBody.attachments && responseBody.attachments instanceof Array) {
for (const attachmentInfo of responseBody.attachments) {
const attachmentName = attachmentInfo.name;
const attachmentContents = await this.getRequest(attachmentInfo.url, true);
smartmail.addAttachment(new plugins.smartfile.Smartfile({
path: `./${attachmentName}`,
base: `./${attachmentName}`,
contentBuffer: attachmentContents.body
}));
}
}
return smartmail;