glitch-javascript-sdk 1.8.5 → 1.8.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
@@ -893,6 +893,30 @@ declare class Ads {
893
893
  * GET /ads/reddit/targeting/third_party_audiences
894
894
  */
895
895
  static listRedditThirdPartyAudiences<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
896
+ /**
897
+ * Sync an Ad Campaign with the remote platform
898
+ *
899
+ * @param campaign_id The UUID of the campaign to sync
900
+ * @param params Optional query parameters
901
+ * @returns The synced AdCampaign resource
902
+ */
903
+ static syncCampaign<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
904
+ /**
905
+ * Sync an Ad Group with the remote platform
906
+ *
907
+ * @param campaign_id The UUID of the parent campaign
908
+ * @param group_id The UUID of the ad group to sync
909
+ * @param params Optional query parameters
910
+ * @returns The synced AdGroup resource
911
+ */
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>>;
896
920
  }
897
921
 
898
922
  declare class Communities {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.8.5",
3
+ "version": "1.8.7",
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
@@ -480,86 +480,178 @@ class Ads {
480
480
  * Example usage:
481
481
  * Ads.listRedditCarriers({ scheduler_id: 'uuid-of-scheduler', 'page.size': 50 })
482
482
  */
483
- public static listRedditCarriers<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
484
- return Requests.processRoute(
485
- AdsRoute.routes.getRedditCarriers,
486
- undefined,
487
- undefined,
488
- params
489
- );
490
- }
491
-
492
- /**
493
- * GET /ads/reddit/targeting/communities?names=sub1,sub2
494
- */
495
- public static listRedditCommunities<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
496
- return Requests.processRoute(
497
- AdsRoute.routes.getRedditCommunities,
498
- undefined,
499
- undefined,
500
- params
501
- );
502
- }
503
-
504
- /**
505
- * GET /ads/reddit/targeting/communities/search?query=xyz
506
- */
507
- public static searchRedditCommunities<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
508
- return Requests.processRoute(
509
- AdsRoute.routes.searchRedditCommunities,
510
- undefined,
511
- undefined,
512
- params
513
- );
514
- }
515
-
516
- /**
517
- * GET /ads/reddit/targeting/devices
518
- */
519
- public static listRedditDevices<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
520
- return Requests.processRoute(
521
- AdsRoute.routes.getRedditDevices,
522
- undefined,
523
- undefined,
524
- params
525
- );
526
- }
527
-
528
- /**
529
- * GET /ads/reddit/targeting/geolocations
530
- */
531
- public static listRedditGeolocations<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
532
- return Requests.processRoute(
533
- AdsRoute.routes.getRedditGeolocations,
534
- undefined,
535
- undefined,
536
- params
537
- );
538
- }
539
-
540
- /**
541
- * GET /ads/reddit/targeting/interests
542
- */
543
- public static listRedditInterests<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
544
- return Requests.processRoute(
545
- AdsRoute.routes.getRedditInterests,
546
- undefined,
547
- undefined,
548
- params
549
- );
550
- }
551
-
552
- /**
553
- * GET /ads/reddit/targeting/third_party_audiences
483
+ public static listRedditCarriers<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
484
+ return Requests.processRoute(
485
+ AdsRoute.routes.getRedditCarriers,
486
+ undefined,
487
+ undefined,
488
+ params
489
+ );
490
+ }
491
+
492
+ /**
493
+ * GET /ads/reddit/targeting/communities?names=sub1,sub2
494
+ */
495
+ public static listRedditCommunities<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
496
+ return Requests.processRoute(
497
+ AdsRoute.routes.getRedditCommunities,
498
+ undefined,
499
+ undefined,
500
+ params
501
+ );
502
+ }
503
+
504
+ /**
505
+ * GET /ads/reddit/targeting/communities/search?query=xyz
506
+ */
507
+ public static searchRedditCommunities<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
508
+ return Requests.processRoute(
509
+ AdsRoute.routes.searchRedditCommunities,
510
+ undefined,
511
+ undefined,
512
+ params
513
+ );
514
+ }
515
+
516
+ /**
517
+ * GET /ads/reddit/targeting/devices
518
+ */
519
+ public static listRedditDevices<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
520
+ return Requests.processRoute(
521
+ AdsRoute.routes.getRedditDevices,
522
+ undefined,
523
+ undefined,
524
+ params
525
+ );
526
+ }
527
+
528
+ /**
529
+ * GET /ads/reddit/targeting/geolocations
530
+ */
531
+ public static listRedditGeolocations<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
532
+ return Requests.processRoute(
533
+ AdsRoute.routes.getRedditGeolocations,
534
+ undefined,
535
+ undefined,
536
+ params
537
+ );
538
+ }
539
+
540
+ /**
541
+ * GET /ads/reddit/targeting/interests
542
+ */
543
+ public static listRedditInterests<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
544
+ return Requests.processRoute(
545
+ AdsRoute.routes.getRedditInterests,
546
+ undefined,
547
+ undefined,
548
+ params
549
+ );
550
+ }
551
+
552
+ /**
553
+ * GET /ads/reddit/targeting/third_party_audiences
554
+ */
555
+ public static listRedditThirdPartyAudiences<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
556
+ return Requests.processRoute(
557
+ AdsRoute.routes.getRedditThirdPartyAudiences,
558
+ undefined,
559
+ undefined,
560
+ params
561
+ );
562
+ }
563
+
564
+ /**
565
+ * Sync an Ad Campaign with the remote platform
566
+ *
567
+ * @param campaign_id The UUID of the campaign to sync
568
+ * @param params Optional query parameters
569
+ * @returns The synced AdCampaign resource
554
570
  */
555
- public static listRedditThirdPartyAudiences<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
556
- return Requests.processRoute(
557
- AdsRoute.routes.getRedditThirdPartyAudiences,
558
- undefined,
559
- undefined,
560
- params
561
- );
562
- }
571
+ public static syncCampaign<T>(
572
+ campaign_id: string,
573
+ params?: Record<string, any>
574
+ ): AxiosPromise<Response<T>> {
575
+ return Requests.processRoute(
576
+ AdsRoute.routes.syncCampaign,
577
+ undefined,
578
+ { campaign_id },
579
+ params
580
+ );
581
+ }
582
+
583
+ /**
584
+ * Sync an Ad Group with the remote platform
585
+ *
586
+ * @param campaign_id The UUID of the parent campaign
587
+ * @param group_id The UUID of the ad group to sync
588
+ * @param params Optional query parameters
589
+ * @returns The synced AdGroup resource
590
+ */
591
+ public static syncGroup<T>(
592
+ campaign_id: string,
593
+ group_id: string,
594
+ params?: Record<string, any>
595
+ ): AxiosPromise<Response<T>> {
596
+ return Requests.processRoute(
597
+ AdsRoute.routes.syncGroup,
598
+ undefined,
599
+ { campaign_id, group_id },
600
+ params
601
+ );
602
+ }
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
+
563
655
 
564
656
  }
565
657
 
@@ -166,6 +166,31 @@ class AdsRoute {
166
166
  url: "/ads/reddit/targeting/third_party_audiences",
167
167
  method: HTTP_METHODS.GET,
168
168
  },
169
+ syncCampaign: {
170
+ url: "/ads/campaigns/{campaign_id}/sync",
171
+ method: HTTP_METHODS.POST,
172
+ },
173
+
174
+ syncGroup: {
175
+ url: "/ads/campaigns/{campaign_id}/groups/{group_id}/sync",
176
+ method: HTTP_METHODS.POST,
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
+ },
169
194
  };
170
195
  }
171
196