cal.pub0.org/lib/validations/apiKey.ts

17 lines
419 B
TypeScript
Raw Normal View History

import { withValidation } from "next-validations";
2022-03-30 12:17:55 +00:00
import { _ApiKeyModel as ApiKey } from "@calcom/prisma/zod";
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,
type: "Zod",
mode: "body",
});