UNPKG

tipi-services

Version:

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

28 lines (21 loc) 845 B
const Service = require('../../../Service') const Endpoints = require('./Endpoints') class AccountsService extends Service { constructor (baseUrl) { super() this.endpoints = Endpoints(baseUrl) } async register (ownerId, data) { return this.sendRequest({ endpoint: this.endpoints.register, params: { ownerId }, body: data }) } async details (ownerId, query) { return this.sendRequest({ endpoint: this.endpoints.details, params: { ownerId }, query }) } async unsubscribe (ownerId, data) { return this.sendRequest({ endpoint: this.endpoints.unsubscribe, body: data, params: { ownerId } }) } async removeDeviceNid (ownerId, data) { return this.sendRequest({ endpoint: this.endpoints.removeDeviceNid, body: data, params: { ownerId } }) } } module.exports = AccountsService