2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
import { dateSchema } from './utils';
|
|
|
|
|
|
|
|
/** @see {@link https://docs.joinmastodon.org/entities/RelationshipSeveranceEvent/} */
|
2024-10-13 15:25:30 -07:00
|
|
|
const relationshipSeveranceEventSchema = v.object({
|
|
|
|
id: v.string(),
|
2024-08-28 04:43:23 -07:00
|
|
|
type: z.enum(['domain_block', 'user_domain_block', 'account_suspension']),
|
2024-10-13 15:25:30 -07:00
|
|
|
purged: v.string(),
|
2024-08-28 04:43:23 -07:00
|
|
|
relationships_count: z.number().optional().catch(undefined),
|
|
|
|
created_at: dateSchema,
|
|
|
|
});
|
|
|
|
|
2024-10-13 15:25:30 -07:00
|
|
|
type RelationshipSeveranceEvent = v.InferOutput<typeof relationshipSeveranceEventSchema>;
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export { relationshipSeveranceEventSchema, type RelationshipSeveranceEvent };
|