feat(api): upgrade zod to v4 and implement api docs and client generation

This commit is contained in:
Dominik 2025-06-20 13:23:52 +02:00
parent 98776aacb2
commit 87dc6162f4
Signed by: dominik
GPG key ID: 06A4003FC5049644
26 changed files with 4827 additions and 419 deletions

View file

@ -1,13 +1,14 @@
import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
import { z } from 'zod/v4';
export default function useZodForm<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Schema extends z.ZodType<any, any, any>,
Values extends z.infer<Schema>,
>(schema: Schema, defaultValues?: Values) {
return useForm<Values>({
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return useForm<z.input<typeof schema>, any, z.output<typeof schema>>({
resolver: zodResolver(schema),
defaultValues,
});