@@ -50,6 +50,7 @@ import { followMessage } from '../../../threads/server/methods/followMessage';
5050import { unfollowMessage } from '../../../threads/server/methods/unfollowMessage' ;
5151import { normalizeMessagesForUser } from '../../../utils/server/lib/normalizeMessagesForUser' ;
5252import { API } from '../api' ;
53+ import type { ExtractRoutesFromAPI } from '../ApiClass' ;
5354import { getPaginationItems } from '../helpers/getPaginationItems' ;
5455import { findDiscussionsFromRoom , findMentionedMessages , findStarredMessages } from '../lib/messages' ;
5556
@@ -270,7 +271,7 @@ const ChatSyncMessagesSchema = {
270271 additionalProperties : false ,
271272} ;
272273
273- const isChatSyncMessagesProps = ajv . compile < ChatSyncMessages > ( ChatSyncMessagesSchema ) ;
274+ const isChatSyncMessagesLocalProps = ajv . compile < ChatSyncMessages > ( ChatSyncMessagesSchema ) ;
274275
275276const isSyncMessagesResponse = ajv . compile < {
276277 result : {
@@ -604,7 +605,7 @@ const chatEndpoints = API.v1
604605 'chat.syncMessages' ,
605606 {
606607 authRequired : true ,
607- query : isChatSyncMessagesProps ,
608+ query : isChatSyncMessagesLocalProps ,
608609 response : {
609610 400 : validateBadRequestErrorResponse ,
610611 401 : validateUnauthorizedErrorResponse ,
@@ -1139,4 +1140,10 @@ API.v1.addRoute(
11391140 } ,
11401141 } ,
11411142) ;
1142- void chatEndpoints ;
1143+
1144+ export type ChatEndpoints = ExtractRoutesFromAPI < typeof chatEndpoints > ;
1145+
1146+ declare module '@rocket.chat/rest-typings' {
1147+ // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-interface
1148+ interface Endpoints extends ChatEndpoints { }
1149+ }
0 commit comments