Chore: Migrate REST API - register to TS (#3796)

* Migrate `user.register` to TypeScript
This commit is contained in:
Gerzon Z 2022-03-02 16:08:56 -04:00 committed by GitHub
parent d506de9f23
commit 529c9f0b00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -22,6 +22,16 @@ export interface IPersonalAccessToken extends ILoginToken {
bypassTwoFactor?: boolean; bypassTwoFactor?: boolean;
} }
export interface IUserRegistered {
_id: string;
type: string;
status: UserStatus;
active: boolean;
name: string;
username: string;
__rooms: string[];
}
export interface IUserEmailVerificationToken { export interface IUserEmailVerificationToken {
token: string; token: string;
address: string; address: string;

View File

@ -1,4 +1,4 @@
import { IUser } from '../../IUser'; import { IUser, IUserRegistered } from '../../IUser';
export type UserEndpoints = { export type UserEndpoints = {
'users.info': { 'users.info': {
@ -11,4 +11,7 @@ export type UserEndpoints = {
success: boolean; success: boolean;
}; };
}; };
'users.register': {
POST: (params: { name: string; email: string; username: string; pass: string }) => { user: IUserRegistered };
};
}; };

View File

@ -67,10 +67,8 @@ export const updateJitsiTimeout = (roomId: string): any =>
// @ts-ignore // @ts-ignore
sdk.post('video-conference/jitsi.update-timeout', { roomId }); 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 // RC 0.50.0
// TODO: missing definitions from server
// @ts-ignore
sdk.post('users.register', credentials); sdk.post('users.register', credentials);
export const forgotPassword = (email: string): any => export const forgotPassword = (email: string): any =>