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.
@@ -119,25 +119,49 @@ declare class Competitions {
119
119
  */
120
120
  static autoGenerateUserBrackets<T>(competition_id: string): AxiosPromise<Response<T>>;
121
121
  /**
122
- * Upload main image
122
+ * Updates the main image for the event using a File object.
123
+ *
124
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
125
+ *
126
+ * @param file The file object to upload.
127
+ * @param data Any additional data to pass along to the upload.
128
+ *
129
+ * @returns promise
130
+ */
131
+ static uploadCompetitionMainImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
132
+ /**
133
+ * Updates the main image for the competition using a Blob.
123
134
  *
124
135
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
125
136
  *
126
- * @param competition_id
127
- * @param image
137
+ * @param blob The blob to upload.
138
+ * @param data Any additional data to pass along to the upload
139
+ *
128
140
  * @returns promise
129
141
  */
130
- static uploadMainImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>;
142
+ static uploadCompetitionMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
131
143
  /**
132
- * Upload banner image
144
+ * Updates the banner image for the competition using a File object.
133
145
  *
134
146
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
135
147
  *
136
- * @param competition_id
137
- * @param image
148
+ * @param file The file object to upload.
149
+ * @param data Any additional data to pass along to the upload.
150
+ *
151
+ * @returns promise
152
+ */
153
+ static uploadCompetitionBannerImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
154
+ /**
155
+ * Updates the banner image for the competition using a Blob.
156
+ *
157
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
158
+ *
159
+ * @param blob The blob to upload.
160
+ * @param data Any additional data to pass along to the upload
161
+ *
138
162
  * @returns promise
139
163
  */
140
- static uploadBannerImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>;
164
+ static uploadCompetitionsBannerImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
141
165
  /**
142
166
  * Invites
143
167
  *
@@ -185,7 +209,7 @@ declare class Competitions {
185
209
  * @param round_id
186
210
  * @returns promise
187
211
  */
188
- static bracketStore<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
212
+ static createBracket<T>(competition_id: string, round_id: number, data?: object): AxiosPromise<Response<T>>;
189
213
  /**
190
214
  * Show round bracket
191
215
  *
@@ -207,7 +231,7 @@ declare class Competitions {
207
231
  * @param bracket_id
208
232
  * @returns promise
209
233
  */
210
- static updateBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>;
234
+ static updateBracket<T>(competition_id: string, round_id: number, bracket_id: number, data?: object): AxiosPromise<Response<T>>;
211
235
  /**
212
236
  * Delete bracket
213
237
  *
@@ -236,7 +260,7 @@ declare class Competitions {
236
260
  * @param competition_id
237
261
  * @returns promise
238
262
  */
239
- static roundStore<T>(competition_id: string): AxiosPromise<Response<T>>;
263
+ static createRound<T>(competition_id: string, data?: object): AxiosPromise<Response<T>>;
240
264
  /**
241
265
  * Retrieve the information for a single round.
242
266
  *
@@ -256,7 +280,7 @@ declare class Competitions {
256
280
  * @param round_id
257
281
  * @returns promise
258
282
  */
259
- static updateRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
283
+ static updateRound<T>(competition_id: string, round_id: number, data?: object): AxiosPromise<Response<T>>;
260
284
  /**
261
285
  * Deletes the round for the competition.
262
286
  *
@@ -284,17 +308,17 @@ declare class Competitions {
284
308
  * @param competition_id
285
309
  * @returns promise
286
310
  */
287
- static teamStore<T>(competition_id: string): AxiosPromise<Response<T>>;
311
+ static createCompetitionTeam<T>(competition_id: string, data?: object): AxiosPromise<Response<T>>;
288
312
  /**
289
313
  * Display the contents of a single team associated with the competition.
290
314
  *
291
315
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceTeamShow
292
316
  *
293
- * @param competition_id
294
- * @param team
317
+ * @param competition_id The id of the competition
318
+ * @param team_id The id of the team
295
319
  * @returns promise
296
320
  */
297
- static showTeam<T>(competition_id: string, team: string): AxiosPromise<Response<T>>;
321
+ static showTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
298
322
  /**
299
323
  * Update the team information associated with the competition.
300
324
  *
@@ -304,7 +328,7 @@ declare class Competitions {
304
328
  * @param team_id
305
329
  * @returns promise
306
330
  */
307
- static updateTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
331
+ static updateTeam<T>(competition_id: string, team_id: string, data?: object): AxiosPromise<Response<T>>;
308
332
  /**
309
333
  * Removes the team from the competition.
310
334
  *
@@ -332,7 +356,7 @@ declare class Competitions {
332
356
  * @param competition_id
333
357
  * @returns promise
334
358
  */
335
- static competitionUser<T>(competition_id: string): AxiosPromise<Response<T>>;
359
+ static createCompetitionUser<T>(competition_id: string, data?: object): AxiosPromise<Response<T>>;
336
360
  /**
337
361
  * Show a single user by its ID.
338
362
  *
@@ -352,7 +376,7 @@ declare class Competitions {
352
376
  * @param user_id
353
377
  * @returns promise
354
378
  */
355
- static updateCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
379
+ static updateCompetitionUser<T>(competition_id: string, user_id: string, data?: object): AxiosPromise<Response<T>>;
356
380
  /**
357
381
  * Remove the associated user from the competition.
358
382
  *
@@ -380,7 +404,7 @@ declare class Competitions {
380
404
  * @param competition_id
381
405
  * @returns promise
382
406
  */
383
- static newVenue<T>(competition_id: string): AxiosPromise<Response<T>>;
407
+ static createVenue<T>(competition_id: string, data: object): AxiosPromise<Response<T>>;
384
408
  /**
385
409
  * Show a single venue by its ID.
386
410
  *
@@ -400,7 +424,7 @@ declare class Competitions {
400
424
  * @param venue_id
401
425
  * @returns promise
402
426
  */
403
- static updateVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
427
+ static updateVenue<T>(competition_id: string, venue_id: string, data: object): AxiosPromise<Response<T>>;
404
428
  /**
405
429
  * Deletes the venue from the competition.
406
430
  *
@@ -412,14 +436,26 @@ declare class Competitions {
412
436
  */
413
437
  static destroyVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
414
438
  /**
415
- * Upload venue main image to storage.
439
+ * Updates the main image for the venue using a File object.
440
+ *
441
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
442
+ *
443
+ * @param file The file object to upload.
444
+ * @param data Any additional data to pass along to the upload.
445
+ *
446
+ * @returns promise
447
+ */
448
+ static uploadVenueMainImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
449
+ /**
450
+ * Updates the main image for the venue using a Blob.
416
451
  *
417
452
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
418
453
  *
419
- * @param competition_id
420
- * @param venue_id
454
+ * @param blob The blob to upload.
455
+ * @param data Any additional data to pass along to the upload
456
+ *
421
457
  * @returns promise
422
458
  */
423
- static uploadVenueMainImage<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
459
+ static uploadVenueMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
424
460
  }
