glitch-javascript-sdk 1.5.1 → 1.5.3

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
@@ -22546,6 +22546,7 @@ var SocialPostsRoute = /** @class */ (function () {
22546
22546
  removeMedia: { url: '/socialposts/{post_id}/removeMedia/{media_id}', method: HTTP_METHODS.DELETE },
22547
22547
  reschedule: { url: '/socialposts/{post_id}/reschedule', method: HTTP_METHODS.POST },
22548
22548
  reports: { url: '/socialposts/{post_id}/reports', method: HTTP_METHODS.GET },
22549
+ updatePostImpressions: { url: '/socialposts/{post_id}/impressions', method: HTTP_METHODS.PUT },
22549
22550
  };
22550
22551
  return SocialPostsRoute;
22551
22552
  }());
@@ -22681,6 +22682,18 @@ var SocialPosts = /** @class */ (function () {
22681
22682
  SocialPosts.reports = function (params) {
22682
22683
  return Requests.processRoute(SocialPostsRoute.routes.reports, undefined, undefined, params);
22683
22684
  };
22685
+ /**
22686
+ * Update the information about a post impressions, for posts who API do not give view counts.
22687
+ *
22688
+ * @see https://api.glitch.fun/api/documentation#/Post%20Route/showPostStorage
22689
+ *
22690
+ * @param post_id The id fo the post to retrieve.
22691
+ *
22692
+ * @returns promise
22693
+ */
22694
+ SocialPosts.updatePostImpressions = function (post_id, data, params) {
22695
+ return Requests.processRoute(SocialPostsRoute.routes.updatePostImpressions, data, { post_id: post_id }, params);
22696
+ };
22684
22697
  return SocialPosts;
22685
22698
  }());
22686
22699
 
@@ -24464,7 +24477,7 @@ var MediaRoute = /** @class */ (function () {
24464
24477
  }
24465
24478
  MediaRoute.routes = {
24466
24479
  upload: { url: '/media', method: HTTP_METHODS.POST },
24467
- getMedia: { url: '/media/{meda_id}', method: HTTP_METHODS.GET },
24480
+ getMedia: { url: '/media/{media_id}', method: HTTP_METHODS.GET },
24468
24481
  };
24469
24482
  return MediaRoute;
24470
24483
  }());
@@ -25018,6 +25031,92 @@ var Funnel = /** @class */ (function () {
25018
25031
  return Funnel;
25019
25032
  }());
25020
25033
 
25034
+ var SocialStatsRoute = /** @class */ (function () {
25035
+ function SocialStatsRoute() {
25036
+ }
25037
+ SocialStatsRoute.routes = {
25038
+ /**
25039
+ * Retrieve a list of social statistics with optional filters.
25040
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics
25041
+ */
25042
+ getStats: { url: '/socialstats', method: HTTP_METHODS.GET },
25043
+ /**
25044
+ * Retrieve platform-level statistics (e.g., average followers).
25045
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/platformStatistics
25046
+ */
25047
+ getPlatformStatistics: { url: '/socialstats/statistics', method: HTTP_METHODS.GET },
25048
+ /**
25049
+ * Generate reports with various insights based on report_type and filters.
25050
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/reports
25051
+ */
25052
+ getReports: { url: '/socialstats/reports', method: HTTP_METHODS.GET },
25053
+ /**
25054
+ * Retrieve a single social media account statistic record by its ID.
25055
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/show
25056
+ */
25057
+ getStatById: { url: '/socialstats/{id}', method: HTTP_METHODS.GET },
25058
+ };
25059
+ return SocialStatsRoute;
25060
+ }());
25061
+
25062
+ // src/api/SocialStats.ts
25063
+ var SocialStats = /** @class */ (function () {
25064
+ function SocialStats() {
25065
+ }
25066
+ /**
25067
+ * List all the social media account statistics, with optional filters.
25068
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics
25069
+ *
25070
+ * @param params Optional query parameters:
25071
+ * - platform (string | string[]): Filter by platform(s)
25072
+ * - start_date (string): Filter records created on or after this date (YYYY-MM-DD)
25073
+ * - end_date (string): Filter records created on or before this date (YYYY-MM-DD)
25074
+ * - user_id (string): Filter by user ID
25075
+ * - title_promotion_schedule_id (string): Filter by TitlePromotionSchedule ID
25076
+ * @returns promise
25077
+ */
25078
+ SocialStats.list = function (params) {
25079
+ return Requests.processRoute(SocialStatsRoute.routes.getStats, undefined, undefined, params);
25080
+ };
25081
+ /**
25082
+ * Get platform-level statistics, such as average follower count per platform.
25083
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/platformStatistics
25084
+ *
25085
+ * @returns promise
25086
+ */
25087
+ SocialStats.platformStatistics = function (params) {
25088
+ return Requests.processRoute(SocialStatsRoute.routes.getPlatformStatistics, undefined, undefined, params);
25089
+ };
25090
+ /**
25091
+ * Generate various reports for social media account statistics.
25092
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/reports
25093
+ *
25094
+ * @param params Query parameters:
25095
+ * - report_type (string): Required (e.g. average_followers, growth, platform_breakdown)
25096
+ * - platform (string or string[]): Filter by platform(s)
25097
+ * - start_date (string): Filter from date (YYYY-MM-DD)
25098
+ * - end_date (string): Filter to date (YYYY-MM-DD)
25099
+ * - user_id (string): Filter by user ID
25100
+ * - title_promotion_schedule_id (string): Filter by schedule ID
25101
+ *
25102
+ * @returns promise
25103
+ */
25104
+ SocialStats.reports = function (params) {
25105
+ return Requests.processRoute(SocialStatsRoute.routes.getReports, undefined, undefined, params);
25106
+ };
25107
+ /**
25108
+ * Retrieve a single social media account statistic record by its ID.
25109
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/show
25110
+ *
25111
+ * @param id The ID of the statistic record.
25112
+ * @returns promise
25113
+ */
25114
+ SocialStats.view = function (id, params) {
25115
+ return Requests.processRoute(SocialStatsRoute.routes.getStatById, {}, { id: id }, params);
25116
+ };
25117
+ return SocialStats;
25118
+ }());
25119
+
25021
25120
  var Parser = /** @class */ (function () {
25022
25121
  function Parser() {
25023
25122
  }
@@ -25445,6 +25544,7 @@ var Glitch = /** @class */ (function () {
25445
25544
  Media: Media,
25446
25545
  Scheduler: Scheduler,
25447
25546
  Funnel: Funnel,
25547
+ SocialStats: SocialStats
25448
25548
  };
25449
25549
  Glitch.util = {
25450
25550
  Requests: Requests,