glitch-javascript-sdk 1.5.1 → 1.5.2

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
@@ -24464,7 +24464,7 @@ var MediaRoute = /** @class */ (function () {
24464
24464
  }
24465
24465
  MediaRoute.routes = {
24466
24466
  upload: { url: '/media', method: HTTP_METHODS.POST },
24467
- getMedia: { url: '/media/{meda_id}', method: HTTP_METHODS.GET },
24467
+ getMedia: { url: '/media/{media_id}', method: HTTP_METHODS.GET },
24468
24468
  };
24469
24469
  return MediaRoute;
24470
24470
  }());
@@ -25018,6 +25018,92 @@ var Funnel = /** @class */ (function () {
25018
25018
  return Funnel;
25019
25019
  }());
25020
25020
 
25021
+ var SocialStatsRoute = /** @class */ (function () {
25022
+ function SocialStatsRoute() {
25023
+ }
25024
+ SocialStatsRoute.routes = {
25025
+ /**
25026
+ * Retrieve a list of social statistics with optional filters.
25027
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics
25028
+ */
25029
+ getStats: { url: '/socialstats', method: HTTP_METHODS.GET },
25030
+ /**
25031
+ * Retrieve platform-level statistics (e.g., average followers).
25032
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/platformStatistics
25033
+ */
25034
+ getPlatformStatistics: { url: '/socialstats/statistics', method: HTTP_METHODS.GET },
25035
+ /**
25036
+ * Generate reports with various insights based on report_type and filters.
25037
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/reports
25038
+ */
25039
+ getReports: { url: '/socialstats/reports', method: HTTP_METHODS.GET },
25040
+ /**
25041
+ * Retrieve a single social media account statistic record by its ID.
25042
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/show
25043
+ */
25044
+ getStatById: { url: '/socialstats/{id}', method: HTTP_METHODS.GET },
25045
+ };
25046
+ return SocialStatsRoute;
25047
+ }());
25048
+
25049
+ // src/api/SocialStats.ts
25050
+ var SocialStats = /** @class */ (function () {
25051
+ function SocialStats() {
25052
+ }
25053
+ /**
25054
+ * List all the social media account statistics, with optional filters.
25055
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics
25056
+ *
25057
+ * @param params Optional query parameters:
25058
+ * - platform (string | string[]): Filter by platform(s)
25059
+ * - start_date (string): Filter records created on or after this date (YYYY-MM-DD)
25060
+ * - end_date (string): Filter records created on or before this date (YYYY-MM-DD)
25061
+ * - user_id (string): Filter by user ID
25062
+ * - title_promotion_schedule_id (string): Filter by TitlePromotionSchedule ID
25063
+ * @returns promise
25064
+ */
25065
+ SocialStats.list = function (params) {
25066
+ return Requests.processRoute(SocialStatsRoute.routes.getStats, undefined, undefined, params);
25067
+ };
25068
+ /**
25069
+ * Get platform-level statistics, such as average follower count per platform.
25070
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/platformStatistics
25071
+ *
25072
+ * @returns promise
25073
+ */
25074
+ SocialStats.platformStatistics = function (params) {
25075
+ return Requests.processRoute(SocialStatsRoute.routes.getPlatformStatistics, undefined, undefined, params);
25076
+ };
25077
+ /**
25078
+ * Generate various reports for social media account statistics.
25079
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/reports
25080
+ *
25081
+ * @param params Query parameters:
25082
+ * - report_type (string): Required (e.g. average_followers, growth, platform_breakdown)
25083
+ * - platform (string or string[]): Filter by platform(s)
25084
+ * - start_date (string): Filter from date (YYYY-MM-DD)
25085
+ * - end_date (string): Filter to date (YYYY-MM-DD)
25086
+ * - user_id (string): Filter by user ID
25087
+ * - title_promotion_schedule_id (string): Filter by schedule ID
25088
+ *
25089
+ * @returns promise
25090
+ */
25091
+ SocialStats.reports = function (params) {
25092
+ return Requests.processRoute(SocialStatsRoute.routes.getReports, undefined, undefined, params);
25093
+ };
25094
+ /**
25095
+ * Retrieve a single social media account statistic record by its ID.
25096
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/show
25097
+ *
25098
+ * @param id The ID of the statistic record.
25099
+ * @returns promise
25100
+ */
25101
+ SocialStats.view = function (id, params) {
25102
+ return Requests.processRoute(SocialStatsRoute.routes.getStatById, {}, { id: id }, params);
25103
+ };
25104
+ return SocialStats;
25105
+ }());
25106
+
25021
25107
  var Parser = /** @class */ (function () {
25022
25108
  function Parser() {
25023
25109
  }
@@ -25445,6 +25531,7 @@ var Glitch = /** @class */ (function () {
25445
25531
  Media: Media,
25446
25532
  Scheduler: Scheduler,
25447
25533
  Funnel: Funnel,
25534
+ SocialStats: SocialStats
25448
25535
  };
25449
25536
  Glitch.util = {
25450
25537
  Requests: Requests,