This commit is contained in:
Peter Maquiran
2024-08-13 10:52:35 +01:00
parent 5b31a186c2
commit 251f533a68
53 changed files with 985 additions and 453 deletions
+25 -6
View File
@@ -21,11 +21,15 @@ const MessageEntitySchema = z.object({
attachments: z.array(z.object({
fileType: z.nativeEnum(MessageAttachmentFileType),
source: z.nativeEnum(MessageAttachmentSource),
file: z.string().optional(),
fileName: z.string().optional(),
applicationId: z.string().optional(),
docId: z.string().optional()
})),
attachmentsSource: z.array(z.object({
file: z.string(),
fileName: z.string(),
applicationId: z.string(),
docId: z.string()
}))
id: z.string(),
})),
})
type Message = z.infer<typeof MessageEntitySchema>;
@@ -56,8 +60,19 @@ export class MessageEntity implements Message {
file?: string,
fileName: string,
applicationId?: string,
docId?: string
}[]
docId?: string,
mimeType?: string,
description?: string
}[] = []
attachmentsSource: {
id: string,
file: string
}[] = []
reactions = []
requestId: string
constructor() {}
@@ -67,4 +82,8 @@ export class MessageEntity implements Message {
}
}
get hasAttachment() {
return this.attachments.length >= 1
}
}