UNPKG

jspteroapi

Version:

A pterodactyl v1 api using undici

81 lines (80 loc) 3.04 kB
import { EditLocationOptions, Location, LocationAttributes, LocationFilterInput, LocationIncludeInput } from '../interfaces/Location'; import { Application } from '../index'; export declare class locationMethods { private readonly application; constructor(application: Application); /** * @internal */ private getLocations; /** * @param options - Include information about locations relationships * @param filter - Filter Location by specific fields and values * @returns Array of locations * @example * ```ts * const res = await app.getAllLocations() // res = Location[] * ``` * @example * ```ts * app.getAllLocations().then((res) => console.log(res)) // res = Location[] * ``` */ getAllLocations: (options?: LocationIncludeInput, filter?: LocationFilterInput) => Promise<Location[]>; /** * @param locationId - The location id to get information about * @param options - Include information about locations relationships * @returns Location information * @example * ```ts * const res = await app.getLocationInfo(1) // res = LocationAttributes * ``` * @example * ```ts * app.getLocationInfo(1).then((res) => console.log(res)) // res = LocationAttributes * ``` */ getLocationInfo: (locationId: number, options?: LocationIncludeInput) => Promise<LocationAttributes>; /** * @param shortName - The short name of the new location * @param description - The description of location * @param options - Include information about locations relationships * @returns Location information * @example * ```ts * const res = await app.createLocation('Home') // res = LocationAttributes * ``` * @example * ```ts * app.createLocation('Home').then((res) => console.log(res)) // res = LocationAttributes * ``` */ createLocation: (shortName: string, description?: string, options?: LocationIncludeInput) => Promise<LocationAttributes>; /** * @param locationId - The location id to edit * @param options - Location edit options * @returns Location information * @example * ```ts * const res = await app.editLocation(1, 'Homie') // res = LocationAttributes * ``` * @example * ```ts * app.editLocation(1, undefined, 'Very good locaiton').then((res) => console.log(res)) // res = LocationAttributes * ``` */ editLocation: (locationId: number, options: EditLocationOptions) => Promise<LocationAttributes>; /** * @param locationId - The location id to delete * @returns Successfully deleted the location! * @example * ```ts * const res = await app.deleteLocation(1) // res = Successfully deleted the location! * ``` * @example * ```ts * app.deleteLocation(1).then((res) => console.log(res)) // res = Successfully deleted the location! * ``` */ deleteLocation: (locationId: number) => Promise<string>; }