diff --git a/app/definitions/ISpotlight.ts b/app/definitions/ISpotlight.ts new file mode 100644 index 00000000..8a055775 --- /dev/null +++ b/app/definitions/ISpotlight.ts @@ -0,0 +1,11 @@ +import { IServerRoomItem } from './IRoom'; +import { IUser } from './IUser'; + +export type TSpotlightUser = Pick & { outside: boolean }; + +export type ISpotlightRoom = Pick & Partial>; + +export interface ISpotlight { + users: TSpotlightUser[]; + rooms: ISpotlightRoom[]; +} diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index de888e3a..33a31bd3 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -2,6 +2,7 @@ import sdk from './sdk'; import { TEAM_TYPE } from '../../../definitions/ITeam'; import roomTypeToApiType, { RoomTypes } from '../methods/roomTypeToApiType'; import { SubscriptionType, INotificationPreferences } from '../../../definitions'; +import { ISpotlight } from '../../../definitions/ISpotlight'; export const createChannel = ({ name, @@ -72,7 +73,7 @@ export const forgotPassword = (email: string) => export const sendConfirmationEmail = (email: string): Promise<{ message: string; success: boolean }> => sdk.methodCallWrapper('sendConfirmationEmail', email); -export const spotlight = (search: string, usernames: string, type: { users: boolean; rooms: boolean }) => +export const spotlight = (search: string, usernames: string[], type: { users: boolean; rooms: boolean }): Promise => // RC 0.51.0 sdk.methodCallWrapper('spotlight', search, usernames, type);