glitch-javascript-sdk 3.9.0 → 3.9.1

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.
@@ -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;
@@ -107,6 +108,10 @@ declare class Hosting {
107
108
  static catalog<T>(): AxiosPromise<Response<T>>;
108
109
  static dashboard<T>(title_id: string): AxiosPromise<Response<T>>;
109
110
  static channelAnalytics<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
111
+ /** Start or apply a bandwidth-based Hosting plan, separate from Store distribution. */
112
+ static billingCheckout<T>(title_id: string, plan: HostingPlanKey): AxiosPromise<Response<T>>;
113
+ /** Confirm a paid Stripe Checkout session before provisioning its Azure resource. */
114
+ static confirmBillingCheckout<T>(title_id: string, checkout_session_id: string): AxiosPromise<Response<T>>;
110
115
  static createSite<T>(title_id: string, data: CreateHostingSiteRequest): AxiosPromise<Response<T>>;
111
116
  static updateSite<T>(title_id: string, site_id: string, data: Partial<CreateHostingSiteRequest> & Record<string, any>): AxiosPromise<Response<T>>;
112
117
  static createUploadUrl<T>(title_id: string, site_id: string): AxiosPromise<Response<T>>;
@@ -0,0 +1,10 @@
1
+ declare global {
2
+ interface Window {
3
+ GlitchHosting?: {
4
+ ready: Promise<Record<string, any>>;
5
+ session?: Record<string, any>;
6
+ getContext: () => Record<string, any> | null;
7
+ };
8
+ }
9
+ }
10
+ export {};
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
  }