fix: add back req extend types

pull/9078/head
Agusti Fernandez Pardo 2022-05-20 02:19:33 +02:00
parent d23fa4be4e
commit 29deb1fd3c
1 changed files with 14 additions and 0 deletions

View File

@ -1,8 +1,22 @@
import type { IncomingMessage } from "http";
import { NextMiddleware } from "next-api-middleware"; import { NextMiddleware } from "next-api-middleware";
import { hashAPIKey } from "@calcom/ee/lib/api/apiKeys"; import { hashAPIKey } from "@calcom/ee/lib/api/apiKeys";
import prisma from "@calcom/prisma"; 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. // Used to check if the apiKey is not expired, could be extracted if reused. but not for now.
export const dateNotInPast = function (date: Date) { export const dateNotInPast = function (date: Date) {
const now = new Date(); const now = new Date();