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.
@@ -220,5 +220,36 @@ declare class Ads {
220
220
  * @returns A response object with data (funding instruments)
221
221
  */
222
222
  static listCampaignFundingInstruments<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
223
+ /**
224
+ * GET /ads/reddit/targeting/carriers
225
+ *
226
+ * Example usage:
227
+ * Ads.listRedditCarriers({ scheduler_id: 'uuid-of-scheduler', 'page.size': 50 })
228
+ */
229
+ static listRedditCarriers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
230
+ /**
231
+ * GET /ads/reddit/targeting/communities?names=sub1,sub2
232
+ */
233
+ static listRedditCommunities<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
234
+ /**
235
+ * GET /ads/reddit/targeting/communities/search?query=xyz
236
+ */
237
+ static searchRedditCommunities<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
238
+ /**
239
+ * GET /ads/reddit/targeting/devices
240
+ */
241
+ static listRedditDevices<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
242
+ /**
243
+ * GET /ads/reddit/targeting/geolocations
244
+ */
245
+ static listRedditGeolocations<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
246
+ /**
247
+ * GET /ads/reddit/targeting/interests
248
+ */
249
+ static listRedditInterests<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
250
+ /**
251
+ * GET /ads/reddit/targeting/third_party_audiences
252
+ */
253
+ static listRedditThirdPartyAudiences<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
223
254
  }
224
255
  export default Ads;
@@ -194,6 +194,13 @@ declare class Scheduler {
194
194
  * @returns promise
195
195
  */
196
196
  static clearRedditAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
197
+ /**
198
+ * Clear Reddit Ads OAuth credentials from a promotion schedule.
199
+ *
200
+ * @param scheduler_id The ID of the promotion schedule.
201
+ * @returns promise
202
+ */
203
+ static clearRedditAdsAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
197
204
  /**
198
205
  * Clear YouTube OAuth credentials from a promotion schedule.
199
206
  *
@@ -341,5 +348,41 @@ declare class Scheduler {
341
348
  * GET /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts
342
349
  */
343
350
  static crossPromoteRelationshipPosts<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
351
+ /**
352
+ * List platform-level businesses for the given campaign ID,
353
+ * as defined by /schedulers/{scheduler_id}/businesses on the backend.
354
+ *
355
+ * Typically relevant for Reddit (list businesses), or might return a
356
+ * "not supported" message for Meta/TikTok.
357
+ *
358
+ * @param scheduler_id The UUID of the Ad Campaign
359
+ * @param params Optional query parameters, e.g. page.size, etc.
360
+ * @returns A response object with data (business list or messages)
361
+ */
362
+ static listCampaignBusinesses<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
363
+ /**
364
+ * List Ad Accounts for the given campaign ID,
365
+ * as defined by /schedulers/{scheduler_id}/ad_accounts on the backend.
366
+ *
367
+ * E.g. for Reddit, you can pass ?business_id= to get business-level ad accounts,
368
+ * or for Twitter, it might just return a user’s ad accounts, etc.
369
+ *
370
+ * @param scheduler_id The UUID of the Ad Campaign
371
+ * @param params Optional query parameters, e.g. business_id, page.size, etc.
372
+ * @returns A response object with data (ad account list)
373
+ */
374
+ static listCampaignAdAccounts<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
375
+ /**
376
+ * List funding instruments for the given campaign ID,
377
+ * as defined by /schedulers/{scheduler_id}/funding_instruments on the backend.
378
+ *
379
+ * For Twitter, pass ?account_id=...
380
+ * For Reddit, pass ?ad_account_id=... or ?business_id=...
381
+ *
382
+ * @param scheduler_id The UUID of the Ad Campaign
383
+ * @param params Optional query parameters
384
+ * @returns A response object with data (funding instruments)
385
+ */
386
+ static listCampaignFundingInstruments<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
344
387
  }
345
388
  export default Scheduler;
