-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
43 lines (27 loc) · 2.15 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
39
40
41
42
43
module.exports = class PteroManager {
constructor(apiKey, url) {
this.apiKey = apiKey;
this.url = url;
this.headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": `Bearer ${this.apiKey}`
};
}
createUser = async (body) => require('./src/functions/Users/createUser')(this.url, this.headers, body);
createServer = async (query, body) => require('./src/functions/Servers/createServer')(this.url, this.headers, query, body);
createFolder = async (query, userApiKey, body) => require('./src/functions/Files/createFolder')(this.url, this.headers, query, userApiKey, body);
suspendServer = async (query) => require('./src/functions/Servers/suspendServer')(this.url, this.headers, query);
unsuspendServer = async (query) => require('./src/functions/Servers/unsuspendServer')(this.url, this.headers, query);
reinstallServer = async (query) => require('./src/functions/Servers/reinstallServer')(this.url, this.headers, query);
updateUser = async (query, newData) => require('./src/functions/Users/updateUser')(this.url, this.headers, query, newData);
updateServer = async (query, newData) => require('./src/functions/Users/updateServer')(this.url, this.headers, query, newData);
deleteUser = async (query) => require('./src/functions/Users/deleteUser')(this.url, this.headers, query);
deleteUser = async (query) => require('./src/functions/Servers/deleteServer')(this.url, this.headers, query);
getUsers = async () => require('./src/functions/Users/getUsers')(this.url, this.headers);
getUser = async (query) => require('./src/functions/Users/getUser')(this.url, this.headers, query);
getUserServers = async (query) => require('./src/functions/Users/getUserServers')(this.url, this.headers, query);
getServers = async () => require('./src/functions/Servers/getServers')(this.url, this.headers);
getServer = async (query) => require('./src/functions/Servers/getServer')(this.url, this.headers, query);
writeFile = async (query, userApiKey, filePath, fileContent) => require('./src/functions/Files/writeFile')(this.url, this.headers, query, userApiKey, filePath, fileContent);
};