UNPKG

tipi-services

Version:

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

28 lines (21 loc) 709 B
const Service = require('../../../Service') const Endpoints = require('./Endpoints') class ConversationsService extends Service { constructor (baseUrl) { super() this.endpoints = Endpoints(baseUrl) } async list (query) { return this.sendRequest({ endpoint: this.endpoints.list, query }) } async details (id, query) { return this.sendRequest({ endpoint: this.endpoints.details, params: { id }, query }) } async find (query) { return this.sendRequest({ endpoint: this.endpoints.find, query }) } async seenAll (data) { return this.sendRequest({ endpoint: this.endpoints.seenAll, body: data }) } } module.exports = ConversationsService