glitch-javascript-sdk 1.7.8 → 1.8.0

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.
@@ -184,5 +184,41 @@ declare class Ads {
184
184
  * @returns A 204 No Content response on success
185
185
  */
186
186
  static deleteTrigger<T>(campaign_id: string, group_id: string, trigger_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
187
+ /**
188
+ * List platform-level businesses for the given campaign ID,
189
+ * as defined by /ads/campaigns/{id}/businesses on the backend.
190
+ *
191
+ * Typically relevant for Reddit (list businesses), or might return a
192
+ * "not supported" message for Meta/TikTok.
193
+ *
194
+ * @param campaign_id The UUID of the Ad Campaign
195
+ * @param params Optional query parameters, e.g. page.size, etc.
196
+ * @returns A response object with data (business list or messages)
197
+ */
198
+ static listCampaignBusinesses<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
199
+ /**
200
+ * List Ad Accounts for the given campaign ID,
201
+ * as defined by /ads/campaigns/{id}/ad_accounts on the backend.
202
+ *
203
+ * E.g. for Reddit, you can pass ?business_id= to get business-level ad accounts,
204
+ * or for Twitter, it might just return a user’s ad accounts, etc.
205
+ *
206
+ * @param campaign_id The UUID of the Ad Campaign
207
+ * @param params Optional query parameters, e.g. business_id, page.size, etc.
208
+ * @returns A response object with data (ad account list)
209
+ */
210
+ static listCampaignAdAccounts<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
211
+ /**
212
+ * List funding instruments for the given campaign ID,
213
+ * as defined by /ads/campaigns/{id}/funding_instruments on the backend.
214
+ *
215
+ * For Twitter, pass ?account_id=...
216
+ * For Reddit, pass ?ad_account_id=... or ?business_id=...
217
+ *
218
+ * @param campaign_id The UUID of the Ad Campaign
219
+ * @param params Optional query parameters
220
+ * @returns A response object with data (funding instruments)
221
+ */
222
+ static listCampaignFundingInstruments<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
187
223
  }
188
224
  export default Ads;
@@ -341,5 +341,41 @@ declare class Scheduler {
341
341
  * GET /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts
342
342
  */
343
343
  static crossPromoteRelationshipPosts<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
344
+ /**
345
+ * List platform-level businesses for the given campaign ID,
346
+ * as defined by /schedulers/{scheduler_id}/businesses on the backend.
347
+ *
348
+ * Typically relevant for Reddit (list businesses), or might return a
349
+ * "not supported" message for Meta/TikTok.
350
+ *
351
+ * @param scheduler_id The UUID of the Ad Campaign
352
+ * @param params Optional query parameters, e.g. page.size, etc.
353
+ * @returns A response object with data (business list or messages)
354
+ */
355
+ static listCampaignBusinesses<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
356
+ /**
357
+ * List Ad Accounts for the given campaign ID,
358
+ * as defined by /schedulers/{scheduler_id}/ad_accounts on the backend.
359
+ *
360
+ * E.g. for Reddit, you can pass ?business_id= to get business-level ad accounts,
361
+ * or for Twitter, it might just return a user’s ad accounts, etc.
362
+ *
363
+ * @param scheduler_id The UUID of the Ad Campaign
364
+ * @param params Optional query parameters, e.g. business_id, page.size, etc.
365
+ * @returns A response object with data (ad account list)
366
+ */
367
+ static listCampaignAdAccounts<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
368
+ /**
369
+ * List funding instruments for the given campaign ID,
370
+ * as defined by /schedulers/{scheduler_id}/funding_instruments on the backend.
371
+ *
372
+ * For Twitter, pass ?account_id=...
373
+ * For Reddit, pass ?ad_account_id=... or ?business_id=...
374
+ *
375
+ * @param scheduler_id The UUID of the Ad Campaign
376
+ * @param params Optional query parameters
377
+ * @returns A response object with data (funding instruments)
378
+ */
379
+ static listCampaignFundingInstruments<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
344
380
  }
345
381
  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
  // ----------------------------------------------------------------
@@ -6923,6 +6935,51 @@ var Ads = /** @class */ (function () {
6923
6935
  Ads.deleteTrigger = function (campaign_id, group_id, trigger_id, params) {
6924
6936
  return Requests.processRoute(AdsRoute.routes.deleteTrigger, {}, { campaign_id: campaign_id, group_id: group_id, trigger_id: trigger_id }, params);
6925
6937
  };
6938
+ /**
6939
+ * List platform-level businesses for the given campaign ID,
6940
+ * as defined by /ads/campaigns/{id}/businesses on the backend.
6941
+ *
6942
+ * Typically relevant for Reddit (list businesses), or might return a
6943
+ * "not supported" message for Meta/TikTok.
6944
+ *
6945
+ * @param campaign_id The UUID of the Ad Campaign
6946
+ * @param params Optional query parameters, e.g. page.size, etc.
6947
+ * @returns A response object with data (business list or messages)
6948
+ */
6949
+ Ads.listCampaignBusinesses = function (campaign_id, params) {
6950
+ return Requests.processRoute(AdsRoute.routes.getCampaignBusinesses, undefined, // no request body
6951
+ { campaign_id: campaign_id }, // path params
6952
+ params // query params
6953
+ );
6954
+ };
6955
+ /**
6956
+ * List Ad Accounts for the given campaign ID,
6957
+ * as defined by /ads/campaigns/{id}/ad_accounts on the backend.
6958
+ *
6959
+ * E.g. for Reddit, you can pass ?business_id= to get business-level ad accounts,
6960
+ * or for Twitter, it might just return a user’s ad accounts, etc.
6961
+ *
6962
+ * @param campaign_id The UUID of the Ad Campaign
6963
+ * @param params Optional query parameters, e.g. business_id, page.size, etc.
6964
+ * @returns A response object with data (ad account list)
6965
+ */
6966
+ Ads.listCampaignAdAccounts = function (campaign_id, params) {
6967
+ return Requests.processRoute(AdsRoute.routes.getCampaignAdAccounts, undefined, { campaign_id: campaign_id }, params);
6968
+ };
6969
+ /**
6970
+ * List funding instruments for the given campaign ID,
6971
+ * as defined by /ads/campaigns/{id}/funding_instruments on the backend.
6972
+ *
6973
+ * For Twitter, pass ?account_id=...
6974
+ * For Reddit, pass ?ad_account_id=... or ?business_id=...
6975
+ *
6976
+ * @param campaign_id The UUID of the Ad Campaign
6977
+ * @param params Optional query parameters
6978
+ * @returns A response object with data (funding instruments)
6979
+ */
6980
+ Ads.listCampaignFundingInstruments = function (campaign_id, params) {
6981
+ return Requests.processRoute(AdsRoute.routes.getCampaignFundingInstruments, undefined, { campaign_id: campaign_id }, params);
6982
+ };
6926
6983
  return Ads;
6927
6984
  }());
6928
6985
 
@@ -12106,6 +12163,18 @@ var SchedulerRoute = /** @class */ (function () {
12106
12163
  url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts',
12107
12164
  method: HTTP_METHODS.GET
12108
12165
  },
12166
+ getCampaignBusinesses: {
12167
+ url: "/schedulers/{scheduler_id}/businesses",
12168
+ method: HTTP_METHODS.GET,
12169
+ },
12170
+ getCampaignAdAccounts: {
12171
+ url: "/schedulers/{scheduler_id}/ad_accounts",
12172
+ method: HTTP_METHODS.GET,
12173
+ },
12174
+ getCampaignFundingInstruments: {
12175
+ url: "/schedulers/{scheduler_id}/funding_instruments",
12176
+ method: HTTP_METHODS.GET,
12177
+ },
12109
12178
  };
12110
12179
  return SchedulerRoute;
12111
12180
  }());
