diff --git a/package.json b/package.json index 2291040fa65e6be01c2539ca7cf4a3ab4a72910b..695ef1fc5b1083a57797380bd4e7fb72df9cd3ab 100644 --- a/package.json +++ b/package.json @@ -56,14 +56,15 @@ }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", + "@types/better-sqlite3": "^5.4.1", "@types/chai": "^4.2.11", "@types/command-line-args": "^5.0.0", + "@types/express": "^4.17.9", "@types/js-yaml": "^3.12.4", "@types/marked": "^1.1.0", "@types/mime": "^2.0.2", "@types/mocha": "^7.0.2", "@types/node": "^12", - "@types/better-sqlite3": "^5.4.1", "chai": "^4.2.0", "mocha": "^8.0.1", "nyc": "^15.1.0", diff --git a/src/discordas.ts b/src/discordas.ts index e69562800f68d69dd1b5795f7d08a86100e44b90..59761f00ff7e457dd165543878fbbca58133e19b 100644 --- a/src/discordas.ts +++ b/src/discordas.ts @@ -26,6 +26,7 @@ import * as usage from "command-line-usage"; import * as uuid from "uuid/v4"; import { IMatrixEvent } from "./matrixtypes"; import { MetricPeg, PrometheusBridgeMetrics } from "./metrics"; +import { Response } from "express"; const log = new Log("DiscordAS"); @@ -176,8 +177,12 @@ async function run() { const roomhandler = discordbot.RoomHandler; const eventProcessor = discordbot.MxEventProcessor; - // tslint:disable-next-line:no-any - appservice.expressAppInstance.get("/health", (_, res: any) => { + // 2020-12-07: If this fails to build in TypeScript with + // "Namespace 'serveStatic' has no exported member 'RequestHandlerConstructor'.", + // remove @types/express-serve-static-core and @types/serve-static from yarn.lock + // and run yarn. + // See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/49595 + appservice.expressAppInstance.get("/health", (_, res: Response) => { res.status(201).send(""); }); diff --git a/yarn.lock b/yarn.lock index 2bb55ea9e8095a887dd2af85dcd22f2d16ff7867..3a4d32d846b51b367dbae285267fbfa0478b29b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -278,9 +278,9 @@ "@types/node" "*" "@types/express-serve-static-core@*": - version "4.17.13" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.13.tgz#d9af025e925fc8b089be37423b8d1eac781be084" - integrity sha512-RgDi5a4nuzam073lRGKTUIaL3eF2+H7LJvJ8eUnCI0wA6SNjXc44DCmWNiTLs/AZ7QlsFWZiw/gTG3nSQGL0fA== + version "4.17.14" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.14.tgz#cabf91debeeb3cb04b798e2cff908864e89b6106" + integrity sha512-uFTLwu94TfUFMToXNgRZikwPuZdOtDgs3syBtAIr/OXorL1kJqUJT9qCLnRZ5KBOWfZQikQ2xKgR2tnDj1OgDA== dependencies: "@types/node" "*" "@types/qs" "*" @@ -296,6 +296,16 @@ "@types/qs" "*" "@types/serve-static" "*" +"@types/express@^4.17.9": + version "4.17.9" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.9.tgz#f5f2df6add703ff28428add52bdec8a1091b0a78" + integrity sha512-SDzEIZInC4sivGIFY4Sz1GG6J9UObPwCInYJjko2jzOf/Imx/dlpume6Xxwj1ORL82tBbmN4cPDIDkLbWHk9hw== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "*" + "@types/qs" "*" + "@types/serve-static" "*" + "@types/http-cache-semantics@*": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" @@ -374,9 +384,9 @@ "@types/node" "*" "@types/serve-static@*": - version "1.13.6" - resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.6.tgz#866b1b8dec41c36e28c7be40ac725b88be43c5c1" - integrity sha512-nuRJmv7jW7VmCVTn+IgYDkkbbDGyIINOeu/G0d74X3lm6E5KfMeQPJhxIt1ayQeQB3cSxvYs1RA/wipYoFB4EA== + version "1.13.8" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.8.tgz#851129d434433c7082148574ffec263d58309c46" + integrity sha512-MoJhSQreaVoL+/hurAZzIm8wafFR6ajiTM1m4A0kv6AGeVBl4r4pOV8bGFrjjq1sGxDTnCoF8i22o0/aE5XCyA== dependencies: "@types/mime" "*" "@types/node" "*"