bigbuffet-rw/packages/pl-api/lib/entities/admin/relay.ts
marcin mikołajczak a6bc160caa pl-api: Do some blind search and replace
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-14 00:25:30 +02:00

11 lines
340 B
TypeScript

import * as v from 'valibot';
const adminRelaySchema = z.preprocess((data: any) => ({ id: data.actor, ...data }), v.object({
actor: v.fallback(v.string(), ''),
id: v.string(),
followed_back: v.fallback(v.boolean(), false),
}));
type AdminRelay = v.InferOutput<typeof adminRelaySchema>
export { adminRelaySchema, type AdminRelay };