UNPKG

tipi-services

Version:

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

28 lines (21 loc) 749 B
const Service = require('../../../Service') const Endpoints = require('./Endpoints') class PubSubMessagesService extends Service { constructor (baseUrl) { super() this.endpoints = Endpoints(baseUrl) } async list (query) { return this.sendRequest({ endpoint: this.endpoints.list, query }) } async batchDetails (data) { return this.sendRequest({ endpoint: this.endpoints.batchDetails, body: data }) } async batchOperation (data) { return this.sendRequest({ endpoint: this.endpoints.batchOperation, body: data }) } async setData (id, data) { return this.sendRequest({ endpoint: this.endpoints.setData, params: { id }, body: data }) } } module.exports = PubSubMessagesService