exaroton 1.11.2 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exaroton",
3
- "version": "1.11.2",
3
+ "version": "1.12.0",
4
4
  "description": "exaroton API client",
5
5
  "homepage": "https://exaroton.com",
6
6
  "main": "index.js",
@@ -0,0 +1,20 @@
1
+ const ServerRequest = require('./ServerRequest');
2
+
3
+ class ExtendServerStopTimeRequest extends ServerRequest {
4
+ endpoint = "servers/{id}/extend-time";
5
+ method = "POST";
6
+
7
+ /**
8
+ * ExecuteServerCommandRequest constructor
9
+ *
10
+ * @param {string} id
11
+ * @param {number} time
12
+ */
13
+ constructor(id, time) {
14
+ super(id);
15
+
16
+ this.data = {time: time};
17
+ }
18
+ }
19
+
20
+ module.exports = ExtendServerStopTimeRequest;
@@ -16,6 +16,7 @@ const ShareServerLogsRequest = require('../Request/Server/ShareServerLogsRequest
16
16
  const GetServerOptionRequest = require('../Request/Server/GetServerOptionRequest');
17
17
  const SetServerOptionRequest = require('../Request/Server/SetServerOptionRequest');
18
18
  const GetPlayerListsRequest = require('../Request/Server/PlayerLists/GetPlayerListsRequest');
19
+ const ExtendServerStopTimeRequest = require("../Request/Server/ExtendServerStopTimeRequest.js");
19
20
 
20
21
  class Server extends EventEmitter {
21
22
  /**
@@ -195,6 +196,17 @@ class Server extends EventEmitter {
195
196
  return this.#client.request(new ExecuteServerCommandRequest(this.id, command));
196
197
  }
197
198
 
199
+ /**
200
+ * Extend the time until the server automatically stops
201
+ *
202
+ * @param {number} time
203
+ * @return {Promise<Response>}
204
+ * @throws {RequestError}
205
+ */
206
+ async extendStopTime(time) {
207
+ return this.#client.request(new ExtendServerStopTimeRequest(this.id, time));
208
+ }
209
+
198
210
  /**
199
211
  * Get the content of the server logs
200
212
  *
@@ -460,4 +472,4 @@ class Server extends EventEmitter {
460
472
  }
461
473
  }
462
474
 
463
- module.exports = Server;
475
+ module.exports = Server;
@@ -9,6 +9,7 @@ const ServerStatus = {
9
9
  LOADING: 6,
10
10
  CRASHED: 7,
11
11
  PENDING: 8,
12
+ TRANSFERRING: 9,
12
13
  PREPARING: 10
13
14
  };
14
15