glitch-javascript-sdk 0.2.5 → 0.2.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 +289 -160
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Communities.d.ts +20 -20
- package/dist/esm/api/Competitions.d.ts +40 -40
- package/dist/esm/api/Events.d.ts +17 -17
- package/dist/esm/api/Teams.d.ts +7 -7
- package/dist/esm/api/Templates.d.ts +9 -9
- package/dist/esm/api/Users.d.ts +3 -3
- package/dist/esm/api/Waitlist.d.ts +5 -5
- package/dist/esm/config/Config.d.ts +12 -0
- package/dist/esm/index.js +445 -316
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/models/community.d.ts +40 -0
- package/dist/esm/models/template.d.ts +15 -0
- package/dist/esm/models/user.d.ts +29 -0
- package/dist/esm/util/Requests.d.ts +14 -7
- package/dist/index.d.ts +208 -108
- package/package.json +1 -1
- package/src/api/Communities.ts +39 -39
- package/src/api/Competitions.ts +45 -45
- package/src/api/Events.ts +21 -21
- package/src/api/Teams.ts +14 -14
- package/src/api/Templates.ts +14 -14
- package/src/api/Users.ts +7 -6
- package/src/api/Waitlist.ts +10 -10
- package/src/config/Config.ts +20 -0
- package/src/models/community.ts +42 -0
- package/src/models/template.ts +16 -0
- package/src/models/user.ts +31 -0
- package/src/util/Requests.ts +102 -11
package/src/api/Events.ts
CHANGED
|
@@ -12,8 +12,8 @@ class Events {
|
|
|
12
12
|
*
|
|
13
13
|
* @returns promise
|
|
14
14
|
*/
|
|
15
|
-
public static list<T>(): AxiosPromise<Response<T>> {
|
|
16
|
-
return Requests.processRoute(EventsRoutes.routes.list);
|
|
15
|
+
public static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
16
|
+
return Requests.processRoute(EventsRoutes.routes.list, undefined, undefined, params);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -25,9 +25,9 @@ class Events {
|
|
|
25
25
|
*
|
|
26
26
|
* @returns Promise
|
|
27
27
|
*/
|
|
28
|
-
public static create<T>(data: object): AxiosPromise<Response<T>> {
|
|
28
|
+
public static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
29
29
|
|
|
30
|
-
return Requests.processRoute(EventsRoutes.routes.create, data);
|
|
30
|
+
return Requests.processRoute(EventsRoutes.routes.create, data, undefined, params);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
@@ -40,9 +40,9 @@ class Events {
|
|
|
40
40
|
*
|
|
41
41
|
* @returns promise
|
|
42
42
|
*/
|
|
43
|
-
public static update<T>(event_id: string, data: object): AxiosPromise<Response<T>> {
|
|
43
|
+
public static update<T>(event_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
44
44
|
|
|
45
|
-
return Requests.processRoute(EventsRoutes.routes.update, data, { event_id: event_id });
|
|
45
|
+
return Requests.processRoute(EventsRoutes.routes.update, data, { event_id: event_id }, params);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
@@ -54,9 +54,9 @@ class Events {
|
|
|
54
54
|
*
|
|
55
55
|
* @returns promise
|
|
56
56
|
*/
|
|
57
|
-
public static view<T>(event_id: string): AxiosPromise<Response<T>> {
|
|
57
|
+
public static view<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
58
58
|
|
|
59
|
-
return Requests.processRoute(EventsRoutes.routes.view, {}, { event_id: event_id });
|
|
59
|
+
return Requests.processRoute(EventsRoutes.routes.view, {}, { event_id: event_id }, params);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -67,7 +67,7 @@ class Events {
|
|
|
67
67
|
* @param event_id The id of the event to delete.
|
|
68
68
|
* @returns promise
|
|
69
69
|
*/
|
|
70
|
-
public static delete<T>(event_id: string): AxiosPromise<Response<T>> {
|
|
70
|
+
public static delete<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
71
71
|
|
|
72
72
|
return Requests.processRoute(EventsRoutes.routes.delete, {}, { event_id: event_id });
|
|
73
73
|
}
|
|
@@ -83,7 +83,7 @@ class Events {
|
|
|
83
83
|
*
|
|
84
84
|
* @returns promise
|
|
85
85
|
*/
|
|
86
|
-
public static updateInvirtuEvent<T>(event_id: string, data: object): AxiosPromise<Response<T>> {
|
|
86
|
+
public static updateInvirtuEvent<T>(event_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
87
87
|
|
|
88
88
|
return Requests.processRoute(EventsRoutes.routes.updateInvirtu, data, { event_id: event_id });
|
|
89
89
|
}
|
|
@@ -98,7 +98,7 @@ class Events {
|
|
|
98
98
|
*
|
|
99
99
|
* @returns promise
|
|
100
100
|
*/
|
|
101
|
-
public static addRTMPSource<T>(event_id: string, data?: object): AxiosPromise<Response<T>> {
|
|
101
|
+
public static addRTMPSource<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
102
102
|
|
|
103
103
|
return Requests.processRoute(EventsRoutes.routes.addRTMPSource, data, { event_id: event_id });
|
|
104
104
|
}
|
|
@@ -113,7 +113,7 @@ class Events {
|
|
|
113
113
|
*
|
|
114
114
|
* @returns promise
|
|
115
115
|
*/
|
|
116
|
-
public static updateRTMPSource<T>(event_id: string, stream_id: string, data?: object): AxiosPromise<Response<T>> {
|
|
116
|
+
public static updateRTMPSource<T>(event_id: string, stream_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
117
117
|
|
|
118
118
|
return Requests.processRoute(EventsRoutes.routes.updateRTMPSource, data, { event_id: event_id, subid: stream_id });
|
|
119
119
|
}
|
|
@@ -128,7 +128,7 @@ class Events {
|
|
|
128
128
|
*
|
|
129
129
|
* @returns promise
|
|
130
130
|
*/
|
|
131
|
-
public static removeRTMPSource<T>(event_id: string, stream_id: string): AxiosPromise<Response<T>> {
|
|
131
|
+
public static removeRTMPSource<T>(event_id: string, stream_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
132
132
|
|
|
133
133
|
return Requests.processRoute(EventsRoutes.routes.removeRTMPSource, {}, { event_id: event_id, subid: stream_id });
|
|
134
134
|
}
|
|
@@ -142,7 +142,7 @@ class Events {
|
|
|
142
142
|
*
|
|
143
143
|
* @returns promise
|
|
144
144
|
*/
|
|
145
|
-
public static syncAsLive<T>(event_id: string): AxiosPromise<Response<T>> {
|
|
145
|
+
public static syncAsLive<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
146
146
|
|
|
147
147
|
return Requests.processRoute(EventsRoutes.routes.syncAsLive, {}, { event_id: event_id });
|
|
148
148
|
}
|
|
@@ -157,7 +157,7 @@ class Events {
|
|
|
157
157
|
*
|
|
158
158
|
* @returns promise
|
|
159
159
|
*/
|
|
160
|
-
public static uploadMainImageFile<T>(event_id: string, file: File, data?: object): AxiosPromise<Response<T>> {
|
|
160
|
+
public static uploadMainImageFile<T>(event_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
161
161
|
|
|
162
162
|
let url = EventsRoutes.routes.uploadMainImage.url.replace('{event_id}', event_id);
|
|
163
163
|
|
|
@@ -174,7 +174,7 @@ class Events {
|
|
|
174
174
|
*
|
|
175
175
|
* @returns promise
|
|
176
176
|
*/
|
|
177
|
-
public static uploadMainImageBlob<T>(event_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>> {
|
|
177
|
+
public static uploadMainImageBlob<T>(event_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
178
178
|
|
|
179
179
|
let url = EventsRoutes.routes.uploadMainImage.url.replace('{event_id}', event_id);
|
|
180
180
|
|
|
@@ -191,7 +191,7 @@ class Events {
|
|
|
191
191
|
*
|
|
192
192
|
* @returns promise
|
|
193
193
|
*/
|
|
194
|
-
public static uploadBannerImageFile<T>(event_id: string, file: File, data?: object): AxiosPromise<Response<T>> {
|
|
194
|
+
public static uploadBannerImageFile<T>(event_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
195
195
|
|
|
196
196
|
let url = EventsRoutes.routes.uploadBannerImage.url.replace('{event_id}', event_id);
|
|
197
197
|
|
|
@@ -208,7 +208,7 @@ class Events {
|
|
|
208
208
|
*
|
|
209
209
|
* @returns promise
|
|
210
210
|
*/
|
|
211
|
-
public static uploadBannerImageBlob<T>(event_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>> {
|
|
211
|
+
public static uploadBannerImageBlob<T>(event_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
212
212
|
|
|
213
213
|
let url = EventsRoutes.routes.uploadBannerImage.url.replace('{event_id}', event_id);
|
|
214
214
|
|
|
@@ -225,7 +225,7 @@ class Events {
|
|
|
225
225
|
*
|
|
226
226
|
* @returns promise
|
|
227
227
|
*/
|
|
228
|
-
public static enableBroadcastMode<T>(event_id: string): AxiosPromise<Response<T>> {
|
|
228
|
+
public static enableBroadcastMode<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
229
229
|
|
|
230
230
|
return Requests.processRoute(EventsRoutes.routes.enableBroadcastMode, {}, { event_id: event_id });
|
|
231
231
|
}
|
|
@@ -238,7 +238,7 @@ class Events {
|
|
|
238
238
|
*
|
|
239
239
|
* @returns promise
|
|
240
240
|
*/
|
|
241
|
-
public static enableLivestreamMode<T>(event_id: string): AxiosPromise<Response<T>> {
|
|
241
|
+
public static enableLivestreamMode<T>(event_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
242
242
|
|
|
243
243
|
return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, {}, { event_id: event_id });
|
|
244
244
|
}
|
|
@@ -253,7 +253,7 @@ class Events {
|
|
|
253
253
|
*
|
|
254
254
|
* @returns promise
|
|
255
255
|
*/
|
|
256
|
-
public static sendOnScreenContent<T>(event_id: string, data: object): AxiosPromise<Response<T>> {
|
|
256
|
+
public static sendOnScreenContent<T>(event_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
257
257
|
|
|
258
258
|
return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, data, { event_id: event_id });
|
|
259
259
|
}
|
package/src/api/Teams.ts
CHANGED
|
@@ -12,8 +12,8 @@ class Teams {
|
|
|
12
12
|
*
|
|
13
13
|
* @returns promise
|
|
14
14
|
*/
|
|
15
|
-
public static list<T>() : AxiosPromise<Response<T>> {
|
|
16
|
-
return Requests.processRoute(TeamsRoutes.routes.list);
|
|
15
|
+
public static list<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
16
|
+
return Requests.processRoute(TeamsRoutes.routes.list, undefined, undefined, params);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -25,9 +25,9 @@ class Teams {
|
|
|
25
25
|
*
|
|
26
26
|
* @returns Promise
|
|
27
27
|
*/
|
|
28
|
-
public static create<T>(data : object) : AxiosPromise<Response<T>> {
|
|
28
|
+
public static create<T>(data : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
29
29
|
|
|
30
|
-
return Requests.processRoute(TeamsRoutes.routes.create, data);
|
|
30
|
+
return Requests.processRoute(TeamsRoutes.routes.create, data, undefined, params);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
@@ -40,9 +40,9 @@ class Teams {
|
|
|
40
40
|
*
|
|
41
41
|
* @returns promise
|
|
42
42
|
*/
|
|
43
|
-
public static update<T>(team_id : string, data : object) : AxiosPromise<Response<T>>{
|
|
43
|
+
public static update<T>(team_id : string, data : object, params?: Record<string, any>) : AxiosPromise<Response<T>>{
|
|
44
44
|
|
|
45
|
-
return Requests.processRoute(TeamsRoutes.routes.create, data, {team_id : team_id});
|
|
45
|
+
return Requests.processRoute(TeamsRoutes.routes.create, data, {team_id : team_id}, undefined);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
@@ -54,9 +54,9 @@ class Teams {
|
|
|
54
54
|
*
|
|
55
55
|
* @returns promise
|
|
56
56
|
*/
|
|
57
|
-
public static view<T>(team_id : string) : AxiosPromise<Response<T>> {
|
|
57
|
+
public static view<T>(team_id : string, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
58
58
|
|
|
59
|
-
return Requests.processRoute(TeamsRoutes.routes.view, {}, {team_id : team_id});
|
|
59
|
+
return Requests.processRoute(TeamsRoutes.routes.view, {}, {team_id : team_id}, params);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -67,9 +67,9 @@ class Teams {
|
|
|
67
67
|
* @param team_id The id of the team to delete.
|
|
68
68
|
* @returns promise
|
|
69
69
|
*/
|
|
70
|
-
public static delete<T>(team_id : string) : AxiosPromise<Response<T>> {
|
|
70
|
+
public static delete<T>(team_id : string, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
71
71
|
|
|
72
|
-
return Requests.processRoute(TeamsRoutes.routes.delete, {}, {team_id : team_id});
|
|
72
|
+
return Requests.processRoute(TeamsRoutes.routes.delete, {}, {team_id : team_id}, params);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/**
|
|
@@ -149,8 +149,8 @@ class Teams {
|
|
|
149
149
|
*
|
|
150
150
|
* @returns promise
|
|
151
151
|
*/
|
|
152
|
-
public static listInvites<T>(team_id : string): AxiosPromise<Response<T>> {
|
|
153
|
-
return Requests.processRoute(TeamsRoutes.routes.listInvites, {}, {team_id : team_id});
|
|
152
|
+
public static listInvites<T>(team_id : string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
153
|
+
return Requests.processRoute(TeamsRoutes.routes.listInvites, {}, {team_id : team_id}, params);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
/**
|
|
@@ -190,8 +190,8 @@ class Teams {
|
|
|
190
190
|
*
|
|
191
191
|
* @returns promise
|
|
192
192
|
*/
|
|
193
|
-
public static listUsers<T>(team_id : string): AxiosPromise<Response<T>> {
|
|
194
|
-
return Requests.processRoute(TeamsRoutes.routes.listTeamUsers, {}, {team_id : team_id});
|
|
193
|
+
public static listUsers<T>(team_id : string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
194
|
+
return Requests.processRoute(TeamsRoutes.routes.listTeamUsers, {}, {team_id : team_id}, params);
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
/**
|
package/src/api/Templates.ts
CHANGED
|
@@ -12,8 +12,8 @@ class Templates {
|
|
|
12
12
|
*
|
|
13
13
|
* @returns promise
|
|
14
14
|
*/
|
|
15
|
-
public static list<T>() : AxiosPromise<Response<T>> {
|
|
16
|
-
return Requests.processRoute(TemplatesRoute.routes.list);
|
|
15
|
+
public static list<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
16
|
+
return Requests.processRoute(TemplatesRoute.routes.list, undefined, undefined, params);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -25,9 +25,9 @@ class Templates {
|
|
|
25
25
|
*
|
|
26
26
|
* @returns Promise
|
|
27
27
|
*/
|
|
28
|
-
public static create<T>(data : object) : AxiosPromise<Response<T>> {
|
|
28
|
+
public static create<T>(data : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
29
29
|
|
|
30
|
-
return Requests.processRoute(TemplatesRoute.routes.create, data);
|
|
30
|
+
return Requests.processRoute(TemplatesRoute.routes.create, data, undefined, params);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
@@ -40,9 +40,9 @@ class Templates {
|
|
|
40
40
|
*
|
|
41
41
|
* @returns promise
|
|
42
42
|
*/
|
|
43
|
-
public static update<T>(template_id : string, data : object) : AxiosPromise<Response<T>>{
|
|
43
|
+
public static update<T>(template_id : string, data : object, params?: Record<string, any>) : AxiosPromise<Response<T>>{
|
|
44
44
|
|
|
45
|
-
return Requests.processRoute(TemplatesRoute.routes.update, data, {template_id : template_id});
|
|
45
|
+
return Requests.processRoute(TemplatesRoute.routes.update, data, {template_id : template_id}, params);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
@@ -54,9 +54,9 @@ class Templates {
|
|
|
54
54
|
*
|
|
55
55
|
* @returns promise
|
|
56
56
|
*/
|
|
57
|
-
public static view<T>(template_id : string) : AxiosPromise<Response<T>> {
|
|
57
|
+
public static view<T>(template_id : string, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
58
58
|
|
|
59
|
-
return Requests.processRoute(TemplatesRoute.routes.view, {}, {template_id : template_id});
|
|
59
|
+
return Requests.processRoute(TemplatesRoute.routes.view, {}, {template_id : template_id}, params);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -67,9 +67,9 @@ class Templates {
|
|
|
67
67
|
* @param template_id The id of the template to delete.
|
|
68
68
|
* @returns promise
|
|
69
69
|
*/
|
|
70
|
-
public static delete<T>(template_id : string) : AxiosPromise<Response<T>> {
|
|
70
|
+
public static delete<T>(template_id : string, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
71
71
|
|
|
72
|
-
return Requests.processRoute(TemplatesRoute.routes.delete, {}, {template_id : template_id});
|
|
72
|
+
return Requests.processRoute(TemplatesRoute.routes.delete, {}, {template_id : template_id}, params);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/**
|
|
@@ -82,7 +82,7 @@ class Templates {
|
|
|
82
82
|
*
|
|
83
83
|
* @returns promise
|
|
84
84
|
*/
|
|
85
|
-
public static uploadLogoFile<T>(template_id: string, file : File, data? : object): AxiosPromise<Response<T>> {
|
|
85
|
+
public static uploadLogoFile<T>(template_id: string, file : File, data? : object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
86
86
|
|
|
87
87
|
let url = TemplatesRoute.routes.uploadLogo.url.replace('{template_id}', template_id);
|
|
88
88
|
|
|
@@ -99,7 +99,7 @@ class Templates {
|
|
|
99
99
|
*
|
|
100
100
|
* @returns promise
|
|
101
101
|
*/
|
|
102
|
-
public static uploadLogoBlob<T>(template_id: string, blob : Blob, data? : object): AxiosPromise<Response<T>> {
|
|
102
|
+
public static uploadLogoBlob<T>(template_id: string, blob : Blob, data? : object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
103
103
|
|
|
104
104
|
let url = TemplatesRoute.routes.uploadLogo.url.replace('{template_id}', template_id);
|
|
105
105
|
|
|
@@ -116,7 +116,7 @@ class Templates {
|
|
|
116
116
|
*
|
|
117
117
|
* @returns promise
|
|
118
118
|
*/
|
|
119
|
-
public static uploadMainImageFile<T>(template_id: string, file : File, data? : object): AxiosPromise<Response<T>> {
|
|
119
|
+
public static uploadMainImageFile<T>(template_id: string, file : File, data? : object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
120
120
|
|
|
121
121
|
let url = TemplatesRoute.routes.uploadMainImage.url.replace('{template_id}', template_id);
|
|
122
122
|
|
|
@@ -133,7 +133,7 @@ class Templates {
|
|
|
133
133
|
*
|
|
134
134
|
* @returns promise
|
|
135
135
|
*/
|
|
136
|
-
public static uploadMainImageBlob<T>(template_id: string, blob : Blob, data? : object): AxiosPromise<Response<T>> {
|
|
136
|
+
public static uploadMainImageBlob<T>(template_id: string, blob : Blob, data? : object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
137
137
|
|
|
138
138
|
let url = TemplatesRoute.routes.uploadMainImage.url.replace('{template_id}', template_id);
|
|
139
139
|
|
package/src/api/Users.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { unescape } from "querystring";
|
|
1
2
|
import UserRoutes from "../routes/UserRoutes";
|
|
2
3
|
import Requests from "../util/Requests";
|
|
3
4
|
import Response from "../util/Response";
|
|
@@ -12,8 +13,8 @@ class Users {
|
|
|
12
13
|
*
|
|
13
14
|
* @returns promise
|
|
14
15
|
*/
|
|
15
|
-
public static list<T>(): AxiosPromise<Response<T>> {
|
|
16
|
-
return Requests.processRoute(UserRoutes.routes.list);
|
|
16
|
+
public static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
17
|
+
return Requests.processRoute(UserRoutes.routes.list, undefined, undefined, params);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -25,9 +26,9 @@ class Users {
|
|
|
25
26
|
*
|
|
26
27
|
* @returns Promise
|
|
27
28
|
*/
|
|
28
|
-
public static update<T>(data: object): AxiosPromise<Response<T>> {
|
|
29
|
+
public static update<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
29
30
|
|
|
30
|
-
return Requests.processRoute(UserRoutes.routes.update, data);
|
|
31
|
+
return Requests.processRoute(UserRoutes.routes.update, data, undefined, params);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/**
|
|
@@ -40,9 +41,9 @@ class Users {
|
|
|
40
41
|
*
|
|
41
42
|
* @returns promise
|
|
42
43
|
*/
|
|
43
|
-
public static me<T>(): AxiosPromise<Response<T>> {
|
|
44
|
+
public static me<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
44
45
|
|
|
45
|
-
return Requests.processRoute(UserRoutes.routes.me, {});
|
|
46
|
+
return Requests.processRoute(UserRoutes.routes.me, {}, undefined, params);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
/**
|
package/src/api/Waitlist.ts
CHANGED
|
@@ -12,8 +12,8 @@ class Waitlists {
|
|
|
12
12
|
*
|
|
13
13
|
* @returns promise
|
|
14
14
|
*/
|
|
15
|
-
public static list<T>() : AxiosPromise<Response<T>> {
|
|
16
|
-
return Requests.processRoute(WaitlistRoutes.routes.list);
|
|
15
|
+
public static list<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
16
|
+
return Requests.processRoute(WaitlistRoutes.routes.list, undefined, undefined, params);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -25,9 +25,9 @@ class Waitlists {
|
|
|
25
25
|
*
|
|
26
26
|
* @returns Promise
|
|
27
27
|
*/
|
|
28
|
-
public static create<T>(data : object) : AxiosPromise<Response<T>> {
|
|
28
|
+
public static create<T>(data : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
29
29
|
|
|
30
|
-
return Requests.processRoute(WaitlistRoutes.routes.create, data);
|
|
30
|
+
return Requests.processRoute(WaitlistRoutes.routes.create, data, undefined, params);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
@@ -40,9 +40,9 @@ class Waitlists {
|
|
|
40
40
|
*
|
|
41
41
|
* @returns promise
|
|
42
42
|
*/
|
|
43
|
-
public static update<T>(waitlist_id : string, data : object) : AxiosPromise<Response<T>>{
|
|
43
|
+
public static update<T>(waitlist_id : string, data : object, params?: Record<string, any>) : AxiosPromise<Response<T>>{
|
|
44
44
|
|
|
45
|
-
return Requests.processRoute(WaitlistRoutes.routes.update, data, {waitlist_id : waitlist_id});
|
|
45
|
+
return Requests.processRoute(WaitlistRoutes.routes.update, data, {waitlist_id : waitlist_id}, params);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
@@ -54,9 +54,9 @@ class Waitlists {
|
|
|
54
54
|
*
|
|
55
55
|
* @returns promise
|
|
56
56
|
*/
|
|
57
|
-
public static view<T>(waitlist_id : string) : AxiosPromise<Response<T>> {
|
|
57
|
+
public static view<T>(waitlist_id : string, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
58
58
|
|
|
59
|
-
return Requests.processRoute(WaitlistRoutes.routes.view, {}, {waitlist_id : waitlist_id});
|
|
59
|
+
return Requests.processRoute(WaitlistRoutes.routes.view, {}, {waitlist_id : waitlist_id}, params);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -67,9 +67,9 @@ class Waitlists {
|
|
|
67
67
|
* @param waitlist_id The id of the team to delete.
|
|
68
68
|
* @returns promise
|
|
69
69
|
*/
|
|
70
|
-
public static delete<T>(waitlist_id : string) : AxiosPromise<Response<T>> {
|
|
70
|
+
public static delete<T>(waitlist_id : string, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
71
71
|
|
|
72
|
-
return Requests.processRoute(WaitlistRoutes.routes.delete, {}, {waitlist_id : waitlist_id});
|
|
72
|
+
return Requests.processRoute(WaitlistRoutes.routes.delete, {}, {waitlist_id : waitlist_id}, params);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
|
package/src/config/Config.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Community from "../models/community";
|
|
1
2
|
import Requests from "../util/Requests";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,6 +11,7 @@ class Config {
|
|
|
10
11
|
|
|
11
12
|
private static _baseUrl: string;
|
|
12
13
|
private static _authToken: string;
|
|
14
|
+
private static _community: object;
|
|
13
15
|
|
|
14
16
|
private static _baseUrlLocked: boolean = false;
|
|
15
17
|
|
|
@@ -59,6 +61,17 @@ class Config {
|
|
|
59
61
|
Requests.setAuthToken(authToken);
|
|
60
62
|
}
|
|
61
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Set the community to be associated with this config through
|
|
66
|
+
*
|
|
67
|
+
* @param authToken The JWT
|
|
68
|
+
*/
|
|
69
|
+
public static setCommunity(community: Community) {
|
|
70
|
+
Config._community = community;
|
|
71
|
+
|
|
72
|
+
Requests.setCommunityID(community.id);
|
|
73
|
+
}
|
|
74
|
+
|
|
62
75
|
/**
|
|
63
76
|
* Gets base url
|
|
64
77
|
*/
|
|
@@ -72,6 +85,13 @@ class Config {
|
|
|
72
85
|
public static get authToken(): string {
|
|
73
86
|
return Config._authToken;
|
|
74
87
|
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Gets the community currently associated
|
|
91
|
+
*/
|
|
92
|
+
public static get getCommunity(): Community {
|
|
93
|
+
return Config._community;
|
|
94
|
+
}
|
|
75
95
|
}
|
|
76
96
|
|
|
77
97
|
export default Config;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Template from "./template";
|
|
2
|
+
import User from "./user";
|
|
3
|
+
|
|
4
|
+
interface Community {
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
logo?: string;
|
|
9
|
+
banner_image?: string;
|
|
10
|
+
video_logo?: string;
|
|
11
|
+
subdomain?: string;
|
|
12
|
+
cname?: string;
|
|
13
|
+
bannner_image?: string;
|
|
14
|
+
cname_enabled?: boolean;
|
|
15
|
+
require_attendee_rsvp?: boolean;
|
|
16
|
+
is_private?: boolean;
|
|
17
|
+
disable_streams?: boolean;
|
|
18
|
+
disable_competitions?: boolean;
|
|
19
|
+
disable_forums?: boolean;
|
|
20
|
+
disable_teams?: boolean;
|
|
21
|
+
custom_css?: boolean;
|
|
22
|
+
twitter_page?: string;
|
|
23
|
+
facebook_page?: string;
|
|
24
|
+
instagram_page?: string;
|
|
25
|
+
snapchat_page?: string;
|
|
26
|
+
tiktok_page?: string;
|
|
27
|
+
twitch_page?: string;
|
|
28
|
+
youtube_page?: string;
|
|
29
|
+
paetron_page?: string;
|
|
30
|
+
twitter_handle?: string;
|
|
31
|
+
facebook_handle?: string;
|
|
32
|
+
instagram_handle?: string;
|
|
33
|
+
snapchat_handle?: string;
|
|
34
|
+
tiktok_handle?: string;
|
|
35
|
+
twitch_handle?: string;
|
|
36
|
+
youtube_handle?: string;
|
|
37
|
+
paetron_handle?: string;
|
|
38
|
+
template?: Template;
|
|
39
|
+
admins?: User[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default Community;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface Template {
|
|
2
|
+
id?: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
version?: string;
|
|
6
|
+
directory?: string;
|
|
7
|
+
entry_point_file?: string;
|
|
8
|
+
author_name?: string;
|
|
9
|
+
author_website?: string;
|
|
10
|
+
author_email?: string;
|
|
11
|
+
main_image?: string;
|
|
12
|
+
logo?: string;
|
|
13
|
+
is_private?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default Template;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface User {
|
|
2
|
+
id?: string;
|
|
3
|
+
first_name?: string;
|
|
4
|
+
last_name?: string;
|
|
5
|
+
username?: string;
|
|
6
|
+
display_name?: string;
|
|
7
|
+
bio?: string;
|
|
8
|
+
avatar?: string;
|
|
9
|
+
banner_image?: string;
|
|
10
|
+
twitter_page?: string;
|
|
11
|
+
facebook_page?: string;
|
|
12
|
+
instagram_page?: string;
|
|
13
|
+
snapchat_page?: string;
|
|
14
|
+
tiktok_page?: string;
|
|
15
|
+
twitch_page?: string;
|
|
16
|
+
youtube_page?: string;
|
|
17
|
+
paetron_page?: string;
|
|
18
|
+
twitter_handle?: string;
|
|
19
|
+
facebook_handle?: string;
|
|
20
|
+
instagram_handle?: string;
|
|
21
|
+
snapchat_handle?: string;
|
|
22
|
+
tiktok_handle?: string;
|
|
23
|
+
twitch_handle?: string;
|
|
24
|
+
youtube_handle?: string;
|
|
25
|
+
paetron_handle?: string;
|
|
26
|
+
created_at?: string;
|
|
27
|
+
updated_at?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default User;
|
|
31
|
+
|