tipi-services
Version:
Node.js library to access wrapping REST API of tipi backend services
29 lines (21 loc) • 725 B
JavaScript
const Service = require('../../../Service')
const Endpoints = require('./Endpoints')
class AccessesService extends Service {
constructor (baseUrl) {
super()
this.endpoints = Endpoints(baseUrl)
}
async create (data) {
return this.sendRequest({ endpoint: this.endpoints.create, body: data })
}
async list (query) {
return this.sendRequest({ endpoint: this.endpoints.list, query })
}
async accept (id, data) {
return this.sendRequest({ endpoint: this.endpoints.accept, params: { id }, body: data })
}
async deny (id, data) {
return this.sendRequest({ endpoint: this.endpoints.deny, params: { id }, body: data })
}
}
module.exports = AccessesService