glitch-javascript-sdk 0.2.0 → 0.2.2

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,201 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Communities {
4
+ /**
5
+ * List all the communities.
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/resourceCommunityList
8
+ *
9
+ * @returns promise
10
+ */
11
+ static list<T>(): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Create a new community.
14
+ *
15
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/newCommunityResourceStorage
16
+ *
17
+ * @param data The data to be passed when creating a community.
18
+ *
19
+ * @returns Promise
20
+ */
21
+ static create<T>(data: object): AxiosPromise<Response<T>>;
22
+ /**
23
+ * Update a community.
24
+ *
25
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/updateCommunityStorage
26
+ *
27
+ * @param community_id The id of the community to update.
28
+ * @param data The data to update.
29
+ *
30
+ * @returns promise
31
+ */
32
+ static update<T>(community_id: string, data: object): AxiosPromise<Response<T>>;
33
+ /**
34
+ * Retrieve the information for a single community.
35
+ *
36
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/showCommunityStorage
37
+ *
38
+ * @param community_id The id fo the community to retrieve.
39
+ *
40
+ * @returns promise
41
+ */
42
+ static view<T>(community_id: string): AxiosPromise<Response<T>>;
43
+ /**
44
+ * Deletes a community.
45
+ *
46
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/destoryCommunityStorage
47
+ *
48
+ * @param community_id The id of the community to delete.
49
+ * @returns promise
50
+ */
51
+ static delete<T>(community_id: string): AxiosPromise<Response<T>>;
52
+ /**
53
+ * Updates the main image for the community using a File object.
54
+ *
55
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadLogoCommunityImage
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 uploadLogoFile<T>(community_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
63
+ /**
64
+ * Updates the main image for the community using a Blob.
65
+ *
66
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadLogoCommunityImage
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 uploadLogoBlob<T>(community_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
74
+ /**
75
+ * Updates the banner image for the community using a File object.
76
+ *
77
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
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>(community_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
85
+ /**
86
+ * Updates the banner image for the community using a Blob.
87
+ *
88
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
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>(community_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
96
+ /**
97
+ * Updates the banner image for the community using a File object.
98
+ *
99
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
100
+ *
101
+ * @param file The file object to upload.
102
+ * @param data Any additional data to pass along to the upload.
103
+ *
104
+ * @returns promise
105
+ */
106
+ static uploadVideoLogoFile<T>(community_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
107
+ /**
108
+ * Updates the banner image for the community using a Blob.
109
+ *
110
+ * @see https://api.glitch.fun/api/documentation#/Community%20Route/uploadBannerCommunityImage
111
+ *
112
+ * @param blob The blob to upload.
113
+ * @param data Any additional data to pass along to the upload
114
+ *
115
+ * @returns promise
116
+ */
117
+ static uploadVideoLogoBlob<T>(community_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
118
+ /**
119
+ * List the invites that have been sent for the community to users.
120
+ *
121
+ * @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitysUserInviteList
122
+ *
123
+ * @param community_id The id of the community
124
+ *
125
+ * @returns promise
126
+ */
127
+ static listInvites<T>(community_id: string): AxiosPromise<Response<T>>;
128
+ /**
129
+ * Send an invitation to a user to join the community.
130
+ *
131
+ * @see https://api.glitch.fun/api/documentation#/communitys%20Route/communitySendInvite
132
+ *
133
+ * @param community_id The id of the community.
134
+ * @param data The data that will be passed into sending an invite.
135
+ *
136
+ * @returns promise
137
+ */
138
+ static sendInvite<T>(community_id: string, data?: object): AxiosPromise<Response<T>>;
139
+ /**
140
+ * Accept an invite to a community. The JSON Web Token (JWT) must be related to the token.
141
+ *
142
+ * @see https://api.glitch.fun/api/documentation#/communitys%20Route/communityAcceptInvite
143
+ *
144
+ * @param community_id The id of the community
145
+ * @param token The token required to accept the user.
146
+ *
147
+ * @returns promise
148
+ */
149
+ static acceptInvite<T>(community_id: string, token: string): AxiosPromise<Response<T>>;
150
+ /**
151
+ * List the users who are currently associated with the community.
152
+ *
153
+ * @see https://api.glitch.fun/api/documentation#/communitys%20Route/communityUserList
154
+ *
155
+ * @param community_id The id of the community.
156
+ *
157
+ * @returns promise
158
+ */
159
+ static listUsers<T>(community_id: string): AxiosPromise<Response<T>>;
160
+ /**
161
+ * Add a user to a community.
162
+ *
163
+ * @see https://api.glitch.fun/api/documentation#/communitys%20Route/createcommunityUser
164
+ *
165
+ * @param community_id The id of the community.
166
+ * @param data The data to be passed when adding a user.
167
+ *
168
+ * @returns promise
169
+ */
170
+ static addUser<T>(community_id: string, data?: object): AxiosPromise<Response<T>>;
171
+ /**
172
+ * Retrieves a single user and their information that is associated with a community.
173
+ *
174
+ * @see https://api.glitch.fun/api/documentation#/communitys%20Route/showcommunityUser
175
+ *
176
+ * @param community_id The id of the community.
177
+ * @param user_id The id of the user.
178
+ *
179
+ * @returns promise
180
+ */
181
+ static getUser<T>(community_id: string, user_id: string): AxiosPromise<Response<T>>;
182
+ /**
183
+ * Updates the users information associated with the community.
184
+ *
185
+ * @param community_id The id of the community.
186
+ * @param user_id The id of the user.
187
+ *
188
+ * @returns promise
189
+ */
190
+ static updatetUser<T>(community_id: string, user_id: string, data?: object): AxiosPromise<Response<T>>;
191
+ /**
192
+ * Removes a user from a community.
193
+ *
194
+ * @param community_id The id of community.
195
+ * @param user_id The id of the user.
196
+ *
197
+ * @returns promise
198
+ */
199
+ static removetUser<T>(community_id: string, user_id: string): AxiosPromise<Response<T>>;
200
+ }
201
+ export default Communities;
@@ -0,0 +1,97 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Templates {
4
+ /**
5
+ * List all the templates.
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/Template%20Route/resourceTemplateList
8
+ *
9
+ * @returns promise
10
+ */
11
+ static list<T>(): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Create a new template.
14
+ *
15
+ * @see https://api.glitch.fun/api/documentation#/Template%20Route/newTemplateResourceStorage
16
+ *
17
+ * @param data The data to be passed when creating a template.
18
+ *
19
+ * @returns Promise
20
+ */
21
+ static create<T>(data: object): AxiosPromise<Response<T>>;
22
+ /**
23
+ * Update a template.
24
+ *
25
+ * @see https://api.glitch.fun/api/documentation#/Template%20Route/updateTemplateStorage
26
+ *
27
+ * @param template_id The id of the template to update.
28
+ * @param data The data to update.
29
+ *
30
+ * @returns promise
31
+ */
32
+ static update<T>(template_id: string, data: object): AxiosPromise<Response<T>>;
33
+ /**
34
+ * Retrieve the information for a single template.
35
+ *
36
+ * @see https://api.glitch.fun/api/documentation#/Template%20Route/showTemplateStorage
37
+ *
38
+ * @param template_id The id fo the template to retrieve.
39
+ *
40
+ * @returns promise
41
+ */
42
+ static view<T>(template_id: string): AxiosPromise<Response<T>>;
43
+ /**
44
+ * Deletes a template.
45
+ *
46
+ * @see https://api.glitch.fun/api/documentation#/Template%20Route/destoryTemplateStorage
47
+ *
48
+ * @param template_id The id of the template to delete.
49
+ * @returns promise
50
+ */
51
+ static delete<T>(template_id: string): AxiosPromise<Response<T>>;
52
+ /**
53
+ * Updates the logo for the template using a File object.
54
+ *
55
+ * @see https://api.glitch.fun/api/documentation#/Template%20Route/uploadLogoTemplateImage
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 uploadLogoFile<T>(template_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
63
+ /**
64
+ * Updates the logo for the template using a Blob.
65
+ *
66
+ * @see https://api.glitch.fun/api/documentation#/Template%20Route/uploadLogoTemplateImage
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 uploadLogoBlob<T>(template_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
74
+ /**
75
+ * Updates the main image for the template using a File object.
76
+ *
77
+ * @see https://api.glitch.fun/api/documentation#/Template%20Route/uploadMainTemplateImage
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 uploadMainImageFile<T>(template_id: string, file: File, data?: object): AxiosPromise<Response<T>>;
85
+ /**
86
+ * Updates the main image for the template using a Blob.
87
+ *
88
+ * @see https://api.glitch.fun/api/documentation#/Template%20Route/uploadMainTemplateImage
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 uploadMainImageBlob<T>(template_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>;
96
+ }
97
+ export default Templates;
@@ -1,12 +1,16 @@
1
1
  import Auth from "./Auth";
2
2
  import Competitions from "./Competitions";
3
+ import Communities from "./Communities";
3
4
  import Users from "./Users";
4
5
  import Events from "./Events";
5
6
  import Teams from "./Teams";
6
7
  import Waitlists from "./Waitlist";
8
+ import Templates from "./Templates";
7
9
  export { Auth };
8
10
  export { Competitions };
11
+ export { Communities };
9
12
  export { Users };
10
13
  export { Events };
11
14
  export { Teams };
12
15
  export { Waitlists };
16
+ export { Templates };
@@ -1,9 +1,11 @@
1
1
  import { Config } from "./config";
2
2
  import Auth from "./api/Auth";
3
3
  import Competitions from "./api/Competitions";
4
+ import { Communities } from "./api";
4
5
  import { Users } from "./api";
5
6
  import { Events } from "./api";
6
7
  import { Teams } from "./api";
8
+ import { Templates } from "./api";
7
9
  import { Waitlists } from "./api";
8
10
  import Requests from "./util/Requests";
9
11
  import Parser from "./util/Parser";
@@ -24,9 +26,11 @@ declare class Glitch {
24
26
  static api: {
25
27
  Auth: typeof Auth;
26
28
  Competitions: typeof Competitions;
29
+ Communities: typeof Communities;
27
30
  Users: typeof Users;
28
31
  Events: typeof Events;
29
32
  Teams: typeof Teams;
33
+ Templates: typeof Templates;
30
34
  Waitlists: typeof Waitlists;
31
35
  };
32
36
  static util: {