mirror of
https://github.com/outline/outline.git
synced 2026-11-21 13:34:02 +03:00
* Allow returning team apiKeys.list for admins from apiKeys.list * Filter apikeys in store
32 lines
784 B
TypeScript
32 lines
784 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 APIKeysListSchema = BaseSchema.extend({
|
|
body: z.object({
|
|
/** The owner of the API key */
|
|
userId: z.string().uuid().optional(),
|
|
}),
|
|
});
|
|
|
|
export type APIKeysListReq = z.infer<typeof APIKeysListSchema>;
|
|
|
|
export const APIKeysDeleteSchema = BaseSchema.extend({
|
|
body: z.object({
|
|
/** API Key Id */
|
|
id: z.string().uuid(),
|
|
}),
|
|
});
|
|
|
|
export type APIKeysDeleteReq = z.infer<typeof APIKeysDeleteSchema>;
|