glitch-javascript-sdk 3.9.0 → 3.9.2
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 +5852 -0
- package/dist/browser/hosting-runtime.js.map +1 -0
- package/dist/cjs/index.js +10 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Hosting.d.ts +9 -1
- package/dist/esm/hosting-runtime.d.ts +10 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/package.json +1 -1
- package/src/api/Hosting.ts +15 -1
- package/src/hosting-runtime.ts +45 -0
- package/src/routes/HostingRoute.ts +2 -0
|
@@ -9,6 +9,7 @@ export interface HostingAccount {
|
|
|
9
9
|
id: string;
|
|
10
10
|
community_id: string;
|
|
11
11
|
plan: HostingPlanKey;
|
|
12
|
+
pending_plan?: HostingPlanKey | null;
|
|
12
13
|
status: string;
|
|
13
14
|
included_bandwidth_bytes: number;
|
|
14
15
|
used_bandwidth_bytes: number;
|
|
@@ -38,6 +39,7 @@ export interface HostingDomain {
|
|
|
38
39
|
verification_record_name?: string | null;
|
|
39
40
|
verification_record_value?: string | null;
|
|
40
41
|
certificate_status?: string | null;
|
|
42
|
+
billing_status?: 'active' | 'past_due' | 'unpaid' | 'cancelled' | null;
|
|
41
43
|
annual_price_cents?: number | null;
|
|
42
44
|
auto_renew: boolean;
|
|
43
45
|
}
|
|
@@ -57,7 +59,9 @@ export interface HostingDatabase {
|
|
|
57
59
|
high_availability_enabled: boolean;
|
|
58
60
|
endpoint?: string | null;
|
|
59
61
|
port?: number | null;
|
|
60
|
-
binding_name:
|
|
62
|
+
binding_name: string;
|
|
63
|
+
billing_status: 'awaiting_payment' | 'active' | 'past_due' | 'unpaid' | 'cancelled' | 'expired' | 'failed';
|
|
64
|
+
billing_active: boolean;
|
|
61
65
|
last_error?: string | null;
|
|
62
66
|
}
|
|
63
67
|
export interface HostingSite {
|
|
@@ -107,6 +111,10 @@ declare class Hosting {
|
|
|
107
111
|
static catalog<T>(): AxiosPromise<Response<T>>;
|
|
108
112
|
static dashboard<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
109
113
|
static channelAnalytics<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
114
|
+
/** Start or apply a bandwidth-based Hosting plan, separate from Store distribution. */
|
|
115
|
+
static billingCheckout<T>(title_id: string, plan: HostingPlanKey): AxiosPromise<Response<T>>;
|
|
116
|
+
/** Confirm a paid Stripe Checkout session before provisioning its Azure resource. */
|
|
117
|
+
static confirmBillingCheckout<T>(title_id: string, checkout_session_id: string): AxiosPromise<Response<T>>;
|
|
110
118
|
static createSite<T>(title_id: string, data: CreateHostingSiteRequest): AxiosPromise<Response<T>>;
|
|
111
119
|
static updateSite<T>(title_id: string, site_id: string, data: Partial<CreateHostingSiteRequest> & Record<string, any>): AxiosPromise<Response<T>>;
|
|
112
120
|
static createUploadUrl<T>(title_id: string, site_id: string): AxiosPromise<Response<T>>;
|
package/dist/esm/index.js
CHANGED
|
@@ -20888,6 +20888,8 @@ HostingRoute.routes = {
|
|
|
20888
20888
|
catalog: { url: '/hosting/catalog', method: HTTP_METHODS.GET },
|
|
20889
20889
|
dashboard: { url: '/titles/{title_id}/hosting', method: HTTP_METHODS.GET },
|
|
20890
20890
|
channelAnalytics: { url: '/titles/{title_id}/hosting/analytics/channels', method: HTTP_METHODS.GET },
|
|
20891
|
+
billingCheckout: { url: '/titles/{title_id}/hosting/billing/checkout', method: HTTP_METHODS.POST },
|
|
20892
|
+
confirmBillingCheckout: { url: '/titles/{title_id}/hosting/billing/confirm', method: HTTP_METHODS.POST },
|
|
20891
20893
|
createSite: { url: '/titles/{title_id}/hosting/sites', method: HTTP_METHODS.POST },
|
|
20892
20894
|
updateSite: { url: '/titles/{title_id}/hosting/sites/{site_id}', method: HTTP_METHODS.PUT },
|
|
20893
20895
|
uploadUrl: { url: '/titles/{title_id}/hosting/sites/{site_id}/upload-url', method: HTTP_METHODS.POST },
|
|
@@ -20924,6 +20926,14 @@ class Hosting {
|
|
|
20924
20926
|
static channelAnalytics(title_id, params) {
|
|
20925
20927
|
return Requests.processRoute(HostingRoute.routes.channelAnalytics, undefined, { title_id }, params);
|
|
20926
20928
|
}
|
|
20929
|
+
/** Start or apply a bandwidth-based Hosting plan, separate from Store distribution. */
|
|
20930
|
+
static billingCheckout(title_id, plan) {
|
|
20931
|
+
return Requests.processRoute(HostingRoute.routes.billingCheckout, { plan }, { title_id });
|
|
20932
|
+
}
|
|
20933
|
+
/** Confirm a paid Stripe Checkout session before provisioning its Azure resource. */
|
|
20934
|
+
static confirmBillingCheckout(title_id, checkout_session_id) {
|
|
20935
|
+
return Requests.processRoute(HostingRoute.routes.confirmBillingCheckout, { checkout_session_id }, { title_id });
|
|
20936
|
+
}
|
|
20927
20937
|
static createSite(title_id, data) {
|
|
20928
20938
|
return Requests.processRoute(HostingRoute.routes.createSite, data, { title_id });
|
|
20929
20939
|
}
|