129 lines
3.8 KiB
JavaScript
129 lines
3.8 KiB
JavaScript
"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 (0, 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 (0, 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 (0, request_1.request)({
|
|
method: 'GET',
|
|
path: `/api/stats/runners/donations`,
|
|
});
|
|
return result.body;
|
|
}
|
|
/**
|
|
* Get top runners by laptime
|
|
* Returns the top ten runners by fastest laptime on your selected track (track by id).
|
|
* @param track
|
|
* @returns ResponseStatsRunner
|
|
* @throws ApiError
|
|
*/
|
|
static async statsControllerGetTopRunnersByLaptime(track) {
|
|
const result = await (0, request_1.request)({
|
|
method: 'GET',
|
|
path: `/api/stats/runners/laptime`,
|
|
query: {
|
|
'track': track,
|
|
},
|
|
});
|
|
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 (0, 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 (0, 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 (0, request_1.request)({
|
|
method: 'GET',
|
|
path: `/api/stats/teams/donations`,
|
|
});
|
|
return result.body;
|
|
}
|
|
/**
|
|
* Get top orgs by distance
|
|
* Returns the top ten organizations by distance.
|
|
* @returns ResponseStatsOrgnisation
|
|
* @throws ApiError
|
|
*/
|
|
static async statsControllerGetTopOrgsByDistance() {
|
|
const result = await (0, request_1.request)({
|
|
method: 'GET',
|
|
path: `/api/stats/organizations/distance`,
|
|
});
|
|
return result.body;
|
|
}
|
|
/**
|
|
* Get top orgs by donations
|
|
* Returns the top ten organizations by donations.
|
|
* @returns ResponseStatsOrgnisation
|
|
* @throws ApiError
|
|
*/
|
|
static async statsControllerGetTopOrgsByDonations() {
|
|
const result = await (0, request_1.request)({
|
|
method: 'GET',
|
|
path: `/api/stats/organizations/donations`,
|
|
});
|
|
return result.body;
|
|
}
|
|
}
|
|
exports.StatsService = StatsService;
|