glitch-javascript-sdk 2.0.0 → 2.0.2

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.
@@ -0,0 +1,7 @@
1
+ import Route from "./interface";
2
+ declare class MarketingAgenciesRoute {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default MarketingAgenciesRoute;
package/dist/index.d.ts CHANGED
@@ -5325,6 +5325,81 @@ declare class Scheduler {
5325
5325
  * @returns A response object with data (funding instruments)
5326
5326
  */
5327
5327
  static listCampaignFundingInstruments<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5328
+ /**
5329
+ * List all destinations for a title update.
5330
+ *
5331
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/listTitleUpdateDestinations
5332
+ *
5333
+ * @param scheduler_id The ID of the promotion schedule.
5334
+ * @param update_id The ID of the title update.
5335
+ * @returns promise
5336
+ */
5337
+ static listDestinations<T>(scheduler_id: string, update_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5338
+ /**
5339
+ * Create a new destination for a title update.
5340
+ *
5341
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/createTitleUpdateDestination
5342
+ *
5343
+ * @param scheduler_id The ID of the promotion schedule.
5344
+ * @param update_id The ID of the title update.
5345
+ * @param data The data for the new destination.
5346
+ * @returns promise
5347
+ */
5348
+ static createDestination<T>(scheduler_id: string, update_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5349
+ /**
5350
+ * Get a specific title update destination.
5351
+ *
5352
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/getTitleUpdateDestination
5353
+ *
5354
+ * @param scheduler_id The ID of the promotion schedule.
5355
+ * @param update_id The ID of the title update.
5356
+ * @param destination_id The ID of the destination.
5357
+ * @returns promise
5358
+ */
5359
+ static getDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5360
+ /**
5361
+ * Update a title update destination.
5362
+ *
5363
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdateDestination
5364
+ *
5365
+ * @param scheduler_id The ID of the promotion schedule.
5366
+ * @param update_id The ID of the title update.
5367
+ * @param destination_id The ID of the destination.
5368
+ * @param data The data to update.
5369
+ * @returns promise
5370
+ */
5371
+ static updateDestination<T>(scheduler_id: string, update_id: string, destination_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5372
+ /**
5373
+ * Delete a title update destination.
5374
+ *
5375
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/deleteTitleUpdateDestination
5376
+ *
5377
+ * @param scheduler_id The ID of the promotion schedule.
5378
+ * @param update_id The ID of the title update.
5379
+ * @param destination_id The ID of the destination.
5380
+ * @returns promise
5381
+ */
5382
+ static deleteDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5383
+ /**
5384
+ * Get AI-powered subreddit recommendations for a scheduler.
5385
+ *
5386
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/getSchedulerRedditRecommendations
5387
+ *
5388
+ * @param scheduler_id The ID of the promotion schedule.
5389
+ * @param data The context for the post (title, content, media type).
5390
+ * @returns promise
5391
+ */
5392
+ static getRedditRecommendations<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5393
+ /**
5394
+ * Generate tailored content for a specific subreddit.
5395
+ *
5396
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/generateRedditContentForSubreddit
5397
+ *
5398
+ * @param scheduler_id The ID of the promotion schedule.
5399
+ * @param data The target subreddit and post context.
5400
+ * @returns promise
5401
+ */
5402
+ static generateRedditContent<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5328
5403
  }
5329
5404
 
5330
5405
  declare class Funnel {
@@ -5688,6 +5763,178 @@ declare class AIUsage {
5688
5763
  static summary<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
5689
5764
  }
5690
5765
 
5766
+ declare class MarketingAgencies {
5767
+ /**
5768
+ * List all marketing agencies.
5769
+ *
5770
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies
5771
+ *
5772
+ * @param params Optional query parameters (e.g., is_admin, sort_by, sort_order, page, per_page).
5773
+ * @returns promise
5774
+ */
5775
+ static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
5776
+ /**
5777
+ * Create a new marketing agency.
5778
+ *
5779
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies
5780
+ *
5781
+ * @param data The data for the new agency.
5782
+ * @returns Promise
5783
+ */
5784
+ static create<T>(data: object): AxiosPromise<Response<T>>;
5785
+ /**
5786
+ * Retrieve a single marketing agency by its ID.
5787
+ *
5788
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id
5789
+ *
5790
+ * @param id The UUID of the agency to retrieve.
5791
+ * @returns promise
5792
+ */
5793
+ static view<T>(id: string): AxiosPromise<Response<T>>;
5794
+ /**
5795
+ * Update a marketing agency.
5796
+ *
5797
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/putMarketing-agencies-id
5798
+ *
5799
+ * @param id The UUID of the agency to update.
5800
+ * @param data The data to update.
5801
+ * @returns promise
5802
+ */
5803
+ static update<T>(id: string, data: object): AxiosPromise<Response<T>>;
5804
+ /**
5805
+ * Deletes a marketing agency.
5806
+ *
5807
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id
5808
+ *
5809
+ * @param id The UUID of the agency to delete.
5810
+ * @returns promise
5811
+ */
5812
+ static delete<T>(id: string): AxiosPromise<Response<T>>;
5813
+ /**
5814
+ * Add a user as an administrator to an agency.
5815
+ *
5816
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-administrators
5817
+ *
5818
+ * @param id The UUID of the agency.
5819
+ * @param data The data containing the user_id to add.
5820
+ * @returns Promise
5821
+ */
5822
+ static addAdministrator<T>(id: string, data: {
5823
+ user_id: string;
5824
+ }): AxiosPromise<Response<T>>;
5825
+ /**
5826
+ * Remove a user as an administrator from an agency.
5827
+ *
5828
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-administrators-user_id
5829
+ *
5830
+ * @param id The UUID of the agency.
5831
+ * @param user_id The UUID of the user to remove.
5832
+ * @returns Promise
5833
+ */
5834
+ static removeAdministrator<T>(id: string, user_id: string): AxiosPromise<Response<T>>;
5835
+ /**
5836
+ * Set the logo for an agency.
5837
+ *
5838
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-logo
5839
+ *
5840
+ * @param id The UUID of the agency.
5841
+ * @param data The data containing the media_id for the logo.
5842
+ * @returns Promise
5843
+ */
5844
+ static setLogo<T>(id: string, data: {
5845
+ media_id: string;
5846
+ }): AxiosPromise<Response<T>>;
5847
+ /**
5848
+ * Add a case study to an agency.
5849
+ *
5850
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies
5851
+ *
5852
+ * @param id The UUID of the agency.
5853
+ * @param data The data containing the media_id and optional order.
5854
+ * @returns Promise
5855
+ */
5856
+ static addCaseStudy<T>(id: string, data: {
5857
+ media_id: string;
5858
+ order?: number;
5859
+ }): AxiosPromise<Response<T>>;
5860
+ /**
5861
+ * Remove a case study from an agency.
5862
+ *
5863
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-case-studies-media_id
5864
+ *
5865
+ * @param id The UUID of the agency.
5866
+ * @param media_id The UUID of the media to remove.
5867
+ * @returns Promise
5868
+ */
5869
+ static removeCaseStudy<T>(id: string, media_id: string): AxiosPromise<Response<T>>;
5870
+ /**
5871
+ * Update the order of case studies for an agency.
5872
+ *
5873
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies-order
5874
+ *
5875
+ * @param id The UUID of the agency.
5876
+ * @param order_data An array of objects with media_id and new order.
5877
+ * @returns Promise
5878
+ */
5879
+ static updateCaseStudyOrder<T>(id: string, order_data: {
5880
+ media_id: string;
5881
+ order: number;
5882
+ }[]): AxiosPromise<Response<T>>;
5883
+ /**
5884
+ * Invite a user to become an administrator of an agency.
5885
+ *
5886
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-invites
5887
+ *
5888
+ * @param id The UUID of the agency.
5889
+ * @param data The data containing the email of the user to invite.
5890
+ * @returns Promise
5891
+ */
5892
+ static invite<T>(id: string, data: {
5893
+ email: string;
5894
+ }): AxiosPromise<Response<T>>;
5895
+ /**
5896
+ * List all pending invitations for an agency.
5897
+ *
5898
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id-invites
5899
+ *
5900
+ * @param id The UUID of the agency.
5901
+ * @returns Promise
5902
+ */
5903
+ static listInvites<T>(id: string): AxiosPromise<Response<T>>;
5904
+ /**
5905
+ * Revoke a pending invitation.
5906
+ *
5907
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-invites-invite_id
5908
+ *
5909
+ * @param id The UUID of the agency.
5910
+ * @param invite_id The UUID of the invitation to revoke.
5911
+ * @returns Promise
5912
+ */
5913
+ static revokeInvite<T>(id: string, invite_id: string): AxiosPromise<Response<T>>;
5914
+ /**
5915
+ * Get the details of a pending invitation using its token.
5916
+ *
5917
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-invites-details
5918
+ *
5919
+ * @param params An object containing the token.
5920
+ * @returns Promise
5921
+ */
5922
+ static getInviteDetails<T>(params: {
5923
+ token: string;
5924
+ }): AxiosPromise<Response<T>>;
5925
+ /**
5926
+ * Accept an invitation to become an administrator.
5927
+ *
5928
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-invites-accept
5929
+ *
5930
+ * @param data The data containing the invitation token.
5931
+ * @returns Promise
5932
+ */
5933
+ static acceptInvite<T>(data: {
5934
+ token: string;
5935
+ }): AxiosPromise<Response<T>>;
5936
+ }
5937
+
5691
5938
  interface Route {
5692
5939
  url: string;
5693
5940
  method: string;
@@ -6032,6 +6279,7 @@ declare class Glitch {
6032
6279
  Fingerprinting: typeof Fingerprinting;
6033
6280
  ShortLinks: typeof ShortLinks;
6034
6281
  AIUsage: typeof AIUsage;
6282
+ MarketingAgencies: typeof MarketingAgencies;
6035
6283
  };
6036
6284
  static util: {
6037
6285
  Requests: typeof Requests;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -0,0 +1,210 @@
1
+ import MarketingAgenciesRoute from "../routes/MarketingAgenciesRoute";
2
+ import Requests from "../util/Requests";
3
+ import Response from "../util/Response";
4
+ import { AxiosPromise } from "axios";
5
+
6
+ class MarketingAgencies {
7
+
8
+ /**
9
+ * List all marketing agencies.
10
+ *
11
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies
12
+ *
13
+ * @param params Optional query parameters (e.g., is_admin, sort_by, sort_order, page, per_page).
14
+ * @returns promise
15
+ */
16
+ public static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
17
+ return Requests.processRoute(MarketingAgenciesRoute.routes.list, undefined, undefined, params);
18
+ }
19
+
20
+ /**
21
+ * Create a new marketing agency.
22
+ *
23
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies
24
+ *
25
+ * @param data The data for the new agency.
26
+ * @returns Promise
27
+ */
28
+ public static create<T>(data: object): AxiosPromise<Response<T>> {
29
+ return Requests.processRoute(MarketingAgenciesRoute.routes.create, data);
30
+ }
31
+
32
+ /**
33
+ * Retrieve a single marketing agency by its ID.
34
+ *
35
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id
36
+ *
37
+ * @param id The UUID of the agency to retrieve.
38
+ * @returns promise
39
+ */
40
+ public static view<T>(id: string): AxiosPromise<Response<T>> {
41
+ return Requests.processRoute(MarketingAgenciesRoute.routes.view, {}, { id });
42
+ }
43
+
44
+ /**
45
+ * Update a marketing agency.
46
+ *
47
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/putMarketing-agencies-id
48
+ *
49
+ * @param id The UUID of the agency to update.
50
+ * @param data The data to update.
51
+ * @returns promise
52
+ */
53
+ public static update<T>(id: string, data: object): AxiosPromise<Response<T>> {
54
+ return Requests.processRoute(MarketingAgenciesRoute.routes.update, data, { id });
55
+ }
56
+
57
+ /**
58
+ * Deletes a marketing agency.
59
+ *
60
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id
61
+ *
62
+ * @param id The UUID of the agency to delete.
63
+ * @returns promise
64
+ */
65
+ public static delete<T>(id: string): AxiosPromise<Response<T>> {
66
+ return Requests.processRoute(MarketingAgenciesRoute.routes.delete, {}, { id });
67
+ }
68
+
69
+ /**
70
+ * Add a user as an administrator to an agency.
71
+ *
72
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-administrators
73
+ *
74
+ * @param id The UUID of the agency.
75
+ * @param data The data containing the user_id to add.
76
+ * @returns Promise
77
+ */
78
+ public static addAdministrator<T>(id: string, data: { user_id: string }): AxiosPromise<Response<T>> {
79
+ return Requests.processRoute(MarketingAgenciesRoute.routes.addAdministrator, data, { id });
80
+ }
81
+
82
+ /**
83
+ * Remove a user as an administrator from an agency.
84
+ *
85
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-administrators-user_id
86
+ *
87
+ * @param id The UUID of the agency.
88
+ * @param user_id The UUID of the user to remove.
89
+ * @returns Promise
90
+ */
91
+ public static removeAdministrator<T>(id: string, user_id: string): AxiosPromise<Response<T>> {
92
+ return Requests.processRoute(MarketingAgenciesRoute.routes.removeAdministrator, {}, { id, user_id });
93
+ }
94
+
95
+ /**
96
+ * Set the logo for an agency.
97
+ *
98
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-logo
99
+ *
100
+ * @param id The UUID of the agency.
101
+ * @param data The data containing the media_id for the logo.
102
+ * @returns Promise
103
+ */
104
+ public static setLogo<T>(id: string, data: { media_id: string }): AxiosPromise<Response<T>> {
105
+ return Requests.processRoute(MarketingAgenciesRoute.routes.setLogo, data, { id });
106
+ }
107
+
108
+ /**
109
+ * Add a case study to an agency.
110
+ *
111
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies
112
+ *
113
+ * @param id The UUID of the agency.
114
+ * @param data The data containing the media_id and optional order.
115
+ * @returns Promise
116
+ */
117
+ public static addCaseStudy<T>(id: string, data: { media_id: string, order?: number }): AxiosPromise<Response<T>> {
118
+ return Requests.processRoute(MarketingAgenciesRoute.routes.addCaseStudy, data, { id });
119
+ }
120
+
121
+ /**
122
+ * Remove a case study from an agency.
123
+ *
124
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-case-studies-media_id
125
+ *
126
+ * @param id The UUID of the agency.
127
+ * @param media_id The UUID of the media to remove.
128
+ * @returns Promise
129
+ */
130
+ public static removeCaseStudy<T>(id: string, media_id: string): AxiosPromise<Response<T>> {
131
+ return Requests.processRoute(MarketingAgenciesRoute.routes.removeCaseStudy, {}, { id, media_id });
132
+ }
133
+
134
+ /**
135
+ * Update the order of case studies for an agency.
136
+ *
137
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies-order
138
+ *
139
+ * @param id The UUID of the agency.
140
+ * @param order_data An array of objects with media_id and new order.
141
+ * @returns Promise
142
+ */
143
+ public static updateCaseStudyOrder<T>(id: string, order_data: { media_id: string, order: number }[]): AxiosPromise<Response<T>> {
144
+ return Requests.processRoute(MarketingAgenciesRoute.routes.updateCaseStudyOrder, { order_data }, { id });
145
+ }
146
+
147
+ /**
148
+ * Invite a user to become an administrator of an agency.
149
+ *
150
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-invites
151
+ *
152
+ * @param id The UUID of the agency.
153
+ * @param data The data containing the email of the user to invite.
154
+ * @returns Promise
155
+ */
156
+ public static invite<T>(id: string, data: { email: string }): AxiosPromise<Response<T>> {
157
+ return Requests.processRoute(MarketingAgenciesRoute.routes.invite, data, { id });
158
+ }
159
+
160
+ /**
161
+ * List all pending invitations for an agency.
162
+ *
163
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id-invites
164
+ *
165
+ * @param id The UUID of the agency.
166
+ * @returns Promise
167
+ */
168
+ public static listInvites<T>(id: string): AxiosPromise<Response<T>> {
169
+ return Requests.processRoute(MarketingAgenciesRoute.routes.listInvites, {}, { id });
170
+ }
171
+
172
+ /**
173
+ * Revoke a pending invitation.
174
+ *
175
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-invites-invite_id
176
+ *
177
+ * @param id The UUID of the agency.
178
+ * @param invite_id The UUID of the invitation to revoke.
179
+ * @returns Promise
180
+ */
181
+ public static revokeInvite<T>(id: string, invite_id: string): AxiosPromise<Response<T>> {
182
+ return Requests.processRoute(MarketingAgenciesRoute.routes.revokeInvite, {}, { id, invite_id });
183
+ }
184
+
185
+ /**
186
+ * Get the details of a pending invitation using its token.
187
+ *
188
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-invites-details
189
+ *
190
+ * @param params An object containing the token.
191
+ * @returns Promise
192
+ */
193
+ public static getInviteDetails<T>(params: { token: string }): AxiosPromise<Response<T>> {
194
+ return Requests.processRoute(MarketingAgenciesRoute.routes.getInviteDetails, undefined, undefined, params);
195
+ }
196
+
197
+ /**
198
+ * Accept an invitation to become an administrator.
199
+ *
200
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-invites-accept
201
+ *
202
+ * @param data The data containing the invitation token.
203
+ * @returns Promise
204
+ */
205
+ public static acceptInvite<T>(data: { token: string }): AxiosPromise<Response<T>> {
206
+ return Requests.processRoute(MarketingAgenciesRoute.routes.acceptInvite, data);
207
+ }
208
+ }
209
+
210
+ export default MarketingAgencies;
@@ -681,6 +681,102 @@ class Scheduler {
681
681
  );
682
682
  }
683
683
 
684
+ /**
685
+ * List all destinations for a title update.
686
+ *
687
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/listTitleUpdateDestinations
688
+ *
689
+ * @param scheduler_id The ID of the promotion schedule.
690
+ * @param update_id The ID of the title update.
691
+ * @returns promise
692
+ */
693
+ public static listDestinations<T>(scheduler_id: string, update_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
694
+ return Requests.processRoute(SchedulerRoute.routes.listDestinations, {}, { scheduler_id, update_id }, params);
695
+ }
696
+
697
+ /**
698
+ * Create a new destination for a title update.
699
+ *
700
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/createTitleUpdateDestination
701
+ *
702
+ * @param scheduler_id The ID of the promotion schedule.
703
+ * @param update_id The ID of the title update.
704
+ * @param data The data for the new destination.
705
+ * @returns promise
706
+ */
707
+ public static createDestination<T>(scheduler_id: string, update_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
708
+ return Requests.processRoute(SchedulerRoute.routes.createDestination, data, { scheduler_id, update_id }, params);
709
+ }
710
+
711
+ /**
712
+ * Get a specific title update destination.
713
+ *
714
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/getTitleUpdateDestination
715
+ *
716
+ * @param scheduler_id The ID of the promotion schedule.
717
+ * @param update_id The ID of the title update.
718
+ * @param destination_id The ID of the destination.
719
+ * @returns promise
720
+ */
721
+ public static getDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
722
+ return Requests.processRoute(SchedulerRoute.routes.getDestination, {}, { scheduler_id, update_id, destination_id }, params);
723
+ }
724
+
725
+ /**
726
+ * Update a title update destination.
727
+ *
728
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdateDestination
729
+ *
730
+ * @param scheduler_id The ID of the promotion schedule.
731
+ * @param update_id The ID of the title update.
732
+ * @param destination_id The ID of the destination.
733
+ * @param data The data to update.
734
+ * @returns promise
735
+ */
736
+ public static updateDestination<T>(scheduler_id: string, update_id: string, destination_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
737
+ return Requests.processRoute(SchedulerRoute.routes.updateDestination, data, { scheduler_id, update_id, destination_id }, params);
738
+ }
739
+
740
+ /**
741
+ * Delete a title update destination.
742
+ *
743
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/deleteTitleUpdateDestination
744
+ *
745
+ * @param scheduler_id The ID of the promotion schedule.
746
+ * @param update_id The ID of the title update.
747
+ * @param destination_id The ID of the destination.
748
+ * @returns promise
749
+ */
750
+ public static deleteDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
751
+ return Requests.processRoute(SchedulerRoute.routes.deleteDestination, {}, { scheduler_id, update_id, destination_id }, params);
752
+ }
753
+
754
+ /**
755
+ * Get AI-powered subreddit recommendations for a scheduler.
756
+ *
757
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/getSchedulerRedditRecommendations
758
+ *
759
+ * @param scheduler_id The ID of the promotion schedule.
760
+ * @param data The context for the post (title, content, media type).
761
+ * @returns promise
762
+ */
763
+ public static getRedditRecommendations<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
764
+ return Requests.processRoute(SchedulerRoute.routes.getRedditRecommendations, data, { scheduler_id }, params);
765
+ }
766
+
767
+ /**
768
+ * Generate tailored content for a specific subreddit.
769
+ *
770
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/generateRedditContentForSubreddit
771
+ *
772
+ * @param scheduler_id The ID of the promotion schedule.
773
+ * @param data The target subreddit and post context.
774
+ * @returns promise
775
+ */
776
+ public static generateRedditContent<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
777
+ return Requests.processRoute(SchedulerRoute.routes.generateRedditContent, data, { scheduler_id }, params);
778
+ }
779
+
684
780
  }
