Chore: Migrate REST API - e2eResetOwnKey to Typescript (#3888)
* Chore: Migrate REST API - e2eResetOwnKey to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com>
This commit is contained in:
parent
6ff2fc37d0
commit
307ae1295f
|
@ -1,6 +1,6 @@
|
|||
import rocketchat from '../lib/rocketchat';
|
||||
|
||||
type TRocketChat = typeof rocketchat;
|
||||
export type TRocketChat = typeof rocketchat;
|
||||
|
||||
export interface IRocketChat extends TRocketChat {
|
||||
closeListener: any;
|
||||
|
|
|
@ -196,13 +196,6 @@ const RocketChat = {
|
|||
}
|
||||
return result;
|
||||
},
|
||||
e2eResetOwnKey() {
|
||||
this.unsubscribeRooms();
|
||||
|
||||
// RC 0.72.0
|
||||
return this.methodCallWrapper('e2e.resetOwnE2EKey');
|
||||
},
|
||||
|
||||
loginTOTP,
|
||||
loginWithPassword,
|
||||
loginOAuthOrSso,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import sdk from './sdk';
|
||||
import { TEAM_TYPE } from '../../../definitions/ITeam';
|
||||
import roomTypeToApiType, { RoomTypes } from '../methods/roomTypeToApiType';
|
||||
import { SubscriptionType, INotificationPreferences, IRoomNotifications, IMessage } from '../../../definitions';
|
||||
import { SubscriptionType, INotificationPreferences, IRoomNotifications, TRocketChat, IMessage } from '../../../definitions';
|
||||
import { ISpotlight } from '../../../definitions/ISpotlight';
|
||||
import { IAvatarSuggestion, IParams } from '../../../definitions/IProfileViewInterfaces';
|
||||
import { Encryption } from '../../encryption';
|
||||
|
@ -744,6 +744,15 @@ export const useInviteToken = (token: string): any =>
|
|||
// @ts-ignore
|
||||
sdk.post('useInviteToken', { token });
|
||||
|
||||
export function e2eResetOwnKey(this: TRocketChat): Promise<boolean | {}> {
|
||||
// {} when TOTP is enabled
|
||||
// TODO: remove this
|
||||
this.unsubscribeRooms();
|
||||
|
||||
// RC 0.72.0
|
||||
return sdk.methodCallWrapper('e2e.resetOwnE2EKey');
|
||||
}
|
||||
|
||||
export const editMessage = async (message: IMessage) => {
|
||||
const { rid, msg } = await Encryption.encryptMessage(message);
|
||||
// RC 0.49.0
|
||||
|
|
Loading…
Reference in New Issue