pleroma/packages/pl-api/lib/entities/admin/relay.ts
marcin mikołajczak 036fa32cd3 Add pl-api to workspace
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:43:23 +02:00

11 lines
313 B
TypeScript

import z from 'zod';
const adminRelaySchema = z.preprocess((data: any) => ({ id: data.actor, ...data }), z.object({
actor: z.string().catch(''),
id: z.string(),
followed_back: z.boolean().catch(false),
}));
type AdminRelay = z.infer<typeof adminRelaySchema>
export { adminRelaySchema, type AdminRelay };