Skip to content

Commit 246700b

Browse files
committed
fix: upgrade deps
1 parent be58ce2 commit 246700b

File tree

6 files changed

+2322
-2057
lines changed

6 files changed

+2322
-2057
lines changed

.mdeprc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"node": "10.15.1",
2+
"node": "10.16.0",
33
"repo": "microfleet",
44
"p": "html-to-pdf",
55
"nycCoverage": false,

__tests__/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020

2121
tester:
2222
container_name: tester
23-
image: makeomatic/node:10.15.1-chrome-tester
23+
image: makeomatic/node:10.16.0-chrome-tester
2424
links:
2525
- redis
2626
- rabbitmq

package.json

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,43 +22,42 @@
2222
},
2323
"dependencies": {
2424
"64": "^0.2.0",
25-
"@microfleet/core": "^13.3.2",
26-
"@microfleet/transport-amqp": "^13.1.3",
27-
"@microfleet/validation": "^8.1.0",
28-
"bluebird": "^3.5.4",
25+
"@microfleet/core": "^14.0.0",
26+
"@microfleet/transport-amqp": "^14.0.1",
27+
"@microfleet/validation": "^8.1.2",
28+
"bluebird": "^3.5.5",
2929
"bluebird-retry": "^0.11.0",
30-
"bunyan": "^1.8.12",
31-
"chrome-launcher": "^0.10.5",
32-
"chrome-remote-interface": "^0.27.0",
30+
"chrome-launcher": "^0.11.1",
31+
"chrome-remote-interface": "^0.27.2",
3332
"common-errors": "^1.0.5",
3433
"debug": "^4.1.0",
35-
"hapi": "^18.1.0",
36-
"ms-conf": "^3.3.3",
34+
"@hapi/hapi": "^18.1.0",
35+
"ms-conf": "^5.0.0",
3736
"mustache": "^3.0.1",
38-
"prom-client": "^11.2.1",
37+
"prom-client": "^11.5.3",
3938
"request": "^2.88.0",
4039
"request-promise": "^4.2.2",
4140
"stdout-stream": "^1.4.1"
4241
},
4342
"devDependencies": {
44-
"@babel/cli": "^7.2.3",
45-
"@babel/core": "^7.2.2",
46-
"@babel/plugin-proposal-class-properties": "^7.2.3",
47-
"@babel/plugin-proposal-object-rest-spread": "^7.2.0",
43+
"@babel/cli": "^7.5.0",
44+
"@babel/core": "^7.5.4",
45+
"@babel/plugin-proposal-class-properties": "^7.5.0",
46+
"@babel/plugin-proposal-object-rest-spread": "^7.5.4",
4847
"@babel/plugin-transform-strict-mode": "^7.2.0",
49-
"@makeomatic/deploy": "^8.4.0",
50-
"@semantic-release/changelog": "^3.0.1",
51-
"@semantic-release/exec": "^3.3.1",
48+
"@makeomatic/deploy": "^8.4.4",
49+
"@semantic-release/changelog": "^3.0.4",
50+
"@semantic-release/exec": "^3.3.5",
5251
"@semantic-release/git": "7.0.16",
53-
"babel-eslint": "^10.0.1",
54-
"cheerio": "^1.0.0-rc.2",
55-
"codecov": "^3.1.0",
52+
"babel-eslint": "^10.0.2",
53+
"cheerio": "^1.0.0-rc.3",
54+
"codecov": "^3.5.0",
5655
"cross-env": "^5.2.0",
57-
"eslint": "^5.10.0",
56+
"eslint": "^6.0.1",
5857
"eslint-config-makeomatic": "^3.0.0",
59-
"eslint-plugin-import": "^2.14.0",
60-
"eslint-plugin-promise": "^4.0.1",
61-
"jest": "^24.1.0",
58+
"eslint-plugin-import": "^2.18.0",
59+
"eslint-plugin-promise": "^4.2.1",
60+
"jest": "^24.8.0",
6261
"json": "^9.0.6",
6362
"rimraf": "^2.6.2"
6463
},

src/actions/render.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,20 @@ const upload = require('../utils/upload');
1111
* @param {(Object|boolean)} data.params.meta - Document configuration for @microfleet/files.
1212
* @returns {Promise<*>} Data with file location.
1313
*/
14-
function render({ params }) {
14+
async function render({ params }) {
1515
this.log.debug({ params }, 'preparing to render template');
1616
const { meta, context, documentOptions } = params;
1717
const template = this.config.pdfPrinter.getTemplate(params.template);
1818

1919
// render template to html
2020
const html = mustache.render(template, context);
21+
const pdf = await this.chrome.printToPdf(html, documentOptions);
2122

22-
return this.chrome
23-
.printToPdf(html, documentOptions)
24-
.then(pdf => (
25-
meta === false
26-
? pdf
27-
: upload.call(this, meta, pdf).get('uploadId')
28-
));
23+
if (meta === false) {
24+
return pdf;
25+
}
26+
27+
return upload.call(this, meta, pdf).get('uploadId');
2928
}
3029

3130
module.exports = render;

src/configs/router.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ const autoSchema = routerExtension('validate/schemaLessAction');
1313
*/
1414
const auditLog = routerExtension('audit/log');
1515

16+
/**
17+
* Prometheus metrics
18+
*/
19+
const metrics = routerExtension('audit/metrics');
20+
1621
/**
1722
* Specifies configuration for the router of the microservice
1823
* @type {Object}
@@ -26,7 +31,7 @@ exports.router = {
2631
enabledGenericActions: ['health'],
2732
},
2833
extensions: {
29-
enabled: ['postRequest', 'preRequest', 'preResponse'],
30-
register: [autoSchema, auditLog()],
34+
enabled: ['postRequest', 'preRequest', 'preResponse', 'postResponse'],
35+
register: [autoSchema, auditLog(), metrics()],
3136
},
3237
};

0 commit comments

Comments
 (0)