glitch-javascript-sdk 1.7.2 → 1.7.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 +56 -83
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Scheduler.d.ts +28 -47
- package/dist/esm/index.js +56 -83
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +28 -47
- package/package.json +1 -1
- package/src/api/Scheduler.ts +39 -108
- package/src/routes/SchedulerRoute.ts +18 -34
|
@@ -289,75 +289,56 @@ declare class Scheduler {
|
|
|
289
289
|
*/
|
|
290
290
|
static getSchedulerProgression<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
291
291
|
/**
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
295
|
-
* @param params Optional query params
|
|
296
|
-
*/
|
|
297
|
-
static crossPromoteListRelationships<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
298
|
-
/**
|
|
299
|
-
* Find potential cross-promote partners for a scheduler.
|
|
300
|
-
*
|
|
301
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
302
|
-
* @param params Optional query params
|
|
292
|
+
* Search for cross-promote partners.
|
|
293
|
+
* Uses query parameter `my_scheduler_id`
|
|
303
294
|
*/
|
|
304
|
-
static
|
|
295
|
+
static crossPromoteSearch<T>(my_scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
305
296
|
/**
|
|
306
|
-
* List cross-promote
|
|
307
|
-
*
|
|
308
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
309
|
-
* @param params Optional query params
|
|
297
|
+
* List cross-promote invitations for a scheduler.
|
|
298
|
+
* Expects a query param `scheduler_id`
|
|
310
299
|
*/
|
|
311
300
|
static crossPromoteInvitesList<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
312
301
|
/**
|
|
313
302
|
* Send an invite to cross-promote.
|
|
314
|
-
*
|
|
315
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
316
|
-
* @param data { partner_scheduler_id, optional_message }
|
|
303
|
+
* Converts `partner_scheduler_id` and `optional_message` into the PHP expected fields.
|
|
317
304
|
*/
|
|
318
|
-
static crossPromoteInviteSend<T>(scheduler_id: string, data:
|
|
305
|
+
static crossPromoteInviteSend<T>(scheduler_id: string, data: {
|
|
306
|
+
partner_scheduler_id: string;
|
|
307
|
+
optional_message?: string;
|
|
308
|
+
}, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
319
309
|
/**
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
323
|
-
* @param invite_id The ID of the invite
|
|
310
|
+
* Respond to an invitation (accept or deny).
|
|
324
311
|
*/
|
|
325
|
-
static
|
|
312
|
+
static crossPromoteInviteRespond<T>(invitation_id: string, data: {
|
|
313
|
+
status: 'accepted' | 'denied';
|
|
314
|
+
platforms?: string[];
|
|
315
|
+
}, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
326
316
|
/**
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
330
|
-
* @param invite_id The ID of the invite
|
|
317
|
+
* List cross-promote relationships for a scheduler.
|
|
318
|
+
* Expects a query param `scheduler_id`
|
|
331
319
|
*/
|
|
332
|
-
static
|
|
320
|
+
static crossPromoteListRelationships<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
333
321
|
/**
|
|
334
322
|
* End a cross-promote relationship.
|
|
335
|
-
*
|
|
336
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
337
|
-
* @param relationship_id The ID of the relationship
|
|
338
323
|
*/
|
|
339
|
-
static
|
|
324
|
+
static crossPromoteEndRelationship<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
325
|
+
/**
|
|
326
|
+
* List logs for a cross-promote relationship.
|
|
327
|
+
*/
|
|
328
|
+
static crossPromoteListLogs<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
340
329
|
/**
|
|
341
330
|
* Get which platforms are cross-promoted in an existing relationship.
|
|
342
|
-
*
|
|
343
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
344
|
-
* @param relationship_id The ID of the relationship
|
|
345
331
|
*/
|
|
346
|
-
static crossPromoteRelationshipGetPlatforms<T>(
|
|
332
|
+
static crossPromoteRelationshipGetPlatforms<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
347
333
|
/**
|
|
348
334
|
* Set which platforms are cross-promoted in an existing relationship.
|
|
349
|
-
*
|
|
350
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
351
|
-
* @param relationship_id The ID of the relationship
|
|
352
|
-
* @param data An object like { platforms: ['twitter', 'facebook', ...] }
|
|
353
335
|
*/
|
|
354
|
-
static crossPromoteRelationshipSetPlatforms<T>(
|
|
336
|
+
static crossPromoteRelationshipSetPlatforms<T>(relationship_id: string, data: {
|
|
337
|
+
platforms: string[];
|
|
338
|
+
}, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
355
339
|
/**
|
|
356
340
|
* Get recently cross-promoted posts under a relationship.
|
|
357
|
-
*
|
|
358
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
359
|
-
* @param relationship_id The ID of the relationship
|
|
360
341
|
*/
|
|
361
|
-
static crossPromoteRelationshipPosts<T>(
|
|
342
|
+
static crossPromoteRelationshipPosts<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
362
343
|
}
|
|
363
344
|
export default Scheduler;
|
package/dist/esm/index.js
CHANGED
|
@@ -11635,52 +11635,44 @@ var SchedulerRoute = /** @class */ (function () {
|
|
|
11635
11635
|
getRedditSubreddits: { url: '/schedulers/{scheduler_id}/reddit/subreddits', method: HTTP_METHODS.GET },
|
|
11636
11636
|
getRedditSubredditFlairs: { url: '/schedulers/{scheduler_id}/reddit/subreddits/{subreddit}/flairs', method: HTTP_METHODS.GET },
|
|
11637
11637
|
getDiscordChannels: { url: '/schedulers/{scheduler_id}/discord/channels', method: HTTP_METHODS.GET },
|
|
11638
|
-
|
|
11639
|
-
url: '/schedulers/
|
|
11640
|
-
method: HTTP_METHODS.GET
|
|
11641
|
-
},
|
|
11642
|
-
// 2) Find potential cross-promote partners
|
|
11643
|
-
crossPromoteFind: {
|
|
11644
|
-
url: '/schedulers/{scheduler_id}/crosspromote/find',
|
|
11638
|
+
crossPromoteSearch: {
|
|
11639
|
+
url: '/schedulers/cross-promote/search',
|
|
11645
11640
|
method: HTTP_METHODS.GET
|
|
11646
11641
|
},
|
|
11647
|
-
// 3) List invites
|
|
11648
11642
|
crossPromoteInvitesList: {
|
|
11649
|
-
url: '/schedulers/
|
|
11643
|
+
url: '/schedulers/cross-promote/invitations',
|
|
11650
11644
|
method: HTTP_METHODS.GET
|
|
11651
11645
|
},
|
|
11652
|
-
// 4) Send an invite to cross-promote
|
|
11653
11646
|
crossPromoteInviteSend: {
|
|
11654
|
-
url: '/schedulers/
|
|
11647
|
+
url: '/schedulers/cross-promote/invitations',
|
|
11655
11648
|
method: HTTP_METHODS.POST
|
|
11656
11649
|
},
|
|
11657
|
-
|
|
11658
|
-
|
|
11659
|
-
url: '/schedulers/{scheduler_id}/crosspromote/invites/{invite_id}/accept',
|
|
11650
|
+
crossPromoteInviteRespond: {
|
|
11651
|
+
url: '/schedulers/cross-promote/invitations/{invitation_id}/respond',
|
|
11660
11652
|
method: HTTP_METHODS.POST
|
|
11661
11653
|
},
|
|
11662
|
-
|
|
11663
|
-
|
|
11664
|
-
|
|
11654
|
+
crossPromoteListRelationships: {
|
|
11655
|
+
url: '/schedulers/cross-promote/relationships',
|
|
11656
|
+
method: HTTP_METHODS.GET
|
|
11657
|
+
},
|
|
11658
|
+
crossPromoteEndRelationship: {
|
|
11659
|
+
url: '/schedulers/cross-promote/relationships/{relationship_id}/end',
|
|
11665
11660
|
method: HTTP_METHODS.POST
|
|
11666
11661
|
},
|
|
11667
|
-
|
|
11668
|
-
|
|
11669
|
-
|
|
11670
|
-
method: HTTP_METHODS.DELETE
|
|
11662
|
+
crossPromoteListLogs: {
|
|
11663
|
+
url: '/schedulers/cross-promote/relationships/{relationship_id}/logs',
|
|
11664
|
+
method: HTTP_METHODS.GET
|
|
11671
11665
|
},
|
|
11672
|
-
// 8) Get/Set which platforms are cross-promoted in an existing relationship
|
|
11673
11666
|
crossPromoteRelationshipGetPlatforms: {
|
|
11674
|
-
url: '/schedulers/
|
|
11667
|
+
url: '/schedulers/cross-promote/relationships/{relationship_id}/platforms',
|
|
11675
11668
|
method: HTTP_METHODS.GET
|
|
11676
11669
|
},
|
|
11677
11670
|
crossPromoteRelationshipSetPlatforms: {
|
|
11678
|
-
url: '/schedulers/
|
|
11671
|
+
url: '/schedulers/cross-promote/relationships/{relationship_id}/platforms',
|
|
11679
11672
|
method: HTTP_METHODS.PUT
|
|
11680
11673
|
},
|
|
11681
|
-
// 9) Get recently cross-promoted posts under a relationship
|
|
11682
11674
|
crossPromoteRelationshipPosts: {
|
|
11683
|
-
url: '/schedulers/
|
|
11675
|
+
url: '/schedulers/cross-promote/relationships/{relationship_id}/posts',
|
|
11684
11676
|
method: HTTP_METHODS.GET
|
|
11685
11677
|
},
|
|
11686
11678
|
};
|
|
@@ -12046,95 +12038,76 @@ var Scheduler = /** @class */ (function () {
|
|
|
12046
12038
|
return Requests.processRoute(SchedulerRoute.routes.getSchedulerProgression, {}, { scheduler_id: scheduler_id }, params);
|
|
12047
12039
|
};
|
|
12048
12040
|
/**
|
|
12049
|
-
*
|
|
12050
|
-
*
|
|
12051
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
12052
|
-
* @param params Optional query params
|
|
12053
|
-
*/
|
|
12054
|
-
Scheduler.crossPromoteListRelationships = function (scheduler_id, params) {
|
|
12055
|
-
return Requests.processRoute(SchedulerRoute.routes.crossPromoteListRelationships, {}, { scheduler_id: scheduler_id }, params);
|
|
12056
|
-
};
|
|
12057
|
-
/**
|
|
12058
|
-
* Find potential cross-promote partners for a scheduler.
|
|
12059
|
-
*
|
|
12060
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
12061
|
-
* @param params Optional query params
|
|
12041
|
+
* Search for cross-promote partners.
|
|
12042
|
+
* Uses query parameter `my_scheduler_id`
|
|
12062
12043
|
*/
|
|
12063
|
-
Scheduler.
|
|
12064
|
-
|
|
12044
|
+
Scheduler.crossPromoteSearch = function (my_scheduler_id, params) {
|
|
12045
|
+
var newParams = __assign(__assign({}, params), { my_scheduler_id: my_scheduler_id });
|
|
12046
|
+
return Requests.processRoute(SchedulerRoute.routes.crossPromoteSearch, {}, {}, newParams);
|
|
12065
12047
|
};
|
|
12066
12048
|
/**
|
|
12067
|
-
* List cross-promote
|
|
12068
|
-
*
|
|
12069
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
12070
|
-
* @param params Optional query params
|
|
12049
|
+
* List cross-promote invitations for a scheduler.
|
|
12050
|
+
* Expects a query param `scheduler_id`
|
|
12071
12051
|
*/
|
|
12072
12052
|
Scheduler.crossPromoteInvitesList = function (scheduler_id, params) {
|
|
12073
|
-
|
|
12053
|
+
var newParams = __assign(__assign({}, params), { scheduler_id: scheduler_id });
|
|
12054
|
+
return Requests.processRoute(SchedulerRoute.routes.crossPromoteInvitesList, {}, {}, newParams);
|
|
12074
12055
|
};
|
|
12075
12056
|
/**
|
|
12076
12057
|
* Send an invite to cross-promote.
|
|
12077
|
-
*
|
|
12078
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
12079
|
-
* @param data { partner_scheduler_id, optional_message }
|
|
12058
|
+
* Converts `partner_scheduler_id` and `optional_message` into the PHP expected fields.
|
|
12080
12059
|
*/
|
|
12081
12060
|
Scheduler.crossPromoteInviteSend = function (scheduler_id, data, params) {
|
|
12082
|
-
|
|
12061
|
+
var payload = {
|
|
12062
|
+
from_scheduler_id: scheduler_id,
|
|
12063
|
+
to_scheduler_id: data.partner_scheduler_id,
|
|
12064
|
+
message: data.optional_message || ''
|
|
12065
|
+
};
|
|
12066
|
+
return Requests.processRoute(SchedulerRoute.routes.crossPromoteInviteSend, payload, {}, params);
|
|
12083
12067
|
};
|
|
12084
12068
|
/**
|
|
12085
|
-
*
|
|
12086
|
-
*
|
|
12087
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
12088
|
-
* @param invite_id The ID of the invite
|
|
12069
|
+
* Respond to an invitation (accept or deny).
|
|
12089
12070
|
*/
|
|
12090
|
-
Scheduler.
|
|
12091
|
-
return Requests.processRoute(SchedulerRoute.routes.
|
|
12071
|
+
Scheduler.crossPromoteInviteRespond = function (invitation_id, data, params) {
|
|
12072
|
+
return Requests.processRoute(SchedulerRoute.routes.crossPromoteInviteRespond, data, { invitation_id: invitation_id }, params);
|
|
12092
12073
|
};
|
|
12093
12074
|
/**
|
|
12094
|
-
*
|
|
12095
|
-
*
|
|
12096
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
12097
|
-
* @param invite_id The ID of the invite
|
|
12075
|
+
* List cross-promote relationships for a scheduler.
|
|
12076
|
+
* Expects a query param `scheduler_id`
|
|
12098
12077
|
*/
|
|
12099
|
-
Scheduler.
|
|
12100
|
-
|
|
12078
|
+
Scheduler.crossPromoteListRelationships = function (scheduler_id, params) {
|
|
12079
|
+
var newParams = __assign(__assign({}, params), { scheduler_id: scheduler_id });
|
|
12080
|
+
return Requests.processRoute(SchedulerRoute.routes.crossPromoteListRelationships, {}, {}, newParams);
|
|
12101
12081
|
};
|
|
12102
12082
|
/**
|
|
12103
12083
|
* End a cross-promote relationship.
|
|
12104
|
-
*
|
|
12105
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
12106
|
-
* @param relationship_id The ID of the relationship
|
|
12107
12084
|
*/
|
|
12108
|
-
Scheduler.
|
|
12109
|
-
return Requests.processRoute(SchedulerRoute.routes.
|
|
12085
|
+
Scheduler.crossPromoteEndRelationship = function (relationship_id, params) {
|
|
12086
|
+
return Requests.processRoute(SchedulerRoute.routes.crossPromoteEndRelationship, {}, { relationship_id: relationship_id }, params);
|
|
12087
|
+
};
|
|
12088
|
+
/**
|
|
12089
|
+
* List logs for a cross-promote relationship.
|
|
12090
|
+
*/
|
|
12091
|
+
Scheduler.crossPromoteListLogs = function (relationship_id, params) {
|
|
12092
|
+
return Requests.processRoute(SchedulerRoute.routes.crossPromoteListLogs, {}, { relationship_id: relationship_id }, params);
|
|
12110
12093
|
};
|
|
12111
12094
|
/**
|
|
12112
12095
|
* Get which platforms are cross-promoted in an existing relationship.
|
|
12113
|
-
*
|
|
12114
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
12115
|
-
* @param relationship_id The ID of the relationship
|
|
12116
12096
|
*/
|
|
12117
|
-
Scheduler.crossPromoteRelationshipGetPlatforms = function (
|
|
12118
|
-
return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipGetPlatforms, {}, {
|
|
12097
|
+
Scheduler.crossPromoteRelationshipGetPlatforms = function (relationship_id, params) {
|
|
12098
|
+
return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipGetPlatforms, {}, { relationship_id: relationship_id }, params);
|
|
12119
12099
|
};
|
|
12120
12100
|
/**
|
|
12121
12101
|
* Set which platforms are cross-promoted in an existing relationship.
|
|
12122
|
-
*
|
|
12123
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
12124
|
-
* @param relationship_id The ID of the relationship
|
|
12125
|
-
* @param data An object like { platforms: ['twitter', 'facebook', ...] }
|
|
12126
12102
|
*/
|
|
12127
|
-
Scheduler.crossPromoteRelationshipSetPlatforms = function (
|
|
12128
|
-
return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipSetPlatforms, data, {
|
|
12103
|
+
Scheduler.crossPromoteRelationshipSetPlatforms = function (relationship_id, data, params) {
|
|
12104
|
+
return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipSetPlatforms, data, { relationship_id: relationship_id }, params);
|
|
12129
12105
|
};
|
|
12130
12106
|
/**
|
|
12131
12107
|
* Get recently cross-promoted posts under a relationship.
|
|
12132
|
-
*
|
|
12133
|
-
* @param scheduler_id The ID of the promotion schedule
|
|
12134
|
-
* @param relationship_id The ID of the relationship
|
|
12135
12108
|
*/
|
|
12136
|
-
Scheduler.crossPromoteRelationshipPosts = function (
|
|
12137
|
-
return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipPosts, {}, {
|
|
12109
|
+
Scheduler.crossPromoteRelationshipPosts = function (relationship_id, params) {
|
|
12110
|
+
return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipPosts, {}, { relationship_id: relationship_id }, params);
|
|
12138
12111
|
};
|
|
12139
12112
|
return Scheduler;
|
|
12140
12113
|
}());
|