glitch-javascript-sdk 0.1.8 → 0.1.9
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 +97 -49
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Competitions.d.ts +58 -22
- package/dist/esm/index.js +97 -49
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +58 -22
- package/package.json +1 -1
- package/src/api/Competitions.ts +112 -49
- package/src/api/Events.ts +11 -11
package/dist/cjs/index.js
CHANGED
|
@@ -16060,28 +16060,60 @@ var Competitions = /** @class */ (function () {
|
|
|
16060
16060
|
return Requests.processRoute(CompetitionRoutes.routes.autoGenerateUserBrackets, { competition_id: competition_id });
|
|
16061
16061
|
};
|
|
16062
16062
|
/**
|
|
16063
|
-
|
|
16063
|
+
* Updates the main image for the event using a File object.
|
|
16064
|
+
*
|
|
16065
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
|
|
16066
|
+
*
|
|
16067
|
+
* @param file The file object to upload.
|
|
16068
|
+
* @param data Any additional data to pass along to the upload.
|
|
16069
|
+
*
|
|
16070
|
+
* @returns promise
|
|
16071
|
+
*/
|
|
16072
|
+
Competitions.uploadCompetitionMainImageFile = function (competition_id, file, data) {
|
|
16073
|
+
var url = CompetitionRoutes.routes.uploadMainImage.url.replace('{competition_id}', competition_id);
|
|
16074
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
16075
|
+
};
|
|
16076
|
+
/**
|
|
16077
|
+
* Updates the main image for the competition using a Blob.
|
|
16064
16078
|
*
|
|
16065
16079
|
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
|
|
16066
16080
|
*
|
|
16067
|
-
* @param
|
|
16068
|
-
* @param
|
|
16081
|
+
* @param blob The blob to upload.
|
|
16082
|
+
* @param data Any additional data to pass along to the upload
|
|
16083
|
+
*
|
|
16069
16084
|
* @returns promise
|
|
16070
16085
|
*/
|
|
16071
|
-
Competitions.
|
|
16072
|
-
|
|
16086
|
+
Competitions.uploadCompetitionMainImageBlob = function (competition_id, blob, data) {
|
|
16087
|
+
var url = CompetitionRoutes.routes.uploadMainImage.url.replace('{competition_id}', competition_id);
|
|
16088
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
16073
16089
|
};
|
|
16074
16090
|
/**
|
|
16075
|
-
*
|
|
16091
|
+
* Updates the banner image for the competition using a File object.
|
|
16076
16092
|
*
|
|
16077
16093
|
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
|
|
16078
16094
|
*
|
|
16079
|
-
* @param
|
|
16080
|
-
* @param
|
|
16095
|
+
* @param file The file object to upload.
|
|
16096
|
+
* @param data Any additional data to pass along to the upload.
|
|
16097
|
+
*
|
|
16098
|
+
* @returns promise
|
|
16099
|
+
*/
|
|
16100
|
+
Competitions.uploadCompetitionBannerImageFile = function (competition_id, file, data) {
|
|
16101
|
+
var url = CompetitionRoutes.routes.uploadBannerImage.url.replace('{competition_id}', competition_id);
|
|
16102
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
16103
|
+
};
|
|
16104
|
+
/**
|
|
16105
|
+
* Updates the banner image for the competition using a Blob.
|
|
16106
|
+
*
|
|
16107
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
|
|
16108
|
+
*
|
|
16109
|
+
* @param blob The blob to upload.
|
|
16110
|
+
* @param data Any additional data to pass along to the upload
|
|
16111
|
+
*
|
|
16081
16112
|
* @returns promise
|
|
16082
16113
|
*/
|
|
16083
|
-
Competitions.
|
|
16084
|
-
|
|
16114
|
+
Competitions.uploadCompetitionsBannerImageBlob = function (competition_id, blob, data) {
|
|
16115
|
+
var url = CompetitionRoutes.routes.uploadBannerImage.url.replace('{competition_id}', competition_id);
|
|
16116
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
16085
16117
|
};
|
|
16086
16118
|
/**
|
|
16087
16119
|
* Invites
|
|
@@ -16127,7 +16159,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16127
16159
|
* @returns promise
|
|
16128
16160
|
*/
|
|
16129
16161
|
Competitions.brackets = function (competition_id, round_id) {
|
|
16130
|
-
return Requests.processRoute(CompetitionRoutes.routes.brackets, {
|
|
16162
|
+
return Requests.processRoute(CompetitionRoutes.routes.brackets, {}, { round_id: round_id, competition_id: competition_id });
|
|
16131
16163
|
};
|
|
16132
16164
|
/**
|
|
16133
16165
|
* Store round brackets
|
|
@@ -16138,8 +16170,8 @@ var Competitions = /** @class */ (function () {
|
|
|
16138
16170
|
* @param round_id
|
|
16139
16171
|
* @returns promise
|
|
16140
16172
|
*/
|
|
16141
|
-
Competitions.
|
|
16142
|
-
return Requests.processRoute(CompetitionRoutes.routes.bracketStore,
|
|
16173
|
+
Competitions.createBracjet = function (competition_id, round_id, data) {
|
|
16174
|
+
return Requests.processRoute(CompetitionRoutes.routes.bracketStore, data, { round_id: round_id, competition_id: competition_id });
|
|
16143
16175
|
};
|
|
16144
16176
|
/**
|
|
16145
16177
|
* Show round bracket
|
|
@@ -16152,7 +16184,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16152
16184
|
* @returns promise
|
|
16153
16185
|
*/
|
|
16154
16186
|
Competitions.showBracket = function (competition_id, round_id, bracket_id) {
|
|
16155
|
-
return Requests.processRoute(CompetitionRoutes.routes.showBracket, {
|
|
16187
|
+
return Requests.processRoute(CompetitionRoutes.routes.showBracket, {}, { round_id: round_id, bracket_id: bracket_id, competition_id: competition_id });
|
|
16156
16188
|
};
|
|
16157
16189
|
/**
|
|
16158
16190
|
* Update bracket
|
|
@@ -16164,8 +16196,8 @@ var Competitions = /** @class */ (function () {
|
|
|
16164
16196
|
* @param bracket_id
|
|
16165
16197
|
* @returns promise
|
|
16166
16198
|
*/
|
|
16167
|
-
Competitions.updateBracket = function (competition_id, round_id, bracket_id) {
|
|
16168
|
-
return Requests.processRoute(CompetitionRoutes.routes.updateBracket,
|
|
16199
|
+
Competitions.updateBracket = function (competition_id, round_id, bracket_id, data) {
|
|
16200
|
+
return Requests.processRoute(CompetitionRoutes.routes.updateBracket, data, { round_id: round_id, bracket_id: bracket_id, competition_id: competition_id });
|
|
16169
16201
|
};
|
|
16170
16202
|
/**
|
|
16171
16203
|
* Delete bracket
|
|
@@ -16178,7 +16210,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16178
16210
|
* @returns promise
|
|
16179
16211
|
*/
|
|
16180
16212
|
Competitions.destroyBracket = function (competition_id, round_id, bracket_id) {
|
|
16181
|
-
return Requests.processRoute(CompetitionRoutes.routes.destroyBracket, {
|
|
16213
|
+
return Requests.processRoute(CompetitionRoutes.routes.destroyBracket, {}, { round_id: round_id, bracket_id: bracket_id, competition_id: competition_id });
|
|
16182
16214
|
};
|
|
16183
16215
|
/**
|
|
16184
16216
|
* List round
|
|
@@ -16189,7 +16221,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16189
16221
|
* @returns promise
|
|
16190
16222
|
*/
|
|
16191
16223
|
Competitions.rounds = function (competition_id) {
|
|
16192
|
-
return Requests.processRoute(CompetitionRoutes.routes.rounds, { competition_id: competition_id });
|
|
16224
|
+
return Requests.processRoute(CompetitionRoutes.routes.rounds, {}, { competition_id: competition_id });
|
|
16193
16225
|
};
|
|
16194
16226
|
/**
|
|
16195
16227
|
* Create a new round for competition
|
|
@@ -16199,8 +16231,8 @@ var Competitions = /** @class */ (function () {
|
|
|
16199
16231
|
* @param competition_id
|
|
16200
16232
|
* @returns promise
|
|
16201
16233
|
*/
|
|
16202
|
-
Competitions.
|
|
16203
|
-
return Requests.processRoute(CompetitionRoutes.routes.roundStore, { competition_id: competition_id });
|
|
16234
|
+
Competitions.createRound = function (competition_id, data) {
|
|
16235
|
+
return Requests.processRoute(CompetitionRoutes.routes.roundStore, data, { competition_id: competition_id });
|
|
16204
16236
|
};
|
|
16205
16237
|
/**
|
|
16206
16238
|
* Retrieve the information for a single round.
|
|
@@ -16212,7 +16244,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16212
16244
|
* @returns promise
|
|
16213
16245
|
*/
|
|
16214
16246
|
Competitions.showRound = function (competition_id, round_id) {
|
|
16215
|
-
return Requests.processRoute(CompetitionRoutes.routes.showRound, {
|
|
16247
|
+
return Requests.processRoute(CompetitionRoutes.routes.showRound, {}, { round_id: round_id, competition_id: competition_id });
|
|
16216
16248
|
};
|
|
16217
16249
|
/**
|
|
16218
16250
|
* Updating resource in storage with new information.
|
|
@@ -16223,8 +16255,8 @@ var Competitions = /** @class */ (function () {
|
|
|
16223
16255
|
* @param round_id
|
|
16224
16256
|
* @returns promise
|
|
16225
16257
|
*/
|
|
16226
|
-
Competitions.updateRound = function (competition_id, round_id) {
|
|
16227
|
-
return Requests.processRoute(CompetitionRoutes.routes.updateBracket,
|
|
16258
|
+
Competitions.updateRound = function (competition_id, round_id, data) {
|
|
16259
|
+
return Requests.processRoute(CompetitionRoutes.routes.updateBracket, data, { round_id: round_id, competition_id: competition_id });
|
|
16228
16260
|
};
|
|
16229
16261
|
/**
|
|
16230
16262
|
* Deletes the round for the competition.
|
|
@@ -16236,7 +16268,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16236
16268
|
* @returns promise
|
|
16237
16269
|
*/
|
|
16238
16270
|
Competitions.destroyRound = function (competition_id, round_id) {
|
|
16239
|
-
return Requests.processRoute(CompetitionRoutes.routes.destroyRound, {
|
|
16271
|
+
return Requests.processRoute(CompetitionRoutes.routes.destroyRound, {}, { round_id: round_id, competition_id: competition_id });
|
|
16240
16272
|
};
|
|
16241
16273
|
/**
|
|
16242
16274
|
* Retrieve a list of teams associated with the competition.
|
|
@@ -16247,7 +16279,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16247
16279
|
* @returns promise
|
|
16248
16280
|
*/
|
|
16249
16281
|
Competitions.team = function (competition_id) {
|
|
16250
|
-
return Requests.processRoute(CompetitionRoutes.routes.team, { competition_id: competition_id });
|
|
16282
|
+
return Requests.processRoute(CompetitionRoutes.routes.team, {}, { competition_id: competition_id });
|
|
16251
16283
|
};
|
|
16252
16284
|
/**
|
|
16253
16285
|
* Associate a new team with the competition.
|
|
@@ -16257,8 +16289,8 @@ var Competitions = /** @class */ (function () {
|
|
|
16257
16289
|
* @param competition_id
|
|
16258
16290
|
* @returns promise
|
|
16259
16291
|
*/
|
|
16260
|
-
Competitions.
|
|
16261
|
-
return Requests.processRoute(CompetitionRoutes.routes.teamStore, { competition_id: competition_id });
|
|
16292
|
+
Competitions.createCompetitionTeam = function (competition_id, data) {
|
|
16293
|
+
return Requests.processRoute(CompetitionRoutes.routes.teamStore, data, { competition_id: competition_id });
|
|
16262
16294
|
};
|
|
16263
16295
|
/**
|
|
16264
16296
|
* Display the contents of a single team associated with the competition.
|
|
@@ -16281,8 +16313,8 @@ var Competitions = /** @class */ (function () {
|
|
|
16281
16313
|
* @param team_id
|
|
16282
16314
|
* @returns promise
|
|
16283
16315
|
*/
|
|
16284
|
-
Competitions.updateTeam = function (competition_id, team_id) {
|
|
16285
|
-
return Requests.processRoute(CompetitionRoutes.routes.updateTeam,
|
|
16316
|
+
Competitions.updateTeam = function (competition_id, team_id, data) {
|
|
16317
|
+
return Requests.processRoute(CompetitionRoutes.routes.updateTeam, data, { team_id: team_id, competition_id: competition_id });
|
|
16286
16318
|
};
|
|
16287
16319
|
/**
|
|
16288
16320
|
* Removes the team from the competition.
|
|
@@ -16294,7 +16326,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16294
16326
|
* @returns promise
|
|
16295
16327
|
*/
|
|
16296
16328
|
Competitions.destroyTeam = function (competition_id, team_id) {
|
|
16297
|
-
return Requests.processRoute(CompetitionRoutes.routes.destroyTeam, {
|
|
16329
|
+
return Requests.processRoute(CompetitionRoutes.routes.destroyTeam, {}, { team_id: team_id, competition_id: competition_id });
|
|
16298
16330
|
};
|
|
16299
16331
|
/**
|
|
16300
16332
|
* List all the users associated with a competition.
|
|
@@ -16305,7 +16337,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16305
16337
|
* @returns promise
|
|
16306
16338
|
*/
|
|
16307
16339
|
Competitions.users = function (competition_id) {
|
|
16308
|
-
return Requests.processRoute(CompetitionRoutes.routes.users, { competition_id: competition_id });
|
|
16340
|
+
return Requests.processRoute(CompetitionRoutes.routes.users, {}, { competition_id: competition_id });
|
|
16309
16341
|
};
|
|
16310
16342
|
/**
|
|
16311
16343
|
* Associate a new users with the competition.
|
|
@@ -16315,8 +16347,8 @@ var Competitions = /** @class */ (function () {
|
|
|
16315
16347
|
* @param competition_id
|
|
16316
16348
|
* @returns promise
|
|
16317
16349
|
*/
|
|
16318
|
-
Competitions.
|
|
16319
|
-
return Requests.processRoute(CompetitionRoutes.routes.competitionUser, { competition_id: competition_id });
|
|
16350
|
+
Competitions.createCompetitionUser = function (competition_id, data) {
|
|
16351
|
+
return Requests.processRoute(CompetitionRoutes.routes.competitionUser, {}, { competition_id: competition_id });
|
|
16320
16352
|
};
|
|
16321
16353
|
/**
|
|
16322
16354
|
* Show a single user by its ID.
|
|
@@ -16328,7 +16360,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16328
16360
|
* @returns promise
|
|
16329
16361
|
*/
|
|
16330
16362
|
Competitions.showCompetitionUser = function (competition_id, user_id) {
|
|
16331
|
-
return Requests.processRoute(CompetitionRoutes.routes.showCompetitionUser, {
|
|
16363
|
+
return Requests.processRoute(CompetitionRoutes.routes.showCompetitionUser, {}, { user_id: user_id, competition_id: competition_id });
|
|
16332
16364
|
};
|
|
16333
16365
|
/**
|
|
16334
16366
|
* Update the user associated with competition.
|
|
@@ -16339,8 +16371,8 @@ var Competitions = /** @class */ (function () {
|
|
|
16339
16371
|
* @param user_id
|
|
16340
16372
|
* @returns promise
|
|
16341
16373
|
*/
|
|
16342
|
-
Competitions.updateCompetitionUser = function (competition_id, user_id) {
|
|
16343
|
-
return Requests.processRoute(CompetitionRoutes.routes.updateCompetitionUser,
|
|
16374
|
+
Competitions.updateCompetitionUser = function (competition_id, user_id, data) {
|
|
16375
|
+
return Requests.processRoute(CompetitionRoutes.routes.updateCompetitionUser, data, { user_id: user_id, competition_id: competition_id });
|
|
16344
16376
|
};
|
|
16345
16377
|
/**
|
|
16346
16378
|
* Remove the associated user from the competition.
|
|
@@ -16352,7 +16384,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16352
16384
|
* @returns promise
|
|
16353
16385
|
*/
|
|
16354
16386
|
Competitions.destroyCompetitionUser = function (competition_id, user_id) {
|
|
16355
|
-
return Requests.processRoute(CompetitionRoutes.routes.destroyCompetitionUser, {
|
|
16387
|
+
return Requests.processRoute(CompetitionRoutes.routes.destroyCompetitionUser, {}, { user_id: user_id, competition_id: competition_id });
|
|
16356
16388
|
};
|
|
16357
16389
|
/**
|
|
16358
16390
|
* List all the venues associated with a competition.
|
|
@@ -16363,7 +16395,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16363
16395
|
* @returns promise
|
|
16364
16396
|
*/
|
|
16365
16397
|
Competitions.venues = function (competition_id) {
|
|
16366
|
-
return Requests.processRoute(CompetitionRoutes.routes.venues, { competition_id: competition_id });
|
|
16398
|
+
return Requests.processRoute(CompetitionRoutes.routes.venues, {}, { competition_id: competition_id });
|
|
16367
16399
|
};
|
|
16368
16400
|
/**
|
|
16369
16401
|
* Creating a new venue.
|
|
@@ -16373,8 +16405,8 @@ var Competitions = /** @class */ (function () {
|
|
|
16373
16405
|
* @param competition_id
|
|
16374
16406
|
* @returns promise
|
|
16375
16407
|
*/
|
|
16376
|
-
Competitions.
|
|
16377
|
-
return Requests.processRoute(CompetitionRoutes.routes.newVenue, { competition_id: competition_id });
|
|
16408
|
+
Competitions.createVenue = function (competition_id, data) {
|
|
16409
|
+
return Requests.processRoute(CompetitionRoutes.routes.newVenue, data, { competition_id: competition_id });
|
|
16378
16410
|
};
|
|
16379
16411
|
/**
|
|
16380
16412
|
* Show a single venue by its ID.
|
|
@@ -16386,7 +16418,7 @@ var Competitions = /** @class */ (function () {
|
|
|
16386
16418
|
* @returns promise
|
|
16387
16419
|
*/
|
|
16388
16420
|
Competitions.showVenue = function (competition_id, venue_id) {
|
|
16389
|
-
return Requests.processRoute(CompetitionRoutes.routes.showVenue, {
|
|
16421
|
+
return Requests.processRoute(CompetitionRoutes.routes.showVenue, {}, { venue_id: venue_id, competition_id: competition_id });
|
|
16390
16422
|
};
|
|
16391
16423
|
/**
|
|
16392
16424
|
* Update the venue.
|
|
@@ -16397,8 +16429,8 @@ var Competitions = /** @class */ (function () {
|
|
|
16397
16429
|
* @param venue_id
|
|
16398
16430
|
* @returns promise
|
|
16399
16431
|
*/
|
|
16400
|
-
Competitions.updateVenue = function (competition_id, venue_id) {
|
|
16401
|
-
return Requests.processRoute(CompetitionRoutes.routes.updateVenue, { competition_id: competition_id
|
|
16432
|
+
Competitions.updateVenue = function (competition_id, venue_id, data) {
|
|
16433
|
+
return Requests.processRoute(CompetitionRoutes.routes.updateVenue, data, { competition_id: competition_id, venue_id: venue_id });
|
|
16402
16434
|
};
|
|
16403
16435
|
/**
|
|
16404
16436
|
* Deletes the venue from the competition.
|
|
@@ -16410,19 +16442,35 @@ var Competitions = /** @class */ (function () {
|
|
|
16410
16442
|
* @returns promise
|
|
16411
16443
|
*/
|
|
16412
16444
|
Competitions.destroyVenue = function (competition_id, venue_id) {
|
|
16413
|
-
return Requests.processRoute(CompetitionRoutes.routes.destroyVenue, { competition_id: competition_id
|
|
16445
|
+
return Requests.processRoute(CompetitionRoutes.routes.destroyVenue, {}, { competition_id: competition_id, venue_id: venue_id });
|
|
16446
|
+
};
|
|
16447
|
+
/**
|
|
16448
|
+
* Updates the main image for the venue using a File object.
|
|
16449
|
+
*
|
|
16450
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
|
|
16451
|
+
*
|
|
16452
|
+
* @param file The file object to upload.
|
|
16453
|
+
* @param data Any additional data to pass along to the upload.
|
|
16454
|
+
*
|
|
16455
|
+
* @returns promise
|
|
16456
|
+
*/
|
|
16457
|
+
Competitions.uploadVenueMainImageFile = function (competition_id, file, data) {
|
|
16458
|
+
var url = CompetitionRoutes.routes.uploadVenueMainImage.url.replace('{competition_id}', competition_id);
|
|
16459
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
16414
16460
|
};
|
|
16415
16461
|
/**
|
|
16416
|
-
*
|
|
16462
|
+
* Updates the main image for the venue using a Blob.
|
|
16417
16463
|
*
|
|
16418
16464
|
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
|
|
16419
16465
|
*
|
|
16420
|
-
* @param
|
|
16421
|
-
* @param
|
|
16466
|
+
* @param blob The blob to upload.
|
|
16467
|
+
* @param data Any additional data to pass along to the upload
|
|
16468
|
+
*
|
|
16422
16469
|
* @returns promise
|
|
16423
16470
|
*/
|
|
16424
|
-
Competitions.
|
|
16425
|
-
|
|
16471
|
+
Competitions.uploadVenueMainImageBlob = function (competition_id, blob, data) {
|
|
16472
|
+
var url = CompetitionRoutes.routes.uploadVenueMainImage.url.replace('{competition_id}', competition_id);
|
|
16473
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
16426
16474
|
};
|
|
16427
16475
|
return Competitions;
|
|
16428
16476
|
}());
|