Backend API - TheRecoveryTeam/TheQuests GitHub Wiki

Содержание

UserModelManager

UserModelManager.Create

interface UserCreateRequest {
	email: string;
	password: string;
	nickname: string;
}

interface UserCreateResponseSuccess {
	id: string;
	token: string;
}

interface UserCreateResponse400 {
	error: 'NotEnoughData' | 'EmailAlreadyExist' |
               'NicknameAlreadyExist' | 'SessionCreationError' |
               'UserCreationError';
}

UserModelManager.Login

interface UserLoginRequest {
	email: string;
	password: string;
}

interface UserLoginResponseSuccess {
	id: string;
	email: string;
	nickname: string;
	token: string;
}

interface UserLoginResponse400 {
	error: 'NotEnoughData' | 'IncorrectEmailOrPassword' | 
               'SessionCreationError';
}

UserModelManager.Logout

interface UserLogoutRequest {
	email: string;
	password: string;
}
Response Success empty
interface UserLogoutResponse400 {
	error: 'NotEnoughData' | 'IncorrectEmailOrPassword' | 
               'SessionDeleteError';
}

UserModelManager.Contains

interface UserContainsRequest {
	[fieldName]: string
}
Response Success: bool