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.
package/dist/index.d.ts CHANGED
@@ -4752,6 +4752,42 @@ declare class Scheduler {
4752
4752
  * GET /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts
4753
4753
  */
4754
4754
  static crossPromoteRelationshipPosts<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4755
+ /**
4756
+ * List platform-level businesses for the given campaign ID,
4757
+ * as defined by /schedulers/{scheduler_id}/businesses on the backend.
4758
+ *
4759
+ * Typically relevant for Reddit (list businesses), or might return a
4760
+ * "not supported" message for Meta/TikTok.
4761
+ *
4762
+ * @param scheduler_id The UUID of the Ad Campaign
4763
+ * @param params Optional query parameters, e.g. page.size, etc.
4764
+ * @returns A response object with data (business list or messages)
4765
+ */
4766
+ static listCampaignBusinesses<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4767
+ /**
4768
+ * List Ad Accounts for the given campaign ID,
4769
+ * as defined by /schedulers/{scheduler_id}/ad_accounts on the backend.
4770
+ *
4771
+ * E.g. for Reddit, you can pass ?business_id= to get business-level ad accounts,
4772
+ * or for Twitter, it might just return a user’s ad accounts, etc.
4773
+ *
4774
+ * @param scheduler_id The UUID of the Ad Campaign
4775
+ * @param params Optional query parameters, e.g. business_id, page.size, etc.
4776
+ * @returns A response object with data (ad account list)
4777
+ */
4778
+ static listCampaignAdAccounts<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4779
+ /**
4780
+ * List funding instruments for the given campaign ID,
4781
+ * as defined by /schedulers/{scheduler_id}/funding_instruments on the backend.
4782
+ *
4783
+ * For Twitter, pass ?account_id=...
4784
+ * For Reddit, pass ?ad_account_id=... or ?business_id=...
4785
+ *
4786
+ * @param scheduler_id The UUID of the Ad Campaign
4787
+ * @param params Optional query parameters
4788
+ * @returns A response object with data (funding instruments)
4789
+ */
4790
+ static listCampaignFundingInstruments<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4755
4791
  }
4756
4792
 
4757
4793
  declare class Funnel {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.7.9",
3
+ "version": "1.8.0",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -527,6 +527,75 @@ class Scheduler {
527
527
  );
528
528
  }
529
529
 
530
+ /**
531
+ * List platform-level businesses for the given campaign ID,
532
+ * as defined by /schedulers/{scheduler_id}/businesses on the backend.
533
+ *
534
+ * Typically relevant for Reddit (list businesses), or might return a
535
+ * "not supported" message for Meta/TikTok.
536
+ *
537
+ * @param scheduler_id The UUID of the Ad Campaign
538
+ * @param params Optional query parameters, e.g. page.size, etc.
539
+ * @returns A response object with data (business list or messages)
540
+ */
541
+ public static listCampaignBusinesses<T>(
542
+ scheduler_id: string,
543
+ params?: Record<string, any>
544
+ ): AxiosPromise<Response<T>> {
545
+ return Requests.processRoute(
546
+ SchedulerRoute.routes.getCampaignBusinesses,
547
+ undefined, // no request body
548
+ { scheduler_id }, // path params
549
+ params // query params
550
+ );
551
+ }
552
+
553
+ /**
554
+ * List Ad Accounts for the given campaign ID,
555
+ * as defined by /schedulers/{scheduler_id}/ad_accounts on the backend.
556
+ *
557
+ * E.g. for Reddit, you can pass ?business_id= to get business-level ad accounts,
558
+ * or for Twitter, it might just return a user’s ad accounts, etc.
559
+ *
560
+ * @param scheduler_id The UUID of the Ad Campaign
561
+ * @param params Optional query parameters, e.g. business_id, page.size, etc.
562
+ * @returns A response object with data (ad account list)
563
+ */
564
+ public static listCampaignAdAccounts<T>(
565
+ scheduler_id: string,
566
+ params?: Record<string, any>
567
+ ): AxiosPromise<Response<T>> {
568
+ return Requests.processRoute(
569
+ SchedulerRoute.routes.getCampaignAdAccounts,
570
+ undefined,
571
+ { scheduler_id },
572
+ params
573
+ );
574
+ }
575
+
576
+ /**
577
+ * List funding instruments for the given campaign ID,
578
+ * as defined by /schedulers/{scheduler_id}/funding_instruments on the backend.
579
+ *
580
+ * For Twitter, pass ?account_id=...
581
+ * For Reddit, pass ?ad_account_id=... or ?business_id=...
582
+ *
583
+ * @param scheduler_id The UUID of the Ad Campaign
584
+ * @param params Optional query parameters
585
+ * @returns A response object with data (funding instruments)
586
+ */
587
+ public static listCampaignFundingInstruments<T>(
588
+ scheduler_id: string,
589
+ params?: Record<string, any>
590
+ ): AxiosPromise<Response<T>> {
591
+ return Requests.processRoute(
592
+ SchedulerRoute.routes.getCampaignFundingInstruments,
593
+ undefined,
594
+ { scheduler_id },
595
+ params
596
+ );
597
+ }
598
+
530
599
  }
531
600
 
532
601
  export default Scheduler;
@@ -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
  // ----------------------------------------------------------------
@@ -87,6 +87,22 @@ class SchedulerRoute {
87
87
  method: HTTP_METHODS.GET
88
88
  },
89
89
 
90
+ getCampaignBusinesses: {
91
+ url: "/schedulers/{scheduler_id}/businesses",
92
+ method: HTTP_METHODS.GET,
93
+ },
94
+
95
+ getCampaignAdAccounts: {
96
+ url: "/schedulers/{scheduler_id}/ad_accounts",
97
+ method: HTTP_METHODS.GET,
98
+ },
99
+
100
+ getCampaignFundingInstruments: {
101
+ url: "/schedulers/{scheduler_id}/funding_instruments",
102
+ method: HTTP_METHODS.GET,
103
+ },
104
+
105
+
90
106
 
91
107
  };
92
108
  }