glitch-javascript-sdk 4.1.0 → 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.
- package/dist/browser/hosting-runtime.js +5840 -5627
- package/dist/browser/hosting-runtime.js.map +1 -1
- package/dist/cjs/index.js +200 -17
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +5 -0
- package/dist/esm/api/Mcp.d.ts +8 -0
- package/dist/esm/api/Preorders.d.ts +79 -2
- package/dist/esm/api/Scheduler.d.ts +3 -1
- package/dist/esm/api/Titles.d.ts +127 -2
- package/dist/esm/hosting-runtime.d.ts +13 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +186 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +223 -6
- package/guides/game-license-validation.md +54 -0
- package/package.json +2 -2
- package/src/api/Campaigns.ts +8 -0
- package/src/api/Mcp.ts +23 -0
- package/src/api/Preorders.ts +110 -2
- package/src/api/Scheduler.ts +3 -1
- package/src/api/Titles.ts +246 -99
- package/src/hosting-runtime.ts +277 -2
- package/src/index.ts +1 -0
- package/src/routes/CampaignsRoute.ts +1 -0
- package/src/routes/McpRoute.ts +5 -0
- package/src/routes/PreordersRoute.ts +12 -0
- package/src/routes/TitlesRoute.ts +13 -0
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
|
|
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
|
|
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. */
|
|
@@ -12984,7 +13124,7 @@ type PreorderOfferStatus = 'draft' | 'active' | 'paused' | 'ended' | 'archived';
|
|
|
12984
13124
|
type PreorderDerivedState = 'draft' | 'available' | 'scheduled' | 'sold_out' | 'paused' | 'ended' | 'released' | 'archived';
|
|
12985
13125
|
type PreorderPaymentStatus = 'created' | 'requires_action' | 'processing' | 'paid' | 'failed' | 'canceled' | 'refunded' | 'disputed' | 'unknown';
|
|
12986
13126
|
type PreorderFulfillmentStatus = 'waiting_for_release' | 'ready' | 'processing' | 'fulfilled' | 'blocked_missing_build' | 'blocked_missing_key' | 'canceled' | 'failed';
|
|
12987
|
-
interface PreorderRequestOptions extends Pick<AxiosRequestConfig, 'signal' | 'timeout'> {
|
|
13127
|
+
interface PreorderRequestOptions extends Pick<AxiosRequestConfig, 'signal' | 'timeout' | 'headers'> {
|
|
12988
13128
|
}
|
|
12989
13129
|
interface PreorderPrice {
|
|
12990
13130
|
country: string;
|
|
@@ -13028,6 +13168,7 @@ interface PreorderOffer extends Omit<PreorderOfferInput, 'status'> {
|
|
|
13028
13168
|
}
|
|
13029
13169
|
interface PreorderSettings {
|
|
13030
13170
|
enabled: boolean;
|
|
13171
|
+
hosted_checkout_enabled: boolean;
|
|
13031
13172
|
timezone: string;
|
|
13032
13173
|
readiness?: PreorderReadiness;
|
|
13033
13174
|
}
|
|
@@ -13043,6 +13184,64 @@ interface PreorderPurchaseInput {
|
|
|
13043
13184
|
payment_method_id?: string;
|
|
13044
13185
|
payment_intent_id?: string;
|
|
13045
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
|
+
}
|
|
13046
13245
|
interface PreorderOrder {
|
|
13047
13246
|
id: string;
|
|
13048
13247
|
title_id: string;
|
|
@@ -13094,6 +13293,24 @@ interface PreorderAdminOrderFilters {
|
|
|
13094
13293
|
}
|
|
13095
13294
|
type PreorderAdminOrderAction = 'refund' | 'reconcile' | 'fulfill' | 'resend_receipt' | 'resend_access';
|
|
13096
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
|
+
}>>;
|
|
13097
13314
|
static catalog(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderCatalog>>;
|
|
13098
13315
|
static purchase(title_id: string, offer_id: string, data: PreorderPurchaseInput, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderOrder>>;
|
|
13099
13316
|
static myOrders(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<{
|
|
@@ -13105,7 +13322,7 @@ declare class Preorders {
|
|
|
13105
13322
|
resent: boolean;
|
|
13106
13323
|
}>>;
|
|
13107
13324
|
static settings(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderSettings>>;
|
|
13108
|
-
static updateSettings(title_id: string, data: Partial<Pick<PreorderSettings, 'enabled' | 'timezone'>>, 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>>;
|
|
13109
13326
|
static offers(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<{
|
|
13110
13327
|
offers: PreorderOffer[];
|
|
13111
13328
|
}>>;
|
|
@@ -13760,4 +13977,4 @@ declare class Glitch {
|
|
|
13760
13977
|
};
|
|
13761
13978
|
}
|
|
13762
13979
|
|
|
13763
|
-
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, 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 };
|
|
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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glitch-javascript-sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Javascript SDK for Glitch",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"types": "dist/index.d.ts",
|
|
16
16
|
"scripts": {
|
|
17
|
-
"test": "node scripts/test-hosting-routes.cjs && node scripts/test-game-advertising-routes.cjs && node scripts/test-game-design-routes.cjs && node scripts/test-discord-media-routes.cjs && node scripts/test-user-email-delivery-routes.cjs && node scripts/test-game-show-ticket-routes.cjs && node scripts/test-festival-networking-routes.cjs && node scripts/test-microtransaction-routes.cjs && node scripts/test-preorder-routes.cjs && node scripts/test-microtransaction-overlay.cjs && node scripts/test-microtransaction-tutorial.cjs",
|
|
17
|
+
"test": "node scripts/test-hosting-routes.cjs && node scripts/test-game-advertising-routes.cjs && node scripts/test-game-design-routes.cjs && node scripts/test-discord-media-routes.cjs && node scripts/test-user-email-delivery-routes.cjs && node scripts/test-game-show-ticket-routes.cjs && node scripts/test-festival-networking-routes.cjs && node scripts/test-microtransaction-routes.cjs && node scripts/test-preorder-routes.cjs && node scripts/test-microtransaction-overlay.cjs && node scripts/test-microtransaction-tutorial.cjs && node scripts/test-steam-financial-routes.cjs",
|
|
18
18
|
"build": "rm -Rf dist && rollup -c --bundleConfigAsCjs",
|
|
19
19
|
"build-docs": "rm -rf docs && typedoc --tsconfig tsconfig.json src/",
|
|
20
20
|
"test:package": "node scripts/test-package-exports.cjs && npm run test:commerce-compat",
|
package/src/api/Campaigns.ts
CHANGED
|
@@ -870,6 +870,14 @@ class Campaigns {
|
|
|
870
870
|
return Requests.processRoute(CampaignsRoute.routes.sourcingGetSimilarIgdbGames, undefined, { campaign_id }, params);
|
|
871
871
|
}
|
|
872
872
|
|
|
873
|
+
/**
|
|
874
|
+
* Discover recently streamed look-alikes for Easy Create (minimum five).
|
|
875
|
+
* Never treat older Twitch activity as currently streaming.
|
|
876
|
+
*/
|
|
877
|
+
public static sourcingGetActiveStreamLookalikes<T>(campaign_id: string, params: Record<string, any> = {}): AxiosPromise<Response<T>> {
|
|
878
|
+
return Requests.processRoute(CampaignsRoute.routes.sourcingGetActiveStreamLookalikes, params, { campaign_id });
|
|
879
|
+
}
|
|
880
|
+
|
|
873
881
|
/**
|
|
874
882
|
* Find content creators for selected games. This does not save them to the database.
|
|
875
883
|
* @param campaign_id The UUID of the campaign.
|
package/src/api/Mcp.ts
CHANGED
|
@@ -43,6 +43,29 @@ class Mcp {
|
|
|
43
43
|
return Requests.processRoute(McpRoute.routes.billing, {}, { title_id }, params);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
/** Discover title-scoped social operations for ordinary and eligible Agent subscriptions. */
|
|
47
|
+
public static socialCapabilities<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
48
|
+
return Requests.processRoute(McpRoute.routes.socialCapabilities, {}, { title_id }, params);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public static socialOperation<T>(title_id: string, operation: string, args: Record<string, unknown>, confirm = false, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
52
|
+
return Requests.processRoute(McpRoute.routes.socialOperation, { arguments: args, confirm }, { title_id, operation }, params);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Discover full advertising and conversion tracking operations. */
|
|
56
|
+
public static marketingCapabilities<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
57
|
+
return Requests.processRoute(McpRoute.routes.marketingCapabilities, {}, { title_id }, params);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Run a title-scoped advertising or conversion operation; mutations require confirmation. */
|
|
61
|
+
public static marketingOperation<T>(title_id: string, operation: string, args: Record<string, unknown>, confirm = false, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
62
|
+
return Requests.processRoute(McpRoute.routes.marketingOperation, { arguments: args, confirm }, { title_id, operation }, params);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public static influencerCampaignOperation<T>(title_id: string, operation: string, fields?: Record<string, unknown>, campaign_id?: string, confirm = false, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
66
|
+
return Requests.processRoute(McpRoute.routes.influencerCampaignOperation, { fields, campaign_id, confirm }, { title_id, operation }, params);
|
|
67
|
+
}
|
|
68
|
+
|
|
46
69
|
/** Start a paid Glitch Agent run for a title. */
|
|
47
70
|
public static startRun<T>(title_id: string, data?: McpStartRunRequest, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
48
71
|
return Requests.processRoute(McpRoute.routes.startRun, data ?? {}, { title_id }, params);
|
package/src/api/Preorders.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type PreorderDerivedState = 'draft' | 'available' | 'scheduled' | 'sold_o
|
|
|
9
9
|
export type PreorderPaymentStatus = 'created' | 'requires_action' | 'processing' | 'paid' | 'failed' | 'canceled' | 'refunded' | 'disputed' | 'unknown';
|
|
10
10
|
export type PreorderFulfillmentStatus = 'waiting_for_release' | 'ready' | 'processing' | 'fulfilled' | 'blocked_missing_build' | 'blocked_missing_key' | 'canceled' | 'failed';
|
|
11
11
|
|
|
12
|
-
export interface PreorderRequestOptions extends Pick<AxiosRequestConfig, 'signal' | 'timeout'> {}
|
|
12
|
+
export interface PreorderRequestOptions extends Pick<AxiosRequestConfig, 'signal' | 'timeout' | 'headers'> {}
|
|
13
13
|
|
|
14
14
|
export interface PreorderPrice {
|
|
15
15
|
country: string;
|
|
@@ -57,6 +57,7 @@ export interface PreorderOffer extends Omit<PreorderOfferInput, 'status'> {
|
|
|
57
57
|
|
|
58
58
|
export interface PreorderSettings {
|
|
59
59
|
enabled: boolean;
|
|
60
|
+
hosted_checkout_enabled: boolean;
|
|
60
61
|
timezone: string;
|
|
61
62
|
readiness?: PreorderReadiness;
|
|
62
63
|
}
|
|
@@ -75,6 +76,59 @@ export interface PreorderPurchaseInput {
|
|
|
75
76
|
payment_intent_id?: string;
|
|
76
77
|
}
|
|
77
78
|
|
|
79
|
+
export interface HostedPreorderCatalog extends PreorderCatalog {
|
|
80
|
+
hosted_checkout_enabled: boolean;
|
|
81
|
+
title: { id: string; name: string };
|
|
82
|
+
hosting: { site_id: string; hostname: string; origin: string };
|
|
83
|
+
checkout_origin: string;
|
|
84
|
+
embed_script_url: string;
|
|
85
|
+
version: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface HostedPreorderSessionInput {
|
|
89
|
+
offer_id: string;
|
|
90
|
+
return_origin: string;
|
|
91
|
+
nonce: string;
|
|
92
|
+
country?: string;
|
|
93
|
+
currency?: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface HostedPreorderRestoreInput {
|
|
97
|
+
return_origin: string;
|
|
98
|
+
nonce: string;
|
|
99
|
+
country?: string;
|
|
100
|
+
currency?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface HostedPreorderPaymentState {
|
|
104
|
+
status: string;
|
|
105
|
+
requires_action?: boolean;
|
|
106
|
+
client_secret?: string | null;
|
|
107
|
+
payment_intent_id?: string | null;
|
|
108
|
+
retryable_same_request?: boolean;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface HostedPreorderSession {
|
|
112
|
+
id: string;
|
|
113
|
+
checkout_session_id: string;
|
|
114
|
+
intent: 'preorder' | 'preorder_restore';
|
|
115
|
+
title: { id: string; name: string };
|
|
116
|
+
hosting_site_id: string;
|
|
117
|
+
offer?: PreorderOffer | null;
|
|
118
|
+
country: string;
|
|
119
|
+
currency: string;
|
|
120
|
+
return_origin: string;
|
|
121
|
+
nonce: string;
|
|
122
|
+
expires_at: string;
|
|
123
|
+
authenticated: boolean;
|
|
124
|
+
status: string;
|
|
125
|
+
order?: PreorderOrder | null;
|
|
126
|
+
orders?: PreorderOrder[];
|
|
127
|
+
payment?: HostedPreorderPaymentState | null;
|
|
128
|
+
session_token?: string;
|
|
129
|
+
hosted_url?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
78
132
|
export interface PreorderOrder {
|
|
79
133
|
id: string;
|
|
80
134
|
title_id: string;
|
|
@@ -131,6 +185,60 @@ export interface PreorderAdminOrderFilters {
|
|
|
131
185
|
export type PreorderAdminOrderAction = 'refund' | 'reconcile' | 'fulfill' | 'resend_receipt' | 'resend_access';
|
|
132
186
|
|
|
133
187
|
class Preorders {
|
|
188
|
+
private static hostedOptions(checkoutToken: string, options?: PreorderRequestOptions): PreorderRequestOptions {
|
|
189
|
+
return {
|
|
190
|
+
...options,
|
|
191
|
+
headers: {
|
|
192
|
+
...((options?.headers || {}) as Record<string, string>),
|
|
193
|
+
'X-Checkout-Token': checkoutToken,
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
public static hostedCatalog(options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderCatalog>> {
|
|
199
|
+
return Requests.processRoute(PreordersRoute.routes.hostedCatalog, undefined, undefined, undefined, options);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
public static createHostedSession(data: HostedPreorderSessionInput, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>> {
|
|
203
|
+
return Requests.processRoute(PreordersRoute.routes.createHostedSession, data, undefined, undefined, options);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
public static createHostedRestoreSession(data: HostedPreorderRestoreInput, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>> {
|
|
207
|
+
return Requests.processRoute(PreordersRoute.routes.createHostedRestoreSession, data, undefined, undefined, options);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
public static hostedSession(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>> {
|
|
211
|
+
return Requests.processRoute(PreordersRoute.routes.hostedSession, undefined, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
public static hostedMine(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>> {
|
|
215
|
+
return Requests.processRoute(PreordersRoute.routes.hostedMine, undefined, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
public static authenticateHostedSession(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>> {
|
|
219
|
+
return Requests.processRoute(PreordersRoute.routes.hostedAuthenticate, {}, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
public static checkoutHostedSession(title_id: string, session_id: string, checkoutToken: string, data: { accept_terms: boolean; payment_method_id?: string; payment_intent_id?: string }, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>> {
|
|
223
|
+
return Requests.processRoute(PreordersRoute.routes.hostedCheckout, data, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
public static reconcileHostedSession(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>> {
|
|
227
|
+
return Requests.processRoute(PreordersRoute.routes.hostedReconcile, {}, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
public static retryHostedSession(title_id: string, session_id: string, checkoutToken: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>> {
|
|
231
|
+
return Requests.processRoute(PreordersRoute.routes.hostedRetry, {}, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
public static refundHostedOrder(title_id: string, session_id: string, checkoutToken: string, order_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<HostedPreorderSession>> {
|
|
235
|
+
return Requests.processRoute(PreordersRoute.routes.hostedRefund, { order_id }, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
public static resendHostedAccess(title_id: string, session_id: string, checkoutToken: string, order_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<{ resent: boolean }>> {
|
|
239
|
+
return Requests.processRoute(PreordersRoute.routes.hostedResendAccess, { order_id }, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
240
|
+
}
|
|
241
|
+
|
|
134
242
|
public static catalog(title_id: string, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderCatalog>> {
|
|
135
243
|
return Requests.processRoute(PreordersRoute.routes.catalog, undefined, { title_id }, undefined, options);
|
|
136
244
|
}
|
|
@@ -159,7 +267,7 @@ class Preorders {
|
|
|
159
267
|
return Requests.processRoute(PreordersRoute.routes.settings, undefined, { title_id }, undefined, options);
|
|
160
268
|
}
|
|
161
269
|
|
|
162
|
-
public static updateSettings(title_id: string, data: Partial<Pick<PreorderSettings, 'enabled' | 'timezone'>>, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderSettings>> {
|
|
270
|
+
public static updateSettings(title_id: string, data: Partial<Pick<PreorderSettings, 'enabled' | 'hosted_checkout_enabled' | 'timezone'>>, options?: PreorderRequestOptions): AxiosPromise<Response<PreorderSettings>> {
|
|
163
271
|
return Requests.processRoute(PreordersRoute.routes.updateSettings, data, { title_id }, undefined, options);
|
|
164
272
|
}
|
|
165
273
|
|
package/src/api/Scheduler.ts
CHANGED
|
@@ -1019,7 +1019,9 @@ class Scheduler {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
|
|
1021
1021
|
/**
|
|
1022
|
-
* List
|
|
1022
|
+
* List provider conversion actions (Google), Pixel sources (Meta, TikTok, Reddit), or X website-event tags
|
|
1023
|
+
* for the scheduler's connected advertising account. The Reddit result
|
|
1024
|
+
* does not establish delivery of conversion events.
|
|
1023
1025
|
* GET /schedulers/{scheduler_id}/conversion-actions
|
|
1024
1026
|
*/
|
|
1025
1027
|
public static listConversionActions<T>(
|