karso/front/src/back-api/model/change-password.ts
Edouard DUPIN 307a091178 plop
2025-07-04 18:15:12 +02:00

27 lines
650 B
TypeScript

/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
export const ZodChangePassword = zod.object({
method: zod.string().min(2).max(2),
login: zod.string().min(3).max(128),
time: zod.string().min(20).max(64),
password: zod.string().min(128).max(128),
newPassword: zod.string().min(128).max(128),
});
export type ChangePassword = zod.infer<typeof ZodChangePassword>;
export function isChangePassword(data: any): data is ChangePassword {
try {
ZodChangePassword.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodChangePassword' error=${e}`);
return false;
}
}