glitch-javascript-sdk 2.7.7 → 2.8.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/cjs/index.js CHANGED
@@ -24877,6 +24877,14 @@ var TitlesRoute = /** @class */ (function () {
24877
24877
  createBehavioralFunnel: { url: '/titles/{title_id}/behavioral-funnels', method: HTTP_METHODS.POST },
24878
24878
  behavioralFunnelReport: { url: '/titles/{title_id}/behavioral-funnels/{funnel_id}/report', method: HTTP_METHODS.GET },
24879
24879
  deleteBehavioralFunnel: { url: '/titles/{title_id}/behavioral-funnels/{funnel_id}', method: HTTP_METHODS.DELETE },
24880
+ // Aegis Deployment
24881
+ getDeploymentUploadUrl: { url: '/titles/{title_id}/deployments/presigned-url', method: HTTP_METHODS.POST },
24882
+ confirmDeployment: { url: '/titles/{title_id}/deployments/confirm', method: HTTP_METHODS.POST },
24883
+ getPlaySession: { url: '/titles/{title_id}/play', method: HTTP_METHODS.GET },
24884
+ // Aegis Payouts
24885
+ listDeveloperPayouts: { url: '/titles/{title_id}/payouts', method: HTTP_METHODS.GET },
24886
+ viewDeveloperPayout: { url: '/titles/{title_id}/payouts/{payout_id}', method: HTTP_METHODS.GET },
24887
+ developerPayoutSummary: { url: '/titles/{title_id}/payouts/summary', method: HTTP_METHODS.GET },
24880
24888
  };
24881
24889
  return TitlesRoute;
24882
24890
  }());
@@ -25496,6 +25504,44 @@ var Titles = /** @class */ (function () {
25496
25504
  Titles.deleteBehavioralFunnel = function (title_id, funnel_id) {
25497
25505
  return Requests.processRoute(TitlesRoute.routes.deleteBehavioralFunnel, {}, { title_id: title_id, funnel_id: funnel_id });
25498
25506
  };
25507
+ /**
25508
+ * Generates a presigned S3 URL for uploading a game build ZIP.
25509
+ */
25510
+ Titles.getDeploymentUploadUrl = function (title_id) {
25511
+ return Requests.processRoute(TitlesRoute.routes.getDeploymentUploadUrl, {}, { title_id: title_id });
25512
+ };
25513
+ /**
25514
+ * Confirms the upload and starts the automated deployment/extraction process.
25515
+ * @param data { file_path: string, version_string: string, entry_point?: string }
25516
+ */
25517
+ Titles.confirmDeployment = function (title_id, data) {
25518
+ return Requests.processRoute(TitlesRoute.routes.confirmDeployment, data, { title_id: title_id });
25519
+ };
25520
+ /**
25521
+ * Initializes a play session. Handles age-gating and license verification.
25522
+ * Returns the CDN URL for WASM/iFrame or Signaling URL for Pixel Streaming.
25523
+ */
25524
+ Titles.getPlaySession = function (title_id) {
25525
+ return Requests.processRoute(TitlesRoute.routes.getPlaySession, {}, { title_id: title_id });
25526
+ };
25527
+ /**
25528
+ * List all developer payouts for a title.
25529
+ */
25530
+ Titles.listDeveloperPayouts = function (title_id, params) {
25531
+ return Requests.processRoute(TitlesRoute.routes.listDeveloperPayouts, undefined, { title_id: title_id }, params);
25532
+ };
25533
+ /**
25534
+ * View a specific payout record.
25535
+ */
25536
+ Titles.viewDeveloperPayout = function (title_id, payout_id) {
25537
+ return Requests.processRoute(TitlesRoute.routes.viewDeveloperPayout, {}, { title_id: title_id, payout_id: payout_id });
25538
+ };
25539
+ /**
25540
+ * Get the total earnings and playtime summary for a title.
25541
+ */
25542
+ Titles.getDeveloperPayoutSummary = function (title_id) {
25543
+ return Requests.processRoute(TitlesRoute.routes.developerPayoutSummary, {}, { title_id: title_id });
25544
+ };
25499
25545
  return Titles;
25500
25546
  }());
