From b0d65e1a5938ed62cc35c19d30dddf87c53300a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 18:51:25 +0000 Subject: [PATCH 1/3] Update dependency @types/koa to v2.13.10 --- package.json | 2 +- yarn.lock | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7f387e62..d9514efb 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@testing-library/dom": "9.3.3", "@types/jest": "29.5.6", "@types/js-yaml": "4.0.8", - "@types/koa": "2.13.8", + "@types/koa": "2.13.10", "@types/koa-bodyparser": "4.3.11", "@types/koa-proxy": "1.0.6", "@types/koa-static": "4.0.3", diff --git a/yarn.lock b/yarn.lock index c7bc3766..7f5bbbf2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2569,7 +2569,7 @@ "@types/koa" "*" "@types/koa-send" "*" -"@types/koa@*", "@types/koa@2.13.8": +"@types/koa@*": version "2.13.8" resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.13.8.tgz#4302d2f2712348aadb6c0b03eb614f30afde486b" integrity sha512-Ugmxmgk/yPRW3ptBTh9VjOLwsKWJuGbymo1uGX0qdaqqL18uJiiG1ZoV0rxCOYSaDGhvEp5Ece02Amx0iwaxQQ== @@ -2583,6 +2583,20 @@ "@types/koa-compose" "*" "@types/node" "*" +"@types/koa@2.13.10": + version "2.13.10" + resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.13.10.tgz#2c2a1cdf1252d654b05f444194328a3d23a880c4" + integrity sha512-weKc5IBeORLDGwD1FMgPjaZIg0/mtP7KxXAXEzPRCN78k274D9U2acmccDNPL1MwyV40Jj+hQQ5N2eaV6O0z8g== + dependencies: + "@types/accepts" "*" + "@types/content-disposition" "*" + "@types/cookies" "*" + "@types/http-assert" "*" + "@types/http-errors" "*" + "@types/keygrip" "*" + "@types/koa-compose" "*" + "@types/node" "*" + "@types/koa@^2.13.9": version "2.13.9" resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.13.9.tgz#8d989ac17d7f033475fbe34c4f906c9287c2041a" From a8610a9edb9218819678b2fd4028bc83c18745fe Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Tue, 24 Oct 2023 15:18:29 -0400 Subject: [PATCH 2/3] The body is added by bodyParser. I'm not sure how to make the types work here. --- src/server/koa-middleware.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/koa-middleware.ts b/src/server/koa-middleware.ts index 16086204..6558ea9e 100644 --- a/src/server/koa-middleware.ts +++ b/src/server/koa-middleware.ts @@ -49,6 +49,7 @@ export function koaMiddleware( } const response = await dispatcher.request({ + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment body, /* @ts-expect-error the value of a header can be an array and we don't have a solution for that yet */ headers, From f861fcbe235eebe59838521b148572555643e2f2 Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Tue, 24 Oct 2023 15:28:42 -0400 Subject: [PATCH 3/3] ignore TypeScript errors because I don't know how to fix them --- src/server/koa-middleware.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/koa-middleware.ts b/src/server/koa-middleware.ts index 6558ea9e..8e5850b9 100644 --- a/src/server/koa-middleware.ts +++ b/src/server/koa-middleware.ts @@ -31,12 +31,14 @@ export function koaMiddleware( ): Koa.Middleware { // eslint-disable-next-line max-statements return async function middleware(ctx, next) { + /* @ts-expect-error the body comes from koa-bodyparser, not sure how to fix this */ const { body, headers, path, query } = ctx.request; // eslint-disable-next-line @typescript-eslint/consistent-type-assertions const method = ctx.request.method as HttpMethods; if (proxyEnabled && proxyUrl) { + /* @ts-expect-error the body comes from koa-bodyparser, not sure how to fix this */ // eslint-disable-next-line @typescript-eslint/no-unsafe-return return proxy({ host: proxyUrl })(ctx, next); }