jspteroapi
Version:
A pterodactyl v1 api using undici
74 lines (73 loc) • 2.94 kB
TypeScript
import { Client } from '../index';
import { Allocation } from '../interfaces/Allocation';
export declare class networkMethods {
private readonly client;
constructor(client: Client);
/**
* @param serverId - ID of the server to get (In the settings tab of server/in link)
* @returns Array of allocations
* @example
* ```ts
* const res = await client.getAllAlocations('c2f5a3b6') // res = Allocation[]
* ```
* @example
* ```ts
* client.getAllAlocations('c2f5a3b6').then((res) => console.log(res)) // res = Allocation[]
* ```
*/
getAllAlocations: (serverId: string) => Promise<Allocation[]>;
/**
* @param serverId - ID of the server to get (In the settings tab of server/in link)
* @remarks This method is only available if auto-assign is enabled
* @example
* ```ts
* const res = await client.assignAllocation('c2f5a3b6') // res = Allocation
* ```
* @example
* ```ts
* client.assignAllocation('c2f5a3b6').then((res) => console.log(res)) // res = Allocation
* ```
*/
assignAllocation: (serverId: string) => Promise<Allocation>;
/**
* @param serverId - ID of the server to get (In the settings tab of server/in link)
* @param allocationId - ID of the allocation to set the note for
* @param note - The note you want to set
* @example
* ```ts
* const res = await client.setAllocationNote('c2f5a3b6', 1, "Port for RDP") // res = Allocation
* ```
* @example
* ```ts
* client.setAllocationNote('c2f5a3b6', 1, "Port for RDP").then((res) => console.log(res)) // res = Allocation
* ```
*/
setAllocationNote: (serverId: string, allocationId: number, note: string) => Promise<Allocation>;
/**
* @param serverId - ID of the server to get (In the settings tab of server/in link)
* @param allocationId - ID of the allocation to make primary
* @example
* ```ts
* const res = await client.setAllocationPrimary('c2f5a3b6', 1) // res = Allocation
* ```
* @example
* ```ts
* client.setAllocationPrimary('c2f5a3b6', 1).then((res) => console.log(res)) // res = Allocation
* ```
*/
setAllocationPrimary: (serverId: string, allocationId: number) => Promise<Allocation>;
/**
* @param serverId - ID of the server to get (In the settings tab of server/in link)
* @param allocationId - ID of the allocation to delete
* @remarks This method is only available if allocation is not primary
* @example
* ```ts
* const res = await client.deleteAllocation('c2f5a3b6', 1) // res = Sucessfully deleted Allocation!
* ```
* @example
* ```ts
* client.deleteAllocation('c2f5a3b6', 1).then((res) => console.log(res)) // res = Sucessfully deleted Allocation!
* ```
*/
deleteAllocation: (serverId: string, allocationId: number) => Promise<string>;
}