File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33A Node.js wrapper for the Multicraft API.
44
5- To view examples of use, check out the ` examples.js ` file.
65
7- ### Updating
6+ ### Example use
7+
8+ ` npm i multicraft-api-node `
9+
10+ ```
11+ const MulticraftAPI = require('multicraft-api-node');
12+
13+ const api = new MulticraftAPI({
14+ url: "https://localhost/api.php",
15+ user: "username",
16+ key: "apiKey"
17+ });
18+
19+ api.listServersByConnection({ connection_id: '1' })
20+ .then((data) => console.log(data))
21+ .catch((err) => console.error(err));
22+
23+ // {
24+ // success: true,
25+ // errors: [],
26+ // data: { Servers: { '1': 'test', '2': 'Minecraft Server' } }
27+ // }
28+
29+ ```
30+ To view more examples of use, check out the ` examples.js ` file.
31+
32+ ### Manual Updating
833
934The ` methods.json ` file automatically generates the functions. To update this file:
1035
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ const MulticraftAPI = require('multicraft-api-node');
33
44const api = new MulticraftAPI ( {
55 url : "https://localhost/api.php" ,
6- user : "admin " ,
7- key : "5kd9HaPid@mWqK "
6+ user : "username " ,
7+ key : "apiKey "
88} ) ;
99
1010async function examples ( ) {
Original file line number Diff line number Diff line change 181181 {
182182 "name" : " value" ,
183183 "type" : " array"
184+ },
185+ {
186+ "name" : " details" ,
187+ "default" : " 0"
184188 }
185189 ],
186190 "listServersByConnection" : [
386390 " server_id" ,
387391 " daemon_id"
388392 ],
393+ "getMoveStatus" : [
394+ " server_id"
395+ ],
389396 "listServerPorts" : [
390397 " id"
391398 ],
429436 ],
430437 "getStatistics" : [
431438 {
432- "name" : " daemon_id " ,
439+ "name" : " id " ,
433440 "default" : 0
434441 },
435442 {
436443 "name" : " include_suspended" ,
437444 "default" : 0
438445 }
439446 ],
447+ "runScript" : [
448+ " daemon_id" ,
449+ " script" ,
450+ {
451+ "name" : " args" ,
452+ "default" : " "
453+ }
454+ ],
455+ "getScript" : [
456+ " daemon_id" ,
457+ " scriptId"
458+ ],
440459 "listSettings" : [],
441460 "getSetting" : [
442461 " key"
Original file line number Diff line number Diff line change 11{
22 "name" : " multicraft-api-node" ,
3- "version" : " 2.3 .0" ,
4- "description" : " API Version 2.3 .0" ,
3+ "version" : " 2.4 .0" ,
4+ "description" : " API Version 2.4 .0" ,
55 "main" : " index.js" ,
66 "homepage" : " https://github.com/Shockbyte/multicraft-api-node" ,
77 "repository" : {
You can’t perform that action at this time.
0 commit comments