glitch-javascript-sdk 0.0.4 → 0.0.7

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.
@@ -9,8 +9,47 @@ class CompetitionRoutes {
9
9
  view : { url: '/competitions/{competition_id}', method: HTTP_METHODS.GET },
10
10
  update :{ url: '/competitions/{competition_id}', method: HTTP_METHODS.PUT },
11
11
  delete : { url: '/competitions/{competition_id}', method: HTTP_METHODS.DELETE },
12
+ addTeam : { url: '/competitions/{competition_id}/addTeam', method: HTTP_METHODS.POST },
13
+ addParticipant : { url: '/competitions/{competition_id}/addParticipant', method: HTTP_METHODS.POST },
14
+ registerTeam : { url: '/competitions/{competition_id}/registerTeam', method: HTTP_METHODS.POST },
15
+ registerUser : { url: '/competitions/{competition_id}/registerUser', method: HTTP_METHODS.POST },
16
+ syncRounds : { url: '/competitions/{competition_id}/syncRounds', method: HTTP_METHODS.GET },
17
+ autoGenerate : { url: '/competitions/{competition_id}/rounds/{round_id}/brackets/autoGenerate', method: HTTP_METHODS.GET },
18
+ autoGenerateUserBrackets : { url: '/competitions/{competition_id}/autoGenerateUserBrackets', method: HTTP_METHODS.GET },
19
+ uploadMainImage : { url: '/competitions/{competition_id}/uploadMainImage', method: HTTP_METHODS.POST },
20
+ uploadBannerImage : { url: '/competitions/{competition_id}/uploadBannerImage', method: HTTP_METHODS.POST },
21
+ invites : { url: '/competitions/{competition_id}/invites', method: HTTP_METHODS.GET },
22
+ sendInvite : { url: '/competitions/{competition_id}/sendInvite', method: HTTP_METHODS.POST },
23
+ acceptInvite : { url: '/competitions/{competition_id}/acceptInvite', method: HTTP_METHODS.POST },
24
+ brackets : { url: '/competitions/{competition_id}/rounds/{round_id}/brackets', method: HTTP_METHODS.GET },
25
+ bracketStore : { url: '/competitions/{competition_id}/rounds/{round_id}/brackets', method: HTTP_METHODS.POST },
26
+ showBracket : { url: '/competitions/{competition_id}/rounds/{round_id}/brackets/{bracket_id}', method: HTTP_METHODS.GET },
27
+ updateBracket : { url: '/competitions/{competition_id}/rounds/{round_id}/brackets/{bracket_id}', method: HTTP_METHODS.PUT },
28
+ destroyBracket : { url: '/competitions/{competition_id}/rounds/{round_id}/brackets/{bracket_id}', method: HTTP_METHODS.DELETE },
29
+ rounds : { url: '/competitions/{competition_id}/rounds', method: HTTP_METHODS.GET },
30
+ roundStore : { url: '/competitions/{competition_id}/rounds', method: HTTP_METHODS.POST },
31
+ showRound : { url: '/competitions/{competition_id}/rounds/{round_id}', method: HTTP_METHODS.GET },
32
+ updateRound : { url: '/competitions/{competition_id}/rounds/{round_id}', method: HTTP_METHODS.PUT },
33
+ destroyRound : { url: '/competitions/{competition_id}/rounds/{round_id}', method: HTTP_METHODS.DELETE },
34
+ team : { url: '/competitions/{competition_id}/teams', method: HTTP_METHODS.GET },
35
+ teamStore : { url: '/competitions/{competition_id}/teams', method: HTTP_METHODS.POST },
36
+ showTeam : { url: '/competitions/{competition_id}/teams/{team_id}', method: HTTP_METHODS.GET },
37
+ updateTeam : { url: '/competitions/{competition_id}/teams/{team_id}', method: HTTP_METHODS.PUT },
38
+ destroyTeam : { url: '/competitions/{competition_id}/teams/{team_id}', method: HTTP_METHODS.DELETE },
39
+ users : { url: '/competitions/{competition_id}/users', method: HTTP_METHODS.GET },
40
+ competitionUser : { url: '/competitions/{competition_id}/users', method: HTTP_METHODS.POST },
41
+ showCompetitionUser : { url: '/competitions/{competition_id}/users/{user_id}', method: HTTP_METHODS.GET },
42
+ updateCompetitionUser : { url: '/competitions/{competition_id}/users/{user_id}', method: HTTP_METHODS.PUT },
43
+ destroyCompetitionUser : { url: '/competitions/{competition_id}/users/{user_id}', method: HTTP_METHODS.DELETE },
44
+ venues : { url: '/competitions/{competition_id}/venues', method: HTTP_METHODS.GET },
45
+ newVenue : { url: '/competitions/{competition_id}/venues', method: HTTP_METHODS.POST },
46
+ showVenue : { url: '/competitions/{competition_id}/venues/{venue_id}', method: HTTP_METHODS.GET },
47
+ updateVenue : { url: '/competitions/{competition_id}/venues/{venue_id}', method: HTTP_METHODS.PUT },
48
+ destroyVenue : { url: '/competitions/{competition_id}/venues/{venue_id}', method: HTTP_METHODS.DELETE },
49
+ uploadVenueMainImage : { url: '/competitions/{competition_id}/venues/{venue_id}/uploadMainImage', method: HTTP_METHODS.POST },
12
50
  };
