2022-05-07 02:11:07 +00:00
|
|
|
import { IProfileParams } from '../../IProfile';
|
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': {
|
2022-07-06 20:05:13 +00:00
|
|
|
POST: (params: { status?: string; message?: string }) => {};
|
2022-03-07 15:00:39 +00:00
|
|
|
};
|
2022-03-09 18:10:36 +00:00
|
|
|
'users.updateOwnBasicInfo': {
|
2022-05-07 02:11:07 +00:00
|
|
|
POST: (params: {
|
|
|
|
data: IProfileParams | Pick<IProfileParams, 'username'>;
|
|
|
|
customFields?: { [key: string | number]: string };
|
|
|
|
}) => {
|
2022-03-09 18:10:36 +00:00
|
|
|
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-06-22 12:24:25 +00:00
|
|
|
'users.deleteOwnAccount': {
|
|
|
|
POST: (params: { password: string; confirmRelinquish: boolean }) => { success: boolean };
|
|
|
|
};
|
2022-02-14 16:20:29 +00:00
|
|
|
};
|