glitch-javascript-sdk 2.3.5 → 2.3.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
@@ -3620,6 +3620,14 @@ declare class SocialPosts {
3620
3620
  * @returns promise
3621
3621
  */
3622
3622
  static syncHistory<T>(platform: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3623
+ /**
3624
+ * Perform a social action (Like, Repost, Vote) on a post.
3625
+ *
3626
+ * @param post_id The ID of the social media post.
3627
+ * @param action The action to perform.
3628
+ * @returns promise
3629
+ */
3630
+ static performAction<T>(post_id: string, action: 'like' | 'unlike' | 'repost' | 'unrepost' | 'vote_up' | 'vote_down' | 'unvote'): AxiosPromise<Response<T>>;
3623
3631
  }
3624
3632
 
3625
3633
  declare class Titles {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.3.5",
3
+ "version": "2.3.7",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -341,6 +341,27 @@ class SocialPosts {
341
341
  return Requests.processRoute(SocialPostsRoute.routes.syncHistory, {}, { platform }, params);
342
342
  }
343
343
 
344
+ /**
345
+ * Perform a social action (Like, Repost, Vote) on a post.
346
+ *
347
+ * @param post_id The ID of the social media post.
348
+ * @param action The action to perform.
349
+ * @returns promise
350
+ */
351
+ public static performAction<T>(post_id: string, action: 'like' | 'unlike' | 'repost' | 'unrepost' | 'vote_up' | 'vote_down' | 'unvote'): AxiosPromise<Response<T>> {
352
+ return Requests.processRoute(SocialPostsRoute.routes.performAction, { action }, { post_id });
353
+ }
354
+
355
+ /**
356
+ * Perform a social action (Like, Repost, Vote) on a comment.
357
+ *
358
+ * @param comment_id The ID of the comment.
359
+ * @param action The action to perform.
360
+ * @returns promise
361
+ */
362
+ public static performCommentAction<T>(comment_id: string, action: 'like' | 'unlike' | 'repost' | 'unrepost' | 'vote_up' | 'vote_down' | 'unvote'): AxiosPromise<Response<T>> {
363
+ return Requests.processRoute(SocialPostsRoute.routes.performCommentAction, { action }, { comment_id });
364
+ }
344
365
  }
345
366
 
346
367
  export default SocialPosts;
@@ -36,6 +36,8 @@ class SocialPostsRoute {
36
36
  getLinkSummary: { url: '/socialposts/{post_id}/link-summary', method: HTTP_METHODS.GET },
37
37
  syncHistory: { url: '/social/sync-history/{platform}', method: HTTP_METHODS.POST },
38
38
 
39
+ performAction: { url: '/socialposts/{post_id}/action', method: HTTP_METHODS.POST },
40
+ performCommentAction: { url: '/socialposts/comments/{comment_id}/action', method: HTTP_METHODS.POST },
39
41
  };
40
42
 
41
43
  }