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.
- package/dist/cjs/index.js +132 -127
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Auth.d.ts +34 -2
- package/dist/esm/api/Competitions.d.ts +50 -5
- package/dist/esm/index.js +470 -447
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/util/Requests.d.ts +27 -5
- package/dist/index.d.ts +82 -7
- package/package.json +1 -1
- package/src/api/Auth.ts +38 -3
- package/src/api/Competitions.ts +50 -5
- package/src/util/Requests.ts +46 -31
package/dist/esm/api/Auth.d.ts
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
|
+
import Response from "../util/Response";
|
|
2
|
+
import { AxiosPromise } from "axios";
|
|
1
3
|
declare class Auth {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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;
|