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