diff --git a/apps/meteor/app/livechat/imports/server/rest/sms.ts b/apps/meteor/app/livechat/imports/server/rest/sms.ts index 51902bb413e4..f71001ffbe47 100644 --- a/apps/meteor/app/livechat/imports/server/rest/sms.ts +++ b/apps/meteor/app/livechat/imports/server/rest/sms.ts @@ -21,16 +21,6 @@ import { settings } from '../../../../settings/server'; import type { ILivechatMessage } from '../../../server/lib/LivechatTyped'; import { Livechat as LivechatTyped } from '../../../server/lib/LivechatTyped'; -type UploadedFile = { - _id: string; - name?: string; - type?: string; - size?: number; - description?: string; - identify?: { size: { width: number; height: number } }; - format?: string; -}; - const logger = new Logger('SMS'); const getUploadFile = async (details: Omit, fileUrl: string) => { @@ -134,7 +124,7 @@ API.v1.addRoute('livechat/sms-incoming/:service', { await LivechatTyped.getRoom(visitor, { rid, token, msg: '' }, roomInfo, undefined); } - let file: UploadedFile | undefined; + let file: ILivechatMessage['file']; const attachments: (MessageAttachment | undefined)[] = []; const [media] = sms?.media || []; diff --git a/apps/meteor/app/livechat/server/lib/LivechatTyped.ts b/apps/meteor/app/livechat/server/lib/LivechatTyped.ts index 604f02df078d..ea508b047882 100644 --- a/apps/meteor/app/livechat/server/lib/LivechatTyped.ts +++ b/apps/meteor/app/livechat/server/lib/LivechatTyped.ts @@ -103,29 +103,23 @@ type OfflineMessageData = { host?: string; }; +type UploadedFile = { + _id: string; + name?: string; + type?: string; + size?: number; + description?: string; + identify?: { size: { width: number; height: number } }; + format?: string; +}; + export interface ILivechatMessage { token: string; _id: string; rid: string; msg: string; - file?: { - _id: string; - name?: string; - type?: string; - size?: number; - description?: string; - identify?: { size: { width: number; height: number } }; - format?: string; - }; - files?: { - _id: string; - name?: string; - type?: string; - size?: number; - description?: string; - identify?: { size: { width: number; height: number } }; - format?: string; - }[]; + file?: UploadedFile; + files?: UploadedFile[]; attachments?: MessageAttachment[]; alias?: string; groupable?: boolean;