glitch-javascript-sdk 1.4.9 → 1.5.1

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/index.d.ts CHANGED
@@ -2629,6 +2629,15 @@ declare class SocialPosts {
2629
2629
  * @returns promise
2630
2630
  */
2631
2631
  static update<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2632
+ /**
2633
+ * Deletes a post.
2634
+ *
2635
+ * @see https://api.glitch.fun/api/documentation#/Post%20Route/destoryPostStorage
2636
+ *
2637
+ * @param post_id The id of the post to delete.
2638
+ * @returns promise
2639
+ */
2640
+ static delete<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
2632
2641
  /**
2633
2642
  * Dispute a post as being fraudulent.,s
2634
2643
  *
@@ -4092,6 +4101,18 @@ declare class Scheduler {
4092
4101
  * @returns promise
4093
4102
  */
4094
4103
  static deleteUpdate<T>(scheduler_id: string, update_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4104
+ /**
4105
+ * Schedule title update.
4106
+ *
4107
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdate
4108
+ *
4109
+ * @param scheduler_id The ID of the promotion schedule.
4110
+ * @param update_id The ID of the title update.
4111
+ * @param data The data to update.
4112
+ *
4113
+ * @returns promise
4114
+ */
4115
+ static scheduleUpdate<T>(scheduler_id: string, update_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
4095
4116
  /**
4096
4117
  * Clear Twitter OAuth credentials from a promotion schedule.
4097
4118
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.4.9",
3
+ "version": "1.5.1",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -165,6 +165,21 @@ class Scheduler {
165
165
  return Requests.processRoute(SchedulerRoute.routes.deleteUpdate, {}, { scheduler_id, update_id }, params);
166
166
  }
167
167
 
168
+ /**
169
+ * Schedule title update.
170
+ *
171
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdate
172
+ *
173
+ * @param scheduler_id The ID of the promotion schedule.
174
+ * @param update_id The ID of the title update.
175
+ * @param data The data to update.
176
+ *
177
+ * @returns promise
178
+ */
179
+ public static scheduleUpdate<T>(scheduler_id: string, update_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
180
+ return Requests.processRoute(SchedulerRoute.routes.scheduleUpdate, data, { scheduler_id, update_id }, params);
181
+ }
182
+
168
183
  /**
169
184
  * Clear Twitter OAuth credentials from a promotion schedule.
170
185
  *
@@ -23,7 +23,7 @@ class SocialPosts {
23
23
  *
24
24
  * @returns A promise
25
25
  */
26
- public static create<T>(data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
26
+ public static create<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
27
27
  return Requests.processRoute(SocialPostsRoute.routes.createPost, data, {}, params);
28
28
  }
29
29
 
@@ -50,36 +50,50 @@ class SocialPosts {
50
50
  *
51
51
  * @returns promise
52
52
  */
53
- public static update<T>(post_id: string, data? : object, params?: Record<string, any>): AxiosPromise<Response<T>> {
53
+ public static update<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
54
54
 
55
55
  return Requests.processRoute(SocialPostsRoute.routes.updatePost, data, { post_id: post_id }, params);
56
56
  }
57
57
 
58
-
59
- /**
60
- * Dispute a post as being fraudulent.,s
61
- *
62
- * @see https://api.glitch.fun/api/documentation#/Social%20Media%20Posts/disputePost
58
+ /**
59
+ * Deletes a post.
63
60
  *
64
- * @param post_id The id fo the post to retrieve.
61
+ * @see https://api.glitch.fun/api/documentation#/Post%20Route/destoryPostStorage
65
62
  *
63
+ * @param post_id The id of the post to delete.
66
64
  * @returns promise
67
65
  */
68
- public static dispute<T>(post_id: string, data? : object, params?: Record<string, any>): AxiosPromise<Response<T>> {
66
+ public static delete<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
67
+
68
+ return Requests.processRoute(SocialPostsRoute.routes.deletePost, {}, { post_id: post_id }, params);
69
+ }
70
+
71
+
72
+
73
+ /**
74
+ * Dispute a post as being fraudulent.,s
75
+ *
76
+ * @see https://api.glitch.fun/api/documentation#/Social%20Media%20Posts/disputePost
77
+ *
78
+ * @param post_id The id fo the post to retrieve.
79
+ *
80
+ * @returns promise
81
+ */
82
+ public static dispute<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
69
83
 
70
84
  return Requests.processRoute(SocialPostsRoute.routes.dispute, data, { post_id: post_id }, params);
71
85
  }
72
86
 
73
- /**
74
- * Get the change of the post metrics over a period of time.
75
- *
76
- * @see https://api.glitch.fun/api/documentation#/Social%20Media%20Posts/getSocialMediaPostHistory
77
- *
78
- * @param post_id The id fo the post to retrieve.
79
- *
80
- * @returns promise
81
- */
82
- public static history<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
87
+ /**
88
+ * Get the change of the post metrics over a period of time.
89
+ *
90
+ * @see https://api.glitch.fun/api/documentation#/Social%20Media%20Posts/getSocialMediaPostHistory
91
+ *
92
+ * @param post_id The id fo the post to retrieve.
93
+ *
94
+ * @returns promise
95
+ */
96
+ public static history<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
83
97
 
84
98
  return Requests.processRoute(SocialPostsRoute.routes.history, {}, { post_id: post_id }, params);
85
99
  }
@@ -112,28 +126,28 @@ class SocialPosts {
112
126
  return Requests.processRoute(SocialPostsRoute.routes.removeMedia, {}, { post_id: post_id, media_id: media_id }, params);
113
127
  }
114
128
 
115
- /**
116
- * Reschedule a post that has failed.
117
- *
118
- * @see https://api.glitch.fun/api/documentation#/Social%20Media%20Posts/addMediaToSocialMediaPost
119
- *
120
- * @param post_id The ID of the social media post.
121
- * @param data The data to be sent in the request body.
122
- *
123
- * @returns promise
124
- */
125
- public static reschedule<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
129
+ /**
130
+ * Reschedule a post that has failed.
131
+ *
132
+ * @see https://api.glitch.fun/api/documentation#/Social%20Media%20Posts/addMediaToSocialMediaPost
133
+ *
134
+ * @param post_id The ID of the social media post.
135
+ * @param data The data to be sent in the request body.
136
+ *
137
+ * @returns promise
138
+ */
139
+ public static reschedule<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
126
140
  return Requests.processRoute(SocialPostsRoute.routes.reschedule, data, { post_id: post_id }, params);
127
141
  }
128
142
 
129
- /**
130
- * Get the reports for a social media post
131
- *
132
- * @see https://api.glitch.fun/api/documentation#/Post%20Route/resourcePostList
133
- *
134
- * @returns promise
135
- */
136
- public static reports<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
143
+ /**
144
+ * Get the reports for a social media post
145
+ *
146
+ * @see https://api.glitch.fun/api/documentation#/Post%20Route/resourcePostList
147
+ *
148
+ * @returns promise
149
+ */
150
+ public static reports<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
137
151
  return Requests.processRoute(SocialPostsRoute.routes.reports, undefined, undefined, params);
138
152
  }
