tianji/prisma/zod/monitorevent.ts

25 lines
771 B
TypeScript
Raw Normal View History

import * as z from "zod"
2023-12-13 10:21:04 +00:00
import * as imports from "./schemas"
import { CompleteMonitor, RelatedMonitorModelSchema } from "./index"
export const MonitorEventModelSchema = z.object({
id: z.string(),
message: z.string(),
monitorId: z.string(),
type: z.string(),
createdAt: z.date(),
})
export interface CompleteMonitorEvent extends z.infer<typeof MonitorEventModelSchema> {
monitor: CompleteMonitor
}
/**
* RelatedMonitorEventModelSchema contains all relations on your model in addition to the scalars
*
* NOTE: Lazy required in case of potential circular dependencies within schema
*/
export const RelatedMonitorEventModelSchema: z.ZodSchema<CompleteMonitorEvent> = z.lazy(() => MonitorEventModelSchema.extend({
monitor: RelatedMonitorModelSchema,
}))