glitch-javascript-sdk 1.4.2 → 1.4.4

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/index.d.ts CHANGED
@@ -2657,6 +2657,14 @@ declare class SocialPosts {
2657
2657
  * @returns promise
2658
2658
  */
2659
2659
  static reschedule<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2660
+ /**
2661
+ * Get the reports for a social media post
2662
+ *
2663
+ * @see https://api.glitch.fun/api/documentation#/Post%20Route/resourcePostList
2664
+ *
2665
+ * @returns promise
2666
+ */
2667
+ static reports<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
2660
2668
  }
2661
2669
 
2662
2670
  declare class Titles {
@@ -4193,6 +4201,22 @@ declare class Scheduler {
4193
4201
  * @returns promise
4194
4202
  */
4195
4203
  static getDiscordChannels<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4204
+ /**
4205
+ * Get aggregated reports for a promotion schedule.
4206
+ *
4207
+ * @param scheduler_id The ID of the promotion schedule.
4208
+ * @param params Query parameters (e.g., social_platform, start_date, end_date)
4209
+ * @returns promise
4210
+ */
4211
+ static getSchedulerReports<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4212
+ /**
4213
+ * Get progression data for social media posts over time.
4214
+ *
4215
+ * @param scheduler_id The ID of the promotion schedule.
4216
+ * @param params Query parameters (e.g., social_platform, start_date, end_date)
4217
+ * @returns promise
4218
+ */
4219
+ static getSchedulerProgression<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4196
4220
  }
4197
4221
 
4198
4222
  declare class Funnel {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -356,6 +356,28 @@ class Scheduler {
356
356
  return Requests.processRoute(SchedulerRoute.routes.getDiscordChannels, {}, { scheduler_id }, params);
357
357
  }
358
358
 
359
+ /**
360
+ * Get aggregated reports for a promotion schedule.
361
+ *
362
+ * @param scheduler_id The ID of the promotion schedule.
363
+ * @param params Query parameters (e.g., social_platform, start_date, end_date)
364
+ * @returns promise
365
+ */
366
+ public static getSchedulerReports<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
367
+ return Requests.processRoute(SchedulerRoute.routes.getSchedulerReports, {}, { scheduler_id }, params);
368
+ }
369
+
370
+ /**
371
+ * Get progression data for social media posts over time.
372
+ *
373
+ * @param scheduler_id The ID of the promotion schedule.
374
+ * @param params Query parameters (e.g., social_platform, start_date, end_date)
375
+ * @returns promise
376
+ */
377
+ public static getSchedulerProgression<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
378
+ return Requests.processRoute(SchedulerRoute.routes.getSchedulerProgression, {}, { scheduler_id }, params);
379
+ }
380
+
359
381
  }
360
382
 
361
383
  export default Scheduler;
@@ -126,6 +126,17 @@ class SocialPosts {
126
126
  return Requests.processRoute(SocialPostsRoute.routes.reschedule, data, { post_id: post_id }, params);
127
127
  }
128
128
 
129
+ /**
130
+ * Get the reports for a social media post
131
+ *
132
+ * @see https://api.glitch.fun/api/documentation#/Post%20Route/resourcePostList
133
+ *
134
+ * @returns promise
135
+ */
136
+ public static reports<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
137
+ return Requests.processRoute(SocialPostsRoute.routes.reports, undefined, undefined, params);
138
+ }
139
+
129
140
  }
130
141
 
131
142
  export default SocialPosts;
@@ -19,6 +19,8 @@ class SchedulerRoute {
19
19
  deleteUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.DELETE },
20
20
 
21
21
  testTone: { url: '/schedulers/{scheduler_id}/tone', method: HTTP_METHODS.POST },
22
+ getSchedulerReports: { url: '/schedulers/{scheduler_id}/reports', method: HTTP_METHODS.GET },
23
+ getSchedulerProgression: { url: '/schedulers/{scheduler_id}/progression', method: HTTP_METHODS.GET },
22
24
 
23
25
  // Clear OAuth Routes
24
26
  clearTwitterAuth: { url: '/schedulers/{scheduler_id}/clearTwitterAuth', method: HTTP_METHODS.DELETE },
@@ -13,6 +13,8 @@ class SocialPostsRoute {
13
13
  addMedia: { url: '/socialposts/{post_id}/addMedia', method: HTTP_METHODS.POST },
14
14
  removeMedia: { url: '/socialposts/{post_id}/removeMedia/{media_id}', method: HTTP_METHODS.DELETE },
15
15
  reschedule: { url: '/socialposts/{post_id}/reschedule', method: HTTP_METHODS.POST },
16
+ reports: { url: '/socialposts/{post_id}/reports', method: HTTP_METHODS.GET },
17
+
16
18
  };
17
19
 
18
20
  }
@@ -231,7 +231,7 @@ class Requests {
231
231
 
232
232
  // Format URL
233
233
  url = url.replace(/\/\//g, '/');
234
- const uri = `${Requests.baseUrl}${url}`.replace(/\/\//g, '/');
234
+ const uri = `${url}`.replace(/\/\//g, '/');
235
235
 
236
236
  // Make the request
237
237
  return axios({
@@ -286,7 +286,7 @@ class Requests {
286
286
  }
287
287
 
288
288
  // Construct the full URL if necessary or use a method to determine the base URL
289
- const fullUploadUrl = `${Requests.baseUrl}${uploadUrl}`;
289
+ const fullUploadUrl = `${uploadUrl}`;
290
290
 
291
291
  // Make sure the authorization token is included if required
292
292
  const headers: { [key: string]: string } = {};