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.
- package/dist/browser/hosting-runtime.js +5840 -5627
- package/dist/browser/hosting-runtime.js.map +1 -1
- package/dist/cjs/index.js +304 -2
- 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 +239 -0
- package/dist/esm/api/Scheduler.d.ts +3 -1
- package/dist/esm/api/Titles.d.ts +127 -2
- package/dist/esm/api/index.d.ts +1 -0
- package/dist/esm/hosting-runtime.d.ts +13 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +293 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/PreordersRoute.d.ts +7 -0
- package/dist/index.d.ts +382 -4
- package/guides/game-license-validation.md +54 -0
- package/guides/microtransactions.md +157 -9
- package/package.json +2 -2
- package/src/api/Campaigns.ts +8 -0
- package/src/api/Mcp.ts +23 -0
- package/src/api/Preorders.ts +342 -0
- package/src/api/Scheduler.ts +3 -1
- package/src/api/Titles.ts +246 -99
- package/src/api/index.ts +1 -0
- package/src/hosting-runtime.ts +277 -2
- package/src/index.ts +4 -0
- package/src/routes/CampaignsRoute.ts +1 -0
- package/src/routes/McpRoute.ts +5 -0
- package/src/routes/PreordersRoute.ts +46 -0
- package/src/routes/TitlesRoute.ts +13 -0
package/dist/esm/index.js
CHANGED
|
@@ -12450,6 +12450,19 @@ TitlesRoute.routes = {
|
|
|
12450
12450
|
reviewsVote: { url: '/reviews/{review_id}/vote', method: HTTP_METHODS.POST },
|
|
12451
12451
|
reviewsReport: { url: '/reviews/{review_id}/report', method: HTTP_METHODS.POST },
|
|
12452
12452
|
reviewsDeveloperResponse: { url: '/reviews/{review_id}/developer-response', method: HTTP_METHODS.POST },
|
|
12453
|
+
// Steamworks Financial API (IPartnerFinancialsService): key, sync, stored data, live read-through.
|
|
12454
|
+
steamFinancialsStatus: { url: '/titles/{title_id}/steam/financials', method: HTTP_METHODS.GET },
|
|
12455
|
+
steamFinancialsConnect: { url: '/titles/{title_id}/steam/financials/key', method: HTTP_METHODS.PUT },
|
|
12456
|
+
steamFinancialsTestKey: { url: '/titles/{title_id}/steam/financials/key/test', method: HTTP_METHODS.POST },
|
|
12457
|
+
steamFinancialsDisconnect: { url: '/titles/{title_id}/steam/financials/key', method: HTTP_METHODS.DELETE },
|
|
12458
|
+
steamFinancialsSync: { url: '/titles/{title_id}/steam/financials/sync', method: HTTP_METHODS.POST },
|
|
12459
|
+
steamFinancialsReports: { url: '/titles/{title_id}/steam/financials/reports', method: HTTP_METHODS.GET },
|
|
12460
|
+
steamFinancialsSales: { url: '/titles/{title_id}/steam/financials/sales', method: HTTP_METHODS.GET },
|
|
12461
|
+
steamFinancialsWishlists: { url: '/titles/{title_id}/steam/financials/wishlists', method: HTTP_METHODS.GET },
|
|
12462
|
+
steamFinancialsLookups: { url: '/titles/{title_id}/steam/financials/lookups', method: HTTP_METHODS.GET },
|
|
12463
|
+
steamFinancialsLiveChangedDates: { url: '/titles/{title_id}/steam/financials/live/changed-dates', method: HTTP_METHODS.GET },
|
|
12464
|
+
steamFinancialsLiveDetailedSales: { url: '/titles/{title_id}/steam/financials/live/detailed-sales', method: HTTP_METHODS.GET },
|
|
12465
|
+
steamFinancialsLiveWishlist: { url: '/titles/{title_id}/steam/financials/live/wishlist', method: HTTP_METHODS.GET },
|
|
12453
12466
|
};
|
|
12454
12467
|
|
|
12455
12468
|
class Titles {
|
|
@@ -12488,6 +12501,17 @@ class Titles {
|
|
|
12488
12501
|
static update(title_id, data, params) {
|
|
12489
12502
|
return Requests.processRoute(TitlesRoute.routes.update, data, { title_id: title_id }, params);
|
|
12490
12503
|
}
|
|
12504
|
+
/** View public title monetization settings. For mutation use authenticated title admin. */
|
|
12505
|
+
static getGameMonetization(title_id) {
|
|
12506
|
+
return Titles.view(title_id);
|
|
12507
|
+
}
|
|
12508
|
+
/**
|
|
12509
|
+
* Update publisher monetization including premium_purchase_required_for_full_game.
|
|
12510
|
+
* Requires a title administrator JWT; backend validates premium/subscription/rental compatibility.
|
|
12511
|
+
*/
|
|
12512
|
+
static updateGameMonetization(title_id, settings) {
|
|
12513
|
+
return Titles.update(title_id, settings);
|
|
12514
|
+
}
|
|
12491
12515
|
/**
|
|
12492
12516
|
* Retrieve the information for a single title.
|
|
12493
12517
|
*
|
|
@@ -13129,7 +13153,11 @@ class Titles {
|
|
|
13129
13153
|
*
|
|
13130
13154
|
* @param title_id The UUID of the game title.
|
|
13131
13155
|
* @param install_id The UUID of the specific install/session.
|
|
13132
|
-
* @returns
|
|
13156
|
+
* @returns Access result with a backward-compatible license_type and exact license
|
|
13157
|
+
* metadata: type, status, source, acquired_at, purchased_at, expires_at and
|
|
13158
|
+
* verified price_paid (null when no authoritative historical price exists).
|
|
13159
|
+
* Production requests may return PREMIUM_PURCHASE_REQUIRED (403).
|
|
13160
|
+
* The caller must block gameplay when valid is false.
|
|
13133
13161
|
*/
|
|
13134
13162
|
static validateInstall(title_id, install_id) {
|
|
13135
13163
|
return Requests.processRoute(TitlesRoute.routes.validateInstall, {}, { title_id: title_id, install_id: install_id });
|
|
@@ -13462,6 +13490,82 @@ class Titles {
|
|
|
13462
13490
|
static respondToReview(review_id, data) {
|
|
13463
13491
|
return Requests.processRoute(TitlesRoute.routes.reviewsDeveloperResponse, data, { review_id });
|
|
13464
13492
|
}
|
|
13493
|
+
// ----- Steamworks Financial API -----------------------------------------------------
|
|
13494
|
+
/**
|
|
13495
|
+
* Steam Financial API connection and sync status for a title: masked key, partner,
|
|
13496
|
+
* last sync times, stored sales/wishlist date ranges and pending dates.
|
|
13497
|
+
*/
|
|
13498
|
+
static steamFinancialsStatus(title_id) {
|
|
13499
|
+
return Requests.processRoute(TitlesRoute.routes.steamFinancialsStatus, undefined, { title_id });
|
|
13500
|
+
}
|
|
13501
|
+
/**
|
|
13502
|
+
* Verify a Steamworks Financial API Group key with Steam and store it (encrypted) on the title.
|
|
13503
|
+
* Queues a full sync unless `sync: false` is passed.
|
|
13504
|
+
*
|
|
13505
|
+
* @param data { api_key: string, sync?: boolean }
|
|
13506
|
+
*/
|
|
13507
|
+
static steamFinancialsConnect(title_id, data) {
|
|
13508
|
+
return Requests.processRoute(TitlesRoute.routes.steamFinancialsConnect, data, { title_id });
|
|
13509
|
+
}
|
|
13510
|
+
/** Check a key (or the stored key when api_key is omitted) with Steam without saving anything. */
|
|
13511
|
+
static steamFinancialsTestKey(title_id, data) {
|
|
13512
|
+
return Requests.processRoute(TitlesRoute.routes.steamFinancialsTestKey, data || {}, { title_id });
|
|
13513
|
+
}
|
|
13514
|
+
/** Remove the stored key. Pass { purge_data: true } to also delete synced Steam financial data. */
|
|
13515
|
+
static steamFinancialsDisconnect(title_id, params) {
|
|
13516
|
+
return Requests.processRoute(TitlesRoute.routes.steamFinancialsDisconnect, undefined, { title_id }, params);
|
|
13517
|
+
}
|
|
13518
|
+
/**
|
|
13519
|
+
* Sync sales and/or wishlists from Steam. Queued by default; pass `wait: true` for a short inline run.
|
|
13520
|
+
*
|
|
13521
|
+
* @param data { datasets?: ('sales'|'wishlists')[], full?: boolean, wait?: boolean, max_dates?: number, max_days?: number, from?: string, to?: string, include_view_grants?: boolean }
|
|
13522
|
+
*/
|
|
13523
|
+
static steamFinancialsSync(title_id, data) {
|
|
13524
|
+
return Requests.processRoute(TitlesRoute.routes.steamFinancialsSync, data || {}, { title_id });
|
|
13525
|
+
}
|
|
13526
|
+
/**
|
|
13527
|
+
* Report bundle built from synced Steam data: summary, sales over time and by country, region,
|
|
13528
|
+
* product, platform, sale type, discount and price point, key activations, revenue-share tiers,
|
|
13529
|
+
* wishlists over time and by country, region, language and platform, and the wishlist-to-sales funnel.
|
|
13530
|
+
*
|
|
13531
|
+
* @param params { from?: 'YYYY-MM-DD', to?: 'YYYY-MM-DD', report_keys?: string (comma separated), app_scope?: 'title'|'partner', app_id?: number, limit?: number }
|
|
13532
|
+
*/
|
|
13533
|
+
static steamFinancialsReports(title_id, params) {
|
|
13534
|
+
return Requests.processRoute(TitlesRoute.routes.steamFinancialsReports, undefined, { title_id }, params);
|
|
13535
|
+
}
|
|
13536
|
+
/**
|
|
13537
|
+
* Paginated Steam sales line items (every GetDetailedSales field) with product, country,
|
|
13538
|
+
* discount and key-request names attached.
|
|
13539
|
+
*
|
|
13540
|
+
* @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? }
|
|
13541
|
+
*/
|
|
13542
|
+
static steamFinancialsSales(title_id, params) {
|
|
13543
|
+
return Requests.processRoute(TitlesRoute.routes.steamFinancialsSales, undefined, { title_id }, params);
|
|
13544
|
+
}
|
|
13545
|
+
/**
|
|
13546
|
+
* Daily Steam wishlist rows; pass dimension 'country' or 'language' for the breakdown rows.
|
|
13547
|
+
*
|
|
13548
|
+
* @param params { from?, to?, app_id?, dimension?: 'country'|'language' }
|
|
13549
|
+
*/
|
|
13550
|
+
static steamFinancialsWishlists(title_id, params) {
|
|
13551
|
+
return Requests.processRoute(TitlesRoute.routes.steamFinancialsWishlists, undefined, { title_id }, params);
|
|
13552
|
+
}
|
|
13553
|
+
/** Names Steam returned with sales: package, app, bundle, discount, combined_discount, key_request, game_item, country, partner. */
|
|
13554
|
+
static steamFinancialsLookups(title_id, params) {
|
|
13555
|
+
return Requests.processRoute(TitlesRoute.routes.steamFinancialsLookups, undefined, { title_id }, params);
|
|
13556
|
+
}
|
|
13557
|
+
/** Live GetChangedDatesForPartner (nothing stored). */
|
|
13558
|
+
static steamFinancialsLiveChangedDates(title_id, params) {
|
|
13559
|
+
return Requests.processRoute(TitlesRoute.routes.steamFinancialsLiveChangedDates, undefined, { title_id }, params);
|
|
13560
|
+
}
|
|
13561
|
+
/** Live GetDetailedSales for one date and page (nothing stored). */
|
|
13562
|
+
static steamFinancialsLiveDetailedSales(title_id, params) {
|
|
13563
|
+
return Requests.processRoute(TitlesRoute.routes.steamFinancialsLiveDetailedSales, undefined, { title_id }, params);
|
|
13564
|
+
}
|
|
13565
|
+
/** Live GetAppWishlistReporting for one date (nothing stored). */
|
|
13566
|
+
static steamFinancialsLiveWishlist(title_id, params) {
|
|
13567
|
+
return Requests.processRoute(TitlesRoute.routes.steamFinancialsLiveWishlist, undefined, { title_id }, params);
|
|
13568
|
+
}
|
|
13465
13569
|
}
|
|
13466
13570
|
|
|
13467
13571
|
class CampaignsRoute {
|
|
@@ -13534,6 +13638,7 @@ CampaignsRoute.routes = {
|
|
|
13534
13638
|
sendCampaignContractWithDocusign: { url: '/campaigns/{campaign_id}/influencers/{user_id}/docusign', method: HTTP_METHODS.POST },
|
|
13535
13639
|
sourcingSearchIgdbForCampaignGame: { url: '/campaigns/{campaign_id}/sourcing/search-game', method: HTTP_METHODS.GET },
|
|
13536
13640
|
sourcingGetSimilarIgdbGames: { url: '/campaigns/{campaign_id}/sourcing/similar-games', method: HTTP_METHODS.GET },
|
|
13641
|
+
sourcingGetActiveStreamLookalikes: { url: '/campaigns/{campaign_id}/sourcing/active-stream-lookalikes', method: HTTP_METHODS.POST },
|
|
13537
13642
|
sourcingFindCreators: { url: '/campaigns/{campaign_id}/sourcing/find-creators', method: HTTP_METHODS.POST },
|
|
13538
13643
|
updateSourcingSettings: { url: '/campaigns/{campaign_id}/sourcing/settings', method: HTTP_METHODS.PUT },
|
|
13539
13644
|
sourcingFindAndSaveCreators: { url: '/campaigns/{campaign_id}/sourcing/find-save-creators', method: HTTP_METHODS.POST },
|
|
@@ -14320,6 +14425,13 @@ class Campaigns {
|
|
|
14320
14425
|
static sourcingGetSimilarIgdbGames(campaign_id, params) {
|
|
14321
14426
|
return Requests.processRoute(CampaignsRoute.routes.sourcingGetSimilarIgdbGames, undefined, { campaign_id }, params);
|
|
14322
14427
|
}
|
|
14428
|
+
/**
|
|
14429
|
+
* Discover recently streamed look-alikes for Easy Create (minimum five).
|
|
14430
|
+
* Never treat older Twitch activity as currently streaming.
|
|
14431
|
+
*/
|
|
14432
|
+
static sourcingGetActiveStreamLookalikes(campaign_id, params = {}) {
|
|
14433
|
+
return Requests.processRoute(CampaignsRoute.routes.sourcingGetActiveStreamLookalikes, params, { campaign_id });
|
|
14434
|
+
}
|
|
14323
14435
|
/**
|
|
14324
14436
|
* Find content creators for selected games. This does not save them to the database.
|
|
14325
14437
|
* @param campaign_id The UUID of the campaign.
|
|
@@ -17295,7 +17407,9 @@ class Scheduler {
|
|
|
17295
17407
|
return Requests.processRoute(SchedulerRoute.routes.getCampaignFundingInstruments, undefined, { scheduler_id }, params);
|
|
17296
17408
|
}
|
|
17297
17409
|
/**
|
|
17298
|
-
* List
|
|
17410
|
+
* List provider conversion actions (Google), Pixel sources (Meta, TikTok, Reddit), or X website-event tags
|
|
17411
|
+
* for the scheduler's connected advertising account. The Reddit result
|
|
17412
|
+
* does not establish delivery of conversion events.
|
|
17299
17413
|
* GET /schedulers/{scheduler_id}/conversion-actions
|
|
17300
17414
|
*/
|
|
17301
17415
|
static listConversionActions(scheduler_id, params) {
|
|
@@ -20878,6 +20992,11 @@ McpRoute.routes = {
|
|
|
20878
20992
|
listTitles: { url: "/mcp/v1/titles", method: HTTP_METHODS.GET },
|
|
20879
20993
|
titleContext: { url: "/mcp/v1/titles/{title_id}/context", method: HTTP_METHODS.GET },
|
|
20880
20994
|
billing: { url: "/mcp/v1/titles/{title_id}/billing", method: HTTP_METHODS.GET },
|
|
20995
|
+
socialCapabilities: { url: "/mcp/v1/titles/{title_id}/social/capabilities", method: HTTP_METHODS.GET },
|
|
20996
|
+
socialOperation: { url: "/mcp/v1/titles/{title_id}/social/operations/{operation}", method: HTTP_METHODS.POST },
|
|
20997
|
+
marketingCapabilities: { url: "/mcp/v1/titles/{title_id}/marketing/capabilities", method: HTTP_METHODS.GET },
|
|
20998
|
+
marketingOperation: { url: "/mcp/v1/titles/{title_id}/marketing/operations/{operation}", method: HTTP_METHODS.POST },
|
|
20999
|
+
influencerCampaignOperation: { url: "/mcp/v1/titles/{title_id}/influencer-campaigns/{operation}", method: HTTP_METHODS.POST },
|
|
20881
21000
|
startRun: { url: "/mcp/v1/titles/{title_id}/runs", method: HTTP_METHODS.POST },
|
|
20882
21001
|
viewRun: { url: "/mcp/v1/titles/{title_id}/runs/{run_id}", method: HTTP_METHODS.GET },
|
|
20883
21002
|
runEvents: { url: "/mcp/v1/titles/{title_id}/runs/{run_id}/events", method: HTTP_METHODS.GET },
|
|
@@ -20921,6 +21040,24 @@ class Mcp {
|
|
|
20921
21040
|
static billing(title_id, params) {
|
|
20922
21041
|
return Requests.processRoute(McpRoute.routes.billing, {}, { title_id }, params);
|
|
20923
21042
|
}
|
|
21043
|
+
/** Discover title-scoped social operations for ordinary and eligible Agent subscriptions. */
|
|
21044
|
+
static socialCapabilities(title_id, params) {
|
|
21045
|
+
return Requests.processRoute(McpRoute.routes.socialCapabilities, {}, { title_id }, params);
|
|
21046
|
+
}
|
|
21047
|
+
static socialOperation(title_id, operation, args, confirm = false, params) {
|
|
21048
|
+
return Requests.processRoute(McpRoute.routes.socialOperation, { arguments: args, confirm }, { title_id, operation }, params);
|
|
21049
|
+
}
|
|
21050
|
+
/** Discover full advertising and conversion tracking operations. */
|
|
21051
|
+
static marketingCapabilities(title_id, params) {
|
|
21052
|
+
return Requests.processRoute(McpRoute.routes.marketingCapabilities, {}, { title_id }, params);
|
|
21053
|
+
}
|
|
21054
|
+
/** Run a title-scoped advertising or conversion operation; mutations require confirmation. */
|
|
21055
|
+
static marketingOperation(title_id, operation, args, confirm = false, params) {
|
|
21056
|
+
return Requests.processRoute(McpRoute.routes.marketingOperation, { arguments: args, confirm }, { title_id, operation }, params);
|
|
21057
|
+
}
|
|
21058
|
+
static influencerCampaignOperation(title_id, operation, fields, campaign_id, confirm = false, params) {
|
|
21059
|
+
return Requests.processRoute(McpRoute.routes.influencerCampaignOperation, { fields, campaign_id, confirm }, { title_id, operation }, params);
|
|
21060
|
+
}
|
|
20924
21061
|
/** Start a paid Glitch Agent run for a title. */
|
|
20925
21062
|
static startRun(title_id, data, params) {
|
|
20926
21063
|
return Requests.processRoute(McpRoute.routes.startRun, data !== null && data !== void 0 ? data : {}, { title_id }, params);
|
|
@@ -21927,6 +22064,159 @@ class Microtransactions {
|
|
|
21927
22064
|
}
|
|
21928
22065
|
}
|
|
21929
22066
|
|
|
22067
|
+
class PreordersRoute {
|
|
22068
|
+
}
|
|
22069
|
+
PreordersRoute.routes = {
|
|
22070
|
+
hostedCatalog: { url: '/hosting/preorders/catalog', method: HTTP_METHODS.GET },
|
|
22071
|
+
createHostedSession: { url: '/hosting/preorders/checkout-sessions', method: HTTP_METHODS.POST },
|
|
22072
|
+
createHostedRestoreSession: { url: '/hosting/preorders/restore-sessions', method: HTTP_METHODS.POST },
|
|
22073
|
+
hostedSession: { url: '/titles/{title_id}/preorders/hosted/checkout-sessions/{session_id}', method: HTTP_METHODS.GET },
|
|
22074
|
+
hostedMine: { url: '/titles/{title_id}/preorders/hosted/checkout-sessions/{session_id}/me', method: HTTP_METHODS.GET },
|
|
22075
|
+
hostedAuthenticate: { url: '/titles/{title_id}/preorders/hosted/checkout-sessions/{session_id}/authenticate', method: HTTP_METHODS.POST },
|
|
22076
|
+
hostedCheckout: { url: '/titles/{title_id}/preorders/hosted/checkout-sessions/{session_id}/checkout', method: HTTP_METHODS.POST },
|
|
22077
|
+
hostedReconcile: { url: '/titles/{title_id}/preorders/hosted/checkout-sessions/{session_id}/reconcile', method: HTTP_METHODS.POST },
|
|
22078
|
+
hostedRetry: { url: '/titles/{title_id}/preorders/hosted/checkout-sessions/{session_id}/retry', method: HTTP_METHODS.POST },
|
|
22079
|
+
hostedRefund: { url: '/titles/{title_id}/preorders/hosted/checkout-sessions/{session_id}/refund', method: HTTP_METHODS.POST },
|
|
22080
|
+
hostedResendAccess: { url: '/titles/{title_id}/preorders/hosted/checkout-sessions/{session_id}/resend-access', method: HTTP_METHODS.POST },
|
|
22081
|
+
catalog: { url: '/titles/{title_id}/preorders', method: HTTP_METHODS.GET },
|
|
22082
|
+
purchase: { url: '/titles/{title_id}/preorders/{offer_id}/purchase', method: HTTP_METHODS.POST },
|
|
22083
|
+
myOrders: { url: '/titles/{title_id}/preorders/me/orders', method: HTTP_METHODS.GET },
|
|
22084
|
+
order: { url: '/titles/{title_id}/preorders/orders/{order_id}', method: HTTP_METHODS.GET },
|
|
22085
|
+
refundMine: { url: '/titles/{title_id}/preorders/orders/{order_id}/refund', method: HTTP_METHODS.POST },
|
|
22086
|
+
resendMine: { url: '/titles/{title_id}/preorders/orders/{order_id}/resend-access', method: HTTP_METHODS.POST },
|
|
22087
|
+
settings: { url: '/titles/{title_id}/preorders/settings', method: HTTP_METHODS.GET },
|
|
22088
|
+
updateSettings: { url: '/titles/{title_id}/preorders/settings', method: HTTP_METHODS.PUT },
|
|
22089
|
+
offers: { url: '/titles/{title_id}/preorders/admin/offers', method: HTTP_METHODS.GET },
|
|
22090
|
+
createOffer: { url: '/titles/{title_id}/preorders/admin/offers', method: HTTP_METHODS.POST },
|
|
22091
|
+
offer: { url: '/titles/{title_id}/preorders/admin/offers/{offer_id}', method: HTTP_METHODS.GET },
|
|
22092
|
+
updateOffer: { url: '/titles/{title_id}/preorders/admin/offers/{offer_id}', method: HTTP_METHODS.PUT },
|
|
22093
|
+
activateOffer: { url: '/titles/{title_id}/preorders/admin/offers/{offer_id}/activate', method: HTTP_METHODS.POST },
|
|
22094
|
+
pauseOffer: { url: '/titles/{title_id}/preorders/admin/offers/{offer_id}/pause', method: HTTP_METHODS.POST },
|
|
22095
|
+
archiveOffer: { url: '/titles/{title_id}/preorders/admin/offers/{offer_id}/archive', method: HTTP_METHODS.POST },
|
|
22096
|
+
inventory: { url: '/titles/{title_id}/preorders/admin/offers/{offer_id}/keys', method: HTTP_METHODS.GET },
|
|
22097
|
+
importKeys: { url: '/titles/{title_id}/preorders/admin/offers/{offer_id}/keys/import', method: HTTP_METHODS.POST },
|
|
22098
|
+
retireKey: { url: '/titles/{title_id}/preorders/admin/offers/{offer_id}/keys/{key_id}/retire', method: HTTP_METHODS.POST },
|
|
22099
|
+
adminOrders: { url: '/titles/{title_id}/preorders/admin/orders', method: HTTP_METHODS.GET },
|
|
22100
|
+
readiness: { url: '/titles/{title_id}/preorders/admin/readiness', method: HTTP_METHODS.GET },
|
|
22101
|
+
adminOrderAction: { url: '/titles/{title_id}/preorders/admin/orders/{order_id}/{action}', method: HTTP_METHODS.POST },
|
|
22102
|
+
mcpCapabilities: { url: '/mcp/v1/titles/{title_id}/preorders/capabilities', method: HTTP_METHODS.GET },
|
|
22103
|
+
mcpOperation: { url: '/mcp/v1/titles/{title_id}/preorders/operations/{operation}', method: HTTP_METHODS.POST },
|
|
22104
|
+
};
|
|
22105
|
+
|
|
22106
|
+
class Preorders {
|
|
22107
|
+
static hostedOptions(checkoutToken, options) {
|
|
22108
|
+
return Object.assign(Object.assign({}, options), { headers: Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.headers) || {})), { 'X-Checkout-Token': checkoutToken }) });
|
|
22109
|
+
}
|
|
22110
|
+
static hostedCatalog(options) {
|
|
22111
|
+
return Requests.processRoute(PreordersRoute.routes.hostedCatalog, undefined, undefined, undefined, options);
|
|
22112
|
+
}
|
|
22113
|
+
static createHostedSession(data, options) {
|
|
22114
|
+
return Requests.processRoute(PreordersRoute.routes.createHostedSession, data, undefined, undefined, options);
|
|
22115
|
+
}
|
|
22116
|
+
static createHostedRestoreSession(data, options) {
|
|
22117
|
+
return Requests.processRoute(PreordersRoute.routes.createHostedRestoreSession, data, undefined, undefined, options);
|
|
22118
|
+
}
|
|
22119
|
+
static hostedSession(title_id, session_id, checkoutToken, options) {
|
|
22120
|
+
return Requests.processRoute(PreordersRoute.routes.hostedSession, undefined, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
22121
|
+
}
|
|
22122
|
+
static hostedMine(title_id, session_id, checkoutToken, options) {
|
|
22123
|
+
return Requests.processRoute(PreordersRoute.routes.hostedMine, undefined, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
22124
|
+
}
|
|
22125
|
+
static authenticateHostedSession(title_id, session_id, checkoutToken, options) {
|
|
22126
|
+
return Requests.processRoute(PreordersRoute.routes.hostedAuthenticate, {}, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
22127
|
+
}
|
|
22128
|
+
static checkoutHostedSession(title_id, session_id, checkoutToken, data, options) {
|
|
22129
|
+
return Requests.processRoute(PreordersRoute.routes.hostedCheckout, data, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
22130
|
+
}
|
|
22131
|
+
static reconcileHostedSession(title_id, session_id, checkoutToken, options) {
|
|
22132
|
+
return Requests.processRoute(PreordersRoute.routes.hostedReconcile, {}, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
22133
|
+
}
|
|
22134
|
+
static retryHostedSession(title_id, session_id, checkoutToken, options) {
|
|
22135
|
+
return Requests.processRoute(PreordersRoute.routes.hostedRetry, {}, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
22136
|
+
}
|
|
22137
|
+
static refundHostedOrder(title_id, session_id, checkoutToken, order_id, options) {
|
|
22138
|
+
return Requests.processRoute(PreordersRoute.routes.hostedRefund, { order_id }, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
22139
|
+
}
|
|
22140
|
+
static resendHostedAccess(title_id, session_id, checkoutToken, order_id, options) {
|
|
22141
|
+
return Requests.processRoute(PreordersRoute.routes.hostedResendAccess, { order_id }, { title_id, session_id }, undefined, this.hostedOptions(checkoutToken, options));
|
|
22142
|
+
}
|
|
22143
|
+
static catalog(title_id, options) {
|
|
22144
|
+
return Requests.processRoute(PreordersRoute.routes.catalog, undefined, { title_id }, undefined, options);
|
|
22145
|
+
}
|
|
22146
|
+
static purchase(title_id, offer_id, data, options) {
|
|
22147
|
+
return Requests.processRoute(PreordersRoute.routes.purchase, data, { title_id, offer_id }, undefined, options);
|
|
22148
|
+
}
|
|
22149
|
+
static myOrders(title_id, options) {
|
|
22150
|
+
return Requests.processRoute(PreordersRoute.routes.myOrders, undefined, { title_id }, undefined, options);
|
|
22151
|
+
}
|
|
22152
|
+
static order(title_id, order_id, options) {
|
|
22153
|
+
return Requests.processRoute(PreordersRoute.routes.order, undefined, { title_id, order_id }, undefined, options);
|
|
22154
|
+
}
|
|
22155
|
+
static refundMine(title_id, order_id, options) {
|
|
22156
|
+
return Requests.processRoute(PreordersRoute.routes.refundMine, {}, { title_id, order_id }, undefined, options);
|
|
22157
|
+
}
|
|
22158
|
+
static resendMine(title_id, order_id, options) {
|
|
22159
|
+
return Requests.processRoute(PreordersRoute.routes.resendMine, {}, { title_id, order_id }, undefined, options);
|
|
22160
|
+
}
|
|
22161
|
+
static settings(title_id, options) {
|
|
22162
|
+
return Requests.processRoute(PreordersRoute.routes.settings, undefined, { title_id }, undefined, options);
|
|
22163
|
+
}
|
|
22164
|
+
static updateSettings(title_id, data, options) {
|
|
22165
|
+
return Requests.processRoute(PreordersRoute.routes.updateSettings, data, { title_id }, undefined, options);
|
|
22166
|
+
}
|
|
22167
|
+
static offers(title_id, options) {
|
|
22168
|
+
return Requests.processRoute(PreordersRoute.routes.offers, undefined, { title_id }, undefined, options);
|
|
22169
|
+
}
|
|
22170
|
+
static offer(title_id, offer_id, options) {
|
|
22171
|
+
return Requests.processRoute(PreordersRoute.routes.offer, undefined, { title_id, offer_id }, undefined, options);
|
|
22172
|
+
}
|
|
22173
|
+
static createOffer(title_id, data, options) {
|
|
22174
|
+
return Requests.processRoute(PreordersRoute.routes.createOffer, data, { title_id }, undefined, options);
|
|
22175
|
+
}
|
|
22176
|
+
static updateOffer(title_id, offer_id, data, options) {
|
|
22177
|
+
return Requests.processRoute(PreordersRoute.routes.updateOffer, data, { title_id, offer_id }, undefined, options);
|
|
22178
|
+
}
|
|
22179
|
+
static activateOffer(title_id, offer_id, options) {
|
|
22180
|
+
return Requests.processRoute(PreordersRoute.routes.activateOffer, {}, { title_id, offer_id }, undefined, options);
|
|
22181
|
+
}
|
|
22182
|
+
static pauseOffer(title_id, offer_id, options) {
|
|
22183
|
+
return Requests.processRoute(PreordersRoute.routes.pauseOffer, {}, { title_id, offer_id }, undefined, options);
|
|
22184
|
+
}
|
|
22185
|
+
static archiveOffer(title_id, offer_id, options) {
|
|
22186
|
+
return Requests.processRoute(PreordersRoute.routes.archiveOffer, {}, { title_id, offer_id }, undefined, options);
|
|
22187
|
+
}
|
|
22188
|
+
static inventory(title_id, offer_id, options) {
|
|
22189
|
+
return Requests.processRoute(PreordersRoute.routes.inventory, undefined, { title_id, offer_id }, undefined, options);
|
|
22190
|
+
}
|
|
22191
|
+
static importKeys(title_id, offer_id, keys, options) {
|
|
22192
|
+
return Requests.processRoute(PreordersRoute.routes.importKeys, { keys }, { title_id, offer_id }, undefined, options);
|
|
22193
|
+
}
|
|
22194
|
+
static importKeyFile(title_id, offer_id, file) {
|
|
22195
|
+
const url = PreordersRoute.routes.importKeys.url
|
|
22196
|
+
.replace('{title_id}', title_id)
|
|
22197
|
+
.replace('{offer_id}', offer_id);
|
|
22198
|
+
return Requests.uploadFile(url, 'key_file', file, {}, undefined, undefined, { excludeCommunityContext: true });
|
|
22199
|
+
}
|
|
22200
|
+
static retireKey(title_id, offer_id, key_id, reason, options) {
|
|
22201
|
+
return Requests.processRoute(PreordersRoute.routes.retireKey, { reason }, { title_id, offer_id, key_id }, undefined, options);
|
|
22202
|
+
}
|
|
22203
|
+
static adminOrders(title_id, filters, options) {
|
|
22204
|
+
return Requests.processRoute(PreordersRoute.routes.adminOrders, undefined, { title_id }, filters, options);
|
|
22205
|
+
}
|
|
22206
|
+
static readiness(title_id, options) {
|
|
22207
|
+
return Requests.processRoute(PreordersRoute.routes.readiness, undefined, { title_id }, undefined, options);
|
|
22208
|
+
}
|
|
22209
|
+
static adminOrderAction(title_id, order_id, action, options) {
|
|
22210
|
+
return Requests.processRoute(PreordersRoute.routes.adminOrderAction, {}, { title_id, order_id, action }, undefined, options);
|
|
22211
|
+
}
|
|
22212
|
+
static mcpCapabilities(title_id, options) {
|
|
22213
|
+
return Requests.processRoute(PreordersRoute.routes.mcpCapabilities, undefined, { title_id }, undefined, options);
|
|
22214
|
+
}
|
|
22215
|
+
static mcpOperation(title_id, operation, argumentsData = {}, options) {
|
|
22216
|
+
return Requests.processRoute(PreordersRoute.routes.mcpOperation, { arguments: argumentsData }, { title_id, operation }, undefined, options);
|
|
22217
|
+
}
|
|
22218
|
+
}
|
|
22219
|
+
|
|
21930
22220
|
/** Generate a 256-bit browser nonce. Fails closed without secure Web Crypto. */
|
|
21931
22221
|
function createMicrotransactionNonce() {
|
|
21932
22222
|
var _a;
|
|
@@ -30475,6 +30765,7 @@ Glitch.api = {
|
|
|
30475
30765
|
Hosting: Hosting,
|
|
30476
30766
|
GameDesign: GameDesign,
|
|
30477
30767
|
Microtransactions: Microtransactions,
|
|
30768
|
+
Preorders: Preorders,
|
|
30478
30769
|
};
|
|
30479
30770
|
Glitch.util = {
|
|
30480
30771
|
Requests: Requests,
|