glitch-javascript-sdk 1.8.5 → 1.8.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/cjs/index.js +29 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Ads.d.ts +17 -0
- package/dist/esm/index.js +29 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +17 -0
- package/package.json +1 -1
- package/src/api/Ads.ts +119 -79
- package/src/routes/AdsRoute.ts +9 -0
package/dist/index.d.ts
CHANGED
|
@@ -893,6 +893,23 @@ 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>>;
|
|
896
913
|
}
|
|
897
914
|
|
|
898
915
|
declare class Communities {
|
package/package.json
CHANGED
package/src/api/Ads.ts
CHANGED
|
@@ -480,86 +480,126 @@ class Ads {
|
|
|
480
480
|
* Example usage:
|
|
481
481
|
* Ads.listRedditCarriers({ scheduler_id: 'uuid-of-scheduler', 'page.size': 50 })
|
|
482
482
|
*/
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
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
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
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
|
+
}
|
|
563
603
|
|
|
564
604
|
}
|
|
565
605
|
|
package/src/routes/AdsRoute.ts
CHANGED
|
@@ -166,6 +166,15 @@ 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
|
+
},
|
|
169
178
|
};
|
|
170
179
|
}
|
|
171
180
|
|