glitch-javascript-sdk 0.0.3 → 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,179 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Teams {
4
+ /**
5
+ * List all the teams
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamsList
8
+ *
9
+ * @returns promise
10
+ */
11
+ static list<T>(): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Create a new team.
14
+ *
15
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamCreate
16
+ *
17
+ * @param data The data to be passed when creating a team.
18
+ *
19
+ * @returns Promise
20
+ */
21
+ static create<T>(data: object): AxiosPromise<Response<T>>;
22
+ /**
23
+ * Update a team.
24
+ *
25
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUpdate
26
+ *
27
+ * @param team_id The id of the team to update.
28
+ * @param data The data to update.
29
+ *
30
+ * @returns promise
31
+ */
32
+ static update<T>(team_id: string, data: object): AxiosPromise<Response<T>>;
33
+ /**
34
+ * Retrieve the information for a single team.
35
+ *
36
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamShow
37
+ *
38
+ * @param team_id The id fo the team to retrieve.
39
+ *
40
+ * @returns promise
41
+ */
42
+ static view<T>(team_id: string): AxiosPromise<Response<T>>;
43
+ /**
44
+ * Deletes a team.
45
+ *
46
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamDelete
47
+ *
48
+ * @param team_id The id of the team to delete.
49
+ * @returns promise
50
+ */
51
+ static delete<T>(team_id: string): AxiosPromise<Response<T>>;
52
+ /**
53
+ * Updates the main image for the team using a File object.
54
+ *
55
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUploadMainImage
56
+ *
57
+ * @param file The file object to upload.
58
+ * @param data Any additional data to pass along to the upload.
59
+ *
60
+ * @returns promise
61
+ */
62
+ static uploadMainImageFile<T>(team_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
63
+ /**
64
+ * Updates the main image for the team using a Blob.
65
+ *
66
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUploadMainImage
67
+ *
68
+ * @param blob The blob to upload.
69
+ * @param data Any additional data to pass along to the upload
70
+ *
71
+ * @returns promise
72
+ */
73
+ static uploadMainImageBlob<T>(team_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
74
+ /**
75
+ * Updates the banner image for the team using a File object.
76
+ *
77
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUploadMainImage
78
+ *
79
+ * @param file The file object to upload.
80
+ * @param data Any additional data to pass along to the upload.
81
+ *
82
+ * @returns promise
83
+ */
84
+ static uploadBannerImageFile<T>(team_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
85
+ /**
86
+ * Updates the banner image for the team using a Blob.
87
+ *
88
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUploadMainImage
89
+ *
90
+ * @param blob The blob to upload.
91
+ * @param data Any additional data to pass along to the upload
92
+ *
93
+ * @returns promise
94
+ */
95
+ static uploadBannerImageBlob<T>(team_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
96
+ /**
97
+ * List the invites that have been sent for the team to users.
98
+ *
99
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamsUserInviteList
100
+ *
101
+ * @param team_id The id of the team
102
+ *
103
+ * @returns promise
104
+ */
105
+ static listInvites<T>(team_id: string): AxiosPromise<Response<T>>;
106
+ /**
107
+ * Send an invitation to a user to join the team.
108
+ *
109
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamSendInvite
110
+ *
111
+ * @param team_id The id of the team.
112
+ * @param data The data that will be passed into sending an invite.
113
+ *
114
+ * @returns promise
115
+ */
116
+ static sendInvite<T>(team_id: string, data?: object): AxiosPromise<Response<T>>;
117
+ /**
118
+ * Accept an invite to a team. The JSON Web Token (JWT) must be related to the token.
119
+ *
120
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamAcceptInvite
121
+ *
122
+ * @param team_id The id of the team
123
+ * @param token The token required to accept the user.
124
+ *
125
+ * @returns promise
126
+ */
127
+ static acceptInvite<T>(team_id: string, token: string): AxiosPromise<Response<T>>;
128
+ /**
129
+ * List the users who are currently associated with the team.
130
+ *
131
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/teamUserList
132
+ *
133
+ * @param team_id The id of the team.
134
+ *
135
+ * @returns promise
136
+ */
137
+ static listUsers<T>(team_id: string): AxiosPromise<Response<T>>;
138
+ /**
139
+ * Add a user to a team.
140
+ *
141
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/createTeamUser
142
+ *
143
+ * @param team_id The id of the team.
144
+ * @param data The data to be passed when adding a user.
145
+ *
146
+ * @returns promise
147
+ */
148
+ static addUser<T>(team_id: string, data?: object): AxiosPromise<Response<T>>;
149
+ /**
150
+ * Retrieves a single user and their information that is associated with a team.
151
+ *
152
+ * @see https://api.glitch.fun/api/documentation#/Teams%20Route/showTeamUser
153
+ *
154
+ * @param team_id The id of the team.
155
+ * @param user_id The id of the user.
156
+ *
157
+ * @returns promise
158
+ */
159
+ static getUser<T>(team_id: string, user_id: string): AxiosPromise<Response<T>>;
160
+ /**
161
+ * Updates the users information associated with the team.
162
+ *
163
+ * @param team_id The id of the team.
164
+ * @param user_id The id of the user.
165
+ *
166
+ * @returns promise
167
+ */
168
+ static updatetUser<T>(team_id: string, user_id: string, data?: object): AxiosPromise<Response<T>>;
169
+ /**
170
+ * Removes a user from a team.
171
+ *
172
+ * @param team_id The id of team.
173
+ * @param user_id The id of the user.
174
+ *
175
+ * @returns promise
176
+ */
177
+ static removetUser<T>(team_id: string, user_id: string): AxiosPromise<Response<T>>;
178
+ }
179
+ export default Teams;
@@ -58,5 +58,58 @@ declare class Users {
58
58
  * @returns promise
59
59
  */
60
60
  static oneTimeLoginToken<T>(): AxiosPromise<Response<T>>;
61
+ /**
62
+ * Updates the avatar image for the user using a File object.
63
+ *
64
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadAvatarImage
65
+ *
66
+ * @param file The file object to upload.
67
+ * @param data Any additional data to pass along to the upload.
68
+ *
69
+ * @returns promise
70
+ */
71
+ static uploadAvatarImageFile<T>(file: File, data?: object): AxiosPromise<Response<T>>;
72
+ /**
73
+ * Updates the avatar image for the user using a Blob.
74
+ *
75
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadAvatarImage
76
+ *
77
+ * @param blob The blob to upload.
78
+ * @param data Any additional data to pass along to the upload
79
+ *
80
+ * @returns promise
81
+ */
82
+ static uploadAvatarImageBlob<T>(blob: Blob, data?: object): AxiosPromise<Response<T>>;
83
+ /**
84
+ * Upload a banner image for the user, as a File object.
85
+ *
86
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadBannerImage
87
+ *
88
+ * @param file The file object to upload.
89
+ * @param data Any additional data to pass along to the upload.
90
+ *
91
+ * @returns promise
92
+ */
93
+ static uploadBannerImageFile<T>(file: File, data?: object): AxiosPromise<Response<T>>;
94
+ /**
95
+ * Upload a banner image for the user, as a Blob.
96
+ *
97
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadBannerImage
98
+ *
99
+ * @param file The blob to upload.
100
+ * @param data Any additional data to pass along to the upload.
101
+ *
102
+ * @returns promise
103
+ */
104
+ static uploadBannerImageBlob<T>(blob: Blob, data?: object): AxiosPromise<Response<T>>;
105
+ /**
106
+ * Creates a donation page for that user by syncing their information with various
107
+ * payment service.
108
+ *
109
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage
110
+ *
111
+ * @returns promise
112
+ */
113
+ static createDonationPage<T>(): AxiosPromise<Response<T>>;
61
114
  }
62
115
  export default Users;
@@ -0,0 +1,53 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Teams {
4
+ /**
5
+ * List all the waitlist sign-ups.
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/Waitlist%20Route/waitlistList
8
+ *
9
+ * @returns promise
10
+ */
11
+ static list<T>(): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Sign-up to the waitlist.
14
+ *
15
+ * @see https://api.glitch.fun/api/documentation#/Waitlist%20Route/waitlistCreate
16
+ *
17
+ * @param data The data to be passed when creating a team.
18
+ *
19
+ * @returns Promise
20
+ */
21
+ static create<T>(data: object): AxiosPromise<Response<T>>;
22
+ /**
23
+ * Update a waitlist.
24
+ *
25
+ * @see https://api.glitch.fun/api/documentation#/Waitlist%20Route/waitlistUpdate
26
+ *
27
+ * @param waitlist_id The id of the team to update.
28
+ * @param data The data to update.
29
+ *
30
+ * @returns promise
31
+ */
32
+ static update<T>(waitlist_id: string, data: object): AxiosPromise<Response<T>>;
33
+ /**
34
+ * Retrieve the information for a single user who signed-up to the waitlist.
35
+ *
36
+ * @see https://api.glitch.fun/api/documentation#/Waitlist%20Route/waitlistUpdate
37
+ *
38
+ * @param waitlist_id The id fo the team to retrieve.
39
+ *
40
+ * @returns promise
41
+ */
42
+ static view<T>(waitlist_id: string): AxiosPromise<Response<T>>;
43
+ /**
44
+ * Deletes an entry from the waitlist.
45
+ *
46
+ * @see https://api.glitch.fun/api/documentation#/Waitlist%20Route/waitlistDelete
47
+ *
48
+ * @param waitlist_id The id of the team to delete.
49
+ * @returns promise
50
+ */
51
+ static delete<T>(waitlist_id: string): AxiosPromise<Response<T>>;
52
+ }
53
+ export default Teams;
@@ -2,7 +2,9 @@ import Auth from "./Auth";
2
2
  import Competitions from "./Competitions";
3
3
  import Users from "./Users";
4
4
  import Events from "./Events";
5
+ import Teams from "./Teams";
5
6
  export { Auth };
6
7
  export { Competitions };
7
8
  export { Users };
8
9
  export { Events };
10
+ export { Teams };
@@ -3,13 +3,15 @@ import { Auth } from "./api";
3
3
  import { Competitions } from "./api";
4
4
  import { Users } from "./api";
5
5
  import { Events } from "./api";
6
+ import { Teams } from "./api";
6
7
  declare class Glitch {
7
- static config: typeof Config;
8
+ static config: Config;
8
9
  static api: {
9
- Auth: typeof Auth;
10
- Competitions: typeof Competitions;
11
- Users: typeof Users;
12
- Events: typeof Events;
10
+ Auth: Auth;
11
+ Competitions: Competitions;
12
+ Users: Users;
13
+ Events: Events;
14
+ Teams: Teams;
13
15
  };
14
16
  }
15
17
  export { Glitch };