glitch-javascript-sdk 1.7.9 → 1.8.1
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 +153 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Ads.d.ts +31 -0
- package/dist/esm/api/Scheduler.d.ts +43 -0
- package/dist/esm/index.js +153 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +74 -0
- package/package.json +1 -1
- package/src/api/Ads.ts +87 -0
- package/src/api/Scheduler.ts +79 -0
- package/src/routes/AdsRoute.ts +45 -15
- package/src/routes/SchedulerRoute.ts +17 -0
package/dist/index.d.ts
CHANGED
|
@@ -862,6 +862,37 @@ declare class Ads {
|
|
|
862
862
|
* @returns A response object with data (funding instruments)
|
|
863
863
|
*/
|
|
864
864
|
static listCampaignFundingInstruments<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
865
|
+
/**
|
|
866
|
+
* GET /ads/reddit/targeting/carriers
|
|
867
|
+
*
|
|
868
|
+
* Example usage:
|
|
869
|
+
* Ads.listRedditCarriers({ scheduler_id: 'uuid-of-scheduler', 'page.size': 50 })
|
|
870
|
+
*/
|
|
871
|
+
static listRedditCarriers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
872
|
+
/**
|
|
873
|
+
* GET /ads/reddit/targeting/communities?names=sub1,sub2
|
|
874
|
+
*/
|
|
875
|
+
static listRedditCommunities<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
876
|
+
/**
|
|
877
|
+
* GET /ads/reddit/targeting/communities/search?query=xyz
|
|
878
|
+
*/
|
|
879
|
+
static searchRedditCommunities<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
880
|
+
/**
|
|
881
|
+
* GET /ads/reddit/targeting/devices
|
|
882
|
+
*/
|
|
883
|
+
static listRedditDevices<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
884
|
+
/**
|
|
885
|
+
* GET /ads/reddit/targeting/geolocations
|
|
886
|
+
*/
|
|
887
|
+
static listRedditGeolocations<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
888
|
+
/**
|
|
889
|
+
* GET /ads/reddit/targeting/interests
|
|
890
|
+
*/
|
|
891
|
+
static listRedditInterests<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
892
|
+
/**
|
|
893
|
+
* GET /ads/reddit/targeting/third_party_audiences
|
|
894
|
+
*/
|
|
895
|
+
static listRedditThirdPartyAudiences<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
865
896
|
}
|
|
866
897
|
|
|
867
898
|
declare class Communities {
|
|
@@ -4605,6 +4636,13 @@ declare class Scheduler {
|
|
|
4605
4636
|
* @returns promise
|
|
4606
4637
|
*/
|
|
4607
4638
|
static clearRedditAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4639
|
+
/**
|
|
4640
|
+
* Clear Reddit Ads OAuth credentials from a promotion schedule.
|
|
4641
|
+
*
|
|
4642
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
4643
|
+
* @returns promise
|
|
4644
|
+
*/
|
|
4645
|
+
static clearRedditAdsAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4608
4646
|
/**
|
|
4609
4647
|
* Clear YouTube OAuth credentials from a promotion schedule.
|
|
4610
4648
|
*
|
|
@@ -4752,6 +4790,42 @@ declare class Scheduler {
|
|
|
4752
4790
|
* GET /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts
|
|
4753
4791
|
*/
|
|
4754
4792
|
static crossPromoteRelationshipPosts<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4793
|
+
/**
|
|
4794
|
+
* List platform-level businesses for the given campaign ID,
|
|
4795
|
+
* as defined by /schedulers/{scheduler_id}/businesses on the backend.
|
|
4796
|
+
*
|
|
4797
|
+
* Typically relevant for Reddit (list businesses), or might return a
|
|
4798
|
+
* "not supported" message for Meta/TikTok.
|
|
4799
|
+
*
|
|
4800
|
+
* @param scheduler_id The UUID of the Ad Campaign
|
|
4801
|
+
* @param params Optional query parameters, e.g. page.size, etc.
|
|
4802
|
+
* @returns A response object with data (business list or messages)
|
|
4803
|
+
*/
|
|
4804
|
+
static listCampaignBusinesses<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4805
|
+
/**
|
|
4806
|
+
* List Ad Accounts for the given campaign ID,
|
|
4807
|
+
* as defined by /schedulers/{scheduler_id}/ad_accounts on the backend.
|
|
4808
|
+
*
|
|
4809
|
+
* E.g. for Reddit, you can pass ?business_id= to get business-level ad accounts,
|
|
4810
|
+
* or for Twitter, it might just return a user’s ad accounts, etc.
|
|
4811
|
+
*
|
|
4812
|
+
* @param scheduler_id The UUID of the Ad Campaign
|
|
4813
|
+
* @param params Optional query parameters, e.g. business_id, page.size, etc.
|
|
4814
|
+
* @returns A response object with data (ad account list)
|
|
4815
|
+
*/
|
|
4816
|
+
static listCampaignAdAccounts<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4817
|
+
/**
|
|
4818
|
+
* List funding instruments for the given campaign ID,
|
|
4819
|
+
* as defined by /schedulers/{scheduler_id}/funding_instruments on the backend.
|
|
4820
|
+
*
|
|
4821
|
+
* For Twitter, pass ?account_id=...
|
|
4822
|
+
* For Reddit, pass ?ad_account_id=... or ?business_id=...
|
|
4823
|
+
*
|
|
4824
|
+
* @param scheduler_id The UUID of the Ad Campaign
|
|
4825
|
+
* @param params Optional query parameters
|
|
4826
|
+
* @returns A response object with data (funding instruments)
|
|
4827
|
+
*/
|
|
4828
|
+
static listCampaignFundingInstruments<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4755
4829
|
}
|
|
4756
4830
|
|
|
4757
4831
|
declare class Funnel {
|
package/package.json
CHANGED
package/src/api/Ads.ts
CHANGED
|
@@ -474,6 +474,93 @@ class Ads {
|
|
|
474
474
|
);
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
+
/**
|
|
478
|
+
* GET /ads/reddit/targeting/carriers
|
|
479
|
+
*
|
|
480
|
+
* Example usage:
|
|
481
|
+
* Ads.listRedditCarriers({ scheduler_id: 'uuid-of-scheduler', 'page.size': 50 })
|
|
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
|
|
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
|
+
|
|
477
564
|
}
|
|
478
565
|
|
|
479
566
|
export default Ads;
|
package/src/api/Scheduler.ts
CHANGED
|
@@ -260,6 +260,16 @@ class Scheduler {
|
|
|
260
260
|
return Requests.processRoute(SchedulerRoute.routes.clearRedditAuth, {}, { scheduler_id }, params);
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
/**
|
|
264
|
+
* Clear Reddit Ads OAuth credentials from a promotion schedule.
|
|
265
|
+
*
|
|
266
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
267
|
+
* @returns promise
|
|
268
|
+
*/
|
|
269
|
+
public static clearRedditAdsAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
270
|
+
return Requests.processRoute(SchedulerRoute.routes.clearRedditAdsAuth, {}, { scheduler_id }, params);
|
|
271
|
+
}
|
|
272
|
+
|
|
263
273
|
/**
|
|
264
274
|
* Clear YouTube OAuth credentials from a promotion schedule.
|
|
265
275
|
*
|
|
@@ -527,6 +537,75 @@ class Scheduler {
|
|
|
527
537
|
);
|
|
528
538
|
}
|
|
529
539
|
|
|
540
|
+
/**
|
|
541
|
+
* List platform-level businesses for the given campaign ID,
|
|
542
|
+
* as defined by /schedulers/{scheduler_id}/businesses on the backend.
|
|
543
|
+
*
|
|
544
|
+
* Typically relevant for Reddit (list businesses), or might return a
|
|
545
|
+
* "not supported" message for Meta/TikTok.
|
|
546
|
+
*
|
|
547
|
+
* @param scheduler_id The UUID of the Ad Campaign
|
|
548
|
+
* @param params Optional query parameters, e.g. page.size, etc.
|
|
549
|
+
* @returns A response object with data (business list or messages)
|
|
550
|
+
*/
|
|
551
|
+
public static listCampaignBusinesses<T>(
|
|
552
|
+
scheduler_id: string,
|
|
553
|
+
params?: Record<string, any>
|
|
554
|
+
): AxiosPromise<Response<T>> {
|
|
555
|
+
return Requests.processRoute(
|
|
556
|
+
SchedulerRoute.routes.getCampaignBusinesses,
|
|
557
|
+
undefined, // no request body
|
|
558
|
+
{ scheduler_id }, // path params
|
|
559
|
+
params // query params
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* List Ad Accounts for the given campaign ID,
|
|
565
|
+
* as defined by /schedulers/{scheduler_id}/ad_accounts on the backend.
|
|
566
|
+
*
|
|
567
|
+
* E.g. for Reddit, you can pass ?business_id= to get business-level ad accounts,
|
|
568
|
+
* or for Twitter, it might just return a user’s ad accounts, etc.
|
|
569
|
+
*
|
|
570
|
+
* @param scheduler_id The UUID of the Ad Campaign
|
|
571
|
+
* @param params Optional query parameters, e.g. business_id, page.size, etc.
|
|
572
|
+
* @returns A response object with data (ad account list)
|
|
573
|
+
*/
|
|
574
|
+
public static listCampaignAdAccounts<T>(
|
|
575
|
+
scheduler_id: string,
|
|
576
|
+
params?: Record<string, any>
|
|
577
|
+
): AxiosPromise<Response<T>> {
|
|
578
|
+
return Requests.processRoute(
|
|
579
|
+
SchedulerRoute.routes.getCampaignAdAccounts,
|
|
580
|
+
undefined,
|
|
581
|
+
{ scheduler_id },
|
|
582
|
+
params
|
|
583
|
+
);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* List funding instruments for the given campaign ID,
|
|
588
|
+
* as defined by /schedulers/{scheduler_id}/funding_instruments on the backend.
|
|
589
|
+
*
|
|
590
|
+
* For Twitter, pass ?account_id=...
|
|
591
|
+
* For Reddit, pass ?ad_account_id=... or ?business_id=...
|
|
592
|
+
*
|
|
593
|
+
* @param scheduler_id The UUID of the Ad Campaign
|
|
594
|
+
* @param params Optional query parameters
|
|
595
|
+
* @returns A response object with data (funding instruments)
|
|
596
|
+
*/
|
|
597
|
+
public static listCampaignFundingInstruments<T>(
|
|
598
|
+
scheduler_id: string,
|
|
599
|
+
params?: Record<string, any>
|
|
600
|
+
): AxiosPromise<Response<T>> {
|
|
601
|
+
return Requests.processRoute(
|
|
602
|
+
SchedulerRoute.routes.getCampaignFundingInstruments,
|
|
603
|
+
undefined,
|
|
604
|
+
{ scheduler_id },
|
|
605
|
+
params
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
|
|
530
609
|
}
|
|
531
610
|
|
|
532
611
|
export default Scheduler;
|
package/src/routes/AdsRoute.ts
CHANGED
|
@@ -37,6 +37,21 @@ class AdsRoute {
|
|
|
37
37
|
url: "/ads/campaigns/{campaign_id}",
|
|
38
38
|
method: HTTP_METHODS.DELETE,
|
|
39
39
|
},
|
|
40
|
+
getCampaignBusinesses: {
|
|
41
|
+
url: "/ads/campaigns/{campaign_id}/businesses",
|
|
42
|
+
method: HTTP_METHODS.GET,
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
getCampaignAdAccounts: {
|
|
46
|
+
url: "/ads/campaigns/{campaign_id}/ad_accounts",
|
|
47
|
+
method: HTTP_METHODS.GET,
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
getCampaignFundingInstruments: {
|
|
51
|
+
url: "/ads/campaigns/{campaign_id}/funding_instruments",
|
|
52
|
+
method: HTTP_METHODS.GET,
|
|
53
|
+
},
|
|
54
|
+
|
|
40
55
|
|
|
41
56
|
|
|
42
57
|
// ----------------------------------------------------------------
|
|
@@ -66,21 +81,6 @@ class AdsRoute {
|
|
|
66
81
|
url: "/ads/campaigns/{campaign_id}/groups/{group_id}",
|
|
67
82
|
method: HTTP_METHODS.DELETE,
|
|
68
83
|
},
|
|
69
|
-
getCampaignBusinesses: {
|
|
70
|
-
url: "/ads/campaigns/{campaign_id}/businesses",
|
|
71
|
-
method: HTTP_METHODS.GET,
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
getCampaignAdAccounts: {
|
|
75
|
-
url: "/ads/campaigns/{campaign_id}/ad_accounts",
|
|
76
|
-
method: HTTP_METHODS.GET,
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
getCampaignFundingInstruments: {
|
|
80
|
-
url: "/ads/campaigns/{campaign_id}/funding_instruments",
|
|
81
|
-
method: HTTP_METHODS.GET,
|
|
82
|
-
},
|
|
83
|
-
|
|
84
84
|
// ----------------------------------------------------------------
|
|
85
85
|
// ADS (CREATIVES)
|
|
86
86
|
// ----------------------------------------------------------------
|
|
@@ -136,6 +136,36 @@ class AdsRoute {
|
|
|
136
136
|
url: "/ads/campaigns/{campaign_id}/groups/{group_id}/triggers/{trigger_id}",
|
|
137
137
|
method: HTTP_METHODS.DELETE,
|
|
138
138
|
},
|
|
139
|
+
|
|
140
|
+
// REDDIT TARGETING routes
|
|
141
|
+
getRedditCarriers: {
|
|
142
|
+
url: "/ads/reddit/targeting/carriers",
|
|
143
|
+
method: HTTP_METHODS.GET,
|
|
144
|
+
},
|
|
145
|
+
getRedditCommunities: {
|
|
146
|
+
url: "/ads/reddit/targeting/communities",
|
|
147
|
+
method: HTTP_METHODS.GET,
|
|
148
|
+
},
|
|
149
|
+
searchRedditCommunities: {
|
|
150
|
+
url: "/ads/reddit/targeting/communities/search",
|
|
151
|
+
method: HTTP_METHODS.GET,
|
|
152
|
+
},
|
|
153
|
+
getRedditDevices: {
|
|
154
|
+
url: "/ads/reddit/targeting/devices",
|
|
155
|
+
method: HTTP_METHODS.GET,
|
|
156
|
+
},
|
|
157
|
+
getRedditGeolocations: {
|
|
158
|
+
url: "/ads/reddit/targeting/geolocations",
|
|
159
|
+
method: HTTP_METHODS.GET,
|
|
160
|
+
},
|
|
161
|
+
getRedditInterests: {
|
|
162
|
+
url: "/ads/reddit/targeting/interests",
|
|
163
|
+
method: HTTP_METHODS.GET,
|
|
164
|
+
},
|
|
165
|
+
getRedditThirdPartyAudiences: {
|
|
166
|
+
url: "/ads/reddit/targeting/third_party_audiences",
|
|
167
|
+
method: HTTP_METHODS.GET,
|
|
168
|
+
},
|
|
139
169
|
};
|
|
140
170
|
}
|
|
141
171
|
|
|
@@ -32,6 +32,7 @@ class SchedulerRoute {
|
|
|
32
32
|
clearTwitchAuth: { url: '/schedulers/{scheduler_id}/clearTwitchAuth', method: HTTP_METHODS.DELETE },
|
|
33
33
|
clearKickAuth: { url: '/schedulers/{scheduler_id}/clearKickAuth', method: HTTP_METHODS.DELETE },
|
|
34
34
|
clearRedditAuth: { url: '/schedulers/{scheduler_id}/clearRedditAuth', method: HTTP_METHODS.DELETE },
|
|
35
|
+
clearRedditAdsAuth: { url: '/schedulers/{scheduler_id}/clearRedditAdsAuth', method: HTTP_METHODS.DELETE },
|
|
35
36
|
clearYouTubeAuth: { url: '/schedulers/{scheduler_id}/clearYouTubeAuth', method: HTTP_METHODS.DELETE },
|
|
36
37
|
clearPatreonAuth: { url: '/schedulers/{scheduler_id}/clearPatreonAuth', method: HTTP_METHODS.DELETE },
|
|
37
38
|
clearPinterestAuth: { url: '/schedulers/{scheduler_id}/clearPinterestAuth', method: HTTP_METHODS.DELETE },
|
|
@@ -87,6 +88,22 @@ class SchedulerRoute {
|
|
|
87
88
|
method: HTTP_METHODS.GET
|
|
88
89
|
},
|
|
89
90
|
|
|
91
|
+
getCampaignBusinesses: {
|
|
92
|
+
url: "/schedulers/{scheduler_id}/businesses",
|
|
93
|
+
method: HTTP_METHODS.GET,
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
getCampaignAdAccounts: {
|
|
97
|
+
url: "/schedulers/{scheduler_id}/ad_accounts",
|
|
98
|
+
method: HTTP_METHODS.GET,
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
getCampaignFundingInstruments: {
|
|
102
|
+
url: "/schedulers/{scheduler_id}/funding_instruments",
|
|
103
|
+
method: HTTP_METHODS.GET,
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
|
|
90
107
|
|
|
91
108
|
};
|
|
92
109
|
}
|