-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser-store-visit.service.ts
More file actions
40 lines (38 loc) · 1.15 KB
/
user-store-visit.service.ts
File metadata and controls
40 lines (38 loc) · 1.15 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
36
37
38
39
40
import type { SteamDataRequest } from '../schemas/requests/common.schemas'
import type { GetMostVisitedItemsOnStoreResponse } from '../schemas/responses/user-store-visit.schemas'
import { BaseService } from './_base.service'
export class UserStoreVisitService extends BaseService {
constructor(apiKey: string) {
super(apiKey, 'api', 'IUserStoreVisitService')
}
async getMostVisitedItemsOnStore(
steamUserId: string,
config: {
data_request?: SteamDataRequest
count?: number
} = {
data_request: {
include_assets: false,
include_release: false,
include_platforms: false,
include_all_purchase_options: false,
include_screenshots: false,
include_trailers: false,
include_ratings: false,
include_reviews: false,
include_basic_info: false,
include_full_description: false,
},
count: 10,
},
): Promise<GetMostVisitedItemsOnStoreResponse> {
const url = this.generateSteamUrl(`/GetMostVisitedItemsOnStore/v1`, {
steamid: steamUserId,
input_json: JSON.stringify(config),
})
const response = await this.sendGETRequest<{
response: GetMostVisitedItemsOnStoreResponse
}>(url)
return response.response
}
}