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
|
@@ -5787,8 +5787,16 @@
|
|
|
5787
5787
|
static aiInstructions(title_id, site_id, data = {}) {
|
|
5788
5788
|
return Requests.processRoute(HostingRoute.routes.aiInstructions, data, { title_id, site_id });
|
|
5789
5789
|
}
|
|
5790
|
-
static resolve(hostname) {
|
|
5791
|
-
|
|
5790
|
+
static resolve(hostname, gatewayToken) {
|
|
5791
|
+
if (!gatewayToken) {
|
|
5792
|
+
return Requests.processRoute(HostingRoute.routes.resolve, undefined, undefined, { hostname });
|
|
5793
|
+
}
|
|
5794
|
+
const base = (Config.getBaseUrl() || '').replace(/\/+$/, '');
|
|
5795
|
+
const path = HostingRoute.routes.resolve.url.replace(/^\/+/, '');
|
|
5796
|
+
return axios$1.get(`${base}/${path}`, {
|
|
5797
|
+
params: { hostname },
|
|
5798
|
+
headers: { 'X-Glitch-Hosting-Gateway': gatewayToken },
|
|
5799
|
+
});
|
|
5792
5800
|
}
|
|
5793
5801
|
static startPlaySession(data) {
|
|
5794
5802
|
return Requests.processRoute(HostingRoute.routes.startPlaySession, data);
|
|
@@ -5840,7 +5848,8 @@
|
|
|
5840
5848
|
return session;
|
|
5841
5849
|
}).catch((error) => {
|
|
5842
5850
|
window.dispatchEvent(new CustomEvent('glitch:hosting-error', { detail: { message: (error === null || error === void 0 ? void 0 : error.message) || 'Hosting analytics could not start.' } }));
|
|
5843
|
-
|
|
5851
|
+
// Analytics must never prevent the uploaded game itself from loading.
|
|
5852
|
+
return null;
|
|
5844
5853
|
});
|
|
5845
5854
|
window.GlitchHosting = {
|
|
5846
5855
|
ready,
|