glitch-javascript-sdk 1.1.6 → 1.1.7

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
@@ -2307,6 +2307,16 @@ declare class SocialPosts {
2307
2307
  * @returns promise
2308
2308
  */
2309
2309
  static dispute<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2310
+ /**
2311
+ * Get the change of the post metrics over a period of time.
2312
+ *
2313
+ * @see https://api.glitch.fun/api/documentation#/Social%20Media%20Posts/getSocialMediaPostHistory
2314
+ *
2315
+ * @param post_id The id fo the post to retrieve.
2316
+ *
2317
+ * @returns promise
2318
+ */
2319
+ static history<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
2310
2320
  }
2311
2321
 
2312
2322
  declare class Titles {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -55,6 +55,20 @@ class SocialPosts {
55
55
  return Requests.processRoute(SocialPostsRoute.routes.dispute, data, { post_id: post_id }, params);
56
56
  }
57
57
 
58
+ /**
59
+ * Get the change of the post metrics over a period of time.
60
+ *
61
+ * @see https://api.glitch.fun/api/documentation#/Social%20Media%20Posts/getSocialMediaPostHistory
62
+ *
63
+ * @param post_id The id fo the post to retrieve.
64
+ *
65
+ * @returns promise
66
+ */
67
+ public static history<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
68
+
69
+ return Requests.processRoute(SocialPostsRoute.routes.history, {}, { post_id: post_id }, params);
70
+ }
71
+
58
72
  }
59
73
 
60
74
  export default SocialPosts;
@@ -8,6 +8,7 @@ class SocialPostsRoute {
8
8
  createPost: { url: '/socialposts', method: HTTP_METHODS.POST },
9
9
  retrievePost : { url: '/socialposts/{post_id}', method: HTTP_METHODS.GET },
10
10
  dispute: { url: '/social/{post_id}/dispute', method: HTTP_METHODS.POST },
11
+ history : { url: '/socialposts/{post_id}/history', method: HTTP_METHODS.GET },
11
12
  };
12
13
 
13
14
  }