glitch-javascript-sdk 3.9.5 → 3.9.7
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 +15 -0
- package/dist/browser/hosting-runtime.js.map +1 -1
- package/dist/cjs/index.js +15 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Hosting.d.ts +24 -1
- package/dist/esm/api/Titles.d.ts +28 -5
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +34 -5
- package/package.json +1 -1
- package/src/api/Hosting.ts +34 -1
- package/src/api/Titles.ts +41 -4
- package/src/routes/HostingRoute.ts +3 -0
|
@@ -5,7 +5,7 @@ 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
|
+
export type HostingBillingProvider = 'direct' | 'microsoft_marketplace' | 'aws_marketplace';
|
|
9
9
|
export interface HostingAccount {
|
|
10
10
|
id: string;
|
|
11
11
|
community_id: string;
|
|
@@ -14,6 +14,7 @@ export interface HostingAccount {
|
|
|
14
14
|
status: string;
|
|
15
15
|
billing_provider: HostingBillingProvider;
|
|
16
16
|
microsoft_marketplace_subscription_id?: string | null;
|
|
17
|
+
aws_marketplace_subscription_id?: string | null;
|
|
17
18
|
included_bandwidth_bytes: number;
|
|
18
19
|
used_bandwidth_bytes: number;
|
|
19
20
|
remaining_bandwidth_bytes: number;
|
|
@@ -124,6 +125,22 @@ export interface HostingMarketplaceSubscription {
|
|
|
124
125
|
term_ends_at?: string | null;
|
|
125
126
|
activated_at?: string | null;
|
|
126
127
|
}
|
|
128
|
+
export interface HostingAwsMarketplaceSubscription {
|
|
129
|
+
id: string;
|
|
130
|
+
customer_aws_account_id?: string | null;
|
|
131
|
+
license_arn: string;
|
|
132
|
+
product_code: string;
|
|
133
|
+
plan_dimension?: string | null;
|
|
134
|
+
plan_key?: Exclude<HostingPlanKey, 'free'> | null;
|
|
135
|
+
status: 'PendingRegistration' | 'PendingEntitlement' | 'Subscribed' | 'Unsubscribed';
|
|
136
|
+
entitlement_value: number;
|
|
137
|
+
entitlement_expires_at?: string | null;
|
|
138
|
+
community_id?: string | null;
|
|
139
|
+
hosting_account_id?: string | null;
|
|
140
|
+
activated_at?: string | null;
|
|
141
|
+
last_synced_at?: string | null;
|
|
142
|
+
manage_url: string;
|
|
143
|
+
}
|
|
127
144
|
/**
|
|
128
145
|
* Typed SDK for game website hosting, Azure database add-ons, domains, usage,
|
|
129
146
|
* deployment instructions, and hosted-play attribution.
|
|
@@ -142,6 +159,12 @@ declare class Hosting {
|
|
|
142
159
|
static activateMarketplaceSubscription<T>(subscription_id: string, community_id: string): AxiosPromise<Response<T>>;
|
|
143
160
|
/** Retrieve safe Microsoft Marketplace entitlement and lifecycle status. */
|
|
144
161
|
static marketplaceSubscription<T>(subscription_id: string): AxiosPromise<Response<T>>;
|
|
162
|
+
/** Claim the one-time Glitch code created after AWS ResolveCustomer succeeds. */
|
|
163
|
+
static resolveAwsMarketplacePurchase<T>(activation_code: string): AxiosPromise<Response<T>>;
|
|
164
|
+
/** Connect a paid AWS Marketplace contract to one Glitch business account. */
|
|
165
|
+
static activateAwsMarketplaceSubscription<T>(subscription_id: string, community_id: string): AxiosPromise<Response<T>>;
|
|
166
|
+
/** Refresh and retrieve the safe AWS Marketplace entitlement state. */
|
|
167
|
+
static awsMarketplaceSubscription<T>(subscription_id: string): AxiosPromise<Response<T>>;
|
|
145
168
|
static createSite<T>(title_id: string, data: CreateHostingSiteRequest): AxiosPromise<Response<T>>;
|
|
146
169
|
static updateSite<T>(title_id: string, site_id: string, data: Partial<CreateHostingSiteRequest> & Record<string, any>): AxiosPromise<Response<T>>;
|
|
147
170
|
static createUploadUrl<T>(title_id: string, site_id: string): AxiosPromise<Response<T>>;
|
package/dist/esm/api/Titles.d.ts
CHANGED
|
@@ -4,6 +4,31 @@ export type GameReviewRecommendation = 'recommended' | 'not_recommended' | 'neut
|
|
|
4
4
|
export type GameReviewSentiment = 'positive' | 'mixed' | 'negative';
|
|
5
5
|
export type GameReviewVoteType = 'helpful' | 'funny' | 'detailed' | 'not_helpful';
|
|
6
6
|
export type GameReviewReportReason = 'abuse' | 'spam' | 'off_topic' | 'manipulation' | 'hate' | 'personal_info' | 'other';
|
|
7
|
+
export type TitleTokenPurpose = 'install' | 'deploy' | 'hosting';
|
|
8
|
+
export type TitleTokenAbility = 'deployments:*' | 'deployments:create' | 'deployments:read' | 'deployments:activate' | 'hosting:*' | 'hosting:read' | 'hosting:deploy' | 'hosting:promote';
|
|
9
|
+
export interface CreateTitleTokenRequest {
|
|
10
|
+
expires_at?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
purpose?: TitleTokenPurpose;
|
|
13
|
+
abilities?: TitleTokenAbility[];
|
|
14
|
+
}
|
|
15
|
+
export interface TitleToken {
|
|
16
|
+
id: string;
|
|
17
|
+
title_id: string;
|
|
18
|
+
name?: string | null;
|
|
19
|
+
purpose: TitleTokenPurpose;
|
|
20
|
+
token_prefix: string;
|
|
21
|
+
abilities: TitleTokenAbility[];
|
|
22
|
+
expires_at?: string | null;
|
|
23
|
+
revoked: boolean;
|
|
24
|
+
last_used_at?: string | null;
|
|
25
|
+
created_at?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CreatedTitleToken {
|
|
28
|
+
/** Full secret value. Returned once and never retrievable again. */
|
|
29
|
+
full_token: string;
|
|
30
|
+
token: TitleToken;
|
|
31
|
+
}
|
|
7
32
|
export interface GameReviewRatings {
|
|
8
33
|
gameplay?: GameReviewSentiment;
|
|
9
34
|
performance?: GameReviewSentiment;
|
|
@@ -212,17 +237,15 @@ declare class Titles {
|
|
|
212
237
|
* Create a new API token for a title.
|
|
213
238
|
* Returns { full_token: string, token: TitleToken }.
|
|
214
239
|
*/
|
|
215
|
-
static createTitleToken<T>(title_id: string, data?:
|
|
216
|
-
expires_at?: string;
|
|
217
|
-
}): AxiosPromise<Response<T>>;
|
|
240
|
+
static createTitleToken<T = CreatedTitleToken>(title_id: string, data?: CreateTitleTokenRequest): AxiosPromise<Response<T>>;
|
|
218
241
|
/**
|
|
219
242
|
* List all tokens for a title.
|
|
220
243
|
*/
|
|
221
|
-
static listTitleTokens<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
244
|
+
static listTitleTokens<T = TitleToken[]>(title_id: string): AxiosPromise<Response<T>>;
|
|
222
245
|
/**
|
|
223
246
|
* Revoke a specific token by ID.
|
|
224
247
|
*/
|
|
225
|
-
static revokeTitleToken<T>(title_id: string, token_id: string): AxiosPromise<Response<T>>;
|
|
248
|
+
static revokeTitleToken<T = TitleToken>(title_id: string, token_id: string): AxiosPromise<Response<T>>;
|
|
226
249
|
/**
|
|
227
250
|
* Search for Titles using Meilisearch or fallback based on the query and filters.
|
|
228
251
|
*
|
package/dist/esm/index.js
CHANGED
|
@@ -21327,6 +21327,9 @@ HostingRoute.routes = {
|
|
|
21327
21327
|
resolveMarketplacePurchase: { url: '/hosting/marketplace/resolve', method: HTTP_METHODS.POST },
|
|
21328
21328
|
activateMarketplaceSubscription: { url: '/hosting/marketplace/subscriptions/{subscription_id}/activate', method: HTTP_METHODS.POST },
|
|
21329
21329
|
marketplaceSubscription: { url: '/hosting/marketplace/subscriptions/{subscription_id}', method: HTTP_METHODS.GET },
|
|
21330
|
+
resolveAwsMarketplacePurchase: { url: '/hosting/aws-marketplace/resolve', method: HTTP_METHODS.POST },
|
|
21331
|
+
activateAwsMarketplaceSubscription: { url: '/hosting/aws-marketplace/subscriptions/{subscription_id}/activate', method: HTTP_METHODS.POST },
|
|
21332
|
+
awsMarketplaceSubscription: { url: '/hosting/aws-marketplace/subscriptions/{subscription_id}', method: HTTP_METHODS.GET },
|
|
21330
21333
|
createSite: { url: '/titles/{title_id}/hosting/sites', method: HTTP_METHODS.POST },
|
|
21331
21334
|
updateSite: { url: '/titles/{title_id}/hosting/sites/{site_id}', method: HTTP_METHODS.PUT },
|
|
21332
21335
|
uploadUrl: { url: '/titles/{title_id}/hosting/sites/{site_id}/upload-url', method: HTTP_METHODS.POST },
|
|
@@ -21383,6 +21386,18 @@ class Hosting {
|
|
|
21383
21386
|
static marketplaceSubscription(subscription_id) {
|
|
21384
21387
|
return Requests.processRoute(HostingRoute.routes.marketplaceSubscription, undefined, { subscription_id });
|
|
21385
21388
|
}
|
|
21389
|
+
/** Claim the one-time Glitch code created after AWS ResolveCustomer succeeds. */
|
|
21390
|
+
static resolveAwsMarketplacePurchase(activation_code) {
|
|
21391
|
+
return Requests.processRoute(HostingRoute.routes.resolveAwsMarketplacePurchase, { activation_code });
|
|
21392
|
+
}
|
|
21393
|
+
/** Connect a paid AWS Marketplace contract to one Glitch business account. */
|
|
21394
|
+
static activateAwsMarketplaceSubscription(subscription_id, community_id) {
|
|
21395
|
+
return Requests.processRoute(HostingRoute.routes.activateAwsMarketplaceSubscription, { community_id }, { subscription_id });
|
|
21396
|
+
}
|
|
21397
|
+
/** Refresh and retrieve the safe AWS Marketplace entitlement state. */
|
|
21398
|
+
static awsMarketplaceSubscription(subscription_id) {
|
|
21399
|
+
return Requests.processRoute(HostingRoute.routes.awsMarketplaceSubscription, undefined, { subscription_id });
|
|
21400
|
+
}
|
|
21386
21401
|
static createSite(title_id, data) {
|
|
21387
21402
|
return Requests.processRoute(HostingRoute.routes.createSite, data, { title_id });
|
|
21388
21403
|
}
|