Add pl-api to workspace

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-08-28 13:43:23 +02:00
parent 966b04fdf0
commit 036fa32cd3
114 changed files with 11923 additions and 1 deletions

View File

@ -0,0 +1,22 @@
import { z } from 'zod';
import { Resolve } from '../utils/types';
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 = Resolve<z.infer<typeof statusSourceSchema>>;
export { statusSourceSchema, type StatusSource };