import {User, UsersApi} from '../api' import {ServiceOptions} from '../types' export default class { private service: UsersApi private serviceOptions: ServiceOptions constructor(basePath: string, baseOptions: ServiceOptions) { this.service = new UsersApi({basePath, baseOptions}) this.serviceOptions = baseOptions } public async me(): Promise { const {data} = await this.service.getMe(undefined, this.serviceOptions) return data } public async get(id: string): Promise { const {data} = await this.service.getUsersID( id, undefined, this.serviceOptions ) return data } public async getAll(): Promise { const {data} = await this.service.getUsers(undefined, this.serviceOptions) return data.users || [] } }