glitch-javascript-sdk 0.7.7 → 0.7.8
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 +78 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Feedback.d.ts +51 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +78 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/FeedbackRoute.d.ts +7 -0
- package/dist/index.d.ts +50 -0
- package/package.json +1 -1
- package/src/api/Feedback.ts +80 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +2 -0
- package/src/routes/FeedbackRoute.ts +14 -0
- package/src/routes/MessagesRoute.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2495,6 +2495,55 @@ declare class Messages {
|
|
|
2495
2495
|
static createOrGetThread<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2496
2496
|
}
|
|
2497
2497
|
|
|
2498
|
+
declare class Feedback {
|
|
2499
|
+
/**
|
|
2500
|
+
* List all the feedback that been left by users.
|
|
2501
|
+
*
|
|
2502
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/listFeedback
|
|
2503
|
+
*
|
|
2504
|
+
* @returns promise
|
|
2505
|
+
*/
|
|
2506
|
+
static listFeedback<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2507
|
+
/**
|
|
2508
|
+
* View a particular item of feedback.
|
|
2509
|
+
*
|
|
2510
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/getFeedbackById
|
|
2511
|
+
*
|
|
2512
|
+
* @returns promise
|
|
2513
|
+
*/
|
|
2514
|
+
static viewFeedback<T>(feedback_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2515
|
+
/**
|
|
2516
|
+
* Submit feedback.
|
|
2517
|
+
*
|
|
2518
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
2519
|
+
*
|
|
2520
|
+
* @returns A promise
|
|
2521
|
+
*/
|
|
2522
|
+
static sendFeedback<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2523
|
+
/**
|
|
2524
|
+
* Submit feedback with the log file as a file.
|
|
2525
|
+
*
|
|
2526
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
2527
|
+
*
|
|
2528
|
+
* @param file The file object to upload.
|
|
2529
|
+
* @param data Any additional data to pass along to the upload.
|
|
2530
|
+
*
|
|
2531
|
+
* @returns promise
|
|
2532
|
+
*/
|
|
2533
|
+
static sendFeedbackWithFile<T>(file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2534
|
+
/**
|
|
2535
|
+
* Submit feedback with the log file as a blob.
|
|
2536
|
+
*
|
|
2537
|
+
* @see hhttps://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
2538
|
+
*
|
|
2539
|
+
* @param blob The blob to upload.
|
|
2540
|
+
* @param data Any additional data to pass along to the upload
|
|
2541
|
+
*
|
|
2542
|
+
* @returns promise
|
|
2543
|
+
*/
|
|
2544
|
+
static sendFeedbackWithBlob<T>(blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2498
2547
|
interface Route {
|
|
2499
2548
|
url: string;
|
|
2500
2549
|
method: string;
|
|
@@ -2799,6 +2848,7 @@ declare class Glitch {
|
|
|
2799
2848
|
Communities: typeof Communities;
|
|
2800
2849
|
Users: typeof Users;
|
|
2801
2850
|
Events: typeof Events;
|
|
2851
|
+
Feedback: typeof Feedback;
|
|
2802
2852
|
Teams: typeof Teams;
|
|
2803
2853
|
Posts: typeof Posts;
|
|
2804
2854
|
Messages: typeof Messages;
|
package/package.json
CHANGED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import FeedbackRoute from "../routes/FeedbackRoute";
|
|
2
|
+
import Requests from "../util/Requests";
|
|
3
|
+
import Response from "../util/Response";
|
|
4
|
+
import { AxiosPromise } from "axios";
|
|
5
|
+
|
|
6
|
+
class Feedback {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* List all the feedback that been left by users.
|
|
10
|
+
*
|
|
11
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/listFeedback
|
|
12
|
+
*
|
|
13
|
+
* @returns promise
|
|
14
|
+
*/
|
|
15
|
+
public static listFeedback<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
16
|
+
return Requests.processRoute(FeedbackRoute.routes.listFeedback, undefined, undefined, params);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* View a particular item of feedback.
|
|
21
|
+
*
|
|
22
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/getFeedbackById
|
|
23
|
+
*
|
|
24
|
+
* @returns promise
|
|
25
|
+
*/
|
|
26
|
+
public static viewFeedback<T>(feedback_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
27
|
+
return Requests.processRoute(FeedbackRoute.routes.viewFeedback, undefined, { feedback_id: feedback_id }, params);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Submit feedback.
|
|
32
|
+
*
|
|
33
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
34
|
+
*
|
|
35
|
+
* @returns A promise
|
|
36
|
+
*/
|
|
37
|
+
public static sendFeedback<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
38
|
+
return Requests.processRoute(FeedbackRoute.routes.sendFeedback, data, {}, params);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Submit feedback with the log file as a file.
|
|
45
|
+
*
|
|
46
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
47
|
+
*
|
|
48
|
+
* @param file The file object to upload.
|
|
49
|
+
* @param data Any additional data to pass along to the upload.
|
|
50
|
+
*
|
|
51
|
+
* @returns promise
|
|
52
|
+
*/
|
|
53
|
+
public static sendFeedbackWithFile<T>(file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
54
|
+
|
|
55
|
+
let url = FeedbackRoute.routes.sendFeedback.url;
|
|
56
|
+
|
|
57
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Submit feedback with the log file as a blob.
|
|
62
|
+
*
|
|
63
|
+
* @see hhttps://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
64
|
+
*
|
|
65
|
+
* @param blob The blob to upload.
|
|
66
|
+
* @param data Any additional data to pass along to the upload
|
|
67
|
+
*
|
|
68
|
+
* @returns promise
|
|
69
|
+
*/
|
|
70
|
+
public static sendFeedbackWithBlob<T>(blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
71
|
+
|
|
72
|
+
let url = FeedbackRoute.routes.sendFeedback.url;
|
|
73
|
+
|
|
74
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export default Feedback;
|
package/src/api/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ import Titles from "./Titles";
|
|
|
18
18
|
import Campaigns from "./Campaigns";
|
|
19
19
|
import Subscriptions from "./Subscriptions";
|
|
20
20
|
import Messages from "./Messages";
|
|
21
|
+
import Feedback from "./Feedback";
|
|
21
22
|
|
|
22
23
|
export {Auth};
|
|
23
24
|
export {Competitions};
|
|
@@ -38,4 +39,5 @@ export {SocialPosts};
|
|
|
38
39
|
export {Titles};
|
|
39
40
|
export {Campaigns};
|
|
40
41
|
export {Subscriptions};
|
|
41
|
-
export {Messages};
|
|
42
|
+
export {Messages};
|
|
43
|
+
export {Feedback};
|
package/src/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ import {Titles} from "./api";
|
|
|
22
22
|
import {Campaigns} from "./api";
|
|
23
23
|
import {Subscriptions} from "./api";
|
|
24
24
|
import {Messages} from "./api";
|
|
25
|
+
import {Feedback} from "./api";
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
|
|
@@ -61,6 +62,7 @@ class Glitch {
|
|
|
61
62
|
Communities : Communities,
|
|
62
63
|
Users: Users,
|
|
63
64
|
Events: Events,
|
|
65
|
+
Feedback : Feedback,
|
|
64
66
|
Teams: Teams,
|
|
65
67
|
Posts: Posts,
|
|
66
68
|
Messages : Messages,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Route from "./interface";
|
|
2
|
+
import HTTP_METHODS from "../constants/HttpMethods";
|
|
3
|
+
|
|
4
|
+
class FeedbackRoute {
|
|
5
|
+
|
|
6
|
+
public static routes: { [key: string]: Route } = {
|
|
7
|
+
listFeedback: { url: '/feedback', method: HTTP_METHODS.GET },
|
|
8
|
+
sendFeedback: { url: '/feedback', method: HTTP_METHODS.POST },
|
|
9
|
+
viewFeedback: { url: '/feedback/{feedback_id}', method: HTTP_METHODS.GET },
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default FeedbackRoute;
|
|
@@ -5,8 +5,8 @@ class MessagesRoute {
|
|
|
5
5
|
|
|
6
6
|
public static routes: { [key: string]: Route } = {
|
|
7
7
|
listMessageThreads: { url: '/messages', method: HTTP_METHODS.GET },
|
|
8
|
-
sendMessage: { url: '/
|
|
9
|
-
deleteMessage: { url: '/
|
|
8
|
+
sendMessage: { url: '/messages', method: HTTP_METHODS.POST },
|
|
9
|
+
deleteMessage: { url: '/messages/{message_id}', method: HTTP_METHODS.DELETE },
|
|
10
10
|
createOrGetThread: { url: '/messages/makeThread', method: HTTP_METHODS.POST },
|
|
11
11
|
};
|
|
12
12
|
|