glitch-javascript-sdk 0.1.8 → 0.2.0

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/index.d.ts CHANGED
@@ -228,25 +228,49 @@ declare class Competitions {
228
228
  */
229
229
  static autoGenerateUserBrackets<T>(competition_id: string): AxiosPromise<Response<T>>;
230
230
  /**
231
- * Upload main image
231
+ * Updates the main image for the event using a File object.
232
+ *
233
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
234
+ *
235
+ * @param file The file object to upload.
236
+ * @param data Any additional data to pass along to the upload.
237
+ *
238
+ * @returns promise
239
+ */
240
+ static uploadCompetitionMainImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
241
+ /**
242
+ * Updates the main image for the competition using a Blob.
232
243
  *
233
244
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
234
245
  *
235
- * @param competition_id
236
- * @param image
246
+ * @param blob The blob to upload.
247
+ * @param data Any additional data to pass along to the upload
248
+ *
237
249
  * @returns promise
238
250
  */
239
- static uploadMainImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>;
251
+ static uploadCompetitionMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
240
252
  /**
241
- * Upload banner image
253
+ * Updates the banner image for the competition using a File object.
242
254
  *
243
255
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
244
256
  *
245
- * @param competition_id
246
- * @param image
257
+ * @param file The file object to upload.
258
+ * @param data Any additional data to pass along to the upload.
259
+ *
247
260
  * @returns promise
248
261
  */
249
- static uploadBannerImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>;
262
+ static uploadCompetitionBannerImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
263
+ /**
264
+ * Updates the banner image for the competition using a Blob.
265
+ *
266
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
267
+ *
268
+ * @param blob The blob to upload.
269
+ * @param data Any additional data to pass along to the upload
270
+ *
271
+ * @returns promise
272
+ */
273
+ static uploadCompetitionsBannerImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
250
274
  /**
251
275
  * Invites
252
276
  *
@@ -294,7 +318,7 @@ declare class Competitions {
294
318
  * @param round_id
295
319
  * @returns promise
296
320
  */
297
- static bracketStore<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
321
+ static createBracket<T>(competition_id: string, round_id: number, data?: object): AxiosPromise<Response<T>>;
298
322
  /**
299
323
  * Show round bracket
300
324
  *
@@ -316,7 +340,7 @@ declare class Competitions {
316
340
  * @param bracket_id
317
341
  * @returns promise
318
342
  */
319
- static updateBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>;
343
+ static updateBracket<T>(competition_id: string, round_id: number, bracket_id: number, data?: object): AxiosPromise<Response<T>>;
320
344
  /**
321
345
  * Delete bracket
322
346
  *
@@ -345,7 +369,7 @@ declare class Competitions {
345
369
  * @param competition_id
346
370
  * @returns promise
347
371
  */
348
- static roundStore<T>(competition_id: string): AxiosPromise<Response<T>>;
372
+ static createRound<T>(competition_id: string, data?: object): AxiosPromise<Response<T>>;
349
373
  /**
350
374
  * Retrieve the information for a single round.
351
375
  *
@@ -365,7 +389,7 @@ declare class Competitions {
365
389
  * @param round_id
366
390
  * @returns promise
367
391
  */
368
- static updateRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
392
+ static updateRound<T>(competition_id: string, round_id: number, data?: object): AxiosPromise<Response<T>>;
369
393
  /**
370
394
  * Deletes the round for the competition.
371
395
  *
@@ -393,17 +417,17 @@ declare class Competitions {
393
417
  * @param competition_id
394
418
  * @returns promise
395
419
  */
396
- static teamStore<T>(competition_id: string): AxiosPromise<Response<T>>;
420
+ static createCompetitionTeam<T>(competition_id: string, data?: object): AxiosPromise<Response<T>>;
397
421
  /**
398
422
  * Display the contents of a single team associated with the competition.
399
423
  *
400
424
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceTeamShow
401
425
  *
402
- * @param competition_id
403
- * @param team
426
+ * @param competition_id The id of the competition
427
+ * @param team_id The id of the team
404
428
  * @returns promise
405
429
  */
406
- static showTeam<T>(competition_id: string, team: string): AxiosPromise<Response<T>>;
430
+ static showTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
407
431
  /**
408
432
  * Update the team information associated with the competition.
409
433
  *
@@ -413,7 +437,7 @@ declare class Competitions {
413
437
  * @param team_id
414
438
  * @returns promise
415
439
  */
416
- static updateTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
440
+ static updateTeam<T>(competition_id: string, team_id: string, data?: object): AxiosPromise<Response<T>>;
417
441
  /**
418
442
  * Removes the team from the competition.
419
443
  *
@@ -441,7 +465,7 @@ declare class Competitions {
441
465
  * @param competition_id
442
466
  * @returns promise
443
467
  */
444
- static competitionUser<T>(competition_id: string): AxiosPromise<Response<T>>;
468
+ static createCompetitionUser<T>(competition_id: string, data?: object): AxiosPromise<Response<T>>;
445
469
  /**
446
470
  * Show a single user by its ID.
447
471
  *
@@ -461,7 +485,7 @@ declare class Competitions {
461
485
  * @param user_id
462
486
  * @returns promise
463
487
  */
464
- static updateCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
488
+ static updateCompetitionUser<T>(competition_id: string, user_id: string, data?: object): AxiosPromise<Response<T>>;
465
489
  /**
466
490
  * Remove the associated user from the competition.
467
491
  *
@@ -489,7 +513,7 @@ declare class Competitions {
489
513
  * @param competition_id
490
514
  * @returns promise
491
515
  */
492
- static newVenue<T>(competition_id: string): AxiosPromise<Response<T>>;
516
+ static createVenue<T>(competition_id: string, data: object): AxiosPromise<Response<T>>;
493
517
  /**
494
518
  * Show a single venue by its ID.
495
519
  *
@@ -509,7 +533,7 @@ declare class Competitions {
509
533
  * @param venue_id
510
534
  * @returns promise
511
535
  */
512
- static updateVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
536
+ static updateVenue<T>(competition_id: string, venue_id: string, data: object): AxiosPromise<Response<T>>;
513
537
  /**
514
538
  * Deletes the venue from the competition.
515
539
  *
@@ -521,15 +545,27 @@ declare class Competitions {
521
545
  */
522
546
  static destroyVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
523
547
  /**
524
- * Upload venue main image to storage.
548
+ * Updates the main image for the venue using a File object.
549
+ *
550
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
551
+ *
552
+ * @param file The file object to upload.
553
+ * @param data Any additional data to pass along to the upload.
554
+ *
555
+ * @returns promise
556
+ */
557
+ static uploadVenueMainImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
558
+ /**
559
+ * Updates the main image for the venue using a Blob.
525
560
  *
526
561
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
527
562
  *
528
- * @param competition_id
529
- * @param venue_id
563
+ * @param blob The blob to upload.
564
+ * @param data Any additional data to pass along to the upload
565
+ *
530
566
  * @returns promise
531
567
  */
532
- static uploadVenueMainImage<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
568
+ static uploadVenueMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
533
569
  }
