2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
2024-11-29 07:01:54 -08:00
|
|
|
/**
|
|
|
|
* @category Admin schemas
|
|
|
|
*/
|
2024-10-21 11:39:23 -07:00
|
|
|
const adminRelaySchema = v.pipe(
|
2024-10-15 16:08:56 -07:00
|
|
|
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),
|
|
|
|
}),
|
|
|
|
);
|
2024-08-28 04:43:23 -07:00
|
|
|
|
2024-11-29 06:52:33 -08:00
|
|
|
/**
|
2024-11-29 07:01:54 -08:00
|
|
|
* @category Admin entity types
|
2024-11-29 06:52:33 -08:00
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
type AdminRelay = v.InferOutput<typeof adminRelaySchema>
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export { adminRelaySchema, type AdminRelay };
|