UNPKG

tipi-services

Version:

Node.js library to access wrapping REST API of tipi backend services

33 lines (24 loc) 893 B
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 details (ownerId) { return this.sendRequest({ endpoint: this.endpoints.details, params: { ownerId } }) } async remove (ownerId) { return this.sendRequest({ endpoint: this.endpoints.remove, params: { ownerId } }) } async update (ownerId, data) { return this.sendRequest({ endpoint: this.endpoints.update, params: { ownerId }, body: data }) } async checkHealth (ownerId) { return this.sendRequest({ endpoint: this.endpoints.checkHealth, params: { ownerId } }) } } module.exports = IntegrationsService