Skip to content

Scheduling infrastructure for absolutely everyone.

Fix/api build (#3675)

Agusti Fernandez Pardoe878e1a6653f
diff --git a/packages/app-store/ee/routing_forms/trpc-router.ts b/packages/app-store/ee/routing_forms/trpc-router.ts
index c736eec0d7a..adaf57e8865 100644
--- a/packages/app-store/ee/routing_forms/trpc-router.ts
+++ b/packages/app-store/ee/routing_forms/trpc-router.ts
@@ -2,12 +2,11 @@ import { Prisma, WebhookTriggerEvents } from "@prisma/client";
import { v4 as uuidv4 } from "uuid";
import { z } from "zod";
+import { sendGenericWebhookPayload } from "@calcom/lib/webhooks/sendPayload";
+import getWebhooks from "@calcom/lib/webhooks/subscriptions";
import { TRPCError } from "@calcom/trpc/server";
import { createProtectedRouter, createRouter } from "@calcom/trpc/server/createRouter";
-import { sendGenericWebhookPayload } from "@lib/webhooks/sendPayload";
-import getWebhooks from "@lib/webhooks/subscriptions";
-
import { zodFields, zodRoutes } from "./zod";
const app_RoutingForms = createRouter()
diff --git a/packages/app-store/next-auth.d.ts b/packages/app-store/next-auth.d.ts
deleted file mode 100644
index 066f3129229..00000000000
--- a/packages/app-store/next-auth.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import NextAuth, { DefaultSession } from "next-auth";
-
-declare module "next-auth" {
- type DefaultSessionUser = NonNullable<DefaultSession["user"]>;
- type CalendsoSessionUser = DefaultSessionUser & {
- id: number;
- username: string;
- };
- /**
- * Returned by `useSession`, `getSession` and received as a prop on the `Provider` React Context
- */
- interface Session {
- user: CalendsoSessionUser;
- }
-}
diff --git a/packages/app-store/next.d.ts b/packages/app-store/next.d.ts
deleted file mode 100644
index 865eacefbf2..00000000000
--- a/packages/app-store/next.d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import type { IncomingMessage } from "http";
-import type { Session } from "next-auth";
-
-import "./next-auth";
-
-export declare module "next" {
- interface NextApiRequest extends IncomingMessage {
- // args is defined by /integrations/[...args] endpoint
- query: Partial<{ [key: string]: string | string[] }> & { args: string[] };
- session?: Session | null;
- }
-}
diff --git a/packages/app-store/tsconfig.json b/packages/app-store/tsconfig.json
index 2cf1a3c3df5..ec53741a1c3 100644
--- a/packages/app-store/tsconfig.json
+++ b/packages/app-store/tsconfig.json
@@ -13,8 +13,8 @@
"include": [
"next-env.d.ts",
"@calcom/types",
- "../../packages/types/*.d.ts",
- "../../packages/types/next-auth.d.ts",
+ "../types/*.d.ts",
+ "../types/next-auth.d.ts",
"**/*.ts",
"**/*.tsx",
"../../apps/web/server/**/*.ts",
diff --git a/packages/lib/auth.ts b/packages/lib/auth.ts
index 94691cd5fe6..3b5b429ad1a 100644
--- a/packages/lib/auth.ts
+++ b/packages/lib/auth.ts
@@ -1,5 +1,5 @@
import { compare, hash } from "bcryptjs";
-import { Session } from "next-auth";
+import type { Session } from "next-auth";
import { getSession as getSessionInner, GetSessionParams } from "next-auth/react";
export async function hashPassword(password: string) {
diff --git a/packages/trpc/server/createContext.ts b/packages/trpc/server/createContext.ts
index 9585e34d460..6295a85fb20 100644
--- a/packages/trpc/server/createContext.ts
+++ b/packages/trpc/server/createContext.ts
@@ -1,5 +1,5 @@
-import { GetServerSidePropsContext } from "next";
-import { Session } from "next-auth";
+import type { GetServerSidePropsContext } from "next";
+import type { Session } from "next-auth";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { getSession } from "@calcom/lib/auth";
diff --git a/packages/trpc/tsconfig.json b/packages/trpc/tsconfig.json
new file mode 100644
index 00000000000..11e86362e18
--- /dev/null
+++ b/packages/trpc/tsconfig.json
@@ -0,0 +1,3 @@
+{
+ "extends": "@calcom/tsconfig/react-library.json"
+}
diff --git a/packages/tsconfig/nextjs.json b/packages/tsconfig/nextjs.json
index 048d2671ac8..367eb4454ef 100644
--- a/packages/tsconfig/nextjs.json
+++ b/packages/tsconfig/nextjs.json
@@ -15,11 +15,12 @@
"esModuleInterop": true,
"module": "esnext",
"resolveJsonModule": true,
+ "strict": true,
"isolatedModules": true,
"jsx": "preserve",
"strictNullChecks": true,
"useUnknownInCatchVariables": true
},
- "include": ["src", "next-env.d.ts"],
+ "include": ["src", "next-env.d.ts", "../types/next-auth.d.ts", "../types/*.d.ts"],
"exclude": ["node_modules"]
}
diff --git a/packages/tsconfig/react-library.json b/packages/tsconfig/react-library.json
index 6d6a7fea97f..35821a52361 100644
--- a/packages/tsconfig/react-library.json
+++ b/packages/tsconfig/react-library.json
@@ -7,5 +7,7 @@
"module": "ESNext",
"target": "ES6",
"jsx": "react-jsx"
- }
+ },
+ "include": [".", "../types/next-auth.d.ts"],
+ "exclude": ["dist", "build", "node_modules"]
}
diff --git a/packages/types/next-auth.d.ts b/packages/types/next-auth.d.ts
index b447c8fb78d..188d2d66e08 100644
--- a/packages/types/next-auth.d.ts
+++ b/packages/types/next-auth.d.ts
@@ -1,5 +1,5 @@
import { UserPermissionRole } from "@prisma/client";
-import NextAuth, { DefaultSession } from "next-auth";
+import { DefaultSession } from "next-auth";
declare module "next-auth" {
type DefaultSessionUser = NonNullable<DefaultSession["user"]>;
diff --git a/packages/types/next.d.ts b/packages/types/next.d.ts
index aa0e02c1c29..865eacefbf2 100644
--- a/packages/types/next.d.ts
+++ b/packages/types/next.d.ts
@@ -5,6 +5,8 @@ import "./next-auth";
export declare module "next" {
interface NextApiRequest extends IncomingMessage {
+ // args is defined by /integrations/[...args] endpoint
+ query: Partial<{ [key: string]: string | string[] }> & { args: string[] };
session?: Session | null;
}
}