UNPKG

tipi-services

Version:

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

29 lines (21 loc) 774 B
const Service = require('../../../Service'); const Endpoints = require('./Endpoints') class ApiKeysService extends Service { constructor(baseUrl) { super() this.endpoints = Endpoints(baseUrl) } async getById(id, query) { return this.sendRequest({endpoint: this.endpoints.getById, params: {id}, query }) } async find(query) { return this.sendRequest({ endpoint: this.endpoints.find, query }) } async reset(id, key) { return this.sendRequest({endpoint: this.endpoints.reset, params: {id, key}}) } async update(id, key, data) { return this.sendRequest({endpoint: this.endpoints.update, params: {id, key}, body: data}) } } module.exports = ApiKeysService