glitch-javascript-sdk 0.0.3 → 0.0.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 +28 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Events.d.ts +205 -0
- package/dist/esm/api/Teams.d.ts +179 -0
- package/dist/esm/api/Users.d.ts +53 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +28 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/TeamsRoute.d.ts +7 -0
- package/dist/esm/util/Requests.d.ts +2 -0
- package/dist/index.d.ts +436 -0
- package/package.json +1 -1
- package/src/api/Events.ts +306 -8
- package/src/api/Teams.ts +256 -0
- package/src/api/Users.ts +74 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +4 -2
- package/src/routes/EventsRoute.ts +18 -16
- package/src/routes/TeamsRoute.ts +26 -0
- package/src/routes/UserRoutes.ts +1 -1
- package/src/util/Requests.ts +53 -6
package/dist/esm/api/Events.d.ts
CHANGED
|
@@ -49,5 +49,210 @@ declare class Events {
|
|
|
49
49
|
* @returns promise
|
|
50
50
|
*/
|
|
51
51
|
static delete<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
52
|
+
/**
|
|
53
|
+
* The event is synced with Invirtu for the lie streams. This will allow you to update
|
|
54
|
+
*
|
|
55
|
+
*
|
|
56
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/updateEventStorage
|
|
57
|
+
*
|
|
58
|
+
* @param event_id The id of the event to update.
|
|
59
|
+
* @param data The data to update.
|
|
60
|
+
*
|
|
61
|
+
* @returns promise
|
|
62
|
+
*/
|
|
63
|
+
static updateInvirtuEvent<T>(event_id: string, data: object): AxiosPromise<Response<T>>;
|
|
64
|
+
/**
|
|
65
|
+
* Add an RTMP source to multicast a stream too.
|
|
66
|
+
*
|
|
67
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/addRTMPSource
|
|
68
|
+
*
|
|
69
|
+
* @param event_id The id of the event.
|
|
70
|
+
* @param data The data to be passed when adding an RTMP source.
|
|
71
|
+
*
|
|
72
|
+
* @returns promise
|
|
73
|
+
*/
|
|
74
|
+
static addRTMPSource<T>(event_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
75
|
+
/**
|
|
76
|
+
* Update an RTMP Source for multicasing.
|
|
77
|
+
*
|
|
78
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/addRTMPSource
|
|
79
|
+
*
|
|
80
|
+
* @param event_id The id of the event.
|
|
81
|
+
* @param data The data to be passed when adding an RTMP source.
|
|
82
|
+
*
|
|
83
|
+
* @returns promise
|
|
84
|
+
*/
|
|
85
|
+
static updateRTMPSource<T>(event_id: string, stream_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
86
|
+
/**
|
|
87
|
+
* Remove a RTMP source for multicasing.
|
|
88
|
+
*
|
|
89
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/addRTMPSource
|
|
90
|
+
*
|
|
91
|
+
* @param event_id The id of the event.
|
|
92
|
+
* @param data The data to be passed when adding an RTMP source.
|
|
93
|
+
*
|
|
94
|
+
* @returns promise
|
|
95
|
+
*/
|
|
96
|
+
static removeRTMPSource<T>(event_id: string, stream_id: string): AxiosPromise<Response<T>>;
|
|
97
|
+
/**
|
|
98
|
+
* A function that should be run on an interval to set the event as live when the live stream is active.
|
|
99
|
+
*
|
|
100
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/syncLive
|
|
101
|
+
*
|
|
102
|
+
* @param event_id The id of the event.
|
|
103
|
+
*
|
|
104
|
+
* @returns promise
|
|
105
|
+
*/
|
|
106
|
+
static syncAsLive<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
107
|
+
/**
|
|
108
|
+
* Updates the main image for the event using a File object.
|
|
109
|
+
*
|
|
110
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadMainEventImage
|
|
111
|
+
*
|
|
112
|
+
* @param file The file object to upload.
|
|
113
|
+
* @param data Any additional data to pass along to the upload.
|
|
114
|
+
*
|
|
115
|
+
* @returns promise
|
|
116
|
+
*/
|
|
117
|
+
static uploadMainImageFile<T>(event_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
118
|
+
/**
|
|
119
|
+
* Updates the main image for the event using a Blob.
|
|
120
|
+
*
|
|
121
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadMainEventImage
|
|
122
|
+
*
|
|
123
|
+
* @param blob The blob to upload.
|
|
124
|
+
* @param data Any additional data to pass along to the upload
|
|
125
|
+
*
|
|
126
|
+
* @returns promise
|
|
127
|
+
*/
|
|
128
|
+
static uploadMainImageBlob<T>(event_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
129
|
+
/**
|
|
130
|
+
* Updates the banner image for the team using a File object.
|
|
131
|
+
*
|
|
132
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
|
|
133
|
+
*
|
|
134
|
+
* @param file The file object to upload.
|
|
135
|
+
* @param data Any additional data to pass along to the upload.
|
|
136
|
+
*
|
|
137
|
+
* @returns promise
|
|
138
|
+
*/
|
|
139
|
+
static uploadBannerImageFile<T>(event_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
140
|
+
/**
|
|
141
|
+
* Updates the banner image for the team using a Blob.
|
|
142
|
+
*
|
|
143
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
|
|
144
|
+
*
|
|
145
|
+
* @param blob The blob to upload.
|
|
146
|
+
* @param data Any additional data to pass along to the upload
|
|
147
|
+
*
|
|
148
|
+
* @returns promise
|
|
149
|
+
*/
|
|
150
|
+
static uploadBannerImageBlob<T>(event_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
151
|
+
/**
|
|
152
|
+
* Enable Broadcast Mode. Broadcast mode is when the live stream is broadcasted from the game play through a protocol
|
|
153
|
+
* such as screen sharing.
|
|
154
|
+
*
|
|
155
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/enableBroadcastMode
|
|
156
|
+
*
|
|
157
|
+
* @param event_id The id of the event.
|
|
158
|
+
*
|
|
159
|
+
* @returns promise
|
|
160
|
+
*/
|
|
161
|
+
static enableBroadcastMode<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
162
|
+
/**
|
|
163
|
+
* Enable livestream mode, in which the stream will be delivered to the invirtu RTMP endpoint for
|
|
164
|
+
* streaming.
|
|
165
|
+
*
|
|
166
|
+
* @param event_id The id of the event.
|
|
167
|
+
*
|
|
168
|
+
* @returns promise
|
|
169
|
+
*/
|
|
170
|
+
static enableLivestreamMode<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
171
|
+
/**
|
|
172
|
+
* Sends content that will appear on-screen to the user.
|
|
173
|
+
*
|
|
174
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/sendOnScreenContent
|
|
175
|
+
*
|
|
176
|
+
* @param event_id The id of the event.
|
|
177
|
+
* @param data The information to send on-screen.
|
|
178
|
+
*
|
|
179
|
+
* @returns promise
|
|
180
|
+
*/
|
|
181
|
+
static sendOnScreenContent<T>(event_id: string, data: object): AxiosPromise<Response<T>>;
|
|
182
|
+
/**
|
|
183
|
+
* Uploads an image that can be used and overlay later. A File object is used.
|
|
184
|
+
*
|
|
185
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadOverlayImage
|
|
186
|
+
*
|
|
187
|
+
* @param event_id The id of the event.
|
|
188
|
+
* @param file The image as a file.
|
|
189
|
+
* @param data Any additional data to be sent in the request.
|
|
190
|
+
*
|
|
191
|
+
* @returns promise
|
|
192
|
+
*/
|
|
193
|
+
static addOverlayAsFile<T>(event_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
194
|
+
/**
|
|
195
|
+
* Uploads an image that can be used and overlay later. A blob is used.
|
|
196
|
+
*
|
|
197
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadOverlayImage
|
|
198
|
+
*
|
|
199
|
+
* @param event_id The id of the event.
|
|
200
|
+
* @param blob Image data as a blob
|
|
201
|
+
* @param data Any additional data to be sent in the request.
|
|
202
|
+
*
|
|
203
|
+
* @returns promise
|
|
204
|
+
*/
|
|
205
|
+
static addOverlayAsBlob<T>(event_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
206
|
+
/**
|
|
207
|
+
* Deletes an overlay image.
|
|
208
|
+
*
|
|
209
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/destoryOverlayStorage
|
|
210
|
+
*
|
|
211
|
+
* @param event_id The id of the event.
|
|
212
|
+
* @param overlay_id The id of the overlay.
|
|
213
|
+
*
|
|
214
|
+
* @returns promise
|
|
215
|
+
*/
|
|
216
|
+
static removeOverlay<T>(event_id: string, overlay_id: string): AxiosPromise<Response<T>>;
|
|
217
|
+
/**
|
|
218
|
+
* Enables an overlay so that it will appear on screen.
|
|
219
|
+
*
|
|
220
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/enableOverlayImage
|
|
221
|
+
*
|
|
222
|
+
* @param event_id The id of the event.
|
|
223
|
+
* @param overlay_id The id of the overlay.
|
|
224
|
+
*
|
|
225
|
+
* @returns promise
|
|
226
|
+
*/
|
|
227
|
+
static enableOverlay<T>(event_id: string, overlay_id: string): AxiosPromise<Response<T>>;
|
|
228
|
+
/**
|
|
229
|
+
* Disables the overlay so it no longer appears on-screen.
|
|
230
|
+
*
|
|
231
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/disableOverlay
|
|
232
|
+
*
|
|
233
|
+
* @param event_id The id of the event.
|
|
234
|
+
*
|
|
235
|
+
* @returns promise
|
|
236
|
+
*/
|
|
237
|
+
static disableOverlay<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
238
|
+
/**
|
|
239
|
+
* Enable the donations to appear on-screen
|
|
240
|
+
*
|
|
241
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/enableDonations
|
|
242
|
+
*
|
|
243
|
+
* @param event_id The id of the event.
|
|
244
|
+
*
|
|
245
|
+
* @returns promise
|
|
246
|
+
*/
|
|
247
|
+
static enableDonations<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
248
|
+
/**
|
|
249
|
+
* Disable the donations and remove from the screen.
|
|
250
|
+
*
|
|
251
|
+
* @param event_id
|
|
252
|
+
* @returns
|
|
253
|
+
*/
|
|
254
|
+
static disableDonations<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
255
|
+
static sendInvite<T>(event_id: string, data: object): AxiosPromise<Response<T>>;
|
|
256
|
+
static acceptInvite<T>(event_id: string, token: string): AxiosPromise<Response<T>>;
|
|
52
257
|
}
|
|
53
258
|
export default Events;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import Response from "../util/Response";
|
|
2
|
+
import { AxiosPromise } from "axios";
|
|
3
|
+
declare class Teams {
|
|
4
|
+
/**
|
|
5
|
+
* List all the teams
|
|
6
|
+
*
|
|
7
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamsList
|
|
8
|
+
*
|
|
9
|
+
* @returns promise
|
|
10
|
+
*/
|
|
11
|
+
static list<T>(): AxiosPromise<Response<T>>;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new team.
|
|
14
|
+
*
|
|
15
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamCreate
|
|
16
|
+
*
|
|
17
|
+
* @param data The data to be passed when creating a team.
|
|
18
|
+
*
|
|
19
|
+
* @returns Promise
|
|
20
|
+
*/
|
|
21
|
+
static create<T>(data: object): AxiosPromise<Response<T>>;
|
|
22
|
+
/**
|
|
23
|
+
* Update a team.
|
|
24
|
+
*
|
|
25
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUpdate
|
|
26
|
+
*
|
|
27
|
+
* @param team_id The id of the team to update.
|
|
28
|
+
* @param data The data to update.
|
|
29
|
+
*
|
|
30
|
+
* @returns promise
|
|
31
|
+
*/
|
|
32
|
+
static update<T>(team_id: string, data: object): AxiosPromise<Response<T>>;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve the information for a single team.
|
|
35
|
+
*
|
|
36
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamShow
|
|
37
|
+
*
|
|
38
|
+
* @param team_id The id fo the team to retrieve.
|
|
39
|
+
*
|
|
40
|
+
* @returns promise
|
|
41
|
+
*/
|
|
42
|
+
static view<T>(team_id: string): AxiosPromise<Response<T>>;
|
|
43
|
+
/**
|
|
44
|
+
* Deletes a team.
|
|
45
|
+
*
|
|
46
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamDelete
|
|
47
|
+
*
|
|
48
|
+
* @param team_id The id of the team to delete.
|
|
49
|
+
* @returns promise
|
|
50
|
+
*/
|
|
51
|
+
static delete<T>(team_id: string): AxiosPromise<Response<T>>;
|
|
52
|
+
/**
|
|
53
|
+
* Updates the main image for the team using a File object.
|
|
54
|
+
*
|
|
55
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUploadMainImage
|
|
56
|
+
*
|
|
57
|
+
* @param file The file object to upload.
|
|
58
|
+
* @param data Any additional data to pass along to the upload.
|
|
59
|
+
*
|
|
60
|
+
* @returns promise
|
|
61
|
+
*/
|
|
62
|
+
static uploadMainImageFile<T>(team_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
63
|
+
/**
|
|
64
|
+
* Updates the main image for the team using a Blob.
|
|
65
|
+
*
|
|
66
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUploadMainImage
|
|
67
|
+
*
|
|
68
|
+
* @param blob The blob to upload.
|
|
69
|
+
* @param data Any additional data to pass along to the upload
|
|
70
|
+
*
|
|
71
|
+
* @returns promise
|
|
72
|
+
*/
|
|
73
|
+
static uploadMainImageBlob<T>(team_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
74
|
+
/**
|
|
75
|
+
* Updates the banner image for the team using a File object.
|
|
76
|
+
*
|
|
77
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUploadMainImage
|
|
78
|
+
*
|
|
79
|
+
* @param file The file object to upload.
|
|
80
|
+
* @param data Any additional data to pass along to the upload.
|
|
81
|
+
*
|
|
82
|
+
* @returns promise
|
|
83
|
+
*/
|
|
84
|
+
static uploadBannerImageFile<T>(team_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
85
|
+
/**
|
|
86
|
+
* Updates the banner image for the team using a Blob.
|
|
87
|
+
*
|
|
88
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUploadMainImage
|
|
89
|
+
*
|
|
90
|
+
* @param blob The blob to upload.
|
|
91
|
+
* @param data Any additional data to pass along to the upload
|
|
92
|
+
*
|
|
93
|
+
* @returns promise
|
|
94
|
+
*/
|
|
95
|
+
static uploadBannerImageBlob<T>(team_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
96
|
+
/**
|
|
97
|
+
* List the invites that have been sent for the team to users.
|
|
98
|
+
*
|
|
99
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamsUserInviteList
|
|
100
|
+
*
|
|
101
|
+
* @param team_id The id of the team
|
|
102
|
+
*
|
|
103
|
+
* @returns promise
|
|
104
|
+
*/
|
|
105
|
+
static listInvites<T>(team_id: string): AxiosPromise<Response<T>>;
|
|
106
|
+
/**
|
|
107
|
+
* Send an invitation to a user to join the team.
|
|
108
|
+
*
|
|
109
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamSendInvite
|
|
110
|
+
*
|
|
111
|
+
* @param team_id The id of the team.
|
|
112
|
+
* @param data The data that will be passed into sending an invite.
|
|
113
|
+
*
|
|
114
|
+
* @returns promise
|
|
115
|
+
*/
|
|
116
|
+
static sendInvite<T>(team_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
117
|
+
/**
|
|
118
|
+
* Accept an invite to a team. The JSON Web Token (JWT) must be related to the token.
|
|
119
|
+
*
|
|
120
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamAcceptInvite
|
|
121
|
+
*
|
|
122
|
+
* @param team_id The id of the team
|
|
123
|
+
* @param token The token required to accept the user.
|
|
124
|
+
*
|
|
125
|
+
* @returns promise
|
|
126
|
+
*/
|
|
127
|
+
static acceptInvite<T>(team_id: string, token: string): AxiosPromise<Response<T>>;
|
|
128
|
+
/**
|
|
129
|
+
* List the users who are currently associated with the team.
|
|
130
|
+
*
|
|
131
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUserList
|
|
132
|
+
*
|
|
133
|
+
* @param team_id The id of the team.
|
|
134
|
+
*
|
|
135
|
+
* @returns promise
|
|
136
|
+
*/
|
|
137
|
+
static listUsers<T>(team_id: string): AxiosPromise<Response<T>>;
|
|
138
|
+
/**
|
|
139
|
+
* Add a user to a team.
|
|
140
|
+
*
|
|
141
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/createTeamUser
|
|
142
|
+
*
|
|
143
|
+
* @param team_id The id of the team.
|
|
144
|
+
* @param data The data to be passed when adding a user.
|
|
145
|
+
*
|
|
146
|
+
* @returns promise
|
|
147
|
+
*/
|
|
148
|
+
static addUser<T>(team_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
149
|
+
/**
|
|
150
|
+
* Retrieves a single user and their information that is associated with a team.
|
|
151
|
+
*
|
|
152
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/showTeamUser
|
|
153
|
+
*
|
|
154
|
+
* @param team_id The id of the team.
|
|
155
|
+
* @param user_id The id of the user.
|
|
156
|
+
*
|
|
157
|
+
* @returns promise
|
|
158
|
+
*/
|
|
159
|
+
static getUser<T>(team_id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
160
|
+
/**
|
|
161
|
+
* Updates the users information associated with the team.
|
|
162
|
+
*
|
|
163
|
+
* @param team_id The id of the team.
|
|
164
|
+
* @param user_id The id of the user.
|
|
165
|
+
*
|
|
166
|
+
* @returns promise
|
|
167
|
+
*/
|
|
168
|
+
static updatetUser<T>(team_id: string, user_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
169
|
+
/**
|
|
170
|
+
* Removes a user from a team.
|
|
171
|
+
*
|
|
172
|
+
* @param team_id The id of team.
|
|
173
|
+
* @param user_id The id of the user.
|
|
174
|
+
*
|
|
175
|
+
* @returns promise
|
|
176
|
+
*/
|
|
177
|
+
static removetUser<T>(team_id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
178
|
+
}
|
|
179
|
+
export default Teams;
|
package/dist/esm/api/Users.d.ts
CHANGED
|
@@ -58,5 +58,58 @@ declare class Users {
|
|
|
58
58
|
* @returns promise
|
|
59
59
|
*/
|
|
60
60
|
static oneTimeLoginToken<T>(): AxiosPromise<Response<T>>;
|
|
61
|
+
/**
|
|
62
|
+
* Updates the avatar image for the user using a File object.
|
|
63
|
+
*
|
|
64
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadAvatarImage
|
|
65
|
+
*
|
|
66
|
+
* @param file The file object to upload.
|
|
67
|
+
* @param data Any additional data to pass along to the upload.
|
|
68
|
+
*
|
|
69
|
+
* @returns promise
|
|
70
|
+
*/
|
|
71
|
+
static uploadAvatarImageFile<T>(file: File, data?: object): AxiosPromise<Response<T>>;
|
|
72
|
+
/**
|
|
73
|
+
* Updates the avatar image for the user using a Blob.
|
|
74
|
+
*
|
|
75
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadAvatarImage
|
|
76
|
+
*
|
|
77
|
+
* @param blob The blob to upload.
|
|
78
|
+
* @param data Any additional data to pass along to the upload
|
|
79
|
+
*
|
|
80
|
+
* @returns promise
|
|
81
|
+
*/
|
|
82
|
+
static uploadAvatarImageBlob<T>(blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
83
|
+
/**
|
|
84
|
+
* Upload a banner image for the user, as a File object.
|
|
85
|
+
*
|
|
86
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadBannerImage
|
|
87
|
+
*
|
|
88
|
+
* @param file The file object to upload.
|
|
89
|
+
* @param data Any additional data to pass along to the upload.
|
|
90
|
+
*
|
|
91
|
+
* @returns promise
|
|
92
|
+
*/
|
|
93
|
+
static uploadBannerImageFile<T>(file: File, data?: object): AxiosPromise<Response<T>>;
|
|
94
|
+
/**
|
|
95
|
+
* Upload a banner image for the user, as a Blob.
|
|
96
|
+
*
|
|
97
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadBannerImage
|
|
98
|
+
*
|
|
99
|
+
* @param file The blob to upload.
|
|
100
|
+
* @param data Any additional data to pass along to the upload.
|
|
101
|
+
*
|
|
102
|
+
* @returns promise
|
|
103
|
+
*/
|
|
104
|
+
static uploadBannerImageBlob<T>(blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
105
|
+
/**
|
|
106
|
+
* Creates a donation page for that user by syncing their information with various
|
|
107
|
+
* payment service.
|
|
108
|
+
*
|
|
109
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
|
|
110
|
+
*
|
|
111
|
+
* @returns promise
|
|
112
|
+
*/
|
|
113
|
+
static createDonationPage<T>(): AxiosPromise<Response<T>>;
|
|
61
114
|
}
|
|
62
115
|
export default Users;
|
package/dist/esm/api/index.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import Auth from "./Auth";
|
|
|
2
2
|
import Competitions from "./Competitions";
|
|
3
3
|
import Users from "./Users";
|
|
4
4
|
import Events from "./Events";
|
|
5
|
+
import Teams from "./Teams";
|
|
5
6
|
export { Auth };
|
|
6
7
|
export { Competitions };
|
|
7
8
|
export { Users };
|
|
8
9
|
export { Events };
|
|
10
|
+
export { Teams };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Auth } from "./api";
|
|
|
3
3
|
import { Competitions } from "./api";
|
|
4
4
|
import { Users } from "./api";
|
|
5
5
|
import { Events } from "./api";
|
|
6
|
+
import { Teams } from "./api";
|
|
6
7
|
declare class Glitch {
|
|
7
8
|
static config: typeof Config;
|
|
8
9
|
static api: {
|
|
@@ -10,6 +11,7 @@ declare class Glitch {
|
|
|
10
11
|
Competitions: typeof Competitions;
|
|
11
12
|
Users: typeof Users;
|
|
12
13
|
Events: typeof Events;
|
|
14
|
+
Teams: typeof Teams;
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
17
|
export { Glitch };
|
package/dist/esm/index.js
CHANGED
|
@@ -29845,15 +29845,21 @@ var Requests = /** @class */ (function () {
|
|
|
29845
29845
|
Requests.setAuthToken = function (token) {
|
|
29846
29846
|
this.authToken = token;
|
|
29847
29847
|
};
|
|
29848
|
-
Requests.request = function (method, url, data) {
|
|
29848
|
+
Requests.request = function (method, url, data, fileData) {
|
|
29849
|
+
var headers = {
|
|
29850
|
+
'Content-Type': 'application/json',
|
|
29851
|
+
};
|
|
29852
|
+
if (this.authToken) {
|
|
29853
|
+
headers['Authorization'] = "Bearer ".concat(this.authToken);
|
|
29854
|
+
}
|
|
29855
|
+
if (fileData) {
|
|
29856
|
+
headers['Content-Type'] = 'multipart/form-data';
|
|
29857
|
+
}
|
|
29849
29858
|
var axiosPromise = axios({
|
|
29850
29859
|
method: method,
|
|
29851
29860
|
url: "".concat(this.baseUrl).concat(url),
|
|
29852
|
-
data: data,
|
|
29853
|
-
headers:
|
|
29854
|
-
Authorization: "Bearer ".concat(this.authToken),
|
|
29855
|
-
'Content-Type': 'application/json',
|
|
29856
|
-
},
|
|
29861
|
+
data: fileData || data,
|
|
29862
|
+
headers: headers,
|
|
29857
29863
|
});
|
|
29858
29864
|
return axiosPromise;
|
|
29859
29865
|
};
|
|
@@ -29875,6 +29881,22 @@ var Requests = /** @class */ (function () {
|
|
|
29875
29881
|
Requests.delete = function (url) {
|
|
29876
29882
|
return this.request('DELETE', url);
|
|
29877
29883
|
};
|
|
29884
|
+
Requests.uploadFile = function (url, filename, file, data) {
|
|
29885
|
+
var formData = new FormData();
|
|
29886
|
+
formData.append(filename, file);
|
|
29887
|
+
for (var key in data) {
|
|
29888
|
+
formData.append(key, data[key]);
|
|
29889
|
+
}
|
|
29890
|
+
return this.request('POST', url, data, formData);
|
|
29891
|
+
};
|
|
29892
|
+
Requests.uploadBlob = function (url, filename, blob, data) {
|
|
29893
|
+
var formData = new FormData();
|
|
29894
|
+
formData.append(filename, blob);
|
|
29895
|
+
for (var key in data) {
|
|
29896
|
+
formData.append(key, data[key]);
|
|
29897
|
+
}
|
|
29898
|
+
return this.request('POST', url, data, formData);
|
|
29899
|
+
};
|
|
29878
29900
|
/**
|
|
29879
29901
|
* The Route class contains the method and url, thereforce items can be
|
|
29880
29902
|
* automatically routed depending on the configuration.
|