bigbuffet-rw/packages/pl-api/lib/entities/admin/relay.ts
marcin mikołajczak bc65755862 pl-api: Update docs
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-11-29 16:01:54 +01:00

21 lines
448 B
TypeScript

import * as v from 'valibot';
/**
* @category Admin schemas
*/
const adminRelaySchema = v.pipe(
v.any(),
v.transform((data: any) => ({ id: data.actor, ...data })),
v.object({
actor: v.fallback(v.string(), ''),
id: v.string(),
followed_back: v.fallback(v.boolean(), false),
}),
);
/**
* @category Admin entity types
*/
type AdminRelay = v.InferOutput<typeof adminRelaySchema>
export { adminRelaySchema, type AdminRelay };