glitch-javascript-sdk 0.0.4 → 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.
@@ -49,5 +49,377 @@ declare class Competitions {
49
49
  * @returns promise
50
50
  */
51
51
  static delete<T>(competition_id: string): AxiosPromise<Response<T>>;
52
+ /**
53
+ * Add a team
54
+ *
55
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/addTeam
56
+ *
57
+ * @param competition_id
58
+ * @param team_id
59
+ * @returns promise
60
+ */
61
+ static addTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
62
+ /**
63
+ * Adds participant
64
+ *
65
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/addParticipant
66
+ *
67
+ * @param competition_id
68
+ * @param user_id
69
+ * @returns promise
70
+ */
71
+ static addParticipant<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
72
+ /**
73
+ * Register a team
74
+ *
75
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/registerTeam
76
+ *
77
+ * @param competition_id
78
+ * @param team_id
79
+ * @returns promise
80
+ */
81
+ static registerTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
82
+ /**
83
+ * Register a user
84
+ *
85
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/registerParticipant
86
+ *
87
+ * @param competition_id
88
+ * @returns promise
89
+ */
90
+ static registerUser<T>(competition_id: string): AxiosPromise<Response<T>>;
91
+ /**
92
+ * Sync rounds
93
+ *
94
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/syncRounds
95
+ *
96
+ * @param competition_id
97
+ * @param number_of_competitors
98
+ * @param competitors_per_bracket
99
+ * @returns promise
100
+ */
101
+ static syncRounds<T>(competition_id: string): AxiosPromise<Response<T>>;
102
+ /**
103
+ * auto generate team brackets
104
+ *
105
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/autoGenerateTeamBrackets
106
+ *
107
+ * @param competition_id
108
+ * @param round_id
109
+ * @returns promise
110
+ */
111
+ static autoGenerate<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
112
+ /**
113
+ * auto generate user brackets
114
+ *
115
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/autoGenerateUserBrackets
116
+ *
117
+ * @param competition_id
118
+ * @returns promise
119
+ */
120
+ static autoGenerateUserBrackets<T>(competition_id: string): AxiosPromise<Response<T>>;
121
+ /**
122
+ * Upload main image
123
+ *
124
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
125
+ *
126
+ * @param competition_id
127
+ * @param image
128
+ * @returns promise
129
+ */
130
+ static uploadMainImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>;
131
+ /**
132
+ * Upload banner image
133
+ *
134
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
135
+ *
136
+ * @param competition_id
137
+ * @param image
138
+ * @returns promise
139
+ */
140
+ static uploadBannerImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>;
141
+ /**
142
+ * Invites
143
+ *
144
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserInviteList
145
+ *
146
+ * @param competition_id
147
+ * @returns promise
148
+ */
149
+ static invites<T>(competition_id: string): AxiosPromise<Response<T>>;
150
+ /**
151
+ * Sends invite
152
+ *
153
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionSendInvite
154
+ *
155
+ * @param competition_id
156
+ * @returns promise
157
+ */
158
+ static sendInvite<T>(competition_id: string): AxiosPromise<Response<T>>;
159
+ /**
160
+ * Accept invite
161
+ *
162
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionAcceptInvite
163
+ *
164
+ * @param competition_id
165
+ * @param token
166
+ * @returns promise
167
+ */
168
+ static acceptInvite<T>(competition_id: string, token: string): AxiosPromise<Response<T>>;
169
+ /**
170
+ * Round brackets
171
+ *
172
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundBracketList1
173
+ *
174
+ * @param competition_id
175
+ * @param round_id
176
+ * @returns promise
177
+ */
178
+ static brackets<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
179
+ /**
180
+ * Store round brackets
181
+ *
182
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundBracketStorage
183
+ *
184
+ * @param competition_id
185
+ * @param round_id
186
+ * @returns promise
187
+ */
188
+ static bracketStore<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
189
+ /**
190
+ * Show round bracket
191
+ *
192
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundBracketShow
193
+ *
194
+ * @param competition_id
195
+ * @param round_id
196
+ * @param bracket_id
197
+ * @returns promise
198
+ */
199
+ static showBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>;
200
+ /**
201
+ * Update bracket
202
+ *
203
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateRoundBracket
204
+ *
205
+ * @param competition_id
206
+ * @param round_id
207
+ * @param bracket_id
208
+ * @returns promise
209
+ */
210
+ static updateBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>;
211
+ /**
212
+ * Delete bracket
213
+ *
214
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryRoundBracket
215
+ *
216
+ * @param competition_id
217
+ * @param round_id
218
+ * @param bracket_id
219
+ * @returns promise
220
+ */
221
+ static destroyBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>;
222
+ /**
223
+ * List round
224
+ *
225
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundList
226
+ *
227
+ * @param competition_id
228
+ * @returns promise
229
+ */
230
+ static rounds<T>(competition_id: string): AxiosPromise<Response<T>>;
231
+ /**
232
+ * Create a new round for competition
233
+ *
234
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundStorage
235
+ *
236
+ * @param competition_id
237
+ * @returns promise
238
+ */
239
+ static roundStore<T>(competition_id: string): AxiosPromise<Response<T>>;
240
+ /**
241
+ * Retrieve the information for a single round.
242
+ *
243
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundShow
244
+ *
245
+ * @param competition_id
246
+ * @param round_id
247
+ * @returns promise
248
+ */
249
+ static showRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
250
+ /**
251
+ * Updating resource in storage with new information.
252
+ *
253
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateRound
254
+ *
255
+ * @param competition_id
256
+ * @param round_id
257
+ * @returns promise
258
+ */
259
+ static updateRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
260
+ /**
261
+ * Deletes the round for the competition.
262
+ *
263
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryRound
264
+ *
265
+ * @param competition_id
266
+ * @param round_id
267
+ * @returns promise
268
+ */
269
+ static destroyRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
270
+ /**
271
+ * Retrieve a list of teams associated with the competition.
272
+ *
273
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceCompetitionTeamList
274
+ *
275
+ * @param competition_id
276
+ * @returns promise
277
+ */
278
+ static team<T>(competition_id: string): AxiosPromise<Response<T>>;
279
+ /**
280
+ * Associate a new team with the competition.
281
+ *
282
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceCompetitionTeamStorage
283
+ *
284
+ * @param competition_id
285
+ * @returns promise
286
+ */
287
+ static teamStore<T>(competition_id: string): AxiosPromise<Response<T>>;
288
+ /**
289
+ * Display the contents of a single team associated with the competition.
290
+ *
291
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceTeamShow
292
+ *
293
+ * @param competition_id
294
+ * @param team
295
+ * @returns promise
296
+ */
297
+ static showTeam<T>(competition_id: string, team: string): AxiosPromise<Response<T>>;
298
+ /**
299
+ * Update the team information associated with the competition.
300
+ *
301
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateTeam
302
+ *
303
+ * @param competition_id
304
+ * @param team_id
305
+ * @returns promise
306
+ */
307
+ static updateTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
308
+ /**
309
+ * Removes the team from the competition.
310
+ *
311
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryTeam
312
+ *
313
+ * @param competition_id
314
+ * @param team_id
315
+ * @returns promise
316
+ */
317
+ static destroyTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
318
+ /**
319
+ * List all the users associated with a competition.
320
+ *
321
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
322
+ *
323
+ * @param competition_id
324
+ * @returns promise
325
+ */
326
+ static users<T>(competition_id: string): AxiosPromise<Response<T>>;
327
+ /**
328
+ * Associate a new users with the competition.
329
+ *
330
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/createCompetitionUser
331
+ *
332
+ * @param competition_id
333
+ * @returns promise
334
+ */
335
+ static competitionUser<T>(competition_id: string): AxiosPromise<Response<T>>;
336
+ /**
337
+ * Show a single user by its ID.
338
+ *
339
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/showCompetitionUser
340
+ *
341
+ * @param competition_id
342
+ * @param user_id
343
+ * @returns promise
344
+ */
345
+ static showCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
346
+ /**
347
+ * Update the user associated with competition.
348
+ *
349
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateCompetitionUser
350
+ *
351
+ * @param competition_id
352
+ * @param user_id
353
+ * @returns promise
354
+ */
355
+ static updateCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
356
+ /**
357
+ * Remove the associated user from the competition.
358
+ *
359
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/removeCompetitionUser
360
+ *
361
+ * @param competition_id
362
+ * @param user_id
363
+ * @returns promise
364
+ */
365
+ static destroyCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
366
+ /**
367
+ * List all the venues associated with a competition.
368
+ *
369
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/venueList
370
+ *
371
+ * @param competition_id
372
+ * @returns promise
373
+ */
374
+ static venues<T>(competition_id: string): AxiosPromise<Response<T>>;
375
+ /**
376
+ * Creating a new venue.
377
+ *
378
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/createVenue
379
+ *
380
+ * @param competition_id
381
+ * @returns promise
382
+ */
383
+ static newVenue<T>(competition_id: string): AxiosPromise<Response<T>>;
384
+ /**
385
+ * Show a single venue by its ID.
386
+ *
387
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/showVenue
388
+ *
389
+ * @param competition_id
390
+ * @param venue_id
391
+ * @returns promise
392
+ */
393
+ static showVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
394
+ /**
395
+ * Update the venue.
396
+ *
397
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateVenue
398
+ *
399
+ * @param competition_id
400
+ * @param venue_id
401
+ * @returns promise
402
+ */
403
+ static updateVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
404
+ /**
405
+ * Deletes the venue from the competition.
406
+ *
407
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/removeCompetitionVenue
408
+ *
409
+ * @param competition_id
410
+ * @param venue_id
411
+ * @returns promise
412
+ */
413
+ static destroyVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
414
+ /**
415
+ * Upload venue main image to storage.
416
+ *
417
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
418
+ *
419
+ * @param competition_id
420
+ * @param venue_id
421
+ * @returns promise
422
+ */
423
+ static uploadVenueMainImage<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
52
424
  }
