From 1312579bf68e56289ece0bb3b2f5b173cebf8f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Thu, 10 Nov 2022 08:20:15 +0100 Subject: [PATCH] fix: upgrade @types/node to v16.18.3 (#2365) This pr upgrade @types/node to v16.18.3. This also detected some inconsitent retrun types that I decided to fix. --- package.json | 2 +- src/lib/middleware/content_type_checker.test.ts | 1 + src/lib/routes/client-api/metrics.ts | 4 ++-- src/lib/routes/client-api/register.ts | 2 +- src/lib/routes/public-invite.ts | 7 ++++--- yarn.lock | 7 ++++++- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 0ac847955f..2244d7eb9d 100644 --- a/package.json +++ b/package.json @@ -152,7 +152,7 @@ "@types/make-fetch-happen": "10.0.0", "@types/memoizee": "0.4.8", "@types/mime": "3.0.1", - "@types/node": "16.6.1", + "@types/node": "16.18.3", "@types/nodemailer": "6.4.6", "@types/owasp-password-strength-test": "1.3.0", "@types/semver": "7.3.13", diff --git a/src/lib/middleware/content_type_checker.test.ts b/src/lib/middleware/content_type_checker.test.ts index 86782735e5..98c6300d35 100644 --- a/src/lib/middleware/content_type_checker.test.ts +++ b/src/lib/middleware/content_type_checker.test.ts @@ -24,6 +24,7 @@ const returns415: (t: jest.Mock) => Response = (t) => ({ const expectNoCall: (t: jest.Mock) => Response = (t) => ({ // @ts-ignore status: () => ({ + // @ts-ignore end: () => expect(t).toHaveBeenCalledTimes(0), }), }); diff --git a/src/lib/routes/client-api/metrics.ts b/src/lib/routes/client-api/metrics.ts index 4998588510..e430597e32 100644 --- a/src/lib/routes/client-api/metrics.ts +++ b/src/lib/routes/client-api/metrics.ts @@ -69,9 +69,9 @@ export default class ClientMetricsController extends Controller { try { await this.metricsV2.registerClientMetrics(data, clientIp); - return res.status(202).end(); + res.status(202).end(); } catch (e) { - return res.status(400).end(); + res.status(400).end(); } } } diff --git a/src/lib/routes/client-api/register.ts b/src/lib/routes/client-api/register.ts index 747cd27be5..a83750d6b5 100644 --- a/src/lib/routes/client-api/register.ts +++ b/src/lib/routes/client-api/register.ts @@ -67,6 +67,6 @@ export default class RegisterController extends Controller { const { body: data, ip: clientIp, user } = req; data.environment = RegisterController.resolveEnvironment(user, data); await this.clientInstanceService.registerClient(data, clientIp); - return res.status(202).end(); + res.status(202).end(); } } diff --git a/src/lib/routes/public-invite.ts b/src/lib/routes/public-invite.ts index 4bb26cbf6a..ac5f6588bc 100644 --- a/src/lib/routes/public-invite.ts +++ b/src/lib/routes/public-invite.ts @@ -89,9 +89,9 @@ export class PublicInviteController extends Controller { const { token } = req.params; const valid = await this.publicSignupTokenService.validate(token); if (valid) { - return res.status(200).end(); + res.status(200).end(); } else { - return res.status(400).end(); + res.status(400).end(); } } @@ -102,7 +102,8 @@ export class PublicInviteController extends Controller { const { token } = req.params; const valid = await this.publicSignupTokenService.validate(token); if (!valid) { - return res.status(400).end(); + res.status(400).end(); + return; } const user = await this.publicSignupTokenService.addTokenUser( token, diff --git a/yarn.lock b/yarn.lock index 73db91ed88..e1a7c44a77 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1546,11 +1546,16 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@16.6.1": +"@types/node@*": version "16.6.1" resolved "https://registry.npmjs.org/@types/node/-/node-16.6.1.tgz" integrity sha512-Sr7BhXEAer9xyGuCN3Ek9eg9xPviCF2gfu9kTfuU2HkTVAMYSDeX40fvpmo72n5nansg3nsBjuQBrsS28r+NUw== +"@types/node@16.18.3": + version "16.18.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.3.tgz#d7f7ba828ad9e540270f01ce00d391c54e6e0abc" + integrity sha512-jh6m0QUhIRcZpNv7Z/rpN+ZWXOicUUQbSoWks7Htkbb9IjFQj4kzcX/xFCkjstCj5flMsN8FiSvt+q+Tcs4Llg== + "@types/nodemailer@6.4.6": version "6.4.6" resolved "https://registry.yarnpkg.com/@types/nodemailer/-/nodemailer-6.4.6.tgz#ce21b4b474a08f672f182e15982b7945dde1f288"