glitch-javascript-sdk 3.9.4 → 3.9.5
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 +16 -1
- package/dist/browser/hosting-runtime.js.map +1 -1
- package/dist/cjs/index.js +16 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Hosting.d.ts +27 -0
- package/dist/esm/index.js +16 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/HostingRoute.d.ts +1 -1
- package/dist/index.d.ts +6 -0
- package/package.json +1 -1
- package/src/api/Hosting.ts +37 -0
- package/src/routes/HostingRoute.ts +4 -1
|
@@ -5,12 +5,15 @@ export type HostingMode = 'static' | 'server';
|
|
|
5
5
|
export type HostingDatabaseEngine = 'postgresql' | 'mysql' | 'azure_sql' | 'cosmos_nosql';
|
|
6
6
|
export type HostingDatabasePlan = 'sandbox' | 'launch' | 'growth' | 'scale' | 'dedicated';
|
|
7
7
|
export type HostingDeliveryChannel = 'glitch_store' | 'glitch_hosted_subdomain' | 'glitch_hosted_custom_domain' | 'external';
|
|
8
|
+
export type HostingBillingProvider = 'direct' | 'microsoft_marketplace';
|
|
8
9
|
export interface HostingAccount {
|
|
9
10
|
id: string;
|
|
10
11
|
community_id: string;
|
|
11
12
|
plan: HostingPlanKey;
|
|
12
13
|
pending_plan?: HostingPlanKey | null;
|
|
13
14
|
status: string;
|
|
15
|
+
billing_provider: HostingBillingProvider;
|
|
16
|
+
microsoft_marketplace_subscription_id?: string | null;
|
|
14
17
|
included_bandwidth_bytes: number;
|
|
15
18
|
used_bandwidth_bytes: number;
|
|
16
19
|
remaining_bandwidth_bytes: number;
|
|
@@ -61,6 +64,7 @@ export interface HostingDatabase {
|
|
|
61
64
|
port?: number | null;
|
|
62
65
|
binding_name: string;
|
|
63
66
|
billing_status: 'awaiting_payment' | 'active' | 'past_due' | 'unpaid' | 'cancelled' | 'expired' | 'failed';
|
|
67
|
+
billing_provider: HostingBillingProvider;
|
|
64
68
|
billing_active: boolean;
|
|
65
69
|
last_error?: string | null;
|
|
66
70
|
}
|
|
@@ -103,6 +107,23 @@ export interface CreateHostingDatabaseRequest {
|
|
|
103
107
|
auto_grow_enabled?: boolean;
|
|
104
108
|
high_availability_enabled?: boolean;
|
|
105
109
|
}
|
|
110
|
+
export interface HostingMarketplaceSubscription {
|
|
111
|
+
id: string;
|
|
112
|
+
marketplace_subscription_id: string;
|
|
113
|
+
subscription_name?: string | null;
|
|
114
|
+
offer_id: string;
|
|
115
|
+
plan_id: string;
|
|
116
|
+
plan_key: HostingPlanKey;
|
|
117
|
+
status: 'PendingFulfillmentStart' | 'Subscribed' | 'Suspended' | 'Unsubscribed';
|
|
118
|
+
quantity: number;
|
|
119
|
+
community_id?: string | null;
|
|
120
|
+
is_test: boolean;
|
|
121
|
+
is_free_trial: boolean;
|
|
122
|
+
auto_renew: boolean;
|
|
123
|
+
term_starts_at?: string | null;
|
|
124
|
+
term_ends_at?: string | null;
|
|
125
|
+
activated_at?: string | null;
|
|
126
|
+
}
|
|
106
127
|
/**
|
|
107
128
|
* Typed SDK for game website hosting, Azure database add-ons, domains, usage,
|
|
108
129
|
* deployment instructions, and hosted-play attribution.
|
|
@@ -115,6 +136,12 @@ declare class Hosting {
|
|
|
115
136
|
static billingCheckout<T>(title_id: string, plan: HostingPlanKey): AxiosPromise<Response<T>>;
|
|
116
137
|
/** Confirm a paid Stripe Checkout session before provisioning its Azure resource. */
|
|
117
138
|
static confirmBillingCheckout<T>(title_id: string, checkout_session_id: string): AxiosPromise<Response<T>>;
|
|
139
|
+
/** Resolve the one-hour purchase token passed to Glitch by Microsoft Marketplace. */
|
|
140
|
+
static resolveMarketplacePurchase<T>(token: string): AxiosPromise<Response<T>>;
|
|
141
|
+
/** Link a resolved Microsoft Marketplace subscription to a billable Glitch business account. */
|
|
142
|
+
static activateMarketplaceSubscription<T>(subscription_id: string, community_id: string): AxiosPromise<Response<T>>;
|
|
143
|
+
/** Retrieve safe Microsoft Marketplace entitlement and lifecycle status. */
|
|
144
|
+
static marketplaceSubscription<T>(subscription_id: string): AxiosPromise<Response<T>>;
|
|
118
145
|
static createSite<T>(title_id: string, data: CreateHostingSiteRequest): AxiosPromise<Response<T>>;
|
|
119
146
|
static updateSite<T>(title_id: string, site_id: string, data: Partial<CreateHostingSiteRequest> & Record<string, any>): AxiosPromise<Response<T>>;
|
|
120
147
|
static createUploadUrl<T>(title_id: string, site_id: string): AxiosPromise<Response<T>>;
|
package/dist/esm/index.js
CHANGED
|
@@ -21315,7 +21315,7 @@ class GameAdvertising {
|
|
|
21315
21315
|
}
|
|
21316
21316
|
}
|
|
21317
21317
|
|
|
21318
|
-
/** Route catalog for
|
|
21318
|
+
/** Route catalog for game website hosting and its direct or Marketplace billing. */
|
|
21319
21319
|
class HostingRoute {
|
|
21320
21320
|
}
|
|
21321
21321
|
HostingRoute.routes = {
|
|
@@ -21324,6 +21324,9 @@ HostingRoute.routes = {
|
|
|
21324
21324
|
channelAnalytics: { url: '/titles/{title_id}/hosting/analytics/channels', method: HTTP_METHODS.GET },
|
|
21325
21325
|
billingCheckout: { url: '/titles/{title_id}/hosting/billing/checkout', method: HTTP_METHODS.POST },
|
|
21326
21326
|
confirmBillingCheckout: { url: '/titles/{title_id}/hosting/billing/confirm', method: HTTP_METHODS.POST },
|
|
21327
|
+
resolveMarketplacePurchase: { url: '/hosting/marketplace/resolve', method: HTTP_METHODS.POST },
|
|
21328
|
+
activateMarketplaceSubscription: { url: '/hosting/marketplace/subscriptions/{subscription_id}/activate', method: HTTP_METHODS.POST },
|
|
21329
|
+
marketplaceSubscription: { url: '/hosting/marketplace/subscriptions/{subscription_id}', method: HTTP_METHODS.GET },
|
|
21327
21330
|
createSite: { url: '/titles/{title_id}/hosting/sites', method: HTTP_METHODS.POST },
|
|
21328
21331
|
updateSite: { url: '/titles/{title_id}/hosting/sites/{site_id}', method: HTTP_METHODS.PUT },
|
|
21329
21332
|
uploadUrl: { url: '/titles/{title_id}/hosting/sites/{site_id}/upload-url', method: HTTP_METHODS.POST },
|
|
@@ -21368,6 +21371,18 @@ class Hosting {
|
|
|
21368
21371
|
static confirmBillingCheckout(title_id, checkout_session_id) {
|
|
21369
21372
|
return Requests.processRoute(HostingRoute.routes.confirmBillingCheckout, { checkout_session_id }, { title_id });
|
|
21370
21373
|
}
|
|
21374
|
+
/** Resolve the one-hour purchase token passed to Glitch by Microsoft Marketplace. */
|
|
21375
|
+
static resolveMarketplacePurchase(token) {
|
|
21376
|
+
return Requests.processRoute(HostingRoute.routes.resolveMarketplacePurchase, { token });
|
|
21377
|
+
}
|
|
21378
|
+
/** Link a resolved Microsoft Marketplace subscription to a billable Glitch business account. */
|
|
21379
|
+
static activateMarketplaceSubscription(subscription_id, community_id) {
|
|
21380
|
+
return Requests.processRoute(HostingRoute.routes.activateMarketplaceSubscription, { community_id }, { subscription_id });
|
|
21381
|
+
}
|
|
21382
|
+
/** Retrieve safe Microsoft Marketplace entitlement and lifecycle status. */
|
|
21383
|
+
static marketplaceSubscription(subscription_id) {
|
|
21384
|
+
return Requests.processRoute(HostingRoute.routes.marketplaceSubscription, undefined, { subscription_id });
|
|
21385
|
+
}
|
|
21371
21386
|
static createSite(title_id, data) {
|
|
21372
21387
|
return Requests.processRoute(HostingRoute.routes.createSite, data, { title_id });
|
|
21373
21388
|
}
|