bigbuffet-rw/packages/pl-api/lib/entities/admin/relay.ts

22 lines
448 B
TypeScript
Raw Normal View History

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 };