glitch-javascript-sdk 0.3.3 → 0.3.4
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 +26 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Posts.d.ts +22 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +22 -0
- package/package.json +1 -1
- package/src/api/Posts.ts +31 -0
package/dist/esm/api/Posts.d.ts
CHANGED
|
@@ -19,6 +19,28 @@ declare class Posts {
|
|
|
19
19
|
* @returns Promise
|
|
20
20
|
*/
|
|
21
21
|
static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
22
|
+
/**
|
|
23
|
+
* Create a new post with a file. The file should either be an image or video.
|
|
24
|
+
*
|
|
25
|
+
* @see https://api.glitch.fun/api/documentation#/Post%20Route/newPostResourceStorage
|
|
26
|
+
*
|
|
27
|
+
* @param file The file object to upload.
|
|
28
|
+
* @param data Any additional data to pass along to the upload.
|
|
29
|
+
*
|
|
30
|
+
* @returns promise
|
|
31
|
+
*/
|
|
32
|
+
static createWithFile<T>(file: File, data?: object): AxiosPromise<Response<T>>;
|
|
33
|
+
/**
|
|
34
|
+
* Create a new post with a blob. The blob should either be an image or video.
|
|
35
|
+
*
|
|
36
|
+
* @see https://api.glitch.fun/api/documentation#/Post%20Route/newPostResourceStorage
|
|
37
|
+
*
|
|
38
|
+
* @param file The blob to upload.
|
|
39
|
+
* @param data Any additional data to pass along to the upload.
|
|
40
|
+
*
|
|
41
|
+
* @returns promise
|
|
42
|
+
*/
|
|
43
|
+
static createWithBlob<T>(blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
22
44
|
/**
|
|
23
45
|
* Update a post.
|
|
24
46
|
*
|
package/dist/esm/index.js
CHANGED
|
@@ -32013,6 +32013,32 @@ var Posts = /** @class */ (function () {
|
|
|
32013
32013
|
Posts.create = function (data, params) {
|
|
32014
32014
|
return Requests.processRoute(PostsRoute.routes.create, data, undefined, params);
|
|
32015
32015
|
};
|
|
32016
|
+
/**
|
|
32017
|
+
* Create a new post with a file. The file should either be an image or video.
|
|
32018
|
+
*
|
|
32019
|
+
* @see https://api.glitch.fun/api/documentation#/Post%20Route/newPostResourceStorage
|
|
32020
|
+
*
|
|
32021
|
+
* @param file The file object to upload.
|
|
32022
|
+
* @param data Any additional data to pass along to the upload.
|
|
32023
|
+
*
|
|
32024
|
+
* @returns promise
|
|
32025
|
+
*/
|
|
32026
|
+
Posts.createWithFile = function (file, data) {
|
|
32027
|
+
return Requests.uploadFile(PostsRoute.routes.create.url, 'file', file, data);
|
|
32028
|
+
};
|
|
32029
|
+
/**
|
|
32030
|
+
* Create a new post with a blob. The blob should either be an image or video.
|
|
32031
|
+
*
|
|
32032
|
+
* @see https://api.glitch.fun/api/documentation#/Post%20Route/newPostResourceStorage
|
|
32033
|
+
*
|
|
32034
|
+
* @param file The blob to upload.
|
|
32035
|
+
* @param data Any additional data to pass along to the upload.
|
|
32036
|
+
*
|
|
32037
|
+
* @returns promise
|
|
32038
|
+
*/
|
|
32039
|
+
Posts.createWithBlob = function (blob, data) {
|
|
32040
|
+
return Requests.uploadBlob(PostsRoute.routes.create.url, 'file', blob, data);
|
|
32041
|
+
};
|
|
32016
32042
|
/**
|
|
32017
32043
|
* Update a post.
|
|
32018
32044
|
*
|