glitch-javascript-sdk 2.0.1 → 2.0.3
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 +131 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Scheduler.d.ts +75 -0
- package/dist/esm/api/Users.d.ts +25 -0
- package/dist/esm/index.js +131 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +100 -0
- package/package.json +1 -1
- package/src/api/Scheduler.ts +96 -0
- package/src/api/Users.ts +34 -0
- package/src/routes/SchedulerRoute.ts +7 -0
- package/src/routes/UserRoutes.ts +6 -1
package/dist/cjs/index.js
CHANGED
|
@@ -21777,13 +21777,16 @@ var UserRoutes = /** @class */ (function () {
|
|
|
21777
21777
|
addType: { url: '/users/addType', method: HTTP_METHODS.POST },
|
|
21778
21778
|
removeType: { url: '/users/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
21779
21779
|
getCampaignInvites: { url: '/users/getCampaignInvites', method: HTTP_METHODS.GET },
|
|
21780
|
-
getPayouts: { url: '/users/
|
|
21780
|
+
getPayouts: { url: '/users/getCampaignPayouts', method: HTTP_METHODS.GET },
|
|
21781
21781
|
verifyAccount: { url: '/users/verify', method: HTTP_METHODS.POST },
|
|
21782
21782
|
getInstagramAccounts: { url: '/users/instagramAccounts', method: HTTP_METHODS.GET },
|
|
21783
21783
|
getFacebookPages: { url: "/users/facebookPages", method: HTTP_METHODS.GET },
|
|
21784
21784
|
getSubreddits: { url: "/users/reddit/subreddits", method: HTTP_METHODS.GET },
|
|
21785
21785
|
getSubredditFlairs: { url: "/users/reddit/redditflairs/{subreddit}", method: HTTP_METHODS.GET },
|
|
21786
21786
|
search: { url: '/users/search', method: HTTP_METHODS.GET },
|
|
21787
|
+
resendVerificationEmail: { url: '/users/resendVerificationEmail', method: HTTP_METHODS.POST },
|
|
21788
|
+
clearInstagramAuth: { url: '/users/clearInstagramAuth', method: HTTP_METHODS.DELETE },
|
|
21789
|
+
getSubredditRules: { url: "/users/reddit/redditrules/{subreddit}", method: HTTP_METHODS.GET },
|
|
21787
21790
|
};
|
|
21788
21791
|
return UserRoutes;
|
|
21789
21792
|
}());
|
|
@@ -22236,6 +22239,37 @@ var Users = /** @class */ (function () {
|
|
|
22236
22239
|
Users.search = function (params) {
|
|
22237
22240
|
return Requests.processRoute(UserRoutes.routes.search, undefined, undefined, params);
|
|
22238
22241
|
};
|
|
22242
|
+
/**
|
|
22243
|
+
* Resends the verification email to the authenticated user.
|
|
22244
|
+
*
|
|
22245
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/resendVerificationEmail
|
|
22246
|
+
*
|
|
22247
|
+
* @returns Promise
|
|
22248
|
+
*/
|
|
22249
|
+
Users.resendVerificationEmail = function () {
|
|
22250
|
+
return Requests.processRoute(UserRoutes.routes.resendVerificationEmail, {});
|
|
22251
|
+
};
|
|
22252
|
+
/**
|
|
22253
|
+
* Clear Instagram authentication information from the current user.
|
|
22254
|
+
*
|
|
22255
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/clearInstagramAuth
|
|
22256
|
+
*
|
|
22257
|
+
* @returns promise
|
|
22258
|
+
*/
|
|
22259
|
+
Users.clearInstagramAuth = function () {
|
|
22260
|
+
return Requests.processRoute(UserRoutes.routes.clearInstagramAuth, {});
|
|
22261
|
+
};
|
|
22262
|
+
/**
|
|
22263
|
+
* Gets the rules for a specific subreddit.
|
|
22264
|
+
*
|
|
22265
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubredditRules
|
|
22266
|
+
*
|
|
22267
|
+
* @param subreddit The name of the subreddit to get rules for.
|
|
22268
|
+
* @returns Promise resolving to the list of rules
|
|
22269
|
+
*/
|
|
22270
|
+
Users.getSubredditRules = function (subreddit, params) {
|
|
22271
|
+
return Requests.processRoute(UserRoutes.routes.getSubredditRules, undefined, { subreddit: subreddit }, params);
|
|
22272
|
+
};
|
|
22239
22273
|
return Users;
|
|
22240
22274
|
}());
|
|
22241
22275
|
|
|
@@ -26443,6 +26477,13 @@ var SchedulerRoute = /** @class */ (function () {
|
|
|
26443
26477
|
url: '/schedulers/{scheduler_id}/generateContent',
|
|
26444
26478
|
method: HTTP_METHODS.POST
|
|
26445
26479
|
},
|
|
26480
|
+
getRedditRecommendations: { url: '/schedulers/{scheduler_id}/reddit/recommendations', method: HTTP_METHODS.POST },
|
|
26481
|
+
generateRedditContent: { url: '/schedulers/{scheduler_id}/reddit/generateContent', method: HTTP_METHODS.POST },
|
|
26482
|
+
listDestinations: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations', method: HTTP_METHODS.GET },
|
|
26483
|
+
createDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations', method: HTTP_METHODS.POST },
|
|
26484
|
+
getDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.GET },
|
|
26485
|
+
updateDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.PUT },
|
|
26486
|
+
deleteDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.DELETE },
|
|
26446
26487
|
};
|
|
26447
26488
|
return SchedulerRoute;
|
|
26448
26489
|
}());
|
|
@@ -26987,6 +27028,95 @@ var Scheduler = /** @class */ (function () {
|
|
|
26987
27028
|
Scheduler.listCampaignFundingInstruments = function (scheduler_id, params) {
|
|
26988
27029
|
return Requests.processRoute(SchedulerRoute.routes.getCampaignFundingInstruments, undefined, { scheduler_id: scheduler_id }, params);
|
|
26989
27030
|
};
|
|
27031
|
+
/**
|
|
27032
|
+
* List all destinations for a title update.
|
|
27033
|
+
*
|
|
27034
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/listTitleUpdateDestinations
|
|
27035
|
+
*
|
|
27036
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
27037
|
+
* @param update_id The ID of the title update.
|
|
27038
|
+
* @returns promise
|
|
27039
|
+
*/
|
|
27040
|
+
Scheduler.listDestinations = function (scheduler_id, update_id, params) {
|
|
27041
|
+
return Requests.processRoute(SchedulerRoute.routes.listDestinations, {}, { scheduler_id: scheduler_id, update_id: update_id }, params);
|
|
27042
|
+
};
|
|
27043
|
+
/**
|
|
27044
|
+
* Create a new destination for a title update.
|
|
27045
|
+
*
|
|
27046
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/createTitleUpdateDestination
|
|
27047
|
+
*
|
|
27048
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
27049
|
+
* @param update_id The ID of the title update.
|
|
27050
|
+
* @param data The data for the new destination.
|
|
27051
|
+
* @returns promise
|
|
27052
|
+
*/
|
|
27053
|
+
Scheduler.createDestination = function (scheduler_id, update_id, data, params) {
|
|
27054
|
+
return Requests.processRoute(SchedulerRoute.routes.createDestination, data, { scheduler_id: scheduler_id, update_id: update_id }, params);
|
|
27055
|
+
};
|
|
27056
|
+
/**
|
|
27057
|
+
* Get a specific title update destination.
|
|
27058
|
+
*
|
|
27059
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/getTitleUpdateDestination
|
|
27060
|
+
*
|
|
27061
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
27062
|
+
* @param update_id The ID of the title update.
|
|
27063
|
+
* @param destination_id The ID of the destination.
|
|
27064
|
+
* @returns promise
|
|
27065
|
+
*/
|
|
27066
|
+
Scheduler.getDestination = function (scheduler_id, update_id, destination_id, params) {
|
|
27067
|
+
return Requests.processRoute(SchedulerRoute.routes.getDestination, {}, { scheduler_id: scheduler_id, update_id: update_id, destination_id: destination_id }, params);
|
|
27068
|
+
};
|
|
27069
|
+
/**
|
|
27070
|
+
* Update a title update destination.
|
|
27071
|
+
*
|
|
27072
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdateDestination
|
|
27073
|
+
*
|
|
27074
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
27075
|
+
* @param update_id The ID of the title update.
|
|
27076
|
+
* @param destination_id The ID of the destination.
|
|
27077
|
+
* @param data The data to update.
|
|
27078
|
+
* @returns promise
|
|
27079
|
+
*/
|
|
27080
|
+
Scheduler.updateDestination = function (scheduler_id, update_id, destination_id, data, params) {
|
|
27081
|
+
return Requests.processRoute(SchedulerRoute.routes.updateDestination, data, { scheduler_id: scheduler_id, update_id: update_id, destination_id: destination_id }, params);
|
|
27082
|
+
};
|
|
27083
|
+
/**
|
|
27084
|
+
* Delete a title update destination.
|
|
27085
|
+
*
|
|
27086
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/deleteTitleUpdateDestination
|
|
27087
|
+
*
|
|
27088
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
27089
|
+
* @param update_id The ID of the title update.
|
|
27090
|
+
* @param destination_id The ID of the destination.
|
|
27091
|
+
* @returns promise
|
|
27092
|
+
*/
|
|
27093
|
+
Scheduler.deleteDestination = function (scheduler_id, update_id, destination_id, params) {
|
|
27094
|
+
return Requests.processRoute(SchedulerRoute.routes.deleteDestination, {}, { scheduler_id: scheduler_id, update_id: update_id, destination_id: destination_id }, params);
|
|
27095
|
+
};
|
|
27096
|
+
/**
|
|
27097
|
+
* Get AI-powered subreddit recommendations for a scheduler.
|
|
27098
|
+
*
|
|
27099
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/getSchedulerRedditRecommendations
|
|
27100
|
+
*
|
|
27101
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
27102
|
+
* @param data The context for the post (title, content, media type).
|
|
27103
|
+
* @returns promise
|
|
27104
|
+
*/
|
|
27105
|
+
Scheduler.getRedditRecommendations = function (scheduler_id, data, params) {
|
|
27106
|
+
return Requests.processRoute(SchedulerRoute.routes.getRedditRecommendations, data, { scheduler_id: scheduler_id }, params);
|
|
27107
|
+
};
|
|
27108
|
+
/**
|
|
27109
|
+
* Generate tailored content for a specific subreddit.
|
|
27110
|
+
*
|
|
27111
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/generateRedditContentForSubreddit
|
|
27112
|
+
*
|
|
27113
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
27114
|
+
* @param data The target subreddit and post context.
|
|
27115
|
+
* @returns promise
|
|
27116
|
+
*/
|
|
27117
|
+
Scheduler.generateRedditContent = function (scheduler_id, data, params) {
|
|
27118
|
+
return Requests.processRoute(SchedulerRoute.routes.generateRedditContent, data, { scheduler_id: scheduler_id }, params);
|
|
27119
|
+
};
|
|
26990
27120
|
return Scheduler;
|
|
26991
27121
|
}());
|
|
26992
27122
|
|