glitch-javascript-sdk 1.3.4 → 1.3.5

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.
@@ -41,6 +41,21 @@ class SocialPosts {
41
41
  return Requests.processRoute(SocialPostsRoute.routes.retrievePost, {}, { post_id: post_id }, params);
42
42
  }
43
43
 
44
+ /**
45
+ * Update the informationa bout a post, as long as it hasn't been posted.
46
+ *
47
+ * @see https://api.glitch.fun/api/documentation#/Post%20Route/showPostStorage
48
+ *
49
+ * @param post_id The id fo the post to retrieve.
50
+ *
51
+ * @returns promise
52
+ */
53
+ public static update<T>(post_id: string, data? : object, params?: Record<string, any>): AxiosPromise<Response<T>> {
54
+
55
+ return Requests.processRoute(SocialPostsRoute.routes.updatePost, data, { post_id: post_id }, params);
56
+ }
57
+
58
+
44
59
  /**
45
60
  * Dispute a post as being fraudulent.,s
46
61
  *
@@ -69,6 +84,34 @@ class SocialPosts {
69
84
  return Requests.processRoute(SocialPostsRoute.routes.history, {}, { post_id: post_id }, params);
70
85
  }
71
86
 
87
+ /**
88
+ * Add media to a social media post.
89
+ *
90
+ * @see https://api.glitch.fun/api/documentation#/Social%20Media%20Posts/addMediaToSocialMediaPost
91
+ *
92
+ * @param post_id The ID of the social media post.
93
+ * @param data The data to be sent in the request body.
94
+ *
95
+ * @returns promise
96
+ */
97
+ public static addMedia<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
98
+ return Requests.processRoute(SocialPostsRoute.routes.addMedia, data, { post_id: post_id }, params);
99
+ }
100
+
101
+ /**
102
+ * Remove media from a social media post.
103
+ *
104
+ * @see https://api.glitch.fun/api/documentation#/Social%20Media%20Posts/removeMediaFromSocialMediaPost
105
+ *
106
+ * @param post_id The ID of the social media post.
107
+ * @param media_id The ID of the media to remove.
108
+ *
109
+ * @returns promise
110
+ */
111
+ public static removeMedia<T>(post_id: string, media_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
112
+ return Requests.processRoute(SocialPostsRoute.routes.removeMedia, {}, { post_id: post_id, media_id: media_id }, params);
113
+ }
114
+
72
115
  }
73
116
 
74
117
  export default SocialPosts;
package/src/api/index.ts CHANGED
@@ -25,6 +25,8 @@ import Publications from "./Publications";
25
25
  import GameShows from "./GameShows";
26
26
  import Newsletters from "./Newsletters"
27
27
  import PlayTests from "./PlayTests";
28
+ import Media from "./Media";
29
+ import Scheduler from "./Scheduler";
28
30
 
29
31
  export {Auth};
30
32
  export {Competitions};
@@ -52,4 +54,6 @@ export {Games};
52
54
  export {Publications};
53
55
  export {GameShows};
54
56
  export {Newsletters};
55
- export {PlayTests};
57
+ export {PlayTests};
58
+ export {Media};
59
+ export {Scheduler};
package/src/index.ts CHANGED
@@ -29,6 +29,8 @@ import {Publications} from "./api";
29
29
  import {GameShows} from "./api";
30
30
  import {Newsletters} from "./api";
31
31
  import {PlayTests} from "./api";
32
+ import {Media} from "./api";
33
+ import {Scheduler} from "./api";
32
34
 
33
35
 
34
36
 
@@ -88,7 +90,9 @@ class Glitch {
88
90
  TipPackagePurchases: TipPackagePurchases,
89
91
  Publications : Publications,
90
92
  Newsletters : Newsletters,
91
- PlayTests : PlayTests
93
+ PlayTests : PlayTests,
94
+ Media : Media,
95
+ Scheduler : Scheduler,
92
96
  }
93
97
 
