43 lines
1019 B
TypeScript
43 lines
1019 B
TypeScript
/**
|
|
* Interface of the server (auto-generated code)
|
|
*/
|
|
import { z as zod } from "zod";
|
|
|
|
import {ZodGenericToken} from "./generic-token";
|
|
|
|
export const ZodApplicationToken = ZodGenericToken.extend({
|
|
|
|
});
|
|
|
|
export type ApplicationToken = zod.infer<typeof ZodApplicationToken>;
|
|
|
|
export function isApplicationToken(data: any): data is ApplicationToken {
|
|
try {
|
|
ZodApplicationToken.parse(data);
|
|
return true;
|
|
} catch (e: any) {
|
|
console.log(`Fail to parse data type='ZodApplicationToken' error=${e}`);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
export const ZodApplicationTokenWrite = ZodApplicationToken.omit({
|
|
deleted: true,
|
|
id: true,
|
|
createdAt: true,
|
|
updatedAt: true,
|
|
|
|
}).partial();
|
|
|
|
export type ApplicationTokenWrite = zod.infer<typeof ZodApplicationTokenWrite>;
|
|
|
|
export function isApplicationTokenWrite(data: any): data is ApplicationTokenWrite {
|
|
try {
|
|
ZodApplicationTokenWrite.parse(data);
|
|
return true;
|
|
} catch (e: any) {
|
|
console.log(`Fail to parse data type='ZodApplicationTokenWrite' error=${e}`);
|
|
return false;
|
|
}
|
|
}
|