glitch-javascript-sdk 4.0.1 → 4.2.0

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.
@@ -0,0 +1,7 @@
1
+ import Route from './interface';
2
+ declare class PreordersRoute {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default PreordersRoute;
package/dist/index.d.ts CHANGED
@@ -4103,6 +4103,50 @@ declare class SocialPosts {
4103
4103
  }): AxiosPromise<Response<T>>;
4104
4104
  }
4105
4105
 
4106
+ type AegisLicenseType = 'premium' | 'rental' | 'subscription' | 'sponsored' | 'admin' | 'trial' | 'free' | 'demo' | 'playtest' | 'none';
4107
+ interface AegisLicenseDetail {
4108
+ id: string | null;
4109
+ type: AegisLicenseType;
4110
+ source: string | null;
4111
+ status: string;
4112
+ acquired_at: string | null;
4113
+ purchased_at: string | null;
4114
+ expires_at: string | null;
4115
+ is_permanent: boolean;
4116
+ price_paid: {
4117
+ amount: string;
4118
+ currency: string;
4119
+ } | null;
4120
+ }
4121
+ interface AegisInstallValidation {
4122
+ valid: boolean;
4123
+ reason?: string;
4124
+ code?: string;
4125
+ user_id?: string | null;
4126
+ user_name?: string;
4127
+ /** Kept for backward compatibility; inspect license.type for the exact category. */
4128
+ license_type?: string;
4129
+ license?: AegisLicenseDetail;
4130
+ access?: {
4131
+ premium_purchase_required: boolean;
4132
+ subscription_alone_sufficient: boolean;
4133
+ };
4134
+ build_type?: 'production' | 'demo' | 'playtest';
4135
+ has_full_access?: boolean;
4136
+ non_revenue_build?: boolean;
4137
+ trial_time_remaining?: number | null;
4138
+ rental_time_remaining?: number | null;
4139
+ server_time?: string;
4140
+ }
4141
+ interface GameMonetizationSettings {
4142
+ is_premium: boolean;
4143
+ premium_price: string | number | null;
4144
+ is_rental: boolean;
4145
+ rental_price: string | number | null;
4146
+ rental_duration_hours: number;
4147
+ is_subscription_eligible: boolean;
4148
+ premium_purchase_required_for_full_game: boolean;
4149
+ }
4106
4150
  type GameReviewRecommendation = 'recommended' | 'not_recommended' | 'neutral';
4107
4151
  type GameReviewSentiment = 'positive' | 'mixed' | 'negative';
4108
4152
  type GameReviewVoteType = 'helpful' | 'funny' | 'detailed' | 'not_helpful';
