glitch-javascript-sdk 0.0.1 → 0.0.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.
@@ -1,5 +1,37 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
1
3
  declare class Auth {
2
- static login(login: string, password: string): Promise<import("../util/Response").default<unknown>>;
3
- static register(data: object): Promise<import("../util/Response").default<unknown> | undefined>;
4
+ /**
5
+ * Attempts to authenticate a user using their email address.
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authLogin
8
+ *
9
+ * @param email The email address of the user
10
+ * @param password The password of the user
11
+ *
12
+ * @returns A promise
13
+ */
14
+ static loginWithEmail<T>(email: string, password: string): AxiosPromise<Response<T>>;
15
+ /**
16
+ * Attempts to authenticate a user using their username.
17
+ *
18
+ * @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authLogin
19
+ *
20
+ * @param username The username of the user
21
+ * @param password The password of the user
22
+ *
23
+ * @returns A promise
24
+ */
25
+ static loginWithUsername<T>(username: string, password: string): AxiosPromise<Response<T>>;
26
+ /**
27
+ * Attempts to register a user.
28
+ *
29
+ * @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authRegister
30
+ *
31
+ * @param data The data the user can register with.
32
+ *
33
+ * @returns A promise
34
+ */
35
+ static register<T>(data: object): AxiosPromise<Response<T>>;
4
36
  }
5
37
  export default Auth;
@@ -1,8 +1,53 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
1
3
  declare class Competitions {
2
- static list(): Promise<import("../util/Response").default<unknown> | undefined>;
3
- static create(data: object): Promise<import("../util/Response").default<unknown> | undefined>;
4
- static update(competition_id: string, data: object): Promise<import("../util/Response").default<unknown> | undefined>;
5
- static view(competition_id: string): Promise<import("../util/Response").default<unknown> | undefined>;
6
- static delete(competition_id: string): Promise<import("../util/Response").default<unknown> | undefined>;
4
+ /**
5
+ * List all the competitions
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceList
8
+ *
9
+ * @returns promise
10
+ */
11
+ static list<T>(): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Create a new competition
14
+ *
15
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/newResourceStorage
16
+ *
17
+ * @param data The date to be passed when creating a competiton.
18
+ *
19
+ * @returns Promise
20
+ */
21
+ static create<T>(data: object): AxiosPromise<Response<T>>;
22
+ /**
23
+ * Update a competition
24
+ *
25
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateStorage
26
+ *
27
+ * @param competition_id The id of the competition to update.
28
+ * @param data The data to update.
29
+ *
30
+ * @returns promise
31
+ */
32
+ static update<T>(competition_id: string, data: object): AxiosPromise<Response<T>>;
33
+ /**
34
+ * Retrieve the information for a single competition.
35
+ *
36
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/showStorage
37
+ *
38
+ * @param competition_id The id fo the competition to retrieve.
39
+ *
40
+ * @returns promise
41
+ */
42
+ static view<T>(competition_id: string): AxiosPromise<Response<T>>;
43
+ /**
44
+ * Deletes a competition.
45
+ *
46
+ * @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryStorage
47
+ *
48
+ * @param competition_id The id of the competition to delete.
49
+ * @returns promise
50
+ */
51
+ static delete<T>(competition_id: string): AxiosPromise<Response<T>>;
7
52
  }
8
53
  export default Competitions;