import type {InstanceConfig, Statistics, User} from './index' import { request} from './index' export async function login(email: string, password: string): Promise { const response = await request({ method: 'POST', url: 'login', data: {email, password} }) return response.status === 200 } export async function register(email: string, password: string): Promise { const response = await request({ method: 'POST', url: 'register', data: {email, password} }) return response.status === 201 } export async function getUser(): Promise { const response = await request({ url: 'me' }) return response.data } export async function getConfiguration(): Promise { const response = await request({ url: 'config' }) return response.data } export async function getStatistics(): Promise { const response = await request({ url: 'stats' }) return response.data }