import { AxiosInstance, AxiosProgressEvent } from 'axios'; import z from 'zod'; import WebSocket from 'isomorphic-ws'; type ServerSignalOption = "start" | "stop" | "restart" | "kill"; type GenericResponse = { object: N; attributes: T; meta?: M; }; type PaginationMeta = { total: number; count: number; per_page: number; current_page: number; total_pages: number; links: unknown; }; type GenericListResponse = { object: "list"; data: T[]; meta?: { pagination: PaginationMeta; }; }; type CustomListResponse = { object: "list"; data: T[]; meta?: M; }; type ServerDatabase$1 = { id: string; host: { address: string; port: number; }; name: string; username: string; connections_from: string; max_connections: number; relationships?: { password: GenericResponse<{ password: string; }, "database_password">; }; }; type PartialBy = Omit & Partial>; type Nullable = T | null; /** * Server limits indicate how many resources can be used by the server */ type ServerLimits = { /** * Memory limit in megabytes, 0 = unlimited * @remarks * This is not a pterodactyl's MiB, it's a MB (multiple of 1000). * That means to set 8GB RAM, you should set 8000 instead of 8192 */ memory: number; /** * Swap limit in megabytes, 0 = disabled, -1 = unlimited * @see memory */ swap: number; /** * Disk limit in megabytes, 0 = unlimited * @see memory */ disk: number; /** * IO is an arbitrary value indicating IO importance relative to other servers */ io: number; /** * CPU limit in percentage, 0 = unlimited (1 core = 100%) */ cpu: number; /** * CPU pinning (Optional) * @usage * ``` * 1 or 1,2,4 or 1-4 * ``` * @remarks * Can be useful to pin workloads to P-cores and avoid E-cores or HT/SMT cores * @see https://superuser.com/questions/122536/what-is-hyper-threading-and-how-does-it-work */ threads: Nullable; /** * If OOM killer should be disabled, opposite of {@link oom_killer} * @deprecated use {@link oom_killer} */ oom_disabled: boolean; /** * If OOM killer should be enabled, opposite of {@link oom_disabled} */ oom_killer: boolean; }; /** * Feature limits indicate how many features can user enable by themselves. It doesn't include features assigned * by admins */ type FeatureLimits = { databases: number; allocations: number; backups: number; }; type StartupParams = { name: string; description: string; env_variables: string; default_value: string; server_value: string; is_editable: boolean; rules: string; }; type StartupMeta = { startup_command: string; raw_startup_command: string; }; type ServerBackup$1 = { uuid: string; is_successful: boolean; is_locked: boolean; name: string; ignored_files: string[]; checksum: Nullable; bytes: number; created_at: string; completed_at: Nullable; }; type EggVariable = { name: string; description: string; env_variable: string; default_value: string; server_value: string; is_editable: boolean; rules: string; }; type FileObject = { name: string; mode: string; mode_bits: string; size: number; is_file: boolean; is_symlink: boolean; mimetype: string; created_at: string; modified_at: string; }; type Schedule = { id: number; name: string; cron: { day_of_week: string; day_of_month: string; hour: string; minute: string; }; is_active: boolean; is_processing: boolean; only_when_online: boolean; last_run_at: Nullable; next_run_at: string; created_at: string; updated_at: string; relationships: { tasks: GenericListResponse>; }; }; type ScheduleTask = { id: number; sequence_id: number; action: "command" | "power" | "backup" | "delete_files"; payload: string; time_offset: number; is_queued: boolean; continue_on_failure: boolean; created_at: string; updated_at: Nullable; }; type SocketEventPayloadMap = { [SOCKET_EVENT.AUTH_SUCCESS]: undefined; [SOCKET_EVENT.STATUS]: PowerState; [SOCKET_EVENT.CONSOLE_OUTPUT]: string; [SOCKET_EVENT.STATS]: StatsWsJson; [SOCKET_EVENT.DAEMON_ERROR]: undefined; [SOCKET_EVENT.DAEMON_MESSAGE]: string; [SOCKET_EVENT.INSTALL_OUTPUT]: string; [SOCKET_EVENT.INSTALL_STARTED]: undefined; [SOCKET_EVENT.INSTALL_COMPLETED]: undefined; [SOCKET_EVENT.TRANSFER_LOGS]: string; [SOCKET_EVENT.TRANSFER_STATUS]: string; [SOCKET_EVENT.BACKUP_COMPLETED]: BackupCompletedJson; [SOCKET_EVENT.BACKUP_RESTORE_COMPLETED]: undefined; [SOCKET_EVENT.TOKEN_EXPIRING]: undefined; [SOCKET_EVENT.TOKEN_EXPIRED]: undefined; [SOCKET_EVENT.JWT_ERROR]: string; }; type Listener = SocketEventPayloadMap[E] extends undefined ? () => void : (payload: SocketEventPayloadMap[E]) => void; type CloseEventLike = Parameters>[0]; type ErrorEventLike = Parameters>[0]; declare class ServerWebsocket { private readonly r; private readonly serverId; private socket?; private currentToken?; private readonly bus; private debugLogging; private stripColors; private detachMessageListener?; constructor(requester: AxiosInstance, id: string, stripColors?: boolean); on(event: E, listener: Listener): () => void; deregister(event: E, listener: Listener): void; private emit; connect(resumable?: boolean, debugLogging?: boolean): Promise; onSocketDisconnect(handler: (event: CloseEventLike) => void): void; onSocketError(handler: (event: ErrorEventLike) => void): void; makeResumable(disconnectsToo: boolean): void; private attachMessageListener; private handleIncomingMessage; private parseMessage; private normalisePayload; private dispatchMessage; private refreshCredentials; private authenticate; disconnect(): void; requestStats(): void; requestLogs(): void; private send; getStats(): Promise; getLogs(): Promise; sendPoweraction(action: ServerSignalOption): void; sendCommand(cmd: string): void; } /** * Source: https://github.com/pterodactyl/panel/blob/1.0-develop/resources/scripts/components/server/events.ts */ declare enum SOCKET_EVENT { AUTH_SUCCESS = "auth success", DAEMON_MESSAGE = "daemon message", DAEMON_ERROR = "daemon error", INSTALL_OUTPUT = "install output", INSTALL_STARTED = "install started", INSTALL_COMPLETED = "install completed", CONSOLE_OUTPUT = "console output", STATUS = "status", STATS = "stats", TRANSFER_LOGS = "transfer logs", TRANSFER_STATUS = "transfer status", BACKUP_COMPLETED = "backup completed", BACKUP_RESTORE_COMPLETED = "backup restore completed", TOKEN_EXPIRING = "token expiring", TOKEN_EXPIRED = "token expired", JWT_ERROR = "jwt error" } type BackupCompletedJson = { checksum: string; checksum_type: "sha1"; file_size: number; is_successful: boolean; uuid: string; }; type PowerState = "starting" | "stopping" | "running" | "offline"; type StatsWsJson = { memory_bytes: number; memory_limit_bytes: number; cpu_absolute: number; network: { rx_bytes: number; tx_bytes: number; }; state: PowerState; uptime: number; disk_bytes: number; }; type ServerAllocation$1 = { id: number; ip: string; ip_alias: Nullable; port: number; notes: Nullable; is_default: boolean; }; type ServerSubuser = { uuid: string; username: string; email: string; language: string; image: string; admin: false; root_admin: false; "2fa_enabled": boolean; created_at: string; permissions: SubuserPermission[] | string[]; }; type SubuserPermission = "activity.read" | "allocation.create" | "allocation.delete" | "allocation.read" | "allocation.update" | "backup.create" | "backup.delete" | "backup.download" | "backup.read" | "backup.restore" | "control.console" | "control.restart" | "control.start" | "control.stop" | "database.create" | "database.delete" | "database.read" | "database.update" | "database.view-password" | "file.archive" | "file.create" | "file.delete" | "file.read" | "file.read-content" | "file.sftp" | "file.update" | "schedule.create" | "schedule.delete" | "schedule.read" | "schedule.update" | "settings.description" | "settings.reinstall" | "settings.rename" | "startup.docker-image" | "startup.read" | "startup.update" | "user.create" | "user.delete" | "user.read" | "user.update" | "websocket.connect"; type User = { uuid: string; username: string; email: string; language: string; image: string; admin: boolean; root_admin: boolean; "2fa_enabled": boolean; created_at: string; updated_at: string; }; type APIKey = { identifier: string; description: string; allowed_ips: string[]; last_used_at: Nullable; created_at: string; }; type SSHKey = { name: string; fingerprint: string; pubic_key: string; created_at: string; }; type Permission = { description: string; keys: Record; }; type Server$1 = { server_owner: boolean; identifier: string; internal_id?: number; uuid: string; name: string; node: string; is_node_under_maintenance: boolean; sftp_details: { ip: string; alias: Nullable; port: number; }; description: string; limits: ServerLimits; invocation: string; docker_image: string; egg_features: Nullable; feature_limits: FeatureLimits; status: Nullable; is_suspended: boolean; is_installing: boolean; is_transferring: boolean; relationships: { allocations: GenericListResponse>; variables: GenericListResponse>; egg?: GenericResponse<{ uuid: string; name: string; }, "egg">; subusers?: GenericListResponse>; }; }; type ServerStats = { current_state: "installing" | "install_failed" | "reinstall_failed" | "suspended" | "restoring_backup" | "running" | "stopped" | "offline"; is_suspended: boolean; resources: ServerResources; }; type ServerResources = { memory_bytes: number; cpu_absolute: number; disk_bytes: number; network_tx_bytes: number; network_rx_bytes: number; uptime: number; }; type ServerActivityLog = { id: string; event: string; is_api: boolean; ip: string; description: Nullable; properties: Record; has_additional_metadata: boolean; timestamp: string; relationships?: { actor?: GenericResponse | GenericResponse; }; }; declare class Account$1 { private readonly r; constructor(requester: AxiosInstance); info: () => Promise; updateEmail: (newEmail: string, password: string) => Promise; updatePassword: (currentPassword: string, newPassword: string) => Promise; apiKeys: { list: () => Promise; create: (description: string, allowed_ips?: string[]) => Promise; delete: (identifier: string) => Promise; }; sshKeys: { list: () => Promise; create: (name: string, public_key: string) => Promise; delete: (fingerprint: string) => Promise; }; } declare class ServerActivity { private readonly r; private readonly id; constructor(r: AxiosInstance, id: string); list: (page?: number, per_page?: number, opts?: { sortByTimestamp?: "asc" | "desc"; includeActor?: boolean; }) => Promise; } declare class ServerAllocations { private readonly r; private readonly id; constructor(requester: AxiosInstance, id: string); list: () => Promise; autoAssign: () => Promise; setNotes: (alloc_id: number, notes: string) => Promise; setPrimary: (alloc_id: number) => Promise; unassign: (alloc_id: number) => Promise; } declare class ServerBackups { private readonly r; private readonly id; constructor(requester: AxiosInstance, id: string); list: (page?: number) => Promise; create: (args: { name?: string; is_locked: boolean; ignored_files: string[]; }) => Promise; info: (backup_uuid: string) => Promise; downloadGetUrl: (backup_uuid: string) => Promise; download: (backup_uuid: string) => Promise; delete: (backup_uuid: string) => Promise; rename: (backup_uuid: string, name: string) => Promise; toggleLock: (backup_uuid: string) => Promise; restore: (backup_uuid: string, truncate: boolean) => Promise; } declare class ServerDatabases { private readonly r; private readonly id; constructor(requester: AxiosInstance, id: string); list: (include?: "password"[], page?: number) => Promise; create: (database: string, remote: string) => Promise; rotatePassword: (database_id: string) => Promise; delete: (database_id: string) => Promise; } declare class ServerFiles { private readonly r; private readonly id; constructor(requester: AxiosInstance, id: string); list: (path?: string) => Promise; /** * Return the contents of a file. To read binary file (non-editable) use {@link download} instead */ contents: (path: string) => Promise; downloadGetUrl: (path: string) => Promise; download: (path: string) => Promise; rename: (root: string | undefined, files: { from: string; to: string; }[]) => Promise; copy: (location: string) => Promise; write: (path: string, content: string) => Promise; compress: (root: string | undefined, files: string[], archive_name?: string, extension?: "zip" | "tgz" | "tar.gz" | "txz" | "tar.xz" | "tbz2" | "tar.bz2") => Promise; decompress: (root: string | undefined, file: string) => Promise; delete: (root: string | undefined, files: string[]) => Promise; createFolder: (root: string | undefined, name: string) => Promise; chmod: (root: string | undefined, files: Array<{ file: string; mode: number; }>) => Promise; pullFromRemote: (url: string, directory?: string, filename?: string, // Unused use_header?: boolean, // Unused foreground?: boolean) => Promise; uploadGetUrl: () => Promise; upload: (file: File, root?: string, opts?: { onUploadProgressRaw?: (progressEvent: AxiosProgressEvent) => void; onUploadProgressPercent?: (percent: number) => void; }) => Promise; } declare const ScheduleCreateParamsSchema: z.ZodObject<{ name: z.ZodString; is_active: z.ZodOptional; only_when_online: z.ZodOptional; minute: z.ZodString; hour: z.ZodString; day_of_week: z.ZodString; month: z.ZodString; day_of_month: z.ZodString; }, z.core.$strip>; type ScheduleCreateParams = z.infer; declare class ServerSchedules { private readonly r; private readonly id; constructor(requester: AxiosInstance, id: string); list: () => Promise; create: (params: ScheduleCreateParams) => Promise; control: (sched_id: number) => ScheduleControl; } declare class ScheduleControl { private r; private readonly id; private readonly sched_id; constructor(requester: AxiosInstance, id: string, sched_id: number); info: () => Promise; update: (params: ScheduleCreateParams) => Promise; delete: () => Promise; execute: () => Promise; tasks: { create: (opts: PartialBy, "payload" | "sequence_id" | "continue_on_failure">) => Promise; update: (task_id: number, opts: PartialBy, "payload" | "sequence_id" | "continue_on_failure">) => Promise; delete: (task_id: number) => Promise; }; } declare class ServerSettings { private readonly r; private readonly id; constructor(requester: AxiosInstance, id: string); rename: (name: string) => Promise; updateDescription: (description: Nullable) => Promise; reinstall: () => Promise; changeDockerImage: (image: string) => Promise; } declare class ServerStartup { private readonly r; private readonly id; constructor(requester: AxiosInstance, id: string); list: () => Promise>; set: (key: string, value: string) => Promise; } declare class ServerUsers { private readonly r; private readonly id; constructor(requester: AxiosInstance, id: string); list: () => Promise; create: (email: string, permissions: SubuserPermission[] | string[]) => Promise; info: (user_uuid: string) => Promise; update: (user_uuid: string, permissions: SubuserPermission[] | string[]) => Promise; delete: (user_uuid: string) => Promise; } declare class ServerClient { private readonly r; private readonly id; activity: ServerActivity; databases: ServerDatabases; files: ServerFiles; schedules: ServerSchedules; allocations: ServerAllocations; users: ServerUsers; backups: ServerBackups; startup: ServerStartup; variables: ServerStartup; settings: ServerSettings; constructor(requester: AxiosInstance, id: string); info: (include?: ("egg" | "subusers")[]) => Promise; websocket: (stripColors?: boolean) => ServerWebsocket; resources: () => Promise; command: (command: string) => Promise; power: (signal: "start" | "stop" | "restart" | "kill") => Promise; } declare class Client$1 { account: Account$1; private readonly r; constructor(requester: AxiosInstance); get $r(): AxiosInstance; listPermissions: () => Promise>; listServers: (type?: "accessible" | "mine" | "admin" | "admin-all", page?: number, per_page?: number, include?: ("egg" | "subusers")[]) => Promise; server: (uuid: string) => ServerClient; } /** * Instance of a Humane Pelican User * * @class * @example * You can create account from a raw client * ```ts * import {PelicanAPIClient} from "@pelican.ts/sdk/api" * const client = new PelicanAPIClient(...) * const userData = await client.account.info() * const account = new Account(client, userData) * ``` */ declare class Account { private readonly client; readonly uuid: string; readonly username: string; private $email; get email(): string; readonly language: string; readonly image: string; readonly admin: boolean; /** * Has currently no significance */ readonly root_admin: boolean; private $has2faEnabled; get has2faEnabled(): boolean; readonly createdAt: Date; readonly updatedAt: Date; constructor(client: Client$1, user: User); updateEmail: (newEmail: string, password: string) => Promise; updatePassword: (currentPassword: string, newPassword: string) => Promise; listApiKeys: () => Promise; createApiKey: (description: string, allowed_ips?: string[]) => Promise; deleteApiKey: (identifier: string) => Promise; listSshKeys: () => Promise; createSshKey: (name: string, public_key: string) => Promise; deleteSshKey: (fingerprint: string) => Promise; } /** * Instance of a Humane Pelican Server Allocation * * @class * @example * You can create allocation from a raw client * ```ts * import {PelicanAPIClient} from "@pelican.ts/sdk/api" * const client = new PelicanAPIClient(...) * const allocData = await client.account.server(...).allocations.list() * const alloc = new ServerAllocation(client, allocData[0]) * ``` */ declare class ServerAllocation { private readonly client; readonly alias: Nullable; readonly id: number; readonly ip: string; private $isDefault; get isDefault(): boolean; private $notes; get notes(): Nullable; readonly port: number; constructor(client: ServerClient, alloc: ServerAllocation$1); /** * Set description for this allocation * @param notes */ setNotes: (notes: string) => Promise; /** * Make port primary */ makeDefault: () => Promise; /** * Remove allocation (if user is allowed to manage allocations by themselves) */ unassign: () => Promise; } /** * Instance of a Humane Pelican Server Backup * * @class * @example * You can create account from a raw client * ```ts * import {PelicanAPIClient} from "@pelican.ts/sdk/api" * const client = new PelicanAPIClient(...) * const backupData = await client.account.server(...).backups.info(...) * const backup = new ServerBackup(client, backupData) * ``` */ declare class ServerBackup { private readonly client; readonly bytes: number; readonly checksum: Nullable; readonly completedAt: Nullable; readonly createdAt: Date; readonly ignoredFiles: string[]; readonly isLocked: boolean; readonly isSuccessful: boolean; readonly name: string; readonly uuid: string; constructor(client: ServerClient, backup: ServerBackup$1); downloadGetUrl: () => Promise; download: () => Promise; delete: () => Promise; rename: (name: string) => Promise; toggleLock: () => Promise; restore: (truncate: boolean) => Promise; } /** * Instance of a Humane Pelican Server Database * * @class * @example * You can create account from a raw client * ```ts * import {PelicanAPIClient} from "@pelican.ts/sdk/api" * const client = new PelicanAPIClient(...) * const dbData = await client.account.server(...).databases.info(...) * const database = new ServerDatabase(client, dbData) * ``` */ declare class ServerDatabase { private readonly client; readonly allowConnectionsFrom: string; readonly host: string; readonly port: number; readonly id: string; readonly maxConnections: number; readonly name: string; private $password?; get password(): string | undefined; readonly username: string; constructor(client: ServerClient, database: ServerDatabase$1); /** * Reset password to a random one, password will be updated in this ServerDatabase instance */ rotatePassword: () => Promise; delete: () => Promise; } /** * Instance of a Humane Pelican Server File/Folder * * @class * @example * You can create account from a raw client * ```ts * import {PelicanAPIClient} from "@pelican.ts/sdk/api" * const client = new PelicanAPIClient(...) * const filesData = await client.account.server(...).files.list(FOLDER) * const server = new ServerFile(client, filesData[0], FOLDER) * ``` */ declare class ServerFile { private readonly client; private readonly dir; private readonly path; readonly createdAt: Date; readonly isFile: boolean; readonly isSymlink: boolean; readonly mimetype: string; readonly mode: string; readonly modeBits: string; readonly modifiedAt: Date; readonly name: string; readonly size: number; constructor(client: ServerClient, file: FileObject, dir?: string); /** * Is this file an archive * * @remarks * It uses extension check instead of mimetype as Pelican currently has some issue with mimetypes */ get isArchive(): boolean; /** * Return the contents of a file. To read binary file (non-editable) use {@link download} instead */ contents: () => Promise; downloadGetUrl: () => Promise; download: () => Promise; rename: (newName: string) => Promise; copy: () => Promise; write: (content: string) => Promise; compress: (archive_name?: string, extension?: "zip" | "tgz" | "tar.gz" | "txz" | "tar.xz" | "tbz2" | "tar.bz2") => Promise; decompress: () => Promise; delete: () => Promise; chmod: (mode: number) => Promise; } /** * Instance of a Humane Pelican Server Schedule * * @class * @example * You can create account from a raw client * ```ts * import {PelicanAPIClient} from "@pelican.ts/sdk/api" * const client = new PelicanAPIClient(...) * const schedData = await client.account.server(...).schedules.list() * const server = new ServerSchedule(client, schedData[0]) * ``` */ declare class ServerSchedule { private readonly client; readonly createdAt: Date; private $cron; /** * CRON representation of schedule */ get cron(): { day_of_week: string; day_of_month: string; hour: string; minute: string; }; readonly id: number; private $isActive; /** * Is this schedule enabled */ get isActive(): boolean; private $isProcessing; /** * Is this schedule currently running */ get isProcessing(): boolean; readonly lastRunAt: Nullable; private $name; get name(): string; readonly nextRunAt: Date; private $onlyWhenOnline; /** * Should schedule run only if server is online */ get onlyWhenOnline(): boolean; readonly tasks: ServerScheduleTask[]; private $updatedAt; get updatedAt(): Date; constructor(client: ServerClient, schedule: Schedule); update: (opts: { name: string; is_active?: boolean; only_when_online?: boolean; minute: string; hour: string; day_of_week: string; month: string; day_of_month: string; }) => Promise; delete: () => Promise; execute: () => Promise; } declare class ServerScheduleTask { private readonly client; private readonly scheduleId; private $action; /** * Task action (command would likely need server to be online) */ get action(): "command" | "power" | "backup" | "delete_files"; private $continueOnFailure; /** * Should we fail on error or continue with other tasks? */ get continueOnFailure(): boolean; readonly createdAt: Date; readonly id: number; private $isQueued; /** * Is this task queued right now? */ get isQueued(): boolean; private $payload; /** * Whatever task should do: command to execute, power action or list of files to backup */ get payload(): string; private $sequenceId; /** * Order of this task in defined schedule */ get sequenceId(): number; private $timeOffset; /** * Time offset in seconds relative to schedule start time */ get timeOffset(): number; private $updatedAt; get updatedAt(): Nullable; constructor(client: ServerClient, scheduleId: number, task: ScheduleTask); delete: () => Promise; update: (opts: PartialBy, "payload" | "sequence_id" | "continue_on_failure">) => Promise; } /** * Instance of a Humane Pelican Server Subuser * * @class * @example * You can create account from a raw client * ```ts * import {PelicanAPIClient} from "@pelican.ts/sdk/api" * const client = new PelicanAPIClient(...) * const userData = await client.account.server(...).users.info(...) * const user = new ServerUser(client, userData) * ``` */ declare class ServerUser { private readonly client; readonly uuid: string; readonly username: string; readonly email: string; readonly language: string; readonly image: string; readonly admin: boolean; /** * Currently unused * @deprecated */ readonly root_admin: boolean; readonly has2faEnabled: boolean; readonly createdAt: Date; private $permissions; get permissions(): string[] | SubuserPermission[]; constructor(client: ServerClient, user: ServerSubuser); update: (permissions: SubuserPermission[] | string[]) => Promise; delete: () => Promise; } /** * Instance of a Humane Pelican Server * * @class * @example * You can create server from a raw client * ```ts * import {PelicanAPIClient} from "@pelican.ts/sdk/api" * const client = new PelicanAPIClient(...) * const serverData = await client.account.server(...).info() * const server = new Server(client, serverData) * ``` */ declare class Server { private readonly client; /** * Whether the user owns the server * * @remarks * Useful for gatekeeping features from subusers */ readonly ownsServer: boolean; readonly identifier: string; /** * ID used by Pelican Application API */ readonly internalId?: number; readonly uuid: string; private $name; get name(): string; /** * Node name used by this server * @remarks * This is the name of the node used by this server, not the ID */ readonly node: string; readonly isNodeUnderMaintenance: boolean; readonly sftp: { ip: string; alias: Nullable; port: number; }; private $description; get description(): string; readonly limits: ServerLimits; /** * It's a Startup command used to start the server */ readonly invocation: string; private $dockerImage; get dockerImage(): string; readonly eggFeatures: Nullable; readonly featureLimits: FeatureLimits; readonly status: unknown; readonly isSuspended: boolean; readonly isInstalling: boolean; readonly isTransferring: boolean; readonly allocations: ServerAllocation[]; /** * Egg variables */ readonly variables: EggVariable[]; /** * Egg used by this server, available only if request had include=egg */ readonly egg?: { uuid: string; name: string; }; /** * Server subusers, available only if request had include=subusers */ readonly subusers?: ServerUser[]; constructor(client: ServerClient, server: Server$1); rename: (name: string) => Promise; updateDescription: (description: string) => Promise; reinstall: () => Promise; changeDockerImage: (image: string) => Promise; getActivityLogs: (opts?: { page?: number; per_page?: number; sortByTimestamp?: "asc" | "desc"; includeActor?: boolean; }) => Promise; websocket: (stripColors?: boolean) => ServerWebsocket; getServerStats: () => Promise; runCommand: (command: string) => Promise; sendPowerSignal: (signal: "start" | "stop" | "restart" | "kill") => Promise; getDatabases: (opts?: { include?: "password"[]; page?: number; }) => Promise; /** * Create a database * @param database - optional database name (leave blank for autogenerated) * @param remote - allow connections from (ip, % or anything db-wise) * * @remarks * I have no idea why API endpoint doesn't allow to select database host */ createDatabase: (database: string, remote: string) => Promise; getSchedules: () => Promise; createSchedule: (...opts: Parameters) => Promise; getBackups: (page?: number) => Promise; createBackup: (...args: Parameters) => Promise; getAllocations: () => Promise; /** * Create new allocation (if user is allowed to manage allocations by themselves) */ createAllocation: () => Promise; getFiles: (path?: string) => Promise; createFolder: (...opts: Parameters) => Promise; uploadFile: (...opts: Parameters) => Promise; uploadFileGetUrl: (...opts: Parameters) => Promise; /** * Make wings agent download file or archive folder from specified URL instead of uploading directly */ pullFileFromRemote: (...opts: Parameters) => Promise; compressMultipleFiles: (...opts: Parameters) => Promise; renameMultipleFiles: (...opts: Parameters) => Promise; deleteMultipleFiles: (...opts: Parameters) => Promise; getUsers: () => Promise; /** * Create a subuser * @param email * @param permissions */ createUser: (email: string, permissions: SubuserPermission[] | string[]) => Promise; /** * Get server egg variables and startup commands */ getStartupInfo: () => Promise>; setStartupVariable: (key: string, value: string) => Promise; } /** * Pelican User Client * * @class * @param client Pelican API Client */ declare class Client { private readonly client; constructor(client: Client$1); /** * Get raw API client */ get $client(): Client$1; /** * Get user account */ getAccount: () => Promise; /** * Get subuser (current user) permissions * * Return data is not compatible with subusers API */ listPermissions: () => Promise>; /** * List servers * * @param opts Filtering options (all optional) * * @remarks * `type` — Server access type (Default: accessible) * * Variants: * - `accessible` — your servers and servers you have access to as a subuser * - `mine` — only your servers * - `admin` — only servers you have admin access to (excluding yours) * - `admin-all` — all servers you have admin access to */ listServers: (opts?: { type?: "accessible" | "mine" | "admin" | "admin-all"; page?: number; per_page?: number; include?: ("egg" | "subusers")[]; }) => Promise; /** * Get server by UUID * * @param uuid Server UUID * @param include Include additional data */ getServer: (uuid: string, include?: ("egg" | "subusers")[]) => Promise; } /** * Creates a Humane Pelican User client * @param url Pelican Panel URL (ex: https://demo.pelican.dev) * @param token Pelican User Token (`pacc...`) * @param suffix API suffix, used if you expose api on a different path */ declare const createPelicanClient: (url: string, token: string, suffix?: string, timeout?: number) => Client; export { Account, Client, Server, ServerAllocation, ServerBackup, ServerDatabase, ServerFile, ServerSchedule, ServerUser, createPelicanClient };