bigbuffet-rw/packages/pl-api/lib/entities/admin/ip-block.ts

21 lines
546 B
TypeScript
Raw Normal View History

import * as v from 'valibot';
import { dateSchema } from '../utils';
/** @see {@link https://docs.joinmastodon.org/entities/Admin_IpBlock/} */
const adminIpBlockSchema = v.object({
id: v.string(),
ip: z.string().ip(),
severity: z.enum(['sign_up_requires_approval', 'sign_up_block', 'no_access']),
comment: v.fallback(v.string(), ''),
created_at: dateSchema,
expires_at: z.string().datetime({ offset: true }),
});
type AdminIpBlock = v.InferOutput<typeof adminIpBlockSchema>;
export {
adminIpBlockSchema,
type AdminIpBlock,
};