import { z } from 'zod';
import { Direction } from './enums.js';
export const zNumeric = z.string().transform((val, ctx) => {
    if (typeof val === 'number')
        return val;
    const parsed = parseInt(val);
    if (isNaN(parsed)) {
        ctx.addIssue({
            code: z.ZodIssueCode.custom,
            message: 'Not a number'
        });
    }
    return val;
});
export const ZSearchParams = z.object({
    cursor: z.string().optional(),
    direction: z.nativeEnum(Direction).optional(),
    isInclusive: z.enum(['true']).optional(),
    limit: zNumeric.optional(),
    term: z.string().optional()
});