package/dist/esm/index.js CHANGED
@@ -6612,6 +6612,18 @@ var AdsRoute = /** @class */ (function () {
6612
6612
  url: "/ads/campaigns/{campaign_id}",
6613
6613
  method: HTTP_METHODS.DELETE,
6614
6614
  },
6615
+ getCampaignBusinesses: {
6616
+ url: "/ads/campaigns/{campaign_id}/businesses",
6617
+ method: HTTP_METHODS.GET,
6618
+ },
6619
+ getCampaignAdAccounts: {
6620
+ url: "/ads/campaigns/{campaign_id}/ad_accounts",
6621
+ method: HTTP_METHODS.GET,
6622
+ },
6623
+ getCampaignFundingInstruments: {
6624
+ url: "/ads/campaigns/{campaign_id}/funding_instruments",
6625
+ method: HTTP_METHODS.GET,
6626
+ },
6615
6627
  // ----------------------------------------------------------------
6616
6628
  // AD GROUPS (AKA AD SETS)
6617
6629
  // ----------------------------------------------------------------
@@ -6635,18 +6647,6 @@ var AdsRoute = /** @class */ (function () {
6635
6647
  url: "/ads/campaigns/{campaign_id}/groups/{group_id}",
6636
6648
  method: HTTP_METHODS.DELETE,
6637
6649
  },
6638
- getCampaignBusinesses: {
6639
- url: "/ads/campaigns/{campaign_id}/businesses",
6640
- method: HTTP_METHODS.GET,
6641
- },
6642
- getCampaignAdAccounts: {
6643
- url: "/ads/campaigns/{campaign_id}/ad_accounts",
6644
- method: HTTP_METHODS.GET,
6645
- },
6646
- getCampaignFundingInstruments: {
6647
- url: "/ads/campaigns/{campaign_id}/funding_instruments",
6648
- method: HTTP_METHODS.GET,
6649
- },
6650
6650
  // ----------------------------------------------------------------
6651
6651
  // ADS (CREATIVES)
6652
6652
  // ----------------------------------------------------------------
@@ -6693,6 +6693,35 @@ var AdsRoute = /** @class */ (function () {
6693
6693
  url: "/ads/campaigns/{campaign_id}/groups/{group_id}/triggers/{trigger_id}",
6694
6694
  method: HTTP_METHODS.DELETE,
6695
6695
  },
6696
+ // REDDIT TARGETING routes
6697
+ getRedditCarriers: {
6698
+ url: "/ads/reddit/targeting/carriers",
6699
+ method: HTTP_METHODS.GET,
6700
+ },
6701
+ getRedditCommunities: {
6702
+ url: "/ads/reddit/targeting/communities",
6703
+ method: HTTP_METHODS.GET,
6704
+ },
6705
+ searchRedditCommunities: {
6706
+ url: "/ads/reddit/targeting/communities/search",
6707
+ method: HTTP_METHODS.GET,
6708
+ },
6709
+ getRedditDevices: {
6710
+ url: "/ads/reddit/targeting/devices",
6711
+ method: HTTP_METHODS.GET,
6712
+ },
6713
+ getRedditGeolocations: {
6714
+ url: "/ads/reddit/targeting/geolocations",
6715
+ method: HTTP_METHODS.GET,
6716
+ },
6717
+ getRedditInterests: {
6718
+ url: "/ads/reddit/targeting/interests",
6719
+ method: HTTP_METHODS.GET,
6720
+ },
6721
+ getRedditThirdPartyAudiences: {
6722
+ url: "/ads/reddit/targeting/third_party_audiences",
6723
+ method: HTTP_METHODS.GET,
6724
+ },
6696
6725
  };
6697
6726
  return AdsRoute;
6698
6727
  }());
