mirror of
https://github.com/Thream/website.git
synced 2024-07-21 09:28:32 +02:00
a0fa66e8f5
Co-authored-by: Walid <87608619+WalidKorchi@users.noreply.github.com>
21 lines
448 B
TypeScript
21 lines
448 B
TypeScript
import { Type } from '@sinclair/typebox'
|
|
|
|
import { date, id } from './utils'
|
|
|
|
export const types = [Type.Literal('text'), Type.Literal('file')]
|
|
|
|
export const messageSchema = {
|
|
id,
|
|
value: Type.String(),
|
|
type: Type.Union(types, { default: 'text' }),
|
|
mimetype: Type.String({
|
|
maxLength: 255,
|
|
default: 'text/plain',
|
|
format: 'mimetype'
|
|
}),
|
|
createdAt: date.createdAt,
|
|
updatedAt: date.updatedAt,
|
|
memberId: id,
|
|
channelId: id
|
|
}
|