import { API } from '../core/api' ; import { Block , ExternalInvite , InviteViewList } from '../models' ; extends API export default class Invites extends API { param invite param key async accept ( invite , key ? ) { const response = await this . sendPost ( `invites/${ invite }/accept` , undefined , { key : key || '' } ) ; return response . json ( ) as Promise < Block > ; } param thread param address returns async add ( thread , address ) { const response = await this . sendPost ( `invites` , undefined , { thread , address : address || '' } ) ; return response . status === 201 ; } param thread returns async addExternal ( thread ) { const response = await this . sendPost ( `invites` , undefined , { thread } ) ; return response . json ( ) as Promise < ExternalInvite > ; } returns async list ( ) { const response = await this . sendGet ( 'invites' ) ; return response . json ( ) as Promise < InviteViewList > ; } param id returns async ignore ( id ) { const response = await this . sendPost ( `invites/${ id }/ignore` ) ; return response . status === 200 ; } }