From 2d55ba7013bf8a50d12d9674765aafc9d4f14be9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 30 Nov 2024 05:19:49 +0000 Subject: [PATCH 1/3] chore(deps): update dependency @types/express to v5 --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 187de62..21ed956 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "devDependencies": { "@myrotvorets/eslint-config-myrotvorets-ts": "^3.0.0", - "@types/express": "^4.17.21", + "@types/express": "^5.0.0", "@types/supertest": "^6.0.2", "c8": "^10.0.0", "eslint-formatter-gha": "^1.4.3", @@ -2555,22 +2555,22 @@ "peer": true }, "node_modules/@types/express": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", - "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz", + "integrity": "sha512-DvZriSMehGHL1ZNLzi6MidnsDhUZM/x2pRdDIKdwbUNqqwHxMlRdkxtn6/EPKyqKpHqTl/4nRZsRNLpZxZRpPQ==", "dev": true, "license": "MIT", "dependencies": { "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.33", + "@types/express-serve-static-core": "^5.0.0", "@types/qs": "*", "@types/serve-static": "*" } }, "node_modules/@types/express-serve-static-core": { - "version": "4.19.6", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", - "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.2.tgz", + "integrity": "sha512-vluaspfvWEtE4vcSDlKRNer52DvOGrB2xv6diXy6UKyKW0lqZiWHGNApSyxOv+8DE5Z27IzVvE7hNkxg7EXIcg==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 7af365e..8958a5a 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "license": "MIT", "devDependencies": { "@myrotvorets/eslint-config-myrotvorets-ts": "^3.0.0", - "@types/express": "^4.17.21", + "@types/express": "^5.0.0", "@types/supertest": "^6.0.2", "c8": "^10.0.0", "eslint-formatter-gha": "^1.4.3", From 5878218520cdb0deca28832b63c7a25e80202948 Mon Sep 17 00:00:00 2001 From: Myrotvorets Date: Fri, 20 Dec 2024 05:24:01 +0200 Subject: [PATCH 2/3] Update code --- test/index.test.mts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/index.test.mts b/test/index.test.mts index 5ad49af..11d3590 100644 --- a/test/index.test.mts +++ b/test/index.test.mts @@ -1,22 +1,26 @@ /* eslint-disable sonarjs/assertions-in-tests */ import { describe, it } from 'node:test'; +import type { RequestListener } from 'node:http'; import request from 'supertest'; -import express, { Application, NextFunction, Request, Response } from 'express'; +import express, { type NextFunction, type Request, type Response } from 'express'; import { acceptsJsonMiddleware } from '../src/index.mjs'; interface IStatus { status: number; } -function buildServer(): Application { +function buildServer(): RequestListener { const app = express(); app.disable('x-powered-by'); return app.use( acceptsJsonMiddleware, - (_req: Request, res: Response): unknown => res.json({ status: 200 }), - (err: unknown, _req: Request, res: Response, _next: NextFunction): unknown => - res.status((err as IStatus).status).json(err), - ); + (_req: Request, res: Response) => { + res.json({ status: 200 }); + }, + (err: unknown, _req: Request, res: Response, _next: NextFunction): void => { + res.status((err as IStatus).status).json(err); + }, + ) as RequestListener; } const server = buildServer(); From d89379f208c6239fe2d57da89e0d479e73f1c1a4 Mon Sep 17 00:00:00 2001 From: Myrotvorets Date: Fri, 20 Dec 2024 05:25:43 +0200 Subject: [PATCH 3/3] Update endpoints --- .github/workflows/sonarscan.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sonarscan.yml b/.github/workflows/sonarscan.yml index cf05afa..29ec489 100644 --- a/.github/workflows/sonarscan.yml +++ b/.github/workflows/sonarscan.yml @@ -27,6 +27,8 @@ jobs: egress-policy: block allowed-endpoints: > api.github.com:443 + api.sonarcloud.io:443 + binaries.sonarsource.com:443 github.com:443 npm.pkg.github.com:443 objects.githubusercontent.com:443