2019-08-14 09:48:44 +00:00
|
|
|
/* global axios */
|
2020-03-09 17:57:10 +00:00
|
|
|
import ApiClient from './ApiClient';
|
2019-08-14 09:48:44 +00:00
|
|
|
|
2020-03-09 17:57:10 +00:00
|
|
|
class ReportsAPI extends ApiClient {
|
|
|
|
constructor() {
|
2020-05-11 06:10:14 +00:00
|
|
|
super('reports', { accountScoped: true, apiVersion: 'v2' });
|
2020-03-09 17:57:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
getAccountReports(metric, since, until) {
|
2021-08-27 17:16:32 +00:00
|
|
|
return axios.get(`${this.url}`, {
|
|
|
|
params: { metric, since, until, type: 'account' },
|
2020-03-09 17:57:10 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-11-16 14:11:52 +00:00
|
|
|
getAccountSummary(since, until) {
|
2021-08-27 17:16:32 +00:00
|
|
|
return axios.get(`${this.url}/summary`, {
|
|
|
|
params: { since, until, type: 'account' },
|
2020-03-09 17:57:10 +00:00
|
|
|
});
|
|
|
|
}
|
2020-12-15 18:05:03 +00:00
|
|
|
|
|
|
|
getAgentReports(since, until) {
|
|
|
|
return axios.get(`${this.url}/agents`, {
|
|
|
|
params: { since, until },
|
|
|
|
});
|
|
|
|
}
|
2020-03-09 17:57:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default new ReportsAPI();
|