139
153
 
@@ -17,6 +17,7 @@ class SchedulerRoute {
17
17
  getUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.GET },
18
18
  updateUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.PUT },
19
19
  deleteUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}', method: HTTP_METHODS.DELETE },
20
+ scheduleUpdate: { url: '/schedulers/{scheduler_id}/updates/{update_id}/schedule', method: HTTP_METHODS.POST },
20
21
 
21
22
  testTone: { url: '/schedulers/{scheduler_id}/tone', method: HTTP_METHODS.POST },
22
23
  getSchedulerReports: { url: '/schedulers/{scheduler_id}/reports', method: HTTP_METHODS.GET },
@@ -8,6 +8,7 @@ class SocialPostsRoute {
8
8
  createPost: { url: '/socialposts', method: HTTP_METHODS.POST },
9
9
  retrievePost : { url: '/socialposts/{post_id}', method: HTTP_METHODS.GET },
10
10
  updatePost : { url: '/socialposts/{post_id}', method: HTTP_METHODS.PUT },
11
+ deletePost : { url: '/socialposts/{post_id}', method: HTTP_METHODS.DELETE },
11
12
  dispute: { url: '/social/{post_id}/dispute', method: HTTP_METHODS.POST },
12
13
  history : { url: '/socialposts/{post_id}/history', method: HTTP_METHODS.GET },
13
14
  addMedia: { url: '/socialposts/{post_id}/addMedia', method: HTTP_METHODS.POST },