-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
38 lines (35 loc) · 1.36 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const LinkedAccounts = require("./endpoints/linkedAccounts");
const Authentication = require("./endpoints/authentication");
const Leaderboards = require("./endpoints/leaderboards");
const Endpoint = require("./endpoints/endpoint");
const Contact = require("./endpoints/contact");
const Badges = require("./endpoints/badges");
const Health = require("./endpoints/health");
const Search = require("./endpoints/search");
const Users = require("./endpoints/users");
const Games = require("./endpoints/games");
class DevWarsApi {
/**
* Creates a new instance of the devwars api.
* @param {AxiosInstance} client The axios client to be used to communicate with the api.
*/
constructor(axios) {
this.leaderboards = new Leaderboards(axios, "leaderboards");
this.linkedAccounts = new LinkedAccounts(axios, "oauth");
this.authentication = new Authentication(axios, "auth");
this.contact = new Contact(axios, "contact");
this.health = new Health(axios, "health");
this.search = new Search(axios, "search");
this.badges = new Badges(axios, "badges");
this.users = new Users(axios, "users");
this.games = new Games(axios, "games");
}
/**
* A static body that will be joined with any given body that is also sent.
* This can be used to sent api tokens.
*/
set body(value) {
Endpoint.body = value;
}
}
module.exports = DevWarsApi;