pterodactyl-api-client 1.0.0 → 1.0.2
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/README.md +0 -0
- package/dist/class/APIError.d.ts +1 -1
- package/dist/class/APIError.d.ts.map +1 -1
- package/dist/class/APIError.js +1 -1
- package/dist/class/HttpClient.js +2 -2
- package/dist/class.d.ts +1 -1
- package/dist/class.d.ts.map +1 -1
- package/dist/class.js +1 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
Binary file
|
package/dist/class/APIError.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIError.d.ts","sourceRoot":"","sources":["../../src/class/APIError.ts"],"names":[],"mappings":"AAAA,qBAAa,
|
|
1
|
+
{"version":3,"file":"APIError.d.ts","sourceRoot":"","sources":["../../src/class/APIError.ts"],"names":[],"mappings":"AAAA,qBAAa,mBAAmB,CAAC,CAAC,CAAE,SAAQ,KAAK;IAE7C,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,IAAI,CAAC,GAAE,CAAC,GAAG,IAAI;gBAHf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,GAAE,CAAC,GAAG,IAAI,aAAA;CAI3B"}
|
package/dist/class/APIError.js
CHANGED
package/dist/class/HttpClient.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PterodactylAPIError } from "./APIError.js";
|
|
2
2
|
export default class HttpClient {
|
|
3
3
|
baseURL;
|
|
4
4
|
apiKey;
|
|
@@ -17,7 +17,7 @@ export default class HttpClient {
|
|
|
17
17
|
body: body ? JSON.stringify(body) : null,
|
|
18
18
|
});
|
|
19
19
|
if (!res.ok) {
|
|
20
|
-
throw new
|
|
20
|
+
throw new PterodactylAPIError(res.status, await res.text(), path, body);
|
|
21
21
|
}
|
|
22
22
|
try {
|
|
23
23
|
const returnValue = (await res.json());
|
package/dist/class.d.ts
CHANGED
package/dist/class.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../src/class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,CAAC,OAAO,OAAO,
|
|
1
|
+
{"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../src/class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;gBAEX,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;CAQvE"}
|
package/dist/class.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClientAPI } from "./client/index.js";
|
|
2
|
-
export default class
|
|
2
|
+
export default class PterodactylAPIClient {
|
|
3
3
|
panelUrl;
|
|
4
4
|
role;
|
|
5
5
|
user;
|
|
@@ -14,10 +14,3 @@ export default class PterodactyleAPIClient {
|
|
|
14
14
|
throw new Error("Invalide API key");
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
const client = new PterodactyleAPIClient({
|
|
18
|
-
apiKey: "ptlc_dGFntmD0x97gQ5seINCDtKdLEsI9zV805mhAQ2mjxm9",
|
|
19
|
-
panelUrl: "https://panel.hawai1401.fr",
|
|
20
|
-
});
|
|
21
|
-
client.user.server.schedule.task
|
|
22
|
-
.delete("3ac4b4c1", 2, 4)
|
|
23
|
-
.then((res) => console.log(res));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export {
|
|
1
|
+
export { default as PterodactylAPIClient } from "./class.js";
|
|
2
|
+
export { PterodactylAPIError } from "./class/APIError.js";
|
|
3
3
|
export { default as HttpClient } from "./class/HttpClient.js";
|
|
4
4
|
export * from "./types.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE9D,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export {
|
|
1
|
+
export { default as PterodactylAPIClient } from "./class.js";
|
|
2
|
+
export { PterodactylAPIError } from "./class/APIError.js";
|
|
3
3
|
export { default as HttpClient } from "./class/HttpClient.js";
|
|
4
4
|
export * from "./types.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pterodactyl-api-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "SDK TypeScript non officiel et entièrement typé pour l’API Pterodactyl.\nCouvre l’ensemble des endpoints client et application avec une architecture modulaire, orientée classes, conçue pour Node.js et les environnements TypeScript stricts.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"typed-api"
|
|
51
51
|
],
|
|
52
52
|
"repository": {
|
|
53
|
-
"url": "https://github.com/hawai1401/
|
|
53
|
+
"url": "https://github.com/hawai1401/pterodactyl-api-client"
|
|
54
54
|
},
|
|
55
55
|
"author": "hawai1401 <hawai1401@ik.me> (https://hawai1401.fr)",
|
|
56
56
|
"license": "MIT",
|