@@ -4193,6 +4237,13 @@ declare class Titles {
4193
4237
  * @returns promise
4194
4238
  */
4195
4239
  static update<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
4240
+ /** View public title monetization settings. For mutation use authenticated title admin. */
4241
+ static getGameMonetization<T = GameMonetizationSettings>(title_id: string): AxiosPromise<Response<T>>;
4242
+ /**
4243
+ * Update publisher monetization including premium_purchase_required_for_full_game.
4244
+ * Requires a title administrator JWT; backend validates premium/subscription/rental compatibility.
4245
+ */
4246
+ static updateGameMonetization<T = GameMonetizationSettings>(title_id: string, settings: Partial<GameMonetizationSettings>): AxiosPromise<Response<T>>;
4196
4247
  /**
4197
4248
  * Retrieve the information for a single title.
4198
4249
  *
@@ -4688,9 +4739,13 @@ declare class Titles {
4688
4739
  *
4689
4740
  * @param title_id The UUID of the game title.
4690
4741
  * @param install_id The UUID of the specific install/session.
4691
- * @returns AxiosPromise containing { valid: boolean, user_name: string, license_type: string }
4742
+ * @returns Access result with a backward-compatible license_type and exact license
4743
+ * metadata: type, status, source, acquired_at, purchased_at, expires_at and
4744
+ * verified price_paid (null when no authoritative historical price exists).
4745
+ * Production requests may return PREMIUM_PURCHASE_REQUIRED (403).
4746
+ * The caller must block gameplay when valid is false.
4692
4747
  */
4693
- static validateInstall<T>(title_id: string, install_id: string): AxiosPromise<Response<T>>;
4748
+ static validateInstall<T = AegisInstallValidation>(title_id: string, install_id: string): AxiosPromise<Response<T>>;
4694
4749
  /**
4695
4750
  * List all builds/deployments for a specific title.
4696
4751
  * @param title_id The UUID of the title.
@@ -4937,6 +4992,76 @@ declare class Titles {
4937
4992
  linked_patch_note_id?: string;
4938
4993
  issue_marked_fixed?: boolean;
4939
4994
  }): AxiosPromise<Response<T>>;
4995
+ /**
4996
+ * Steam Financial API connection and sync status for a title: masked key, partner,
4997
+ * last sync times, stored sales/wishlist date ranges and pending dates.
4998
+ */
4999
+ static steamFinancialsStatus<T>(title_id: string): AxiosPromise<Response<T>>;
5000
+ /**
5001
+ * Verify a Steamworks Financial API Group key with Steam and store it (encrypted) on the title.
5002
+ * Queues a full sync unless `sync: false` is passed.
5003
+ *
5004
+ * @param data { api_key: string, sync?: boolean }
5005
+ */
5006
+ static steamFinancialsConnect<T>(title_id: string, data: {
5007
+ api_key: string;
5008
+ sync?: boolean;
5009
+ }): AxiosPromise<Response<T>>;
5010
+ /** Check a key (or the stored key when api_key is omitted) with Steam without saving anything. */
5011
+ static steamFinancialsTestKey<T>(title_id: string, data?: {
5012
+ api_key?: string;
5013
+ }): AxiosPromise<Response<T>>;
5014
+ /** Remove the stored key. Pass { purge_data: true } to also delete synced Steam financial data. */
5015
+ static steamFinancialsDisconnect<T>(title_id: string, params?: {
5016
+ purge_data?: boolean;
5017
+ }): AxiosPromise<Response<T>>;
5018
+ /**
5019
+ * Sync sales and/or wishlists from Steam. Queued by default; pass `wait: true` for a short inline run.
5020
+ *
5021
+ * @param data { datasets?: ('sales'|'wishlists')[], full?: boolean, wait?: boolean, max_dates?: number, max_days?: number, from?: string, to?: string, include_view_grants?: boolean }
5022
+ */
5023
+ static steamFinancialsSync<T>(title_id: string, data?: Record<string, any>): AxiosPromise<Response<T>>;
5024
+ /**
5025
+ * Report bundle built from synced Steam data: summary, sales over time and by country, region,
5026
+ * product, platform, sale type, discount and price point, key activations, revenue-share tiers,
5027
+ * wishlists over time and by country, region, language and platform, and the wishlist-to-sales funnel.
5028
+ *
5029
+ * @param params { from?: 'YYYY-MM-DD', to?: 'YYYY-MM-DD', report_keys?: string (comma separated), app_scope?: 'title'|'partner', app_id?: number, limit?: number }
5030
+ */
5031
+ static steamFinancialsReports<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5032
+ /**
5033
+ * Paginated Steam sales line items (every GetDetailedSales field) with product, country,
5034
+ * discount and key-request names attached.
5035
+ *
5036
+ * @param params { from?, to?, app_scope?, app_id?, page?, per_page?, country_code?, platform?, line_item_type?, package_sale_type?, currency?, packageid?, bundleid?, key_request_id?, combined_discount_id? }
5037
+ */
5038
+ static steamFinancialsSales<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5039
+ /**
5040
+ * Daily Steam wishlist rows; pass dimension 'country' or 'language' for the breakdown rows.
5041
+ *
5042
+ * @param params { from?, to?, app_id?, dimension?: 'country'|'language' }
5043
+ */
5044
+ static steamFinancialsWishlists<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5045
+ /** Names Steam returned with sales: package, app, bundle, discount, combined_discount, key_request, game_item, country, partner. */
5046
+ static steamFinancialsLookups<T>(title_id: string, params?: {
5047
+ kind?: string;
5048
+ }): AxiosPromise<Response<T>>;
5049
+ /** Live GetChangedDatesForPartner (nothing stored). */
5050
+ static steamFinancialsLiveChangedDates<T>(title_id: string, params?: {
5051
+ highwatermark?: string;
5052
+ include_view_grants?: boolean;
5053
+ }): AxiosPromise<Response<T>>;
5054
+ /** Live GetDetailedSales for one date and page (nothing stored). */
5055
+ static steamFinancialsLiveDetailedSales<T>(title_id: string, params: {
5056
+ date: string;
5057
+ highwatermark_id?: string;
5058
+ include_view_grants?: boolean;
5059
+ }): AxiosPromise<Response<T>>;
5060
+ /** Live GetAppWishlistReporting for one date (nothing stored). */
5061
+ static steamFinancialsLiveWishlist<T>(title_id: string, params: {
5062
+ date: string;
5063
+ app_id?: number;
5064
+ }): AxiosPromise<Response<T>>;
4940
5065
  }
