@gamecore-api/sdk 0.3.0 → 0.3.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 +35 -0
- package/dist/index.js +11 -5
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -79,6 +79,37 @@ export declare class GameCoreClient {
|
|
|
79
79
|
}>;
|
|
80
80
|
/** Get single product by ID */
|
|
81
81
|
getProduct: (productId: number) => Promise<Product>;
|
|
82
|
+
/** Get bundle discount rules */
|
|
83
|
+
getBundleRules: () => Promise<{
|
|
84
|
+
id: number;
|
|
85
|
+
name: string;
|
|
86
|
+
scope: string;
|
|
87
|
+
minItems: number;
|
|
88
|
+
discountPercent: number;
|
|
89
|
+
}[]>;
|
|
90
|
+
/** Get active promo campaigns */
|
|
91
|
+
getPromos: () => Promise<{
|
|
92
|
+
id: number;
|
|
93
|
+
name: string;
|
|
94
|
+
type: string;
|
|
95
|
+
value: number;
|
|
96
|
+
scope: string;
|
|
97
|
+
bannerTitle?: string;
|
|
98
|
+
bannerDescription?: string;
|
|
99
|
+
bannerImageUrl?: string;
|
|
100
|
+
bannerColor?: string;
|
|
101
|
+
endsAt?: string;
|
|
102
|
+
}[]>;
|
|
103
|
+
/** Get all games with full metadata (categories, delivery types) */
|
|
104
|
+
getGamesFull: () => Promise<Game[]>;
|
|
105
|
+
/** Validate delivery data before checkout */
|
|
106
|
+
validateDelivery: (productId: number, deliveryData: Record<string, string>) => Promise<{
|
|
107
|
+
valid: boolean;
|
|
108
|
+
errors?: Array<{
|
|
109
|
+
field: string;
|
|
110
|
+
message: string;
|
|
111
|
+
}>;
|
|
112
|
+
}>;
|
|
82
113
|
};
|
|
83
114
|
cart: {
|
|
84
115
|
/** Get cart items for authenticated user */
|
|
@@ -145,6 +176,10 @@ export declare class GameCoreClient {
|
|
|
145
176
|
markRead: (id: number) => Promise<void>;
|
|
146
177
|
/** Mark all notifications as read */
|
|
147
178
|
markAllRead: () => Promise<void>;
|
|
179
|
+
/** Delete user account */
|
|
180
|
+
deleteAccount: () => Promise<void>;
|
|
181
|
+
/** Export user data (GDPR) */
|
|
182
|
+
exportData: () => Promise<Record<string, unknown>>;
|
|
148
183
|
};
|
|
149
184
|
favorites: {
|
|
150
185
|
/** List user's favorite products */
|
package/dist/index.js
CHANGED
|
@@ -140,7 +140,11 @@ class GameCoreClient {
|
|
|
140
140
|
getProductsGrouped: (gameSlug) => this.request("GET", `/catalog/games/${gameSlug}/products/grouped`),
|
|
141
141
|
search: (query, limit = 20) => this.request("GET", `/catalog/search?q=${encodeURIComponent(query)}&limit=${limit}`),
|
|
142
142
|
searchSuggestions: (query, limit = 5) => this.request("GET", `/catalog/search/suggestions?q=${encodeURIComponent(query)}&limit=${limit}`),
|
|
143
|
-
getProduct: (productId) => this.request("GET", `/catalog/products/${productId}`)
|
|
143
|
+
getProduct: (productId) => this.request("GET", `/catalog/products/${productId}`),
|
|
144
|
+
getBundleRules: () => this.request("GET", "/catalog/bundle-rules"),
|
|
145
|
+
getPromos: () => this.request("GET", "/catalog/promos"),
|
|
146
|
+
getGamesFull: () => this.request("GET", "/catalog/games/full"),
|
|
147
|
+
validateDelivery: (productId, deliveryData) => this.request("POST", "/catalog/validate-delivery", { productId, deliveryData })
|
|
144
148
|
};
|
|
145
149
|
cart = {
|
|
146
150
|
get: () => this.request("GET", "/cart"),
|
|
@@ -178,7 +182,9 @@ class GameCoreClient {
|
|
|
178
182
|
getNotifications: () => this.request("GET", "/profile/notifications"),
|
|
179
183
|
getUnreadCount: () => this.request("GET", "/profile/notifications/unread-count"),
|
|
180
184
|
markRead: (id) => this.request("POST", `/profile/notifications/${id}/read`),
|
|
181
|
-
markAllRead: () => this.request("POST", "/profile/notifications/read-all")
|
|
185
|
+
markAllRead: () => this.request("POST", "/profile/notifications/read-all"),
|
|
186
|
+
deleteAccount: () => this.request("POST", "/profile/delete-account"),
|
|
187
|
+
exportData: () => this.request("GET", "/profile/export")
|
|
182
188
|
};
|
|
183
189
|
favorites = {
|
|
184
190
|
list: () => this.request("GET", "/favorites"),
|
|
@@ -195,7 +201,7 @@ class GameCoreClient {
|
|
|
195
201
|
getStats: () => this.request("GET", "/referral/stats"),
|
|
196
202
|
getLinks: () => this.request("GET", "/referral/links"),
|
|
197
203
|
createLink: (data) => this.request("POST", "/referral/links", data),
|
|
198
|
-
updateLink: (id, data) => this.request("
|
|
204
|
+
updateLink: (id, data) => this.request("PUT", `/referral/links/${id}`, data),
|
|
199
205
|
deleteLink: (id) => this.request("DELETE", `/referral/links/${id}`),
|
|
200
206
|
getLinkStats: (id) => this.request("GET", `/referral/links/${id}/stats`),
|
|
201
207
|
getCommissions: () => this.request("GET", "/referral/commissions")
|
|
@@ -218,7 +224,7 @@ class GameCoreClient {
|
|
|
218
224
|
},
|
|
219
225
|
getRandom: (limit = 5) => this.request("GET", `/reviews/public/random?limit=${limit}`),
|
|
220
226
|
getMine: () => this.request("GET", "/reviews/mine"),
|
|
221
|
-
getPending: () => this.request("GET", "/reviews/
|
|
227
|
+
getPending: () => this.request("GET", "/reviews/pending"),
|
|
222
228
|
create: (orderId, rating, text) => this.request("POST", "/reviews", { orderId, rating, text })
|
|
223
229
|
};
|
|
224
230
|
topup = {
|
|
@@ -229,7 +235,7 @@ class GameCoreClient {
|
|
|
229
235
|
giftCards = {
|
|
230
236
|
purchase: (amountUsd) => this.request("POST", "/gift-cards/purchase", { amountUsd }),
|
|
231
237
|
redeem: (code) => this.request("POST", "/gift-cards/redeem", { code }),
|
|
232
|
-
check: (code) => this.request("GET", `/gift-cards/check
|
|
238
|
+
check: (code) => this.request("GET", `/gift-cards/check/${code}`),
|
|
233
239
|
getMine: () => this.request("GET", "/profile/gift-cards")
|
|
234
240
|
};
|
|
235
241
|
announcements = {
|