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.
@@ -126,6 +126,18 @@ declare class Scheduler {
126
126
  * @returns promise
127
127
  */
128
128
  static deleteUpdate<T>(scheduler_id: string, update_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
129
+ /**
130
+ * Schedule title update.
131
+ *
132
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdate
133
+ *
134
+ * @param scheduler_id The ID of the promotion schedule.
135
+ * @param update_id The ID of the title update.
136
+ * @param data The data to update.
137
+ *
138
+ * @returns promise
139
+ */
140
+ static scheduleUpdate<T>(scheduler_id: string, update_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
129
141
  /**
130
142
  * Clear Twitter OAuth credentials from a promotion schedule.
131
143
  *
@@ -0,0 +1,48 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class SocialStats {
4
+ /**
5
+ * List all the social media account statistics, with optional filters.
6
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics
7
+ *
8
+ * @param params Optional query parameters:
9
+ * - platform (string | string[]): Filter by platform(s)
10
+ * - start_date (string): Filter records created on or after this date (YYYY-MM-DD)
11
+ * - end_date (string): Filter records created on or before this date (YYYY-MM-DD)
12
+ * - user_id (string): Filter by user ID
13
+ * - title_promotion_schedule_id (string): Filter by TitlePromotionSchedule ID
14
+ * @returns promise
15
+ */
16
+ static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
17
+ /**
18
+ * Get platform-level statistics, such as average follower count per platform.
19
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/platformStatistics
20
+ *
21
+ * @returns promise
22
+ */
23
+ static platformStatistics<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
24
+ /**
25
+ * Generate various reports for social media account statistics.
26
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/reports
27
+ *
28
+ * @param params Query parameters:
29
+ * - report_type (string): Required (e.g. average_followers, growth, platform_breakdown)
30
+ * - platform (string or string[]): Filter by platform(s)
31
+ * - start_date (string): Filter from date (YYYY-MM-DD)
32
+ * - end_date (string): Filter to date (YYYY-MM-DD)
33
+ * - user_id (string): Filter by user ID
34
+ * - title_promotion_schedule_id (string): Filter by schedule ID
35
+ *
36
+ * @returns promise
37
+ */
38
+ static reports<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
39
+ /**
40
+ * Retrieve a single social media account statistic record by its ID.
41
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/show
42
+ *
43
+ * @param id The ID of the statistic record.
44
+ * @returns promise
45
+ */
46
+ static view<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
47
+ }
48
+ export default SocialStats;
@@ -28,6 +28,7 @@ import PlayTests from "./PlayTests";
28
28
  import Media from "./Media";
29
29
  import Scheduler from "./Scheduler";
30
30
  import Funnel from "./Funnel";
31
+ import SocialStats from "./SocialStats";
31
32
  export { Auth };
32
33
  export { Competitions };
33
34
  export { Communities };
@@ -58,3 +59,4 @@ export { PlayTests };
58
59
  export { Media };
59
60
  export { Scheduler };
60
61
  export { Funnel };
62
+ export { SocialStats };
@@ -28,6 +28,7 @@ import { PlayTests } from "./api";
28
28
  import { Media } from "./api";
29
29
  import { Scheduler } from "./api";
30
30
  import { Funnel } from "./api";
31
+ import { SocialStats } from "./api";
31
32
  import Requests from "./util/Requests";
32
33
  import Parser from "./util/Parser";
33
34
  import Session from "./util/Session";
@@ -77,6 +78,7 @@ declare class Glitch {
77
78
  Media: typeof Media;
78
79
  Scheduler: typeof Scheduler;
79
80
  Funnel: typeof Funnel;
81
+ SocialStats: typeof SocialStats;
80
82
  };
81
83
  static util: {
82
84
  Requests: typeof Requests;
package/dist/esm/index.js CHANGED
@@ -11280,7 +11280,7 @@ var MediaRoute = /** @class */ (function () {
11280
11280
  }
11281
11281
  MediaRoute.routes = {
11282
11282
  upload: { url: '/media', method: HTTP_METHODS.POST },
11283
- getMedia: { url: '/media/{meda_id}', method: HTTP_METHODS.GET },
11283
+ getMedia: { url: '/media/{media_id}', method: HTTP_METHODS.GET },
11284
11284
  };
11285
11285
  return MediaRoute;
11286
11286
  }());
@@ -11346,6 +11346,7 @@ var SchedulerRoute = /** @class */ (function () {
11346
11346
  getUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.GET },
11347
11347
  updateUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.PUT },
11348
11348
  deleteUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.DELETE },
11349
+ scheduleUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}/schedule', method: HTTP_METHODS.POST },
11349
11350
  testTone: { url: '/schedulers/{scheduler_id}/tone', method: HTTP_METHODS.POST },
11350
11351
  getSchedulerReports: { url: '/schedulers/{scheduler_id}/reports', method: HTTP_METHODS.GET },
11351
11352
  getSchedulerProgression: { url: '/schedulers/{scheduler_id}/progression', method: HTTP_METHODS.GET },
