diff --git a/app/definitions/IUser.ts b/app/definitions/IUser.ts index 474a2105e..e1746554d 100644 --- a/app/definitions/IUser.ts +++ b/app/definitions/IUser.ts @@ -22,6 +22,16 @@ export interface IPersonalAccessToken extends ILoginToken { bypassTwoFactor?: boolean; } +export interface IUserRegistered { + _id: string; + type: string; + status: UserStatus; + active: boolean; + name: string; + username: string; + __rooms: string[]; +} + export interface IUserEmailVerificationToken { token: string; address: string; diff --git a/app/definitions/rest/v1/user.ts b/app/definitions/rest/v1/user.ts index 7de12aabf..b8c37cc17 100644 --- a/app/definitions/rest/v1/user.ts +++ b/app/definitions/rest/v1/user.ts @@ -1,4 +1,4 @@ -import { IUser } from '../../IUser'; +import { IUser, IUserRegistered } from '../../IUser'; export type UserEndpoints = { 'users.info': { @@ -11,4 +11,7 @@ export type UserEndpoints = { success: boolean; }; }; + 'users.register': { + POST: (params: { name: string; email: string; username: string; pass: string }) => { user: IUserRegistered }; + }; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index 515269018..19217ef12 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -67,10 +67,8 @@ export const updateJitsiTimeout = (roomId: string): any => // @ts-ignore sdk.post('video-conference/jitsi.update-timeout', { roomId }); -export const register = (credentials: any): any => +export const register = (credentials: { name: string; email: string; pass: string; username: string }) => // RC 0.50.0 - // TODO: missing definitions from server - // @ts-ignore sdk.post('users.register', credentials); export const forgotPassword = (email: string): any =>