glitch-javascript-sdk 1.5.0 → 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
  }());
@@ -24530,6 +24530,7 @@ var SchedulerRoute = /** @class */ (function () {
24530
24530
  getUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.GET },
24531
24531
  updateUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.PUT },
24532
24532
  deleteUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.DELETE },
24533
+ scheduleUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}/schedule', method: HTTP_METHODS.POST },
24533
24534
  testTone: { url: '/schedulers/{scheduler_id}/tone', method: HTTP_METHODS.POST },
24534
24535
  getSchedulerReports: { url: '/schedulers/{scheduler_id}/reports', method: HTTP_METHODS.GET },
24535
24536
  getSchedulerProgression: { url: '/schedulers/{scheduler_id}/progression', method: HTTP_METHODS.GET },
@@ -24710,6 +24711,20 @@ var Scheduler = /** @class */ (function () {
24710
24711
  Scheduler.deleteUpdate = function (scheduler_id, update_id, params) {
24711
24712
  return Requests.processRoute(SchedulerRoute.routes.deleteUpdate, {}, { scheduler_id: scheduler_id, update_id: update_id }, params);
24712
24713
  };
24714
+ /**
24715
+ * Schedule title update.
24716
+ *
24717
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdate
24718
+ *
24719
+ * @param scheduler_id The ID of the promotion schedule.
24720
+ * @param update_id The ID of the title update.
24721
+ * @param data The data to update.
24722
+ *
24723
+ * @returns promise
24724
+ */
24725
+ Scheduler.scheduleUpdate = function (scheduler_id, update_id, data, params) {
24726
+ return Requests.processRoute(SchedulerRoute.routes.scheduleUpdate, data, { scheduler_id: scheduler_id, update_id: update_id }, params);
24727
+ };
24713
24728
  /**
24714
24729
  * Clear Twitter OAuth credentials from a promotion schedule.
24715
24730
  *
@@ -25003,6 +25018,92 @@ var Funnel = /** @class */ (function () {
25003
25018
  return Funnel;
25004
25019
  }());
25005
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
+
25006
25107
  var Parser = /** @class */ (function () {
25007
25108
  function Parser() {
25008
25109
  }
@@ -25430,6 +25531,7 @@ var Glitch = /** @class */ (function () {
25430
25531
  Media: Media,
25431
25532
  Scheduler: Scheduler,
25432
25533
  Funnel: Funnel,
25534
+ SocialStats: SocialStats
25433
25535
  };
25434
25536
  Glitch.util = {
25435
25537
  Requests: Requests,