2022-03-09 18:10:36 +00:00
|
|
|
import { IParams } from '../../IProfileViewInterfaces';
|
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-03-09 18:10:36 +00:00
|
|
|
'users.updateOwnBasicInfo': {
|
|
|
|
POST: (params: { data: IParams | Pick<IParams, 'username'>; customFields?: { [key: string | number]: string } }) => {
|
|
|
|
user: IUser;
|
|
|
|
};
|
|
|
|
};
|
2022-03-10 13:44:55 +00:00
|
|
|
'users.getUsernameSuggestion': {
|
|
|
|
GET: () => { result: string };
|
|
|
|
};
|
2022-03-10 12:37:54 +00:00
|
|
|
'users.resetAvatar': {
|
|
|
|
POST: (params: { userId: string }) => {};
|
|
|
|
};
|
2022-04-04 19:15:29 +00:00
|
|
|
'users.removeOtherTokens': {
|
|
|
|
POST: (params: { userId: string }) => {};
|
|
|
|
};
|
2022-03-10 00:16:20 +00:00
|
|
|
'users.getPreferences': {
|
|
|
|
GET: (params: { userId: IUser['_id'] }) => {
|
|
|
|
preferences: INotificationPreferences;
|
|
|
|
success: boolean;
|
|
|
|
};
|
|
|
|
};
|
2022-02-14 16:20:29 +00:00
|
|
|
};
|