685
781
 
686
782
  export default Scheduler;
package/src/api/index.ts CHANGED
@@ -35,6 +35,7 @@ import Hashtags from "./Hashtags";
35
35
  import WebsiteAnalytics from "./WebsiteAnalytics";
36
36
  import ShortLinks from "./ShortLinks";
37
37
  import AIUsage from "./AIUsage";
38
+ import MarketingAgencies from "./MarketingAgencies";
38
39
 
39
40
  export {Ads};
40
41
  export {Auth};
@@ -72,4 +73,5 @@ export {Hashtags};
72
73
  export {WebsiteAnalytics};
73
74
  export {Fingerprinting};
74
75
  export {ShortLinks};
75
- export {AIUsage};
76
+ export {AIUsage};
77
+ export {MarketingAgencies};
package/src/index.ts CHANGED
@@ -39,6 +39,7 @@ import {WebsiteAnalytics} from "./api";
39
39
  import {Fingerprinting} from "./api";
40
40
  import {ShortLinks} from "./api";
41
41
  import {AIUsage} from "./api";
42
+ import {MarketingAgencies} from "./api"
42
43
 
43
44
  import Requests from "./util/Requests";
44
45
  import Parser from "./util/Parser";
@@ -106,7 +107,8 @@ class Glitch {
106
107
  WebsiteAnalytics: WebsiteAnalytics,
107
108
  Fingerprinting : Fingerprinting,
108
109
  ShortLinks : ShortLinks,
109
- AIUsage : AIUsage
110
+ AIUsage : AIUsage,
111
+ MarketingAgencies : MarketingAgencies
110
112
  }
