glitch-javascript-sdk 2.3.4 → 2.3.6
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 +38 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Scheduler.d.ts +11 -0
- package/dist/esm/api/SocialPosts.d.ts +18 -0
- package/dist/esm/index.js +38 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +29 -0
- package/package.json +1 -1
- package/src/api/Scheduler.ts +14 -0
- package/src/api/SocialPosts.ts +24 -0
- package/src/routes/SchedulerRoute.ts +2 -0
- package/src/routes/SocialPostsRoute.ts +3 -0
package/dist/index.d.ts
CHANGED
|
@@ -3610,6 +3610,24 @@ declare class SocialPosts {
|
|
|
3610
3610
|
* @returns A promise
|
|
3611
3611
|
*/
|
|
3612
3612
|
static getLinkSummary<T>(post_id: string): AxiosPromise<Response<T>>;
|
|
3613
|
+
/**
|
|
3614
|
+
* Trigger a historical sync for a specific platform for the current user.
|
|
3615
|
+
*
|
|
3616
|
+
* @see https://api.glitch.fun/api/documentation#/Social%20Media%20Posts/syncHistory
|
|
3617
|
+
*
|
|
3618
|
+
* @param platform The platform to sync (e.g., 'twitter', 'youtube', 'bluesky').
|
|
3619
|
+
*
|
|
3620
|
+
* @returns promise
|
|
3621
|
+
*/
|
|
3622
|
+
static syncHistory<T>(platform: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3623
|
+
/**
|
|
3624
|
+
* Perform a social action (Like, Repost, Vote) on a post.
|
|
3625
|
+
*
|
|
3626
|
+
* @param post_id The ID of the social media post.
|
|
3627
|
+
* @param action The action to perform.
|
|
3628
|
+
* @returns promise
|
|
3629
|
+
*/
|
|
3630
|
+
static performAction<T>(post_id: string, action: 'like' | 'unlike' | 'repost' | 'unrepost' | 'vote_up' | 'vote_down' | 'unvote'): AxiosPromise<Response<T>>;
|
|
3613
3631
|
}
|
|
3614
3632
|
|
|
3615
3633
|
declare class Titles {
|
|
@@ -6045,6 +6063,17 @@ declare class Scheduler {
|
|
|
6045
6063
|
platform: string;
|
|
6046
6064
|
account_id?: string;
|
|
6047
6065
|
}): AxiosPromise<Response<T>>;
|
|
6066
|
+
/**
|
|
6067
|
+
* Trigger a historical sync for a specific platform on a scheduler.
|
|
6068
|
+
*
|
|
6069
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/syncHistory
|
|
6070
|
+
*
|
|
6071
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
6072
|
+
* @param platform The platform to sync (e.g., 'twitter', 'youtube', 'bluesky').
|
|
6073
|
+
*
|
|
6074
|
+
* @returns promise
|
|
6075
|
+
*/
|
|
6076
|
+
static syncHistory<T>(scheduler_id: string, platform: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6048
6077
|
}
|
|
6049
6078
|
|
|
6050
6079
|
declare class Funnel {
|
package/package.json
CHANGED
package/src/api/Scheduler.ts
CHANGED
|
@@ -813,6 +813,20 @@ class Scheduler {
|
|
|
813
813
|
return Requests.processRoute(SchedulerRoute.routes.getConversionActions, {}, { scheduler_id }, params);
|
|
814
814
|
}
|
|
815
815
|
|
|
816
|
+
/**
|
|
817
|
+
* Trigger a historical sync for a specific platform on a scheduler.
|
|
818
|
+
*
|
|
819
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/syncHistory
|
|
820
|
+
*
|
|
821
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
822
|
+
* @param platform The platform to sync (e.g., 'twitter', 'youtube', 'bluesky').
|
|
823
|
+
*
|
|
824
|
+
* @returns promise
|
|
825
|
+
*/
|
|
826
|
+
public static syncHistory<T>(scheduler_id: string, platform: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
827
|
+
return Requests.processRoute(SchedulerRoute.routes.syncHistory, {}, { scheduler_id, platform }, params);
|
|
828
|
+
}
|
|
829
|
+
|
|
816
830
|
}
|
|
817
831
|
|
|
818
832
|
export default Scheduler;
|
package/src/api/SocialPosts.ts
CHANGED
|
@@ -328,6 +328,30 @@ class SocialPosts {
|
|
|
328
328
|
return Requests.processRoute(SocialPostsRoute.routes.getLinkSummary, undefined, { post_id });
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
+
/**
|
|
332
|
+
* Trigger a historical sync for a specific platform for the current user.
|
|
333
|
+
*
|
|
334
|
+
* @see https://api.glitch.fun/api/documentation#/Social%20Media%20Posts/syncHistory
|
|
335
|
+
*
|
|
336
|
+
* @param platform The platform to sync (e.g., 'twitter', 'youtube', 'bluesky').
|
|
337
|
+
*
|
|
338
|
+
* @returns promise
|
|
339
|
+
*/
|
|
340
|
+
public static syncHistory<T>(platform: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
341
|
+
return Requests.processRoute(SocialPostsRoute.routes.syncHistory, {}, { platform }, params);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Perform a social action (Like, Repost, Vote) on a post.
|
|
346
|
+
*
|
|
347
|
+
* @param post_id The ID of the social media post.
|
|
348
|
+
* @param action The action to perform.
|
|
349
|
+
* @returns promise
|
|
350
|
+
*/
|
|
351
|
+
public static performAction<T>(post_id: string, action: 'like' | 'unlike' | 'repost' | 'unrepost' | 'vote_up' | 'vote_down' | 'unvote'): AxiosPromise<Response<T>> {
|
|
352
|
+
return Requests.processRoute(SocialPostsRoute.routes.performAction, { action }, { post_id });
|
|
353
|
+
}
|
|
354
|
+
|
|
331
355
|
}
|
|
332
356
|
|
|
333
357
|
export default SocialPosts;
|
|
@@ -124,6 +124,8 @@ class SchedulerRoute {
|
|
|
124
124
|
|
|
125
125
|
getConversionActions: { url: '/schedulers/{scheduler_id}/conversion-actions', method: HTTP_METHODS.GET },
|
|
126
126
|
|
|
127
|
+
syncHistory: { url: '/schedulers/{scheduler_id}/sync-history/{platform}', method: HTTP_METHODS.POST },
|
|
128
|
+
|
|
127
129
|
};
|
|
128
130
|
}
|
|
129
131
|
|
|
@@ -34,6 +34,9 @@ class SocialPostsRoute {
|
|
|
34
34
|
getPostAttribution: { url: '/socialposts/{post_id}/attribution', method: HTTP_METHODS.GET },
|
|
35
35
|
getSocialPostAttributionReport: { url: '/reports/fingerprinting/social-post-attribution', method: HTTP_METHODS.GET },
|
|
36
36
|
getLinkSummary: { url: '/socialposts/{post_id}/link-summary', method: HTTP_METHODS.GET },
|
|
37
|
+
syncHistory: { url: '/social/sync-history/{platform}', method: HTTP_METHODS.POST },
|
|
38
|
+
|
|
39
|
+
performAction: { url: '/socialposts/{post_id}/action', method: HTTP_METHODS.POST },
|
|
37
40
|
|
|
38
41
|
};
|
|
39
42
|
|