From 29deb1fd3cd7afc239b91ee96fa0c2727f1279ed Mon Sep 17 00:00:00 2001 From: Agusti Fernandez Pardo Date: Fri, 20 May 2022 02:19:33 +0200 Subject: [PATCH] fix: add back req extend types --- lib/helpers/verifyApiKey.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/helpers/verifyApiKey.ts b/lib/helpers/verifyApiKey.ts index c467c6ce99..feba710c5b 100644 --- a/lib/helpers/verifyApiKey.ts +++ b/lib/helpers/verifyApiKey.ts @@ -1,8 +1,22 @@ +import type { IncomingMessage } from "http"; import { NextMiddleware } from "next-api-middleware"; import { hashAPIKey } from "@calcom/ee/lib/api/apiKeys"; import prisma from "@calcom/prisma"; +/** @todo figure how to use the one from `@calcom/types`fi */ +/** @todo: remove once `@calcom/types` is updated with it.*/ +declare module "next" { + export interface NextApiRequest extends IncomingMessage { + userId: number; + body: Body; + method: string; + query: { + apiKey: string; + }; + } +} + // Used to check if the apiKey is not expired, could be extracted if reused. but not for now. export const dateNotInPast = function (date: Date) { const now = new Date();