2022-03-25 18:37:51 +00:00
|
|
|
import { withValidation } from "next-validations";
|
|
|
|
|
2022-03-30 12:17:55 +00:00
|
|
|
import { _ApiKeyModel as ApiKey } from "@calcom/prisma/zod";
|
|
|
|
|
2022-04-01 15:53:52 +00:00
|
|
|
export const schemaApiKeyBodyParams = ApiKey.omit({ id: true, userId: true, createdAt: true }).partial();
|
2022-03-30 12:17:55 +00:00
|
|
|
|
|
|
|
export const schemaApiKeyPublic = ApiKey.omit({
|
|
|
|
id: true,
|
|
|
|
userId: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const withValidApiKey = withValidation({
|
|
|
|
schema: schemaApiKeyBodyParams,
|
2022-03-25 18:37:51 +00:00
|
|
|
type: "Zod",
|
|
|
|
mode: "body",
|
|
|
|
});
|