This commit is contained in:
111
dist/services/StatsService.js
vendored
Normal file
111
dist/services/StatsService.js
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.StatsService = void 0;
|
||||
const request_1 = require("../core/request");
|
||||
class StatsService {
|
||||
/**
|
||||
* Get
|
||||
* A very basic stats endpoint providing basic counters for a dashboard or simmilar
|
||||
* @returns ResponseStats
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async statsControllerGet() {
|
||||
const result = await request_1.request({
|
||||
method: 'GET',
|
||||
path: `/api/stats`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Get top runners by distance
|
||||
* Returns the top ten runners by distance.
|
||||
* @returns ResponseStatsRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async statsControllerGetTopRunnersByDistance() {
|
||||
const result = await request_1.request({
|
||||
method: 'GET',
|
||||
path: `/api/stats/runners/distance`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Get top runners by donations
|
||||
* Returns the top ten runners by donations.
|
||||
* @returns ResponseStatsRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async statsControllerGetTopRunnersByDonations() {
|
||||
const result = await request_1.request({
|
||||
method: 'GET',
|
||||
path: `/api/stats/runners/donations`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Get top runners by track time
|
||||
* Returns the top ten fastest track times (with their runner and the runner's group).
|
||||
* @returns ResponseStatsRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async statsControllerGetTopRunnersByTrackTime() {
|
||||
const result = await request_1.request({
|
||||
method: 'GET',
|
||||
path: `/api/stats/scans`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Get top teams by distance
|
||||
* Returns the top ten teams by distance.
|
||||
* @returns ResponseStatsTeam
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async statsControllerGetTopTeamsByDistance() {
|
||||
const result = await request_1.request({
|
||||
method: 'GET',
|
||||
path: `/api/stats/teams/distance`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Get top teams by donations
|
||||
* Returns the top ten teams by donations.
|
||||
* @returns ResponseStatsTeam
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async statsControllerGetTopTeamsByDonations() {
|
||||
const result = await request_1.request({
|
||||
method: 'GET',
|
||||
path: `/api/stats/teams/donations`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Get top orgs by distance
|
||||
* Returns the top ten organisations by distance.
|
||||
* @returns ResponseStatsOrgnisation
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async statsControllerGetTopOrgsByDistance() {
|
||||
const result = await request_1.request({
|
||||
method: 'GET',
|
||||
path: `/api/stats/organisations/distance`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Get top orgs by donations
|
||||
* Returns the top ten organisations by donations.
|
||||
* @returns ResponseStatsOrgnisation
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async statsControllerGetTopOrgsByDonations() {
|
||||
const result = await request_1.request({
|
||||
method: 'GET',
|
||||
path: `/api/stats/organisations/donations`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
}
|
||||
exports.StatsService = StatsService;
|
||||
Reference in New Issue
Block a user