glitch-javascript-sdk 1.8.7 → 1.8.9

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
@@ -917,6 +917,28 @@ declare class Ads {
917
917
  static viewRedditAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
918
918
  /** Update a Reddit ad-style social-media post */
919
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>>;
934
+ /**
935
+ * Sync an Ad with the remote platform.
936
+ *
937
+ * @param ad_id UUID of the ad to sync
938
+ * @param params Optional query parameters
939
+ * @returns The synced Ad resource
940
+ */
941
+ static syncAd<T>(ad_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
920
942
  }
921
943
 
922
944
  declare class Communities {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.8.7",
3
+ "version": "1.8.9",
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
@@ -611,7 +611,7 @@ class Ads {
611
611
  params
612
612
  );
613
613
  }
614
-
614
+
615
615
  /** Create a Reddit ad-style social-media post */
616
616
  public static createRedditAdPost<T>(
617
617
  data?: object,
@@ -624,7 +624,7 @@ class Ads {
624
624
  params
625
625
  );
626
626
  }
627
-
627
+
628
628
  /** Retrieve a single Reddit ad-style social-media post */
629
629
  public static viewRedditAdPost<T>(
630
630
  post_id: string,
@@ -637,7 +637,7 @@ class Ads {
637
637
  params
638
638
  );
639
639
  }
640
-
640
+
641
641
  /** Update a Reddit ad-style social-media post */
642
642
  public static updateRedditAdPost<T>(
643
643
  post_id: string,
@@ -651,7 +651,161 @@ class Ads {
651
651
  params
652
652
  );
653
653
  }
654
-
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
+ /**
791
+ * Sync an Ad with the remote platform.
792
+ *
793
+ * @param ad_id UUID of the ad to sync
794
+ * @param params Optional query parameters
795
+ * @returns The synced Ad resource
796
+ */
797
+ public static syncAd<T>(
798
+ ad_id: string,
799
+ params?: Record<string, any>
800
+ ): AxiosPromise<Response<T>> {
801
+ return Requests.processRoute(
802
+ AdsRoute.routes.syncAd,
803
+ undefined,
804
+ { ad_id },
805
+ params
806
+ );
807
+ }
808
+
655
809
 
656
810
  }
657
811
 
@@ -170,7 +170,7 @@ 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,
@@ -191,6 +191,68 @@ class AdsRoute {
191
191
  url: "/ads/posts/reddit/{post_id}",
192
192
  method: HTTP_METHODS.PUT,
193
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
+ },
252
+ syncAd: {
253
+ url: "/ads/creatives/{ad_id}/sync",
254
+ method: HTTP_METHODS.POST,
255
+ },
194
256
  };
195
257
  }
196
258