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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glitch-javascript-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Javascrip SDK for GLitch",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
"build": "rm -Rf dist && rollup -c --bundleConfigAsCjs",
|
|
15
15
|
"build-docs": "rm -rf docs && typedoc --tsconfig tsconfig.json src/"
|
|
16
16
|
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist",
|
|
19
|
-
"src"
|
|
20
|
-
],
|
|
21
17
|
"author": "",
|
|
22
18
|
"license": "ISC",
|
|
23
19
|
"devDependencies": {
|
|
@@ -31,7 +27,7 @@
|
|
|
31
27
|
"rollup": "^3.2.5",
|
|
32
28
|
"rollup-plugin-dts": "^5.0.0",
|
|
33
29
|
"rollup-plugin-polyfill-node": "^0.11.0",
|
|
34
|
-
"typedoc": "^0.23.
|
|
30
|
+
"typedoc": "^0.23.27",
|
|
35
31
|
"typescript": "^4.8.4"
|
|
36
32
|
},
|
|
37
33
|
"dependencies": {
|
package/src/api/Competitions.ts
CHANGED
|
@@ -72,8 +72,491 @@ class Competitions {
|
|
|
72
72
|
return Requests.processRoute(CompetitionRoutes.routes.delete, {}, {competition_id : competition_id});
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Add a team
|
|
77
|
+
*
|
|
78
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/addTeam
|
|
79
|
+
*
|
|
80
|
+
* @param competition_id
|
|
81
|
+
* @param team_id
|
|
82
|
+
* @returns promise
|
|
83
|
+
*/
|
|
84
|
+
public static addTeam<T>(competition_id : string, team_id : string) : AxiosPromise<Response<T>>{
|
|
85
|
+
return Requests.processRoute(CompetitionRoutes.routes.addTeam, {team_id : team_id}, {competition_id : competition_id});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Adds participant
|
|
90
|
+
*
|
|
91
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/addParticipant
|
|
92
|
+
*
|
|
93
|
+
* @param competition_id
|
|
94
|
+
* @param user_id
|
|
95
|
+
* @returns promise
|
|
96
|
+
*/
|
|
97
|
+
public static addParticipant<T>(competition_id : string, user_id : string) : AxiosPromise<Response<T>>{
|
|
98
|
+
return Requests.processRoute(CompetitionRoutes.routes.addParticipant, {user_id : user_id}, {competition_id : competition_id});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Register a team
|
|
103
|
+
*
|
|
104
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/registerTeam
|
|
105
|
+
*
|
|
106
|
+
* @param competition_id
|
|
107
|
+
* @param team_id
|
|
108
|
+
* @returns promise
|
|
109
|
+
*/
|
|
110
|
+
public static registerTeam<T>(competition_id : string, team_id : string) : AxiosPromise<Response<T>>{
|
|
111
|
+
return Requests.processRoute(CompetitionRoutes.routes.registerTeam, {team_id : team_id}, {competition_id : competition_id});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Register a user
|
|
116
|
+
*
|
|
117
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/registerParticipant
|
|
118
|
+
*
|
|
119
|
+
* @param competition_id
|
|
120
|
+
* @returns promise
|
|
121
|
+
*/
|
|
122
|
+
public static registerUser<T>(competition_id : string) : AxiosPromise<Response<T>>{
|
|
123
|
+
return Requests.processRoute(CompetitionRoutes.routes.registerUser, {competition_id : competition_id});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Sync rounds
|
|
128
|
+
*
|
|
129
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/syncRounds
|
|
130
|
+
*
|
|
131
|
+
* @param competition_id
|
|
132
|
+
* @param number_of_competitors
|
|
133
|
+
* @param competitors_per_bracket
|
|
134
|
+
* @returns promise
|
|
135
|
+
*/
|
|
136
|
+
public static syncRounds<T>(competition_id : string) : AxiosPromise<Response<T>>{
|
|
137
|
+
return Requests.processRoute(CompetitionRoutes.routes.syncRounds, {competition_id : competition_id});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* auto generate team brackets
|
|
142
|
+
*
|
|
143
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/autoGenerateTeamBrackets
|
|
144
|
+
*
|
|
145
|
+
* @param competition_id
|
|
146
|
+
* @param round_id
|
|
147
|
+
* @returns promise
|
|
148
|
+
*/
|
|
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});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* auto generate user brackets
|
|
155
|
+
*
|
|
156
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/autoGenerateUserBrackets
|
|
157
|
+
*
|
|
158
|
+
* @param competition_id
|
|
159
|
+
* @returns promise
|
|
160
|
+
*/
|
|
161
|
+
public static autoGenerateUserBrackets<T>(competition_id : string) : AxiosPromise<Response<T>>{
|
|
162
|
+
return Requests.processRoute(CompetitionRoutes.routes.autoGenerateUserBrackets, {competition_id : competition_id});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Upload main image
|
|
167
|
+
*
|
|
168
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
|
|
169
|
+
*
|
|
170
|
+
* @param competition_id
|
|
171
|
+
* @param image
|
|
172
|
+
* @returns promise
|
|
173
|
+
*/
|
|
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});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Upload banner image
|
|
180
|
+
*
|
|
181
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
|
|
182
|
+
*
|
|
183
|
+
* @param competition_id
|
|
184
|
+
* @param image
|
|
185
|
+
* @returns promise
|
|
186
|
+
*/
|
|
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});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Invites
|
|
193
|
+
*
|
|
194
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserInviteList
|
|
195
|
+
*
|
|
196
|
+
* @param competition_id
|
|
197
|
+
* @returns promise
|
|
198
|
+
*/
|
|
199
|
+
public static invites<T>(competition_id : string) : AxiosPromise<Response<T>>{
|
|
200
|
+
return Requests.processRoute(CompetitionRoutes.routes.invites, {competition_id : competition_id});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Sends invite
|
|
205
|
+
*
|
|
206
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionSendInvite
|
|
207
|
+
*
|
|
208
|
+
* @param competition_id
|
|
209
|
+
* @returns promise
|
|
210
|
+
*/
|
|
211
|
+
public static sendInvite<T>(competition_id : string) : AxiosPromise<Response<T>>{
|
|
212
|
+
return Requests.processRoute(CompetitionRoutes.routes.sendInvite, {competition_id : competition_id});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Accept invite
|
|
217
|
+
*
|
|
218
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionAcceptInvite
|
|
219
|
+
*
|
|
220
|
+
* @param competition_id
|
|
221
|
+
* @param token
|
|
222
|
+
* @returns promise
|
|
223
|
+
*/
|
|
224
|
+
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});
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Round brackets
|
|
230
|
+
*
|
|
231
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundBracketList1
|
|
232
|
+
*
|
|
233
|
+
* @param competition_id
|
|
234
|
+
* @param round_id
|
|
235
|
+
* @returns promise
|
|
236
|
+
*/
|
|
237
|
+
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});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Store round brackets
|
|
243
|
+
*
|
|
244
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundBracketStorage
|
|
245
|
+
*
|
|
246
|
+
* @param competition_id
|
|
247
|
+
* @param round_id
|
|
248
|
+
* @returns promise
|
|
249
|
+
*/
|
|
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});
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Show round bracket
|
|
256
|
+
*
|
|
257
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundBracketShow
|
|
258
|
+
*
|
|
259
|
+
* @param competition_id
|
|
260
|
+
* @param round_id
|
|
261
|
+
* @param bracket_id
|
|
262
|
+
* @returns promise
|
|
263
|
+
*/
|
|
264
|
+
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});
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Update bracket
|
|
270
|
+
*
|
|
271
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateRoundBracket
|
|
272
|
+
*
|
|
273
|
+
* @param competition_id
|
|
274
|
+
* @param round_id
|
|
275
|
+
* @param bracket_id
|
|
276
|
+
* @returns promise
|
|
277
|
+
*/
|
|
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});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Delete bracket
|
|
284
|
+
*
|
|
285
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryRoundBracket
|
|
286
|
+
*
|
|
287
|
+
* @param competition_id
|
|
288
|
+
* @param round_id
|
|
289
|
+
* @param bracket_id
|
|
290
|
+
* @returns promise
|
|
291
|
+
*/
|
|
292
|
+
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});
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* List round
|
|
298
|
+
*
|
|
299
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundList
|
|
300
|
+
*
|
|
301
|
+
* @param competition_id
|
|
302
|
+
* @returns promise
|
|
303
|
+
*/
|
|
304
|
+
public static rounds<T>(competition_id : string): AxiosPromise<Response<T>>{
|
|
305
|
+
return Requests.processRoute(CompetitionRoutes.routes.rounds, {competition_id : competition_id});
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Create a new round for competition
|
|
310
|
+
*
|
|
311
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundStorage
|
|
312
|
+
*
|
|
313
|
+
* @param competition_id
|
|
314
|
+
* @returns promise
|
|
315
|
+
*/
|
|
316
|
+
public static roundStore<T>(competition_id : string): AxiosPromise<Response<T>>{
|
|
317
|
+
return Requests.processRoute(CompetitionRoutes.routes.roundStore, {competition_id : competition_id});
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Retrieve the information for a single round.
|
|
322
|
+
*
|
|
323
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundShow
|
|
324
|
+
*
|
|
325
|
+
* @param competition_id
|
|
326
|
+
* @param round_id
|
|
327
|
+
* @returns promise
|
|
328
|
+
*/
|
|
329
|
+
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});
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Updating resource in storage with new information.
|
|
335
|
+
*
|
|
336
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateRound
|
|
337
|
+
*
|
|
338
|
+
* @param competition_id
|
|
339
|
+
* @param round_id
|
|
340
|
+
* @returns promise
|
|
341
|
+
*/
|
|
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});
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Deletes the round for the competition.
|
|
348
|
+
*
|
|
349
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryRound
|
|
350
|
+
*
|
|
351
|
+
* @param competition_id
|
|
352
|
+
* @param round_id
|
|
353
|
+
* @returns promise
|
|
354
|
+
*/
|
|
355
|
+
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});
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Retrieve a list of teams associated with the competition.
|
|
361
|
+
*
|
|
362
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceCompetitionTeamList
|
|
363
|
+
*
|
|
364
|
+
* @param competition_id
|
|
365
|
+
* @returns promise
|
|
366
|
+
*/
|
|
367
|
+
public static team<T>(competition_id : string): AxiosPromise<Response<T>>{
|
|
368
|
+
return Requests.processRoute(CompetitionRoutes.routes.team, {competition_id : competition_id});
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Associate a new team with the competition.
|
|
373
|
+
*
|
|
374
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceCompetitionTeamStorage
|
|
375
|
+
*
|
|
376
|
+
* @param competition_id
|
|
377
|
+
* @returns promise
|
|
378
|
+
*/
|
|
379
|
+
public static teamStore<T>(competition_id : string): AxiosPromise<Response<T>>{
|
|
380
|
+
return Requests.processRoute(CompetitionRoutes.routes.teamStore, {competition_id : competition_id});
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Display the contents of a single team associated with the competition.
|
|
385
|
+
*
|
|
386
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceTeamShow
|
|
387
|
+
*
|
|
388
|
+
* @param competition_id
|
|
389
|
+
* @param team
|
|
390
|
+
* @returns promise
|
|
391
|
+
*/
|
|
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});
|
|
394
|
+
}
|
|
75
395
|
|
|
396
|
+
/**
|
|
397
|
+
* Update the team information associated with the competition.
|
|
398
|
+
*
|
|
399
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateTeam
|
|
400
|
+
*
|
|
401
|
+
* @param competition_id
|
|
402
|
+
* @param team_id
|
|
403
|
+
* @returns promise
|
|
404
|
+
*/
|
|
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});
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Removes the team from the competition.
|
|
411
|
+
*
|
|
412
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryTeam
|
|
413
|
+
*
|
|
414
|
+
* @param competition_id
|
|
415
|
+
* @param team_id
|
|
416
|
+
* @returns promise
|
|
417
|
+
*/
|
|
418
|
+
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});
|
|
420
|
+
}
|
|
76
421
|
|
|
422
|
+
/**
|
|
423
|
+
* List all the users associated with a competition.
|
|
424
|
+
*
|
|
425
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
|
|
426
|
+
*
|
|
427
|
+
* @param competition_id
|
|
428
|
+
* @returns promise
|
|
429
|
+
*/
|
|
430
|
+
public static users<T>(competition_id : string): AxiosPromise<Response<T>>{
|
|
431
|
+
return Requests.processRoute(CompetitionRoutes.routes.users, {competition_id : competition_id});
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Associate a new users with the competition.
|
|
436
|
+
*
|
|
437
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/createCompetitionUser
|
|
438
|
+
*
|
|
439
|
+
* @param competition_id
|
|
440
|
+
* @returns promise
|
|
441
|
+
*/
|
|
442
|
+
public static competitionUser<T>(competition_id : string): AxiosPromise<Response<T>>{
|
|
443
|
+
return Requests.processRoute(CompetitionRoutes.routes.competitionUser, {competition_id : competition_id});
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Show a single user by its ID.
|
|
448
|
+
*
|
|
449
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/showCompetitionUser
|
|
450
|
+
*
|
|
451
|
+
* @param competition_id
|
|
452
|
+
* @param user_id
|
|
453
|
+
* @returns promise
|
|
454
|
+
*/
|
|
455
|
+
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});
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Update the user associated with competition.
|
|
461
|
+
*
|
|
462
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateCompetitionUser
|
|
463
|
+
*
|
|
464
|
+
* @param competition_id
|
|
465
|
+
* @param user_id
|
|
466
|
+
* @returns promise
|
|
467
|
+
*/
|
|
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});
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Remove the associated user from the competition.
|
|
474
|
+
*
|
|
475
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/removeCompetitionUser
|
|
476
|
+
*
|
|
477
|
+
* @param competition_id
|
|
478
|
+
* @param user_id
|
|
479
|
+
* @returns promise
|
|
480
|
+
*/
|
|
481
|
+
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});
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* List all the venues associated with a competition.
|
|
487
|
+
*
|
|
488
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/venueList
|
|
489
|
+
*
|
|
490
|
+
* @param competition_id
|
|
491
|
+
* @returns promise
|
|
492
|
+
*/
|
|
493
|
+
public static venues<T>(competition_id : string): AxiosPromise<Response<T>>{
|
|
494
|
+
return Requests.processRoute(CompetitionRoutes.routes.venues, {competition_id : competition_id});
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Creating a new venue.
|
|
499
|
+
*
|
|
500
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/createVenue
|
|
501
|
+
*
|
|
502
|
+
* @param competition_id
|
|
503
|
+
* @returns promise
|
|
504
|
+
*/
|
|
505
|
+
public static newVenue<T>(competition_id : string): AxiosPromise<Response<T>>{
|
|
506
|
+
return Requests.processRoute(CompetitionRoutes.routes.newVenue, {competition_id : competition_id});
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Show a single venue by its ID.
|
|
511
|
+
*
|
|
512
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/showVenue
|
|
513
|
+
*
|
|
514
|
+
* @param competition_id
|
|
515
|
+
* @param venue_id
|
|
516
|
+
* @returns promise
|
|
517
|
+
*/
|
|
518
|
+
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});
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Update the venue.
|
|
524
|
+
*
|
|
525
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateVenue
|
|
526
|
+
*
|
|
527
|
+
* @param competition_id
|
|
528
|
+
* @param venue_id
|
|
529
|
+
* @returns promise
|
|
530
|
+
*/
|
|
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});
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Deletes the venue from the competition.
|
|
537
|
+
*
|
|
538
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/removeCompetitionVenue
|
|
539
|
+
*
|
|
540
|
+
* @param competition_id
|
|
541
|
+
* @param venue_id
|
|
542
|
+
* @returns promise
|
|
543
|
+
*/
|
|
544
|
+
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});
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Upload venue main image to storage.
|
|
550
|
+
*
|
|
551
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
|
|
552
|
+
*
|
|
553
|
+
* @param competition_id
|
|
554
|
+
* @param venue_id
|
|
555
|
+
* @returns promise
|
|
556
|
+
*/
|
|
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});
|
|
559
|
+
}
|
|
77
560
|
}
|
|
78
561
|
|
|
79
562
|
export default Competitions;
|