UNPKG

@coveo/platform-client

Version:

The main goal of this package is to provide an easy to configure and straightforward way of querying Coveo Cloud APIs using JavaScript.

84 lines 2.99 kB
import ReadServiceResource from '../ReadServiceResource.js'; export default class Statistics extends ReadServiceResource { static baseUrl = '/rest/ua/v15/stats'; /** * Get the incoherent events for a date range. * @param options */ listIncoherentEvents(options) { return this.api.get(this.buildPathWithOrg(`${Statistics.baseUrl}/incoherentEvents`, options)); } /** * Get graph data points for the metrics for a date range. * @param options */ listGraphDataPoints(options) { return this.api.get(this.buildPathWithOrg(`${Statistics.baseUrl}/graphDataPoints`, options)); } /** * Get global data for each metric for a date range. * @param options */ listGlobalData(options) { return this.api.get(this.buildPathWithOrg(`${Statistics.baseUrl}/globalData`, options)); } /** * Get trends of a metric combined with dimensions for a date range. * @param options */ listTrends(options) { return this.api.get(this.buildPathWithOrg(`${Statistics.baseUrl}/trends`, options)); } /** * Get the metrics based on the visits matching the specified criteria. * @param options */ listVisitsMetrics(options) { return this.api.get(this.buildPathWithOrg(`${Statistics.baseUrl}/visitsMetrics`, options)); } /** * Get graph data points for visit based metrics for a date range. * @param options */ listVisitsGraphDataPoints(options) { return this.api.get(this.buildPathWithOrg(`${Statistics.baseUrl}/visitsGraphDataPoints`, options)); } /** * Cancel the execution of a query. * This is a best effort; there is no guarantee that the query will be cancelled. * If the query is cancelled, the sender of the now cancelled query will receive a 409 Conflict. * @param queryId The id of the query to cancel. * @param options */ cancelQuery(queryId, options) { return this.api.delete(this.buildPathWithOrg(`${Statistics.baseUrl}/query/${queryId}`, options)); } /** * Get metrics combined with dimensions for a date range. * @param options */ listCombinedData(options) { return this.api.get(this.buildPathWithOrg(`${Statistics.baseUrl}/combinedData`, options)); } /** * Get the details of the visits matching the specified criteria. * @param options */ listVisits(options) { return this.api.get(this.buildPathWithOrg(`${Statistics.baseUrl}/visits`, options)); } /** * Force a visit view update. * @param options */ updateVisitView(options) { return this.api.post(this.buildPathWithOrg(`${Statistics.baseUrl}/visits`, options)); } checkHealth() { return this.api.get(`${Statistics.baseUrl}/monitoring/health`); } checkStatus() { return this.api.get(`${Statistics.baseUrl}/status`); } } //# sourceMappingURL=Statistics.js.map