111
113
 
112
114
  public static util = {
@@ -0,0 +1,36 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class MarketingAgenciesRoute {
5
+
6
+ public static routes: { [key: string]: Route } = {
7
+ // CRUD for agencies
8
+ list: { url: '/marketing-agencies', method: HTTP_METHODS.GET },
9
+ create: { url: '/marketing-agencies', method: HTTP_METHODS.POST },
10
+ view: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.GET },
11
+ update: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.PUT },
12
+ delete: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.DELETE },
13
+
14
+ // Administrator management
15
+ addAdministrator: { url: '/marketing-agencies/{id}/administrators', method: HTTP_METHODS.POST },
16
+ removeAdministrator: { url: '/marketing-agencies/{id}/administrators/{user_id}', method: HTTP_METHODS.DELETE },
17
+
18
+ // Logo management
19
+ setLogo: { url: '/marketing-agencies/{id}/logo', method: HTTP_METHODS.POST },
20
+
21
+ // Case Study management
22
+ addCaseStudy: { url: '/marketing-agencies/{id}/case-studies', method: HTTP_METHODS.POST },
23
+ removeCaseStudy: { url: '/marketing-agencies/{id}/case-studies/{media_id}', method: HTTP_METHODS.DELETE },
24
+ updateCaseStudyOrder: { url: '/marketing-agencies/{id}/case-studies/order', method: HTTP_METHODS.POST },
25
+
26
+ // Invitation management
27
+ invite: { url: '/marketing-agencies/{id}/invites', method: HTTP_METHODS.POST },
28
+ listInvites: { url: '/marketing-agencies/{id}/invites', method: HTTP_METHODS.GET },
29
+ revokeInvite: { url: '/marketing-agencies/{id}/invites/{invite_id}', method: HTTP_METHODS.DELETE },
30
+ getInviteDetails: { url: '/marketing-agencies/invites/details', method: HTTP_METHODS.GET },
31
+ acceptInvite: { url: '/marketing-agencies/invites/accept', method: HTTP_METHODS.POST },
32
+ };
33
+
34
+ }
35
+
36
+ export default MarketingAgenciesRoute;