Making makeRequest public
This commit is contained in:
parent
33353e3136
commit
26f3f4c03c
2
index.d.ts
vendored
2
index.d.ts
vendored
@ -18,7 +18,7 @@ export default class SecureFile {
|
|||||||
private PrivateKey;
|
private PrivateKey;
|
||||||
constructor(server: string, username: string, private_key: string);
|
constructor(server: string, username: string, private_key: string);
|
||||||
private getCode();
|
private getCode();
|
||||||
private makeRequest(endpoint, method, query, body?);
|
makeRequest(endpoint: string, method: "POST" | "GET" | "PUT" | "DELETE", query: any, body?: Buffer): Promise<Response>;
|
||||||
test(): Promise<{
|
test(): Promise<{
|
||||||
user: string;
|
user: string;
|
||||||
test: true;
|
test: true;
|
||||||
|
2
index.ts
2
index.ts
@ -50,7 +50,7 @@ export default class SecureFile {
|
|||||||
return { code: code, signature: r.sign(code).toString("base64") };
|
return { code: code, signature: r.sign(code).toString("base64") };
|
||||||
}
|
}
|
||||||
|
|
||||||
private async makeRequest(endpoint: string, method: "POST" | "GET" | "PUT" | "DELETE", query: any, body?: Buffer) {
|
public async makeRequest(endpoint: string, method: "POST" | "GET" | "PUT" | "DELETE", query: any, body?: Buffer) {
|
||||||
let code = await this.getCode();
|
let code = await this.getCode();
|
||||||
query.code = code.code;
|
query.code = code.code;
|
||||||
query.signature = code.signature;
|
query.signature = code.signature;
|
||||||
|
Reference in New Issue
Block a user