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.
- package/dist/cjs/index.js +0 -136
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Events.d.ts +53 -0
- package/dist/esm/api/Users.d.ts +62 -0
- package/dist/esm/api/index.d.ts +4 -0
- package/dist/esm/index.d.ts +8 -2
- package/dist/esm/index.js +164 -318
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/EventsRoute.d.ts +7 -0
- package/dist/esm/routes/UserRoutes.d.ts +7 -0
- package/dist/index.d.ts +117 -2
- package/package.json +1 -1
- package/src/api/Events.ts +81 -0
- package/src/api/Users.ts +92 -0
- package/src/api/index.ts +5 -1
- package/src/index.ts +8 -2
- package/src/routes/EventsRoute.ts +33 -0
- package/src/routes/UserRoutes.ts +20 -0
package/dist/cjs/index.js
CHANGED
|
@@ -15712,147 +15712,11 @@ var Config = /** @class */ (function () {
|
|
|
15712
15712
|
return Config;
|
|
15713
15713
|
}());
|
|
15714
15714
|
|
|
15715
|
-
var AuthRoutes = /** @class */ (function () {
|
|
15716
|
-
function AuthRoutes() {
|
|
15717
|
-
}
|
|
15718
|
-
AuthRoutes.routes = {
|
|
15719
|
-
login: { url: '/auth/login', method: HTTP_METHODS.POST },
|
|
15720
|
-
register: { url: '/auth/register', method: HTTP_METHODS.POST },
|
|
15721
|
-
one_time_login: { url: '/auth/oneTimeLoginWithToken', method: HTTP_METHODS.POST },
|
|
15722
|
-
forgot_password: { url: '/auth/forgotpassword', method: HTTP_METHODS.POST },
|
|
15723
|
-
reset_password: { url: '/auth/resetpassword', method: HTTP_METHODS.POST },
|
|
15724
|
-
};
|
|
15725
|
-
return AuthRoutes;
|
|
15726
|
-
}());
|
|
15727
|
-
|
|
15728
|
-
var Auth = /** @class */ (function () {
|
|
15729
|
-
function Auth() {
|
|
15730
|
-
}
|
|
15731
|
-
/**
|
|
15732
|
-
* Attempts to authenticate a user using their email address.
|
|
15733
|
-
*
|
|
15734
|
-
* @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authLogin
|
|
15735
|
-
*
|
|
15736
|
-
* @param email The email address of the user
|
|
15737
|
-
* @param password The password of the user
|
|
15738
|
-
*
|
|
15739
|
-
* @returns A promise
|
|
15740
|
-
*/
|
|
15741
|
-
Auth.loginWithEmail = function (email, password) {
|
|
15742
|
-
return Requests.post(AuthRoutes.routes.login.url, { email: email, password: password });
|
|
15743
|
-
};
|
|
15744
|
-
/**
|
|
15745
|
-
* Attempts to authenticate a user using their username.
|
|
15746
|
-
*
|
|
15747
|
-
* @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authLogin
|
|
15748
|
-
*
|
|
15749
|
-
* @param username The username of the user
|
|
15750
|
-
* @param password The password of the user
|
|
15751
|
-
*
|
|
15752
|
-
* @returns A promise
|
|
15753
|
-
*/
|
|
15754
|
-
Auth.loginWithUsername = function (username, password) {
|
|
15755
|
-
return Requests.post(AuthRoutes.routes.login.url, { username: username, password: password });
|
|
15756
|
-
};
|
|
15757
|
-
/**
|
|
15758
|
-
* Attempts to register a user.
|
|
15759
|
-
*
|
|
15760
|
-
* @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authRegister
|
|
15761
|
-
*
|
|
15762
|
-
* @param data The data the user can register with.
|
|
15763
|
-
*
|
|
15764
|
-
* @returns A promise
|
|
15765
|
-
*/
|
|
15766
|
-
Auth.register = function (data) {
|
|
15767
|
-
return Requests.processRoute(AuthRoutes.routes.register, data);
|
|
15768
|
-
};
|
|
15769
|
-
return Auth;
|
|
15770
|
-
}());
|
|
15771
|
-
|
|
15772
|
-
var CompetitionRoutes = /** @class */ (function () {
|
|
15773
|
-
function CompetitionRoutes() {
|
|
15774
|
-
}
|
|
15775
|
-
CompetitionRoutes.routes = {
|
|
15776
|
-
list: { url: '/competitions', method: HTTP_METHODS.GET },
|
|
15777
|
-
create: { url: '/competitions', method: HTTP_METHODS.POST },
|
|
15778
|
-
view: { url: '/competitions/{competition_id}', method: HTTP_METHODS.GET },
|
|
15779
|
-
update: { url: '/competitions/{competition_id}', method: HTTP_METHODS.PUT },
|
|
15780
|
-
delete: { url: '/competitions/{competition_id}', method: HTTP_METHODS.DELETE },
|
|
15781
|
-
};
|
|
15782
|
-
return CompetitionRoutes;
|
|
15783
|
-
}());
|
|
15784
|
-
|
|
15785
|
-
var Competitions = /** @class */ (function () {
|
|
15786
|
-
function Competitions() {
|
|
15787
|
-
}
|
|
15788
|
-
/**
|
|
15789
|
-
* List all the competitions
|
|
15790
|
-
*
|
|
15791
|
-
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceList
|
|
15792
|
-
*
|
|
15793
|
-
* @returns promise
|
|
15794
|
-
*/
|
|
15795
|
-
Competitions.list = function () {
|
|
15796
|
-
return Requests.processRoute(CompetitionRoutes.routes.list);
|
|
15797
|
-
};
|
|
15798
|
-
/**
|
|
15799
|
-
* Create a new competition
|
|
15800
|
-
*
|
|
15801
|
-
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/newResourceStorage
|
|
15802
|
-
*
|
|
15803
|
-
* @param data The date to be passed when creating a competiton.
|
|
15804
|
-
*
|
|
15805
|
-
* @returns Promise
|
|
15806
|
-
*/
|
|
15807
|
-
Competitions.create = function (data) {
|
|
15808
|
-
return Requests.processRoute(CompetitionRoutes.routes.create, data);
|
|
15809
|
-
};
|
|
15810
|
-
/**
|
|
15811
|
-
* Update a competition
|
|
15812
|
-
*
|
|
15813
|
-
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateStorage
|
|
15814
|
-
*
|
|
15815
|
-
* @param competition_id The id of the competition to update.
|
|
15816
|
-
* @param data The data to update.
|
|
15817
|
-
*
|
|
15818
|
-
* @returns promise
|
|
15819
|
-
*/
|
|
15820
|
-
Competitions.update = function (competition_id, data) {
|
|
15821
|
-
return Requests.processRoute(CompetitionRoutes.routes.create, data, { competition_id: competition_id });
|
|
15822
|
-
};
|
|
15823
|
-
/**
|
|
15824
|
-
* Retrieve the information for a single competition.
|
|
15825
|
-
*
|
|
15826
|
-
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/showStorage
|
|
15827
|
-
*
|
|
15828
|
-
* @param competition_id The id fo the competition to retrieve.
|
|
15829
|
-
*
|
|
15830
|
-
* @returns promise
|
|
15831
|
-
*/
|
|
15832
|
-
Competitions.view = function (competition_id) {
|
|
15833
|
-
return Requests.processRoute(CompetitionRoutes.routes.view, {}, { competition_id: competition_id });
|
|
15834
|
-
};
|
|
15835
|
-
/**
|
|
15836
|
-
* Deletes a competition.
|
|
15837
|
-
*
|
|
15838
|
-
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryStorage
|
|
15839
|
-
*
|
|
15840
|
-
* @param competition_id The id of the competition to delete.
|
|
15841
|
-
* @returns promise
|
|
15842
|
-
*/
|
|
15843
|
-
Competitions.delete = function (competition_id) {
|
|
15844
|
-
return Requests.processRoute(CompetitionRoutes.routes.delete, {}, { competition_id: competition_id });
|
|
15845
|
-
};
|
|
15846
|
-
return Competitions;
|
|
15847
|
-
}());
|
|
15848
|
-
|
|
15849
15715
|
//Configuration
|
|
15850
15716
|
var Glitch = /** @class */ (function () {
|
|
15851
15717
|
function Glitch() {
|
|
15852
15718
|
}
|
|
15853
15719
|
Glitch.config = Config;
|
|
15854
|
-
Glitch.auth = Auth;
|
|
15855
|
-
Glitch.competitions = Competitions;
|
|
15856
15720
|
return Glitch;
|
|
15857
15721
|
}());
|
|
15858
15722
|
|