работаем бля работаем
This commit is contained in:
25
server/plugins/schemas/chat.ts
Normal file
25
server/plugins/schemas/chat.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Type } from 'typebox'
|
||||
|
||||
export const ReplySchema = Type.Object({
|
||||
messageId: Type.String({ format: 'uuid' }),
|
||||
senderId: Type.String({ format: 'uuid' }),
|
||||
text: Type.String(),
|
||||
}, { $id: 'Reply' })
|
||||
|
||||
export const ChatMessageSchema = Type.Object({
|
||||
id: Type.String({ format: 'uuid' }),
|
||||
senderId: Type.String({ format: 'uuid' }),
|
||||
text: Type.String({ minLength: 1 }),
|
||||
createdAt: Type.String({ format: 'date-time' }),
|
||||
updatedAt: Type.String({ format: 'date-time' }),
|
||||
|
||||
attachments: Type.Array(Type.String({ format: 'uuid' })),
|
||||
}, { $id: 'ChatMessage' })
|
||||
|
||||
export const NewChatMessagePayloadSchema = Type.Object({
|
||||
text: Type.String({ minLength: 1 }),
|
||||
attachments: Type.Optional(Type.Array(Type.String({ format: 'uuid' }))),
|
||||
// replyTo: Type.Object({
|
||||
// messageId: Type.String({ format: 'uuid' }),
|
||||
// }),
|
||||
}, { $id: 'NewChatMessagePayload' })
|
||||
Reference in New Issue
Block a user