@gamecore-api/sdk 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +12 -0
- package/dist/index.js +5 -0
- package/dist/types.d.ts +8 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -22,6 +22,16 @@ export declare class GameCoreClient {
|
|
|
22
22
|
getLegal: (type: string, locale?: string) => Promise<LegalDocument>;
|
|
23
23
|
/** Get site statistics for trust signals (cached 5 min on server) */
|
|
24
24
|
getStats: () => Promise<SiteStats>;
|
|
25
|
+
/** Get active hero banners for carousel */
|
|
26
|
+
getBanners: () => Promise<{
|
|
27
|
+
id: number;
|
|
28
|
+
title: string | null;
|
|
29
|
+
description: string | null;
|
|
30
|
+
imageUrl: string | null;
|
|
31
|
+
color: string | null;
|
|
32
|
+
scope: string;
|
|
33
|
+
priority: number;
|
|
34
|
+
}[]>;
|
|
25
35
|
/** Get announcement bar settings (text, link, enabled) */
|
|
26
36
|
getAnnouncementBar: () => Promise<AnnouncementBar>;
|
|
27
37
|
};
|
|
@@ -60,6 +70,7 @@ export declare class GameCoreClient {
|
|
|
60
70
|
deliveryType?: string;
|
|
61
71
|
include?: string;
|
|
62
72
|
inStockOnly?: boolean;
|
|
73
|
+
sort?: "popular" | "name" | "new" | "soldCount";
|
|
63
74
|
}) => Promise<Game[]>;
|
|
64
75
|
/** Get homepage ranked games */
|
|
65
76
|
getHomepageGames: () => Promise<Game[]>;
|
|
@@ -236,6 +247,7 @@ export declare class GameCoreClient {
|
|
|
236
247
|
/** Get public reviews (paginated) */
|
|
237
248
|
listPublic: (params?: {
|
|
238
249
|
gameSlug?: string;
|
|
250
|
+
productId?: number;
|
|
239
251
|
limit?: number;
|
|
240
252
|
offset?: number;
|
|
241
253
|
}) => Promise<PaginatedResponse<Review>>;
|
package/dist/index.js
CHANGED
|
@@ -77,6 +77,7 @@ class GameCoreClient {
|
|
|
77
77
|
getRates: () => this.request("GET", "/rates"),
|
|
78
78
|
getLegal: (type, locale) => this.request("GET", `/legal/${type}${locale ? `?locale=${locale}` : ""}`),
|
|
79
79
|
getStats: () => this.request("GET", "/site/stats"),
|
|
80
|
+
getBanners: () => this.request("GET", "/site/banners"),
|
|
80
81
|
getAnnouncementBar: () => this.request("GET", "/site/announcement-bar")
|
|
81
82
|
};
|
|
82
83
|
auth = {
|
|
@@ -118,6 +119,8 @@ class GameCoreClient {
|
|
|
118
119
|
qs.set("include", params.include);
|
|
119
120
|
if (params?.inStockOnly)
|
|
120
121
|
qs.set("inStockOnly", "true");
|
|
122
|
+
if (params?.sort)
|
|
123
|
+
qs.set("sort", params.sort);
|
|
121
124
|
const q = qs.toString();
|
|
122
125
|
return this.request("GET", `/catalog/games${q ? `?${q}` : ""}`);
|
|
123
126
|
},
|
|
@@ -214,6 +217,8 @@ class GameCoreClient {
|
|
|
214
217
|
const qs = new URLSearchParams;
|
|
215
218
|
if (params?.gameSlug)
|
|
216
219
|
qs.set("gameSlug", params.gameSlug);
|
|
220
|
+
if (params?.productId)
|
|
221
|
+
qs.set("productId", String(params.productId));
|
|
217
222
|
if (params?.limit)
|
|
218
223
|
qs.set("limit", String(params.limit));
|
|
219
224
|
if (params?.offset)
|
package/dist/types.d.ts
CHANGED
|
@@ -37,6 +37,14 @@ export interface SiteConfig {
|
|
|
37
37
|
enabled: boolean;
|
|
38
38
|
message: string | null;
|
|
39
39
|
};
|
|
40
|
+
analytics?: {
|
|
41
|
+
yandex: {
|
|
42
|
+
counterId: string;
|
|
43
|
+
} | null;
|
|
44
|
+
google: {
|
|
45
|
+
measurementId: string;
|
|
46
|
+
} | null;
|
|
47
|
+
};
|
|
40
48
|
}
|
|
41
49
|
export interface ExchangeRates {
|
|
42
50
|
usdToRub: number;
|