18 lines
522 B
TypeScript
18 lines
522 B
TypeScript
import { Type } from 'typebox'
|
|
|
|
export const UserSchema = Type.Object({
|
|
username: Type.String(),
|
|
displayName: Type.String(),
|
|
createdAt: Type.String({ format: 'date-time' }),
|
|
}, { $id: 'User' })
|
|
|
|
export const CreateUserPayloadSchema = Type.Object({
|
|
username: Type.String({ minLength: 1 }),
|
|
password: Type.String({ minLength: 6 }),
|
|
}, { $id: 'CreateUser' })
|
|
|
|
export const LoginPayloadSchema = Type.Object({
|
|
username: Type.String({ minLength: 1 }),
|
|
password: Type.String({ minLength: 1 }),
|
|
}, { $id: 'Login' })
|