2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-30 10:28:12 -07:00
|
|
|
|
2024-10-13 15:25:30 -07:00
|
|
|
const directoryServerSchema = v.object({
|
|
|
|
domain: v.string(),
|
|
|
|
version: v.string(),
|
|
|
|
description: v.string(),
|
|
|
|
languages: z.array(v.string()),
|
|
|
|
region: v.string(),
|
|
|
|
categories: z.array(v.string()),
|
2024-08-30 10:28:12 -07:00
|
|
|
proxied_thumbnail: z.string().url().nullable().catch(null),
|
2024-10-13 15:25:30 -07:00
|
|
|
blurhash: v.fallback(v.nullable(v.string()), null),
|
2024-08-30 10:28:12 -07:00
|
|
|
total_users: z.coerce.number(),
|
|
|
|
last_week_users: z.coerce.number(),
|
2024-10-13 15:25:30 -07:00
|
|
|
approval_required: v.boolean(),
|
|
|
|
language: v.string(),
|
|
|
|
category: v.string(),
|
2024-08-30 10:28:12 -07:00
|
|
|
});
|
|
|
|
|
2024-10-13 15:25:30 -07:00
|
|
|
type DirectoryServer = v.InferOutput<typeof directoryServerSchema>;
|
2024-08-30 10:28:12 -07:00
|
|
|
|
|
|
|
export { directoryServerSchema, type DirectoryServer };
|