pleroma/packages/pl-api/lib/entities/admin/ip-block.ts
marcin mikołajczak a6bc160caa pl-api: Do some blind search and replace
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-14 00:25:30 +02:00

20 lines
546 B
TypeScript

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,
};