fix(core): update

This commit is contained in:
Philipp Kunz 2020-08-13 01:37:26 +00:00
parent 0412cecfe5
commit 108f483823
6 changed files with 143 additions and 150 deletions

View File

@ -19,23 +19,35 @@ mirror:
stage: security stage: security
script: script:
- npmci git mirror - npmci git mirror
only:
- tags
tags: tags:
- lossless - lossless
- docker - docker
- notpriv - notpriv
audit: auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare - npmci npm prepare
- npmci command npm install --ignore-scripts - npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org - npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high - npmci command npm audit --audit-level=high --only=dev
tags: tags:
- lossless
- docker - docker
- notpriv allow_failure: true
# ==================== # ====================
# test stage # test stage
@ -50,9 +62,7 @@ testStable:
- npmci npm test - npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- lossless
- docker - docker
- priv
testBuild: testBuild:
stage: test stage: test
@ -63,9 +73,7 @@ testBuild:
- npmci command npm run build - npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- lossless
- docker - docker
- notpriv
release: release:
stage: release stage: release
@ -85,6 +93,8 @@ release:
codequality: codequality:
stage: metadata stage: metadata
allow_failure: true allow_failure: true
only:
- tags
script: script:
- npmci command npm install -g tslint typescript - npmci command npm install -g tslint typescript
- npmci npm prepare - npmci npm prepare

View File

@ -15,7 +15,7 @@
"properties": { "properties": {
"projectType": { "projectType": {
"type": "string", "type": "string",
"enum": ["website", "element", "service", "npm"] "enum": ["website", "element", "service", "npm", "wcc"]
} }
} }
} }

229
package-lock.json generated
View File

