Merge branch 'develop' into chore.dehydrate-login-methods-from-rocketchatjs
This commit is contained in:
commit
0694d7b67f
|
@ -1,3 +1,4 @@
|
|||
import { ITeam } from '../../ITeam';
|
||||
import type { IMessage, IMessageFromServer } from '../../IMessage';
|
||||
import type { IRoom } from '../../IRoom';
|
||||
import type { IUser } from '../../IUser';
|
||||
|
@ -28,4 +29,7 @@ export type ChannelsEndpoints = {
|
|||
messages: IMessageFromServer[];
|
||||
};
|
||||
};
|
||||
'channels.convertToTeam': {
|
||||
POST: (params: { channelId: string; channelName: string }) => { team: ITeam };
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { ITeam } from '../../ITeam';
|
||||
import type { IMessage, IMessageFromServer } from '../../IMessage';
|
||||
import type { IRoom } from '../../IRoom';
|
||||
import type { IUser } from '../../IUser';
|
||||
|
@ -22,4 +23,7 @@ export type GroupsEndpoints = {
|
|||
messages: IMessageFromServer[];
|
||||
};
|
||||
};
|
||||
'groups.convertToTeam': {
|
||||
POST: (params: { roomId: string; roomName: string }) => { team: ITeam };
|
||||
};
|
||||
};
|
||||
|
|
|
@ -15,6 +15,7 @@ import { UserEndpoints } from './user';
|
|||
import { UsersEndpoints } from './users';
|
||||
import { TeamsEndpoints } from './teams';
|
||||
import { E2eEndpoints } from './e2e';
|
||||
import { SubscriptionsEndpoints } from './subscriptions';
|
||||
|
||||
export type Endpoints = ChannelsEndpoints &
|
||||
ChatEndpoints &
|
||||
|
@ -32,4 +33,5 @@ export type Endpoints = ChannelsEndpoints &
|
|||
UserEndpoints &
|
||||
UsersEndpoints &
|
||||
TeamsEndpoints &
|
||||
E2eEndpoints;
|
||||
E2eEndpoints &
|
||||
SubscriptionsEndpoints;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
export type SubscriptionsEndpoints = {
|
||||
'subscriptions.unread': {
|
||||
POST: (params: { firstUnreadMessage: { _id: string } }) => {};
|
||||
};
|
||||
};
|
|
@ -220,7 +220,7 @@ export const teamListRoomsOfUser = ({ teamId, userId }: { teamId: string; userId
|
|||
// @ts-ignore
|
||||
sdk.get('teams.listRoomsOfUser', { teamId, userId });
|
||||
|
||||
export const convertChannelToTeam = ({ rid, name, type }: { rid: string; name: string; type: 'c' | 'p' }): any => {
|
||||
export const convertChannelToTeam = ({ rid, name, type }: { rid: string; name: string; type: 'c' | 'p' }) => {
|
||||
const params = {
|
||||
...(type === 'c'
|
||||
? {
|
||||
|
@ -232,8 +232,6 @@ export const convertChannelToTeam = ({ rid, name, type }: { rid: string; name: s
|
|||
roomName: name
|
||||
})
|
||||
};
|
||||
// TODO: missing definitions from server
|
||||
// @ts-ignore
|
||||
return sdk.post(type === 'c' ? 'channels.convertToTeam' : 'groups.convertToTeam', params);
|
||||
};
|
||||
|
||||
|
@ -264,10 +262,8 @@ export const deleteMessage = (messageId: string, rid: string): any =>
|
|||
// @ts-ignore
|
||||
sdk.post('chat.delete', { msgId: messageId, roomId: rid });
|
||||
|
||||
export const markAsUnread = ({ messageId }: { messageId: string }): any =>
|
||||
export const markAsUnread = ({ messageId }: { messageId: string }) =>
|
||||
// RC 0.65.0
|
||||
// TODO: missing definitions from server
|
||||
// @ts-ignore
|
||||
sdk.post('subscriptions.unread', { firstUnreadMessage: { _id: messageId } });
|
||||
|
||||
export const toggleStarMessage = (messageId: string, starred: boolean): any => {
|
||||
|
|
Loading…
Reference in New Issue