2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
2024-10-29 14:26:53 -07:00
|
|
|
/**
|
|
|
|
* @category Schemas
|
|
|
|
* @see {@link https://docs.joinmastodon.org/entities/DomainBlock}
|
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
const domainBlockSchema = v.object({
|
|
|
|
domain: v.string(),
|
|
|
|
digest: v.string(),
|
2024-10-14 11:54:44 -07:00
|
|
|
severity: v.picklist(['silence', 'suspend']),
|
2024-10-13 15:25:30 -07:00
|
|
|
comment: v.fallback(v.optional(v.string()), undefined),
|
2024-08-28 04:43:23 -07:00
|
|
|
});
|
|
|
|
|
2024-11-29 07:01:54 -08:00
|
|
|
/**
|
|
|
|
* @category Entity types
|
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
type DomainBlock = v.InferOutput<typeof domainBlockSchema>;
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export { domainBlockSchema, type DomainBlock };
|