14 lines
376 B
TypeScript
14 lines
376 B
TypeScript
import { type TypeOf, object, number, string } from 'zod'
|
|
import { DateSchema } from './common/date'
|
|
import { IdSchema } from './common/id'
|
|
|
|
export const FileSchema = object({
|
|
id: IdSchema.default(0),
|
|
mime: string().default(''),
|
|
name: string().default(''),
|
|
size: number().default(0),
|
|
created: DateSchema.nullable(),
|
|
})
|
|
|
|
export type File = TypeOf<typeof FileSchema>
|