@ -1160,9 +1160,9 @@
} }
}, },
"@gitzone/tsbundle": { "@gitzone/tsbundle": {
"version": "1.0.73", "version": "1.0.78",
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbundle/-/tsbundle-1.0.73.tgz", "resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbundle/-/tsbundle-1.0.78.tgz",
"integrity": "sha512-mGdjsG9QhUvwcGArNqF2bqT67bWVhl7MyrJyxD0a7quGtKWt4MxHHBmPW/rBnBtlhlhEYvxuhdpTDrJh+Rdllg==", "integrity": "sha512-QcjzUPYfp7w2uaNom2eOFiBBPabVOqmaI7Cun1P+BBB+a8JwNlpyNOwDY6cPr2MEW2t9Picbiz9yyqkG1qYrtw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/core": "^7.11.1", "@babel/core": "^7.11.1",
@ -1171,24 +1171,23 @@
"@babel/plugin-transform-runtime": "^7.11.0", "@babel/plugin-transform-runtime": "^7.11.0",
"@babel/preset-env": "^7.11.0", "@babel/preset-env": "^7.11.0",
"@babel/runtime": "^7.11.2", "@babel/runtime": "^7.11.2",
"@pushrocks/early": "^3.0.3", "@pushrocks/early": "^3.0.6",
"@pushrocks/smartcli": "^3.0.12", "@pushrocks/smartcli": "^3.0.12",
"@pushrocks/smartfile": "^8.0.0", "@pushrocks/smartfile": "^8.0.0",
"@pushrocks/smartlog": "^2.0.36", "@pushrocks/smartlog": "^2.0.36",
"@pushrocks/smartlog-destination-local": "^8.0.8", "@pushrocks/smartlog-destination-local": "^8.0.8",
"@pushrocks/smartparcel": "^1.0.5", "@pushrocks/smartparcel": "^1.0.5",
"@rollup/plugin-commonjs": "^12.0.0", "@rollup/plugin-commonjs": "^14.0.0",
"@rollup/plugin-json": "^4.1.0", "@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^8.4.0", "@rollup/plugin-node-resolve": "^8.4.0",
"@rollup/plugin-typescript": "^4.1.2", "@rollup/plugin-typescript": "^5.0.2",
"@types/html-minifier": "^3.5.3", "@types/html-minifier": "^4.0.0",
"@types/node": "^14.0.27", "@types/node": "^14.0.27",
"html-minifier": "^4.0.0", "html-minifier": "^4.0.0",
"rollup": "^2.23.1", "rollup": "^2.23.1",
"rollup-plugin-babel": "^4.4.0", "rollup-plugin-babel": "^4.4.0",
"rollup-plugin-sourcemaps": "^0.6.2", "rollup-plugin-sourcemaps": "^0.6.2",
"rollup-plugin-terser": "^5.3.0", "rollup-plugin-terser": "^6.1.0",
"terser": "^4.7.0",
"typescript": "^3.9.7" "typescript": "^3.9.7"
} }
}, },
@ -1258,78 +1257,24 @@
} }
}, },
"@gitzone/tstest": { "@gitzone/tstest": {
"version": "1.0.43", "version": "1.0.44",
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftstest/-/tstest-1.0.43.tgz", "resolved": "https://verdaccio.lossless.one/@gitzone%2ftstest/-/tstest-1.0.44.tgz",
"integrity": "sha512-wuNBhBDUHHb1TOLQ+QAtUUAhR9Y3uXFR9J0L/KW9DIhh4LPxFdje1tPUGqUbXCWCJ3bt4AWtVBd39K5Z8lSEXQ==", "integrity": "sha512-IzQ9mEboN17Vgm/ecW2GtJa8FsnxDawD0PTeWfvtFbS4KNcqOxVM/gkkO7H4f1eJuzDaMvKWlsjBt2DBRhKqSg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@gitzone/tsbundle": "^1.0.72", "@gitzone/tsbundle": "^1.0.78",
"@gitzone/tsrun": "^1.2.12", "@gitzone/tsrun": "^1.2.12",
"@pushrocks/consolecolor": "^2.0.1", "@pushrocks/consolecolor": "^2.0.1",
"@pushrocks/smartbrowser": "^1.0.17", "@pushrocks/smartbrowser": "^1.0.17",
"@pushrocks/smartdelay": "^2.0.9", "@pushrocks/smartdelay": "^2.0.10",
"@pushrocks/smartexpress": "^3.0.73", "@pushrocks/smartexpress": "^3.0.76",
"@pushrocks/smartfile": "^7.0.6", "@pushrocks/smartfile": "^8.0.0",
"@pushrocks/smartlog": "^2.0.19", "@pushrocks/smartlog": "^2.0.36",
"@pushrocks/smartpromise": "^3.0.6", "@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartshell": "^2.0.25", "@pushrocks/smartshell": "^2.0.25",
"@pushrocks/tapbundle": "^3.2.9", "@pushrocks/tapbundle": "^3.2.9",
"@types/figures": "^3.0.1", "@types/figures": "^3.0.1",
"figures": "^3.0.0" "figures": "^3.0.0"
},
"dependencies": {
"@pushrocks/smartfile": {
"version": "7.0.12",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartfile/-/smartfile-7.0.12.tgz",
"integrity": "sha512-/4T4K07WqOXGvQQ/VFyRMUd8kN1RdqQgmrqHjZE/vMDLz7RYsqU9FlEN6OGX1G1E6pR9IdHnT4ClXPlvzClHYg==",
"dev": true,
"requires": {
"@pushrocks/smarthash": "^2.1.6",
"@pushrocks/smartmime": "^1.0.3",
"@pushrocks/smartpath": "^4.0.1",
"@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartrequest": "^1.1.47",
"@types/fs-extra": "^8.1.0",
"fs-extra": "^8.1.0",
"glob": "^7.1.6",
"js-yaml": "^3.13.1"
}
},
"@types/fs-extra": {
"version": "8.1.1",
"resolved": "https://verdaccio.lossless.one/@types%2ffs-extra/-/fs-extra-8.1.1.tgz",
"integrity": "sha512-TcUlBem321DFQzBNuz8p0CLLKp0VvF/XH9E4KHNmgwyp4E3AfgI5cjiIVZWlbfThBop2qxFIh4+LeY6hVWWZ2w==",
"dev": true,
"requires": {
"@types/node": "*"
}
},
"fs-extra": {
"version": "8.1.0",
"resolved": "https://verdaccio.lossless.one/fs-extra/-/fs-extra-8.1.0.tgz",
"integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
"dev": true,
"requires": {
"graceful-fs": "^4.2.0",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
},
"jsonfile": {
"version": "4.0.0",
"resolved": "https://verdaccio.lossless.one/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.6"
}
},
"universalify": {
"version": "0.1.2",
"resolved": "https://verdaccio.lossless.one/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"dev": true
}
} }
}, },
"@iarna/toml": { "@iarna/toml": {
@ -2234,9 +2179,9 @@
} }
}, },
"@rollup/plugin-commonjs": { "@rollup/plugin-commonjs": {
"version": "12.0.0", "version": "14.0.0",
"resolved": "https://verdaccio.lossless.one/@rollup%2fplugin-commonjs/-/plugin-commonjs-12.0.0.tgz", "resolved": "https://verdaccio.lossless.one/@rollup%2fplugin-commonjs/-/plugin-commonjs-14.0.0.tgz",
"integrity": "sha512-8+mDQt1QUmN+4Y9D3yCG8AJNewuTSLYPJVzKKUZ+lGeQrI+bV12Tc5HCyt2WdlnG6ihIL/DPbKRJlB40DX40mw==", "integrity": "sha512-+PSmD9ePwTAeU106i9FRdc+Zb3XUWyW26mo5Atr2mk82hor8+nPwkztEjFo8/B1fJKfaQDg9aM2bzQkjhi7zOw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@rollup/pluginutils": "^3.0.8", "@rollup/pluginutils": "^3.0.8",
@ -2284,9 +2229,9 @@
} }
}, },
"@rollup/plugin-typescript": { "@rollup/plugin-typescript": {
"version": "4.1.2", "version": "5.0.2",
"resolved": "https://verdaccio.lossless.one/@rollup%2fplugin-typescript/-/plugin-typescript-4.1.2.tgz", "resolved": "https://verdaccio.lossless.one/@rollup%2fplugin-typescript/-/plugin-typescript-5.0.2.tgz",
"integrity": "sha512-+7UlGat/99e2JbmGNnIauxwEhYLwrL7adO/tSJxUN57xrrS3Ps+ZzYpLCDGPZJ57j+ZJTZLLN89KXW9JMEB+jg==", "integrity": "sha512-CkS028Itwjqm1uLbFVfpJgtVtnNvZ+og/m6UlNRR5wOOnNTWPcVQzOu5xGdEX+WWJxdvWIqUq2uR/RBt2ZipWg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@rollup/pluginutils": "^3.0.1", "@rollup/pluginutils": "^3.0.1",
@ -2542,9 +2487,9 @@
} }
}, },
"@types/html-minifier": { "@types/html-minifier": {
"version": "3.5.3", "version": "4.0.0",
"resolved": "https://verdaccio.lossless.one/@types%2fhtml-minifier/-/html-minifier-3.5.3.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fhtml-minifier/-/html-minifier-4.0.0.tgz",
"integrity": "sha512-j1P/4PcWVVCPEy5lofcHnQ6BtXz9tHGiFPWzqm7TtGuWZEfCHEP446HlkSNc9fQgNJaJZ6ewPtp2aaFla/Uerg==", "integrity": "sha512-eFnGhrKmjWBlnSGNtunetE3UU2Tc/LUl92htFslSSTmpp9EKHQVcYQadCyYfnzUEFB5G/3wLWo/USQS/mEPKrA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/clean-css": "*", "@types/clean-css": "*",
@ -2902,14 +2847,15 @@
} }
}, },
"asn1.js": { "asn1.js": {
"version": "4.10.1", "version": "5.4.1",
"resolved": "https://verdaccio.lossless.one/asn1.js/-/asn1.js-4.10.1.tgz", "resolved": "https://verdaccio.lossless.one/asn1.js/-/asn1.js-5.4.1.tgz",
"integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==",
"dev": true, "dev": true,
"requires": { "requires": {
"bn.js": "^4.0.0", "bn.js": "^4.0.0",
"inherits": "^2.0.1", "inherits": "^2.0.1",
"minimalistic-assert": "^1.0.0" "minimalistic-assert": "^1.0.0",
"safer-buffer": "^2.1.0"
}, },
"dependencies": { "dependencies": {
"bn.js": { "bn.js": {
@ -3008,9 +2954,9 @@
"dev": true "dev": true
}, },
"aws4": { "aws4": {
"version": "1.10.0", "version": "1.10.1",
"resolved": "https://verdaccio.lossless.one/aws4/-/aws4-1.10.0.tgz", "resolved": "https://verdaccio.lossless.one/aws4/-/aws4-1.10.1.tgz",
"integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==", "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==",
"dev": true "dev": true
}, },
"babel-plugin-dynamic-import-node": { "babel-plugin-dynamic-import-node": {
@ -4844,9 +4790,9 @@
"dev": true "dev": true
}, },
"electron-to-chromium": { "electron-to-chromium": {
"version": "1.3.529", "version": "1.3.532",
"resolved": "https://verdaccio.lossless.one/electron-to-chromium/-/electron-to-chromium-1.3.529.tgz", "resolved": "https://verdaccio.lossless.one/electron-to-chromium/-/electron-to-chromium-1.3.532.tgz",
"integrity": "sha512-n3sriLldqNyjBlosbnPftjCY+m1dVOY307I1Y0HaHAqDGe3hRvK7ksJwWd+qs599ybR4jobCo1+7zXM9GyNMSA==", "integrity": "sha512-6PYzSCIa/Q2PImAHYLrvKPxuwFqDcvCzRT9w26Szd9psPa9et/t4TzgjaoX7wkBIfkhhgRQWwHWeUHOM4cJdRw==",
"dev": true "dev": true
}, },
"elliptic": { "elliptic": {
@ -6625,6 +6571,17 @@
"posthtml-parser": "^0.4.2", "posthtml-parser": "^0.4.2",
"posthtml-render": "^1.2.2" "posthtml-render": "^1.2.2"
} }
},
"terser": {
"version": "4.8.0",
"resolved": "https://verdaccio.lossless.one/terser/-/terser-4.8.0.tgz",
"integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==",
"dev": true,
"requires": {
"commander": "^2.20.0",
"source-map": "~0.6.1",
"source-map-support": "~0.5.12"
}
} }
} }
}, },
@ -7132,22 +7089,29 @@
"dev": true "dev": true
}, },
"jest-worker": { "jest-worker": {
"version": "24.9.0", "version": "26.3.0",
"resolved": "https://verdaccio.lossless.one/jest-worker/-/jest-worker-24.9.0.tgz", "resolved": "https://verdaccio.lossless.one/jest-worker/-/jest-worker-26.3.0.tgz",
"integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==", "integrity": "sha512-Vmpn2F6IASefL+DVBhPzI2J9/GJUsqzomdeN+P+dK8/jKxbh8R3BtFnx3FIta7wYlPU62cpJMJQo4kuOowcMnw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/node": "*",
"merge-stream": "^2.0.0", "merge-stream": "^2.0.0",
"supports-color": "^6.1.0" "supports-color": "^7.0.0"
}, },
"dependencies": { "dependencies": {
"has-flag": {
"version": "4.0.0",
"resolved": "https://verdaccio.lossless.one/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"supports-color": { "supports-color": {
"version": "6.1.0", "version": "7.1.0",
"resolved": "https://verdaccio.lossless.one/supports-color/-/supports-color-6.1.0.tgz", "resolved": "https://verdaccio.lossless.one/supports-color/-/supports-color-7.1.0.tgz",
"integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
"dev": true, "dev": true,
"requires": { "requires": {
"has-flag": "^3.0.0" "has-flag": "^4.0.0"
} }
} }
} }
@ -8305,29 +8269,17 @@
"requires": { "requires": {
"minimist": "^1.2.0" "minimist": "^1.2.0"
} }
},
"terser": {
"version": "3.17.0",
"resolved": "https://verdaccio.lossless.one/terser/-/terser-3.17.0.tgz",
"integrity": "sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ==",
"dev": true,
"requires": {
"commander": "^2.19.0",
"source-map": "~0.6.1",
"source-map-support": "~0.5.10"
}
} }
} }
}, },
"parse-asn1": { "parse-asn1": {
"version": "5.1.5", "version": "5.1.6",
"resolved": "https://verdaccio.lossless.one/parse-asn1/-/parse-asn1-5.1.5.tgz", "resolved": "https://verdaccio.lossless.one/parse-asn1/-/parse-asn1-5.1.6.tgz",
"integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==",
"dev": true, "dev": true,
"requires": { "requires": {
"asn1.js": "^4.0.0", "asn1.js": "^5.2.0",
"browserify-aes": "^1.0.0", "browserify-aes": "^1.0.0",
"create-hash": "^1.1.0",
"evp_bytestokey": "^1.0.0", "evp_bytestokey": "^1.0.0",
"pbkdf2": "^3.0.3", "pbkdf2": "^3.0.3",
"safe-buffer": "^5.1.1" "safe-buffer": "^5.1.1"
@ -9634,16 +9586,28 @@
} }
}, },
"rollup-plugin-terser": { "rollup-plugin-terser": {
"version": "5.3.0", "version": "6.1.0",
"resolved": "https://verdaccio.lossless.one/rollup-plugin-terser/-/rollup-plugin-terser-5.3.0.tgz", "resolved": "https://verdaccio.lossless.one/rollup-plugin-terser/-/rollup-plugin-terser-6.1.0.tgz",
"integrity": "sha512-XGMJihTIO3eIBsVGq7jiNYOdDMb3pVxuzY0uhOE/FM4x/u9nQgr3+McsjzqBn3QfHIpNSZmFnpoKAwHBEcsT7g==", "integrity": "sha512-4fB3M9nuoWxrwm39habpd4hvrbrde2W2GG4zEGPQg1YITNkM3Tqur5jSuXlWNzbv/2aMLJ+dZJaySc3GCD8oDw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.5.5", "@babel/code-frame": "^7.8.3",
"jest-worker": "^24.9.0", "jest-worker": "^26.0.0",
"rollup-pluginutils": "^2.8.2", "serialize-javascript": "^3.0.0",
"serialize-javascript": "^2.1.2", "terser": "^4.7.0"
"terser": "^4.6.2" },
"dependencies": {
"terser": {
"version": "4.8.0",
"resolved": "https://verdaccio.lossless.one/terser/-/terser-4.8.0.tgz",
"integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==",
"dev": true,
"requires": {
"commander": "^2.20.0",
"source-map": "~0.6.1",
"source-map-support": "~0.5.12"
}
}
} }
}, },
"rollup-pluginutils": { "rollup-pluginutils": {
@ -9760,10 +9724,13 @@
} }
}, },
"serialize-javascript": { "serialize-javascript": {
"version": "2.1.2", "version": "3.1.0",
"resolved": "https://verdaccio.lossless.one/serialize-javascript/-/serialize-javascript-2.1.2.tgz", "resolved": "https://verdaccio.lossless.one/serialize-javascript/-/serialize-javascript-3.1.0.tgz",
"integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==", "integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==",
"dev": true "dev": true,
"requires": {
"randombytes": "^2.1.0"
}
}, },
"serialize-to-js": { "serialize-to-js": {
"version": "3.1.1", "version": "3.1.1",
@ -10466,14 +10433,14 @@
"dev": true "dev": true
}, },
"terser": { "terser": {
"version": "4.8.0", "version": "3.17.0",
"resolved": "https://verdaccio.lossless.one/terser/-/terser-4.8.0.tgz", "resolved": "https://verdaccio.lossless.one/terser/-/terser-3.17.0.tgz",
"integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", "integrity": "sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"commander": "^2.20.0", "commander": "^2.19.0",
"source-map": "~0.6.1", "source-map": "~0.6.1",
"source-map-support": "~0.5.12" "source-map-support": "~0.5.10"
} }
}, },
"through2": { "through2": {

View File

@ -14,7 +14,7 @@
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.25", "@gitzone/tsbuild": "^2.1.25",
"@gitzone/tstest": "^1.0.43", "@gitzone/tstest": "^1.0.44",
"@pushrocks/qenv": "^4.0.10", "@pushrocks/qenv": "^4.0.10",
"@pushrocks/tapbundle": "^3.2.9", "@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.0.27", "@types/node": "^14.0.27",
@ -39,5 +39,8 @@
"cli.js", "cli.js",
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
],
"browserslist": [
"last 1 chrome versions"
] ]
} }

