import { API } from '../core/api' ; import { CafeSessionList , CafeSession } from '../models' ; extends API export default class Cafes extends API { param cafe param token see Tokens returns async add ( cafe , token ) { const response = await this . sendPost ( `cafes` , [ cafe ] , { token } ) ; return response . json ( ) as Promise < CafeSession > ; } param id returns async get ( id ) { const response = await this . sendGet ( `cafes/${ id }` ) ; return response . json ( ) as Promise < CafeSession > ; } returns async list ( ) { const response = await this . sendGet ( 'cafes' ) ; return response . json ( ) as Promise < CafeSessionList > ; } returns async messages ( ) { const response = await this . sendPost ( 'cafes/messages' ) ; return response . status === 200 ; } param id returns async remove ( id ) { const response = await this . sendDelete ( `cafes/${ id }` ) ; return response . status === 204 ; } }