glitch-javascript-sdk 1.7.9 → 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.
@@ -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
  // ----------------------------------------------------------------
@@ -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
  // ----------------------------------------------------------------
@@ -12163,6 +12163,18 @@ var SchedulerRoute = /** @class */ (function () {
12163
12163
  url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts',
12164
12164
  method: HTTP_METHODS.GET
12165
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
+ },
12166
12178
  };
12167
12179
  return SchedulerRoute;
12168
12180
  }());
@@ -12599,6 +12611,51 @@ var Scheduler = /** @class */ (function () {
12599
12611
  Scheduler.crossPromoteRelationshipPosts = function (scheduler_id, relationship_id, params) {
12600
12612
  return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipPosts, {}, { scheduler_id: scheduler_id, relationship_id: relationship_id }, params);
12601
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
+ };
12602
12659
  return Scheduler;
12603
12660
  }());
12604
12661