glitch-javascript-sdk 3.9.1 → 3.9.3
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/browser/hosting-runtime.js +12 -3
- package/dist/browser/hosting-runtime.js.map +1 -1
- package/dist/cjs/index.js +14 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Hosting.d.ts +5 -2
- package/dist/esm/index.js +14 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/api/Competitions.ts +184 -184
- package/src/api/Hosting.ts +15 -3
- package/src/hosting-runtime.ts +2 -1
- package/src/routes/TitlesRoute.ts +7 -7
package/src/api/Hosting.ts
CHANGED
|
@@ -46,6 +46,7 @@ export interface HostingDomain {
|
|
|
46
46
|
verification_record_name?: string | null;
|
|
47
47
|
verification_record_value?: string | null;
|
|
48
48
|
certificate_status?: string | null;
|
|
49
|
+
billing_status?: 'active' | 'past_due' | 'unpaid' | 'cancelled' | null;
|
|
49
50
|
annual_price_cents?: number | null;
|
|
50
51
|
auto_renew: boolean;
|
|
51
52
|
}
|
|
@@ -66,7 +67,9 @@ export interface HostingDatabase {
|
|
|
66
67
|
high_availability_enabled: boolean;
|
|
67
68
|
endpoint?: string | null;
|
|
68
69
|
port?: number | null;
|
|
69
|
-
binding_name:
|
|
70
|
+
binding_name: string;
|
|
71
|
+
billing_status: 'awaiting_payment' | 'active' | 'past_due' | 'unpaid' | 'cancelled' | 'expired' | 'failed';
|
|
72
|
+
billing_active: boolean;
|
|
70
73
|
last_error?: string | null;
|
|
71
74
|
}
|
|
72
75
|
|
|
@@ -192,8 +195,17 @@ class Hosting {
|
|
|
192
195
|
return Requests.processRoute(HostingRoute.routes.aiInstructions, data, { title_id, site_id });
|
|
193
196
|
}
|
|
194
197
|
|
|
195
|
-
public static resolve<T>(hostname: string): AxiosPromise<Response<T>> {
|
|
196
|
-
|
|
198
|
+
public static resolve<T>(hostname: string, gatewayToken?: string): AxiosPromise<Response<T>> {
|
|
199
|
+
if (!gatewayToken) {
|
|
200
|
+
return Requests.processRoute(HostingRoute.routes.resolve, undefined, undefined, { hostname });
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const base = (Config.getBaseUrl() || '').replace(/\/+$/, '');
|
|
204
|
+
const path = HostingRoute.routes.resolve.url.replace(/^\/+/, '');
|
|
205
|
+
return axios.get(`${base}/${path}`, {
|
|
206
|
+
params: { hostname },
|
|
207
|
+
headers: { 'X-Glitch-Hosting-Gateway': gatewayToken },
|
|
208
|
+
});
|
|
197
209
|
}
|
|
198
210
|
|
|
199
211
|
public static startPlaySession<T>(data: Record<string, any>): AxiosPromise<Response<T>> {
|
package/src/hosting-runtime.ts
CHANGED
|
@@ -33,7 +33,8 @@ const ready = Hosting.startPlaySession<Record<string, any>>({
|
|
|
33
33
|
return session;
|
|
34
34
|
}).catch((error) => {
|
|
35
35
|
window.dispatchEvent(new CustomEvent('glitch:hosting-error', { detail: { message: error?.message || 'Hosting analytics could not start.' } }));
|
|
36
|
-
|
|
36
|
+
// Analytics must never prevent the uploaded game itself from loading.
|
|
37
|
+
return null as any;
|
|
37
38
|
});
|
|
38
39
|
|
|
39
40
|
window.GlitchHosting = {
|
|
@@ -97,9 +97,9 @@ class TitlesRoute {
|
|
|
97
97
|
importKeys: { url: '/titles/{title_id}/import-keys', method: HTTP_METHODS.POST },
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
// ─────────────────────────────────────────────────────────────────
|
|
101
|
-
// Purchase/Revenue Endpoints
|
|
102
|
-
// ─────────────────────────────────────────────────────────────────
|
|
100
|
+
// ─────────────────────────────────────────────────────────────────
|
|
101
|
+
// Purchase/Revenue Endpoints
|
|
102
|
+
// ─────────────────────────────────────────────────────────────────
|
|
103
103
|
purchasesList: {
|
|
104
104
|
url: "/titles/{title_id}/purchases",
|
|
105
105
|
method: HTTP_METHODS.GET,
|
|
@@ -117,7 +117,7 @@ class TitlesRoute {
|
|
|
117
117
|
method: HTTP_METHODS.GET,
|
|
118
118
|
},
|
|
119
119
|
|
|
120
|
-
// Advanced analytics sub-routes
|
|
120
|
+
// Advanced analytics sub-routes
|
|
121
121
|
purchasesTimeReport: {
|
|
122
122
|
url: "/titles/{title_id}/purchases/reports/time",
|
|
123
123
|
method: HTTP_METHODS.GET,
|
|
@@ -288,9 +288,9 @@ class TitlesRoute {
|
|
|
288
288
|
*/
|
|
289
289
|
swipeFeed: { url: '/titles/discovery/swipe', method: HTTP_METHODS.GET },
|
|
290
290
|
|
|
291
|
-
developerPayoutConsolidatedSummary: {
|
|
292
|
-
url: '/titles/{title_id}/payouts/consolidated-summary',
|
|
293
|
-
method: HTTP_METHODS.GET
|
|
291
|
+
developerPayoutConsolidatedSummary: {
|
|
292
|
+
url: '/titles/{title_id}/payouts/consolidated-summary',
|
|
293
|
+
method: HTTP_METHODS.GET
|
|
294
294
|
},
|
|
295
295
|
|
|
296
296
|
wishlistHistory: { url: '/titles/{title_id}/wishlist/history', method: HTTP_METHODS.GET },
|