tipi-services
Version:
Node.js library to access wrapping REST API of tipi backend services
25 lines (18 loc) • 643 B
JavaScript
const Service = require('../../../Service')
const Endpoints = require('./Endpoints')
class OneTimePinsService extends Service {
constructor (baseUrl) {
super()
this.endpoints = Endpoints(baseUrl)
}
async generate (data) {
return this.sendRequest({ endpoint: this.endpoints.generate, body: data })
}
async removeByIndex (index, data) {
return this.sendRequest({ endpoint: this.endpoints.removeByIndex, body: data, params: { index } })
}
async removeAll (data) {
return this.sendRequest({ endpoint: this.endpoints.removeAll, body: data })
}
}
module.exports = OneTimePinsService