UNPKG

tipi-services

Version:

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

63 lines (45 loc) 1.74 kB
const Service = require('../../../Service') const Endpoints = require('./Endpoints') class ChartsService extends Service { constructor (baseUrl) { super() this.endpoints = Endpoints(baseUrl) } async reservationsCount (query) { return this.sendRequest({ endpoint: this.endpoints.reservationsCount, query }) } async reservations (query) { return this.sendRequest({ endpoint: this.endpoints.reservations, query }) } async reservationsOrigin (query) { return this.sendRequest({ endpoint: this.endpoints.reservationsOrigin, query }) } async reservationsDistribution (query) { return this.sendRequest({ endpoint: this.endpoints.reservationsDistribution, query }) } async rushHours (query) { return this.sendRequest({ endpoint: this.endpoints.rushHours, query }) } async cities (query) { return this.sendRequest({ endpoint: this.endpoints.cities, query }) } async countries (query) { return this.sendRequest({ endpoint: this.endpoints.countries, query }) } async guests (query) { return this.sendRequest({ endpoint: this.endpoints.guests, query }) } async reservationsSentiment (query) { return this.sendRequest({ endpoint: this.endpoints.reservationsSentiment, query }) } async activitiesAttendeeCount (query) { return this.sendRequest({ endpoint: this.endpoints.activitiesAttendeeCount, query }) } async notificationsType (query) { return this.sendRequest({ endpoint: this.endpoints.notificationsType, query }) } async extendStayCount (query) { return this.sendRequest({ endpoint: this.endpoints.extendStayCount, query }) } } module.exports = ChartsService