glitch-javascript-sdk 0.0.2 → 0.0.3

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,53 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Events {
4
+ /**
5
+ * List all the events
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/Event%20Route/resourceEventList
8
+ *
9
+ * @returns promise
10
+ */
11
+ static list<T>(): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Create a new event.
14
+ *
15
+ * @see https://api.glitch.fun/api/documentation#/Event%20Route/newEventResourceStorage
16
+ *
17
+ * @param data The data to be passed when creating an event.
18
+ *
19
+ * @returns Promise
20
+ */
21
+ static create<T>(data: object): AxiosPromise<Response<T>>;
22
+ /**
23
+ * Update a event
24
+ *
25
+ * @see https://api.glitch.fun/api/documentation#/Event%20Route/updateEventStorage
26
+ *
27
+ * @param event_id The id of the event to update.
28
+ * @param data The data to update.
29
+ *
30
+ * @returns promise
31
+ */
32
+ static update<T>(event_id: string, data: object): AxiosPromise<Response<T>>;
33
+ /**
34
+ * Retrieve the information for a single event.
35
+ *
36
+ * @see https://api.glitch.fun/api/documentation#/Event%20Route/showEventStorage
37
+ *
38
+ * @param event_id The id fo the event to retrieve.
39
+ *
40
+ * @returns promise
41
+ */
42
+ static view<T>(event_id: string): AxiosPromise<Response<T>>;
43
+ /**
44
+ * Deletes a event.
45
+ *
46
+ * @see https://api.glitch.fun/api/documentation#/Event%20Route/destoryEventStorage
47
+ *
48
+ * @param event_id The id of the event to delete.
49
+ * @returns promise
50
+ */
51
+ static delete<T>(event_id: string): AxiosPromise<Response<T>>;
52
+ }
53
+ export default Events;
@@ -0,0 +1,62 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Users {
4
+ /**
5
+ * List all the users.
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userList
8
+ *
9
+ * @returns promise
10
+ */
11
+ static list<T>(): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Updates a users information. Requires the users JSON Web Token (JWT) for them to update their profile.
14
+ *
15
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
16
+ *
17
+ * @param data The date to be passed when creating a competiton.
18
+ *
19
+ * @returns Promise
20
+ */
21
+ static update<T>(data: object): AxiosPromise<Response<T>>;
22
+ /**
23
+ * Gets the current users information based on the current Json Web Token (JWT).
24
+ *
25
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
26
+ *
27
+ * @param user_id The id of the user to update.
28
+ * @param data The data to update.
29
+ *
30
+ * @returns promise
31
+ */
32
+ static me<T>(): AxiosPromise<Response<T>>;
33
+ /**
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
+ *
36
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userToggleFollow
37
+ *
38
+ * @param user_id The id fo the user to retrieve.
39
+ *
40
+ * @returns promise
41
+ */
42
+ static followToggle<T>(user_id: string): AxiosPromise<Response<T>>;
43
+ /**
44
+ * Show a users profile.
45
+ *
46
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/showUser
47
+ *
48
+ * @param user_id The id of the user to delete.
49
+ * @returns promise
50
+ */
51
+ static profile<T>(user_id: string): AxiosPromise<Response<T>>;
52
+ /**
53
+ * Retrieves a user's one time login token based on a users JWT.
54
+ *
55
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userOneTimeLoginToken
56
+ *
57
+ *
58
+ * @returns promise
59
+ */
60
+ static oneTimeLoginToken<T>(): AxiosPromise<Response<T>>;
61
+ }
62
+ export default Users;
@@ -1,4 +1,8 @@
1
1
  import Auth from "./Auth";
2
2
  import Competitions from "./Competitions";
3
+ import Users from "./Users";
4
+ import Events from "./Events";
3
5
  export { Auth };
4
6
  export { Competitions };
7
+ export { Users };
8
+ export { Events };
@@ -1,9 +1,15 @@
1
1
  import Config from "./config/Config";
2
2
  import { Auth } from "./api";
3
3
  import { Competitions } from "./api";
4
+ import { Users } from "./api";
5
+ import { Events } from "./api";
4
6
  declare class Glitch {
5
7
  static config: typeof Config;
6
- static auth: typeof Auth;
7
- static competitions: typeof Competitions;
8
+ static api: {
9
+ Auth: typeof Auth;
10
+ Competitions: typeof Competitions;
11
+ Users: typeof Users;
12
+ Events: typeof Events;
13
+ };
8
14
  }
9
15
  export { Glitch };