Chore: Migrate REST API - register to TS (#3796)
* Migrate `user.register` to TypeScript
This commit is contained in:
parent
d506de9f23
commit
529c9f0b00
|
@ -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;
|
||||||
|
|
|
@ -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 };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -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 =>
|
||||||
|
|
Loading…
Reference in New Issue