46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
/**
|
|
* Interface of the server (auto-generated code)
|
|
*/
|
|
import { z as zod } from "zod";
|
|
|
|
import {ZodLong} from "./long";
|
|
|
|
export const ZodApplicationSmall = zod.object({
|
|
id: ZodLong.optional(),
|
|
name: zod.string().max(255).optional(),
|
|
description: zod.string().max(255).optional(),
|
|
redirect: zod.string().max(255).optional(),
|
|
|
|
});
|
|
|
|
export type ApplicationSmall = zod.infer<typeof ZodApplicationSmall>;
|
|
|
|
export function isApplicationSmall(data: any): data is ApplicationSmall {
|
|
try {
|
|
ZodApplicationSmall.parse(data);
|
|
return true;
|
|
} catch (e: any) {
|
|
console.log(`Fail to parse data type='ZodApplicationSmall' error=${e}`);
|
|
return false;
|
|
}
|
|
}
|
|
export const ZodApplicationSmallWrite = zod.object({
|
|
id: ZodLong.nullable().optional(),
|
|
name: zod.string().max(255).nullable().optional(),
|
|
description: zod.string().max(255).nullable().optional(),
|
|
redirect: zod.string().max(255).nullable().optional(),
|
|
|
|
});
|
|
|
|
export type ApplicationSmallWrite = zod.infer<typeof ZodApplicationSmallWrite>;
|
|
|
|
export function isApplicationSmallWrite(data: any): data is ApplicationSmallWrite {
|
|
try {
|
|
ZodApplicationSmallWrite.parse(data);
|
|
return true;
|
|
} catch (e: any) {
|
|
console.log(`Fail to parse data type='ZodApplicationSmallWrite' error=${e}`);
|
|
return false;
|
|
}
|
|
}
|