425
461
  export default Competitions;
package/dist/esm/index.js CHANGED
@@ -30173,7 +30173,7 @@ var Competitions = /** @class */ (function () {
30173
30173
  * @returns promise
30174
30174
  */
30175
30175
  Competitions.update = function (competition_id, data) {
30176
- return Requests.processRoute(CompetitionRoutes.routes.create, data, { competition_id: competition_id });
30176
+ return Requests.processRoute(CompetitionRoutes.routes.update, data, { competition_id: competition_id });
30177
30177
  };
30178
30178
  /**
30179
30179
  * Retrieve the information for a single competition.
@@ -30243,7 +30243,7 @@ var Competitions = /** @class */ (function () {
30243
30243
  * @returns promise
30244
30244
  */
30245
30245
  Competitions.registerUser = function (competition_id) {
30246
- return Requests.processRoute(CompetitionRoutes.routes.registerUser, { competition_id: competition_id });
30246
+ return Requests.processRoute(CompetitionRoutes.routes.registerUser, {}, { competition_id: competition_id });
30247
30247
  };
30248
30248
  /**
30249
30249
  * Sync rounds
@@ -30268,7 +30268,7 @@ var Competitions = /** @class */ (function () {
30268
30268
  * @returns promise
30269
30269
  */
30270
30270
  Competitions.autoGenerate = function (competition_id, round_id) {
30271
- return Requests.processRoute(CompetitionRoutes.routes.autoGenerate, { round_id: round_id }, { competition_id: competition_id });
30271
+ return Requests.processRoute(CompetitionRoutes.routes.autoGenerate, {}, { competition_id: competition_id, round_id: round_id });
30272
30272
  };
30273
30273
  /**
30274
30274
  * auto generate user brackets
@@ -30279,31 +30279,63 @@ var Competitions = /** @class */ (function () {
30279
30279
  * @returns promise
30280
30280
  */
30281
30281
  Competitions.autoGenerateUserBrackets = function (competition_id) {
30282
- return Requests.processRoute(CompetitionRoutes.routes.autoGenerateUserBrackets, { competition_id: competition_id });
30282
+ return Requests.processRoute(CompetitionRoutes.routes.autoGenerateUserBrackets, {}, { competition_id: competition_id });
30283
30283
  };
30284
30284
  /**
30285
- * Upload main image
30285
+ * Updates the main image for the event using a File object.
30286
+ *
30287
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
30288
+ *
30289
+ * @param file The file object to upload.
30290
+ * @param data Any additional data to pass along to the upload.
30291
+ *
30292
+ * @returns promise
30293
+ */
30294
+ Competitions.uploadCompetitionMainImageFile = function (competition_id, file, data) {
30295
+ var url = CompetitionRoutes.routes.uploadMainImage.url.replace('{competition_id}', competition_id);
30296
+ return Requests.uploadFile(url, 'image', file, data);
30297
+ };
30298
+ /**
30299
+ * Updates the main image for the competition using a Blob.
30286
30300
  *
30287
30301
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
30288
30302
  *
30289
- * @param competition_id
30290
- * @param image
30303
+ * @param blob The blob to upload.
30304
+ * @param data Any additional data to pass along to the upload
30305
+ *
30291
30306
  * @returns promise
30292
30307
  */
30293
- Competitions.uploadMainImage = function (competition_id, image) {
30294
- return Requests.processRoute(CompetitionRoutes.routes.uploadMainImage, { competition_id: competition_id }, { image: image });
30308
+ Competitions.uploadCompetitionMainImageBlob = function (competition_id, blob, data) {
30309
+ var url = CompetitionRoutes.routes.uploadMainImage.url.replace('{competition_id}', competition_id);
30310
+ return Requests.uploadBlob(url, 'image', blob, data);
30295
30311
  };
30296
30312
  /**
30297
- * Upload banner image
30313
+ * Updates the banner image for the competition using a File object.
30298
30314
  *
30299
30315
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
30300
30316
  *
30301
- * @param competition_id
30302
- * @param image
30317
+ * @param file The file object to upload.
30318
+ * @param data Any additional data to pass along to the upload.
30319
+ *
30320
+ * @returns promise
30321
+ */
30322
+ Competitions.uploadCompetitionBannerImageFile = function (competition_id, file, data) {
30323
+ var url = CompetitionRoutes.routes.uploadBannerImage.url.replace('{competition_id}', competition_id);
30324
+ return Requests.uploadFile(url, 'image', file, data);
30325
+ };
30326
+ /**
30327
+ * Updates the banner image for the competition using a Blob.
30328
+ *
30329
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
30330
+ *
30331
+ * @param blob The blob to upload.
30332
+ * @param data Any additional data to pass along to the upload
30333
+ *
30303
30334
  * @returns promise
30304
30335
  */
30305
- Competitions.uploadBannerImage = function (competition_id, image) {
30306
- return Requests.processRoute(CompetitionRoutes.routes.uploadBannerImage, { competition_id: competition_id }, { image: image });
30336
+ Competitions.uploadCompetitionsBannerImageBlob = function (competition_id, blob, data) {
30337
+ var url = CompetitionRoutes.routes.uploadBannerImage.url.replace('{competition_id}', competition_id);
30338
+ return Requests.uploadBlob(url, 'image', blob, data);
30307
30339
  };
30308
30340
  /**
30309
30341
  * Invites
@@ -30314,7 +30346,7 @@ var Competitions = /** @class */ (function () {
30314
30346
  * @returns promise
30315
30347
  */
30316
30348
  Competitions.invites = function (competition_id) {
30317
- return Requests.processRoute(CompetitionRoutes.routes.invites, { competition_id: competition_id });
30349
+ return Requests.processRoute(CompetitionRoutes.routes.invites, {}, { competition_id: competition_id });
30318
30350
  };
30319
30351
  /**
30320
30352
  * Sends invite
@@ -30325,7 +30357,7 @@ var Competitions = /** @class */ (function () {
30325
30357
  * @returns promise
30326
30358
  */
30327
30359
  Competitions.sendInvite = function (competition_id) {
30328
- return Requests.processRoute(CompetitionRoutes.routes.sendInvite, { competition_id: competition_id });
30360
+ return Requests.processRoute(CompetitionRoutes.routes.sendInvite, {}, { competition_id: competition_id });
30329
30361
  };
30330
30362
  /**
30331
30363
  * Accept invite
@@ -30337,7 +30369,7 @@ var Competitions = /** @class */ (function () {
30337
30369
  * @returns promise
30338
30370
  */
30339
30371
  Competitions.acceptInvite = function (competition_id, token) {
30340
- return Requests.processRoute(CompetitionRoutes.routes.acceptInvite, { competition_id: competition_id }, { token: token });
30372
+ return Requests.processRoute(CompetitionRoutes.routes.acceptInvite, { token: token }, { competition_id: competition_id });
30341
30373
  };
30342
30374
  /**
30343
30375
  * Round brackets
@@ -30349,7 +30381,7 @@ var Competitions = /** @class */ (function () {
30349
30381
  * @returns promise
30350
30382
  */
30351
30383
  Competitions.brackets = function (competition_id, round_id) {
30352
- return Requests.processRoute(CompetitionRoutes.routes.brackets, { competition_id: competition_id }, { round_id: round_id });
30384
+ return Requests.processRoute(CompetitionRoutes.routes.brackets, {}, { round_id: round_id, competition_id: competition_id });
30353
30385
  };
30354
30386
  /**
30355
30387
  * Store round brackets
@@ -30360,8 +30392,8 @@ var Competitions = /** @class */ (function () {
30360
30392
  * @param round_id
30361
30393
  * @returns promise
30362
30394
  */
30363
- Competitions.bracketStore = function (competition_id, round_id) {
30364
- return Requests.processRoute(CompetitionRoutes.routes.bracketStore, { competition_id: competition_id }, { round_id: round_id });
30395
+ Competitions.createBracket = function (competition_id, round_id, data) {
30396
+ return Requests.processRoute(CompetitionRoutes.routes.bracketStore, data, { round_id: round_id, competition_id: competition_id });
30365
30397
  };
30366
30398
  /**
30367
30399
  * Show round bracket
@@ -30374,7 +30406,7 @@ var Competitions = /** @class */ (function () {
30374
30406
  * @returns promise
30375
30407
  */
30376
30408
  Competitions.showBracket = function (competition_id, round_id, bracket_id) {
30377
- return Requests.processRoute(CompetitionRoutes.routes.showBracket, { competition_id: competition_id }, { round_id: round_id, bracket_id: bracket_id });
30409
+ return Requests.processRoute(CompetitionRoutes.routes.showBracket, {}, { round_id: round_id, bracket_id: bracket_id, competition_id: competition_id });
30378
30410
  };
30379
30411
  /**
30380
30412
  * Update bracket
@@ -30386,8 +30418,8 @@ var Competitions = /** @class */ (function () {
30386
30418
  * @param bracket_id
30387
30419
  * @returns promise
30388
30420
  */
30389
- Competitions.updateBracket = function (competition_id, round_id, bracket_id) {
30390
- return Requests.processRoute(CompetitionRoutes.routes.updateBracket, { competition_id: competition_id }, { round_id: round_id, bracket_id: bracket_id });
30421
+ Competitions.updateBracket = function (competition_id, round_id, bracket_id, data) {
30422
+ return Requests.processRoute(CompetitionRoutes.routes.updateBracket, data, { round_id: round_id, bracket_id: bracket_id, competition_id: competition_id });
30391
30423
  };
30392
30424
  /**
30393
30425
  * Delete bracket
@@ -30400,7 +30432,7 @@ var Competitions = /** @class */ (function () {
30400
30432
  * @returns promise
30401
30433
  */
30402
30434
  Competitions.destroyBracket = function (competition_id, round_id, bracket_id) {
30403
- return Requests.processRoute(CompetitionRoutes.routes.destroyBracket, { competition_id: competition_id }, { round_id: round_id, bracket_id: bracket_id });
30435
+ return Requests.processRoute(CompetitionRoutes.routes.destroyBracket, {}, { round_id: round_id, bracket_id: bracket_id, competition_id: competition_id });
30404
30436
  };
30405
30437
  /**
30406
30438
  * List round
@@ -30411,7 +30443,7 @@ var Competitions = /** @class */ (function () {
30411
30443
  * @returns promise
30412
30444
  */
30413
30445
  Competitions.rounds = function (competition_id) {
30414
- return Requests.processRoute(CompetitionRoutes.routes.rounds, { competition_id: competition_id });
30446
+ return Requests.processRoute(CompetitionRoutes.routes.rounds, {}, { competition_id: competition_id });
30415
30447
  };
30416
30448
  /**
30417
30449
  * Create a new round for competition
@@ -30421,8 +30453,8 @@ var Competitions = /** @class */ (function () {
30421
30453
  * @param competition_id
30422
30454
  * @returns promise
30423
30455
  */
30424
- Competitions.roundStore = function (competition_id) {
30425
- return Requests.processRoute(CompetitionRoutes.routes.roundStore, { competition_id: competition_id });
30456
+ Competitions.createRound = function (competition_id, data) {
30457
+ return Requests.processRoute(CompetitionRoutes.routes.roundStore, data, { competition_id: competition_id });
30426
30458
  };
30427
30459
  /**
30428
30460
  * Retrieve the information for a single round.
@@ -30434,7 +30466,7 @@ var Competitions = /** @class */ (function () {
30434
30466
  * @returns promise
30435
30467
  */
30436
30468
  Competitions.showRound = function (competition_id, round_id) {
30437
- return Requests.processRoute(CompetitionRoutes.routes.showRound, { competition_id: competition_id }, { round_id: round_id });
30469
+ return Requests.processRoute(CompetitionRoutes.routes.showRound, {}, { round_id: round_id, competition_id: competition_id });
30438
30470
  };
30439
30471
  /**
30440
30472
  * Updating resource in storage with new information.
@@ -30445,8 +30477,8 @@ var Competitions = /** @class */ (function () {
30445
30477
  * @param round_id
30446
30478
  * @returns promise
30447
30479
  */
30448
- Competitions.updateRound = function (competition_id, round_id) {
30449
- return Requests.processRoute(CompetitionRoutes.routes.updateBracket, { competition_id: competition_id }, { round_id: round_id });
30480
+ Competitions.updateRound = function (competition_id, round_id, data) {
30481
+ return Requests.processRoute(CompetitionRoutes.routes.updateBracket, data, { round_id: round_id, competition_id: competition_id });
30450
30482
  };
30451
30483
  /**
30452
30484
  * Deletes the round for the competition.
@@ -30458,7 +30490,7 @@ var Competitions = /** @class */ (function () {
30458
30490
  * @returns promise
30459
30491
  */
30460
30492
  Competitions.destroyRound = function (competition_id, round_id) {
30461
- return Requests.processRoute(CompetitionRoutes.routes.destroyRound, { competition_id: competition_id }, { round_id: round_id });
30493
+ return Requests.processRoute(CompetitionRoutes.routes.destroyRound, {}, { round_id: round_id, competition_id: competition_id });
30462
30494
  };
30463
30495
  /**
30464
30496
  * Retrieve a list of teams associated with the competition.
@@ -30469,7 +30501,7 @@ var Competitions = /** @class */ (function () {
30469
30501
  * @returns promise
30470
30502
  */
30471
30503
  Competitions.team = function (competition_id) {
30472
- return Requests.processRoute(CompetitionRoutes.routes.team, { competition_id: competition_id });
30504
+ return Requests.processRoute(CompetitionRoutes.routes.team, {}, { competition_id: competition_id });
30473
30505
  };
30474
30506
  /**
30475
30507
  * Associate a new team with the competition.
@@ -30479,20 +30511,20 @@ var Competitions = /** @class */ (function () {
30479
30511
  * @param competition_id
30480
30512
  * @returns promise
30481
30513
  */
30482
- Competitions.teamStore = function (competition_id) {
30483
- return Requests.processRoute(CompetitionRoutes.routes.teamStore, { competition_id: competition_id });
30514
+ Competitions.createCompetitionTeam = function (competition_id, data) {
30515
+ return Requests.processRoute(CompetitionRoutes.routes.teamStore, data, { competition_id: competition_id });
30484
30516
  };
30485
30517
  /**
30486
30518
  * Display the contents of a single team associated with the competition.
30487
30519
  *
30488
30520
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceTeamShow
30489
30521
  *
30490
- * @param competition_id
30491
- * @param team
30522
+ * @param competition_id The id of the competition
30523
+ * @param team_id The id of the team
30492
30524
  * @returns promise
30493
30525
  */
30494
- Competitions.showTeam = function (competition_id, team) {
30495
- return Requests.processRoute(CompetitionRoutes.routes.showTeam, { competition_id: competition_id }, { team: team });
30526
+ Competitions.showTeam = function (competition_id, team_id) {
30527
+ return Requests.processRoute(CompetitionRoutes.routes.showTeam, {}, { team_id: team_id, competition_id: competition_id });
30496
30528
  };
30497
30529
  /**
30498
30530
  * Update the team information associated with the competition.
@@ -30503,8 +30535,8 @@ var Competitions = /** @class */ (function () {
30503
30535
  * @param team_id
30504
30536
  * @returns promise
30505
30537
  */
30506
- Competitions.updateTeam = function (competition_id, team_id) {
30507
- return Requests.processRoute(CompetitionRoutes.routes.updateTeam, { competition_id: competition_id }, { team_id: team_id });
30538
+ Competitions.updateTeam = function (competition_id, team_id, data) {
30539
+ return Requests.processRoute(CompetitionRoutes.routes.updateTeam, data, { team_id: team_id, competition_id: competition_id });
30508
30540
  };
30509
30541
  /**
30510
30542
  * Removes the team from the competition.
@@ -30516,7 +30548,7 @@ var Competitions = /** @class */ (function () {
30516
30548
  * @returns promise
30517
30549
  */
30518
30550
  Competitions.destroyTeam = function (competition_id, team_id) {
30519
- return Requests.processRoute(CompetitionRoutes.routes.destroyTeam, { competition_id: competition_id }, { team_id: team_id });
30551
+ return Requests.processRoute(CompetitionRoutes.routes.destroyTeam, {}, { team_id: team_id, competition_id: competition_id });
30520
30552
  };
30521
30553
  /**
30522
30554
  * List all the users associated with a competition.
@@ -30527,7 +30559,7 @@ var Competitions = /** @class */ (function () {
30527
30559
  * @returns promise
30528
30560
  */
30529
30561
  Competitions.users = function (competition_id) {
30530
- return Requests.processRoute(CompetitionRoutes.routes.users, { competition_id: competition_id });
30562
+ return Requests.processRoute(CompetitionRoutes.routes.users, {}, { competition_id: competition_id });
30531
30563
  };
30532
30564
  /**
30533
30565
  * Associate a new users with the competition.
@@ -30537,8 +30569,8 @@ var Competitions = /** @class */ (function () {
30537
30569
  * @param competition_id
30538
30570
  * @returns promise
30539
30571
  */
30540
- Competitions.competitionUser = function (competition_id) {
30541
- return Requests.processRoute(CompetitionRoutes.routes.competitionUser, { competition_id: competition_id });
30572
+ Competitions.createCompetitionUser = function (competition_id, data) {
30573
+ return Requests.processRoute(CompetitionRoutes.routes.competitionUser, data, { competition_id: competition_id });
30542
30574
  };
30543
30575
  /**
30544
30576
  * Show a single user by its ID.
@@ -30550,7 +30582,7 @@ var Competitions = /** @class */ (function () {
30550
30582
  * @returns promise
30551
30583
  */
30552
30584
  Competitions.showCompetitionUser = function (competition_id, user_id) {
30553
- return Requests.processRoute(CompetitionRoutes.routes.showCompetitionUser, { competition_id: competition_id }, { user_id: user_id });
30585
+ return Requests.processRoute(CompetitionRoutes.routes.showCompetitionUser, {}, { user_id: user_id, competition_id: competition_id });
30554
30586
  };
30555
30587
  /**
30556
30588
  * Update the user associated with competition.
@@ -30561,8 +30593,8 @@ var Competitions = /** @class */ (function () {
30561
30593
  * @param user_id
30562
30594
  * @returns promise
30563
30595
  */
30564
- Competitions.updateCompetitionUser = function (competition_id, user_id) {
30565
- return Requests.processRoute(CompetitionRoutes.routes.updateCompetitionUser, { competition_id: competition_id }, { user_id: user_id });
30596
+ Competitions.updateCompetitionUser = function (competition_id, user_id, data) {
30597
+ return Requests.processRoute(CompetitionRoutes.routes.updateCompetitionUser, data, { user_id: user_id, competition_id: competition_id });
30566
30598
  };
30567
30599
  /**
30568
30600
  * Remove the associated user from the competition.
@@ -30574,7 +30606,7 @@ var Competitions = /** @class */ (function () {
30574
30606
  * @returns promise
30575
30607
  */
30576
30608
  Competitions.destroyCompetitionUser = function (competition_id, user_id) {
30577
- return Requests.processRoute(CompetitionRoutes.routes.destroyCompetitionUser, { competition_id: competition_id }, { user_id: user_id });
30609
+ return Requests.processRoute(CompetitionRoutes.routes.destroyCompetitionUser, {}, { user_id: user_id, competition_id: competition_id });
30578
30610
  };
30579
30611
  /**
30580
30612
  * List all the venues associated with a competition.
@@ -30585,7 +30617,7 @@ var Competitions = /** @class */ (function () {
30585
30617
  * @returns promise
30586
30618
  */
30587
30619
  Competitions.venues = function (competition_id) {
30588
- return Requests.processRoute(CompetitionRoutes.routes.venues, { competition_id: competition_id });
30620
+ return Requests.processRoute(CompetitionRoutes.routes.venues, {}, { competition_id: competition_id });
30589
30621
  };
30590
30622
  /**
30591
30623
  * Creating a new venue.
@@ -30595,8 +30627,8 @@ var Competitions = /** @class */ (function () {
30595
30627
  * @param competition_id
30596
30628
  * @returns promise
30597
30629
  */
30598
- Competitions.newVenue = function (competition_id) {
30599
- return Requests.processRoute(CompetitionRoutes.routes.newVenue, { competition_id: competition_id });
30630
+ Competitions.createVenue = function (competition_id, data) {
30631
+ return Requests.processRoute(CompetitionRoutes.routes.newVenue, data, { competition_id: competition_id });
30600
30632
  };
30601
30633
  /**
30602
30634
  * Show a single venue by its ID.
@@ -30608,7 +30640,7 @@ var Competitions = /** @class */ (function () {
30608
30640
  * @returns promise
30609
30641
  */
30610
30642
  Competitions.showVenue = function (competition_id, venue_id) {
30611
- return Requests.processRoute(CompetitionRoutes.routes.showVenue, { competition_id: competition_id }, { venue_id: venue_id });
30643
+ return Requests.processRoute(CompetitionRoutes.routes.showVenue, {}, { venue_id: venue_id, competition_id: competition_id });
30612
30644
  };
30613
30645
  /**
30614
30646
  * Update the venue.
@@ -30619,8 +30651,8 @@ var Competitions = /** @class */ (function () {
30619
30651
  * @param venue_id
30620
30652
  * @returns promise
30621
30653
  */
30622
- Competitions.updateVenue = function (competition_id, venue_id) {
30623
- return Requests.processRoute(CompetitionRoutes.routes.updateVenue, { competition_id: competition_id }, { venue_id: venue_id });
30654
+ Competitions.updateVenue = function (competition_id, venue_id, data) {
30655
+ return Requests.processRoute(CompetitionRoutes.routes.updateVenue, data, { competition_id: competition_id, venue_id: venue_id });
30624
30656
  };
30625
30657
  /**
30626
30658
  * Deletes the venue from the competition.
@@ -30632,19 +30664,35 @@ var Competitions = /** @class */ (function () {
30632
30664
  * @returns promise
30633
30665
  */
30634
30666
  Competitions.destroyVenue = function (competition_id, venue_id) {
30635
- return Requests.processRoute(CompetitionRoutes.routes.destroyVenue, { competition_id: competition_id }, { venue_id: venue_id });
30667
+ return Requests.processRoute(CompetitionRoutes.routes.destroyVenue, {}, { competition_id: competition_id, venue_id: venue_id });
30636
30668
  };
30637
30669
  /**
30638
- * Upload venue main image to storage.
30670
+ * Updates the main image for the venue using a File object.
30671
+ *
30672
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
30673
+ *
30674
+ * @param file The file object to upload.
30675
+ * @param data Any additional data to pass along to the upload.
30676
+ *
30677
+ * @returns promise
30678
+ */
30679
+ Competitions.uploadVenueMainImageFile = function (competition_id, file, data) {
30680
+ var url = CompetitionRoutes.routes.uploadVenueMainImage.url.replace('{competition_id}', competition_id);
30681
+ return Requests.uploadFile(url, 'image', file, data);
30682
+ };
30683
+ /**
30684
+ * Updates the main image for the venue using a Blob.
30639
30685
  *
30640
30686
  * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
30641
30687
  *
30642
- * @param competition_id
30643
- * @param venue_id
30688
+ * @param blob The blob to upload.
30689
+ * @param data Any additional data to pass along to the upload
30690
+ *
30644
30691
  * @returns promise
30645
30692
  */
30646
- Competitions.uploadVenueMainImage = function (competition_id, venue_id) {
30647
- return Requests.processRoute(CompetitionRoutes.routes.uploadVenueMainImage, { competition_id: competition_id }, { venue_id: venue_id });
30693
+ Competitions.uploadVenueMainImageBlob = function (competition_id, blob, data) {
30694
+ var url = CompetitionRoutes.routes.uploadVenueMainImage.url.replace('{competition_id}', competition_id);
30695
+ return Requests.uploadBlob(url, 'image', blob, data);
30648
30696
  };
30649
30697
  return Competitions;
30650
30698
  }());