View File

@ -20,7 +20,7 @@ tap.test('should create a smartmail', async () => {
testSmartmail = new smartmail.Smartmail({ testSmartmail = new smartmail.Smartmail({
body: 'hi there. This is the body.', body: 'hi there. This is the body.',
from: 'Lossless GmbH <noreply@mail.lossless.com>', from: 'Lossless GmbH <noreply@mail.lossless.com>',
subject: 'TestMessage from @mojoio/mailgun test' subject: 'TestMessage from @mojoio/mailgun test',
}); });
expect(testSmartmail).to.be.instanceOf(smartmail.Smartmail); expect(testSmartmail).to.be.instanceOf(smartmail.Smartmail);
}); });
@ -33,9 +33,12 @@ tap.test('should send a smartmail with empty body', async () => {
const emptyBodySmartmail = new smartmail.Smartmail<IMailgunMessage>({ const emptyBodySmartmail = new smartmail.Smartmail<IMailgunMessage>({
body: '', body: '',
from: 'Lossless GmbH <noreply@mail.lossless.one>', from: 'Lossless GmbH <noreply@mail.lossless.one>',
subject: 'A message with no body from @mojoio/mailgun test' subject: 'A message with no body from @mojoio/mailgun test',
}); });
await testMailgunAccount.sendSmartMail(emptyBodySmartmail, 'Sandbox Team <sandbox@mail.git.zone>'); await testMailgunAccount.sendSmartMail(
emptyBodySmartmail,
'Sandbox Team <sandbox@mail.git.zone>'
);
}); });
tap.test('should retrieve a mail using a retrieval url', async () => { tap.test('should retrieve a mail using a retrieval url', async () => {

View File

@ -5,7 +5,7 @@ export class MailgunAccount {
public baseUrl = 'https://api.mailgun.net/v3'; public baseUrl = 'https://api.mailgun.net/v3';
public apiToken: string; public apiToken: string;
public smartSmtps: {[domain: string]: plugins.smartsmtp.Smartsmtp} = {}; public smartSmtps: { [domain: string]: plugins.smartsmtp.Smartsmtp } = {};
constructor(apiTokenArg: string) { constructor(apiTokenArg: string) {
this.apiToken = apiTokenArg; this.apiToken = apiTokenArg;
@ -15,7 +15,7 @@ export class MailgunAccount {
* allows adding smtp credentials * allows adding smtp credentials
* Format: [domain]|[username]|[password] * Format: [domain]|[username]|[password]
*/ */
public addSmtpCredentials (credentials: string) { public addSmtpCredentials(credentials: string) {
const credentialArray = credentials.split('|'); const credentialArray = credentials.split('|');
if (credentialArray.length !== 3) { if (credentialArray.length !== 3) {
throw new Error('credentials are in the wrong format'); throw new Error('credentials are in the wrong format');
@ -23,7 +23,7 @@ export class MailgunAccount {
this.smartSmtps[credentialArray[0]] = new plugins.smartsmtp.Smartsmtp({ this.smartSmtps[credentialArray[0]] = new plugins.smartsmtp.Smartsmtp({
smtpServer: 'smtp.mailgun.org', smtpServer: 'smtp.mailgun.org',
smtpUser: credentialArray[1], smtpUser: credentialArray[1],
smtpPassword: credentialArray[2] smtpPassword: credentialArray[2],
}); });
} }
@ -111,21 +111,31 @@ export class MailgunAccount {
console.log('All requirements for API met'); console.log('All requirements for API met');
const response = await this.postFormData(`/${domain}/messages`, formFields); const response = await this.postFormData(`/${domain}/messages`, formFields);
if (response.statusCode === 200) { if (response.statusCode === 200) {
console.log(`Sent mail with subject ${smartmailArg.getSubject(dataArg)} to ${toArg} using the mailgun API`); console.log(
`Sent mail with subject ${smartmailArg.getSubject(
dataArg
)} to ${toArg} using the mailgun API`
);
return response.body; return response.body;
} else { } else {
console.log(response.body); console.log(response.body);
throw new Error('could not send email'); throw new Error('could not send email');
} }
} else { } else {
console.log('An empty body was provided. This does not work via the API, but using SMTP instead.'); console.log(
'An empty body was provided. This does not work via the API, but using SMTP instead.'
);
const wantedSmartsmtp = this.smartSmtps[domain]; const wantedSmartsmtp = this.smartSmtps[domain];
if (!wantedSmartsmtp) { if (!wantedSmartsmtp) {
console.log('did not find appropriate smtp credentials'); console.log('did not find appropriate smtp credentials');
return; return;
} }
wantedSmartsmtp.sendSmartMail(smartmailArg, toArg); wantedSmartsmtp.sendSmartMail(smartmailArg, toArg);
console.log(`Sent mail with subject ${smartmailArg.getSubject(dataArg)} to ${toArg} using an smtp transport over Mailgun`); console.log(
`Sent mail with subject ${smartmailArg.getSubject(
dataArg
)} to ${toArg} using an smtp transport over Mailgun`
);
} }
} }