glitch-javascript-sdk 3.10.4 → 3.10.6

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/index.d.ts CHANGED
@@ -11556,6 +11556,28 @@ type HostingServiceRole = 'web' | 'api' | 'game' | 'realtime' | 'simulation' | '
11556
11556
  type HostingServiceVisibility = 'public' | 'internal' | 'none';
11557
11557
  type HostingCapacityModel = 'singleton' | 'replicated' | 'serverless';
11558
11558
  type HostingBillingProvider = 'direct' | 'microsoft_marketplace' | 'aws_marketplace';
11559
+ interface HostingDatabase {
11560
+ id: string;
11561
+ hosting_site_id: string;
11562
+ name: string;
11563
+ engine: HostingDatabaseEngine;
11564
+ plan: HostingDatabasePlan;
11565
+ status: 'awaiting_payment' | 'requested' | 'provisioning' | 'ready' | 'resizing' | 'restoring' | 'failed' | 'deleting' | 'deleted';
11566
+ deployment_model: 'shared' | 'dedicated' | 'serverless' | 'managed_cache';
11567
+ azure_region: string;
11568
+ included_storage_bytes: number;
11569
+ current_storage_bytes: number;
11570
+ auto_grow_enabled: boolean;
11571
+ backup_retention_days: number;
11572
+ high_availability_enabled: boolean;
11573
+ endpoint?: string | null;
11574
+ port?: number | null;
11575
+ binding_name: string;
11576
+ billing_status: 'awaiting_payment' | 'active' | 'past_due' | 'unpaid' | 'cancelled' | 'expired' | 'failed';
11577
+ billing_provider: HostingBillingProvider;
11578
+ billing_active: boolean;
11579
+ last_error?: string | null;
11580
+ }
11559
11581
  interface HostingDatabaseCredentials {
11560
11582
  database_id: string;
11561
11583
  name: string;
@@ -11698,6 +11720,26 @@ interface CreateHostingReleaseRequest {
11698
11720
  source_type: 'upload' | 'cli' | 'game_build';
11699
11721
  blob_path?: string;
11700
11722
  game_build_id?: string;
11723
+ /** Proven relative path in the finished artifact. Never guess index.html or package.json. */
11724
+ entry_point: string;
11725
+ }
11726
+ interface HostingCheckoutResult {
11727
+ database?: HostingDatabase;
11728
+ action?: string;
11729
+ checkout_url?: string | null;
11730
+ /** Stripe Embedded Checkout client secret for same-page card collection and 3DS. */
11731
+ checkout_client_secret?: string | null;
11732
+ checkout_mode?: 'embedded' | 'hosted' | null;
11733
+ checkout_session_id?: string | null;
11734
+ billing_provider?: HostingBillingProvider;
11735
+ message?: string;
11736
+ }
11737
+ interface HostingAiInstructionsRequest extends HostingServiceStackRequest {
11738
+ framework?: string;
11739
+ custom_domain?: string;
11740
+ databases?: Array<Pick<HostingDatabase, 'name' | 'engine' | 'plan'>>;
11741
+ version?: string;
11742
+ /** Candidate only; the generated instructions require proof from the finished artifact. */
11701
11743
  entry_point?: string;
11702
11744
  }
11703
11745
  interface CreateHostingDatabaseRequest {
@@ -11709,7 +11751,7 @@ interface CreateHostingDatabaseRequest {
11709
11751
  high_availability_enabled?: boolean;
11710
11752
  }
11711
11753
  /**
11712
- * Typed SDK for game website hosting, Azure database add-ons, domains, usage,
11754
+ * Typed SDK for game website hosting, managed database add-ons, domains, usage,
11713
11755
  * deployment instructions, and hosted-play attribution.
11714
11756
  */
11715
11757
  declare class Hosting {
@@ -11718,7 +11760,7 @@ declare class Hosting {
11718
11760
  static channelAnalytics<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
11719
11761
  /** Start or apply a bandwidth-based Hosting plan, separate from Store distribution. */
11720
11762
  static billingCheckout<T>(title_id: string, plan: HostingPlanKey): AxiosPromise<Response<T>>;
11721
- /** Confirm a paid Stripe Checkout session before provisioning its Azure resource. */
11763
+ /** Confirm a paid Stripe Checkout session before provisioning its add-on. */
11722
11764
  static confirmBillingCheckout<T>(title_id: string, checkout_session_id: string): AxiosPromise<Response<T>>;
11723
11765
  /** Resolve the one-hour purchase token passed to Glitch by Microsoft Marketplace. */
11724
11766
  static resolveMarketplacePurchase<T>(token: string): AxiosPromise<Response<T>>;
@@ -11735,7 +11777,7 @@ declare class Hosting {
11735
11777
  static createSite<T>(title_id: string, data: CreateHostingSiteRequest): AxiosPromise<Response<T>>;
11736
11778
  static updateSite<T>(title_id: string, site_id: string, data: Partial<CreateHostingSiteRequest> & Record<string, any>): AxiosPromise<Response<T>>;
11737
11779
  static createUploadUrl<T>(title_id: string, site_id: string): AxiosPromise<Response<T>>;
11738
- /** Upload directly to the short-lived Azure URL returned by createUploadUrl. */
11780
+ /** Upload directly to the short-lived signed URL returned by createUploadUrl. */
11739
11781
  static uploadBuild(uploadUrl: string, file: Blob, requiredHeaders?: Record<string, string>, onUploadProgress?: (event: AxiosProgressEvent) => void): AxiosPromise<void>;
11740
11782
  static releases<T>(title_id: string, site_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
11741
11783
  static createRelease<T>(title_id: string, site_id: string, data: CreateHostingReleaseRequest): AxiosPromise<Response<T>>;
@@ -11744,7 +11786,7 @@ declare class Hosting {
11744
11786
  static verifyDomain<T>(title_id: string, site_id: string, domain_id: string): AxiosPromise<Response<T>>;
11745
11787
  static checkDomain<T>(hostname: string): AxiosPromise<Response<T>>;
11746
11788
  static purchaseDomain<T>(title_id: string, site_id: string, data: Record<string, any>): AxiosPromise<Response<T>>;
11747
- static aiInstructions<T>(title_id: string, site_id: string, data?: Record<string, any>): AxiosPromise<Response<T>>;
11789
+ static aiInstructions<T>(title_id: string, site_id: string, data?: HostingAiInstructionsRequest): AxiosPromise<Response<T>>;
11748
11790
  static services<T = HostingService[]>(title_id: string, site_id: string): AxiosPromise<Response<T>>;
11749
11791
  /** Calculate the always-on floor without creating resources or charges. */
11750
11792
  static estimateServices<T = HostingServiceEstimate>(title_id: string, site_id: string, data: HostingServiceStackRequest): AxiosPromise<Response<T>>;
@@ -11757,7 +11799,7 @@ declare class Hosting {
11757
11799
  static startPlaySession<T>(data: Record<string, any>): AxiosPromise<Response<T>>;
11758
11800
  static heartbeatPlaySession<T>(session_id: string, sessionToken: string): AxiosPromise<Response<T>>;
11759
11801
  static databases<T>(title_id: string, site_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
11760
- static createDatabase<T>(title_id: string, site_id: string, data: CreateHostingDatabaseRequest): AxiosPromise<Response<T>>;
11802
+ static createDatabase<T = HostingCheckoutResult>(title_id: string, site_id: string, data: CreateHostingDatabaseRequest): AxiosPromise<Response<T>>;
11761
11803
  static database<T>(title_id: string, site_id: string, database_id: string): AxiosPromise<Response<T>>;
11762
11804
  /**
11763
11805
  * Reveal credentials to a signed-in business billing administrator after an
@@ -11765,7 +11807,7 @@ declare class Hosting {
11765
11807
  */
11766
11808
  static databaseCredentials<T = HostingDatabaseCredentials>(title_id: string, site_id: string, database_id: string, confirmation: string): AxiosPromise<Response<T>>;
11767
11809
  static updateDatabase<T>(title_id: string, site_id: string, database_id: string, data: Record<string, any>): AxiosPromise<Response<T>>;
11768
- static retryDatabase<T>(title_id: string, site_id: string, database_id: string): AxiosPromise<Response<T>>;
11810
+ static retryDatabase<T = HostingCheckoutResult>(title_id: string, site_id: string, database_id: string): AxiosPromise<Response<T>>;
11769
11811
  static deleteDatabase<T>(title_id: string, site_id: string, database_id: string, confirmation: string): AxiosPromise<Response<T>>;
11770
11812
  }
11771
11813
 
@@ -11774,7 +11816,10 @@ type GameDesignPlayMode = 'single-player' | 'cooperative' | 'competitive multipl
11774
11816
  type GameDesignSessionLength = '5–10 minute' | '15–30 minute' | '30–60 minute' | 'open-ended';
11775
11817
  interface GameDesignBlueprintInput {
11776
11818
  gameName?: string;
11777
- genre: GameDesignGenre;
11819
+ /** Primary deterministic fallback profile retained for older clients. */
11820
+ genre?: GameDesignGenre;
11821
+ /** Exact genre names selected from Utility.listGenres(). */
11822
+ genres?: string[];
11778
11823
  playMode: GameDesignPlayMode;
11779
11824
  sessionLength: GameDesignSessionLength;
11780
11825
  playerFantasy: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "3.10.4",
3
+ "version": "3.10.6",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -33,7 +33,10 @@ export type GameDesignSessionLength =
33
33
 
34
34
  export interface GameDesignBlueprintInput {
35
35
  gameName?: string;
36
- genre: GameDesignGenre;
36
+ /** Primary deterministic fallback profile retained for older clients. */
37
+ genre?: GameDesignGenre;
38
+ /** Exact genre names selected from Utility.listGenres(). */
39
+ genres?: string[];
37
40
  playMode: GameDesignPlayMode;
38
41
  sessionLength: GameDesignSessionLength;
39
42
  playerFantasy: string;
@@ -54,6 +54,9 @@ export interface HostingDomain {
54
54
  verification_record_name?: string | null;
55
55
  verification_record_value?: string | null;
56
56
  certificate_status?: string | null;
57
+ error_code?: string | null;
58
+ incident_id?: string | null;
59
+ last_error?: string | null;
57
60
  billing_status?: 'active' | 'past_due' | 'unpaid' | 'cancelled' | null;
58
61
  annual_price_cents?: number | null;
59
62
  auto_renew: boolean;
@@ -118,6 +121,7 @@ export interface HostingSite {
118
121
  status: 'draft' | 'provisioning' | 'live' | 'limited' | 'failed' | 'disabled';
119
122
  server_mode_enabled: boolean;
120
123
  azure_region?: string | null;
124
+ active_release_id?: string | null;
121
125
  active_release?: HostingRelease | null;
122
126
  domains?: HostingDomain[];
123
127
  databases?: HostingDatabase[];
@@ -248,6 +252,28 @@ export interface CreateHostingReleaseRequest {
248
252
  source_type: 'upload' | 'cli' | 'game_build';
249
253
  blob_path?: string;
250
254
  game_build_id?: string;
255
+ /** Proven relative path in the finished artifact. Never guess index.html or package.json. */
256
+ entry_point: string;
257
+ }
258
+
259
+ export interface HostingCheckoutResult {
260
+ database?: HostingDatabase;
261
+ action?: string;
262
+ checkout_url?: string | null;
263
+ /** Stripe Embedded Checkout client secret for same-page card collection and 3DS. */
264
+ checkout_client_secret?: string | null;
265
+ checkout_mode?: 'embedded' | 'hosted' | null;
266
+ checkout_session_id?: string | null;
267
+ billing_provider?: HostingBillingProvider;
268
+ message?: string;
269
+ }
270
+
271
+ export interface HostingAiInstructionsRequest extends HostingServiceStackRequest {
272
+ framework?: string;
273
+ custom_domain?: string;
274
+ databases?: Array<Pick<HostingDatabase, 'name' | 'engine' | 'plan'>>;
275
+ version?: string;
276
+ /** Candidate only; the generated instructions require proof from the finished artifact. */
251
277
  entry_point?: string;
252
278
  }
253
279
 
@@ -294,7 +320,7 @@ export interface HostingAwsMarketplaceSubscription {
294
320
  }
295
321
 
296
322
  /**
297
- * Typed SDK for game website hosting, Azure database add-ons, domains, usage,
323
+ * Typed SDK for game website hosting, managed database add-ons, domains, usage,
298
324
  * deployment instructions, and hosted-play attribution.
299
325
  */
300
326
  class Hosting {
@@ -315,7 +341,7 @@ class Hosting {
315
341
  return Requests.processRoute(HostingRoute.routes.billingCheckout, { plan }, { title_id });
316
342
  }
317
343
 
318
- /** Confirm a paid Stripe Checkout session before provisioning its Azure resource. */
344
+ /** Confirm a paid Stripe Checkout session before provisioning its add-on. */
319
345
  public static confirmBillingCheckout<T>(title_id: string, checkout_session_id: string): AxiosPromise<Response<T>> {
320
346
  return Requests.processRoute(HostingRoute.routes.confirmBillingCheckout, { checkout_session_id }, { title_id });
321
347
  }
@@ -362,7 +388,7 @@ class Hosting {
362
388
  return Requests.processRoute(HostingRoute.routes.uploadUrl, {}, { title_id, site_id });
363
389
  }
364
390
 
365
- /** Upload directly to the short-lived Azure URL returned by createUploadUrl. */
391
+ /** Upload directly to the short-lived signed URL returned by createUploadUrl. */
366
392
  public static uploadBuild(uploadUrl: string, file: Blob, requiredHeaders: Record<string, string> = {}, onUploadProgress?: (event: AxiosProgressEvent) => void): AxiosPromise<void> {
367
393
  return axios.put(uploadUrl, file, {
368
394
  headers: { 'x-ms-blob-type': 'BlockBlob', 'Content-Type': 'application/zip', ...requiredHeaders },
@@ -398,7 +424,7 @@ class Hosting {
398
424
  return Requests.processRoute(HostingRoute.routes.purchaseDomain, data, { title_id, site_id });
399
425
  }
400
426
 
401
- public static aiInstructions<T>(title_id: string, site_id: string, data: Record<string, any> = {}): AxiosPromise<Response<T>> {
427
+ public static aiInstructions<T>(title_id: string, site_id: string, data: HostingAiInstructionsRequest = {}): AxiosPromise<Response<T>> {
402
428
  return Requests.processRoute(HostingRoute.routes.aiInstructions, data, { title_id, site_id });
403
429
  }
404
430
 
@@ -452,7 +478,7 @@ class Hosting {
452
478
  return Requests.processRoute(HostingRoute.routes.databases, undefined, { title_id, site_id }, params);
453
479
  }
454
480
 
455
- public static createDatabase<T>(title_id: string, site_id: string, data: CreateHostingDatabaseRequest): AxiosPromise<Response<T>> {
481
+ public static createDatabase<T = HostingCheckoutResult>(title_id: string, site_id: string, data: CreateHostingDatabaseRequest): AxiosPromise<Response<T>> {
456
482
  return Requests.processRoute(HostingRoute.routes.createDatabase, data, { title_id, site_id });
457
483
  }
458
484
 
@@ -472,7 +498,7 @@ class Hosting {
472
498
  return Requests.processRoute(HostingRoute.routes.updateDatabase, data, { title_id, site_id, database_id });
473
499
  }
474
500
 
475
- public static retryDatabase<T>(title_id: string, site_id: string, database_id: string): AxiosPromise<Response<T>> {
501
+ public static retryDatabase<T = HostingCheckoutResult>(title_id: string, site_id: string, database_id: string): AxiosPromise<Response<T>> {
476
502
  return Requests.processRoute(HostingRoute.routes.retryDatabase, {}, { title_id, site_id, database_id });
477
503
  }
478
504