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.
@@ -0,0 +1,7 @@
1
+ import Route from "./interface";
2
+ declare class RecordingsRoute {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default RecordingsRoute;
@@ -0,0 +1,7 @@
1
+ import Route from "./interface";
2
+ declare class WaitlistRoutes {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default WaitlistRoutes;
@@ -46,6 +46,8 @@ declare class Requests {
46
46
  * @param data
47
47
  * @returns
48
48
  */
49
- static processRoute<T>(route: Route, data?: object, routeReplace?: object): AxiosPromise<Response<T>>;
49
+ static processRoute<T>(route: Route, data?: object, routeReplace?: {
50
+ [key: string]: any;
51
+ }): AxiosPromise<Response<T>>;
50
52
  }
51
53
  export default Requests;
package/dist/index.d.ts CHANGED
@@ -104,6 +104,378 @@ declare class Competitions {
104
104
  * @returns promise
105
105
  */
106
106
  static delete<T>(competition_id: string): AxiosPromise<Response<T>>;
107
+ /**
108
+ * Add a team
109
+ *
110
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/addTeam
111
+ *
112
+ * @param competition_id
113
+ * @param team_id
114
+ * @returns promise
115
+ */
116
+ static addTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
117
+ /**
118
+ * Adds participant
119
+ *
120
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/addParticipant
121
+ *
122
+ * @param competition_id
123
+ * @param user_id
124
+ * @returns promise
125
+ */
126
+ static addParticipant<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
127
+ /**
128
+ * Register a team
129
+ *
130
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/registerTeam
131
+ *
132
+ * @param competition_id
133
+ * @param team_id
134
+ * @returns promise
135
+ */
136
+ static registerTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
137
+ /**
138
+ * Register a user
139
+ *
140
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/registerParticipant
141
+ *
142
+ * @param competition_id
143
+ * @returns promise
144
+ */
145
+ static registerUser<T>(competition_id: string): AxiosPromise<Response<T>>;
146
+ /**
147
+ * Sync rounds
148
+ *
149
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/syncRounds
150
+ *
151
+ * @param competition_id
152
+ * @param number_of_competitors
153
+ * @param competitors_per_bracket
154
+ * @returns promise
155
+ */
156
+ static syncRounds<T>(competition_id: string): AxiosPromise<Response<T>>;
157
+ /**
158
+ * auto generate team brackets
159
+ *
160
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/autoGenerateTeamBrackets
161
+ *
162
+ * @param competition_id
163
+ * @param round_id
164
+ * @returns promise
165
+ */
166
+ static autoGenerate<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
167
+ /**
168
+ * auto generate user brackets
169
+ *
170
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/autoGenerateUserBrackets
171
+ *
172
+ * @param competition_id
173
+ * @returns promise
174
+ */
175
+ static autoGenerateUserBrackets<T>(competition_id: string): AxiosPromise<Response<T>>;
176
+ /**
177
+ * Upload main image
178
+ *
179
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage
180
+ *
181
+ * @param competition_id
182
+ * @param image
183
+ * @returns promise
184
+ */
185
+ static uploadMainImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>;
186
+ /**
187
+ * Upload banner image
188
+ *
189
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage
190
+ *
191
+ * @param competition_id
192
+ * @param image
193
+ * @returns promise
194
+ */
195
+ static uploadBannerImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>;
196
+ /**
197
+ * Invites
198
+ *
199
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserInviteList
200
+ *
201
+ * @param competition_id
202
+ * @returns promise
203
+ */
204
+ static invites<T>(competition_id: string): AxiosPromise<Response<T>>;
205
+ /**
206
+ * Sends invite
207
+ *
208
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionSendInvite
209
+ *
210
+ * @param competition_id
211
+ * @returns promise
212
+ */
213
+ static sendInvite<T>(competition_id: string): AxiosPromise<Response<T>>;
214
+ /**
215
+ * Accept invite
216
+ *
217
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionAcceptInvite
218
+ *
219
+ * @param competition_id
220
+ * @param token
221
+ * @returns promise
222
+ */
223
+ static acceptInvite<T>(competition_id: string, token: string): AxiosPromise<Response<T>>;
224
+ /**
225
+ * Round brackets
226
+ *
227
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundBracketList1
228
+ *
229
+ * @param competition_id
230
+ * @param round_id
231
+ * @returns promise
232
+ */
233
+ static brackets<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
234
+ /**
235
+ * Store round brackets
236
+ *
237
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundBracketStorage
238
+ *
239
+ * @param competition_id
240
+ * @param round_id
241
+ * @returns promise
242
+ */
243
+ static bracketStore<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
244
+ /**
245
+ * Show round bracket
246
+ *
247
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundBracketShow
248
+ *
249
+ * @param competition_id
250
+ * @param round_id
251
+ * @param bracket_id
252
+ * @returns promise
253
+ */
254
+ static showBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>;
255
+ /**
256
+ * Update bracket
257
+ *
258
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateRoundBracket
259
+ *
260
+ * @param competition_id
261
+ * @param round_id
262
+ * @param bracket_id
263
+ * @returns promise
264
+ */
265
+ static updateBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>;
266
+ /**
267
+ * Delete bracket
268
+ *
269
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryRoundBracket
270
+ *
271
+ * @param competition_id
272
+ * @param round_id
273
+ * @param bracket_id
274
+ * @returns promise
275
+ */
276
+ static destroyBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>;
277
+ /**
278
+ * List round
279
+ *
280
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundList
281
+ *
282
+ * @param competition_id
283
+ * @returns promise
284
+ */
285
+ static rounds<T>(competition_id: string): AxiosPromise<Response<T>>;
286
+ /**
287
+ * Create a new round for competition
288
+ *
289
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundStorage
290
+ *
291
+ * @param competition_id
292
+ * @returns promise
293
+ */
294
+ static roundStore<T>(competition_id: string): AxiosPromise<Response<T>>;
295
+ /**
296
+ * Retrieve the information for a single round.
297
+ *
298
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceRoundShow
299
+ *
300
+ * @param competition_id
301
+ * @param round_id
302
+ * @returns promise
303
+ */
304
+ static showRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
305
+ /**
306
+ * Updating resource in storage with new information.
307
+ *
308
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateRound
309
+ *
310
+ * @param competition_id
311
+ * @param round_id
312
+ * @returns promise
313
+ */
314
+ static updateRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
315
+ /**
316
+ * Deletes the round for the competition.
317
+ *
318
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryRound
319
+ *
320
+ * @param competition_id
321
+ * @param round_id
322
+ * @returns promise
323
+ */
324
+ static destroyRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>;
325
+ /**
326
+ * Retrieve a list of teams associated with the competition.
327
+ *
328
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceCompetitionTeamList
329
+ *
330
+ * @param competition_id
331
+ * @returns promise
332
+ */
333
+ static team<T>(competition_id: string): AxiosPromise<Response<T>>;
334
+ /**
335
+ * Associate a new team with the competition.
336
+ *
337
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceCompetitionTeamStorage
338
+ *
339
+ * @param competition_id
340
+ * @returns promise
341
+ */
342
+ static teamStore<T>(competition_id: string): AxiosPromise<Response<T>>;
343
+ /**
344
+ * Display the contents of a single team associated with the competition.
345
+ *
346
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceTeamShow
347
+ *
348
+ * @param competition_id
349
+ * @param team
350
+ * @returns promise
351
+ */
352
+ static showTeam<T>(competition_id: string, team: string): AxiosPromise<Response<T>>;
353
+ /**
354
+ * Update the team information associated with the competition.
355
+ *
356
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateTeam
357
+ *
358
+ * @param competition_id
359
+ * @param team_id
360
+ * @returns promise
361
+ */
362
+ static updateTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
363
+ /**
364
+ * Removes the team from the competition.
365
+ *
366
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryTeam
367
+ *
368
+ * @param competition_id
369
+ * @param team_id
370
+ * @returns promise
371
+ */
372
+ static destroyTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>;
373
+ /**
374
+ * List all the users associated with a competition.
375
+ *
376
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
377
+ *
378
+ * @param competition_id
379
+ * @returns promise
380
+ */
381
+ static users<T>(competition_id: string): AxiosPromise<Response<T>>;
382
+ /**
383
+ * Associate a new users with the competition.
384
+ *
385
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/createCompetitionUser
386
+ *
387
+ * @param competition_id
388
+ * @returns promise
389
+ */
390
+ static competitionUser<T>(competition_id: string): AxiosPromise<Response<T>>;
391
+ /**
392
+ * Show a single user by its ID.
393
+ *
394
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/showCompetitionUser
395
+ *
396
+ * @param competition_id
397
+ * @param user_id
398
+ * @returns promise
399
+ */
400
+ static showCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
401
+ /**
402
+ * Update the user associated with competition.
403
+ *
404
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateCompetitionUser
405
+ *
406
+ * @param competition_id
407
+ * @param user_id
408
+ * @returns promise
409
+ */
410
+ static updateCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
411
+ /**
412
+ * Remove the associated user from the competition.
413
+ *
414
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/removeCompetitionUser
415
+ *
416
+ * @param competition_id
417
+ * @param user_id
418
+ * @returns promise
419
+ */
420
+ static destroyCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>;
421
+ /**
422
+ * List all the venues associated with a competition.
423
+ *
424
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/venueList
425
+ *
426
+ * @param competition_id
427
+ * @returns promise
428
+ */
429
+ static venues<T>(competition_id: string): AxiosPromise<Response<T>>;
430
+ /**
431
+ * Creating a new venue.
432
+ *
433
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/createVenue
434
+ *
435
+ * @param competition_id
436
+ * @returns promise
437
+ */
438
+ static newVenue<T>(competition_id: string): AxiosPromise<Response<T>>;
439
+ /**
440
+ * Show a single venue by its ID.
441
+ *
442
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/showVenue
443
+ *
444
+ * @param competition_id
445
+ * @param venue_id
446
+ * @returns promise
447
+ */
448
+ static showVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
449
+ /**
450
+ * Update the venue.
451
+ *
452
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateVenue
453
+ *
454
+ * @param competition_id
455
+ * @param venue_id
456
+ * @returns promise
457
+ */
458
+ static updateVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
459
+ /**
460
+ * Deletes the venue from the competition.
461
+ *
462
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/removeCompetitionVenue
463
+ *
464
+ * @param competition_id
465
+ * @param venue_id
466
+ * @returns promise
467
+ */
468
+ static destroyVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
469
+ /**
470
+ * Upload venue main image to storage.
471
+ *
472
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage
473
+ *
474
+ * @param competition_id
475
+ * @param venue_id
476
+ * @returns promise
477
+ */
478
+ static uploadVenueMainImage<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>;
107
479
  }
108
480
 
109
481
  declare class Users {
@@ -653,13 +1025,13 @@ declare class Teams {
653
1025
  }
654
1026
 
655
1027
  declare class Glitch {
656
- static config: typeof Config;
1028
+ static config: Config;
657
1029
  static api: {
658
- Auth: typeof Auth;
659
- Competitions: typeof Competitions;
660
- Users: typeof Users;
661
- Events: typeof Events;
662
- Teams: typeof Teams;
1030
+ Auth: Auth;
1031
+ Competitions: Competitions;
1032
+ Users: Users;
1033
+ Events: Events;
1034
+ Teams: Teams;
663
1035
  };
664
1036
  }
665
1037
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.0.4",
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.15",
30
+ "typedoc": "^0.23.27",
35
31
  "typescript": "^4.8.4"
36
32
  },
37
33
  "dependencies": {