25501
25547
 
@@ -26539,6 +26585,7 @@ var SubscriptionsRoute = /** @class */ (function () {
26539
26585
  url: '/subscriptions/communities/custom/{community_id}',
26540
26586
  method: HTTP_METHODS.POST
26541
26587
  },
26588
+ purchaseLicense: { url: '/titles/{title_id}/purchase', method: HTTP_METHODS.POST },
26542
26589
  };
26543
26590
  return SubscriptionsRoute;
26544
26591
  }());
@@ -26646,6 +26693,14 @@ var Subscriptions = /** @class */ (function () {
26646
26693
  Subscriptions.createCustomCommunitySubscription = function (community_id, data, params) {
26647
26694
  return Requests.processRoute(SubscriptionsRoute.routes.createCustomCommunitySubscription, data, { community_id: community_id }, params);
26648
26695
  };
26696
+ /**
26697
+ * Purchase a permanent license or rent a game title.
26698
+ * If a rental was active in the last 7 days, the fee is automatically deducted from the premium price.
26699
+ * @param data { purchase_type: 'premium' | 'rental', payment_method_id: string }
26700
+ */
26701
+ Subscriptions.purchaseLicense = function (title_id, data) {
26702
+ return Requests.processRoute(SubscriptionsRoute.routes.purchaseLicense, data, { title_id: title_id });
26703
+ };
26649
26704
  return Subscriptions;
26650
26705
  }());
26651
26706
 
@@ -26939,6 +26994,7 @@ var GamesRoutes = /** @class */ (function () {
26939
26994
  createCampaignWithTitle: { url: '/games/{game_id}/generateCampaignWithTitle', method: HTTP_METHODS.POST },
26940
26995
  createGameTitle: { url: '/games/{game_id}/generateTitle', method: HTTP_METHODS.POST },
26941
26996
  createGameScheduler: { url: '/games/{game_id}/generateScheduler', method: HTTP_METHODS.POST },
26997
+ releaseStats: { url: '/games/release-stats', method: HTTP_METHODS.GET },
26942
26998
  };
26943
26999
  return GamesRoutes;
26944
27000
  }());
@@ -27004,6 +27060,32 @@ var Games = /** @class */ (function () {
27004
27060
  Games.createGameScheduler = function (game_id, data, params) {
27005
27061
  return Requests.processRoute(GamesRoutes.routes.createGameScheduler, data, { game_id: game_id }, params);
27006
27062
  };
27063
+ /**
27064
+ * Get release competition statistics and Steam danger zones.
27065
+ *
27066
+ * This tool analyzes the 'ExternalGames' database to show how many other games
27067
+ * are releasing around a specific date. It also overlays hard-coded Steam events
27068
+ * like NextFest and Seasonal Sales.
27069
+ *
27070
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/getReleaseStats
27071
+ *
27072
+ * @param params Filtering options:
27073
+ * - precision: 'day' | 'month' | 'year' (Default: 'day'). Use 'month' for long-term planning.
27074
+ * - start_date: 'YYYY-MM-DD'. The date to begin the analysis from.
27075
+ *
27076
+ * @returns AxiosPromise<Response<ReleaseStatsResponse>>
27077
+ *
27078
+ * @example
27079
+ * Games.getReleaseStats({ precision: 'day', start_date: '2025-06-01' })
27080
+ * .then(res => console.log(res.data.data));
27081
+ */
27082
+ Games.getReleaseStats = function (params) {
27083
+ // Defensive check: ensure precision is valid if provided
27084
+ if ((params === null || params === void 0 ? void 0 : params.precision) && !['day', 'month', 'year'].includes(params.precision)) {
27085
+ console.warn("Invalid precision '".concat(params.precision, "' passed to getReleaseStats. Defaulting to 'day'."));
27086
+ }
27087
+ return Requests.processRoute(GamesRoutes.routes.releaseStats, undefined, undefined, params);
27088
+ };
27007
27089
  return Games;
27008
27090
  }());
27009
27091