Skip to content

Commit 66cedf7

Browse files
committed
fix(chat): restore route typing export for chat endpoints
- re-added ExtractRoutesFromAPI integration - ensured endpoints are included in shared @rocket.chat/rest-typings - removed unused void workaround
1 parent 7a4f496 commit 66cedf7

File tree

1 file changed

+10
-3
lines changed
  • apps/meteor/app/api/server/v1

1 file changed

+10
-3
lines changed

apps/meteor/app/api/server/v1/chat.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { followMessage } from '../../../threads/server/methods/followMessage';
5050
import { unfollowMessage } from '../../../threads/server/methods/unfollowMessage';
5151
import { normalizeMessagesForUser } from '../../../utils/server/lib/normalizeMessagesForUser';
5252
import { API } from '../api';
53+
import type { ExtractRoutesFromAPI } from '../ApiClass';
5354
import { getPaginationItems } from '../helpers/getPaginationItems';
5455
import { 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

275276
const 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

Comments
 (0)