вложения, канальчики, бим-бим + бам-бам

This commit is contained in:
2026-04-25 00:51:12 +06:00
parent 0b75148a3f
commit ad477ee813
61 changed files with 14636 additions and 375 deletions

26
server/schemas/chat.ts Normal file
View File

@@ -0,0 +1,26 @@
import { Type } from 'typebox'
export const ReplySchema = Type.Object({
messageId: Type.String({ format: 'uuid' }),
senderId: Type.String({ format: 'uuid' }),
text: Type.String(),
}, { title: 'Reply', description: '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' })),
// replyTo: ReplySchema,
}, { title: 'ChatMessage', description: 'ChatMessage' })
export const NewChatMessageSchema = Type.Object({
text: Type.String({ minLength: 1 }),
attachments: Type.Optional(Type.Array(Type.String({ format: 'uuid' }))),
// replyTo: Type.Object({
// messageId: Type.String({ format: 'uuid' }),
// }),
}, { title: 'NewChatMessage', description: 'NewChatMessage' })