13
51
 
52
+
14
53
  }
15
54
 
16
55
  export default CompetitionRoutes;
@@ -0,0 +1,16 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class RecordingsRoute {
5
+
6
+ public static routes: { [key: string]: Route } = {
7
+ login: { url: '/auth/login', method: HTTP_METHODS.POST },
8
+ register: { url: '/auth/register', method: HTTP_METHODS.POST },
9
+ one_time_login : { url: '/auth/oneTimeLoginWithToken', method: HTTP_METHODS.POST },
10
+ forgot_password :{ url: '/auth/forgotpassword', method: HTTP_METHODS.POST },
11
+ reset_password : { url: '/auth/resetpassword', method: HTTP_METHODS.POST },
12
+ };
13
+
14
+ }
15
+
16
+ export default RecordingsRoute;
@@ -0,0 +1,16 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class WaitlistRoutes {
5
+
6
+ public static routes: { [key: string]: Route } = {
7
+ list: { url: '/waitlists', method: HTTP_METHODS.GET },
8
+ create: { url: '/waitlists', method: HTTP_METHODS.POST },
9
+ show : { url: '/waitlists/{waitlist_id}', method: HTTP_METHODS.GET},
10
+ update : { url: '/waitlists/{waitlist_id}', method: HTTP_METHODS.PUT},
11
+ delete : { url: '/waitlists/{waitlist_id}', method: HTTP_METHODS.DELETE},
12
+ };
13
+
14
+ }
15
+
16
+ export default WaitlistRoutes;
@@ -19,18 +19,6 @@ class Requests {
19
19
  this.config = config;
20
20
  }
21
21
 
22
- /**
23
- * Sets the configuration of the system.
24
- *
25
- * @param config Config The config class.
26
- */
27
- public static setConfig(config: Config) {
28
-
29
- this.baseUrl = config.baseUrl;
30
-
31
- this.authToken = config.authToken;
32
- }
33
-
34
22
  /**
35
23
  * Sets the base url of the API.
36
24
  *
@@ -57,7 +45,7 @@ class Requests {
57
45
  fileData?: any
58
46
  ): AxiosPromise<Response<T>> {
59
47
 
60
- let headers = {
48
+ let headers : { [key: string]: string } = {
61
49
  'Content-Type': 'application/json',
62
50
  };
63
51
 
@@ -145,7 +133,7 @@ class Requests {
145
133
  * @param data
146
134
  * @returns
147
135
  */
148
- public static processRoute<T>(route : Route, data? : object, routeReplace? : object) : AxiosPromise<Response<T>> {
136
+ public static processRoute<T>(route : Route, data? : object, routeReplace? : {[key: string]: any}) : AxiosPromise<Response<T>> {
149
137
 
150
138
  let url = route.url;
151
139