UNPKG

jspteroapi

Version:

A pterodactyl v1 api using undici

55 lines (54 loc) 2.13 kB
import { Allocation, AllocationFilterInput, AllocationIncludeInput } from '../interfaces/Allocation'; import { Application } from '../index'; export declare class allocationMethods { private readonly application; constructor(application: Application); /** * @internal */ private getAllocations; /** * @param nodeId - The node id of which you want to get allocations from * @param options - Include information about relationships * @returns Returns information about node * @example * ```ts * const res = await app.getAllAllocations(1) // res = NodeAttributes * ``` * @example * ```ts * app.getAllAllocations(1).then((res) => console.log(res)) // res = NodeAttributes * ``` */ getAllAllocations: (nodeId: number, options?: AllocationIncludeInput, filter?: AllocationFilterInput) => Promise<Allocation[]>; /** * @param nodeId - The node id of which you want to create allocations * @param ports - Ports array to add * @param alias - The alias for this allocation * @param ip - IP for the allocation * @returns If successful returns Successfully created! * @example * ```ts * const res = await app.createAllocation(1, ['25565']) // res = Successfully created! * ``` * @example * ```ts * app.createAllocation(1, ['25565'], 'minecraft').then((res) => console.log(res)) // res = Successfully created! * ``` */ createAllocation: (nodeId: number, ports: string[], alias?: string, ip?: string) => Promise<string>; /** * @param nodeId - The node id of which you want to delete allocation * @param allocationId - The id of allocation to delete * @returns If successful returns Successfully deleted! * @example * ```ts * const res = await app.deleteAllocation(1, 5) // res = Successfully deleted! * ``` * @example * ```ts * app.deleteAllocation(1, 8).then((res) => console.log(res)) // res = Successfully deleted! * ``` */ deleteAllocation: (nodeId: number, allocationId: number) => Promise<string>; }