feat: adds module transpiling so api can require @calcom/prisma and not @prisma/client directly

This commit is contained in:
Agusti Fernandez Pardo committed 2022-03-25 19:37:51 +01:00
1 parent a2817a2fee
commit c2234593db
10 files changed
+183 -3

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import { withValidation } from "next-validations";
import { z } from "zod";
const schemaApiKey = z
.object({
expiresAt: z.date().optional(), // default is 30 days
note: z.string().min(1).optional(),
})
.strict(); // Adding strict so that we can disallow passing in extra fields
const withValidApiKey = withValidation({
schema: schemaApiKey,
type: "Zod",
mode: "body",
});
export { schemaApiKey, withValidApiKey };