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.
- package/dist/cjs/index.js +318 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/MarketingAgencies.d.ts +174 -0
- package/dist/esm/api/Scheduler.d.ts +75 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +318 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/MarketingAgenciesRoute.d.ts +7 -0
- package/dist/index.d.ts +248 -0
- package/package.json +1 -1
- package/src/api/MarketingAgencies.ts +210 -0
- package/src/api/Scheduler.ts +96 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +3 -1
- package/src/routes/MarketingAgenciesRoute.ts +36 -0
- package/src/routes/SchedulerRoute.ts +7 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import Response from "../util/Response";
|
|
2
|
+
import { AxiosPromise } from "axios";
|
|
3
|
+
declare class MarketingAgencies {
|
|
4
|
+
/**
|
|
5
|
+
* List all marketing agencies.
|
|
6
|
+
*
|
|
7
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies
|
|
8
|
+
*
|
|
9
|
+
* @param params Optional query parameters (e.g., is_admin, sort_by, sort_order, page, per_page).
|
|
10
|
+
* @returns promise
|
|
11
|
+
*/
|
|
12
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new marketing agency.
|
|
15
|
+
*
|
|
16
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies
|
|
17
|
+
*
|
|
18
|
+
* @param data The data for the new agency.
|
|
19
|
+
* @returns Promise
|
|
20
|
+
*/
|
|
21
|
+
static create<T>(data: object): AxiosPromise<Response<T>>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve a single marketing agency by its ID.
|
|
24
|
+
*
|
|
25
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id
|
|
26
|
+
*
|
|
27
|
+
* @param id The UUID of the agency to retrieve.
|
|
28
|
+
* @returns promise
|
|
29
|
+
*/
|
|
30
|
+
static view<T>(id: string): AxiosPromise<Response<T>>;
|
|
31
|
+
/**
|
|
32
|
+
* Update a marketing agency.
|
|
33
|
+
*
|
|
34
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/putMarketing-agencies-id
|
|
35
|
+
*
|
|
36
|
+
* @param id The UUID of the agency to update.
|
|
37
|
+
* @param data The data to update.
|
|
38
|
+
* @returns promise
|
|
39
|
+
*/
|
|
40
|
+
static update<T>(id: string, data: object): AxiosPromise<Response<T>>;
|
|
41
|
+
/**
|
|
42
|
+
* Deletes a marketing agency.
|
|
43
|
+
*
|
|
44
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id
|
|
45
|
+
*
|
|
46
|
+
* @param id The UUID of the agency to delete.
|
|
47
|
+
* @returns promise
|
|
48
|
+
*/
|
|
49
|
+
static delete<T>(id: string): AxiosPromise<Response<T>>;
|
|
50
|
+
/**
|
|
51
|
+
* Add a user as an administrator to an agency.
|
|
52
|
+
*
|
|
53
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-administrators
|
|
54
|
+
*
|
|
55
|
+
* @param id The UUID of the agency.
|
|
56
|
+
* @param data The data containing the user_id to add.
|
|
57
|
+
* @returns Promise
|
|
58
|
+
*/
|
|
59
|
+
static addAdministrator<T>(id: string, data: {
|
|
60
|
+
user_id: string;
|
|
61
|
+
}): AxiosPromise<Response<T>>;
|
|
62
|
+
/**
|
|
63
|
+
* Remove a user as an administrator from an agency.
|
|
64
|
+
*
|
|
65
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-administrators-user_id
|
|
66
|
+
*
|
|
67
|
+
* @param id The UUID of the agency.
|
|
68
|
+
* @param user_id The UUID of the user to remove.
|
|
69
|
+
* @returns Promise
|
|
70
|
+
*/
|
|
71
|
+
static removeAdministrator<T>(id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
72
|
+
/**
|
|
73
|
+
* Set the logo for an agency.
|
|
74
|
+
*
|
|
75
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-logo
|
|
76
|
+
*
|
|
77
|
+
* @param id The UUID of the agency.
|
|
78
|
+
* @param data The data containing the media_id for the logo.
|
|
79
|
+
* @returns Promise
|
|
80
|
+
*/
|
|
81
|
+
static setLogo<T>(id: string, data: {
|
|
82
|
+
media_id: string;
|
|
83
|
+
}): AxiosPromise<Response<T>>;
|
|
84
|
+
/**
|
|
85
|
+
* Add a case study to an agency.
|
|
86
|
+
*
|
|
87
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies
|
|
88
|
+
*
|
|
89
|
+
* @param id The UUID of the agency.
|
|
90
|
+
* @param data The data containing the media_id and optional order.
|
|
91
|
+
* @returns Promise
|
|
92
|
+
*/
|
|
93
|
+
static addCaseStudy<T>(id: string, data: {
|
|
94
|
+
media_id: string;
|
|
95
|
+
order?: number;
|
|
96
|
+
}): AxiosPromise<Response<T>>;
|
|
97
|
+
/**
|
|
98
|
+
* Remove a case study from an agency.
|
|
99
|
+
*
|
|
100
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-case-studies-media_id
|
|
101
|
+
*
|
|
102
|
+
* @param id The UUID of the agency.
|
|
103
|
+
* @param media_id The UUID of the media to remove.
|
|
104
|
+
* @returns Promise
|
|
105
|
+
*/
|
|
106
|
+
static removeCaseStudy<T>(id: string, media_id: string): AxiosPromise<Response<T>>;
|
|
107
|
+
/**
|
|
108
|
+
* Update the order of case studies for an agency.
|
|
109
|
+
*
|
|
110
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies-order
|
|
111
|
+
*
|
|
112
|
+
* @param id The UUID of the agency.
|
|
113
|
+
* @param order_data An array of objects with media_id and new order.
|
|
114
|
+
* @returns Promise
|
|
115
|
+
*/
|
|
116
|
+
static updateCaseStudyOrder<T>(id: string, order_data: {
|
|
117
|
+
media_id: string;
|
|
118
|
+
order: number;
|
|
119
|
+
}[]): AxiosPromise<Response<T>>;
|
|
120
|
+
/**
|
|
121
|
+
* Invite a user to become an administrator of an agency.
|
|
122
|
+
*
|
|
123
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-invites
|
|
124
|
+
*
|
|
125
|
+
* @param id The UUID of the agency.
|
|
126
|
+
* @param data The data containing the email of the user to invite.
|
|
127
|
+
* @returns Promise
|
|
128
|
+
*/
|
|
129
|
+
static invite<T>(id: string, data: {
|
|
130
|
+
email: string;
|
|
131
|
+
}): AxiosPromise<Response<T>>;
|
|
132
|
+
/**
|
|
133
|
+
* List all pending invitations for an agency.
|
|
134
|
+
*
|
|
135
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id-invites
|
|
136
|
+
*
|
|
137
|
+
* @param id The UUID of the agency.
|
|
138
|
+
* @returns Promise
|
|
139
|
+
*/
|
|
140
|
+
static listInvites<T>(id: string): AxiosPromise<Response<T>>;
|
|
141
|
+
/**
|
|
142
|
+
* Revoke a pending invitation.
|
|
143
|
+
*
|
|
144
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-invites-invite_id
|
|
145
|
+
*
|
|
146
|
+
* @param id The UUID of the agency.
|
|
147
|
+
* @param invite_id The UUID of the invitation to revoke.
|
|
148
|
+
* @returns Promise
|
|
149
|
+
*/
|
|
150
|
+
static revokeInvite<T>(id: string, invite_id: string): AxiosPromise<Response<T>>;
|
|
151
|
+
/**
|
|
152
|
+
* Get the details of a pending invitation using its token.
|
|
153
|
+
*
|
|
154
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-invites-details
|
|
155
|
+
*
|
|
156
|
+
* @param params An object containing the token.
|
|
157
|
+
* @returns Promise
|
|
158
|
+
*/
|
|
159
|
+
static getInviteDetails<T>(params: {
|
|
160
|
+
token: string;
|
|
161
|
+
}): AxiosPromise<Response<T>>;
|
|
162
|
+
/**
|
|
163
|
+
* Accept an invitation to become an administrator.
|
|
164
|
+
*
|
|
165
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-invites-accept
|
|
166
|
+
*
|
|
167
|
+
* @param data The data containing the invitation token.
|
|
168
|
+
* @returns Promise
|
|
169
|
+
*/
|
|
170
|
+
static acceptInvite<T>(data: {
|
|
171
|
+
token: string;
|
|
172
|
+
}): AxiosPromise<Response<T>>;
|
|
173
|
+
}
|
|
174
|
+
export default MarketingAgencies;
|
|
@@ -421,5 +421,80 @@ declare class Scheduler {
|
|
|
421
421
|
* @returns A response object with data (funding instruments)
|
|
422
422
|
*/
|
|
423
423
|
static listCampaignFundingInstruments<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
424
|
+
/**
|
|
425
|
+
* List all destinations for a title update.
|
|
426
|
+
*
|
|
427
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/listTitleUpdateDestinations
|
|
428
|
+
*
|
|
429
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
430
|
+
* @param update_id The ID of the title update.
|
|
431
|
+
* @returns promise
|
|
432
|
+
*/
|
|
433
|
+
static listDestinations<T>(scheduler_id: string, update_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
434
|
+
/**
|
|
435
|
+
* Create a new destination for a title update.
|
|
436
|
+
*
|
|
437
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/createTitleUpdateDestination
|
|
438
|
+
*
|
|
439
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
440
|
+
* @param update_id The ID of the title update.
|
|
441
|
+
* @param data The data for the new destination.
|
|
442
|
+
* @returns promise
|
|
443
|
+
*/
|
|
444
|
+
static createDestination<T>(scheduler_id: string, update_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
445
|
+
/**
|
|
446
|
+
* Get a specific title update destination.
|
|
447
|
+
*
|
|
448
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/getTitleUpdateDestination
|
|
449
|
+
*
|
|
450
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
451
|
+
* @param update_id The ID of the title update.
|
|
452
|
+
* @param destination_id The ID of the destination.
|
|
453
|
+
* @returns promise
|
|
454
|
+
*/
|
|
455
|
+
static getDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
456
|
+
/**
|
|
457
|
+
* Update a title update destination.
|
|
458
|
+
*
|
|
459
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdateDestination
|
|
460
|
+
*
|
|
461
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
462
|
+
* @param update_id The ID of the title update.
|
|
463
|
+
* @param destination_id The ID of the destination.
|
|
464
|
+
* @param data The data to update.
|
|
465
|
+
* @returns promise
|
|
466
|
+
*/
|
|
467
|
+
static updateDestination<T>(scheduler_id: string, update_id: string, destination_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
468
|
+
/**
|
|
469
|
+
* Delete a title update destination.
|
|
470
|
+
*
|
|
471
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/deleteTitleUpdateDestination
|
|
472
|
+
*
|
|
473
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
474
|
+
* @param update_id The ID of the title update.
|
|
475
|
+
* @param destination_id The ID of the destination.
|
|
476
|
+
* @returns promise
|
|
477
|
+
*/
|
|
478
|
+
static deleteDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
479
|
+
/**
|
|
480
|
+
* Get AI-powered subreddit recommendations for a scheduler.
|
|
481
|
+
*
|
|
482
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/getSchedulerRedditRecommendations
|
|
483
|
+
*
|
|
484
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
485
|
+
* @param data The context for the post (title, content, media type).
|
|
486
|
+
* @returns promise
|
|
487
|
+
*/
|
|
488
|
+
static getRedditRecommendations<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
489
|
+
/**
|
|
490
|
+
* Generate tailored content for a specific subreddit.
|
|
491
|
+
*
|
|
492
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/generateRedditContentForSubreddit
|
|
493
|
+
*
|
|
494
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
495
|
+
* @param data The target subreddit and post context.
|
|
496
|
+
* @returns promise
|
|
497
|
+
*/
|
|
498
|
+
static generateRedditContent<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
424
499
|
}
|
|
425
500
|
export default Scheduler;
|
package/dist/esm/api/index.d.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
|
export { Ads };
|
|
39
40
|
export { Auth };
|
|
40
41
|
export { Competitions };
|
|
@@ -72,3 +73,4 @@ export { WebsiteAnalytics };
|
|
|
72
73
|
export { Fingerprinting };
|
|
73
74
|
export { ShortLinks };
|
|
74
75
|
export { AIUsage };
|
|
76
|
+
export { MarketingAgencies };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ import { WebsiteAnalytics } from "./api";
|
|
|
35
35
|
import { Fingerprinting } from "./api";
|
|
36
36
|
import { ShortLinks } from "./api";
|
|
37
37
|
import { AIUsage } from "./api";
|
|
38
|
+
import { MarketingAgencies } from "./api";
|
|
38
39
|
import Requests from "./util/Requests";
|
|
39
40
|
import Parser from "./util/Parser";
|
|
40
41
|
import Session from "./util/Session";
|
|
@@ -91,6 +92,7 @@ declare class Glitch {
|
|
|
91
92
|
Fingerprinting: typeof Fingerprinting;
|
|
92
93
|
ShortLinks: typeof ShortLinks;
|
|
93
94
|
AIUsage: typeof AIUsage;
|
|
95
|
+
MarketingAgencies: typeof MarketingAgencies;
|
|
94
96
|
};
|
|
95
97
|
static util: {
|
|
96
98
|
Requests: typeof Requests;
|
package/dist/esm/index.js
CHANGED
|
@@ -13259,6 +13259,13 @@ var SchedulerRoute = /** @class */ (function () {
|
|
|
13259
13259
|
url: '/schedulers/{scheduler_id}/generateContent',
|
|
13260
13260
|
method: HTTP_METHODS.POST
|
|
13261
13261
|
},
|
|
13262
|
+
getRedditRecommendations: { url: '/schedulers/{scheduler_id}/reddit/recommendations', method: HTTP_METHODS.POST },
|
|
13263
|
+
generateRedditContent: { url: '/schedulers/{scheduler_id}/reddit/generateContent', method: HTTP_METHODS.POST },
|
|
13264
|
+
listDestinations: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations', method: HTTP_METHODS.GET },
|
|
13265
|
+
createDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations', method: HTTP_METHODS.POST },
|
|
13266
|
+
getDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.GET },
|
|
13267
|
+
updateDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.PUT },
|
|
13268
|
+
deleteDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.DELETE },
|
|
13262
13269
|
};
|
|
13263
13270
|
return SchedulerRoute;
|
|
13264
13271
|
}());
|
|
@@ -13803,6 +13810,95 @@ var Scheduler = /** @class */ (function () {
|
|
|
13803
13810
|
Scheduler.listCampaignFundingInstruments = function (scheduler_id, params) {
|
|
13804
13811
|
return Requests.processRoute(SchedulerRoute.routes.getCampaignFundingInstruments, undefined, { scheduler_id: scheduler_id }, params);
|
|
13805
13812
|
};
|
|
13813
|
+
/**
|
|
13814
|
+
* List all destinations for a title update.
|
|
13815
|
+
*
|
|
13816
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/listTitleUpdateDestinations
|
|
13817
|
+
*
|
|
13818
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
13819
|
+
* @param update_id The ID of the title update.
|
|
13820
|
+
* @returns promise
|
|
13821
|
+
*/
|
|
13822
|
+
Scheduler.listDestinations = function (scheduler_id, update_id, params) {
|
|
13823
|
+
return Requests.processRoute(SchedulerRoute.routes.listDestinations, {}, { scheduler_id: scheduler_id, update_id: update_id }, params);
|
|
13824
|
+
};
|
|
13825
|
+
/**
|
|
13826
|
+
* Create a new destination for a title update.
|
|
13827
|
+
*
|
|
13828
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/createTitleUpdateDestination
|
|
13829
|
+
*
|
|
13830
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
13831
|
+
* @param update_id The ID of the title update.
|
|
13832
|
+
* @param data The data for the new destination.
|
|
13833
|
+
* @returns promise
|
|
13834
|
+
*/
|
|
13835
|
+
Scheduler.createDestination = function (scheduler_id, update_id, data, params) {
|
|
13836
|
+
return Requests.processRoute(SchedulerRoute.routes.createDestination, data, { scheduler_id: scheduler_id, update_id: update_id }, params);
|
|
13837
|
+
};
|
|
13838
|
+
/**
|
|
13839
|
+
* Get a specific title update destination.
|
|
13840
|
+
*
|
|
13841
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/getTitleUpdateDestination
|
|
13842
|
+
*
|
|
13843
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
13844
|
+
* @param update_id The ID of the title update.
|
|
13845
|
+
* @param destination_id The ID of the destination.
|
|
13846
|
+
* @returns promise
|
|
13847
|
+
*/
|
|
13848
|
+
Scheduler.getDestination = function (scheduler_id, update_id, destination_id, params) {
|
|
13849
|
+
return Requests.processRoute(SchedulerRoute.routes.getDestination, {}, { scheduler_id: scheduler_id, update_id: update_id, destination_id: destination_id }, params);
|
|
13850
|
+
};
|
|
13851
|
+
/**
|
|
13852
|
+
* Update a title update destination.
|
|
13853
|
+
*
|
|
13854
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdateDestination
|
|
13855
|
+
*
|
|
13856
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
13857
|
+
* @param update_id The ID of the title update.
|
|
13858
|
+
* @param destination_id The ID of the destination.
|
|
13859
|
+
* @param data The data to update.
|
|
13860
|
+
* @returns promise
|
|
13861
|
+
*/
|
|
13862
|
+
Scheduler.updateDestination = function (scheduler_id, update_id, destination_id, data, params) {
|
|
13863
|
+
return Requests.processRoute(SchedulerRoute.routes.updateDestination, data, { scheduler_id: scheduler_id, update_id: update_id, destination_id: destination_id }, params);
|
|
13864
|
+
};
|
|
13865
|
+
/**
|
|
13866
|
+
* Delete a title update destination.
|
|
13867
|
+
*
|
|
13868
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/deleteTitleUpdateDestination
|
|
13869
|
+
*
|
|
13870
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
13871
|
+
* @param update_id The ID of the title update.
|
|
13872
|
+
* @param destination_id The ID of the destination.
|
|
13873
|
+
* @returns promise
|
|
13874
|
+
*/
|
|
13875
|
+
Scheduler.deleteDestination = function (scheduler_id, update_id, destination_id, params) {
|
|
13876
|
+
return Requests.processRoute(SchedulerRoute.routes.deleteDestination, {}, { scheduler_id: scheduler_id, update_id: update_id, destination_id: destination_id }, params);
|
|
13877
|
+
};
|
|
13878
|
+
/**
|
|
13879
|
+
* Get AI-powered subreddit recommendations for a scheduler.
|
|
13880
|
+
*
|
|
13881
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/getSchedulerRedditRecommendations
|
|
13882
|
+
*
|
|
13883
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
13884
|
+
* @param data The context for the post (title, content, media type).
|
|
13885
|
+
* @returns promise
|
|
13886
|
+
*/
|
|
13887
|
+
Scheduler.getRedditRecommendations = function (scheduler_id, data, params) {
|
|
13888
|
+
return Requests.processRoute(SchedulerRoute.routes.getRedditRecommendations, data, { scheduler_id: scheduler_id }, params);
|
|
13889
|
+
};
|
|
13890
|
+
/**
|
|
13891
|
+
* Generate tailored content for a specific subreddit.
|
|
13892
|
+
*
|
|
13893
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/generateRedditContentForSubreddit
|
|
13894
|
+
*
|
|
13895
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
13896
|
+
* @param data The target subreddit and post context.
|
|
13897
|
+
* @returns promise
|
|
13898
|
+
*/
|
|
13899
|
+
Scheduler.generateRedditContent = function (scheduler_id, data, params) {
|
|
13900
|
+
return Requests.processRoute(SchedulerRoute.routes.generateRedditContent, data, { scheduler_id: scheduler_id }, params);
|
|
13901
|
+
};
|
|
13806
13902
|
return Scheduler;
|
|
13807
13903
|
}());
|
|
13808
13904
|
|
|
@@ -14404,6 +14500,226 @@ var AIUsage = /** @class */ (function () {
|
|
|
14404
14500
|
return AIUsage;
|
|
14405
14501
|
}());
|
|
14406
14502
|
|
|
14503
|
+
var MarketingAgenciesRoute = /** @class */ (function () {
|
|
14504
|
+
function MarketingAgenciesRoute() {
|
|
14505
|
+
}
|
|
14506
|
+
MarketingAgenciesRoute.routes = {
|
|
14507
|
+
// CRUD for agencies
|
|
14508
|
+
list: { url: '/marketing-agencies', method: HTTP_METHODS.GET },
|
|
14509
|
+
create: { url: '/marketing-agencies', method: HTTP_METHODS.POST },
|
|
14510
|
+
view: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.GET },
|
|
14511
|
+
update: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.PUT },
|
|
14512
|
+
delete: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.DELETE },
|
|
14513
|
+
// Administrator management
|
|
14514
|
+
addAdministrator: { url: '/marketing-agencies/{id}/administrators', method: HTTP_METHODS.POST },
|
|
14515
|
+
removeAdministrator: { url: '/marketing-agencies/{id}/administrators/{user_id}', method: HTTP_METHODS.DELETE },
|
|
14516
|
+
// Logo management
|
|
14517
|
+
setLogo: { url: '/marketing-agencies/{id}/logo', method: HTTP_METHODS.POST },
|
|
14518
|
+
// Case Study management
|
|
14519
|
+
addCaseStudy: { url: '/marketing-agencies/{id}/case-studies', method: HTTP_METHODS.POST },
|
|
14520
|
+
removeCaseStudy: { url: '/marketing-agencies/{id}/case-studies/{media_id}', method: HTTP_METHODS.DELETE },
|
|
14521
|
+
updateCaseStudyOrder: { url: '/marketing-agencies/{id}/case-studies/order', method: HTTP_METHODS.POST },
|
|
14522
|
+
// Invitation management
|
|
14523
|
+
invite: { url: '/marketing-agencies/{id}/invites', method: HTTP_METHODS.POST },
|
|
14524
|
+
listInvites: { url: '/marketing-agencies/{id}/invites', method: HTTP_METHODS.GET },
|
|
14525
|
+
revokeInvite: { url: '/marketing-agencies/{id}/invites/{invite_id}', method: HTTP_METHODS.DELETE },
|
|
14526
|
+
getInviteDetails: { url: '/marketing-agencies/invites/details', method: HTTP_METHODS.GET },
|
|
14527
|
+
acceptInvite: { url: '/marketing-agencies/invites/accept', method: HTTP_METHODS.POST },
|
|
14528
|
+
};
|
|
14529
|
+
return MarketingAgenciesRoute;
|
|
14530
|
+
}());
|
|
14531
|
+
|
|
14532
|
+
var MarketingAgencies = /** @class */ (function () {
|
|
14533
|
+
function MarketingAgencies() {
|
|
14534
|
+
}
|
|
14535
|
+
/**
|
|
14536
|
+
* List all marketing agencies.
|
|
14537
|
+
*
|
|
14538
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies
|
|
14539
|
+
*
|
|
14540
|
+
* @param params Optional query parameters (e.g., is_admin, sort_by, sort_order, page, per_page).
|
|
14541
|
+
* @returns promise
|
|
14542
|
+
*/
|
|
14543
|
+
MarketingAgencies.list = function (params) {
|
|
14544
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.list, undefined, undefined, params);
|
|
14545
|
+
};
|
|
14546
|
+
/**
|
|
14547
|
+
* Create a new marketing agency.
|
|
14548
|
+
*
|
|
14549
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies
|
|
14550
|
+
*
|
|
14551
|
+
* @param data The data for the new agency.
|
|
14552
|
+
* @returns Promise
|
|
14553
|
+
*/
|
|
14554
|
+
MarketingAgencies.create = function (data) {
|
|
14555
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.create, data);
|
|
14556
|
+
};
|
|
14557
|
+
/**
|
|
14558
|
+
* Retrieve a single marketing agency by its ID.
|
|
14559
|
+
*
|
|
14560
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id
|
|
14561
|
+
*
|
|
14562
|
+
* @param id The UUID of the agency to retrieve.
|
|
14563
|
+
* @returns promise
|
|
14564
|
+
*/
|
|
14565
|
+
MarketingAgencies.view = function (id) {
|
|
14566
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.view, {}, { id: id });
|
|
14567
|
+
};
|
|
14568
|
+
/**
|
|
14569
|
+
* Update a marketing agency.
|
|
14570
|
+
*
|
|
14571
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/putMarketing-agencies-id
|
|
14572
|
+
*
|
|
14573
|
+
* @param id The UUID of the agency to update.
|
|
14574
|
+
* @param data The data to update.
|
|
14575
|
+
* @returns promise
|
|
14576
|
+
*/
|
|
14577
|
+
MarketingAgencies.update = function (id, data) {
|
|
14578
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.update, data, { id: id });
|
|
14579
|
+
};
|
|
14580
|
+
/**
|
|
14581
|
+
* Deletes a marketing agency.
|
|
14582
|
+
*
|
|
14583
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id
|
|
14584
|
+
*
|
|
14585
|
+
* @param id The UUID of the agency to delete.
|
|
14586
|
+
* @returns promise
|
|
14587
|
+
*/
|
|
14588
|
+
MarketingAgencies.delete = function (id) {
|
|
14589
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.delete, {}, { id: id });
|
|
14590
|
+
};
|
|
14591
|
+
/**
|
|
14592
|
+
* Add a user as an administrator to an agency.
|
|
14593
|
+
*
|
|
14594
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-administrators
|
|
14595
|
+
*
|
|
14596
|
+
* @param id The UUID of the agency.
|
|
14597
|
+
* @param data The data containing the user_id to add.
|
|
14598
|
+
* @returns Promise
|
|
14599
|
+
*/
|
|
14600
|
+
MarketingAgencies.addAdministrator = function (id, data) {
|
|
14601
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.addAdministrator, data, { id: id });
|
|
14602
|
+
};
|
|
14603
|
+
/**
|
|
14604
|
+
* Remove a user as an administrator from an agency.
|
|
14605
|
+
*
|
|
14606
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-administrators-user_id
|
|
14607
|
+
*
|
|
14608
|
+
* @param id The UUID of the agency.
|
|
14609
|
+
* @param user_id The UUID of the user to remove.
|
|
14610
|
+
* @returns Promise
|
|
14611
|
+
*/
|
|
14612
|
+
MarketingAgencies.removeAdministrator = function (id, user_id) {
|
|
14613
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.removeAdministrator, {}, { id: id, user_id: user_id });
|
|
14614
|
+
};
|
|
14615
|
+
/**
|
|
14616
|
+
* Set the logo for an agency.
|
|
14617
|
+
*
|
|
14618
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-logo
|
|
14619
|
+
*
|
|
14620
|
+
* @param id The UUID of the agency.
|
|
14621
|
+
* @param data The data containing the media_id for the logo.
|
|
14622
|
+
* @returns Promise
|
|
14623
|
+
*/
|
|
14624
|
+
MarketingAgencies.setLogo = function (id, data) {
|
|
14625
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.setLogo, data, { id: id });
|
|
14626
|
+
};
|
|
14627
|
+
/**
|
|
14628
|
+
* Add a case study to an agency.
|
|
14629
|
+
*
|
|
14630
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies
|
|
14631
|
+
*
|
|
14632
|
+
* @param id The UUID of the agency.
|
|
14633
|
+
* @param data The data containing the media_id and optional order.
|
|
14634
|
+
* @returns Promise
|
|
14635
|
+
*/
|
|
14636
|
+
MarketingAgencies.addCaseStudy = function (id, data) {
|
|
14637
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.addCaseStudy, data, { id: id });
|
|
14638
|
+
};
|
|
14639
|
+
/**
|
|
14640
|
+
* Remove a case study from an agency.
|
|
14641
|
+
*
|
|
14642
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-case-studies-media_id
|
|
14643
|
+
*
|
|
14644
|
+
* @param id The UUID of the agency.
|
|
14645
|
+
* @param media_id The UUID of the media to remove.
|
|
14646
|
+
* @returns Promise
|
|
14647
|
+
*/
|
|
14648
|
+
MarketingAgencies.removeCaseStudy = function (id, media_id) {
|
|
14649
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.removeCaseStudy, {}, { id: id, media_id: media_id });
|
|
14650
|
+
};
|
|
14651
|
+
/**
|
|
14652
|
+
* Update the order of case studies for an agency.
|
|
14653
|
+
*
|
|
14654
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies-order
|
|
14655
|
+
*
|
|
14656
|
+
* @param id The UUID of the agency.
|
|
14657
|
+
* @param order_data An array of objects with media_id and new order.
|
|
14658
|
+
* @returns Promise
|
|
14659
|
+
*/
|
|
14660
|
+
MarketingAgencies.updateCaseStudyOrder = function (id, order_data) {
|
|
14661
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.updateCaseStudyOrder, { order_data: order_data }, { id: id });
|
|
14662
|
+
};
|
|
14663
|
+
/**
|
|
14664
|
+
* Invite a user to become an administrator of an agency.
|
|
14665
|
+
*
|
|
14666
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-invites
|
|
14667
|
+
*
|
|
14668
|
+
* @param id The UUID of the agency.
|
|
14669
|
+
* @param data The data containing the email of the user to invite.
|
|
14670
|
+
* @returns Promise
|
|
14671
|
+
*/
|
|
14672
|
+
MarketingAgencies.invite = function (id, data) {
|
|
14673
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.invite, data, { id: id });
|
|
14674
|
+
};
|
|
14675
|
+
/**
|
|
14676
|
+
* List all pending invitations for an agency.
|
|
14677
|
+
*
|
|
14678
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id-invites
|
|
14679
|
+
*
|
|
14680
|
+
* @param id The UUID of the agency.
|
|
14681
|
+
* @returns Promise
|
|
14682
|
+
*/
|
|
14683
|
+
MarketingAgencies.listInvites = function (id) {
|
|
14684
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.listInvites, {}, { id: id });
|
|
14685
|
+
};
|
|
14686
|
+
/**
|
|
14687
|
+
* Revoke a pending invitation.
|
|
14688
|
+
*
|
|
14689
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-invites-invite_id
|
|
14690
|
+
*
|
|
14691
|
+
* @param id The UUID of the agency.
|
|
14692
|
+
* @param invite_id The UUID of the invitation to revoke.
|
|
14693
|
+
* @returns Promise
|
|
14694
|
+
*/
|
|
14695
|
+
MarketingAgencies.revokeInvite = function (id, invite_id) {
|
|
14696
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.revokeInvite, {}, { id: id, invite_id: invite_id });
|
|
14697
|
+
};
|
|
14698
|
+
/**
|
|
14699
|
+
* Get the details of a pending invitation using its token.
|
|
14700
|
+
*
|
|
14701
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-invites-details
|
|
14702
|
+
*
|
|
14703
|
+
* @param params An object containing the token.
|
|
14704
|
+
* @returns Promise
|
|
14705
|
+
*/
|
|
14706
|
+
MarketingAgencies.getInviteDetails = function (params) {
|
|
14707
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.getInviteDetails, undefined, undefined, params);
|
|
14708
|
+
};
|
|
14709
|
+
/**
|
|
14710
|
+
* Accept an invitation to become an administrator.
|
|
14711
|
+
*
|
|
14712
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-invites-accept
|
|
14713
|
+
*
|
|
14714
|
+
* @param data The data containing the invitation token.
|
|
14715
|
+
* @returns Promise
|
|
14716
|
+
*/
|
|
14717
|
+
MarketingAgencies.acceptInvite = function (data) {
|
|
14718
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.acceptInvite, data);
|
|
14719
|
+
};
|
|
14720
|
+
return MarketingAgencies;
|
|
14721
|
+
}());
|
|
14722
|
+
|
|
14407
14723
|
var Parser = /** @class */ (function () {
|
|
14408
14724
|
function Parser() {
|
|
14409
14725
|
}
|
|
@@ -14928,7 +15244,8 @@ var Glitch = /** @class */ (function () {
|
|
|
14928
15244
|
WebsiteAnalytics: WebsiteAnalytics,
|
|
14929
15245
|
Fingerprinting: Fingerprinting,
|
|
14930
15246
|
ShortLinks: ShortLinks,
|
|
14931
|
-
AIUsage: AIUsage
|
|
15247
|
+
AIUsage: AIUsage,
|
|
15248
|
+
MarketingAgencies: MarketingAgencies
|
|
14932
15249
|
};
|
|
14933
15250
|
Glitch.util = {
|
|
14934
15251
|
Requests: Requests,
|