Skip to content

Commit 9b1d5c5

Browse files
committed
Merge branch '2.4.0'
2 parents 53bf9cc + 6588c93 commit 9b1d5c5

4 files changed

Lines changed: 51 additions & 7 deletions

File tree

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,34 @@
22

33
A 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

934
The `methods.json` file automatically generates the functions. To update this file:
1035

examples.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ const MulticraftAPI = require('multicraft-api-node');
33

44
const api = new MulticraftAPI({
55
url: "https://localhost/api.php",
6-
user: "admin",
7-
key: "5kd9HaPid@mWqK"
6+
user: "username",
7+
key: "apiKey"
88
});
99

1010
async function examples() {

methods.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@
181181
{
182182
"name": "value",
183183
"type": "array"
184+
},
185+
{
186+
"name": "details",
187+
"default": "0"
184188
}
185189
],
186190
"listServersByConnection": [
@@ -386,6 +390,9 @@
386390
"server_id",
387391
"daemon_id"
388392
],
393+
"getMoveStatus": [
394+
"server_id"
395+
],
389396
"listServerPorts": [
390397
"id"
391398
],
@@ -429,14 +436,26 @@
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"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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": {

0 commit comments

Comments
 (0)