glitch-javascript-sdk 2.4.5 → 2.4.6

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
@@ -3640,6 +3640,52 @@ declare class SocialPosts {
3640
3640
  * Get ad creative performance matrix.
3641
3641
  */
3642
3642
  static creativePerformance<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
3643
+ /**
3644
+ * List social media conversations.
3645
+ *
3646
+ * @see https://api.glitch.fun/api/documentation#/Social%20Messaging/listSocialConversations
3647
+ *
3648
+ * @param params Query parameters (scheduler_id, platform, page, per_page).
3649
+ * @returns promise
3650
+ */
3651
+ static listConversations<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
3652
+ /**
3653
+ * Sync conversations from external platform.
3654
+ *
3655
+ * @see https://api.glitch.fun/api/documentation#/Social%20Messaging/syncSocialConversations
3656
+ *
3657
+ * @param data Body parameters (platform, scheduler_id).
3658
+ * @returns promise
3659
+ */
3660
+ static syncConversations<T>(data: object): AxiosPromise<Response<T>>;
3661
+ /**
3662
+ * Get a specific conversation.
3663
+ *
3664
+ * @see https://api.glitch.fun/api/documentation#/Social%20Messaging/getSocialConversation
3665
+ *
3666
+ * @param conversation_id The ID of the conversation.
3667
+ * @returns promise
3668
+ */
3669
+ static getConversation<T>(conversation_id: string): AxiosPromise<Response<T>>;
3670
+ /**
3671
+ * List messages in a conversation.
3672
+ *
3673
+ * @see https://api.glitch.fun/api/documentation#/Social%20Messaging/listSocialMessages
3674
+ *
3675
+ * @param conversation_id The ID of the conversation.
3676
+ * @param params Query parameters (sync, page, per_page).
3677
+ * @returns promise
3678
+ */
3679
+ static getConversationMessages<T>(conversation_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3680
+ /**
3681
+ * Send a Direct Message.
3682
+ *
3683
+ * @see https://api.glitch.fun/api/documentation#/Social%20Messaging/sendSocialMessage
3684
+ *
3685
+ * @param data Body parameters (message, conversation_id, recipient_id, platform, scheduler_id, media_ids).
3686
+ * @returns promise
3687
+ */
3688
+ static sendSocialMessage<T>(data: object): AxiosPromise<Response<T>>;
3643
3689
  }
3644
3690
 
3645
3691
  declare class Titles {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.4.5",
3
+ "version": "2.4.6",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -369,6 +369,67 @@ class SocialPosts {
369
369
  public static creativePerformance<T>(params: Record<string, any>): AxiosPromise<Response<T>> {
370
370
  return Requests.processRoute(SocialPostsRoute.routes.creativePerformance, {}, {}, params);
371
371
  }
372
+
373
+ /**
374
+ * List social media conversations.
375
+ *
376
+ * @see https://api.glitch.fun/api/documentation#/Social%20Messaging/listSocialConversations
377
+ *
378
+ * @param params Query parameters (scheduler_id, platform, page, per_page).
379
+ * @returns promise
380
+ */
381
+ public static listConversations<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
382
+ return Requests.processRoute(SocialPostsRoute.routes.listConversations, undefined, undefined, params);
383
+ }
384
+
385
+ /**
386
+ * Sync conversations from external platform.
387
+ *
388
+ * @see https://api.glitch.fun/api/documentation#/Social%20Messaging/syncSocialConversations
389
+ *
390
+ * @param data Body parameters (platform, scheduler_id).
391
+ * @returns promise
392
+ */
393
+ public static syncConversations<T>(data: object): AxiosPromise<Response<T>> {
394
+ return Requests.processRoute(SocialPostsRoute.routes.syncConversations, data);
395
+ }
396
+
397
+ /**
398
+ * Get a specific conversation.
399
+ *
400
+ * @see https://api.glitch.fun/api/documentation#/Social%20Messaging/getSocialConversation
401
+ *
402
+ * @param conversation_id The ID of the conversation.
403
+ * @returns promise
404
+ */
405
+ public static getConversation<T>(conversation_id: string): AxiosPromise<Response<T>> {
406
+ return Requests.processRoute(SocialPostsRoute.routes.getConversation, undefined, { conversation_id });
407
+ }
408
+
409
+ /**
410
+ * List messages in a conversation.
411
+ *
412
+ * @see https://api.glitch.fun/api/documentation#/Social%20Messaging/listSocialMessages
413
+ *
414
+ * @param conversation_id The ID of the conversation.
415
+ * @param params Query parameters (sync, page, per_page).
416
+ * @returns promise
417
+ */
418
+ public static getConversationMessages<T>(conversation_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
419
+ return Requests.processRoute(SocialPostsRoute.routes.getConversationMessages, undefined, { conversation_id }, params);
420
+ }
421
+
422
+ /**
423
+ * Send a Direct Message.
424
+ *
425
+ * @see https://api.glitch.fun/api/documentation#/Social%20Messaging/sendSocialMessage
426
+ *
427
+ * @param data Body parameters (message, conversation_id, recipient_id, platform, scheduler_id, media_ids).
428
+ * @returns promise
429
+ */
430
+ public static sendSocialMessage<T>(data: object): AxiosPromise<Response<T>> {
431
+ return Requests.processRoute(SocialPostsRoute.routes.sendSocialMessage, data);
432
+ }
372
433
  }
373
434
 
374
435
  export default SocialPosts;
@@ -41,6 +41,13 @@ class SocialPostsRoute {
41
41
 
42
42
  creativePerformance: { url: '/socialposts/creative-performance', method: HTTP_METHODS.GET },
43
43
 
44
+ // Social Messaging (DM) Routes
45
+ listConversations: { url: '/social/conversations', method: HTTP_METHODS.GET },
46
+ syncConversations: { url: '/social/conversations/sync', method: HTTP_METHODS.POST },
47
+ getConversation: { url: '/social/conversations/{conversation_id}', method: HTTP_METHODS.GET },
48
+ getConversationMessages: { url: '/social/conversations/{conversation_id}/messages', method: HTTP_METHODS.GET },
49
+ sendSocialMessage: { url: '/social/messages', method: HTTP_METHODS.POST },
50
+
44
51
  };
45
52
 
46
53
  }