@@ -11526,6 +11527,20 @@ var Scheduler = /** @class */ (function () {
11526
11527
  Scheduler.deleteUpdate = function (scheduler_id, update_id, params) {
11527
11528
  return Requests.processRoute(SchedulerRoute.routes.deleteUpdate, {}, { scheduler_id: scheduler_id, update_id: update_id }, params);
11528
11529
  };
11530
+ /**
11531
+ * Schedule title update.
11532
+ *
11533
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdate
11534
+ *
11535
+ * @param scheduler_id The ID of the promotion schedule.
11536
+ * @param update_id The ID of the title update.
11537
+ * @param data The data to update.
11538
+ *
11539
+ * @returns promise
11540
+ */
11541
+ Scheduler.scheduleUpdate = function (scheduler_id, update_id, data, params) {
11542
+ return Requests.processRoute(SchedulerRoute.routes.scheduleUpdate, data, { scheduler_id: scheduler_id, update_id: update_id }, params);
11543
+ };
11529
11544
  /**
11530
11545
  * Clear Twitter OAuth credentials from a promotion schedule.
11531
11546
  *
@@ -11819,6 +11834,92 @@ var Funnel = /** @class */ (function () {
11819
11834
  return Funnel;
11820
11835
  }());
11821
11836
 
11837
+ var SocialStatsRoute = /** @class */ (function () {
11838
+ function SocialStatsRoute() {
11839
+ }
11840
+ SocialStatsRoute.routes = {
11841
+ /**
11842
+ * Retrieve a list of social statistics with optional filters.
11843
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics
11844
+ */
11845
+ getStats: { url: '/socialstats', method: HTTP_METHODS.GET },
11846
+ /**
11847
+ * Retrieve platform-level statistics (e.g., average followers).
11848
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/platformStatistics
11849
+ */
11850
+ getPlatformStatistics: { url: '/socialstats/statistics', method: HTTP_METHODS.GET },
11851
+ /**
11852
+ * Generate reports with various insights based on report_type and filters.
11853
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/reports
11854
+ */
11855
+ getReports: { url: '/socialstats/reports', method: HTTP_METHODS.GET },
11856
+ /**
11857
+ * Retrieve a single social media account statistic record by its ID.
11858
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/show
11859
+ */
11860
+ getStatById: { url: '/socialstats/{id}', method: HTTP_METHODS.GET },
11861
+ };
11862
+ return SocialStatsRoute;
11863
+ }());
11864
+
11865
+ // src/api/SocialStats.ts
11866
+ var SocialStats = /** @class */ (function () {
11867
+ function SocialStats() {
11868
+ }
11869
+ /**
11870
+ * List all the social media account statistics, with optional filters.
11871
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics
11872
+ *
11873
+ * @param params Optional query parameters:
11874
+ * - platform (string | string[]): Filter by platform(s)
11875
+ * - start_date (string): Filter records created on or after this date (YYYY-MM-DD)
11876
+ * - end_date (string): Filter records created on or before this date (YYYY-MM-DD)
11877
+ * - user_id (string): Filter by user ID
11878
+ * - title_promotion_schedule_id (string): Filter by TitlePromotionSchedule ID
11879
+ * @returns promise
11880
+ */
11881
+ SocialStats.list = function (params) {
11882
+ return Requests.processRoute(SocialStatsRoute.routes.getStats, undefined, undefined, params);
11883
+ };
11884
+ /**
11885
+ * Get platform-level statistics, such as average follower count per platform.
11886
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/platformStatistics
11887
+ *
11888
+ * @returns promise
11889
+ */
11890
+ SocialStats.platformStatistics = function (params) {
11891
+ return Requests.processRoute(SocialStatsRoute.routes.getPlatformStatistics, undefined, undefined, params);
11892
+ };
11893
+ /**
11894
+ * Generate various reports for social media account statistics.
11895
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/reports
11896
+ *
11897
+ * @param params Query parameters:
11898
+ * - report_type (string): Required (e.g. average_followers, growth, platform_breakdown)
11899
+ * - platform (string or string[]): Filter by platform(s)
11900
+ * - start_date (string): Filter from date (YYYY-MM-DD)
11901
+ * - end_date (string): Filter to date (YYYY-MM-DD)
11902
+ * - user_id (string): Filter by user ID
11903
+ * - title_promotion_schedule_id (string): Filter by schedule ID
11904
+ *
11905
+ * @returns promise
11906
+ */
11907
+ SocialStats.reports = function (params) {
11908
+ return Requests.processRoute(SocialStatsRoute.routes.getReports, undefined, undefined, params);
11909
+ };
11910
+ /**
11911
+ * Retrieve a single social media account statistic record by its ID.
11912
+ * @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/show
11913
+ *
11914
+ * @param id The ID of the statistic record.
11915
+ * @returns promise
11916
+ */
11917
+ SocialStats.view = function (id, params) {
11918
+ return Requests.processRoute(SocialStatsRoute.routes.getStatById, {}, { id: id }, params);
11919
+ };
11920
+ return SocialStats;
11921
+ }());
11922
+
11822
11923
  var Parser = /** @class */ (function () {
11823
11924
  function Parser() {
11824
11925
  }
@@ -12246,6 +12347,7 @@ var Glitch = /** @class */ (function () {
12246
12347
  Media: Media,
12247
12348
  Scheduler: Scheduler,
12248
12349
  Funnel: Funnel,
12350
+ SocialStats: SocialStats
12249
12351
  };
12250
12352
  Glitch.util = {
12251
12353
  Requests: Requests,