@gamecore-api/sdk 0.4.0 → 0.5.0

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 CHANGED
@@ -1,4 +1,4 @@
1
- import type { TelegramInitResponse, User, SiteConfig, ExchangeRates, LegalDocument, Game, GameDetail, Product, SearchResult, Category, CartItem, CheckoutRequest, CheckoutResponse, Order, UserBalance, LevelStatus, Transaction, Notification, Favorite, Review, ReviewStats, CouponResult, ReferralStats, ReferralLink, ReferralCommission, TopupMethod, TopupResponse, TopupStatus, GiftCard, Announcement, AnnouncementBar, ProductFilters, PaginatedResponse } from "./types";
1
+ import type { TelegramInitResponse, User, SiteConfig, ExchangeRates, LegalDocument, Game, GameDetail, Product, SearchResult, Category, CartItem, CheckoutRequest, CheckoutResponse, Order, UserBalance, LevelStatus, Transaction, Notification, Favorite, Review, ReviewStats, CouponResult, ReferralStats, ReferralLink, ReferralCommission, TopupMethod, TopupResponse, TopupStatus, GiftCard, Announcement, AnnouncementBar, SiteStats, ProductFilters, PaginatedResponse } from "./types";
2
2
  export interface GameCoreOptions {
3
3
  /** Site API key (gc_live_xxx or gc_test_xxx) */
4
4
  apiKey: string;
@@ -20,6 +20,8 @@ export declare class GameCoreClient {
20
20
  getRates: () => Promise<ExchangeRates>;
21
21
  /** Get legal document by type (privacy, terms, etc.) */
22
22
  getLegal: (type: string, locale?: string) => Promise<LegalDocument>;
23
+ /** Get site statistics for trust signals (cached 5 min on server) */
24
+ getStats: () => Promise<SiteStats>;
23
25
  /** Get announcement bar settings (text, link, enabled) */
24
26
  getAnnouncementBar: () => Promise<AnnouncementBar>;
25
27
  };
package/dist/index.js CHANGED
@@ -76,6 +76,7 @@ class GameCoreClient {
76
76
  getConfig: () => this.request("GET", "/site/config"),
77
77
  getRates: () => this.request("GET", "/rates"),
78
78
  getLegal: (type, locale) => this.request("GET", `/legal/${type}${locale ? `?locale=${locale}` : ""}`),
79
+ getStats: () => this.request("GET", "/site/stats"),
79
80
  getAnnouncementBar: () => this.request("GET", "/site/announcement-bar")
80
81
  };
81
82
  auth = {
package/dist/types.d.ts CHANGED
@@ -33,6 +33,10 @@ export interface SiteConfig {
33
33
  rateMode: "auto" | "manual";
34
34
  currentRate: number;
35
35
  supportedLocales?: string[];
36
+ maintenance?: {
37
+ enabled: boolean;
38
+ message: string | null;
39
+ };
36
40
  }
37
41
  export interface ExchangeRates {
38
42
  usdToRub: number;
@@ -55,6 +59,8 @@ export interface Game {
55
59
  localIcon?: string | null;
56
60
  productCount: number;
57
61
  inStock: boolean;
62
+ soldCount?: number;
63
+ tags?: string[];
58
64
  minPrice?: number | null;
59
65
  type?: string;
60
66
  deliveryTypes?: string[];
@@ -131,6 +137,8 @@ export interface FulfillmentMeta {
131
137
  export interface Product {
132
138
  id: number;
133
139
  name: string;
140
+ description?: string | null;
141
+ estimatedDelivery?: string;
134
142
  icon: string | null;
135
143
  price: number | null;
136
144
  priceWithoutDiscount?: number;
@@ -379,6 +387,12 @@ export interface Announcement {
379
387
  imageUrl?: string | null;
380
388
  createdAt: string;
381
389
  }
390
+ export interface SiteStats {
391
+ totalCustomers: number;
392
+ totalOrders: number;
393
+ totalGames: number;
394
+ avgDeliveryMinutes: number;
395
+ }
382
396
  export interface AnnouncementBar {
383
397
  enabled: boolean;
384
398
  text: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamecore-api/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "TypeScript SDK for GameCore API — browser-safe, zero dependencies",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",