glitch-javascript-sdk 1.4.9 → 1.5.0
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 +12 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/SocialPosts.d.ts +9 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/package.json +1 -1
- package/src/api/SocialPosts.ts +52 -38
- package/src/routes/SocialPostsRoute.ts +1 -0
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
|
*
|
package/package.json
CHANGED
package/src/api/SocialPosts.ts
CHANGED
|
@@ -23,7 +23,7 @@ class SocialPosts {
|
|
|
23
23
|
*
|
|
24
24
|
* @returns A promise
|
|
25
25
|
*/
|
|
26
|
-
public static create<T>(data
|
|
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
|
|
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
|
-
* @
|
|
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
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
|
|
@@ -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 },
|