glitch-javascript-sdk 1.4.2 → 1.4.4
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 +35 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Scheduler.d.ts +16 -0
- package/dist/esm/api/SocialPosts.d.ts +8 -0
- package/dist/esm/index.js +35 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +24 -0
- package/package.json +1 -1
- package/src/api/Scheduler.ts +22 -0
- package/src/api/SocialPosts.ts +11 -0
- package/src/routes/SchedulerRoute.ts +2 -0
- package/src/routes/SocialPostsRoute.ts +2 -0
- package/src/util/Requests.ts +2 -2
|
@@ -260,5 +260,21 @@ declare class Scheduler {
|
|
|
260
260
|
* @returns promise
|
|
261
261
|
*/
|
|
262
262
|
static getDiscordChannels<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
263
|
+
/**
|
|
264
|
+
* Get aggregated reports for a promotion schedule.
|
|
265
|
+
*
|
|
266
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
267
|
+
* @param params Query parameters (e.g., social_platform, start_date, end_date)
|
|
268
|
+
* @returns promise
|
|
269
|
+
*/
|
|
270
|
+
static getSchedulerReports<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
271
|
+
/**
|
|
272
|
+
* Get progression data for social media posts over time.
|
|
273
|
+
*
|
|
274
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
275
|
+
* @param params Query parameters (e.g., social_platform, start_date, end_date)
|
|
276
|
+
* @returns promise
|
|
277
|
+
*/
|
|
278
|
+
static getSchedulerProgression<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
263
279
|
}
|
|
264
280
|
export default Scheduler;
|
|
@@ -90,5 +90,13 @@ declare class SocialPosts {
|
|
|
90
90
|
* @returns promise
|
|
91
91
|
*/
|
|
92
92
|
static reschedule<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
93
|
+
/**
|
|
94
|
+
* Get the reports for a social media post
|
|
95
|
+
*
|
|
96
|
+
* @see https://api.glitch.fun/api/documentation#/Post%20Route/resourcePostList
|
|
97
|
+
*
|
|
98
|
+
* @returns promise
|
|
99
|
+
*/
|
|
100
|
+
static reports<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
93
101
|
}
|
|
94
102
|
export default SocialPosts;
|
package/dist/esm/index.js
CHANGED
|
@@ -5478,7 +5478,7 @@ var Requests = /** @class */ (function () {
|
|
|
5478
5478
|
}
|
|
5479
5479
|
// Format URL
|
|
5480
5480
|
url = url.replace(/\/\//g, '/');
|
|
5481
|
-
var uri = "".concat(
|
|
5481
|
+
var uri = "".concat(url).replace(/\/\//g, '/');
|
|
5482
5482
|
// Make the request
|
|
5483
5483
|
return axios$1({
|
|
5484
5484
|
method: 'POST',
|
|
@@ -5523,7 +5523,7 @@ var Requests = /** @class */ (function () {
|
|
|
5523
5523
|
formData.append(key, data[key]);
|
|
5524
5524
|
}
|
|
5525
5525
|
}
|
|
5526
|
-
fullUploadUrl = "".concat(
|
|
5526
|
+
fullUploadUrl = "".concat(uploadUrl);
|
|
5527
5527
|
headers = {};
|
|
5528
5528
|
if (Requests.authToken) {
|
|
5529
5529
|
headers['Authorization'] = "Bearer ".concat(Requests.authToken);
|
|
@@ -9332,6 +9332,7 @@ var SocialPostsRoute = /** @class */ (function () {
|
|
|
9332
9332
|
addMedia: { url: '/socialposts/{post_id}/addMedia', method: HTTP_METHODS.POST },
|
|
9333
9333
|
removeMedia: { url: '/socialposts/{post_id}/removeMedia/{media_id}', method: HTTP_METHODS.DELETE },
|
|
9334
9334
|
reschedule: { url: '/socialposts/{post_id}/reschedule', method: HTTP_METHODS.POST },
|
|
9335
|
+
reports: { url: '/socialposts/{post_id}/reports', method: HTTP_METHODS.GET },
|
|
9335
9336
|
};
|
|
9336
9337
|
return SocialPostsRoute;
|
|
9337
9338
|
}());
|
|
@@ -9446,6 +9447,16 @@ var SocialPosts = /** @class */ (function () {
|
|
|
9446
9447
|
SocialPosts.reschedule = function (post_id, data, params) {
|
|
9447
9448
|
return Requests.processRoute(SocialPostsRoute.routes.reschedule, data, { post_id: post_id }, params);
|
|
9448
9449
|
};
|
|
9450
|
+
/**
|
|
9451
|
+
* Get the reports for a social media post
|
|
9452
|
+
*
|
|
9453
|
+
* @see https://api.glitch.fun/api/documentation#/Post%20Route/resourcePostList
|
|
9454
|
+
*
|
|
9455
|
+
* @returns promise
|
|
9456
|
+
*/
|
|
9457
|
+
SocialPosts.reports = function (params) {
|
|
9458
|
+
return Requests.processRoute(SocialPostsRoute.routes.reports, undefined, undefined, params);
|
|
9459
|
+
};
|
|
9449
9460
|
return SocialPosts;
|
|
9450
9461
|
}());
|
|
9451
9462
|
|
|
@@ -11296,6 +11307,8 @@ var SchedulerRoute = /** @class */ (function () {
|
|
|
11296
11307
|
updateUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.PUT },
|
|
11297
11308
|
deleteUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.DELETE },
|
|
11298
11309
|
testTone: { url: '/schedulers/{scheduler_id}/tone', method: HTTP_METHODS.POST },
|
|
11310
|
+
getSchedulerReports: { url: '/schedulers/{scheduler_id}/reports', method: HTTP_METHODS.GET },
|
|
11311
|
+
getSchedulerProgression: { url: '/schedulers/{scheduler_id}/progression', method: HTTP_METHODS.GET },
|
|
11299
11312
|
// Clear OAuth Routes
|
|
11300
11313
|
clearTwitterAuth: { url: '/schedulers/{scheduler_id}/clearTwitterAuth', method: HTTP_METHODS.DELETE },
|
|
11301
11314
|
clearFacebookAuth: { url: '/schedulers/{scheduler_id}/clearFacebookAuth', method: HTTP_METHODS.DELETE },
|
|
@@ -11645,6 +11658,26 @@ var Scheduler = /** @class */ (function () {
|
|
|
11645
11658
|
Scheduler.getDiscordChannels = function (scheduler_id, params) {
|
|
11646
11659
|
return Requests.processRoute(SchedulerRoute.routes.getDiscordChannels, {}, { scheduler_id: scheduler_id }, params);
|
|
11647
11660
|
};
|
|
11661
|
+
/**
|
|
11662
|
+
* Get aggregated reports for a promotion schedule.
|
|
11663
|
+
*
|
|
11664
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
11665
|
+
* @param params Query parameters (e.g., social_platform, start_date, end_date)
|
|
11666
|
+
* @returns promise
|
|
11667
|
+
*/
|
|
11668
|
+
Scheduler.getSchedulerReports = function (scheduler_id, params) {
|
|
11669
|
+
return Requests.processRoute(SchedulerRoute.routes.getSchedulerReports, {}, { scheduler_id: scheduler_id }, params);
|
|
11670
|
+
};
|
|
11671
|
+
/**
|
|
11672
|
+
* Get progression data for social media posts over time.
|
|
11673
|
+
*
|
|
11674
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
11675
|
+
* @param params Query parameters (e.g., social_platform, start_date, end_date)
|
|
11676
|
+
* @returns promise
|
|
11677
|
+
*/
|
|
11678
|
+
Scheduler.getSchedulerProgression = function (scheduler_id, params) {
|
|
11679
|
+
return Requests.processRoute(SchedulerRoute.routes.getSchedulerProgression, {}, { scheduler_id: scheduler_id }, params);
|
|
11680
|
+
};
|
|
11648
11681
|
return Scheduler;
|
|
11649
11682
|
}());
|
|
11650
11683
|
|