2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
2024-10-16 08:03:27 -07:00
|
|
|
import { datetimeSchema } from '../utils';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
2024-11-29 06:52:33 -08:00
|
|
|
/**
|
|
|
|
* @category Admin schemas
|
|
|
|
* @see {@link https://docs.joinmastodon.org/entities/Admin_DomainBlock/}
|
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
const adminDomainBlockSchema = v.object({
|
|
|
|
id: v.string(),
|
|
|
|
domain: v.string(),
|
|
|
|
digest: v.string(),
|
2024-10-16 08:03:27 -07:00
|
|
|
created_at: datetimeSchema,
|
2024-10-14 11:54:44 -07:00
|
|
|
severity: v.picklist(['silence', 'suspend', 'noop']),
|
2024-10-13 15:25:30 -07:00
|
|
|
reject_media: v.boolean(),
|
|
|
|
reject_reports: v.boolean(),
|
|
|
|
private_comment: v.fallback(v.nullable(v.string()), null),
|
|
|
|
public_comment: v.fallback(v.nullable(v.string()), null),
|
|
|
|
obfuscate: v.boolean(),
|
2024-08-28 04:43:23 -07:00
|
|
|
});
|
|
|
|
|
2024-11-29 06:52:33 -08:00
|
|
|
/**
|
2024-11-29 07:01:54 -08:00
|
|
|
* @category Admin entity types
|
2024-11-29 06:52:33 -08:00
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
type AdminDomainBlock = v.InferOutput<typeof adminDomainBlockSchema>;
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export {
|
|
|
|
adminDomainBlockSchema,
|
|
|
|
type AdminDomainBlock,
|
|
|
|
};
|