534
570
 
535
571
  declare class Users {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -42,7 +42,7 @@ class Competitions {
42
42
  */
43
43
  public static update<T>(competition_id : string, data : object) : AxiosPromise<Response<T>>{
44
44
 
45
- return Requests.processRoute(CompetitionRoutes.routes.create, data, {competition_id : competition_id});
45
+ return Requests.processRoute(CompetitionRoutes.routes.update, data, {competition_id : competition_id});
46
46
  }
47
47
 
48
48
  /**
@@ -120,7 +120,7 @@ class Competitions {
120
120
  * @returns promise
121
121
  */
122
122
  public static registerUser<T>(competition_id : string) : AxiosPromise<Response<T>>{
123
- return Requests.processRoute(CompetitionRoutes.routes.registerUser, {competition_id : competition_id});
123
+ return Requests.processRoute(CompetitionRoutes.routes.registerUser, {}, {competition_id : competition_id});
124
124
  }
125
125
 
126
126
  /**
@@ -147,7 +147,7 @@ class Competitions {
147
147
  * @returns promise
148
148
  */
149
149
  public static autoGenerate<T>(competition_id : string, round_id : number) : AxiosPromise<Response<T>>{
150
- return Requests.processRoute(CompetitionRoutes.routes.autoGenerate, {round_id : round_id}, {competition_id : competition_id});
150
+ return Requests.processRoute(CompetitionRoutes.routes.autoGenerate, {}, {competition_id : competition_id, round_id : round_id});
151
151
  }
152
152
 
153
153
  /**
@@ -159,33 +159,75 @@ class Competitions {
159
159
  * @returns promise
160
160
  */
161
161
  public static autoGenerateUserBrackets<T>(competition_id : string) : AxiosPromise<Response<T>>{
162
- return Requests.processRoute(CompetitionRoutes.routes.autoGenerateUserBrackets, {competition_id : competition_id});
162
+ return Requests.processRoute(CompetitionRoutes.routes.autoGenerateUserBrackets, {}, {competition_id : competition_id});
163
163
  }
164
164
 
165
165
  /**
166
- * Upload main image
166
+ * Updates the main image for the event using a File object.
167
+ *
168
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
169
+ *
170
+ * @param file The file object to upload.
171
+ * @param data Any additional data to pass along to the upload.
172
+ *
173
+ * @returns promise
174
+ */
175
+ public static uploadCompetitionMainImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>> {
176
+
177
+ let url = CompetitionRoutes.routes.uploadMainImage.url.replace('{competition_id}', competition_id);
178
+
179
+ return Requests.uploadFile(url, 'image', file, data);
180
+ }
181
+
182
+ /**
183
+ * Updates the main image for the competition using a Blob.
167
184
  *
168
185
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
169
186
  *
170
- * @param competition_id
171
- * @param image
187
+ * @param blob The blob to upload.
188
+ * @param data Any additional data to pass along to the upload
189
+ *
172
190
  * @returns promise
173
191
  */
174
- public static uploadMainImage<T>(competition_id : string, image : string) : AxiosPromise<Response<T>>{
175
- return Requests.processRoute(CompetitionRoutes.routes.uploadMainImage, {competition_id : competition_id}, {image : image});
192
+ public static uploadCompetitionMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>> {
193
+
194
+ let url = CompetitionRoutes.routes.uploadMainImage.url.replace('{competition_id}', competition_id);
195
+
196
+ return Requests.uploadBlob(url, 'image', blob, data);
176
197
  }
177
198
 
178
199
  /**
179
- * Upload banner image
200
+ * Updates the banner image for the competition using a File object.
180
201
  *
181
202
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
182
203
  *
183
- * @param competition_id
184
- * @param image
204
+ * @param file The file object to upload.
205
+ * @param data Any additional data to pass along to the upload.
206
+ *
185
207
  * @returns promise
186
208
  */
187
- public static uploadBannerImage<T>(competition_id : string, image : string) : AxiosPromise<Response<T>>{
188
- return Requests.processRoute(CompetitionRoutes.routes.uploadBannerImage, {competition_id : competition_id}, {image : image});
209
+ public static uploadCompetitionBannerImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>> {
210
+
211
+ let url = CompetitionRoutes.routes.uploadBannerImage.url.replace('{competition_id}', competition_id);
212
+
213
+ return Requests.uploadFile(url, 'image', file, data);
214
+ }
215
+
216
+ /**
217
+ * Updates the banner image for the competition using a Blob.
218
+ *
219
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
220
+ *
221
+ * @param blob The blob to upload.
222
+ * @param data Any additional data to pass along to the upload
223
+ *
224
+ * @returns promise
225
+ */
226
+ public static uploadCompetitionsBannerImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>> {
227
+
228
+ let url = CompetitionRoutes.routes.uploadBannerImage.url.replace('{competition_id}', competition_id);
229
+
230
+ return Requests.uploadBlob(url, 'image', blob, data);
189
231
  }
190
232
 
191
233
  /**
@@ -197,7 +239,7 @@ class Competitions {
197
239
  * @returns promise
198
240
  */
199
241
  public static invites<T>(competition_id : string) : AxiosPromise<Response<T>>{
200
- return Requests.processRoute(CompetitionRoutes.routes.invites, {competition_id : competition_id});
242
+ return Requests.processRoute(CompetitionRoutes.routes.invites, {}, {competition_id : competition_id});
201
243
  }
202
244
 
203
245
  /**
@@ -209,7 +251,7 @@ class Competitions {
209
251
  * @returns promise
210
252
  */
211
253
  public static sendInvite<T>(competition_id : string) : AxiosPromise<Response<T>>{
212
- return Requests.processRoute(CompetitionRoutes.routes.sendInvite, {competition_id : competition_id});
254
+ return Requests.processRoute(CompetitionRoutes.routes.sendInvite, {}, {competition_id : competition_id});
213
255
  }
214
256
 
215
257
  /**
@@ -222,7 +264,7 @@ class Competitions {
222
264
  * @returns promise
223
265
  */
224
266
  public static acceptInvite<T>(competition_id : string, token : string): AxiosPromise<Response<T>>{
225
- return Requests.processRoute(CompetitionRoutes.routes.acceptInvite, {competition_id : competition_id}, {token : token});
267
+ return Requests.processRoute(CompetitionRoutes.routes.acceptInvite, {token : token}, {competition_id : competition_id});
226
268
  }
227
269
 
228
270
  /**
@@ -235,7 +277,7 @@ class Competitions {
235
277
  * @returns promise
236
278
  */
237
279
  public static brackets<T>(competition_id : string, round_id : number): AxiosPromise<Response<T>>{
238
- return Requests.processRoute(CompetitionRoutes.routes.brackets, {competition_id : competition_id}, {round_id : round_id});
280
+ return Requests.processRoute(CompetitionRoutes.routes.brackets, {}, {round_id : round_id, competition_id : competition_id});
239
281
  }
240
282
 
241
283
  /**
@@ -247,8 +289,8 @@ class Competitions {
247
289
  * @param round_id
248
290
  * @returns promise
249
291
  */
250
- public static bracketStore<T>(competition_id : string, round_id : number): AxiosPromise<Response<T>>{
251
- return Requests.processRoute(CompetitionRoutes.routes.bracketStore, {competition_id : competition_id}, {round_id : round_id});
292
+ public static createBracket<T>(competition_id : string, round_id : number, data?: object): AxiosPromise<Response<T>>{
293
+ return Requests.processRoute(CompetitionRoutes.routes.bracketStore, data, {round_id : round_id, competition_id : competition_id});
252
294
  }
253
295
 
254
296
  /**
@@ -262,7 +304,7 @@ class Competitions {
262
304
  * @returns promise
263
305
  */
264
306
  public static showBracket<T>(competition_id : string, round_id : number, bracket_id : number): AxiosPromise<Response<T>>{
265
- return Requests.processRoute(CompetitionRoutes.routes.showBracket, {competition_id : competition_id}, {round_id : round_id, bracket_id : bracket_id});
307
+ return Requests.processRoute(CompetitionRoutes.routes.showBracket, {}, {round_id : round_id, bracket_id : bracket_id, competition_id : competition_id});
266
308
  }
267
309
 
268
310
  /**
@@ -275,8 +317,8 @@ class Competitions {
275
317
  * @param bracket_id
276
318
  * @returns promise
277
319
  */
278
- public static updateBracket<T>(competition_id : string, round_id : number, bracket_id : number): AxiosPromise<Response<T>>{
279
- return Requests.processRoute(CompetitionRoutes.routes.updateBracket, {competition_id : competition_id}, {round_id : round_id, bracket_id : bracket_id});
320
+ public static updateBracket<T>(competition_id : string, round_id : number, bracket_id : number, data?: object): AxiosPromise<Response<T>>{
321
+ return Requests.processRoute(CompetitionRoutes.routes.updateBracket, data, {round_id : round_id, bracket_id : bracket_id, competition_id : competition_id});
280
322
  }
281
323
 
282
324
  /**
@@ -290,7 +332,7 @@ class Competitions {
290
332
  * @returns promise
291
333
  */
292
334
  public static destroyBracket<T>(competition_id : string, round_id : number, bracket_id : number): AxiosPromise<Response<T>>{
293
- return Requests.processRoute(CompetitionRoutes.routes.destroyBracket, {competition_id : competition_id}, {round_id : round_id, bracket_id : bracket_id});
335
+ return Requests.processRoute(CompetitionRoutes.routes.destroyBracket, {}, {round_id : round_id, bracket_id : bracket_id, competition_id : competition_id});
294
336
  }
295
337
 
296
338
  /**
@@ -302,7 +344,7 @@ class Competitions {
302
344
  * @returns promise
303
345
  */
304
346
  public static rounds<T>(competition_id : string): AxiosPromise<Response<T>>{
305
- return Requests.processRoute(CompetitionRoutes.routes.rounds, {competition_id : competition_id});
347
+ return Requests.processRoute(CompetitionRoutes.routes.rounds, {}, {competition_id : competition_id});
306
348
  }
307
349
 
308
350
  /**
@@ -313,8 +355,8 @@ class Competitions {
313
355
  * @param competition_id
314
356
  * @returns promise
315
357
  */
316
- public static roundStore<T>(competition_id : string): AxiosPromise<Response<T>>{
317
- return Requests.processRoute(CompetitionRoutes.routes.roundStore, {competition_id : competition_id});
358
+ public static createRound<T>(competition_id : string, data?: object): AxiosPromise<Response<T>>{
359
+ return Requests.processRoute(CompetitionRoutes.routes.roundStore, data, {competition_id : competition_id});
318
360
  }
319
361
 
320
362
  /**
@@ -327,7 +369,7 @@ class Competitions {
327
369
  * @returns promise
328
370
  */
329
371
  public static showRound<T>(competition_id : string, round_id : number): AxiosPromise<Response<T>>{
330
- return Requests.processRoute(CompetitionRoutes.routes.showRound, {competition_id : competition_id}, {round_id : round_id});
372
+ return Requests.processRoute(CompetitionRoutes.routes.showRound, {}, {round_id : round_id, competition_id : competition_id});
331
373
  }
332
374
 
333
375
  /**
@@ -339,8 +381,8 @@ class Competitions {
339
381
  * @param round_id
340
382
  * @returns promise
341
383
  */
342
- public static updateRound<T>(competition_id : string, round_id : number): AxiosPromise<Response<T>>{
343
- return Requests.processRoute(CompetitionRoutes.routes.updateBracket, {competition_id : competition_id}, {round_id : round_id});
384
+ public static updateRound<T>(competition_id : string, round_id : number, data?: object): AxiosPromise<Response<T>>{
385
+ return Requests.processRoute(CompetitionRoutes.routes.updateBracket, data, {round_id : round_id, competition_id : competition_id});
344
386
  }
345
387
 
346
388
  /**
@@ -353,7 +395,7 @@ class Competitions {
353
395
  * @returns promise
354
396
  */
355
397
  public static destroyRound<T>(competition_id : string, round_id : number): AxiosPromise<Response<T>>{
356
- return Requests.processRoute(CompetitionRoutes.routes.destroyRound, {competition_id : competition_id}, {round_id : round_id});
398
+ return Requests.processRoute(CompetitionRoutes.routes.destroyRound, {}, {round_id : round_id, competition_id : competition_id});
357
399
  }
358
400
 
359
401
  /**
@@ -365,7 +407,7 @@ class Competitions {
365
407
  * @returns promise
366
408
  */
367
409
  public static team<T>(competition_id : string): AxiosPromise<Response<T>>{
368
- return Requests.processRoute(CompetitionRoutes.routes.team, {competition_id : competition_id});
410
+ return Requests.processRoute(CompetitionRoutes.routes.team, {}, {competition_id : competition_id});
369
411
  }
370
412
 
371
413
  /**
@@ -376,8 +418,8 @@ class Competitions {
376
418
  * @param competition_id
377
419
  * @returns promise
378
420
  */
379
- public static teamStore<T>(competition_id : string): AxiosPromise<Response<T>>{
380
- return Requests.processRoute(CompetitionRoutes.routes.teamStore, {competition_id : competition_id});
421
+ public static createCompetitionTeam<T>(competition_id : string, data?: object): AxiosPromise<Response<T>>{
422
+ return Requests.processRoute(CompetitionRoutes.routes.teamStore, data, {competition_id : competition_id});
381
423
  }
382
424
 
383
425
  /**
@@ -385,12 +427,12 @@ class Competitions {
385
427
  *
386
428
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceTeamShow
387
429
  *
388
- * @param competition_id
389
- * @param team
430
+ * @param competition_id The id of the competition
431
+ * @param team_id The id of the team
390
432
  * @returns promise
391
433
  */
392
- public static showTeam<T>(competition_id : string, team : string): AxiosPromise<Response<T>>{
393
- return Requests.processRoute(CompetitionRoutes.routes.showTeam, {competition_id : competition_id}, {team : team});
434
+ public static showTeam<T>(competition_id : string, team_id : string): AxiosPromise<Response<T>>{
435
+ return Requests.processRoute(CompetitionRoutes.routes.showTeam, {}, {team_id : team_id, competition_id : competition_id});
394
436
  }
395
437
 
396
438
  /**
@@ -402,8 +444,8 @@ class Competitions {
402
444
  * @param team_id
403
445
  * @returns promise
404
446
  */
405
- public static updateTeam<T>(competition_id : string, team_id : string): AxiosPromise<Response<T>>{
406
- return Requests.processRoute(CompetitionRoutes.routes.updateTeam, {competition_id : competition_id}, {team_id : team_id});
447
+ public static updateTeam<T>(competition_id : string, team_id : string, data?: object): AxiosPromise<Response<T>>{
448
+ return Requests.processRoute(CompetitionRoutes.routes.updateTeam, data, {team_id : team_id, competition_id : competition_id});
407
449
  }
408
450
 
409
451
  /**
@@ -416,7 +458,7 @@ class Competitions {
416
458
  * @returns promise
417
459
  */
418
460
  public static destroyTeam<T>(competition_id : string, team_id : string): AxiosPromise<Response<T>>{
419
- return Requests.processRoute(CompetitionRoutes.routes.destroyTeam, {competition_id : competition_id}, {team_id : team_id});
461
+ return Requests.processRoute(CompetitionRoutes.routes.destroyTeam, {}, {team_id : team_id, competition_id : competition_id});
420
462
  }
421
463
 
422
464
  /**
@@ -428,7 +470,7 @@ class Competitions {
428
470
  * @returns promise
429
471
  */
430
472
  public static users<T>(competition_id : string): AxiosPromise<Response<T>>{
431
- return Requests.processRoute(CompetitionRoutes.routes.users, {competition_id : competition_id});
473
+ return Requests.processRoute(CompetitionRoutes.routes.users, {}, {competition_id : competition_id});
432
474
  }
433
475
 
434
476
  /**
@@ -439,8 +481,8 @@ class Competitions {
439
481
  * @param competition_id
440
482
  * @returns promise
441
483
  */
442
- public static competitionUser<T>(competition_id : string): AxiosPromise<Response<T>>{
443
- return Requests.processRoute(CompetitionRoutes.routes.competitionUser, {competition_id : competition_id});
484
+ public static createCompetitionUser<T>(competition_id : string, data?: object): AxiosPromise<Response<T>>{
485
+ return Requests.processRoute(CompetitionRoutes.routes.competitionUser, data, {competition_id : competition_id});
444
486
  }
445
487
 
446
488
  /**
@@ -453,7 +495,7 @@ class Competitions {
453
495
  * @returns promise
454
496
  */
455
497
  public static showCompetitionUser<T>(competition_id : string, user_id : string): AxiosPromise<Response<T>>{
456
- return Requests.processRoute(CompetitionRoutes.routes.showCompetitionUser, {competition_id : competition_id}, {user_id : user_id});
498
+ return Requests.processRoute(CompetitionRoutes.routes.showCompetitionUser, {}, {user_id : user_id, competition_id : competition_id});
457
499
  }
458
500
 
459
501
  /**
@@ -465,8 +507,8 @@ class Competitions {
465
507
  * @param user_id
466
508
  * @returns promise
467
509
  */
468
- public static updateCompetitionUser<T>(competition_id : string, user_id : string): AxiosPromise<Response<T>>{
469
- return Requests.processRoute(CompetitionRoutes.routes.updateCompetitionUser, {competition_id : competition_id}, {user_id : user_id});
510
+ public static updateCompetitionUser<T>(competition_id : string, user_id : string, data?: object): AxiosPromise<Response<T>>{
511
+ return Requests.processRoute(CompetitionRoutes.routes.updateCompetitionUser, data, {user_id : user_id, competition_id : competition_id});
470
512
  }
471
513
 
472
514
  /**
@@ -479,7 +521,7 @@ class Competitions {
479
521
  * @returns promise
480
522
  */
481
523
  public static destroyCompetitionUser<T>(competition_id : string, user_id : string): AxiosPromise<Response<T>>{
482
- return Requests.processRoute(CompetitionRoutes.routes.destroyCompetitionUser, {competition_id : competition_id}, {user_id : user_id});
524
+ return Requests.processRoute(CompetitionRoutes.routes.destroyCompetitionUser, {}, {user_id : user_id, competition_id : competition_id});
483
525
  }
484
526
 
485
527
  /**
@@ -491,7 +533,7 @@ class Competitions {
491
533
  * @returns promise
492
534
  */
493
535
  public static venues<T>(competition_id : string): AxiosPromise<Response<T>>{
494
- return Requests.processRoute(CompetitionRoutes.routes.venues, {competition_id : competition_id});
536
+ return Requests.processRoute(CompetitionRoutes.routes.venues, {}, {competition_id : competition_id});
495
537
  }
496
538
 
497
539
  /**
@@ -502,8 +544,8 @@ class Competitions {
502
544
  * @param competition_id
503
545
  * @returns promise
504
546
  */
505
- public static newVenue<T>(competition_id : string): AxiosPromise<Response<T>>{
506
- return Requests.processRoute(CompetitionRoutes.routes.newVenue, {competition_id : competition_id});
547
+ public static createVenue<T>(competition_id : string, data : object ): AxiosPromise<Response<T>>{
548
+ return Requests.processRoute(CompetitionRoutes.routes.newVenue, data, {competition_id : competition_id});
507
549
  }
508
550
 
509
551
  /**
@@ -516,7 +558,7 @@ class Competitions {
516
558
  * @returns promise
517
559
  */
518
560
  public static showVenue<T>(competition_id : string, venue_id : string): AxiosPromise<Response<T>>{
519
- return Requests.processRoute(CompetitionRoutes.routes.showVenue, {competition_id : competition_id}, {venue_id : venue_id});
561
+ return Requests.processRoute(CompetitionRoutes.routes.showVenue, {}, {venue_id : venue_id, competition_id : competition_id});
520
562
  }
521
563
 
522
564
  /**
@@ -528,8 +570,8 @@ class Competitions {
528
570
  * @param venue_id
529
571
  * @returns promise
530
572
  */
531
- public static updateVenue<T>(competition_id : string, venue_id : string): AxiosPromise<Response<T>>{
532
- return Requests.processRoute(CompetitionRoutes.routes.updateVenue, {competition_id : competition_id}, {venue_id : venue_id});
573
+ public static updateVenue<T>(competition_id : string, venue_id : string, data : object): AxiosPromise<Response<T>>{
574
+ return Requests.processRoute(CompetitionRoutes.routes.updateVenue, data, {competition_id : competition_id, venue_id : venue_id});
533
575
  }
534
576
 
535
577
  /**
@@ -542,20 +584,41 @@ class Competitions {
542
584
  * @returns promise
543
585
  */
544
586
  public static destroyVenue<T>(competition_id : string, venue_id : string): AxiosPromise<Response<T>>{
545
- return Requests.processRoute(CompetitionRoutes.routes.destroyVenue, {competition_id : competition_id}, {venue_id : venue_id});
587
+ return Requests.processRoute(CompetitionRoutes.routes.destroyVenue, {}, {competition_id : competition_id, venue_id : venue_id});
546
588
  }
547
589
 
548
590
  /**
549
- * Upload venue main image to storage.
591
+ * Updates the main image for the venue using a File object.
592
+ *
593
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
594
+ *
595
+ * @param file The file object to upload.
596
+ * @param data Any additional data to pass along to the upload.
597
+ *
598
+ * @returns promise
599
+ */
600
+ public static uploadVenueMainImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>> {
601
+
602
+ let url = CompetitionRoutes.routes.uploadVenueMainImage.url.replace('{competition_id}', competition_id);
603
+
604
+ return Requests.uploadFile(url, 'image', file, data);
605
+ }
606
+
607
+ /**
608
+ * Updates the main image for the venue using a Blob.
550
609
  *
551
610
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
552
611
  *
553
- * @param competition_id
554
- * @param venue_id
612
+ * @param blob The blob to upload.
613
+ * @param data Any additional data to pass along to the upload
614
+ *
555
615
  * @returns promise
556
616
  */
557
- public static uploadVenueMainImage<T>(competition_id : string, venue_id : string): AxiosPromise<Response<T>>{
558
- return Requests.processRoute(CompetitionRoutes.routes.uploadVenueMainImage, {competition_id : competition_id}, {venue_id : venue_id});
617
+ public static uploadVenueMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>> {
618
+
619
+ let url = CompetitionRoutes.routes.uploadVenueMainImage.url.replace('{competition_id}', competition_id);
620
+
621
+ return Requests.uploadBlob(url, 'image', blob, data);
559
622
  }
560
623
  }
561
624