25 lines
760 B
TypeScript
25 lines
760 B
TypeScript
import { type TypeOf, boolean, string, array } from 'zod'
|
|
|
|
import { AbstractSchema } from './abstract'
|
|
import { ListSchema } from './list'
|
|
import { UserSchema } from './user'
|
|
import { SubscriptionSchema } from './subscription'
|
|
import { IdSchema } from './common/id'
|
|
import { HexColorSchema } from './common/hexColor'
|
|
|
|
export const NamespaceSchema = AbstractSchema.extend({
|
|
id: IdSchema.default(0),
|
|
title: string().default(''),
|
|
description: string().default(''),
|
|
owner: UserSchema,
|
|
lists: array(ListSchema),
|
|
isArchived: boolean().default(false),
|
|
hexColor: HexColorSchema.default(''),
|
|
subscription: SubscriptionSchema.nullable(),
|
|
|
|
created: IdSchema.nullable(),
|
|
updated: IdSchema.nullable(),
|
|
})
|
|
|
|
export type Namespace = TypeOf<typeof NamespaceSchema>
|