Files
outline/server/routes/api/apiKeys/schema.ts
Mohamed ELIDRISSI 492beedf00 refactor: add server side validation schema for apiKeys (#4859)
* refactor: add tests for apiKey api routes

* refactor: move files to subfolder

* refactor: schema for apiKeys.create and apiKeys.delete
2023-02-11 15:02:52 -08:00

21 lines
484 B
TypeScript

import { z } from "zod";
import BaseSchema from "@server/routes/api/BaseSchema";
export const APIKeysCreateSchema = BaseSchema.extend({
body: z.object({
/** API Key name */
name: z.string(),
}),
});
export type APIKeysCreateReq = z.infer<typeof APIKeysCreateSchema>;
export const APIKeysDeleteSchema = BaseSchema.extend({
body: z.object({
/** API Key Id */
id: z.string().uuid(),
}),
});
export type APIKeysDeleteReq = z.infer<typeof APIKeysDeleteSchema>;