bigbuffet-rw/packages/pl-api/lib/entities/directory/server.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

27 lines
782 B
TypeScript

import * as v from 'valibot';
/**
* @category Directory schemas
*/
const directoryServerSchema = v.object({
domain: v.string(),
version: v.string(),
description: v.string(),
languages: v.array(v.string()),
region: v.string(),
categories: v.array(v.string()),
proxied_thumbnail: v.fallback(v.nullable(v.pipe(v.string(), v.url())), null),
blurhash: v.fallback(v.nullable(v.string()), null),
total_users: v.pipe(v.unknown(), v.transform(Number)),
last_week_users: v.pipe(v.unknown(), v.transform(Number)),
approval_required: v.boolean(),
language: v.string(),
category: v.string(),
});
/**
* @category Directory entity types
*/
type DirectoryServer = v.InferOutput<typeof directoryServerSchema>;
export { directoryServerSchema, type DirectoryServer };