glitch-javascript-sdk 0.0.3 → 0.0.6
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 +0 -15714
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Competitions.d.ts +372 -0
- 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/Waitlist.d.ts +53 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +7 -5
- package/dist/esm/index.js +0 -29938
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/RecordingRoute.d.ts +7 -0
- package/dist/esm/routes/TeamsRoute.d.ts +7 -0
- package/dist/esm/routes/WaitlistRoutes.d.ts +7 -0
- package/dist/esm/util/Requests.d.ts +5 -1
- package/dist/index.d.ts +813 -5
- package/package.json +2 -6
- package/src/api/Competitions.ts +483 -0
- package/src/api/Events.ts +306 -8
- package/src/api/Teams.ts +256 -0
- package/src/api/Users.ts +74 -0
- package/src/api/Waitlist.ts +78 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +7 -5
- package/src/routes/CompetitionRoute.ts +39 -0
- package/src/routes/EventsRoute.ts +18 -16
- package/src/routes/RecordingRoute.ts +16 -0
- package/src/routes/TeamsRoute.ts +26 -0
- package/src/routes/UserRoutes.ts +1 -1
- package/src/routes/WaitlistRoutes.ts +16 -0
- package/src/util/Requests.ts +54 -7
package/dist/index.d.ts
CHANGED
|
@@ -104,6 +104,378 @@ declare class Competitions {
|
|
|
104
104
|
* @returns promise
|
|
105
105
|
*/
|
|
106
106
|
static delete<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
107
|
+
/**
|
|
108
|
+
* Add a team
|
|
109
|
+
*
|
|
110
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/addTeam
|
|
111
|
+
*
|
|
112
|
+
* @param competition_id
|
|
113
|
+
* @param team_id
|
|
114
|
+
* @returns promise
|
|
115
|
+
*/
|
|
116
|
+
static addTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
|
|
117
|
+
/**
|
|
118
|
+
* Adds participant
|
|
119
|
+
*
|
|
120
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/addParticipant
|
|
121
|
+
*
|
|
122
|
+
* @param competition_id
|
|
123
|
+
* @param user_id
|
|
124
|
+
* @returns promise
|
|
125
|
+
*/
|
|
126
|
+
static addParticipant<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
127
|
+
/**
|
|
128
|
+
* Register a team
|
|
129
|
+
*
|
|
130
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/registerTeam
|
|
131
|
+
*
|
|
132
|
+
* @param competition_id
|
|
133
|
+
* @param team_id
|
|
134
|
+
* @returns promise
|
|
135
|
+
*/
|
|
136
|
+
static registerTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
|
|
137
|
+
/**
|
|
138
|
+
* Register a user
|
|
139
|
+
*
|
|
140
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/registerParticipant
|
|
141
|
+
*
|
|
142
|
+
* @param competition_id
|
|
143
|
+
* @returns promise
|
|
144
|
+
*/
|
|
145
|
+
static registerUser<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
146
|
+
/**
|
|
147
|
+
* Sync rounds
|
|
148
|
+
*
|
|
149
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/syncRounds
|
|
150
|
+
*
|
|
151
|
+
* @param competition_id
|
|
152
|
+
* @param number_of_competitors
|
|
153
|
+
* @param competitors_per_bracket
|
|
154
|
+
* @returns promise
|
|
155
|
+
*/
|
|
156
|
+
static syncRounds<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
157
|
+
/**
|
|
158
|
+
* auto generate team brackets
|
|
159
|
+
*
|
|
160
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/autoGenerateTeamBrackets
|
|
161
|
+
*
|
|
162
|
+
* @param competition_id
|
|
163
|
+
* @param round_id
|
|
164
|
+
* @returns promise
|
|
165
|
+
*/
|
|
166
|
+
static autoGenerate<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
|
|
167
|
+
/**
|
|
168
|
+
* auto generate user brackets
|
|
169
|
+
*
|
|
170
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/autoGenerateUserBrackets
|
|
171
|
+
*
|
|
172
|
+
* @param competition_id
|
|
173
|
+
* @returns promise
|
|
174
|
+
*/
|
|
175
|
+
static autoGenerateUserBrackets<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
176
|
+
/**
|
|
177
|
+
* Upload main image
|
|
178
|
+
*
|
|
179
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
|
|
180
|
+
*
|
|
181
|
+
* @param competition_id
|
|
182
|
+
* @param image
|
|
183
|
+
* @returns promise
|
|
184
|
+
*/
|
|
185
|
+
static uploadMainImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>;
|
|
186
|
+
/**
|
|
187
|
+
* Upload banner image
|
|
188
|
+
*
|
|
189
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
|
|
190
|
+
*
|
|
191
|
+
* @param competition_id
|
|
192
|
+
* @param image
|
|
193
|
+
* @returns promise
|
|
194
|
+
*/
|
|
195
|
+
static uploadBannerImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>;
|
|
196
|
+
/**
|
|
197
|
+
* Invites
|
|
198
|
+
*
|
|
199
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserInviteList
|
|
200
|
+
*
|
|
201
|
+
* @param competition_id
|
|
202
|
+
* @returns promise
|
|
203
|
+
*/
|
|
204
|
+
static invites<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
205
|
+
/**
|
|
206
|
+
* Sends invite
|
|
207
|
+
*
|
|
208
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionSendInvite
|
|
209
|
+
*
|
|
210
|
+
* @param competition_id
|
|
211
|
+
* @returns promise
|
|
212
|
+
*/
|
|
213
|
+
static sendInvite<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
214
|
+
/**
|
|
215
|
+
* Accept invite
|
|
216
|
+
*
|
|
217
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionAcceptInvite
|
|
218
|
+
*
|
|
219
|
+
* @param competition_id
|
|
220
|
+
* @param token
|
|
221
|
+
* @returns promise
|
|
222
|
+
*/
|
|
223
|
+
static acceptInvite<T>(competition_id: string, token: string): AxiosPromise<Response<T>>;
|
|
224
|
+
/**
|
|
225
|
+
* Round brackets
|
|
226
|
+
*
|
|
227
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundBracketList1
|
|
228
|
+
*
|
|
229
|
+
* @param competition_id
|
|
230
|
+
* @param round_id
|
|
231
|
+
* @returns promise
|
|
232
|
+
*/
|
|
233
|
+
static brackets<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
|
|
234
|
+
/**
|
|
235
|
+
* Store round brackets
|
|
236
|
+
*
|
|
237
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundBracketStorage
|
|
238
|
+
*
|
|
239
|
+
* @param competition_id
|
|
240
|
+
* @param round_id
|
|
241
|
+
* @returns promise
|
|
242
|
+
*/
|
|
243
|
+
static bracketStore<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
|
|
244
|
+
/**
|
|
245
|
+
* Show round bracket
|
|
246
|
+
*
|
|
247
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundBracketShow
|
|
248
|
+
*
|
|
249
|
+
* @param competition_id
|
|
250
|
+
* @param round_id
|
|
251
|
+
* @param bracket_id
|
|
252
|
+
* @returns promise
|
|
253
|
+
*/
|
|
254
|
+
static showBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>;
|
|
255
|
+
/**
|
|
256
|
+
* Update bracket
|
|
257
|
+
*
|
|
258
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateRoundBracket
|
|
259
|
+
*
|
|
260
|
+
* @param competition_id
|
|
261
|
+
* @param round_id
|
|
262
|
+
* @param bracket_id
|
|
263
|
+
* @returns promise
|
|
264
|
+
*/
|
|
265
|
+
static updateBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>;
|
|
266
|
+
/**
|
|
267
|
+
* Delete bracket
|
|
268
|
+
*
|
|
269
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryRoundBracket
|
|
270
|
+
*
|
|
271
|
+
* @param competition_id
|
|
272
|
+
* @param round_id
|
|
273
|
+
* @param bracket_id
|
|
274
|
+
* @returns promise
|
|
275
|
+
*/
|
|
276
|
+
static destroyBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>;
|
|
277
|
+
/**
|
|
278
|
+
* List round
|
|
279
|
+
*
|
|
280
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundList
|
|
281
|
+
*
|
|
282
|
+
* @param competition_id
|
|
283
|
+
* @returns promise
|
|
284
|
+
*/
|
|
285
|
+
static rounds<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
286
|
+
/**
|
|
287
|
+
* Create a new round for competition
|
|
288
|
+
*
|
|
289
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundStorage
|
|
290
|
+
*
|
|
291
|
+
* @param competition_id
|
|
292
|
+
* @returns promise
|
|
293
|
+
*/
|
|
294
|
+
static roundStore<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
295
|
+
/**
|
|
296
|
+
* Retrieve the information for a single round.
|
|
297
|
+
*
|
|
298
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundShow
|
|
299
|
+
*
|
|
300
|
+
* @param competition_id
|
|
301
|
+
* @param round_id
|
|
302
|
+
* @returns promise
|
|
303
|
+
*/
|
|
304
|
+
static showRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
|
|
305
|
+
/**
|
|
306
|
+
* Updating resource in storage with new information.
|
|
307
|
+
*
|
|
308
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateRound
|
|
309
|
+
*
|
|
310
|
+
* @param competition_id
|
|
311
|
+
* @param round_id
|
|
312
|
+
* @returns promise
|
|
313
|
+
*/
|
|
314
|
+
static updateRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
|
|
315
|
+
/**
|
|
316
|
+
* Deletes the round for the competition.
|
|
317
|
+
*
|
|
318
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryRound
|
|
319
|
+
*
|
|
320
|
+
* @param competition_id
|
|
321
|
+
* @param round_id
|
|
322
|
+
* @returns promise
|
|
323
|
+
*/
|
|
324
|
+
static destroyRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
|
|
325
|
+
/**
|
|
326
|
+
* Retrieve a list of teams associated with the competition.
|
|
327
|
+
*
|
|
328
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceCompetitionTeamList
|
|
329
|
+
*
|
|
330
|
+
* @param competition_id
|
|
331
|
+
* @returns promise
|
|
332
|
+
*/
|
|
333
|
+
static team<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
334
|
+
/**
|
|
335
|
+
* Associate a new team with the competition.
|
|
336
|
+
*
|
|
337
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceCompetitionTeamStorage
|
|
338
|
+
*
|
|
339
|
+
* @param competition_id
|
|
340
|
+
* @returns promise
|
|
341
|
+
*/
|
|
342
|
+
static teamStore<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
343
|
+
/**
|
|
344
|
+
* Display the contents of a single team associated with the competition.
|
|
345
|
+
*
|
|
346
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceTeamShow
|
|
347
|
+
*
|
|
348
|
+
* @param competition_id
|
|
349
|
+
* @param team
|
|
350
|
+
* @returns promise
|
|
351
|
+
*/
|
|
352
|
+
static showTeam<T>(competition_id: string, team: string): AxiosPromise<Response<T>>;
|
|
353
|
+
/**
|
|
354
|
+
* Update the team information associated with the competition.
|
|
355
|
+
*
|
|
356
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateTeam
|
|
357
|
+
*
|
|
358
|
+
* @param competition_id
|
|
359
|
+
* @param team_id
|
|
360
|
+
* @returns promise
|
|
361
|
+
*/
|
|
362
|
+
static updateTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
|
|
363
|
+
/**
|
|
364
|
+
* Removes the team from the competition.
|
|
365
|
+
*
|
|
366
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryTeam
|
|
367
|
+
*
|
|
368
|
+
* @param competition_id
|
|
369
|
+
* @param team_id
|
|
370
|
+
* @returns promise
|
|
371
|
+
*/
|
|
372
|
+
static destroyTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
|
|
373
|
+
/**
|
|
374
|
+
* List all the users associated with a competition.
|
|
375
|
+
*
|
|
376
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
|
|
377
|
+
*
|
|
378
|
+
* @param competition_id
|
|
379
|
+
* @returns promise
|
|
380
|
+
*/
|
|
381
|
+
static users<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
382
|
+
/**
|
|
383
|
+
* Associate a new users with the competition.
|
|
384
|
+
*
|
|
385
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/createCompetitionUser
|
|
386
|
+
*
|
|
387
|
+
* @param competition_id
|
|
388
|
+
* @returns promise
|
|
389
|
+
*/
|
|
390
|
+
static competitionUser<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
391
|
+
/**
|
|
392
|
+
* Show a single user by its ID.
|
|
393
|
+
*
|
|
394
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/showCompetitionUser
|
|
395
|
+
*
|
|
396
|
+
* @param competition_id
|
|
397
|
+
* @param user_id
|
|
398
|
+
* @returns promise
|
|
399
|
+
*/
|
|
400
|
+
static showCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
401
|
+
/**
|
|
402
|
+
* Update the user associated with competition.
|
|
403
|
+
*
|
|
404
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateCompetitionUser
|
|
405
|
+
*
|
|
406
|
+
* @param competition_id
|
|
407
|
+
* @param user_id
|
|
408
|
+
* @returns promise
|
|
409
|
+
*/
|
|
410
|
+
static updateCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
411
|
+
/**
|
|
412
|
+
* Remove the associated user from the competition.
|
|
413
|
+
*
|
|
414
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/removeCompetitionUser
|
|
415
|
+
*
|
|
416
|
+
* @param competition_id
|
|
417
|
+
* @param user_id
|
|
418
|
+
* @returns promise
|
|
419
|
+
*/
|
|
420
|
+
static destroyCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
421
|
+
/**
|
|
422
|
+
* List all the venues associated with a competition.
|
|
423
|
+
*
|
|
424
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/venueList
|
|
425
|
+
*
|
|
426
|
+
* @param competition_id
|
|
427
|
+
* @returns promise
|
|
428
|
+
*/
|
|
429
|
+
static venues<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
430
|
+
/**
|
|
431
|
+
* Creating a new venue.
|
|
432
|
+
*
|
|
433
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/createVenue
|
|
434
|
+
*
|
|
435
|
+
* @param competition_id
|
|
436
|
+
* @returns promise
|
|
437
|
+
*/
|
|
438
|
+
static newVenue<T>(competition_id: string): AxiosPromise<Response<T>>;
|
|
439
|
+
/**
|
|
440
|
+
* Show a single venue by its ID.
|
|
441
|
+
*
|
|
442
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/showVenue
|
|
443
|
+
*
|
|
444
|
+
* @param competition_id
|
|
445
|
+
* @param venue_id
|
|
446
|
+
* @returns promise
|
|
447
|
+
*/
|
|
448
|
+
static showVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
|
|
449
|
+
/**
|
|
450
|
+
* Update the venue.
|
|
451
|
+
*
|
|
452
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateVenue
|
|
453
|
+
*
|
|
454
|
+
* @param competition_id
|
|
455
|
+
* @param venue_id
|
|
456
|
+
* @returns promise
|
|
457
|
+
*/
|
|
458
|
+
static updateVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
|
|
459
|
+
/**
|
|
460
|
+
* Deletes the venue from the competition.
|
|
461
|
+
*
|
|
462
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/removeCompetitionVenue
|
|
463
|
+
*
|
|
464
|
+
* @param competition_id
|
|
465
|
+
* @param venue_id
|
|
466
|
+
* @returns promise
|
|
467
|
+
*/
|
|
468
|
+
static destroyVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
|
|
469
|
+
/**
|
|
470
|
+
* Upload venue main image to storage.
|
|
471
|
+
*
|
|
472
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
|
|
473
|
+
*
|
|
474
|
+
* @param competition_id
|
|
475
|
+
* @param venue_id
|
|
476
|
+
* @returns promise
|
|
477
|
+
*/
|
|
478
|
+
static uploadVenueMainImage<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
|
|
107
479
|
}
|
|
108
480
|
|
|
109
481
|
declare class Users {
|
|
@@ -164,6 +536,59 @@ declare class Users {
|
|
|
164
536
|
* @returns promise
|
|
165
537
|
*/
|
|
166
538
|
static oneTimeLoginToken<T>(): AxiosPromise<Response<T>>;
|
|
539
|
+
/**
|
|
540
|
+
* Updates the avatar image for the user using a File object.
|
|
541
|
+
*
|
|
542
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadAvatarImage
|
|
543
|
+
*
|
|
544
|
+
* @param file The file object to upload.
|
|
545
|
+
* @param data Any additional data to pass along to the upload.
|
|
546
|
+
*
|
|
547
|
+
* @returns promise
|
|
548
|
+
*/
|
|
549
|
+
static uploadAvatarImageFile<T>(file: File, data?: object): AxiosPromise<Response<T>>;
|
|
550
|
+
/**
|
|
551
|
+
* Updates the avatar image for the user using a Blob.
|
|
552
|
+
*
|
|
553
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadAvatarImage
|
|
554
|
+
*
|
|
555
|
+
* @param blob The blob to upload.
|
|
556
|
+
* @param data Any additional data to pass along to the upload
|
|
557
|
+
*
|
|
558
|
+
* @returns promise
|
|
559
|
+
*/
|
|
560
|
+
static uploadAvatarImageBlob<T>(blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
561
|
+
/**
|
|
562
|
+
* Upload a banner image for the user, as a File object.
|
|
563
|
+
*
|
|
564
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadBannerImage
|
|
565
|
+
*
|
|
566
|
+
* @param file The file object to upload.
|
|
567
|
+
* @param data Any additional data to pass along to the upload.
|
|
568
|
+
*
|
|
569
|
+
* @returns promise
|
|
570
|
+
*/
|
|
571
|
+
static uploadBannerImageFile<T>(file: File, data?: object): AxiosPromise<Response<T>>;
|
|
572
|
+
/**
|
|
573
|
+
* Upload a banner image for the user, as a Blob.
|
|
574
|
+
*
|
|
575
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadBannerImage
|
|
576
|
+
*
|
|
577
|
+
* @param file The blob to upload.
|
|
578
|
+
* @param data Any additional data to pass along to the upload.
|
|
579
|
+
*
|
|
580
|
+
* @returns promise
|
|
581
|
+
*/
|
|
582
|
+
static uploadBannerImageBlob<T>(blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
583
|
+
/**
|
|
584
|
+
* Creates a donation page for that user by syncing their information with various
|
|
585
|
+
* payment service.
|
|
586
|
+
*
|
|
587
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
|
|
588
|
+
*
|
|
589
|
+
* @returns promise
|
|
590
|
+
*/
|
|
591
|
+
static createDonationPage<T>(): AxiosPromise<Response<T>>;
|
|
167
592
|
}
|
|
168
593
|
|
|
169
594
|
declare class Events {
|
|
@@ -215,15 +640,398 @@ declare class Events {
|
|
|
215
640
|
* @returns promise
|
|
216
641
|
*/
|
|
217
642
|
static delete<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
643
|
+
/**
|
|
644
|
+
* The event is synced with Invirtu for the lie streams. This will allow you to update
|
|
645
|
+
*
|
|
646
|
+
*
|
|
647
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/updateEventStorage
|
|
648
|
+
*
|
|
649
|
+
* @param event_id The id of the event to update.
|
|
650
|
+
* @param data The data to update.
|
|
651
|
+
*
|
|
652
|
+
* @returns promise
|
|
653
|
+
*/
|
|
654
|
+
static updateInvirtuEvent<T>(event_id: string, data: object): AxiosPromise<Response<T>>;
|
|
655
|
+
/**
|
|
656
|
+
* Add an RTMP source to multicast a stream too.
|
|
657
|
+
*
|
|
658
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/addRTMPSource
|
|
659
|
+
*
|
|
660
|
+
* @param event_id The id of the event.
|
|
661
|
+
* @param data The data to be passed when adding an RTMP source.
|
|
662
|
+
*
|
|
663
|
+
* @returns promise
|
|
664
|
+
*/
|
|
665
|
+
static addRTMPSource<T>(event_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
666
|
+
/**
|
|
667
|
+
* Update an RTMP Source for multicasing.
|
|
668
|
+
*
|
|
669
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/addRTMPSource
|
|
670
|
+
*
|
|
671
|
+
* @param event_id The id of the event.
|
|
672
|
+
* @param data The data to be passed when adding an RTMP source.
|
|
673
|
+
*
|
|
674
|
+
* @returns promise
|
|
675
|
+
*/
|
|
676
|
+
static updateRTMPSource<T>(event_id: string, stream_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
677
|
+
/**
|
|
678
|
+
* Remove a RTMP source for multicasing.
|
|
679
|
+
*
|
|
680
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/addRTMPSource
|
|
681
|
+
*
|
|
682
|
+
* @param event_id The id of the event.
|
|
683
|
+
* @param data The data to be passed when adding an RTMP source.
|
|
684
|
+
*
|
|
685
|
+
* @returns promise
|
|
686
|
+
*/
|
|
687
|
+
static removeRTMPSource<T>(event_id: string, stream_id: string): AxiosPromise<Response<T>>;
|
|
688
|
+
/**
|
|
689
|
+
* A function that should be run on an interval to set the event as live when the live stream is active.
|
|
690
|
+
*
|
|
691
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/syncLive
|
|
692
|
+
*
|
|
693
|
+
* @param event_id The id of the event.
|
|
694
|
+
*
|
|
695
|
+
* @returns promise
|
|
696
|
+
*/
|
|
697
|
+
static syncAsLive<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
698
|
+
/**
|
|
699
|
+
* Updates the main image for the event using a File object.
|
|
700
|
+
*
|
|
701
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadMainEventImage
|
|
702
|
+
*
|
|
703
|
+
* @param file The file object to upload.
|
|
704
|
+
* @param data Any additional data to pass along to the upload.
|
|
705
|
+
*
|
|
706
|
+
* @returns promise
|
|
707
|
+
*/
|
|
708
|
+
static uploadMainImageFile<T>(event_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
709
|
+
/**
|
|
710
|
+
* Updates the main image for the event using a Blob.
|
|
711
|
+
*
|
|
712
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadMainEventImage
|
|
713
|
+
*
|
|
714
|
+
* @param blob The blob to upload.
|
|
715
|
+
* @param data Any additional data to pass along to the upload
|
|
716
|
+
*
|
|
717
|
+
* @returns promise
|
|
718
|
+
*/
|
|
719
|
+
static uploadMainImageBlob<T>(event_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
720
|
+
/**
|
|
721
|
+
* Updates the banner image for the team using a File object.
|
|
722
|
+
*
|
|
723
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
|
|
724
|
+
*
|
|
725
|
+
* @param file The file object to upload.
|
|
726
|
+
* @param data Any additional data to pass along to the upload.
|
|
727
|
+
*
|
|
728
|
+
* @returns promise
|
|
729
|
+
*/
|
|
730
|
+
static uploadBannerImageFile<T>(event_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
731
|
+
/**
|
|
732
|
+
* Updates the banner image for the team using a Blob.
|
|
733
|
+
*
|
|
734
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
|
|
735
|
+
*
|
|
736
|
+
* @param blob The blob to upload.
|
|
737
|
+
* @param data Any additional data to pass along to the upload
|
|
738
|
+
*
|
|
739
|
+
* @returns promise
|
|
740
|
+
*/
|
|
741
|
+
static uploadBannerImageBlob<T>(event_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
742
|
+
/**
|
|
743
|
+
* Enable Broadcast Mode. Broadcast mode is when the live stream is broadcasted from the game play through a protocol
|
|
744
|
+
* such as screen sharing.
|
|
745
|
+
*
|
|
746
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/enableBroadcastMode
|
|
747
|
+
*
|
|
748
|
+
* @param event_id The id of the event.
|
|
749
|
+
*
|
|
750
|
+
* @returns promise
|
|
751
|
+
*/
|
|
752
|
+
static enableBroadcastMode<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
753
|
+
/**
|
|
754
|
+
* Enable livestream mode, in which the stream will be delivered to the invirtu RTMP endpoint for
|
|
755
|
+
* streaming.
|
|
756
|
+
*
|
|
757
|
+
* @param event_id The id of the event.
|
|
758
|
+
*
|
|
759
|
+
* @returns promise
|
|
760
|
+
*/
|
|
761
|
+
static enableLivestreamMode<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
762
|
+
/**
|
|
763
|
+
* Sends content that will appear on-screen to the user.
|
|
764
|
+
*
|
|
765
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/sendOnScreenContent
|
|
766
|
+
*
|
|
767
|
+
* @param event_id The id of the event.
|
|
768
|
+
* @param data The information to send on-screen.
|
|
769
|
+
*
|
|
770
|
+
* @returns promise
|
|
771
|
+
*/
|
|
772
|
+
static sendOnScreenContent<T>(event_id: string, data: object): AxiosPromise<Response<T>>;
|
|
773
|
+
/**
|
|
774
|
+
* Uploads an image that can be used and overlay later. A File object is used.
|
|
775
|
+
*
|
|
776
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadOverlayImage
|
|
777
|
+
*
|
|
778
|
+
* @param event_id The id of the event.
|
|
779
|
+
* @param file The image as a file.
|
|
780
|
+
* @param data Any additional data to be sent in the request.
|
|
781
|
+
*
|
|
782
|
+
* @returns promise
|
|
783
|
+
*/
|
|
784
|
+
static addOverlayAsFile<T>(event_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
785
|
+
/**
|
|
786
|
+
* Uploads an image that can be used and overlay later. A blob is used.
|
|
787
|
+
*
|
|
788
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadOverlayImage
|
|
789
|
+
*
|
|
790
|
+
* @param event_id The id of the event.
|
|
791
|
+
* @param blob Image data as a blob
|
|
792
|
+
* @param data Any additional data to be sent in the request.
|
|
793
|
+
*
|
|
794
|
+
* @returns promise
|
|
795
|
+
*/
|
|
796
|
+
static addOverlayAsBlob<T>(event_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
797
|
+
/**
|
|
798
|
+
* Deletes an overlay image.
|
|
799
|
+
*
|
|
800
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/destoryOverlayStorage
|
|
801
|
+
*
|
|
802
|
+
* @param event_id The id of the event.
|
|
803
|
+
* @param overlay_id The id of the overlay.
|
|
804
|
+
*
|
|
805
|
+
* @returns promise
|
|
806
|
+
*/
|
|
807
|
+
static removeOverlay<T>(event_id: string, overlay_id: string): AxiosPromise<Response<T>>;
|
|
808
|
+
/**
|
|
809
|
+
* Enables an overlay so that it will appear on screen.
|
|
810
|
+
*
|
|
811
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/enableOverlayImage
|
|
812
|
+
*
|
|
813
|
+
* @param event_id The id of the event.
|
|
814
|
+
* @param overlay_id The id of the overlay.
|
|
815
|
+
*
|
|
816
|
+
* @returns promise
|
|
817
|
+
*/
|
|
818
|
+
static enableOverlay<T>(event_id: string, overlay_id: string): AxiosPromise<Response<T>>;
|
|
819
|
+
/**
|
|
820
|
+
* Disables the overlay so it no longer appears on-screen.
|
|
821
|
+
*
|
|
822
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/disableOverlay
|
|
823
|
+
*
|
|
824
|
+
* @param event_id The id of the event.
|
|
825
|
+
*
|
|
826
|
+
* @returns promise
|
|
827
|
+
*/
|
|
828
|
+
static disableOverlay<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
829
|
+
/**
|
|
830
|
+
* Enable the donations to appear on-screen
|
|
831
|
+
*
|
|
832
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/enableDonations
|
|
833
|
+
*
|
|
834
|
+
* @param event_id The id of the event.
|
|
835
|
+
*
|
|
836
|
+
* @returns promise
|
|
837
|
+
*/
|
|
838
|
+
static enableDonations<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
839
|
+
/**
|
|
840
|
+
* Disable the donations and remove from the screen.
|
|
841
|
+
*
|
|
842
|
+
* @param event_id
|
|
843
|
+
* @returns
|
|
844
|
+
*/
|
|
845
|
+
static disableDonations<T>(event_id: string): AxiosPromise<Response<T>>;
|
|
846
|
+
static sendInvite<T>(event_id: string, data: object): AxiosPromise<Response<T>>;
|
|
847
|
+
static acceptInvite<T>(event_id: string, token: string): AxiosPromise<Response<T>>;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
declare class Teams {
|
|
851
|
+
/**
|
|
852
|
+
* List all the teams
|
|
853
|
+
*
|
|
854
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamsList
|
|
855
|
+
*
|
|
856
|
+
* @returns promise
|
|
857
|
+
*/
|
|
858
|
+
static list<T>(): AxiosPromise<Response<T>>;
|
|
859
|
+
/**
|
|
860
|
+
* Create a new team.
|
|
861
|
+
*
|
|
862
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamCreate
|
|
863
|
+
*
|
|
864
|
+
* @param data The data to be passed when creating a team.
|
|
865
|
+
*
|
|
866
|
+
* @returns Promise
|
|
867
|
+
*/
|
|
868
|
+
static create<T>(data: object): AxiosPromise<Response<T>>;
|
|
869
|
+
/**
|
|
870
|
+
* Update a team.
|
|
871
|
+
*
|
|
872
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUpdate
|
|
873
|
+
*
|
|
874
|
+
* @param team_id The id of the team to update.
|
|
875
|
+
* @param data The data to update.
|
|
876
|
+
*
|
|
877
|
+
* @returns promise
|
|
878
|
+
*/
|
|
879
|
+
static update<T>(team_id: string, data: object): AxiosPromise<Response<T>>;
|
|
880
|
+
/**
|
|
881
|
+
* Retrieve the information for a single team.
|
|
882
|
+
*
|
|
883
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamShow
|
|
884
|
+
*
|
|
885
|
+
* @param team_id The id fo the team to retrieve.
|
|
886
|
+
*
|
|
887
|
+
* @returns promise
|
|
888
|
+
*/
|
|
889
|
+
static view<T>(team_id: string): AxiosPromise<Response<T>>;
|
|
890
|
+
/**
|
|
891
|
+
* Deletes a team.
|
|
892
|
+
*
|
|
893
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamDelete
|
|
894
|
+
*
|
|
895
|
+
* @param team_id The id of the team to delete.
|
|
896
|
+
* @returns promise
|
|
897
|
+
*/
|
|
898
|
+
static delete<T>(team_id: string): AxiosPromise<Response<T>>;
|
|
899
|
+
/**
|
|
900
|
+
* Updates the main image for the team using a File object.
|
|
901
|
+
*
|
|
902
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUploadMainImage
|
|
903
|
+
*
|
|
904
|
+
* @param file The file object to upload.
|
|
905
|
+
* @param data Any additional data to pass along to the upload.
|
|
906
|
+
*
|
|
907
|
+
* @returns promise
|
|
908
|
+
*/
|
|
909
|
+
static uploadMainImageFile<T>(team_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
910
|
+
/**
|
|
911
|
+
* Updates the main image for the team using a Blob.
|
|
912
|
+
*
|
|
913
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUploadMainImage
|
|
914
|
+
*
|
|
915
|
+
* @param blob The blob to upload.
|
|
916
|
+
* @param data Any additional data to pass along to the upload
|
|
917
|
+
*
|
|
918
|
+
* @returns promise
|
|
919
|
+
*/
|
|
920
|
+
static uploadMainImageBlob<T>(team_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
921
|
+
/**
|
|
922
|
+
* Updates the banner image for the team using a File object.
|
|
923
|
+
*
|
|
924
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUploadMainImage
|
|
925
|
+
*
|
|
926
|
+
* @param file The file object to upload.
|
|
927
|
+
* @param data Any additional data to pass along to the upload.
|
|
928
|
+
*
|
|
929
|
+
* @returns promise
|
|
930
|
+
*/
|
|
931
|
+
static uploadBannerImageFile<T>(team_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
932
|
+
/**
|
|
933
|
+
* Updates the banner image for the team using a Blob.
|
|
934
|
+
*
|
|
935
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUploadMainImage
|
|
936
|
+
*
|
|
937
|
+
* @param blob The blob to upload.
|
|
938
|
+
* @param data Any additional data to pass along to the upload
|
|
939
|
+
*
|
|
940
|
+
* @returns promise
|
|
941
|
+
*/
|
|
942
|
+
static uploadBannerImageBlob<T>(team_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
943
|
+
/**
|
|
944
|
+
* List the invites that have been sent for the team to users.
|
|
945
|
+
*
|
|
946
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamsUserInviteList
|
|
947
|
+
*
|
|
948
|
+
* @param team_id The id of the team
|
|
949
|
+
*
|
|
950
|
+
* @returns promise
|
|
951
|
+
*/
|
|
952
|
+
static listInvites<T>(team_id: string): AxiosPromise<Response<T>>;
|
|
953
|
+
/**
|
|
954
|
+
* Send an invitation to a user to join the team.
|
|
955
|
+
*
|
|
956
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamSendInvite
|
|
957
|
+
*
|
|
958
|
+
* @param team_id The id of the team.
|
|
959
|
+
* @param data The data that will be passed into sending an invite.
|
|
960
|
+
*
|
|
961
|
+
* @returns promise
|
|
962
|
+
*/
|
|
963
|
+
static sendInvite<T>(team_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
964
|
+
/**
|
|
965
|
+
* Accept an invite to a team. The JSON Web Token (JWT) must be related to the token.
|
|
966
|
+
*
|
|
967
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamAcceptInvite
|
|
968
|
+
*
|
|
969
|
+
* @param team_id The id of the team
|
|
970
|
+
* @param token The token required to accept the user.
|
|
971
|
+
*
|
|
972
|
+
* @returns promise
|
|
973
|
+
*/
|
|
974
|
+
static acceptInvite<T>(team_id: string, token: string): AxiosPromise<Response<T>>;
|
|
975
|
+
/**
|
|
976
|
+
* List the users who are currently associated with the team.
|
|
977
|
+
*
|
|
978
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUserList
|
|
979
|
+
*
|
|
980
|
+
* @param team_id The id of the team.
|
|
981
|
+
*
|
|
982
|
+
* @returns promise
|
|
983
|
+
*/
|
|
984
|
+
static listUsers<T>(team_id: string): AxiosPromise<Response<T>>;
|
|
985
|
+
/**
|
|
986
|
+
* Add a user to a team.
|
|
987
|
+
*
|
|
988
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/createTeamUser
|
|
989
|
+
*
|
|
990
|
+
* @param team_id The id of the team.
|
|
991
|
+
* @param data The data to be passed when adding a user.
|
|
992
|
+
*
|
|
993
|
+
* @returns promise
|
|
994
|
+
*/
|
|
995
|
+
static addUser<T>(team_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
996
|
+
/**
|
|
997
|
+
* Retrieves a single user and their information that is associated with a team.
|
|
998
|
+
*
|
|
999
|
+
* @see https://api.glitch.fun/api/documentation#/Teams%20Route/showTeamUser
|
|
1000
|
+
*
|
|
1001
|
+
* @param team_id The id of the team.
|
|
1002
|
+
* @param user_id The id of the user.
|
|
1003
|
+
*
|
|
1004
|
+
* @returns promise
|
|
1005
|
+
*/
|
|
1006
|
+
static getUser<T>(team_id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
1007
|
+
/**
|
|
1008
|
+
* Updates the users information associated with the team.
|
|
1009
|
+
*
|
|
1010
|
+
* @param team_id The id of the team.
|
|
1011
|
+
* @param user_id The id of the user.
|
|
1012
|
+
*
|
|
1013
|
+
* @returns promise
|
|
1014
|
+
*/
|
|
1015
|
+
static updatetUser<T>(team_id: string, user_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Removes a user from a team.
|
|
1018
|
+
*
|
|
1019
|
+
* @param team_id The id of team.
|
|
1020
|
+
* @param user_id The id of the user.
|
|
1021
|
+
*
|
|
1022
|
+
* @returns promise
|
|
1023
|
+
*/
|
|
1024
|
+
static removetUser<T>(team_id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
218
1025
|
}
|
|
219
1026
|
|
|
220
1027
|
declare class Glitch {
|
|
221
|
-
static config:
|
|
1028
|
+
static config: Config;
|
|
222
1029
|
static api: {
|
|
223
|
-
Auth:
|
|
224
|
-
Competitions:
|
|
225
|
-
Users:
|
|
226
|
-
Events:
|
|
1030
|
+
Auth: Auth;
|
|
1031
|
+
Competitions: Competitions;
|
|
1032
|
+
Users: Users;
|
|
1033
|
+
Events: Events;
|
|
1034
|
+
Teams: Teams;
|
|
227
1035
|
};
|
|
228
1036
|
}
|
|
229
1037
|
|