24fire-api 1.0.1 → 1.0.3

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/index.js +25 -18
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "24fire-api",
3
- "version": "1.0.1",
4
- "description": "Nutze die fireapi in Nodejs, sicher und schnell",
3
+ "version": "1.0.3",
4
+ "description": "Nutze die 24fire api in Nodejs, sicher und schnell",
5
5
  "main": "src/index.js",
6
6
  "repository": {
7
7
  "type": "git",
package/src/index.js CHANGED
@@ -7,6 +7,7 @@
7
7
  //24fireAPI für NodeJS
8
8
  //Stand: 06.01.2024
9
9
  //Made by FlosTechnikwlt
10
+ //Credits: Lars.1309
10
11
 
11
12
  'use strict';
12
13
  const axios = require('axios');
@@ -48,12 +49,14 @@ class fireAPI {
48
49
 
49
50
 
50
51
  async function startVM() {
51
- const response = await axios.post(`https://api.24fire.de/kvm/status/start`, {
52
- headers: {
53
- //'Authorization': `Bearer ${apiKey}`,
54
- 'X-FIRE-APIKEY': apiKey,
55
- },
56
- });
52
+ const response = await axios.request({
53
+ method: 'post',
54
+ maxBodyLength: Infinity,
55
+ url: 'https://api.24fire.de/kvm/status/start',
56
+ headers: {
57
+ 'X-FIRE-APIKEY': apiKey
58
+ }
59
+ })
57
60
  return response.data;
58
61
  }
59
62
 
@@ -61,12 +64,14 @@ class fireAPI {
61
64
 
62
65
 
63
66
  async function stopVM() {
64
- const response = await axios.post(`https://api.24fire.de/kvm/status/stop`, {
65
- headers: {
66
- //'Authorization': `Bearer ${apiKey}`,
67
- 'X-FIRE-APIKEY': apiKey,
68
- },
69
- });
67
+ const response = await axios.request({
68
+ method: 'post',
69
+ maxBodyLength: Infinity,
70
+ url: 'https://api.24fire.de/kvm/status/start',
71
+ headers: {
72
+ 'X-FIRE-APIKEY': apiKey
73
+ }
74
+ })
70
75
  return response.data;
71
76
  }
72
77
 
@@ -74,12 +79,14 @@ class fireAPI {
74
79
 
75
80
 
76
81
  async function restartVM() {
77
- const response = await axios.post(`https://api.24fire.de/kvm/status/restart`, {
78
- headers: {
79
- //'Authorization': `Bearer ${apiKey}`,
80
- 'X-FIRE-APIKEY': apiKey,
81
- },
82
- });
82
+ const response = await axios.request({
83
+ method: 'post',
84
+ maxBodyLength: Infinity,
85
+ url: 'https://api.24fire.de/kvm/status/restart',
86
+ headers: {
87
+ 'X-FIRE-APIKEY': apiKey
88
+ }
89
+ })
83
90
  return response.data;
84
91
  }
85
92