({
message,
files,
threadId,
author,
mentions,
}: {
message: string;
files: UploadedFile[];
threadId: string;
author: SerializedUser;
mentions: SerializedUser[];
})
| 84 | } |
| 85 | |
| 86 | export function createMessageImitation({ |
| 87 | message, |
| 88 | files, |
| 89 | threadId, |
| 90 | author, |
| 91 | mentions, |
| 92 | }: { |
| 93 | message: string; |
| 94 | files: UploadedFile[]; |
| 95 | threadId: string; |
| 96 | author: SerializedUser; |
| 97 | mentions: SerializedUser[]; |
| 98 | }): SerializedMessage { |
| 99 | return { |
| 100 | id: uuid(), |
| 101 | body: message, |
| 102 | sentAt: new Date().toISOString(), |
| 103 | usersId: author.id, |
| 104 | mentions, |
| 105 | attachments: files.map((file) => { |
| 106 | return { name: file.id, url: file.url }; |
| 107 | }), |
| 108 | reactions: [], |
| 109 | threadId, |
| 110 | messageFormat: MessageFormat.LINEN, |
| 111 | externalId: null, |
| 112 | author: { |
| 113 | id: author.id, |
| 114 | externalUserId: author.externalUserId, |
| 115 | username: username(author.displayName), |
| 116 | displayName: author.displayName, |
| 117 | profileImageUrl: author.profileImageUrl, |
| 118 | authsId: null, |
| 119 | role: author.role, |
| 120 | }, |
| 121 | }; |
| 122 | } |
no test coverage detected