UNPKG

tipi-services

Version:

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

32 lines (24 loc) 939 B
const Service = require('../../../Service') const Endpoints = require('./Endpoints') class MandrillIntegrationsService 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, query) { return this.sendRequest({ endpoint: this.endpoints.details, params: { ownerId }, query }) } async listTemplates (ownerId, query) { return this.sendRequest({ endpoint: this.endpoints.listTemplates, params: { ownerId }, query }) } async remove (ownerId) { return this.sendRequest({ endpoint: this.endpoints.remove, params: { ownerId } }) } } module.exports = MandrillIntegrationsService