@@ -12542,6 +12611,51 @@ var Scheduler = /** @class */ (function () {
12542
12611
  Scheduler.crossPromoteRelationshipPosts = function (scheduler_id, relationship_id, params) {
12543
12612
  return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipPosts, {}, { scheduler_id: scheduler_id, relationship_id: relationship_id }, params);
12544
12613
  };
12614
+ /**
12615
+ * List platform-level businesses for the given campaign ID,
12616
+ * as defined by /schedulers/{scheduler_id}/businesses on the backend.
12617
+ *
12618
+ * Typically relevant for Reddit (list businesses), or might return a
12619
+ * "not supported" message for Meta/TikTok.
12620
+ *
12621
+ * @param scheduler_id The UUID of the Ad Campaign
12622
+ * @param params Optional query parameters, e.g. page.size, etc.
12623
+ * @returns A response object with data (business list or messages)
12624
+ */
12625
+ Scheduler.listCampaignBusinesses = function (scheduler_id, params) {
12626
+ return Requests.processRoute(SchedulerRoute.routes.getCampaignBusinesses, undefined, // no request body
12627
+ { scheduler_id: scheduler_id }, // path params
12628
+ params // query params
12629
+ );
12630
+ };
12631
+ /**
12632
+ * List Ad Accounts for the given campaign ID,
12633
+ * as defined by /schedulers/{scheduler_id}/ad_accounts on the backend.
12634
+ *
12635
+ * E.g. for Reddit, you can pass ?business_id= to get business-level ad accounts,
12636
+ * or for Twitter, it might just return a user’s ad accounts, etc.
12637
+ *
12638
+ * @param scheduler_id The UUID of the Ad Campaign
12639
+ * @param params Optional query parameters, e.g. business_id, page.size, etc.
12640
+ * @returns A response object with data (ad account list)
12641
+ */
12642
+ Scheduler.listCampaignAdAccounts = function (scheduler_id, params) {
12643
+ return Requests.processRoute(SchedulerRoute.routes.getCampaignAdAccounts, undefined, { scheduler_id: scheduler_id }, params);
12644
+ };
12645
+ /**
12646
+ * List funding instruments for the given campaign ID,
12647
+ * as defined by /schedulers/{scheduler_id}/funding_instruments on the backend.
12648
+ *
12649
+ * For Twitter, pass ?account_id=...
12650
+ * For Reddit, pass ?ad_account_id=... or ?business_id=...
12651
+ *
12652
+ * @param scheduler_id The UUID of the Ad Campaign
12653
+ * @param params Optional query parameters
12654
+ * @returns A response object with data (funding instruments)
12655
+ */
12656
+ Scheduler.listCampaignFundingInstruments = function (scheduler_id, params) {
12657
+ return Requests.processRoute(SchedulerRoute.routes.getCampaignFundingInstruments, undefined, { scheduler_id: scheduler_id }, params);
12658
+ };
12545
12659
  return Scheduler;
12546
12660
  }());
12547
12661