tipi-services
Version:
Node.js library to access wrapping REST API of tipi backend services
49 lines (36 loc) • 1.38 kB
JavaScript
const Service = require('../../../Service')
const Endpoints = require('./Endpoints')
class MembersService extends Service {
constructor (baseUrl) {
super()
this.endpoints = Endpoints(baseUrl)
}
async create (data) {
return this.sendRequest({ endpoint: this.endpoints.create, body: data })
}
async batchInvite (data) {
return this.sendRequest({ endpoint: this.endpoints.batchInvite, body: data })
}
async invite (data) {
return this.sendRequest({ endpoint: this.endpoints.invite, body: data })
}
async details (id, extend) {
return this.sendRequest({ endpoint: this.endpoints.details, params: { id }, query: { extend } })
}
async update (id, data) {
return this.sendRequest({ endpoint: this.endpoints.update, params: { id }, body: data })
}
async list (query) {
return this.sendRequest({ endpoint: this.endpoints.list, query })
}
async listAllChatViewers (query) {
return this.sendRequest({ endpoint: this.endpoints.listAllChatViewers, query })
}
async remove (id, data) {
return this.sendRequest({ endpoint: this.endpoints.remove, params: { id }, body: data })
}
async resendInvitation (id, data) {
return this.sendRequest({ endpoint: this.endpoints.resendInvitation, params: { id }, body: data })
}
}
module.exports = MembersService