2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
import { locationSchema } from './location';
|
|
|
|
|
|
|
|
/** @see {@link https://docs.joinmastodon.org/entities/StatusSource/} */
|
2024-10-13 15:25:30 -07:00
|
|
|
const statusSourceSchema = v.object({
|
|
|
|
id: v.string(),
|
|
|
|
text: v.fallback(v.string(), ''),
|
|
|
|
spoiler_text: v.fallback(v.string(), ''),
|
2024-08-28 04:43:23 -07:00
|
|
|
|
2024-10-14 15:07:22 -07:00
|
|
|
content_type: v.fallback(v.string(), 'text/plain'),
|
2024-10-13 15:25:30 -07:00
|
|
|
location: v.fallback(v.nullable(locationSchema), null),
|
2024-08-28 04:43:23 -07:00
|
|
|
|
2024-10-14 15:07:22 -07:00
|
|
|
text_map: v.fallback(v.nullable(v.record(v.string(), v.string())), null),
|
|
|
|
spoiler_text_map: v.fallback(v.nullable(v.record(v.string(), v.string())), null),
|
2024-08-28 04:43:23 -07:00
|
|
|
});
|
|
|
|
|
2024-10-13 15:25:30 -07:00
|
|
|
type StatusSource = v.InferOutput<typeof statusSourceSchema>;
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export { statusSourceSchema, type StatusSource };
|