53
425
  export default Competitions;
@@ -0,0 +1,53 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Teams {
4
+ /**
5
+ * List all the waitlist sign-ups.
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/Waitlist%20Route/waitlistList
8
+ *
9
+ * @returns promise
10
+ */
11
+ static list<T>(): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Sign-up to the waitlist.
14
+ *
15
+ * @see https://api.glitch.fun/api/documentation#/Waitlist%20Route/waitlistCreate
16
+ *
17
+ * @param data The data to be passed when creating a team.
18
+ *
19
+ * @returns Promise
20
+ */
21
+ static create<T>(data: object): AxiosPromise<Response<T>>;
22
+ /**
23
+ * Update a waitlist.
24
+ *
25
+ * @see https://api.glitch.fun/api/documentation#/Waitlist%20Route/waitlistUpdate
26
+ *
27
+ * @param waitlist_id The id of the team to update.
28
+ * @param data The data to update.
29
+ *
30
+ * @returns promise
31
+ */
32
+ static update<T>(waitlist_id: string, data: object): AxiosPromise<Response<T>>;
33
+ /**
34
+ * Retrieve the information for a single user who signed-up to the waitlist.
35
+ *
36
+ * @see https://api.glitch.fun/api/documentation#/Waitlist%20Route/waitlistUpdate
37
+ *
38
+ * @param waitlist_id The id fo the team to retrieve.
39
+ *
40
+ * @returns promise
41
+ */
42
+ static view<T>(waitlist_id: string): AxiosPromise<Response<T>>;
43
+ /**
44
+ * Deletes an entry from the waitlist.
45
+ *
46
+ * @see https://api.glitch.fun/api/documentation#/Waitlist%20Route/waitlistDelete
47
+ *
48
+ * @param waitlist_id The id of the team to delete.
49
+ * @returns promise
50
+ */
51
+ static delete<T>(waitlist_id: string): AxiosPromise<Response<T>>;
52
+ }
53
+ export default Teams;
@@ -5,13 +5,13 @@ import { Users } from "./api";
5
5
  import { Events } from "./api";
6
6
  import { Teams } from "./api";
7
7
  declare class Glitch {
8
- static config: typeof Config;
8
+ static config: Config;
9
9
  static api: {
10
- Auth: typeof Auth;
11
- Competitions: typeof Competitions;
12
- Users: typeof Users;
13
- Events: typeof Events;
14
- Teams: typeof Teams;
10
+ Auth: Auth;
11
+ Competitions: Competitions;
12
+ Users: Users;
13
+ Events: Events;
14
+ Teams: Teams;
15
15
  };
16
16
  }
17
17
  export { Glitch };