94
98
  public static util = {
@@ -0,0 +1,11 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class MediaRoute {
5
+ public static routes: { [key: string]: Route } = {
6
+ upload: { url: '/media', method: HTTP_METHODS.POST },
7
+ getMedia: { url: '/media/{meda_id}', method: HTTP_METHODS.GET },
8
+ };
9
+ }
10
+
11
+ export default MediaRoute;
@@ -0,0 +1,39 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class SchedulerRoute {
5
+ public static routes: { [key: string]: Route } = {
6
+ // Title Promotion Schedule Routes
7
+ listSchedules: { url: '/schedulers', method: HTTP_METHODS.GET },
8
+ createSchedule: { url: '/schedulers', method: HTTP_METHODS.POST },
9
+ getSchedule: { url: '/schedulers/{scheduler_id}', method: HTTP_METHODS.GET },
10
+ updateSchedule: { url: '/schedulers/{scheduler_id}', method: HTTP_METHODS.PUT },
11
+ deleteSchedule: { url: '/schedulers/{scheduler_id}', method: HTTP_METHODS.DELETE },
12
+ getSchedulePosts: { url: '/schedulers/{scheduler_id}/posts', method: HTTP_METHODS.GET },
13
+
14
+ // Title Update Routes
15
+ listUpdates: { url: '/schedulers/{scheduler_id}/updates', method: HTTP_METHODS.GET },
16
+ createUpdate: { url: '/schedulers/{scheduler_id}/updates', method: HTTP_METHODS.POST },
17
+ getUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.GET },
18
+ updateUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.PUT },
19
+ deleteUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.DELETE },
20
+
21
+ // Clear OAuth Routes
22
+ clearTwitterAuth: { url: '/schedulers/{scheduler_id}/clearTwitterAuth', method: HTTP_METHODS.DELETE },
23
+ clearFacebookAuth: { url: '/schedulers/{scheduler_id}/clearFacebookAuth', method: HTTP_METHODS.DELETE },
24
+ clearInstagramAuth: { url: '/schedulers/{scheduler_id}/clearInstagramAuth', method: HTTP_METHODS.DELETE },
25
+ clearSnapchatAuth: { url: '/schedulers/{scheduler_id}/clearSnapchatAuth', method: HTTP_METHODS.DELETE },
26
+ clearTikTokAuth: { url: '/schedulers/{scheduler_id}/clearTikTokAuth', method: HTTP_METHODS.DELETE },
27
+ clearTwitchAuth: { url: '/schedulers/{scheduler_id}/clearTwitchAuth', method: HTTP_METHODS.DELETE },
28
+ clearKickAuth: { url: '/schedulers/{scheduler_id}/clearKickAuth', method: HTTP_METHODS.DELETE },
29
+ clearRedditAuth: { url: '/schedulers/{scheduler_id}/clearRedditAuth', method: HTTP_METHODS.DELETE },
30
+ clearYouTubeAuth: { url: '/schedulers/{scheduler_id}/clearYouTubeAuth', method: HTTP_METHODS.DELETE },
31
+ clearPatreonAuth: { url: '/schedulers/{scheduler_id}/clearPatreonAuth', method: HTTP_METHODS.DELETE },
32
+ clearPinterestAuth: { url: '/schedulers/{scheduler_id}/clearPinterestAuth', method: HTTP_METHODS.DELETE },
33
+ clearSteamAuth: { url: '/schedulers/{scheduler_id}/clearSteamAuth', method: HTTP_METHODS.DELETE },
34
+ clearDiscordAuth: { url: '/schedulers/{scheduler_id}/clearDiscordAuth', method: HTTP_METHODS.DELETE },
35
+ clearBlueskyAuth: { url: '/schedulers/{scheduler_id}/clearBlueskyAuth', method: HTTP_METHODS.DELETE },
36
+ };
37
+ }
38
+
39
+ export default SchedulerRoute;
@@ -7,8 +7,11 @@ class SocialPostsRoute {
7
7
  getPosts: { url: '/socialposts', method: HTTP_METHODS.GET },
8
8
  createPost: { url: '/socialposts', method: HTTP_METHODS.POST },
9
9
  retrievePost : { url: '/socialposts/{post_id}', method: HTTP_METHODS.GET },
10
+ updatePost : { url: '/socialposts/{post_id}', method: HTTP_METHODS.PUT },
10
11
  dispute: { url: '/social/{post_id}/dispute', method: HTTP_METHODS.POST },
11
12
  history : { url: '/socialposts/{post_id}/history', method: HTTP_METHODS.GET },
13
+ addMedia: { url: '/socialposts/{post_id}/addMedia', method: HTTP_METHODS.POST },
14
+ removeMedia: { url: '/socialposts/{post_id}/removeMedia/{media_id}', method: HTTP_METHODS.DELETE },
12
15
  };
13
16
 
14
17
  }