glitch-javascript-sdk 1.8.6 → 1.8.8

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
@@ -910,6 +910,27 @@ declare class Ads {
910
910
  * @returns The synced AdGroup resource
911
911
  */
912
912
  static syncGroup<T>(campaign_id: string, group_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
913
+ static listRedditAdPosts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
914
+ /** Create a Reddit ad-style social-media post */
915
+ static createRedditAdPost<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
916
+ /** Retrieve a single Reddit ad-style social-media post */
917
+ static viewRedditAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
918
+ /** Update a Reddit ad-style social-media post */
919
+ static updateRedditAdPost<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
920
+ static listTwitterAdPosts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
921
+ static createTwitterAdPost<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
922
+ static viewTwitterAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
923
+ static updateTwitterAdPost<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
924
+ static deleteTwitterAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
925
+ static listFacebookAdPosts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
926
+ static createFacebookAdPost<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
927
+ static viewFacebookAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
928
+ static updateFacebookAdPost<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
929
+ static deleteFacebookAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
930
+ static tiktokUploadImage<T>(data: FormData, params?: Record<string, any>): AxiosPromise<Response<T>>;
931
+ static tiktokUploadVideo<T>(data: FormData, params?: Record<string, any>): AxiosPromise<Response<T>>;
932
+ static tiktokUploadMusic<T>(data: FormData, params?: Record<string, any>): AxiosPromise<Response<T>>;
933
+ static tiktokGetMediaInfo<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
913
934
  }
914
935
 
915
936
  declare class Communities {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.8.6",
3
+ "version": "1.8.8",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/api/Ads.ts CHANGED
@@ -601,6 +601,193 @@ class Ads {
601
601
  );
602
602
  }
603
603
 
604
+ public static listRedditAdPosts<T>(
605
+ params?: Record<string, any>
606
+ ): AxiosPromise<Response<T>> {
607
+ return Requests.processRoute(
608
+ AdsRoute.routes.getRedditAdPosts,
609
+ undefined,
610
+ undefined,
611
+ params
612
+ );
613
+ }
614
+
615
+ /** Create a Reddit ad-style social-media post */
616
+ public static createRedditAdPost<T>(
617
+ data?: object,
618
+ params?: Record<string, any>
619
+ ): AxiosPromise<Response<T>> {
620
+ return Requests.processRoute(
621
+ AdsRoute.routes.createRedditAdPost,
622
+ data,
623
+ {},
624
+ params
625
+ );
626
+ }
627
+
628
+ /** Retrieve a single Reddit ad-style social-media post */
629
+ public static viewRedditAdPost<T>(
630
+ post_id: string,
631
+ params?: Record<string, any>
632
+ ): AxiosPromise<Response<T>> {
633
+ return Requests.processRoute(
634
+ AdsRoute.routes.retrieveRedditAdPost,
635
+ {},
636
+ { post_id },
637
+ params
638
+ );
639
+ }
640
+
641
+ /** Update a Reddit ad-style social-media post */
642
+ public static updateRedditAdPost<T>(
643
+ post_id: string,
644
+ data?: object,
645
+ params?: Record<string, any>
646
+ ): AxiosPromise<Response<T>> {
647
+ return Requests.processRoute(
648
+ AdsRoute.routes.updateRedditAdPost,
649
+ data,
650
+ { post_id },
651
+ params
652
+ );
653
+ }
654
+
655
+ public static listTwitterAdPosts<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
656
+ return Requests.processRoute(
657
+ AdsRoute.routes.getTwitterAdPosts,
658
+ undefined,
659
+ undefined,
660
+ params
661
+ );
662
+ }
663
+
664
+ public static createTwitterAdPost<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
665
+ return Requests.processRoute(
666
+ AdsRoute.routes.createTwitterAdPost,
667
+ data,
668
+ {},
669
+ params
670
+ );
671
+ }
672
+
673
+ public static viewTwitterAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
674
+ return Requests.processRoute(
675
+ AdsRoute.routes.retrieveTwitterAdPost,
676
+ {},
677
+ { post_id },
678
+ params
679
+ );
680
+ }
681
+
682
+ public static updateTwitterAdPost<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
683
+ return Requests.processRoute(
684
+ AdsRoute.routes.updateTwitterAdPost,
685
+ data,
686
+ { post_id },
687
+ params
688
+ );
689
+ }
690
+
691
+ public static deleteTwitterAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
692
+ return Requests.processRoute(
693
+ AdsRoute.routes.deleteTwitterAdPost,
694
+ {},
695
+ { post_id },
696
+ params
697
+ );
698
+ }
699
+
700
+ public static listFacebookAdPosts<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
701
+ return Requests.processRoute(
702
+ AdsRoute.routes.getFacebookAdPosts,
703
+ undefined,
704
+ undefined,
705
+ params
706
+ );
707
+ }
708
+
709
+ public static createFacebookAdPost<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
710
+ return Requests.processRoute(
711
+ AdsRoute.routes.createFacebookAdPost,
712
+ data,
713
+ {},
714
+ params
715
+ );
716
+ }
717
+
718
+ public static viewFacebookAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
719
+ return Requests.processRoute(
720
+ AdsRoute.routes.retrieveFacebookAdPost,
721
+ {},
722
+ { post_id },
723
+ params
724
+ );
725
+ }
726
+
727
+ public static updateFacebookAdPost<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
728
+ return Requests.processRoute(
729
+ AdsRoute.routes.updateFacebookAdPost,
730
+ data,
731
+ { post_id },
732
+ params
733
+ );
734
+ }
735
+
736
+ public static deleteFacebookAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
737
+ return Requests.processRoute(
738
+ AdsRoute.routes.deleteFacebookAdPost,
739
+ {},
740
+ { post_id },
741
+ params
742
+ );
743
+ }
744
+
745
+ public static tiktokUploadImage<T>(
746
+ data: FormData,
747
+ params?: Record<string, any>
748
+ ): AxiosPromise<Response<T>> {
749
+ return Requests.processRoute(
750
+ AdsRoute.routes.tiktokUploadImage,
751
+ data,
752
+ {},
753
+ params
754
+ );
755
+ }
756
+
757
+ public static tiktokUploadVideo<T>(
758
+ data: FormData,
759
+ params?: Record<string, any>
760
+ ): AxiosPromise<Response<T>> {
761
+ return Requests.processRoute(
762
+ AdsRoute.routes.tiktokUploadVideo,
763
+ data,
764
+ {},
765
+ params
766
+ );
767
+ }
768
+
769
+ public static tiktokUploadMusic<T>(
770
+ data: FormData,
771
+ params?: Record<string, any>
772
+ ): AxiosPromise<Response<T>> {
773
+ return Requests.processRoute(
774
+ AdsRoute.routes.tiktokUploadMusic,
775
+ data,
776
+ {},
777
+ params
778
+ );
779
+ }
780
+
781
+ public static tiktokGetMediaInfo<T>(params: Record<string, any>): AxiosPromise<Response<T>> {
782
+ return Requests.processRoute(
783
+ AdsRoute.routes.tiktokGetMediaInfo,
784
+ undefined,
785
+ undefined,
786
+ params
787
+ );
788
+ }
789
+
790
+
604
791
  }
