mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
57 lines
1.4 KiB
TypeScript
57 lines
1.4 KiB
TypeScript
import { z } from "zod"
|
|
|
|
export enum MessageAttachmentSource {
|
|
Webtrix = 1,
|
|
Device,
|
|
}
|
|
|
|
export enum MessageAttachmentFileType {
|
|
Doc = 1,
|
|
Image ,
|
|
Audio ,
|
|
Video
|
|
}
|
|
|
|
export const MessageOutPutDataDTOSchema = z.object({
|
|
id: z.string(),
|
|
roomId: z.string(),
|
|
sender: z.object({
|
|
wxUserId: z.number(),
|
|
wxFullName: z.string(),
|
|
wxeMail: z.string(),
|
|
userPhoto: z.string().optional()
|
|
}),
|
|
message: z.string().nullable().optional(),
|
|
messageType: z.number(),
|
|
sentAt: z.string(),
|
|
canEdit: z.boolean(),
|
|
oneShot: z.boolean(),
|
|
requireUnlock: z.boolean(),
|
|
requestId: z.string().optional(),
|
|
reactions: z.object({
|
|
id: z.string(),
|
|
reactedAt: z.string(),
|
|
reaction: z.string(),
|
|
sender: z.object({}),
|
|
}).array(),
|
|
info: z.array(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(),
|
|
id: z.string()
|
|
}))
|
|
});
|
|
|
|
export const MessageOutPutDTOSchema = z.object({
|
|
success: z.boolean(),
|
|
message: z.string(),
|
|
data: MessageOutPutDataDTOSchema.array()
|
|
});
|
|
|
|
export type MessageOutPutDataDTO = z.infer<typeof MessageOutPutDataDTOSchema>
|
|
export type MessageOutPutDTO = z.infer<typeof MessageOutPutDTOSchema>
|