42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
/**
|
|
* Interface of the server (auto-generated code)
|
|
*/
|
|
import { z as zod } from "zod";
|
|
|
|
import {ZodGenericData, ZodGenericDataWrite } from "./generic-data";
|
|
|
|
export const ZodGenericDataSoftDelete = ZodGenericData.extend({
|
|
/**
|
|
* Deleted state
|
|
*/
|
|
deleted: zod.boolean().readonly().optional(),
|
|
|
|
});
|
|
|
|
export type GenericDataSoftDelete = zod.infer<typeof ZodGenericDataSoftDelete>;
|
|
|
|
export function isGenericDataSoftDelete(data: any): data is GenericDataSoftDelete {
|
|
try {
|
|
ZodGenericDataSoftDelete.parse(data);
|
|
return true;
|
|
} catch (e: any) {
|
|
console.log(`Fail to parse data type='ZodGenericDataSoftDelete' error=${e}`);
|
|
return false;
|
|
}
|
|
}
|
|
export const ZodGenericDataSoftDeleteWrite = ZodGenericDataWrite.extend({
|
|
|
|
});
|
|
|
|
export type GenericDataSoftDeleteWrite = zod.infer<typeof ZodGenericDataSoftDeleteWrite>;
|
|
|
|
export function isGenericDataSoftDeleteWrite(data: any): data is GenericDataSoftDeleteWrite {
|
|
try {
|
|
ZodGenericDataSoftDeleteWrite.parse(data);
|
|
return true;
|
|
} catch (e: any) {
|
|
console.log(`Fail to parse data type='ZodGenericDataSoftDeleteWrite' error=${e}`);
|
|
return false;
|
|
}
|
|
}
|