39 lines
863 B
TypeScript
39 lines
863 B
TypeScript
/**
|
|
* Interface of the server (auto-generated code)
|
|
*/
|
|
import { z as zod } from "zod";
|
|
|
|
|
|
export const ZodPublicKey = zod.object({
|
|
key: zod.string().max(255).optional(),
|
|
|
|
});
|
|
|
|
export type PublicKey = zod.infer<typeof ZodPublicKey>;
|
|
|
|
export function isPublicKey(data: any): data is PublicKey {
|
|
try {
|
|
ZodPublicKey.parse(data);
|
|
return true;
|
|
} catch (e: any) {
|
|
console.log(`Fail to parse data type='ZodPublicKey' error=${e}`);
|
|
return false;
|
|
}
|
|
}
|
|
export const ZodPublicKeyWrite = zod.object({
|
|
key: zod.string().max(255).nullable().optional(),
|
|
|
|
});
|
|
|
|
export type PublicKeyWrite = zod.infer<typeof ZodPublicKeyWrite>;
|
|
|
|
export function isPublicKeyWrite(data: any): data is PublicKeyWrite {
|
|
try {
|
|
ZodPublicKeyWrite.parse(data);
|
|
return true;
|
|
} catch (e: any) {
|
|
console.log(`Fail to parse data type='ZodPublicKeyWrite' error=${e}`);
|
|
return false;
|
|
}
|
|
}
|