@@ -6980,6 +7009,51 @@ var Ads = /** @class */ (function () {
6980
7009
  Ads.listCampaignFundingInstruments = function (campaign_id, params) {
6981
7010
  return Requests.processRoute(AdsRoute.routes.getCampaignFundingInstruments, undefined, { campaign_id: campaign_id }, params);
6982
7011
  };
7012
+ /**
7013
+ * GET /ads/reddit/targeting/carriers
7014
+ *
7015
+ * Example usage:
7016
+ * Ads.listRedditCarriers({ scheduler_id: 'uuid-of-scheduler', 'page.size': 50 })
7017
+ */
7018
+ Ads.listRedditCarriers = function (params) {
7019
+ return Requests.processRoute(AdsRoute.routes.getRedditCarriers, undefined, undefined, params);
7020
+ };
7021
+ /**
7022
+ * GET /ads/reddit/targeting/communities?names=sub1,sub2
7023
+ */
7024
+ Ads.listRedditCommunities = function (params) {
7025
+ return Requests.processRoute(AdsRoute.routes.getRedditCommunities, undefined, undefined, params);
7026
+ };
7027
+ /**
7028
+ * GET /ads/reddit/targeting/communities/search?query=xyz
7029
+ */
7030
+ Ads.searchRedditCommunities = function (params) {
7031
+ return Requests.processRoute(AdsRoute.routes.searchRedditCommunities, undefined, undefined, params);
7032
+ };
7033
+ /**
7034
+ * GET /ads/reddit/targeting/devices
7035
+ */
7036
+ Ads.listRedditDevices = function (params) {
7037
+ return Requests.processRoute(AdsRoute.routes.getRedditDevices, undefined, undefined, params);
7038
+ };
7039
+ /**
7040
+ * GET /ads/reddit/targeting/geolocations
7041
+ */
7042
+ Ads.listRedditGeolocations = function (params) {
7043
+ return Requests.processRoute(AdsRoute.routes.getRedditGeolocations, undefined, undefined, params);
7044
+ };
7045
+ /**
7046
+ * GET /ads/reddit/targeting/interests
7047
+ */
7048
+ Ads.listRedditInterests = function (params) {
7049
+ return Requests.processRoute(AdsRoute.routes.getRedditInterests, undefined, undefined, params);
7050
+ };
7051
+ /**
7052
+ * GET /ads/reddit/targeting/third_party_audiences
7053
+ */
7054
+ Ads.listRedditThirdPartyAudiences = function (params) {
7055
+ return Requests.processRoute(AdsRoute.routes.getRedditThirdPartyAudiences, undefined, undefined, params);
7056
+ };
6983
7057
  return Ads;
6984
7058
  }());
6985
7059
 
@@ -12111,6 +12185,7 @@ var SchedulerRoute = /** @class */ (function () {
12111
12185
  clearTwitchAuth: { url: '/schedulers/{scheduler_id}/clearTwitchAuth', method: HTTP_METHODS.DELETE },
12112
12186
  clearKickAuth: { url: '/schedulers/{scheduler_id}/clearKickAuth', method: HTTP_METHODS.DELETE },
12113
12187
  clearRedditAuth: { url: '/schedulers/{scheduler_id}/clearRedditAuth', method: HTTP_METHODS.DELETE },
12188
+ clearRedditAdsAuth: { url: '/schedulers/{scheduler_id}/clearRedditAdsAuth', method: HTTP_METHODS.DELETE },
12114
12189
  clearYouTubeAuth: { url: '/schedulers/{scheduler_id}/clearYouTubeAuth', method: HTTP_METHODS.DELETE },
12115
12190
  clearPatreonAuth: { url: '/schedulers/{scheduler_id}/clearPatreonAuth', method: HTTP_METHODS.DELETE },
12116
12191
  clearPinterestAuth: { url: '/schedulers/{scheduler_id}/clearPinterestAuth', method: HTTP_METHODS.DELETE },
@@ -12163,6 +12238,18 @@ var SchedulerRoute = /** @class */ (function () {
12163
12238
  url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts',
12164
12239
  method: HTTP_METHODS.GET
12165
12240
  },
12241
+ getCampaignBusinesses: {
12242
+ url: "/schedulers/{scheduler_id}/businesses",
12243
+ method: HTTP_METHODS.GET,
12244
+ },
12245
+ getCampaignAdAccounts: {
12246
+ url: "/schedulers/{scheduler_id}/ad_accounts",
12247
+ method: HTTP_METHODS.GET,
12248
+ },
12249
+ getCampaignFundingInstruments: {
12250
+ url: "/schedulers/{scheduler_id}/funding_instruments",
12251
+ method: HTTP_METHODS.GET,
12252
+ },
12166
12253
  };
12167
12254
  return SchedulerRoute;
12168
12255
  }());
