@gamecore-api/sdk 0.18.0 → 0.20.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 +19 -0
- package/dist/index.js +2 -0
- package/dist/types.d.ts +20 -2
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -117,6 +117,25 @@ export declare class GameCoreClient {
|
|
|
117
117
|
initTelegram: () => Promise<TelegramInitResponse>;
|
|
118
118
|
/** Poll Telegram auth status until authenticated or expired */
|
|
119
119
|
pollTelegramStatus: (token: string, intervalMs?: number) => Promise<User>;
|
|
120
|
+
/**
|
|
121
|
+
* Read the storefront's Telegram OpenID Connect config. Returns
|
|
122
|
+
* { enabled: false, clientId: null } when the tenant hasn't set
|
|
123
|
+
* up Web Login in BotFather (the SPA should fall back to the
|
|
124
|
+
* deep-link flow). When enabled, hand `clientId` to telegram-
|
|
125
|
+
* login.js to render the native consent card.
|
|
126
|
+
*/
|
|
127
|
+
getTelegramOidcConfig: () => Promise<{
|
|
128
|
+
enabled: boolean;
|
|
129
|
+
clientId: string | null;
|
|
130
|
+
}>;
|
|
131
|
+
/**
|
|
132
|
+
* Submit the RS256 id_token returned by telegram-login.js for
|
|
133
|
+
* server-side JWKS verification. On success the backend sets an
|
|
134
|
+
* auth cookie and returns the authenticated user, exactly like
|
|
135
|
+
* the Mini App / Widget verifiers. Optional `ref` threads a
|
|
136
|
+
* referral code through user creation on first login.
|
|
137
|
+
*/
|
|
138
|
+
telegramOidc: (idToken: string, ref?: string) => Promise<TelegramAuthResponse>;
|
|
120
139
|
/**
|
|
121
140
|
* Verify Telegram Mini App initData and issue a session cookie.
|
|
122
141
|
* Call this when your storefront is opened inside Telegram via the
|
package/dist/index.js
CHANGED
|
@@ -108,6 +108,8 @@ class GameCoreClient {
|
|
|
108
108
|
}
|
|
109
109
|
}, intervalMs);
|
|
110
110
|
}),
|
|
111
|
+
getTelegramOidcConfig: () => this.request("GET", "/auth/telegram/oidc/config"),
|
|
112
|
+
telegramOidc: (idToken, ref) => this.request("POST", "/auth/telegram/oidc/callback", { idToken, ref }, { rawResponse: true }),
|
|
111
113
|
verifyMiniApp: (initData, ref) => this.request("POST", "/auth/telegram/miniapp", { initData, ref }, { rawResponse: true }),
|
|
112
114
|
verifyTelegramWidget: (data, ref) => this.request("POST", "/auth/telegram/widget", { ...data, ref }, { rawResponse: true }),
|
|
113
115
|
renderTelegramWidget: async (opts) => {
|
package/dist/types.d.ts
CHANGED
|
@@ -191,7 +191,16 @@ export interface Game {
|
|
|
191
191
|
inStock: boolean;
|
|
192
192
|
soldCount?: number;
|
|
193
193
|
tags?: string[];
|
|
194
|
-
|
|
194
|
+
/**
|
|
195
|
+
* Availability lifecycle. `out_of_stock` is **derived** by the
|
|
196
|
+
* backend when a game has 0 visible products under the requesting
|
|
197
|
+
* site's filters (gateway allow-list, per-site overrides, allowed
|
|
198
|
+
* regions). Editorial states (`coming_soon`, `maintenance`,
|
|
199
|
+
* `discontinued`) are admin overrides on canonical_games and
|
|
200
|
+
* always win. Storefronts should branch on this field to render
|
|
201
|
+
* the right banner / Schema.org `availability` value.
|
|
202
|
+
*/
|
|
203
|
+
availabilityStatus?: "available" | "out_of_stock" | "coming_soon" | "maintenance" | "discontinued";
|
|
195
204
|
availabilityMessage?: string | null;
|
|
196
205
|
minPrice?: number | null;
|
|
197
206
|
type?: string;
|
|
@@ -245,7 +254,16 @@ export interface GameDetail {
|
|
|
245
254
|
/** Steam app id — null for non-Steam titles and mobile games. */
|
|
246
255
|
steamAppid?: number | null;
|
|
247
256
|
/** Availability lifecycle. Shares the union from {@link Game}. */
|
|
248
|
-
|
|
257
|
+
/**
|
|
258
|
+
* Availability lifecycle. `out_of_stock` is **derived** by the
|
|
259
|
+
* backend when a game has 0 visible products under the requesting
|
|
260
|
+
* site's filters (gateway allow-list, per-site overrides, allowed
|
|
261
|
+
* regions). Editorial states (`coming_soon`, `maintenance`,
|
|
262
|
+
* `discontinued`) are admin overrides on canonical_games and
|
|
263
|
+
* always win. Storefronts should branch on this field to render
|
|
264
|
+
* the right banner / Schema.org `availability` value.
|
|
265
|
+
*/
|
|
266
|
+
availabilityStatus?: "available" | "out_of_stock" | "coming_soon" | "maintenance" | "discontinued";
|
|
249
267
|
/** Human-readable message for non-available games. */
|
|
250
268
|
availabilityMessage?: string | null;
|
|
251
269
|
inStock?: boolean;
|