2022-02-14 16:20:29 +00:00
|
|
|
import type { ITeam } from '../../ITeam';
|
|
|
|
import type { IUser } from '../../IUser';
|
2022-03-04 13:18:07 +00:00
|
|
|
import { INotificationPreferences, IUserPreferences, IUserRegistered } from '../../IUser';
|
2022-02-14 16:20:29 +00:00
|
|
|
|
|
|
|
export type UsersEndpoints = {
|
|
|
|
'users.2fa.sendEmailCode': {
|
|
|
|
POST: (params: { emailOrUsername: string }) => void;
|
|
|
|
};
|
|
|
|
'users.autocomplete': {
|
|
|
|
GET: (params: { selector: string }) => { items: IUser[] };
|
|
|
|
};
|
|
|
|
'users.listTeams': {
|
|
|
|
GET: (params: { userId: IUser['_id'] }) => { teams: Array<ITeam> };
|
|
|
|
};
|
2022-03-04 14:18:06 +00:00
|
|
|
'users.forgotPassword': {
|
|
|
|
POST: (params: { email: string }) => {};
|
|
|
|
};
|
2022-03-04 13:18:07 +00:00
|
|
|
'users.info': {
|
|
|
|
GET: (params: { userId: IUser['_id'] }) => {
|
|
|
|
user: IUser;
|
|
|
|
success: boolean;
|
|
|
|
};
|
|
|
|
POST: (params: { userId: IUser['_id'] }) => {
|
|
|
|
user: IUser;
|
|
|
|
success: boolean;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
'users.setPreferences': {
|
2022-03-09 16:49:52 +00:00
|
|
|
POST: (params: { userId?: IUser['_id']; data: Partial<INotificationPreferences> }) => {
|
2022-03-04 13:18:07 +00:00
|
|
|
user: IUserPreferences;
|
|
|
|
success: boolean;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
'users.register': {
|
|
|
|
POST: (params: { name: string; email: string; username: string; pass: string }) => { user: IUserRegistered };
|
|
|
|
};
|
2022-03-07 15:00:39 +00:00
|
|
|
'users.setStatus': {
|
|
|
|
POST: (params: { status: string; message: string }) => {};
|
|
|
|
};
|
2022-02-14 16:20:29 +00:00
|
|
|
};
|