bigbuffet-rw/packages/pl-api/lib/entities/admin/ip-block.ts
marcin mikołajczak bc65755862 pl-api: Update docs
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-11-29 16:01:54 +01:00

26 lines
647 B
TypeScript

import * as v from 'valibot';
import { datetimeSchema } from '../utils';
/**
* @category Admin schemas
* @see {@link https://docs.joinmastodon.org/entities/Admin_IpBlock/}
*/
const adminIpBlockSchema = v.object({
id: v.string(),
ip: v.pipe(v.string(), v.ip()),
severity: v.picklist(['sign_up_requires_approval', 'sign_up_block', 'no_access']),
comment: v.fallback(v.string(), ''),
created_at: datetimeSchema,
expires_at: v.fallback(v.nullable(datetimeSchema), null),
});
/**
* @category Admin entity types
*/
type AdminIpBlock = v.InferOutput<typeof adminIpBlockSchema>;
export {
adminIpBlockSchema,
type AdminIpBlock,
};