4941
5066
 
4942
5067
  declare class Campaigns {
@@ -5546,6 +5671,11 @@ declare class Campaigns {
5546
5671
  * @returns promise
5547
5672
  */
5548
5673
  static sourcingGetSimilarIgdbGames<T>(campaign_id: string, params: Record<string, any>): AxiosPromise<Response<T>>;
5674
+ /**
5675
+ * Discover recently streamed look-alikes for Easy Create (minimum five).
5676
+ * Never treat older Twitch activity as currently streaming.
5677
+ */
5678
+ static sourcingGetActiveStreamLookalikes<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5549
5679
  /**
5550
5680
  * Find content creators for selected games. This does not save them to the database.
5551
5681
  * @param campaign_id The UUID of the campaign.
@@ -7787,7 +7917,9 @@ declare class Scheduler {
7787
7917
  */
7788
7918
  static listCampaignFundingInstruments<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
7789
7919
  /**
7790
- * List Google Ads conversion actions available to a scheduler account.
7920
+ * List provider conversion actions (Google), Pixel sources (Meta, TikTok, Reddit), or X website-event tags
7921
+ * for the scheduler's connected advertising account. The Reddit result
7922
+ * does not establish delivery of conversion events.
7791
7923
  * GET /schedulers/{scheduler_id}/conversion-actions
7792
7924
  */
7793
7925
  static listConversionActions<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
@@ -10721,6 +10853,14 @@ declare class Mcp {
10721
10853
  static titleContext<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
10722
10854
  /** Check subscription, trial, plan, and credit state for a title. */
10723
10855
  static billing<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
10856
+ /** Discover title-scoped social operations for ordinary and eligible Agent subscriptions. */
10857
+ static socialCapabilities<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
10858
+ static socialOperation<T>(title_id: string, operation: string, args: Record<string, unknown>, confirm?: boolean, params?: Record<string, any>): AxiosPromise<Response<T>>;
10859
+ /** Discover full advertising and conversion tracking operations. */
10860
+ static marketingCapabilities<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
10861
+ /** Run a title-scoped advertising or conversion operation; mutations require confirmation. */
10862
+ static marketingOperation<T>(title_id: string, operation: string, args: Record<string, unknown>, confirm?: boolean, params?: Record<string, any>): AxiosPromise<Response<T>>;
10863
+ static influencerCampaignOperation<T>(title_id: string, operation: string, fields?: Record<string, unknown>, campaign_id?: string, confirm?: boolean, params?: Record<string, any>): AxiosPromise<Response<T>>;
10724
10864
  /** Start a paid Glitch Agent run for a title. */
10725
10865
  static startRun<T>(title_id: string, data?: McpStartRunRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
10726
10866
  /** Fetch a durable run with status, actions, guidance, events, files, and report. */
@@ -12979,6 +13119,243 @@ declare class Microtransactions {
12979
13119
  private static call;
12980
13120
  }
12981
13121
 
13122
+ type PreorderFulfillmentType = 'glitch_license' | 'platform_key';
13123
+ type PreorderOfferStatus = 'draft' | 'active' | 'paused' | 'ended' | 'archived';
13124
+ type PreorderDerivedState = 'draft' | 'available' | 'scheduled' | 'sold_out' | 'paused' | 'ended' | 'released' | 'archived';
13125
+ type PreorderPaymentStatus = 'created' | 'requires_action' | 'processing' | 'paid' | 'failed' | 'canceled' | 'refunded' | 'disputed' | 'unknown';
13126
+ type PreorderFulfillmentStatus = 'waiting_for_release' | 'ready' | 'processing' | 'fulfilled' | 'blocked_missing_build' | 'blocked_missing_key' | 'canceled' | 'failed';
13127
+ interface PreorderRequestOptions extends Pick<AxiosRequestConfig, 'signal' | 'timeout' | 'headers'> {
13128
+ }
13129
+ interface PreorderPrice {
13130
+ country: string;
13131
+ currency: string;
13132
+ amount_minor: number;
13133
+ }
13134
+ interface PreorderInventory {
13135
+ available: number;
13136
+ reserved: number;
13137
+ delivered: number;
13138
+ retired: number;
13139
+ total: number;
13140
+ }
13141
+ interface PreorderOfferInput {
13142
+ sku: string;
13143
+ platform_code: string;
13144
+ platform_label: string;
13145
+ fulfillment_type: PreorderFulfillmentType;
13146
+ status?: PreorderOfferStatus;
13147
+ sales_start_at?: string | null;
13148
+ sales_end_at?: string | null;
13149
+ release_at: string;
13150
+ limit_total?: number | null;
13151
+ max_per_user?: number;
13152
+ custom_message?: string | null;
13153
+ post_purchase_url?: string | null;
13154
+ redeem_url?: string | null;
13155
+ prices: PreorderPrice[];
13156
+ }
13157
+ interface PreorderOffer extends Omit<PreorderOfferInput, 'status'> {
13158
+ id: string;
13159
+ title_id: string;
13160
+ status: PreorderOfferStatus;
13161
+ state: PreorderDerivedState;
13162
+ sold: number;
13163
+ reserved_or_paid: number;
13164
+ remaining: number | null;
13165
+ revision: number;
13166
+ inventory?: PreorderInventory;
13167
+ owned_count?: number;
13168
+ }
13169
+ interface PreorderSettings {
13170
+ enabled: boolean;
13171
+ hosted_checkout_enabled: boolean;
13172
+ timezone: string;
13173
+ readiness?: PreorderReadiness;
13174
+ }
13175
+ interface PreorderCatalog {
13176
+ enabled: boolean;
13177
+ timezone?: string;
13178
+ offers: PreorderOffer[];
13179
+ }
13180
+ interface PreorderPurchaseInput {
13181
+ country?: string;
13182
+ currency?: string;
13183
+ idempotency_key: string;
13184
+ payment_method_id?: string;
13185
+ payment_intent_id?: string;
13186
+ }
13187
+ interface HostedPreorderCatalog extends PreorderCatalog {
13188
+ hosted_checkout_enabled: boolean;
13189
+ title: {
13190
+ id: string;
13191
+ name: string;
13192
+ };
13193
+ hosting: {
13194
+ site_id: string;
13195
+ hostname: string;
13196
+ origin: string;
13197
+ };
13198
+ checkout_origin: string;
13199
+ embed_script_url: string;
13200
+ version: number;
13201
+ }
13202
+ interface HostedPreorderSessionInput {
13203
+ offer_id: string;
13204
+ return_origin: string;
13205
+ nonce: string;
13206
+ country?: string;
13207
+ currency?: string;
13208
+ }
13209
+ interface HostedPreorderRestoreInput {
13210
+ return_origin: string;
13211
+ nonce: string;
13212
+ country?: string;
13213
+ currency?: string;
13214
+ }
13215
+ interface HostedPreorderPaymentState {
13216
+ status: string;
13217
+ requires_action?: boolean;
13218
+ client_secret?: string | null;
13219
+ payment_intent_id?: string | null;
13220
+ retryable_same_request?: boolean;
13221
+ }
13222
+ interface HostedPreorderSession {
13223
+ id: string;
13224
+ checkout_session_id: string;
13225
+ intent: 'preorder' | 'preorder_restore';
13226
+ title: {
13227
+ id: string;
13228
+ name: string;
13229
+ };
13230
+ hosting_site_id: string;
13231
+ offer?: PreorderOffer | null;
13232
+ country: string;
13233
+ currency: string;
13234
+ return_origin: string;
13235
+ nonce: string;
13236
+ expires_at: string;
13237
+ authenticated: boolean;
13238
+ status: string;
13239
+ order?: PreorderOrder | null;
13240
+ orders?: PreorderOrder[];
13241
+ payment?: HostedPreorderPaymentState | null;
13242
+ session_token?: string;
13243
+ hosted_url?: string;
13244
+ }
13245
+ interface PreorderOrder {
13246
+ id: string;
13247
+ title_id: string;
13248
+ offer_id: string;
13249
+ user_id?: string;
13250
+ platform_code: string;
13251
+ platform_label: string;
13252
+ fulfillment_type: PreorderFulfillmentType;
13253
+ payment_status: PreorderPaymentStatus;
13254
+ fulfillment_status: PreorderFulfillmentStatus;
13255
+ currency: string;
13256
+ subtotal_minor: number;
13257
+ tax_minor: number;
13258
+ total_minor: number;
13259
+ promised_release_at: string;
13260
+ current_release_at: string;
13261
+ paid_at?: string;
13262
+ fulfilled_at?: string;
13263
+ custom_message?: string;
13264
+ post_purchase_url?: string;
13265
+ redeem_url?: string;
13266
+ platform_key?: string;
13267
+ key_masked_suffix?: string;
13268
+ purchase_email?: string;
13269
+ provider_reference?: string;
13270
+ commission_minor?: number;
13271
+ developer_share_minor?: number;
13272
+ requires_action?: boolean;
13273
+ client_secret?: string;
13274
+ payment_intent_id?: string;
13275
+ }
13276
+ interface PreorderReadinessIssue {
13277
+ offer_id: string;
13278
+ code: string;
13279
+ [key: string]: unknown;
13280
+ }
13281
+ interface PreorderReadiness {
13282
+ enabled: boolean;
13283
+ ready: boolean;
13284
+ blockers: PreorderReadinessIssue[];
13285
+ warnings: PreorderReadinessIssue[];
13286
+ }
13287
+ interface PreorderAdminOrderFilters {
13288
+ offer_id?: string;
13289
+ payment_status?: string;
13290
+ fulfillment_status?: string;
13291
+ per_page?: number;
13292
+ page?: number;
13293
+ }
13294
+ type PreorderAdminOrderAction = 'refund' | 'reconcile' | 'fulfill' | 'resend_receipt' | 'resend_access';
13295
+ declare class Preorders {
13296
+ private static hostedOptions;
13297
+ static hostedCatalog(options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderCatalog>>;
13298
+ static createHostedSession(data: HostedPreorderSessionInput, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
13299
+ static createHostedRestoreSession(data: HostedPreorderRestoreInput, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
13300
+ static hostedSession(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
13301
+ static hostedMine(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
13302
+ static authenticateHostedSession(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
13303
+ static checkoutHostedSession(title_id: string, session_id: string, checkoutToken: string, data: {
13304
+ accept_terms: boolean;
13305
+ payment_method_id?: string;
13306
+ payment_intent_id?: string;
13307
+ }, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
13308
+ static reconcileHostedSession(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
13309
+ static retryHostedSession(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
13310
+ static refundHostedOrder(title_id: string, session_id: string, checkoutToken: string, order_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>>;
13311
+ static resendHostedAccess(title_id: string, session_id: string, checkoutToken: string, order_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<{
13312
+ resent: boolean;
13313
+ }>>;
13314
+ static catalog(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderCatalog>>;
13315
+ static purchase(title_id: string, offer_id: string, data: PreorderPurchaseInput, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOrder>>;
13316
+ static myOrders(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<{
13317
+ orders: PreorderOrder[];
13318
+ }>>;
13319
+ static order(title_id: string, order_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOrder>>;
13320
+ static refundMine(title_id: string, order_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOrder>>;
13321
+ static resendMine(title_id: string, order_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<{
13322
+ resent: boolean;
13323
+ }>>;
13324
+ static settings(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderSettings>>;
13325
+ static updateSettings(title_id: string, data: Partial<Pick<PreorderSettings, 'enabled' | 'hosted_checkout_enabled' | 'timezone'>>, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderSettings>>;
13326
+ static offers(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<{
13327
+ offers: PreorderOffer[];
13328
+ }>>;
13329
+ static offer(title_id: string, offer_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOffer>>;
13330
+ static createOffer(title_id: string, data: PreorderOfferInput, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOffer>>;
13331
+ static updateOffer(title_id: string, offer_id: string, data: PreorderOfferInput, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOffer>>;
13332
+ static activateOffer(title_id: string, offer_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOffer>>;
13333
+ static pauseOffer(title_id: string, offer_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOffer>>;
13334
+ static archiveOffer(title_id: string, offer_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOffer>>;
13335
+ static inventory(title_id: string, offer_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderInventory>>;
13336
+ static importKeys(title_id: string, offer_id: string, keys: string[], options?: PreorderRequestOptions): AxiosPromise<Response<{
13337
+ inserted: number;
13338
+ duplicate_in_upload: number;
13339
+ duplicate_existing: number;
13340
+ invalid: number;
13341
+ inventory: PreorderInventory;
13342
+ }>>;
13343
+ static importKeyFile<T>(title_id: string, offer_id: string, file: File | Blob): AxiosPromise<Response<T>>;
13344
+ static retireKey(title_id: string, offer_id: string, key_id: string, reason: string, options?: PreorderRequestOptions): AxiosPromise<Response<{
13345
+ id: string;
13346
+ status: string;
13347
+ masked_suffix: string;
13348
+ }>>;
13349
+ static adminOrders(title_id: string, filters?: PreorderAdminOrderFilters, options?: PreorderRequestOptions): AxiosPromise<Response<{
13350
+ orders: PreorderOrder[];
13351
+ pagination: Record<string, number>;
13352
+ }>>;
13353
+ static readiness(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderReadiness>>;
13354
+ static adminOrderAction(title_id: string, order_id: string, action: PreorderAdminOrderAction, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOrder>>;
13355
+ static mcpCapabilities<T = unknown>(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<T>>;
13356
+ static mcpOperation<T = unknown>(title_id: string, operation: string, argumentsData?: Record<string, unknown>, options?: PreorderRequestOptions): AxiosPromise<Response<T>>;
13357
+ }
13358
+
12982
13359
  /** A one-time notification, never a receipt or authorization to grant goods. */
12983
13360
  interface MicrotransactionPurchaseMessage {
12984
13361
  type: 'glitch.microtransaction.updated';
@@ -13510,6 +13887,7 @@ declare class Glitch {
13510
13887
  Hosting: typeof Hosting;
13511
13888
  GameDesign: typeof GameDesign;
13512
13889
  Microtransactions: typeof Microtransactions;
13890
+ Preorders: typeof Preorders;
13513
13891
  };
13514
13892
  static util: {
13515
13893
  Requests: typeof Requests;
@@ -13599,4 +13977,4 @@ declare class Glitch {
13599
13977
  };
13600
13978
  }
13601
13979
 
13602
- export { type FestivalApplicationInput, type FestivalApplicationState, type FestivalConversation, type FestivalMediaUpload, type FestivalNetworkingFilters, type FestivalNetworkingProfile, type FestivalNetworkingResponse, type FestivalNetworkingSettings, type FestivalPost, type FestivalPostInput, type FestivalPostKind, type FestivalPostState, type FestivalPreferences, type FestivalReportInput, type FestivalRequestOptions, type FestivalWorkType, type MicrotransactionAbility, type MicrotransactionBranding, type MicrotransactionBridge, type MicrotransactionBridgeOptions, type MicrotransactionCapabilities, type MicrotransactionCatalog, type MicrotransactionCatalogFilter, type MicrotransactionCheckoutInput, type MicrotransactionCheckoutResult, type MicrotransactionCheckoutSession, type MicrotransactionCheckoutSessionInput, type MicrotransactionConsumeInput, type MicrotransactionCreatedCheckoutSession, type MicrotransactionCurrency, type MicrotransactionDelivery, type MicrotransactionDeliveryListFilters, type MicrotransactionDeliveryResult, type MicrotransactionDeliverySettings, type MicrotransactionDeliverySettingsInput, type MicrotransactionDeliveryStatus, type MicrotransactionEarnings, type MicrotransactionEntitlement, type MicrotransactionEnvironment, type MicrotransactionEnvironmentFilter, type MicrotransactionError, type MicrotransactionErrorCode, type MicrotransactionFramePolicy, type MicrotransactionFulfillmentStatus, type MicrotransactionGrant, type MicrotransactionGrantUsage, type MicrotransactionGrantUsageStatus, type MicrotransactionHandoff, type MicrotransactionHandoffClaim, type MicrotransactionHandoffClaimInput, type MicrotransactionLegacyConfirmation, type MicrotransactionManagementListFilters, type MicrotransactionMedia, type MicrotransactionMyPurchases, type MicrotransactionMyPurchasesFilters, type MicrotransactionOperation, type MicrotransactionOperationCapability, type MicrotransactionOrder, type MicrotransactionOrderDetail, type MicrotransactionOrderListFilters, type MicrotransactionOverlay, type MicrotransactionOverlayOptions, type MicrotransactionPaymentStatus, type MicrotransactionPayout, type MicrotransactionPayoutListFilters, type MicrotransactionPayoutStatus, type MicrotransactionPlayerPurchase, type MicrotransactionPrice, type MicrotransactionProduct, type MicrotransactionProductInput, type MicrotransactionProductListFilters, type MicrotransactionProductStatus, type MicrotransactionProductType, type MicrotransactionProvider, type MicrotransactionProviderConfiguration, type MicrotransactionProviderInput, type MicrotransactionProviderName, type MicrotransactionProviderOnboarding, type MicrotransactionProviderOnboardingInput, type MicrotransactionProviderSku, type MicrotransactionPurchaseInput, type MicrotransactionPurchaseMessage, type MicrotransactionPurchasePagination, type MicrotransactionQuote, type MicrotransactionReadiness, type MicrotransactionReadyMessage, type MicrotransactionRefund, type MicrotransactionRefundInput, type MicrotransactionRefundListFilters, type MicrotransactionRefundRecord, type MicrotransactionRefundRequest, type MicrotransactionRefundStatus, type MicrotransactionRelatedListFilters, type MicrotransactionRequestOptions, type MicrotransactionResponse, type MicrotransactionRestoreBridgeOptions, type MicrotransactionSessionOptions, type MicrotransactionSettings, type MicrotransactionSettingsInput, type MicrotransactionTaxCollection, type MicrotransactionVerifiedSession, createMicrotransactionBridge, createMicrotransactionNonce, createMicrotransactionRestoreBridge, Glitch as default, openMicrotransactionOverlay, openMicrotransactionRestoreOverlay };
13980
+ export { type AegisInstallValidation, type AegisLicenseDetail, type AegisLicenseType, type FestivalApplicationInput, type FestivalApplicationState, type FestivalConversation, type FestivalMediaUpload, type FestivalNetworkingFilters, type FestivalNetworkingProfile, type FestivalNetworkingResponse, type FestivalNetworkingSettings, type FestivalPost, type FestivalPostInput, type FestivalPostKind, type FestivalPostState, type FestivalPreferences, type FestivalReportInput, type FestivalRequestOptions, type FestivalWorkType, type GameMonetizationSettings, type HostedPreorderCatalog, type HostedPreorderPaymentState, type HostedPreorderRestoreInput, type HostedPreorderSession, type HostedPreorderSessionInput, type MicrotransactionAbility, type MicrotransactionBranding, type MicrotransactionBridge, type MicrotransactionBridgeOptions, type MicrotransactionCapabilities, type MicrotransactionCatalog, type MicrotransactionCatalogFilter, type MicrotransactionCheckoutInput, type MicrotransactionCheckoutResult, type MicrotransactionCheckoutSession, type MicrotransactionCheckoutSessionInput, type MicrotransactionConsumeInput, type MicrotransactionCreatedCheckoutSession, type MicrotransactionCurrency, type MicrotransactionDelivery, type MicrotransactionDeliveryListFilters, type MicrotransactionDeliveryResult, type MicrotransactionDeliverySettings, type MicrotransactionDeliverySettingsInput, type MicrotransactionDeliveryStatus, type MicrotransactionEarnings, type MicrotransactionEntitlement, type MicrotransactionEnvironment, type MicrotransactionEnvironmentFilter, type MicrotransactionError, type MicrotransactionErrorCode, type MicrotransactionFramePolicy, type MicrotransactionFulfillmentStatus, type MicrotransactionGrant, type MicrotransactionGrantUsage, type MicrotransactionGrantUsageStatus, type MicrotransactionHandoff, type MicrotransactionHandoffClaim, type MicrotransactionHandoffClaimInput, type MicrotransactionLegacyConfirmation, type MicrotransactionManagementListFilters, type MicrotransactionMedia, type MicrotransactionMyPurchases, type MicrotransactionMyPurchasesFilters, type MicrotransactionOperation, type MicrotransactionOperationCapability, type MicrotransactionOrder, type MicrotransactionOrderDetail, type MicrotransactionOrderListFilters, type MicrotransactionOverlay, type MicrotransactionOverlayOptions, type MicrotransactionPaymentStatus, type MicrotransactionPayout, type MicrotransactionPayoutListFilters, type MicrotransactionPayoutStatus, type MicrotransactionPlayerPurchase, type MicrotransactionPrice, type MicrotransactionProduct, type MicrotransactionProductInput, type MicrotransactionProductListFilters, type MicrotransactionProductStatus, type MicrotransactionProductType, type MicrotransactionProvider, type MicrotransactionProviderConfiguration, type MicrotransactionProviderInput, type MicrotransactionProviderName, type MicrotransactionProviderOnboarding, type MicrotransactionProviderOnboardingInput, type MicrotransactionProviderSku, type MicrotransactionPurchaseInput, type MicrotransactionPurchaseMessage, type MicrotransactionPurchasePagination, type MicrotransactionQuote, type MicrotransactionReadiness, type MicrotransactionReadyMessage, type MicrotransactionRefund, type MicrotransactionRefundInput, type MicrotransactionRefundListFilters, type MicrotransactionRefundRecord, type MicrotransactionRefundRequest, type MicrotransactionRefundStatus, type MicrotransactionRelatedListFilters, type MicrotransactionRequestOptions, type MicrotransactionResponse, type MicrotransactionRestoreBridgeOptions, type MicrotransactionSessionOptions, type MicrotransactionSettings, type MicrotransactionSettingsInput, type MicrotransactionTaxCollection, type MicrotransactionVerifiedSession, type PreorderAdminOrderAction, type PreorderAdminOrderFilters, type PreorderCatalog, type PreorderDerivedState, type PreorderFulfillmentStatus, type PreorderFulfillmentType, type PreorderInventory, type PreorderOffer, type PreorderOfferInput, type PreorderOfferStatus, type PreorderOrder, type PreorderPaymentStatus, type PreorderPrice, type PreorderPurchaseInput, type PreorderReadiness, type PreorderReadinessIssue, type PreorderRequestOptions, type PreorderSettings, createMicrotransactionBridge, createMicrotransactionNonce, createMicrotransactionRestoreBridge, Glitch as default, openMicrotransactionOverlay, openMicrotransactionRestoreOverlay };
@@ -0,0 +1,54 @@
1
+ # Game licenses and the Aegis validation handshake
2
+
3
+ Call `Titles.validateInstall(titleId, installId)` at game startup and when resuming an
4
+ existing session. Deny full-game access whenever HTTP is 403/404 or `valid` is
5
+ not `true`; never infer ownership from client-local values.
6
+
7
+ ```ts
8
+ import Glitch from "glitch-javascript-sdk";
9
+ import type { AegisInstallValidation } from "glitch-javascript-sdk";
10
+
11
+ const response = await Glitch.api.Titles.validateInstall<AegisInstallValidation>(
12
+ titleId, installId
13
+ );
14
+ const result = response.data.data;
15
+ if (!result.valid) throw new Error(result.reason || "Access denied");
16
+
17
+ if (result.license?.type === "premium") {
18
+ // Player owns a permanent premium license.
19
+ } else if (result.license?.type === "rental") {
20
+ // Check expires_at and rely on repeat server validation.
21
+ } else if (result.license?.type === "subscription") {
22
+ // Subscription access is scoped to titles that allow it.
23
+ }
24
+ ```
25
+
26
+ The historical `license_type` property is kept for backward compatibility
27
+ and can be `purchased`, `subscription`, `trial`, `demo` or `playtest`.
28
+ Use `license.type` for exact `premium`, `rental`, `subscription`, `sponsored`,
29
+ `admin`, `free`, `trial`, `demo`, `playtest` or `none`.
30
+
31
+ `license` includes `id`, `type`, `source`, `status`, `acquired_at`,
32
+ `purchased_at`, `expires_at`, `is_permanent` and `price_paid`. Amount and
33
+ purchase time are nullable when a historical payment record is not reliably
34
+ recoverable; never substitute the current catalog price. No payment secret or
35
+ raw transaction identifier is returned.
36
+
37
+ Premium-only access is configured by the title administrator on the
38
+ Monetization page using `premium_purchase_required_for_full_game`. It defaults
39
+ to false. When true, a production game launch or validation without an
40
+ authorized premium entitlement returns `PREMIUM_PURCHASE_REQUIRED` (403).
41
+ The Glitch play page renders checkout and registration/login inline.
42
+ Demo and eligible playtests remain free. Previously sold, still-active rentals
43
+ are honored until their original expiration; new rentals cannot be enabled
44
+ with premium-only mode.
45
+
46
+ The publisher SDK exposes `Titles.getGameMonetization` and
47
+ `Titles.updateGameMonetization`. Mutation requires publisher JWT and backend
48
+ validation. The Glitch MCP connector additionally offers
49
+ `glitch_get_game_monetization` and `glitch_update_game_monetization`, the latter
50
+ requiring `commerce:write`, `expected_version` and `confirm=true`.
51
+
52
+ Use `AegisInstallValidation` and `AegisLicenseDetail` types for integration.
53
+ Do not expose developer install/MCP credentials in browser JavaScript or game
54
+ builds, or use an unrelated player's install ID.