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
|
@@ -39,6 +39,7 @@ export interface HostingDomain {
|
|
|
39
39
|
verification_record_name?: string | null;
|
|
40
40
|
verification_record_value?: string | null;
|
|
41
41
|
certificate_status?: string | null;
|
|
42
|
+
billing_status?: 'active' | 'past_due' | 'unpaid' | 'cancelled' | null;
|
|
42
43
|
annual_price_cents?: number | null;
|
|
43
44
|
auto_renew: boolean;
|
|
44
45
|
}
|
|
@@ -58,7 +59,9 @@ export interface HostingDatabase {
|
|
|
58
59
|
high_availability_enabled: boolean;
|
|
59
60
|
endpoint?: string | null;
|
|
60
61
|
port?: number | null;
|
|
61
|
-
binding_name:
|
|
62
|
+
binding_name: string;
|
|
63
|
+
billing_status: 'awaiting_payment' | 'active' | 'past_due' | 'unpaid' | 'cancelled' | 'expired' | 'failed';
|
|
64
|
+
billing_active: boolean;
|
|
62
65
|
last_error?: string | null;
|
|
63
66
|
}
|
|
64
67
|
export interface HostingSite {
|
|
@@ -125,7 +128,7 @@ declare class Hosting {
|
|
|
125
128
|
static checkDomain<T>(hostname: string): AxiosPromise<Response<T>>;
|
|
126
129
|
static purchaseDomain<T>(title_id: string, site_id: string, data: Record<string, any>): AxiosPromise<Response<T>>;
|
|
127
130
|
static aiInstructions<T>(title_id: string, site_id: string, data?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
128
|
-
static resolve<T>(hostname: string): AxiosPromise<Response<T>>;
|
|
131
|
+
static resolve<T>(hostname: string, gatewayToken?: string): AxiosPromise<Response<T>>;
|
|
129
132
|
static startPlaySession<T>(data: Record<string, any>): AxiosPromise<Response<T>>;
|
|
130
133
|
static heartbeatPlaySession<T>(session_id: string, sessionToken: string): AxiosPromise<Response<T>>;
|
|
131
134
|
static databases<T>(title_id: string, site_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
package/dist/esm/index.js
CHANGED
|
@@ -11820,9 +11820,9 @@ TitlesRoute.routes = {
|
|
|
11820
11820
|
method: HTTP_METHODS.PUT
|
|
11821
11821
|
},
|
|
11822
11822
|
importKeys: { url: '/titles/{title_id}/import-keys', method: HTTP_METHODS.POST },
|
|
11823
|
-
// ─────────────────────────────────────────────────────────────────
|
|
11824
|
-
// Purchase/Revenue Endpoints
|
|
11825
|
-
// ─────────────────────────────────────────────────────────────────
|
|
11823
|
+
// ─────────────────────────────────────────────────────────────────
|
|
11824
|
+
// Purchase/Revenue Endpoints
|
|
11825
|
+
// ─────────────────────────────────────────────────────────────────
|
|
11826
11826
|
purchasesList: {
|
|
11827
11827
|
url: "/titles/{title_id}/purchases",
|
|
11828
11828
|
method: HTTP_METHODS.GET,
|
|
@@ -11839,7 +11839,7 @@ TitlesRoute.routes = {
|
|
|
11839
11839
|
url: "/titles/{title_id}/purchases/summary",
|
|
11840
11840
|
method: HTTP_METHODS.GET,
|
|
11841
11841
|
},
|
|
11842
|
-
// Advanced analytics sub-routes
|
|
11842
|
+
// Advanced analytics sub-routes
|
|
11843
11843
|
purchasesTimeReport: {
|
|
11844
11844
|
url: "/titles/{title_id}/purchases/reports/time",
|
|
11845
11845
|
method: HTTP_METHODS.GET,
|
|
@@ -20974,8 +20974,16 @@ class Hosting {
|
|
|
20974
20974
|
static aiInstructions(title_id, site_id, data = {}) {
|
|
20975
20975
|
return Requests.processRoute(HostingRoute.routes.aiInstructions, data, { title_id, site_id });
|
|
20976
20976
|
}
|
|
20977
|
-
static resolve(hostname) {
|
|
20978
|
-
|
|
20977
|
+
static resolve(hostname, gatewayToken) {
|
|
20978
|
+
if (!gatewayToken) {
|
|
20979
|
+
return Requests.processRoute(HostingRoute.routes.resolve, undefined, undefined, { hostname });
|
|
20980
|
+
}
|
|
20981
|
+
const base = (Config.getBaseUrl() || '').replace(/\/+$/, '');
|
|
20982
|
+
const path = HostingRoute.routes.resolve.url.replace(/^\/+/, '');
|
|
20983
|
+
return axios$1.get(`${base}/${path}`, {
|
|
20984
|
+
params: { hostname },
|
|
20985
|
+
headers: { 'X-Glitch-Hosting-Gateway': gatewayToken },
|
|
20986
|
+
});
|
|
20979
20987
|
}
|
|
20980
20988
|
static startPlaySession(data) {
|
|
20981
20989
|
return Requests.processRoute(HostingRoute.routes.startPlaySession, data);
|