2021-07-16 08:27:30 -04:00
|
|
|
import { HttpStatusCode, ServerStats } from '@shared/models'
|
2021-07-07 05:07:12 -04:00
|
|
|
import { AbstractCommand, OverrideCommandOptions } from '../shared'
|
|
|
|
|
|
|
|
export class StatsCommand extends AbstractCommand {
|
|
|
|
|
|
|
|
get (options: OverrideCommandOptions & {
|
|
|
|
useCache?: boolean // default false
|
|
|
|
} = {}) {
|
|
|
|
const { useCache = false } = options
|
|
|
|
const path = '/api/v1/server/stats'
|
|
|
|
|
|
|
|
const query = {
|
|
|
|
t: useCache ? undefined : new Date().getTime()
|
|
|
|
}
|
|
|
|
|
|
|
|
return this.getRequestBody<ServerStats>({
|
|
|
|
...options,
|
|
|
|
|
|
|
|
path,
|
|
|
|
query,
|
2021-07-08 04:55:16 -04:00
|
|
|
implicitToken: false,
|
2021-07-07 05:07:12 -04:00
|
|
|
defaultExpectedStatus: HttpStatusCode.OK_200
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|