This repository was archived by the owner on Nov 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 122
feat: Introduce new msg interface and correct the tests #767
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bfb806a
introduce new msg type and correct the tests
Dnouv 74144d1
remove unmapped property
Dnouv 46df84b
Update src/definition/messages/IMessageRaw.ts
Dnouv e2eb80f
update types for roomId
Dnouv cb7775b
Add comment to IMessageRaw
d-gubert 7362e7e
Fix lint
d-gubert 36526a3
Refactor typing
d-gubert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import type { IBlock, Block } from '@rocket.chat/ui-kit'; | ||
|
|
||
| import type { IRoom } from '../rooms'; | ||
| import type { IUserLookup } from '../users'; | ||
| import type { IMessageAttachment } from './IMessageAttachment'; | ||
| import type { IMessageFile } from './IMessageFile'; | ||
| import type { IMessageReactions } from './IMessageReaction'; | ||
|
|
||
| /** | ||
| * The raw version of a message, without resolved information for relationship fields, i.e. | ||
| * `room`, `sender` and `editor` are not the complete entity like they are in `IMessage` | ||
| * | ||
| * This is used in methods that fetch multiple messages at the same time, as resolving the relationship | ||
| * fields require additional queries to the database and would hit the system's performance significantly. | ||
| */ | ||
| export interface IMessageRaw { | ||
| id: string; | ||
| roomId: IRoom['id']; | ||
| sender: IUserLookup; | ||
| createdAt: Date; | ||
| threadId?: string; | ||
| text?: string; | ||
| updatedAt?: Date; | ||
| editor?: IUserLookup; | ||
| editedAt?: Date; | ||
| emoji?: string; | ||
| avatarUrl?: string; | ||
| alias?: string; | ||
| file?: IMessageFile; | ||
| attachments?: Array<IMessageAttachment>; | ||
| reactions?: IMessageReactions; | ||
| groupable?: boolean; | ||
| parseUrls?: boolean; | ||
| customFields?: { [key: string]: any }; | ||
| blocks?: Array<IBlock | Block>; | ||
| starred?: Array<{ _id: string }>; | ||
| pinned?: boolean; | ||
| pinnedAt?: Date; | ||
| pinnedBy?: IUserLookup; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| export interface IUserLookup { | ||
| _id: string; | ||
| username: string; | ||
| name?: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.