605
792
 
606
793
  export default Ads;
@@ -170,11 +170,85 @@ class AdsRoute {
170
170
  url: "/ads/campaigns/{campaign_id}/sync",
171
171
  method: HTTP_METHODS.POST,
172
172
  },
173
-
173
+
174
174
  syncGroup: {
175
175
  url: "/ads/campaigns/{campaign_id}/groups/{group_id}/sync",
176
176
  method: HTTP_METHODS.POST,
177
177
  },
178
+ getRedditAdPosts: {
179
+ url: "/ads/posts/reddit",
180
+ method: HTTP_METHODS.GET,
181
+ },
182
+ createRedditAdPost: {
183
+ url: "/ads/posts/reddit",
184
+ method: HTTP_METHODS.POST,
185
+ },
186
+ retrieveRedditAdPost: {
187
+ url: "/ads/posts/reddit/{post_id}",
188
+ method: HTTP_METHODS.GET,
189
+ },
190
+ updateRedditAdPost: {
191
+ url: "/ads/posts/reddit/{post_id}",
192
+ method: HTTP_METHODS.PUT,
193
+ },
194
+ getTwitterAdPosts: {
195
+ url: "/ads/posts/twitter",
196
+ method: HTTP_METHODS.GET,
197
+ },
198
+ createTwitterAdPost: {
199
+ url: "/ads/posts/twitter",
200
+ method: HTTP_METHODS.POST,
201
+ },
202
+ retrieveTwitterAdPost: {
203
+ url: "/ads/posts/twitter/{post_id}",
204
+ method: HTTP_METHODS.GET,
205
+ },
206
+ updateTwitterAdPost: {
207
+ url: "/ads/posts/twitter/{post_id}",
208
+ method: HTTP_METHODS.PUT,
209
+ },
210
+ deleteTwitterAdPost: {
211
+ url: "/ads/posts/twitter/{post_id}",
212
+ method: HTTP_METHODS.DELETE,
213
+ },
214
+
215
+ getFacebookAdPosts: {
216
+ url: "/ads/posts/facebook",
217
+ method: HTTP_METHODS.GET,
218
+ },
219
+ createFacebookAdPost: {
220
+ url: "/ads/posts/facebook",
221
+ method: HTTP_METHODS.POST,
222
+ },
223
+ retrieveFacebookAdPost: {
224
+ url: "/ads/posts/facebook/{post_id}",
225
+ method: HTTP_METHODS.GET,
226
+ },
227
+ updateFacebookAdPost: {
228
+ url: "/ads/posts/facebook/{post_id}",
229
+ method: HTTP_METHODS.PUT,
230
+ },
231
+ deleteFacebookAdPost: {
232
+ url: "/ads/posts/facebook/{post_id}",
233
+ method: HTTP_METHODS.DELETE,
234
+ },
235
+
236
+ tiktokUploadImage: {
237
+ url: "/ads/posts/tiktok/upload/image",
238
+ method: HTTP_METHODS.POST,
239
+ },
240
+ tiktokUploadVideo: {
241
+ url: "/ads/posts/tiktok/upload/video",
242
+ method: HTTP_METHODS.POST,
243
+ },
244
+ tiktokUploadMusic: {
245
+ url: "/ads/posts/tiktok/upload/music",
246
+ method: HTTP_METHODS.POST,
247
+ },
248
+ tiktokGetMediaInfo: {
249
+ url: "/ads/posts/tiktok/media/info",
250
+ method: HTTP_METHODS.GET,
251
+ },
178
252
  };
179
253
  }
180
254