-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcharts.service.ts
More file actions
35 lines (32 loc) · 1.07 KB
/
charts.service.ts
File metadata and controls
35 lines (32 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import type {
BestOfYearResponse,
GamesByConcurrentPlayersResponse,
MostPlayedGamesResponse,
} from '../schemas/responses/charts.schemas'
import { BaseService } from './_base.service'
export class ChartsService extends BaseService {
constructor(apiKey: string) {
super(apiKey, 'api', 'ISteamChartsService')
}
async getGamesByConcurrentPlayers(): Promise<GamesByConcurrentPlayersResponse> {
const url = this.generateSteamUrl(`/GetGamesByConcurrentPlayers/v1`)
const response = await this.sendGETRequest<{
response: GamesByConcurrentPlayersResponse
}>(url)
return response.response
}
async getMostPlayedGames(): Promise<MostPlayedGamesResponse> {
const url = this.generateSteamUrl(`/GetMostPlayedGames/v1`)
const response = await this.sendGETRequest<{
response: MostPlayedGamesResponse
}>(url)
return response.response
}
async getBestOfYear(): Promise<BestOfYearResponse> {
const url = this.generateSteamUrl(`/GetBestOfYearPages/v1`)
const response = await this.sendGETRequest<{
response: BestOfYearResponse
}>(url)
return response.response
}
}