]>
Commit | Line | Data |
---|---|---|
1 | import { HttpStatusCode, ServerStats } from '@shared/models' | |
2 | import { AbstractCommand, OverrideCommandOptions } from '../shared' | |
3 | ||
4 | export class StatsCommand extends AbstractCommand { | |
5 | ||
6 | get (options: OverrideCommandOptions & { | |
7 | useCache?: boolean // default false | |
8 | } = {}) { | |
9 | const { useCache = false } = options | |
10 | const path = '/api/v1/server/stats' | |
11 | ||
12 | const query = { | |
13 | t: useCache ? undefined : new Date().getTime() | |
14 | } | |
15 | ||
16 | return this.getRequestBody<ServerStats>({ | |
17 | ...options, | |
18 | ||
19 | path, | |
20 | query, | |
21 | implicitToken: false, | |
22 | defaultExpectedStatus: HttpStatusCode.OK_200 | |
23 | }) | |
24 | } | |
25 | } |