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
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import Response from "../util/Response";
|
|
2
|
+
import { AxiosPromise } from "axios";
|
|
3
|
+
declare class Feedback {
|
|
4
|
+
/**
|
|
5
|
+
* List all the feedback that been left by users.
|
|
6
|
+
*
|
|
7
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/listFeedback
|
|
8
|
+
*
|
|
9
|
+
* @returns promise
|
|
10
|
+
*/
|
|
11
|
+
static listFeedback<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
12
|
+
/**
|
|
13
|
+
* View a particular item of feedback.
|
|
14
|
+
*
|
|
15
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/getFeedbackById
|
|
16
|
+
*
|
|
17
|
+
* @returns promise
|
|
18
|
+
*/
|
|
19
|
+
static viewFeedback<T>(feedback_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
20
|
+
/**
|
|
21
|
+
* Submit feedback.
|
|
22
|
+
*
|
|
23
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
24
|
+
*
|
|
25
|
+
* @returns A promise
|
|
26
|
+
*/
|
|
27
|
+
static sendFeedback<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
28
|
+
/**
|
|
29
|
+
* Submit feedback with the log file as a file.
|
|
30
|
+
*
|
|
31
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
32
|
+
*
|
|
33
|
+
* @param file The file object to upload.
|
|
34
|
+
* @param data Any additional data to pass along to the upload.
|
|
35
|
+
*
|
|
36
|
+
* @returns promise
|
|
37
|
+
*/
|
|
38
|
+
static sendFeedbackWithFile<T>(file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
39
|
+
/**
|
|
40
|
+
* Submit feedback with the log file as a blob.
|
|
41
|
+
*
|
|
42
|
+
* @see hhttps://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
43
|
+
*
|
|
44
|
+
* @param blob The blob to upload.
|
|
45
|
+
* @param data Any additional data to pass along to the upload
|
|
46
|
+
*
|
|
47
|
+
* @returns promise
|
|
48
|
+
*/
|
|
49
|
+
static sendFeedbackWithBlob<T>(blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
50
|
+
}
|
|
51
|
+
export default Feedback;
|
package/dist/esm/api/index.d.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
|
export { Auth };
|
|
22
23
|
export { Competitions };
|
|
23
24
|
export { Communities };
|
|
@@ -38,3 +39,4 @@ export { Titles };
|
|
|
38
39
|
export { Campaigns };
|
|
39
40
|
export { Subscriptions };
|
|
40
41
|
export { Messages };
|
|
42
|
+
export { Feedback };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { Titles } from "./api";
|
|
|
18
18
|
import { Campaigns } from "./api";
|
|
19
19
|
import { Subscriptions } from "./api";
|
|
20
20
|
import { Messages } from "./api";
|
|
21
|
+
import { Feedback } from "./api";
|
|
21
22
|
import Requests from "./util/Requests";
|
|
22
23
|
import Parser from "./util/Parser";
|
|
23
24
|
import Session from "./util/Session";
|
|
@@ -43,6 +44,7 @@ declare class Glitch {
|
|
|
43
44
|
Communities: typeof Communities;
|
|
44
45
|
Users: typeof Users;
|
|
45
46
|
Events: typeof Events;
|
|
47
|
+
Feedback: typeof Feedback;
|
|
46
48
|
Teams: typeof Teams;
|
|
47
49
|
Posts: typeof Posts;
|
|
48
50
|
Messages: typeof Messages;
|
package/dist/esm/index.js
CHANGED
|
@@ -9090,8 +9090,8 @@ var MessagesRoute = /** @class */ (function () {
|
|
|
9090
9090
|
}
|
|
9091
9091
|
MessagesRoute.routes = {
|
|
9092
9092
|
listMessageThreads: { url: '/messages', method: HTTP_METHODS.GET },
|
|
9093
|
-
sendMessage: { url: '/
|
|
9094
|
-
deleteMessage: { url: '/
|
|
9093
|
+
sendMessage: { url: '/messages', method: HTTP_METHODS.POST },
|
|
9094
|
+
deleteMessage: { url: '/messages/{message_id}', method: HTTP_METHODS.DELETE },
|
|
9095
9095
|
createOrGetThread: { url: '/messages/makeThread', method: HTTP_METHODS.POST },
|
|
9096
9096
|
};
|
|
9097
9097
|
return MessagesRoute;
|
|
@@ -9144,6 +9144,81 @@ var Messages = /** @class */ (function () {
|
|
|
9144
9144
|
return Messages;
|
|
9145
9145
|
}());
|
|
9146
9146
|
|
|
9147
|
+
var FeedbackRoute = /** @class */ (function () {
|
|
9148
|
+
function FeedbackRoute() {
|
|
9149
|
+
}
|
|
9150
|
+
FeedbackRoute.routes = {
|
|
9151
|
+
listFeedback: { url: '/feedback', method: HTTP_METHODS.GET },
|
|
9152
|
+
sendFeedback: { url: '/feedback', method: HTTP_METHODS.POST },
|
|
9153
|
+
viewFeedback: { url: '/feedback/{feedback_id}', method: HTTP_METHODS.GET },
|
|
9154
|
+
};
|
|
9155
|
+
return FeedbackRoute;
|
|
9156
|
+
}());
|
|
9157
|
+
|
|
9158
|
+
var Feedback = /** @class */ (function () {
|
|
9159
|
+
function Feedback() {
|
|
9160
|
+
}
|
|
9161
|
+
/**
|
|
9162
|
+
* List all the feedback that been left by users.
|
|
9163
|
+
*
|
|
9164
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/listFeedback
|
|
9165
|
+
*
|
|
9166
|
+
* @returns promise
|
|
9167
|
+
*/
|
|
9168
|
+
Feedback.listFeedback = function (params) {
|
|
9169
|
+
return Requests.processRoute(FeedbackRoute.routes.listFeedback, undefined, undefined, params);
|
|
9170
|
+
};
|
|
9171
|
+
/**
|
|
9172
|
+
* View a particular item of feedback.
|
|
9173
|
+
*
|
|
9174
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/getFeedbackById
|
|
9175
|
+
*
|
|
9176
|
+
* @returns promise
|
|
9177
|
+
*/
|
|
9178
|
+
Feedback.viewFeedback = function (feedback_id, params) {
|
|
9179
|
+
return Requests.processRoute(FeedbackRoute.routes.viewFeedback, undefined, { feedback_id: feedback_id }, params);
|
|
9180
|
+
};
|
|
9181
|
+
/**
|
|
9182
|
+
* Submit feedback.
|
|
9183
|
+
*
|
|
9184
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
9185
|
+
*
|
|
9186
|
+
* @returns A promise
|
|
9187
|
+
*/
|
|
9188
|
+
Feedback.sendFeedback = function (data, params) {
|
|
9189
|
+
return Requests.processRoute(FeedbackRoute.routes.sendFeedback, data, {}, params);
|
|
9190
|
+
};
|
|
9191
|
+
/**
|
|
9192
|
+
* Submit feedback with the log file as a file.
|
|
9193
|
+
*
|
|
9194
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
9195
|
+
*
|
|
9196
|
+
* @param file The file object to upload.
|
|
9197
|
+
* @param data Any additional data to pass along to the upload.
|
|
9198
|
+
*
|
|
9199
|
+
* @returns promise
|
|
9200
|
+
*/
|
|
9201
|
+
Feedback.sendFeedbackWithFile = function (file, data, params) {
|
|
9202
|
+
var url = FeedbackRoute.routes.sendFeedback.url;
|
|
9203
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
9204
|
+
};
|
|
9205
|
+
/**
|
|
9206
|
+
* Submit feedback with the log file as a blob.
|
|
9207
|
+
*
|
|
9208
|
+
* @see hhttps://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
9209
|
+
*
|
|
9210
|
+
* @param blob The blob to upload.
|
|
9211
|
+
* @param data Any additional data to pass along to the upload
|
|
9212
|
+
*
|
|
9213
|
+
* @returns promise
|
|
9214
|
+
*/
|
|
9215
|
+
Feedback.sendFeedbackWithBlob = function (blob, data, params) {
|
|
9216
|
+
var url = FeedbackRoute.routes.sendFeedback.url;
|
|
9217
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
9218
|
+
};
|
|
9219
|
+
return Feedback;
|
|
9220
|
+
}());
|
|
9221
|
+
|
|
9147
9222
|
var Parser = /** @class */ (function () {
|
|
9148
9223
|
function Parser() {
|
|
9149
9224
|
}
|
|
@@ -9547,6 +9622,7 @@ var Glitch = /** @class */ (function () {
|
|
|
9547
9622
|
Communities: Communities,
|
|
9548
9623
|
Users: Users,
|
|
9549
9624
|
Events: Events,
|
|
9625
|
+
Feedback: Feedback,
|
|
9550
9626
|
Teams: Teams,
|
|
9551
9627
|
Posts: Posts,
|
|
9552
9628
|
Messages: Messages,
|