fix(core): update

This commit is contained in:
2024-02-17 21:55:25 +01:00
parent 332a4a4195
commit 929404fadd
8 changed files with 100 additions and 31 deletions
+9
View File
@@ -11,6 +11,10 @@ export class HetznerAccount {
return HetznerServer.getServers(this);
}
public async createServer(optionsArg: plugins.tsclass.typeFestOwn.SecondArgument<typeof HetznerServer.create>) {
return HetznerServer.create(this, optionsArg);
}
/**
* request things from the hetzner API
* @param methodArg
@@ -19,6 +23,9 @@ export class HetznerAccount {
*/
public request = async (methodArg: string, pathArg: string, payloadArg: any) => {
const url = `https://api.hetzner.cloud/v1${pathArg}`;
console.log(`Url: ${url}`);
console.log(`Method: ${methodArg}`);
console.log(`Payload: ${JSON.stringify(payloadArg, null, 2)}`);
const response = await plugins.smartrequest.request(url, {
method: methodArg,
headers: {
@@ -26,6 +33,8 @@ export class HetznerAccount {
},
requestBody: payloadArg,
});
console.log(response.statusCode);
console.log(response.body);
return response;
}
}