27 lines
650 B
TypeScript
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;
|
|
}
|
|
}
|