@@ -12405,6 +12492,15 @@ var Scheduler = /** @class */ (function () {
12405
12492
  Scheduler.clearRedditAuth = function (scheduler_id, params) {
12406
12493
  return Requests.processRoute(SchedulerRoute.routes.clearRedditAuth, {}, { scheduler_id: scheduler_id }, params);
12407
12494
  };
12495
+ /**
12496
+ * Clear Reddit Ads OAuth credentials from a promotion schedule.
12497
+ *
12498
+ * @param scheduler_id The ID of the promotion schedule.
12499
+ * @returns promise
12500
+ */
12501
+ Scheduler.clearRedditAdsAuth = function (scheduler_id, params) {
12502
+ return Requests.processRoute(SchedulerRoute.routes.clearRedditAdsAuth, {}, { scheduler_id: scheduler_id }, params);
12503
+ };
12408
12504
  /**
12409
12505
  * Clear YouTube OAuth credentials from a promotion schedule.
12410
12506
  *
@@ -12599,6 +12695,51 @@ var Scheduler = /** @class */ (function () {
12599
12695
  Scheduler.crossPromoteRelationshipPosts = function (scheduler_id, relationship_id, params) {
12600
12696
  return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipPosts, {}, { scheduler_id: scheduler_id, relationship_id: relationship_id }, params);
12601
12697
  };
12698
+ /**
12699
+ * List platform-level businesses for the given campaign ID,
12700
+ * as defined by /schedulers/{scheduler_id}/businesses on the backend.
12701
+ *
12702
+ * Typically relevant for Reddit (list businesses), or might return a
12703
+ * "not supported" message for Meta/TikTok.
12704
+ *
12705
+ * @param scheduler_id The UUID of the Ad Campaign
12706
+ * @param params Optional query parameters, e.g. page.size, etc.
12707
+ * @returns A response object with data (business list or messages)
12708
+ */
12709
+ Scheduler.listCampaignBusinesses = function (scheduler_id, params) {
12710
+ return Requests.processRoute(SchedulerRoute.routes.getCampaignBusinesses, undefined, // no request body
12711
+ { scheduler_id: scheduler_id }, // path params
12712
+ params // query params
12713
+ );
12714
+ };
12715
+ /**
12716
+ * List Ad Accounts for the given campaign ID,
12717
+ * as defined by /schedulers/{scheduler_id}/ad_accounts on the backend.
12718
+ *
12719
+ * E.g. for Reddit, you can pass ?business_id= to get business-level ad accounts,
12720
+ * or for Twitter, it might just return a user’s ad accounts, etc.
12721
+ *
12722
+ * @param scheduler_id The UUID of the Ad Campaign
12723
+ * @param params Optional query parameters, e.g. business_id, page.size, etc.
12724
+ * @returns A response object with data (ad account list)
12725
+ */
12726
+ Scheduler.listCampaignAdAccounts = function (scheduler_id, params) {
12727
+ return Requests.processRoute(SchedulerRoute.routes.getCampaignAdAccounts, undefined, { scheduler_id: scheduler_id }, params);
12728
+ };
12729
+ /**
12730
+ * List funding instruments for the given campaign ID,
12731
+ * as defined by /schedulers/{scheduler_id}/funding_instruments on the backend.
12732
+ *
12733
+ * For Twitter, pass ?account_id=...
12734
+ * For Reddit, pass ?ad_account_id=... or ?business_id=...
12735
+ *
12736
+ * @param scheduler_id The UUID of the Ad Campaign
12737
+ * @param params Optional query parameters
12738
+ * @returns A response object with data (funding instruments)
12739
+ */
12740
+ Scheduler.listCampaignFundingInstruments = function (scheduler_id, params) {
12741
+ return Requests.processRoute(SchedulerRoute.routes.getCampaignFundingInstruments, undefined, { scheduler_id: scheduler_id }, params);
12742
+ };
12602
12743
  return Scheduler;
12603
12744
  }());
12604
12745