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/dist/esm/api/Teams.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare class Teams {
|
|
|
8
8
|
*
|
|
9
9
|
* @returns promise
|
|
10
10
|
*/
|
|
11
|
-
static list<T>(): AxiosPromise<Response<T>>;
|
|
11
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
12
12
|
/**
|
|
13
13
|
* Create a new team.
|
|
14
14
|
*
|
|
@@ -18,7 +18,7 @@ declare class Teams {
|
|
|
18
18
|
*
|
|
19
19
|
* @returns Promise
|
|
20
20
|
*/
|
|
21
|
-
static create<T>(data: object): AxiosPromise<Response<T>>;
|
|
21
|
+
static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
22
22
|
/**
|
|
23
23
|
* Update a team.
|
|
24
24
|
*
|
|
@@ -29,7 +29,7 @@ declare class Teams {
|
|
|
29
29
|
*
|
|
30
30
|
* @returns promise
|
|
31
31
|
*/
|
|
32
|
-
static update<T>(team_id: string, data: object): AxiosPromise<Response<T>>;
|
|
32
|
+
static update<T>(team_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
33
33
|
/**
|
|
34
34
|
* Retrieve the information for a single team.
|
|
35
35
|
*
|
|
@@ -39,7 +39,7 @@ declare class Teams {
|
|
|
39
39
|
*
|
|
40
40
|
* @returns promise
|
|
41
41
|
*/
|
|
42
|
-
static view<T>(team_id: string): AxiosPromise<Response<T>>;
|
|
42
|
+
static view<T>(team_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
43
43
|
/**
|
|
44
44
|
* Deletes a team.
|
|
45
45
|
*
|
|
@@ -48,7 +48,7 @@ declare class Teams {
|
|
|
48
48
|
* @param team_id The id of the team to delete.
|
|
49
49
|
* @returns promise
|
|
50
50
|
*/
|
|
51
|
-
static delete<T>(team_id: string): AxiosPromise<Response<T>>;
|
|
51
|
+
static delete<T>(team_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
52
52
|
/**
|
|
53
53
|
* Updates the main image for the team using a File object.
|
|
54
54
|
*
|
|
@@ -102,7 +102,7 @@ declare class Teams {
|
|
|
102
102
|
*
|
|
103
103
|
* @returns promise
|
|
104
104
|
*/
|
|
105
|
-
static listInvites<T>(team_id: string): AxiosPromise<Response<T>>;
|
|
105
|
+
static listInvites<T>(team_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
106
106
|
/**
|
|
107
107
|
* Send an invitation to a user to join the team.
|
|
108
108
|
*
|
|
@@ -134,7 +134,7 @@ declare class Teams {
|
|
|
134
134
|
*
|
|
135
135
|
* @returns promise
|
|
136
136
|
*/
|
|
137
|
-
static listUsers<T>(team_id: string): AxiosPromise<Response<T>>;
|
|
137
|
+
static listUsers<T>(team_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
138
138
|
/**
|
|
139
139
|
* Add a user to a team.
|
|
140
140
|
*
|
|
@@ -8,7 +8,7 @@ declare class Templates {
|
|
|
8
8
|
*
|
|
9
9
|
* @returns promise
|
|
10
10
|
*/
|
|
11
|
-
static list<T>(): AxiosPromise<Response<T>>;
|
|
11
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
12
12
|
/**
|
|
13
13
|
* Create a new template.
|
|
14
14
|
*
|
|
@@ -18,7 +18,7 @@ declare class Templates {
|
|
|
18
18
|
*
|
|
19
19
|
* @returns Promise
|
|
20
20
|
*/
|
|
21
|
-
static create<T>(data: object): AxiosPromise<Response<T>>;
|
|
21
|
+
static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
22
22
|
/**
|
|
23
23
|
* Update a template.
|
|
24
24
|
*
|
|
@@ -29,7 +29,7 @@ declare class Templates {
|
|
|
29
29
|
*
|
|
30
30
|
* @returns promise
|
|
31
31
|
*/
|
|
32
|
-
static update<T>(template_id: string, data: object): AxiosPromise<Response<T>>;
|
|
32
|
+
static update<T>(template_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
33
33
|
/**
|
|
34
34
|
* Retrieve the information for a single template.
|
|
35
35
|
*
|
|
@@ -39,7 +39,7 @@ declare class Templates {
|
|
|
39
39
|
*
|
|
40
40
|
* @returns promise
|
|
41
41
|
*/
|
|
42
|
-
static view<T>(template_id: string): AxiosPromise<Response<T>>;
|
|
42
|
+
static view<T>(template_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
43
43
|
/**
|
|
44
44
|
* Deletes a template.
|
|
45
45
|
*
|
|
@@ -48,7 +48,7 @@ declare class Templates {
|
|
|
48
48
|
* @param template_id The id of the template to delete.
|
|
49
49
|
* @returns promise
|
|
50
50
|
*/
|
|
51
|
-
static delete<T>(template_id: string): AxiosPromise<Response<T>>;
|
|
51
|
+
static delete<T>(template_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
52
52
|
/**
|
|
53
53
|
* Updates the logo for the template using a File object.
|
|
54
54
|
*
|
|
@@ -59,7 +59,7 @@ declare class Templates {
|
|
|
59
59
|
*
|
|
60
60
|
* @returns promise
|
|
61
61
|
*/
|
|
62
|
-
static uploadLogoFile<T>(template_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
62
|
+
static uploadLogoFile<T>(template_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
63
63
|
/**
|
|
64
64
|
* Updates the logo for the template using a Blob.
|
|
65
65
|
*
|
|
@@ -70,7 +70,7 @@ declare class Templates {
|
|
|
70
70
|
*
|
|
71
71
|
* @returns promise
|
|
72
72
|
*/
|
|
73
|
-
static uploadLogoBlob<T>(template_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
73
|
+
static uploadLogoBlob<T>(template_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
74
74
|
/**
|
|
75
75
|
* Updates the main image for the template using a File object.
|
|
76
76
|
*
|
|
@@ -81,7 +81,7 @@ declare class Templates {
|
|
|
81
81
|
*
|
|
82
82
|
* @returns promise
|
|
83
83
|
*/
|
|
84
|
-
static uploadMainImageFile<T>(template_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
|
|
84
|
+
static uploadMainImageFile<T>(template_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
85
85
|
/**
|
|
86
86
|
* Updates the main image for the template using a Blob.
|
|
87
87
|
*
|
|
@@ -92,6 +92,6 @@ declare class Templates {
|
|
|
92
92
|
*
|
|
93
93
|
* @returns promise
|
|
94
94
|
*/
|
|
95
|
-
static uploadMainImageBlob<T>(template_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
|
|
95
|
+
static uploadMainImageBlob<T>(template_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
96
96
|
}
|
|
97
97
|
export default Templates;
|
package/dist/esm/api/Users.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare class Users {
|
|
|
8
8
|
*
|
|
9
9
|
* @returns promise
|
|
10
10
|
*/
|
|
11
|
-
static list<T>(): AxiosPromise<Response<T>>;
|
|
11
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
12
12
|
/**
|
|
13
13
|
* Updates a users information. Requires the users JSON Web Token (JWT) for them to update their profile.
|
|
14
14
|
*
|
|
@@ -18,7 +18,7 @@ declare class Users {
|
|
|
18
18
|
*
|
|
19
19
|
* @returns Promise
|
|
20
20
|
*/
|
|
21
|
-
static update<T>(data: object): AxiosPromise<Response<T>>;
|
|
21
|
+
static update<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
22
22
|
/**
|
|
23
23
|
* Gets the current users information based on the current Json Web Token (JWT).
|
|
24
24
|
*
|
|
@@ -29,7 +29,7 @@ declare class Users {
|
|
|
29
29
|
*
|
|
30
30
|
* @returns promise
|
|
31
31
|
*/
|
|
32
|
-
static me<T>(): AxiosPromise<Response<T>>;
|
|
32
|
+
static me<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
33
33
|
/**
|
|
34
34
|
* Will follow and unfollow a user. If the user is not being following, it will follow the user. If they are following, it will unfollow the user. The current JWT is used for the follower.
|
|
35
35
|
*
|
|
@@ -8,7 +8,7 @@ declare class Waitlists {
|
|
|
8
8
|
*
|
|
9
9
|
* @returns promise
|
|
10
10
|
*/
|
|
11
|
-
static list<T>(): AxiosPromise<Response<T>>;
|
|
11
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
12
12
|
/**
|
|
13
13
|
* Sign-up to the waitlist.
|
|
14
14
|
*
|
|
@@ -18,7 +18,7 @@ declare class Waitlists {
|
|
|
18
18
|
*
|
|
19
19
|
* @returns Promise
|
|
20
20
|
*/
|
|
21
|
-
static create<T>(data: object): AxiosPromise<Response<T>>;
|
|
21
|
+
static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
22
22
|
/**
|
|
23
23
|
* Update a waitlist.
|
|
24
24
|
*
|
|
@@ -29,7 +29,7 @@ declare class Waitlists {
|
|
|
29
29
|
*
|
|
30
30
|
* @returns promise
|
|
31
31
|
*/
|
|
32
|
-
static update<T>(waitlist_id: string, data: object): AxiosPromise<Response<T>>;
|
|
32
|
+
static update<T>(waitlist_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
33
33
|
/**
|
|
34
34
|
* Retrieve the information for a single user who signed-up to the waitlist.
|
|
35
35
|
*
|
|
@@ -39,7 +39,7 @@ declare class Waitlists {
|
|
|
39
39
|
*
|
|
40
40
|
* @returns promise
|
|
41
41
|
*/
|
|
42
|
-
static view<T>(waitlist_id: string): AxiosPromise<Response<T>>;
|
|
42
|
+
static view<T>(waitlist_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
43
43
|
/**
|
|
44
44
|
* Deletes an entry from the waitlist.
|
|
45
45
|
*
|
|
@@ -48,6 +48,6 @@ declare class Waitlists {
|
|
|
48
48
|
* @param waitlist_id The id of the team to delete.
|
|
49
49
|
* @returns promise
|
|
50
50
|
*/
|
|
51
|
-
static delete<T>(waitlist_id: string): AxiosPromise<Response<T>>;
|
|
51
|
+
static delete<T>(waitlist_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
52
52
|
}
|
|
53
53
|
export default Waitlists;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Community from "../models/community";
|
|
1
2
|
/**
|
|
2
3
|
* Config
|
|
3
4
|
*
|
|
@@ -7,6 +8,7 @@
|
|
|
7
8
|
declare class Config {
|
|
8
9
|
private static _baseUrl;
|
|
9
10
|
private static _authToken;
|
|
11
|
+
private static _community;
|
|
10
12
|
private static _baseUrlLocked;
|
|
11
13
|
/**
|
|
12
14
|
* Set the configuration
|
|
@@ -28,6 +30,12 @@ declare class Config {
|
|
|
28
30
|
* @param authToken The JWT
|
|
29
31
|
*/
|
|
30
32
|
static setAuthToken(authToken: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Set the community to be associated with this config through
|
|
35
|
+
*
|
|
36
|
+
* @param authToken The JWT
|
|
37
|
+
*/
|
|
38
|
+
static setCommunity(community: Community): void;
|
|
31
39
|
/**
|
|
32
40
|
* Gets base url
|
|
33
41
|
*/
|
|
@@ -36,5 +44,9 @@ declare class Config {
|
|
|
36
44
|
* Gets auth token
|
|
37
45
|
*/
|
|
38
46
|
static get authToken(): string;
|
|
47
|
+
/**
|
|
48
|
+
* Gets the community currently associated
|
|
49
|
+
*/
|
|
50
|
+
static get getCommunity(): Community;
|
|
39
51
|
}
|
|
40
52
|
export default Config;
|