UNPKG

tipi-services

Version:

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

29 lines (21 loc) 743 B
const Service = require('../../../Service') const Endpoints = require('./Endpoints') class IntegrationsService extends Service { constructor (baseUrl) { super() this.endpoints = Endpoints(baseUrl) } async set (data) { return this.sendRequest({ endpoint: this.endpoints.set, body: data }) } async list (query) { return this.sendRequest({ endpoint: this.endpoints.list, query }) } async remove (action, data) { return this.sendRequest({ endpoint: this.endpoints.remove, params: { action }, body: data }) } async test (action, data) { return this.sendRequest({ endpoint: this.endpoints.test, params: { action }, body: data }) } } module.exports = IntegrationsService