diff --git a/package-lock.json b/package-lock.json index 5754556..eca009d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,10 +9,9 @@ "version": "2.4.4", "license": "MIT", "dependencies": { - "@koa/router": "^14.0.0", + "@koa/router": "^15.1.1", "@koa/send": "^6.0.0", "@types/koa": "^3.0.0", - "@types/koa__router": "^12.0.4", "@types/stack-trace": "^0.0.33", "@types/supertest": "^6.0.3", "dotenv": "^17.2.3", @@ -873,19 +872,26 @@ } }, "node_modules/@koa/router": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@koa/router/-/router-14.0.0.tgz", - "integrity": "sha512-LBSu5K0qAaaQcXX/0WIB9PGDevyCxxpnc1uq13vV/CgObaVxuis5hKl3Eboq/8gcb6ebnkAStW9NB/Em2eYyFA==", - "deprecated": "Please upgrade to v15 or higher. All reported bugs in this version are fixed in newer releases, dependencies have been updated, and security has been improved.", + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/@koa/router/-/router-15.1.1.tgz", + "integrity": "sha512-trYxL4VOx8r92f8luqpN83xkN0DMTsp/HBJIxoDZH/a2I1Hxvoe+jjjhyJRQUQIHmsNQjCM+Xj6nCqSvnDnlCw==", "license": "MIT", "dependencies": { - "debug": "^4.4.1", - "http-errors": "^2.0.0", + "debug": "^4.4.3", + "http-errors": "^2.0.1", "koa-compose": "^4.1.0", - "path-to-regexp": "^8.2.0" + "path-to-regexp": "^8.3.0" }, "engines": { "node": ">= 20" + }, + "peerDependencies": { + "koa": "^2.0.0 || ^3.0.0" + }, + "peerDependenciesMeta": { + "koa": { + "optional": false + } } }, "node_modules/@koa/send": { @@ -1506,15 +1512,6 @@ "@types/node": "*" } }, - "node_modules/@types/koa__router": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/@types/koa__router/-/koa__router-12.0.5.tgz", - "integrity": "sha512-1HeLxuDn4n5it1yZYCSyOYXo++73zT0ffoviXnPxbwbxLbvDFEvWD9ZzpRiIpK4oKR0pi+K+Mk/ZjyROjW3HSw==", - "license": "MIT", - "dependencies": { - "@types/koa": "*" - } - }, "node_modules/@types/koa-compose": { "version": "3.2.9", "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.9.tgz", @@ -5044,6 +5041,7 @@ "resolved": "https://registry.npmjs.org/koa/-/koa-3.1.1.tgz", "integrity": "sha512-KDDuvpfqSK0ZKEO2gCPedNjl5wYpfj+HNiuVRlbhd1A88S3M0ySkdf2V/EJ4NWt5dwh5PXCdcenrKK2IQJAxsg==", "license": "MIT", + "peer": true, "dependencies": { "accepts": "^1.3.8", "content-disposition": "~0.5.4", diff --git a/package.json b/package.json index 96da5c5..c3b7f97 100644 --- a/package.json +++ b/package.json @@ -42,10 +42,9 @@ "format:check": "prettier --check ." }, "dependencies": { - "@koa/router": "^14.0.0", + "@koa/router": "^15.1.1", "@koa/send": "^6.0.0", "@types/koa": "^3.0.0", - "@types/koa__router": "^12.0.4", "@types/stack-trace": "^0.0.33", "@types/supertest": "^6.0.3", "dotenv": "^17.2.3", diff --git a/src/Application/ApplicationFactory.ts b/src/Application/ApplicationFactory.ts index e69c7b2..4829c1e 100644 --- a/src/Application/ApplicationFactory.ts +++ b/src/Application/ApplicationFactory.ts @@ -1,4 +1,4 @@ -import Router from '@koa/router'; +import Router, { type RouterInstance } from '@koa/router'; import Koa, { type DefaultContext, type DefaultState, type Middleware } from 'koa'; import { koaBody } from 'koa-body'; import { type Application } from './types'; @@ -34,7 +34,7 @@ export function create(config: KoalaConfig): Application { return app; } -function createRouter(): Router { +function createRouter(): RouterInstance { const router = new Router(); for (const route of getRoutes()) {