fix(core): update

This commit is contained in:
2024-01-29 21:08:05 +01:00
parent 82668f9610
commit d4f777d0e6
269 changed files with 120 additions and 28951 deletions
+30
View File
@@ -0,0 +1,30 @@
import * as plugins from './hetznercloud.plugins.js';
export class HetznerAccount {
public token: string;
constructor(tokenArg: string) {
this.token = tokenArg;
}
getServers() {
}
/**
* request things from the hetzner API
* @param methodArg
* @param pathArg
* @param payloadArg
*/
public request = async (methodArg: string, pathArg: string, payloadArg: any) => {
const url = `https://api.hetzner.cloud/v1${pathArg}`;
const response = await plugins.smartrequest.request(url, {
method: methodArg,
headers: {
Authorization: `Bearer ${this.token}`,
},
requestBody: payloadArg,
});
return response;
}
}