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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Template from "./template";
|
|
2
|
+
import User from "./user";
|
|
3
|
+
interface Community {
|
|
4
|
+
id?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
logo?: string;
|
|
8
|
+
banner_image?: string;
|
|
9
|
+
video_logo?: string;
|
|
10
|
+
subdomain?: string;
|
|
11
|
+
cname?: string;
|
|
12
|
+
bannner_image?: string;
|
|
13
|
+
cname_enabled?: boolean;
|
|
14
|
+
require_attendee_rsvp?: boolean;
|
|
15
|
+
is_private?: boolean;
|
|
16
|
+
disable_streams?: boolean;
|
|
17
|
+
disable_competitions?: boolean;
|
|
18
|
+
disable_forums?: boolean;
|
|
19
|
+
disable_teams?: boolean;
|
|
20
|
+
custom_css?: boolean;
|
|
21
|
+
twitter_page?: string;
|
|
22
|
+
facebook_page?: string;
|
|
23
|
+
instagram_page?: string;
|
|
24
|
+
snapchat_page?: string;
|
|
25
|
+
tiktok_page?: string;
|
|
26
|
+
twitch_page?: string;
|
|
27
|
+
youtube_page?: string;
|
|
28
|
+
paetron_page?: string;
|
|
29
|
+
twitter_handle?: string;
|
|
30
|
+
facebook_handle?: string;
|
|
31
|
+
instagram_handle?: string;
|
|
32
|
+
snapchat_handle?: string;
|
|
33
|
+
tiktok_handle?: string;
|
|
34
|
+
twitch_handle?: string;
|
|
35
|
+
youtube_handle?: string;
|
|
36
|
+
paetron_handle?: string;
|
|
37
|
+
template?: Template;
|
|
38
|
+
admins?: User[];
|
|
39
|
+
}
|
|
40
|
+
export default Community;
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
export default Template;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
export default User;
|
|
@@ -6,6 +6,7 @@ declare class Requests {
|
|
|
6
6
|
config: Config;
|
|
7
7
|
private static baseUrl;
|
|
8
8
|
private static authToken;
|
|
9
|
+
private static community_id?;
|
|
9
10
|
constructor(config: Config);
|
|
10
11
|
/**
|
|
11
12
|
* Sets the base url of the API.
|
|
@@ -19,6 +20,12 @@ declare class Requests {
|
|
|
19
20
|
* @param token
|
|
20
21
|
*/
|
|
21
22
|
static setAuthToken(token: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the community id that will be associated with all requests
|
|
25
|
+
*
|
|
26
|
+
* @param token
|
|
27
|
+
*/
|
|
28
|
+
static setCommunityID(community_id: string | undefined): void;
|
|
22
29
|
private static request;
|
|
23
30
|
/**
|
|
24
31
|
* Calls a GET request to the url endpoint.
|
|
@@ -26,12 +33,12 @@ declare class Requests {
|
|
|
26
33
|
* @param url
|
|
27
34
|
* @returns
|
|
28
35
|
*/
|
|
29
|
-
static get<T>(url: string): AxiosPromise<Response<T>>;
|
|
30
|
-
static post<T>(url: string, data: any): AxiosPromise<Response<T>>;
|
|
31
|
-
static put<T>(url: string, data: any): AxiosPromise<Response<T>>;
|
|
32
|
-
static delete<T>(url: string): AxiosPromise<Response<T>>;
|
|
33
|
-
static uploadFile<T>(url: string, filename: string, file: File, data?: any): AxiosPromise<Response<T>>;
|
|
34
|
-
static uploadBlob<T>(url: string, filename: string, blob: Blob, data?: any): AxiosPromise<Response<T>>;
|
|
36
|
+
static get<T>(url: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
37
|
+
static post<T>(url: string, data: any, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
38
|
+
static put<T>(url: string, data: any, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
39
|
+
static delete<T>(url: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
40
|
+
static uploadFile<T>(url: string, filename: string, file: File, data?: any, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
41
|
+
static uploadBlob<T>(url: string, filename: string, blob: Blob, data?: any, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
35
42
|
/**
|
|
36
43
|
* The Route class contains the method and url, thereforce items can be
|
|
37
44
|
* automatically routed depending on the configuration.
|
|
@@ -42,6 +49,6 @@ declare class Requests {
|
|
|
42
49
|
*/
|
|
43
50
|
static processRoute<T>(route: Route, data?: object, routeReplace?: {
|
|
44
51
|
[key: string]: any;
|
|
45
|
-
}): AxiosPromise<Response<T>>;
|
|
52
|
+
}, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
46
53
|
}
|
|
47
54
|
export default Requests;
|