From 1ec6e0d049f5e6f111fc6e21862768e1760b4ecc Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Thu, 22 Oct 2020 20:23:34 +0100 Subject: [PATCH 1/4] Update methods for 2.4.0 --- methods.json | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/methods.json b/methods.json index d62b685..14071d7 100644 --- a/methods.json +++ b/methods.json @@ -181,6 +181,10 @@ { "name": "value", "type": "array" + }, + { + "name": "details", + "default": "0" } ], "listServersByConnection": [ @@ -386,6 +390,9 @@ "server_id", "daemon_id" ], + "getMoveStatus": [ + "server_id" + ], "listServerPorts": [ "id" ], @@ -429,7 +436,7 @@ ], "getStatistics": [ { - "name": "daemon_id", + "name": "id", "default": 0 }, { @@ -437,6 +444,18 @@ "default": 0 } ], + "runScript": [ + "daemon_id", + "script", + { + "name": "args", + "default": "" + } + ], + "getScript": [ + "daemon_id", + "scriptId" + ], "listSettings": [], "getSetting": [ "key" From 99ac55d60437fa6e88b50e296076d22f64172858 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Thu, 22 Oct 2020 20:26:53 +0100 Subject: [PATCH 2/4] Update version in package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index eba31f8..8e3aaa8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "multicraft-api-node", - "version": "2.3.0", - "description": "API Version 2.3.0", + "version": "2.4.0", + "description": "API Version 2.4.0", "main": "index.js", "homepage": "https://github.com/Shockbyte/multicraft-api-node", "repository": { From abfc6f566ab75b0160f1e4e4a39c379e2c0859a1 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Thu, 22 Oct 2020 20:27:00 +0100 Subject: [PATCH 3/4] Update readme --- README.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 84251c2..a5d1e58 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,34 @@ A Node.js wrapper for the Multicraft API. -To view examples of use, check out the `examples.js` file. -### Updating +### Example use + +`npm i multicraft-api-node` + +``` +const MulticraftAPI = require('multicraft-api-node'); + +const api = new MulticraftAPI({ + url: "https://localhost/api.php", + user: "username", + key: "apiKey" +}); + +api.listServersByConnection({ connection_id: '1' }) + .then((data) => console.log(data)) + .catch((err) => console.error(err)); + +// { +// success: true, +// errors: [], +// data: { Servers: { '1': 'test', '2': 'Minecraft Server' } } +// } + +``` +To view more examples of use, check out the `examples.js` file. + +### Manual Updating The `methods.json` file automatically generates the functions. To update this file: From 6588c93275dd5996d8354c5aa35e538fbf847d1e Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Thu, 22 Oct 2020 20:27:11 +0100 Subject: [PATCH 4/4] Remove incorrect api credentials --- examples.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples.js b/examples.js index 81b1164..f90cb04 100644 --- a/examples.js +++ b/examples.js @@ -3,8 +3,8 @@ const MulticraftAPI = require('multicraft-api-node'); const api = new MulticraftAPI({ url: "https://localhost/api.php", - user: "admin", - key: "5kd9HaPid@mWqK" + user: "username", + key: "apiKey" }); async function examples() {