Files
outline/server/routes/api/apiKeys/schema.ts
Hemachandar 3af9861c4a feat: add API key expiry options (#7064)
* feat: add API key expiry options

* review
2024-06-18 18:34:45 -07:00

23 lines
558 B
TypeScript

import { z } from "zod";
import { BaseSchema } from "@server/routes/api/schema";
export const APIKeysCreateSchema = BaseSchema.extend({
body: z.object({
/** API Key name */
name: z.string(),
/** API Key expiry date */
expiresAt: z.coerce.date().optional(),
}),
});
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>;