bigbuffet-rw/packages/pl-api/lib/entities/status-source.ts
marcin mikołajczak d91b55d9b1 cleanup
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-29 22:48:58 +02:00

20 lines
604 B
TypeScript

import { z } from 'zod';
import { locationSchema } from './location';
/** @see {@link https://docs.joinmastodon.org/entities/StatusSource/} */
const statusSourceSchema = z.object({
id: z.string(),
text: z.string().catch(''),
spoiler_text: z.string().catch(''),
content_type: z.string().catch('text/plain'),
location: locationSchema.nullable().catch(null),
text_map: z.record(z.string()).nullable().catch(null),
spoiler_text_map: z.record(z.string()).nullable().catch(null),
});
type StatusSource = z.infer<typeof statusSourceSchema>;
export { statusSourceSchema, type StatusSource };