glitch-javascript-sdk 2.7.7 → 2.7.8

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
@@ -26939,6 +26939,7 @@ var GamesRoutes = /** @class */ (function () {
26939
26939
  createCampaignWithTitle: { url: '/games/{game_id}/generateCampaignWithTitle', method: HTTP_METHODS.POST },
26940
26940
  createGameTitle: { url: '/games/{game_id}/generateTitle', method: HTTP_METHODS.POST },
26941
26941
  createGameScheduler: { url: '/games/{game_id}/generateScheduler', method: HTTP_METHODS.POST },
26942
+ releaseStats: { url: '/games/release-stats', method: HTTP_METHODS.GET },
26942
26943
  };
26943
26944
  return GamesRoutes;
26944
26945
  }());
@@ -27004,6 +27005,32 @@ var Games = /** @class */ (function () {
27004
27005
  Games.createGameScheduler = function (game_id, data, params) {
27005
27006
  return Requests.processRoute(GamesRoutes.routes.createGameScheduler, data, { game_id: game_id }, params);
27006
27007
  };
27008
+ /**
27009
+ * Get release competition statistics and Steam danger zones.
27010
+ *
27011
+ * This tool analyzes the 'ExternalGames' database to show how many other games
27012
+ * are releasing around a specific date. It also overlays hard-coded Steam events
27013
+ * like NextFest and Seasonal Sales.
27014
+ *
27015
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/getReleaseStats
27016
+ *
27017
+ * @param params Filtering options:
27018
+ * - precision: 'day' | 'month' | 'year' (Default: 'day'). Use 'month' for long-term planning.
27019
+ * - start_date: 'YYYY-MM-DD'. The date to begin the analysis from.
27020
+ *
27021
+ * @returns AxiosPromise<Response<ReleaseStatsResponse>>
27022
+ *
27023
+ * @example
27024
+ * Games.getReleaseStats({ precision: 'day', start_date: '2025-06-01' })
27025
+ * .then(res => console.log(res.data.data));
27026
+ */
27027
+ Games.getReleaseStats = function (params) {
27028
+ // Defensive check: ensure precision is valid if provided
27029
+ if ((params === null || params === void 0 ? void 0 : params.precision) && !['day', 'month', 'year'].includes(params.precision)) {
27030
+ console.warn("Invalid precision '".concat(params.precision, "' passed to getReleaseStats. Defaulting to 'day'."));
27031
+ }
27032
+ return Requests.processRoute(GamesRoutes.routes.releaseStats, undefined, undefined, params);
27033
+ };
27007
27034
  return Games;
27008
27035
  }());
27009
27036